(window["webpackJsonp"] = window["webpackJsonp"] || []).push([[1],{ /***/ "./node_modules/@emotion/is-prop-valid/dist/emotion-is-prop-valid.browser.cjs.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, '__esModule', { value: true }); var memoize = __webpack_require__("./node_modules/@emotion/memoize/dist/emotion-memoize.browser.cjs.js"); function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; } var memoize__default = /*#__PURE__*/_interopDefault(memoize); var reactPropsRegex = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/; // https://esbench.com/bench/5bfee68a4cd7e6009ef61d23 var isPropValid = /* #__PURE__ */memoize__default['default'](function (prop) { return reactPropsRegex.test(prop) || prop.charCodeAt(0) === 111 /* o */ && prop.charCodeAt(1) === 110 /* n */ && prop.charCodeAt(2) < 91; } /* Z+1 */ ); exports.default = isPropValid; /***/ }), /***/ "./node_modules/@emotion/memoize/dist/emotion-memoize.browser.cjs.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, '__esModule', { value: true }); function memoize(fn) { var cache = Object.create(null); return function (arg) { if (cache[arg] === undefined) cache[arg] = fn(arg); return cache[arg]; }; } exports.default = memoize; /***/ }), /***/ "./node_modules/@emotion/stylis/dist/stylis.browser.cjs.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, '__esModule', { value: true }); function stylis_min (W) { function M(d, c, e, h, a) { for (var m = 0, b = 0, v = 0, n = 0, q, g, x = 0, K = 0, k, u = k = q = 0, l = 0, r = 0, I = 0, t = 0, B = e.length, J = B - 1, y, f = '', p = '', F = '', G = '', C; l < B;) { g = e.charCodeAt(l); l === J && 0 !== b + n + v + m && (0 !== b && (g = 47 === b ? 10 : 47), n = v = m = 0, B++, J++); if (0 === b + n + v + m) { if (l === J && (0 < r && (f = f.replace(N, '')), 0 < f.trim().length)) { switch (g) { case 32: case 9: case 59: case 13: case 10: break; default: f += e.charAt(l); } g = 59; } switch (g) { case 123: f = f.trim(); q = f.charCodeAt(0); k = 1; for (t = ++l; l < B;) { switch (g = e.charCodeAt(l)) { case 123: k++; break; case 125: k--; break; case 47: switch (g = e.charCodeAt(l + 1)) { case 42: case 47: a: { for (u = l + 1; u < J; ++u) { switch (e.charCodeAt(u)) { case 47: if (42 === g && 42 === e.charCodeAt(u - 1) && l + 2 !== u) { l = u + 1; break a; } break; case 10: if (47 === g) { l = u + 1; break a; } } } l = u; } } break; case 91: g++; case 40: g++; case 34: case 39: for (; l++ < J && e.charCodeAt(l) !== g;) { } } if (0 === k) break; l++; } k = e.substring(t, l); 0 === q && (q = (f = f.replace(ca, '').trim()).charCodeAt(0)); switch (q) { case 64: 0 < r && (f = f.replace(N, '')); g = f.charCodeAt(1); switch (g) { case 100: case 109: case 115: case 45: r = c; break; default: r = O; } k = M(c, r, k, g, a + 1); t = k.length; 0 < A && (r = X(O, f, I), C = H(3, k, r, c, D, z, t, g, a, h), f = r.join(''), void 0 !== C && 0 === (t = (k = C.trim()).length) && (g = 0, k = '')); if (0 < t) switch (g) { case 115: f = f.replace(da, ea); case 100: case 109: case 45: k = f + '{' + k + '}'; break; case 107: f = f.replace(fa, '$1 $2'); k = f + '{' + k + '}'; k = 1 === w || 2 === w && L('@' + k, 3) ? '@-webkit-' + k + '@' + k : '@' + k; break; default: k = f + k, 112 === h && (k = (p += k, '')); } else k = ''; break; default: k = M(c, X(c, f, I), k, h, a + 1); } F += k; k = I = r = u = q = 0; f = ''; g = e.charCodeAt(++l); break; case 125: case 59: f = (0 < r ? f.replace(N, '') : f).trim(); if (1 < (t = f.length)) switch (0 === u && (q = f.charCodeAt(0), 45 === q || 96 < q && 123 > q) && (t = (f = f.replace(' ', ':')).length), 0 < A && void 0 !== (C = H(1, f, c, d, D, z, p.length, h, a, h)) && 0 === (t = (f = C.trim()).length) && (f = '\x00\x00'), q = f.charCodeAt(0), g = f.charCodeAt(1), q) { case 0: break; case 64: if (105 === g || 99 === g) { G += f + e.charAt(l); break; } default: 58 !== f.charCodeAt(t - 1) && (p += P(f, q, g, f.charCodeAt(2))); } I = r = u = q = 0; f = ''; g = e.charCodeAt(++l); } } switch (g) { case 13: case 10: 47 === b ? b = 0 : 0 === 1 + q && 107 !== h && 0 < f.length && (r = 1, f += '\x00'); 0 < A * Y && H(0, f, c, d, D, z, p.length, h, a, h); z = 1; D++; break; case 59: case 125: if (0 === b + n + v + m) { z++; break; } default: z++; y = e.charAt(l); switch (g) { case 9: case 32: if (0 === n + m + b) switch (x) { case 44: case 58: case 9: case 32: y = ''; break; default: 32 !== g && (y = ' '); } break; case 0: y = '\\0'; break; case 12: y = '\\f'; break; case 11: y = '\\v'; break; case 38: 0 === n + b + m && (r = I = 1, y = '\f' + y); break; case 108: if (0 === n + b + m + E && 0 < u) switch (l - u) { case 2: 112 === x && 58 === e.charCodeAt(l - 3) && (E = x); case 8: 111 === K && (E = K); } break; case 58: 0 === n + b + m && (u = l); break; case 44: 0 === b + v + n + m && (r = 1, y += '\r'); break; case 34: case 39: 0 === b && (n = n === g ? 0 : 0 === n ? g : n); break; case 91: 0 === n + b + v && m++; break; case 93: 0 === n + b + v && m--; break; case 41: 0 === n + b + m && v--; break; case 40: if (0 === n + b + m) { if (0 === q) switch (2 * x + 3 * K) { case 533: break; default: q = 1; } v++; } break; case 64: 0 === b + v + n + m + u + k && (k = 1); break; case 42: case 47: if (!(0 < n + m + v)) switch (b) { case 0: switch (2 * g + 3 * e.charCodeAt(l + 1)) { case 235: b = 47; break; case 220: t = l, b = 42; } break; case 42: 47 === g && 42 === x && t + 2 !== l && (33 === e.charCodeAt(t + 2) && (p += e.substring(t, l + 1)), y = '', b = 0); } } 0 === b && (f += y); } K = x; x = g; l++; } t = p.length; if (0 < t) { r = c; if (0 < A && (C = H(2, p, r, d, D, z, t, h, a, h), void 0 !== C && 0 === (p = C).length)) return G + p + F; p = r.join(',') + '{' + p + '}'; if (0 !== w * E) { 2 !== w || L(p, 2) || (E = 0); switch (E) { case 111: p = p.replace(ha, ':-moz-$1') + p; break; case 112: p = p.replace(Q, '::-webkit-input-$1') + p.replace(Q, '::-moz-$1') + p.replace(Q, ':-ms-input-$1') + p; } E = 0; } } return G + p + F; } function X(d, c, e) { var h = c.trim().split(ia); c = h; var a = h.length, m = d.length; switch (m) { case 0: case 1: var b = 0; for (d = 0 === m ? '' : d[0] + ' '; b < a; ++b) { c[b] = Z(d, c[b], e).trim(); } break; default: var v = b = 0; for (c = []; b < a; ++b) { for (var n = 0; n < m; ++n) { c[v++] = Z(d[n] + ' ', h[b], e).trim(); } } } return c; } function Z(d, c, e) { var h = c.charCodeAt(0); 33 > h && (h = (c = c.trim()).charCodeAt(0)); switch (h) { case 38: return c.replace(F, '$1' + d.trim()); case 58: return d.trim() + c.replace(F, '$1' + d.trim()); default: if (0 < 1 * e && 0 < c.indexOf('\f')) return c.replace(F, (58 === d.charCodeAt(0) ? '' : '$1') + d.trim()); } return d + c; } function P(d, c, e, h) { var a = d + ';', m = 2 * c + 3 * e + 4 * h; if (944 === m) { d = a.indexOf(':', 9) + 1; var b = a.substring(d, a.length - 1).trim(); b = a.substring(0, d).trim() + b + ';'; return 1 === w || 2 === w && L(b, 1) ? '-webkit-' + b + b : b; } if (0 === w || 2 === w && !L(a, 1)) return a; switch (m) { case 1015: return 97 === a.charCodeAt(10) ? '-webkit-' + a + a : a; case 951: return 116 === a.charCodeAt(3) ? '-webkit-' + a + a : a; case 963: return 110 === a.charCodeAt(5) ? '-webkit-' + a + a : a; case 1009: if (100 !== a.charCodeAt(4)) break; case 969: case 942: return '-webkit-' + a + a; case 978: return '-webkit-' + a + '-moz-' + a + a; case 1019: case 983: return '-webkit-' + a + '-moz-' + a + '-ms-' + a + a; case 883: if (45 === a.charCodeAt(8)) return '-webkit-' + a + a; if (0 < a.indexOf('image-set(', 11)) return a.replace(ja, '$1-webkit-$2') + a; break; case 932: if (45 === a.charCodeAt(4)) switch (a.charCodeAt(5)) { case 103: return '-webkit-box-' + a.replace('-grow', '') + '-webkit-' + a + '-ms-' + a.replace('grow', 'positive') + a; case 115: return '-webkit-' + a + '-ms-' + a.replace('shrink', 'negative') + a; case 98: return '-webkit-' + a + '-ms-' + a.replace('basis', 'preferred-size') + a; } return '-webkit-' + a + '-ms-' + a + a; case 964: return '-webkit-' + a + '-ms-flex-' + a + a; case 1023: if (99 !== a.charCodeAt(8)) break; b = a.substring(a.indexOf(':', 15)).replace('flex-', '').replace('space-between', 'justify'); return '-webkit-box-pack' + b + '-webkit-' + a + '-ms-flex-pack' + b + a; case 1005: return ka.test(a) ? a.replace(aa, ':-webkit-') + a.replace(aa, ':-moz-') + a : a; case 1e3: b = a.substring(13).trim(); c = b.indexOf('-') + 1; switch (b.charCodeAt(0) + b.charCodeAt(c)) { case 226: b = a.replace(G, 'tb'); break; case 232: b = a.replace(G, 'tb-rl'); break; case 220: b = a.replace(G, 'lr'); break; default: return a; } return '-webkit-' + a + '-ms-' + b + a; case 1017: if (-1 === a.indexOf('sticky', 9)) break; case 975: c = (a = d).length - 10; b = (33 === a.charCodeAt(c) ? a.substring(0, c) : a).substring(d.indexOf(':', 7) + 1).trim(); switch (m = b.charCodeAt(0) + (b.charCodeAt(7) | 0)) { case 203: if (111 > b.charCodeAt(8)) break; case 115: a = a.replace(b, '-webkit-' + b) + ';' + a; break; case 207: case 102: a = a.replace(b, '-webkit-' + (102 < m ? 'inline-' : '') + 'box') + ';' + a.replace(b, '-webkit-' + b) + ';' + a.replace(b, '-ms-' + b + 'box') + ';' + a; } return a + ';'; case 938: if (45 === a.charCodeAt(5)) switch (a.charCodeAt(6)) { case 105: return b = a.replace('-items', ''), '-webkit-' + a + '-webkit-box-' + b + '-ms-flex-' + b + a; case 115: return '-webkit-' + a + '-ms-flex-item-' + a.replace(ba, '') + a; default: return '-webkit-' + a + '-ms-flex-line-pack' + a.replace('align-content', '').replace(ba, '') + a; } break; case 973: case 989: if (45 !== a.charCodeAt(3) || 122 === a.charCodeAt(4)) break; case 931: case 953: if (!0 === la.test(d)) return 115 === (b = d.substring(d.indexOf(':') + 1)).charCodeAt(0) ? P(d.replace('stretch', 'fill-available'), c, e, h).replace(':fill-available', ':stretch') : a.replace(b, '-webkit-' + b) + a.replace(b, '-moz-' + b.replace('fill-', '')) + a; break; case 962: if (a = '-webkit-' + a + (102 === a.charCodeAt(5) ? '-ms-' + a : '') + a, 211 === e + h && 105 === a.charCodeAt(13) && 0 < a.indexOf('transform', 10)) return a.substring(0, a.indexOf(';', 27) + 1).replace(ma, '$1-webkit-$2') + a; } return a; } function L(d, c) { var e = d.indexOf(1 === c ? ':' : '{'), h = d.substring(0, 3 !== c ? e : 10); e = d.substring(e + 1, d.length - 1); return R(2 !== c ? h : h.replace(na, '$1'), e, c); } function ea(d, c) { var e = P(c, c.charCodeAt(0), c.charCodeAt(1), c.charCodeAt(2)); return e !== c + ';' ? e.replace(oa, ' or ($1)').substring(4) : '(' + c + ')'; } function H(d, c, e, h, a, m, b, v, n, q) { for (var g = 0, x = c, w; g < A; ++g) { switch (w = S[g].call(B, d, x, e, h, a, m, b, v, n, q)) { case void 0: case !1: case !0: case null: break; default: x = w; } } if (x !== c) return x; } function T(d) { switch (d) { case void 0: case null: A = S.length = 0; break; default: if ('function' === typeof d) S[A++] = d;else if ('object' === typeof d) for (var c = 0, e = d.length; c < e; ++c) { T(d[c]); } else Y = !!d | 0; } return T; } function U(d) { d = d.prefix; void 0 !== d && (R = null, d ? 'function' !== typeof d ? w = 1 : (w = 2, R = d) : w = 0); return U; } function B(d, c) { var e = d; 33 > e.charCodeAt(0) && (e = e.trim()); V = e; e = [V]; if (0 < A) { var h = H(-1, c, e, e, D, z, 0, 0, 0, 0); void 0 !== h && 'string' === typeof h && (c = h); } var a = M(O, e, c, 0, 0); 0 < A && (h = H(-2, a, e, e, D, z, a.length, 0, 0, 0), void 0 !== h && (a = h)); V = ''; E = 0; z = D = 1; return a; } var ca = /^\0+/g, N = /[\0\r\f]/g, aa = /: */g, ka = /zoo|gra/, ma = /([,: ])(transform)/g, ia = /,\r+?/g, F = /([\t\r\n ])*\f?&/g, fa = /@(k\w+)\s*(\S*)\s*/, Q = /::(place)/g, ha = /:(read-only)/g, G = /[svh]\w+-[tblr]{2}/, da = /\(\s*(.*)\s*\)/g, oa = /([\s\S]*?);/g, ba = /-self|flex-/g, na = /[^]*?(:[rp][el]a[\w-]+)[^]*/, la = /stretch|:\s*\w+\-(?:conte|avail)/, ja = /([^-])(image-set\()/, z = 1, D = 1, E = 0, w = 1, O = [], S = [], A = 0, R = null, Y = 0, V = ''; B.use = T; B.set = U; void 0 !== W && U(W); return B; } exports.default = stylis_min; /***/ }), /***/ "./node_modules/@emotion/unitless/dist/unitless.browser.cjs.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, '__esModule', { value: true }); var unitlessKeys = { animationIterationCount: 1, borderImageOutset: 1, borderImageSlice: 1, borderImageWidth: 1, boxFlex: 1, boxFlexGroup: 1, boxOrdinalGroup: 1, columnCount: 1, columns: 1, flex: 1, flexGrow: 1, flexPositive: 1, flexShrink: 1, flexNegative: 1, flexOrder: 1, gridRow: 1, gridRowEnd: 1, gridRowSpan: 1, gridRowStart: 1, gridColumn: 1, gridColumnEnd: 1, gridColumnSpan: 1, gridColumnStart: 1, msGridRow: 1, msGridRowSpan: 1, msGridColumn: 1, msGridColumnSpan: 1, fontWeight: 1, lineHeight: 1, opacity: 1, order: 1, orphans: 1, tabSize: 1, widows: 1, zIndex: 1, zoom: 1, WebkitLineClamp: 1, // SVG-related properties fillOpacity: 1, floodOpacity: 1, stopOpacity: 1, strokeDasharray: 1, strokeDashoffset: 1, strokeMiterlimit: 1, strokeOpacity: 1, strokeWidth: 1 }; exports.default = unitlessKeys; /***/ }), /***/ "./node_modules/ag-grid-community/dist/ag-grid-community.cjs.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; /* WEBPACK VAR INJECTION */(function(global) {/** * ag-grid-community - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ ' * @license MIT */ Object.defineProperty(exports, '__esModule', { value: true }); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ /** * If value is undefined, null or blank, returns null, otherwise returns the value * @param {T} value * @returns {T | null} */ function makeNull(value) { if (value == null || value === '') { return null; } return value; } function exists(value, allowEmptyString) { if (allowEmptyString === void 0) { allowEmptyString = false; } return value != null && (value !== '' || allowEmptyString); } function missing(value) { return !exists(value); } function missingOrEmpty(value) { return value == null || value.length === 0; } function toStringOrNull(value) { return value != null && typeof value.toString === 'function' ? value.toString() : null; } // for parsing html attributes, where we want empty strings and missing attributes to be undefined function attrToNumber(value) { if (value === undefined) { // undefined or empty means ignore the value return; } if (value === null || value === '') { // null or blank means clear return null; } if (typeof value === 'number') { return isNaN(value) ? undefined : value; } var valueParsed = parseInt(value, 10); return isNaN(valueParsed) ? undefined : valueParsed; } // for parsing html attributes, where we want empty strings and missing attributes to be undefined function attrToBoolean(value) { if (value === undefined) { // undefined or empty means ignore the value return; } if (value === null || value === '') { // null means clear return false; } if (typeof value === 'boolean') { // if simple boolean, return the boolean return value; } // if equal to the string 'true' (ignoring case) then return true return (/true/i).test(value); } // for parsing html attributes, where we want empty strings and missing attributes to be undefined function attrToString(value) { if (value == null || value === '') { return; } return value; } /** @deprecated */ function referenceCompare(left, right) { if (left == null && right == null) { return true; } if (left == null && right != null) { return false; } if (left != null && right == null) { return false; } return left === right; } function jsonEquals(val1, val2) { var val1Json = val1 ? JSON.stringify(val1) : null; var val2Json = val2 ? JSON.stringify(val2) : null; return val1Json === val2Json; } function defaultComparator(valueA, valueB, accentedCompare) { if (accentedCompare === void 0) { accentedCompare = false; } var valueAMissing = valueA == null; var valueBMissing = valueB == null; // this is for aggregations sum and avg, where the result can be a number that is wrapped. // if we didn't do this, then the toString() value would be used, which would result in // the strings getting used instead of the numbers. if (valueA && valueA.toNumber) { valueA = valueA.toNumber(); } if (valueB && valueB.toNumber) { valueB = valueB.toNumber(); } if (valueAMissing && valueBMissing) { return 0; } if (valueAMissing) { return -1; } if (valueBMissing) { return 1; } function doQuickCompare(a, b) { return (a > b ? 1 : (a < b ? -1 : 0)); } if (typeof valueA !== 'string') { return doQuickCompare(valueA, valueB); } if (!accentedCompare) { return doQuickCompare(valueA, valueB); } try { // using local compare also allows chinese comparisons return valueA.localeCompare(valueB); } catch (e) { // if something wrong with localeCompare, eg not supported // by browser, then just continue with the quick one return doQuickCompare(valueA, valueB); } } function values(object) { if (object instanceof Set || object instanceof Map) { var arr_1 = []; object.forEach(function (value) { return arr_1.push(value); }); return arr_1; } return Object.values(object); } var GenericUtils = /*#__PURE__*/Object.freeze({ makeNull: makeNull, exists: exists, missing: missing, missingOrEmpty: missingOrEmpty, toStringOrNull: toStringOrNull, attrToNumber: attrToNumber, attrToBoolean: attrToBoolean, attrToString: attrToString, referenceCompare: referenceCompare, jsonEquals: jsonEquals, defaultComparator: defaultComparator, values: values }); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var ColumnKeyCreator = /** @class */ (function () { function ColumnKeyCreator() { this.existingKeys = {}; } ColumnKeyCreator.prototype.addExistingKeys = function (keys) { for (var i = 0; i < keys.length; i++) { this.existingKeys[keys[i]] = true; } }; ColumnKeyCreator.prototype.getUniqueKey = function (colId, colField) { // in case user passed in number for colId, convert to string colId = toStringOrNull(colId); var count = 0; while (true) { var idToTry = void 0; if (colId) { idToTry = colId; if (count !== 0) { idToTry += '_' + count; } } else if (colField) { idToTry = colField; if (count !== 0) { idToTry += '_' + count; } } else { idToTry = '' + count; } if (!this.existingKeys[idToTry]) { this.existingKeys[idToTry] = true; return idToTry; } count++; } }; return ColumnKeyCreator; }()); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ function iterateObject(object, callback) { if (object == null) { return; } if (Array.isArray(object)) { object.forEach(function (value, index) { return callback("" + index, value); }); } else { Object.keys(object).forEach(function (key) { return callback(key, object[key]); }); } } function cloneObject(object) { var copy = {}; var keys = Object.keys(object); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = object[key]; copy[key] = value; } return copy; } function deepCloneObject(object) { return JSON.parse(JSON.stringify(object)); } // returns copy of an object, doing a deep clone of any objects with that object. // this is used for eg creating copies of Column Definitions, where we want to // deep copy all objects, but do not want to deep copy functions (eg when user provides // a function or class for colDef.cellRenderer) function deepCloneDefinition(object, keysToSkip) { if (!object) { return; } var obj = object; var res = {}; Object.keys(obj).forEach(function (key) { if (keysToSkip && keysToSkip.indexOf(key) >= 0) { return; } var value = obj[key]; // 'simple object' means a bunch of key/value pairs, eg {filter: 'myFilter'}. it does // NOT include the following: // 1) arrays // 2) functions or classes (eg ColumnAPI instance) var sourceIsSimpleObject = isNonNullObject(value) && value.constructor === Object; if (sourceIsSimpleObject) { res[key] = deepCloneDefinition(value); } else { res[key] = value; } }); return res; } function getProperty(object, key) { return object[key]; } function setProperty(object, key, value) { object[key] = value; } /** * Will copy the specified properties from `source` into the equivalent properties on `target`, ignoring properties with * a value of `undefined`. */ function copyPropertiesIfPresent(source, target) { var properties = []; for (var _i = 2; _i < arguments.length; _i++) { properties[_i - 2] = arguments[_i]; } properties.forEach(function (p) { return copyPropertyIfPresent(source, target, p); }); } /** * Will copy the specified property from `source` into the equivalent property on `target`, unless the property has a * value of `undefined`. If a transformation is provided, it will be applied to the value before being set on `target`. */ function copyPropertyIfPresent(source, target, property, transform) { var value = getProperty(source, property); if (value !== undefined) { setProperty(target, property, transform ? transform(value) : value); } } function getAllKeysInObjects(objects) { var allValues = {}; objects.filter(function (obj) { return obj != null; }).forEach(function (obj) { Object.keys(obj).forEach(function (key) { return allValues[key] = null; }); }); return Object.keys(allValues); } function getAllValuesInObject(obj) { if (!obj) { return []; } var anyObject = Object; if (typeof anyObject.values === 'function') { return anyObject.values(obj); } var ret = []; for (var key in obj) { if (obj.hasOwnProperty(key) && obj.propertyIsEnumerable(key)) { ret.push(obj[key]); } } return ret; } function mergeDeep(dest, source, copyUndefined, makeCopyOfSimpleObjects) { if (copyUndefined === void 0) { copyUndefined = true; } if (makeCopyOfSimpleObjects === void 0) { makeCopyOfSimpleObjects = false; } if (!exists(source)) { return; } iterateObject(source, function (key, sourceValue) { var destValue = dest[key]; if (destValue === sourceValue) { return; } // when creating params, we don't want to just copy objects over. otherwise merging ColDefs (eg DefaultColDef // and Column Types) would result in params getting shared between objects. // by putting an empty value into destValue first, it means we end up copying over values from // the source object, rather than just copying in the source object in it's entirety. if (makeCopyOfSimpleObjects) { var objectIsDueToBeCopied = destValue == null && sourceValue != null; if (objectIsDueToBeCopied) { // 'simple object' means a bunch of key/value pairs, eg {filter: 'myFilter'}, as opposed // to a Class instance (such as ColumnAPI instance). var sourceIsSimpleObject = typeof sourceValue === 'object' && sourceValue.constructor === Object; var dontCopy = sourceIsSimpleObject; if (dontCopy) { destValue = {}; dest[key] = destValue; } } } if (isNonNullObject(sourceValue) && isNonNullObject(destValue) && !Array.isArray(destValue)) { mergeDeep(destValue, sourceValue, copyUndefined, makeCopyOfSimpleObjects); } else if (copyUndefined || sourceValue !== undefined) { dest[key] = sourceValue; } }); } function missingOrEmptyObject(value) { return missing(value) || Object.keys(value).length === 0; } function get(source, expression, defaultValue) { if (source == null) { return defaultValue; } var keys = expression.split('.'); var objectToRead = source; while (keys.length > 1) { objectToRead = objectToRead[keys.shift()]; if (objectToRead == null) { return defaultValue; } } var value = objectToRead[keys[0]]; return value != null ? value : defaultValue; } function set(target, expression, value) { if (target == null) { return; } var keys = expression.split('.'); var objectToUpdate = target; // Create empty objects keys.forEach(function (key, i) { if (!objectToUpdate[key]) { objectToUpdate[key] = {}; } if (i < keys.length - 1) { objectToUpdate = objectToUpdate[key]; } }); objectToUpdate[keys[keys.length - 1]] = value; } function getValueUsingField(data, field, fieldContainsDots) { if (!field || !data) { return; } // if no '.', then it's not a deep value if (!fieldContainsDots) { return data[field]; } // otherwise it is a deep value, so need to dig for it var fields = field.split('.'); var currentObject = data; for (var i = 0; i < fields.length; i++) { if (currentObject == null) { return undefined; } currentObject = currentObject[fields[i]]; } return currentObject; } // used by ColumnAPI and GridAPI to remove all references, so keeping grid in memory resulting in a // memory leak if user is not disposing of the GridAPI or ColumnApi references function removeAllReferences(obj, objectName) { Object.keys(obj).forEach(function (key) { var value = obj[key]; // we want to replace all the @autowired services, which are objects. any simple types (boolean, string etc) // we don't care about if (typeof value === 'object') { obj[key] = undefined; } }); var proto = Object.getPrototypeOf(obj); var properties = {}; Object.keys(proto).forEach(function (key) { var value = proto[key]; // leave all basic types - this is needed for GridAPI to leave the "destroyed: boolean" attribute alone if (typeof value === 'function') { var func = function () { console.warn("AG Grid: " + objectName + " function " + key + "() cannot be called as the grid has been destroyed.\n Please don't call grid API functions on destroyed grids - as a matter of fact you shouldn't\n be keeping the API reference, your application has a memory leak! Remove the API reference\n when the grid is destroyed."); }; properties[key] = { value: func, writable: true }; } }); Object.defineProperties(obj, properties); } function isNonNullObject(value) { return typeof value === 'object' && value !== null; } var ObjectUtils = /*#__PURE__*/Object.freeze({ iterateObject: iterateObject, cloneObject: cloneObject, deepCloneObject: deepCloneObject, deepCloneDefinition: deepCloneDefinition, getProperty: getProperty, setProperty: setProperty, copyPropertiesIfPresent: copyPropertiesIfPresent, copyPropertyIfPresent: copyPropertyIfPresent, getAllKeysInObjects: getAllKeysInObjects, getAllValuesInObject: getAllValuesInObject, mergeDeep: mergeDeep, missingOrEmptyObject: missingOrEmptyObject, get: get, set: set, getValueUsingField: getValueUsingField, removeAllReferences: removeAllReferences, isNonNullObject: isNonNullObject }); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var doOnceFlags = {}; /** * If the key was passed before, then doesn't execute the func * @param {Function} func * @param {string} key */ function doOnce(func, key) { if (doOnceFlags[key]) { return; } func(); doOnceFlags[key] = true; } function getFunctionName(funcConstructor) { // for every other browser in the world if (funcConstructor.name) { return funcConstructor.name; } // for the pestilence that is ie11 var matches = /function\s+([^\(]+)/.exec(funcConstructor.toString()); return matches && matches.length === 2 ? matches[1].trim() : null; } function isFunction(val) { return !!(val && val.constructor && val.call && val.apply); } function executeInAWhile(funcs) { executeAfter(funcs, 400); } var executeNextVMTurnFuncs = []; var executeNextVMTurnPending = false; function executeNextVMTurn(func) { executeNextVMTurnFuncs.push(func); if (executeNextVMTurnPending) { return; } executeNextVMTurnPending = true; window.setTimeout(function () { var funcsCopy = executeNextVMTurnFuncs.slice(); executeNextVMTurnFuncs.length = 0; executeNextVMTurnPending = false; funcsCopy.forEach(function (func) { return func(); }); }, 0); } function executeAfter(funcs, milliseconds) { if (milliseconds === void 0) { milliseconds = 0; } if (funcs.length > 0) { window.setTimeout(function () { return funcs.forEach(function (func) { return func(); }); }, milliseconds); } } /** * @param {Function} func The function to be debounced * @param {number} delay The time in ms to debounce * @return {Function} The debounced function */ function debounce(func, delay) { var timeout; // Calling debounce returns a new anonymous function return function () { var args = []; for (var _i = 0; _i < arguments.length; _i++) { args[_i] = arguments[_i]; } var context = this; window.clearTimeout(timeout); // Set the new timeout timeout = window.setTimeout(function () { func.apply(context, args); }, delay); }; } /** * @param {Function} func The function to be throttled * @param {number} wait The time in ms to throttle * @return {Function} The throttled function */ function throttle(func, wait) { var previousCall = 0; return function () { var args = []; for (var _i = 0; _i < arguments.length; _i++) { args[_i] = arguments[_i]; } var context = this; var currentCall = new Date().getTime(); if (currentCall - previousCall < wait) { return; } previousCall = currentCall; func.apply(context, args); }; } function waitUntil(condition, callback, timeout, timeoutMessage) { if (timeout === void 0) { timeout = 100; } var timeStamp = new Date().getTime(); var interval = null; var executed = false; var internalCallback = function () { var reachedTimeout = ((new Date().getTime()) - timeStamp) > timeout; if (condition() || reachedTimeout) { callback(); executed = true; if (interval != null) { window.clearInterval(interval); interval = null; } if (reachedTimeout && timeoutMessage) { console.warn(timeoutMessage); } } }; internalCallback(); if (!executed) { interval = window.setInterval(internalCallback, 10); } } function compose() { var fns = []; for (var _i = 0; _i < arguments.length; _i++) { fns[_i] = arguments[_i]; } return function (arg) { return fns.reduce(function (composed, f) { return f(composed); }, arg); }; } function callIfPresent(func) { if (func) { func(); } } var noop = function () { return; }; var FunctionUtils = /*#__PURE__*/Object.freeze({ doOnce: doOnce, getFunctionName: getFunctionName, isFunction: isFunction, executeInAWhile: executeInAWhile, executeNextVMTurn: executeNextVMTurn, executeAfter: executeAfter, debounce: debounce, throttle: throttle, waitUntil: waitUntil, compose: compose, callIfPresent: callIfPresent, noop: noop }); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __read = (undefined && undefined.__read) || function (o, n) { var m = typeof Symbol === "function" && o[Symbol.iterator]; if (!m) return o; var i = m.call(o), r, ar = [], e; try { while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); } catch (error) { e = { error: error }; } finally { try { if (r && !r.done && (m = i["return"])) m.call(i); } finally { if (e) throw e.error; } } return ar; }; var __spread = (undefined && undefined.__spread) || function () { for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i])); return ar; }; var Context = /** @class */ (function () { function Context(params, logger) { this.beanWrappers = {}; this.destroyed = false; if (!params || !params.beanClasses) { return; } this.contextParams = params; this.logger = logger; this.logger.log(">> creating ag-Application Context"); this.createBeans(); var beanInstances = this.getBeanInstances(); this.wireBeans(beanInstances); this.logger.log(">> ag-Application Context ready - component is alive"); } Context.prototype.getBeanInstances = function () { return values(this.beanWrappers).map(function (beanEntry) { return beanEntry.beanInstance; }); }; Context.prototype.createBean = function (bean, afterPreCreateCallback) { if (!bean) { throw Error("Can't wire to bean since it is null"); } this.wireBeans([bean], afterPreCreateCallback); return bean; }; Context.prototype.wireBeans = function (beanInstances, afterPreCreateCallback) { this.autoWireBeans(beanInstances); this.methodWireBeans(beanInstances); this.callLifeCycleMethods(beanInstances, 'preConstructMethods'); // the callback sets the attributes, so the component has access to attributes // before postConstruct methods in the component are executed if (exists(afterPreCreateCallback)) { beanInstances.forEach(afterPreCreateCallback); } this.callLifeCycleMethods(beanInstances, 'postConstructMethods'); }; Context.prototype.createBeans = function () { var _this = this; // register all normal beans this.contextParams.beanClasses.forEach(this.createBeanWrapper.bind(this)); // register override beans, these will overwrite beans above of same name // instantiate all beans - overridden beans will be left out iterateObject(this.beanWrappers, function (key, beanEntry) { var constructorParamsMeta; if (beanEntry.bean.__agBeanMetaData && beanEntry.bean.__agBeanMetaData.autowireMethods && beanEntry.bean.__agBeanMetaData.autowireMethods.agConstructor) { constructorParamsMeta = beanEntry.bean.__agBeanMetaData.autowireMethods.agConstructor; } var constructorParams = _this.getBeansForParameters(constructorParamsMeta, beanEntry.bean.name); var newInstance = new (beanEntry.bean.bind.apply(beanEntry.bean, __spread([null], constructorParams))); beanEntry.beanInstance = newInstance; }); var createdBeanNames = Object.keys(this.beanWrappers).join(', '); this.logger.log("created beans: " + createdBeanNames); }; // tslint:disable-next-line Context.prototype.createBeanWrapper = function (BeanClass) { var metaData = BeanClass.__agBeanMetaData; if (!metaData) { var beanName = void 0; if (BeanClass.prototype.constructor) { beanName = getFunctionName(BeanClass.prototype.constructor); } else { beanName = "" + BeanClass; } console.error("Context item " + beanName + " is not a bean"); return; } var beanEntry = { bean: BeanClass, beanInstance: null, beanName: metaData.beanName }; this.beanWrappers[metaData.beanName] = beanEntry; }; Context.prototype.autoWireBeans = function (beanInstances) { var _this = this; beanInstances.forEach(function (beanInstance) { _this.forEachMetaDataInHierarchy(beanInstance, function (metaData, beanName) { var attributes = metaData.agClassAttributes; if (!attributes) { return; } attributes.forEach(function (attribute) { var otherBean = _this.lookupBeanInstance(beanName, attribute.beanName, attribute.optional); beanInstance[attribute.attributeName] = otherBean; }); }); }); }; Context.prototype.methodWireBeans = function (beanInstances) { var _this = this; beanInstances.forEach(function (beanInstance) { _this.forEachMetaDataInHierarchy(beanInstance, function (metaData, beanName) { iterateObject(metaData.autowireMethods, function (methodName, wireParams) { // skip constructor, as this is dealt with elsewhere if (methodName === "agConstructor") { return; } var initParams = _this.getBeansForParameters(wireParams, beanName); beanInstance[methodName].apply(beanInstance, initParams); }); }); }); }; Context.prototype.forEachMetaDataInHierarchy = function (beanInstance, callback) { var prototype = Object.getPrototypeOf(beanInstance); while (prototype != null) { var constructor = prototype.constructor; if (constructor.hasOwnProperty('__agBeanMetaData')) { var metaData = constructor.__agBeanMetaData; var beanName = this.getBeanName(constructor); callback(metaData, beanName); } prototype = Object.getPrototypeOf(prototype); } }; Context.prototype.getBeanName = function (constructor) { if (constructor.__agBeanMetaData && constructor.__agBeanMetaData.beanName) { return constructor.__agBeanMetaData.beanName; } var constructorString = constructor.toString(); var beanName = constructorString.substring(9, constructorString.indexOf("(")); return beanName; }; Context.prototype.getBeansForParameters = function (parameters, beanName) { var _this = this; var beansList = []; if (parameters) { iterateObject(parameters, function (paramIndex, otherBeanName) { var otherBean = _this.lookupBeanInstance(beanName, otherBeanName); beansList[Number(paramIndex)] = otherBean; }); } return beansList; }; Context.prototype.lookupBeanInstance = function (wiringBean, beanName, optional) { if (optional === void 0) { optional = false; } if (beanName === "context") { return this; } if (this.contextParams.providedBeanInstances && this.contextParams.providedBeanInstances.hasOwnProperty(beanName)) { return this.contextParams.providedBeanInstances[beanName]; } var beanEntry = this.beanWrappers[beanName]; if (beanEntry) { return beanEntry.beanInstance; } if (!optional) { console.error("AG Grid: unable to find bean reference " + beanName + " while initialising " + wiringBean); } return null; }; Context.prototype.callLifeCycleMethods = function (beanInstances, lifeCycleMethod) { var _this = this; beanInstances.forEach(function (beanInstance) { return _this.callLifeCycleMethodsOnBean(beanInstance, lifeCycleMethod); }); }; Context.prototype.callLifeCycleMethodsOnBean = function (beanInstance, lifeCycleMethod, methodToIgnore) { // putting all methods into a map removes duplicates var allMethods = {}; // dump methods from each level of the metadata hierarchy this.forEachMetaDataInHierarchy(beanInstance, function (metaData) { var methods = metaData[lifeCycleMethod]; if (methods) { methods.forEach(function (methodName) { if (methodName != methodToIgnore) { allMethods[methodName] = true; } }); } }); var allMethodsList = Object.keys(allMethods); allMethodsList.forEach(function (methodName) { return beanInstance[methodName](); }); }; Context.prototype.getBean = function (name) { return this.lookupBeanInstance("getBean", name, true); }; Context.prototype.destroy = function () { if (this.destroyed) { return; } this.logger.log(">> Shutting down ag-Application Context"); var beanInstances = this.getBeanInstances(); this.destroyBeans(beanInstances); this.contextParams.providedBeanInstances = null; this.destroyed = true; this.logger.log(">> ag-Application Context shut down - component is dead"); }; Context.prototype.destroyBean = function (bean) { if (!bean) { return; } this.destroyBeans([bean]); }; Context.prototype.destroyBeans = function (beans) { var _this = this; if (!beans) { return []; } beans.forEach(function (bean) { _this.callLifeCycleMethodsOnBean(bean, 'preDestroyMethods', 'destroy'); // call destroy() explicitly if it exists var beanAny = bean; if (typeof beanAny.destroy === 'function') { beanAny.destroy(); } }); return []; }; return Context; }()); function PreConstruct(target, methodName, descriptor) { var props = getOrCreateProps(target.constructor); if (!props.preConstructMethods) { props.preConstructMethods = []; } props.preConstructMethods.push(methodName); } function PostConstruct(target, methodName, descriptor) { var props = getOrCreateProps(target.constructor); if (!props.postConstructMethods) { props.postConstructMethods = []; } props.postConstructMethods.push(methodName); } function PreDestroy(target, methodName, descriptor) { var props = getOrCreateProps(target.constructor); if (!props.preDestroyMethods) { props.preDestroyMethods = []; } props.preDestroyMethods.push(methodName); } function Bean(beanName) { return function (classConstructor) { var props = getOrCreateProps(classConstructor); props.beanName = beanName; }; } function Autowired(name) { return function (target, propertyKey, descriptor) { autowiredFunc(target, name, false, target, propertyKey, null); }; } function Optional(name) { return function (target, propertyKey, descriptor) { autowiredFunc(target, name, true, target, propertyKey, null); }; } function autowiredFunc(target, name, optional, classPrototype, methodOrAttributeName, index) { if (name === null) { console.error("AG Grid: Autowired name should not be null"); return; } if (typeof index === "number") { console.error("AG Grid: Autowired should be on an attribute"); return; } // it's an attribute on the class var props = getOrCreateProps(target.constructor); if (!props.agClassAttributes) { props.agClassAttributes = []; } props.agClassAttributes.push({ attributeName: methodOrAttributeName, beanName: name, optional: optional }); } function Qualifier(name) { return function (classPrototype, methodOrAttributeName, index) { var constructor = typeof classPrototype == "function" ? classPrototype : classPrototype.constructor; var props; if (typeof index === "number") { // it's a parameter on a method var methodName = void 0; if (methodOrAttributeName) { props = getOrCreateProps(constructor); methodName = methodOrAttributeName; } else { props = getOrCreateProps(constructor); methodName = "agConstructor"; } if (!props.autowireMethods) { props.autowireMethods = {}; } if (!props.autowireMethods[methodName]) { props.autowireMethods[methodName] = {}; } props.autowireMethods[methodName][index] = name; } }; } function getOrCreateProps(target) { if (!target.hasOwnProperty("__agBeanMetaData")) { target.__agBeanMetaData = {}; } return target.__agBeanMetaData; } /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var __param = (undefined && undefined.__param) || function (paramIndex, decorator) { return function (target, key) { decorator(target, key, paramIndex); } }; var EventService = /** @class */ (function () { function EventService() { this.allSyncListeners = new Map(); this.allAsyncListeners = new Map(); this.globalSyncListeners = new Set(); this.globalAsyncListeners = new Set(); this.asyncFunctionsQueue = []; this.scheduled = false; // using an object performs better than a Set for the number of different events we have this.firedEvents = {}; } // because this class is used both inside the context and outside the context, we do not // use autowired attributes, as that would be confusing, as sometimes the attributes // would be wired, and sometimes not. // // the global event servers used by AG Grid is autowired by the context once, and this // setBeans method gets called once. // // the times when this class is used outside of the context (eg RowNode has an instance of this // class) then it is not a bean, and this setBeans method is not called. EventService.prototype.setBeans = function (loggerFactory, gridOptionsService, frameworkOverrides, globalEventListener) { if (globalEventListener === void 0) { globalEventListener = null; } this.frameworkOverrides = frameworkOverrides; this.gridOptionsService = gridOptionsService; if (globalEventListener) { var async = gridOptionsService.useAsyncEvents(); this.addGlobalListener(globalEventListener, async); } }; EventService.prototype.getListeners = function (eventType, async, autoCreateListenerCollection) { var listenerMap = async ? this.allAsyncListeners : this.allSyncListeners; var listeners = listenerMap.get(eventType); // Note: 'autoCreateListenerCollection' should only be 'true' if a listener is about to be added. For instance // getListeners() is also called during event dispatch even though no listeners are added. This measure protects // against 'memory bloat' as empty collections will prevent the RowNode's event service from being removed after // the RowComp is destroyed, see noRegisteredListenersExist() below. if (!listeners && autoCreateListenerCollection) { listeners = new Set(); listenerMap.set(eventType, listeners); } return listeners; }; EventService.prototype.noRegisteredListenersExist = function () { return this.allSyncListeners.size === 0 && this.allAsyncListeners.size === 0 && this.globalSyncListeners.size === 0 && this.globalAsyncListeners.size === 0; }; EventService.prototype.addEventListener = function (eventType, listener, async) { if (async === void 0) { async = false; } this.getListeners(eventType, async, true).add(listener); }; EventService.prototype.removeEventListener = function (eventType, listener, async) { if (async === void 0) { async = false; } var listeners = this.getListeners(eventType, async, false); if (!listeners) { return; } listeners.delete(listener); if (listeners.size === 0) { var listenerMap = async ? this.allAsyncListeners : this.allSyncListeners; listenerMap.delete(eventType); } }; EventService.prototype.addGlobalListener = function (listener, async) { if (async === void 0) { async = false; } (async ? this.globalAsyncListeners : this.globalSyncListeners).add(listener); }; EventService.prototype.removeGlobalListener = function (listener, async) { if (async === void 0) { async = false; } (async ? this.globalAsyncListeners : this.globalSyncListeners).delete(listener); }; EventService.prototype.dispatchEvent = function (event) { var agEvent = event; if (this.gridOptionsService) { // Apply common properties to all dispatched events if this event service has had its beans set with gridOptionsService. // Note there are multiple instances of EventService that are used local to components which do not set gridOptionsService. var _a = this.gridOptionsService, api = _a.api, columnApi = _a.columnApi, context = _a.context; agEvent.api = api; agEvent.columnApi = columnApi; agEvent.context = context; } this.dispatchToListeners(agEvent, true); this.dispatchToListeners(agEvent, false); this.firedEvents[agEvent.type] = true; }; EventService.prototype.dispatchEventOnce = function (event) { if (!this.firedEvents[event.type]) { this.dispatchEvent(event); } }; EventService.prototype.dispatchToListeners = function (event, async) { var _this = this; var eventType = event.type; if (async && 'event' in event) { var browserEvent = event.event; if (browserEvent instanceof Event) { // AG-7893 - Persist composedPath() so that its result can still be accessed by the user asynchronously. // Within an async event handler if they call composedPath() on the event it will always return an empty []. event.eventPath = browserEvent.composedPath(); } } var processEventListeners = function (listeners) { return listeners.forEach(function (listener) { if (async) { _this.dispatchAsync(function () { return listener(event); }); } else { listener(event); } }); }; var listeners = this.getListeners(eventType, async, false); if (listeners) { processEventListeners(listeners); } var globalListeners = async ? this.globalAsyncListeners : this.globalSyncListeners; globalListeners.forEach(function (listener) { if (async) { _this.dispatchAsync(function () { return _this.frameworkOverrides.dispatchEvent(eventType, function () { return listener(eventType, event); }, true); }); } else { _this.frameworkOverrides.dispatchEvent(eventType, function () { return listener(eventType, event); }, true); } }); }; // this gets called inside the grid's thread, for each event that it // wants to set async. the grid then batches the events into one setTimeout() // because setTimeout() is an expensive operation. ideally we would have // each event in it's own setTimeout(), but we batch for performance. EventService.prototype.dispatchAsync = function (func) { // add to the queue for executing later in the next VM turn this.asyncFunctionsQueue.push(func); // check if timeout is already scheduled. the first time the grid calls // this within it's thread turn, this should be false, so it will schedule // the 'flush queue' method the first time it comes here. then the flag is // set to 'true' so it will know it's already scheduled for subsequent calls. if (!this.scheduled) { // if not scheduled, schedule one window.setTimeout(this.flushAsyncQueue.bind(this), 0); // mark that it is scheduled this.scheduled = true; } }; // this happens in the next VM turn only, and empties the queue of events EventService.prototype.flushAsyncQueue = function () { this.scheduled = false; // we take a copy, because the event listener could be using // the grid, which would cause more events, which would be potentially // added to the queue, so safe to take a copy, the new events will // get executed in a later VM turn rather than risk updating the // queue as we are flushing it. var queueCopy = this.asyncFunctionsQueue.slice(); this.asyncFunctionsQueue = []; // execute the queue queueCopy.forEach(function (func) { return func(); }); }; __decorate([ __param(0, Qualifier('loggerFactory')), __param(1, Qualifier('gridOptionsService')), __param(2, Qualifier('frameworkOverrides')), __param(3, Qualifier('globalEventListener')) ], EventService.prototype, "setBeans", null); EventService = __decorate([ Bean('eventService') ], EventService); return EventService; }()); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ (function (ModuleNames) { ModuleNames["CommunityCoreModule"] = "@ag-grid-community/core"; // community modules ModuleNames["InfiniteRowModelModule"] = "@ag-grid-community/infinite-row-model"; ModuleNames["ClientSideRowModelModule"] = "@ag-grid-community/client-side-row-model"; ModuleNames["CsvExportModule"] = "@ag-grid-community/csv-export"; // enterprise core - users don't need to import on this, but other enterprise modules do ModuleNames["EnterpriseCoreModule"] = "@ag-grid-enterprise/core"; // enterprise modules ModuleNames["RowGroupingModule"] = "@ag-grid-enterprise/row-grouping"; ModuleNames["ColumnsToolPanelModule"] = "@ag-grid-enterprise/column-tool-panel"; ModuleNames["FiltersToolPanelModule"] = "@ag-grid-enterprise/filter-tool-panel"; ModuleNames["MenuModule"] = "@ag-grid-enterprise/menu"; ModuleNames["SetFilterModule"] = "@ag-grid-enterprise/set-filter"; ModuleNames["MultiFilterModule"] = "@ag-grid-enterprise/multi-filter"; ModuleNames["StatusBarModule"] = "@ag-grid-enterprise/status-bar"; ModuleNames["SideBarModule"] = "@ag-grid-enterprise/side-bar"; ModuleNames["RangeSelectionModule"] = "@ag-grid-enterprise/range-selection"; ModuleNames["MasterDetailModule"] = "@ag-grid-enterprise/master-detail"; ModuleNames["RichSelectModule"] = "@ag-grid-enterprise/rich-select"; ModuleNames["GridChartsModule"] = "@ag-grid-enterprise/charts"; ModuleNames["ViewportRowModelModule"] = "@ag-grid-enterprise/viewport-row-model"; ModuleNames["ServerSideRowModelModule"] = "@ag-grid-enterprise/server-side-row-model"; ModuleNames["ExcelExportModule"] = "@ag-grid-enterprise/excel-export"; ModuleNames["ClipboardModule"] = "@ag-grid-enterprise/clipboard"; ModuleNames["SparklinesModule"] = "@ag-grid-enterprise/sparklines"; // framework wrappers currently don't provide beans, comps etc, so no need to be modules, // however i argue they should be as in theory they 'could' provide beans etc ModuleNames["AngularModule"] = "@ag-grid-community/angular"; ModuleNames["ReactModule"] = "@ag-grid-community/react"; ModuleNames["VueModule"] = "@ag-grid-community/vue"; // and then this, which is definitely not a grid module, as it should not have any dependency // on the grid (ie shouldn't even reference the Module interface) // ChartsModule = "@ag-grid-community/charts-core", })(exports.ModuleNames || (exports.ModuleNames = {})); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __read$1 = (undefined && undefined.__read) || function (o, n) { var m = typeof Symbol === "function" && o[Symbol.iterator]; if (!m) return o; var i = m.call(o), r, ar = [], e; try { while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); } catch (error) { e = { error: error }; } finally { try { if (r && !r.done && (m = i["return"])) m.call(i); } finally { if (e) throw e.error; } } return ar; }; var ModuleRegistry = /** @class */ (function () { function ModuleRegistry() { } ModuleRegistry.register = function (module, moduleBased) { if (moduleBased === void 0) { moduleBased = true; } ModuleRegistry.runVersionChecks(module); ModuleRegistry.modulesMap[module.moduleName] = module; ModuleRegistry.setModuleBased(moduleBased); }; ModuleRegistry.runVersionChecks = function (module) { if (!ModuleRegistry.currentModuleVersion) { ModuleRegistry.currentModuleVersion = module.version; } if (!module.version) { console.error("AG Grid: You are using incompatible versions of AG Grid modules. Major and minor versions should always match across modules. '" + module.moduleName + "' is incompatible. Please update all modules to the same version."); } else if (module.version !== ModuleRegistry.currentModuleVersion) { console.error("AG Grid: You are using incompatible versions of AG Grid modules. Major and minor versions should always match across modules. '" + module.moduleName + "' is version " + module.version + " but the other modules are version " + this.currentModuleVersion + ". Please update all modules to the same version."); } if (module.validate) { var result = module.validate(); if (!result.isValid) { var errorResult = result; console.error("AG Grid: " + errorResult.message); } } }; ModuleRegistry.setModuleBased = function (moduleBased) { if (ModuleRegistry.moduleBased === undefined) { ModuleRegistry.moduleBased = moduleBased; } else { if (ModuleRegistry.moduleBased !== moduleBased) { doOnce(function () { console.warn("AG Grid: You are mixing modules (i.e. @ag-grid-community/core) and packages (ag-grid-community) - you can only use one or the other of these mechanisms."); console.warn('Please see https://www.ag-grid.com/javascript-grid/packages-modules/ for more information.'); }, 'ModulePackageCheck'); } } }; /** * INTERNAL - Set if files are being served from a single UMD bundle to provide accurate enterprise upgrade steps. */ ModuleRegistry.setIsBundled = function () { ModuleRegistry.isBundled = true; }; // noinspection JSUnusedGlobalSymbols ModuleRegistry.registerModules = function (modules, moduleBased) { if (moduleBased === void 0) { moduleBased = true; } ModuleRegistry.setModuleBased(moduleBased); if (!modules) { return; } modules.forEach(function (module) { return ModuleRegistry.register(module, moduleBased); }); }; ModuleRegistry.assertRegistered = function (moduleName, reason) { var _a; if (this.isRegistered(moduleName)) { return true; } var warningKey = reason + moduleName; var warningMessage; if (ModuleRegistry.isBundled) { { warningMessage = "AG Grid: unable to use " + reason + " as 'ag-grid-enterprise' has not been loaded. Check you are using the Enterprise bundle:\n \n \n \nFor more info see: https://ag-grid.com/javascript-data-grid/getting-started/#getting-started-with-ag-grid-enterprise"; } } else if (ModuleRegistry.moduleBased || ModuleRegistry.moduleBased === undefined) { var modName = (_a = Object.entries(exports.ModuleNames).find(function (_a) { var _b = __read$1(_a, 2), k = _b[0], v = _b[1]; return v === moduleName; })) === null || _a === void 0 ? void 0 : _a[0]; warningMessage = "AG Grid: unable to use " + reason + " as the " + modName + " is not registered. Check if you have registered the module:\n \n import { ModuleRegistry } from '@ag-grid-community/core';\n import { " + modName + " } from '" + moduleName + "';\n \n ModuleRegistry.registerModules([ " + modName + " ]);\n\nFor more info see: https://www.ag-grid.com/javascript-grid/modules/"; } else { warningMessage = "AG Grid: unable to use " + reason + " as package 'ag-grid-enterprise' has not been imported. Check that you have imported the package:\n \n import 'ag-grid-enterprise';\n \nFor more info see: https://www.ag-grid.com/javascript-grid/packages/"; } doOnce(function () { console.warn(warningMessage); }, warningKey); return false; }; ModuleRegistry.isRegistered = function (moduleName) { return !!ModuleRegistry.modulesMap[moduleName]; }; ModuleRegistry.getRegisteredModules = function () { return values(ModuleRegistry.modulesMap); }; ModuleRegistry.isPackageBased = function () { return !ModuleRegistry.moduleBased; }; // having in a map a) removes duplicates and b) allows fast lookup ModuleRegistry.modulesMap = {}; return ModuleRegistry; }()); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __decorate$1 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var instanceIdSequence = 0; function getNextColInstanceId() { return instanceIdSequence++; } // Wrapper around a user provide column definition. The grid treats the column definition as ready only. // This class contains all the runtime information about a column, plus some logic (the definition has no logic). // This class implements both interfaces ColumnGroupChild and ProvidedColumnGroupChild as the class can // appear as a child of either the original tree or the displayed tree. However the relevant group classes // for each type only implements one, as each group can only appear in it's associated tree (eg ProvidedColumnGroup // can only appear in OriginalColumn tree). var Column = /** @class */ (function () { function Column(colDef, userProvidedColDef, colId, primary) { // used by React (and possibly other frameworks) as key for rendering. also used to // identify old vs new columns for destroying cols when no longer used. this.instanceId = getNextColInstanceId(); // The measured height of this column's header when autoHeaderHeight is enabled this.autoHeaderHeight = null; this.moving = false; this.menuVisible = false; this.filterActive = false; this.eventService = new EventService(); this.rowGroupActive = false; this.pivotActive = false; this.aggregationActive = false; this.colDef = colDef; this.userProvidedColDef = userProvidedColDef; this.colId = colId; this.primary = primary; this.setState(colDef); } Column.prototype.getInstanceId = function () { return this.instanceId; }; Column.prototype.setState = function (colDef) { // sort if (colDef.sort !== undefined) { if (colDef.sort === 'asc' || colDef.sort === 'desc') { this.sort = colDef.sort; } } else { if (colDef.initialSort === 'asc' || colDef.initialSort === 'desc') { this.sort = colDef.initialSort; } } // sortIndex var sortIndex = attrToNumber(colDef.sortIndex); var initialSortIndex = attrToNumber(colDef.initialSortIndex); if (sortIndex !== undefined) { if (sortIndex !== null) { this.sortIndex = sortIndex; } } else { if (initialSortIndex !== null) { this.sortIndex = initialSortIndex; } } // hide var hide = attrToBoolean(colDef.hide); var initialHide = attrToBoolean(colDef.initialHide); if (hide !== undefined) { this.visible = !hide; } else { this.visible = !initialHide; } // pinned if (colDef.pinned !== undefined) { this.setPinned(colDef.pinned); } else { this.setPinned(colDef.initialPinned); } // flex var flex = attrToNumber(colDef.flex); var initialFlex = attrToNumber(colDef.initialFlex); if (flex !== undefined) { this.flex = flex; } else if (initialFlex !== undefined) { this.flex = initialFlex; } }; // gets called when user provides an alternative colDef, eg Column.prototype.setColDef = function (colDef, userProvidedColDef) { this.colDef = colDef; this.userProvidedColDef = userProvidedColDef; this.initMinAndMaxWidths(); this.initDotNotation(); this.eventService.dispatchEvent(this.createColumnEvent('colDefChanged', "api")); }; /** * Returns the column definition provided by the application. * This may not be correct, as items can be superseded by default column options. * However it's useful for comparison, eg to know which application column definition matches that column. */ Column.prototype.getUserProvidedColDef = function () { return this.userProvidedColDef; }; Column.prototype.setParent = function (parent) { this.parent = parent; }; /** Returns the parent column group, if column grouping is active. */ Column.prototype.getParent = function () { return this.parent; }; Column.prototype.setOriginalParent = function (originalParent) { this.originalParent = originalParent; }; Column.prototype.getOriginalParent = function () { return this.originalParent; }; // this is done after constructor as it uses gridOptionsService Column.prototype.initialise = function () { this.initMinAndMaxWidths(); this.resetActualWidth('gridInitializing'); this.initDotNotation(); this.validate(); }; Column.prototype.initDotNotation = function () { var suppressDotNotation = this.gridOptionsService.is('suppressFieldDotNotation'); this.fieldContainsDots = exists(this.colDef.field) && this.colDef.field.indexOf('.') >= 0 && !suppressDotNotation; this.tooltipFieldContainsDots = exists(this.colDef.tooltipField) && this.colDef.tooltipField.indexOf('.') >= 0 && !suppressDotNotation; }; Column.prototype.initMinAndMaxWidths = function () { var colDef = this.colDef; this.minWidth = this.columnUtils.calculateColMinWidth(colDef); this.maxWidth = this.columnUtils.calculateColMaxWidth(colDef); }; Column.prototype.resetActualWidth = function (source) { if (source === void 0) { source = 'api'; } var initialWidth = this.columnUtils.calculateColInitialWidth(this.colDef); this.setActualWidth(initialWidth, source, true); }; Column.prototype.isEmptyGroup = function () { return false; }; Column.prototype.isRowGroupDisplayed = function (colId) { if (missing(this.colDef) || missing(this.colDef.showRowGroup)) { return false; } var showingAllGroups = this.colDef.showRowGroup === true; var showingThisGroup = this.colDef.showRowGroup === colId; return showingAllGroups || showingThisGroup; }; /** Returns `true` if column is a primary column, `false` if secondary. Secondary columns are used for pivoting. */ Column.prototype.isPrimary = function () { return this.primary; }; /** Returns `true` if column filtering is allowed. */ Column.prototype.isFilterAllowed = function () { // filter defined means it's a string, class or true. // if its false, null or undefined then it's false. var filterDefined = !!this.colDef.filter || !!this.colDef.filterFramework; return filterDefined; }; Column.prototype.isFieldContainsDots = function () { return this.fieldContainsDots; }; Column.prototype.isTooltipFieldContainsDots = function () { return this.tooltipFieldContainsDots; }; Column.prototype.validate = function () { var colDefAny = this.colDef; function warnOnce(msg, key, obj) { doOnce(function () { if (obj) { console.warn(msg, obj); } else { doOnce(function () { return console.warn(msg); }, key); } }, key); } var usingCSRM = this.gridOptionsService.isRowModelType('clientSide'); if (usingCSRM && !ModuleRegistry.isRegistered(exports.ModuleNames.RowGroupingModule)) { var rowGroupingItems = ['enableRowGroup', 'rowGroup', 'rowGroupIndex', 'enablePivot', 'enableValue', 'pivot', 'pivotIndex', 'aggFunc']; var itemsUsed = rowGroupingItems.filter(function (x) { return exists(colDefAny[x]); }); if (itemsUsed.length > 0) { ModuleRegistry.assertRegistered(exports.ModuleNames.RowGroupingModule, itemsUsed.map(function (i) { return 'colDef.' + i; }).join(', ')); } } if (this.colDef.cellEditor === 'agRichSelect' || this.colDef.cellEditor === 'agRichSelectCellEditor') { ModuleRegistry.assertRegistered(exports.ModuleNames.RichSelectModule, this.colDef.cellEditor); } if (this.gridOptionsService.isTreeData()) { var itemsNotAllowedWithTreeData = ['rowGroup', 'rowGroupIndex', 'pivot', 'pivotIndex']; var itemsUsed = itemsNotAllowedWithTreeData.filter(function (x) { return exists(colDefAny[x]); }); if (itemsUsed.length > 0) { warnOnce("AG Grid: " + itemsUsed.join() + " is not possible when doing tree data, your column definition should not have " + itemsUsed.join(), 'TreeDataCannotRowGroup'); } } if (exists(colDefAny.menuTabs)) { ModuleRegistry.assertRegistered(exports.ModuleNames.MenuModule, 'menuTabs'); } if (exists(colDefAny.columnsMenuParams)) { ModuleRegistry.assertRegistered(exports.ModuleNames.MenuModule, 'columnsMenuParams'); } if (exists(colDefAny.columnsMenuParams)) { ModuleRegistry.assertRegistered(exports.ModuleNames.ColumnsToolPanelModule, 'columnsMenuParams'); } if (exists(this.colDef.width) && typeof this.colDef.width !== 'number') { warnOnce('AG Grid: colDef.width should be a number, not ' + typeof this.colDef.width, 'ColumnCheck'); } if (colDefAny.pinnedRowCellRenderer || colDefAny.pinnedRowCellRendererParams || colDefAny.pinnedRowCellRendererFramework) { warnOnce('AG Grid: pinnedRowCellRenderer[Params,Framework] no longer exist. Use cellRendererSelector if you want a different Cell Renderer for pinned rows. Check params.node.rowPinned.', 'colDef.pinnedRowCellRenderer-deprecated'); } if (exists(colDefAny.columnGroupShow) && colDefAny.columnGroupShow !== 'closed' && colDefAny.columnGroupShow !== 'open') { warnOnce("AG Grid: '" + colDefAny.columnGroupShow + "' is not valid for columnGroupShow. Valid values are 'open', 'closed', undefined, null", 'columnGroupShow_invalid'); } }; /** Add an event listener to the column. */ Column.prototype.addEventListener = function (eventType, listener) { this.eventService.addEventListener(eventType, listener); }; /** Remove event listener from the column. */ Column.prototype.removeEventListener = function (eventType, listener) { this.eventService.removeEventListener(eventType, listener); }; Column.prototype.createColumnFunctionCallbackParams = function (rowNode) { return { node: rowNode, data: rowNode.data, column: this, colDef: this.colDef, context: this.gridOptionsService.context, api: this.gridOptionsService.api, columnApi: this.gridOptionsService.columnApi }; }; Column.prototype.isSuppressNavigable = function (rowNode) { // if boolean set, then just use it if (typeof this.colDef.suppressNavigable === 'boolean') { return this.colDef.suppressNavigable; } // if function, then call the function to find out if (typeof this.colDef.suppressNavigable === 'function') { var params = this.createColumnFunctionCallbackParams(rowNode); var userFunc = this.colDef.suppressNavigable; return userFunc(params); } return false; }; Column.prototype.isCellEditable = function (rowNode) { // only allow editing of groups if the user has this option enabled if (rowNode.group && !this.gridOptionsService.is('enableGroupEdit')) { return false; } return this.isColumnFunc(rowNode, this.colDef.editable); }; Column.prototype.isSuppressFillHandle = function () { return !!attrToBoolean(this.colDef.suppressFillHandle); }; Column.prototype.isAutoHeight = function () { return !!attrToBoolean(this.colDef.autoHeight); }; Column.prototype.isAutoHeaderHeight = function () { return !!attrToBoolean(this.colDef.autoHeaderHeight); }; Column.prototype.isRowDrag = function (rowNode) { return this.isColumnFunc(rowNode, this.colDef.rowDrag); }; Column.prototype.isDndSource = function (rowNode) { return this.isColumnFunc(rowNode, this.colDef.dndSource); }; Column.prototype.isCellCheckboxSelection = function (rowNode) { return this.isColumnFunc(rowNode, this.colDef.checkboxSelection); }; Column.prototype.isSuppressPaste = function (rowNode) { return this.isColumnFunc(rowNode, this.colDef ? this.colDef.suppressPaste : null); }; Column.prototype.isResizable = function () { return !!attrToBoolean(this.colDef.resizable); }; Column.prototype.isColumnFunc = function (rowNode, value) { // if boolean set, then just use it if (typeof value === 'boolean') { return value; } // if function, then call the function to find out if (typeof value === 'function') { var params = this.createColumnFunctionCallbackParams(rowNode); var editableFunc = value; return editableFunc(params); } return false; }; Column.prototype.setMoving = function (moving, source) { if (source === void 0) { source = "api"; } this.moving = moving; this.eventService.dispatchEvent(this.createColumnEvent('movingChanged', source)); }; Column.prototype.createColumnEvent = function (type, source) { return { type: type, column: this, columns: [this], source: source, api: this.gridOptionsService.api, columnApi: this.gridOptionsService.columnApi, context: this.gridOptionsService.context }; }; Column.prototype.isMoving = function () { return this.moving; }; /** If sorting is active, returns the sort direction e.g. `'asc'` or `'desc'`. */ Column.prototype.getSort = function () { return this.sort; }; Column.prototype.setSort = function (sort, source) { if (source === void 0) { source = "api"; } if (this.sort !== sort) { this.sort = sort; this.eventService.dispatchEvent(this.createColumnEvent('sortChanged', source)); } }; Column.prototype.setMenuVisible = function (visible, source) { if (source === void 0) { source = "api"; } if (this.menuVisible !== visible) { this.menuVisible = visible; this.eventService.dispatchEvent(this.createColumnEvent('menuVisibleChanged', source)); } }; Column.prototype.isMenuVisible = function () { return this.menuVisible; }; Column.prototype.isSortAscending = function () { return this.sort === 'asc'; }; Column.prototype.isSortDescending = function () { return this.sort === 'desc'; }; Column.prototype.isSortNone = function () { return missing(this.sort); }; Column.prototype.isSorting = function () { return exists(this.sort); }; Column.prototype.getSortIndex = function () { return this.sortIndex; }; Column.prototype.setSortIndex = function (sortOrder) { this.sortIndex = sortOrder; }; Column.prototype.setAggFunc = function (aggFunc) { this.aggFunc = aggFunc; }; /** If aggregation is set for the column, returns the aggregation function. */ Column.prototype.getAggFunc = function () { return this.aggFunc; }; Column.prototype.getLeft = function () { return this.left; }; Column.prototype.getOldLeft = function () { return this.oldLeft; }; Column.prototype.getRight = function () { return this.left + this.actualWidth; }; Column.prototype.setLeft = function (left, source) { if (source === void 0) { source = "api"; } this.oldLeft = this.left; if (this.left !== left) { this.left = left; this.eventService.dispatchEvent(this.createColumnEvent('leftChanged', source)); } }; /** Returns `true` if filter is active on the column. */ Column.prototype.isFilterActive = function () { return this.filterActive; }; // additionalEventAttributes is used by provided simple floating filter, so it can add 'floatingFilter=true' to the event Column.prototype.setFilterActive = function (active, source, additionalEventAttributes) { if (source === void 0) { source = "api"; } if (this.filterActive !== active) { this.filterActive = active; this.eventService.dispatchEvent(this.createColumnEvent('filterActiveChanged', source)); } var filterChangedEvent = this.createColumnEvent('filterChanged', source); if (additionalEventAttributes) { mergeDeep(filterChangedEvent, additionalEventAttributes); } this.eventService.dispatchEvent(filterChangedEvent); }; Column.prototype.setPinned = function (pinned) { if (pinned === true || pinned === 'left') { this.pinned = 'left'; } else if (pinned === 'right') { this.pinned = 'right'; } else { this.pinned = null; } }; Column.prototype.setFirstRightPinned = function (firstRightPinned, source) { if (source === void 0) { source = "api"; } if (this.firstRightPinned !== firstRightPinned) { this.firstRightPinned = firstRightPinned; this.eventService.dispatchEvent(this.createColumnEvent('firstRightPinnedChanged', source)); } }; Column.prototype.setLastLeftPinned = function (lastLeftPinned, source) { if (source === void 0) { source = "api"; } if (this.lastLeftPinned !== lastLeftPinned) { this.lastLeftPinned = lastLeftPinned; this.eventService.dispatchEvent(this.createColumnEvent('lastLeftPinnedChanged', source)); } }; Column.prototype.isFirstRightPinned = function () { return this.firstRightPinned; }; Column.prototype.isLastLeftPinned = function () { return this.lastLeftPinned; }; Column.prototype.isPinned = function () { return this.pinned === 'left' || this.pinned === 'right'; }; Column.prototype.isPinnedLeft = function () { return this.pinned === 'left'; }; Column.prototype.isPinnedRight = function () { return this.pinned === 'right'; }; Column.prototype.getPinned = function () { return this.pinned; }; Column.prototype.setVisible = function (visible, source) { if (source === void 0) { source = "api"; } var newValue = visible === true; if (this.visible !== newValue) { this.visible = newValue; this.eventService.dispatchEvent(this.createColumnEvent('visibleChanged', source)); } }; Column.prototype.isVisible = function () { return this.visible; }; Column.prototype.isSpanHeaderHeight = function () { return !!this.getColDef().spanHeaderHeight; }; /** Returns the column definition for this column. * The column definition will be the result of merging the application provided column definition with any provided defaults * (e.g. `defaultColDef` grid option, or column types. * * Equivalent: `getDefinition` */ Column.prototype.getColDef = function () { return this.colDef; }; Column.prototype.getColumnGroupShow = function () { return this.colDef.columnGroupShow; }; /** * Returns the unique ID for the column. * * Equivalent: `getId`, `getUniqueId` */ Column.prototype.getColId = function () { return this.colId; }; /** * Returns the unique ID for the column. * * Equivalent: `getColId`, `getUniqueId` */ Column.prototype.getId = function () { return this.getColId(); }; /** * Returns the unique ID for the column. * * Equivalent: `getColId`, `getId` */ Column.prototype.getUniqueId = function () { return this.getId(); }; Column.prototype.getDefinition = function () { return this.colDef; }; /** Returns the current width of the column. If the column is resized, the actual width is the new size. */ Column.prototype.getActualWidth = function () { return this.actualWidth; }; Column.prototype.getAutoHeaderHeight = function () { return this.autoHeaderHeight; }; /** Returns true if the header height has changed */ Column.prototype.setAutoHeaderHeight = function (height) { var changed = height !== this.autoHeaderHeight; this.autoHeaderHeight = height; return changed; }; Column.prototype.createBaseColDefParams = function (rowNode) { var params = { node: rowNode, data: rowNode.data, colDef: this.colDef, column: this, api: this.gridOptionsService.api, columnApi: this.gridOptionsService.columnApi, context: this.gridOptionsService.context }; return params; }; Column.prototype.getColSpan = function (rowNode) { if (missing(this.colDef.colSpan)) { return 1; } var params = this.createBaseColDefParams(rowNode); var colSpan = this.colDef.colSpan(params); // colSpan must be number equal to or greater than 1 return Math.max(colSpan, 1); }; Column.prototype.getRowSpan = function (rowNode) { if (missing(this.colDef.rowSpan)) { return 1; } var params = this.createBaseColDefParams(rowNode); var rowSpan = this.colDef.rowSpan(params); // rowSpan must be number equal to or greater than 1 return Math.max(rowSpan, 1); }; Column.prototype.setActualWidth = function (actualWidth, source, silent) { if (source === void 0) { source = "api"; } if (silent === void 0) { silent = false; } if (this.minWidth != null) { actualWidth = Math.max(actualWidth, this.minWidth); } if (this.maxWidth != null) { actualWidth = Math.min(actualWidth, this.maxWidth); } if (this.actualWidth !== actualWidth) { // disable flex for this column if it was manually resized. this.actualWidth = actualWidth; if (this.flex && source !== 'flex' && source !== 'gridInitializing') { this.flex = null; } if (!silent) { this.fireColumnWidthChangedEvent(source); } } }; Column.prototype.fireColumnWidthChangedEvent = function (source) { this.eventService.dispatchEvent(this.createColumnEvent('widthChanged', source)); }; Column.prototype.isGreaterThanMax = function (width) { if (this.maxWidth != null) { return width > this.maxWidth; } return false; }; Column.prototype.getMinWidth = function () { return this.minWidth; }; Column.prototype.getMaxWidth = function () { return this.maxWidth; }; Column.prototype.getFlex = function () { return this.flex || 0; }; // this method should only be used by the columnModel to // change flex when required by the applyColumnState method. Column.prototype.setFlex = function (flex) { if (this.flex !== flex) { this.flex = flex; } }; Column.prototype.setMinimum = function (source) { if (source === void 0) { source = "api"; } if (exists(this.minWidth)) { this.setActualWidth(this.minWidth, source); } }; Column.prototype.setRowGroupActive = function (rowGroup, source) { if (source === void 0) { source = "api"; } if (this.rowGroupActive !== rowGroup) { this.rowGroupActive = rowGroup; this.eventService.dispatchEvent(this.createColumnEvent('columnRowGroupChanged', source)); } }; /** Returns `true` if row group is currently active for this column. */ Column.prototype.isRowGroupActive = function () { return this.rowGroupActive; }; Column.prototype.setPivotActive = function (pivot, source) { if (source === void 0) { source = "api"; } if (this.pivotActive !== pivot) { this.pivotActive = pivot; this.eventService.dispatchEvent(this.createColumnEvent('columnPivotChanged', source)); } }; /** Returns `true` if pivot is currently active for this column. */ Column.prototype.isPivotActive = function () { return this.pivotActive; }; Column.prototype.isAnyFunctionActive = function () { return this.isPivotActive() || this.isRowGroupActive() || this.isValueActive(); }; Column.prototype.isAnyFunctionAllowed = function () { return this.isAllowPivot() || this.isAllowRowGroup() || this.isAllowValue(); }; Column.prototype.setValueActive = function (value, source) { if (source === void 0) { source = "api"; } if (this.aggregationActive !== value) { this.aggregationActive = value; this.eventService.dispatchEvent(this.createColumnEvent('columnValueChanged', source)); } }; /** Returns `true` if value (aggregation) is currently active for this column. */ Column.prototype.isValueActive = function () { return this.aggregationActive; }; Column.prototype.isAllowPivot = function () { return this.colDef.enablePivot === true; }; Column.prototype.isAllowValue = function () { return this.colDef.enableValue === true; }; Column.prototype.isAllowRowGroup = function () { return this.colDef.enableRowGroup === true; }; Column.prototype.getMenuTabs = function (defaultValues) { var menuTabs = this.getColDef().menuTabs; if (menuTabs == null) { menuTabs = defaultValues; } return menuTabs; }; // + renderedHeaderCell - for making header cell transparent when moving Column.EVENT_MOVING_CHANGED = 'movingChanged'; // + renderedCell - changing left position Column.EVENT_LEFT_CHANGED = 'leftChanged'; // + renderedCell - changing width Column.EVENT_WIDTH_CHANGED = 'widthChanged'; // + renderedCell - for changing pinned classes Column.EVENT_LAST_LEFT_PINNED_CHANGED = 'lastLeftPinnedChanged'; Column.EVENT_FIRST_RIGHT_PINNED_CHANGED = 'firstRightPinnedChanged'; // + renderedColumn - for changing visibility icon Column.EVENT_VISIBLE_CHANGED = 'visibleChanged'; // + every time the filter changes, used in the floating filters Column.EVENT_FILTER_CHANGED = 'filterChanged'; // + renderedHeaderCell - marks the header with filter icon Column.EVENT_FILTER_ACTIVE_CHANGED = 'filterActiveChanged'; // + renderedHeaderCell - marks the header with sort icon Column.EVENT_SORT_CHANGED = 'sortChanged'; // + renderedHeaderCell - marks the header with sort icon Column.EVENT_COL_DEF_CHANGED = 'colDefChanged'; Column.EVENT_MENU_VISIBLE_CHANGED = 'menuVisibleChanged'; // + toolpanel, for gui updates Column.EVENT_ROW_GROUP_CHANGED = 'columnRowGroupChanged'; // + toolpanel, for gui updates Column.EVENT_PIVOT_CHANGED = 'columnPivotChanged'; // + toolpanel, for gui updates Column.EVENT_VALUE_CHANGED = 'columnValueChanged'; __decorate$1([ Autowired('gridOptionsService') ], Column.prototype, "gridOptionsService", void 0); __decorate$1([ Autowired('columnUtils') ], Column.prototype, "columnUtils", void 0); __decorate$1([ PostConstruct ], Column.prototype, "initialise", null); return Column; }()); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __decorate$2 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var ProvidedColumnGroup = /** @class */ (function () { function ProvidedColumnGroup(colGroupDef, groupId, padding, level) { this.localEventService = new EventService(); this.expandable = false; // used by React (and possibly other frameworks) as key for rendering. also used to // identify old vs new columns for destroying cols when no longer used. this.instanceId = getNextColInstanceId(); this.expandableListenerRemoveCallback = null; this.colGroupDef = colGroupDef; this.groupId = groupId; this.expanded = !!colGroupDef && !!colGroupDef.openByDefault; this.padding = padding; this.level = level; } ProvidedColumnGroup.prototype.destroy = function () { if (this.expandableListenerRemoveCallback) { this.reset(null, undefined); } }; ProvidedColumnGroup.prototype.reset = function (colGroupDef, level) { this.colGroupDef = colGroupDef; this.level = level; this.originalParent = null; if (this.expandableListenerRemoveCallback) { this.expandableListenerRemoveCallback(); } // we use ! below, as we want to set the object back to the // way it was when it was first created this.children = undefined; this.expandable = undefined; }; ProvidedColumnGroup.prototype.getInstanceId = function () { return this.instanceId; }; ProvidedColumnGroup.prototype.setOriginalParent = function (originalParent) { this.originalParent = originalParent; }; ProvidedColumnGroup.prototype.getOriginalParent = function () { return this.originalParent; }; ProvidedColumnGroup.prototype.getLevel = function () { return this.level; }; ProvidedColumnGroup.prototype.isVisible = function () { // return true if at least one child is visible if (this.children) { return this.children.some(function (child) { return child.isVisible(); }); } return false; }; ProvidedColumnGroup.prototype.isPadding = function () { return this.padding; }; ProvidedColumnGroup.prototype.setExpanded = function (expanded) { this.expanded = expanded === undefined ? false : expanded; var event = { type: ProvidedColumnGroup.EVENT_EXPANDED_CHANGED }; this.localEventService.dispatchEvent(event); }; ProvidedColumnGroup.prototype.isExpandable = function () { return this.expandable; }; ProvidedColumnGroup.prototype.isExpanded = function () { return this.expanded; }; ProvidedColumnGroup.prototype.getGroupId = function () { return this.groupId; }; ProvidedColumnGroup.prototype.getId = function () { return this.getGroupId(); }; ProvidedColumnGroup.prototype.setChildren = function (children) { this.children = children; }; ProvidedColumnGroup.prototype.getChildren = function () { return this.children; }; ProvidedColumnGroup.prototype.getColGroupDef = function () { return this.colGroupDef; }; ProvidedColumnGroup.prototype.getLeafColumns = function () { var result = []; this.addLeafColumns(result); return result; }; ProvidedColumnGroup.prototype.addLeafColumns = function (leafColumns) { if (!this.children) { return; } this.children.forEach(function (child) { if (child instanceof Column) { leafColumns.push(child); } else if (child instanceof ProvidedColumnGroup) { child.addLeafColumns(leafColumns); } }); }; ProvidedColumnGroup.prototype.getColumnGroupShow = function () { var colGroupDef = this.colGroupDef; if (!colGroupDef) { return; } return colGroupDef.columnGroupShow; }; // need to check that this group has at least one col showing when both expanded and contracted. // if not, then we don't allow expanding and contracting on this group ProvidedColumnGroup.prototype.setupExpandable = function () { var _this = this; this.setExpandable(); if (this.expandableListenerRemoveCallback) { this.expandableListenerRemoveCallback(); } var listener = this.onColumnVisibilityChanged.bind(this); this.getLeafColumns().forEach(function (col) { return col.addEventListener('visibleChanged', listener); }); this.expandableListenerRemoveCallback = function () { _this.getLeafColumns().forEach(function (col) { return col.removeEventListener('visibleChanged', listener); }); _this.expandableListenerRemoveCallback = null; }; }; ProvidedColumnGroup.prototype.setExpandable = function () { if (this.isPadding()) { return; } // want to make sure the group doesn't disappear when it's open var atLeastOneShowingWhenOpen = false; // want to make sure the group doesn't disappear when it's closed var atLeastOneShowingWhenClosed = false; // want to make sure the group has something to show / hide var atLeastOneChangeable = false; var children = this.findChildrenRemovingPadding(); for (var i = 0, j = children.length; i < j; i++) { var abstractColumn = children[i]; if (!abstractColumn.isVisible()) { continue; } // if the abstractColumn is a grid generated group, there will be no colDef var headerGroupShow = abstractColumn.getColumnGroupShow(); if (headerGroupShow === 'open') { atLeastOneShowingWhenOpen = true; atLeastOneChangeable = true; } else if (headerGroupShow === 'closed') { atLeastOneShowingWhenClosed = true; atLeastOneChangeable = true; } else { atLeastOneShowingWhenOpen = true; atLeastOneShowingWhenClosed = true; } } var expandable = atLeastOneShowingWhenOpen && atLeastOneShowingWhenClosed && atLeastOneChangeable; if (this.expandable !== expandable) { this.expandable = expandable; var event_1 = { type: ProvidedColumnGroup.EVENT_EXPANDABLE_CHANGED }; this.localEventService.dispatchEvent(event_1); } }; ProvidedColumnGroup.prototype.findChildrenRemovingPadding = function () { var res = []; var process = function (items) { items.forEach(function (item) { // if padding, we add this children instead of the padding var skipBecausePadding = item instanceof ProvidedColumnGroup && item.isPadding(); if (skipBecausePadding) { process(item.children); } else { res.push(item); } }); }; process(this.children); return res; }; ProvidedColumnGroup.prototype.onColumnVisibilityChanged = function () { this.setExpandable(); }; ProvidedColumnGroup.prototype.addEventListener = function (eventType, listener) { this.localEventService.addEventListener(eventType, listener); }; ProvidedColumnGroup.prototype.removeEventListener = function (eventType, listener) { this.localEventService.removeEventListener(eventType, listener); }; ProvidedColumnGroup.EVENT_EXPANDED_CHANGED = 'expandedChanged'; ProvidedColumnGroup.EVENT_EXPANDABLE_CHANGED = 'expandableChanged'; __decorate$2([ PreDestroy ], ProvidedColumnGroup.prototype, "destroy", null); return ProvidedColumnGroup; }()); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var DefaultColumnTypes = { numericColumn: { headerClass: 'ag-right-aligned-header', cellClass: 'ag-right-aligned-cell' }, rightAligned: { headerClass: 'ag-right-aligned-header', cellClass: 'ag-right-aligned-cell' } }; /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ function firstExistingValue() { var values = []; for (var _i = 0; _i < arguments.length; _i++) { values[_i] = arguments[_i]; } for (var i = 0; i < values.length; i++) { var value = values[i]; if (exists(value)) { return value; } } return null; } function existsAndNotEmpty(value) { return value != null && value.length > 0; } function last(arr) { if (!arr || !arr.length) { return; } return arr[arr.length - 1]; } function areEqual(a, b, comparator) { if (a == null && b == null) { return true; } return a != null && b != null && a.length === b.length && a.every(function (value, index) { return comparator ? comparator(value, b[index]) : b[index] === value; }); } /** @deprecated */ function shallowCompare(arr1, arr2) { return areEqual(arr1, arr2); } function sortNumerically(array) { return array.sort(function (a, b) { return a - b; }); } function removeRepeatsFromArray(array, object) { if (!array) { return; } for (var index = array.length - 2; index >= 0; index--) { var thisOneMatches = array[index] === object; var nextOneMatches = array[index + 1] === object; if (thisOneMatches && nextOneMatches) { array.splice(index + 1, 1); } } } function removeFromArray(array, object) { var index = array.indexOf(object); if (index >= 0) { array.splice(index, 1); } } function removeAllFromArray(array, toRemove) { toRemove.forEach(function (item) { return removeFromArray(array, item); }); } function insertIntoArray(array, object, toIndex) { array.splice(toIndex, 0, object); } function insertArrayIntoArray(dest, src, toIndex) { if (dest == null || src == null) { return; } // put items in backwards, otherwise inserted items end up in reverse order for (var i = src.length - 1; i >= 0; i--) { var item = src[i]; insertIntoArray(dest, item, toIndex); } } function moveInArray(array, objectsToMove, toIndex) { // first take out items from the array removeAllFromArray(array, objectsToMove); // now add the objects, in same order as provided to us, that means we start at the end // as the objects will be pushed to the right as they are inserted objectsToMove.slice().reverse().forEach(function (obj) { return insertIntoArray(array, obj, toIndex); }); } function includes(array, value) { return array.indexOf(value) > -1; } function flatten(arrayOfArrays) { return [].concat.apply([], arrayOfArrays); } function pushAll(target, source) { if (source == null || target == null) { return; } source.forEach(function (value) { return target.push(value); }); } function toStrings(array) { return array.map(toStringOrNull); } function forEachReverse(list, action) { if (list == null) { return; } for (var i = list.length - 1; i >= 0; i--) { action(list[i], i); } } var ArrayUtils = /*#__PURE__*/Object.freeze({ firstExistingValue: firstExistingValue, existsAndNotEmpty: existsAndNotEmpty, last: last, areEqual: areEqual, shallowCompare: shallowCompare, sortNumerically: sortNumerically, removeRepeatsFromArray: removeRepeatsFromArray, removeFromArray: removeFromArray, removeAllFromArray: removeAllFromArray, insertIntoArray: insertIntoArray, insertArrayIntoArray: insertArrayIntoArray, moveInArray: moveInArray, includes: includes, flatten: flatten, pushAll: pushAll, toStrings: toStrings, forEachReverse: forEachReverse }); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var AG_GRID_STOP_PROPAGATION = '__ag_Grid_Stop_Propagation'; var PASSIVE_EVENTS = ['touchstart', 'touchend', 'touchmove', 'touchcancel', 'scroll']; var supports = {}; /** * a user once raised an issue - they said that when you opened a popup (eg context menu) * and then clicked on a selection checkbox, the popup wasn't closed. this is because the * popup listens for clicks on the body, however ag-grid WAS stopping propagation on the * checkbox clicks (so the rows didn't pick them up as row selection selection clicks). * to get around this, we have a pattern to stop propagation for the purposes of AG Grid, * but we still let the event pass back to the body. * @param {Event} event */ function stopPropagationForAgGrid(event) { event[AG_GRID_STOP_PROPAGATION] = true; } function isStopPropagationForAgGrid(event) { return event[AG_GRID_STOP_PROPAGATION] === true; } var isEventSupported = (function () { var tags = { select: 'input', change: 'input', submit: 'form', reset: 'form', error: 'img', load: 'img', abort: 'img' }; var eventChecker = function (eventName) { if (typeof supports[eventName] === 'boolean') { return supports[eventName]; } var el = document.createElement(tags[eventName] || 'div'); eventName = 'on' + eventName; return supports[eventName] = (eventName in el); }; return eventChecker; })(); function getCtrlForEvent(gridOptionsService, event, type) { var sourceElement = event.target; while (sourceElement) { var renderedComp = gridOptionsService.getDomData(sourceElement, type); if (renderedComp) { return renderedComp; } sourceElement = sourceElement.parentElement; } return null; } function isElementInEventPath(element, event) { if (!event || !element) { return false; } return getEventPath(event).indexOf(element) >= 0; } function createEventPath(event) { var res = []; var pointer = event.target; while (pointer) { res.push(pointer); pointer = pointer.parentElement; } return res; } /** * Gets the path for a browser Event or from the target on an AG Grid Event * https://developer.mozilla.org/en-US/docs/Web/API/Event * @param {Event| { target: EventTarget }} event * @returns {EventTarget[]} */ function getEventPath(event) { // This can be called with either a browser event or an AG Grid Event that has a target property. var eventNoType = event; if (eventNoType.path) { return eventNoType.path; } if (eventNoType.composedPath) { return eventNoType.composedPath(); } // If this is an AG Grid event build the path ourselves return createEventPath(eventNoType); } function addSafePassiveEventListener(frameworkOverrides, eElement, event, listener) { var isPassive = includes(PASSIVE_EVENTS, event); var options = isPassive ? { passive: true } : undefined; // this check is here for certain scenarios where I believe the user must be destroying // the grid somehow but continuing for it to be used if (frameworkOverrides && frameworkOverrides.addEventListener) { frameworkOverrides.addEventListener(eElement, event, listener, options); } } var EventUtils = /*#__PURE__*/Object.freeze({ stopPropagationForAgGrid: stopPropagationForAgGrid, isStopPropagationForAgGrid: isStopPropagationForAgGrid, isEventSupported: isEventSupported, getCtrlForEvent: getCtrlForEvent, isElementInEventPath: isElementInEventPath, createEventPath: createEventPath, getEventPath: getEventPath, addSafePassiveEventListener: addSafePassiveEventListener }); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __decorate$3 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var BeanStub = /** @class */ (function () { function BeanStub() { var _this = this; this.destroyFunctions = []; this.destroyed = false; // for vue 3 - prevents Vue from trying to make this (and obviously any sub classes) from being reactive // prevents vue from creating proxies for created objects and prevents identity related issues this.__v_skip = true; this.isAlive = function () { return !_this.destroyed; }; } // this was a test constructor niall built, when active, it prints after 5 seconds all beans/components that are // not destroyed. to use, create a new grid, then api.destroy() before 5 seconds. then anything that gets printed // points to a bean or component that was not properly disposed of. // constructor() { // setTimeout(()=> { // if (this.isAlive()) { // let prototype: any = Object.getPrototypeOf(this); // const constructor: any = prototype.constructor; // const constructorString = constructor.toString(); // const beanName = constructorString.substring(9, constructorString.indexOf("(")); // console.log('is alive ' + beanName); // } // }, 5000); // } // CellComp and GridComp and override this because they get the FrameworkOverrides from the Beans bean BeanStub.prototype.getFrameworkOverrides = function () { return this.frameworkOverrides; }; BeanStub.prototype.getContext = function () { return this.context; }; BeanStub.prototype.destroy = function () { // let prototype: any = Object.getPrototypeOf(this); // const constructor: any = prototype.constructor; // const constructorString = constructor.toString(); // const beanName = constructorString.substring(9, constructorString.indexOf("(")); this.destroyFunctions.forEach(function (func) { return func(); }); this.destroyFunctions.length = 0; this.destroyed = true; this.dispatchEvent({ type: BeanStub.EVENT_DESTROYED }); }; BeanStub.prototype.addEventListener = function (eventType, listener) { if (!this.localEventService) { this.localEventService = new EventService(); } this.localEventService.addEventListener(eventType, listener); }; BeanStub.prototype.removeEventListener = function (eventType, listener) { if (this.localEventService) { this.localEventService.removeEventListener(eventType, listener); } }; BeanStub.prototype.dispatchEventAsync = function (event) { var _this = this; window.setTimeout(function () { return _this.dispatchEvent(event); }, 0); }; BeanStub.prototype.dispatchEvent = function (event) { if (this.localEventService) { this.localEventService.dispatchEvent(event); } }; BeanStub.prototype.addManagedListener = function (object, event, listener) { var _this = this; if (this.destroyed) { return; } if (object instanceof HTMLElement) { addSafePassiveEventListener(this.getFrameworkOverrides(), object, event, listener); } else { object.addEventListener(event, listener); } var destroyFunc = function () { object.removeEventListener(event, listener); _this.destroyFunctions = _this.destroyFunctions.filter(function (fn) { return fn !== destroyFunc; }); return null; }; this.destroyFunctions.push(destroyFunc); return destroyFunc; }; BeanStub.prototype.addManagedPropertyListener = function (event, listener) { var _this = this; if (this.destroyed) { return; } this.gridOptionsService.addEventListener(event, listener); var destroyFunc = function () { _this.gridOptionsService.removeEventListener(event, listener); _this.destroyFunctions = _this.destroyFunctions.filter(function (fn) { return fn !== destroyFunc; }); return null; }; this.destroyFunctions.push(destroyFunc); return destroyFunc; }; BeanStub.prototype.addDestroyFunc = function (func) { // if we are already destroyed, we execute the func now if (this.isAlive()) { this.destroyFunctions.push(func); } else { func(); } }; BeanStub.prototype.createManagedBean = function (bean, context) { var res = this.createBean(bean, context); this.addDestroyFunc(this.destroyBean.bind(this, bean, context)); return res; }; BeanStub.prototype.createBean = function (bean, context, afterPreCreateCallback) { return (context || this.getContext()).createBean(bean, afterPreCreateCallback); }; BeanStub.prototype.destroyBean = function (bean, context) { return (context || this.getContext()).destroyBean(bean); }; BeanStub.prototype.destroyBeans = function (beans, context) { var _this = this; if (beans) { beans.forEach(function (bean) { return _this.destroyBean(bean, context); }); } return []; }; BeanStub.EVENT_DESTROYED = 'destroyed'; __decorate$3([ Autowired('frameworkOverrides') ], BeanStub.prototype, "frameworkOverrides", void 0); __decorate$3([ Autowired('context') ], BeanStub.prototype, "context", void 0); __decorate$3([ Autowired('eventService') ], BeanStub.prototype, "eventService", void 0); __decorate$3([ Autowired('gridOptionsService') ], BeanStub.prototype, "gridOptionsService", void 0); __decorate$3([ Autowired('localeService') ], BeanStub.prototype, "localeService", void 0); __decorate$3([ Autowired('environment') ], BeanStub.prototype, "environment", void 0); __decorate$3([ PreDestroy ], BeanStub.prototype, "destroy", null); return BeanStub; }()); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __decorate$4 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var __param$1 = (undefined && undefined.__param) || function (paramIndex, decorator) { return function (target, key) { decorator(target, key, paramIndex); } }; // takes ColDefs and ColGroupDefs and turns them into Columns and OriginalGroups var ColumnFactory = /** @class */ (function (_super) { __extends(ColumnFactory, _super); function ColumnFactory() { return _super !== null && _super.apply(this, arguments) || this; } ColumnFactory.prototype.setBeans = function (loggerFactory) { this.logger = loggerFactory.create('ColumnFactory'); }; ColumnFactory.prototype.createColumnTree = function (defs, primaryColumns, existingTree) { // column key creator dishes out unique column id's in a deterministic way, // so if we have two grids (that could be master/slave) with same column definitions, // then this ensures the two grids use identical id's. var columnKeyCreator = new ColumnKeyCreator(); var _a = this.extractExistingTreeData(existingTree), existingCols = _a.existingCols, existingGroups = _a.existingGroups, existingColKeys = _a.existingColKeys; columnKeyCreator.addExistingKeys(existingColKeys); // create am unbalanced tree that maps the provided definitions var unbalancedTree = this.recursivelyCreateColumns(defs, 0, primaryColumns, existingCols, columnKeyCreator, existingGroups); var treeDept = this.findMaxDept(unbalancedTree, 0); this.logger.log('Number of levels for grouped columns is ' + treeDept); var columnTree = this.balanceColumnTree(unbalancedTree, 0, treeDept, columnKeyCreator); var deptFirstCallback = function (child, parent) { if (child instanceof ProvidedColumnGroup) { child.setupExpandable(); } // we set the original parents at the end, rather than when we go along, as balancing the tree // adds extra levels into the tree. so we can only set parents when balancing is done. child.setOriginalParent(parent); }; this.columnUtils.depthFirstOriginalTreeSearch(null, columnTree, deptFirstCallback); return { columnTree: columnTree, treeDept: treeDept }; }; ColumnFactory.prototype.extractExistingTreeData = function (existingTree) { var existingCols = []; var existingGroups = []; var existingColKeys = []; if (existingTree) { this.columnUtils.depthFirstOriginalTreeSearch(null, existingTree, function (item) { if (item instanceof ProvidedColumnGroup) { var group = item; existingGroups.push(group); } else { var col = item; existingColKeys.push(col.getId()); existingCols.push(col); } }); } return { existingCols: existingCols, existingGroups: existingGroups, existingColKeys: existingColKeys }; }; ColumnFactory.prototype.createForAutoGroups = function (autoGroupCols, gridBalancedTree) { var _this = this; return autoGroupCols.map(function (col) { return _this.createAutoGroupTreeItem(gridBalancedTree, col); }); }; ColumnFactory.prototype.createAutoGroupTreeItem = function (balancedColumnTree, column) { var dept = this.findDepth(balancedColumnTree); // at the end, this will be the top of the tree item. var nextChild = column; for (var i = dept - 1; i >= 0; i--) { var autoGroup = new ProvidedColumnGroup(null, "FAKE_PATH_" + column.getId() + "}_" + i, true, i); this.createBean(autoGroup); autoGroup.setChildren([nextChild]); nextChild.setOriginalParent(autoGroup); nextChild = autoGroup; } // at this point, the nextChild is the top most item in the tree return nextChild; }; ColumnFactory.prototype.findDepth = function (balancedColumnTree) { var dept = 0; var pointer = balancedColumnTree; while (pointer && pointer[0] && pointer[0] instanceof ProvidedColumnGroup) { dept++; pointer = pointer[0].getChildren(); } return dept; }; ColumnFactory.prototype.balanceColumnTree = function (unbalancedTree, currentDept, columnDept, columnKeyCreator) { var result = []; // go through each child, for groups, recurse a level deeper, // for columns we need to pad for (var i = 0; i < unbalancedTree.length; i++) { var child = unbalancedTree[i]; if (child instanceof ProvidedColumnGroup) { // child is a group, all we do is go to the next level of recursion var originalGroup = child; var newChildren = this.balanceColumnTree(originalGroup.getChildren(), currentDept + 1, columnDept, columnKeyCreator); originalGroup.setChildren(newChildren); result.push(originalGroup); } else { // child is a column - so here we add in the padded column groups if needed var firstPaddedGroup = void 0; var currentPaddedGroup = void 0; // this for loop will NOT run any loops if no padded column groups are needed for (var j = columnDept - 1; j >= currentDept; j--) { var newColId = columnKeyCreator.getUniqueKey(null, null); var colGroupDefMerged = this.createMergedColGroupDef(null); var paddedGroup = new ProvidedColumnGroup(colGroupDefMerged, newColId, true, currentDept); this.createBean(paddedGroup); if (currentPaddedGroup) { currentPaddedGroup.setChildren([paddedGroup]); } currentPaddedGroup = paddedGroup; if (!firstPaddedGroup) { firstPaddedGroup = currentPaddedGroup; } } // likewise this if statement will not run if no padded groups if (firstPaddedGroup && currentPaddedGroup) { result.push(firstPaddedGroup); var hasGroups = unbalancedTree.some(function (leaf) { return leaf instanceof ProvidedColumnGroup; }); if (hasGroups) { currentPaddedGroup.setChildren([child]); continue; } else { currentPaddedGroup.setChildren(unbalancedTree); break; } } result.push(child); } } return result; }; ColumnFactory.prototype.findMaxDept = function (treeChildren, dept) { var maxDeptThisLevel = dept; for (var i = 0; i < treeChildren.length; i++) { var abstractColumn = treeChildren[i]; if (abstractColumn instanceof ProvidedColumnGroup) { var originalGroup = abstractColumn; var newDept = this.findMaxDept(originalGroup.getChildren(), dept + 1); if (maxDeptThisLevel < newDept) { maxDeptThisLevel = newDept; } } } return maxDeptThisLevel; }; ColumnFactory.prototype.recursivelyCreateColumns = function (defs, level, primaryColumns, existingColsCopy, columnKeyCreator, existingGroups) { var _this = this; return (defs || []).map(function (def) { if (_this.isColumnGroup(def)) { return _this.createColumnGroup(primaryColumns, def, level, existingColsCopy, columnKeyCreator, existingGroups); } else { return _this.createColumn(primaryColumns, def, existingColsCopy, columnKeyCreator); } }); }; ColumnFactory.prototype.createColumnGroup = function (primaryColumns, colGroupDef, level, existingColumns, columnKeyCreator, existingGroups) { var colGroupDefMerged = this.createMergedColGroupDef(colGroupDef); var groupId = columnKeyCreator.getUniqueKey(colGroupDefMerged.groupId || null, null); var existingGroup = this.findExistingGroup(colGroupDef, existingGroups); var providedGroup; if (existingGroup) { providedGroup = existingGroup; providedGroup.reset(colGroupDefMerged, level); removeFromArray(existingGroups, existingGroup); } else { providedGroup = new ProvidedColumnGroup(colGroupDefMerged, groupId, false, level); this.createBean(providedGroup); } var children = this.recursivelyCreateColumns(colGroupDefMerged.children, level + 1, primaryColumns, existingColumns, columnKeyCreator, existingGroups); providedGroup.setChildren(children); return providedGroup; }; ColumnFactory.prototype.createMergedColGroupDef = function (colGroupDef) { var colGroupDefMerged = {}; Object.assign(colGroupDefMerged, this.gridOptionsService.get('defaultColGroupDef')); Object.assign(colGroupDefMerged, colGroupDef); return colGroupDefMerged; }; ColumnFactory.prototype.createColumn = function (primaryColumns, colDef, existingColsCopy, columnKeyCreator) { var colDefMerged = this.mergeColDefs(colDef); // see if column already exists var column = this.findExistingColumn(colDef, existingColsCopy); // make sure we remove, so if user provided duplicate id, then we don't have more than // one column instance for colDef with common id if (existingColsCopy && column) { removeFromArray(existingColsCopy, column); } if (!column) { // no existing column, need to create one var colId = columnKeyCreator.getUniqueKey(colDefMerged.colId, colDefMerged.field); column = new Column(colDefMerged, colDef, colId, primaryColumns); this.context.createBean(column); } else { column.setColDef(colDefMerged, colDef); this.applyColumnState(column, colDefMerged); } return column; }; ColumnFactory.prototype.applyColumnState = function (column, colDef) { // flex var flex = attrToNumber(colDef.flex); if (flex !== undefined) { column.setFlex(flex); } // width - we only set width if column is not flexing var noFlexThisCol = column.getFlex() <= 0; if (noFlexThisCol) { // both null and undefined means we skip, as it's not possible to 'clear' width (a column must have a width) var width = attrToNumber(colDef.width); if (width != null) { column.setActualWidth(width); } else { // otherwise set the width again, in case min or max width has changed, // and width needs to be adjusted. var widthBeforeUpdate = column.getActualWidth(); column.setActualWidth(widthBeforeUpdate); } } // sort - anything but undefined will set sort, thus null or empty string will clear the sort if (colDef.sort !== undefined) { if (colDef.sort == 'asc' || colDef.sort == 'desc') { column.setSort(colDef.sort); } else { column.setSort(undefined); } } // sorted at - anything but undefined, thus null will clear the sortIndex var sortIndex = attrToNumber(colDef.sortIndex); if (sortIndex !== undefined) { column.setSortIndex(sortIndex); } // hide - anything but undefined, thus null will clear the hide var hide = attrToBoolean(colDef.hide); if (hide !== undefined) { column.setVisible(!hide); } // pinned - anything but undefined, thus null or empty string will remove pinned if (colDef.pinned !== undefined) { column.setPinned(colDef.pinned); } }; ColumnFactory.prototype.findExistingColumn = function (newColDef, existingColsCopy) { return (existingColsCopy || []).find(function (existingCol) { var existingColDef = existingCol.getUserProvidedColDef(); if (!existingColDef) { return false; } var newHasId = newColDef.colId != null; var newHasField = newColDef.field != null; if (newHasId) { return existingCol.getId() === newColDef.colId; } if (newHasField) { return existingColDef.field === newColDef.field; } // if no id or field present, then try object equivalence. if (existingColDef === newColDef) { return true; } return false; }); }; ColumnFactory.prototype.findExistingGroup = function (newGroupDef, existingGroups) { return existingGroups.find(function (existingGroup) { var existingDef = existingGroup.getColGroupDef(); if (!existingDef) { return false; } var newHasId = newGroupDef.groupId != null; if (newHasId) { return existingGroup.getId() === newGroupDef.groupId; } return false; }); }; ColumnFactory.prototype.mergeColDefs = function (colDef) { // start with empty merged definition var colDefMerged = {}; // merge properties from default column definitions var defaultColDef = this.gridOptionsService.get('defaultColDef'); mergeDeep(colDefMerged, defaultColDef, false, true); // merge properties from column type properties var columnType = colDef.type; if (!columnType) { columnType = defaultColDef && defaultColDef.type; } // if type of both colDef and defaultColDef, then colDef gets preference if (columnType) { this.assignColumnTypes(columnType, colDefMerged); } // merge properties from column definitions mergeDeep(colDefMerged, colDef, false, true); var autoGroupColDef = this.gridOptionsService.get('autoGroupColumnDef'); var isSortingCoupled = this.gridOptionsService.isColumnsSortingCoupledToGroup(); if (colDef.rowGroup && autoGroupColDef && isSortingCoupled) { // override the sort for row group columns where the autoGroupColDef defines these values. mergeDeep(colDefMerged, { sort: autoGroupColDef.sort, initialSort: autoGroupColDef.initialSort }, false, true); } return colDefMerged; }; ColumnFactory.prototype.assignColumnTypes = function (type, colDefMerged) { var typeKeys = []; if (type instanceof Array) { var invalidArray = type.some(function (a) { return typeof a !== 'string'; }); if (invalidArray) { console.warn("AG Grid: if colDef.type is supplied an array it should be of type 'string[]'"); } else { typeKeys = type; } } else if (typeof type === 'string') { typeKeys = type.split(','); } else { console.warn("AG Grid: colDef.type should be of type 'string' | 'string[]'"); return; } // merge user defined with default column types var allColumnTypes = Object.assign({}, DefaultColumnTypes); var userTypes = this.gridOptionsService.get('columnTypes') || {}; iterateObject(userTypes, function (key, value) { if (key in allColumnTypes) { console.warn("AG Grid: the column type '" + key + "' is a default column type and cannot be overridden."); } else { allColumnTypes[key] = value; } }); typeKeys.forEach(function (t) { var typeColDef = allColumnTypes[t.trim()]; if (typeColDef) { mergeDeep(colDefMerged, typeColDef, false, true); } else { console.warn("AG Grid: colDef.type '" + t + "' does not correspond to defined gridOptions.columnTypes"); } }); }; // if object has children, we assume it's a group ColumnFactory.prototype.isColumnGroup = function (abstractColDef) { return abstractColDef.children !== undefined; }; __decorate$4([ Autowired('columnUtils') ], ColumnFactory.prototype, "columnUtils", void 0); __decorate$4([ __param$1(0, Qualifier('loggerFactory')) ], ColumnFactory.prototype, "setBeans", null); ColumnFactory = __decorate$4([ Bean('columnFactory') ], ColumnFactory); return ColumnFactory; }(BeanStub)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var ColDefUtil = /** @class */ (function () { function ColDefUtil() { } ColDefUtil.ColDefPropertyMap = { headerName: undefined, columnGroupShow: undefined, headerClass: undefined, toolPanelClass: undefined, headerValueGetter: undefined, pivotKeys: undefined, groupId: undefined, colId: undefined, sort: undefined, initialSort: undefined, field: undefined, type: undefined, tooltipComponent: undefined, tooltipField: undefined, headerTooltip: undefined, cellClass: undefined, showRowGroup: undefined, filter: undefined, initialAggFunc: undefined, defaultAggFunc: undefined, aggFunc: undefined, pinned: undefined, initialPinned: undefined, chartDataType: undefined, cellEditorPopupPosition: undefined, headerGroupComponent: undefined, headerGroupComponentFramework: undefined, headerGroupComponentParams: undefined, cellStyle: undefined, cellRenderer: undefined, cellRendererParams: undefined, cellRendererFramework: undefined, cellEditor: undefined, cellEditorFramework: undefined, cellEditorParams: undefined, filterFramework: undefined, filterParams: undefined, pivotValueColumn: undefined, headerComponent: undefined, headerComponentFramework: undefined, headerComponentParams: undefined, floatingFilterComponent: undefined, floatingFilterComponentParams: undefined, floatingFilterComponentFramework: undefined, tooltipComponentParams: undefined, tooltipComponentFramework: undefined, refData: undefined, columnsMenuParams: undefined, children: undefined, sortingOrder: undefined, allowedAggFuncs: undefined, menuTabs: undefined, pivotTotalColumnIds: undefined, cellClassRules: undefined, icons: undefined, sortIndex: undefined, initialSortIndex: undefined, flex: undefined, initialFlex: undefined, width: undefined, initialWidth: undefined, minWidth: undefined, maxWidth: undefined, rowGroupIndex: undefined, initialRowGroupIndex: undefined, pivotIndex: undefined, initialPivotIndex: undefined, suppressCellFlash: undefined, suppressColumnsToolPanel: undefined, suppressFiltersToolPanel: undefined, openByDefault: undefined, marryChildren: undefined, hide: undefined, initialHide: undefined, rowGroup: undefined, initialRowGroup: undefined, pivot: undefined, initialPivot: undefined, checkboxSelection: undefined, showDisabledCheckboxes: undefined, headerCheckboxSelection: undefined, headerCheckboxSelectionFilteredOnly: undefined, headerCheckboxSelectionCurrentPageOnly: undefined, suppressMenu: undefined, suppressMovable: undefined, lockPosition: undefined, lockVisible: undefined, lockPinned: undefined, unSortIcon: undefined, suppressSizeToFit: undefined, suppressAutoSize: undefined, enableRowGroup: undefined, enablePivot: undefined, enableValue: undefined, editable: undefined, suppressPaste: undefined, suppressNavigable: undefined, enableCellChangeFlash: undefined, rowDrag: undefined, dndSource: undefined, autoHeight: undefined, wrapText: undefined, sortable: undefined, resizable: undefined, singleClickEdit: undefined, floatingFilter: undefined, cellEditorPopup: undefined, suppressFillHandle: undefined, wrapHeaderText: undefined, autoHeaderHeight: undefined, dndSourceOnRowDrag: undefined, valueGetter: undefined, valueSetter: undefined, filterValueGetter: undefined, keyCreator: undefined, valueFormatter: undefined, valueParser: undefined, comparator: undefined, equals: undefined, pivotComparator: undefined, suppressKeyboardEvent: undefined, suppressHeaderKeyboardEvent: undefined, colSpan: undefined, rowSpan: undefined, getQuickFilterText: undefined, onCellValueChanged: undefined, onCellClicked: undefined, onCellDoubleClicked: undefined, onCellContextMenu: undefined, rowDragText: undefined, tooltipValueGetter: undefined, cellRendererSelector: undefined, cellEditorSelector: undefined, spanHeaderHeight: undefined }; ColDefUtil.ALL_PROPERTIES = Object.keys(ColDefUtil.ColDefPropertyMap); // used when doing property checks - this causes noise when using frameworks which can add their own fw specific // properties to colDefs, gridOptions etc ColDefUtil.FRAMEWORK_PROPERTIES = [ '__ob__', '__v_skip', '__metadata__', 'mappedColumnProperties', 'hasChildColumns', 'toColDef', 'createColDefFromGridColumn' ]; return ColDefUtil; }()); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var Events = /** @class */ (function () { function Events() { } /** Everything has changed with the columns. Either complete new set of columns set, or user called applyColumnState() */ /** @deprecated - grid no longer uses this, and setSate() also fires individual events */ Events.EVENT_COLUMN_EVERYTHING_CHANGED = 'columnEverythingChanged'; /** User has set in new columns. */ Events.EVENT_NEW_COLUMNS_LOADED = 'newColumnsLoaded'; /** The pivot mode flag was changed */ Events.EVENT_COLUMN_PIVOT_MODE_CHANGED = 'columnPivotModeChanged'; /** A row group column was added, removed or order changed. */ Events.EVENT_COLUMN_ROW_GROUP_CHANGED = 'columnRowGroupChanged'; /** expandAll / collapseAll was called from the api. */ Events.EVENT_EXPAND_COLLAPSE_ALL = 'expandOrCollapseAll'; /** A pivot column was added, removed or order changed. */ Events.EVENT_COLUMN_PIVOT_CHANGED = 'columnPivotChanged'; /** The list of grid columns has changed. */ Events.EVENT_GRID_COLUMNS_CHANGED = 'gridColumnsChanged'; /** A value column was added, removed or agg function was changed. */ Events.EVENT_COLUMN_VALUE_CHANGED = 'columnValueChanged'; /** A column was moved */ Events.EVENT_COLUMN_MOVED = 'columnMoved'; /** One or more columns was shown / hidden */ Events.EVENT_COLUMN_VISIBLE = 'columnVisible'; /** One or more columns was pinned / unpinned*/ Events.EVENT_COLUMN_PINNED = 'columnPinned'; /** A column group was opened / closed */ Events.EVENT_COLUMN_GROUP_OPENED = 'columnGroupOpened'; /** One or more columns was resized. If just one, the column in the event is set. */ Events.EVENT_COLUMN_RESIZED = 'columnResized'; /** The list of displayed columns has changed, can result from columns open / close, column move, pivot, group, etc */ Events.EVENT_DISPLAYED_COLUMNS_CHANGED = 'displayedColumnsChanged'; /** The list of virtual columns has changed, results from viewport changing */ Events.EVENT_VIRTUAL_COLUMNS_CHANGED = 'virtualColumnsChanged'; /** Async Transactions Executed */ Events.EVENT_ASYNC_TRANSACTIONS_FLUSHED = 'asyncTransactionsFlushed'; /** A row group was opened / closed */ Events.EVENT_ROW_GROUP_OPENED = 'rowGroupOpened'; /** @deprecated v28 use EVENT_ROW_DATA_UPDATED instead */ Events.EVENT_ROW_DATA_CHANGED = 'rowDataChanged'; /** The client has updated data for the grid */ Events.EVENT_ROW_DATA_UPDATED = 'rowDataUpdated'; /** The client has set new floating data into the grid */ Events.EVENT_PINNED_ROW_DATA_CHANGED = 'pinnedRowDataChanged'; /** Range selection has changed */ Events.EVENT_RANGE_SELECTION_CHANGED = 'rangeSelectionChanged'; /** Chart was created */ Events.EVENT_CHART_CREATED = 'chartCreated'; /** Chart Range selection has changed */ Events.EVENT_CHART_RANGE_SELECTION_CHANGED = 'chartRangeSelectionChanged'; /** Chart Options have changed */ Events.EVENT_CHART_OPTIONS_CHANGED = 'chartOptionsChanged'; /** Chart was destroyed */ Events.EVENT_CHART_DESTROYED = 'chartDestroyed'; /** For when the tool panel is shown / hidden */ Events.EVENT_TOOL_PANEL_VISIBLE_CHANGED = 'toolPanelVisibleChanged'; Events.EVENT_TOOL_PANEL_SIZE_CHANGED = 'toolPanelSizeChanged'; /** * This is a replacement event for EVENT_TOOL_PANEL_VISIBLE_CHANGED. In v30, the original event interface will be dropped * and replaced with the new event (but using the old event type and interface name) */ Events.EVENT_INTERNAL_TOOL_PANEL_VISIBLE_CHANGED = 'internalToolPanelVisibleChanged'; Events.EVENT_COLUMN_PANEL_ITEM_DRAG_START = 'columnPanelItemDragStart'; Events.EVENT_COLUMN_PANEL_ITEM_DRAG_END = 'columnPanelItemDragEnd'; /** Model was updated - grid updates the drawn rows when this happens */ Events.EVENT_MODEL_UPDATED = 'modelUpdated'; Events.EVENT_PASTE_START = 'pasteStart'; Events.EVENT_PASTE_END = 'pasteEnd'; Events.EVENT_FILL_START = 'fillStart'; Events.EVENT_FILL_END = 'fillEnd'; /** Undo operation has started. */ Events.EVENT_UNDO_STARTED = 'undoStarted'; /** Undo operation has ended. */ Events.EVENT_UNDO_ENDED = 'undoEnded'; /** Redo operation has started. */ Events.EVENT_REDO_STARTED = 'redoStarted'; /** Redo operation has ended. */ Events.EVENT_REDO_ENDED = 'redoEnded'; Events.EVENT_KEY_SHORTCUT_CHANGED_CELL_START = 'keyShortcutChangedCellStart'; Events.EVENT_KEY_SHORTCUT_CHANGED_CELL_END = 'keyShortcutChangedCellEnd'; Events.EVENT_CELL_CLICKED = 'cellClicked'; Events.EVENT_CELL_DOUBLE_CLICKED = 'cellDoubleClicked'; Events.EVENT_CELL_MOUSE_DOWN = 'cellMouseDown'; Events.EVENT_CELL_CONTEXT_MENU = 'cellContextMenu'; Events.EVENT_CELL_VALUE_CHANGED = 'cellValueChanged'; Events.EVENT_CELL_EDIT_REQUEST = 'cellEditRequest'; Events.EVENT_ROW_VALUE_CHANGED = 'rowValueChanged'; Events.EVENT_CELL_FOCUSED = 'cellFocused'; Events.EVENT_CELL_FOCUS_CLEARED = 'cellFocusCleared'; Events.EVENT_FULL_WIDTH_ROW_FOCUSED = 'fullWidthRowFocused'; Events.EVENT_ROW_SELECTED = 'rowSelected'; Events.EVENT_SELECTION_CHANGED = 'selectionChanged'; Events.EVENT_CELL_KEY_DOWN = 'cellKeyDown'; Events.EVENT_CELL_KEY_PRESS = 'cellKeyPress'; Events.EVENT_CELL_MOUSE_OVER = 'cellMouseOver'; Events.EVENT_CELL_MOUSE_OUT = 'cellMouseOut'; /** 2 events for filtering. The grid LISTENS for filterChanged and afterFilterChanged */ Events.EVENT_FILTER_CHANGED = 'filterChanged'; /** Filter was change but not applied. Only useful if apply buttons are used in filters. */ Events.EVENT_FILTER_MODIFIED = 'filterModified'; Events.EVENT_FILTER_OPENED = 'filterOpened'; Events.EVENT_SORT_CHANGED = 'sortChanged'; /** A row was removed from the dom, for any reason. Use to clean up resources (if any) used by the row. */ Events.EVENT_VIRTUAL_ROW_REMOVED = 'virtualRowRemoved'; Events.EVENT_ROW_CLICKED = 'rowClicked'; Events.EVENT_ROW_DOUBLE_CLICKED = 'rowDoubleClicked'; /** Gets called once after the grid has finished initialising. */ Events.EVENT_GRID_READY = 'gridReady'; /** Width of height of the main grid div has changed. Grid listens for this and does layout of grid if it's * changed, so always filling the space it was given. */ Events.EVENT_GRID_SIZE_CHANGED = 'gridSizeChanged'; /** The indexes of the rows rendered has changed, eg user has scrolled to a new vertical position. */ Events.EVENT_VIEWPORT_CHANGED = 'viewportChanged'; /* The width of the scrollbar has been calculated */ Events.EVENT_SCROLLBAR_WIDTH_CHANGED = 'scrollbarWidthChanged'; /** Rows were rendered for the first time (ie on async data load). */ Events.EVENT_FIRST_DATA_RENDERED = 'firstDataRendered'; /** A column drag has started, either resizing a column or moving a column. */ Events.EVENT_DRAG_STARTED = 'dragStarted'; /** A column drag has stopped */ Events.EVENT_DRAG_STOPPED = 'dragStopped'; Events.EVENT_CHECKBOX_CHANGED = 'checkboxChanged'; Events.EVENT_ROW_EDITING_STARTED = 'rowEditingStarted'; Events.EVENT_ROW_EDITING_STOPPED = 'rowEditingStopped'; Events.EVENT_CELL_EDITING_STARTED = 'cellEditingStarted'; Events.EVENT_CELL_EDITING_STOPPED = 'cellEditingStopped'; /** Main body of grid has scrolled, either horizontally or vertically */ Events.EVENT_BODY_SCROLL = 'bodyScroll'; /** Main body of the grid has stopped scrolling, either horizontally or vertically */ Events.EVENT_BODY_SCROLL_END = 'bodyScrollEnd'; Events.EVENT_HEIGHT_SCALE_CHANGED = 'heightScaleChanged'; /** The displayed page for pagination has changed. For example the data was filtered or sorted, * or the user has moved to a different page. */ Events.EVENT_PAGINATION_CHANGED = 'paginationChanged'; /** Only used by React, Angular, Web Components and VueJS AG Grid components * (not used if doing plain JavaScript). If the grid receives changes due * to bound properties, this event fires after the grid has finished processing the change. */ Events.EVENT_COMPONENT_STATE_CHANGED = 'componentStateChanged'; /***************************** INTERNAL EVENTS: START ******************************************* */ /** Please remember to add to ComponentUtil.EXCLUDED_INTERNAL_EVENTS to not have these events exposed to framework components. */ /** All items from here down are used internally by the grid, not intended for external use. */ // not documented, either experimental, or we just don't want users using an depending on them Events.EVENT_BODY_HEIGHT_CHANGED = 'bodyHeightChanged'; Events.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED = 'displayedColumnsWidthChanged'; Events.EVENT_SCROLL_VISIBILITY_CHANGED = 'scrollVisibilityChanged'; Events.EVENT_COLUMN_HOVER_CHANGED = 'columnHoverChanged'; Events.EVENT_FLASH_CELLS = 'flashCells'; Events.EVENT_PAGINATION_PIXEL_OFFSET_CHANGED = 'paginationPixelOffsetChanged'; Events.EVENT_DISPLAYED_ROWS_CHANGED = 'displayedRowsChanged'; Events.EVENT_LEFT_PINNED_WIDTH_CHANGED = 'leftPinnedWidthChanged'; Events.EVENT_RIGHT_PINNED_WIDTH_CHANGED = 'rightPinnedWidthChanged'; Events.EVENT_ROW_CONTAINER_HEIGHT_CHANGED = 'rowContainerHeightChanged'; Events.EVENT_HEADER_HEIGHT_CHANGED = 'headerHeightChanged'; Events.EVENT_COLUMN_HEADER_HEIGHT_CHANGED = 'columnHeaderHeightChanged'; Events.EVENT_ROW_DRAG_ENTER = 'rowDragEnter'; Events.EVENT_ROW_DRAG_MOVE = 'rowDragMove'; Events.EVENT_ROW_DRAG_LEAVE = 'rowDragLeave'; Events.EVENT_ROW_DRAG_END = 'rowDragEnd'; // environment Events.EVENT_GRID_STYLES_CHANGED = 'gridStylesChanged'; // primarily for charts Events.EVENT_POPUP_TO_FRONT = 'popupToFront'; // these are used for server side group and agg - only used by CS with Viewport Row Model - intention is // to design these better around server side functions and then release to general public when fully working with // all the row models. Events.EVENT_COLUMN_ROW_GROUP_CHANGE_REQUEST = 'columnRowGroupChangeRequest'; Events.EVENT_COLUMN_PIVOT_CHANGE_REQUEST = 'columnPivotChangeRequest'; Events.EVENT_COLUMN_VALUE_CHANGE_REQUEST = 'columnValueChangeRequest'; Events.EVENT_COLUMN_AGG_FUNC_CHANGE_REQUEST = 'columnAggFuncChangeRequest'; Events.EVENT_KEYBOARD_FOCUS = 'keyboardFocus'; Events.EVENT_MOUSE_FOCUS = 'mouseFocus'; Events.EVENT_STORE_UPDATED = 'storeUpdated'; Events.EVENT_FILTER_DESTROYED = 'filterDestroyed'; return Events; }()); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __read$2 = (undefined && undefined.__read) || function (o, n) { var m = typeof Symbol === "function" && o[Symbol.iterator]; if (!m) return o; var i = m.call(o), r, ar = [], e; try { while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); } catch (error) { e = { error: error }; } finally { try { if (r && !r.done && (m = i["return"])) m.call(i); } finally { if (e) throw e.error; } } return ar; }; var __spread$1 = (undefined && undefined.__spread) || function () { for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read$2(arguments[i])); return ar; }; /** * These keys are used for validating properties supplied on a gridOptions object, and for code generation. * If you change the properties on the gridOptions interface, you *must* update this file as well to be consistent. */ var PropertyKeys = /** @class */ (function () { function PropertyKeys() { } PropertyKeys.STRING_PROPERTIES = [ 'rowSelection', 'overlayLoadingTemplate', 'overlayNoRowsTemplate', 'quickFilterText', 'rowModelType', 'editType', 'domLayout', 'clipboardDelimiter', 'rowGroupPanelShow', 'multiSortKey', 'pivotColumnGroupTotals', 'pivotRowTotals', 'pivotPanelShow', 'fillHandleDirection', 'serverSideStoreType', 'groupDisplayType', 'treeDataDisplayType', 'colResizeDefault' ]; PropertyKeys.OBJECT_PROPERTIES = [ 'components', 'frameworkComponents', 'rowStyle', 'context', 'autoGroupColumnDef', 'localeText', 'icons', 'datasource', 'serverSideDatasource', 'viewportDatasource', 'groupRowRendererParams', 'aggFuncs', 'fullWidthCellRendererParams', 'defaultColGroupDef', 'defaultColDef', 'defaultCsvExportParams', 'defaultExcelExportParams', 'columnTypes', 'rowClassRules', 'detailCellRendererParams', 'loadingCellRendererParams', 'loadingOverlayComponentParams', 'noRowsOverlayComponentParams', 'popupParent', 'statusBar', 'sideBar', 'chartThemeOverrides', 'customChartThemes', 'chartToolPanelsDef' ]; PropertyKeys.ARRAY_PROPERTIES = [ 'sortingOrder', 'alignedGrids', 'rowData', 'columnDefs', 'excelStyles', 'pinnedTopRowData', 'pinnedBottomRowData', 'chartThemes', 'rowClass' ]; PropertyKeys.NUMBER_PROPERTIES = [ 'rowHeight', 'detailRowHeight', 'rowBuffer', 'headerHeight', 'groupHeaderHeight', 'floatingFiltersHeight', 'pivotHeaderHeight', 'pivotGroupHeaderHeight', 'groupDefaultExpanded', 'viewportRowModelPageSize', 'viewportRowModelBufferSize', 'autoSizePadding', 'maxBlocksInCache', 'maxConcurrentDatasourceRequests', 'tooltipShowDelay', 'tooltipHideDelay', 'cacheOverflowSize', 'paginationPageSize', 'cacheBlockSize', 'infiniteInitialRowCount', 'serverSideInitialRowCount', 'scrollbarWidth', 'asyncTransactionWaitMillis', 'blockLoadDebounceMillis', 'keepDetailRowsCount', 'undoRedoCellEditingLimit', 'cellFlashDelay', 'cellFadeDelay', 'tabIndex' ]; PropertyKeys.BOOLEAN_PROPERTIES = [ 'suppressMakeColumnVisibleAfterUnGroup', 'suppressRowClickSelection', 'suppressCellSelection', 'suppressCellFocus', 'suppressHorizontalScroll', 'alwaysShowHorizontalScroll', 'alwaysShowVerticalScroll', 'debug', 'enableBrowserTooltips', 'enableCellExpressions', 'groupSelectsChildren', 'groupIncludeFooter', 'groupIncludeTotalFooter', 'groupSuppressBlankHeader', 'suppressMenuHide', 'suppressRowDeselection', 'unSortIcon', 'suppressMultiSort', 'alwaysMultiSort', 'singleClickEdit', 'suppressLoadingOverlay', 'suppressNoRowsOverlay', 'suppressAutoSize', 'skipHeaderOnAutoSize', 'suppressParentsInRowNodes', 'suppressColumnMoveAnimation', 'suppressMovableColumns', 'suppressFieldDotNotation', 'enableRangeSelection', 'enableRangeHandle', 'enableFillHandle', 'suppressClearOnFillReduction', 'deltaSort', 'suppressTouch', 'suppressAsyncEvents', 'allowContextMenuWithControlKey', 'suppressContextMenu', 'rememberGroupStateWhenNewData', 'enableCellChangeFlash', 'suppressDragLeaveHidesColumns', 'suppressRowGroupHidesColumns', 'suppressMiddleClickScrolls', 'suppressPreventDefaultOnMouseWheel', 'suppressCopyRowsToClipboard', 'copyHeadersToClipboard', 'copyGroupHeadersToClipboard', 'pivotMode', 'suppressAggFuncInHeader', 'suppressColumnVirtualisation', 'suppressAggAtRootLevel', 'suppressFocusAfterRefresh', 'functionsPassive', 'functionsReadOnly', 'animateRows', 'groupSelectsFiltered', 'groupRemoveSingleChildren', 'groupRemoveLowestSingleChildren', 'enableRtl', 'suppressClickEdit', 'rowDragEntireRow', 'rowDragManaged', 'suppressRowDrag', 'suppressMoveWhenRowDragging', 'rowDragMultiRow', 'enableGroupEdit', 'embedFullWidthRows', 'suppressPaginationPanel', 'groupHideOpenParents', 'groupAllowUnbalanced', 'pagination', 'paginationAutoPageSize', 'suppressScrollOnNewData', 'suppressScrollWhenPopupsAreOpen', 'purgeClosedRowNodes', 'cacheQuickFilter', 'excludeHiddenColumnsFromQuickFilter', 'ensureDomOrder', 'accentedSort', 'suppressChangeDetection', 'valueCache', 'valueCacheNeverExpires', 'aggregateOnlyChangedColumns', 'suppressAnimationFrame', 'suppressExcelExport', 'suppressCsvExport', 'treeData', 'masterDetail', 'suppressMultiRangeSelection', 'enterMovesDownAfterEdit', 'enterMovesDown', 'suppressPropertyNamesCheck', 'rowMultiSelectWithClick', 'suppressRowHoverHighlight', 'suppressRowTransform', 'suppressClipboardPaste', 'suppressLastEmptyLineOnPaste', 'enableCharts', 'enableChartToolPanelsButton', 'suppressChartToolPanelsButton', 'suppressMaintainUnsortedOrder', 'enableCellTextSelection', 'suppressBrowserResizeObserver', 'suppressMaxRenderedRowRestriction', 'excludeChildrenWhenTreeDataFiltering', 'tooltipMouseTrack', 'keepDetailRows', 'paginateChildRows', 'preventDefaultOnContextMenu', 'undoRedoCellEditing', 'allowDragFromColumnsToolPanel', 'immutableData', 'pivotSuppressAutoColumn', 'suppressExpandablePivotGroups', 'debounceVerticalScrollbar', 'detailRowAutoHeight', 'serverSideFilteringAlwaysResets', 'serverSideSortingAlwaysResets', 'serverSideSortAllLevels', 'serverSideFilterAllLevels', 'serverSideSortOnServer', 'serverSideFilterOnServer', 'suppressAggFilteredOnly', 'showOpenedGroup', 'suppressClipboardApi', 'suppressModelUpdateAfterUpdateTransaction', 'stopEditingWhenCellsLoseFocus', 'maintainColumnOrder', 'groupMaintainOrder', 'columnHoverHighlight', 'reactUi', 'suppressReactUi', 'readOnlyEdit', 'suppressRowVirtualisation', 'enableCellEditingOnBackspace', 'resetRowDataOnUpdate', 'removePivotHeaderRowWhenSingleValueColumn', 'suppressCopySingleCellRanges', 'groupRowsSticky', 'suppressServerSideInfiniteScroll', 'rowGroupPanelSuppressSort', 'allowShowChangeAfterFilter', 'suppressCutToClipboard' ]; /** You do not need to include event callbacks in this list, as they are generated automatically. */ PropertyKeys.FUNCTIONAL_PROPERTIES = [ 'localeTextFunc', 'doesExternalFilterPass', 'groupRowAggNodes', 'isFullWidthCell', 'processSecondaryColDef', 'processSecondaryColGroupDef', 'processPivotResultColDef', 'processPivotResultColGroupDef', 'getBusinessKeyForNode', 'isRowSelectable', 'postSort', 'defaultGroupOrderComparator', 'rowDragText', 'groupRowRenderer', 'groupRowRendererFramework', 'fullWidthCellRenderer', 'fullWidthCellRendererFramework', 'loadingCellRenderer', 'loadingCellRendererFramework', 'loadingOverlayComponent', 'loadingOverlayComponentFramework', 'noRowsOverlayComponent', 'noRowsOverlayComponentFramework', 'detailCellRenderer', 'detailCellRendererFramework' ]; PropertyKeys.CALLBACK_PROPERTIES = [ 'getLocaleText', 'isExternalFilterPresent', 'getRowHeight', 'getRowClass', 'getRowStyle', 'getContextMenuItems', 'getMainMenuItems', 'processRowPostCreate', 'processCellForClipboard', 'getGroupRowAgg', 'getRowNodeId', 'isFullWidthRow', 'sendToClipboard', 'navigateToNextHeader', 'tabToNextHeader', 'navigateToNextCell', 'tabToNextCell', 'processCellFromClipboard', 'getDocument', 'postProcessPopup', 'getChildCount', 'getDataPath', 'isRowMaster', 'postSortRows', 'processHeaderForClipboard', 'processGroupHeaderForClipboard', 'paginationNumberFormatter', 'processDataFromClipboard', 'getServerSideGroupKey', 'isServerSideGroup', 'createChartContainer', 'getChartToolbarItems', 'fillOperation', 'isApplyServerSideTransaction', 'getServerSideStoreParams', 'getServerSideGroupLevelParams', 'isServerSideGroupOpenByDefault', 'isGroupOpenByDefault', 'initialGroupOrderComparator', 'loadingCellRendererSelector', 'getRowId', 'groupAggFiltering' ]; PropertyKeys.FUNCTION_PROPERTIES = __spread$1(PropertyKeys.FUNCTIONAL_PROPERTIES, PropertyKeys.CALLBACK_PROPERTIES); PropertyKeys.ALL_PROPERTIES = __spread$1(PropertyKeys.ARRAY_PROPERTIES, PropertyKeys.OBJECT_PROPERTIES, PropertyKeys.STRING_PROPERTIES, PropertyKeys.NUMBER_PROPERTIES, PropertyKeys.FUNCTION_PROPERTIES, PropertyKeys.BOOLEAN_PROPERTIES); /** * Used when performing property checks. This avoids noise caused when using frameworks, which can add their own * framework-specific properties to colDefs, gridOptions etc. */ PropertyKeys.FRAMEWORK_PROPERTIES = [ '__ob__', '__v_skip', '__metadata__', 'mappedColumnProperties', 'hasChildColumns', 'toColDef', 'createColDefFromGridColumn' ]; return PropertyKeys; }()); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __assign = (undefined && undefined.__assign) || function () { __assign = Object.assign || function(t) { for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; } return t; }; return __assign.apply(this, arguments); }; var __read$3 = (undefined && undefined.__read) || function (o, n) { var m = typeof Symbol === "function" && o[Symbol.iterator]; if (!m) return o; var i = m.call(o), r, ar = [], e; try { while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); } catch (error) { e = { error: error }; } finally { try { if (r && !r.done && (m = i["return"])) m.call(i); } finally { if (e) throw e.error; } } return ar; }; var __spread$2 = (undefined && undefined.__spread) || function () { for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read$3(arguments[i])); return ar; }; var ComponentUtil = /** @class */ (function () { function ComponentUtil() { } ComponentUtil.getCallbackForEvent = function (eventName) { if (!eventName || eventName.length < 2) { return eventName; } return 'on' + eventName[0].toUpperCase() + eventName.substr(1); }; ComponentUtil.getCoercionLookup = function () { var coercionLookup = {}; __spread$2(ComponentUtil.ARRAY_PROPERTIES, ComponentUtil.OBJECT_PROPERTIES, ComponentUtil.STRING_PROPERTIES, ComponentUtil.FUNCTION_PROPERTIES, ComponentUtil.EVENT_CALLBACKS).forEach(function (key) { return coercionLookup[key] = 'none'; }); ComponentUtil.BOOLEAN_PROPERTIES .forEach(function (key) { return coercionLookup[key] = 'boolean'; }); ComponentUtil.NUMBER_PROPERTIES .forEach(function (key) { return coercionLookup[key] = 'number'; }); return coercionLookup; }; ComponentUtil.getValue = function (key, rawValue) { var coercionStep = ComponentUtil.coercionLookup[key]; if (coercionStep) { var newValue = rawValue; switch (coercionStep) { case 'number': { newValue = ComponentUtil.toNumber(rawValue); break; } case 'boolean': { newValue = ComponentUtil.toBoolean(rawValue); break; } case 'none': { // if groupAggFiltering exists and isn't a function, handle as a boolean. if (key === 'groupAggFiltering' && typeof rawValue !== 'function') { newValue = ComponentUtil.toBoolean(rawValue); } break; } } return newValue; } return undefined; }; ComponentUtil.getGridOptionKeys = function (component, isVue) { // Vue does not have keys in prod so instead need to run through all the // gridOptions checking for presence of a gridOption key. return isVue ? Object.keys(ComponentUtil.coercionLookup) : Object.keys(component); }; ComponentUtil.copyAttributesToGridOptions = function (gridOptions, component, isVue) { if (isVue === void 0) { isVue = false; } // create empty grid options if none were passed if (typeof gridOptions !== 'object') { gridOptions = {}; } // to allow array style lookup in TypeScript, take type away from 'this' and 'gridOptions' var pGridOptions = gridOptions; var keys = ComponentUtil.getGridOptionKeys(component, isVue); // Loop through component props, if they are not undefined and a valid gridOption copy to gridOptions keys.forEach(function (key) { var value = component[key]; if (typeof value !== 'undefined') { var coercedValue = ComponentUtil.getValue(key, value); if (coercedValue !== undefined) { pGridOptions[key] = coercedValue; } } }); return gridOptions; }; ComponentUtil.processOnChange = function (changes, api) { if (!changes || Object.keys(changes).length === 0) { return; } var changesToApply = __assign({}, changes); // We manually call these updates so that we can provide a different source of gridOptionsChanged // We do not call setProperty as this will be called by the grid api methods if (changesToApply.columnTypes) { api.setColumnTypes(changesToApply.columnTypes.currentValue, "gridOptionsChanged"); delete changesToApply.columnTypes; } if (changesToApply.autoGroupColumnDef) { api.setAutoGroupColumnDef(changesToApply.autoGroupColumnDef.currentValue, "gridOptionsChanged"); delete changesToApply.autoGroupColumnDef; } if (changesToApply.defaultColDef) { api.setDefaultColDef(changesToApply.defaultColDef.currentValue, "gridOptionsChanged"); delete changesToApply.defaultColDef; } if (changesToApply.columnDefs) { api.setColumnDefs(changesToApply.columnDefs.currentValue, "gridOptionsChanged"); delete changesToApply.columnDefs; } Object.keys(changesToApply).forEach(function (key) { var gridKey = key; var coercedValue = ComponentUtil.getValue(gridKey, changesToApply[gridKey].currentValue); api.__setProperty(gridKey, coercedValue); }); // copy changes into an event for dispatch var event = { type: Events.EVENT_COMPONENT_STATE_CHANGED }; iterateObject(changes, function (key, value) { event[key] = value; }); api.dispatchEvent(event); }; ComponentUtil.toBoolean = function (value) { if (typeof value === 'boolean') { return value; } if (typeof value === 'string') { // for boolean, compare to empty String to allow attributes appearing with // no value to be treated as 'true' return value.toUpperCase() === 'TRUE' || value == ''; } return false; }; ComponentUtil.toNumber = function (value) { if (typeof value === 'number') { return value; } if (typeof value === 'string') { return Number(value); } }; // all events ComponentUtil.EVENTS = values(Events); // events that are internal to AG Grid and should not be exposed to users via documentation or generated framework components /** Exclude the following internal events from code generation to prevent exposing these events via framework components */ ComponentUtil.EXCLUDED_INTERNAL_EVENTS = [ Events.EVENT_SCROLLBAR_WIDTH_CHANGED, Events.EVENT_CHECKBOX_CHANGED, Events.EVENT_HEIGHT_SCALE_CHANGED, Events.EVENT_BODY_HEIGHT_CHANGED, Events.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED, Events.EVENT_SCROLL_VISIBILITY_CHANGED, Events.EVENT_COLUMN_HOVER_CHANGED, Events.EVENT_FLASH_CELLS, Events.EVENT_PAGINATION_PIXEL_OFFSET_CHANGED, Events.EVENT_DISPLAYED_ROWS_CHANGED, Events.EVENT_LEFT_PINNED_WIDTH_CHANGED, Events.EVENT_RIGHT_PINNED_WIDTH_CHANGED, Events.EVENT_ROW_CONTAINER_HEIGHT_CHANGED, Events.EVENT_POPUP_TO_FRONT, Events.EVENT_KEYBOARD_FOCUS, Events.EVENT_MOUSE_FOCUS, Events.EVENT_STORE_UPDATED, Events.EVENT_COLUMN_PANEL_ITEM_DRAG_START, Events.EVENT_COLUMN_PANEL_ITEM_DRAG_END, Events.EVENT_FILL_START, Events.EVENT_FILL_END, Events.EVENT_KEY_SHORTCUT_CHANGED_CELL_START, Events.EVENT_KEY_SHORTCUT_CHANGED_CELL_END, Events.EVENT_FULL_WIDTH_ROW_FOCUSED, Events.EVENT_HEADER_HEIGHT_CHANGED, Events.EVENT_COLUMN_HEADER_HEIGHT_CHANGED, Events.EVENT_INTERNAL_TOOL_PANEL_VISIBLE_CHANGED, Events.EVENT_CELL_FOCUS_CLEARED, Events.EVENT_GRID_STYLES_CHANGED, Events.EVENT_FILTER_DESTROYED ]; // events that are available for use by users of AG Grid and so should be documented /** EVENTS that should be exposed via code generation for the framework components. */ ComponentUtil.PUBLIC_EVENTS = ComponentUtil.EVENTS.filter(function (e) { return !includes(ComponentUtil.EXCLUDED_INTERNAL_EVENTS, e); }); // onXXX methods, based on the above events ComponentUtil.EVENT_CALLBACKS = ComponentUtil.EVENTS.map(function (event) { return ComponentUtil.getCallbackForEvent(event); }); ComponentUtil.STRING_PROPERTIES = PropertyKeys.STRING_PROPERTIES; ComponentUtil.OBJECT_PROPERTIES = PropertyKeys.OBJECT_PROPERTIES; ComponentUtil.ARRAY_PROPERTIES = PropertyKeys.ARRAY_PROPERTIES; ComponentUtil.NUMBER_PROPERTIES = PropertyKeys.NUMBER_PROPERTIES; ComponentUtil.BOOLEAN_PROPERTIES = PropertyKeys.BOOLEAN_PROPERTIES; ComponentUtil.FUNCTION_PROPERTIES = PropertyKeys.FUNCTION_PROPERTIES; ComponentUtil.ALL_PROPERTIES = PropertyKeys.ALL_PROPERTIES; ComponentUtil.ALL_PROPERTIES_SET = new Set(PropertyKeys.ALL_PROPERTIES); ComponentUtil.coercionLookup = ComponentUtil.getCoercionLookup(); return ComponentUtil; }()); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ function fuzzyCheckStrings(inputValues, validValues, allSuggestions) { var fuzzyMatches = {}; var invalidInputs = inputValues.filter(function (inputValue) { return !validValues.some(function (validValue) { return validValue === inputValue; }); }); if (invalidInputs.length > 0) { invalidInputs.forEach(function (invalidInput) { return fuzzyMatches[invalidInput] = fuzzySuggestions(invalidInput, allSuggestions); }); } return fuzzyMatches; } /** * * @param {String} inputValue The value to be compared against a list of strings * @param allSuggestions The list of strings to be compared against */ function fuzzySuggestions(inputValue, allSuggestions, hideIrrelevant, filterByPercentageOfBestMatch) { var thisSuggestions = allSuggestions.map(function (text) { return ({ value: text, relevance: stringWeightedDistances(inputValue.toLowerCase(), text.toLocaleLowerCase()) }); }); thisSuggestions.sort(function (a, b) { return b.relevance - a.relevance; }); if (hideIrrelevant) { thisSuggestions = thisSuggestions.filter(function (suggestion) { return suggestion.relevance !== 0; }); } if (filterByPercentageOfBestMatch && filterByPercentageOfBestMatch > 0) { var bestMatch = thisSuggestions[0].relevance; var limit_1 = bestMatch * filterByPercentageOfBestMatch; thisSuggestions = thisSuggestions.filter(function (suggestion) { return limit_1 - suggestion.relevance < 0; }); } return thisSuggestions.map(function (suggestion) { return suggestion.value; }); } function stringWeightedDistances(str1, str2) { var a = str1.replace(/\s/g, ''); var b = str2.replace(/\s/g, ''); var weight = 0; var lastIndex = -1; for (var i = 0; i < a.length; i++) { var idx = b.indexOf(a[i], lastIndex + 1); if (idx === -1) { continue; } lastIndex = idx; weight += (100 - (lastIndex * 100 / 10000) * 100); } return weight; } var FuzzyMatchUtils = /*#__PURE__*/Object.freeze({ fuzzyCheckStrings: fuzzyCheckStrings, fuzzySuggestions: fuzzySuggestions }); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __decorate$5 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var __read$4 = (undefined && undefined.__read) || function (o, n) { var m = typeof Symbol === "function" && o[Symbol.iterator]; if (!m) return o; var i = m.call(o), r, ar = [], e; try { while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); } catch (error) { e = { error: error }; } finally { try { if (r && !r.done && (m = i["return"])) m.call(i); } finally { if (e) throw e.error; } } return ar; }; var __spread$3 = (undefined && undefined.__spread) || function () { for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read$4(arguments[i])); return ar; }; function logDeprecation(version, oldProp, newProp, message) { var newPropMsg = newProp ? "Please use '" + newProp + "' instead. " : ''; doOnce(function () { return console.warn("AG Grid: since v" + version + ", '" + oldProp + "' is deprecated. " + newPropMsg + (message !== null && message !== void 0 ? message : '')); }, "Deprecated_" + oldProp); } var GridOptionsValidator = /** @class */ (function () { function GridOptionsValidator() { this.deprecatedProperties = { serverSideInfiniteScroll: { version: '29', message: 'Infinite Scrolling is now the default behaviour. This can be suppressed with `suppressServerSideInfiniteScroll`.' }, rememberGroupStateWhenNewData: { version: '24', message: 'Now that transaction updates are possible and they keep group state, this feature is no longer needed.' }, suppressEnterpriseResetOnNewColumns: { version: '25', message: 'Now that it is possible to dynamically change columns in the grid, this is no longer needed.' }, suppressColumnStateEvents: { version: '25', message: 'Events should be ignored based on the `event.source`, which will be "api" if the event was due to setting column state via the API.' }, defaultExportParams: { version: '25.2', message: 'The property `defaultExportParams` has been replaced by `defaultCsvExportParams` and `defaultExcelExportParams`' }, stopEditingWhenGridLosesFocus: { version: '25.2.2', newProp: 'stopEditingWhenCellsLoseFocus', copyToNewProp: true }, applyColumnDefOrder: { version: '26', message: 'The property `applyColumnDefOrder` is no longer needed, as this is the default behaviour. To turn this behaviour off, set maintainColumnOrder=true' }, groupMultiAutoColumn: { version: '26', newProp: 'groupDisplayType', copyToNewProp: true, newPropValue: 'multipleColumns' }, groupUseEntireRow: { version: '26', newProp: 'groupDisplayType', copyToNewProp: true, newPropValue: 'groupRows' }, defaultGroupSortComparator: { version: '26', newProp: 'initialGroupOrderComparator' }, enableMultiRowDragging: { version: '26.1', newProp: 'rowDragMultiRow', copyToNewProp: true }, colWidth: { version: '26.1', newProp: 'defaultColDef.width' }, minColWidth: { version: '26.1', newProp: 'defaultColDef.minWidth' }, maxColWidth: { version: '26.1', newProp: 'defaultColDef.maxWidth' }, reactUi: { version: '26.1', message: 'React UI is on by default, so no need for reactUi=true. To turn it off, set suppressReactUi=true.' }, suppressCellSelection: { version: '27', newProp: 'suppressCellFocus', copyToNewProp: true }, clipboardDeliminator: { version: '27.1', newProp: 'clipboardDelimiter', copyToNewProp: true }, getRowNodeId: { version: '27.1', newProp: 'getRowId', message: 'The difference: if getRowId() is implemented then immutable data is enabled by default.' }, defaultGroupOrderComparator: { version: '27.2', newProp: 'initialGroupOrderComparator' }, groupRowAggNodes: { version: '27.2', newProp: 'getGroupRowAgg' }, postSort: { version: '27.2', newProp: 'postSortRows' }, isFullWidthCell: { version: '27.2', newProp: 'isFullWidthRow' }, localeTextFunc: { version: '27.2', newProp: 'getLocaleText' }, serverSideFilteringAlwaysResets: { version: '28.0', newProp: 'serverSideFilterAllLevels', copyToNewProp: true, }, serverSideSortingAlwaysResets: { version: '28.0', newProp: 'serverSideSortAllLevels', copyToNewProp: true, }, suppressReactUi: { version: '28', message: 'The legacy React rendering engine is deprecated and will be removed in the next major version of the grid.' }, processSecondaryColDef: { version: '28', newProp: 'processPivotResultColDef', copyToNewProp: true }, processSecondaryColGroupDef: { version: '28', newProp: 'processPivotResultColGroupDef', copyToNewProp: true }, getServerSideStoreParams: { version: '28', newProp: 'getServerSideGroupLevelParams', copyToNewProp: true }, enableChartToolPanelsButton: { version: '29', message: 'The Chart Tool Panels button is now enabled by default. To hide the Chart Tool Panels button and display the hamburger button instead, set suppressChartToolPanelsButton=true.' }, functionsPassive: { version: '29.2' }, onColumnRowGroupChangeRequest: { version: '29.2' }, onColumnPivotChangeRequest: { version: '29.2' }, onColumnValueChangeRequest: { version: '29.2' }, onColumnAggFuncChangeRequest: { version: '29.2' }, }; } GridOptionsValidator.prototype.pickOneWarning = function (prop1, prop2) { console.warn("AG Grid: " + prop1 + " and " + prop2 + " do not work with each other, you need to pick one."); }; GridOptionsValidator.prototype.init = function () { var _this = this; this.checkForDeprecated(); this.checkForViolations(); if (this.gridOptions.suppressPropertyNamesCheck !== true) { this.checkGridOptionsProperties(); this.checkColumnDefProperties(); } this.checkColumnDefViolations(); if (this.gridOptionsService.is('groupSelectsChildren') && this.gridOptionsService.is('suppressParentsInRowNodes')) { console.warn("AG Grid: 'groupSelectsChildren' does not work with 'suppressParentsInRowNodes', this selection method needs the part in rowNode to work"); } if (this.gridOptionsService.is('groupSelectsChildren')) { if (this.gridOptionsService.get('rowSelection') !== 'multiple') { console.warn("AG Grid: rowSelection must be 'multiple' for groupSelectsChildren to make sense"); } } if (this.gridOptionsService.is('groupRemoveSingleChildren') && this.gridOptionsService.is('groupHideOpenParents')) { this.pickOneWarning('groupRemoveSingleChildren', 'groupHideOpenParents'); } if (this.gridOptionsService.isRowModelType('serverSide')) { var msg = function (prop, alt) { return ("AG Grid: '" + prop + "' is not supported on the Server-Side Row Model." + (alt ? " Please use " + alt + " instead." : '')); }; if (this.gridOptionsService.exists('groupDefaultExpanded')) { console.warn(msg('groupDefaultExpanded', 'isServerSideGroupOpenByDefault callback')); } if (this.gridOptionsService.exists('groupIncludeFooter')) { console.warn(msg('groupIncludeFooter')); } if (this.gridOptionsService.exists('groupIncludeTotalFooter')) { console.warn(msg('groupIncludeTotalFooter')); } } if (this.gridOptionsService.is('enableRangeSelection')) { ModuleRegistry.assertRegistered(exports.ModuleNames.RangeSelectionModule, 'enableRangeSelection'); } else if (this.gridOptionsService.is('enableRangeHandle') || this.gridOptionsService.is('enableFillHandle')) { console.warn("AG Grid: 'enableRangeHandle' or 'enableFillHandle' will not work unless 'enableRangeSelection' is set to true"); } var validateRegistered = function (prop, module) { return _this.gridOptionsService.exists(prop) && ModuleRegistry.assertRegistered(module, prop); }; // Ensure the SideBar is registered which will then lead them to register Column / Filter Tool panels as required by their config. // It is possible to use the SideBar only with your own custom tool panels. validateRegistered('sideBar', exports.ModuleNames.SideBarModule); validateRegistered('statusBar', exports.ModuleNames.StatusBarModule); validateRegistered('enableCharts', exports.ModuleNames.GridChartsModule); validateRegistered('getMainMenuItems', exports.ModuleNames.MenuModule); validateRegistered('getContextMenuItems', exports.ModuleNames.MenuModule); validateRegistered('allowContextMenuWithControlKey', exports.ModuleNames.MenuModule); if (this.gridOptionsService.is('groupRowsSticky')) { if (this.gridOptionsService.is('groupHideOpenParents')) { this.pickOneWarning('groupRowsSticky', 'groupHideOpenParents'); } if (this.gridOptionsService.is('masterDetail')) { this.pickOneWarning('groupRowsSticky', 'masterDetail'); } if (this.gridOptionsService.is('pagination')) { this.pickOneWarning('groupRowsSticky', 'pagination'); } } }; GridOptionsValidator.prototype.checkColumnDefProperties = function () { var _this = this; if (this.gridOptions.columnDefs == null) { return; } this.gridOptions.columnDefs.forEach(function (colDef) { var userProperties = Object.getOwnPropertyNames(colDef); var validProperties = __spread$3(ColDefUtil.ALL_PROPERTIES, ColDefUtil.FRAMEWORK_PROPERTIES); _this.checkProperties(userProperties, validProperties, validProperties, 'colDef', 'https://www.ag-grid.com/javascript-data-grid/column-properties/'); }); }; GridOptionsValidator.prototype.checkColumnDefViolations = function () { var _a; var rowModel = (_a = this.gridOptionsService.get('rowModelType')) !== null && _a !== void 0 ? _a : 'clientSide'; var unsupportedPropertiesMap = { infinite: ['headerCheckboxSelection', 'headerCheckboxSelectionFilteredOnly', 'headerCheckboxSelectionCurrentPageOnly'], viewport: ['headerCheckboxSelection', 'headerCheckboxSelectionFilteredOnly', 'headerCheckboxSelectionCurrentPageOnly'], serverSide: ['headerCheckboxSelectionFilteredOnly', 'headerCheckboxSelectionCurrentPageOnly'], clientSide: [], }; var unsupportedProperties = unsupportedPropertiesMap[rowModel]; if (!(unsupportedProperties === null || unsupportedProperties === void 0 ? void 0 : unsupportedProperties.length)) { return; } var validateColDef = function (colDef) { unsupportedProperties.forEach(function (property) { if (property in colDef && !!colDef[property]) { console.warn("AG Grid: Column property " + property + " is not supported with the row model type " + rowModel + "."); } }); }; if (this.gridOptions.columnDefs != null) { this.gridOptions.columnDefs.forEach(function (colDef) { return validateColDef(colDef); }); } if (this.gridOptions.autoGroupColumnDef != null) { validateColDef(this.gridOptions.autoGroupColumnDef); } if (this.gridOptions.defaultColDef != null) { validateColDef(this.gridOptions.defaultColDef); } }; GridOptionsValidator.prototype.checkGridOptionsProperties = function () { var userProperties = Object.getOwnPropertyNames(this.gridOptions); var validProperties = __spread$3(PropertyKeys.ALL_PROPERTIES, PropertyKeys.FRAMEWORK_PROPERTIES, ComponentUtil.EVENT_CALLBACKS); var validPropertiesAndExceptions = __spread$3(validProperties, ['api', 'columnApi'], Object.keys(this.deprecatedProperties)); this.checkProperties(userProperties, validPropertiesAndExceptions, validProperties, 'gridOptions', 'https://www.ag-grid.com/javascript-data-grid/grid-options/'); }; GridOptionsValidator.prototype.checkProperties = function (userProperties, validPropertiesAndExceptions, validProperties, containerName, docsUrl) { var invalidProperties = fuzzyCheckStrings(userProperties, validPropertiesAndExceptions, validProperties); iterateObject(invalidProperties, function (key, value) { console.warn("AG Grid: invalid " + containerName + " property '" + key + "' did you mean any of these: " + value.slice(0, 8).join(", ")); }); if (Object.keys(invalidProperties).length > 0) { console.warn("AG Grid: to see all the valid " + containerName + " properties please check: " + docsUrl); } }; GridOptionsValidator.prototype.checkForDeprecated = function () { // casting to generic object, so typescript compiles even though // we are looking for attributes that don't exist var options = this.gridOptions; Object.entries(this.deprecatedProperties).forEach(function (_a) { var _b; var _c = __read$4(_a, 2), oldProp = _c[0], details = _c[1]; var oldPropValue = options[oldProp]; if (oldPropValue) { logDeprecation(details.version, oldProp, details.newProp, details.message); if (details.copyToNewProp && details.newProp && options[details.newProp] == null) { options[details.newProp] = (_b = details.newPropValue) !== null && _b !== void 0 ? _b : oldPropValue; } } }); // Manual messages and deprecation behaviour that don't fit our standard approach above. if (options.groupSuppressAutoColumn) { var propName = options.treeData ? 'treeDataDisplayType' : 'groupDisplayType'; console.warn("AG Grid: since v26.0, the grid property `groupSuppressAutoColumn` has been replaced by `" + propName + " = 'custom'`"); options[propName] = 'custom'; } if (options.immutableData) { if (options.getRowId) { console.warn('AG Grid: since v27.1, `immutableData` is deprecated. With the `getRowId` callback implemented, immutable data is enabled by default so you can remove `immutableData=true`.'); } else { console.warn('AG Grid: since v27.1, `immutableData` is deprecated. To enable immutable data you must implement the `getRowId()` callback.'); } } if (options.serverSideStoreType) { console.warn('AG Grid: since v29.0, `serverSideStoreType` has been replaced by `suppressServerSideInfiniteScroll`. Set to false to use Partial Store, and true to use Full Store.'); options.suppressServerSideInfiniteScroll = options.serverSideStoreType !== 'partial'; } }; GridOptionsValidator.prototype.checkForViolations = function () { if (this.gridOptionsService.is('treeData')) { this.treeDataViolations(); } }; GridOptionsValidator.prototype.treeDataViolations = function () { if (this.gridOptionsService.isRowModelType('clientSide')) { if (!this.gridOptionsService.exists('getDataPath')) { console.warn('AG Grid: property usingTreeData=true with rowModel=clientSide, but you did not ' + 'provide getDataPath function, please provide getDataPath function if using tree data.'); } } if (this.gridOptionsService.isRowModelType('serverSide')) { if (!this.gridOptionsService.exists('isServerSideGroup')) { console.warn('AG Grid: property usingTreeData=true with rowModel=serverSide, but you did not ' + 'provide isServerSideGroup function, please provide isServerSideGroup function if using tree data.'); } if (!this.gridOptionsService.exists('getServerSideGroupKey')) { console.warn('AG Grid: property usingTreeData=true with rowModel=serverSide, but you did not ' + 'provide getServerSideGroupKey function, please provide getServerSideGroupKey function if using tree data.'); } } }; __decorate$5([ Autowired('gridOptions') ], GridOptionsValidator.prototype, "gridOptions", void 0); __decorate$5([ Autowired('gridOptionsService') ], GridOptionsValidator.prototype, "gridOptionsService", void 0); __decorate$5([ PostConstruct ], GridOptionsValidator.prototype, "init", null); GridOptionsValidator = __decorate$5([ Bean('gridOptionsValidator') ], GridOptionsValidator); return GridOptionsValidator; }()); function matchesGroupDisplayType(toMatch, supplied) { var groupDisplayTypeValues = ['groupRows', 'multipleColumns', 'custom', 'singleColumn']; if (groupDisplayTypeValues.indexOf(supplied) < 0) { console.warn("AG Grid: '" + supplied + "' is not a valid groupDisplayType value - possible values are: '" + groupDisplayTypeValues.join("', '") + "'"); return false; } return supplied === toMatch; } function matchesTreeDataDisplayType(toMatch, supplied) { var treeDataDisplayTypeValues = ['auto', 'custom']; if (treeDataDisplayTypeValues.indexOf(supplied) < 0) { console.warn("AG Grid: '" + supplied + "' is not a valid treeDataDisplayType value - possible values are: '" + treeDataDisplayTypeValues.join("', '") + "'"); return false; } return supplied === toMatch; } /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __decorate$6 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var ColumnGroup = /** @class */ (function () { function ColumnGroup(providedColumnGroup, groupId, partId, pinned) { // depends on the open/closed state of the group, only displaying columns are stored here this.displayedChildren = []; this.localEventService = new EventService(); this.groupId = groupId; this.partId = partId; this.providedColumnGroup = providedColumnGroup; this.pinned = pinned; } // this is static, a it is used outside of this class ColumnGroup.createUniqueId = function (groupId, instanceId) { return groupId + '_' + instanceId; }; // as the user is adding and removing columns, the groups are recalculated. // this reset clears out all children, ready for children to be added again ColumnGroup.prototype.reset = function () { this.parent = null; this.children = null; this.displayedChildren = null; }; ColumnGroup.prototype.getParent = function () { return this.parent; }; ColumnGroup.prototype.setParent = function (parent) { this.parent = parent; }; ColumnGroup.prototype.getUniqueId = function () { return ColumnGroup.createUniqueId(this.groupId, this.partId); }; ColumnGroup.prototype.isEmptyGroup = function () { return this.displayedChildren.length === 0; }; ColumnGroup.prototype.isMoving = function () { var allLeafColumns = this.getProvidedColumnGroup().getLeafColumns(); if (!allLeafColumns || allLeafColumns.length === 0) { return false; } return allLeafColumns.every(function (col) { return col.isMoving(); }); }; ColumnGroup.prototype.checkLeft = function () { // first get all children to setLeft, as it impacts our decision below this.displayedChildren.forEach(function (child) { if (child instanceof ColumnGroup) { child.checkLeft(); } }); // set our left based on first displayed column if (this.displayedChildren.length > 0) { if (this.gridOptionsService.is('enableRtl')) { var lastChild = last(this.displayedChildren); var lastChildLeft = lastChild.getLeft(); this.setLeft(lastChildLeft); } else { var firstChildLeft = this.displayedChildren[0].getLeft(); this.setLeft(firstChildLeft); } } else { // this should never happen, as if we have no displayed columns, then // this groups should not even exist. this.setLeft(null); } }; ColumnGroup.prototype.getLeft = function () { return this.left; }; ColumnGroup.prototype.getOldLeft = function () { return this.oldLeft; }; ColumnGroup.prototype.setLeft = function (left) { this.oldLeft = left; if (this.left !== left) { this.left = left; this.localEventService.dispatchEvent(this.createAgEvent(ColumnGroup.EVENT_LEFT_CHANGED)); } }; ColumnGroup.prototype.getPinned = function () { return this.pinned; }; ColumnGroup.prototype.createAgEvent = function (type) { return { type: type }; }; ColumnGroup.prototype.addEventListener = function (eventType, listener) { this.localEventService.addEventListener(eventType, listener); }; ColumnGroup.prototype.removeEventListener = function (eventType, listener) { this.localEventService.removeEventListener(eventType, listener); }; ColumnGroup.prototype.getGroupId = function () { return this.groupId; }; ColumnGroup.prototype.getPartId = function () { return this.partId; }; ColumnGroup.prototype.isChildInThisGroupDeepSearch = function (wantedChild) { var result = false; this.children.forEach(function (foundChild) { if (wantedChild === foundChild) { result = true; } if (foundChild instanceof ColumnGroup) { if (foundChild.isChildInThisGroupDeepSearch(wantedChild)) { result = true; } } }); return result; }; ColumnGroup.prototype.getActualWidth = function () { var groupActualWidth = 0; if (this.displayedChildren) { this.displayedChildren.forEach(function (child) { groupActualWidth += child.getActualWidth(); }); } return groupActualWidth; }; ColumnGroup.prototype.isResizable = function () { if (!this.displayedChildren) { return false; } // if at least one child is resizable, then the group is resizable var result = false; this.displayedChildren.forEach(function (child) { if (child.isResizable()) { result = true; } }); return result; }; ColumnGroup.prototype.getMinWidth = function () { var result = 0; this.displayedChildren.forEach(function (groupChild) { result += groupChild.getMinWidth() || 0; }); return result; }; ColumnGroup.prototype.addChild = function (child) { if (!this.children) { this.children = []; } this.children.push(child); }; ColumnGroup.prototype.getDisplayedChildren = function () { return this.displayedChildren; }; ColumnGroup.prototype.getLeafColumns = function () { var result = []; this.addLeafColumns(result); return result; }; ColumnGroup.prototype.getDisplayedLeafColumns = function () { var result = []; this.addDisplayedLeafColumns(result); return result; }; ColumnGroup.prototype.getDefinition = function () { return this.providedColumnGroup.getColGroupDef(); }; ColumnGroup.prototype.getColGroupDef = function () { return this.providedColumnGroup.getColGroupDef(); }; ColumnGroup.prototype.isPadding = function () { return this.providedColumnGroup.isPadding(); }; ColumnGroup.prototype.isExpandable = function () { return this.providedColumnGroup.isExpandable(); }; ColumnGroup.prototype.isExpanded = function () { return this.providedColumnGroup.isExpanded(); }; ColumnGroup.prototype.setExpanded = function (expanded) { this.providedColumnGroup.setExpanded(expanded); }; ColumnGroup.prototype.addDisplayedLeafColumns = function (leafColumns) { this.displayedChildren.forEach(function (child) { if (child instanceof Column) { leafColumns.push(child); } else if (child instanceof ColumnGroup) { child.addDisplayedLeafColumns(leafColumns); } }); }; ColumnGroup.prototype.addLeafColumns = function (leafColumns) { this.children.forEach(function (child) { if (child instanceof Column) { leafColumns.push(child); } else if (child instanceof ColumnGroup) { child.addLeafColumns(leafColumns); } }); }; ColumnGroup.prototype.getChildren = function () { return this.children; }; ColumnGroup.prototype.getColumnGroupShow = function () { return this.providedColumnGroup.getColumnGroupShow(); }; ColumnGroup.prototype.getProvidedColumnGroup = function () { return this.providedColumnGroup; }; /** @deprecated v27 getOriginalColumnGroup is deprecated, use getProvidedColumnGroup. */ ColumnGroup.prototype.getOriginalColumnGroup = function () { logDeprecation('27', 'getOriginalColumnGroup', 'getProvidedColumnGroup'); return this.getProvidedColumnGroup(); }; ColumnGroup.prototype.getPaddingLevel = function () { var parent = this.getParent(); if (!this.isPadding() || !parent || !parent.isPadding()) { return 0; } return 1 + parent.getPaddingLevel(); }; ColumnGroup.prototype.calculateDisplayedColumns = function () { var _this = this; // clear out last time we calculated this.displayedChildren = []; // find the column group that is controlling expandable. this is relevant when we have padding (empty) // groups, where the expandable is actually the first parent that is not a padding group. var parentWithExpansion = this; while (parentWithExpansion != null && parentWithExpansion.isPadding()) { parentWithExpansion = parentWithExpansion.getParent(); } var isExpandable = parentWithExpansion ? parentWithExpansion.providedColumnGroup.isExpandable() : false; // it not expandable, everything is visible if (!isExpandable) { this.displayedChildren = this.children; this.localEventService.dispatchEvent(this.createAgEvent(ColumnGroup.EVENT_DISPLAYED_CHILDREN_CHANGED)); return; } // Add cols based on columnGroupShow // Note - the below also adds padding groups, these are always added because they never have // colDef.columnGroupShow set. this.children.forEach(function (child) { // never add empty groups var emptyGroup = child instanceof ColumnGroup && (!child.displayedChildren || !child.displayedChildren.length); if (emptyGroup) { return; } var headerGroupShow = child.getColumnGroupShow(); switch (headerGroupShow) { case 'open': // when set to open, only show col if group is open if (parentWithExpansion.providedColumnGroup.isExpanded()) { _this.displayedChildren.push(child); } break; case 'closed': // when set to open, only show col if group is open if (!parentWithExpansion.providedColumnGroup.isExpanded()) { _this.displayedChildren.push(child); } break; default: _this.displayedChildren.push(child); break; } }); this.localEventService.dispatchEvent(this.createAgEvent(ColumnGroup.EVENT_DISPLAYED_CHILDREN_CHANGED)); }; ColumnGroup.EVENT_LEFT_CHANGED = 'leftChanged'; ColumnGroup.EVENT_DISPLAYED_CHILDREN_CHANGED = 'displayedChildrenChanged'; __decorate$6([ Autowired('gridOptionsService') ], ColumnGroup.prototype, "gridOptionsService", void 0); return ColumnGroup; }()); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ // class returns unique instance id's for columns. // eg, the following calls (in this order) will result in: // // getInstanceIdForKey('country') => 0 // getInstanceIdForKey('country') => 1 // getInstanceIdForKey('country') => 2 // getInstanceIdForKey('country') => 3 // getInstanceIdForKey('age') => 0 // getInstanceIdForKey('age') => 1 // getInstanceIdForKey('country') => 4 var GroupInstanceIdCreator = /** @class */ (function () { function GroupInstanceIdCreator() { // this map contains keys to numbers, so we remember what the last call was this.existingIds = {}; } GroupInstanceIdCreator.prototype.getInstanceIdForKey = function (key) { var lastResult = this.existingIds[key]; var result; if (typeof lastResult !== 'number') { // first time this key result = 0; } else { result = lastResult + 1; } this.existingIds[key] = result; return result; }; return GroupInstanceIdCreator; }()); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$1 = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __decorate$7 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var GROUP_AUTO_COLUMN_ID = 'ag-Grid-AutoColumn'; var AutoGroupColService = /** @class */ (function (_super) { __extends$1(AutoGroupColService, _super); function AutoGroupColService() { return _super !== null && _super.apply(this, arguments) || this; } AutoGroupColService.prototype.createAutoGroupColumns = function (existingCols, rowGroupColumns) { var _this = this; var groupAutoColumns = []; var doingTreeData = this.gridOptionsService.isTreeData(); var doingMultiAutoColumn = this.gridOptionsService.isGroupMultiAutoColumn(); if (doingTreeData && doingMultiAutoColumn) { console.warn('AG Grid: you cannot mix groupDisplayType = "multipleColumns" with treeData, only one column can be used to display groups when doing tree data'); doingMultiAutoColumn = false; } // if doing groupDisplayType = "multipleColumns", then we call the method multiple times, once // for each column we are grouping by if (doingMultiAutoColumn) { rowGroupColumns.forEach(function (rowGroupCol, index) { groupAutoColumns.push(_this.createOneAutoGroupColumn(existingCols, rowGroupCol, index)); }); } else { groupAutoColumns.push(this.createOneAutoGroupColumn(existingCols)); } return groupAutoColumns; }; // rowGroupCol and index are missing if groupDisplayType != "multipleColumns" AutoGroupColService.prototype.createOneAutoGroupColumn = function (existingCols, rowGroupCol, index) { // if one provided by user, use it, otherwise create one var defaultAutoColDef = this.generateDefaultColDef(rowGroupCol); // if doing multi, set the field var colId; if (rowGroupCol) { colId = GROUP_AUTO_COLUMN_ID + "-" + rowGroupCol.getId(); } else { colId = GROUP_AUTO_COLUMN_ID; } var userAutoColDef = this.gridOptionsService.get('autoGroupColumnDef'); mergeDeep(defaultAutoColDef, userAutoColDef); defaultAutoColDef = this.columnFactory.mergeColDefs(defaultAutoColDef); defaultAutoColDef.colId = colId; // For tree data the filter is always allowed if (!this.gridOptionsService.isTreeData()) { // we would only allow filter if the user has provided field or value getter. otherwise the filter // would not be able to work. var noFieldOrValueGetter = missing(defaultAutoColDef.field) && missing(defaultAutoColDef.valueGetter) && missing(defaultAutoColDef.filterValueGetter) && defaultAutoColDef.filter !== 'agGroupColumnFilter'; if (noFieldOrValueGetter) { defaultAutoColDef.filter = false; } } // if showing many cols, we don't want to show more than one with a checkbox for selection if (index && index > 0) { defaultAutoColDef.headerCheckboxSelection = false; } var existingCol = existingCols.find(function (col) { return col.getId() == colId; }); if (existingCol) { existingCol.setColDef(defaultAutoColDef, null); this.columnFactory.applyColumnState(existingCol, defaultAutoColDef); return existingCol; } var isSortingCoupled = this.gridOptionsService.isColumnsSortingCoupledToGroup(); if (isSortingCoupled && (defaultAutoColDef.sort || defaultAutoColDef.initialSort) && !defaultAutoColDef.field) { // if no field, then this column cannot hold its own sort state mergeDeep(defaultAutoColDef, { sort: null, initialSort: null }, true, true); } var newCol = new Column(defaultAutoColDef, null, colId, true); this.context.createBean(newCol); return newCol; }; AutoGroupColService.prototype.generateDefaultColDef = function (rowGroupCol) { var userDef = this.gridOptionsService.get('autoGroupColumnDef'); var localeTextFunc = this.localeService.getLocaleTextFunc(); var res = { headerName: localeTextFunc('group', 'Group') }; var userHasProvidedGroupCellRenderer = userDef && (userDef.cellRenderer || userDef.cellRendererFramework || userDef.cellRendererSelector); // only add the default group cell renderer if user hasn't provided one if (!userHasProvidedGroupCellRenderer) { res.cellRenderer = 'agGroupCellRenderer'; } // we never allow moving the group column // defaultAutoColDef.suppressMovable = true; if (rowGroupCol) { var colDef = rowGroupCol.getColDef(); Object.assign(res, { // cellRendererParams.groupKey: colDefToCopy.field; headerName: this.columnModel.getDisplayNameForColumn(rowGroupCol, 'header'), headerValueGetter: colDef.headerValueGetter }); if (colDef.cellRenderer || colDef.cellRendererFramework) { Object.assign(res, { cellRendererParams: { innerRenderer: colDef.cellRenderer, innerRendererFramework: colDef.cellRendererFramework, innerRendererParams: colDef.cellRendererParams } }); } res.showRowGroup = rowGroupCol.getColId(); } else { res.showRowGroup = true; } return res; }; __decorate$7([ Autowired('columnModel') ], AutoGroupColService.prototype, "columnModel", void 0); __decorate$7([ Autowired('columnFactory') ], AutoGroupColService.prototype, "columnFactory", void 0); AutoGroupColService = __decorate$7([ Bean('autoGroupColService') ], AutoGroupColService); return AutoGroupColService; }(BeanStub)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var reUnescapedHtml = /[&<>"']/g; /** * HTML Escapes. */ var HTML_ESCAPES = { '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' }; /** * It encodes any string in UTF-8 format * taken from https://github.com/mathiasbynens/utf8.js * @param {string} s * @returns {string} */ function utf8_encode(s) { var stringFromCharCode = String.fromCharCode; function ucs2decode(string) { var output = []; if (!string) { return []; } var len = string.length; var counter = 0; var value; var extra; while (counter < len) { value = string.charCodeAt(counter++); if (value >= 0xD800 && value <= 0xDBFF && counter < len) { // high surrogate, and there is a next character extra = string.charCodeAt(counter++); if ((extra & 0xFC00) == 0xDC00) { // low surrogate output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000); } else { // unmatched surrogate; only append this code unit, in case the next // code unit is the high surrogate of a surrogate pair output.push(value); counter--; } } else { output.push(value); } } return output; } function checkScalarValue(point) { if (point >= 0xD800 && point <= 0xDFFF) { throw Error('Lone surrogate U+' + point.toString(16).toUpperCase() + ' is not a scalar value'); } } function createByte(point, shift) { return stringFromCharCode(((point >> shift) & 0x3F) | 0x80); } function encodeCodePoint(point) { if ((point >= 0 && point <= 31 && point !== 10)) { var convertedCode = point.toString(16).toUpperCase(); var paddedCode = convertedCode.padStart(4, '0'); return "_x" + paddedCode + "_"; } if ((point & 0xFFFFFF80) == 0) { // 1-byte sequence return stringFromCharCode(point); } var symbol = ''; if ((point & 0xFFFFF800) == 0) { // 2-byte sequence symbol = stringFromCharCode(((point >> 6) & 0x1F) | 0xC0); } else if ((point & 0xFFFF0000) == 0) { // 3-byte sequence checkScalarValue(point); symbol = stringFromCharCode(((point >> 12) & 0x0F) | 0xE0); symbol += createByte(point, 6); } else if ((point & 0xFFE00000) == 0) { // 4-byte sequence symbol = stringFromCharCode(((point >> 18) & 0x07) | 0xF0); symbol += createByte(point, 12); symbol += createByte(point, 6); } symbol += stringFromCharCode((point & 0x3F) | 0x80); return symbol; } var codePoints = ucs2decode(s); var length = codePoints.length; var index = -1; var codePoint; var byteString = ''; while (++index < length) { codePoint = codePoints[index]; byteString += encodeCodePoint(codePoint); } return byteString; } function capitalise(str) { return str[0].toUpperCase() + str.substr(1).toLowerCase(); } function escapeString(toEscape, skipEscapingHtmlChars) { if (toEscape == null) { return null; } // we call toString() twice, in case value is an object, where user provides // a toString() method, and first call to toString() returns back something other // than a string (eg a number to render) var stringResult = toEscape.toString().toString(); if (skipEscapingHtmlChars) { return stringResult; } // in react we don't need to escape html characters, as it's done by the framework return stringResult.replace(reUnescapedHtml, function (chr) { return HTML_ESCAPES[chr]; }); } /** * Converts a camelCase string into startCase * @param {string} camelCase * @return {string} */ function camelCaseToHumanText(camelCase) { if (!camelCase || camelCase == null) { return null; } // either split on a lowercase followed by uppercase ie asHereTo -> as Here To var rex = /([a-z])([A-Z])/g; // or starts with uppercase and we take all expect the last which is assumed to be part of next word if followed by lowercase HEREToThere -> HERE To There var rexCaps = /([A-Z]+)([A-Z])([a-z])/g; var words = camelCase .replace(rex, '$1 $2') .replace(rexCaps, '$1 $2$3') .replace(/\./g, ' ') .split(' '); return words.map(function (word) { return word.substring(0, 1).toUpperCase() + ((word.length > 1) ? word.substring(1, word.length) : ''); }).join(' '); } var StringUtils = /*#__PURE__*/Object.freeze({ utf8_encode: utf8_encode, capitalise: capitalise, escapeString: escapeString, camelCaseToHumanText: camelCaseToHumanText }); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ function convertToMap(arr) { var map = new Map(); arr.forEach(function (pair) { return map.set(pair[0], pair[1]); }); return map; } // handy for organising a list into a map, where each item is mapped by an attribute, eg mapping Columns by ID function mapById(arr, callback) { var map = new Map(); arr.forEach(function (item) { return map.set(callback(item), item); }); return map; } function keys(map) { var arr = []; map.forEach(function (_, key) { return arr.push(key); }); return arr; } var MapUtils = /*#__PURE__*/Object.freeze({ convertToMap: convertToMap, mapById: mapById, keys: keys }); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$2 = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __decorate$8 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var __param$2 = (undefined && undefined.__param) || function (paramIndex, decorator) { return function (target, key) { decorator(target, key, paramIndex); } }; var __rest = (undefined && undefined.__rest) || function (s, e) { var t = {}; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p]; if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]]; } return t; }; var __values = (undefined && undefined.__values) || function(o) { var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; if (m) return m.call(o); if (o && typeof o.length === "number") return { next: function () { if (o && i >= o.length) o = void 0; return { value: o && o[i++], done: !o }; } }; throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); }; var __read$5 = (undefined && undefined.__read) || function (o, n) { var m = typeof Symbol === "function" && o[Symbol.iterator]; if (!m) return o; var i = m.call(o), r, ar = [], e; try { while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); } catch (error) { e = { error: error }; } finally { try { if (r && !r.done && (m = i["return"])) m.call(i); } finally { if (e) throw e.error; } } return ar; }; var __spread$4 = (undefined && undefined.__spread) || function () { for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read$5(arguments[i])); return ar; }; var ColumnModel = /** @class */ (function (_super) { __extends$2(ColumnModel, _super); function ColumnModel() { var _this = _super !== null && _super.apply(this, arguments) || this; // header row count, based on user provided columns _this.primaryHeaderRowCount = 0; _this.secondaryHeaderRowCount = 0; // header row count, either above, or based on pivoting if we are pivoting _this.gridHeaderRowCount = 0; // leave level columns of the displayed trees _this.displayedColumnsLeft = []; _this.displayedColumnsRight = []; _this.displayedColumnsCenter = []; // all three lists above combined _this.displayedColumns = []; // for fast lookup, to see if a column or group is still displayed _this.displayedColumnsAndGroupsMap = {}; // all columns to be rendered _this.viewportColumns = []; // A hash key to keep track of changes in viewport columns _this.viewportColumnsHash = ''; // same as viewportColumns, except we always include columns with headerAutoHeight _this.headerViewportColumns = []; // all columns to be rendered in the centre _this.viewportColumnsCenter = []; // same as viewportColumnsCenter, except we always include columns with headerAutoHeight _this.headerViewportColumnsCenter = []; _this.autoHeightActiveAtLeastOnce = false; _this.rowGroupColumns = []; _this.valueColumns = []; _this.pivotColumns = []; _this.ready = false; _this.autoGroupsNeedBuilding = false; _this.forceRecreateAutoGroups = false; _this.pivotMode = false; _this.bodyWidth = 0; _this.leftWidth = 0; _this.rightWidth = 0; _this.bodyWidthDirty = true; _this.flexColsCalculatedAtLestOnce = false; return _this; } ColumnModel.prototype.init = function () { var _this = this; this.suppressColumnVirtualisation = this.gridOptionsService.is('suppressColumnVirtualisation'); var pivotMode = this.gridOptionsService.is('pivotMode'); if (this.isPivotSettingAllowed(pivotMode)) { this.pivotMode = pivotMode; } this.usingTreeData = this.gridOptionsService.isTreeData(); this.addManagedPropertyListener('groupDisplayType', function () { return _this.onAutoGroupColumnDefChanged(); }); this.addManagedPropertyListener('autoGroupColumnDef', function () { return _this.onAutoGroupColumnDefChanged(); }); this.addManagedPropertyListener('defaultColDef', function (params) { return _this.onSharedColDefChanged(params.source); }); this.addManagedPropertyListener('columnTypes', function (params) { return _this.onSharedColDefChanged(params.source); }); }; ColumnModel.prototype.onAutoGroupColumnDefChanged = function () { this.autoGroupsNeedBuilding = true; this.forceRecreateAutoGroups = true; this.updateGridColumns(); this.updateDisplayedColumns('gridOptionsChanged'); }; ColumnModel.prototype.onSharedColDefChanged = function (source) { if (source === void 0) { source = 'api'; } // likewise for autoGroupCol, the default col def impacts this this.forceRecreateAutoGroups = true; this.createColumnsFromColumnDefs(true, source); }; ColumnModel.prototype.setColumnDefs = function (columnDefs, source) { if (source === void 0) { source = 'api'; } var colsPreviouslyExisted = !!this.columnDefs; this.columnDefs = columnDefs; this.createColumnsFromColumnDefs(colsPreviouslyExisted, source); }; ColumnModel.prototype.destroyOldColumns = function (oldTree, newTree) { var oldObjectsById = {}; if (!oldTree) { return; } // add in all old columns to be destroyed this.columnUtils.depthFirstOriginalTreeSearch(null, oldTree, function (child) { oldObjectsById[child.getInstanceId()] = child; }); // however we don't destroy anything in the new tree. if destroying the grid, there is no new tree if (newTree) { this.columnUtils.depthFirstOriginalTreeSearch(null, newTree, function (child) { oldObjectsById[child.getInstanceId()] = null; }); } // what's left can be destroyed var colsToDestroy = Object.values(oldObjectsById).filter(function (item) { return item != null; }); this.destroyBeans(colsToDestroy); }; ColumnModel.prototype.destroyColumns = function () { this.destroyOldColumns(this.primaryColumnTree); this.destroyOldColumns(this.secondaryBalancedTree); this.destroyOldColumns(this.groupAutoColsBalancedTree); }; ColumnModel.prototype.createColumnsFromColumnDefs = function (colsPreviouslyExisted, source) { var _this = this; if (source === void 0) { source = 'api'; } // only need to dispatch before/after events if updating columns, never if setting columns for first time var dispatchEventsFunc = colsPreviouslyExisted ? this.compareColumnStatesAndDispatchEvents(source) : undefined; // always invalidate cache on changing columns, as the column id's for the new columns // could overlap with the old id's, so the cache would return old values for new columns. this.valueCache.expire(); // NOTE ================== // we should be destroying the existing columns and groups if they exist, for example, the original column // group adds a listener to the columns, it should be also removing the listeners this.autoGroupsNeedBuilding = true; var oldPrimaryColumns = this.primaryColumns; var oldPrimaryTree = this.primaryColumnTree; var balancedTreeResult = this.columnFactory.createColumnTree(this.columnDefs, true, oldPrimaryTree); this.destroyOldColumns(this.primaryColumnTree, balancedTreeResult.columnTree); this.primaryColumnTree = balancedTreeResult.columnTree; this.primaryHeaderRowCount = balancedTreeResult.treeDept + 1; this.primaryColumns = this.getColumnsFromTree(this.primaryColumnTree); this.primaryColumnsMap = {}; this.primaryColumns.forEach(function (col) { return _this.primaryColumnsMap[col.getId()] = col; }); this.extractRowGroupColumns(source, oldPrimaryColumns); this.extractPivotColumns(source, oldPrimaryColumns); this.extractValueColumns(source, oldPrimaryColumns); this.ready = true; // if we are showing secondary columns, then no need to update grid columns // at this point, as it's the pivot service responsibility to change these // if we are no longer pivoting (ie and need to revert back to primary, otherwise // we shouldn't be touching the primary). var gridColsNotProcessed = this.gridColsArePrimary === undefined; var processGridCols = this.gridColsArePrimary || gridColsNotProcessed; if (processGridCols) { this.updateGridColumns(); if (colsPreviouslyExisted && !this.gridOptionsService.is('maintainColumnOrder')) { this.orderGridColumnsLikePrimary(); } this.updateDisplayedColumns(source); this.checkViewportColumns(); } // this event is not used by AG Grid, but left here for backwards compatibility, // in case applications use it this.dispatchEverythingChanged(source); if (dispatchEventsFunc) { dispatchEventsFunc(); } this.dispatchNewColumnsLoaded(); }; ColumnModel.prototype.dispatchNewColumnsLoaded = function () { var newColumnsLoadedEvent = { type: Events.EVENT_NEW_COLUMNS_LOADED }; this.eventService.dispatchEvent(newColumnsLoadedEvent); }; // this event is legacy, no grid code listens to it. instead the grid listens to New Columns Loaded ColumnModel.prototype.dispatchEverythingChanged = function (source) { if (source === void 0) { source = 'api'; } var eventEverythingChanged = { type: Events.EVENT_COLUMN_EVERYTHING_CHANGED, source: source }; this.eventService.dispatchEvent(eventEverythingChanged); }; ColumnModel.prototype.orderGridColumnsLikePrimary = function () { var _this = this; var primaryColumns = this.primaryColumns; if (!primaryColumns) { return; } this.gridColumns.sort(function (colA, colB) { var primaryIndexA = primaryColumns.indexOf(colA); var primaryIndexB = primaryColumns.indexOf(colB); // if both cols are present in primary, then we just return the position, // so position is maintained. var indexAPresent = primaryIndexA >= 0; var indexBPresent = primaryIndexB >= 0; if (indexAPresent && indexBPresent) { return primaryIndexA - primaryIndexB; } if (indexAPresent) { // B is auto group column, so put B first return 1; } if (indexBPresent) { // A is auto group column, so put A first return -1; } // otherwise both A and B are auto-group columns. so we just keep the order // as they were already in. var gridIndexA = _this.gridColumns.indexOf(colA); var gridIndexB = _this.gridColumns.indexOf(colB); return gridIndexA - gridIndexB; }); this.gridColumns = this.placeLockedColumns(this.gridColumns); }; ColumnModel.prototype.getAllDisplayedAutoHeightCols = function () { return this.displayedAutoHeightCols; }; ColumnModel.prototype.setViewport = function () { if (this.gridOptionsService.is('enableRtl')) { this.viewportLeft = this.bodyWidth - this.scrollPosition - this.scrollWidth; this.viewportRight = this.bodyWidth - this.scrollPosition; } else { this.viewportLeft = this.scrollPosition; this.viewportRight = this.scrollWidth + this.scrollPosition; } }; // used by clipboard service, to know what columns to paste into ColumnModel.prototype.getDisplayedColumnsStartingAt = function (column) { var currentColumn = column; var columns = []; while (currentColumn != null) { columns.push(currentColumn); currentColumn = this.getDisplayedColAfter(currentColumn); } return columns; }; // checks what columns are currently displayed due to column virtualisation. dispatches an event // if the list of columns has changed. // + setColumnWidth(), setViewportPosition(), setColumnDefs(), sizeColumnsToFit() ColumnModel.prototype.checkViewportColumns = function () { // check displayCenterColumnTree exists first, as it won't exist when grid is initialising if (this.displayedColumnsCenter == null) { return; } var viewportColumnsChanged = this.extractViewport(); if (!viewportColumnsChanged) { return; } var event = { type: Events.EVENT_VIRTUAL_COLUMNS_CHANGED }; this.eventService.dispatchEvent(event); }; ColumnModel.prototype.setViewportPosition = function (scrollWidth, scrollPosition) { if (scrollWidth !== this.scrollWidth || scrollPosition !== this.scrollPosition || this.bodyWidthDirty) { this.scrollWidth = scrollWidth; this.scrollPosition = scrollPosition; // we need to call setVirtualViewportLeftAndRight() at least once after the body width changes, // as the viewport can stay the same, but in RTL, if body width changes, we need to work out the // virtual columns again this.bodyWidthDirty = true; this.setViewport(); if (this.ready) { this.checkViewportColumns(); } } }; ColumnModel.prototype.isPivotMode = function () { return this.pivotMode; }; ColumnModel.prototype.isPivotSettingAllowed = function (pivot) { if (pivot && this.gridOptionsService.isTreeData()) { console.warn("AG Grid: Pivot mode not available in conjunction Tree Data i.e. 'gridOptions.treeData: true'"); return false; } return true; }; ColumnModel.prototype.setPivotMode = function (pivotMode, source) { if (source === void 0) { source = 'api'; } if (pivotMode === this.pivotMode || !this.isPivotSettingAllowed(this.pivotMode)) { return; } this.pivotMode = pivotMode; // we need to update grid columns to cover the scenario where user has groupDisplayType = 'custom', as // this means we don't use auto group column UNLESS we are in pivot mode (it's mandatory in pivot mode), // so need to updateGridColumn() to check it autoGroupCol needs to be added / removed this.autoGroupsNeedBuilding = true; this.updateGridColumns(); this.updateDisplayedColumns(source); var event = { type: Events.EVENT_COLUMN_PIVOT_MODE_CHANGED }; this.eventService.dispatchEvent(event); }; ColumnModel.prototype.getSecondaryPivotColumn = function (pivotKeys, valueColKey) { if (missing(this.secondaryColumns)) { return null; } var valueColumnToFind = this.getPrimaryColumn(valueColKey); var foundColumn = null; this.secondaryColumns.forEach(function (column) { var thisPivotKeys = column.getColDef().pivotKeys; var pivotValueColumn = column.getColDef().pivotValueColumn; var pivotKeyMatches = areEqual(thisPivotKeys, pivotKeys); var pivotValueMatches = pivotValueColumn === valueColumnToFind; if (pivotKeyMatches && pivotValueMatches) { foundColumn = column; } }); return foundColumn; }; ColumnModel.prototype.setBeans = function (loggerFactory) { this.logger = loggerFactory.create('columnModel'); }; ColumnModel.prototype.setFirstRightAndLastLeftPinned = function (source) { var lastLeft; var firstRight; if (this.gridOptionsService.is('enableRtl')) { lastLeft = this.displayedColumnsLeft ? this.displayedColumnsLeft[0] : null; firstRight = this.displayedColumnsRight ? last(this.displayedColumnsRight) : null; } else { lastLeft = this.displayedColumnsLeft ? last(this.displayedColumnsLeft) : null; firstRight = this.displayedColumnsRight ? this.displayedColumnsRight[0] : null; } this.gridColumns.forEach(function (column) { column.setLastLeftPinned(column === lastLeft, source); column.setFirstRightPinned(column === firstRight, source); }); }; ColumnModel.prototype.autoSizeColumns = function (params) { var _this = this; var columns = params.columns, skipHeader = params.skipHeader, skipHeaderGroups = params.skipHeaderGroups, stopAtGroup = params.stopAtGroup, _a = params.source, source = _a === void 0 ? 'api' : _a; // because of column virtualisation, we can only do this function on columns that are // actually rendered, as non-rendered columns (outside the viewport and not rendered // due to column virtualisation) are not present. this can result in all rendered columns // getting narrowed, which in turn introduces more rendered columns on the RHS which // did not get autosized in the original run, leaving the visible grid with columns on // the LHS sized, but RHS no. so we keep looping through the visible columns until // no more cols are available (rendered) to be resized // we autosize after animation frames finish in case any cell renderers need to complete first. this can // happen eg if client code is calling api.autoSizeAllColumns() straight after grid is initialised, but grid // hasn't fully drawn out all the cells yet (due to cell renderers in animation frames). this.animationFrameService.flushAllFrames(); // keep track of which cols we have resized in here var columnsAutosized = []; // initialise with anything except 0 so that while loop executes at least once var changesThisTimeAround = -1; var shouldSkipHeader = skipHeader != null ? skipHeader : this.gridOptionsService.is('skipHeaderOnAutoSize'); var shouldSkipHeaderGroups = skipHeaderGroups != null ? skipHeaderGroups : shouldSkipHeader; while (changesThisTimeAround !== 0) { changesThisTimeAround = 0; this.actionOnGridColumns(columns, function (column) { // if already autosized, skip it if (columnsAutosized.indexOf(column) >= 0) { return false; } // get how wide this col should be var preferredWidth = _this.autoWidthCalculator.getPreferredWidthForColumn(column, shouldSkipHeader); // preferredWidth = -1 if this col is not on the screen if (preferredWidth > 0) { var newWidth = _this.normaliseColumnWidth(column, preferredWidth); column.setActualWidth(newWidth, source); columnsAutosized.push(column); changesThisTimeAround++; } return true; }, source); } if (!shouldSkipHeaderGroups) { this.autoSizeColumnGroupsByColumns(columns, stopAtGroup); } this.dispatchColumnResizedEvent(columnsAutosized, true, 'autosizeColumns'); }; ColumnModel.prototype.dispatchColumnResizedEvent = function (columns, finished, source, flexColumns) { if (flexColumns === void 0) { flexColumns = null; } if (columns && columns.length) { var event_1 = { type: Events.EVENT_COLUMN_RESIZED, columns: columns, column: columns.length === 1 ? columns[0] : null, flexColumns: flexColumns, finished: finished, source: source }; this.eventService.dispatchEvent(event_1); } }; ColumnModel.prototype.dispatchColumnChangedEvent = function (type, columns, source) { var event = { type: type, columns: columns, column: (columns && columns.length == 1) ? columns[0] : null, source: source }; this.eventService.dispatchEvent(event); }; ColumnModel.prototype.dispatchColumnMovedEvent = function (params) { var movedColumns = params.movedColumns, source = params.source, toIndex = params.toIndex, finished = params.finished; var event = { type: Events.EVENT_COLUMN_MOVED, columns: movedColumns, column: movedColumns && movedColumns.length === 1 ? movedColumns[0] : null, toIndex: toIndex, finished: finished, source: source }; this.eventService.dispatchEvent(event); }; ColumnModel.prototype.dispatchColumnPinnedEvent = function (changedColumns, source) { if (!changedColumns.length) { return; } // if just one column, we use this, otherwise we don't include the col var column = changedColumns.length === 1 ? changedColumns[0] : null; // only include visible if it's common in all columns var pinned = this.getCommonValue(changedColumns, function (col) { return col.getPinned(); }); var event = { type: Events.EVENT_COLUMN_PINNED, // mistake in typing, 'undefined' should be allowed, as 'null' means 'not pinned' pinned: pinned != null ? pinned : null, columns: changedColumns, column: column, source: source }; this.eventService.dispatchEvent(event); }; ColumnModel.prototype.dispatchColumnVisibleEvent = function (changedColumns, source) { if (!changedColumns.length) { return; } // if just one column, we use this, otherwise we don't include the col var column = changedColumns.length === 1 ? changedColumns[0] : null; // only include visible if it's common in all columns var visible = this.getCommonValue(changedColumns, function (col) { return col.isVisible(); }); var event = { type: Events.EVENT_COLUMN_VISIBLE, visible: visible, columns: changedColumns, column: column, source: source }; this.eventService.dispatchEvent(event); }; ColumnModel.prototype.autoSizeColumn = function (key, skipHeader, source) { if (source === void 0) { source = "api"; } if (key) { this.autoSizeColumns({ columns: [key], skipHeader: skipHeader, skipHeaderGroups: true, source: source }); } }; ColumnModel.prototype.autoSizeColumnGroupsByColumns = function (keys, stopAtGroup) { var e_1, _a, e_2, _b; var columnGroups = new Set(); var columns = this.getGridColumns(keys); columns.forEach(function (col) { var parent = col.getParent(); while (parent && parent != stopAtGroup) { if (!parent.isPadding()) { columnGroups.add(parent); } parent = parent.getParent(); } }); var headerGroupCtrl; var resizedColumns = []; try { for (var columnGroups_1 = __values(columnGroups), columnGroups_1_1 = columnGroups_1.next(); !columnGroups_1_1.done; columnGroups_1_1 = columnGroups_1.next()) { var columnGroup = columnGroups_1_1.value; try { for (var _c = (e_2 = void 0, __values(this.ctrlsService.getHeaderRowContainerCtrls())), _d = _c.next(); !_d.done; _d = _c.next()) { var headerContainerCtrl = _d.value; headerGroupCtrl = headerContainerCtrl.getHeaderCtrlForColumn(columnGroup); if (headerGroupCtrl) { break; } } } catch (e_2_1) { e_2 = { error: e_2_1 }; } finally { try { if (_d && !_d.done && (_b = _c.return)) _b.call(_c); } finally { if (e_2) throw e_2.error; } } if (headerGroupCtrl) { headerGroupCtrl.resizeLeafColumnsToFit(); } } } catch (e_1_1) { e_1 = { error: e_1_1 }; } finally { try { if (columnGroups_1_1 && !columnGroups_1_1.done && (_a = columnGroups_1.return)) _a.call(columnGroups_1); } finally { if (e_1) throw e_1.error; } } return resizedColumns; }; ColumnModel.prototype.autoSizeAllColumns = function (skipHeader, source) { if (source === void 0) { source = "api"; } var allDisplayedColumns = this.getAllDisplayedColumns(); this.autoSizeColumns({ columns: allDisplayedColumns, skipHeader: skipHeader, source: source }); }; // Possible candidate for reuse (alot of recursive traversal duplication) ColumnModel.prototype.getColumnsFromTree = function (rootColumns) { var result = []; var recursiveFindColumns = function (childColumns) { for (var i = 0; i < childColumns.length; i++) { var child = childColumns[i]; if (child instanceof Column) { result.push(child); } else if (child instanceof ProvidedColumnGroup) { recursiveFindColumns(child.getChildren()); } } }; recursiveFindColumns(rootColumns); return result; }; ColumnModel.prototype.getAllDisplayedTrees = function () { if (this.displayedTreeLeft && this.displayedTreeRight && this.displayedTreeCentre) { return this.displayedTreeLeft .concat(this.displayedTreeCentre) .concat(this.displayedTreeRight); } return null; }; // + columnSelectPanel ColumnModel.prototype.getPrimaryColumnTree = function () { return this.primaryColumnTree; }; // + gridPanel -> for resizing the body and setting top margin ColumnModel.prototype.getHeaderRowCount = function () { return this.gridHeaderRowCount; }; // + headerRenderer -> setting pinned body width ColumnModel.prototype.getDisplayedTreeLeft = function () { return this.displayedTreeLeft; }; // + headerRenderer -> setting pinned body width ColumnModel.prototype.getDisplayedTreeRight = function () { return this.displayedTreeRight; }; // + headerRenderer -> setting pinned body width ColumnModel.prototype.getDisplayedTreeCentre = function () { return this.displayedTreeCentre; }; // gridPanel -> ensureColumnVisible ColumnModel.prototype.isColumnDisplayed = function (column) { return this.getAllDisplayedColumns().indexOf(column) >= 0; }; // + csvCreator ColumnModel.prototype.getAllDisplayedColumns = function () { return this.displayedColumns; }; ColumnModel.prototype.getViewportColumns = function () { return this.viewportColumns; }; ColumnModel.prototype.getDisplayedLeftColumnsForRow = function (rowNode) { if (!this.colSpanActive) { return this.displayedColumnsLeft; } return this.getDisplayedColumnsForRow(rowNode, this.displayedColumnsLeft); }; ColumnModel.prototype.getDisplayedRightColumnsForRow = function (rowNode) { if (!this.colSpanActive) { return this.displayedColumnsRight; } return this.getDisplayedColumnsForRow(rowNode, this.displayedColumnsRight); }; ColumnModel.prototype.getDisplayedColumnsForRow = function (rowNode, displayedColumns, filterCallback, emptySpaceBeforeColumn) { var result = []; var lastConsideredCol = null; var _loop_1 = function (i) { var col = displayedColumns[i]; var maxAllowedColSpan = displayedColumns.length - i; var colSpan = Math.min(col.getColSpan(rowNode), maxAllowedColSpan); var columnsToCheckFilter = [col]; if (colSpan > 1) { var colsToRemove = colSpan - 1; for (var j = 1; j <= colsToRemove; j++) { columnsToCheckFilter.push(displayedColumns[i + j]); } i += colsToRemove; } // see which cols we should take out for column virtualisation var filterPasses; if (filterCallback) { // if user provided a callback, means some columns may not be in the viewport. // the user will NOT provide a callback if we are talking about pinned areas, // as pinned areas have no horizontal scroll and do not virtualise the columns. // if lots of columns, that means column spanning, and we set filterPasses = true // if one or more of the columns spanned pass the filter. filterPasses = false; columnsToCheckFilter.forEach(function (colForFilter) { if (filterCallback(colForFilter)) { filterPasses = true; } }); } else { filterPasses = true; } if (filterPasses) { if (result.length === 0 && lastConsideredCol) { var gapBeforeColumn = emptySpaceBeforeColumn ? emptySpaceBeforeColumn(col) : false; if (gapBeforeColumn) { result.push(lastConsideredCol); } } result.push(col); } lastConsideredCol = col; out_i_1 = i; }; var out_i_1; for (var i = 0; i < displayedColumns.length; i++) { _loop_1(i); i = out_i_1; } return result; }; // + rowRenderer // if we are not column spanning, this just returns back the virtual centre columns, // however if we are column spanning, then different rows can have different virtual // columns, so we have to work out the list for each individual row. ColumnModel.prototype.getViewportCenterColumnsForRow = function (rowNode) { var _this = this; if (!this.colSpanActive) { return this.viewportColumnsCenter; } var emptySpaceBeforeColumn = function (col) { var left = col.getLeft(); return exists(left) && left > _this.viewportLeft; }; // if doing column virtualisation, then we filter based on the viewport. var filterCallback = this.suppressColumnVirtualisation ? null : this.isColumnInRowViewport.bind(this); return this.getDisplayedColumnsForRow(rowNode, this.displayedColumnsCenter, filterCallback, emptySpaceBeforeColumn); }; ColumnModel.prototype.getAriaColumnIndex = function (col) { return this.getAllGridColumns().indexOf(col) + 1; }; ColumnModel.prototype.isColumnInHeaderViewport = function (col) { // for headers, we never filter out autoHeaderHeight columns, if calculating if (col.isAutoHeaderHeight()) { return true; } return this.isColumnInRowViewport(col); }; ColumnModel.prototype.isColumnInRowViewport = function (col) { // we never filter out autoHeight columns, as we need them in the DOM for calculating Auto Height if (col.isAutoHeight()) { return true; } var columnLeft = col.getLeft() || 0; var columnRight = columnLeft + col.getActualWidth(); // adding 200 for buffer size, so some cols off viewport are rendered. // this helps horizontal scrolling so user rarely sees white space (unless // they scroll horizontally fast). however we are conservative, as the more // buffer the slower the vertical redraw speed var leftBounds = this.viewportLeft - 200; var rightBounds = this.viewportRight + 200; var columnToMuchLeft = columnLeft < leftBounds && columnRight < leftBounds; var columnToMuchRight = columnLeft > rightBounds && columnRight > rightBounds; return !columnToMuchLeft && !columnToMuchRight; }; // used by: // + angularGrid -> setting pinned body width // note: this should be cached ColumnModel.prototype.getDisplayedColumnsLeftWidth = function () { return this.getWidthOfColsInList(this.displayedColumnsLeft); }; // note: this should be cached ColumnModel.prototype.getDisplayedColumnsRightWidth = function () { return this.getWidthOfColsInList(this.displayedColumnsRight); }; ColumnModel.prototype.updatePrimaryColumnList = function (keys, masterList, actionIsAdd, columnCallback, eventType, source) { var _this = this; if (source === void 0) { source = "api"; } if (!keys || missingOrEmpty(keys)) { return; } var atLeastOne = false; keys.forEach(function (key) { var columnToAdd = _this.getPrimaryColumn(key); if (!columnToAdd) { return; } if (actionIsAdd) { if (masterList.indexOf(columnToAdd) >= 0) { return; } masterList.push(columnToAdd); } else { if (masterList.indexOf(columnToAdd) < 0) { return; } removeFromArray(masterList, columnToAdd); } columnCallback(columnToAdd); atLeastOne = true; }); if (!atLeastOne) { return; } if (this.autoGroupsNeedBuilding) { this.updateGridColumns(); } this.updateDisplayedColumns(source); var event = { type: eventType, columns: masterList, column: masterList.length === 1 ? masterList[0] : null, source: source }; this.eventService.dispatchEvent(event); }; ColumnModel.prototype.setRowGroupColumns = function (colKeys, source) { if (source === void 0) { source = "api"; } this.autoGroupsNeedBuilding = true; this.setPrimaryColumnList(colKeys, this.rowGroupColumns, Events.EVENT_COLUMN_ROW_GROUP_CHANGED, this.setRowGroupActive.bind(this), source); }; ColumnModel.prototype.setRowGroupActive = function (active, column, source) { if (active === column.isRowGroupActive()) { return; } column.setRowGroupActive(active, source); if (active && !this.gridOptionsService.is('suppressRowGroupHidesColumns')) { this.setColumnVisible(column, false, source); } if (!active && !this.gridOptionsService.is('suppressMakeColumnVisibleAfterUnGroup')) { this.setColumnVisible(column, true, source); } }; ColumnModel.prototype.addRowGroupColumn = function (key, source) { if (source === void 0) { source = "api"; } if (key) { this.addRowGroupColumns([key], source); } }; ColumnModel.prototype.addRowGroupColumns = function (keys, source) { if (source === void 0) { source = "api"; } this.autoGroupsNeedBuilding = true; this.updatePrimaryColumnList(keys, this.rowGroupColumns, true, this.setRowGroupActive.bind(this, true), Events.EVENT_COLUMN_ROW_GROUP_CHANGED, source); }; ColumnModel.prototype.removeRowGroupColumns = function (keys, source) { if (source === void 0) { source = "api"; } this.autoGroupsNeedBuilding = true; this.updatePrimaryColumnList(keys, this.rowGroupColumns, false, this.setRowGroupActive.bind(this, false), Events.EVENT_COLUMN_ROW_GROUP_CHANGED, source); }; ColumnModel.prototype.removeRowGroupColumn = function (key, source) { if (source === void 0) { source = "api"; } if (key) { this.removeRowGroupColumns([key], source); } }; ColumnModel.prototype.addPivotColumns = function (keys, source) { if (source === void 0) { source = "api"; } this.updatePrimaryColumnList(keys, this.pivotColumns, true, function (column) { return column.setPivotActive(true, source); }, Events.EVENT_COLUMN_PIVOT_CHANGED, source); }; ColumnModel.prototype.setPivotColumns = function (colKeys, source) { if (source === void 0) { source = "api"; } this.setPrimaryColumnList(colKeys, this.pivotColumns, Events.EVENT_COLUMN_PIVOT_CHANGED, function (added, column) { column.setPivotActive(added, source); }, source); }; ColumnModel.prototype.addPivotColumn = function (key, source) { if (source === void 0) { source = "api"; } this.addPivotColumns([key], source); }; ColumnModel.prototype.removePivotColumns = function (keys, source) { if (source === void 0) { source = "api"; } this.updatePrimaryColumnList(keys, this.pivotColumns, false, function (column) { return column.setPivotActive(false, source); }, Events.EVENT_COLUMN_PIVOT_CHANGED, source); }; ColumnModel.prototype.removePivotColumn = function (key, source) { if (source === void 0) { source = "api"; } this.removePivotColumns([key], source); }; ColumnModel.prototype.setPrimaryColumnList = function (colKeys, masterList, eventName, columnCallback, source) { var _this = this; masterList.length = 0; if (exists(colKeys)) { colKeys.forEach(function (key) { var column = _this.getPrimaryColumn(key); if (column) { masterList.push(column); } }); } (this.primaryColumns || []).forEach(function (column) { var added = masterList.indexOf(column) >= 0; columnCallback(added, column); }); if (this.autoGroupsNeedBuilding) { this.updateGridColumns(); } this.updateDisplayedColumns(source); this.dispatchColumnChangedEvent(eventName, masterList, source); }; ColumnModel.prototype.setValueColumns = function (colKeys, source) { if (source === void 0) { source = "api"; } this.setPrimaryColumnList(colKeys, this.valueColumns, Events.EVENT_COLUMN_VALUE_CHANGED, this.setValueActive.bind(this), source); }; ColumnModel.prototype.setValueActive = function (active, column, source) { if (active === column.isValueActive()) { return; } column.setValueActive(active, source); if (active && !column.getAggFunc()) { var initialAggFunc = this.aggFuncService.getDefaultAggFunc(column); column.setAggFunc(initialAggFunc); } }; ColumnModel.prototype.addValueColumns = function (keys, source) { if (source === void 0) { source = "api"; } this.updatePrimaryColumnList(keys, this.valueColumns, true, this.setValueActive.bind(this, true), Events.EVENT_COLUMN_VALUE_CHANGED, source); }; ColumnModel.prototype.addValueColumn = function (colKey, source) { if (source === void 0) { source = "api"; } if (colKey) { this.addValueColumns([colKey], source); } }; ColumnModel.prototype.removeValueColumn = function (colKey, source) { if (source === void 0) { source = "api"; } this.removeValueColumns([colKey], source); }; ColumnModel.prototype.removeValueColumns = function (keys, source) { if (source === void 0) { source = "api"; } this.updatePrimaryColumnList(keys, this.valueColumns, false, this.setValueActive.bind(this, false), Events.EVENT_COLUMN_VALUE_CHANGED, source); }; // returns the width we can set to this col, taking into consideration min and max widths ColumnModel.prototype.normaliseColumnWidth = function (column, newWidth) { var minWidth = column.getMinWidth(); if (exists(minWidth) && newWidth < minWidth) { newWidth = minWidth; } var maxWidth = column.getMaxWidth(); if (exists(maxWidth) && column.isGreaterThanMax(newWidth)) { newWidth = maxWidth; } return newWidth; }; ColumnModel.prototype.getPrimaryOrGridColumn = function (key) { var column = this.getPrimaryColumn(key); return column || this.getGridColumn(key); }; ColumnModel.prototype.setColumnWidths = function (columnWidths, shiftKey, // @takeFromAdjacent - if user has 'shift' pressed, then pixels are taken from adjacent column finished, // @finished - ends up in the event, tells the user if more events are to come source) { var _this = this; if (source === void 0) { source = "api"; } var sets = []; columnWidths.forEach(function (columnWidth) { var col = _this.getPrimaryOrGridColumn(columnWidth.key); if (!col) { return; } sets.push({ width: columnWidth.newWidth, ratios: [1], columns: [col] }); // if user wants to do shift resize by default, then we invert the shift operation var defaultIsShift = _this.gridOptionsService.get('colResizeDefault') === 'shift'; if (defaultIsShift) { shiftKey = !shiftKey; } if (shiftKey) { var otherCol = _this.getDisplayedColAfter(col); if (!otherCol) { return; } var widthDiff = col.getActualWidth() - columnWidth.newWidth; var otherColWidth = otherCol.getActualWidth() + widthDiff; sets.push({ width: otherColWidth, ratios: [1], columns: [otherCol] }); } }); if (sets.length === 0) { return; } this.resizeColumnSets({ resizeSets: sets, finished: finished, source: source }); }; ColumnModel.prototype.checkMinAndMaxWidthsForSet = function (columnResizeSet) { var columns = columnResizeSet.columns, width = columnResizeSet.width; // every col has a min width, so sum them all up and see if we have enough room // for all the min widths var minWidthAccumulated = 0; var maxWidthAccumulated = 0; var maxWidthActive = true; columns.forEach(function (col) { var minWidth = col.getMinWidth(); minWidthAccumulated += minWidth || 0; var maxWidth = col.getMaxWidth(); if (exists(maxWidth) && maxWidth > 0) { maxWidthAccumulated += maxWidth; } else { // if at least one columns has no max width, it means the group of columns // then has no max width, as at least one column can take as much width as possible maxWidthActive = false; } }); var minWidthPasses = width >= minWidthAccumulated; var maxWidthPasses = !maxWidthActive || (width <= maxWidthAccumulated); return minWidthPasses && maxWidthPasses; }; // method takes sets of columns and resizes them. either all sets will be resized, or nothing // be resized. this is used for example when user tries to resize a group and holds shift key, // then both the current group (grows), and the adjacent group (shrinks), will get resized, // so that's two sets for this method. ColumnModel.prototype.resizeColumnSets = function (params) { var _this = this; var resizeSets = params.resizeSets, finished = params.finished, source = params.source; var passMinMaxCheck = !resizeSets || resizeSets.every(function (columnResizeSet) { return _this.checkMinAndMaxWidthsForSet(columnResizeSet); }); if (!passMinMaxCheck) { // even though we are not going to resize beyond min/max size, we still need to dispatch event when finished if (finished) { var columns = resizeSets && resizeSets.length > 0 ? resizeSets[0].columns : null; this.dispatchColumnResizedEvent(columns, finished, source); } return; // don't resize! } var changedCols = []; var allResizedCols = []; resizeSets.forEach(function (set) { var width = set.width, columns = set.columns, ratios = set.ratios; // keep track of pixels used, and last column gets the remaining, // to cater for rounding errors, and min width adjustments var newWidths = {}; var finishedCols = {}; columns.forEach(function (col) { return allResizedCols.push(col); }); // the loop below goes through each col. if a col exceeds it's min/max width, // it then gets set to its min/max width and the column is removed marked as 'finished' // and the calculation is done again leaving this column out. take for example columns // {A, width: 50, maxWidth: 100} // {B, width: 50} // {C, width: 50} // and then the set is set to width 600 - on the first pass the grid tries to set each column // to 200. it checks A and sees 200 > 100 and so sets the width to 100. col A is then marked // as 'finished' and the calculation is done again with the remaining cols B and C, which end up // splitting the remaining 500 pixels. var finishedColsGrew = true; var loopCount = 0; var _loop_2 = function () { loopCount++; if (loopCount > 1000) { // this should never happen, but in the future, someone might introduce a bug here, // so we stop the browser from hanging and report bug properly console.error('AG Grid: infinite loop in resizeColumnSets'); return "break"; } finishedColsGrew = false; var subsetCols = []; var subsetRatioTotal = 0; var pixelsToDistribute = width; columns.forEach(function (col, index) { var thisColFinished = finishedCols[col.getId()]; if (thisColFinished) { pixelsToDistribute -= newWidths[col.getId()]; } else { subsetCols.push(col); var ratioThisCol = ratios[index]; subsetRatioTotal += ratioThisCol; } }); // because we are not using all of the ratios (cols can be missing), // we scale the ratio. if all columns are included, then subsetRatioTotal=1, // and so the ratioScale will be 1. var ratioScale = 1 / subsetRatioTotal; subsetCols.forEach(function (col, index) { var lastCol = index === (subsetCols.length - 1); var colNewWidth; if (lastCol) { colNewWidth = pixelsToDistribute; } else { colNewWidth = Math.round(ratios[index] * width * ratioScale); pixelsToDistribute -= colNewWidth; } var minWidth = col.getMinWidth(); var maxWidth = col.getMaxWidth(); if (exists(minWidth) && colNewWidth < minWidth) { colNewWidth = minWidth; finishedCols[col.getId()] = true; finishedColsGrew = true; } else if (exists(maxWidth) && maxWidth > 0 && colNewWidth > maxWidth) { colNewWidth = maxWidth; finishedCols[col.getId()] = true; finishedColsGrew = true; } newWidths[col.getId()] = colNewWidth; }); }; while (finishedColsGrew) { var state_1 = _loop_2(); if (state_1 === "break") break; } columns.forEach(function (col) { var newWidth = newWidths[col.getId()]; var actualWidth = col.getActualWidth(); if (actualWidth !== newWidth) { col.setActualWidth(newWidth, source); changedCols.push(col); } }); }); // if no cols changed, then no need to update more or send event. var atLeastOneColChanged = changedCols.length > 0; var flexedCols = []; if (atLeastOneColChanged) { flexedCols = this.refreshFlexedColumns({ resizingCols: allResizedCols, skipSetLeft: true }); this.setLeftValues(source); this.updateBodyWidths(); this.checkViewportColumns(); } // check for change first, to avoid unnecessary firing of events // however we always dispatch 'finished' events. this is important // when groups are resized, as if the group is changing slowly, // eg 1 pixel at a time, then each change will dispatch change events // in all the columns in the group, but only one with get the pixel. var colsForEvent = allResizedCols.concat(flexedCols); if (atLeastOneColChanged || finished) { this.dispatchColumnResizedEvent(colsForEvent, finished, source, flexedCols); } }; ColumnModel.prototype.setColumnAggFunc = function (key, aggFunc, source) { if (source === void 0) { source = "api"; } if (!key) { return; } var column = this.getPrimaryColumn(key); if (!column) { return; } column.setAggFunc(aggFunc); this.dispatchColumnChangedEvent(Events.EVENT_COLUMN_VALUE_CHANGED, [column], source); }; ColumnModel.prototype.moveRowGroupColumn = function (fromIndex, toIndex, source) { if (source === void 0) { source = "api"; } var column = this.rowGroupColumns[fromIndex]; this.rowGroupColumns.splice(fromIndex, 1); this.rowGroupColumns.splice(toIndex, 0, column); var event = { type: Events.EVENT_COLUMN_ROW_GROUP_CHANGED, columns: this.rowGroupColumns, column: this.rowGroupColumns.length === 1 ? this.rowGroupColumns[0] : null, source: source }; this.eventService.dispatchEvent(event); }; ColumnModel.prototype.moveColumns = function (columnsToMoveKeys, toIndex, source, finished) { if (source === void 0) { source = "api"; } if (finished === void 0) { finished = true; } this.columnAnimationService.start(); if (toIndex > this.gridColumns.length - columnsToMoveKeys.length) { console.warn('AG Grid: tried to insert columns in invalid location, toIndex = ' + toIndex); console.warn('AG Grid: remember that you should not count the moving columns when calculating the new index'); return; } // we want to pull all the columns out first and put them into an ordered list var movedColumns = this.getGridColumns(columnsToMoveKeys); var failedRules = !this.doesMovePassRules(movedColumns, toIndex); if (failedRules) { return; } moveInArray(this.gridColumns, movedColumns, toIndex); this.updateDisplayedColumns(source); this.dispatchColumnMovedEvent({ movedColumns: movedColumns, source: source, toIndex: toIndex, finished: finished }); this.columnAnimationService.finish(); }; ColumnModel.prototype.doesMovePassRules = function (columnsToMove, toIndex) { // make a copy of what the grid columns would look like after the move var proposedColumnOrder = this.getProposedColumnOrder(columnsToMove, toIndex); return this.doesOrderPassRules(proposedColumnOrder); }; ColumnModel.prototype.doesOrderPassRules = function (gridOrder) { if (!this.doesMovePassMarryChildren(gridOrder)) { return false; } if (!this.doesMovePassLockedPositions(gridOrder)) { return false; } return true; }; ColumnModel.prototype.getProposedColumnOrder = function (columnsToMove, toIndex) { var proposedColumnOrder = this.gridColumns.slice(); moveInArray(proposedColumnOrder, columnsToMove, toIndex); return proposedColumnOrder; }; // returns the provided cols sorted in same order as they appear in grid columns. eg if grid columns // contains [a,b,c,d,e] and col passed is [e,a] then the passed cols are sorted into [a,e] ColumnModel.prototype.sortColumnsLikeGridColumns = function (cols) { var _this = this; if (!cols || cols.length <= 1) { return; } var notAllColsInGridColumns = cols.filter(function (c) { return _this.gridColumns.indexOf(c) < 0; }).length > 0; if (notAllColsInGridColumns) { return; } cols.sort(function (a, b) { var indexA = _this.gridColumns.indexOf(a); var indexB = _this.gridColumns.indexOf(b); return indexA - indexB; }); }; ColumnModel.prototype.doesMovePassLockedPositions = function (proposedColumnOrder) { // Placement is a number indicating 'left' 'center' or 'right' as 0 1 2 var lastPlacement = 0; var rulePassed = true; var lockPositionToPlacement = function (position) { if (!position) { // false or undefined return 1; } if (position === true) { return 0; } return position === 'left' ? 0 : 2; // Otherwise 'right' }; proposedColumnOrder.forEach(function (col) { var placement = lockPositionToPlacement(col.getColDef().lockPosition); if (placement < lastPlacement) { // If placement goes down, we're not in the correct order rulePassed = false; } lastPlacement = placement; }); return rulePassed; }; ColumnModel.prototype.doesMovePassMarryChildren = function (allColumnsCopy) { var rulePassed = true; this.columnUtils.depthFirstOriginalTreeSearch(null, this.gridBalancedTree, function (child) { if (!(child instanceof ProvidedColumnGroup)) { return; } var columnGroup = child; var colGroupDef = columnGroup.getColGroupDef(); var marryChildren = colGroupDef && colGroupDef.marryChildren; if (!marryChildren) { return; } var newIndexes = []; columnGroup.getLeafColumns().forEach(function (col) { var newColIndex = allColumnsCopy.indexOf(col); newIndexes.push(newColIndex); }); var maxIndex = Math.max.apply(Math, newIndexes); var minIndex = Math.min.apply(Math, newIndexes); // spread is how far the first column in this group is away from the last column var spread = maxIndex - minIndex; var maxSpread = columnGroup.getLeafColumns().length - 1; // if the columns if (spread > maxSpread) { rulePassed = false; } // console.log(`maxIndex = ${maxIndex}, minIndex = ${minIndex}, spread = ${spread}, maxSpread = ${maxSpread}, fail = ${spread > (count-1)}`) // console.log(allColumnsCopy.map( col => col.getColDef().field).join(',')); }); return rulePassed; }; ColumnModel.prototype.moveColumn = function (key, toIndex, source) { if (source === void 0) { source = "api"; } this.moveColumns([key], toIndex, source); }; ColumnModel.prototype.moveColumnByIndex = function (fromIndex, toIndex, source) { if (source === void 0) { source = "api"; } var column = this.gridColumns[fromIndex]; this.moveColumn(column, toIndex, source); }; ColumnModel.prototype.getColumnDefs = function () { var _this = this; if (!this.primaryColumns) { return; } var cols = this.primaryColumns.slice(); if (this.gridColsArePrimary) { cols.sort(function (a, b) { return _this.gridColumns.indexOf(a) - _this.gridColumns.indexOf(b); }); } else if (this.lastPrimaryOrder) { cols.sort(function (a, b) { return _this.lastPrimaryOrder.indexOf(a) - _this.lastPrimaryOrder.indexOf(b); }); } return this.columnDefFactory.buildColumnDefs(cols, this.rowGroupColumns, this.pivotColumns); }; // used by: // + angularGrid -> for setting body width // + rowController -> setting main row widths (when inserting and resizing) // need to cache this ColumnModel.prototype.getBodyContainerWidth = function () { return this.bodyWidth; }; ColumnModel.prototype.getContainerWidth = function (pinned) { switch (pinned) { case 'left': return this.leftWidth; case 'right': return this.rightWidth; default: return this.bodyWidth; } }; // after setColumnWidth or updateGroupsAndDisplayedColumns ColumnModel.prototype.updateBodyWidths = function () { var newBodyWidth = this.getWidthOfColsInList(this.displayedColumnsCenter); var newLeftWidth = this.getWidthOfColsInList(this.displayedColumnsLeft); var newRightWidth = this.getWidthOfColsInList(this.displayedColumnsRight); // this is used by virtual col calculation, for RTL only, as a change to body width can impact displayed // columns, due to RTL inverting the y coordinates this.bodyWidthDirty = this.bodyWidth !== newBodyWidth; var atLeastOneChanged = this.bodyWidth !== newBodyWidth || this.leftWidth !== newLeftWidth || this.rightWidth !== newRightWidth; if (atLeastOneChanged) { this.bodyWidth = newBodyWidth; this.leftWidth = newLeftWidth; this.rightWidth = newRightWidth; // when this fires, it is picked up by the gridPanel, which ends up in // gridPanel calling setWidthAndScrollPosition(), which in turn calls setViewportPosition() var event_2 = { type: Events.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED, }; this.eventService.dispatchEvent(event_2); } }; // + rowController ColumnModel.prototype.getValueColumns = function () { return this.valueColumns ? this.valueColumns : []; }; // + rowController ColumnModel.prototype.getPivotColumns = function () { return this.pivotColumns ? this.pivotColumns : []; }; // + clientSideRowModel ColumnModel.prototype.isPivotActive = function () { return this.pivotColumns && this.pivotColumns.length > 0 && this.pivotMode; }; // + toolPanel ColumnModel.prototype.getRowGroupColumns = function () { return this.rowGroupColumns ? this.rowGroupColumns : []; }; // + rowController -> while inserting rows ColumnModel.prototype.getDisplayedCenterColumns = function () { return this.displayedColumnsCenter; }; // + rowController -> while inserting rows ColumnModel.prototype.getDisplayedLeftColumns = function () { return this.displayedColumnsLeft; }; ColumnModel.prototype.getDisplayedRightColumns = function () { return this.displayedColumnsRight; }; ColumnModel.prototype.getDisplayedColumns = function (type) { switch (type) { case 'left': return this.getDisplayedLeftColumns(); case 'right': return this.getDisplayedRightColumns(); default: return this.getDisplayedCenterColumns(); } }; // used by: // + clientSideRowController -> sorting, building quick filter text // + headerRenderer -> sorting (clearing icon) ColumnModel.prototype.getAllPrimaryColumns = function () { return this.primaryColumns ? this.primaryColumns.slice() : null; }; ColumnModel.prototype.getSecondaryColumns = function () { return this.secondaryColumns ? this.secondaryColumns.slice() : null; }; ColumnModel.prototype.getAllColumnsForQuickFilter = function () { return this.columnsForQuickFilter; }; // + moveColumnController ColumnModel.prototype.getAllGridColumns = function () { return this.gridColumns; }; ColumnModel.prototype.isEmpty = function () { return missingOrEmpty(this.gridColumns); }; ColumnModel.prototype.isRowGroupEmpty = function () { return missingOrEmpty(this.rowGroupColumns); }; ColumnModel.prototype.setColumnVisible = function (key, visible, source) { if (source === void 0) { source = "api"; } this.setColumnsVisible([key], visible, source); }; ColumnModel.prototype.setColumnsVisible = function (keys, visible, source) { if (visible === void 0) { visible = false; } if (source === void 0) { source = "api"; } this.applyColumnState({ state: keys.map(function (key) { return ({ colId: typeof key === 'string' ? key : key.getColId(), hide: !visible, }); }), }, source); }; ColumnModel.prototype.setColumnPinned = function (key, pinned, source) { if (source === void 0) { source = "api"; } if (key) { this.setColumnsPinned([key], pinned, source); } }; ColumnModel.prototype.setColumnsPinned = function (keys, pinned, source) { if (source === void 0) { source = "api"; } if (this.gridOptionsService.isDomLayout('print')) { console.warn("AG Grid: Changing the column pinning status is not allowed with domLayout='print'"); return; } this.columnAnimationService.start(); var actualPinned; if (pinned === true || pinned === 'left') { actualPinned = 'left'; } else if (pinned === 'right') { actualPinned = 'right'; } else { actualPinned = null; } this.actionOnGridColumns(keys, function (col) { if (col.getPinned() !== actualPinned) { col.setPinned(actualPinned); return true; } return false; }, source, function () { var event = { type: Events.EVENT_COLUMN_PINNED, pinned: actualPinned, column: null, columns: null, source: source }; return event; }); this.columnAnimationService.finish(); }; // does an action on a set of columns. provides common functionality for looking up the // columns based on key, getting a list of effected columns, and then updated the event // with either one column (if it was just one col) or a list of columns // used by: autoResize, setVisible, setPinned ColumnModel.prototype.actionOnGridColumns = function (// the column keys this action will be on keys, // the action to do - if this returns false, the column was skipped // and won't be included in the event action, // should return back a column event of the right type source, createEvent) { var _this = this; if (missingOrEmpty(keys)) { return; } var updatedColumns = []; keys.forEach(function (key) { var column = _this.getGridColumn(key); if (!column) { return; } // need to check for false with type (ie !== instead of !=) // as not returning anything (undefined) would also be false var resultOfAction = action(column); if (resultOfAction !== false) { updatedColumns.push(column); } }); if (!updatedColumns.length) { return; } this.updateDisplayedColumns(source); if (exists(createEvent) && createEvent) { var event_3 = createEvent(); event_3.columns = updatedColumns; event_3.column = updatedColumns.length === 1 ? updatedColumns[0] : null; this.eventService.dispatchEvent(event_3); } }; ColumnModel.prototype.getDisplayedColBefore = function (col) { var allDisplayedColumns = this.getAllDisplayedColumns(); var oldIndex = allDisplayedColumns.indexOf(col); if (oldIndex > 0) { return allDisplayedColumns[oldIndex - 1]; } return null; }; // used by: // + rowRenderer -> for navigation ColumnModel.prototype.getDisplayedColAfter = function (col) { var allDisplayedColumns = this.getAllDisplayedColumns(); var oldIndex = allDisplayedColumns.indexOf(col); if (oldIndex < (allDisplayedColumns.length - 1)) { return allDisplayedColumns[oldIndex + 1]; } return null; }; ColumnModel.prototype.getDisplayedGroupAfter = function (columnGroup) { return this.getDisplayedGroupAtDirection(columnGroup, 'After'); }; ColumnModel.prototype.getDisplayedGroupBefore = function (columnGroup) { return this.getDisplayedGroupAtDirection(columnGroup, 'Before'); }; ColumnModel.prototype.getDisplayedGroupAtDirection = function (columnGroup, direction) { // pick the last displayed column in this group var requiredLevel = columnGroup.getProvidedColumnGroup().getLevel() + columnGroup.getPaddingLevel(); var colGroupLeafColumns = columnGroup.getDisplayedLeafColumns(); var col = direction === 'After' ? last(colGroupLeafColumns) : colGroupLeafColumns[0]; var getDisplayColMethod = "getDisplayedCol" + direction; while (true) { // keep moving to the next col, until we get to another group var column = this[getDisplayColMethod](col); if (!column) { return null; } var groupPointer = this.getColumnGroupAtLevel(column, requiredLevel); if (groupPointer !== columnGroup) { return groupPointer; } } }; ColumnModel.prototype.getColumnGroupAtLevel = function (column, level) { // get group at same level as the one we are looking for var groupPointer = column.getParent(); var originalGroupLevel; var groupPointerLevel; while (true) { var groupPointerProvidedColumnGroup = groupPointer.getProvidedColumnGroup(); originalGroupLevel = groupPointerProvidedColumnGroup.getLevel(); groupPointerLevel = groupPointer.getPaddingLevel(); if (originalGroupLevel + groupPointerLevel <= level) { break; } groupPointer = groupPointer.getParent(); } return groupPointer; }; ColumnModel.prototype.isPinningLeft = function () { return this.displayedColumnsLeft.length > 0; }; ColumnModel.prototype.isPinningRight = function () { return this.displayedColumnsRight.length > 0; }; ColumnModel.prototype.getPrimaryAndSecondaryAndAutoColumns = function () { var _a; return (_a = []).concat.apply(_a, __spread$4([ this.primaryColumns || [], this.groupAutoColumns || [], this.secondaryColumns || [], ])); }; ColumnModel.prototype.createStateItemFromColumn = function (column) { var rowGroupIndex = column.isRowGroupActive() ? this.rowGroupColumns.indexOf(column) : null; var pivotIndex = column.isPivotActive() ? this.pivotColumns.indexOf(column) : null; var aggFunc = column.isValueActive() ? column.getAggFunc() : null; var sort = column.getSort() != null ? column.getSort() : null; var sortIndex = column.getSortIndex() != null ? column.getSortIndex() : null; var flex = column.getFlex() != null && column.getFlex() > 0 ? column.getFlex() : null; var res = { colId: column.getColId(), width: column.getActualWidth(), hide: !column.isVisible(), pinned: column.getPinned(), sort: sort, sortIndex: sortIndex, aggFunc: aggFunc, rowGroup: column.isRowGroupActive(), rowGroupIndex: rowGroupIndex, pivot: column.isPivotActive(), pivotIndex: pivotIndex, flex: flex }; return res; }; ColumnModel.prototype.getColumnState = function () { if (missing(this.primaryColumns) || !this.isAlive()) { return []; } var colsForState = this.getPrimaryAndSecondaryAndAutoColumns(); var res = colsForState.map(this.createStateItemFromColumn.bind(this)); this.orderColumnStateList(res); return res; }; ColumnModel.prototype.orderColumnStateList = function (columnStateList) { // for fast looking, store the index of each column var colIdToGridIndexMap = convertToMap(this.gridColumns.map(function (col, index) { return [col.getColId(), index]; })); columnStateList.sort(function (itemA, itemB) { var posA = colIdToGridIndexMap.has(itemA.colId) ? colIdToGridIndexMap.get(itemA.colId) : -1; var posB = colIdToGridIndexMap.has(itemB.colId) ? colIdToGridIndexMap.get(itemB.colId) : -1; return posA - posB; }); }; ColumnModel.prototype.resetColumnState = function (source) { // NOTE = there is one bug here that no customer has noticed - if a column has colDef.lockPosition, // this is ignored below when ordering the cols. to work, we should always put lockPosition cols first. // As a work around, developers should just put lockPosition columns first in their colDef list. if (source === void 0) { source = "api"; } // we can't use 'allColumns' as the order might of messed up, so get the primary ordered list var primaryColumns = this.getColumnsFromTree(this.primaryColumnTree); var columnStates = []; // we start at 1000, so if user has mix of rowGroup and group specified, it will work with both. // eg IF user has ColA.rowGroupIndex=0, ColB.rowGroupIndex=1, ColC.rowGroup=true, // THEN result will be ColA.rowGroupIndex=0, ColB.rowGroupIndex=1, ColC.rowGroup=1000 var letRowGroupIndex = 1000; var letPivotIndex = 1000; var colsToProcess = []; if (this.groupAutoColumns) { colsToProcess = colsToProcess.concat(this.groupAutoColumns); } if (primaryColumns) { colsToProcess = colsToProcess.concat(primaryColumns); } colsToProcess.forEach(function (column) { var getValueOrNull = function (a, b) { return a != null ? a : b != null ? b : null; }; var colDef = column.getColDef(); var sort = getValueOrNull(colDef.sort, colDef.initialSort); var sortIndex = getValueOrNull(colDef.sortIndex, colDef.initialSortIndex); var hide = getValueOrNull(colDef.hide, colDef.initialHide); var pinned = getValueOrNull(colDef.pinned, colDef.initialPinned); var width = getValueOrNull(colDef.width, colDef.initialWidth); var flex = getValueOrNull(colDef.flex, colDef.initialFlex); var rowGroupIndex = getValueOrNull(colDef.rowGroupIndex, colDef.initialRowGroupIndex); var rowGroup = getValueOrNull(colDef.rowGroup, colDef.initialRowGroup); if (rowGroupIndex == null && (rowGroup == null || rowGroup == false)) { rowGroupIndex = null; rowGroup = null; } var pivotIndex = getValueOrNull(colDef.pivotIndex, colDef.initialPivotIndex); var pivot = getValueOrNull(colDef.pivot, colDef.initialPivot); if (pivotIndex == null && (pivot == null || pivot == false)) { pivotIndex = null; pivot = null; } var aggFunc = getValueOrNull(colDef.aggFunc, colDef.initialAggFunc); var stateItem = { colId: column.getColId(), sort: sort, sortIndex: sortIndex, hide: hide, pinned: pinned, width: width, flex: flex, rowGroup: rowGroup, rowGroupIndex: rowGroupIndex, pivot: pivot, pivotIndex: pivotIndex, aggFunc: aggFunc, }; if (missing(rowGroupIndex) && rowGroup) { stateItem.rowGroupIndex = letRowGroupIndex++; } if (missing(pivotIndex) && pivot) { stateItem.pivotIndex = letPivotIndex++; } columnStates.push(stateItem); }); this.applyColumnState({ state: columnStates, applyOrder: true }, source); }; ColumnModel.prototype.applyColumnState = function (params, source) { var _this = this; if (missingOrEmpty(this.primaryColumns)) { return false; } if (params && params.state && !params.state.forEach) { console.warn('AG Grid: applyColumnState() - the state attribute should be an array, however an array was not found. Please provide an array of items (one for each col you want to change) for state.'); return false; } var applyStates = function (states, existingColumns, getById) { var dispatchEventsFunc = _this.compareColumnStatesAndDispatchEvents(source); _this.autoGroupsNeedBuilding = true; // at the end below, this list will have all columns we got no state for var columnsWithNoState = existingColumns.slice(); var rowGroupIndexes = {}; var pivotIndexes = {}; var autoGroupColumnStates = []; // If pivoting is modified, these are the states we try to reapply after // the secondary columns are re-generated var unmatchedAndAutoStates = []; var unmatchedCount = 0; var previousRowGroupCols = _this.rowGroupColumns.slice(); var previousPivotCols = _this.pivotColumns.slice(); states.forEach(function (state) { var colId = state.colId || ''; // auto group columns are re-created so deferring syncing with ColumnState var isAutoGroupColumn = colId.startsWith(GROUP_AUTO_COLUMN_ID); if (isAutoGroupColumn) { autoGroupColumnStates.push(state); unmatchedAndAutoStates.push(state); return; } var column = getById(colId); if (!column) { unmatchedAndAutoStates.push(state); unmatchedCount += 1; } else { _this.syncColumnWithStateItem(column, state, params.defaultState, rowGroupIndexes, pivotIndexes, false, source); removeFromArray(columnsWithNoState, column); } }); // anything left over, we got no data for, so add in the column as non-value, non-rowGroup and hidden var applyDefaultsFunc = function (col) { return _this.syncColumnWithStateItem(col, null, params.defaultState, rowGroupIndexes, pivotIndexes, false, source); }; columnsWithNoState.forEach(applyDefaultsFunc); // sort the lists according to the indexes that were provided var comparator = function (indexes, oldList, colA, colB) { var indexA = indexes[colA.getId()]; var indexB = indexes[colB.getId()]; var aHasIndex = indexA != null; var bHasIndex = indexB != null; if (aHasIndex && bHasIndex) { // both a and b are new cols with index, so sort on index return indexA - indexB; } if (aHasIndex) { // a has an index, so it should be before a return -1; } if (bHasIndex) { // b has an index, so it should be before a return 1; } var oldIndexA = oldList.indexOf(colA); var oldIndexB = oldList.indexOf(colB); var aHasOldIndex = oldIndexA >= 0; var bHasOldIndex = oldIndexB >= 0; if (aHasOldIndex && bHasOldIndex) { // both a and b are old cols, so sort based on last order return oldIndexA - oldIndexB; } if (aHasOldIndex) { // a is old, b is new, so b is first return -1; } // this bit does matter, means both are new cols // but without index or that b is old and a is new return 1; }; _this.rowGroupColumns.sort(comparator.bind(_this, rowGroupIndexes, previousRowGroupCols)); _this.pivotColumns.sort(comparator.bind(_this, pivotIndexes, previousPivotCols)); _this.updateGridColumns(); // sync newly created auto group columns with ColumnState var autoGroupColsCopy = _this.groupAutoColumns ? _this.groupAutoColumns.slice() : []; autoGroupColumnStates.forEach(function (stateItem) { var autoCol = _this.getAutoColumn(stateItem.colId); removeFromArray(autoGroupColsCopy, autoCol); _this.syncColumnWithStateItem(autoCol, stateItem, params.defaultState, null, null, true, source); }); // autogroup cols with nothing else, apply the default autoGroupColsCopy.forEach(applyDefaultsFunc); _this.applyOrderAfterApplyState(params); _this.updateDisplayedColumns(source); _this.dispatchEverythingChanged(source); dispatchEventsFunc(); // Will trigger secondary column changes if pivoting modified return { unmatchedAndAutoStates: unmatchedAndAutoStates, unmatchedCount: unmatchedCount }; }; this.columnAnimationService.start(); var _a = applyStates(params.state || [], this.primaryColumns || [], function (id) { return _this.getPrimaryColumn(id); }), unmatchedAndAutoStates = _a.unmatchedAndAutoStates, unmatchedCount = _a.unmatchedCount; // If there are still states left over, see if we can apply them to newly generated // secondary or auto columns. Also if defaults exist, ensure they are applied to secondary cols if (unmatchedAndAutoStates.length > 0 || exists(params.defaultState)) { unmatchedCount = applyStates(unmatchedAndAutoStates, this.secondaryColumns || [], function (id) { return _this.getSecondaryColumn(id); }).unmatchedCount; } this.columnAnimationService.finish(); return unmatchedCount === 0; // Successful if no states unaccounted for }; ColumnModel.prototype.applyOrderAfterApplyState = function (params) { var _this = this; if (!params.applyOrder || !params.state) { return; } var newOrder = []; var processedColIds = {}; params.state.forEach(function (item) { if (!item.colId || processedColIds[item.colId]) { return; } var col = _this.gridColumnsMap[item.colId]; if (col) { newOrder.push(col); processedColIds[item.colId] = true; } }); // add in all other columns var autoGroupInsertIndex = 0; this.gridColumns.forEach(function (col) { var colId = col.getColId(); var alreadyProcessed = processedColIds[colId] != null; if (alreadyProcessed) { return; } var isAutoGroupCol = colId.startsWith(GROUP_AUTO_COLUMN_ID); if (isAutoGroupCol) { // auto group columns, if missing from state list, are added to the start. // it's common to have autoGroup missing, as grouping could be on by default // on a column, but the user could of since removed the grouping via the UI. // if we don't inc the insert index, autoGroups will be inserted in reverse order insertIntoArray(newOrder, col, autoGroupInsertIndex++); } else { // normal columns, if missing from state list, are added at the end newOrder.push(col); } }); // this is already done in updateGridColumns, however we changed the order above (to match the order of the state // columns) so we need to do it again. we could of put logic into the order above to take into account fixed // columns, however if we did then we would have logic for updating fixed columns twice. reusing the logic here // is less sexy for the code here, but it keeps consistency. newOrder = this.placeLockedColumns(newOrder); if (!this.doesMovePassMarryChildren(newOrder)) { console.warn('AG Grid: Applying column order broke a group where columns should be married together. Applying new order has been discarded.'); return; } this.gridColumns = newOrder; }; ColumnModel.prototype.compareColumnStatesAndDispatchEvents = function (source) { var _this = this; var startState = { rowGroupColumns: this.rowGroupColumns.slice(), pivotColumns: this.pivotColumns.slice(), valueColumns: this.valueColumns.slice() }; var columnStateBefore = this.getColumnState(); var columnStateBeforeMap = {}; columnStateBefore.forEach(function (col) { columnStateBeforeMap[col.colId] = col; }); return function () { var colsForState = _this.getPrimaryAndSecondaryAndAutoColumns(); // dispatches generic ColumnEvents where all columns are returned rather than what has changed var dispatchWhenListsDifferent = function (eventType, colsBefore, colsAfter, idMapper) { var beforeList = colsBefore.map(idMapper); var afterList = colsAfter.map(idMapper); var unchanged = areEqual(beforeList, afterList); if (unchanged) { return; } // returning all columns rather than what has changed! var event = { type: eventType, columns: colsAfter, column: colsAfter.length === 1 ? colsAfter[0] : null, source: source }; _this.eventService.dispatchEvent(event); }; // determines which columns have changed according to supplied predicate var getChangedColumns = function (changedPredicate) { var changedColumns = []; colsForState.forEach(function (column) { var colStateBefore = columnStateBeforeMap[column.getColId()]; if (colStateBefore && changedPredicate(colStateBefore, column)) { changedColumns.push(column); } }); return changedColumns; }; var columnIdMapper = function (c) { return c.getColId(); }; dispatchWhenListsDifferent(Events.EVENT_COLUMN_ROW_GROUP_CHANGED, startState.rowGroupColumns, _this.rowGroupColumns, columnIdMapper); dispatchWhenListsDifferent(Events.EVENT_COLUMN_PIVOT_CHANGED, startState.pivotColumns, _this.pivotColumns, columnIdMapper); var valueChangePredicate = function (cs, c) { var oldActive = cs.aggFunc != null; var activeChanged = oldActive != c.isValueActive(); // we only check aggFunc if the agg is active var aggFuncChanged = oldActive && cs.aggFunc != c.getAggFunc(); return activeChanged || aggFuncChanged; }; var changedValues = getChangedColumns(valueChangePredicate); if (changedValues.length > 0) { // we pass all value columns, now the ones that changed. this is the same // as pivot and rowGroup cols, but different to all other properties below. // this is more for backwards compatibility, as it's always been this way. // really it should be the other way, as the order of the cols makes no difference // for valueColumns (apart from displaying them in the tool panel). _this.dispatchColumnChangedEvent(Events.EVENT_COLUMN_VALUE_CHANGED, _this.valueColumns, source); } var resizeChangePredicate = function (cs, c) { return cs.width != c.getActualWidth(); }; _this.dispatchColumnResizedEvent(getChangedColumns(resizeChangePredicate), true, source); var pinnedChangePredicate = function (cs, c) { return cs.pinned != c.getPinned(); }; _this.dispatchColumnPinnedEvent(getChangedColumns(pinnedChangePredicate), source); var visibilityChangePredicate = function (cs, c) { return cs.hide == c.isVisible(); }; _this.dispatchColumnVisibleEvent(getChangedColumns(visibilityChangePredicate), source); var sortChangePredicate = function (cs, c) { return cs.sort != c.getSort() || cs.sortIndex != c.getSortIndex(); }; if (getChangedColumns(sortChangePredicate).length > 0) { _this.sortController.dispatchSortChangedEvents(source); } // special handling for moved column events _this.normaliseColumnMovedEventForColumnState(columnStateBefore, source); }; }; ColumnModel.prototype.getCommonValue = function (cols, valueGetter) { if (!cols || cols.length == 0) { return undefined; } // compare each value to the first value. if nothing differs, then value is common so return it. var firstValue = valueGetter(cols[0]); for (var i = 1; i < cols.length; i++) { if (firstValue !== valueGetter(cols[i])) { // values differ, no common value return undefined; } } return firstValue; }; ColumnModel.prototype.normaliseColumnMovedEventForColumnState = function (colStateBefore, source) { // we are only interested in columns that were both present and visible before and after var _this = this; var colStateAfter = this.getColumnState(); var colStateAfterMapped = {}; colStateAfter.forEach(function (s) { return colStateAfterMapped[s.colId] = s; }); // get id's of cols in both before and after lists var colsIntersectIds = {}; colStateBefore.forEach(function (s) { if (colStateAfterMapped[s.colId]) { colsIntersectIds[s.colId] = true; } }); // filter state lists, so we only have cols that were present before and after var beforeFiltered = colStateBefore.filter(function (c) { return colsIntersectIds[c.colId]; }); var afterFiltered = colStateAfter.filter(function (c) { return colsIntersectIds[c.colId]; }); // see if any cols are in a different location var movedColumns = []; afterFiltered.forEach(function (csAfter, index) { var csBefore = beforeFiltered && beforeFiltered[index]; if (csBefore && csBefore.colId !== csAfter.colId) { var gridCol = _this.getGridColumn(csBefore.colId); if (gridCol) { movedColumns.push(gridCol); } } }); if (!movedColumns.length) { return; } this.dispatchColumnMovedEvent({ movedColumns: movedColumns, source: source, finished: true }); }; ColumnModel.prototype.syncColumnWithStateItem = function (column, stateItem, defaultState, rowGroupIndexes, pivotIndexes, autoCol, source) { if (!column) { return; } var getValue = function (key1, key2) { var obj = { value1: undefined, value2: undefined }; var calculated = false; if (stateItem) { if (stateItem[key1] !== undefined) { obj.value1 = stateItem[key1]; calculated = true; } if (exists(key2) && stateItem[key2] !== undefined) { obj.value2 = stateItem[key2]; calculated = true; } } if (!calculated && defaultState) { if (defaultState[key1] !== undefined) { obj.value1 = defaultState[key1]; } if (exists(key2) && defaultState[key2] !== undefined) { obj.value2 = defaultState[key2]; } } return obj; }; // following ensures we are left with boolean true or false, eg converts (null, undefined, 0) all to true var hide = getValue('hide').value1; if (hide !== undefined) { column.setVisible(!hide, source); } // sets pinned to 'left' or 'right' var pinned = getValue('pinned').value1; if (pinned !== undefined) { column.setPinned(pinned); } // if width provided and valid, use it, otherwise stick with the old width var minColWidth = this.columnUtils.calculateColMinWidth(column.getColDef()); // flex var flex = getValue('flex').value1; if (flex !== undefined) { column.setFlex(flex); } // width - we only set width if column is not flexing var noFlexThisCol = column.getFlex() <= 0; if (noFlexThisCol) { // both null and undefined means we skip, as it's not possible to 'clear' width (a column must have a width) var width = getValue('width').value1; if (width != null) { if (minColWidth != null && width >= minColWidth) { column.setActualWidth(width, source); } } } var sort = getValue('sort').value1; if (sort !== undefined) { if (sort === 'desc' || sort === 'asc') { column.setSort(sort, source); } else { column.setSort(undefined, source); } } var sortIndex = getValue('sortIndex').value1; if (sortIndex !== undefined) { column.setSortIndex(sortIndex); } // we do not do aggFunc, rowGroup or pivot for auto cols or secondary cols if (autoCol || !column.isPrimary()) { return; } var aggFunc = getValue('aggFunc').value1; if (aggFunc !== undefined) { if (typeof aggFunc === 'string') { column.setAggFunc(aggFunc); if (!column.isValueActive()) { column.setValueActive(true, source); this.valueColumns.push(column); } } else { if (exists(aggFunc)) { console.warn('AG Grid: stateItem.aggFunc must be a string. if using your own aggregation ' + 'functions, register the functions first before using them in get/set state. This is because it is ' + 'intended for the column state to be stored and retrieved as simple JSON.'); } // Note: we do not call column.setAggFunc(null), so that next time we aggregate // by this column (eg drag the column to the agg section int he toolpanel) it will // default to the last aggregation function. if (column.isValueActive()) { column.setValueActive(false, source); removeFromArray(this.valueColumns, column); } } } var _a = getValue('rowGroup', 'rowGroupIndex'), rowGroup = _a.value1, rowGroupIndex = _a.value2; if (rowGroup !== undefined || rowGroupIndex !== undefined) { if (typeof rowGroupIndex === 'number' || rowGroup) { if (!column.isRowGroupActive()) { column.setRowGroupActive(true, source); this.rowGroupColumns.push(column); } if (rowGroupIndexes && typeof rowGroupIndex === 'number') { rowGroupIndexes[column.getId()] = rowGroupIndex; } } else { if (column.isRowGroupActive()) { column.setRowGroupActive(false, source); removeFromArray(this.rowGroupColumns, column); } } } var _b = getValue('pivot', 'pivotIndex'), pivot = _b.value1, pivotIndex = _b.value2; if (pivot !== undefined || pivotIndex !== undefined) { if (typeof pivotIndex === 'number' || pivot) { if (!column.isPivotActive()) { column.setPivotActive(true, source); this.pivotColumns.push(column); } if (pivotIndexes && typeof pivotIndex === 'number') { pivotIndexes[column.getId()] = pivotIndex; } } else { if (column.isPivotActive()) { column.setPivotActive(false, source); removeFromArray(this.pivotColumns, column); } } } }; ColumnModel.prototype.getGridColumns = function (keys) { return this.getColumns(keys, this.getGridColumn.bind(this)); }; ColumnModel.prototype.getColumns = function (keys, columnLookupCallback) { var foundColumns = []; if (keys) { keys.forEach(function (key) { var column = columnLookupCallback(key); if (column) { foundColumns.push(column); } }); } return foundColumns; }; // used by growGroupPanel ColumnModel.prototype.getColumnWithValidation = function (key) { if (key == null) { return null; } var column = this.getGridColumn(key); if (!column) { console.warn('AG Grid: could not find column ' + key); } return column; }; ColumnModel.prototype.getPrimaryColumn = function (key) { if (!this.primaryColumns) { return null; } return this.getColumn(key, this.primaryColumns, this.primaryColumnsMap); }; ColumnModel.prototype.getGridColumn = function (key) { return this.getColumn(key, this.gridColumns, this.gridColumnsMap); }; ColumnModel.prototype.getSecondaryColumn = function (key) { if (!this.secondaryColumns) { return null; } return this.getColumn(key, this.secondaryColumns, this.secondaryColumnsMap); }; ColumnModel.prototype.getColumn = function (key, columnList, columnMap) { if (!key) { return null; } // most of the time this method gets called the key is a string, so we put this shortcut in // for performance reasons, to see if we can match for ID (it doesn't do auto columns, that's done below) if (typeof key == 'string' && columnMap[key]) { return columnMap[key]; } for (var i = 0; i < columnList.length; i++) { if (this.columnsMatch(columnList[i], key)) { return columnList[i]; } } return this.getAutoColumn(key); }; ColumnModel.prototype.getSourceColumnsForGroupColumn = function (groupCol) { var sourceColumnId = groupCol.getColDef().showRowGroup; if (!sourceColumnId) { return null; } if (sourceColumnId === true) { return this.rowGroupColumns.slice(0); } var column = this.getPrimaryColumn(sourceColumnId); return column ? [column] : null; }; ColumnModel.prototype.getAutoColumn = function (key) { var _this = this; if (!this.groupAutoColumns || !exists(this.groupAutoColumns) || missing(this.groupAutoColumns)) { return null; } return this.groupAutoColumns.find(function (groupCol) { return _this.columnsMatch(groupCol, key); }) || null; }; ColumnModel.prototype.columnsMatch = function (column, key) { var columnMatches = column === key; var colDefMatches = column.getColDef() === key; var idMatches = column.getColId() == key; return columnMatches || colDefMatches || idMatches; }; ColumnModel.prototype.getDisplayNameForColumn = function (column, location, includeAggFunc) { if (includeAggFunc === void 0) { includeAggFunc = false; } if (!column) { return null; } var headerName = this.getHeaderName(column.getColDef(), column, null, null, location); if (includeAggFunc) { return this.wrapHeaderNameWithAggFunc(column, headerName); } return headerName; }; ColumnModel.prototype.getDisplayNameForProvidedColumnGroup = function (columnGroup, providedColumnGroup, location) { var colGroupDef = providedColumnGroup ? providedColumnGroup.getColGroupDef() : null; if (colGroupDef) { return this.getHeaderName(colGroupDef, null, columnGroup, providedColumnGroup, location); } return null; }; ColumnModel.prototype.getDisplayNameForColumnGroup = function (columnGroup, location) { return this.getDisplayNameForProvidedColumnGroup(columnGroup, columnGroup.getProvidedColumnGroup(), location); }; // location is where the column is going to appear, ie who is calling us ColumnModel.prototype.getHeaderName = function (colDef, column, columnGroup, providedColumnGroup, location) { var headerValueGetter = colDef.headerValueGetter; if (headerValueGetter) { var params = { colDef: colDef, column: column, columnGroup: columnGroup, providedColumnGroup: providedColumnGroup, location: location, api: this.gridOptionsService.api, columnApi: this.gridOptionsService.columnApi, context: this.gridOptionsService.context }; if (typeof headerValueGetter === 'function') { // valueGetter is a function, so just call it return headerValueGetter(params); } else if (typeof headerValueGetter === 'string') { // valueGetter is an expression, so execute the expression return this.expressionService.evaluate(headerValueGetter, params); } console.warn('AG Grid: headerValueGetter must be a function or a string'); return ''; } else if (colDef.headerName != null) { return colDef.headerName; } else if (colDef.field) { return camelCaseToHumanText(colDef.field); } return ''; }; ColumnModel.prototype.wrapHeaderNameWithAggFunc = function (column, headerName) { if (this.gridOptionsService.is('suppressAggFuncInHeader')) { return headerName; } // only columns with aggregation active can have aggregations var pivotValueColumn = column.getColDef().pivotValueColumn; var pivotActiveOnThisColumn = exists(pivotValueColumn); var aggFunc = null; var aggFuncFound; // otherwise we have a measure that is active, and we are doing aggregation on it if (pivotActiveOnThisColumn) { var isCollapsedHeaderEnabled = this.gridOptionsService.is('removePivotHeaderRowWhenSingleValueColumn') && this.valueColumns.length === 1; var isTotalColumn = column.getColDef().pivotTotalColumnIds !== undefined; if (isCollapsedHeaderEnabled && !isTotalColumn) { return headerName; // Skip decorating the header - in this case the label is the pivot key, not the value col } aggFunc = pivotValueColumn ? pivotValueColumn.getAggFunc() : null; aggFuncFound = true; } else { var measureActive = column.isValueActive(); var aggregationPresent = this.pivotMode || !this.isRowGroupEmpty(); if (measureActive && aggregationPresent) { aggFunc = column.getAggFunc(); aggFuncFound = true; } else { aggFuncFound = false; } } if (aggFuncFound) { var aggFuncString = (typeof aggFunc === 'string') ? aggFunc : 'func'; var localeTextFunc = this.localeService.getLocaleTextFunc(); var aggFuncStringTranslated = localeTextFunc(aggFuncString, aggFuncString); return aggFuncStringTranslated + "(" + headerName + ")"; } return headerName; }; // returns the group with matching colId and instanceId. If instanceId is missing, // matches only on the colId. ColumnModel.prototype.getColumnGroup = function (colId, partId) { if (!colId) { return null; } if (colId instanceof ColumnGroup) { return colId; } var allColumnGroups = this.getAllDisplayedTrees(); var checkPartId = typeof partId === 'number'; var result = null; this.columnUtils.depthFirstAllColumnTreeSearch(allColumnGroups, function (child) { if (child instanceof ColumnGroup) { var columnGroup = child; var matched = void 0; if (checkPartId) { matched = colId === columnGroup.getGroupId() && partId === columnGroup.getPartId(); } else { matched = colId === columnGroup.getGroupId(); } if (matched) { result = columnGroup; } } }); return result; }; ColumnModel.prototype.isReady = function () { return this.ready; }; ColumnModel.prototype.extractValueColumns = function (source, oldPrimaryColumns) { this.valueColumns = this.extractColumns(oldPrimaryColumns, this.valueColumns, function (col, flag) { return col.setValueActive(flag, source); }, // aggFunc doesn't have index variant, cos order of value cols doesn't matter, so always return null function () { return undefined; }, function () { return undefined; }, // aggFunc is a string, so return it's existence function (colDef) { var aggFunc = colDef.aggFunc; // null or empty string means clear if (aggFunc === null || aggFunc === '') { return null; } if (aggFunc === undefined) { return; } return !!aggFunc; }, function (colDef) { // return false if any of the following: null, undefined, empty string return colDef.initialAggFunc != null && colDef.initialAggFunc != ''; }); // all new columns added will have aggFunc missing, so set it to what is in the colDef this.valueColumns.forEach(function (col) { var colDef = col.getColDef(); // if aggFunc provided, we always override, as reactive property if (colDef.aggFunc != null && colDef.aggFunc != '') { col.setAggFunc(colDef.aggFunc); } else { // otherwise we use initialAggFunc only if no agg func set - which happens when new column only if (!col.getAggFunc()) { col.setAggFunc(colDef.initialAggFunc); } } }); }; ColumnModel.prototype.extractRowGroupColumns = function (source, oldPrimaryColumns) { this.rowGroupColumns = this.extractColumns(oldPrimaryColumns, this.rowGroupColumns, function (col, flag) { return col.setRowGroupActive(flag, source); }, function (colDef) { return colDef.rowGroupIndex; }, function (colDef) { return colDef.initialRowGroupIndex; }, function (colDef) { return colDef.rowGroup; }, function (colDef) { return colDef.initialRowGroup; }); }; ColumnModel.prototype.extractColumns = function (oldPrimaryColumns, previousCols, setFlagFunc, getIndexFunc, getInitialIndexFunc, getValueFunc, getInitialValueFunc) { if (oldPrimaryColumns === void 0) { oldPrimaryColumns = []; } if (previousCols === void 0) { previousCols = []; } var colsWithIndex = []; var colsWithValue = []; // go though all cols. // if value, change // if default only, change only if new (this.primaryColumns || []).forEach(function (col) { var colIsNew = oldPrimaryColumns.indexOf(col) < 0; var colDef = col.getColDef(); var value = attrToBoolean(getValueFunc(colDef)); var initialValue = attrToBoolean(getInitialValueFunc(colDef)); var index = attrToNumber(getIndexFunc(colDef)); var initialIndex = attrToNumber(getInitialIndexFunc(colDef)); var include; var valuePresent = value !== undefined; var indexPresent = index !== undefined; var initialValuePresent = initialValue !== undefined; var initialIndexPresent = initialIndex !== undefined; if (valuePresent) { include = value; // boolean value is guaranteed as attrToBoolean() is used above } else if (indexPresent) { if (index === null) { // if col is new we don't want to use the default / initial if index is set to null. Similarly, // we don't want to include the property for existing columns, i.e. we want to 'clear' it. include = false; } else { // note that 'null >= 0' evaluates to true which means 'rowGroupIndex = null' would enable row // grouping if the null check didn't exist above. include = index >= 0; } } else { if (colIsNew) { // as no value or index is 'present' we use the default / initial when col is new if (initialValuePresent) { include = initialValue; } else if (initialIndexPresent) { include = initialIndex != null && initialIndex >= 0; } else { include = false; } } else { // otherwise include it if included last time, e.g. if we are extracting row group cols and this col // is an existing row group col (i.e. it exists in 'previousCols') then we should include it. include = previousCols.indexOf(col) >= 0; } } if (include) { var useIndex = colIsNew ? (index != null || initialIndex != null) : index != null; useIndex ? colsWithIndex.push(col) : colsWithValue.push(col); } }); var getIndexForCol = function (col) { var index = getIndexFunc(col.getColDef()); var defaultIndex = getInitialIndexFunc(col.getColDef()); return index != null ? index : defaultIndex; }; // sort cols with index, and add these first colsWithIndex.sort(function (colA, colB) { var indexA = getIndexForCol(colA); var indexB = getIndexForCol(colB); if (indexA === indexB) { return 0; } if (indexA < indexB) { return -1; } return 1; }); var res = [].concat(colsWithIndex); // second add columns that were there before and in the same order as they were before, // so we are preserving order of current grouping of columns that simply have rowGroup=true previousCols.forEach(function (col) { if (colsWithValue.indexOf(col) >= 0) { res.push(col); } }); // lastly put in all remaining cols colsWithValue.forEach(function (col) { if (res.indexOf(col) < 0) { res.push(col); } }); // set flag=false for removed cols previousCols.forEach(function (col) { if (res.indexOf(col) < 0) { setFlagFunc(col, false); } }); // set flag=true for newly added cols res.forEach(function (col) { if (previousCols.indexOf(col) < 0) { setFlagFunc(col, true); } }); return res; }; ColumnModel.prototype.extractPivotColumns = function (source, oldPrimaryColumns) { this.pivotColumns = this.extractColumns(oldPrimaryColumns, this.pivotColumns, function (col, flag) { return col.setPivotActive(flag, source); }, function (colDef) { return colDef.pivotIndex; }, function (colDef) { return colDef.initialPivotIndex; }, function (colDef) { return colDef.pivot; }, function (colDef) { return colDef.initialPivot; }); }; ColumnModel.prototype.resetColumnGroupState = function (source) { if (source === void 0) { source = "api"; } var stateItems = []; this.columnUtils.depthFirstOriginalTreeSearch(null, this.primaryColumnTree, function (child) { if (child instanceof ProvidedColumnGroup) { var colGroupDef = child.getColGroupDef(); var groupState = { groupId: child.getGroupId(), open: !colGroupDef ? undefined : colGroupDef.openByDefault }; stateItems.push(groupState); } }); this.setColumnGroupState(stateItems, source); }; ColumnModel.prototype.getColumnGroupState = function () { var columnGroupState = []; this.columnUtils.depthFirstOriginalTreeSearch(null, this.gridBalancedTree, function (node) { if (node instanceof ProvidedColumnGroup) { columnGroupState.push({ groupId: node.getGroupId(), open: node.isExpanded() }); } }); return columnGroupState; }; ColumnModel.prototype.setColumnGroupState = function (stateItems, source) { var _this = this; if (source === void 0) { source = "api"; } this.columnAnimationService.start(); var impactedGroups = []; stateItems.forEach(function (stateItem) { var groupKey = stateItem.groupId; var newValue = stateItem.open; var providedColumnGroup = _this.getProvidedColumnGroup(groupKey); if (!providedColumnGroup) { return; } if (providedColumnGroup.isExpanded() === newValue) { return; } _this.logger.log('columnGroupOpened(' + providedColumnGroup.getGroupId() + ',' + newValue + ')'); providedColumnGroup.setExpanded(newValue); impactedGroups.push(providedColumnGroup); }); this.updateGroupsAndDisplayedColumns(source); this.setFirstRightAndLastLeftPinned(source); impactedGroups.forEach(function (providedColumnGroup) { var event = { type: Events.EVENT_COLUMN_GROUP_OPENED, columnGroup: providedColumnGroup }; _this.eventService.dispatchEvent(event); }); this.columnAnimationService.finish(); }; // called by headerRenderer - when a header is opened or closed ColumnModel.prototype.setColumnGroupOpened = function (key, newValue, source) { if (source === void 0) { source = "api"; } var keyAsString; if (key instanceof ProvidedColumnGroup) { keyAsString = key.getId(); } else { keyAsString = key || ''; } this.setColumnGroupState([{ groupId: keyAsString, open: newValue }], source); }; ColumnModel.prototype.getProvidedColumnGroup = function (key) { // if (key instanceof ProvidedColumnGroup) { return key; } if (typeof key !== 'string') { console.error('AG Grid: group key must be a string'); } // otherwise, search for the column group by id var res = null; this.columnUtils.depthFirstOriginalTreeSearch(null, this.gridBalancedTree, function (node) { if (node instanceof ProvidedColumnGroup) { if (node.getId() === key) { res = node; } } }); return res; }; ColumnModel.prototype.calculateColumnsForDisplay = function () { var _this = this; var columnsForDisplay; if (this.pivotMode && missing(this.secondaryColumns)) { // pivot mode is on, but we are not pivoting, so we only // show columns we are aggregating on columnsForDisplay = this.gridColumns.filter(function (column) { var isAutoGroupCol = _this.groupAutoColumns && includes(_this.groupAutoColumns, column); var isValueCol = _this.valueColumns && includes(_this.valueColumns, column); return isAutoGroupCol || isValueCol; }); } else { // otherwise continue as normal. this can be working on the primary // or secondary columns, whatever the gridColumns are set to columnsForDisplay = this.gridColumns.filter(function (column) { // keep col if a) it's auto-group or b) it's visible var isAutoGroupCol = _this.groupAutoColumns && includes(_this.groupAutoColumns, column); return isAutoGroupCol || column.isVisible(); }); } return columnsForDisplay; }; ColumnModel.prototype.checkColSpanActiveInCols = function (columns) { var result = false; columns.forEach(function (col) { if (exists(col.getColDef().colSpan)) { result = true; } }); return result; }; ColumnModel.prototype.calculateColumnsForGroupDisplay = function () { var _this = this; this.groupDisplayColumns = []; this.groupDisplayColumnsMap = {}; var checkFunc = function (col) { var colDef = col.getColDef(); var underlyingColumn = colDef.showRowGroup; if (colDef && exists(underlyingColumn)) { _this.groupDisplayColumns.push(col); if (typeof underlyingColumn === 'string') { _this.groupDisplayColumnsMap[underlyingColumn] = col; } else if (underlyingColumn === true) { _this.getRowGroupColumns().forEach(function (rowGroupCol) { _this.groupDisplayColumnsMap[rowGroupCol.getId()] = col; }); } } }; this.gridColumns.forEach(checkFunc); if (this.groupAutoColumns) { this.groupAutoColumns.forEach(checkFunc); } }; ColumnModel.prototype.getGroupDisplayColumns = function () { return this.groupDisplayColumns; }; ColumnModel.prototype.getGroupDisplayColumnForGroup = function (rowGroupColumnId) { return this.groupDisplayColumnsMap[rowGroupColumnId]; }; ColumnModel.prototype.updateDisplayedColumns = function (source) { var columnsForDisplay = this.calculateColumnsForDisplay(); this.buildDisplayedTrees(columnsForDisplay); this.calculateColumnsForGroupDisplay(); // also called when group opened/closed this.updateGroupsAndDisplayedColumns(source); // also called when group opened/closed this.setFirstRightAndLastLeftPinned(source); }; ColumnModel.prototype.isSecondaryColumnsPresent = function () { return exists(this.secondaryColumns); }; ColumnModel.prototype.setSecondaryColumns = function (colDefs, source) { var _this = this; if (source === void 0) { source = "api"; } var newColsPresent = colDefs && colDefs.length > 0; // if not cols passed, and we had no cols anyway, then do nothing if (!newColsPresent && missing(this.secondaryColumns)) { return; } if (newColsPresent) { this.processSecondaryColumnDefinitions(colDefs); var balancedTreeResult = this.columnFactory.createColumnTree(colDefs, false, this.secondaryBalancedTree || this.previousSecondaryColumns || undefined); this.destroyOldColumns(this.secondaryBalancedTree, balancedTreeResult.columnTree); this.secondaryBalancedTree = balancedTreeResult.columnTree; this.secondaryHeaderRowCount = balancedTreeResult.treeDept + 1; this.secondaryColumns = this.getColumnsFromTree(this.secondaryBalancedTree); this.secondaryColumnsMap = {}; this.secondaryColumns.forEach(function (col) { return _this.secondaryColumnsMap[col.getId()] = col; }); this.previousSecondaryColumns = null; } else { this.previousSecondaryColumns = this.secondaryBalancedTree; this.secondaryBalancedTree = null; this.secondaryHeaderRowCount = -1; this.secondaryColumns = null; this.secondaryColumnsMap = {}; } this.updateGridColumns(); this.updateDisplayedColumns(source); }; ColumnModel.prototype.processSecondaryColumnDefinitions = function (colDefs) { var columnCallback = this.gridOptionsService.get('processPivotResultColDef') || this.gridOptionsService.get('processSecondaryColDef'); var groupCallback = this.gridOptionsService.get('processPivotResultColGroupDef') || this.gridOptionsService.get('processSecondaryColGroupDef'); if (!columnCallback && !groupCallback) { return undefined; } var searchForColDefs = function (colDefs2) { colDefs2.forEach(function (abstractColDef) { var isGroup = exists(abstractColDef.children); if (isGroup) { var colGroupDef = abstractColDef; if (groupCallback) { groupCallback(colGroupDef); } searchForColDefs(colGroupDef.children); } else { var colDef = abstractColDef; if (columnCallback) { columnCallback(colDef); } } }); }; if (colDefs) { searchForColDefs(colDefs); } }; // called from: applyColumnState, setColumnDefs, setSecondaryColumns ColumnModel.prototype.updateGridColumns = function () { var _this = this; var prevGridCols = this.gridBalancedTree; if (this.gridColsArePrimary) { this.lastPrimaryOrder = this.gridColumns; } else { this.lastSecondaryOrder = this.gridColumns; } var sortOrderToRecover; if (this.secondaryColumns && this.secondaryBalancedTree) { var hasSameColumns = this.secondaryColumns.every(function (col) { return _this.gridColumnsMap[col.getColId()] !== undefined; }); this.gridBalancedTree = this.secondaryBalancedTree.slice(); this.gridHeaderRowCount = this.secondaryHeaderRowCount; this.gridColumns = this.secondaryColumns.slice(); this.gridColsArePrimary = false; // If the current columns are the same or a subset of the previous // we keep the previous order, otherwise we go back to the order the pivot // cols are generated in if (hasSameColumns) { sortOrderToRecover = this.lastSecondaryOrder; } } else if (this.primaryColumns) { this.gridBalancedTree = this.primaryColumnTree.slice(); this.gridHeaderRowCount = this.primaryHeaderRowCount; this.gridColumns = this.primaryColumns.slice(); this.gridColsArePrimary = true; // updateGridColumns gets called after user adds a row group. we want to maintain the order of the columns // when this happens (eg if user moved a column) rather than revert back to the original column order. // likewise if changing in/out of pivot mode, we want to maintain the order of the cols sortOrderToRecover = this.lastPrimaryOrder; } // create the new auto columns var areAutoColsChanged = this.createGroupAutoColumnsIfNeeded(); // if auto group cols have changed, and we have a sort order, we need to move auto cols to the start if (areAutoColsChanged && sortOrderToRecover) { var groupAutoColsMap_1 = convertToMap(this.groupAutoColumns.map(function (col) { return [col, true]; })); // if group columns has changed, we don't preserve the group column order, so remove them from the old order sortOrderToRecover = sortOrderToRecover.filter(function (col) { return !groupAutoColsMap_1.has(col); }); // and add them to the start of the order sortOrderToRecover = __spread$4(this.groupAutoColumns, sortOrderToRecover); } this.addAutoGroupToGridColumns(); this.orderGridColsLike(sortOrderToRecover); this.gridColumns = this.placeLockedColumns(this.gridColumns); this.refreshQuickFilterColumns(); this.clearDisplayedAndViewportColumns(); this.colSpanActive = this.checkColSpanActiveInCols(this.gridColumns); this.gridColumnsMap = {}; this.gridColumns.forEach(function (col) { return _this.gridColumnsMap[col.getId()] = col; }); this.setAutoHeightActive(); if (!areEqual(prevGridCols, this.gridBalancedTree)) { var event_4 = { type: Events.EVENT_GRID_COLUMNS_CHANGED }; this.eventService.dispatchEvent(event_4); } }; ColumnModel.prototype.setAutoHeightActive = function () { this.autoHeightActive = this.gridColumns.filter(function (col) { return col.isAutoHeight(); }).length > 0; if (this.autoHeightActive) { this.autoHeightActiveAtLeastOnce = true; var rowModelType = this.rowModel.getType(); var supportedRowModel = rowModelType === 'clientSide' || rowModelType === 'serverSide'; if (!supportedRowModel) { var message_1 = 'AG Grid - autoHeight columns only work with Client Side Row Model and Server Side Row Model.'; doOnce(function () { return console.warn(message_1); }, 'autoHeightActive.wrongRowModel'); } } }; ColumnModel.prototype.orderGridColsLike = function (colsOrder) { if (missing(colsOrder)) { return; } var lastOrderMapped = convertToMap(colsOrder.map(function (col, index) { return [col, index]; })); // only do the sort if at least one column is accounted for. columns will be not accounted for // if changing from secondary to primary columns var noColsFound = true; this.gridColumns.forEach(function (col) { if (lastOrderMapped.has(col)) { noColsFound = false; } }); if (noColsFound) { return; } // order cols in the same order as before. we need to make sure that all // cols still exists, so filter out any that no longer exist. var gridColsMap = convertToMap(this.gridColumns.map(function (col) { return [col, true]; })); var oldColsOrdered = colsOrder.filter(function (col) { return gridColsMap.has(col); }); var oldColsMap = convertToMap(oldColsOrdered.map(function (col) { return [col, true]; })); var newColsOrdered = this.gridColumns.filter(function (col) { return !oldColsMap.has(col); }); // add in the new columns, at the end (if no group), or at the end of the group (if a group) var newGridColumns = oldColsOrdered.slice(); newColsOrdered.forEach(function (newCol) { var parent = newCol.getOriginalParent(); // if no parent, means we are not grouping, so just add the column to the end if (!parent) { newGridColumns.push(newCol); return; } // find the group the column belongs to. if no siblings at the current level (eg col in group on it's // own) then go up one level and look for siblings there. var siblings = []; while (!siblings.length && parent) { var leafCols = parent.getLeafColumns(); leafCols.forEach(function (leafCol) { var presentInNewGriColumns = newGridColumns.indexOf(leafCol) >= 0; var noYetInSiblings = siblings.indexOf(leafCol) < 0; if (presentInNewGriColumns && noYetInSiblings) { siblings.push(leafCol); } }); parent = parent.getOriginalParent(); } // if no siblings exist at any level, this means the col is in a group (or parent groups) on it's own if (!siblings.length) { newGridColumns.push(newCol); return; } // find index of last column in the group var indexes = siblings.map(function (col) { return newGridColumns.indexOf(col); }); var lastIndex = Math.max.apply(Math, __spread$4(indexes)); insertIntoArray(newGridColumns, newCol, lastIndex + 1); }); this.gridColumns = newGridColumns; }; ColumnModel.prototype.isPrimaryColumnGroupsPresent = function () { return this.primaryHeaderRowCount > 1; }; // if we are using autoGroupCols, then they should be included for quick filter. this covers the // following scenarios: // a) user provides 'field' into autoGroupCol of normal grid, so now because a valid col to filter leafs on // b) using tree data and user depends on autoGroupCol for first col, and we also want to filter on this // (tree data is a bit different, as parent rows can be filtered on, unlike row grouping) ColumnModel.prototype.refreshQuickFilterColumns = function () { var _a; var columnsForQuickFilter; if (this.groupAutoColumns) { columnsForQuickFilter = ((_a = this.primaryColumns) !== null && _a !== void 0 ? _a : []).concat(this.groupAutoColumns); } else if (this.primaryColumns) { columnsForQuickFilter = this.primaryColumns; } columnsForQuickFilter = columnsForQuickFilter !== null && columnsForQuickFilter !== void 0 ? columnsForQuickFilter : []; this.columnsForQuickFilter = this.gridOptionsService.is('excludeHiddenColumnsFromQuickFilter') ? columnsForQuickFilter.filter(function (col) { return col.isVisible(); }) : columnsForQuickFilter; }; ColumnModel.prototype.placeLockedColumns = function (cols) { var left = []; var normal = []; var right = []; cols.forEach(function (col) { var position = col.getColDef().lockPosition; if (position === 'right') { right.push(col); } else if (position === 'left' || position === true) { left.push(col); } else { normal.push(col); } }); return __spread$4(left, normal, right); }; ColumnModel.prototype.addAutoGroupToGridColumns = function () { if (missing(this.groupAutoColumns)) { this.destroyOldColumns(this.groupAutoColsBalancedTree); this.groupAutoColsBalancedTree = null; return; } this.gridColumns = this.groupAutoColumns ? this.groupAutoColumns.concat(this.gridColumns) : this.gridColumns; var newAutoColsTree = this.columnFactory.createForAutoGroups(this.groupAutoColumns, this.gridBalancedTree); this.destroyOldColumns(this.groupAutoColsBalancedTree, newAutoColsTree); this.groupAutoColsBalancedTree = newAutoColsTree; this.gridBalancedTree = newAutoColsTree.concat(this.gridBalancedTree); }; // gets called after we copy down grid columns, to make sure any part of the gui // that tries to draw, eg the header, it will get empty lists of columns rather // than stale columns. for example, the header will received gridColumnsChanged // event, so will try and draw, but it will draw successfully when it acts on the // virtualColumnsChanged event ColumnModel.prototype.clearDisplayedAndViewportColumns = function () { this.viewportRowLeft = {}; this.viewportRowRight = {}; this.viewportRowCenter = {}; this.displayedColumnsLeft = []; this.displayedColumnsRight = []; this.displayedColumnsCenter = []; this.displayedColumns = []; this.viewportColumns = []; this.headerViewportColumns = []; this.viewportColumnsHash = ''; }; ColumnModel.prototype.updateGroupsAndDisplayedColumns = function (source) { this.updateOpenClosedVisibilityInColumnGroups(); this.deriveDisplayedColumns(source); this.refreshFlexedColumns(); this.extractViewport(); this.updateBodyWidths(); // this event is picked up by the gui, headerRenderer and rowRenderer, to recalculate what columns to display var event = { type: Events.EVENT_DISPLAYED_COLUMNS_CHANGED }; this.eventService.dispatchEvent(event); }; ColumnModel.prototype.deriveDisplayedColumns = function (source) { this.derivedDisplayedColumnsFromDisplayedTree(this.displayedTreeLeft, this.displayedColumnsLeft); this.derivedDisplayedColumnsFromDisplayedTree(this.displayedTreeCentre, this.displayedColumnsCenter); this.derivedDisplayedColumnsFromDisplayedTree(this.displayedTreeRight, this.displayedColumnsRight); this.joinDisplayedColumns(); this.setLeftValues(source); this.displayedAutoHeightCols = this.displayedColumns.filter(function (col) { return col.isAutoHeight(); }); }; ColumnModel.prototype.isAutoRowHeightActive = function () { return this.autoHeightActive; }; ColumnModel.prototype.wasAutoRowHeightEverActive = function () { return this.autoHeightActiveAtLeastOnce; }; ColumnModel.prototype.joinDisplayedColumns = function () { if (this.gridOptionsService.is('enableRtl')) { this.displayedColumns = this.displayedColumnsRight .concat(this.displayedColumnsCenter) .concat(this.displayedColumnsLeft); } else { this.displayedColumns = this.displayedColumnsLeft .concat(this.displayedColumnsCenter) .concat(this.displayedColumnsRight); } }; // sets the left pixel position of each column ColumnModel.prototype.setLeftValues = function (source) { this.setLeftValuesOfColumns(source); this.setLeftValuesOfGroups(); }; ColumnModel.prototype.setLeftValuesOfColumns = function (source) { var _this = this; if (!this.primaryColumns) { return; } // go through each list of displayed columns var allColumns = this.primaryColumns.slice(0); // let totalColumnWidth = this.getWidthOfColsInList() var doingRtl = this.gridOptionsService.is('enableRtl'); [ this.displayedColumnsLeft, this.displayedColumnsRight, this.displayedColumnsCenter ].forEach(function (columns) { if (doingRtl) { // when doing RTL, we start at the top most pixel (ie RHS) and work backwards var left_1 = _this.getWidthOfColsInList(columns); columns.forEach(function (column) { left_1 -= column.getActualWidth(); column.setLeft(left_1, source); }); } else { // otherwise normal LTR, we start at zero var left_2 = 0; columns.forEach(function (column) { column.setLeft(left_2, source); left_2 += column.getActualWidth(); }); } removeAllFromArray(allColumns, columns); }); // items left in allColumns are columns not displayed, so remove the left position. this is // important for the rows, as if a col is made visible, then taken out, then made visible again, // we don't want the animation of the cell floating in from the old position, whatever that was. allColumns.forEach(function (column) { column.setLeft(null, source); }); }; ColumnModel.prototype.setLeftValuesOfGroups = function () { // a groups left value is the lest left value of it's children [ this.displayedTreeLeft, this.displayedTreeRight, this.displayedTreeCentre ].forEach(function (columns) { columns.forEach(function (column) { if (column instanceof ColumnGroup) { var columnGroup = column; columnGroup.checkLeft(); } }); }); }; ColumnModel.prototype.derivedDisplayedColumnsFromDisplayedTree = function (tree, columns) { columns.length = 0; this.columnUtils.depthFirstDisplayedColumnTreeSearch(tree, function (child) { if (child instanceof Column) { columns.push(child); } }); }; ColumnModel.prototype.extractViewportColumns = function () { if (this.suppressColumnVirtualisation) { // no virtualisation, so don't filter this.viewportColumnsCenter = this.displayedColumnsCenter; this.headerViewportColumnsCenter = this.displayedColumnsCenter; } else { // filter out what should be visible this.viewportColumnsCenter = this.displayedColumnsCenter.filter(this.isColumnInRowViewport.bind(this)); this.headerViewportColumnsCenter = this.displayedColumnsCenter.filter(this.isColumnInHeaderViewport.bind(this)); } this.viewportColumns = this.viewportColumnsCenter .concat(this.displayedColumnsLeft) .concat(this.displayedColumnsRight); this.headerViewportColumns = this.headerViewportColumnsCenter .concat(this.displayedColumnsLeft) .concat(this.displayedColumnsRight); }; ColumnModel.prototype.getVirtualHeaderGroupRow = function (type, dept) { var result; switch (type) { case 'left': result = this.viewportRowLeft[dept]; break; case 'right': result = this.viewportRowRight[dept]; break; default: result = this.viewportRowCenter[dept]; break; } if (missing(result)) { result = []; } return result; }; ColumnModel.prototype.calculateHeaderRows = function () { // go through each group, see if any of it's cols are displayed, and if yes, // then this group is included this.viewportRowLeft = {}; this.viewportRowRight = {}; this.viewportRowCenter = {}; // for easy lookup when building the groups. var virtualColIds = {}; this.headerViewportColumns.forEach(function (col) { return virtualColIds[col.getId()] = true; }); var testGroup = function (children, result, dept) { var returnValue = false; for (var i = 0; i < children.length; i++) { // see if this item is within viewport var child = children[i]; var addThisItem = false; if (child instanceof Column) { // for column, test if column is included addThisItem = virtualColIds[child.getId()] === true; } else { // if group, base decision on children var columnGroup = child; var displayedChildren = columnGroup.getDisplayedChildren(); if (displayedChildren) { addThisItem = testGroup(displayedChildren, result, dept + 1); } } if (addThisItem) { returnValue = true; if (!result[dept]) { result[dept] = []; } result[dept].push(child); } } return returnValue; }; testGroup(this.displayedTreeLeft, this.viewportRowLeft, 0); testGroup(this.displayedTreeRight, this.viewportRowRight, 0); testGroup(this.displayedTreeCentre, this.viewportRowCenter, 0); }; ColumnModel.prototype.extractViewport = function () { var hashColumn = function (c) { return c.getId() + "-" + (c.getPinned() || 'normal'); }; this.extractViewportColumns(); var newHash = this.viewportColumns.map(hashColumn).join('#'); var changed = this.viewportColumnsHash !== newHash; if (changed) { this.viewportColumnsHash = newHash; this.calculateHeaderRows(); } return changed; }; ColumnModel.prototype.refreshFlexedColumns = function (params) { var _this = this; if (params === void 0) { params = {}; } var source = params.source ? params.source : 'flex'; if (params.viewportWidth != null) { this.flexViewportWidth = params.viewportWidth; } if (!this.flexViewportWidth) { return []; } // If the grid has left-over space, divide it between flexing columns in proportion to their flex value. // A "flexing column" is one that has a 'flex' value set and is not currently being constrained by its // minWidth or maxWidth rules. var flexAfterDisplayIndex = -1; if (params.resizingCols) { params.resizingCols.forEach(function (col) { var indexOfCol = _this.displayedColumnsCenter.indexOf(col); if (flexAfterDisplayIndex < indexOfCol) { flexAfterDisplayIndex = indexOfCol; } }); } var isColFlex = function (col) { var afterResizingCols = _this.displayedColumnsCenter.indexOf(col) > flexAfterDisplayIndex; return col.getFlex() && afterResizingCols; }; var knownWidthColumns = this.displayedColumnsCenter.filter(function (col) { return !isColFlex(col); }); var flexingColumns = this.displayedColumnsCenter.filter(function (col) { return isColFlex(col); }); var changedColumns = []; if (!flexingColumns.length) { return []; } var flexingColumnSizes = []; var spaceForFlexingColumns; outer: while (true) { var totalFlex = flexingColumns.reduce(function (count, col) { return count + col.getFlex(); }, 0); spaceForFlexingColumns = this.flexViewportWidth - this.getWidthOfColsInList(knownWidthColumns); for (var i = 0; i < flexingColumns.length; i++) { var col = flexingColumns[i]; var widthByFlexRule = spaceForFlexingColumns * col.getFlex() / totalFlex; var constrainedWidth = 0; var minWidth = col.getMinWidth(); var maxWidth = col.getMaxWidth(); if (exists(minWidth) && widthByFlexRule < minWidth) { constrainedWidth = minWidth; } else if (exists(maxWidth) && widthByFlexRule > maxWidth) { constrainedWidth = maxWidth; } if (constrainedWidth) { // This column is not in fact flexing as it is being constrained to a specific size // so remove it from the list of flexing columns and start again col.setActualWidth(constrainedWidth, source); removeFromArray(flexingColumns, col); changedColumns.push(col); knownWidthColumns.push(col); continue outer; } flexingColumnSizes[i] = Math.round(widthByFlexRule); } break; } var remainingSpace = spaceForFlexingColumns; flexingColumns.forEach(function (col, i) { col.setActualWidth(Math.min(flexingColumnSizes[i], remainingSpace), source); changedColumns.push(col); remainingSpace -= flexingColumnSizes[i]; }); if (!params.skipSetLeft) { this.setLeftValues(source); } if (params.updateBodyWidths) { this.updateBodyWidths(); } if (params.fireResizedEvent) { this.dispatchColumnResizedEvent(changedColumns, true, source, flexingColumns); } // if the user sets rowData directly into GridOptions, then the row data is set before // grid is attached to the DOM. this means the columns are not flexed, and then the rows // have the wrong height (as they depend on column widths). so once the columns have // been flexed for the first time (only happens once grid is attached to DOM, as dependency // on getting the grid width, which only happens after attached after ResizeObserver fires) // we get get rows to re-calc their heights. if (!this.flexColsCalculatedAtLestOnce) { if (this.gridOptionsService.isRowModelType('clientSide')) { this.rowModel.resetRowHeights(); } this.flexColsCalculatedAtLestOnce = true; } return flexingColumns; }; // called from api ColumnModel.prototype.sizeColumnsToFit = function (gridWidth, source, silent, params) { var _a, _b, _c, _d, _e; if (source === void 0) { source = "sizeColumnsToFit"; } var limitsMap = {}; if (params) { (_a = params === null || params === void 0 ? void 0 : params.columnLimits) === null || _a === void 0 ? void 0 : _a.forEach(function (_a) { var key = _a.key, dimensions = __rest(_a, ["key"]); limitsMap[typeof key === 'string' ? key : key.getColId()] = dimensions; }); } // avoid divide by zero var allDisplayedColumns = this.getAllDisplayedColumns(); var doColumnsAlreadyFit = gridWidth === this.getWidthOfColsInList(allDisplayedColumns); if (gridWidth <= 0 || !allDisplayedColumns.length || doColumnsAlreadyFit) { return; } var colsToSpread = []; var colsToNotSpread = []; allDisplayedColumns.forEach(function (column) { if (column.getColDef().suppressSizeToFit === true) { colsToNotSpread.push(column); } else { colsToSpread.push(column); } }); // make a copy of the cols that are going to be resized var colsToDispatchEventFor = colsToSpread.slice(0); var finishedResizing = false; var moveToNotSpread = function (column) { removeFromArray(colsToSpread, column); colsToNotSpread.push(column); }; // resetting cols to their original width makes the sizeColumnsToFit more deterministic, // rather than depending on the current size of the columns. most users call sizeColumnsToFit // immediately after grid is created, so will make no difference. however if application is calling // sizeColumnsToFit repeatedly (eg after column group is opened / closed repeatedly) we don't want // the columns to start shrinking / growing over time. // // NOTE: the process below will assign values to `this.actualWidth` of each column without firing events // for this reason we need to manually dispatch resize events after the resize has been done for each column. colsToSpread.forEach(function (column) { return column.resetActualWidth(source); }); while (!finishedResizing) { finishedResizing = true; var availablePixels = gridWidth - this.getWidthOfColsInList(colsToNotSpread); if (availablePixels <= 0) { // no width, set everything to minimum colsToSpread.forEach(function (column) { var _a, _b; var widthOverride = (_b = (_a = limitsMap === null || limitsMap === void 0 ? void 0 : limitsMap[column.getId()]) === null || _a === void 0 ? void 0 : _a.minWidth) !== null && _b !== void 0 ? _b : params === null || params === void 0 ? void 0 : params.defaultMinWidth; if (typeof widthOverride === 'number') { column.setActualWidth(widthOverride); return; } column.setMinimum(source); }); } else { var scale = availablePixels / this.getWidthOfColsInList(colsToSpread); // we set the pixels for the last col based on what's left, as otherwise // we could be a pixel or two short or extra because of rounding errors. var pixelsForLastCol = availablePixels; // backwards through loop, as we are removing items as we go for (var i = colsToSpread.length - 1; i >= 0; i--) { var column = colsToSpread[i]; var widthOverride = limitsMap === null || limitsMap === void 0 ? void 0 : limitsMap[column.getId()]; var minOverride = ((_b = widthOverride === null || widthOverride === void 0 ? void 0 : widthOverride.minWidth) !== null && _b !== void 0 ? _b : params === null || params === void 0 ? void 0 : params.defaultMinWidth); var maxOverride = ((_c = widthOverride === null || widthOverride === void 0 ? void 0 : widthOverride.maxWidth) !== null && _c !== void 0 ? _c : params === null || params === void 0 ? void 0 : params.defaultMaxWidth); var colMinWidth = (_d = column.getMinWidth()) !== null && _d !== void 0 ? _d : 0; var colMaxWidth = (_e = column.getMaxWidth()) !== null && _e !== void 0 ? _e : Number.MAX_VALUE; var minWidth = typeof minOverride === 'number' && minOverride > colMinWidth ? minOverride : column.getMinWidth(); var maxWidth = typeof maxOverride === 'number' && maxOverride < colMaxWidth ? maxOverride : column.getMaxWidth(); var newWidth = Math.round(column.getActualWidth() * scale); if (exists(minWidth) && newWidth < minWidth) { newWidth = minWidth; moveToNotSpread(column); finishedResizing = false; } else if (exists(maxWidth) && newWidth > maxWidth) { newWidth = maxWidth; moveToNotSpread(column); finishedResizing = false; } else if (i === 0) { // if this is the last column newWidth = pixelsForLastCol; } column.setActualWidth(newWidth, source, true); pixelsForLastCol -= newWidth; } } } // see notes above colsToDispatchEventFor.forEach(function (col) { col.fireColumnWidthChangedEvent(source); }); this.setLeftValues(source); this.updateBodyWidths(); if (silent) { return; } this.dispatchColumnResizedEvent(colsToDispatchEventFor, true, source); }; ColumnModel.prototype.buildDisplayedTrees = function (visibleColumns) { var leftVisibleColumns = []; var rightVisibleColumns = []; var centerVisibleColumns = []; visibleColumns.forEach(function (column) { switch (column.getPinned()) { case "left": leftVisibleColumns.push(column); break; case "right": rightVisibleColumns.push(column); break; default: centerVisibleColumns.push(column); break; } }); var groupInstanceIdCreator = new GroupInstanceIdCreator(); this.displayedTreeLeft = this.displayedGroupCreator.createDisplayedGroups(leftVisibleColumns, this.gridBalancedTree, groupInstanceIdCreator, 'left', this.displayedTreeLeft); this.displayedTreeRight = this.displayedGroupCreator.createDisplayedGroups(rightVisibleColumns, this.gridBalancedTree, groupInstanceIdCreator, 'right', this.displayedTreeRight); this.displayedTreeCentre = this.displayedGroupCreator.createDisplayedGroups(centerVisibleColumns, this.gridBalancedTree, groupInstanceIdCreator, null, this.displayedTreeCentre); this.updateDisplayedMap(); }; ColumnModel.prototype.updateDisplayedMap = function () { var _this = this; this.displayedColumnsAndGroupsMap = {}; var func = function (child) { _this.displayedColumnsAndGroupsMap[child.getUniqueId()] = child; }; this.columnUtils.depthFirstAllColumnTreeSearch(this.displayedTreeCentre, func); this.columnUtils.depthFirstAllColumnTreeSearch(this.displayedTreeLeft, func); this.columnUtils.depthFirstAllColumnTreeSearch(this.displayedTreeRight, func); }; ColumnModel.prototype.isDisplayed = function (item) { var fromMap = this.displayedColumnsAndGroupsMap[item.getUniqueId()]; // check for reference, in case new column / group with same id is now present return fromMap === item; }; ColumnModel.prototype.updateOpenClosedVisibilityInColumnGroups = function () { var allColumnGroups = this.getAllDisplayedTrees(); this.columnUtils.depthFirstAllColumnTreeSearch(allColumnGroups, function (child) { if (child instanceof ColumnGroup) { var columnGroup = child; columnGroup.calculateDisplayedColumns(); } }); }; ColumnModel.prototype.getGroupAutoColumns = function () { return this.groupAutoColumns; }; /** * Creates new auto group columns if required * @returns whether auto cols have changed */ ColumnModel.prototype.createGroupAutoColumnsIfNeeded = function () { if (!this.autoGroupsNeedBuilding) { return false; } this.autoGroupsNeedBuilding = false; var groupFullWidthRow = this.gridOptionsService.isGroupUseEntireRow(this.pivotMode); // we need to allow suppressing auto-column separately for group and pivot as the normal situation // is CSRM and user provides group column themselves for normal view, but when they go into pivot the // columns are generated by the grid so no opportunity for user to provide group column. so need a way // to suppress auto-col for grouping only, and not pivot. // however if using Viewport RM or SSRM and user is providing the columns, the user may wish full control // of the group column in this instance. var suppressAutoColumn = this.pivotMode ? this.gridOptionsService.is('pivotSuppressAutoColumn') : this.isGroupSuppressAutoColumn(); var groupingActive = this.rowGroupColumns.length > 0 || this.usingTreeData; var needAutoColumns = groupingActive && !suppressAutoColumn && !groupFullWidthRow; if (needAutoColumns) { var existingCols = this.groupAutoColumns || []; var newAutoGroupCols = this.autoGroupColService.createAutoGroupColumns(existingCols, this.rowGroupColumns); var autoColsDifferent = !this.autoColsEqual(newAutoGroupCols, this.groupAutoColumns); // we force recreate so new group cols pick up the new // definitions. otherwise we could ignore the new cols because they appear to be the same. if (autoColsDifferent || this.forceRecreateAutoGroups) { this.groupAutoColumns = newAutoGroupCols; return true; } } else { this.groupAutoColumns = null; } return false; }; ColumnModel.prototype.isGroupSuppressAutoColumn = function () { var groupDisplayType = this.gridOptionsService.get('groupDisplayType'); var isCustomRowGroups = groupDisplayType ? matchesGroupDisplayType('custom', groupDisplayType) : false; if (isCustomRowGroups) { return true; } var treeDataDisplayType = this.gridOptionsService.get('treeDataDisplayType'); return treeDataDisplayType ? matchesTreeDataDisplayType('custom', treeDataDisplayType) : false; }; ColumnModel.prototype.autoColsEqual = function (colsA, colsB) { return areEqual(colsA, colsB, function (a, b) { return a.getColId() === b.getColId(); }); }; ColumnModel.prototype.getWidthOfColsInList = function (columnList) { return columnList.reduce(function (width, col) { return width + col.getActualWidth(); }, 0); }; ColumnModel.prototype.getGridBalancedTree = function () { return this.gridBalancedTree; }; ColumnModel.prototype.hasFloatingFilters = function () { if (!this.gridColumns) { return false; } var res = this.gridColumns.some(function (col) { return col.getColDef().floatingFilter; }); return res; }; ColumnModel.prototype.getFirstDisplayedColumn = function () { var isRtl = this.gridOptionsService.is('enableRtl'); var queryOrder = [ 'getDisplayedLeftColumns', 'getDisplayedCenterColumns', 'getDisplayedRightColumns' ]; if (isRtl) { queryOrder.reverse(); } for (var i = 0; i < queryOrder.length; i++) { var container = this[queryOrder[i]](); if (container.length) { return isRtl ? last(container) : container[0]; } } return null; }; ColumnModel.prototype.setColumnHeaderHeight = function (col, height) { var changed = col.setAutoHeaderHeight(height); if (changed) { var event_5 = { type: Events.EVENT_COLUMN_HEADER_HEIGHT_CHANGED, column: col, columns: [col], source: 'autosizeColumnHeaderHeight', }; this.eventService.dispatchEvent(event_5); } }; ColumnModel.prototype.getColumnGroupHeaderRowHeight = function () { if (this.isPivotMode()) { return this.getPivotGroupHeaderHeight(); } return this.getGroupHeaderHeight(); }; ColumnModel.prototype.getColumnHeaderRowHeight = function () { var defaultHeight = (this.isPivotMode() ? this.getPivotHeaderHeight() : this.getHeaderHeight()); var displayedHeights = this.getAllDisplayedColumns() .filter(function (col) { return col.isAutoHeaderHeight(); }) .map(function (col) { return col.getAutoHeaderHeight() || 0; }); return Math.max.apply(Math, __spread$4([defaultHeight], displayedHeights)); }; ColumnModel.prototype.getHeaderHeight = function () { var _a; return (_a = this.gridOptionsService.getNum('headerHeight')) !== null && _a !== void 0 ? _a : this.environment.getFromTheme(25, 'headerHeight'); }; ColumnModel.prototype.getFloatingFiltersHeight = function () { var _a; return (_a = this.gridOptionsService.getNum('floatingFiltersHeight')) !== null && _a !== void 0 ? _a : this.getHeaderHeight(); }; ColumnModel.prototype.getGroupHeaderHeight = function () { var _a; return (_a = this.gridOptionsService.getNum('groupHeaderHeight')) !== null && _a !== void 0 ? _a : this.getHeaderHeight(); }; ColumnModel.prototype.getPivotHeaderHeight = function () { var _a; return (_a = this.gridOptionsService.getNum('pivotHeaderHeight')) !== null && _a !== void 0 ? _a : this.getHeaderHeight(); }; ColumnModel.prototype.getPivotGroupHeaderHeight = function () { var _a; return (_a = this.gridOptionsService.getNum('pivotGroupHeaderHeight')) !== null && _a !== void 0 ? _a : this.getGroupHeaderHeight(); }; __decorate$8([ Autowired('expressionService') ], ColumnModel.prototype, "expressionService", void 0); __decorate$8([ Autowired('columnFactory') ], ColumnModel.prototype, "columnFactory", void 0); __decorate$8([ Autowired('displayedGroupCreator') ], ColumnModel.prototype, "displayedGroupCreator", void 0); __decorate$8([ Autowired('ctrlsService') ], ColumnModel.prototype, "ctrlsService", void 0); __decorate$8([ Autowired('autoWidthCalculator') ], ColumnModel.prototype, "autoWidthCalculator", void 0); __decorate$8([ Autowired('columnUtils') ], ColumnModel.prototype, "columnUtils", void 0); __decorate$8([ Autowired('columnAnimationService') ], ColumnModel.prototype, "columnAnimationService", void 0); __decorate$8([ Autowired('autoGroupColService') ], ColumnModel.prototype, "autoGroupColService", void 0); __decorate$8([ Optional('aggFuncService') ], ColumnModel.prototype, "aggFuncService", void 0); __decorate$8([ Optional('valueCache') ], ColumnModel.prototype, "valueCache", void 0); __decorate$8([ Optional('animationFrameService') ], ColumnModel.prototype, "animationFrameService", void 0); __decorate$8([ Autowired('rowModel') ], ColumnModel.prototype, "rowModel", void 0); __decorate$8([ Autowired('sortController') ], ColumnModel.prototype, "sortController", void 0); __decorate$8([ Autowired('columnDefFactory') ], ColumnModel.prototype, "columnDefFactory", void 0); __decorate$8([ PostConstruct ], ColumnModel.prototype, "init", null); __decorate$8([ PreDestroy ], ColumnModel.prototype, "destroyColumns", null); __decorate$8([ __param$2(0, Qualifier('loggerFactory')) ], ColumnModel.prototype, "setBeans", null); ColumnModel = __decorate$8([ Bean('columnModel') ], ColumnModel); return ColumnModel; }(BeanStub)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$3 = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __decorate$9 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; // takes in a list of columns, as specified by the column definitions, and returns column groups var ColumnUtils = /** @class */ (function (_super) { __extends$3(ColumnUtils, _super); function ColumnUtils() { return _super !== null && _super.apply(this, arguments) || this; } ColumnUtils.prototype.calculateColMinWidth = function (colDef) { return colDef.minWidth != null ? colDef.minWidth : this.environment.getMinColWidth(); }; ColumnUtils.prototype.calculateColMaxWidth = function (colDef) { return colDef.maxWidth != null ? colDef.maxWidth : Number.MAX_SAFE_INTEGER; }; ColumnUtils.prototype.calculateColInitialWidth = function (colDef) { var minColWidth = this.calculateColMinWidth(colDef); var maxColWidth = this.calculateColMaxWidth(colDef); var width; var colDefWidth = attrToNumber(colDef.width); var colDefInitialWidth = attrToNumber(colDef.initialWidth); if (colDefWidth != null) { width = colDefWidth; } else if (colDefInitialWidth != null) { width = colDefInitialWidth; } else { width = 200; } return Math.max(Math.min(width, maxColWidth), minColWidth); }; ColumnUtils.prototype.getOriginalPathForColumn = function (column, originalBalancedTree) { var result = []; var found = false; var recursePath = function (balancedColumnTree, dept) { for (var i = 0; i < balancedColumnTree.length; i++) { if (found) { return; } // quit the search, so 'result' is kept with the found result var node = balancedColumnTree[i]; if (node instanceof ProvidedColumnGroup) { var nextNode = node; recursePath(nextNode.getChildren(), dept + 1); result[dept] = node; } else if (node === column) { found = true; } } }; recursePath(originalBalancedTree, 0); // we should always find the path, but in case there is a bug somewhere, returning null // will make it fail rather than provide a 'hard to track down' bug return found ? result : null; }; ColumnUtils.prototype.depthFirstOriginalTreeSearch = function (parent, tree, callback) { var _this = this; if (!tree) { return; } tree.forEach(function (child) { if (child instanceof ProvidedColumnGroup) { _this.depthFirstOriginalTreeSearch(child, child.getChildren(), callback); } callback(child, parent); }); }; ColumnUtils.prototype.depthFirstAllColumnTreeSearch = function (tree, callback) { var _this = this; if (!tree) { return; } tree.forEach(function (child) { if (child instanceof ColumnGroup) { _this.depthFirstAllColumnTreeSearch(child.getChildren(), callback); } callback(child); }); }; ColumnUtils.prototype.depthFirstDisplayedColumnTreeSearch = function (tree, callback) { var _this = this; if (!tree) { return; } tree.forEach(function (child) { if (child instanceof ColumnGroup) { _this.depthFirstDisplayedColumnTreeSearch(child.getDisplayedChildren(), callback); } callback(child); }); }; ColumnUtils = __decorate$9([ Bean('columnUtils') ], ColumnUtils); return ColumnUtils; }(BeanStub)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$4 = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __decorate$a = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; // takes in a list of columns, as specified by the column definitions, and returns column groups var DisplayedGroupCreator = /** @class */ (function (_super) { __extends$4(DisplayedGroupCreator, _super); function DisplayedGroupCreator() { return _super !== null && _super.apply(this, arguments) || this; } DisplayedGroupCreator.prototype.createDisplayedGroups = function ( // all displayed columns sorted - this is the columns the grid should show sortedVisibleColumns, // the tree of columns, as provided by the users, used to know what groups columns roll up into balancedColumnTree, // creates unique id's for the group groupInstanceIdCreator, // whether it's left, right or center col pinned, // we try to reuse old groups if we can, to allow gui to do animation oldDisplayedGroups) { var _this = this; var result = []; var previousRealPath; var previousOriginalPath; var oldColumnsMapped = this.mapOldGroupsById(oldDisplayedGroups); // go through each column, then do a bottom up comparison to the previous column, and start // to share groups if they converge at any point. sortedVisibleColumns.forEach(function (currentColumn) { var currentOriginalPath = _this.getOriginalPathForColumn(balancedColumnTree, currentColumn); var currentRealPath = []; var firstColumn = !previousOriginalPath; for (var i = 0; i < currentOriginalPath.length; i++) { if (firstColumn || currentOriginalPath[i] !== previousOriginalPath[i]) { // new group needed var newGroup = _this.createColumnGroup(currentOriginalPath[i], groupInstanceIdCreator, oldColumnsMapped, pinned); currentRealPath[i] = newGroup; // if top level, add to result, otherwise add to parent if (i == 0) { result.push(newGroup); } else { currentRealPath[i - 1].addChild(newGroup); } } else { // reuse old group currentRealPath[i] = previousRealPath[i]; } } var noColumnGroups = currentRealPath.length === 0; if (noColumnGroups) { // if we are not grouping, then the result of the above is an empty // path (no groups), and we just add the column to the root list. result.push(currentColumn); } else { var leafGroup = last(currentRealPath); leafGroup.addChild(currentColumn); } previousRealPath = currentRealPath; previousOriginalPath = currentOriginalPath; }); this.setupParentsIntoColumns(result, null); return result; }; DisplayedGroupCreator.prototype.createColumnGroup = function (providedGroup, groupInstanceIdCreator, oldColumnsMapped, pinned) { var groupId = providedGroup.getGroupId(); var instanceId = groupInstanceIdCreator.getInstanceIdForKey(groupId); var uniqueId = ColumnGroup.createUniqueId(groupId, instanceId); var columnGroup = oldColumnsMapped[uniqueId]; // if the user is setting new colDefs, it is possible that the id's overlap, and we // would have a false match from above. so we double check we are talking about the // same original column group. if (columnGroup && columnGroup.getProvidedColumnGroup() !== providedGroup) { columnGroup = null; } if (exists(columnGroup)) { // clean out the old column group here, as we will be adding children into it again columnGroup.reset(); } else { columnGroup = new ColumnGroup(providedGroup, groupId, instanceId, pinned); this.context.createBean(columnGroup); } return columnGroup; }; // returns back a 2d map of ColumnGroup as follows: groupId -> instanceId -> ColumnGroup DisplayedGroupCreator.prototype.mapOldGroupsById = function (displayedGroups) { var result = {}; var recursive = function (columnsOrGroups) { columnsOrGroups.forEach(function (columnOrGroup) { if (columnOrGroup instanceof ColumnGroup) { var columnGroup = columnOrGroup; result[columnOrGroup.getUniqueId()] = columnGroup; recursive(columnGroup.getChildren()); } }); }; if (displayedGroups) { recursive(displayedGroups); } return result; }; DisplayedGroupCreator.prototype.setupParentsIntoColumns = function (columnsOrGroups, parent) { var _this = this; columnsOrGroups.forEach(function (columnsOrGroup) { columnsOrGroup.setParent(parent); if (columnsOrGroup instanceof ColumnGroup) { var columnGroup = columnsOrGroup; _this.setupParentsIntoColumns(columnGroup.getChildren(), columnGroup); } }); }; DisplayedGroupCreator.prototype.getOriginalPathForColumn = function (balancedColumnTree, column) { var result = []; var found = false; var recursePath = function (columnTree, dept) { for (var i = 0; i < columnTree.length; i++) { // quit the search, so 'result' is kept with the found result if (found) { return; } var node = columnTree[i]; if (node instanceof ProvidedColumnGroup) { recursePath(node.getChildren(), dept + 1); result[dept] = node; } else if (node === column) { found = true; } } }; recursePath(balancedColumnTree, 0); // it's possible we didn't find a path. this happens if the column is generated // by the grid (auto-group), in that the definition didn't come from the client. in this case, // we create a fake original path. if (found) { return result; } console.warn('AG Grid: could not get path'); return null; }; DisplayedGroupCreator = __decorate$a([ Bean('displayedGroupCreator') ], DisplayedGroupCreator); return DisplayedGroupCreator; }(BeanStub)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$5 = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __decorate$b = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var AgStackComponentsRegistry = /** @class */ (function (_super) { __extends$5(AgStackComponentsRegistry, _super); function AgStackComponentsRegistry() { var _this = _super !== null && _super.apply(this, arguments) || this; _this.componentsMappedByName = {}; return _this; } AgStackComponentsRegistry.prototype.setupComponents = function (components) { var _this = this; if (components) { components.forEach(function (componentMeta) { return _this.addComponent(componentMeta); }); } }; AgStackComponentsRegistry.prototype.addComponent = function (componentMeta) { // get name of the class as a string // insert a dash after every capital letter // let classEscaped = className.replace(/([A-Z])/g, "-$1").toLowerCase(); var classEscaped = componentMeta.componentName.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase(); // put all to upper case var classUpperCase = classEscaped.toUpperCase(); // finally store this.componentsMappedByName[classUpperCase] = componentMeta.componentClass; }; AgStackComponentsRegistry.prototype.getComponentClass = function (htmlTag) { return this.componentsMappedByName[htmlTag]; }; AgStackComponentsRegistry = __decorate$b([ Bean('agStackComponentsRegistry') ], AgStackComponentsRegistry); return AgStackComponentsRegistry; }(BeanStub)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ // ARIA HELPER FUNCTIONS function toggleAriaAttribute(element, attribute, value) { if (value == null || value == '') { removeAriaAttribute(element, attribute); } else { setAriaAttribute(element, attribute, value); } } function setAriaAttribute(element, attribute, value) { element.setAttribute(ariaAttributeName(attribute), value.toString()); } function removeAriaAttribute(element, attribute) { element.removeAttribute(ariaAttributeName(attribute)); } function ariaAttributeName(attribute) { return "aria-" + attribute; } function setAriaRole(element, role) { if (role) { element.setAttribute('role', role); } else { element.removeAttribute('role'); } } function getAriaSortState(sortDirection) { var sort; if (sortDirection === 'asc') { sort = 'ascending'; } else if (sortDirection === 'desc') { sort = 'descending'; } else if (sortDirection === 'mixed') { sort = 'other'; } else { sort = 'none'; } return sort; } // ARIA ATTRIBUTE GETTERS function getAriaLevel(element) { return parseInt(element.getAttribute('aria-level'), 10); } function getAriaPosInSet(element) { return parseInt(element.getAttribute('aria-posinset'), 10); } function getAriaDescribedBy(element) { return element.getAttribute('aria-describedby') || ''; } // ARIA ATTRIBUTE SETTERS function setAriaLabel(element, label) { toggleAriaAttribute(element, 'label', label); } function setAriaLabelledBy(element, labelledBy) { toggleAriaAttribute(element, 'labelledby', labelledBy); } function setAriaDescription(element, description) { toggleAriaAttribute(element, 'description', description); } function setAriaDescribedBy(element, describedby) { toggleAriaAttribute(element, 'describedby', describedby); } function setAriaLive(element, live) { toggleAriaAttribute(element, 'live', live); } function setAriaLevel(element, level) { toggleAriaAttribute(element, 'level', level); } function setAriaDisabled(element, disabled) { toggleAriaAttribute(element, 'disabled', disabled); } function setAriaHidden(element, hidden) { toggleAriaAttribute(element, 'hidden', hidden); } function setAriaExpanded(element, expanded) { setAriaAttribute(element, 'expanded', expanded); } function removeAriaExpanded(element) { removeAriaAttribute(element, 'expanded'); } function setAriaSetSize(element, setsize) { setAriaAttribute(element, 'setsize', setsize); } function setAriaPosInSet(element, position) { setAriaAttribute(element, 'posinset', position); } function setAriaMultiSelectable(element, multiSelectable) { setAriaAttribute(element, 'multiselectable', multiSelectable); } function setAriaRowCount(element, rowCount) { setAriaAttribute(element, 'rowcount', rowCount); } function setAriaRowIndex(element, rowIndex) { setAriaAttribute(element, 'rowindex', rowIndex); } function setAriaColCount(element, colCount) { setAriaAttribute(element, 'colcount', colCount); } function setAriaColIndex(element, colIndex) { setAriaAttribute(element, 'colindex', colIndex); } function setAriaColSpan(element, colSpan) { setAriaAttribute(element, 'colspan', colSpan); } function setAriaSort(element, sort) { setAriaAttribute(element, 'sort', sort); } function removeAriaSort(element) { removeAriaAttribute(element, 'sort'); } function setAriaSelected(element, selected) { toggleAriaAttribute(element, 'selected', selected); } function setAriaChecked(element, checked) { setAriaAttribute(element, 'checked', checked === undefined ? 'mixed' : checked); } var AriaUtils = /*#__PURE__*/Object.freeze({ setAriaRole: setAriaRole, getAriaSortState: getAriaSortState, getAriaLevel: getAriaLevel, getAriaPosInSet: getAriaPosInSet, getAriaDescribedBy: getAriaDescribedBy, setAriaLabel: setAriaLabel, setAriaLabelledBy: setAriaLabelledBy, setAriaDescription: setAriaDescription, setAriaDescribedBy: setAriaDescribedBy, setAriaLive: setAriaLive, setAriaLevel: setAriaLevel, setAriaDisabled: setAriaDisabled, setAriaHidden: setAriaHidden, setAriaExpanded: setAriaExpanded, removeAriaExpanded: removeAriaExpanded, setAriaSetSize: setAriaSetSize, setAriaPosInSet: setAriaPosInSet, setAriaMultiSelectable: setAriaMultiSelectable, setAriaRowCount: setAriaRowCount, setAriaRowIndex: setAriaRowIndex, setAriaColCount: setAriaColCount, setAriaColIndex: setAriaColIndex, setAriaColSpan: setAriaColSpan, setAriaSort: setAriaSort, removeAriaSort: removeAriaSort, setAriaSelected: setAriaSelected, setAriaChecked: setAriaChecked }); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ /** * These variables are lazy loaded, as otherwise they try and get initialised when we are loading * unit tests and we don't have references to window or document in the unit tests */ var isSafari; var safariVersion; var isChrome; var isFirefox; var isMacOs; var isIOS; var invisibleScrollbar; var browserScrollbarWidth; function isBrowserSafari() { if (isSafari === undefined) { isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent); } return isSafari; } function getSafariVersion() { if (safariVersion === undefined) { if (isBrowserSafari()) { var versionMatch = navigator.userAgent.match(/version\/(\d+)/i); if (versionMatch) { safariVersion = versionMatch[1] != null ? parseFloat(versionMatch[1]) : 0; } } else { safariVersion = 0; } } return safariVersion; } /** * Returns true for Chrome and also for Edge (Chromium) */ function isBrowserChrome() { if (isChrome === undefined) { var win = window; isChrome = (!!win.chrome && (!!win.chrome.webstore || !!win.chrome.runtime)) || (/Chrome/.test(navigator.userAgent) && /Google Inc/.test(navigator.vendor)); } return isChrome; } function isBrowserFirefox() { if (isFirefox === undefined) { isFirefox = /(firefox)/i.test(navigator.userAgent); } return isFirefox; } function isMacOsUserAgent() { if (isMacOs === undefined) { isMacOs = /(Mac|iPhone|iPod|iPad)/i.test(navigator.platform); } return isMacOs; } function isIOSUserAgent() { if (isIOS === undefined) { isIOS = (/iPad|iPhone|iPod/.test(navigator.platform) || // eslint-disable-next-line (navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1)); } return isIOS; } function browserSupportsPreventScroll() { // all browsers except safari support focus({ preventScroll: true }). // this feature was added on Safari 15+ return !isBrowserSafari() || getSafariVersion() >= 15; } function getTabIndex(el) { if (!el) { return null; } var numberTabIndex = el.tabIndex; var tabIndex = el.getAttribute('tabIndex'); if (numberTabIndex === -1 && (tabIndex === null || (tabIndex === '' && !isBrowserFirefox()))) { return null; } return numberTabIndex.toString(); } function getMaxDivHeight() { if (!document.body) { return -1; } var res = 1000000; // FF reports the height back but still renders blank after ~6M px var testUpTo = navigator.userAgent.toLowerCase().match(/firefox/) ? 6000000 : 1000000000; var div = document.createElement('div'); document.body.appendChild(div); while (true) { var test = res * 2; div.style.height = test + 'px'; if (test > testUpTo || div.clientHeight !== test) { break; } else { res = test; } } document.body.removeChild(div); return res; } function getBodyWidth() { var _a, _b, _c; return (_b = (_a = document.body) === null || _a === void 0 ? void 0 : _a.clientWidth) !== null && _b !== void 0 ? _b : (window.innerHeight || ((_c = document.documentElement) === null || _c === void 0 ? void 0 : _c.clientWidth) || -1); } function getBodyHeight() { var _a, _b, _c; return (_b = (_a = document.body) === null || _a === void 0 ? void 0 : _a.clientHeight) !== null && _b !== void 0 ? _b : (window.innerHeight || ((_c = document.documentElement) === null || _c === void 0 ? void 0 : _c.clientHeight) || -1); } function getScrollbarWidth() { if (browserScrollbarWidth == null) { initScrollbarWidthAndVisibility(); } return browserScrollbarWidth; } function initScrollbarWidthAndVisibility() { var body = document.body; var div = document.createElement('div'); div.style.width = div.style.height = '100px'; div.style.opacity = '0'; div.style.overflow = 'scroll'; div.style.msOverflowStyle = 'scrollbar'; // needed for WinJS apps div.style.position = 'absolute'; body.appendChild(div); var width = div.offsetWidth - div.clientWidth; // if width is 0 and client width is 0, means the DOM isn't ready if (width === 0 && div.clientWidth === 0) { width = null; } // remove div if (div.parentNode) { div.parentNode.removeChild(div); } if (width != null) { browserScrollbarWidth = width; invisibleScrollbar = width === 0; } } function isInvisibleScrollbar() { if (invisibleScrollbar == null) { initScrollbarWidthAndVisibility(); } return invisibleScrollbar; } var BrowserUtils = /*#__PURE__*/Object.freeze({ isBrowserSafari: isBrowserSafari, getSafariVersion: getSafariVersion, isBrowserChrome: isBrowserChrome, isBrowserFirefox: isBrowserFirefox, isMacOsUserAgent: isMacOsUserAgent, isIOSUserAgent: isIOSUserAgent, browserSupportsPreventScroll: browserSupportsPreventScroll, getTabIndex: getTabIndex, getMaxDivHeight: getMaxDivHeight, getBodyWidth: getBodyWidth, getBodyHeight: getBodyHeight, getScrollbarWidth: getScrollbarWidth, isInvisibleScrollbar: isInvisibleScrollbar }); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ function padStartWidthZeros(value, totalStringSize) { return value.toString().padStart(totalStringSize, '0'); } function createArrayOfNumbers(first, last) { var result = []; for (var i = first; i <= last; i++) { result.push(i); } return result; } function cleanNumber(value) { if (typeof value === 'string') { value = parseInt(value, 10); } if (typeof value === 'number') { return Math.floor(value); } return null; } function decToHex(number, bytes) { var hex = ''; for (var i = 0; i < bytes; i++) { hex += String.fromCharCode(number & 0xff); number >>>= 8; } return hex; } function formatNumberTwoDecimalPlacesAndCommas(value, thousandSeparator, decimalSeparator) { if (typeof value !== 'number') { return ''; } return formatNumberCommas(Math.round(value * 100) / 100, thousandSeparator, decimalSeparator); } /** * the native method number.toLocaleString(undefined, {minimumFractionDigits: 0}) * puts in decimal places in IE, so we use this method instead * from: http://blog.tompawlak.org/number-currency-formatting-javascript * @param {number} value * @returns {string} */ function formatNumberCommas(value, thousandSeparator, decimalSeparator) { if (typeof value !== 'number') { return ''; } return value.toString().replace('.', decimalSeparator).replace(/(\d)(?=(\d{3})+(?!\d))/g, "$1" + thousandSeparator); } function sum(values) { return values == null ? null : values.reduce(function (total, value) { return total + value; }, 0); } function zeroOrGreater(value, defaultValue) { if (value >= 0) { return value; } // zero gets returned if number is missing or the wrong type return defaultValue; } function oneOrGreater(value, defaultValue) { var valueNumber = parseInt(value, 10); if (!isNaN(valueNumber) && isFinite(valueNumber) && valueNumber > 0) { return valueNumber; } return defaultValue; } var NumberUtils = /*#__PURE__*/Object.freeze({ padStartWidthZeros: padStartWidthZeros, createArrayOfNumbers: createArrayOfNumbers, cleanNumber: cleanNumber, decToHex: decToHex, formatNumberTwoDecimalPlacesAndCommas: formatNumberTwoDecimalPlacesAndCommas, formatNumberCommas: formatNumberCommas, sum: sum, zeroOrGreater: zeroOrGreater, oneOrGreater: oneOrGreater }); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __read$6 = (undefined && undefined.__read) || function (o, n) { var m = typeof Symbol === "function" && o[Symbol.iterator]; if (!m) return o; var i = m.call(o), r, ar = [], e; try { while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); } catch (error) { e = { error: error }; } finally { try { if (r && !r.done && (m = i["return"])) m.call(i); } finally { if (e) throw e.error; } } return ar; }; /** * Serialises a Date to a string of format `yyyy-MM-dd HH:mm:ss`. * An alternative separator can be provided to be used instead of hyphens. * @param date The date to serialise * @param includeTime Whether to include the time in the serialised string * @param separator The separator to use between date parts */ function serialiseDate(date, includeTime, separator) { if (includeTime === void 0) { includeTime = true; } if (separator === void 0) { separator = '-'; } if (!date) { return null; } var serialised = [date.getFullYear(), date.getMonth() + 1, date.getDate()].map(function (part) { return padStartWidthZeros(part, 2); }).join(separator); if (includeTime) { serialised += ' ' + [date.getHours(), date.getMinutes(), date.getSeconds()].map(function (part) { return padStartWidthZeros(part, 2); }).join(':'); } return serialised; } var calculateOrdinal = function (value) { if (value > 3 && value < 21) { return 'th'; } var remainder = value % 10; switch (remainder) { case 1: return "st"; case 2: return "nd"; case 3: return "rd"; } return 'th'; }; /** * Serialises a Date to a string of format the defined format, does not include time. * @param date The date to serialise * @param format The string to format the date to, defaults to YYYY-MM-DD */ function dateToFormattedString(date, format) { if (format === void 0) { format = 'YYYY-MM-DD'; } var fullYear = padStartWidthZeros(date.getFullYear(), 4); var months = [ 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December', ]; var days = [ 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', ]; var replace = { YYYY: function () { return fullYear.slice(fullYear.length - 4, fullYear.length); }, YY: function () { return fullYear.slice(fullYear.length - 2, fullYear.length); }, Y: function () { return "" + date.getFullYear(); }, MMMM: function () { return months[date.getMonth()]; }, MMM: function () { return months[date.getMonth()].slice(0, 3); }, MM: function () { return padStartWidthZeros(date.getMonth() + 1, 2); }, Mo: function () { return "" + (date.getMonth() + 1) + calculateOrdinal(date.getMonth() + 1); }, M: function () { return "" + (date.getMonth() + 1); }, Do: function () { return "" + date.getDate() + calculateOrdinal(date.getDate()); }, DD: function () { return padStartWidthZeros(date.getDate(), 2); }, D: function () { return "" + date.getDate(); }, dddd: function () { return days[date.getDay()]; }, ddd: function () { return days[date.getDay()].slice(0, 3); }, dd: function () { return days[date.getDay()].slice(0, 2); }, do: function () { return "" + date.getDay() + calculateOrdinal(date.getDay()); }, d: function () { return "" + date.getDay(); }, }; var regexp = new RegExp(Object.keys(replace).join('|'), 'g'); return format.replace(regexp, function (match) { if (match in replace) { return replace[match](); } return match; }); } /** * Parses a date and time from a string in the format `yyyy-MM-dd HH:mm:ss` */ function parseDateTimeFromString(value) { if (!value) { return null; } var _a = __read$6(value.split(' '), 2), dateStr = _a[0], timeStr = _a[1]; if (!dateStr) { return null; } var fields = dateStr.split('-').map(function (f) { return parseInt(f, 10); }); if (fields.filter(function (f) { return !isNaN(f); }).length !== 3) { return null; } var _b = __read$6(fields, 3), year = _b[0], month = _b[1], day = _b[2]; var date = new Date(year, month - 1, day); if (date.getFullYear() !== year || date.getMonth() !== month - 1 || date.getDate() !== day) { // date was not parsed as expected so must have been invalid return null; } if (!timeStr || timeStr === '00:00:00') { return date; } var _c = __read$6(timeStr.split(':').map(function (part) { return parseInt(part, 10); }), 3), hours = _c[0], minutes = _c[1], seconds = _c[2]; if (hours >= 0 && hours < 24) { date.setHours(hours); } if (minutes >= 0 && minutes < 60) { date.setMinutes(minutes); } if (seconds >= 0 && seconds < 60) { date.setSeconds(seconds); } return date; } var DateUtils = /*#__PURE__*/Object.freeze({ serialiseDate: serialiseDate, dateToFormattedString: dateToFormattedString, parseDateTimeFromString: parseDateTimeFromString }); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __values$1 = (undefined && undefined.__values) || function(o) { var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; if (m) return m.call(o); if (o && typeof o.length === "number") return { next: function () { if (o && i >= o.length) o = void 0; return { value: o && o[i++], done: !o }; } }; throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); }; var __read$7 = (undefined && undefined.__read) || function (o, n) { var m = typeof Symbol === "function" && o[Symbol.iterator]; if (!m) return o; var i = m.call(o), r, ar = [], e; try { while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); } catch (error) { e = { error: error }; } finally { try { if (r && !r.done && (m = i["return"])) m.call(i); } finally { if (e) throw e.error; } } return ar; }; var rtlNegativeScroll; /** * This method adds a class to an element and remove that class from all siblings. * Useful for toggling state. * @param {HTMLElement} element The element to receive the class * @param {string} elementClass The class to be assigned to the element * @param {boolean} otherElementClass The class to be assigned to siblings of the element, but not the element itself */ function radioCssClass(element, elementClass, otherElementClass) { var parent = element.parentElement; var sibling = parent && parent.firstChild; while (sibling) { if (elementClass) { sibling.classList.toggle(elementClass, sibling === element); } if (otherElementClass) { sibling.classList.toggle(otherElementClass, sibling !== element); } sibling = sibling.nextSibling; } } var FOCUSABLE_SELECTOR = '[tabindex], input, select, button, textarea, [href]'; var FOCUSABLE_EXCLUDE = '.ag-hidden, .ag-hidden *, [disabled], .ag-disabled, .ag-disabled *'; function isFocusableFormField(element) { var matches = Element.prototype.matches || Element.prototype.msMatchesSelector; var inputSelector = 'input, select, button, textarea'; var isFocusable = matches.call(element, inputSelector); var isNotFocusable = matches.call(element, FOCUSABLE_EXCLUDE); var isElementVisible = isVisible(element); var focusable = isFocusable && !isNotFocusable && isElementVisible; return focusable; } function setDisplayed(element, displayed, options) { if (options === void 0) { options = {}; } var skipAriaHidden = options.skipAriaHidden; element.classList.toggle('ag-hidden', !displayed); if (!skipAriaHidden) { setAriaHidden(element, !displayed); } } function setVisible(element, visible, options) { if (options === void 0) { options = {}; } var skipAriaHidden = options.skipAriaHidden; element.classList.toggle('ag-invisible', !visible); if (!skipAriaHidden) { setAriaHidden(element, !visible); } } function setDisabled(element, disabled) { var attributeName = 'disabled'; var addOrRemoveDisabledAttribute = disabled ? function (e) { return e.setAttribute(attributeName, ''); } : function (e) { return e.removeAttribute(attributeName); }; addOrRemoveDisabledAttribute(element); nodeListForEach(element.querySelectorAll('input'), function (input) { return addOrRemoveDisabledAttribute(input); }); } function isElementChildOfClass(element, cls, maxNest) { var counter = 0; while (element) { if (element.classList.contains(cls)) { return true; } element = element.parentElement; if (typeof maxNest == 'number') { if (++counter > maxNest) { break; } } else if (element === maxNest) { break; } } return false; } // returns back sizes as doubles instead of strings. similar to // getBoundingClientRect, however getBoundingClientRect does not: // a) work with fractions (eg browser is zooming) // b) has CSS transitions applied (eg CSS scale, browser zoom), which we don't want, we want the un-transitioned values function getElementSize(el) { var _a = window.getComputedStyle(el), height = _a.height, width = _a.width, borderTopWidth = _a.borderTopWidth, borderRightWidth = _a.borderRightWidth, borderBottomWidth = _a.borderBottomWidth, borderLeftWidth = _a.borderLeftWidth, paddingTop = _a.paddingTop, paddingRight = _a.paddingRight, paddingBottom = _a.paddingBottom, paddingLeft = _a.paddingLeft, marginTop = _a.marginTop, marginRight = _a.marginRight, marginBottom = _a.marginBottom, marginLeft = _a.marginLeft, boxSizing = _a.boxSizing; return { height: parseFloat(height), width: parseFloat(width), borderTopWidth: parseFloat(borderTopWidth), borderRightWidth: parseFloat(borderRightWidth), borderBottomWidth: parseFloat(borderBottomWidth), borderLeftWidth: parseFloat(borderLeftWidth), paddingTop: parseFloat(paddingTop), paddingRight: parseFloat(paddingRight), paddingBottom: parseFloat(paddingBottom), paddingLeft: parseFloat(paddingLeft), marginTop: parseFloat(marginTop), marginRight: parseFloat(marginRight), marginBottom: parseFloat(marginBottom), marginLeft: parseFloat(marginLeft), boxSizing: boxSizing }; } function getInnerHeight(el) { var size = getElementSize(el); if (size.boxSizing === 'border-box') { return size.height - size.paddingTop - size.paddingBottom; } return size.height; } function getInnerWidth(el) { var size = getElementSize(el); if (size.boxSizing === 'border-box') { return size.width - size.paddingLeft - size.paddingRight; } return size.width; } function getAbsoluteHeight(el) { var size = getElementSize(el); var marginRight = size.marginBottom + size.marginTop; return Math.ceil(el.offsetHeight + marginRight); } function getAbsoluteWidth(el) { var size = getElementSize(el); var marginWidth = size.marginLeft + size.marginRight; return Math.ceil(el.offsetWidth + marginWidth); } function isRtlNegativeScroll() { if (typeof rtlNegativeScroll === "boolean") { return rtlNegativeScroll; } var template = document.createElement('div'); template.style.direction = 'rtl'; template.style.width = '1px'; template.style.height = '1px'; template.style.position = 'fixed'; template.style.top = '0px'; template.style.overflow = 'hidden'; template.dir = 'rtl'; template.innerHTML = /* html */ "
\n \n \n
"; document.body.appendChild(template); template.scrollLeft = 1; rtlNegativeScroll = Math.floor(template.scrollLeft) === 0; document.body.removeChild(template); return rtlNegativeScroll; } function getScrollLeft(element, rtl) { var scrollLeft = element.scrollLeft; if (rtl) { // Absolute value - for FF that reports RTL scrolls in negative numbers scrollLeft = Math.abs(scrollLeft); if (isBrowserChrome() && !isRtlNegativeScroll()) { scrollLeft = element.scrollWidth - element.clientWidth - scrollLeft; } } return scrollLeft; } function setScrollLeft(element, value, rtl) { if (rtl) { // Chrome and Safari when doing RTL have the END position of the scroll as zero, not the start if (isRtlNegativeScroll()) { value *= -1; } else if (isBrowserSafari() || isBrowserChrome()) { value = element.scrollWidth - element.clientWidth - value; } } element.scrollLeft = value; } function clearElement(el) { while (el && el.firstChild) { el.removeChild(el.firstChild); } } /** @deprecated */ function removeElement(parent, cssSelector) { removeFromParent(parent.querySelector(cssSelector)); } function removeFromParent(node) { if (node && node.parentNode) { node.parentNode.removeChild(node); } } function isVisible(element) { return element.offsetParent !== null; } /** * Loads the template and returns it as an element. makes up for no simple way in * the dom api to load html directly, eg we cannot do this: document.createElement(template) * @param {string} template * @returns {HTMLElement} */ function loadTemplate(template) { var tempDiv = document.createElement('div'); tempDiv.innerHTML = (template || '').trim(); return tempDiv.firstChild; } function appendHtml(eContainer, htmlTemplate) { if (eContainer.lastChild) { // https://developer.mozilla.org/en-US/docs/Web/API/Element/insertAdjacentHTML // we put the items at the start, so new items appear underneath old items, // so when expanding/collapsing groups, the new rows don't go on top of the // rows below that are moving our of the way eContainer.insertAdjacentHTML('afterbegin', htmlTemplate); } else { eContainer.innerHTML = htmlTemplate; } } /** @deprecated */ function getElementAttribute(element, attributeName) { if (element.attributes && element.attributes[attributeName]) { var attribute = element.attributes[attributeName]; return attribute.value; } return null; } function offsetHeight(element) { return element && element.clientHeight ? element.clientHeight : 0; } function offsetWidth(element) { return element && element.clientWidth ? element.clientWidth : 0; } function ensureDomOrder(eContainer, eChild, eChildBefore) { // if already in right order, do nothing if (eChildBefore && eChildBefore.nextSibling === eChild) { return; } var focusedEl = document.activeElement; var eChildHasFocus = eChild.contains(focusedEl); if (eChildBefore) { if (eChildBefore.nextSibling) { // insert between the eRowBefore and the row after it eContainer.insertBefore(eChild, eChildBefore.nextSibling); } else { // if nextSibling is missing, means other row is at end, so just append new row at the end eContainer.appendChild(eChild); } } else { // otherwise put at start if (eContainer.firstChild && eContainer.firstChild !== eChild) { // insert it at the first location eContainer.insertAdjacentElement('afterbegin', eChild); } } if (eChildHasFocus && focusedEl && browserSupportsPreventScroll()) { focusedEl.focus({ preventScroll: true }); } } function setDomChildOrder(eContainer, orderedChildren) { for (var i = 0; i < orderedChildren.length; i++) { var correctCellAtIndex = orderedChildren[i]; var actualCellAtIndex = eContainer.children[i]; if (actualCellAtIndex !== correctCellAtIndex) { eContainer.insertBefore(correctCellAtIndex, actualCellAtIndex); } } } function insertWithDomOrder(eContainer, eToInsert, eChildBefore) { if (eChildBefore) { // if previous element exists, just slot in after the previous element eChildBefore.insertAdjacentElement('afterend', eToInsert); } else { if (eContainer.firstChild) { // insert it at the first location eContainer.insertAdjacentElement('afterbegin', eToInsert); } else { // otherwise eContainer is empty, so just append it eContainer.appendChild(eToInsert); } } } /** @deprecated */ function prependDC(parent, documentFragment) { if (exists(parent.firstChild)) { parent.insertBefore(documentFragment, parent.firstChild); } else { parent.appendChild(documentFragment); } } function addStylesToElement(eElement, styles) { var e_1, _a; if (!styles) { return; } try { for (var _b = __values$1(Object.entries(styles)), _c = _b.next(); !_c.done; _c = _b.next()) { var _d = __read$7(_c.value, 2), key = _d[0], value = _d[1]; if (!key || !key.length || value == null) { continue; } // changes the key from camelCase into a hyphenated-string var parsedKey = key.replace(/[A-Z]/g, function (s) { return "-" + s.toLocaleLowerCase(); }); var valueAsString = value.toString(); var parsedValue = valueAsString.replace(/\s*!important/g, ''); var priority = parsedValue.length != valueAsString.length ? 'important' : undefined; eElement.style.setProperty(parsedKey, value, priority); } } catch (e_1_1) { e_1 = { error: e_1_1 }; } finally { try { if (_c && !_c.done && (_a = _b.return)) _a.call(_b); } finally { if (e_1) throw e_1.error; } } } function isHorizontalScrollShowing(element) { return element.clientWidth < element.scrollWidth; } function isVerticalScrollShowing(element) { return element.clientHeight < element.scrollHeight; } function setElementWidth(element, width) { if (width === 'flex') { element.style.removeProperty('width'); element.style.removeProperty('minWidth'); element.style.removeProperty('maxWidth'); element.style.flex = '1 1 auto'; } else { setFixedWidth(element, width); } } function setFixedWidth(element, width) { width = formatSize(width); element.style.width = width.toString(); element.style.maxWidth = width.toString(); element.style.minWidth = width.toString(); } function setElementHeight(element, height) { if (height === 'flex') { element.style.removeProperty('height'); element.style.removeProperty('minHeight'); element.style.removeProperty('maxHeight'); element.style.flex = '1 1 auto'; } else { setFixedHeight(element, height); } } function setFixedHeight(element, height) { height = formatSize(height); element.style.height = height.toString(); element.style.maxHeight = height.toString(); element.style.minHeight = height.toString(); } function formatSize(size) { if (typeof size === 'number') { return size + "px"; } return size; } function isNodeOrElement(o) { return o instanceof Node || o instanceof HTMLElement; } /** * Makes a copy of a node list into a list * @param {NodeList} nodeList * @returns {Node[]} */ function copyNodeList(nodeList) { if (nodeList == null) { return []; } var result = []; nodeListForEach(nodeList, function (node) { return result.push(node); }); return result; } function iterateNamedNodeMap(map, callback) { if (!map) { return; } for (var i = 0; i < map.length; i++) { var attr = map[i]; callback(attr.name, attr.value); } } function addOrRemoveAttribute(element, name, value) { if (value == null) { element.removeAttribute(name); } else { element.setAttribute(name, value.toString()); } } function nodeListForEach(nodeList, action) { if (nodeList == null) { return; } for (var i = 0; i < nodeList.length; i++) { action(nodeList[i]); } } var DomUtils = /*#__PURE__*/Object.freeze({ radioCssClass: radioCssClass, FOCUSABLE_SELECTOR: FOCUSABLE_SELECTOR, FOCUSABLE_EXCLUDE: FOCUSABLE_EXCLUDE, isFocusableFormField: isFocusableFormField, setDisplayed: setDisplayed, setVisible: setVisible, setDisabled: setDisabled, isElementChildOfClass: isElementChildOfClass, getElementSize: getElementSize, getInnerHeight: getInnerHeight, getInnerWidth: getInnerWidth, getAbsoluteHeight: getAbsoluteHeight, getAbsoluteWidth: getAbsoluteWidth, isRtlNegativeScroll: isRtlNegativeScroll, getScrollLeft: getScrollLeft, setScrollLeft: setScrollLeft, clearElement: clearElement, removeElement: removeElement, removeFromParent: removeFromParent, isVisible: isVisible, loadTemplate: loadTemplate, appendHtml: appendHtml, getElementAttribute: getElementAttribute, offsetHeight: offsetHeight, offsetWidth: offsetWidth, ensureDomOrder: ensureDomOrder, setDomChildOrder: setDomChildOrder, insertWithDomOrder: insertWithDomOrder, prependDC: prependDC, addStylesToElement: addStylesToElement, isHorizontalScrollShowing: isHorizontalScrollShowing, isVerticalScrollShowing: isVerticalScrollShowing, setElementWidth: setElementWidth, setFixedWidth: setFixedWidth, setElementHeight: setElementHeight, setFixedHeight: setFixedHeight, formatSize: formatSize, isNodeOrElement: isNodeOrElement, copyNodeList: copyNodeList, iterateNamedNodeMap: iterateNamedNodeMap, addOrRemoveAttribute: addOrRemoveAttribute, nodeListForEach: nodeListForEach }); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ // // IMPORTANT NOTE! // // If you change the list below, copy/paste the new content into the docs page javascript-grid-icons // var iconNameClassMap = { // header column group shown when expanded (click to contract) columnGroupOpened: 'expanded', // header column group shown when contracted (click to expand) columnGroupClosed: 'contracted', // tool panel column group contracted (click to expand) columnSelectClosed: 'tree-closed', // tool panel column group expanded (click to contract) columnSelectOpen: 'tree-open', // column tool panel header expand/collapse all button, shown when some children are expanded and // others are collapsed columnSelectIndeterminate: 'tree-indeterminate', // shown on ghost icon while dragging column to the side of the grid to pin columnMovePin: 'pin', // shown on ghost icon while dragging over part of the page that is not a drop zone columnMoveHide: 'eye-slash', // shown on ghost icon while dragging columns to reorder columnMoveMove: 'arrows', // animating icon shown when dragging a column to the right of the grid causes horizontal scrolling columnMoveLeft: 'left', // animating icon shown when dragging a column to the left of the grid causes horizontal scrolling columnMoveRight: 'right', // shown on ghost icon while dragging over Row Groups drop zone columnMoveGroup: 'group', // shown on ghost icon while dragging over Values drop zone columnMoveValue: 'aggregation', // shown on ghost icon while dragging over pivot drop zone columnMovePivot: 'pivot', // shown on ghost icon while dragging over drop zone that doesn't support it, e.g. // string column over aggregation drop zone dropNotAllowed: 'not-allowed', // shown on row group when contracted (click to expand) groupContracted: 'tree-closed', // shown on row group when expanded (click to contract) groupExpanded: 'tree-open', // set filter tree list group contracted (click to expand) setFilterGroupClosed: 'tree-closed', // set filter tree list group expanded (click to contract) setFilterGroupOpen: 'tree-open', // set filter tree list expand/collapse all button, shown when some children are expanded and // others are collapsed setFilterGroupIndeterminate: 'tree-indeterminate', // context menu chart item chart: 'chart', // chart window title bar close: 'cross', // X (remove) on column 'pill' after adding it to a drop zone list cancel: 'cancel', // indicates the currently active pin state in the "Pin column" sub-menu of the column menu check: 'tick', // "go to first" button in pagination controls first: 'first', // "go to previous" button in pagination controls previous: 'previous', // "go to next" button in pagination controls next: 'next', // "go to last" button in pagination controls last: 'last', // shown on top right of chart when chart is linked to range data (click to unlink) linked: 'linked', // shown on top right of chart when chart is not linked to range data (click to link) unlinked: 'unlinked', // "Choose colour" button on chart settings tab colorPicker: 'color-picker', // rotating spinner shown by the loading cell renderer groupLoading: 'loading', // button to launch enterprise column menu menu: 'menu', // filter tool panel tab filter: 'filter', // column tool panel tab columns: 'columns', // button in chart regular size window title bar (click to maximise) maximize: 'maximize', // button in chart maximised window title bar (click to make regular size) minimize: 'minimize', // "Pin column" item in column header menu menuPin: 'pin', // "Value aggregation" column menu item (shown on numeric columns when grouping is active)" menuValue: 'aggregation', // "Group by {column-name}" item in column header menu menuAddRowGroup: 'group', // "Un-Group by {column-name}" item in column header menu menuRemoveRowGroup: 'group', // context menu copy item clipboardCopy: 'copy', // context menu cut item clipboardCut: 'cut', // context menu paste item clipboardPaste: 'paste', // identifies the pivot drop zone pivotPanel: 'pivot', // "Row groups" drop zone in column tool panel rowGroupPanel: 'group', // columns tool panel Values drop zone valuePanel: 'aggregation', // drag handle used to pick up draggable columns columnDrag: 'grip', // drag handle used to pick up draggable rows rowDrag: 'grip', // context menu export item save: 'save', // csv export csvExport: 'csv', // excel export, excelExport: 'excel', // icon on dropdown editors smallDown: 'small-down', // version of small-right used in RTL mode smallLeft: 'small-left', // separater between column 'pills' when you add multiple columns to the header drop zone smallRight: 'small-right', smallUp: 'small-up', // show on column header when column is sorted ascending sortAscending: 'asc', // show on column header when column is sorted descending sortDescending: 'desc', // show on column header when column has no sort, only when enabled with gridOptions.unSortIcon=true sortUnSort: 'none' }; /** * If icon provided, use this (either a string, or a function callback). * if not, then use the default icon from the theme * @param {string} iconName * @param {GridOptionsService} gridOptionsService * @param {Column | null} [column] * @returns {HTMLElement} */ function createIcon(iconName, gridOptionsService, column) { var iconContents = createIconNoSpan(iconName, gridOptionsService, column); if (iconContents && iconContents.className.indexOf('ag-icon') > -1) { return iconContents; } var eResult = document.createElement('span'); eResult.appendChild(iconContents); return eResult; } function createIconNoSpan(iconName, gridOptionsService, column, forceCreate) { var userProvidedIcon = null; // check col for icon first var icons = column && column.getColDef().icons; if (icons) { userProvidedIcon = icons[iconName]; } // if not in col, try grid options if (gridOptionsService && !userProvidedIcon) { var optionsIcons = gridOptionsService.get('icons'); if (optionsIcons) { userProvidedIcon = optionsIcons[iconName]; } } // now if user provided, use it if (userProvidedIcon) { var rendererResult = void 0; if (typeof userProvidedIcon === 'function') { rendererResult = userProvidedIcon(); } else if (typeof userProvidedIcon === 'string') { rendererResult = userProvidedIcon; } else { throw new Error('icon from grid options needs to be a string or a function'); } if (typeof rendererResult === 'string') { return loadTemplate(rendererResult); } if (isNodeOrElement(rendererResult)) { return rendererResult; } console.warn('AG Grid: iconRenderer should return back a string or a dom object'); } else { var span = document.createElement('span'); var cssClass = iconNameClassMap[iconName]; if (!cssClass) { if (!forceCreate) { console.warn("AG Grid: Did not find icon " + iconName); cssClass = ''; } else { cssClass = iconName; } } span.setAttribute('class', "ag-icon ag-icon-" + cssClass); span.setAttribute('unselectable', 'on'); setAriaRole(span, 'presentation'); return span; } } var IconUtils = /*#__PURE__*/Object.freeze({ iconNameClassMap: iconNameClassMap, createIcon: createIcon, createIconNoSpan: createIconNoSpan }); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var KeyCode = /** @class */ (function () { function KeyCode() { } KeyCode.BACKSPACE = 'Backspace'; KeyCode.TAB = 'Tab'; KeyCode.ENTER = 'Enter'; KeyCode.ESCAPE = 'Escape'; KeyCode.SPACE = ' '; KeyCode.LEFT = 'ArrowLeft'; KeyCode.UP = 'ArrowUp'; KeyCode.RIGHT = 'ArrowRight'; KeyCode.DOWN = 'ArrowDown'; KeyCode.DELETE = 'Delete'; KeyCode.F2 = 'F2'; KeyCode.PAGE_UP = 'PageUp'; KeyCode.PAGE_DOWN = 'PageDown'; KeyCode.PAGE_HOME = 'Home'; KeyCode.PAGE_END = 'End'; // these should be used with `event.code` instead of `event.key` // as `event.key` changes when non-latin keyboards are used KeyCode.A = 'KeyA'; KeyCode.C = 'KeyC'; KeyCode.D = 'KeyD'; KeyCode.V = 'KeyV'; KeyCode.X = 'KeyX'; KeyCode.Y = 'KeyY'; KeyCode.Z = 'KeyZ'; return KeyCode; }()); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var A_KEYCODE = 65; var C_KEYCODE = 67; var V_KEYCODE = 86; var D_KEYCODE = 68; var Z_KEYCODE = 90; var Y_KEYCODE = 89; function isEventFromPrintableCharacter(event) { // no allowed printable chars have alt or ctrl key combinations if (event.altKey || event.ctrlKey || event.metaKey) { return false; } // if key is length 1, eg if it is 'a' for the a key, or '2' for the '2' key. // non-printable characters have names, eg 'Enter' or 'Backspace'. var printableCharacter = event.key.length === 1; return printableCharacter; } /** * Allows user to tell the grid to skip specific keyboard events * @param {GridOptionsService} gridOptionsService * @param {KeyboardEvent} keyboardEvent * @param {IRowNode} rowNode * @param {Column} column * @param {boolean} editing * @returns {boolean} */ function isUserSuppressingKeyboardEvent(gridOptionsService, keyboardEvent, rowNode, column, editing) { var colDefFunc = column ? column.getColDef().suppressKeyboardEvent : undefined; // if no callbacks provided by user, then do nothing if (!colDefFunc) { return false; } var params = { event: keyboardEvent, editing: editing, column: column, api: gridOptionsService.api, node: rowNode, data: rowNode.data, colDef: column.getColDef(), context: gridOptionsService.context, columnApi: gridOptionsService.columnApi }; // colDef get first preference on suppressing events if (colDefFunc) { var colDefFuncResult = colDefFunc(params); // if colDef func suppressed, then return now, no need to call gridOption func if (colDefFuncResult) { return true; } } // otherwise return false, don't suppress, as colDef didn't suppress and no func on gridOptions return false; } function isUserSuppressingHeaderKeyboardEvent(gridOptionsService, keyboardEvent, headerRowIndex, column) { var colDef = column.getDefinition(); var colDefFunc = colDef && colDef.suppressHeaderKeyboardEvent; if (!exists(colDefFunc)) { return false; } var params = { api: gridOptionsService.api, columnApi: gridOptionsService.columnApi, context: gridOptionsService.context, colDef: colDef, column: column, headerRowIndex: headerRowIndex, event: keyboardEvent }; return !!colDefFunc(params); } function normaliseQwertyAzerty(keyboardEvent) { var keyCode = keyboardEvent.keyCode; var code; switch (keyCode) { case A_KEYCODE: code = KeyCode.A; break; case C_KEYCODE: code = KeyCode.C; break; case V_KEYCODE: code = KeyCode.V; break; case D_KEYCODE: code = KeyCode.D; break; case Z_KEYCODE: code = KeyCode.Z; break; case Y_KEYCODE: code = KeyCode.Y; break; default: code = keyboardEvent.code; } return code; } function isDeleteKey(key, alwaysReturnFalseOnBackspace) { if (alwaysReturnFalseOnBackspace === void 0) { alwaysReturnFalseOnBackspace = false; } if (key === KeyCode.DELETE) { return true; } if (!alwaysReturnFalseOnBackspace && key === KeyCode.BACKSPACE) { return isMacOsUserAgent(); } return false; } var KeyboardUtils = /*#__PURE__*/Object.freeze({ isEventFromPrintableCharacter: isEventFromPrintableCharacter, isUserSuppressingKeyboardEvent: isUserSuppressingKeyboardEvent, isUserSuppressingHeaderKeyboardEvent: isUserSuppressingHeaderKeyboardEvent, normaliseQwertyAzerty: normaliseQwertyAzerty, isDeleteKey: isDeleteKey }); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ /** * `True` if the event is close to the original event by X pixels either vertically or horizontally. * we only start dragging after X pixels so this allows us to know if we should start dragging yet. * @param {MouseEvent | TouchEvent} e1 * @param {MouseEvent | TouchEvent} e2 * @param {number} pixelCount * @returns {boolean} */ function areEventsNear(e1, e2, pixelCount) { // by default, we wait 4 pixels before starting the drag if (pixelCount === 0) { return false; } var diffX = Math.abs(e1.clientX - e2.clientX); var diffY = Math.abs(e1.clientY - e2.clientY); return Math.max(diffX, diffY) <= pixelCount; } var MouseUtils = /*#__PURE__*/Object.freeze({ areEventsNear: areEventsNear }); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ /** * Gets called by: a) ClientSideNodeManager and b) GroupStage to do sorting. * when in ClientSideNodeManager we always have indexes (as this sorts the items the * user provided) but when in GroupStage, the nodes can contain filler nodes that * don't have order id's * @param {RowNode[]} rowNodes * @param {Object} rowNodeOrder * * @returns a boolean representing whether nodes were reordered */ function sortRowNodesByOrder(rowNodes, rowNodeOrder) { if (!rowNodes) { return false; } var comparator = function (nodeA, nodeB) { var positionA = rowNodeOrder[nodeA.id]; var positionB = rowNodeOrder[nodeB.id]; var aHasIndex = positionA !== undefined; var bHasIndex = positionB !== undefined; var bothNodesAreUserNodes = aHasIndex && bHasIndex; var bothNodesAreFillerNodes = !aHasIndex && !bHasIndex; if (bothNodesAreUserNodes) { // when comparing two nodes the user has provided, they always // have indexes return positionA - positionB; } if (bothNodesAreFillerNodes) { // when comparing two filler nodes, we have no index to compare them // against, however we want this sorting to be deterministic, so that // the rows don't jump around as the user does delta updates. so we // want the same sort result. so we use the __objectId - which doesn't make sense // from a sorting point of view, but does give consistent behaviour between // calls. otherwise groups jump around as delta updates are done. // note: previously here we used nodeId, however this gave a strange order // as string ordering of numbers is wrong, so using id based on creation order // as least gives better looking order. return nodeA.__objectId - nodeB.__objectId; } if (aHasIndex) { return 1; } return -1; }; // check if the list first needs sorting var rowNodeA; var rowNodeB; var atLeastOneOutOfOrder = false; for (var i = 0; i < rowNodes.length - 1; i++) { rowNodeA = rowNodes[i]; rowNodeB = rowNodes[i + 1]; if (comparator(rowNodeA, rowNodeB) > 0) { atLeastOneOutOfOrder = true; break; } } if (atLeastOneOutOfOrder) { rowNodes.sort(comparator); return true; } return false; } function traverseNodesWithKey(nodes, callback) { var keyParts = []; recursiveSearchNodes(nodes); function recursiveSearchNodes(currentNodes) { if (!currentNodes) { return; } currentNodes.forEach(function (node) { // also checking for children for tree data if (node.group || node.hasChildren()) { keyParts.push(node.key); var key = keyParts.join('|'); callback(node, key); recursiveSearchNodes(node.childrenAfterGroup); keyParts.pop(); } }); } } var RowNodeUtils = /*#__PURE__*/Object.freeze({ sortRowNodesByOrder: sortRowNodesByOrder, traverseNodesWithKey: traverseNodesWithKey }); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ function convertToSet(list) { var set = new Set(); list.forEach(function (x) { return set.add(x); }); return set; } var SetUtils = /*#__PURE__*/Object.freeze({ convertToSet: convertToSet }); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __assign$1 = (undefined && undefined.__assign) || function () { __assign$1 = Object.assign || function(t) { for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; } return t; }; return __assign$1.apply(this, arguments); }; var utils = __assign$1(__assign$1(__assign$1(__assign$1(__assign$1(__assign$1(__assign$1(__assign$1(__assign$1(__assign$1(__assign$1(__assign$1(__assign$1(__assign$1(__assign$1(__assign$1(__assign$1(__assign$1({}, AriaUtils), ArrayUtils), BrowserUtils), DateUtils), DomUtils), EventUtils), FunctionUtils), FuzzyMatchUtils), GenericUtils), IconUtils), KeyboardUtils), MapUtils), MouseUtils), NumberUtils), ObjectUtils), RowNodeUtils), SetUtils), StringUtils); var _ = utils; /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var NumberSequence = /** @class */ (function () { function NumberSequence(initValue, step) { if (initValue === void 0) { initValue = 0; } if (step === void 0) { step = 1; } this.nextValue = initValue; this.step = step; } NumberSequence.prototype.next = function () { var valToReturn = this.nextValue; this.nextValue += this.step; return valToReturn; }; NumberSequence.prototype.peek = function () { return this.nextValue; }; NumberSequence.prototype.skip = function (count) { this.nextValue += count; }; return NumberSequence; }()); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ (function (AgPromiseStatus) { AgPromiseStatus[AgPromiseStatus["IN_PROGRESS"] = 0] = "IN_PROGRESS"; AgPromiseStatus[AgPromiseStatus["RESOLVED"] = 1] = "RESOLVED"; })(exports.AgPromiseStatus || (exports.AgPromiseStatus = {})); var AgPromise = /** @class */ (function () { function AgPromise(callback) { var _this = this; this.status = exports.AgPromiseStatus.IN_PROGRESS; this.resolution = null; this.waiters = []; callback(function (value) { return _this.onDone(value); }, function (params) { return _this.onReject(params); }); } AgPromise.all = function (promises) { return new AgPromise(function (resolve) { var remainingToResolve = promises.length; var combinedValues = new Array(remainingToResolve); promises.forEach(function (promise, index) { promise.then(function (value) { combinedValues[index] = value; remainingToResolve--; if (remainingToResolve === 0) { resolve(combinedValues); } }); }); }); }; AgPromise.resolve = function (value) { if (value === void 0) { value = null; } return new AgPromise(function (resolve) { return resolve(value); }); }; AgPromise.prototype.then = function (func) { var _this = this; return new AgPromise(function (resolve) { if (_this.status === exports.AgPromiseStatus.RESOLVED) { resolve(func(_this.resolution)); } else { _this.waiters.push(function (value) { return resolve(func(value)); }); } }); }; AgPromise.prototype.resolveNow = function (ifNotResolvedValue, ifResolved) { return this.status === exports.AgPromiseStatus.RESOLVED ? ifResolved(this.resolution) : ifNotResolvedValue; }; AgPromise.prototype.onDone = function (value) { this.status = exports.AgPromiseStatus.RESOLVED; this.resolution = value; this.waiters.forEach(function (waiter) { return waiter(value); }); }; AgPromise.prototype.onReject = function (params) { console.warn('TBI'); }; return AgPromise; }()); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ /** * A Util Class only used when debugging for printing time to console */ var Timer = /** @class */ (function () { function Timer() { this.timestamp = new Date().getTime(); } Timer.prototype.print = function (msg) { var duration = (new Date().getTime()) - this.timestamp; console.info(msg + " = " + duration); this.timestamp = new Date().getTime(); }; return Timer; }()); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$6 = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __assign$2 = (undefined && undefined.__assign) || function () { __assign$2 = Object.assign || function(t) { for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; } return t; }; return __assign$2.apply(this, arguments); }; var __decorate$c = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var TooltipStates; (function (TooltipStates) { TooltipStates[TooltipStates["NOTHING"] = 0] = "NOTHING"; TooltipStates[TooltipStates["WAITING_TO_SHOW"] = 1] = "WAITING_TO_SHOW"; TooltipStates[TooltipStates["SHOWING"] = 2] = "SHOWING"; })(TooltipStates || (TooltipStates = {})); var CustomTooltipFeature = /** @class */ (function (_super) { __extends$6(CustomTooltipFeature, _super); function CustomTooltipFeature(parentComp) { var _this = _super.call(this) || this; _this.DEFAULT_SHOW_TOOLTIP_DELAY = 2000; _this.DEFAULT_HIDE_TOOLTIP_DELAY = 10000; _this.SHOW_QUICK_TOOLTIP_DIFF = 1000; _this.FADE_OUT_TOOLTIP_TIMEOUT = 1000; _this.state = TooltipStates.NOTHING; // when showing the tooltip, we need to make sure it's the most recent instance we request, as due to // async we could request two tooltips before the first instance returns, in which case we should // disregard the second instance. _this.tooltipInstanceCount = 0; _this.tooltipMouseTrack = false; _this.parentComp = parentComp; return _this; } CustomTooltipFeature.prototype.postConstruct = function () { this.tooltipShowDelay = this.getTooltipDelay('show') || this.DEFAULT_SHOW_TOOLTIP_DELAY; this.tooltipHideDelay = this.getTooltipDelay('hide') || this.DEFAULT_HIDE_TOOLTIP_DELAY; this.tooltipMouseTrack = this.gridOptionsService.is('tooltipMouseTrack'); var el = this.parentComp.getGui(); this.addManagedListener(el, 'mouseenter', this.onMouseEnter.bind(this)); this.addManagedListener(el, 'mouseleave', this.onMouseLeave.bind(this)); this.addManagedListener(el, 'mousemove', this.onMouseMove.bind(this)); this.addManagedListener(el, 'mousedown', this.onMouseDown.bind(this)); this.addManagedListener(el, 'keydown', this.onKeyDown.bind(this)); }; CustomTooltipFeature.prototype.destroy = function () { // if this component gets destroyed while tooltip is showing, need to make sure // we don't end with no mouseLeave event resulting in zombie tooltip this.setToDoNothing(); _super.prototype.destroy.call(this); }; CustomTooltipFeature.prototype.onMouseEnter = function (e) { if (isIOSUserAgent()) { return; } // every mouseenter should be following by a mouseleave, however for some unkonwn, it's possible for // mouseenter to be called twice in a row, which can happen if editing the cell. this was reported // in https://ag-grid.atlassian.net/browse/AG-4422. to get around this, we check the state, and if // state is !=nothing, then we know mouseenter was already received. if (this.state != TooltipStates.NOTHING) { return; } // if another tooltip was hidden very recently, we only wait 200ms to show, not the normal waiting time var delay = this.isLastTooltipHiddenRecently() ? 200 : this.tooltipShowDelay; this.showTooltipTimeoutId = window.setTimeout(this.showTooltip.bind(this), delay); this.lastMouseEvent = e; this.state = TooltipStates.WAITING_TO_SHOW; }; CustomTooltipFeature.prototype.onMouseLeave = function () { this.setToDoNothing(); }; CustomTooltipFeature.prototype.onKeyDown = function () { this.setToDoNothing(); }; CustomTooltipFeature.prototype.setToDoNothing = function () { if (this.state === TooltipStates.SHOWING) { this.hideTooltip(); } this.clearTimeouts(); this.state = TooltipStates.NOTHING; }; CustomTooltipFeature.prototype.onMouseMove = function (e) { // there is a delay from the time we mouseOver a component and the time the // tooltip is displayed, so we need to track mousemove to be able to correctly // position the tooltip when showTooltip is called. this.lastMouseEvent = e; if (this.tooltipMouseTrack && this.state === TooltipStates.SHOWING && this.tooltipComp) { this.positionTooltipUnderLastMouseEvent(); } }; CustomTooltipFeature.prototype.onMouseDown = function () { this.setToDoNothing(); }; CustomTooltipFeature.prototype.getTooltipDelay = function (type) { var tooltipShowDelay = this.gridOptionsService.getNum('tooltipShowDelay'); var tooltipHideDelay = this.gridOptionsService.getNum('tooltipHideDelay'); var delay = type === 'show' ? tooltipShowDelay : tooltipHideDelay; var capitalisedType = capitalise(type); if (exists(delay)) { if (delay < 0) { doOnce(function () { return console.warn("AG Grid: tooltip" + capitalisedType + "Delay should not be lower than 0"); }, "tooltip" + capitalisedType + "DelayWarn"); } return Math.max(200, delay); } return null; }; CustomTooltipFeature.prototype.hideTooltip = function () { // check if comp exists - due to async, although we asked for // one, the instance may not be back yet if (this.tooltipComp) { this.destroyTooltipComp(); CustomTooltipFeature.lastTooltipHideTime = new Date().getTime(); } this.state = TooltipStates.NOTHING; }; CustomTooltipFeature.prototype.destroyTooltipComp = function () { var _this = this; // add class to fade out the tooltip this.tooltipComp.getGui().classList.add('ag-tooltip-hiding'); // make local copies of these variables, as we use them in the async function below, // and we clear then to 'undefined' later, so need to take a copy before they are undefined. var tooltipPopupDestroyFunc = this.tooltipPopupDestroyFunc; var tooltipComp = this.tooltipComp; window.setTimeout(function () { tooltipPopupDestroyFunc(); _this.getContext().destroyBean(tooltipComp); }, this.FADE_OUT_TOOLTIP_TIMEOUT); this.tooltipPopupDestroyFunc = undefined; this.tooltipComp = undefined; }; CustomTooltipFeature.prototype.isLastTooltipHiddenRecently = function () { // return true if <1000ms since last time we hid a tooltip var now = new Date().getTime(); var then = CustomTooltipFeature.lastTooltipHideTime; return (now - then) < this.SHOW_QUICK_TOOLTIP_DIFF; }; CustomTooltipFeature.prototype.showTooltip = function () { var params = __assign$2({}, this.parentComp.getTooltipParams()); if (!exists(params.value)) { this.setToDoNothing(); return; } this.state = TooltipStates.SHOWING; this.tooltipInstanceCount++; // we pass in tooltipInstanceCount so the callback knows what the count was when // we requested the tooltip, so if another tooltip was requested in the mean time // we disregard it var callback = this.newTooltipComponentCallback.bind(this, this.tooltipInstanceCount); var userDetails = this.userComponentFactory.getTooltipCompDetails(params); userDetails.newAgStackInstance().then(callback); }; CustomTooltipFeature.prototype.newTooltipComponentCallback = function (tooltipInstanceCopy, tooltipComp) { var compNoLongerNeeded = this.state !== TooltipStates.SHOWING || this.tooltipInstanceCount !== tooltipInstanceCopy; if (compNoLongerNeeded) { this.getContext().destroyBean(tooltipComp); return; } var eGui = tooltipComp.getGui(); this.tooltipComp = tooltipComp; if (!eGui.classList.contains('ag-tooltip')) { eGui.classList.add('ag-tooltip-custom'); } var translate = this.localeService.getLocaleTextFunc(); var addPopupRes = this.popupService.addPopup({ eChild: eGui, ariaLabel: translate('ariaLabelTooltip', 'Tooltip') }); if (addPopupRes) { this.tooltipPopupDestroyFunc = addPopupRes.hideFunc; } // this.tooltipPopupDestroyFunc = this.popupService.addPopup(false, eGui, false); this.positionTooltipUnderLastMouseEvent(); this.hideTooltipTimeoutId = window.setTimeout(this.hideTooltip.bind(this), this.tooltipHideDelay); }; CustomTooltipFeature.prototype.positionTooltipUnderLastMouseEvent = function () { this.popupService.positionPopupUnderMouseEvent({ type: 'tooltip', mouseEvent: this.lastMouseEvent, ePopup: this.tooltipComp.getGui(), nudgeY: 18, skipObserver: this.tooltipMouseTrack }); }; CustomTooltipFeature.prototype.clearTimeouts = function () { if (this.showTooltipTimeoutId) { window.clearTimeout(this.showTooltipTimeoutId); this.showTooltipTimeoutId = undefined; } if (this.hideTooltipTimeoutId) { window.clearTimeout(this.hideTooltipTimeoutId); this.hideTooltipTimeoutId = undefined; } }; __decorate$c([ Autowired('popupService') ], CustomTooltipFeature.prototype, "popupService", void 0); __decorate$c([ Autowired('userComponentFactory') ], CustomTooltipFeature.prototype, "userComponentFactory", void 0); __decorate$c([ Autowired('columnApi') ], CustomTooltipFeature.prototype, "columnApi", void 0); __decorate$c([ Autowired('gridApi') ], CustomTooltipFeature.prototype, "gridApi", void 0); __decorate$c([ PostConstruct ], CustomTooltipFeature.prototype, "postConstruct", null); return CustomTooltipFeature; }(BeanStub)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var CssClassManager = /** @class */ (function () { function CssClassManager(getGui) { // to minimise DOM hits, we only apply CSS classes if they have changed. as adding a CSS class that is already // there, or removing one that wasn't present, all takes CPU. this.cssClassStates = {}; this.getGui = getGui; } CssClassManager.prototype.addCssClass = function (className) { var _this = this; var list = (className || '').split(' '); if (list.length > 1) { list.forEach(function (cls) { return _this.addCssClass(cls); }); return; } var updateNeeded = this.cssClassStates[className] !== true; if (updateNeeded && className.length) { var eGui = this.getGui(); if (eGui) { eGui.classList.add(className); } this.cssClassStates[className] = true; } }; CssClassManager.prototype.removeCssClass = function (className) { var _this = this; var list = (className || '').split(' '); if (list.length > 1) { list.forEach(function (cls) { return _this.removeCssClass(cls); }); return; } var updateNeeded = this.cssClassStates[className] !== false; if (updateNeeded && className.length) { var eGui = this.getGui(); if (eGui) { eGui.classList.remove(className); } this.cssClassStates[className] = false; } }; CssClassManager.prototype.containsCssClass = function (className) { var eGui = this.getGui(); if (!eGui) { return false; } return eGui.classList.contains(className); }; CssClassManager.prototype.addOrRemoveCssClass = function (className, addOrRemove) { var _this = this; if (!className) { return; } // we check for spaces before doing the split, as doing the split // created a performance problem (on windows only, see AG-6765) if (className.indexOf(' ') >= 0) { var list = (className || '').split(' '); if (list.length > 1) { list.forEach(function (cls) { return _this.addOrRemoveCssClass(cls, addOrRemove); }); return; } } var updateNeeded = this.cssClassStates[className] !== addOrRemove; if (updateNeeded && className.length) { var eGui = this.getGui(); if (eGui) { eGui.classList.toggle(className, addOrRemove); } this.cssClassStates[className] = addOrRemove; } }; return CssClassManager; }()); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$7 = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __decorate$d = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var compIdSequence = new NumberSequence(); var Component = /** @class */ (function (_super) { __extends$7(Component, _super); function Component(template) { var _this = _super.call(this) || this; // if false, then CSS class "ag-hidden" is applied, which sets "display: none" _this.displayed = true; // if false, then CSS class "ag-invisible" is applied, which sets "visibility: hidden" _this.visible = true; // unique id for this row component. this is used for getting a reference to the HTML dom. // we cannot use the RowNode id as this is not unique (due to animation, old rows can be lying // around as we create a new rowComp instance for the same row node). _this.compId = compIdSequence.next(); _this.cssClassManager = new CssClassManager(function () { return _this.eGui; }); if (template) { _this.setTemplate(template); } return _this; } Component.prototype.preConstructOnComponent = function () { this.usingBrowserTooltips = this.gridOptionsService.is('enableBrowserTooltips'); }; Component.prototype.getCompId = function () { return this.compId; }; Component.prototype.getTooltipParams = function () { return { value: this.tooltipText, location: 'UNKNOWN' }; }; Component.prototype.setTooltip = function (newTooltipText) { var _this = this; var removeTooltip = function () { if (_this.usingBrowserTooltips) { _this.getGui().removeAttribute('title'); } else { _this.tooltipFeature = _this.destroyBean(_this.tooltipFeature); } }; var addTooltip = function () { if (_this.usingBrowserTooltips) { _this.getGui().setAttribute('title', _this.tooltipText); } else { _this.tooltipFeature = _this.createBean(new CustomTooltipFeature(_this)); } }; if (this.tooltipText != newTooltipText) { if (this.tooltipText) { removeTooltip(); } if (newTooltipText != null) { this.tooltipText = newTooltipText; if (this.tooltipText) { addTooltip(); } } } }; // for registered components only, eg creates AgCheckbox instance from ag-checkbox HTML tag Component.prototype.createChildComponentsFromTags = function (parentNode, paramsMap) { var _this = this; // we MUST take a copy of the list first, as the 'swapComponentForNode' adds comments into the DOM // which messes up the traversal order of the children. var childNodeList = copyNodeList(parentNode.childNodes); childNodeList.forEach(function (childNode) { if (!(childNode instanceof HTMLElement)) { return; } var childComp = _this.createComponentFromElement(childNode, function (childComp) { // copy over all attributes, including css classes, so any attributes user put on the tag // wll be carried across var childGui = childComp.getGui(); if (childGui) { _this.copyAttributesFromNode(childNode, childComp.getGui()); } }, paramsMap); if (childComp) { if (childComp.addItems && childNode.children.length) { _this.createChildComponentsFromTags(childNode, paramsMap); // converting from HTMLCollection to Array var items = Array.prototype.slice.call(childNode.children); childComp.addItems(items); } // replace the tag (eg ag-checkbox) with the proper HTMLElement (eg 'div') in the dom _this.swapComponentForNode(childComp, parentNode, childNode); } else if (childNode.childNodes) { _this.createChildComponentsFromTags(childNode, paramsMap); } }); }; Component.prototype.createComponentFromElement = function (element, afterPreCreateCallback, paramsMap) { var key = element.nodeName; var componentParams = paramsMap ? paramsMap[element.getAttribute('ref')] : undefined; var ComponentClass = this.agStackComponentsRegistry.getComponentClass(key); if (ComponentClass) { Component.elementGettingCreated = element; var newComponent = new ComponentClass(componentParams); newComponent.setParentComponent(this); this.createBean(newComponent, null, afterPreCreateCallback); return newComponent; } return null; }; Component.prototype.copyAttributesFromNode = function (source, dest) { iterateNamedNodeMap(source.attributes, function (name, value) { return dest.setAttribute(name, value); }); }; Component.prototype.swapComponentForNode = function (newComponent, parentNode, childNode) { var eComponent = newComponent.getGui(); parentNode.replaceChild(eComponent, childNode); parentNode.insertBefore(document.createComment(childNode.nodeName), eComponent); this.addDestroyFunc(this.destroyBean.bind(this, newComponent)); this.swapInComponentForQuerySelectors(newComponent, childNode); }; Component.prototype.swapInComponentForQuerySelectors = function (newComponent, childNode) { var thisNoType = this; this.iterateOverQuerySelectors(function (querySelector) { if (thisNoType[querySelector.attributeName] === childNode) { thisNoType[querySelector.attributeName] = newComponent; } }); }; Component.prototype.iterateOverQuerySelectors = function (action) { var thisPrototype = Object.getPrototypeOf(this); while (thisPrototype != null) { var metaData = thisPrototype.__agComponentMetaData; var currentProtoName = getFunctionName(thisPrototype.constructor); if (metaData && metaData[currentProtoName] && metaData[currentProtoName].querySelectors) { metaData[currentProtoName].querySelectors.forEach(function (querySelector) { return action(querySelector); }); } thisPrototype = Object.getPrototypeOf(thisPrototype); } }; Component.prototype.setTemplate = function (template, paramsMap) { var eGui = loadTemplate(template); this.setTemplateFromElement(eGui, paramsMap); }; Component.prototype.setTemplateFromElement = function (element, paramsMap) { this.eGui = element; this.eGui.__agComponent = this; this.wireQuerySelectors(); // context will not be available when user sets template in constructor if (!!this.getContext()) { this.createChildComponentsFromTags(this.getGui(), paramsMap); } }; Component.prototype.createChildComponentsPreConstruct = function () { // ui exists if user sets template in constructor. when this happens, we have to wait for the context // to be autoWired first before we can create child components. if (!!this.getGui()) { this.createChildComponentsFromTags(this.getGui()); } }; Component.prototype.wireQuerySelectors = function () { var _this = this; if (!this.eGui) { return; } var thisNoType = this; this.iterateOverQuerySelectors(function (querySelector) { var setResult = function (result) { return thisNoType[querySelector.attributeName] = result; }; // if it's a ref selector, and match is on top level component, we return // the element. otherwise no way of components putting ref=xxx on the top // level element as querySelector only looks at children. var topLevelRefMatch = querySelector.refSelector && _this.eGui.getAttribute('ref') === querySelector.refSelector; if (topLevelRefMatch) { setResult(_this.eGui); } else { // otherwise use querySelector, which looks at children var resultOfQuery = _this.eGui.querySelector(querySelector.querySelector); if (resultOfQuery) { setResult(resultOfQuery.__agComponent || resultOfQuery); } } }); }; Component.prototype.getGui = function () { return this.eGui; }; Component.prototype.getFocusableElement = function () { return this.eGui; }; Component.prototype.setParentComponent = function (component) { this.parentComponent = component; }; Component.prototype.getParentComponent = function () { return this.parentComponent; }; // this method is for older code, that wants to provide the gui element, // it is not intended for this to be in ag-Stack Component.prototype.setGui = function (eGui) { this.eGui = eGui; }; Component.prototype.queryForHtmlElement = function (cssSelector) { return this.eGui.querySelector(cssSelector); }; Component.prototype.queryForHtmlInputElement = function (cssSelector) { return this.eGui.querySelector(cssSelector); }; Component.prototype.appendChild = function (newChild, container) { if (newChild == null) { return; } if (!container) { container = this.eGui; } if (isNodeOrElement(newChild)) { container.appendChild(newChild); } else { var childComponent = newChild; container.appendChild(childComponent.getGui()); } }; Component.prototype.isDisplayed = function () { return this.displayed; }; Component.prototype.setVisible = function (visible, options) { if (options === void 0) { options = {}; } if (visible !== this.visible) { this.visible = visible; var skipAriaHidden = options.skipAriaHidden; setVisible(this.eGui, visible, { skipAriaHidden: skipAriaHidden }); } }; Component.prototype.setDisplayed = function (displayed, options) { if (options === void 0) { options = {}; } if (displayed !== this.displayed) { this.displayed = displayed; var skipAriaHidden = options.skipAriaHidden; setDisplayed(this.eGui, displayed, { skipAriaHidden: skipAriaHidden }); var event_1 = { type: Component.EVENT_DISPLAYED_CHANGED, visible: this.displayed }; this.dispatchEvent(event_1); } }; Component.prototype.destroy = function () { if (this.tooltipFeature) { this.tooltipFeature = this.destroyBean(this.tooltipFeature); } if (this.parentComponent) { this.parentComponent = undefined; } var eGui = this.eGui; if (eGui && eGui.__agComponent) { eGui.__agComponent = undefined; } _super.prototype.destroy.call(this); }; Component.prototype.addGuiEventListener = function (event, listener, options) { var _this = this; this.eGui.addEventListener(event, listener, options); this.addDestroyFunc(function () { return _this.eGui.removeEventListener(event, listener); }); }; Component.prototype.addCssClass = function (className) { this.cssClassManager.addCssClass(className); }; Component.prototype.removeCssClass = function (className) { this.cssClassManager.removeCssClass(className); }; Component.prototype.containsCssClass = function (className) { return this.cssClassManager.containsCssClass(className); }; Component.prototype.addOrRemoveCssClass = function (className, addOrRemove) { this.cssClassManager.addOrRemoveCssClass(className, addOrRemove); }; Component.prototype.getAttribute = function (key) { var eGui = this.eGui; return eGui ? eGui.getAttribute(key) : null; }; Component.prototype.getRefElement = function (refName) { return this.queryForHtmlElement("[ref=\"" + refName + "\"]"); }; Component.EVENT_DISPLAYED_CHANGED = 'displayedChanged'; __decorate$d([ Autowired('agStackComponentsRegistry') ], Component.prototype, "agStackComponentsRegistry", void 0); __decorate$d([ PreConstruct ], Component.prototype, "preConstructOnComponent", null); __decorate$d([ PreConstruct ], Component.prototype, "createChildComponentsPreConstruct", null); return Component; }(BeanStub)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ function QuerySelector(selector) { return querySelectorFunc.bind(this, selector, undefined); } function RefSelector(ref) { return querySelectorFunc.bind(this, "[ref=" + ref + "]", ref); } function querySelectorFunc(selector, refSelector, classPrototype, methodOrAttributeName, index) { if (selector === null) { console.error('AG Grid: QuerySelector selector should not be null'); return; } if (typeof index === 'number') { console.error('AG Grid: QuerySelector should be on an attribute'); return; } addToObjectProps(classPrototype, 'querySelectors', { attributeName: methodOrAttributeName, querySelector: selector, refSelector: refSelector }); } // // think we should take this out, put property bindings on the // export function Method(eventName?: string): Function { // return methodFunc.bind(this, eventName); // } // // function methodFunc(alias: string, target: Object, methodName: string) { // if (alias === null) { // console.error("AG Grid: EventListener eventName should not be null"); // return; // } // // addToObjectProps(target, 'methods', { // methodName: methodName, // alias: alias // }); // } function addToObjectProps(target, key, value) { // it's an attribute on the class var props = getOrCreateProps$1(target, getFunctionName(target.constructor)); if (!props[key]) { props[key] = []; } props[key].push(value); } function getOrCreateProps$1(target, instanceName) { if (!target.__agComponentMetaData) { target.__agComponentMetaData = {}; } if (!target.__agComponentMetaData[instanceName]) { target.__agComponentMetaData[instanceName] = {}; } return target.__agComponentMetaData[instanceName]; } /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$8 = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __decorate$e = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; // optional floating filter for user provided filters - instead of providing a floating filter, // they can provide a getModelAsString() method on the filter instead. this class just displays // the string returned from getModelAsString() var ReadOnlyFloatingFilter = /** @class */ (function (_super) { __extends$8(ReadOnlyFloatingFilter, _super); function ReadOnlyFloatingFilter() { return _super.call(this, /* html */ "\n
\n \n
") || this; } // this is a user component, and IComponent has "public destroy()" as part of the interface. // so we need to override destroy() just to make the method public. ReadOnlyFloatingFilter.prototype.destroy = function () { _super.prototype.destroy.call(this); }; ReadOnlyFloatingFilter.prototype.init = function (params) { this.params = params; var displayName = this.columnModel.getDisplayNameForColumn(params.column, 'header', true); var translate = this.localeService.getLocaleTextFunc(); this.eFloatingFilterText .setDisabled(true) .setInputAriaLabel(displayName + " " + translate('ariaFilterInput', 'Filter Input')); }; ReadOnlyFloatingFilter.prototype.onParentModelChanged = function (parentModel) { var _this = this; if (!parentModel) { this.eFloatingFilterText.setValue(''); return; } this.params.parentFilterInstance(function (filterInstance) { // it would be nice to check if getModelAsString was present before creating this component, // however that is not possible, as React Hooks and VueJS don't attached the methods to the Filter until // AFTER the filter is created, not allowing inspection before this (we create floating filters as columns // are drawn, but the parent filters are only created when needed). if (filterInstance.getModelAsString) { var modelAsString = filterInstance.getModelAsString(parentModel); _this.eFloatingFilterText.setValue(modelAsString); } }); }; __decorate$e([ RefSelector('eFloatingFilterText') ], ReadOnlyFloatingFilter.prototype, "eFloatingFilterText", void 0); __decorate$e([ Autowired('columnModel') ], ReadOnlyFloatingFilter.prototype, "columnModel", void 0); return ReadOnlyFloatingFilter; }(Component)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ /** Provides sync access to async component. Date component can be lazy created - this class encapsulates * this by keeping value locally until DateComp has loaded, then passing DateComp the value. */ var DateCompWrapper = /** @class */ (function () { function DateCompWrapper(context, userComponentFactory, dateComponentParams, eParent) { var _this = this; this.alive = true; this.context = context; this.eParent = eParent; var compDetails = userComponentFactory.getDateCompDetails(dateComponentParams); var promise = compDetails.newAgStackInstance(); promise.then(function (dateComp) { // because async, check the filter still exists after component comes back if (!_this.alive) { context.destroyBean(dateComp); return; } _this.dateComp = dateComp; if (!dateComp) { return; } eParent.appendChild(dateComp.getGui()); if (dateComp.afterGuiAttached) { dateComp.afterGuiAttached(); } if (_this.tempValue) { dateComp.setDate(_this.tempValue); } if (_this.disabled != null) { _this.setDateCompDisabled(_this.disabled); } }); } DateCompWrapper.prototype.destroy = function () { this.alive = false; this.dateComp = this.context.destroyBean(this.dateComp); }; DateCompWrapper.prototype.getDate = function () { return this.dateComp ? this.dateComp.getDate() : this.tempValue; }; DateCompWrapper.prototype.setDate = function (value) { if (this.dateComp) { this.dateComp.setDate(value); } else { this.tempValue = value; } }; DateCompWrapper.prototype.setDisabled = function (disabled) { if (this.dateComp) { this.setDateCompDisabled(disabled); } else { this.disabled = disabled; } }; DateCompWrapper.prototype.setDisplayed = function (displayed) { setDisplayed(this.eParent, displayed); }; DateCompWrapper.prototype.setInputPlaceholder = function (placeholder) { if (this.dateComp && this.dateComp.setInputPlaceholder) { this.dateComp.setInputPlaceholder(placeholder); } }; DateCompWrapper.prototype.setInputAriaLabel = function (label) { if (this.dateComp && this.dateComp.setInputAriaLabel) { this.dateComp.setInputAriaLabel(label); } }; DateCompWrapper.prototype.afterGuiAttached = function (params) { if (this.dateComp && typeof this.dateComp.afterGuiAttached === 'function') { this.dateComp.afterGuiAttached(params); } }; DateCompWrapper.prototype.setDateCompDisabled = function (disabled) { if (this.dateComp == null) { return; } if (this.dateComp.setDisabled == null) { return; } this.dateComp.setDisabled(disabled); }; return DateCompWrapper; }()); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __assign$3 = (undefined && undefined.__assign) || function () { __assign$3 = Object.assign || function(t) { for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; } return t; }; return __assign$3.apply(this, arguments); }; /* Common logic for options, used by both filters and floating filters. */ var OptionsFactory = /** @class */ (function () { function OptionsFactory() { this.customFilterOptions = {}; } OptionsFactory.prototype.init = function (params, defaultOptions) { this.filterOptions = params.filterOptions || defaultOptions; this.mapCustomOptions(); this.selectDefaultItem(params); this.checkForDeprecatedParams(); }; OptionsFactory.prototype.checkForDeprecatedParams = function () { if (this.filterOptions.some(function (opt) { return typeof opt != 'string' && opt.test != null; })) { console.warn("AG Grid: [IFilterOptionDef] since v26.2.0, test() has been replaced with predicate()."); } if (this.filterOptions.some(function (opt) { return typeof opt != 'string' && opt.hideFilterInput != null; })) { console.warn("AG Grid: [IFilterOptionDef] since v26.2.0, useOfHideFilterInput has been replaced with numberOfInputs."); } }; OptionsFactory.prototype.getFilterOptions = function () { return this.filterOptions; }; OptionsFactory.prototype.mapCustomOptions = function () { var _this = this; if (!this.filterOptions) { return; } this.filterOptions.forEach(function (filterOption) { if (typeof filterOption === 'string') { return; } var requiredProperties = [['displayKey'], ['displayName'], ['predicate', 'test']]; var propertyCheck = function (keys) { if (!keys.some(function (key) { return filterOption[key] != null; })) { console.warn("AG Grid: ignoring FilterOptionDef as it doesn't contain one of '" + keys + "'"); return false; } return true; }; if (!requiredProperties.every(propertyCheck)) { _this.filterOptions = _this.filterOptions.filter(function (v) { return v === filterOption; }) || []; return; } var test = filterOption.test; var mutatedFilterOptions = __assign$3({}, filterOption); if (test != null && filterOption.predicate == null) { mutatedFilterOptions.predicate = function (v, cv) { return test(v[0], cv); }; delete mutatedFilterOptions.test; } if (mutatedFilterOptions.hideFilterInput && mutatedFilterOptions.numberOfInputs == null) { mutatedFilterOptions.numberOfInputs = 0; delete mutatedFilterOptions.hideFilterInput; } _this.customFilterOptions[filterOption.displayKey] = mutatedFilterOptions; }); }; OptionsFactory.prototype.selectDefaultItem = function (params) { if (params.defaultOption) { this.defaultOption = params.defaultOption; } else if (this.filterOptions.length >= 1) { var firstFilterOption = this.filterOptions[0]; if (typeof firstFilterOption === 'string') { this.defaultOption = firstFilterOption; } else if (firstFilterOption.displayKey) { this.defaultOption = firstFilterOption.displayKey; } else { console.warn("AG Grid: invalid FilterOptionDef supplied as it doesn't contain a 'displayKey'"); } } else { console.warn('AG Grid: no filter options for filter'); } }; OptionsFactory.prototype.getDefaultOption = function () { return this.defaultOption; }; OptionsFactory.prototype.getCustomOption = function (name) { return this.customFilterOptions[name]; }; return OptionsFactory; }()); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var DEFAULT_FILTER_LOCALE_TEXT = { applyFilter: 'Apply', clearFilter: 'Clear', resetFilter: 'Reset', cancelFilter: 'Cancel', textFilter: 'Text Filter', numberFilter: 'Number Filter', dateFilter: 'Date Filter', setFilter: 'Set Filter', filterOoo: 'Filter...', empty: 'Choose One', equals: 'Equals', notEqual: 'Not equal', lessThan: 'Less than', greaterThan: 'Greater than', inRange: 'In range', inRangeStart: 'From', inRangeEnd: 'To', lessThanOrEqual: 'Less than or equals', greaterThanOrEqual: 'Greater than or equals', contains: 'Contains', notContains: 'Not contains', startsWith: 'Starts with', endsWith: 'Ends with', blank: 'Blank', notBlank: 'Not blank', andCondition: 'AND', orCondition: 'OR', dateFormatOoo: 'yyyy-mm-dd', }; /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$9 = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __assign$4 = (undefined && undefined.__assign) || function () { __assign$4 = Object.assign || function(t) { for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; } return t; }; return __assign$4.apply(this, arguments); }; var __decorate$f = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var ManagedFocusFeature = /** @class */ (function (_super) { __extends$9(ManagedFocusFeature, _super); function ManagedFocusFeature(eFocusableElement, callbacks) { if (callbacks === void 0) { callbacks = {}; } var _this = _super.call(this) || this; _this.eFocusableElement = eFocusableElement; _this.callbacks = callbacks; _this.callbacks = __assign$4({ shouldStopEventPropagation: function () { return false; }, onTabKeyDown: function (e) { if (e.defaultPrevented) { return; } var nextRoot = _this.focusService.findNextFocusableElement(_this.eFocusableElement, false, e.shiftKey); if (!nextRoot) { return; } nextRoot.focus(); e.preventDefault(); } }, callbacks); return _this; } ManagedFocusFeature.prototype.postConstruct = function () { this.eFocusableElement.classList.add(ManagedFocusFeature.FOCUS_MANAGED_CLASS); this.addKeyDownListeners(this.eFocusableElement); if (this.callbacks.onFocusIn) { this.addManagedListener(this.eFocusableElement, 'focusin', this.callbacks.onFocusIn); } if (this.callbacks.onFocusOut) { this.addManagedListener(this.eFocusableElement, 'focusout', this.callbacks.onFocusOut); } }; ManagedFocusFeature.prototype.addKeyDownListeners = function (eGui) { var _this = this; this.addManagedListener(eGui, 'keydown', function (e) { if (e.defaultPrevented || isStopPropagationForAgGrid(e)) { return; } if (_this.callbacks.shouldStopEventPropagation(e)) { stopPropagationForAgGrid(e); return; } if (e.key === KeyCode.TAB) { _this.callbacks.onTabKeyDown(e); } else if (_this.callbacks.handleKeyDown) { _this.callbacks.handleKeyDown(e); } }); }; ManagedFocusFeature.FOCUS_MANAGED_CLASS = 'ag-focus-managed'; __decorate$f([ Autowired('focusService') ], ManagedFocusFeature.prototype, "focusService", void 0); __decorate$f([ PostConstruct ], ManagedFocusFeature.prototype, "postConstruct", null); return ManagedFocusFeature; }(BeanStub)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$a = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __decorate$g = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var RESIZE_CONTAINER_STYLE = 'ag-resizer-wrapper'; var RESIZE_TEMPLATE = /* html */ "
\n
\n
\n
\n
\n
\n
\n
\n
\n
"; var PositionableFeature = /** @class */ (function (_super) { __extends$a(PositionableFeature, _super); function PositionableFeature(element, config) { var _this = _super.call(this) || this; _this.element = element; _this.dragStartPosition = { x: 0, y: 0 }; _this.position = { x: 0, y: 0 }; _this.lastSize = { width: -1, height: -1 }; _this.positioned = false; _this.resizersAdded = false; _this.resizeListeners = []; _this.boundaryEl = null; _this.isResizing = false; _this.isMoving = false; _this.resizable = {}; _this.movable = false; _this.currentResizer = null; _this.config = Object.assign({}, { popup: false }, config); return _this; } PositionableFeature.prototype.center = function () { var _a = this.offsetParent, clientHeight = _a.clientHeight, clientWidth = _a.clientWidth; var x = (clientWidth / 2) - (this.getWidth() / 2); var y = (clientHeight / 2) - (this.getHeight() / 2); this.offsetElement(x, y); }; PositionableFeature.prototype.initialisePosition = function () { var _a = this.config, centered = _a.centered, forcePopupParentAsOffsetParent = _a.forcePopupParentAsOffsetParent, minWidth = _a.minWidth, width = _a.width, minHeight = _a.minHeight, height = _a.height, x = _a.x, y = _a.y; if (!this.offsetParent) { this.setOffsetParent(); } var computedMinHeight = 0; var computedMinWidth = 0; // here we don't use the main offset parent but the element's offsetParent // in order to calculated the minWidth and minHeight correctly var isVisible = !!this.element.offsetParent; if (isVisible) { var boundaryEl = this.findBoundaryElement(); var offsetParentComputedStyles = window.getComputedStyle(boundaryEl); if (offsetParentComputedStyles.minWidth != null) { var paddingWidth = boundaryEl.offsetWidth - this.element.offsetWidth; computedMinWidth = parseInt(offsetParentComputedStyles.minWidth, 10) - paddingWidth; } if (offsetParentComputedStyles.minHeight != null) { var paddingHeight = boundaryEl.offsetHeight - this.element.offsetHeight; computedMinHeight = parseInt(offsetParentComputedStyles.minHeight, 10) - paddingHeight; } } this.minHeight = minHeight || computedMinHeight; this.minWidth = minWidth || computedMinWidth; if (width) { this.setWidth(width); } if (height) { this.setHeight(height); } if (!width || !height) { this.refreshSize(); } if (centered) { this.center(); } else if (x || y) { this.offsetElement(x, y); } else if (isVisible && forcePopupParentAsOffsetParent && this.boundaryEl) { var top_1 = parseFloat(this.boundaryEl.style.top); var left = parseFloat(this.boundaryEl.style.left); this.offsetElement(isNaN(left) ? 0 : left, isNaN(top_1) ? 0 : top_1); } this.positioned = !!this.offsetParent; }; PositionableFeature.prototype.isPositioned = function () { return this.positioned; }; PositionableFeature.prototype.getPosition = function () { return this.position; }; PositionableFeature.prototype.setMovable = function (movable, moveElement) { if (!this.config.popup || movable === this.movable) { return; } this.movable = movable; var params = this.moveElementDragListener || { eElement: moveElement, onDragStart: this.onMoveStart.bind(this), onDragging: this.onMove.bind(this), onDragStop: this.onMoveEnd.bind(this) }; if (movable) { this.dragService.addDragSource(params); this.moveElementDragListener = params; } else { this.dragService.removeDragSource(params); this.moveElementDragListener = undefined; } }; PositionableFeature.prototype.setResizable = function (resizable) { var _this = this; this.clearResizeListeners(); if (resizable) { this.addResizers(); } else { this.removeResizers(); } if (typeof resizable === 'boolean') { if (resizable === false) { return; } resizable = { topLeft: resizable, top: resizable, topRight: resizable, right: resizable, bottomRight: resizable, bottom: resizable, bottomLeft: resizable, left: resizable }; } Object.keys(resizable).forEach(function (side) { var resizableStructure = resizable; var isSideResizable = !!resizableStructure[side]; var resizerEl = _this.getResizerElement(side); var params = { dragStartPixels: 0, eElement: resizerEl, onDragStart: function (e) { return _this.onResizeStart(e, side); }, onDragging: _this.onResize.bind(_this), onDragStop: function (e) { return _this.onResizeEnd(e, side); }, }; if (isSideResizable || (!_this.isAlive() && !isSideResizable)) { if (isSideResizable) { _this.dragService.addDragSource(params); _this.resizeListeners.push(params); resizerEl.style.pointerEvents = 'all'; } else { resizerEl.style.pointerEvents = 'none'; } _this.resizable[side] = isSideResizable; } }); }; PositionableFeature.prototype.removeSizeFromEl = function () { this.element.style.removeProperty('height'); this.element.style.removeProperty('width'); this.element.style.removeProperty('flex'); }; PositionableFeature.prototype.restoreLastSize = function () { this.element.style.flex = '0 0 auto'; var _a = this.lastSize, height = _a.height, width = _a.width; if (width !== -1) { this.element.style.width = width + "px"; } if (height !== -1) { this.element.style.height = height + "px"; } }; PositionableFeature.prototype.getHeight = function () { return this.element.offsetHeight; }; PositionableFeature.prototype.setHeight = function (height) { var _a = this.config, popup = _a.popup, forcePopupParentAsOffsetParent = _a.forcePopupParentAsOffsetParent; var eGui = this.element; var isPercent = false; if (typeof height === 'string' && height.indexOf('%') !== -1) { setFixedHeight(eGui, height); height = getAbsoluteHeight(eGui); isPercent = true; } else if (this.positioned) { var elRect = this.element.getBoundingClientRect(); var parentRect = this.offsetParent.getBoundingClientRect(); height = Math.max(this.minHeight, height); var clientHeight = this.offsetParent.clientHeight; if (clientHeight) { var yPosition = popup ? this.position.y : elRect.top; var parentTop = popup ? 0 : parentRect.top; // When `forcePopupParentAsOffsetParent`, there may be elements that appear after the resizable element, but aren't included in the height. // Take these into account here var additionalHeight = 0; if (forcePopupParentAsOffsetParent && this.boundaryEl) { var bottom = this.boundaryEl.getBoundingClientRect().bottom; additionalHeight = bottom - elRect.bottom; } var availableHeight = clientHeight + parentTop - yPosition - additionalHeight; if (height > availableHeight) { height = availableHeight; } } } if (this.getHeight() === height) { return; } if (!isPercent) { if (popup) { setFixedHeight(eGui, height); } else { eGui.style.height = height + "px"; eGui.style.flex = '0 0 auto'; this.lastSize.height = typeof height === 'number' ? height : parseFloat(height); } } else { eGui.style.maxHeight = 'unset'; eGui.style.minHeight = 'unset'; } }; PositionableFeature.prototype.getWidth = function () { return this.element.offsetWidth; }; PositionableFeature.prototype.setWidth = function (width) { var eGui = this.element; var popup = this.config.popup; var isPercent = false; if (typeof width === 'string' && width.indexOf('%') !== -1) { setFixedWidth(eGui, width); width = getAbsoluteWidth(eGui); isPercent = true; } else if (this.positioned) { width = Math.max(this.minWidth, width); var clientWidth = this.offsetParent.clientWidth; var xPosition = popup ? this.position.x : this.element.getBoundingClientRect().left; if (clientWidth && (width + xPosition > clientWidth)) { width = clientWidth - xPosition; } } if (this.getWidth() === width) { return; } if (!isPercent) { if (this.config.popup) { setFixedWidth(eGui, width); } else { eGui.style.width = width + "px"; eGui.style.flex = ' unset'; this.lastSize.width = typeof width === 'number' ? width : parseFloat(width); } } else { eGui.style.maxWidth = 'unset'; eGui.style.minWidth = 'unset'; } }; PositionableFeature.prototype.offsetElement = function (x, y) { if (x === void 0) { x = 0; } if (y === void 0) { y = 0; } var ePopup = this.config.forcePopupParentAsOffsetParent ? this.boundaryEl : this.element; this.popupService.positionPopup({ ePopup: ePopup, keepWithinBounds: true, skipObserver: this.movable || this.isResizable(), updatePosition: function () { return ({ x: x, y: y }); } }); this.setPosition(parseFloat(ePopup.style.left), parseFloat(ePopup.style.top)); }; PositionableFeature.prototype.setPosition = function (x, y) { this.position.x = x; this.position.y = y; }; PositionableFeature.prototype.updateDragStartPosition = function (x, y) { this.dragStartPosition = { x: x, y: y }; }; PositionableFeature.prototype.calculateMouseMovement = function (params) { var e = params.e, isLeft = params.isLeft, isTop = params.isTop, anywhereWithin = params.anywhereWithin, topBuffer = params.topBuffer; var xDiff = e.clientX - this.dragStartPosition.x; var yDiff = e.clientY - this.dragStartPosition.y; var movementX = this.shouldSkipX(e, !!isLeft, !!anywhereWithin, xDiff) ? 0 : xDiff; var movementY = this.shouldSkipY(e, !!isTop, topBuffer, yDiff) ? 0 : yDiff; return { movementX: movementX, movementY: movementY }; }; PositionableFeature.prototype.shouldSkipX = function (e, isLeft, anywhereWithin, diff) { var elRect = this.element.getBoundingClientRect(); var parentRect = this.offsetParent.getBoundingClientRect(); var boundaryElRect = this.boundaryEl.getBoundingClientRect(); var xPosition = this.config.popup ? this.position.x : elRect.left; // skip if cursor is outside of popupParent horizontally var skipX = ((xPosition <= 0 && parentRect.left >= e.clientX) || (parentRect.right <= e.clientX && parentRect.right <= boundaryElRect.right)); if (skipX) { return true; } if (isLeft) { skipX = ( // skip if we are moving to the left and the cursor // is positioned to the right of the left side anchor (diff < 0 && e.clientX > xPosition + parentRect.left) || // skip if we are moving to the right and the cursor // is positioned to the left of the dialog (diff > 0 && e.clientX < xPosition + parentRect.left)); } else { if (anywhereWithin) { // if anywhereWithin is true, we allow to move // as long as the cursor is within the dialog skipX = ((diff < 0 && e.clientX > boundaryElRect.right) || (diff > 0 && e.clientX < xPosition + parentRect.left)); } else { skipX = ( // if the movement is bound to the right side of the dialog // we skip if we are moving to the left and the cursor // is to the right of the dialog (diff < 0 && e.clientX > boundaryElRect.right) || // or skip if we are moving to the right and the cursor // is to the left of the right side anchor (diff > 0 && e.clientX < boundaryElRect.right)); } } return skipX; }; PositionableFeature.prototype.shouldSkipY = function (e, isTop, topBuffer, diff) { if (topBuffer === void 0) { topBuffer = 0; } var elRect = this.element.getBoundingClientRect(); var parentRect = this.offsetParent.getBoundingClientRect(); var boundaryElRect = this.boundaryEl.getBoundingClientRect(); var yPosition = this.config.popup ? this.position.y : elRect.top; // skip if cursor is outside of popupParent vertically var skipY = ((yPosition <= 0 && parentRect.top >= e.clientY) || (parentRect.bottom <= e.clientY && parentRect.bottom <= boundaryElRect.bottom)); if (skipY) { return true; } if (isTop) { skipY = ( // skip if we are moving to towards top and the cursor is // below the top anchor + topBuffer // note: topBuffer is used when moving the dialog using the title bar (diff < 0 && e.clientY > yPosition + parentRect.top + topBuffer) || // skip if we are moving to the bottom and the cursor is // above the top anchor (diff > 0 && e.clientY < yPosition + parentRect.top)); } else { skipY = ( // skip if we are moving towards the top and the cursor // is below the bottom anchor (diff < 0 && e.clientY > boundaryElRect.bottom) || // skip if we are moving towards the bottom and the cursor // is above the bottom anchor (diff > 0 && e.clientY < boundaryElRect.bottom)); } return skipY; }; PositionableFeature.prototype.createResizeMap = function () { var eGui = this.element; this.resizerMap = { topLeft: { element: eGui.querySelector('[ref=eTopLeftResizer]') }, top: { element: eGui.querySelector('[ref=eTopResizer]') }, topRight: { element: eGui.querySelector('[ref=eTopRightResizer]') }, right: { element: eGui.querySelector('[ref=eRightResizer]') }, bottomRight: { element: eGui.querySelector('[ref=eBottomRightResizer]') }, bottom: { element: eGui.querySelector('[ref=eBottomResizer]') }, bottomLeft: { element: eGui.querySelector('[ref=eBottomLeftResizer]') }, left: { element: eGui.querySelector('[ref=eLeftResizer]') } }; }; PositionableFeature.prototype.addResizers = function () { if (this.resizersAdded) { return; } var eGui = this.element; if (!eGui) { return; } var parser = new DOMParser(); var resizers = parser.parseFromString(RESIZE_TEMPLATE, 'text/html').body; eGui.appendChild(resizers.firstChild); this.createResizeMap(); this.resizersAdded = true; }; PositionableFeature.prototype.removeResizers = function () { this.resizerMap = undefined; var resizerEl = this.element.querySelector("." + RESIZE_CONTAINER_STYLE); if (resizerEl) { this.element.removeChild(resizerEl); } this.resizersAdded = false; }; PositionableFeature.prototype.getResizerElement = function (side) { return this.resizerMap[side].element; }; PositionableFeature.prototype.onResizeStart = function (e, side) { this.boundaryEl = this.findBoundaryElement(); if (!this.positioned) { this.initialisePosition(); } this.currentResizer = { isTop: !!side.match(/top/i), isRight: !!side.match(/right/i), isBottom: !!side.match(/bottom/i), isLeft: !!side.match(/left/i), }; this.element.classList.add('ag-resizing'); this.resizerMap[side].element.classList.add('ag-active'); var _a = this.config, popup = _a.popup, forcePopupParentAsOffsetParent = _a.forcePopupParentAsOffsetParent; if (!popup && !forcePopupParentAsOffsetParent) { this.applySizeToSiblings(this.currentResizer.isBottom || this.currentResizer.isTop); } this.isResizing = true; this.updateDragStartPosition(e.clientX, e.clientY); }; PositionableFeature.prototype.getSiblings = function () { var element = this.element; var parent = element.parentElement; if (!parent) { return null; } return Array.prototype.slice.call(parent.children).filter(function (el) { return !el.classList.contains('ag-hidden'); }); }; PositionableFeature.prototype.getMinSizeOfSiblings = function () { var siblings = this.getSiblings() || []; var height = 0; var width = 0; for (var i = 0; i < siblings.length; i++) { var currentEl = siblings[i]; var isFlex = !!currentEl.style.flex && currentEl.style.flex !== '0 0 auto'; if (currentEl === this.element) { continue; } var nextHeight = this.minHeight || 0; var nextWidth = this.minWidth || 0; if (isFlex) { var computedStyle = window.getComputedStyle(currentEl); if (computedStyle.minHeight) { nextHeight = parseInt(computedStyle.minHeight, 10); } if (computedStyle.minWidth) { nextWidth = parseInt(computedStyle.minWidth, 10); } } else { nextHeight = currentEl.offsetHeight; nextWidth = currentEl.offsetWidth; } height += nextHeight; width += nextWidth; } return { height: height, width: width }; }; PositionableFeature.prototype.applySizeToSiblings = function (vertical) { var containerToFlex = null; var siblings = this.getSiblings(); if (!siblings) { return; } for (var i = 0; i < siblings.length; i++) { var el = siblings[i]; if (el === containerToFlex) { continue; } if (vertical) { el.style.height = el.offsetHeight + "px"; } else { el.style.width = el.offsetWidth + "px"; } el.style.flex = '0 0 auto'; if (el === this.element) { containerToFlex = siblings[i + 1]; } } if (containerToFlex) { containerToFlex.style.removeProperty('height'); containerToFlex.style.removeProperty('min-height'); containerToFlex.style.removeProperty('max-height'); containerToFlex.style.flex = '1 1 auto'; } }; PositionableFeature.prototype.isResizable = function () { return Object.values(this.resizable).some(function (value) { return value; }); }; PositionableFeature.prototype.onResize = function (e) { if (!this.isResizing || !this.currentResizer) { return; } var _a = this.config, popup = _a.popup, forcePopupParentAsOffsetParent = _a.forcePopupParentAsOffsetParent; var _b = this.currentResizer, isTop = _b.isTop, isRight = _b.isRight, isBottom = _b.isBottom, isLeft = _b.isLeft; var isHorizontal = isRight || isLeft; var isVertical = isBottom || isTop; var _c = this.calculateMouseMovement({ e: e, isLeft: isLeft, isTop: isTop }), movementX = _c.movementX, movementY = _c.movementY; var xPosition = this.position.x; var yPosition = this.position.y; var offsetLeft = 0; var offsetTop = 0; if (isHorizontal && movementX) { var direction = isLeft ? -1 : 1; var oldWidth = this.getWidth(); var newWidth = oldWidth + (movementX * direction); var skipWidth = false; if (isLeft) { offsetLeft = oldWidth - newWidth; if (xPosition + offsetLeft <= 0 || newWidth <= this.minWidth) { skipWidth = true; offsetLeft = 0; } } if (!skipWidth) { this.setWidth(newWidth); } } if (isVertical && movementY) { var direction = isTop ? -1 : 1; var oldHeight = this.getHeight(); var newHeight = oldHeight + (movementY * direction); var skipHeight = false; if (isTop) { offsetTop = oldHeight - newHeight; if (yPosition + offsetTop <= 0 || newHeight <= this.minHeight) { skipHeight = true; offsetTop = 0; } } else { // do not let the size of all siblings be higher than the parent container if (!this.config.popup && !this.config.forcePopupParentAsOffsetParent && oldHeight < newHeight && (this.getMinSizeOfSiblings().height + newHeight) > this.element.parentElement.offsetHeight) { skipHeight = true; } } if (!skipHeight) { this.setHeight(newHeight); } } this.updateDragStartPosition(e.clientX, e.clientY); if ((popup || forcePopupParentAsOffsetParent) && offsetLeft || offsetTop) { this.offsetElement(xPosition + offsetLeft, yPosition + offsetTop); } }; PositionableFeature.prototype.onResizeEnd = function (e, side) { this.isResizing = false; this.currentResizer = null; this.boundaryEl = null; var params = { type: 'resize', api: this.gridOptionsService.api, columnApi: this.gridOptionsService.columnApi }; this.element.classList.remove('ag-resizing'); this.resizerMap[side].element.classList.remove('ag-active'); this.dispatchEvent(params); }; PositionableFeature.prototype.refreshSize = function () { var eGui = this.element; if (this.config.popup) { if (!this.config.width) { this.setWidth(eGui.offsetWidth); } if (!this.config.height) { this.setHeight(eGui.offsetHeight); } } }; PositionableFeature.prototype.onMoveStart = function (e) { this.boundaryEl = this.findBoundaryElement(); if (!this.positioned) { this.initialisePosition(); } this.isMoving = true; this.element.classList.add('ag-moving'); this.updateDragStartPosition(e.clientX, e.clientY); }; PositionableFeature.prototype.onMove = function (e) { if (!this.isMoving) { return; } var _a = this.position, x = _a.x, y = _a.y; var topBuffer; if (this.config.calculateTopBuffer) { topBuffer = this.config.calculateTopBuffer(); } var _b = this.calculateMouseMovement({ e: e, isTop: true, anywhereWithin: true, topBuffer: topBuffer }), movementX = _b.movementX, movementY = _b.movementY; this.offsetElement(x + movementX, y + movementY); this.updateDragStartPosition(e.clientX, e.clientY); }; PositionableFeature.prototype.onMoveEnd = function () { this.isMoving = false; this.boundaryEl = null; this.element.classList.remove('ag-moving'); }; PositionableFeature.prototype.setOffsetParent = function () { if (this.config.forcePopupParentAsOffsetParent) { this.offsetParent = this.popupService.getPopupParent(); } else { this.offsetParent = this.element.offsetParent; } }; PositionableFeature.prototype.findBoundaryElement = function () { var el = this.element; while (el) { if (window.getComputedStyle(el).position !== 'static') { return el; } el = el.parentElement; } return this.element; }; PositionableFeature.prototype.clearResizeListeners = function () { while (this.resizeListeners.length) { var params = this.resizeListeners.pop(); this.dragService.removeDragSource(params); } }; PositionableFeature.prototype.destroy = function () { _super.prototype.destroy.call(this); if (this.moveElementDragListener) { this.dragService.removeDragSource(this.moveElementDragListener); } this.clearResizeListeners(); this.removeResizers(); }; __decorate$g([ Autowired('popupService') ], PositionableFeature.prototype, "popupService", void 0); __decorate$g([ Autowired('dragService') ], PositionableFeature.prototype, "dragService", void 0); return PositionableFeature; }(BeanStub)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$b = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __decorate$h = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; /** * Contains common logic to all provided filters (apply button, clear button, etc). * All the filters that come with AG Grid extend this class. User filters do not * extend this class. * * @param M type of filter-model managed by the concrete sub-class that extends this type * @param V type of value managed by the concrete sub-class that extends this type */ var ProvidedFilter = /** @class */ (function (_super) { __extends$b(ProvidedFilter, _super); function ProvidedFilter(filterNameKey) { var _this = _super.call(this) || this; _this.filterNameKey = filterNameKey; _this.applyActive = false; _this.hidePopup = null; _this.debouncePending = false; // after the user hits 'apply' the model gets copied to here. this is then the model that we use for // all filtering. so if user changes UI but doesn't hit apply, then the UI will be out of sync with this model. // this is what we want, as the UI should only become the 'active' filter once it's applied. when apply is // inactive, this model will be in sync (following the debounce ms). if the UI is not a valid filter // (eg the value is missing so nothing to filter on, or for set filter all checkboxes are checked so filter // not active) then this appliedModel will be null/undefined. _this.appliedModel = null; return _this; } ProvidedFilter.prototype.postConstruct = function () { this.resetTemplate(); // do this first to create the DOM this.createManagedBean(new ManagedFocusFeature(this.getFocusableElement(), { handleKeyDown: this.handleKeyDown.bind(this) })); this.positionableFeature = new PositionableFeature(this.getPositionableElement(), { forcePopupParentAsOffsetParent: true }); this.createBean(this.positionableFeature); }; // override ProvidedFilter.prototype.handleKeyDown = function (e) { }; ProvidedFilter.prototype.getFilterTitle = function () { return this.translate(this.filterNameKey); }; ProvidedFilter.prototype.isFilterActive = function () { // filter is active if we have a valid applied model return !!this.appliedModel; }; ProvidedFilter.prototype.resetTemplate = function (paramsMap) { var eGui = this.getGui(); if (eGui) { eGui.removeEventListener('submit', this.onFormSubmit); } var templateString = /* html */ "\n
\n
\n " + this.createBodyTemplate() + "\n
\n
"; this.setTemplate(templateString, paramsMap); eGui = this.getGui(); if (eGui) { eGui.addEventListener('submit', this.onFormSubmit); } }; ProvidedFilter.prototype.isReadOnly = function () { return !!this.providedFilterParams.readOnly; }; ProvidedFilter.prototype.init = function (params) { var _this = this; this.setParams(params); this.resetUiToDefaults(true).then(function () { _this.updateUiVisibility(); _this.setupOnBtApplyDebounce(); }); }; ProvidedFilter.prototype.setParams = function (params) { this.providedFilterParams = params; this.applyActive = ProvidedFilter.isUseApplyButton(params); this.createButtonPanel(); }; ProvidedFilter.prototype.createButtonPanel = function () { var _this = this; var buttons = this.providedFilterParams.buttons; if (!buttons || buttons.length < 1 || this.isReadOnly()) { return; } var eButtonsPanel = document.createElement('div'); eButtonsPanel.classList.add('ag-filter-apply-panel'); var addButton = function (type) { var text; var clickListener; switch (type) { case 'apply': text = _this.translate('applyFilter'); clickListener = function (e) { return _this.onBtApply(false, false, e); }; break; case 'clear': text = _this.translate('clearFilter'); clickListener = function () { return _this.onBtClear(); }; break; case 'reset': text = _this.translate('resetFilter'); clickListener = function () { return _this.onBtReset(); }; break; case 'cancel': text = _this.translate('cancelFilter'); clickListener = function (e) { _this.onBtCancel(e); }; break; default: console.warn('AG Grid: Unknown button type specified'); return; } var buttonType = type === 'apply' ? 'submit' : 'button'; var button = loadTemplate( /* html */ "" + text + "\n "); eButtonsPanel.appendChild(button); _this.addManagedListener(button, 'click', clickListener); }; convertToSet(buttons).forEach(function (type) { return addButton(type); }); this.getGui().appendChild(eButtonsPanel); }; // subclasses can override this to provide alternative debounce defaults ProvidedFilter.prototype.getDefaultDebounceMs = function () { return 0; }; ProvidedFilter.prototype.setupOnBtApplyDebounce = function () { var _this = this; var debounceMs = ProvidedFilter.getDebounceMs(this.providedFilterParams, this.getDefaultDebounceMs()); var debounceFunc = debounce(this.checkApplyDebounce.bind(this), debounceMs); this.onBtApplyDebounce = function () { _this.debouncePending = true; debounceFunc(); }; }; ProvidedFilter.prototype.checkApplyDebounce = function () { if (this.debouncePending) { // May already have been applied, so don't apply again (e.g. closing filter before debounce timeout) this.debouncePending = false; this.onBtApply(); } }; ProvidedFilter.prototype.getModel = function () { return this.appliedModel ? this.appliedModel : null; }; ProvidedFilter.prototype.setModel = function (model) { var _this = this; var promise = model != null ? this.setModelIntoUi(model) : this.resetUiToDefaults(); return promise.then(function () { _this.updateUiVisibility(); // we set the model from the GUI, rather than the provided model, // so the model is consistent, e.g. handling of null/undefined will be the same, // or if model is case insensitive, then casing is removed. _this.applyModel('api'); }); }; ProvidedFilter.prototype.onBtCancel = function (e) { var _this = this; this.resetUiToActiveModel(this.getModel(), function () { if (_this.providedFilterParams.closeOnApply) { _this.close(e); } }); }; ProvidedFilter.prototype.resetUiToActiveModel = function (currentModel, afterUiUpdatedFunc) { var _this = this; var afterAppliedFunc = function () { _this.onUiChanged(false, 'prevent'); afterUiUpdatedFunc === null || afterUiUpdatedFunc === void 0 ? void 0 : afterUiUpdatedFunc(); }; if (currentModel != null) { this.setModelIntoUi(currentModel).then(afterAppliedFunc); } else { this.resetUiToDefaults().then(afterAppliedFunc); } }; ProvidedFilter.prototype.onBtClear = function () { var _this = this; this.resetUiToDefaults().then(function () { return _this.onUiChanged(); }); }; ProvidedFilter.prototype.onBtReset = function () { this.onBtClear(); this.onBtApply(); }; /** * Applies changes made in the UI to the filter, and returns true if the model has changed. */ ProvidedFilter.prototype.applyModel = function (source) { var newModel = this.getModelFromUi(); if (!this.isModelValid(newModel)) { return false; } var previousModel = this.appliedModel; this.appliedModel = newModel; // models can be same if user pasted same content into text field, or maybe just changed the case // and it's a case insensitive filter return !this.areModelsEqual(previousModel, newModel); }; ProvidedFilter.prototype.isModelValid = function (model) { return true; }; ProvidedFilter.prototype.onFormSubmit = function (e) { e.preventDefault(); }; ProvidedFilter.prototype.onBtApply = function (afterFloatingFilter, afterDataChange, e) { if (afterFloatingFilter === void 0) { afterFloatingFilter = false; } if (afterDataChange === void 0) { afterDataChange = false; } // Prevent form submission if (e) { e.preventDefault(); } if (this.applyModel(afterDataChange ? 'rowDataUpdated' : 'ui')) { // the floating filter uses 'afterFloatingFilter' info, so it doesn't refresh after filter changed if change // came from floating filter this.providedFilterParams.filterChangedCallback({ afterFloatingFilter: afterFloatingFilter, afterDataChange: afterDataChange }); } var closeOnApply = this.providedFilterParams.closeOnApply; // only close if an apply button is visible, otherwise we'd be closing every time a change was made! if (closeOnApply && this.applyActive && !afterFloatingFilter && !afterDataChange) { this.close(e); } }; ProvidedFilter.prototype.onNewRowsLoaded = function () { }; ProvidedFilter.prototype.close = function (e) { if (!this.hidePopup) { return; } var keyboardEvent = e; var key = keyboardEvent && keyboardEvent.key; var params; if (key === 'Enter' || key === 'Space') { params = { keyboardEvent: keyboardEvent }; } this.hidePopup(params); this.hidePopup = null; }; /** * By default, if the change came from a floating filter it will be applied immediately, otherwise if there is no * apply button it will be applied after a debounce, otherwise it will not be applied at all. This behaviour can * be adjusted by using the apply parameter. */ ProvidedFilter.prototype.onUiChanged = function (fromFloatingFilter, apply) { if (fromFloatingFilter === void 0) { fromFloatingFilter = false; } this.updateUiVisibility(); this.providedFilterParams.filterModifiedCallback(); if (this.applyActive && !this.isReadOnly()) { var isValid = this.isModelValid(this.getModelFromUi()); setDisabled(this.getRefElement('applyFilterButton'), !isValid); } if ((fromFloatingFilter && !apply) || apply === 'immediately') { this.onBtApply(fromFloatingFilter); } else if ((!this.applyActive && !apply) || apply === 'debounce') { this.onBtApplyDebounce(); } }; ProvidedFilter.prototype.afterGuiAttached = function (params) { if ((params === null || params === void 0 ? void 0 : params.container) === 'floatingFilter') { this.positionableFeature.restoreLastSize(); this.positionableFeature.setResizable(this.gridOptionsService.is('enableRtl') ? { bottom: true, bottomLeft: true, left: true } : { bottom: true, bottomRight: true, right: true }); } else { this.positionableFeature.removeSizeFromEl(); this.positionableFeature.setResizable(false); } if (params == null) { return; } this.hidePopup = params.hidePopup; }; ProvidedFilter.prototype.afterGuiDetached = function () { this.checkApplyDebounce(); }; // static, as used by floating filter also ProvidedFilter.getDebounceMs = function (params, debounceDefault) { if (ProvidedFilter.isUseApplyButton(params)) { if (params.debounceMs != null) { console.warn('AG Grid: debounceMs is ignored when apply button is present'); } return 0; } return params.debounceMs != null ? params.debounceMs : debounceDefault; }; // static, as used by floating filter also ProvidedFilter.isUseApplyButton = function (params) { return !!params.buttons && params.buttons.indexOf('apply') >= 0; }; ProvidedFilter.prototype.destroy = function () { var eGui = this.getGui(); if (eGui) { eGui.removeEventListener('submit', this.onFormSubmit); } this.hidePopup = null; _super.prototype.destroy.call(this); }; ProvidedFilter.prototype.translate = function (key) { var translate = this.localeService.getLocaleTextFunc(); return translate(key, DEFAULT_FILTER_LOCALE_TEXT[key]); }; ProvidedFilter.prototype.getCellValue = function (rowNode) { var _a = this.providedFilterParams, api = _a.api, colDef = _a.colDef, column = _a.column, columnApi = _a.columnApi, context = _a.context; return this.providedFilterParams.valueGetter({ api: api, colDef: colDef, column: column, columnApi: columnApi, context: context, data: rowNode.data, getValue: function (field) { return rowNode.data[field]; }, node: rowNode, }); }; // override to control positionable feature ProvidedFilter.prototype.getPositionableElement = function () { return this.eFilterBody; }; __decorate$h([ Autowired('rowModel') ], ProvidedFilter.prototype, "rowModel", void 0); __decorate$h([ RefSelector('eFilterBody') ], ProvidedFilter.prototype, "eFilterBody", void 0); __decorate$h([ PostConstruct ], ProvidedFilter.prototype, "postConstruct", null); return ProvidedFilter; }(Component)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$c = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __decorate$i = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var AgAbstractLabel = /** @class */ (function (_super) { __extends$c(AgAbstractLabel, _super); function AgAbstractLabel(config, template) { var _this = _super.call(this, template) || this; _this.labelSeparator = ''; _this.labelAlignment = 'left'; _this.disabled = false; _this.label = ''; _this.config = config || {}; return _this; } AgAbstractLabel.prototype.postConstruct = function () { this.addCssClass('ag-labeled'); this.eLabel.classList.add('ag-label'); var _a = this.config, labelSeparator = _a.labelSeparator, label = _a.label, labelWidth = _a.labelWidth, labelAlignment = _a.labelAlignment; if (labelSeparator != null) { this.setLabelSeparator(labelSeparator); } if (label != null) { this.setLabel(label); } if (labelWidth != null) { this.setLabelWidth(labelWidth); } this.setLabelAlignment(labelAlignment || this.labelAlignment); this.refreshLabel(); }; AgAbstractLabel.prototype.refreshLabel = function () { clearElement(this.eLabel); if (typeof this.label === 'string') { this.eLabel.innerText = this.label + this.labelSeparator; } else if (this.label) { this.eLabel.appendChild(this.label); } if (this.label === '') { setDisplayed(this.eLabel, false); setAriaRole(this.eLabel, 'presentation'); } else { setDisplayed(this.eLabel, true); setAriaRole(this.eLabel, null); } }; AgAbstractLabel.prototype.setLabelSeparator = function (labelSeparator) { if (this.labelSeparator === labelSeparator) { return this; } this.labelSeparator = labelSeparator; if (this.label != null) { this.refreshLabel(); } return this; }; AgAbstractLabel.prototype.getLabelId = function () { this.eLabel.id = this.eLabel.id || "ag-" + this.getCompId() + "-label"; return this.eLabel.id; }; AgAbstractLabel.prototype.getLabel = function () { return this.label; }; AgAbstractLabel.prototype.setLabel = function (label) { if (this.label === label) { return this; } this.label = label; this.refreshLabel(); return this; }; AgAbstractLabel.prototype.setLabelAlignment = function (alignment) { var eGui = this.getGui(); var eGuiClassList = eGui.classList; eGuiClassList.toggle('ag-label-align-left', alignment === 'left'); eGuiClassList.toggle('ag-label-align-right', alignment === 'right'); eGuiClassList.toggle('ag-label-align-top', alignment === 'top'); return this; }; AgAbstractLabel.prototype.setLabelEllipsis = function (hasEllipsis) { this.eLabel.classList.toggle('ag-label-ellipsis', hasEllipsis); return this; }; AgAbstractLabel.prototype.setLabelWidth = function (width) { if (this.label == null) { return this; } setElementWidth(this.eLabel, width); return this; }; AgAbstractLabel.prototype.setDisabled = function (disabled) { disabled = !!disabled; var element = this.getGui(); setDisabled(element, disabled); element.classList.toggle('ag-disabled', disabled); this.disabled = disabled; return this; }; AgAbstractLabel.prototype.isDisabled = function () { return !!this.disabled; }; __decorate$i([ PostConstruct ], AgAbstractLabel.prototype, "postConstruct", null); return AgAbstractLabel; }(Component)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$d = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var AgAbstractField = /** @class */ (function (_super) { __extends$d(AgAbstractField, _super); function AgAbstractField(config, template, className) { var _this = _super.call(this, config, template) || this; _this.className = className; return _this; } AgAbstractField.prototype.postConstruct = function () { _super.prototype.postConstruct.call(this); if (this.className) { this.addCssClass(this.className); } }; AgAbstractField.prototype.onValueChange = function (callbackFn) { var _this = this; this.addManagedListener(this, AgAbstractField.EVENT_CHANGED, function () { return callbackFn(_this.getValue()); }); return this; }; AgAbstractField.prototype.getWidth = function () { return this.getGui().clientWidth; }; AgAbstractField.prototype.setWidth = function (width) { setFixedWidth(this.getGui(), width); return this; }; AgAbstractField.prototype.getPreviousValue = function () { return this.previousValue; }; AgAbstractField.prototype.getValue = function () { return this.value; }; AgAbstractField.prototype.setValue = function (value, silent) { if (this.value === value) { return this; } this.previousValue = this.value; this.value = value; if (!silent) { this.dispatchEvent({ type: AgAbstractField.EVENT_CHANGED }); } return this; }; AgAbstractField.EVENT_CHANGED = 'valueChange'; return AgAbstractField; }(AgAbstractLabel)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$e = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __decorate$j = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var AgPickerField = /** @class */ (function (_super) { __extends$e(AgPickerField, _super); function AgPickerField(config, className, pickerIcon, ariaRole) { var _this = _super.call(this, config, /* html */ "
\n
\n
\n
\n
\n
\n
", className) || this; _this.pickerIcon = pickerIcon; _this.isPickerDisplayed = false; _this.isDestroyingPicker = false; _this.skipClick = false; return _this; } AgPickerField.prototype.postConstruct = function () { var _this = this; _super.prototype.postConstruct.call(this); var displayId = this.getCompId() + "-display"; this.eDisplayField.setAttribute('id', displayId); setAriaDescribedBy(this.eWrapper, displayId); var clickHandler = function () { if (_this.skipClick) { _this.skipClick = false; return; } if (_this.isDisabled()) { return; } _this.pickerComponent = _this.showPicker(); }; var eGui = this.getGui(); this.addManagedListener(eGui, 'mousedown', function (e) { if (!_this.skipClick && _this.pickerComponent && _this.pickerComponent.isAlive() && isVisible(_this.pickerComponent.getGui()) && eGui.contains(e.target)) { _this.skipClick = true; } }); this.addManagedListener(eGui, 'keydown', function (e) { switch (e.key) { case KeyCode.UP: case KeyCode.DOWN: case KeyCode.ENTER: case KeyCode.SPACE: clickHandler(); case KeyCode.ESCAPE: if (_this.isPickerDisplayed) { e.preventDefault(); } break; } }); this.addManagedListener(this.eWrapper, 'click', clickHandler); this.addManagedListener(this.eLabel, 'click', clickHandler); if (this.pickerIcon) { var icon = createIconNoSpan(this.pickerIcon, this.gridOptionsService); if (icon) { this.eIcon.appendChild(icon); } } }; AgPickerField.prototype.refreshLabel = function () { if (exists(this.getLabel())) { setAriaLabelledBy(this.eWrapper, this.getLabelId()); } else { this.eWrapper.removeAttribute('aria-labelledby'); } _super.prototype.refreshLabel.call(this); }; AgPickerField.prototype.setAriaLabel = function (label) { setAriaLabel(this.eWrapper, label); return this; }; AgPickerField.prototype.setInputWidth = function (width) { setElementWidth(this.eWrapper, width); return this; }; AgPickerField.prototype.getFocusableElement = function () { return this.eWrapper; }; __decorate$j([ RefSelector('eLabel') ], AgPickerField.prototype, "eLabel", void 0); __decorate$j([ RefSelector('eWrapper') ], AgPickerField.prototype, "eWrapper", void 0); __decorate$j([ RefSelector('eDisplayField') ], AgPickerField.prototype, "eDisplayField", void 0); __decorate$j([ RefSelector('eIcon') ], AgPickerField.prototype, "eIcon", void 0); return AgPickerField; }(AgAbstractField)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$f = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __decorate$k = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var AgList = /** @class */ (function (_super) { __extends$f(AgList, _super); function AgList(cssIdentifier) { if (cssIdentifier === void 0) { cssIdentifier = 'default'; } var _this = _super.call(this, /* html */ "
") || this; _this.cssIdentifier = cssIdentifier; _this.options = []; _this.itemEls = []; return _this; } AgList.prototype.init = function () { this.addManagedListener(this.getGui(), 'keydown', this.handleKeyDown.bind(this)); }; AgList.prototype.handleKeyDown = function (e) { var key = e.key; switch (key) { case KeyCode.ENTER: if (!this.highlightedEl) { this.setValue(this.getValue()); } else { var pos = this.itemEls.indexOf(this.highlightedEl); this.setValueByIndex(pos); } break; case KeyCode.DOWN: case KeyCode.UP: var isDown = key === KeyCode.DOWN; var itemToHighlight = void 0; e.preventDefault(); if (!this.highlightedEl) { itemToHighlight = this.itemEls[isDown ? 0 : this.itemEls.length - 1]; } else { var currentIdx = this.itemEls.indexOf(this.highlightedEl); var nextPos = currentIdx + (isDown ? 1 : -1); nextPos = Math.min(Math.max(nextPos, 0), this.itemEls.length - 1); itemToHighlight = this.itemEls[nextPos]; } this.highlightItem(itemToHighlight); break; } }; AgList.prototype.addOptions = function (listOptions) { var _this = this; listOptions.forEach(function (listOption) { return _this.addOption(listOption); }); return this; }; AgList.prototype.addOption = function (listOption) { var value = listOption.value, text = listOption.text; var sanitisedText = escapeString(text || value); this.options.push({ value: value, text: sanitisedText }); this.renderOption(value, sanitisedText); this.updateIndices(); return this; }; AgList.prototype.updateIndices = function () { var options = this.getGui().querySelectorAll('.ag-list-item'); options.forEach(function (option, idx) { setAriaPosInSet(option, idx + 1); setAriaSetSize(option, options.length); }); }; AgList.prototype.renderOption = function (value, text) { var _this = this; var itemEl = document.createElement('div'); setAriaRole(itemEl, 'option'); itemEl.classList.add('ag-list-item', "ag-" + this.cssIdentifier + "-list-item"); itemEl.innerHTML = "" + text + ""; itemEl.tabIndex = -1; this.itemEls.push(itemEl); this.addManagedListener(itemEl, 'mouseover', function () { return _this.highlightItem(itemEl); }); this.addManagedListener(itemEl, 'mouseleave', function () { return _this.clearHighlighted(); }); this.addManagedListener(itemEl, 'click', function () { return _this.setValue(value); }); this.getGui().appendChild(itemEl); }; AgList.prototype.setValue = function (value, silent) { if (this.value === value) { this.fireItemSelected(); return this; } if (value == null) { this.reset(); return this; } var idx = this.options.findIndex(function (option) { return option.value === value; }); if (idx !== -1) { var option = this.options[idx]; this.value = option.value; this.displayValue = option.text != null ? option.text : option.value; this.highlightItem(this.itemEls[idx]); if (!silent) { this.fireChangeEvent(); } } return this; }; AgList.prototype.setValueByIndex = function (idx) { return this.setValue(this.options[idx].value); }; AgList.prototype.getValue = function () { return this.value; }; AgList.prototype.getDisplayValue = function () { return this.displayValue; }; AgList.prototype.refreshHighlighted = function () { var _this = this; this.clearHighlighted(); var idx = this.options.findIndex(function (option) { return option.value === _this.value; }); if (idx !== -1) { this.highlightItem(this.itemEls[idx]); } }; AgList.prototype.reset = function () { this.value = null; this.displayValue = null; this.clearHighlighted(); this.fireChangeEvent(); }; AgList.prototype.highlightItem = function (el) { if (!el.offsetParent) { return; } this.clearHighlighted(); this.highlightedEl = el; this.highlightedEl.classList.add(AgList.ACTIVE_CLASS); setAriaSelected(this.highlightedEl, true); this.highlightedEl.focus(); }; AgList.prototype.clearHighlighted = function () { if (!this.highlightedEl || !this.highlightedEl.offsetParent) { return; } this.highlightedEl.classList.remove(AgList.ACTIVE_CLASS); setAriaSelected(this.highlightedEl, false); this.highlightedEl = null; }; AgList.prototype.fireChangeEvent = function () { this.dispatchEvent({ type: AgAbstractField.EVENT_CHANGED }); this.fireItemSelected(); }; AgList.prototype.fireItemSelected = function () { this.dispatchEvent({ type: AgList.EVENT_ITEM_SELECTED }); }; AgList.EVENT_ITEM_SELECTED = 'selectedItem'; AgList.ACTIVE_CLASS = 'ag-active-item'; __decorate$k([ PostConstruct ], AgList.prototype, "init", null); return AgList; }(Component)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$g = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __decorate$l = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var AgSelect = /** @class */ (function (_super) { __extends$g(AgSelect, _super); function AgSelect(config) { return _super.call(this, config, 'ag-select', 'smallDown', 'listbox') || this; } AgSelect.prototype.init = function () { var _this = this; this.listComponent = this.createBean(new AgList('select')); this.listComponent.setParentComponent(this); this.eWrapper.tabIndex = 0; this.listComponent.addManagedListener(this.listComponent, AgList.EVENT_ITEM_SELECTED, function () { if (_this.hideList) { _this.hideList(); } _this.dispatchEvent({ type: AgSelect.EVENT_ITEM_SELECTED }); }); this.listComponent.addManagedListener(this.listComponent, AgAbstractField.EVENT_CHANGED, function () { _this.setValue(_this.listComponent.getValue(), false, true); if (_this.hideList) { _this.hideList(); } }); }; AgSelect.prototype.showPicker = function () { var _this = this; var listGui = this.listComponent.getGui(); var eDocument = this.gridOptionsService.getDocument(); var destroyMouseWheelFunc = this.addManagedListener(eDocument.body, 'wheel', function (e) { if (!listGui.contains(e.target) && _this.hideList) { _this.hideList(); } }); var destroyFocusOutFunc = this.addManagedListener(listGui, 'focusout', function (e) { if (!listGui.contains(e.relatedTarget) && _this.hideList) { _this.hideList(); } }); var translate = this.localeService.getLocaleTextFunc(); var addPopupRes = this.popupService.addPopup({ modal: true, eChild: listGui, closeOnEsc: true, closedCallback: function () { _this.hideList = null; _this.isPickerDisplayed = false; destroyFocusOutFunc(); destroyMouseWheelFunc(); if (_this.isAlive()) { setAriaExpanded(_this.eWrapper, false); _this.getFocusableElement().focus(); } }, ariaLabel: translate('ariaLabelSelectField', 'Select Field') }); if (addPopupRes) { this.hideList = addPopupRes.hideFunc; } this.isPickerDisplayed = true; setElementWidth(listGui, getAbsoluteWidth(this.eWrapper)); setAriaExpanded(this.eWrapper, true); listGui.style.maxHeight = getInnerHeight(this.popupService.getPopupParent()) + 'px'; listGui.style.position = 'absolute'; this.popupService.positionPopupByComponent({ type: 'ag-list', eventSource: this.eWrapper, ePopup: listGui, position: 'under', keepWithinBounds: true }); this.listComponent.refreshHighlighted(); return this.listComponent; }; AgSelect.prototype.addOptions = function (options) { var _this = this; options.forEach(function (option) { return _this.addOption(option); }); return this; }; AgSelect.prototype.addOption = function (option) { this.listComponent.addOption(option); return this; }; AgSelect.prototype.setValue = function (value, silent, fromPicker) { if (this.value === value) { return this; } if (!fromPicker) { this.listComponent.setValue(value, true); } var newValue = this.listComponent.getValue(); if (newValue === this.getValue()) { return this; } this.eDisplayField.innerHTML = this.listComponent.getDisplayValue(); return _super.prototype.setValue.call(this, value, silent); }; AgSelect.prototype.destroy = function () { if (this.hideList) { this.hideList(); } this.destroyBean(this.listComponent); _super.prototype.destroy.call(this); }; AgSelect.EVENT_ITEM_SELECTED = 'selectedItem'; __decorate$l([ Autowired('popupService') ], AgSelect.prototype, "popupService", void 0); __decorate$l([ PostConstruct ], AgSelect.prototype, "init", null); return AgSelect; }(AgPickerField)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$h = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __decorate$m = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var AgAbstractInputField = /** @class */ (function (_super) { __extends$h(AgAbstractInputField, _super); function AgAbstractInputField(config, className, inputType, displayFieldTag) { if (inputType === void 0) { inputType = 'text'; } if (displayFieldTag === void 0) { displayFieldTag = 'input'; } var _this = _super.call(this, config, /* html */ "\n
\n
\n
\n <" + displayFieldTag + " ref=\"eInput\" class=\"ag-input-field-input\">\n
\n
", className) || this; _this.inputType = inputType; _this.displayFieldTag = displayFieldTag; return _this; } AgAbstractInputField.prototype.postConstruct = function () { _super.prototype.postConstruct.call(this); this.setInputType(); this.eLabel.classList.add(this.className + "-label"); this.eWrapper.classList.add(this.className + "-input-wrapper"); this.eInput.classList.add(this.className + "-input"); this.addCssClass('ag-input-field'); this.eInput.id = this.eInput.id || "ag-" + this.getCompId() + "-input"; var _a = this.config, width = _a.width, value = _a.value; if (width != null) { this.setWidth(width); } if (value != null) { this.setValue(value); } this.addInputListeners(); }; AgAbstractInputField.prototype.refreshLabel = function () { if (exists(this.getLabel())) { setAriaLabelledBy(this.eInput, this.getLabelId()); } else { this.eInput.removeAttribute('aria-labelledby'); } _super.prototype.refreshLabel.call(this); }; AgAbstractInputField.prototype.addInputListeners = function () { var _this = this; this.addManagedListener(this.eInput, 'input', function (e) { return _this.setValue(e.target.value); }); }; AgAbstractInputField.prototype.setInputType = function () { if (this.displayFieldTag === 'input') { this.eInput.setAttribute('type', this.inputType); } }; AgAbstractInputField.prototype.getInputElement = function () { return this.eInput; }; AgAbstractInputField.prototype.setInputWidth = function (width) { setElementWidth(this.eWrapper, width); return this; }; AgAbstractInputField.prototype.setInputName = function (name) { this.getInputElement().setAttribute('name', name); return this; }; AgAbstractInputField.prototype.getFocusableElement = function () { return this.eInput; }; AgAbstractInputField.prototype.setMaxLength = function (length) { var eInput = this.eInput; eInput.maxLength = length; return this; }; AgAbstractInputField.prototype.setInputPlaceholder = function (placeholder) { addOrRemoveAttribute(this.eInput, 'placeholder', placeholder); return this; }; AgAbstractInputField.prototype.setInputAriaLabel = function (label) { setAriaLabel(this.eInput, label); return this; }; AgAbstractInputField.prototype.setDisabled = function (disabled) { setDisabled(this.eInput, disabled); return _super.prototype.setDisabled.call(this, disabled); }; __decorate$m([ RefSelector('eLabel') ], AgAbstractInputField.prototype, "eLabel", void 0); __decorate$m([ RefSelector('eWrapper') ], AgAbstractInputField.prototype, "eWrapper", void 0); __decorate$m([ RefSelector('eInput') ], AgAbstractInputField.prototype, "eInput", void 0); return AgAbstractInputField; }(AgAbstractField)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$i = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var AgCheckbox = /** @class */ (function (_super) { __extends$i(AgCheckbox, _super); function AgCheckbox(config, className, inputType) { if (className === void 0) { className = 'ag-checkbox'; } if (inputType === void 0) { inputType = 'checkbox'; } var _this = _super.call(this, config, className, inputType) || this; _this.labelAlignment = 'right'; _this.selected = false; _this.readOnly = false; _this.passive = false; return _this; } AgCheckbox.prototype.addInputListeners = function () { this.addManagedListener(this.eInput, 'click', this.onCheckboxClick.bind(this)); this.addManagedListener(this.eLabel, 'click', this.toggle.bind(this)); }; AgCheckbox.prototype.getNextValue = function () { return this.selected === undefined ? true : !this.selected; }; AgCheckbox.prototype.setPassive = function (passive) { this.passive = passive; }; AgCheckbox.prototype.isReadOnly = function () { return this.readOnly; }; AgCheckbox.prototype.setReadOnly = function (readOnly) { this.eWrapper.classList.toggle('ag-disabled', readOnly); this.eInput.disabled = readOnly; this.readOnly = readOnly; }; AgCheckbox.prototype.setDisabled = function (disabled) { this.eWrapper.classList.toggle('ag-disabled', disabled); return _super.prototype.setDisabled.call(this, disabled); }; AgCheckbox.prototype.toggle = function () { if (this.eInput.disabled) { return; } var previousValue = this.isSelected(); var nextValue = this.getNextValue(); if (this.passive) { this.dispatchChange(nextValue, previousValue); } else { this.setValue(nextValue); } }; AgCheckbox.prototype.getValue = function () { return this.isSelected(); }; AgCheckbox.prototype.setValue = function (value, silent) { this.refreshSelectedClass(value); this.setSelected(value, silent); return this; }; AgCheckbox.prototype.setName = function (name) { var input = this.getInputElement(); input.name = name; return this; }; AgCheckbox.prototype.isSelected = function () { return this.selected; }; AgCheckbox.prototype.setSelected = function (selected, silent) { if (this.isSelected() === selected) { return; } this.previousValue = this.isSelected(); selected = this.selected = typeof selected === 'boolean' ? selected : undefined; this.eInput.checked = selected; this.eInput.indeterminate = selected === undefined; if (!silent) { this.dispatchChange(this.selected, this.previousValue); } }; AgCheckbox.prototype.dispatchChange = function (selected, previousValue, event) { this.dispatchEvent({ type: AgCheckbox.EVENT_CHANGED, selected: selected, previousValue: previousValue, event: event }); var input = this.getInputElement(); var checkboxChangedEvent = { type: Events.EVENT_CHECKBOX_CHANGED, id: input.id, name: input.name, selected: selected, previousValue: previousValue }; this.eventService.dispatchEvent(checkboxChangedEvent); }; AgCheckbox.prototype.onCheckboxClick = function (e) { if (this.passive || this.eInput.disabled) { return; } var previousValue = this.isSelected(); var selected = this.selected = e.target.checked; this.refreshSelectedClass(selected); this.dispatchChange(selected, previousValue, e); }; AgCheckbox.prototype.refreshSelectedClass = function (value) { this.eWrapper.classList.toggle('ag-checked', value === true); this.eWrapper.classList.toggle('ag-indeterminate', value == null); }; return AgCheckbox; }(AgAbstractInputField)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$j = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var AgRadioButton = /** @class */ (function (_super) { __extends$j(AgRadioButton, _super); function AgRadioButton(config) { return _super.call(this, config, 'ag-radio-button', 'radio') || this; } AgRadioButton.prototype.isSelected = function () { return this.eInput.checked; }; AgRadioButton.prototype.toggle = function () { if (this.eInput.disabled) { return; } // do not allow an active radio button to be deselected if (!this.isSelected()) { this.setValue(true); } }; AgRadioButton.prototype.addInputListeners = function () { _super.prototype.addInputListeners.call(this); this.addManagedListener(this.eventService, Events.EVENT_CHECKBOX_CHANGED, this.onChange.bind(this)); }; /** * This ensures that if another radio button in the same named group is selected, we deselect this radio button. * By default the browser does this for you, but we are managing classes ourselves in order to ensure input * elements are styled correctly in IE11, and the DOM 'changed' event is only fired when a button is selected, * not deselected, so we need to use our own event. */ AgRadioButton.prototype.onChange = function (event) { if (event.selected && event.name && this.eInput.name && this.eInput.name === event.name && event.id && this.eInput.id !== event.id) { this.setValue(false, true); } }; return AgRadioButton; }(AgCheckbox)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$k = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __read$8 = (undefined && undefined.__read) || function (o, n) { var m = typeof Symbol === "function" && o[Symbol.iterator]; if (!m) return o; var i = m.call(o), r, ar = [], e; try { while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); } catch (error) { e = { error: error }; } finally { try { if (r && !r.done && (m = i["return"])) m.call(i); } finally { if (e) throw e.error; } } return ar; }; var __spread$5 = (undefined && undefined.__spread) || function () { for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read$8(arguments[i])); return ar; }; var SimpleFilterModelFormatter = /** @class */ (function () { function SimpleFilterModelFormatter(localeService, optionsFactory) { this.localeService = localeService; this.optionsFactory = optionsFactory; } // used by: // 1) NumberFloatingFilter & TextFloatingFilter: Always, for both when editable and read only. // 2) DateFloatingFilter: Only when read only (as we show text rather than a date picker when read only) SimpleFilterModelFormatter.prototype.getModelAsString = function (model) { var _this = this; if (!model) { return null; } var isCombined = model.operator != null; var translate = this.localeService.getLocaleTextFunc(); if (isCombined) { var combinedModel = model; var conditions = combinedModel.conditions; if (!conditions) { var condition1 = combinedModel.condition1, condition2 = combinedModel.condition2; conditions = [condition1, condition2]; } var customOptions = conditions.map(function (condition) { return _this.getModelAsString(condition); }); var joinOperatorTranslateKey = combinedModel.operator === 'AND' ? 'andCondition' : 'orCondition'; return customOptions.join(" " + translate(joinOperatorTranslateKey, DEFAULT_FILTER_LOCALE_TEXT[joinOperatorTranslateKey]) + " "); } else if (model.type === SimpleFilter.BLANK || model.type === SimpleFilter.NOT_BLANK) { return translate(model.type, model.type); } else { var condition = model; var customOption = this.optionsFactory.getCustomOption(condition.type); // For custom filter options we display the Name of the filter instead // of displaying the `from` value, as it wouldn't be relevant var _a = customOption || {}, displayKey = _a.displayKey, displayName = _a.displayName, numberOfInputs = _a.numberOfInputs; if (displayKey && displayName && numberOfInputs === 0) { translate(displayKey, displayName); return displayName; } return this.conditionToString(condition, customOption); } }; return SimpleFilterModelFormatter; }()); /** * Every filter with a dropdown where the user can specify a comparing type against the filter values. * * @param M type of filter-model managed by the concrete sub-class that extends this type * @param V type of value managed by the concrete sub-class that extends this type * @param E type of UI element used for collecting user-input */ var SimpleFilter = /** @class */ (function (_super) { __extends$k(SimpleFilter, _super); function SimpleFilter() { var _this = _super !== null && _super.apply(this, arguments) || this; _this.eTypes = []; _this.eJoinOperatorPanels = []; _this.eJoinOperatorsAnd = []; _this.eJoinOperatorsOr = []; _this.eConditionBodies = []; _this.listener = function () { return _this.onUiChanged(); }; _this.lastUiCompletePosition = null; _this.joinOperatorId = 0; return _this; } SimpleFilter.prototype.getNumberOfInputs = function (type) { var customOpts = this.optionsFactory.getCustomOption(type); if (customOpts) { var numberOfInputs = customOpts.numberOfInputs; return numberOfInputs != null ? numberOfInputs : 1; } var zeroInputTypes = [ SimpleFilter.EMPTY, SimpleFilter.NOT_BLANK, SimpleFilter.BLANK, ]; if (type && zeroInputTypes.indexOf(type) >= 0) { return 0; } else if (type === SimpleFilter.IN_RANGE) { return 2; } return 1; }; // floating filter calls this when user applies filter from floating filter SimpleFilter.prototype.onFloatingFilterChanged = function (type, value) { this.setTypeFromFloatingFilter(type); this.setValueFromFloatingFilter(value); this.onUiChanged(true); }; SimpleFilter.prototype.setTypeFromFloatingFilter = function (type) { var _this = this; this.eTypes.forEach(function (eType, position) { if (position === 0) { eType.setValue(type, true); } else { eType.setValue(_this.optionsFactory.getDefaultOption(), true); } }); }; SimpleFilter.prototype.getModelFromUi = function () { var conditions = this.getUiCompleteConditions(); if (conditions.length === 0) { return null; } if (this.maxNumConditions > 1 && conditions.length > 1) { return { filterType: this.getFilterType(), operator: this.getJoinOperator(), condition1: conditions[0], condition2: conditions[1], conditions: conditions }; } return conditions[0]; }; SimpleFilter.prototype.getConditionTypes = function () { return this.eTypes.map(function (eType) { return eType.getValue(); }); }; SimpleFilter.prototype.getConditionType = function (position) { return this.eTypes[position].getValue(); }; SimpleFilter.prototype.getJoinOperator = function () { if (this.eJoinOperatorsOr.length === 0) { return this.defaultJoinOperator; } return this.eJoinOperatorsOr[0].getValue() === true ? 'OR' : 'AND'; }; SimpleFilter.prototype.areModelsEqual = function (a, b) { var _this = this; // both are missing if (!a && !b) { return true; } // one is missing, other present if ((!a && b) || (a && !b)) { return false; } // one is combined, the other is not var aIsSimple = !a.operator; var bIsSimple = !b.operator; var oneSimpleOneCombined = (!aIsSimple && bIsSimple) || (aIsSimple && !bIsSimple); if (oneSimpleOneCombined) { return false; } var res; // otherwise both present, so compare if (aIsSimple) { var aSimple = a; var bSimple = b; res = this.areSimpleModelsEqual(aSimple, bSimple); } else { var aCombined = a; var bCombined = b; res = aCombined.operator === bCombined.operator && areEqual(aCombined.conditions, bCombined.conditions, function (aModel, bModel) { return _this.areSimpleModelsEqual(aModel, bModel); }); } return res; }; SimpleFilter.prototype.setModelIntoUi = function (model) { var _this = this; var isCombined = model.operator; if (isCombined) { var combinedModel = model; if (!combinedModel.conditions) { combinedModel.conditions = [ combinedModel.condition1, combinedModel.condition2 ]; } var numConditions = this.validateAndUpdateConditions(combinedModel.conditions); var numPrevConditions = this.getNumConditions(); if (numConditions < numPrevConditions) { this.removeConditionsAndOperators(numConditions); } else if (numConditions > numPrevConditions) { for (var i = numPrevConditions; i < numConditions; i++) { this.createJoinOperatorPanel(); this.createOption(); } } var orChecked_1 = combinedModel.operator === 'OR'; this.eJoinOperatorsAnd.forEach(function (eJoinOperatorAnd) { return eJoinOperatorAnd.setValue(!orChecked_1, true); }); this.eJoinOperatorsOr.forEach(function (eJoinOperatorOr) { return eJoinOperatorOr.setValue(orChecked_1, true); }); combinedModel.conditions.forEach(function (condition, position) { _this.eTypes[position].setValue(condition.type, true); _this.setConditionIntoUi(condition, position); }); } else { var simpleModel = model; if (this.getNumConditions() > 1) { this.removeConditionsAndOperators(1); } this.eTypes[0].setValue(simpleModel.type, true); this.setConditionIntoUi(simpleModel, 0); } this.lastUiCompletePosition = this.getNumConditions() - 1; this.createMissingConditionsAndOperators(); this.onUiChanged(); return AgPromise.resolve(); }; SimpleFilter.prototype.validateAndUpdateConditions = function (conditions) { var numConditions = conditions.length; if (numConditions > this.maxNumConditions) { conditions.splice(this.maxNumConditions); doOnce(function () { return console.warn('AG Grid: Filter Model contains more conditions than "filterParams.maxNumConditions". Additional conditions have been ignored.'); }, 'simpleFilterSetModelMaxNumConditions'); numConditions = this.maxNumConditions; } return numConditions; }; SimpleFilter.prototype.doesFilterPass = function (params) { var _this = this; var _a; var model = this.getModel(); if (model == null) { return true; } var operator = model.operator; var models = []; if (operator) { var combinedModel = model; models.push.apply(models, __spread$5(((_a = combinedModel.conditions) !== null && _a !== void 0 ? _a : []))); } else { models.push(model); } var combineFunction = operator && operator === 'OR' ? 'some' : 'every'; return models[combineFunction](function (m) { return _this.individualConditionPasses(params, m); }); }; SimpleFilter.prototype.setParams = function (params) { _super.prototype.setParams.call(this, params); this.setNumConditions(params); this.defaultJoinOperator = this.getDefaultJoinOperator(params.defaultJoinOperator); this.filterPlaceholder = params.filterPlaceholder; this.optionsFactory = new OptionsFactory(); this.optionsFactory.init(params, this.getDefaultFilterOptions()); this.createOption(); this.createMissingConditionsAndOperators(); }; SimpleFilter.prototype.setNumConditions = function (params) { var _a, _b; if (params.suppressAndOrCondition != null) { doOnce(function () { return console.warn('AG Grid: Since v29.2 "filterParams.suppressAndOrCondition" is deprecated. Use "filterParams.maxNumConditions = 1" instead.'); }, 'simpleFilterSuppressAndOrCondition'); } if (params.alwaysShowBothConditions != null) { doOnce(function () { return console.warn('AG Grid: Since v29.2 "filterParams.alwaysShowBothConditions" is deprecated. Use "filterParams.numAlwaysVisibleConditions = 2" instead.'); }, 'simpleFilterAlwaysShowBothConditions'); } this.maxNumConditions = (_a = params.maxNumConditions) !== null && _a !== void 0 ? _a : (params.suppressAndOrCondition ? 1 : 2); if (this.maxNumConditions < 1) { doOnce(function () { return console.warn('AG Grid: "filterParams.maxNumConditions" must be greater than or equal to zero.'); }, 'simpleFilterMaxNumConditions'); this.maxNumConditions = 1; } this.numAlwaysVisibleConditions = (_b = params.numAlwaysVisibleConditions) !== null && _b !== void 0 ? _b : (params.alwaysShowBothConditions ? 2 : 1); if (this.numAlwaysVisibleConditions < 1) { doOnce(function () { return console.warn('AG Grid: "filterParams.numAlwaysVisibleConditions" must be greater than or equal to zero.'); }, 'simpleFilterNumAlwaysVisibleConditions'); this.numAlwaysVisibleConditions = 1; } if (this.numAlwaysVisibleConditions > this.maxNumConditions) { doOnce(function () { return console.warn('AG Grid: "filterParams.numAlwaysVisibleConditions" cannot be greater than "filterParams.maxNumConditions".'); }, 'simpleFilterNumAlwaysVisibleGreaterThanMaxNumConditions'); this.numAlwaysVisibleConditions = this.maxNumConditions; } }; SimpleFilter.prototype.createOption = function () { var _this = this; var eType = this.createManagedBean(new AgSelect()); this.eTypes.push(eType); eType.addCssClass('ag-filter-select'); this.eFilterBody.appendChild(eType.getGui()); var eConditionBody = this.createValueElement(); this.eConditionBodies.push(eConditionBody); this.eFilterBody.appendChild(eConditionBody); this.putOptionsIntoDropdown(eType); this.resetType(eType); var position = this.getNumConditions() - 1; this.forEachPositionInput(position, function (element) { return _this.resetInput(element); }); this.addChangedListeners(eType, position); }; SimpleFilter.prototype.createJoinOperatorPanel = function () { var eJoinOperatorPanel = document.createElement('div'); this.eJoinOperatorPanels.push(eJoinOperatorPanel); eJoinOperatorPanel.classList.add('ag-filter-condition'); var eJoinOperatorAnd = this.createJoinOperator(this.eJoinOperatorsAnd, eJoinOperatorPanel, 'and'); var eJoinOperatorOr = this.createJoinOperator(this.eJoinOperatorsOr, eJoinOperatorPanel, 'or'); this.eFilterBody.appendChild(eJoinOperatorPanel); var index = this.eJoinOperatorPanels.length - 1; var uniqueGroupId = this.joinOperatorId++; this.resetJoinOperatorAnd(eJoinOperatorAnd, index, uniqueGroupId); this.resetJoinOperatorOr(eJoinOperatorOr, index, uniqueGroupId); if (!this.isReadOnly()) { eJoinOperatorAnd.onValueChange(this.listener); eJoinOperatorOr.onValueChange(this.listener); } }; SimpleFilter.prototype.createJoinOperator = function (eJoinOperators, eJoinOperatorPanel, andOr) { var eJoinOperator = this.createManagedBean(new AgRadioButton()); eJoinOperators.push(eJoinOperator); eJoinOperator.addCssClass('ag-filter-condition-operator'); eJoinOperator.addCssClass("ag-filter-condition-operator-" + andOr); eJoinOperatorPanel.appendChild(eJoinOperator.getGui()); return eJoinOperator; }; SimpleFilter.prototype.getDefaultJoinOperator = function (defaultJoinOperator) { return defaultJoinOperator === 'AND' || defaultJoinOperator === 'OR' ? defaultJoinOperator : 'AND'; }; SimpleFilter.prototype.putOptionsIntoDropdown = function (eType) { var _this = this; var filterOptions = this.optionsFactory.getFilterOptions(); // Add specified options to all condition drop-downs. filterOptions.forEach(function (option) { var listOption = typeof option === 'string' ? _this.createBoilerplateListOption(option) : _this.createCustomListOption(option); eType.addOption(listOption); }); // Make drop-downs read-only if there is only one option. eType.setDisabled(filterOptions.length <= 1); }; SimpleFilter.prototype.createBoilerplateListOption = function (option) { return { value: option, text: this.translate(option) }; }; SimpleFilter.prototype.createCustomListOption = function (option) { var displayKey = option.displayKey; var customOption = this.optionsFactory.getCustomOption(option.displayKey); return { value: displayKey, text: customOption ? this.localeService.getLocaleTextFunc()(customOption.displayKey, customOption.displayName) : this.translate(displayKey), }; }; /** * @deprecated As of v29.2 filters can have more than two conditions. Check `colDef.filterParams.maxNumConditions` instead. */ SimpleFilter.prototype.isAllowTwoConditions = function () { return this.maxNumConditions >= 2; }; SimpleFilter.prototype.createBodyTemplate = function () { // created dynamically return ''; }; SimpleFilter.prototype.getCssIdentifier = function () { return 'simple-filter'; }; SimpleFilter.prototype.updateUiVisibility = function () { var joinOperator = this.getJoinOperator(); this.updateNumConditions(); // from here, the number of elements in all the collections is correct, so can just update the values/statuses this.updateConditionStatusesAndValues(this.lastUiCompletePosition, joinOperator); }; SimpleFilter.prototype.updateNumConditions = function () { var _a; // Collection sizes are already correct if updated via API, so only need to handle UI updates here var lastUiCompletePosition = -1; var areAllConditionsUiComplete = true; for (var position = 0; position < this.getNumConditions(); position++) { if (this.isConditionUiComplete(position)) { lastUiCompletePosition = position; } else { areAllConditionsUiComplete = false; } } if (this.shouldAddNewConditionAtEnd(areAllConditionsUiComplete)) { this.createJoinOperatorPanel(); this.createOption(); } else { var activePosition = (_a = this.lastUiCompletePosition) !== null && _a !== void 0 ? _a : this.getNumConditions() - 2; if (lastUiCompletePosition < activePosition) { // remove any incomplete conditions at the end, excluding the active position this.removeConditionsAndOperators(activePosition + 1); var removeStartPosition = lastUiCompletePosition + 1; var numConditionsToRemove = activePosition - removeStartPosition; if (numConditionsToRemove > 0) { this.removeConditionsAndOperators(removeStartPosition, numConditionsToRemove); } this.createMissingConditionsAndOperators(); } } this.lastUiCompletePosition = lastUiCompletePosition; }; SimpleFilter.prototype.updateConditionStatusesAndValues = function (lastUiCompletePosition, joinOperator) { var _this = this; this.eTypes.forEach(function (eType, position) { var disabled = _this.isConditionDisabled(position, lastUiCompletePosition); var group = position === 1 ? [eType, _this.eJoinOperatorPanels[0], _this.eJoinOperatorsAnd[0], _this.eJoinOperatorsOr[0]] : [eType]; group.forEach(function (element) { if (element instanceof AgAbstractInputField || element instanceof AgSelect) { element.setDisabled(disabled); } else { setDisabled(element, disabled); } }); }); this.eConditionBodies.forEach(function (element, index) { setDisplayed(element, _this.isConditionBodyVisible(index)); }); var orChecked = (joinOperator !== null && joinOperator !== void 0 ? joinOperator : this.getJoinOperator()) === 'OR'; this.eJoinOperatorsAnd.forEach(function (eJoinOperatorAnd, index) { eJoinOperatorAnd.setValue(!orChecked, true); }); this.eJoinOperatorsOr.forEach(function (eJoinOperatorOr, index) { eJoinOperatorOr.setValue(orChecked, true); }); this.forEachInput(function (element, index, position, numberOfInputs) { _this.setElementDisplayed(element, index < numberOfInputs); _this.setElementDisabled(element, _this.isConditionDisabled(position, lastUiCompletePosition)); }); this.resetPlaceholder(); }; SimpleFilter.prototype.shouldAddNewConditionAtEnd = function (areAllConditionsUiComplete) { return areAllConditionsUiComplete && this.getNumConditions() < this.maxNumConditions && !this.isReadOnly(); }; SimpleFilter.prototype.removeConditionsAndOperators = function (startPosition, deleteCount) { if (startPosition >= this.getNumConditions()) { return; } this.removeComponents(this.eTypes, startPosition, deleteCount); this.removeElements(this.eConditionBodies, startPosition, deleteCount); this.removeValueElements(startPosition, deleteCount); var joinOperatorIndex = Math.max(startPosition - 1, 0); this.removeElements(this.eJoinOperatorPanels, joinOperatorIndex, deleteCount); this.removeComponents(this.eJoinOperatorsAnd, joinOperatorIndex, deleteCount); this.removeComponents(this.eJoinOperatorsOr, joinOperatorIndex, deleteCount); }; SimpleFilter.prototype.removeElements = function (elements, startPosition, deleteCount) { var removedElements = this.removeItems(elements, startPosition, deleteCount); removedElements.forEach(function (element) { return removeFromParent(element); }); }; SimpleFilter.prototype.removeComponents = function (components, startPosition, deleteCount) { var _this = this; var removedComponents = this.removeItems(components, startPosition, deleteCount); removedComponents.forEach(function (comp) { removeFromParent(comp.getGui()); _this.destroyBean(comp); }); }; SimpleFilter.prototype.removeItems = function (items, startPosition, deleteCount) { return deleteCount == null ? items.splice(startPosition) : items.splice(startPosition, deleteCount); }; SimpleFilter.prototype.afterGuiAttached = function (params) { _super.prototype.afterGuiAttached.call(this, params); this.resetPlaceholder(); if (!params || (!params.suppressFocus && !this.isReadOnly())) { var firstInput = this.getInputs(0)[0]; if (!firstInput) { return; } if (firstInput instanceof AgAbstractInputField) { firstInput.getInputElement().focus(); } } }; SimpleFilter.prototype.afterGuiDetached = function () { _super.prototype.afterGuiDetached.call(this); var appliedModel = this.getModel(); if (!this.areModelsEqual(appliedModel, this.getModelFromUi())) { this.resetUiToActiveModel(appliedModel); } // remove incomplete positions var lastUiCompletePosition = -1; // as we remove incomplete positions, the last UI complete position will change var updatedLastUiCompletePosition = -1; var conditionsRemoved = false; var joinOperator = this.getJoinOperator(); for (var position = this.getNumConditions() - 1; position >= 0; position--) { if (this.isConditionUiComplete(position)) { if (lastUiCompletePosition === -1) { lastUiCompletePosition = position; updatedLastUiCompletePosition = position; } } else { var shouldRemovePositionAtEnd = position >= this.numAlwaysVisibleConditions && !this.isConditionUiComplete(position - 1); var positionBeforeLastUiCompletePosition = position < lastUiCompletePosition; if (shouldRemovePositionAtEnd || positionBeforeLastUiCompletePosition) { this.removeConditionsAndOperators(position, 1); conditionsRemoved = true; if (positionBeforeLastUiCompletePosition) { updatedLastUiCompletePosition--; } } } } var shouldUpdateConditionStatusesAndValues = false; if (this.getNumConditions() < this.numAlwaysVisibleConditions) { // if conditions have been removed, need to recreate new ones at the end up to the number required this.createMissingConditionsAndOperators(); shouldUpdateConditionStatusesAndValues = true; } if (this.shouldAddNewConditionAtEnd(updatedLastUiCompletePosition === this.getNumConditions() - 1)) { this.createJoinOperatorPanel(); this.createOption(); shouldUpdateConditionStatusesAndValues = true; } if (shouldUpdateConditionStatusesAndValues) { this.updateConditionStatusesAndValues(updatedLastUiCompletePosition, joinOperator); } if (conditionsRemoved) { this.updateJoinOperatorsDisabled(); } this.lastUiCompletePosition = updatedLastUiCompletePosition; }; SimpleFilter.prototype.getPlaceholderText = function (defaultPlaceholder, position) { var placeholder = this.translate(defaultPlaceholder); if (isFunction(this.filterPlaceholder)) { var filterPlaceholderFn = this.filterPlaceholder; var filterOptionKey = this.eTypes[position].getValue(); var filterOption = this.translate(filterOptionKey); placeholder = filterPlaceholderFn({ filterOptionKey: filterOptionKey, filterOption: filterOption, placeholder: placeholder }); } else if (typeof this.filterPlaceholder === 'string') { placeholder = this.filterPlaceholder; } return placeholder; }; // allow sub-classes to reset HTML placeholders after UI update. SimpleFilter.prototype.resetPlaceholder = function () { var _this = this; var globalTranslate = this.localeService.getLocaleTextFunc(); this.forEachInput(function (element, index, position, numberOfInputs) { if (!(element instanceof AgAbstractInputField)) { return; } var placeholder = index === 0 && numberOfInputs > 1 ? 'inRangeStart' : index === 0 ? 'filterOoo' : 'inRangeEnd'; var ariaLabel = index === 0 && numberOfInputs > 1 ? globalTranslate('ariaFilterFromValue', 'Filter from value') : index === 0 ? globalTranslate('ariaFilterValue', 'Filter Value') : globalTranslate('ariaFilterToValue', 'Filter to Value'); element.setInputPlaceholder(_this.getPlaceholderText(placeholder, position)); element.setInputAriaLabel(ariaLabel); }); }; SimpleFilter.prototype.setElementValue = function (element, value) { if (element instanceof AgAbstractInputField) { element.setValue(value != null ? String(value) : null, true); } }; SimpleFilter.prototype.setElementDisplayed = function (element, displayed) { if (element instanceof Component) { setDisplayed(element.getGui(), displayed); } }; SimpleFilter.prototype.setElementDisabled = function (element, disabled) { if (element instanceof Component) { setDisabled(element.getGui(), disabled); } }; SimpleFilter.prototype.attachElementOnChange = function (element, listener) { if (element instanceof AgAbstractInputField) { element.onValueChange(listener); } }; SimpleFilter.prototype.forEachInput = function (cb) { var _this = this; this.getConditionTypes().forEach(function (type, position) { _this.forEachPositionTypeInput(position, type, cb); }); }; SimpleFilter.prototype.forEachPositionInput = function (position, cb) { var type = this.getConditionType(position); this.forEachPositionTypeInput(position, type, cb); }; SimpleFilter.prototype.forEachPositionTypeInput = function (position, type, cb) { var numberOfInputs = this.getNumberOfInputs(type); var inputs = this.getInputs(position); for (var index = 0; index < inputs.length; index++) { var input = inputs[index]; if (input != null) { cb(input, index, position, numberOfInputs); } } }; SimpleFilter.prototype.isConditionDisabled = function (position, lastUiCompletePosition) { if (this.isReadOnly()) { return true; } // Read-only mode trumps everything. if (position === 0) { return false; } // Position 0 should typically be editable. // Only allow editing of a 2nd or later condition if the previous condition is complete and no subsequent conditions are complete. return position > lastUiCompletePosition + 1; }; SimpleFilter.prototype.isConditionBodyVisible = function (position) { // Check that the condition needs inputs. var type = this.getConditionType(position); var numberOfInputs = this.getNumberOfInputs(type); return numberOfInputs > 0; }; // returns true if the UI represents a working filter, eg all parts are filled out. // eg if text filter and textfield blank then returns false. SimpleFilter.prototype.isConditionUiComplete = function (position) { if (position >= this.getNumConditions()) { return false; } // Condition doesn't exist. var type = this.getConditionType(position); if (type === SimpleFilter.EMPTY) { return false; } if (this.getValues(position).some(function (v) { return v == null; })) { return false; } return true; }; SimpleFilter.prototype.getNumConditions = function () { return this.eTypes.length; }; SimpleFilter.prototype.getUiCompleteConditions = function () { var conditions = []; for (var position = 0; position < this.getNumConditions(); position++) { if (this.isConditionUiComplete(position)) { conditions.push(this.createCondition(position)); } } return conditions; }; SimpleFilter.prototype.createMissingConditionsAndOperators = function () { if (this.isReadOnly()) { return; } // don't show incomplete conditions when read only for (var i = this.getNumConditions(); i < this.numAlwaysVisibleConditions; i++) { this.createJoinOperatorPanel(); this.createOption(); } }; SimpleFilter.prototype.resetUiToDefaults = function (silent) { var _this = this; this.removeConditionsAndOperators(this.isReadOnly() ? 1 : this.numAlwaysVisibleConditions); this.eTypes.forEach(function (eType) { return _this.resetType(eType); }); this.eJoinOperatorsAnd.forEach(function (eJoinOperatorAnd, index) { return _this.resetJoinOperatorAnd(eJoinOperatorAnd, index, _this.joinOperatorId + index); }); this.eJoinOperatorsOr.forEach(function (eJoinOperatorOr, index) { return _this.resetJoinOperatorOr(eJoinOperatorOr, index, _this.joinOperatorId + index); }); this.joinOperatorId++; this.forEachInput(function (element) { return _this.resetInput(element); }); this.resetPlaceholder(); this.createMissingConditionsAndOperators(); this.lastUiCompletePosition = null; if (!silent) { this.onUiChanged(); } return AgPromise.resolve(); }; SimpleFilter.prototype.resetType = function (eType) { var translate = this.localeService.getLocaleTextFunc(); var filteringLabel = translate('ariaFilteringOperator', 'Filtering operator'); eType .setValue(this.optionsFactory.getDefaultOption(), true) .setAriaLabel(filteringLabel) .setDisabled(this.isReadOnly()); }; SimpleFilter.prototype.resetJoinOperatorAnd = function (eJoinOperatorAnd, index, uniqueGroupId) { this.resetJoinOperator(eJoinOperatorAnd, index, this.isDefaultOperator('AND'), this.translate('andCondition'), uniqueGroupId); }; SimpleFilter.prototype.resetJoinOperatorOr = function (eJoinOperatorOr, index, uniqueGroupId) { this.resetJoinOperator(eJoinOperatorOr, index, this.isDefaultOperator('OR'), this.translate('orCondition'), uniqueGroupId); }; SimpleFilter.prototype.resetJoinOperator = function (eJoinOperator, index, value, label, uniqueGroupId) { this.updateJoinOperatorDisabled(eJoinOperator .setValue(value, true) .setName("ag-simple-filter-and-or-" + this.getCompId() + "-" + uniqueGroupId) .setLabel(label), index); }; SimpleFilter.prototype.updateJoinOperatorsDisabled = function () { var _this = this; this.eJoinOperatorsAnd.forEach(function (eJoinOperator, index) { return _this.updateJoinOperatorDisabled(eJoinOperator, index); }); this.eJoinOperatorsOr.forEach(function (eJoinOperator, index) { return _this.updateJoinOperatorDisabled(eJoinOperator, index); }); }; SimpleFilter.prototype.updateJoinOperatorDisabled = function (eJoinOperator, index) { eJoinOperator.setDisabled(this.isReadOnly() || index > 0); }; SimpleFilter.prototype.resetInput = function (element) { this.setElementValue(element, null); this.setElementDisabled(element, this.isReadOnly()); }; // puts model values into the UI SimpleFilter.prototype.setConditionIntoUi = function (model, position) { var _this = this; var values = this.mapValuesFromModel(model); this.forEachInput(function (element, index, elPosition, _) { if (elPosition !== position) { return; } _this.setElementValue(element, values[index] != null ? values[index] : null); }); }; // after floating filter changes, this sets the 'value' section. this is implemented by the base class // (as that's where value is controlled), the 'type' part from the floating filter is dealt with in this class. SimpleFilter.prototype.setValueFromFloatingFilter = function (value) { var _this = this; this.forEachInput(function (element, index, position, _) { _this.setElementValue(element, index === 0 && position === 0 ? value : null); }); }; SimpleFilter.prototype.isDefaultOperator = function (operator) { return operator === this.defaultJoinOperator; }; SimpleFilter.prototype.addChangedListeners = function (eType, position) { var _this = this; if (this.isReadOnly()) { return; } eType.onValueChange(this.listener); this.forEachPositionInput(position, function (element) { _this.attachElementOnChange(element, _this.listener); }); }; /** returns true if the row passes the said condition */ SimpleFilter.prototype.individualConditionPasses = function (params, filterModel) { var cellValue = this.getCellValue(params.node); var values = this.mapValuesFromModel(filterModel); var customFilterOption = this.optionsFactory.getCustomOption(filterModel.type); var customFilterResult = this.evaluateCustomFilter(customFilterOption, values, cellValue); if (customFilterResult != null) { return customFilterResult; } if (cellValue == null) { return this.evaluateNullValue(filterModel.type); } return this.evaluateNonNullValue(values, cellValue, filterModel, params); }; SimpleFilter.prototype.evaluateCustomFilter = function (customFilterOption, values, cellValue) { if (customFilterOption == null) { return; } var predicate = customFilterOption.predicate; // only execute the custom filter if a value exists or a value isn't required, i.e. input is hidden if (predicate != null && !values.some(function (v) { return v == null; })) { return predicate(values, cellValue); } // No custom filter invocation, indicate that to the caller. return; }; SimpleFilter.prototype.isBlank = function (cellValue) { return cellValue == null || (typeof cellValue === 'string' && cellValue.trim().length === 0); }; SimpleFilter.EMPTY = 'empty'; SimpleFilter.BLANK = 'blank'; SimpleFilter.NOT_BLANK = 'notBlank'; SimpleFilter.EQUALS = 'equals'; SimpleFilter.NOT_EQUAL = 'notEqual'; SimpleFilter.LESS_THAN = 'lessThan'; SimpleFilter.LESS_THAN_OR_EQUAL = 'lessThanOrEqual'; SimpleFilter.GREATER_THAN = 'greaterThan'; SimpleFilter.GREATER_THAN_OR_EQUAL = 'greaterThanOrEqual'; SimpleFilter.IN_RANGE = 'inRange'; SimpleFilter.CONTAINS = 'contains'; SimpleFilter.NOT_CONTAINS = 'notContains'; SimpleFilter.STARTS_WITH = 'startsWith'; SimpleFilter.ENDS_WITH = 'endsWith'; return SimpleFilter; }(ProvidedFilter)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$l = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var ScalarFilter = /** @class */ (function (_super) { __extends$l(ScalarFilter, _super); function ScalarFilter() { return _super !== null && _super.apply(this, arguments) || this; } ScalarFilter.prototype.setParams = function (params) { _super.prototype.setParams.call(this, params); this.scalarFilterParams = params; }; ScalarFilter.prototype.evaluateNullValue = function (filterType) { switch (filterType) { case ScalarFilter.EQUALS: case ScalarFilter.NOT_EQUAL: if (this.scalarFilterParams.includeBlanksInEquals) { return true; } break; case ScalarFilter.GREATER_THAN: case ScalarFilter.GREATER_THAN_OR_EQUAL: if (this.scalarFilterParams.includeBlanksInGreaterThan) { return true; } break; case ScalarFilter.LESS_THAN: case ScalarFilter.LESS_THAN_OR_EQUAL: if (this.scalarFilterParams.includeBlanksInLessThan) { return true; } break; case ScalarFilter.IN_RANGE: if (this.scalarFilterParams.includeBlanksInRange) { return true; } break; case ScalarFilter.BLANK: return true; case ScalarFilter.NOT_BLANK: return false; } return false; }; ScalarFilter.prototype.evaluateNonNullValue = function (values, cellValue, filterModel) { var comparator = this.comparator(); var compareResult = values[0] != null ? comparator(values[0], cellValue) : 0; switch (filterModel.type) { case ScalarFilter.EQUALS: return compareResult === 0; case ScalarFilter.NOT_EQUAL: return compareResult !== 0; case ScalarFilter.GREATER_THAN: return compareResult > 0; case ScalarFilter.GREATER_THAN_OR_EQUAL: return compareResult >= 0; case ScalarFilter.LESS_THAN: return compareResult < 0; case ScalarFilter.LESS_THAN_OR_EQUAL: return compareResult <= 0; case ScalarFilter.IN_RANGE: { var compareToResult = comparator(values[1], cellValue); return this.scalarFilterParams.inRangeInclusive ? compareResult >= 0 && compareToResult <= 0 : compareResult > 0 && compareToResult < 0; } case ScalarFilter.BLANK: return this.isBlank(cellValue); case ScalarFilter.NOT_BLANK: return !this.isBlank(cellValue); default: console.warn('AG Grid: Unexpected type of filter "' + filterModel.type + '", it looks like the filter was configured with incorrect Filter Options'); return true; } }; return ScalarFilter; }(SimpleFilter)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$m = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __assign$5 = (undefined && undefined.__assign) || function () { __assign$5 = Object.assign || function(t) { for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; } return t; }; return __assign$5.apply(this, arguments); }; var __decorate$n = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var DEFAULT_MIN_YEAR = 1000; var DEFAULT_MAX_YEAR = Infinity; var DateFilterModelFormatter = /** @class */ (function (_super) { __extends$m(DateFilterModelFormatter, _super); function DateFilterModelFormatter(dateFilterParams, localeService, optionsFactory) { var _this = _super.call(this, localeService, optionsFactory) || this; _this.dateFilterParams = dateFilterParams; return _this; } DateFilterModelFormatter.prototype.conditionToString = function (condition, options) { var type = condition.type; var numberOfInputs = (options || {}).numberOfInputs; var isRange = type == SimpleFilter.IN_RANGE || numberOfInputs === 2; var dateFrom = parseDateTimeFromString(condition.dateFrom); var dateTo = parseDateTimeFromString(condition.dateTo); var format = this.dateFilterParams.inRangeFloatingFilterDateFormat; if (isRange) { var formattedFrom = dateFrom !== null ? dateToFormattedString(dateFrom, format) : 'null'; var formattedTo = dateTo !== null ? dateToFormattedString(dateTo, format) : 'null'; return formattedFrom + "-" + formattedTo; } if (dateFrom != null) { return dateToFormattedString(dateFrom, format); } // cater for when the type doesn't need a value return "" + type; }; return DateFilterModelFormatter; }(SimpleFilterModelFormatter)); var DateFilter = /** @class */ (function (_super) { __extends$m(DateFilter, _super); function DateFilter() { var _this = _super.call(this, 'dateFilter') || this; _this.eConditionPanelsFrom = []; _this.eConditionPanelsTo = []; _this.dateConditionFromComps = []; _this.dateConditionToComps = []; _this.minValidYear = DEFAULT_MIN_YEAR; _this.maxValidYear = DEFAULT_MAX_YEAR; return _this; } DateFilter.prototype.afterGuiAttached = function (params) { _super.prototype.afterGuiAttached.call(this, params); this.dateConditionFromComps[0].afterGuiAttached(params); }; DateFilter.prototype.mapValuesFromModel = function (filterModel) { // unlike the other filters, we do two things here: // 1) allow for different attribute names (same as done for other filters) (eg the 'from' and 'to' // are in different locations in Date and Number filter models) // 2) convert the type (because Date filter uses Dates, however model is 'string') // // NOTE: The conversion of string to date also removes the timezone - i.e. when user picks // a date from the UI, it will have timezone info in it. This is lost when creating // the model. When we recreate the date again here, it's without a timezone. var _a = filterModel || {}, dateFrom = _a.dateFrom, dateTo = _a.dateTo, type = _a.type; return [ dateFrom && parseDateTimeFromString(dateFrom) || null, dateTo && parseDateTimeFromString(dateTo) || null, ].slice(0, this.getNumberOfInputs(type)); }; DateFilter.prototype.comparator = function () { return this.dateFilterParams.comparator ? this.dateFilterParams.comparator : this.defaultComparator.bind(this); }; DateFilter.prototype.defaultComparator = function (filterDate, cellValue) { // The default comparator assumes that the cellValue is a date var cellAsDate = cellValue; if (cellValue == null || cellAsDate < filterDate) { return -1; } if (cellAsDate > filterDate) { return 1; } return 0; }; DateFilter.prototype.setParams = function (params) { this.dateFilterParams = params; _super.prototype.setParams.call(this, params); var yearParser = function (param, fallback) { if (params[param] != null) { if (!isNaN(params[param])) { return params[param] == null ? fallback : Number(params[param]); } else { console.warn("AG Grid: DateFilter " + param + " is not a number"); } } return fallback; }; this.minValidYear = yearParser('minValidYear', DEFAULT_MIN_YEAR); this.maxValidYear = yearParser('maxValidYear', DEFAULT_MAX_YEAR); if (this.minValidYear > this.maxValidYear) { console.warn("AG Grid: DateFilter minValidYear should be <= maxValidYear"); } this.filterModelFormatter = new DateFilterModelFormatter(this.dateFilterParams, this.localeService, this.optionsFactory); }; DateFilter.prototype.createDateCompWrapper = function (element) { var _this = this; var dateCompWrapper = new DateCompWrapper(this.getContext(), this.userComponentFactory, { onDateChanged: function () { return _this.onUiChanged(); }, filterParams: this.dateFilterParams }, element); this.addDestroyFunc(function () { return dateCompWrapper.destroy(); }); return dateCompWrapper; }; DateFilter.prototype.setElementValue = function (element, value) { element.setDate(value); }; DateFilter.prototype.setElementDisplayed = function (element, displayed) { element.setDisplayed(displayed); }; DateFilter.prototype.setElementDisabled = function (element, disabled) { element.setDisabled(disabled); }; DateFilter.prototype.getDefaultFilterOptions = function () { return DateFilter.DEFAULT_FILTER_OPTIONS; }; DateFilter.prototype.createValueElement = function () { var eCondition = document.createElement('div'); eCondition.classList.add('ag-filter-body'); this.createFromToElement(eCondition, this.eConditionPanelsFrom, this.dateConditionFromComps, 'from'); this.createFromToElement(eCondition, this.eConditionPanelsTo, this.dateConditionToComps, 'to'); return eCondition; }; DateFilter.prototype.createFromToElement = function (eCondition, eConditionPanels, dateConditionComps, fromTo) { var eConditionPanel = document.createElement('div'); eConditionPanel.classList.add("ag-filter-" + fromTo); eConditionPanel.classList.add("ag-filter-date-" + fromTo); eConditionPanels.push(eConditionPanel); eCondition.appendChild(eConditionPanel); dateConditionComps.push(this.createDateCompWrapper(eConditionPanel)); }; DateFilter.prototype.removeValueElements = function (startPosition, deleteCount) { this.removeDateComps(this.dateConditionFromComps, startPosition, deleteCount); this.removeDateComps(this.dateConditionToComps, startPosition, deleteCount); this.removeItems(this.eConditionPanelsFrom, startPosition, deleteCount); this.removeItems(this.eConditionPanelsTo, startPosition, deleteCount); }; DateFilter.prototype.removeDateComps = function (components, startPosition, deleteCount) { var removedComponents = this.removeItems(components, startPosition, deleteCount); removedComponents.forEach(function (comp) { return comp.destroy(); }); }; DateFilter.prototype.isConditionUiComplete = function (position) { var _this = this; if (!_super.prototype.isConditionUiComplete.call(this, position)) { return false; } var isValidDate = function (value) { return value != null && value.getUTCFullYear() >= _this.minValidYear && value.getUTCFullYear() <= _this.maxValidYear; }; var valid = true; this.forEachInput(function (element, index, elPosition, numberOfInputs) { if (elPosition !== position || !valid || index >= numberOfInputs) { return; } valid = valid && isValidDate(element.getDate()); }); return valid; }; DateFilter.prototype.areSimpleModelsEqual = function (aSimple, bSimple) { return aSimple.dateFrom === bSimple.dateFrom && aSimple.dateTo === bSimple.dateTo && aSimple.type === bSimple.type; }; DateFilter.prototype.getFilterType = function () { return 'date'; }; DateFilter.prototype.createCondition = function (position) { var type = this.getConditionType(position); var model = {}; var values = this.getValues(position); if (values.length > 0) { model.dateFrom = serialiseDate(values[0]); } if (values.length > 1) { model.dateTo = serialiseDate(values[1]); } return __assign$5({ dateFrom: null, dateTo: null, filterType: this.getFilterType(), type: type }, model); }; DateFilter.prototype.resetPlaceholder = function () { var globalTranslate = this.localeService.getLocaleTextFunc(); var placeholder = this.translate('dateFormatOoo'); var ariaLabel = globalTranslate('ariaFilterValue', 'Filter Value'); this.forEachInput(function (element) { element.setInputPlaceholder(placeholder); element.setInputAriaLabel(ariaLabel); }); }; DateFilter.prototype.getInputs = function (position) { if (position >= this.dateConditionFromComps.length) { return [null, null]; } return [this.dateConditionFromComps[position], this.dateConditionToComps[position]]; }; DateFilter.prototype.getValues = function (position) { var result = []; this.forEachPositionInput(position, function (element, index, _elPosition, numberOfInputs) { if (index < numberOfInputs) { result.push(element.getDate()); } }); return result; }; DateFilter.prototype.getModelAsString = function (model) { var _a; return (_a = this.filterModelFormatter.getModelAsString(model)) !== null && _a !== void 0 ? _a : ''; }; DateFilter.DEFAULT_FILTER_OPTIONS = [ ScalarFilter.EQUALS, ScalarFilter.GREATER_THAN, ScalarFilter.LESS_THAN, ScalarFilter.NOT_EQUAL, ScalarFilter.IN_RANGE, ScalarFilter.BLANK, ScalarFilter.NOT_BLANK, ]; __decorate$n([ Autowired('userComponentFactory') ], DateFilter.prototype, "userComponentFactory", void 0); return DateFilter; }(ScalarFilter)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$n = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var SimpleFloatingFilter = /** @class */ (function (_super) { __extends$n(SimpleFloatingFilter, _super); function SimpleFloatingFilter() { return _super !== null && _super.apply(this, arguments) || this; } SimpleFloatingFilter.prototype.getDefaultDebounceMs = function () { return 0; }; // this is a user component, and IComponent has "public destroy()" as part of the interface. // so we need to override destroy() just to make the method public. SimpleFloatingFilter.prototype.destroy = function () { _super.prototype.destroy.call(this); }; SimpleFloatingFilter.prototype.isEventFromFloatingFilter = function (event) { return event && event.afterFloatingFilter; }; SimpleFloatingFilter.prototype.isEventFromDataChange = function (event) { return event === null || event === void 0 ? void 0 : event.afterDataChange; }; SimpleFloatingFilter.prototype.getLastType = function () { return this.lastType; }; SimpleFloatingFilter.prototype.isReadOnly = function () { return this.readOnly; }; SimpleFloatingFilter.prototype.setLastTypeFromModel = function (model) { // if no model provided by the parent filter use default if (!model) { this.lastType = this.optionsFactory.getDefaultOption(); return; } var isCombined = model.operator; var condition; if (isCombined) { var combinedModel = model; condition = combinedModel.conditions[0]; } else { condition = model; } this.lastType = condition.type; }; SimpleFloatingFilter.prototype.canWeEditAfterModelFromParentFilter = function (model) { if (!model) { // if no model, then we can edit as long as the lastType is something we can edit, as this // is the type we will provide to the parent filter if the user decides to use the floating filter. return this.isTypeEditable(this.lastType); } // never allow editing if the filter is combined (ie has two parts) var isCombined = model.operator; if (isCombined) { return false; } var simpleModel = model; return this.isTypeEditable(simpleModel.type); }; SimpleFloatingFilter.prototype.init = function (params) { this.optionsFactory = new OptionsFactory(); this.optionsFactory.init(params.filterParams, this.getDefaultFilterOptions()); this.lastType = this.optionsFactory.getDefaultOption(); // readOnly is a property of ProvidedFilterParams - we need to find a better (type-safe) // way to support reading this in the future. this.readOnly = !!params.filterParams.readOnly; // we are editable if: // 1) there is a type (user has configured filter wrong if not type) // AND // 2) the default type is not 'in range' var editable = this.isTypeEditable(this.lastType); this.setEditable(editable); }; SimpleFloatingFilter.prototype.doesFilterHaveSingleInput = function (filterType) { var customFilterOption = this.optionsFactory.getCustomOption(filterType); var numberOfInputs = (customFilterOption || {}).numberOfInputs; return numberOfInputs == null || numberOfInputs == 1; }; SimpleFloatingFilter.prototype.isTypeEditable = function (type) { var uneditableTypes = [ SimpleFilter.IN_RANGE, SimpleFilter.EMPTY, SimpleFilter.BLANK, SimpleFilter.NOT_BLANK, ]; return !!type && !this.isReadOnly() && this.doesFilterHaveSingleInput(type) && uneditableTypes.indexOf(type) < 0; }; return SimpleFloatingFilter; }(Component)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$o = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __decorate$o = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var DateFloatingFilter = /** @class */ (function (_super) { __extends$o(DateFloatingFilter, _super); function DateFloatingFilter() { return _super.call(this, /* html */ "\n
\n \n
\n
") || this; } DateFloatingFilter.prototype.getDefaultFilterOptions = function () { return DateFilter.DEFAULT_FILTER_OPTIONS; }; DateFloatingFilter.prototype.init = function (params) { _super.prototype.init.call(this, params); this.params = params; this.filterParams = params.filterParams; this.createDateComponent(); var translate = this.localeService.getLocaleTextFunc(); this.eReadOnlyText .setDisabled(true) .setInputAriaLabel(translate('ariaDateFilterInput', 'Date Filter Input')); this.filterModelFormatter = new DateFilterModelFormatter(this.filterParams, this.localeService, this.optionsFactory); }; DateFloatingFilter.prototype.setEditable = function (editable) { setDisplayed(this.eDateWrapper, editable); setDisplayed(this.eReadOnlyText.getGui(), !editable); }; DateFloatingFilter.prototype.onParentModelChanged = function (model, event) { // We don't want to update the floating filter if the floating filter caused the change, // because the UI is already in sync. if we didn't do this, the UI would behave strangely // as it would be updating as the user is typing. // This is similar for data changes, which don't affect provided date floating filters if (this.isEventFromFloatingFilter(event) || this.isEventFromDataChange(event)) { return; } _super.prototype.setLastTypeFromModel.call(this, model); var allowEditing = !this.isReadOnly() && this.canWeEditAfterModelFromParentFilter(model); this.setEditable(allowEditing); if (allowEditing) { if (model) { var dateModel = model; this.dateComp.setDate(parseDateTimeFromString(dateModel.dateFrom)); } else { this.dateComp.setDate(null); } this.eReadOnlyText.setValue(''); } else { this.eReadOnlyText.setValue(this.filterModelFormatter.getModelAsString(model)); this.dateComp.setDate(null); } }; DateFloatingFilter.prototype.onDateChanged = function () { var _this = this; var filterValueDate = this.dateComp.getDate(); var filterValueText = serialiseDate(filterValueDate); this.params.parentFilterInstance(function (filterInstance) { if (filterInstance) { var date = parseDateTimeFromString(filterValueText); filterInstance.onFloatingFilterChanged(_this.getLastType() || null, date); } }); }; DateFloatingFilter.prototype.createDateComponent = function () { var _this = this; var debounceMs = ProvidedFilter.getDebounceMs(this.params.filterParams, this.getDefaultDebounceMs()); var dateComponentParams = { onDateChanged: debounce(this.onDateChanged.bind(this), debounceMs), filterParams: this.params.column.getColDef().filterParams }; this.dateComp = new DateCompWrapper(this.getContext(), this.userComponentFactory, dateComponentParams, this.eDateWrapper); this.addDestroyFunc(function () { return _this.dateComp.destroy(); }); }; DateFloatingFilter.prototype.getFilterModelFormatter = function () { return this.filterModelFormatter; }; __decorate$o([ Autowired('userComponentFactory') ], DateFloatingFilter.prototype, "userComponentFactory", void 0); __decorate$o([ RefSelector('eReadOnlyText') ], DateFloatingFilter.prototype, "eReadOnlyText", void 0); __decorate$o([ RefSelector('eDateWrapper') ], DateFloatingFilter.prototype, "eDateWrapper", void 0); return DateFloatingFilter; }(SimpleFloatingFilter)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$p = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __decorate$p = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var DefaultDateComponent = /** @class */ (function (_super) { __extends$p(DefaultDateComponent, _super); function DefaultDateComponent() { return _super.call(this, /* html */ "\n
\n \n
") || this; } // this is a user component, and IComponent has "public destroy()" as part of the interface. // so we need to override destroy() just to make the method public. DefaultDateComponent.prototype.destroy = function () { _super.prototype.destroy.call(this); }; DefaultDateComponent.prototype.init = function (params) { var _this = this; var eDocument = this.gridOptionsService.getDocument(); var inputElement = this.eDateInput.getInputElement(); var shouldUseBrowserDatePicker = this.shouldUseBrowserDatePicker(params); if (shouldUseBrowserDatePicker) { inputElement.type = 'date'; } // ensures that the input element is focussed when a clear button is clicked, // unless using safari as there is no clear button and focus does not work properly var usingSafariDatePicker = shouldUseBrowserDatePicker && isBrowserSafari(); this.addManagedListener(inputElement, 'mousedown', function () { if (_this.eDateInput.isDisabled() || usingSafariDatePicker) { return; } inputElement.focus(); }); this.addManagedListener(inputElement, 'input', function (e) { if (e.target !== eDocument.activeElement) { return; } if (_this.eDateInput.isDisabled()) { return; } params.onDateChanged(); }); var _a = params.filterParams || {}, minValidYear = _a.minValidYear, maxValidYear = _a.maxValidYear; if (minValidYear) { inputElement.min = minValidYear + "-01-01"; } if (maxValidYear) { inputElement.max = maxValidYear + "-12-31"; } }; DefaultDateComponent.prototype.getDate = function () { return parseDateTimeFromString(this.eDateInput.getValue()); }; DefaultDateComponent.prototype.setDate = function (date) { this.eDateInput.setValue(serialiseDate(date, false)); }; DefaultDateComponent.prototype.setInputPlaceholder = function (placeholder) { this.eDateInput.setInputPlaceholder(placeholder); }; DefaultDateComponent.prototype.setDisabled = function (disabled) { this.eDateInput.setDisabled(disabled); }; DefaultDateComponent.prototype.afterGuiAttached = function (params) { if (!params || !params.suppressFocus) { this.eDateInput.getInputElement().focus(); } }; DefaultDateComponent.prototype.shouldUseBrowserDatePicker = function (params) { if (params.filterParams && params.filterParams.browserDatePicker != null) { return params.filterParams.browserDatePicker; } return isBrowserChrome() || isBrowserFirefox() || (isBrowserSafari() && getSafariVersion() >= 14.1); }; __decorate$p([ RefSelector('eDateInput') ], DefaultDateComponent.prototype, "eDateInput", void 0); return DefaultDateComponent; }(Component)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$q = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var AgInputTextField = /** @class */ (function (_super) { __extends$q(AgInputTextField, _super); function AgInputTextField(config, className, inputType) { if (className === void 0) { className = 'ag-text-field'; } if (inputType === void 0) { inputType = 'text'; } return _super.call(this, config, className, inputType) || this; } AgInputTextField.prototype.postConstruct = function () { _super.prototype.postConstruct.call(this); if (this.config.allowedCharPattern) { this.preventDisallowedCharacters(); } }; AgInputTextField.prototype.setValue = function (value, silent) { var ret = _super.prototype.setValue.call(this, value, silent); if (this.eInput.value !== value) { this.eInput.value = exists(value) ? value : ''; } return ret; }; AgInputTextField.prototype.preventDisallowedCharacters = function () { var pattern = new RegExp("[" + this.config.allowedCharPattern + "]"); var preventDisallowedCharacters = function (event) { if (event.ctrlKey || event.metaKey) { // copy/paste can fall in here on certain browsers (e.g. Safari) return; } if (event.key && !pattern.test(event.key)) { event.preventDefault(); } }; this.addManagedListener(this.eInput, 'keypress', preventDisallowedCharacters); this.addManagedListener(this.eInput, 'paste', function (e) { var _a; var text = (_a = e.clipboardData) === null || _a === void 0 ? void 0 : _a.getData('text'); if (text && text.split('').some(function (c) { return !pattern.test(c); })) { e.preventDefault(); } }); }; return AgInputTextField; }(AgAbstractInputField)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$r = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var AgInputNumberField = /** @class */ (function (_super) { __extends$r(AgInputNumberField, _super); function AgInputNumberField(config) { return _super.call(this, config, 'ag-number-field', 'number') || this; } AgInputNumberField.prototype.postConstruct = function () { var _this = this; _super.prototype.postConstruct.call(this); this.addManagedListener(this.eInput, 'blur', function () { var floatedValue = parseFloat(_this.eInput.value); var value = isNaN(floatedValue) ? '' : _this.normalizeValue(floatedValue.toString()); if (_this.value !== value) { _this.setValue(value); } }); this.addManagedListener(this.eInput, 'wheel', this.onWheel.bind(this)); this.eInput.step = 'any'; }; AgInputNumberField.prototype.onWheel = function (e) { // Prevent default scroll events from incrementing / decrementing the input, since its inconsistent between browsers if (document.activeElement === this.eInput) { e.preventDefault(); } }; AgInputNumberField.prototype.normalizeValue = function (value) { if (value === '') { return ''; } if (this.precision) { value = this.adjustPrecision(value); } var val = parseFloat(value); if (this.min != null && val < this.min) { value = this.min.toString(); } else if (this.max != null && val > this.max) { value = this.max.toString(); } return value; }; AgInputNumberField.prototype.adjustPrecision = function (value) { if (this.precision) { var floatString = parseFloat(value).toFixed(this.precision); value = parseFloat(floatString).toString(); } return value; }; AgInputNumberField.prototype.setMin = function (min) { if (this.min === min) { return this; } this.min = min; addOrRemoveAttribute(this.eInput, 'min', min); return this; }; AgInputNumberField.prototype.setMax = function (max) { if (this.max === max) { return this; } this.max = max; addOrRemoveAttribute(this.eInput, 'max', max); return this; }; AgInputNumberField.prototype.setPrecision = function (precision) { this.precision = precision; return this; }; AgInputNumberField.prototype.setStep = function (step) { if (this.step === step) { return this; } this.step = step; addOrRemoveAttribute(this.eInput, 'step', step); return this; }; AgInputNumberField.prototype.setValue = function (value, silent) { if (value != null) { value = this.adjustPrecision(value); var normalizedValue = this.normalizeValue(value); if (value != normalizedValue) { return this; } } return _super.prototype.setValue.call(this, value, silent); }; return AgInputNumberField; }(AgInputTextField)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$s = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var NumberFilterModelFormatter = /** @class */ (function (_super) { __extends$s(NumberFilterModelFormatter, _super); function NumberFilterModelFormatter() { return _super !== null && _super.apply(this, arguments) || this; } NumberFilterModelFormatter.prototype.conditionToString = function (condition, options) { var numberOfInputs = (options || {}).numberOfInputs; var isRange = condition.type == SimpleFilter.IN_RANGE || numberOfInputs === 2; if (isRange) { return condition.filter + "-" + condition.filterTo; } // cater for when the type doesn't need a value if (condition.filter != null) { return "" + condition.filter; } return "" + condition.type; }; return NumberFilterModelFormatter; }(SimpleFilterModelFormatter)); function getAllowedCharPattern(filterParams) { var allowedCharPattern = (filterParams !== null && filterParams !== void 0 ? filterParams : {}).allowedCharPattern; if (allowedCharPattern) { return allowedCharPattern; } if (!isBrowserChrome()) { // only Chrome and Edge (Chromium) have nice HTML5 number field handling, so for other browsers we provide an equivalent // constraint instead return '\\d\\-\\.'; } return null; } var NumberFilter = /** @class */ (function (_super) { __extends$s(NumberFilter, _super); function NumberFilter() { var _this = _super.call(this, 'numberFilter') || this; _this.eValuesFrom = []; _this.eValuesTo = []; return _this; } NumberFilter.prototype.mapValuesFromModel = function (filterModel) { var _a = filterModel || {}, filter = _a.filter, filterTo = _a.filterTo, type = _a.type; return [ this.processValue(filter), this.processValue(filterTo), ].slice(0, this.getNumberOfInputs(type)); }; NumberFilter.prototype.getDefaultDebounceMs = function () { return 500; }; NumberFilter.prototype.comparator = function () { return function (left, right) { if (left === right) { return 0; } return left < right ? 1 : -1; }; }; NumberFilter.prototype.setParams = function (params) { this.numberFilterParams = params; _super.prototype.setParams.call(this, params); this.filterModelFormatter = new NumberFilterModelFormatter(this.localeService, this.optionsFactory); }; NumberFilter.prototype.getDefaultFilterOptions = function () { return NumberFilter.DEFAULT_FILTER_OPTIONS; }; NumberFilter.prototype.createValueElement = function () { var allowedCharPattern = getAllowedCharPattern(this.numberFilterParams); var eCondition = document.createElement('div'); eCondition.classList.add('ag-filter-body'); setAriaRole(eCondition, 'presentation'); this.createFromToElement(eCondition, this.eValuesFrom, 'from', allowedCharPattern); this.createFromToElement(eCondition, this.eValuesTo, 'to', allowedCharPattern); return eCondition; }; NumberFilter.prototype.createFromToElement = function (eCondition, eValues, fromTo, allowedCharPattern) { var eValue = this.createManagedBean(allowedCharPattern ? new AgInputTextField({ allowedCharPattern: allowedCharPattern }) : new AgInputNumberField()); eValue.addCssClass("ag-filter-" + fromTo); eValue.addCssClass('ag-filter-filter'); eValues.push(eValue); eCondition.appendChild(eValue.getGui()); }; NumberFilter.prototype.removeValueElements = function (startPosition, deleteCount) { this.removeComponents(this.eValuesFrom, startPosition, deleteCount); this.removeComponents(this.eValuesTo, startPosition, deleteCount); }; NumberFilter.prototype.getValues = function (position) { var _this = this; var result = []; this.forEachPositionInput(position, function (element, index, _elPosition, numberOfInputs) { if (index < numberOfInputs) { result.push(_this.processValue(_this.stringToFloat(element.getValue()))); } }); return result; }; NumberFilter.prototype.areSimpleModelsEqual = function (aSimple, bSimple) { return aSimple.filter === bSimple.filter && aSimple.filterTo === bSimple.filterTo && aSimple.type === bSimple.type; }; NumberFilter.prototype.getFilterType = function () { return 'number'; }; NumberFilter.prototype.processValue = function (value) { if (value == null) { return null; } return isNaN(value) ? null : value; }; NumberFilter.prototype.stringToFloat = function (value) { if (typeof value === 'number') { return value; } var filterText = makeNull(value); if (filterText != null && filterText.trim() === '') { filterText = null; } if (this.numberFilterParams.numberParser) { return this.numberFilterParams.numberParser(filterText); } return filterText == null || filterText.trim() === '-' ? null : parseFloat(filterText); }; NumberFilter.prototype.createCondition = function (position) { var type = this.getConditionType(position); var model = { filterType: this.getFilterType(), type: type }; var values = this.getValues(position); if (values.length > 0) { model.filter = values[0]; } if (values.length > 1) { model.filterTo = values[1]; } return model; }; NumberFilter.prototype.getInputs = function (position) { if (position >= this.eValuesFrom.length) { return [null, null]; } return [this.eValuesFrom[position], this.eValuesTo[position]]; }; NumberFilter.prototype.getModelAsString = function (model) { var _a; return (_a = this.filterModelFormatter.getModelAsString(model)) !== null && _a !== void 0 ? _a : ''; }; NumberFilter.DEFAULT_FILTER_OPTIONS = [ ScalarFilter.EQUALS, ScalarFilter.NOT_EQUAL, ScalarFilter.LESS_THAN, ScalarFilter.LESS_THAN_OR_EQUAL, ScalarFilter.GREATER_THAN, ScalarFilter.GREATER_THAN_OR_EQUAL, ScalarFilter.IN_RANGE, ScalarFilter.BLANK, ScalarFilter.NOT_BLANK, ]; return NumberFilter; }(ScalarFilter)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$t = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __assign$6 = (undefined && undefined.__assign) || function () { __assign$6 = Object.assign || function(t) { for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; } return t; }; return __assign$6.apply(this, arguments); }; var TextFilterModelFormatter = /** @class */ (function (_super) { __extends$t(TextFilterModelFormatter, _super); function TextFilterModelFormatter() { return _super !== null && _super.apply(this, arguments) || this; } TextFilterModelFormatter.prototype.conditionToString = function (condition, options) { var numberOfInputs = (options || {}).numberOfInputs; var isRange = condition.type == SimpleFilter.IN_RANGE || numberOfInputs === 2; if (isRange) { return condition.filter + "-" + condition.filterTo; } // cater for when the type doesn't need a value if (condition.filter != null) { return "" + condition.filter; } return "" + condition.type; }; return TextFilterModelFormatter; }(SimpleFilterModelFormatter)); var TextFilter = /** @class */ (function (_super) { __extends$t(TextFilter, _super); function TextFilter() { var _this = _super.call(this, 'textFilter') || this; _this.eValuesFrom = []; _this.eValuesTo = []; return _this; } TextFilter.trimInput = function (value) { var trimmedInput = value && value.trim(); // trim the input, unless it is all whitespace (this is consistent with Excel behaviour) return trimmedInput === '' ? value : trimmedInput; }; TextFilter.prototype.getDefaultDebounceMs = function () { return 500; }; TextFilter.prototype.setParams = function (params) { this.textFilterParams = params; _super.prototype.setParams.call(this, params); this.matcher = this.getTextMatcher(); this.formatter = this.textFilterParams.textFormatter || (this.textFilterParams.caseSensitive ? TextFilter.DEFAULT_FORMATTER : TextFilter.DEFAULT_LOWERCASE_FORMATTER); this.filterModelFormatter = new TextFilterModelFormatter(this.localeService, this.optionsFactory); }; TextFilter.prototype.getTextMatcher = function () { var legacyComparator = this.textFilterParams.textCustomComparator; if (legacyComparator) { _.doOnce(function () { return console.warn('AG Grid - textCustomComparator is deprecated, use textMatcher instead.'); }, 'textCustomComparator.deprecated'); return function (_a) { var filterOption = _a.filterOption, value = _a.value, filterText = _a.filterText; return legacyComparator(filterOption, value, filterText); }; } return this.textFilterParams.textMatcher || TextFilter.DEFAULT_MATCHER; }; TextFilter.prototype.createCondition = function (position) { var type = this.getConditionType(position); var model = { filterType: this.getFilterType(), type: type, }; var values = this.getValues(position); if (values.length > 0) { model.filter = values[0]; } if (values.length > 1) { model.filterTo = values[1]; } return model; }; TextFilter.prototype.getFilterType = function () { return 'text'; }; TextFilter.prototype.areSimpleModelsEqual = function (aSimple, bSimple) { return aSimple.filter === bSimple.filter && aSimple.filterTo === bSimple.filterTo && aSimple.type === bSimple.type; }; TextFilter.prototype.getInputs = function (position) { if (position >= this.eValuesFrom.length) { return [null, null]; } return [this.eValuesFrom[position], this.eValuesTo[position]]; }; TextFilter.prototype.getValues = function (position) { var _this = this; var result = []; this.forEachPositionInput(position, function (element, index, _elPosition, numberOfInputs) { if (index < numberOfInputs) { var value = makeNull(element.getValue()); var cleanValue = (_this.textFilterParams.trimInput ? TextFilter.trimInput(value) : value) || null; result.push(cleanValue); element.setValue(cleanValue, true); // ensure clean value is visible } }); return result; }; TextFilter.prototype.getDefaultFilterOptions = function () { return TextFilter.DEFAULT_FILTER_OPTIONS; }; TextFilter.prototype.createValueElement = function () { var eCondition = document.createElement('div'); eCondition.classList.add('ag-filter-body'); setAriaRole(eCondition, 'presentation'); this.createFromToElement(eCondition, this.eValuesFrom, 'from'); this.createFromToElement(eCondition, this.eValuesTo, 'to'); return eCondition; }; TextFilter.prototype.createFromToElement = function (eCondition, eValues, fromTo) { var eValue = this.createManagedBean(new AgInputTextField()); eValue.addCssClass("ag-filter-" + fromTo); eValue.addCssClass('ag-filter-filter'); eValues.push(eValue); eCondition.appendChild(eValue.getGui()); }; TextFilter.prototype.removeValueElements = function (startPosition, deleteCount) { this.removeComponents(this.eValuesFrom, startPosition, deleteCount); this.removeComponents(this.eValuesTo, startPosition, deleteCount); }; TextFilter.prototype.mapValuesFromModel = function (filterModel) { var _a = filterModel || {}, filter = _a.filter, filterTo = _a.filterTo, type = _a.type; return [ filter || null, filterTo || null, ].slice(0, this.getNumberOfInputs(type)); }; TextFilter.prototype.evaluateNullValue = function (filterType) { var filterTypesAllowNulls = [ SimpleFilter.NOT_EQUAL, SimpleFilter.NOT_CONTAINS, SimpleFilter.BLANK, ]; return filterType ? filterTypesAllowNulls.indexOf(filterType) >= 0 : false; }; TextFilter.prototype.evaluateNonNullValue = function (values, cellValue, filterModel, params) { var _this = this; var formattedValues = values.map(function (v) { return _this.formatter(v); }) || []; var cellValueFormatted = this.formatter(cellValue); var _a = this.textFilterParams, api = _a.api, colDef = _a.colDef, column = _a.column, columnApi = _a.columnApi, context = _a.context, textFormatter = _a.textFormatter; if (filterModel.type === SimpleFilter.BLANK) { return this.isBlank(cellValue); } else if (filterModel.type === SimpleFilter.NOT_BLANK) { return !this.isBlank(cellValue); } var matcherParams = { api: api, colDef: colDef, column: column, columnApi: columnApi, context: context, node: params.node, data: params.data, filterOption: filterModel.type, value: cellValueFormatted, textFormatter: textFormatter, }; return formattedValues.some(function (v) { return _this.matcher(__assign$6(__assign$6({}, matcherParams), { filterText: v })); }); }; TextFilter.prototype.getModelAsString = function (model) { var _a; return (_a = this.filterModelFormatter.getModelAsString(model)) !== null && _a !== void 0 ? _a : ''; }; TextFilter.DEFAULT_FILTER_OPTIONS = [ SimpleFilter.CONTAINS, SimpleFilter.NOT_CONTAINS, SimpleFilter.EQUALS, SimpleFilter.NOT_EQUAL, SimpleFilter.STARTS_WITH, SimpleFilter.ENDS_WITH, SimpleFilter.BLANK, SimpleFilter.NOT_BLANK, ]; TextFilter.DEFAULT_FORMATTER = function (from) { return from; }; TextFilter.DEFAULT_LOWERCASE_FORMATTER = function (from) { return from == null ? null : from.toString().toLowerCase(); }; TextFilter.DEFAULT_MATCHER = function (_a) { var filterOption = _a.filterOption, value = _a.value, filterText = _a.filterText; if (filterText == null) { return false; } switch (filterOption) { case TextFilter.CONTAINS: return value.indexOf(filterText) >= 0; case TextFilter.NOT_CONTAINS: return value.indexOf(filterText) < 0; case TextFilter.EQUALS: return value === filterText; case TextFilter.NOT_EQUAL: return value != filterText; case TextFilter.STARTS_WITH: return value.indexOf(filterText) === 0; case TextFilter.ENDS_WITH: var index = value.lastIndexOf(filterText); return index >= 0 && index === (value.length - filterText.length); default: return false; } }; return TextFilter; }(SimpleFilter)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$u = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __decorate$q = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var FloatingFilterTextInputService = /** @class */ (function (_super) { __extends$u(FloatingFilterTextInputService, _super); function FloatingFilterTextInputService(params) { var _this = _super.call(this) || this; _this.params = params; return _this; } FloatingFilterTextInputService.prototype.setupGui = function (parentElement) { this.eFloatingFilterTextInput = this.createManagedBean(new AgInputTextField(this.params.config)); this.eFloatingFilterTextInput.setInputAriaLabel(this.params.ariaLabel); parentElement.appendChild(this.eFloatingFilterTextInput.getGui()); }; FloatingFilterTextInputService.prototype.setEditable = function (editable) { this.eFloatingFilterTextInput.setDisabled(!editable); }; FloatingFilterTextInputService.prototype.getValue = function () { return this.eFloatingFilterTextInput.getValue(); }; FloatingFilterTextInputService.prototype.setValue = function (value, silent) { this.eFloatingFilterTextInput.setValue(value, silent); }; FloatingFilterTextInputService.prototype.addValueChangedListener = function (listener) { var inputGui = this.eFloatingFilterTextInput.getGui(); this.addManagedListener(inputGui, 'input', listener); this.addManagedListener(inputGui, 'keypress', listener); this.addManagedListener(inputGui, 'keydown', listener); }; return FloatingFilterTextInputService; }(BeanStub)); var TextInputFloatingFilter = /** @class */ (function (_super) { __extends$u(TextInputFloatingFilter, _super); function TextInputFloatingFilter() { return _super !== null && _super.apply(this, arguments) || this; } TextInputFloatingFilter.prototype.postConstruct = function () { this.setTemplate(/* html */ "\n
\n "); }; TextInputFloatingFilter.prototype.getDefaultDebounceMs = function () { return 500; }; TextInputFloatingFilter.prototype.onParentModelChanged = function (model, event) { if (this.isEventFromFloatingFilter(event) || this.isEventFromDataChange(event)) { // if the floating filter triggered the change, it is already in sync. // Data changes also do not affect provided text floating filters return; } this.setLastTypeFromModel(model); this.setEditable(this.canWeEditAfterModelFromParentFilter(model)); this.floatingFilterInputService.setValue(this.getFilterModelFormatter().getModelAsString(model)); }; TextInputFloatingFilter.prototype.init = function (params) { this.params = params; var displayName = this.columnModel.getDisplayNameForColumn(params.column, 'header', true); var translate = this.localeService.getLocaleTextFunc(); var ariaLabel = displayName + " " + translate('ariaFilterInput', 'Filter Input'); this.floatingFilterInputService = this.createFloatingFilterInputService(ariaLabel); this.floatingFilterInputService.setupGui(this.eFloatingFilterInputContainer); _super.prototype.init.call(this, params); this.applyActive = ProvidedFilter.isUseApplyButton(this.params.filterParams); if (!this.isReadOnly()) { var debounceMs = ProvidedFilter.getDebounceMs(this.params.filterParams, this.getDefaultDebounceMs()); var toDebounce = debounce(this.syncUpWithParentFilter.bind(this), debounceMs); this.floatingFilterInputService.addValueChangedListener(toDebounce); } }; TextInputFloatingFilter.prototype.syncUpWithParentFilter = function (e) { var _this = this; var enterKeyPressed = e.key === KeyCode.ENTER; if (this.applyActive && !enterKeyPressed) { return; } var value = this.floatingFilterInputService.getValue(); if (this.params.filterParams.trimInput) { value = TextFilter.trimInput(value); this.floatingFilterInputService.setValue(value, true); // ensure visible value is trimmed } this.params.parentFilterInstance(function (filterInstance) { if (filterInstance) { // NumberFilter is typed as number, but actually receives string values filterInstance.onFloatingFilterChanged(_this.getLastType() || null, value || null); } }); }; TextInputFloatingFilter.prototype.setEditable = function (editable) { this.floatingFilterInputService.setEditable(editable); }; __decorate$q([ Autowired('columnModel') ], TextInputFloatingFilter.prototype, "columnModel", void 0); __decorate$q([ RefSelector('eFloatingFilterInputContainer') ], TextInputFloatingFilter.prototype, "eFloatingFilterInputContainer", void 0); __decorate$q([ PostConstruct ], TextInputFloatingFilter.prototype, "postConstruct", null); return TextInputFloatingFilter; }(SimpleFloatingFilter)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$v = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var FloatingFilterNumberInputService = /** @class */ (function (_super) { __extends$v(FloatingFilterNumberInputService, _super); function FloatingFilterNumberInputService(params) { var _this = _super.call(this) || this; _this.params = params; _this.numberInputActive = true; return _this; } FloatingFilterNumberInputService.prototype.setupGui = function (parentElement) { this.eFloatingFilterNumberInput = this.createManagedBean(new AgInputNumberField()); this.eFloatingFilterTextInput = this.createManagedBean(new AgInputTextField()); this.eFloatingFilterTextInput.setDisabled(true); this.eFloatingFilterNumberInput.setInputAriaLabel(this.params.ariaLabel); this.eFloatingFilterTextInput.setInputAriaLabel(this.params.ariaLabel); parentElement.appendChild(this.eFloatingFilterNumberInput.getGui()); parentElement.appendChild(this.eFloatingFilterTextInput.getGui()); }; FloatingFilterNumberInputService.prototype.setEditable = function (editable) { this.numberInputActive = editable; this.eFloatingFilterNumberInput.setDisplayed(this.numberInputActive); this.eFloatingFilterTextInput.setDisplayed(!this.numberInputActive); }; FloatingFilterNumberInputService.prototype.getValue = function () { return this.getActiveInputElement().getValue(); }; FloatingFilterNumberInputService.prototype.setValue = function (value, silent) { this.getActiveInputElement().setValue(value, silent); }; FloatingFilterNumberInputService.prototype.getActiveInputElement = function () { return this.numberInputActive ? this.eFloatingFilterNumberInput : this.eFloatingFilterTextInput; }; FloatingFilterNumberInputService.prototype.addValueChangedListener = function (listener) { this.setupListeners(this.eFloatingFilterNumberInput.getGui(), listener); this.setupListeners(this.eFloatingFilterTextInput.getGui(), listener); }; FloatingFilterNumberInputService.prototype.setupListeners = function (element, listener) { this.addManagedListener(element, 'input', listener); this.addManagedListener(element, 'keypress', listener); this.addManagedListener(element, 'keydown', listener); }; return FloatingFilterNumberInputService; }(BeanStub)); var NumberFloatingFilter = /** @class */ (function (_super) { __extends$v(NumberFloatingFilter, _super); function NumberFloatingFilter() { return _super !== null && _super.apply(this, arguments) || this; } NumberFloatingFilter.prototype.init = function (params) { _super.prototype.init.call(this, params); this.filterModelFormatter = new NumberFilterModelFormatter(this.localeService, this.optionsFactory); }; NumberFloatingFilter.prototype.getDefaultFilterOptions = function () { return NumberFilter.DEFAULT_FILTER_OPTIONS; }; NumberFloatingFilter.prototype.getFilterModelFormatter = function () { return this.filterModelFormatter; }; NumberFloatingFilter.prototype.createFloatingFilterInputService = function (ariaLabel) { var allowedCharPattern = getAllowedCharPattern(this.params.filterParams); if (allowedCharPattern) { // need to sue text input return this.createManagedBean(new FloatingFilterTextInputService({ config: { allowedCharPattern: allowedCharPattern }, ariaLabel: ariaLabel })); } return this.createManagedBean(new FloatingFilterNumberInputService({ ariaLabel: ariaLabel })); }; return NumberFloatingFilter; }(TextInputFloatingFilter)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$w = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var TextFloatingFilter = /** @class */ (function (_super) { __extends$w(TextFloatingFilter, _super); function TextFloatingFilter() { return _super !== null && _super.apply(this, arguments) || this; } TextFloatingFilter.prototype.init = function (params) { _super.prototype.init.call(this, params); this.filterModelFormatter = new TextFilterModelFormatter(this.localeService, this.optionsFactory); }; TextFloatingFilter.prototype.getDefaultFilterOptions = function () { return TextFilter.DEFAULT_FILTER_OPTIONS; }; TextFloatingFilter.prototype.getFilterModelFormatter = function () { return this.filterModelFormatter; }; TextFloatingFilter.prototype.createFloatingFilterInputService = function (ariaLabel) { return this.createManagedBean(new FloatingFilterTextInputService({ ariaLabel: ariaLabel })); }; return TextFloatingFilter; }(TextInputFloatingFilter)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var TouchListener = /** @class */ (function () { function TouchListener(eElement, preventMouseClick) { var _this = this; if (preventMouseClick === void 0) { preventMouseClick = false; } this.destroyFuncs = []; this.touching = false; this.eventService = new EventService(); this.eElement = eElement; this.preventMouseClick = preventMouseClick; var startListener = this.onTouchStart.bind(this); var moveListener = this.onTouchMove.bind(this); var endListener = this.onTouchEnd.bind(this); this.eElement.addEventListener("touchstart", startListener, { passive: true }); this.eElement.addEventListener("touchmove", moveListener, { passive: true }); // we set passive=false, as we want to prevent default on this event this.eElement.addEventListener("touchend", endListener, { passive: false }); this.destroyFuncs.push(function () { _this.eElement.removeEventListener("touchstart", startListener, { passive: true }); _this.eElement.removeEventListener("touchmove", moveListener, { passive: true }); _this.eElement.removeEventListener("touchend", endListener, { passive: false }); }); } TouchListener.prototype.getActiveTouch = function (touchList) { for (var i = 0; i < touchList.length; i++) { var matches = touchList[i].identifier === this.touchStart.identifier; if (matches) { return touchList[i]; } } return null; }; TouchListener.prototype.addEventListener = function (eventType, listener) { this.eventService.addEventListener(eventType, listener); }; TouchListener.prototype.removeEventListener = function (eventType, listener) { this.eventService.removeEventListener(eventType, listener); }; TouchListener.prototype.onTouchStart = function (touchEvent) { var _this = this; // only looking at one touch point at any time if (this.touching) { return; } this.touchStart = touchEvent.touches[0]; this.touching = true; this.moved = false; var touchStartCopy = this.touchStart; window.setTimeout(function () { var touchesMatch = _this.touchStart === touchStartCopy; if (_this.touching && touchesMatch && !_this.moved) { _this.moved = true; var event_1 = { type: TouchListener.EVENT_LONG_TAP, touchStart: _this.touchStart, touchEvent: touchEvent }; _this.eventService.dispatchEvent(event_1); } }, 500); }; TouchListener.prototype.onTouchMove = function (touchEvent) { if (!this.touching) { return; } var touch = this.getActiveTouch(touchEvent.touches); if (!touch) { return; } var eventIsFarAway = !areEventsNear(touch, this.touchStart, 4); if (eventIsFarAway) { this.moved = true; } }; TouchListener.prototype.onTouchEnd = function (touchEvent) { if (!this.touching) { return; } if (!this.moved) { var event_2 = { type: TouchListener.EVENT_TAP, touchStart: this.touchStart }; this.eventService.dispatchEvent(event_2); this.checkForDoubleTap(); } // stops the tap from also been processed as a mouse click if (this.preventMouseClick && touchEvent.cancelable) { touchEvent.preventDefault(); } this.touching = false; }; TouchListener.prototype.checkForDoubleTap = function () { var now = new Date().getTime(); if (this.lastTapTime && this.lastTapTime > 0) { // if previous tap, see if duration is short enough to be considered double tap var interval = now - this.lastTapTime; if (interval > TouchListener.DOUBLE_TAP_MILLIS) { // dispatch double tap event var event_3 = { type: TouchListener.EVENT_DOUBLE_TAP, touchStart: this.touchStart }; this.eventService.dispatchEvent(event_3); // this stops a tripple tap ending up as two double taps this.lastTapTime = null; } else { this.lastTapTime = now; } } else { this.lastTapTime = now; } }; TouchListener.prototype.destroy = function () { this.destroyFuncs.forEach(function (func) { return func(); }); }; TouchListener.EVENT_TAP = "tap"; TouchListener.EVENT_DOUBLE_TAP = "doubleTap"; TouchListener.EVENT_LONG_TAP = "longTap"; TouchListener.DOUBLE_TAP_MILLIS = 500; return TouchListener; }()); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$x = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __decorate$r = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var SortIndicatorComp = /** @class */ (function (_super) { __extends$x(SortIndicatorComp, _super); function SortIndicatorComp(skipTemplate) { var _this = _super.call(this) || this; if (!skipTemplate) { _this.setTemplate(SortIndicatorComp.TEMPLATE); } return _this; } SortIndicatorComp.prototype.attachCustomElements = function (eSortOrder, eSortAsc, eSortDesc, eSortMixed, eSortNone) { this.eSortOrder = eSortOrder; this.eSortAsc = eSortAsc; this.eSortDesc = eSortDesc; this.eSortMixed = eSortMixed; this.eSortNone = eSortNone; }; SortIndicatorComp.prototype.setupSort = function (column, suppressOrder) { var _this = this; if (suppressOrder === void 0) { suppressOrder = false; } this.column = column; this.suppressOrder = suppressOrder; this.setupMultiSortIndicator(); var canSort = !!this.column.getColDef().sortable; if (!canSort) { return; } this.addInIcon('sortAscending', this.eSortAsc, column); this.addInIcon('sortDescending', this.eSortDesc, column); this.addInIcon('sortUnSort', this.eSortNone, column); // Watch global events, as row group columns can effect their display column. this.addManagedListener(this.eventService, Events.EVENT_SORT_CHANGED, function () { return _this.onSortChanged(); }); // when grouping changes so can sort indexes and icons this.addManagedListener(this.eventService, Events.EVENT_COLUMN_ROW_GROUP_CHANGED, function () { return _this.onSortChanged(); }); this.onSortChanged(); }; SortIndicatorComp.prototype.addInIcon = function (iconName, eParent, column) { if (eParent == null) { return; } var eIcon = createIconNoSpan(iconName, this.gridOptionsService, column); if (eIcon) { eParent.appendChild(eIcon); } }; SortIndicatorComp.prototype.onSortChanged = function () { this.updateIcons(); if (!this.suppressOrder) { this.updateSortOrder(); } }; SortIndicatorComp.prototype.updateIcons = function () { var sortDirection = this.sortController.getDisplaySortForColumn(this.column); if (this.eSortAsc) { var isAscending = sortDirection === 'asc'; setDisplayed(this.eSortAsc, isAscending, { skipAriaHidden: true }); } if (this.eSortDesc) { var isDescending = sortDirection === 'desc'; setDisplayed(this.eSortDesc, isDescending, { skipAriaHidden: true }); } if (this.eSortNone) { var alwaysHideNoSort = !this.column.getColDef().unSortIcon && !this.gridOptionsService.is('unSortIcon'); var isNone = sortDirection === null || sortDirection === undefined; setDisplayed(this.eSortNone, !alwaysHideNoSort && isNone, { skipAriaHidden: true }); } }; SortIndicatorComp.prototype.setupMultiSortIndicator = function () { var _this = this; this.addInIcon('sortUnSort', this.eSortMixed, this.column); var isColumnShowingRowGroup = this.column.getColDef().showRowGroup; var areGroupsCoupled = this.gridOptionsService.isColumnsSortingCoupledToGroup(); if (areGroupsCoupled && isColumnShowingRowGroup) { // Watch global events, as row group columns can effect their display column. this.addManagedListener(this.eventService, Events.EVENT_SORT_CHANGED, function () { return _this.updateMultiSortIndicator(); }); // when grouping changes so can sort indexes and icons this.addManagedListener(this.eventService, Events.EVENT_COLUMN_ROW_GROUP_CHANGED, function () { return _this.updateMultiSortIndicator(); }); this.updateMultiSortIndicator(); } }; SortIndicatorComp.prototype.updateMultiSortIndicator = function () { if (this.eSortMixed) { var isMixedSort = this.sortController.getDisplaySortForColumn(this.column) === 'mixed'; setDisplayed(this.eSortMixed, isMixedSort, { skipAriaHidden: true }); } }; // we listen here for global sort events, NOT column sort events, as we want to do this // when sorting has been set on all column (if we listened just for our col (where we // set the asc / desc icons) then it's possible other cols are yet to get their sorting state. SortIndicatorComp.prototype.updateSortOrder = function () { var _this = this; var _a; if (!this.eSortOrder) { return; } var allColumnsWithSorting = this.sortController.getColumnsWithSortingOrdered(); var indexThisCol = (_a = this.sortController.getDisplaySortIndexForColumn(this.column)) !== null && _a !== void 0 ? _a : -1; var moreThanOneColSorting = allColumnsWithSorting.some(function (col) { var _a; return (_a = _this.sortController.getDisplaySortIndexForColumn(col)) !== null && _a !== void 0 ? _a : -1 >= 1; }); var showIndex = indexThisCol >= 0 && moreThanOneColSorting; setDisplayed(this.eSortOrder, showIndex, { skipAriaHidden: true }); if (indexThisCol >= 0) { this.eSortOrder.innerHTML = (indexThisCol + 1).toString(); } else { clearElement(this.eSortOrder); } }; SortIndicatorComp.TEMPLATE = "\n \n \n \n \n \n "; __decorate$r([ RefSelector('eSortOrder') ], SortIndicatorComp.prototype, "eSortOrder", void 0); __decorate$r([ RefSelector('eSortAsc') ], SortIndicatorComp.prototype, "eSortAsc", void 0); __decorate$r([ RefSelector('eSortDesc') ], SortIndicatorComp.prototype, "eSortDesc", void 0); __decorate$r([ RefSelector('eSortMixed') ], SortIndicatorComp.prototype, "eSortMixed", void 0); __decorate$r([ RefSelector('eSortNone') ], SortIndicatorComp.prototype, "eSortNone", void 0); __decorate$r([ Autowired('columnModel') ], SortIndicatorComp.prototype, "columnModel", void 0); __decorate$r([ Autowired('sortController') ], SortIndicatorComp.prototype, "sortController", void 0); return SortIndicatorComp; }(Component)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$y = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __decorate$s = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var HeaderComp = /** @class */ (function (_super) { __extends$y(HeaderComp, _super); function HeaderComp() { var _this = _super !== null && _super.apply(this, arguments) || this; _this.lastMovingChanged = 0; return _this; } // this is a user component, and IComponent has "public destroy()" as part of the interface. // so we need to override destroy() just to make the method public. HeaderComp.prototype.destroy = function () { _super.prototype.destroy.call(this); }; HeaderComp.prototype.refresh = function (params) { this.params = params; // if template changed, then recreate the whole comp, the code required to manage // a changing template is to difficult for what it's worth. if (this.workOutTemplate() != this.currentTemplate) { return false; } if (this.workOutShowMenu() != this.currentShowMenu) { return false; } if (this.workOutSort() != this.currentSort) { return false; } this.setDisplayName(params); return true; }; HeaderComp.prototype.workOutTemplate = function () { var template = firstExistingValue(this.params.template, HeaderComp.TEMPLATE); // take account of any newlines & whitespace before/after the actual template template = template && template.trim ? template.trim() : template; return template; }; HeaderComp.prototype.init = function (params) { this.params = params; this.currentTemplate = this.workOutTemplate(); this.setTemplate(this.currentTemplate); this.setupTap(); this.setupIcons(params.column); this.setMenu(); this.setupSort(); this.setupFilterIcon(); this.setDisplayName(params); }; HeaderComp.prototype.setDisplayName = function (params) { if (this.currentDisplayName != params.displayName) { this.currentDisplayName = params.displayName; var displayNameSanitised = escapeString(this.currentDisplayName); if (this.eText) { this.eText.innerHTML = displayNameSanitised; } } }; HeaderComp.prototype.setupIcons = function (column) { this.addInIcon('menu', this.eMenu, column); this.addInIcon('filter', this.eFilter, column); }; HeaderComp.prototype.addInIcon = function (iconName, eParent, column) { if (eParent == null) { return; } var eIcon = createIconNoSpan(iconName, this.gridOptionsService, column); if (eIcon) { eParent.appendChild(eIcon); } }; HeaderComp.prototype.setupTap = function () { var _this = this; var gridOptionsService = this.gridOptionsService; if (gridOptionsService.is('suppressTouch')) { return; } var touchListener = new TouchListener(this.getGui(), true); var suppressMenuHide = gridOptionsService.is('suppressMenuHide'); var tapMenuButton = suppressMenuHide && exists(this.eMenu); var menuTouchListener = tapMenuButton ? new TouchListener(this.eMenu, true) : touchListener; if (this.params.enableMenu) { var eventType = tapMenuButton ? 'EVENT_TAP' : 'EVENT_LONG_TAP'; var showMenuFn = function (event) { gridOptionsService.api.showColumnMenuAfterMouseClick(_this.params.column, event.touchStart); }; this.addManagedListener(menuTouchListener, TouchListener[eventType], showMenuFn); } if (this.params.enableSorting) { var tapListener = function (event) { var target = event.touchStart.target; // When suppressMenuHide is true, a tap on the menu icon will bubble up // to the header container, in that case we should not sort if (suppressMenuHide && _this.eMenu.contains(target)) { return; } _this.sortController.progressSort(_this.params.column, false, "uiColumnSorted"); }; this.addManagedListener(touchListener, TouchListener.EVENT_TAP, tapListener); } // if tapMenuButton is true `touchListener` and `menuTouchListener` are different // so we need to make sure to destroy both listeners here this.addDestroyFunc(function () { return touchListener.destroy(); }); if (tapMenuButton) { this.addDestroyFunc(function () { return menuTouchListener.destroy(); }); } }; HeaderComp.prototype.workOutShowMenu = function () { // we don't show the menu if on an iPad/iPhone, as the user cannot have a pointer device/ // However if suppressMenuHide is set to true the menu will be displayed alwasys, so it's ok // to show it on iPad in this case (as hover isn't needed). If suppressMenuHide // is false (default) user will need to use longpress to display the menu. var menuHides = !this.gridOptionsService.is('suppressMenuHide'); var onIpadAndMenuHides = isIOSUserAgent() && menuHides; var showMenu = this.params.enableMenu && !onIpadAndMenuHides; return showMenu; }; HeaderComp.prototype.setMenu = function () { var _this = this; // if no menu provided in template, do nothing if (!this.eMenu) { return; } this.currentShowMenu = this.workOutShowMenu(); if (!this.currentShowMenu) { removeFromParent(this.eMenu); return; } var suppressMenuHide = this.gridOptionsService.is('suppressMenuHide'); this.addManagedListener(this.eMenu, 'click', function () { return _this.showMenu(_this.eMenu); }); this.eMenu.classList.toggle('ag-header-menu-always-show', suppressMenuHide); }; HeaderComp.prototype.showMenu = function (eventSource) { if (!eventSource) { eventSource = this.eMenu; } this.menuFactory.showMenuAfterButtonClick(this.params.column, eventSource, 'columnMenu'); }; HeaderComp.prototype.workOutSort = function () { return this.params.enableSorting; }; HeaderComp.prototype.setupSort = function () { var _this = this; this.currentSort = this.params.enableSorting; // eSortIndicator will not be present when customers provided custom header // templates, in that case, we need to look for provided sort elements and // manually create eSortIndicator. if (!this.eSortIndicator) { this.eSortIndicator = this.context.createBean(new SortIndicatorComp(true)); this.eSortIndicator.attachCustomElements(this.eSortOrder, this.eSortAsc, this.eSortDesc, this.eSortMixed, this.eSortNone); } this.eSortIndicator.setupSort(this.params.column); // we set up the indicator prior to the check for whether this column is sortable, as it allows the indicator to // set up the multi sort indicator which can appear irrelevant of whether this column can itself be sorted. // this can occur in the case of a non-sortable group display column. if (!this.currentSort) { return; } var sortUsingCtrl = this.gridOptionsService.get('multiSortKey') === 'ctrl'; // keep track of last time the moving changed flag was set this.addManagedListener(this.params.column, Column.EVENT_MOVING_CHANGED, function () { _this.lastMovingChanged = new Date().getTime(); }); // add the event on the header, so when clicked, we do sorting if (this.eLabel) { this.addManagedListener(this.eLabel, 'click', function (event) { // sometimes when moving a column via dragging, this was also firing a clicked event. // here is issue raised by user: https://ag-grid.zendesk.com/agent/tickets/1076 // this check stops sort if a) column is moving or b) column moved less than 200ms ago (so caters for race condition) var moving = _this.params.column.isMoving(); var nowTime = new Date().getTime(); // typically there is <2ms if moving flag was set recently, as it would be done in same VM turn var movedRecently = (nowTime - _this.lastMovingChanged) < 50; var columnMoving = moving || movedRecently; if (!columnMoving) { var multiSort = sortUsingCtrl ? (event.ctrlKey || event.metaKey) : event.shiftKey; _this.params.progressSort(multiSort); } }); } var onSortingChanged = function () { _this.addOrRemoveCssClass('ag-header-cell-sorted-asc', _this.params.column.isSortAscending()); _this.addOrRemoveCssClass('ag-header-cell-sorted-desc', _this.params.column.isSortDescending()); _this.addOrRemoveCssClass('ag-header-cell-sorted-none', _this.params.column.isSortNone()); if (_this.params.column.getColDef().showRowGroup) { var sourceColumns = _this.columnModel.getSourceColumnsForGroupColumn(_this.params.column); // this == is intentional, as it allows null and undefined to match, which are both unsorted states var sortDirectionsMatch = sourceColumns === null || sourceColumns === void 0 ? void 0 : sourceColumns.every(function (sourceCol) { return _this.params.column.getSort() == sourceCol.getSort(); }); var isMultiSorting = !sortDirectionsMatch; _this.addOrRemoveCssClass('ag-header-cell-sorted-mixed', isMultiSorting); } }; this.addManagedListener(this.eventService, Events.EVENT_SORT_CHANGED, onSortingChanged); this.addManagedListener(this.eventService, Events.EVENT_COLUMN_ROW_GROUP_CHANGED, onSortingChanged); }; HeaderComp.prototype.setupFilterIcon = function () { if (!this.eFilter) { return; } this.addManagedListener(this.params.column, Column.EVENT_FILTER_CHANGED, this.onFilterChanged.bind(this)); this.onFilterChanged(); }; HeaderComp.prototype.onFilterChanged = function () { var filterPresent = this.params.column.isFilterActive(); setDisplayed(this.eFilter, filterPresent, { skipAriaHidden: true }); }; HeaderComp.TEMPLATE = "
\n \n
\n \n \n \n
\n
"; __decorate$s([ Autowired('sortController') ], HeaderComp.prototype, "sortController", void 0); __decorate$s([ Autowired('menuFactory') ], HeaderComp.prototype, "menuFactory", void 0); __decorate$s([ Autowired('columnModel') ], HeaderComp.prototype, "columnModel", void 0); __decorate$s([ RefSelector('eFilter') ], HeaderComp.prototype, "eFilter", void 0); __decorate$s([ RefSelector('eSortIndicator') ], HeaderComp.prototype, "eSortIndicator", void 0); __decorate$s([ RefSelector('eMenu') ], HeaderComp.prototype, "eMenu", void 0); __decorate$s([ RefSelector('eLabel') ], HeaderComp.prototype, "eLabel", void 0); __decorate$s([ RefSelector('eText') ], HeaderComp.prototype, "eText", void 0); __decorate$s([ RefSelector('eSortOrder') ], HeaderComp.prototype, "eSortOrder", void 0); __decorate$s([ RefSelector('eSortAsc') ], HeaderComp.prototype, "eSortAsc", void 0); __decorate$s([ RefSelector('eSortDesc') ], HeaderComp.prototype, "eSortDesc", void 0); __decorate$s([ RefSelector('eSortMixed') ], HeaderComp.prototype, "eSortMixed", void 0); __decorate$s([ RefSelector('eSortNone') ], HeaderComp.prototype, "eSortNone", void 0); return HeaderComp; }(Component)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$z = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __decorate$t = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var HeaderGroupComp = /** @class */ (function (_super) { __extends$z(HeaderGroupComp, _super); function HeaderGroupComp() { return _super.call(this, HeaderGroupComp.TEMPLATE) || this; } // this is a user component, and IComponent has "public destroy()" as part of the interface. // so we need to override destroy() just to make the method public. HeaderGroupComp.prototype.destroy = function () { _super.prototype.destroy.call(this); }; HeaderGroupComp.prototype.init = function (params) { this.params = params; this.checkWarnings(); this.setupLabel(); this.addGroupExpandIcon(); this.setupExpandIcons(); }; HeaderGroupComp.prototype.checkWarnings = function () { var paramsAny = this.params; if (paramsAny.template) { var message_1 = "AG Grid: A template was provided for Header Group Comp - templates are only supported for Header Comps (not groups)"; doOnce(function () { return console.warn(message_1); }, 'HeaderGroupComp.templateNotSupported'); } }; HeaderGroupComp.prototype.setupExpandIcons = function () { var _this = this; this.addInIcon("columnGroupOpened", "agOpened"); this.addInIcon("columnGroupClosed", "agClosed"); var expandAction = function (event) { if (isStopPropagationForAgGrid(event)) { return; } var newExpandedValue = !_this.params.columnGroup.isExpanded(); _this.columnModel.setColumnGroupOpened(_this.params.columnGroup.getProvidedColumnGroup(), newExpandedValue, "uiColumnExpanded"); }; this.addTouchAndClickListeners(this.eCloseIcon, expandAction); this.addTouchAndClickListeners(this.eOpenIcon, expandAction); var stopPropagationAction = function (event) { stopPropagationForAgGrid(event); }; // adding stopPropagation to the double click for the icons prevents double click action happening // when the icons are clicked. if the icons are double clicked, then the groups should open and // then close again straight away. if we also listened to double click, then the group would open, // close, then open, which is not what we want. double click should only action if the user double // clicks outside of the icons. this.addManagedListener(this.eCloseIcon, "dblclick", stopPropagationAction); this.addManagedListener(this.eOpenIcon, "dblclick", stopPropagationAction); this.addManagedListener(this.getGui(), "dblclick", expandAction); this.updateIconVisibility(); var providedColumnGroup = this.params.columnGroup.getProvidedColumnGroup(); this.addManagedListener(providedColumnGroup, ProvidedColumnGroup.EVENT_EXPANDED_CHANGED, this.updateIconVisibility.bind(this)); this.addManagedListener(providedColumnGroup, ProvidedColumnGroup.EVENT_EXPANDABLE_CHANGED, this.updateIconVisibility.bind(this)); }; HeaderGroupComp.prototype.addTouchAndClickListeners = function (eElement, action) { var touchListener = new TouchListener(eElement, true); this.addManagedListener(touchListener, TouchListener.EVENT_TAP, action); this.addDestroyFunc(function () { return touchListener.destroy(); }); this.addManagedListener(eElement, "click", action); }; HeaderGroupComp.prototype.updateIconVisibility = function () { var columnGroup = this.params.columnGroup; if (columnGroup.isExpandable()) { var expanded = this.params.columnGroup.isExpanded(); setDisplayed(this.eOpenIcon, expanded); setDisplayed(this.eCloseIcon, !expanded); } else { setDisplayed(this.eOpenIcon, false); setDisplayed(this.eCloseIcon, false); } }; HeaderGroupComp.prototype.addInIcon = function (iconName, refName) { var eIcon = createIconNoSpan(iconName, this.gridOptionsService, null); if (eIcon) { this.getRefElement(refName).appendChild(eIcon); } }; HeaderGroupComp.prototype.addGroupExpandIcon = function () { if (!this.params.columnGroup.isExpandable()) { setDisplayed(this.eOpenIcon, false); setDisplayed(this.eCloseIcon, false); return; } }; HeaderGroupComp.prototype.setupLabel = function () { // no renderer, default text render var displayName = this.params.displayName; if (exists(displayName)) { var displayNameSanitised = escapeString(displayName); this.getRefElement('agLabel').innerHTML = displayNameSanitised; } }; HeaderGroupComp.TEMPLATE = "
\n \n \n \n
"; __decorate$t([ Autowired("columnModel") ], HeaderGroupComp.prototype, "columnModel", void 0); __decorate$t([ RefSelector("agOpened") ], HeaderGroupComp.prototype, "eOpenIcon", void 0); __decorate$t([ RefSelector("agClosed") ], HeaderGroupComp.prototype, "eCloseIcon", void 0); return HeaderGroupComp; }(Component)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$A = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var PopupComponent = /** @class */ (function (_super) { __extends$A(PopupComponent, _super); function PopupComponent() { return _super !== null && _super.apply(this, arguments) || this; } PopupComponent.prototype.isPopup = function () { return true; }; PopupComponent.prototype.setParentComponent = function (container) { container.addCssClass('ag-has-popup'); _super.prototype.setParentComponent.call(this, container); }; PopupComponent.prototype.destroy = function () { var parentComp = this.parentComponent; var hasParent = parentComp && parentComp.isAlive(); if (hasParent) { parentComp.getGui().classList.remove('ag-has-popup'); } _super.prototype.destroy.call(this); }; return PopupComponent; }(Component)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$B = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __decorate$u = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var LargeTextCellEditor = /** @class */ (function (_super) { __extends$B(LargeTextCellEditor, _super); function LargeTextCellEditor() { return _super.call(this, LargeTextCellEditor.TEMPLATE) || this; } LargeTextCellEditor.prototype.init = function (params) { this.params = params; this.focusAfterAttached = params.cellStartedEdit; this.eTextArea .setMaxLength(params.maxLength || 200) .setCols(params.cols || 60) .setRows(params.rows || 10); if (exists(params.value, true)) { this.eTextArea.setValue(params.value.toString(), true); } this.addGuiEventListener('keydown', this.onKeyDown.bind(this)); }; LargeTextCellEditor.prototype.onKeyDown = function (event) { var key = event.key; if (key === KeyCode.LEFT || key === KeyCode.UP || key === KeyCode.RIGHT || key === KeyCode.DOWN || (event.shiftKey && key === KeyCode.ENTER)) { // shift+enter allows for newlines event.stopPropagation(); } }; LargeTextCellEditor.prototype.afterGuiAttached = function () { var translate = this.localeService.getLocaleTextFunc(); this.eTextArea.setInputAriaLabel(translate('ariaInputEditor', 'Input Editor')); if (this.focusAfterAttached) { this.eTextArea.getFocusableElement().focus(); } }; LargeTextCellEditor.prototype.getValue = function () { return this.params.parseValue(this.eTextArea.getValue()); }; LargeTextCellEditor.TEMPLATE = "
\n \n
"; __decorate$u([ RefSelector("eTextArea") ], LargeTextCellEditor.prototype, "eTextArea", void 0); return LargeTextCellEditor; }(PopupComponent)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$C = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __decorate$v = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var SelectCellEditor = /** @class */ (function (_super) { __extends$C(SelectCellEditor, _super); function SelectCellEditor() { var _this = _super.call(this, '
') || this; _this.startedByEnter = false; return _this; } SelectCellEditor.prototype.init = function (params) { var _this = this; this.focusAfterAttached = params.cellStartedEdit; if (missing(params.values)) { console.warn('AG Grid: no values found for select cellEditor'); return; } this.startedByEnter = params.eventKey != null ? params.eventKey === KeyCode.ENTER : false; var hasValue = false; params.values.forEach(function (value) { var option = { value: value }; var valueFormatted = _this.valueFormatterService.formatValue(params.column, null, value); var valueFormattedExits = valueFormatted !== null && valueFormatted !== undefined; option.text = valueFormattedExits ? valueFormatted : value; _this.eSelect.addOption(option); hasValue = hasValue || params.value === value; }); if (hasValue) { this.eSelect.setValue(params.value, true); } else if (params.values.length) { this.eSelect.setValue(params.values[0], true); } // we don't want to add this if full row editing, otherwise selecting will stop the // full row editing. if (this.gridOptionsService.get('editType') !== 'fullRow') { this.addManagedListener(this.eSelect, AgSelect.EVENT_ITEM_SELECTED, function () { return params.stopEditing(); }); } }; SelectCellEditor.prototype.afterGuiAttached = function () { if (this.focusAfterAttached) { this.eSelect.getFocusableElement().focus(); } if (this.startedByEnter) { this.eSelect.showPicker(); } }; SelectCellEditor.prototype.focusIn = function () { this.eSelect.getFocusableElement().focus(); }; SelectCellEditor.prototype.getValue = function () { return this.eSelect.getValue(); }; SelectCellEditor.prototype.isPopup = function () { return false; }; __decorate$v([ Autowired('valueFormatterService') ], SelectCellEditor.prototype, "valueFormatterService", void 0); __decorate$v([ RefSelector('eSelect') ], SelectCellEditor.prototype, "eSelect", void 0); return SelectCellEditor; }(PopupComponent)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$D = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __decorate$w = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var TextCellEditor = /** @class */ (function (_super) { __extends$D(TextCellEditor, _super); function TextCellEditor() { return _super.call(this, TextCellEditor.TEMPLATE) || this; } TextCellEditor.prototype.init = function (params) { this.params = params; var eInput = this.eInput; var startValue; // cellStartedEdit is only false if we are doing fullRow editing if (params.cellStartedEdit) { this.focusAfterAttached = true; if (params.eventKey === KeyCode.BACKSPACE || params.eventKey === KeyCode.DELETE) { startValue = ''; } else if (params.charPress) { startValue = params.charPress; } else { startValue = this.getStartValue(params); if (params.eventKey !== KeyCode.F2) { this.highlightAllOnFocus = true; } } } else { this.focusAfterAttached = false; startValue = this.getStartValue(params); } if (startValue != null) { eInput.setValue(startValue, true); } if (params.maxLength != null) { eInput.setMaxLength(params.maxLength); } this.addManagedListener(eInput.getGui(), 'keydown', function (event) { var key = event.key; if (key === KeyCode.PAGE_UP || key === KeyCode.PAGE_DOWN) { event.preventDefault(); } }); }; TextCellEditor.prototype.afterGuiAttached = function () { var translate = this.localeService.getLocaleTextFunc(); var eInput = this.eInput; eInput.setInputAriaLabel(translate('ariaInputEditor', 'Input Editor')); if (!this.focusAfterAttached) { return; } // Added for AG-3238. We can't remove this explicit focus() because Chrome requires an input // to be focused before setSelectionRange will work. But it triggers a bug in Safari where // explicitly focusing then blurring an empty field will cause the parent container to scroll. if (!isBrowserSafari()) { eInput.getFocusableElement().focus(); } var inputEl = eInput.getInputElement(); if (this.highlightAllOnFocus) { inputEl.select(); } else { // when we started editing, we want the caret at the end, not the start. // this comes into play in two scenarios: // a) when user hits F2 // b) when user hits a printable character var value = eInput.getValue(); var len = (exists(value) && value.length) || 0; if (len) { inputEl.setSelectionRange(len, len); } } }; // gets called when tabbing trough cells and in full row edit mode TextCellEditor.prototype.focusIn = function () { var eInput = this.eInput; var focusEl = eInput.getFocusableElement(); var inputEl = eInput.getInputElement(); focusEl.focus(); inputEl.select(); }; TextCellEditor.prototype.getValue = function () { var eInput = this.eInput; return this.params.parseValue(eInput.getValue()); }; TextCellEditor.prototype.getStartValue = function (params) { var formatValue = params.useFormatter || params.column.getColDef().refData; return formatValue ? params.formatValue(params.value) : params.value; }; TextCellEditor.prototype.isPopup = function () { return false; }; TextCellEditor.TEMPLATE = "
\n \n
"; __decorate$w([ RefSelector('eInput') ], TextCellEditor.prototype, "eInput", void 0); return TextCellEditor; }(PopupComponent)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$E = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __decorate$x = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var ARROW_UP = '\u2191'; var ARROW_DOWN = '\u2193'; var AnimateShowChangeCellRenderer = /** @class */ (function (_super) { __extends$E(AnimateShowChangeCellRenderer, _super); function AnimateShowChangeCellRenderer() { var _this = _super.call(this, AnimateShowChangeCellRenderer.TEMPLATE) || this; _this.refreshCount = 0; return _this; } AnimateShowChangeCellRenderer.prototype.init = function (params) { // this.params = params; this.eValue = this.queryForHtmlElement('.ag-value-change-value'); this.eDelta = this.queryForHtmlElement('.ag-value-change-delta'); this.refresh(params); }; AnimateShowChangeCellRenderer.prototype.showDelta = function (params, delta) { var absDelta = Math.abs(delta); var valueFormatted = params.formatValue(absDelta); var valueToUse = exists(valueFormatted) ? valueFormatted : absDelta; var deltaUp = (delta >= 0); if (deltaUp) { this.eDelta.innerHTML = ARROW_UP + valueToUse; } else { // because negative, use ABS to remove sign this.eDelta.innerHTML = ARROW_DOWN + valueToUse; } this.eDelta.classList.toggle('ag-value-change-delta-up', deltaUp); this.eDelta.classList.toggle('ag-value-change-delta-down', !deltaUp); }; AnimateShowChangeCellRenderer.prototype.setTimerToRemoveDelta = function () { var _this = this; // the refreshCount makes sure that if the value updates again while // the below timer is waiting, then the below timer will realise it // is not the most recent and will not try to remove the delta value. this.refreshCount++; var refreshCountCopy = this.refreshCount; window.setTimeout(function () { if (refreshCountCopy === _this.refreshCount) { _this.hideDeltaValue(); } }, 2000); }; AnimateShowChangeCellRenderer.prototype.hideDeltaValue = function () { this.eValue.classList.remove('ag-value-change-value-highlight'); clearElement(this.eDelta); }; AnimateShowChangeCellRenderer.prototype.refresh = function (params) { var value = params.value; if (value === this.lastValue) { return false; } if (exists(params.valueFormatted)) { this.eValue.innerHTML = params.valueFormatted; } else if (exists(params.value)) { this.eValue.innerHTML = value; } else { clearElement(this.eValue); } // we don't show the delta if we are in the middle of a filter. see comment on FilterManager // with regards processingFilterChange if (this.filterManager.isSuppressFlashingCellsBecauseFiltering()) { return false; } if (typeof value === 'number' && typeof this.lastValue === 'number') { var delta = value - this.lastValue; this.showDelta(params, delta); } // highlight the current value, but only if it's not new, otherwise it // would get highlighted first time the value is shown if (this.lastValue) { this.eValue.classList.add('ag-value-change-value-highlight'); } this.setTimerToRemoveDelta(); this.lastValue = value; return true; }; AnimateShowChangeCellRenderer.TEMPLATE = '' + '' + '' + ''; __decorate$x([ Autowired('filterManager') ], AnimateShowChangeCellRenderer.prototype, "filterManager", void 0); return AnimateShowChangeCellRenderer; }(Component)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$F = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __decorate$y = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var AnimateSlideCellRenderer = /** @class */ (function (_super) { __extends$F(AnimateSlideCellRenderer, _super); function AnimateSlideCellRenderer() { var _this = _super.call(this, AnimateSlideCellRenderer.TEMPLATE) || this; _this.refreshCount = 0; _this.eCurrent = _this.queryForHtmlElement('.ag-value-slide-current'); return _this; } AnimateSlideCellRenderer.prototype.init = function (params) { this.refresh(params); }; AnimateSlideCellRenderer.prototype.addSlideAnimation = function () { var _this = this; this.refreshCount++; // below we keep checking this, and stop working on the animation // if it no longer matches - this means another animation has started // and this one is stale. var refreshCountCopy = this.refreshCount; // if old animation, remove it if (this.ePrevious) { this.getGui().removeChild(this.ePrevious); } this.ePrevious = loadTemplate(''); this.ePrevious.innerHTML = this.eCurrent.innerHTML; this.getGui().insertBefore(this.ePrevious, this.eCurrent); // having timeout of 0 allows use to skip to the next css turn, // so we know the previous css classes have been applied. so the // complex set of setTimeout below creates the animation window.setTimeout(function () { if (refreshCountCopy !== _this.refreshCount) { return; } _this.ePrevious.classList.add('ag-value-slide-out-end'); }, 50); window.setTimeout(function () { if (refreshCountCopy !== _this.refreshCount) { return; } _this.getGui().removeChild(_this.ePrevious); _this.ePrevious = null; }, 3000); }; AnimateSlideCellRenderer.prototype.refresh = function (params) { var value = params.value; if (missing(value)) { value = ''; } if (value === this.lastValue) { return false; } // we don't show the delta if we are in the middle of a filter. see comment on FilterManager // with regards processingFilterChange if (this.filterManager.isSuppressFlashingCellsBecauseFiltering()) { return false; } this.addSlideAnimation(); this.lastValue = value; if (exists(params.valueFormatted)) { this.eCurrent.innerHTML = params.valueFormatted; } else if (exists(params.value)) { this.eCurrent.innerHTML = value; } else { clearElement(this.eCurrent); } return true; }; AnimateSlideCellRenderer.TEMPLATE = "\n \n "; __decorate$y([ Autowired('filterManager') ], AnimateSlideCellRenderer.prototype, "filterManager", void 0); return AnimateSlideCellRenderer; }(Component)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __assign$7 = (undefined && undefined.__assign) || function () { __assign$7 = Object.assign || function(t) { for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; } return t; }; return __assign$7.apply(this, arguments); }; var RowNode = /** @class */ (function () { function RowNode(beans) { /** The current row index. If the row is filtered out or in a collapsed group, this value will be `null`. */ this.rowIndex = null; /** The key for the group eg Ireland, UK, USA */ this.key = null; /** Children mapped by the pivot columns. */ this.childrenMapped = {}; /** * This will be `true` if it has a rowIndex assigned, otherwise `false`. */ this.displayed = false; /** The row top position in pixels. */ this.rowTop = null; /** The top pixel for this row last time, makes sense if data set was ordered or filtered, * it is used so new rows can animate in from their old position. */ this.oldRowTop = null; /** `true` by default - can be overridden via gridOptions.isRowSelectable(rowNode) */ this.selectable = true; /** Used by sorting service - to give deterministic sort to groups. Previously we * just id for this, however id is a string and had slower sorting compared to numbers. */ this.__objectId = RowNode.OBJECT_ID_SEQUENCE++; /** When one or more Columns are using autoHeight, this keeps track of height of each autoHeight Cell, * indexed by the Column ID. */ this.__autoHeights = {}; /** `true` when nodes with the same id are being removed and added as part of the same batch transaction */ this.alreadyRendered = false; this.highlighted = null; this.selected = false; this.beans = beans; } /** * Replaces the data on the `rowNode`. When this method is called, the grid will refresh the entire rendered row if it is displayed. */ RowNode.prototype.setData = function (data) { this.setDataCommon(data, false); }; // similar to setRowData, however it is expected that the data is the same data item. this // is intended to be used with Redux type stores, where the whole data can be changed. we are // guaranteed that the data is the same entity (so grid doesn't need to worry about the id of the // underlying data changing, hence doesn't need to worry about selection). the grid, upon receiving // dataChanged event, will refresh the cells rather than rip them all out (so user can show transitions). /** * Updates the data on the `rowNode`. When this method is called, the grid will refresh the entire rendered row if it is displayed. */ RowNode.prototype.updateData = function (data) { this.setDataCommon(data, true); }; RowNode.prototype.setDataCommon = function (data, update) { var oldData = this.data; this.data = data; this.beans.valueCache.onDataChanged(); this.updateDataOnDetailNode(); this.checkRowSelectable(); this.resetQuickFilterAggregateText(); var event = this.createDataChangedEvent(data, oldData, update); this.dispatchLocalEvent(event); }; // when we are doing master / detail, the detail node is lazy created, but then kept around. // so if we show / hide the detail, the same detail rowNode is used. so we need to keep the data // in sync, otherwise expand/collapse of the detail would still show the old values. RowNode.prototype.updateDataOnDetailNode = function () { if (this.detailNode) { this.detailNode.data = this.data; } }; RowNode.prototype.createDataChangedEvent = function (newData, oldData, update) { return { type: RowNode.EVENT_DATA_CHANGED, node: this, oldData: oldData, newData: newData, update: update }; }; RowNode.prototype.createLocalRowEvent = function (type) { return { type: type, node: this }; }; RowNode.prototype.getRowIndexString = function () { if (this.rowPinned === 'top') { return 't-' + this.rowIndex; } if (this.rowPinned === 'bottom') { return 'b-' + this.rowIndex; } return this.rowIndex.toString(); }; RowNode.prototype.createDaemonNode = function () { var oldNode = new RowNode(this.beans); // just copy the id and data, this is enough for the node to be used // in the selection controller (the selection controller is the only // place where daemon nodes can live). oldNode.id = this.id; oldNode.data = this.data; oldNode.__daemon = true; oldNode.selected = this.selected; oldNode.level = this.level; return oldNode; }; RowNode.prototype.setDataAndId = function (data, id) { var oldNode = exists(this.id) ? this.createDaemonNode() : null; var oldData = this.data; this.data = data; this.updateDataOnDetailNode(); this.setId(id); this.beans.selectionService.syncInRowNode(this, oldNode); this.checkRowSelectable(); var event = this.createDataChangedEvent(data, oldData, false); this.dispatchLocalEvent(event); }; RowNode.prototype.checkRowSelectable = function () { var isRowSelectableFunc = this.beans.gridOptionsService.get('isRowSelectable'); this.setRowSelectable(isRowSelectableFunc ? isRowSelectableFunc(this) : true); }; RowNode.prototype.setRowSelectable = function (newVal) { if (this.selectable !== newVal) { this.selectable = newVal; if (this.eventService) { this.eventService.dispatchEvent(this.createLocalRowEvent(RowNode.EVENT_SELECTABLE_CHANGED)); } var isGroupSelectsChildren = this.beans.gridOptionsService.is('groupSelectsChildren'); if (isGroupSelectsChildren) { var selected = this.calculateSelectedFromChildren(); this.setSelectedParams({ newValue: selected !== null && selected !== void 0 ? selected : false, source: 'selectableChanged' }); } } }; RowNode.prototype.setId = function (id) { // see if user is providing the id's var getRowIdFunc = this.beans.gridOptionsService.getRowIdFunc(); if (getRowIdFunc) { // if user is providing the id's, then we set the id only after the data has been set. // this is important for virtual pagination and viewport, where empty rows exist. if (this.data) { // we pass 'true' as we skip this level when generating keys, // as we don't always have the key for this level (eg when updating // data via transaction on SSRM, we are getting key to look up the // RowNode, don't have the RowNode yet, thus no way to get the current key) var parentKeys = this.getGroupKeys(true); this.id = getRowIdFunc({ data: this.data, parentKeys: parentKeys.length > 0 ? parentKeys : undefined, level: this.level }); // make sure id provided doesn't start with 'row-group-' as this is reserved. also check that // it has 'startsWith' in case the user provided a number. if (this.id !== null && typeof this.id === 'string' && this.id.startsWith(RowNode.ID_PREFIX_ROW_GROUP)) { console.error("AG Grid: Row IDs cannot start with " + RowNode.ID_PREFIX_ROW_GROUP + ", this is a reserved prefix for AG Grid's row grouping feature."); } // force id to be a string if (this.id !== null && typeof this.id !== 'string') { this.id = '' + this.id; } } else { // this can happen if user has set blank into the rowNode after the row previously // having data. this happens in virtual page row model, when data is delete and // the page is refreshed. this.id = undefined; } } else { this.id = id; } }; RowNode.prototype.getGroupKeys = function (excludeSelf) { if (excludeSelf === void 0) { excludeSelf = false; } var keys = []; var pointer = this; if (excludeSelf) { pointer = pointer.parent; } while (pointer && pointer.level >= 0) { keys.push(pointer.key); pointer = pointer.parent; } keys.reverse(); return keys; }; RowNode.prototype.isPixelInRange = function (pixel) { if (!exists(this.rowTop) || !exists(this.rowHeight)) { return false; } return pixel >= this.rowTop && pixel < (this.rowTop + this.rowHeight); }; RowNode.prototype.setFirstChild = function (firstChild) { if (this.firstChild === firstChild) { return; } this.firstChild = firstChild; if (this.eventService) { this.eventService.dispatchEvent(this.createLocalRowEvent(RowNode.EVENT_FIRST_CHILD_CHANGED)); } }; RowNode.prototype.setLastChild = function (lastChild) { if (this.lastChild === lastChild) { return; } this.lastChild = lastChild; if (this.eventService) { this.eventService.dispatchEvent(this.createLocalRowEvent(RowNode.EVENT_LAST_CHILD_CHANGED)); } }; RowNode.prototype.setChildIndex = function (childIndex) { if (this.childIndex === childIndex) { return; } this.childIndex = childIndex; if (this.eventService) { this.eventService.dispatchEvent(this.createLocalRowEvent(RowNode.EVENT_CHILD_INDEX_CHANGED)); } }; RowNode.prototype.setRowTop = function (rowTop) { this.oldRowTop = this.rowTop; if (this.rowTop === rowTop) { return; } this.rowTop = rowTop; if (this.eventService) { this.eventService.dispatchEvent(this.createLocalRowEvent(RowNode.EVENT_TOP_CHANGED)); } this.setDisplayed(rowTop !== null); }; RowNode.prototype.clearRowTopAndRowIndex = function () { this.oldRowTop = null; this.setRowTop(null); this.setRowIndex(null); }; RowNode.prototype.setDisplayed = function (displayed) { if (this.displayed === displayed) { return; } this.displayed = displayed; if (this.eventService) { this.eventService.dispatchEvent(this.createLocalRowEvent(RowNode.EVENT_DISPLAYED_CHANGED)); } }; RowNode.prototype.setDragging = function (dragging) { if (this.dragging === dragging) { return; } this.dragging = dragging; if (this.eventService) { this.eventService.dispatchEvent(this.createLocalRowEvent(RowNode.EVENT_DRAGGING_CHANGED)); } }; RowNode.prototype.setHighlighted = function (highlighted) { if (highlighted === this.highlighted) { return; } this.highlighted = highlighted; if (this.eventService) { this.eventService.dispatchEvent(this.createLocalRowEvent(RowNode.EVENT_HIGHLIGHT_CHANGED)); } }; RowNode.prototype.setAllChildrenCount = function (allChildrenCount) { if (this.allChildrenCount === allChildrenCount) { return; } this.allChildrenCount = allChildrenCount; if (this.eventService) { this.eventService.dispatchEvent(this.createLocalRowEvent(RowNode.EVENT_ALL_CHILDREN_COUNT_CHANGED)); } }; RowNode.prototype.setMaster = function (master) { if (this.master === master) { return; } // if changing AWAY from master, then unexpand, otherwise // next time it's shown it is expanded again if (this.master && !master) { this.expanded = false; } this.master = master; if (this.eventService) { this.eventService.dispatchEvent(this.createLocalRowEvent(RowNode.EVENT_MASTER_CHANGED)); } }; RowNode.prototype.setGroup = function (group) { if (this.group === group) { return; } // if we used to be a group, and no longer, then close the node if (this.group && !group) { this.expanded = false; } this.group = group; this.updateHasChildren(); if (this.eventService) { this.eventService.dispatchEvent(this.createLocalRowEvent(RowNode.EVENT_GROUP_CHANGED)); } }; /** * Sets the row height. * Call if you want to change the height initially assigned to the row. * After calling, you must call `api.onRowHeightChanged()` so the grid knows it needs to work out the placement of the rows. */ RowNode.prototype.setRowHeight = function (rowHeight, estimated) { if (estimated === void 0) { estimated = false; } this.rowHeight = rowHeight; this.rowHeightEstimated = estimated; if (this.eventService) { this.eventService.dispatchEvent(this.createLocalRowEvent(RowNode.EVENT_HEIGHT_CHANGED)); } }; RowNode.prototype.setRowAutoHeight = function (cellHeight, column) { if (!this.__autoHeights) { this.__autoHeights = {}; } var autoHeights = this.__autoHeights; autoHeights[column.getId()] = cellHeight; if (cellHeight != null) { if (this.checkAutoHeightsDebounced == null) { this.checkAutoHeightsDebounced = debounce(this.checkAutoHeights.bind(this), 1); } this.checkAutoHeightsDebounced(); } }; RowNode.prototype.checkAutoHeights = function () { var notAllPresent = false; var nonePresent = true; var newRowHeight = 0; var autoHeights = this.__autoHeights; if (autoHeights == null) { return; } var displayedAutoHeightCols = this.beans.columnModel.getAllDisplayedAutoHeightCols(); displayedAutoHeightCols.forEach(function (col) { var cellHeight = autoHeights[col.getId()]; if (cellHeight == null) { notAllPresent = true; return; } nonePresent = false; if (cellHeight > newRowHeight) { newRowHeight = cellHeight; } }); if (notAllPresent) { return; } // we take min of 10, so we don't adjust for empty rows. if <10, we put to default. // this prevents the row starting very small when waiting for async components, // which would then mean the grid squashes in far to many rows (as small heights // means more rows fit in) which looks crap. so best ignore small values and assume // we are still waiting for values to render. if (nonePresent || newRowHeight < 10) { newRowHeight = this.beans.gridOptionsService.getRowHeightForNode(this).height; } if (newRowHeight == this.rowHeight) { return; } this.setRowHeight(newRowHeight); var rowModel = this.beans.rowModel; if (rowModel.onRowHeightChangedDebounced) { rowModel.onRowHeightChangedDebounced(); } }; RowNode.prototype.setRowIndex = function (rowIndex) { if (this.rowIndex === rowIndex) { return; } this.rowIndex = rowIndex; if (this.eventService) { this.eventService.dispatchEvent(this.createLocalRowEvent(RowNode.EVENT_ROW_INDEX_CHANGED)); } }; RowNode.prototype.setUiLevel = function (uiLevel) { if (this.uiLevel === uiLevel) { return; } this.uiLevel = uiLevel; if (this.eventService) { this.eventService.dispatchEvent(this.createLocalRowEvent(RowNode.EVENT_UI_LEVEL_CHANGED)); } }; /** * Set the expanded state of this rowNode. Pass `true` to expand and `false` to collapse. */ RowNode.prototype.setExpanded = function (expanded, e) { if (this.expanded === expanded) { return; } this.expanded = expanded; if (this.eventService) { this.eventService.dispatchEvent(this.createLocalRowEvent(RowNode.EVENT_EXPANDED_CHANGED)); } var event = Object.assign({}, this.createGlobalRowEvent(Events.EVENT_ROW_GROUP_OPENED), { expanded: expanded, event: e || null }); this.beans.rowNodeEventThrottle.dispatchExpanded(event); // when using footers we need to refresh the group row, as the aggregation // values jump between group and footer if (this.beans.gridOptionsService.is('groupIncludeFooter')) { this.beans.rowRenderer.refreshCells({ rowNodes: [this] }); } }; RowNode.prototype.createGlobalRowEvent = function (type) { return { type: type, node: this, data: this.data, rowIndex: this.rowIndex, rowPinned: this.rowPinned, context: this.beans.gridOptionsService.context, api: this.beans.gridOptionsService.api, columnApi: this.beans.gridOptionsService.columnApi }; }; RowNode.prototype.dispatchLocalEvent = function (event) { if (this.eventService) { this.eventService.dispatchEvent(event); } }; /** * Replaces the value on the `rowNode` for the specified column. When complete, * the grid will refresh the rendered cell on the required row only. * **Note**: This method on fires `onCellEditRequest` when the Grid is on **Read Only** mode. * * @param colKey The column where the value should be updated * @param newValue The new value * @param eventSource The source of the event * @returns `True` if the value was changed, otherwise `False`. */ RowNode.prototype.setDataValue = function (colKey, newValue, eventSource) { // When it is done via the editors, no 'cell changed' event gets fired, as it's assumed that // the cell knows about the change given it's in charge of the editing. // this method is for the client to call, so the cell listens for the change // event, and also flashes the cell when the change occurs. var column = this.beans.columnModel.getPrimaryColumn(colKey); var oldValue = this.beans.valueService.getValue(column, this); if (this.beans.gridOptionsService.is('readOnlyEdit')) { this.dispatchEventForSaveValueReadOnly(column, oldValue, newValue, eventSource); return false; } var valueChanged = this.beans.valueService.setValue(this, column, newValue, eventSource); this.dispatchCellChangedEvent(column, newValue, oldValue); this.checkRowSelectable(); return valueChanged; }; RowNode.prototype.dispatchEventForSaveValueReadOnly = function (column, oldValue, newValue, eventSource) { var event = { type: Events.EVENT_CELL_EDIT_REQUEST, event: null, rowIndex: this.rowIndex, rowPinned: this.rowPinned, column: column, colDef: column.getColDef(), context: this.beans.gridOptionsService.context, api: this.beans.gridOptionsService.api, columnApi: this.beans.gridOptionsService.columnApi, data: this.data, node: this, oldValue: oldValue, newValue: newValue, value: newValue, source: eventSource }; this.beans.eventService.dispatchEvent(event); }; RowNode.prototype.setGroupValue = function (colKey, newValue) { var column = this.beans.columnModel.getGridColumn(colKey); if (missing(this.groupData)) { this.groupData = {}; } var columnId = column.getColId(); var oldValue = this.groupData[columnId]; if (oldValue === newValue) { return; } this.groupData[columnId] = newValue; this.dispatchCellChangedEvent(column, newValue, oldValue); }; // sets the data for an aggregation RowNode.prototype.setAggData = function (newAggData) { var _this = this; // find out all keys that could potentially change var colIds = getAllKeysInObjects([this.aggData, newAggData]); var oldAggData = this.aggData; this.aggData = newAggData; // if no event service, nobody has registered for events, so no need fire event if (this.eventService) { colIds.forEach(function (colId) { var column = _this.beans.columnModel.getGridColumn(colId); var value = _this.aggData ? _this.aggData[colId] : undefined; var oldValue = oldAggData ? oldAggData[colId] : undefined; _this.dispatchCellChangedEvent(column, value, oldValue); }); } }; RowNode.prototype.updateHasChildren = function () { // in CSRM, the group property will be set before the childrenAfterGroup property, check both to prevent flickering var newValue = (this.group && !this.footer) || (this.childrenAfterGroup && this.childrenAfterGroup.length > 0); var isSsrm = this.beans.gridOptionsService.isRowModelType('serverSide'); if (isSsrm) { var isTreeData = this.beans.gridOptionsService.isTreeData(); var isGroupFunc = this.beans.gridOptionsService.get('isServerSideGroup'); // stubs and footers can never have children, as they're grid rows. if tree data the presence of children // is determined by the isServerSideGroup callback, if not tree data then the rows group property will be set. newValue = !this.stub && !this.footer && (isTreeData ? !!isGroupFunc && isGroupFunc(this.data) : !!this.group); } if (newValue !== this.__hasChildren) { this.__hasChildren = !!newValue; if (this.eventService) { this.eventService.dispatchEvent(this.createLocalRowEvent(RowNode.EVENT_HAS_CHILDREN_CHANGED)); } } }; RowNode.prototype.hasChildren = function () { if (this.__hasChildren == null) { this.updateHasChildren(); } return this.__hasChildren; }; RowNode.prototype.isEmptyRowGroupNode = function () { return this.group && missingOrEmpty(this.childrenAfterGroup); }; RowNode.prototype.dispatchCellChangedEvent = function (column, newValue, oldValue) { var cellChangedEvent = { type: RowNode.EVENT_CELL_CHANGED, node: this, column: column, newValue: newValue, oldValue: oldValue }; this.dispatchLocalEvent(cellChangedEvent); }; /** * The first time `quickFilter` runs, the grid creates a one-off string representation of the row. * This string is then used for the quick filter instead of hitting each column separately. * When you edit, using grid editing, this string gets cleared down. * However if you edit without using grid editing, you will need to clear this string down for the row to be updated with the new values. * Otherwise new values will not work with the `quickFilter`. */ RowNode.prototype.resetQuickFilterAggregateText = function () { this.quickFilterAggregateText = null; }; /** Returns: * - `true` if the node can be expanded, i.e it is a group or master row. * - `false` if the node cannot be expanded */ RowNode.prototype.isExpandable = function () { return (this.hasChildren() && !this.footer) || this.master ? true : false; }; /** Returns: * - `true` if node is selected, * - `false` if the node isn't selected * - `undefined` if it's partially selected (group where not all children are selected). */ RowNode.prototype.isSelected = function () { // for footers, we just return what our sibling selected state is, as cannot select a footer if (this.footer) { return this.sibling.isSelected(); } return this.selected; }; /** Perform a depth-first search of this node and its children. */ RowNode.prototype.depthFirstSearch = function (callback) { if (this.childrenAfterGroup) { this.childrenAfterGroup.forEach(function (child) { return child.depthFirstSearch(callback); }); } callback(this); }; // + selectionController.calculatedSelectedForAllGroupNodes() RowNode.prototype.calculateSelectedFromChildren = function () { var _a; var atLeastOneSelected = false; var atLeastOneDeSelected = false; var atLeastOneMixed = false; if (!((_a = this.childrenAfterGroup) === null || _a === void 0 ? void 0 : _a.length)) { return this.selectable ? this.selected : null; } for (var i = 0; i < this.childrenAfterGroup.length; i++) { var child = this.childrenAfterGroup[i]; var childState = child.isSelected(); // non-selectable nodes must be calculated from their children, or ignored if no value results. if (!child.selectable) { var selectable = child.calculateSelectedFromChildren(); if (selectable === null) { continue; } childState = selectable; } switch (childState) { case true: atLeastOneSelected = true; break; case false: atLeastOneDeSelected = true; break; default: atLeastOneMixed = true; break; } } if (atLeastOneMixed || (atLeastOneSelected && atLeastOneDeSelected)) { return undefined; } else if (atLeastOneSelected) { return true; } else if (atLeastOneDeSelected) { return false; } else if (!this.selectable) { return null; } else { return this.selected; } }; RowNode.prototype.setSelectedInitialValue = function (selected) { this.selected = selected; }; RowNode.prototype.selectThisNode = function (newValue, e, source) { if (source === void 0) { source = 'api'; } // we only check selectable when newValue=true (ie selecting) to allow unselecting values, // as selectable is dynamic, need a way to unselect rows when selectable becomes false. var selectionNotAllowed = !this.selectable && newValue; var selectionNotChanged = this.selected === newValue; if (selectionNotAllowed || selectionNotChanged) { return false; } this.selected = newValue; if (this.eventService) { this.dispatchLocalEvent(this.createLocalRowEvent(RowNode.EVENT_ROW_SELECTED)); } var event = __assign$7(__assign$7({}, this.createGlobalRowEvent(Events.EVENT_ROW_SELECTED)), { event: e || null, source: source }); this.beans.eventService.dispatchEvent(event); return true; }; /** * Select (or deselect) the node. * @param newValue -`true` for selection, `false` for deselection. * @param clearSelection - If selecting, then passing `true` will select the node exclusively (i.e. NOT do multi select). If doing deselection, `clearSelection` has no impact. * @param suppressFinishActions - Pass `true` to prevent the `selectionChanged` from being fired. Note that the `rowSelected` event will still be fired. * @param source - Source property that will appear in the `selectionChanged` event. */ RowNode.prototype.setSelected = function (newValue, clearSelection, suppressFinishActions, source) { if (clearSelection === void 0) { clearSelection = false; } if (suppressFinishActions === void 0) { suppressFinishActions = false; } if (source === void 0) { source = 'api'; } this.setSelectedParams({ newValue: newValue, clearSelection: clearSelection, suppressFinishActions: suppressFinishActions, rangeSelect: false, source: source }); }; // to make calling code more readable, this is the same method as setSelected except it takes names parameters RowNode.prototype.setSelectedParams = function (params) { if (this.rowPinned) { console.warn('AG Grid: cannot select pinned rows'); return 0; } if (this.id === undefined) { console.warn('AG Grid: cannot select node until id for node is known'); return 0; } return this.beans.selectionService.setNodeSelected(__assign$7(__assign$7({}, params), { node: this.footer ? this.sibling : this })); }; /** * Returns: * - `true` if node is either pinned to the `top` or `bottom` * - `false` if the node isn't pinned */ RowNode.prototype.isRowPinned = function () { return this.rowPinned === 'top' || this.rowPinned === 'bottom'; }; RowNode.prototype.isParentOfNode = function (potentialParent) { var parentNode = this.parent; while (parentNode) { if (parentNode === potentialParent) { return true; } parentNode = parentNode.parent; } return false; }; /** Add an event listener. */ RowNode.prototype.addEventListener = function (eventType, listener) { if (!this.eventService) { this.eventService = new EventService(); } this.eventService.addEventListener(eventType, listener); }; /** Remove event listener. */ RowNode.prototype.removeEventListener = function (eventType, listener) { if (!this.eventService) { return; } this.eventService.removeEventListener(eventType, listener); if (this.eventService.noRegisteredListenersExist()) { this.eventService = null; } }; RowNode.prototype.onMouseEnter = function () { this.dispatchLocalEvent(this.createLocalRowEvent(RowNode.EVENT_MOUSE_ENTER)); }; RowNode.prototype.onMouseLeave = function () { this.dispatchLocalEvent(this.createLocalRowEvent(RowNode.EVENT_MOUSE_LEAVE)); }; RowNode.prototype.getFirstChildOfFirstChild = function (rowGroupColumn) { var currentRowNode = this; var isCandidate = true; var foundFirstChildPath = false; var nodeToSwapIn = null; // if we are hiding groups, then if we are the first child, of the first child, // all the way up to the column we are interested in, then we show the group cell. while (isCandidate && !foundFirstChildPath) { var parentRowNode = currentRowNode.parent; var firstChild = exists(parentRowNode) && currentRowNode.firstChild; if (firstChild) { if (parentRowNode.rowGroupColumn === rowGroupColumn) { foundFirstChildPath = true; nodeToSwapIn = parentRowNode; } } else { isCandidate = false; } currentRowNode = parentRowNode; } return foundFirstChildPath ? nodeToSwapIn : null; }; /** * Returns: * - `true` if the node is a full width cell * - `false` if the node is not a full width cell */ RowNode.prototype.isFullWidthCell = function () { var isFullWidthCellFunc = this.getIsFullWidthCellFunc(); return isFullWidthCellFunc ? isFullWidthCellFunc({ rowNode: this }) : false; }; RowNode.prototype.getIsFullWidthCellFunc = function () { var isFullWidthRow = this.beans.gridOptionsService.getCallback('isFullWidthRow'); if (isFullWidthRow) { return isFullWidthRow; } // this is the deprecated way, so provide a proxy to make it compatible var isFullWidthCell = this.beans.gridOptionsService.get('isFullWidthCell'); if (isFullWidthCell) { return function (params) { return isFullWidthCell(params.rowNode); }; } }; /** * Returns the route of the row node. If the Row Node is a group, it returns the route to that Row Node. * If the Row Node is not a group, it returns `undefined`. */ RowNode.prototype.getRoute = function () { if (this.key == null) { return; } var res = []; var pointer = this; while (pointer.key != null) { res.push(pointer.key); pointer = pointer.parent; } return res.reverse(); }; RowNode.prototype.createFooter = function () { var _this = this; // only create footer node once, otherwise we have daemons and // the animate screws up with the daemons hanging around if (this.sibling) { return; } var footerNode = new RowNode(this.beans); Object.keys(this).forEach(function (key) { footerNode[key] = _this[key]; }); footerNode.footer = true; footerNode.setRowTop(null); footerNode.setRowIndex(null); // manually set oldRowTop to null so we discard any // previous information about its position. footerNode.oldRowTop = null; footerNode.id = 'rowGroupFooter_' + this.id; // get both header and footer to reference each other as siblings. this is never undone, // only overwritten. so if a group is expanded, then contracted, it will have a ghost // sibling - but that's fine, as we can ignore this if the header is contracted. footerNode.sibling = this; this.sibling = footerNode; }; RowNode.ID_PREFIX_ROW_GROUP = 'row-group-'; RowNode.ID_PREFIX_TOP_PINNED = 't-'; RowNode.ID_PREFIX_BOTTOM_PINNED = 'b-'; RowNode.OBJECT_ID_SEQUENCE = 0; RowNode.EVENT_ROW_SELECTED = 'rowSelected'; RowNode.EVENT_DATA_CHANGED = 'dataChanged'; RowNode.EVENT_CELL_CHANGED = 'cellChanged'; RowNode.EVENT_ALL_CHILDREN_COUNT_CHANGED = 'allChildrenCountChanged'; RowNode.EVENT_MASTER_CHANGED = 'masterChanged'; RowNode.EVENT_GROUP_CHANGED = 'groupChanged'; RowNode.EVENT_MOUSE_ENTER = 'mouseEnter'; RowNode.EVENT_MOUSE_LEAVE = 'mouseLeave'; RowNode.EVENT_HEIGHT_CHANGED = 'heightChanged'; RowNode.EVENT_TOP_CHANGED = 'topChanged'; RowNode.EVENT_DISPLAYED_CHANGED = 'displayedChanged'; RowNode.EVENT_FIRST_CHILD_CHANGED = 'firstChildChanged'; RowNode.EVENT_LAST_CHILD_CHANGED = 'lastChildChanged'; RowNode.EVENT_CHILD_INDEX_CHANGED = 'childIndexChanged'; RowNode.EVENT_ROW_INDEX_CHANGED = 'rowIndexChanged'; RowNode.EVENT_EXPANDED_CHANGED = 'expandedChanged'; RowNode.EVENT_HAS_CHILDREN_CHANGED = 'hasChildrenChanged'; RowNode.EVENT_SELECTABLE_CHANGED = 'selectableChanged'; RowNode.EVENT_UI_LEVEL_CHANGED = 'uiLevelChanged'; RowNode.EVENT_HIGHLIGHT_CHANGED = 'rowHighlightChanged'; RowNode.EVENT_DRAGGING_CHANGED = 'draggingChanged'; return RowNode; }()); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$G = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __assign$8 = (undefined && undefined.__assign) || function () { __assign$8 = Object.assign || function(t) { for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; } return t; }; return __assign$8.apply(this, arguments); }; var __decorate$z = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var CheckboxSelectionComponent = /** @class */ (function (_super) { __extends$G(CheckboxSelectionComponent, _super); function CheckboxSelectionComponent() { return _super.call(this, /* html*/ "\n
\n \n
") || this; } CheckboxSelectionComponent.prototype.postConstruct = function () { this.eCheckbox.setPassive(true); setAriaLive(this.eCheckbox.getInputElement(), 'polite'); }; CheckboxSelectionComponent.prototype.getCheckboxId = function () { return this.eCheckbox.getInputElement().id; }; CheckboxSelectionComponent.prototype.onDataChanged = function () { // when rows are loaded for the second time, this can impact the selection, as a row // could be loaded as already selected (if user scrolls down, and then up again). this.onSelectionChanged(); }; CheckboxSelectionComponent.prototype.onSelectableChanged = function () { this.showOrHideSelect(); }; CheckboxSelectionComponent.prototype.onSelectionChanged = function () { var translate = this.localeService.getLocaleTextFunc(); var state = this.rowNode.isSelected(); var stateName = state === undefined ? translate('ariaIndeterminate', 'indeterminate') : (state === true ? translate('ariaChecked', 'checked') : translate('ariaUnchecked', 'unchecked')); var ariaLabel = translate('ariaRowToggleSelection', 'Press Space to toggle row selection'); this.eCheckbox.setValue(state, true); this.eCheckbox.setInputAriaLabel(ariaLabel + " (" + stateName + ")"); }; CheckboxSelectionComponent.prototype.onCheckedClicked = function (event) { var groupSelectsFiltered = this.gridOptionsService.is('groupSelectsFiltered'); var updatedCount = this.rowNode.setSelectedParams({ newValue: false, rangeSelect: event.shiftKey, groupSelectsFiltered: groupSelectsFiltered, event: event, source: 'checkboxSelected' }); return updatedCount; }; CheckboxSelectionComponent.prototype.onUncheckedClicked = function (event) { var groupSelectsFiltered = this.gridOptionsService.is('groupSelectsFiltered'); var updatedCount = this.rowNode.setSelectedParams({ newValue: true, rangeSelect: event.shiftKey, groupSelectsFiltered: groupSelectsFiltered, event: event, source: 'checkboxSelected' }); return updatedCount; }; CheckboxSelectionComponent.prototype.init = function (params) { var _this = this; this.rowNode = params.rowNode; this.column = params.column; this.overrides = params.overrides; this.onSelectionChanged(); // we don't want double click on this icon to open a group this.addManagedListener(this.eCheckbox.getInputElement(), 'dblclick', function (event) { stopPropagationForAgGrid(event); }); this.addManagedListener(this.eCheckbox.getInputElement(), 'click', function (event) { // we don't want the row clicked event to fire when selecting the checkbox, otherwise the row // would possibly get selected twice stopPropagationForAgGrid(event); var isSelected = _this.eCheckbox.getValue(); if (isSelected) { _this.onCheckedClicked(event); } else { _this.onUncheckedClicked(event || {}); } }); this.addManagedListener(this.rowNode, RowNode.EVENT_ROW_SELECTED, this.onSelectionChanged.bind(this)); this.addManagedListener(this.rowNode, RowNode.EVENT_DATA_CHANGED, this.onDataChanged.bind(this)); this.addManagedListener(this.rowNode, RowNode.EVENT_SELECTABLE_CHANGED, this.onSelectableChanged.bind(this)); var isRowSelectableFunc = this.gridOptionsService.get('isRowSelectable'); var checkboxVisibleIsDynamic = isRowSelectableFunc || typeof this.getIsVisible() === 'function'; if (checkboxVisibleIsDynamic) { var showOrHideSelectListener = this.showOrHideSelect.bind(this); this.addManagedListener(this.eventService, Events.EVENT_DISPLAYED_COLUMNS_CHANGED, showOrHideSelectListener); this.addManagedListener(this.rowNode, RowNode.EVENT_DATA_CHANGED, showOrHideSelectListener); this.addManagedListener(this.rowNode, RowNode.EVENT_CELL_CHANGED, showOrHideSelectListener); this.showOrHideSelect(); } this.eCheckbox.getInputElement().setAttribute('tabindex', '-1'); }; CheckboxSelectionComponent.prototype.showOrHideSelect = function () { var _a, _b, _c, _d; // if the isRowSelectable() is not provided the row node is selectable by default var selectable = this.rowNode.selectable; // checkboxSelection callback is deemed a legacy solution however we will still consider it's result. // If selectable, then also check the colDef callback. if not selectable, this it short circuits - no need // to call the colDef callback. var isVisible = this.getIsVisible(); if (selectable) { if (typeof isVisible === 'function') { var extraParams = (_a = this.overrides) === null || _a === void 0 ? void 0 : _a.callbackParams; var params = (_b = this.column) === null || _b === void 0 ? void 0 : _b.createColumnFunctionCallbackParams(this.rowNode); selectable = params ? isVisible(__assign$8(__assign$8({}, extraParams), params)) : false; } else { selectable = isVisible !== null && isVisible !== void 0 ? isVisible : false; } } var disableInsteadOfHide = (_c = this.column) === null || _c === void 0 ? void 0 : _c.getColDef().showDisabledCheckboxes; if (disableInsteadOfHide) { this.eCheckbox.setDisabled(!selectable); this.setVisible(true); this.setDisplayed(true); return; } if ((_d = this.overrides) === null || _d === void 0 ? void 0 : _d.removeHidden) { this.setDisplayed(selectable); return; } this.setVisible(selectable); }; CheckboxSelectionComponent.prototype.getIsVisible = function () { var _a, _b; if (this.overrides) { return this.overrides.isVisible; } // column will be missing if groupDisplayType = 'groupRows' return (_b = (_a = this.column) === null || _a === void 0 ? void 0 : _a.getColDef()) === null || _b === void 0 ? void 0 : _b.checkboxSelection; }; __decorate$z([ RefSelector('eCheckbox') ], CheckboxSelectionComponent.prototype, "eCheckbox", void 0); __decorate$z([ PostConstruct ], CheckboxSelectionComponent.prototype, "postConstruct", null); return CheckboxSelectionComponent; }(Component)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$H = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __decorate$A = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var __values$2 = (undefined && undefined.__values) || function(o) { var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; if (m) return m.call(o); if (o && typeof o.length === "number") return { next: function () { if (o && i >= o.length) o = void 0; return { value: o && o[i++], done: !o }; } }; throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); }; (function (DragSourceType) { DragSourceType[DragSourceType["ToolPanel"] = 0] = "ToolPanel"; DragSourceType[DragSourceType["HeaderCell"] = 1] = "HeaderCell"; DragSourceType[DragSourceType["RowDrag"] = 2] = "RowDrag"; DragSourceType[DragSourceType["ChartPanel"] = 3] = "ChartPanel"; })(exports.DragSourceType || (exports.DragSourceType = {})); (function (VerticalDirection) { VerticalDirection[VerticalDirection["Up"] = 0] = "Up"; VerticalDirection[VerticalDirection["Down"] = 1] = "Down"; })(exports.VerticalDirection || (exports.VerticalDirection = {})); (function (HorizontalDirection) { HorizontalDirection[HorizontalDirection["Left"] = 0] = "Left"; HorizontalDirection[HorizontalDirection["Right"] = 1] = "Right"; })(exports.HorizontalDirection || (exports.HorizontalDirection = {})); var DragAndDropService = /** @class */ (function (_super) { __extends$H(DragAndDropService, _super); function DragAndDropService() { var _this = _super !== null && _super.apply(this, arguments) || this; _this.dragSourceAndParamsList = []; _this.dropTargets = []; return _this; } DragAndDropService_1 = DragAndDropService; DragAndDropService.prototype.init = function () { this.ePinnedIcon = createIcon('columnMovePin', this.gridOptionsService, null); this.eHideIcon = createIcon('columnMoveHide', this.gridOptionsService, null); this.eMoveIcon = createIcon('columnMoveMove', this.gridOptionsService, null); this.eLeftIcon = createIcon('columnMoveLeft', this.gridOptionsService, null); this.eRightIcon = createIcon('columnMoveRight', this.gridOptionsService, null); this.eGroupIcon = createIcon('columnMoveGroup', this.gridOptionsService, null); this.eAggregateIcon = createIcon('columnMoveValue', this.gridOptionsService, null); this.ePivotIcon = createIcon('columnMovePivot', this.gridOptionsService, null); this.eDropNotAllowedIcon = createIcon('dropNotAllowed', this.gridOptionsService, null); }; DragAndDropService.prototype.addDragSource = function (dragSource, allowTouch) { if (allowTouch === void 0) { allowTouch = false; } var params = { eElement: dragSource.eElement, dragStartPixels: dragSource.dragStartPixels, onDragStart: this.onDragStart.bind(this, dragSource), onDragStop: this.onDragStop.bind(this), onDragging: this.onDragging.bind(this) }; this.dragSourceAndParamsList.push({ params: params, dragSource: dragSource }); this.dragService.addDragSource(params, allowTouch); }; DragAndDropService.prototype.removeDragSource = function (dragSource) { var sourceAndParams = this.dragSourceAndParamsList.find(function (item) { return item.dragSource === dragSource; }); if (sourceAndParams) { this.dragService.removeDragSource(sourceAndParams.params); removeFromArray(this.dragSourceAndParamsList, sourceAndParams); } }; DragAndDropService.prototype.clearDragSourceParamsList = function () { var _this = this; this.dragSourceAndParamsList.forEach(function (sourceAndParams) { return _this.dragService.removeDragSource(sourceAndParams.params); }); this.dragSourceAndParamsList.length = 0; this.dropTargets.length = 0; }; DragAndDropService.prototype.nudge = function () { if (this.dragging) { this.onDragging(this.eventLastTime, true); } }; DragAndDropService.prototype.onDragStart = function (dragSource, mouseEvent) { this.dragging = true; this.dragSource = dragSource; this.eventLastTime = mouseEvent; this.dragItem = this.dragSource.getDragItem(); this.lastDropTarget = this.dragSource.dragSourceDropTarget; if (this.dragSource.onDragStarted) { this.dragSource.onDragStarted(); } this.createGhost(); }; DragAndDropService.prototype.onDragStop = function (mouseEvent) { this.eventLastTime = null; this.dragging = false; if (this.dragSource.onDragStopped) { this.dragSource.onDragStopped(); } if (this.lastDropTarget && this.lastDropTarget.onDragStop) { var draggingEvent = this.createDropTargetEvent(this.lastDropTarget, mouseEvent, null, null, false); this.lastDropTarget.onDragStop(draggingEvent); } this.lastDropTarget = null; this.dragItem = null; this.removeGhost(); }; DragAndDropService.prototype.onDragging = function (mouseEvent, fromNudge) { var _this = this; var _a, _b, _c, _d; var hDirection = this.getHorizontalDirection(mouseEvent); var vDirection = this.getVerticalDirection(mouseEvent); this.eventLastTime = mouseEvent; this.positionGhost(mouseEvent); // check if mouseEvent intersects with any of the drop targets var validDropTargets = this.dropTargets.filter(function (target) { return _this.isMouseOnDropTarget(mouseEvent, target); }); var dropTarget = this.findCurrentDropTarget(mouseEvent, validDropTargets); if (dropTarget !== this.lastDropTarget) { this.leaveLastTargetIfExists(mouseEvent, hDirection, vDirection, fromNudge); if (this.lastDropTarget !== null && dropTarget === null) { (_b = (_a = this.dragSource).onGridExit) === null || _b === void 0 ? void 0 : _b.call(_a, this.dragItem); } if (this.lastDropTarget === null && dropTarget !== null) { (_d = (_c = this.dragSource).onGridEnter) === null || _d === void 0 ? void 0 : _d.call(_c, this.dragItem); } this.enterDragTargetIfExists(dropTarget, mouseEvent, hDirection, vDirection, fromNudge); this.lastDropTarget = dropTarget; } else if (dropTarget && dropTarget.onDragging) { var draggingEvent = this.createDropTargetEvent(dropTarget, mouseEvent, hDirection, vDirection, fromNudge); dropTarget.onDragging(draggingEvent); } }; DragAndDropService.prototype.getAllContainersFromDropTarget = function (dropTarget) { var secondaryContainers = dropTarget.getSecondaryContainers ? dropTarget.getSecondaryContainers() : null; var containers = [[dropTarget.getContainer()]]; return secondaryContainers ? containers.concat(secondaryContainers) : containers; }; DragAndDropService.prototype.allContainersIntersect = function (mouseEvent, containers) { var e_1, _a; try { for (var containers_1 = __values$2(containers), containers_1_1 = containers_1.next(); !containers_1_1.done; containers_1_1 = containers_1.next()) { var container = containers_1_1.value; var rect = container.getBoundingClientRect(); // if element is not visible, then width and height are zero if (rect.width === 0 || rect.height === 0) { return false; } var horizontalFit = mouseEvent.clientX >= rect.left && mouseEvent.clientX < rect.right; var verticalFit = mouseEvent.clientY >= rect.top && mouseEvent.clientY < rect.bottom; if (!horizontalFit || !verticalFit) { return false; } } } catch (e_1_1) { e_1 = { error: e_1_1 }; } finally { try { if (containers_1_1 && !containers_1_1.done && (_a = containers_1.return)) _a.call(containers_1); } finally { if (e_1) throw e_1.error; } } return true; }; // checks if the mouse is on the drop target. it checks eContainer and eSecondaryContainers DragAndDropService.prototype.isMouseOnDropTarget = function (mouseEvent, dropTarget) { var e_2, _a; var allContainersFromDropTarget = this.getAllContainersFromDropTarget(dropTarget); var mouseOverTarget = false; try { for (var allContainersFromDropTarget_1 = __values$2(allContainersFromDropTarget), allContainersFromDropTarget_1_1 = allContainersFromDropTarget_1.next(); !allContainersFromDropTarget_1_1.done; allContainersFromDropTarget_1_1 = allContainersFromDropTarget_1.next()) { var currentContainers = allContainersFromDropTarget_1_1.value; if (this.allContainersIntersect(mouseEvent, currentContainers)) { mouseOverTarget = true; break; } } } catch (e_2_1) { e_2 = { error: e_2_1 }; } finally { try { if (allContainersFromDropTarget_1_1 && !allContainersFromDropTarget_1_1.done && (_a = allContainersFromDropTarget_1.return)) _a.call(allContainersFromDropTarget_1); } finally { if (e_2) throw e_2.error; } } if (dropTarget.targetContainsSource && !dropTarget.getContainer().contains(this.dragSource.eElement)) { return false; } return mouseOverTarget && dropTarget.isInterestedIn(this.dragSource.type, this.dragSource.eElement); }; DragAndDropService.prototype.findCurrentDropTarget = function (mouseEvent, validDropTargets) { var e_3, _a, e_4, _b; var len = validDropTargets.length; if (len === 0) { return null; } if (len === 1) { return validDropTargets[0]; } var rootNode = this.gridOptionsService.getRootNode(); // elementsFromPoint return a list of elements under // the mouseEvent sorted from topMost to bottomMost var elementStack = rootNode.elementsFromPoint(mouseEvent.clientX, mouseEvent.clientY); try { // loop over the sorted elementStack to find which dropTarget comes first for (var elementStack_1 = __values$2(elementStack), elementStack_1_1 = elementStack_1.next(); !elementStack_1_1.done; elementStack_1_1 = elementStack_1.next()) { var el = elementStack_1_1.value; try { for (var validDropTargets_1 = (e_4 = void 0, __values$2(validDropTargets)), validDropTargets_1_1 = validDropTargets_1.next(); !validDropTargets_1_1.done; validDropTargets_1_1 = validDropTargets_1.next()) { var dropTarget = validDropTargets_1_1.value; var containers = flatten(this.getAllContainersFromDropTarget(dropTarget)); if (containers.indexOf(el) !== -1) { return dropTarget; } } } catch (e_4_1) { e_4 = { error: e_4_1 }; } finally { try { if (validDropTargets_1_1 && !validDropTargets_1_1.done && (_b = validDropTargets_1.return)) _b.call(validDropTargets_1); } finally { if (e_4) throw e_4.error; } } } } catch (e_3_1) { e_3 = { error: e_3_1 }; } finally { try { if (elementStack_1_1 && !elementStack_1_1.done && (_a = elementStack_1.return)) _a.call(elementStack_1); } finally { if (e_3) throw e_3.error; } } // we should never hit this point of the code because only // valid dropTargets should be provided to this method. return null; }; DragAndDropService.prototype.enterDragTargetIfExists = function (dropTarget, mouseEvent, hDirection, vDirection, fromNudge) { if (!dropTarget) { return; } if (dropTarget.onDragEnter) { var dragEnterEvent = this.createDropTargetEvent(dropTarget, mouseEvent, hDirection, vDirection, fromNudge); dropTarget.onDragEnter(dragEnterEvent); } this.setGhostIcon(dropTarget.getIconName ? dropTarget.getIconName() : null); }; DragAndDropService.prototype.leaveLastTargetIfExists = function (mouseEvent, hDirection, vDirection, fromNudge) { if (!this.lastDropTarget) { return; } if (this.lastDropTarget.onDragLeave) { var dragLeaveEvent = this.createDropTargetEvent(this.lastDropTarget, mouseEvent, hDirection, vDirection, fromNudge); this.lastDropTarget.onDragLeave(dragLeaveEvent); } this.setGhostIcon(null); }; DragAndDropService.prototype.addDropTarget = function (dropTarget) { this.dropTargets.push(dropTarget); }; DragAndDropService.prototype.removeDropTarget = function (dropTarget) { this.dropTargets = this.dropTargets.filter(function (target) { return target.getContainer() !== dropTarget.getContainer(); }); }; DragAndDropService.prototype.hasExternalDropZones = function () { return this.dropTargets.some(function (zones) { return zones.external; }); }; DragAndDropService.prototype.findExternalZone = function (params) { var externalTargets = this.dropTargets.filter(function (target) { return target.external; }); return externalTargets.find(function (zone) { return zone.getContainer() === params.getContainer(); }) || null; }; DragAndDropService.prototype.getHorizontalDirection = function (event) { var clientX = this.eventLastTime && this.eventLastTime.clientX; var eClientX = event.clientX; if (clientX === eClientX) { return null; } return clientX > eClientX ? exports.HorizontalDirection.Left : exports.HorizontalDirection.Right; }; DragAndDropService.prototype.getVerticalDirection = function (event) { var clientY = this.eventLastTime && this.eventLastTime.clientY; var eClientY = event.clientY; if (clientY === eClientY) { return null; } return clientY > eClientY ? exports.VerticalDirection.Up : exports.VerticalDirection.Down; }; DragAndDropService.prototype.createDropTargetEvent = function (dropTarget, event, hDirection, vDirection, fromNudge) { // localise x and y to the target var dropZoneTarget = dropTarget.getContainer(); var rect = dropZoneTarget.getBoundingClientRect(); var _a = this, api = _a.gridApi, columnApi = _a.columnApi, dragItem = _a.dragItem, dragSource = _a.dragSource; var x = event.clientX - rect.left; var y = event.clientY - rect.top; return { event: event, x: x, y: y, vDirection: vDirection, hDirection: hDirection, dragSource: dragSource, fromNudge: fromNudge, dragItem: dragItem, api: api, columnApi: columnApi, dropZoneTarget: dropZoneTarget }; }; DragAndDropService.prototype.positionGhost = function (event) { var ghost = this.eGhost; if (!ghost) { return; } var ghostRect = ghost.getBoundingClientRect(); var ghostHeight = ghostRect.height; // for some reason, without the '-2', it still overlapped by 1 or 2 pixels, which // then brought in scrollbars to the browser. no idea why, but putting in -2 here // works around it which is good enough for me. var browserWidth = getBodyWidth() - 2; var browserHeight = getBodyHeight() - 2; var top = event.pageY - (ghostHeight / 2); var left = event.pageX - 10; var eDocument = this.gridOptionsService.getDocument(); var win = (eDocument.defaultView || window); var windowScrollY = win.pageYOffset || eDocument.documentElement.scrollTop; var windowScrollX = win.pageXOffset || eDocument.documentElement.scrollLeft; // check ghost is not positioned outside of the browser if (browserWidth > 0 && ((left + ghost.clientWidth) > (browserWidth + windowScrollX))) { left = browserWidth + windowScrollX - ghost.clientWidth; } if (left < 0) { left = 0; } if (browserHeight > 0 && ((top + ghost.clientHeight) > (browserHeight + windowScrollY))) { top = browserHeight + windowScrollY - ghost.clientHeight; } if (top < 0) { top = 0; } ghost.style.left = left + "px"; ghost.style.top = top + "px"; }; DragAndDropService.prototype.removeGhost = function () { if (this.eGhost && this.eGhostParent) { this.eGhostParent.removeChild(this.eGhost); } this.eGhost = null; }; DragAndDropService.prototype.createGhost = function () { this.eGhost = loadTemplate(DragAndDropService_1.GHOST_TEMPLATE); this.mouseEventService.stampTopLevelGridCompWithGridInstance(this.eGhost); var theme = this.environment.getTheme().theme; if (theme) { this.eGhost.classList.add(theme); } this.eGhostIcon = this.eGhost.querySelector('.ag-dnd-ghost-icon'); this.setGhostIcon(null); var eText = this.eGhost.querySelector('.ag-dnd-ghost-label'); var dragItemName = this.dragSource.dragItemName; if (isFunction(dragItemName)) { dragItemName = dragItemName(); } eText.innerHTML = escapeString(dragItemName) || ''; this.eGhost.style.height = '25px'; this.eGhost.style.top = '20px'; this.eGhost.style.left = '20px'; var eDocument = this.gridOptionsService.getDocument(); var targetEl = null; try { targetEl = eDocument.fullscreenElement; } catch (e) { // some environments like SalesForce will throw errors // simply by trying to read the fullscreenElement property } finally { if (!targetEl) { var rootNode = this.gridOptionsService.getRootNode(); var body = rootNode.querySelector('body'); if (body) { targetEl = body; } else if (rootNode instanceof ShadowRoot) { targetEl = rootNode; } else { targetEl = rootNode === null || rootNode === void 0 ? void 0 : rootNode.documentElement; } } } this.eGhostParent = targetEl; if (!this.eGhostParent) { console.warn('AG Grid: could not find document body, it is needed for dragging columns'); } else { this.eGhostParent.appendChild(this.eGhost); } }; DragAndDropService.prototype.setGhostIcon = function (iconName, shake) { if (shake === void 0) { shake = false; } clearElement(this.eGhostIcon); var eIcon = null; if (!iconName) { iconName = this.dragSource.defaultIconName || DragAndDropService_1.ICON_NOT_ALLOWED; } switch (iconName) { case DragAndDropService_1.ICON_PINNED: eIcon = this.ePinnedIcon; break; case DragAndDropService_1.ICON_MOVE: eIcon = this.eMoveIcon; break; case DragAndDropService_1.ICON_LEFT: eIcon = this.eLeftIcon; break; case DragAndDropService_1.ICON_RIGHT: eIcon = this.eRightIcon; break; case DragAndDropService_1.ICON_GROUP: eIcon = this.eGroupIcon; break; case DragAndDropService_1.ICON_AGGREGATE: eIcon = this.eAggregateIcon; break; case DragAndDropService_1.ICON_PIVOT: eIcon = this.ePivotIcon; break; case DragAndDropService_1.ICON_NOT_ALLOWED: eIcon = this.eDropNotAllowedIcon; break; case DragAndDropService_1.ICON_HIDE: eIcon = this.eHideIcon; break; } this.eGhostIcon.classList.toggle('ag-shake-left-to-right', shake); if (eIcon === this.eHideIcon && this.gridOptionsService.is('suppressDragLeaveHidesColumns')) { return; } if (eIcon) { this.eGhostIcon.appendChild(eIcon); } }; var DragAndDropService_1; DragAndDropService.ICON_PINNED = 'pinned'; DragAndDropService.ICON_MOVE = 'move'; DragAndDropService.ICON_LEFT = 'left'; DragAndDropService.ICON_RIGHT = 'right'; DragAndDropService.ICON_GROUP = 'group'; DragAndDropService.ICON_AGGREGATE = 'aggregate'; DragAndDropService.ICON_PIVOT = 'pivot'; DragAndDropService.ICON_NOT_ALLOWED = 'notAllowed'; DragAndDropService.ICON_HIDE = 'hide'; DragAndDropService.GHOST_TEMPLATE = "
\n \n
\n
"; __decorate$A([ Autowired('dragService') ], DragAndDropService.prototype, "dragService", void 0); __decorate$A([ Autowired('mouseEventService') ], DragAndDropService.prototype, "mouseEventService", void 0); __decorate$A([ Autowired('columnApi') ], DragAndDropService.prototype, "columnApi", void 0); __decorate$A([ Autowired('gridApi') ], DragAndDropService.prototype, "gridApi", void 0); __decorate$A([ PostConstruct ], DragAndDropService.prototype, "init", null); __decorate$A([ PreDestroy ], DragAndDropService.prototype, "clearDragSourceParamsList", null); DragAndDropService = DragAndDropService_1 = __decorate$A([ Bean('dragAndDropService') ], DragAndDropService); return DragAndDropService; }(BeanStub)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$I = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __decorate$B = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var RowDragComp = /** @class */ (function (_super) { __extends$I(RowDragComp, _super); function RowDragComp(cellValueFn, rowNode, column, customGui, dragStartPixels, suppressVisibilityChange) { var _this = _super.call(this) || this; _this.cellValueFn = cellValueFn; _this.rowNode = rowNode; _this.column = column; _this.customGui = customGui; _this.dragStartPixels = dragStartPixels; _this.suppressVisibilityChange = suppressVisibilityChange; _this.dragSource = null; return _this; } RowDragComp.prototype.isCustomGui = function () { return this.customGui != null; }; RowDragComp.prototype.postConstruct = function () { if (!this.customGui) { this.setTemplate(/* html */ "
"); this.getGui().appendChild(createIconNoSpan('rowDrag', this.beans.gridOptionsService, null)); this.addDragSource(); } else { this.setDragElement(this.customGui, this.dragStartPixels); } this.checkCompatibility(); if (!this.suppressVisibilityChange) { var strategy = this.beans.gridOptionsService.is('rowDragManaged') ? new ManagedVisibilityStrategy(this, this.beans, this.rowNode, this.column) : new NonManagedVisibilityStrategy(this, this.beans, this.rowNode, this.column); this.createManagedBean(strategy, this.beans.context); } }; RowDragComp.prototype.setDragElement = function (dragElement, dragStartPixels) { this.setTemplateFromElement(dragElement); this.addDragSource(dragStartPixels); }; RowDragComp.prototype.getSelectedNodes = function () { var isRowDragMultiRow = this.beans.gridOptionsService.is('rowDragMultiRow'); if (!isRowDragMultiRow) { return [this.rowNode]; } var selection = this.beans.selectionService.getSelectedNodes(); return selection.indexOf(this.rowNode) !== -1 ? selection : [this.rowNode]; }; // returns true if all compatibility items work out RowDragComp.prototype.checkCompatibility = function () { var managed = this.beans.gridOptionsService.is('rowDragManaged'); var treeData = this.beans.gridOptionsService.isTreeData(); if (treeData && managed) { doOnce(function () { return console.warn('AG Grid: If using row drag with tree data, you cannot have rowDragManaged=true'); }, 'RowDragComp.managedAndTreeData'); } }; RowDragComp.prototype.getDragItem = function () { return { rowNode: this.rowNode, rowNodes: this.getSelectedNodes(), columns: this.column ? [this.column] : undefined, defaultTextValue: this.cellValueFn(), }; }; RowDragComp.prototype.getRowDragText = function (column) { if (column) { var colDef = column.getColDef(); if (colDef.rowDragText) { return colDef.rowDragText; } } return this.gridOptionsService.get('rowDragText'); }; RowDragComp.prototype.addDragSource = function (dragStartPixels) { var _this = this; if (dragStartPixels === void 0) { dragStartPixels = 4; } // if this is changing the drag element, delete the previous dragSource if (this.dragSource) { this.removeDragSource(); } var rowDragText = this.getRowDragText(this.column); var translate = this.localeService.getLocaleTextFunc(); this.dragSource = { type: exports.DragSourceType.RowDrag, eElement: this.getGui(), dragItemName: function () { var _a; var dragItem = _this.getDragItem(); var dragItemCount = ((_a = dragItem.rowNodes) === null || _a === void 0 ? void 0 : _a.length) || 1; if (rowDragText) { return rowDragText(dragItem, dragItemCount); } return dragItemCount === 1 ? _this.cellValueFn() : dragItemCount + " " + translate('rowDragRows', 'rows'); }, getDragItem: function () { return _this.getDragItem(); }, dragStartPixels: dragStartPixels, dragSourceDomDataKey: this.beans.gridOptionsService.getDomDataKey() }; this.beans.dragAndDropService.addDragSource(this.dragSource, true); }; RowDragComp.prototype.removeDragSource = function () { if (this.dragSource) { this.beans.dragAndDropService.removeDragSource(this.dragSource); } this.dragSource = null; }; __decorate$B([ Autowired('beans') ], RowDragComp.prototype, "beans", void 0); __decorate$B([ PostConstruct ], RowDragComp.prototype, "postConstruct", null); __decorate$B([ PreDestroy ], RowDragComp.prototype, "removeDragSource", null); return RowDragComp; }(Component)); var VisibilityStrategy = /** @class */ (function (_super) { __extends$I(VisibilityStrategy, _super); function VisibilityStrategy(parent, rowNode, column) { var _this = _super.call(this) || this; _this.parent = parent; _this.rowNode = rowNode; _this.column = column; return _this; } VisibilityStrategy.prototype.setDisplayedOrVisible = function (neverDisplayed) { var displayedOptions = { skipAriaHidden: true }; if (neverDisplayed) { this.parent.setDisplayed(false, displayedOptions); } else { var shown = true; var isShownSometimes = false; if (this.column) { shown = this.column.isRowDrag(this.rowNode) || this.parent.isCustomGui(); isShownSometimes = isFunction(this.column.getColDef().rowDrag); } // if shown sometimes, them some rows can have drag handle while other don't, // so we use setVisible to keep the handles horizontally aligned (as setVisible // keeps the empty space, whereas setDisplayed looses the space) if (isShownSometimes) { this.parent.setDisplayed(true, displayedOptions); this.parent.setVisible(shown, displayedOptions); } else { this.parent.setDisplayed(shown, displayedOptions); this.parent.setVisible(true, displayedOptions); } } }; return VisibilityStrategy; }(BeanStub)); // when non managed, the visibility depends on suppressRowDrag property only var NonManagedVisibilityStrategy = /** @class */ (function (_super) { __extends$I(NonManagedVisibilityStrategy, _super); function NonManagedVisibilityStrategy(parent, beans, rowNode, column) { var _this = _super.call(this, parent, rowNode, column) || this; _this.beans = beans; return _this; } NonManagedVisibilityStrategy.prototype.postConstruct = function () { this.addManagedPropertyListener('suppressRowDrag', this.onSuppressRowDrag.bind(this)); // in case data changes, then we need to update visibility of drag item this.addManagedListener(this.rowNode, RowNode.EVENT_DATA_CHANGED, this.workOutVisibility.bind(this)); this.addManagedListener(this.rowNode, RowNode.EVENT_CELL_CHANGED, this.workOutVisibility.bind(this)); this.addManagedListener(this.rowNode, RowNode.EVENT_CELL_CHANGED, this.workOutVisibility.bind(this)); this.addManagedListener(this.beans.eventService, Events.EVENT_NEW_COLUMNS_LOADED, this.workOutVisibility.bind(this)); this.workOutVisibility(); }; NonManagedVisibilityStrategy.prototype.onSuppressRowDrag = function () { this.workOutVisibility(); }; NonManagedVisibilityStrategy.prototype.workOutVisibility = function () { // only show the drag if both sort and filter are not present var neverDisplayed = this.beans.gridOptionsService.is('suppressRowDrag'); this.setDisplayedOrVisible(neverDisplayed); }; __decorate$B([ PostConstruct ], NonManagedVisibilityStrategy.prototype, "postConstruct", null); return NonManagedVisibilityStrategy; }(VisibilityStrategy)); // when managed, the visibility depends on sort, filter and row group, as well as suppressRowDrag property var ManagedVisibilityStrategy = /** @class */ (function (_super) { __extends$I(ManagedVisibilityStrategy, _super); function ManagedVisibilityStrategy(parent, beans, rowNode, column) { var _this = _super.call(this, parent, rowNode, column) || this; _this.beans = beans; return _this; } ManagedVisibilityStrategy.prototype.postConstruct = function () { // we do not show the component if sort, filter or grouping is active this.addManagedListener(this.beans.eventService, Events.EVENT_SORT_CHANGED, this.workOutVisibility.bind(this)); this.addManagedListener(this.beans.eventService, Events.EVENT_FILTER_CHANGED, this.workOutVisibility.bind(this)); this.addManagedListener(this.beans.eventService, Events.EVENT_COLUMN_ROW_GROUP_CHANGED, this.workOutVisibility.bind(this)); this.addManagedListener(this.beans.eventService, Events.EVENT_NEW_COLUMNS_LOADED, this.workOutVisibility.bind(this)); // in case data changes, then we need to update visibility of drag item this.addManagedListener(this.rowNode, RowNode.EVENT_DATA_CHANGED, this.workOutVisibility.bind(this)); this.addManagedListener(this.rowNode, RowNode.EVENT_CELL_CHANGED, this.workOutVisibility.bind(this)); this.addManagedPropertyListener('suppressRowDrag', this.onSuppressRowDrag.bind(this)); this.workOutVisibility(); }; ManagedVisibilityStrategy.prototype.onSuppressRowDrag = function () { this.workOutVisibility(); }; ManagedVisibilityStrategy.prototype.workOutVisibility = function () { // only show the drag if both sort and filter are not present var gridBodyCon = this.beans.ctrlsService.getGridBodyCtrl(); var rowDragFeature = gridBodyCon.getRowDragFeature(); var shouldPreventRowMove = rowDragFeature && rowDragFeature.shouldPreventRowMove(); var suppressRowDrag = this.beans.gridOptionsService.is('suppressRowDrag'); var hasExternalDropZones = this.beans.dragAndDropService.hasExternalDropZones(); var neverDisplayed = (shouldPreventRowMove && !hasExternalDropZones) || suppressRowDrag; this.setDisplayedOrVisible(neverDisplayed); }; __decorate$B([ PostConstruct ], ManagedVisibilityStrategy.prototype, "postConstruct", null); return ManagedVisibilityStrategy; }(VisibilityStrategy)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$J = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __assign$9 = (undefined && undefined.__assign) || function () { __assign$9 = Object.assign || function(t) { for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; } return t; }; return __assign$9.apply(this, arguments); }; var __decorate$C = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var GroupCellRendererCtrl = /** @class */ (function (_super) { __extends$J(GroupCellRendererCtrl, _super); function GroupCellRendererCtrl() { return _super !== null && _super.apply(this, arguments) || this; } GroupCellRendererCtrl.prototype.init = function (comp, eGui, eCheckbox, eExpanded, eContracted, compClass, params) { this.params = params; this.eGui = eGui; this.eCheckbox = eCheckbox; this.eExpanded = eExpanded; this.eContracted = eContracted; this.comp = comp; this.compClass = compClass; var topLevelFooter = this.isTopLevelFooter(); var embeddedRowMismatch = this.isEmbeddedRowMismatch(); // This allows for empty strings to appear as groups since // it will only return for null or undefined. var isNullValueAndNotMaster = params.value == null && !params.node.master; var skipCell = false; // if the groupCellRenderer is inside of a footer and groupHideOpenParents is true // we should only display the groupCellRenderer if the current column is the rowGroupedColumn if (this.gridOptionsService.is('groupIncludeFooter') && this.gridOptionsService.is('groupHideOpenParents')) { var node = params.node; if (node.footer) { var showRowGroup = params.colDef && params.colDef.showRowGroup; var rowGroupColumnId = node.rowGroupColumn && node.rowGroupColumn.getColId(); skipCell = showRowGroup !== rowGroupColumnId; } } this.cellIsBlank = topLevelFooter ? false : (embeddedRowMismatch || (isNullValueAndNotMaster && !params.node.master) || skipCell); if (this.cellIsBlank) { return; } this.setupShowingValueForOpenedParent(); this.findDisplayedGroupNode(); this.addFullWidthRowDraggerIfNeeded(); this.addExpandAndContract(); this.addCheckboxIfNeeded(); this.addValueElement(); this.setupIndent(); this.refreshAriaExpanded(); }; GroupCellRendererCtrl.prototype.destroy = function () { _super.prototype.destroy.call(this); // property cleanup to avoid memory leaks this.expandListener = null; }; GroupCellRendererCtrl.prototype.refreshAriaExpanded = function () { var _a = this.params, node = _a.node, eParentOfValue = _a.eParentOfValue; if (this.expandListener) { this.expandListener = this.expandListener(); } if (!this.isExpandable()) { removeAriaExpanded(eParentOfValue); return; } var listener = function () { // for react, we don't use JSX, as setting attributes via jsx is slower setAriaExpanded(eParentOfValue, !!node.expanded); }; this.expandListener = this.addManagedListener(node, RowNode.EVENT_EXPANDED_CHANGED, listener) || null; listener(); }; GroupCellRendererCtrl.prototype.isTopLevelFooter = function () { if (!this.gridOptionsService.is('groupIncludeTotalFooter')) { return false; } if (this.params.value != null || this.params.node.level != -1) { return false; } // at this point, we know it's the root node and there is no value present, so it's a footer cell. // the only thing to work out is if we are displaying groups across multiple // columns (groupDisplayType: 'multipleColumns'), we only want 'total' to appear in the first column. var colDef = this.params.colDef; var doingFullWidth = colDef == null; if (doingFullWidth) { return true; } if (colDef.showRowGroup === true) { return true; } var rowGroupCols = this.columnModel.getRowGroupColumns(); // this is a sanity check, rowGroupCols should always be present if (!rowGroupCols || rowGroupCols.length === 0) { return true; } var firstRowGroupCol = rowGroupCols[0]; return firstRowGroupCol.getId() === colDef.showRowGroup; }; // if we are doing embedded full width rows, we only show the renderer when // in the body, or if pinning in the pinned section, or if pinning and RTL, // in the right section. otherwise we would have the cell repeated in each section. GroupCellRendererCtrl.prototype.isEmbeddedRowMismatch = function () { if (!this.params.fullWidth || !this.gridOptionsService.is('embedFullWidthRows')) { return false; } var pinnedLeftCell = this.params.pinned === 'left'; var pinnedRightCell = this.params.pinned === 'right'; var bodyCell = !pinnedLeftCell && !pinnedRightCell; if (this.gridOptionsService.is('enableRtl')) { if (this.columnModel.isPinningLeft()) { return !pinnedRightCell; } return !bodyCell; } if (this.columnModel.isPinningLeft()) { return !pinnedLeftCell; } return !bodyCell; }; GroupCellRendererCtrl.prototype.findDisplayedGroupNode = function () { var column = this.params.column; var rowNode = this.params.node; if (this.showingValueForOpenedParent) { var pointer = rowNode.parent; while (pointer != null) { if (pointer.rowGroupColumn && column.isRowGroupDisplayed(pointer.rowGroupColumn.getId())) { this.displayedGroupNode = pointer; break; } pointer = pointer.parent; } } // if we didn't find a displayed group, set it to the row node if (missing(this.displayedGroupNode)) { this.displayedGroupNode = rowNode; } }; GroupCellRendererCtrl.prototype.setupShowingValueForOpenedParent = function () { // note - this code depends on sortService.updateGroupDataForHiddenOpenParents, where group data // is updated to reflect the dragged down parents var rowNode = this.params.node; var column = this.params.column; if (!this.gridOptionsService.is('groupHideOpenParents')) { this.showingValueForOpenedParent = false; return; } // hideOpenParents means rowNode.groupData can have data for the group this column is displaying, even though // this rowNode isn't grouping by the column we are displaying // if no groupData at all, we are not showing a parent value if (!rowNode.groupData) { this.showingValueForOpenedParent = false; return; } // this is the normal case, in that we are showing a group for which this column is configured. note that // this means the Row Group is closed (if it was open, we would not be displaying it) var showingGroupNode = rowNode.rowGroupColumn != null; if (showingGroupNode) { var keyOfGroupingColumn = rowNode.rowGroupColumn.getId(); var configuredToShowThisGroupLevel = column.isRowGroupDisplayed(keyOfGroupingColumn); // if showing group as normal, we didn't take group info from parent if (configuredToShowThisGroupLevel) { this.showingValueForOpenedParent = false; return; } } // see if we are showing a Group Value for the Displayed Group. if we are showing a group value, and this Row Node // is not grouping by this Displayed Group, we must of gotten the value from a parent node var valPresent = rowNode.groupData[column.getId()] != null; this.showingValueForOpenedParent = valPresent; }; GroupCellRendererCtrl.prototype.addValueElement = function () { if (this.displayedGroupNode.footer) { this.addFooterValue(); } else { this.addGroupValue(); this.addChildCount(); } }; GroupCellRendererCtrl.prototype.addGroupValue = function () { // we try and use the cellRenderer of the column used for the grouping if we can var paramsAdjusted = this.adjustParamsWithDetailsFromRelatedColumn(); var innerCompDetails = this.getInnerCompDetails(paramsAdjusted); var valueFormatted = paramsAdjusted.valueFormatted, value = paramsAdjusted.value; var valueWhenNoRenderer = valueFormatted; if (valueWhenNoRenderer == null) { if (value === '' && this.params.node.group) { var localeTextFunc = this.localeService.getLocaleTextFunc(); valueWhenNoRenderer = localeTextFunc('blanks', '(Blanks)'); } else { valueWhenNoRenderer = value !== null && value !== void 0 ? value : null; } } this.comp.setInnerRenderer(innerCompDetails, valueWhenNoRenderer); }; GroupCellRendererCtrl.prototype.adjustParamsWithDetailsFromRelatedColumn = function () { var relatedColumn = this.displayedGroupNode.rowGroupColumn; var column = this.params.column; if (!relatedColumn) { return this.params; } var notFullWidth = column != null; if (notFullWidth) { var showingThisRowGroup = column.isRowGroupDisplayed(relatedColumn.getId()); if (!showingThisRowGroup) { return this.params; } } var params = this.params; var _a = this.params, value = _a.value, node = _a.node; var valueFormatted = this.valueFormatterService.formatValue(relatedColumn, node, value); // we don't update the original params, as they could of come through React, // as react has RowGroupCellRenderer, which means the params could be props which // would be read only var paramsAdjusted = __assign$9(__assign$9({}, params), { valueFormatted: valueFormatted }); return paramsAdjusted; }; GroupCellRendererCtrl.prototype.addFooterValue = function () { var footerValueGetter = this.params.footerValueGetter; var footerValue = ''; if (footerValueGetter) { // params is same as we were given, except we set the value as the item to display var paramsClone = cloneObject(this.params); paramsClone.value = this.params.value; if (typeof footerValueGetter === 'function') { footerValue = footerValueGetter(paramsClone); } else if (typeof footerValueGetter === 'string') { footerValue = this.expressionService.evaluate(footerValueGetter, paramsClone); } else { console.warn('AG Grid: footerValueGetter should be either a function or a string (expression)'); } } else { footerValue = 'Total ' + (this.params.value != null ? this.params.value : ''); } var innerCompDetails = this.getInnerCompDetails(this.params); this.comp.setInnerRenderer(innerCompDetails, footerValue); }; GroupCellRendererCtrl.prototype.getInnerCompDetails = function (params) { var _this = this; // for full width rows, we don't do any of the below if (params.fullWidth) { return this.userComponentFactory.getFullWidthGroupRowInnerCellRenderer(this.gridOptionsService.get('groupRowRendererParams'), params); } // when grouping, the normal case is we use the cell renderer of the grouped column. eg if grouping by country // and then rating, we will use the country cell renderer for each country group row and likewise the rating // cell renderer for each rating group row. // // however if the user has innerCellRenderer defined, this gets preference and we don't use cell renderers // of the grouped columns. // // so we check and use in the following order: // // 1) thisColDef.cellRendererParams.innerRenderer of the column showing the groups (eg auto group column) // 2) groupedColDef.cellRenderer of the grouped column // 3) groupedColDef.cellRendererParams.innerRenderer // we check if cell renderer provided for the group cell renderer, eg colDef.cellRendererParams.innerRenderer var innerCompDetails = this.userComponentFactory .getInnerRendererDetails(params, params); // avoid using GroupCellRenderer again, otherwise stack overflow, as we insert same renderer again and again. // this covers off chance user is grouping by a column that is also configured with GroupCellRenderer var isGroupRowRenderer = function (details) { return details && details.componentClass == _this.compClass; }; if (innerCompDetails && !isGroupRowRenderer(innerCompDetails)) { // use the renderer defined in cellRendererParams.innerRenderer return innerCompDetails; } var relatedColumn = this.displayedGroupNode.rowGroupColumn; var relatedColDef = relatedColumn ? relatedColumn.getColDef() : undefined; if (!relatedColDef) { return; } // otherwise see if we can use the cellRenderer of the column we are grouping by var relatedCompDetails = this.userComponentFactory .getCellRendererDetails(relatedColDef, params); if (relatedCompDetails && !isGroupRowRenderer(relatedCompDetails)) { // Only if the original column is using a specific renderer, it it is a using a DEFAULT one ignore it return relatedCompDetails; } if (isGroupRowRenderer(relatedCompDetails) && relatedColDef.cellRendererParams && relatedColDef.cellRendererParams.innerRenderer) { // edge case - this comes from a column which has been grouped dynamically, that has a renderer 'group' // and has an inner cell renderer var res = this.userComponentFactory.getInnerRendererDetails(relatedColDef.cellRendererParams, params); return res; } }; GroupCellRendererCtrl.prototype.addChildCount = function () { // only include the child count if it's included, eg if user doing custom aggregation, // then this could be left out, or set to -1, ie no child count if (this.params.suppressCount) { return; } this.addManagedListener(this.displayedGroupNode, RowNode.EVENT_ALL_CHILDREN_COUNT_CHANGED, this.updateChildCount.bind(this)); // filtering changes the child count, so need to cater for it this.updateChildCount(); }; GroupCellRendererCtrl.prototype.updateChildCount = function () { var allChildrenCount = this.displayedGroupNode.allChildrenCount; var showingGroupForThisNode = this.isShowRowGroupForThisRow(); var showCount = showingGroupForThisNode && allChildrenCount != null && allChildrenCount >= 0; var countString = showCount ? "(" + allChildrenCount + ")" : ""; this.comp.setChildCount(countString); }; GroupCellRendererCtrl.prototype.isShowRowGroupForThisRow = function () { if (this.gridOptionsService.isTreeData()) { return true; } var rowGroupColumn = this.displayedGroupNode.rowGroupColumn; if (!rowGroupColumn) { return false; } // column is null for fullWidthRows var column = this.params.column; var thisColumnIsInterested = column == null || column.isRowGroupDisplayed(rowGroupColumn.getId()); return thisColumnIsInterested; }; GroupCellRendererCtrl.prototype.addExpandAndContract = function () { var params = this.params; var eExpandedIcon = createIconNoSpan('groupExpanded', this.gridOptionsService, null); var eContractedIcon = createIconNoSpan('groupContracted', this.gridOptionsService, null); if (eExpandedIcon) { this.eExpanded.appendChild(eExpandedIcon); } if (eContractedIcon) { this.eContracted.appendChild(eContractedIcon); } var eGroupCell = params.eGridCell; // if editing groups, then double click is to start editing if (!this.gridOptionsService.is('enableGroupEdit') && this.isExpandable() && !params.suppressDoubleClickExpand) { this.addManagedListener(eGroupCell, 'dblclick', this.onCellDblClicked.bind(this)); } this.addManagedListener(this.eExpanded, 'click', this.onExpandClicked.bind(this)); this.addManagedListener(this.eContracted, 'click', this.onExpandClicked.bind(this)); // expand / contract as the user hits enter this.addManagedListener(eGroupCell, 'keydown', this.onKeyDown.bind(this)); this.addManagedListener(params.node, RowNode.EVENT_EXPANDED_CHANGED, this.showExpandAndContractIcons.bind(this)); this.showExpandAndContractIcons(); // because we don't show the expand / contract when there are no children, we need to check every time // the number of children change. var expandableChangedListener = this.onRowNodeIsExpandableChanged.bind(this); this.addManagedListener(this.displayedGroupNode, RowNode.EVENT_ALL_CHILDREN_COUNT_CHANGED, expandableChangedListener); this.addManagedListener(this.displayedGroupNode, RowNode.EVENT_MASTER_CHANGED, expandableChangedListener); this.addManagedListener(this.displayedGroupNode, RowNode.EVENT_GROUP_CHANGED, expandableChangedListener); this.addManagedListener(this.displayedGroupNode, RowNode.EVENT_HAS_CHILDREN_CHANGED, expandableChangedListener); }; GroupCellRendererCtrl.prototype.onExpandClicked = function (mouseEvent) { if (isStopPropagationForAgGrid(mouseEvent)) { return; } // so if we expand a node, it does not also get selected. stopPropagationForAgGrid(mouseEvent); this.onExpandOrContract(mouseEvent); }; GroupCellRendererCtrl.prototype.onExpandOrContract = function (e) { // must use the displayedGroup, so if data was dragged down, we expand the parent, not this row var rowNode = this.displayedGroupNode; var nextExpandState = !rowNode.expanded; if (!nextExpandState && rowNode.sticky) { this.scrollToStickyNode(rowNode); } rowNode.setExpanded(nextExpandState, e); }; GroupCellRendererCtrl.prototype.scrollToStickyNode = function (rowNode) { var gridBodyCtrl = this.ctrlsService.getGridBodyCtrl(); var scrollFeature = gridBodyCtrl.getScrollFeature(); scrollFeature.setVerticalScrollPosition(rowNode.rowTop - rowNode.stickyRowTop); }; GroupCellRendererCtrl.prototype.isExpandable = function () { if (this.showingValueForOpenedParent) { return true; } var rowNode = this.displayedGroupNode; var reducedLeafNode = this.columnModel.isPivotMode() && rowNode.leafGroup; var expandableGroup = rowNode.isExpandable() && !rowNode.footer && !reducedLeafNode; if (!expandableGroup) { return false; } // column is null for fullWidthRows var column = this.params.column; var displayingForOneColumnOnly = column != null && typeof column.getColDef().showRowGroup === 'string'; if (displayingForOneColumnOnly) { var showing = this.isShowRowGroupForThisRow(); return showing; } return true; }; GroupCellRendererCtrl.prototype.showExpandAndContractIcons = function () { var _a = this, params = _a.params, displayedGroup = _a.displayedGroupNode, columnModel = _a.columnModel; var node = params.node; var isExpandable = this.isExpandable(); if (isExpandable) { // if expandable, show one based on expand state. // if we were dragged down, means our parent is always expanded var expanded = this.showingValueForOpenedParent ? true : node.expanded; this.comp.setExpandedDisplayed(expanded); this.comp.setContractedDisplayed(!expanded); } else { // it not expandable, show neither this.comp.setExpandedDisplayed(false); this.comp.setContractedDisplayed(false); } // compensation padding for leaf nodes, so there is blank space instead of the expand icon var pivotMode = columnModel.isPivotMode(); var pivotModeAndLeafGroup = pivotMode && displayedGroup.leafGroup; var addExpandableCss = isExpandable && !pivotModeAndLeafGroup; var isTotalFooterNode = node.footer && node.level === -1; this.comp.addOrRemoveCssClass('ag-cell-expandable', addExpandableCss); this.comp.addOrRemoveCssClass('ag-row-group', addExpandableCss); if (pivotMode) { this.comp.addOrRemoveCssClass('ag-pivot-leaf-group', pivotModeAndLeafGroup); } else if (!isTotalFooterNode) { this.comp.addOrRemoveCssClass('ag-row-group-leaf-indent', !addExpandableCss); } }; GroupCellRendererCtrl.prototype.onRowNodeIsExpandableChanged = function () { // maybe if no children now, we should hide the expand / contract icons this.showExpandAndContractIcons(); // if we have no children, this impacts the indent this.setIndent(); this.refreshAriaExpanded(); }; GroupCellRendererCtrl.prototype.setupIndent = function () { // only do this if an indent - as this overwrites the padding that // the theme set, which will make things look 'not aligned' for the // first group level. var node = this.params.node; var suppressPadding = this.params.suppressPadding; if (!suppressPadding) { this.addManagedListener(node, RowNode.EVENT_UI_LEVEL_CHANGED, this.setIndent.bind(this)); this.setIndent(); } }; GroupCellRendererCtrl.prototype.setIndent = function () { if (this.gridOptionsService.is('groupHideOpenParents')) { return; } var params = this.params; var rowNode = params.node; // if we are only showing one group column, we don't want to be indenting based on level var fullWithRow = !!params.colDef; var treeData = this.gridOptionsService.isTreeData(); var manyDimensionThisColumn = !fullWithRow || treeData || params.colDef.showRowGroup === true; var paddingCount = manyDimensionThisColumn ? rowNode.uiLevel : 0; if (this.indentClass) { this.comp.addOrRemoveCssClass(this.indentClass, false); } this.indentClass = 'ag-row-group-indent-' + paddingCount; this.comp.addOrRemoveCssClass(this.indentClass, true); }; GroupCellRendererCtrl.prototype.addFullWidthRowDraggerIfNeeded = function () { var _this = this; if (!this.params.fullWidth || !this.params.rowDrag) { return; } var rowDragComp = new RowDragComp(function () { return _this.params.value; }, this.params.node); this.createManagedBean(rowDragComp, this.context); this.eGui.insertAdjacentElement('afterbegin', rowDragComp.getGui()); }; GroupCellRendererCtrl.prototype.isUserWantsSelected = function () { var paramsCheckbox = this.params.checkbox; // if a function, we always return true as change detection can show or hide the checkbox. return typeof paramsCheckbox === 'function' || paramsCheckbox === true; }; GroupCellRendererCtrl.prototype.addCheckboxIfNeeded = function () { var _this = this; var rowNode = this.displayedGroupNode; var checkboxNeeded = this.isUserWantsSelected() && // footers cannot be selected !rowNode.footer && // pinned rows cannot be selected !rowNode.rowPinned && // details cannot be selected !rowNode.detail; if (checkboxNeeded) { var cbSelectionComponent_1 = new CheckboxSelectionComponent(); this.getContext().createBean(cbSelectionComponent_1); cbSelectionComponent_1.init({ rowNode: rowNode, column: this.params.column, overrides: { isVisible: this.params.checkbox, callbackParams: this.params, removeHidden: true, }, }); this.eCheckbox.appendChild(cbSelectionComponent_1.getGui()); this.addDestroyFunc(function () { return _this.getContext().destroyBean(cbSelectionComponent_1); }); } this.comp.setCheckboxVisible(checkboxNeeded); }; GroupCellRendererCtrl.prototype.onKeyDown = function (event) { var enterKeyPressed = event.key === KeyCode.ENTER; if (!enterKeyPressed || this.params.suppressEnterExpand) { return; } var cellEditable = this.params.column && this.params.column.isCellEditable(this.params.node); if (cellEditable) { return; } this.onExpandOrContract(event); }; GroupCellRendererCtrl.prototype.onCellDblClicked = function (mouseEvent) { if (isStopPropagationForAgGrid(mouseEvent)) { return; } // we want to avoid acting on double click events on the expand / contract icon, // as that icons already has expand / collapse functionality on it. otherwise if // the icon was double clicked, we would get 'click', 'click', 'dblclick' which // is open->close->open, however double click should be open->close only. var targetIsExpandIcon = isElementInEventPath(this.eExpanded, mouseEvent) || isElementInEventPath(this.eContracted, mouseEvent); if (!targetIsExpandIcon) { this.onExpandOrContract(mouseEvent); } }; __decorate$C([ Autowired('expressionService') ], GroupCellRendererCtrl.prototype, "expressionService", void 0); __decorate$C([ Autowired('valueFormatterService') ], GroupCellRendererCtrl.prototype, "valueFormatterService", void 0); __decorate$C([ Autowired('columnModel') ], GroupCellRendererCtrl.prototype, "columnModel", void 0); __decorate$C([ Autowired('userComponentFactory') ], GroupCellRendererCtrl.prototype, "userComponentFactory", void 0); __decorate$C([ Autowired("ctrlsService") ], GroupCellRendererCtrl.prototype, "ctrlsService", void 0); return GroupCellRendererCtrl; }(BeanStub)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$K = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __decorate$D = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var GroupCellRenderer = /** @class */ (function (_super) { __extends$K(GroupCellRenderer, _super); function GroupCellRenderer() { return _super.call(this, GroupCellRenderer.TEMPLATE) || this; } GroupCellRenderer.prototype.init = function (params) { var _this = this; var compProxy = { setInnerRenderer: function (compDetails, valueToDisplay) { return _this.setRenderDetails(compDetails, valueToDisplay); }, setChildCount: function (count) { return _this.eChildCount.innerHTML = count; }, addOrRemoveCssClass: function (cssClass, value) { return _this.addOrRemoveCssClass(cssClass, value); }, setContractedDisplayed: function (expanded) { return setDisplayed(_this.eContracted, expanded); }, setExpandedDisplayed: function (expanded) { return setDisplayed(_this.eExpanded, expanded); }, setCheckboxVisible: function (visible) { return _this.eCheckbox.classList.toggle('ag-invisible', !visible); } }; var ctrl = this.createManagedBean(new GroupCellRendererCtrl()); var fullWidth = !params.colDef; var eGui = this.getGui(); ctrl.init(compProxy, eGui, this.eCheckbox, this.eExpanded, this.eContracted, this.constructor, params); if (fullWidth) { setAriaRole(eGui, 'gridcell'); } }; GroupCellRenderer.prototype.setRenderDetails = function (compDetails, valueToDisplay) { var _this = this; if (compDetails) { var componentPromise = compDetails.newAgStackInstance(); if (!componentPromise) { return; } componentPromise.then(function (comp) { if (!comp) { return; } var destroyComp = function () { return _this.context.destroyBean(comp); }; if (_this.isAlive()) { _this.eValue.appendChild(comp.getGui()); _this.addDestroyFunc(destroyComp); } else { destroyComp(); } }); } else { this.eValue.innerText = valueToDisplay; } }; // this is a user component, and IComponent has "public destroy()" as part of the interface. // so we need to have public here instead of private or protected GroupCellRenderer.prototype.destroy = function () { this.getContext().destroyBean(this.innerCellRenderer); _super.prototype.destroy.call(this); }; GroupCellRenderer.prototype.refresh = function () { return false; }; GroupCellRenderer.TEMPLATE = "\n \n \n \n \n \n "; __decorate$D([ RefSelector('eExpanded') ], GroupCellRenderer.prototype, "eExpanded", void 0); __decorate$D([ RefSelector('eContracted') ], GroupCellRenderer.prototype, "eContracted", void 0); __decorate$D([ RefSelector('eCheckbox') ], GroupCellRenderer.prototype, "eCheckbox", void 0); __decorate$D([ RefSelector('eValue') ], GroupCellRenderer.prototype, "eValue", void 0); __decorate$D([ RefSelector('eChildCount') ], GroupCellRenderer.prototype, "eChildCount", void 0); return GroupCellRenderer; }(Component)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$L = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __decorate$E = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var LoadingCellRenderer = /** @class */ (function (_super) { __extends$L(LoadingCellRenderer, _super); function LoadingCellRenderer() { return _super.call(this, LoadingCellRenderer.TEMPLATE) || this; } LoadingCellRenderer.prototype.init = function (params) { params.node.failedLoad ? this.setupFailed() : this.setupLoading(); }; LoadingCellRenderer.prototype.setupFailed = function () { var localeTextFunc = this.localeService.getLocaleTextFunc(); this.eLoadingText.innerText = localeTextFunc('loadingError', 'ERR'); }; LoadingCellRenderer.prototype.setupLoading = function () { var eLoadingIcon = createIconNoSpan('groupLoading', this.gridOptionsService, null); if (eLoadingIcon) { this.eLoadingIcon.appendChild(eLoadingIcon); } var localeTextFunc = this.localeService.getLocaleTextFunc(); this.eLoadingText.innerText = localeTextFunc('loadingOoo', 'Loading'); }; LoadingCellRenderer.prototype.refresh = function (params) { return false; }; // this is a user component, and IComponent has "public destroy()" as part of the interface. // so we need to override destroy() just to make the method public. LoadingCellRenderer.prototype.destroy = function () { _super.prototype.destroy.call(this); }; LoadingCellRenderer.TEMPLATE = "
\n \n \n
"; __decorate$E([ RefSelector('eLoadingIcon') ], LoadingCellRenderer.prototype, "eLoadingIcon", void 0); __decorate$E([ RefSelector('eLoadingText') ], LoadingCellRenderer.prototype, "eLoadingText", void 0); return LoadingCellRenderer; }(Component)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$M = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var LoadingOverlayComponent = /** @class */ (function (_super) { __extends$M(LoadingOverlayComponent, _super); function LoadingOverlayComponent() { return _super.call(this) || this; } // this is a user component, and IComponent has "public destroy()" as part of the interface. // so we need to override destroy() just to make the method public. LoadingOverlayComponent.prototype.destroy = function () { _super.prototype.destroy.call(this); }; LoadingOverlayComponent.prototype.init = function (params) { var _a; var template = (_a = this.gridOptionsService.get('overlayLoadingTemplate')) !== null && _a !== void 0 ? _a : LoadingOverlayComponent.DEFAULT_LOADING_OVERLAY_TEMPLATE; var localeTextFunc = this.localeService.getLocaleTextFunc(); var localisedTemplate = template.replace('[LOADING...]', localeTextFunc('loadingOoo', 'Loading...')); this.setTemplate(localisedTemplate); }; LoadingOverlayComponent.DEFAULT_LOADING_OVERLAY_TEMPLATE = '[LOADING...]'; return LoadingOverlayComponent; }(Component)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$N = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var NoRowsOverlayComponent = /** @class */ (function (_super) { __extends$N(NoRowsOverlayComponent, _super); function NoRowsOverlayComponent() { return _super.call(this) || this; } // this is a user component, and IComponent has "public destroy()" as part of the interface. // so we need to override destroy() just to make the method public. NoRowsOverlayComponent.prototype.destroy = function () { _super.prototype.destroy.call(this); }; NoRowsOverlayComponent.prototype.init = function (params) { var _a; var template = (_a = this.gridOptionsService.get('overlayNoRowsTemplate')) !== null && _a !== void 0 ? _a : NoRowsOverlayComponent.DEFAULT_NO_ROWS_TEMPLATE; var localeTextFunc = this.localeService.getLocaleTextFunc(); var localisedTemplate = template.replace('[NO_ROWS_TO_SHOW]', localeTextFunc('noRowsToShow', 'No Rows To Show')); this.setTemplate(localisedTemplate); }; NoRowsOverlayComponent.DEFAULT_NO_ROWS_TEMPLATE = '[NO_ROWS_TO_SHOW]'; return NoRowsOverlayComponent; }(Component)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$O = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var TooltipComponent = /** @class */ (function (_super) { __extends$O(TooltipComponent, _super); function TooltipComponent() { return _super.call(this, /* html */ "
") || this; } // will need to type params TooltipComponent.prototype.init = function (params) { var value = params.value; this.getGui().innerHTML = escapeString(value); }; return TooltipComponent; }(PopupComponent)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$P = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __decorate$F = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var __read$9 = (undefined && undefined.__read) || function (o, n) { var m = typeof Symbol === "function" && o[Symbol.iterator]; if (!m) return o; var i = m.call(o), r, ar = [], e; try { while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); } catch (error) { e = { error: error }; } finally { try { if (r && !r.done && (m = i["return"])) m.call(i); } finally { if (e) throw e.error; } } return ar; }; var __spread$6 = (undefined && undefined.__spread) || function () { for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read$9(arguments[i])); return ar; }; var UserComponentRegistry = /** @class */ (function (_super) { __extends$P(UserComponentRegistry, _super); function UserComponentRegistry() { var _this = _super !== null && _super.apply(this, arguments) || this; _this.agGridDefaults = { //date agDateInput: DefaultDateComponent, //header agColumnHeader: HeaderComp, agColumnGroupHeader: HeaderGroupComp, agSortIndicator: SortIndicatorComp, //floating filters agTextColumnFloatingFilter: TextFloatingFilter, agNumberColumnFloatingFilter: NumberFloatingFilter, agDateColumnFloatingFilter: DateFloatingFilter, agReadOnlyFloatingFilter: ReadOnlyFloatingFilter, // renderers agAnimateShowChangeCellRenderer: AnimateShowChangeCellRenderer, agAnimateSlideCellRenderer: AnimateSlideCellRenderer, agGroupCellRenderer: GroupCellRenderer, agGroupRowRenderer: GroupCellRenderer, agLoadingCellRenderer: LoadingCellRenderer, //editors agCellEditor: TextCellEditor, agTextCellEditor: TextCellEditor, agSelectCellEditor: SelectCellEditor, agLargeTextCellEditor: LargeTextCellEditor, //filter agTextColumnFilter: TextFilter, agNumberColumnFilter: NumberFilter, agDateColumnFilter: DateFilter, //overlays agLoadingOverlay: LoadingOverlayComponent, agNoRowsOverlay: NoRowsOverlayComponent, // tooltips agTooltipComponent: TooltipComponent }; /** Used to provide useful error messages if a user is trying to use an enterprise component without loading the module. */ _this.enterpriseAgDefaultCompsModule = { agSetColumnFilter: exports.ModuleNames.SetFilterModule, agSetColumnFloatingFilter: exports.ModuleNames.SetFilterModule, agMultiColumnFilter: exports.ModuleNames.MultiFilterModule, agMultiColumnFloatingFilter: exports.ModuleNames.MultiFilterModule, agGroupColumnFilter: exports.ModuleNames.RowGroupingModule, agGroupColumnFloatingFilter: exports.ModuleNames.RowGroupingModule, agRichSelect: exports.ModuleNames.RichSelectModule, agRichSelectCellEditor: exports.ModuleNames.RichSelectModule, agDetailCellRenderer: exports.ModuleNames.MasterDetailModule, agSparklineCellRenderer: exports.ModuleNames.SparklinesModule }; _this.deprecatedAgGridDefaults = { agPopupTextCellEditor: 'AG Grid: Since v27.1 The agPopupTextCellEditor is deprecated. Instead use { cellEditor: "agTextCellEditor", cellEditorPopup: true }', agPopupSelectCellEditor: 'AG Grid: Since v27.1 the agPopupSelectCellEditor is deprecated. Instead use { cellEditor: "agSelectCellEditor", cellEditorPopup: true }', }; _this.jsComps = {}; _this.fwComps = {}; return _this; } UserComponentRegistry.prototype.init = function () { var _this = this; if (this.gridOptions.components != null) { iterateObject(this.gridOptions.components, function (key, component) { return _this.registerJsComponent(key, component); }); } if (this.gridOptions.frameworkComponents != null) { iterateObject(this.gridOptions.frameworkComponents, function (key, component) { return _this.registerFwComponent(key, component); }); } }; UserComponentRegistry.prototype.registerDefaultComponent = function (name, component) { if (this.agGridDefaults[name]) { console.error("Trying to overwrite a default component. You should call registerComponent"); return; } this.agGridDefaults[name] = component; }; UserComponentRegistry.prototype.registerJsComponent = function (name, component) { if (this.fwComps[name]) { console.error("Trying to register a component that you have already registered for frameworks: " + name); return; } this.jsComps[name] = component; }; /** * B the business interface (ie IHeader) * A the agGridComponent interface (ie IHeaderComp). The final object acceptable by ag-grid */ UserComponentRegistry.prototype.registerFwComponent = function (name, component) { var warningMessage = "AG Grid: As of v27, registering components via grid property frameworkComponents is deprecated. Instead register both JavaScript AND Framework Components via the components property."; doOnce(function () { return console.warn(warningMessage); }, "UserComponentRegistry.frameworkComponentsDeprecated"); this.fwComps[name] = component; }; UserComponentRegistry.prototype.retrieve = function (propertyName, name) { var _this = this; var createResult = function (component, componentFromFramework) { return ({ componentFromFramework: componentFromFramework, component: component }); }; // FrameworkOverrides.frameworkComponent() is used in two locations: // 1) for Vue, user provided components get registered via a framework specific way. // 2) for React, it's how the React UI provides alternative default components (eg GroupCellRenderer and DetailCellRenderer) var registeredViaFrameworkComp = this.getFrameworkOverrides().frameworkComponent(name, this.gridOptions.components); if (registeredViaFrameworkComp != null) { return createResult(registeredViaFrameworkComp, true); } var frameworkComponent = this.fwComps[name]; if (frameworkComponent) { return createResult(frameworkComponent, true); } var jsComponent = this.jsComps[name]; if (jsComponent) { var isFwkComp = this.getFrameworkOverrides().isFrameworkComponent(jsComponent); return createResult(jsComponent, isFwkComp); } var defaultComponent = this.agGridDefaults[name]; if (defaultComponent) { return createResult(defaultComponent, false); } var moduleForComponent = this.enterpriseAgDefaultCompsModule[name]; if (moduleForComponent) { ModuleRegistry.assertRegistered(moduleForComponent, "AG Grid '" + propertyName + "' component: " + name); } else if (this.deprecatedAgGridDefaults[name]) { doOnce(function () { return console.warn(_this.deprecatedAgGridDefaults[name]); }, name); } else { doOnce(function () { _this.warnAboutMissingComponent(propertyName, name); }, "MissingComp" + name); } return null; }; UserComponentRegistry.prototype.warnAboutMissingComponent = function (propertyName, componentName) { var validComponents = __spread$6(Object.keys(this.agGridDefaults).filter(function (k) { return !['agCellEditor', 'agGroupRowRenderer', 'agSortIndicator'].includes(k); }), Object.keys(this.jsComps), Object.keys(this.fwComps)); var suggestions = fuzzySuggestions(componentName, validComponents, true, 0.8); console.warn("AG Grid: Could not find '" + componentName + "' component. It was configured as \"" + propertyName + ": '" + componentName + "'\" but it wasn't found in the list of registered components."); if (suggestions.length > 0) { console.warn(" Did you mean: [" + suggestions.slice(0, 3) + "]?"); } console.warn("If using a custom component check it has been registered as described in: https://ag-grid.com/javascript-data-grid/components/"); }; __decorate$F([ Autowired('gridOptions') ], UserComponentRegistry.prototype, "gridOptions", void 0); __decorate$F([ PostConstruct ], UserComponentRegistry.prototype, "init", null); UserComponentRegistry = __decorate$F([ Bean('userComponentRegistry') ], UserComponentRegistry); return UserComponentRegistry; }(BeanStub)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var DateComponent = { propertyName: 'dateComponent', cellRenderer: false }; var HeaderComponent = { propertyName: 'headerComponent', cellRenderer: false }; var HeaderGroupComponent = { propertyName: 'headerGroupComponent', cellRenderer: false }; var CellRendererComponent = { propertyName: 'cellRenderer', cellRenderer: true }; var CellEditorComponent = { propertyName: 'cellEditor', cellRenderer: false }; var InnerRendererComponent = { propertyName: 'innerRenderer', cellRenderer: true }; var LoadingOverlayComponent$1 = { propertyName: 'loadingOverlayComponent', cellRenderer: false }; var NoRowsOverlayComponent$1 = { propertyName: 'noRowsOverlayComponent', cellRenderer: false }; var TooltipComponent$1 = { propertyName: 'tooltipComponent', cellRenderer: false }; var FilterComponent = { propertyName: 'filter', cellRenderer: false }; var FloatingFilterComponent = { propertyName: 'floatingFilterComponent', cellRenderer: false }; var ToolPanelComponent = { propertyName: 'toolPanel', cellRenderer: false }; var StatusPanelComponent = { propertyName: 'statusPanel', cellRenderer: false }; var FullWidth = { propertyName: 'fullWidthCellRenderer', cellRenderer: true }; var FullWidthLoading = { propertyName: 'loadingCellRenderer', cellRenderer: true }; var FullWidthGroup = { propertyName: 'groupRowRenderer', cellRenderer: true }; var FullWidthDetail = { propertyName: 'detailCellRenderer', cellRenderer: true }; /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var FloatingFilterMapper = /** @class */ (function () { function FloatingFilterMapper() { } FloatingFilterMapper.getFloatingFilterType = function (filterType) { return this.filterToFloatingFilterMapping[filterType]; }; FloatingFilterMapper.filterToFloatingFilterMapping = { set: 'agSetColumnFloatingFilter', agSetColumnFilter: 'agSetColumnFloatingFilter', multi: 'agMultiColumnFloatingFilter', agMultiColumnFilter: 'agMultiColumnFloatingFilter', group: 'agGroupColumnFloatingFilter', agGroupColumnFilter: 'agGroupColumnFloatingFilter', number: 'agNumberColumnFloatingFilter', agNumberColumnFilter: 'agNumberColumnFloatingFilter', date: 'agDateColumnFloatingFilter', agDateColumnFilter: 'agDateColumnFloatingFilter', text: 'agTextColumnFloatingFilter', agTextColumnFilter: 'agTextColumnFloatingFilter' }; return FloatingFilterMapper; }()); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$Q = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __decorate$G = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var UserComponentFactory = /** @class */ (function (_super) { __extends$Q(UserComponentFactory, _super); function UserComponentFactory() { return _super !== null && _super.apply(this, arguments) || this; } UserComponentFactory.prototype.getHeaderCompDetails = function (colDef, params) { return this.getCompDetails(colDef, HeaderComponent, 'agColumnHeader', params); }; UserComponentFactory.prototype.getHeaderGroupCompDetails = function (params) { var colGroupDef = params.columnGroup.getColGroupDef(); return this.getCompDetails(colGroupDef, HeaderGroupComponent, 'agColumnGroupHeader', params); }; // this one is unusual, as it can be LoadingCellRenderer, DetailCellRenderer, FullWidthCellRenderer or GroupRowRenderer. // so we have to pass the type in. UserComponentFactory.prototype.getFullWidthCellRendererDetails = function (params) { return this.getCompDetails(this.gridOptions, FullWidth, null, params, true); }; UserComponentFactory.prototype.getFullWidthLoadingCellRendererDetails = function (params) { return this.getCompDetails(this.gridOptions, FullWidthLoading, 'agLoadingCellRenderer', params, true); }; UserComponentFactory.prototype.getFullWidthGroupCellRendererDetails = function (params) { return this.getCompDetails(this.gridOptions, FullWidthGroup, 'agGroupRowRenderer', params, true); }; UserComponentFactory.prototype.getFullWidthDetailCellRendererDetails = function (params) { return this.getCompDetails(this.gridOptions, FullWidthDetail, 'agDetailCellRenderer', params, true); }; // CELL RENDERER UserComponentFactory.prototype.getInnerRendererDetails = function (def, params) { return this.getCompDetails(def, InnerRendererComponent, null, params); }; UserComponentFactory.prototype.getFullWidthGroupRowInnerCellRenderer = function (def, params) { return this.getCompDetails(def, InnerRendererComponent, null, params); }; UserComponentFactory.prototype.getCellRendererDetails = function (def, params) { return this.getCompDetails(def, CellRendererComponent, null, params); }; // CELL EDITOR UserComponentFactory.prototype.getCellEditorDetails = function (def, params) { return this.getCompDetails(def, CellEditorComponent, 'agCellEditor', params, true); }; // FILTER UserComponentFactory.prototype.getFilterDetails = function (def, params, defaultFilter) { return this.getCompDetails(def, FilterComponent, defaultFilter, params, true); }; UserComponentFactory.prototype.getDateCompDetails = function (params) { return this.getCompDetails(this.gridOptions, DateComponent, 'agDateInput', params, true); }; UserComponentFactory.prototype.getLoadingOverlayCompDetails = function (params) { return this.getCompDetails(this.gridOptions, LoadingOverlayComponent$1, 'agLoadingOverlay', params, true); }; UserComponentFactory.prototype.getNoRowsOverlayCompDetails = function (params) { return this.getCompDetails(this.gridOptions, NoRowsOverlayComponent$1, 'agNoRowsOverlay', params, true); }; UserComponentFactory.prototype.getTooltipCompDetails = function (params) { return this.getCompDetails(params.colDef, TooltipComponent$1, 'agTooltipComponent', params, true); }; UserComponentFactory.prototype.getSetFilterCellRendererDetails = function (def, params) { return this.getCompDetails(def, CellRendererComponent, null, params); }; UserComponentFactory.prototype.getFloatingFilterCompDetails = function (def, params, defaultFloatingFilter) { return this.getCompDetails(def, FloatingFilterComponent, defaultFloatingFilter, params); }; UserComponentFactory.prototype.getToolPanelCompDetails = function (toolPanelDef, params) { return this.getCompDetails(toolPanelDef, ToolPanelComponent, null, params, true); }; UserComponentFactory.prototype.getStatusPanelCompDetails = function (def, params) { return this.getCompDetails(def, StatusPanelComponent, null, params, true); }; UserComponentFactory.prototype.getCompDetails = function (defObject, type, defaultName, params, mandatory) { var _this = this; if (mandatory === void 0) { mandatory = false; } var propertyName = type.propertyName, cellRenderer = type.cellRenderer; var _a = this.getCompKeys(defObject, type, params), compName = _a.compName, jsComp = _a.jsComp, fwComp = _a.fwComp, paramsFromSelector = _a.paramsFromSelector, popupFromSelector = _a.popupFromSelector, popupPositionFromSelector = _a.popupPositionFromSelector; var lookupFromRegistry = function (key) { var item = _this.userComponentRegistry.retrieve(propertyName, key); if (item) { jsComp = !item.componentFromFramework ? item.component : undefined; fwComp = item.componentFromFramework ? item.component : undefined; } }; // if compOption is a string, means we need to look the item up if (compName != null) { lookupFromRegistry(compName); } // if lookup brought nothing back, and we have a default, lookup the default if (jsComp == null && fwComp == null && defaultName != null) { lookupFromRegistry(defaultName); } // if we have a comp option, and it's a function, replace it with an object equivalent adaptor if (jsComp && cellRenderer && !this.agComponentUtils.doesImplementIComponent(jsComp)) { jsComp = this.agComponentUtils.adaptFunction(propertyName, jsComp); } if (!jsComp && !fwComp) { if (mandatory) { console.error("AG Grid: Could not find component " + compName + ", did you forget to configure this component?"); } return; } var paramsMerged = this.mergeParamsWithApplicationProvidedParams(defObject, type, params, paramsFromSelector); var componentFromFramework = jsComp == null; var componentClass = jsComp ? jsComp : fwComp; return { componentFromFramework: componentFromFramework, componentClass: componentClass, params: paramsMerged, type: type, popupFromSelector: popupFromSelector, popupPositionFromSelector: popupPositionFromSelector, newAgStackInstance: function () { return _this.newAgStackInstance(componentClass, componentFromFramework, paramsMerged, type); } }; }; UserComponentFactory.prototype.getCompKeys = function (defObject, type, params) { var _this = this; var propertyName = type.propertyName; var compName; var jsComp; var fwComp; var paramsFromSelector; var popupFromSelector; var popupPositionFromSelector; // there are two types of js comps, class based and func based. we can only check for // class based, by checking if getGui() exists. no way to differentiate js func based vs eg react func based // const isJsClassComp = (comp: any) => this.agComponentUtils.doesImplementIComponent(comp); // const fwActive = this.frameworkComponentWrapper != null; // pull from defObject if available if (defObject) { var defObjectAny = defObject; // if selector, use this var selectorFunc = defObjectAny[propertyName + 'Selector']; var selectorRes = selectorFunc ? selectorFunc(params) : null; var assignComp = function (providedJsComp, providedFwComp) { var xxxFrameworkDeprecatedWarn = function () { var warningMessage = "AG Grid: As of v27, the property " + propertyName + "Framework is deprecated. The property " + propertyName + " can now be used for JavaScript AND Framework Components."; doOnce(function () { return console.warn(warningMessage); }, "UserComponentFactory." + propertyName + "FrameworkDeprecated"); }; if (typeof providedJsComp === 'string') { compName = providedJsComp; } else if (typeof providedFwComp === 'string') { xxxFrameworkDeprecatedWarn(); compName = providedFwComp; // comp===true for filters, which means use the default comp } else if (providedJsComp != null && providedJsComp !== true) { var isFwkComp = _this.getFrameworkOverrides().isFrameworkComponent(providedJsComp); if (isFwkComp) { fwComp = providedJsComp; } else { jsComp = providedJsComp; } } else if (providedFwComp != null) { xxxFrameworkDeprecatedWarn(); fwComp = providedFwComp; } }; if (selectorRes) { if (selectorRes.frameworkComponent != null) { var warningMessage_1 = "AG Grid: As of v27, the return for " + propertyName + "Selector has attributes [component, params] only. The attribute frameworkComponent is deprecated. You should now return back Framework Components using the 'component' attribute and the grid works out if it's a framework component or not."; doOnce(function () { return console.warn(warningMessage_1); }, "UserComponentFactory." + propertyName + "FrameworkSelectorDeprecated"); assignComp(selectorRes.frameworkComponent, undefined); } else { assignComp(selectorRes.component, undefined); } paramsFromSelector = selectorRes.params; popupFromSelector = selectorRes.popup; popupPositionFromSelector = selectorRes.popupPosition; } else { // if no selector, or result of selector is empty, take from defObject assignComp(defObjectAny[propertyName], defObjectAny[propertyName + 'Framework']); } } return { compName: compName, jsComp: jsComp, fwComp: fwComp, paramsFromSelector: paramsFromSelector, popupFromSelector: popupFromSelector, popupPositionFromSelector: popupPositionFromSelector }; }; UserComponentFactory.prototype.newAgStackInstance = function (ComponentClass, componentFromFramework, params, type) { var propertyName = type.propertyName; var jsComponent = !componentFromFramework; // using javascript component var instance; if (jsComponent) { instance = new ComponentClass(); } else { // Using framework component var thisComponentConfig = this.componentMetadataProvider.retrieve(propertyName); instance = this.frameworkComponentWrapper.wrap(ComponentClass, thisComponentConfig.mandatoryMethodList, thisComponentConfig.optionalMethodList, type); } var deferredInit = this.initComponent(instance, params); if (deferredInit == null) { return AgPromise.resolve(instance); } return deferredInit.then(function () { return instance; }); }; // used by Floating Filter UserComponentFactory.prototype.mergeParamsWithApplicationProvidedParams = function (defObject, type, paramsFromGrid, paramsFromSelector) { if (paramsFromSelector === void 0) { paramsFromSelector = null; } var params = { context: this.gridOptionsService.context, columnApi: this.gridOptionsService.columnApi, api: this.gridOptionsService.api }; mergeDeep(params, paramsFromGrid); // pull user params from either the old prop name and new prop name // eg either cellRendererParams and cellCompParams var defObjectAny = defObject; var userParams = defObjectAny && defObjectAny[type.propertyName + 'Params']; if (typeof userParams === 'function') { var userParamsFromFunc = userParams(paramsFromGrid); mergeDeep(params, userParamsFromFunc); } else if (typeof userParams === 'object') { mergeDeep(params, userParams); } mergeDeep(params, paramsFromSelector); return params; }; UserComponentFactory.prototype.initComponent = function (component, params) { this.context.createBean(component); if (component.init == null) { return; } return component.init(params); }; UserComponentFactory.prototype.getDefaultFloatingFilterType = function (def) { if (def == null) { return null; } var defaultFloatingFilterType = null; var _a = this.getCompKeys(def, FilterComponent), compName = _a.compName, jsComp = _a.jsComp, fwComp = _a.fwComp; if (compName) { // will be undefined if not in the map defaultFloatingFilterType = FloatingFilterMapper.getFloatingFilterType(compName); } else { var usingDefaultFilter = (jsComp == null && fwComp == null) && (def.filter === true); if (usingDefaultFilter) { var setFilterModuleLoaded = ModuleRegistry.isRegistered(exports.ModuleNames.SetFilterModule); defaultFloatingFilterType = setFilterModuleLoaded ? 'agSetColumnFloatingFilter' : 'agTextColumnFloatingFilter'; } } return defaultFloatingFilterType; }; __decorate$G([ Autowired('gridOptions') ], UserComponentFactory.prototype, "gridOptions", void 0); __decorate$G([ Autowired('agComponentUtils') ], UserComponentFactory.prototype, "agComponentUtils", void 0); __decorate$G([ Autowired('componentMetadataProvider') ], UserComponentFactory.prototype, "componentMetadataProvider", void 0); __decorate$G([ Autowired('userComponentRegistry') ], UserComponentFactory.prototype, "userComponentRegistry", void 0); __decorate$G([ Optional('frameworkComponentWrapper') ], UserComponentFactory.prototype, "frameworkComponentWrapper", void 0); UserComponentFactory = __decorate$G([ Bean('userComponentFactory') ], UserComponentFactory); return UserComponentFactory; }(BeanStub)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ (function (ExcelFactoryMode) { ExcelFactoryMode[ExcelFactoryMode["SINGLE_SHEET"] = 0] = "SINGLE_SHEET"; ExcelFactoryMode[ExcelFactoryMode["MULTI_SHEET"] = 1] = "MULTI_SHEET"; })(exports.ExcelFactoryMode || (exports.ExcelFactoryMode = {})); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$R = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __decorate$H = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; /** Adds drag listening onto an element. In AG Grid this is used twice, first is resizing columns, * second is moving the columns and column groups around (ie the 'drag' part of Drag and Drop. */ var DragService = /** @class */ (function (_super) { __extends$R(DragService, _super); function DragService() { var _this = _super !== null && _super.apply(this, arguments) || this; _this.dragEndFunctions = []; _this.dragSources = []; return _this; } DragService.prototype.init = function () { this.logger = this.loggerFactory.create('DragService'); }; DragService.prototype.removeAllListeners = function () { this.dragSources.forEach(this.removeListener.bind(this)); this.dragSources.length = 0; }; DragService.prototype.removeListener = function (dragSourceAndListener) { var element = dragSourceAndListener.dragSource.eElement; var mouseDownListener = dragSourceAndListener.mouseDownListener; element.removeEventListener('mousedown', mouseDownListener); // remove touch listener only if it exists if (dragSourceAndListener.touchEnabled) { var touchStartListener = dragSourceAndListener.touchStartListener; element.removeEventListener('touchstart', touchStartListener, { passive: true }); } }; DragService.prototype.removeDragSource = function (params) { var dragSourceAndListener = this.dragSources.find(function (item) { return item.dragSource === params; }); if (!dragSourceAndListener) { return; } this.removeListener(dragSourceAndListener); removeFromArray(this.dragSources, dragSourceAndListener); }; DragService.prototype.isDragging = function () { return this.dragging; }; DragService.prototype.addDragSource = function (params, includeTouch) { var _this = this; if (includeTouch === void 0) { includeTouch = false; } var mouseListener = this.onMouseDown.bind(this, params); params.eElement.addEventListener('mousedown', mouseListener); var touchListener = null; var suppressTouch = this.gridOptionsService.is('suppressTouch'); if (includeTouch && !suppressTouch) { touchListener = function (touchEvent) { if (isFocusableFormField(touchEvent.target)) { return; } if (touchEvent.cancelable) { touchEvent.preventDefault(); touchEvent.stopPropagation(); } _this.onTouchStart(params, touchEvent); }; // we set passive=false, as we want to prevent default on this event params.eElement.addEventListener('touchstart', touchListener, { passive: false }); } this.dragSources.push({ dragSource: params, mouseDownListener: mouseListener, touchStartListener: touchListener, touchEnabled: includeTouch }); }; // gets called whenever mouse down on any drag source DragService.prototype.onTouchStart = function (params, touchEvent) { var _this = this; this.currentDragParams = params; this.dragging = false; var touch = touchEvent.touches[0]; this.touchLastTime = touch; this.touchStart = touch; var touchMoveEvent = function (e) { return _this.onTouchMove(e, params.eElement); }; var touchEndEvent = function (e) { return _this.onTouchUp(e, params.eElement); }; var documentTouchMove = function (e) { if (e.cancelable) { e.preventDefault(); } }; var target = touchEvent.target; var events = [ // Prevents the page document from moving while we are dragging items around. // preventDefault needs to be called in the touchmove listener and never inside the // touchstart, because using touchstart causes the click event to be cancelled on touch devices. { target: document, type: 'touchmove', listener: documentTouchMove, options: { passive: false } }, { target: target, type: 'touchmove', listener: touchMoveEvent, options: { passive: true } }, { target: target, type: 'touchend', listener: touchEndEvent, options: { passive: true } }, { target: target, type: 'touchcancel', listener: touchEndEvent, options: { passive: true } } ]; // temporally add these listeners, for the duration of the drag this.addTemporaryEvents(events); // see if we want to start dragging straight away if (params.dragStartPixels === 0) { this.onCommonMove(touch, this.touchStart, params.eElement); } }; // gets called whenever mouse down on any drag source DragService.prototype.onMouseDown = function (params, mouseEvent) { var _this = this; var e = mouseEvent; if (params.skipMouseEvent && params.skipMouseEvent(mouseEvent)) { return; } // if there are two elements with parent / child relationship, and both are draggable, // when we drag the child, we should NOT drag the parent. an example of this is row moving // and range selection - row moving should get preference when use drags the rowDrag component. if (e._alreadyProcessedByDragService) { return; } e._alreadyProcessedByDragService = true; // only interested in left button clicks if (mouseEvent.button !== 0) { return; } this.currentDragParams = params; this.dragging = false; this.mouseStartEvent = mouseEvent; var eDocument = this.gridOptionsService.getDocument(); var mouseMoveEvent = function (event) { return _this.onMouseMove(event, params.eElement); }; var mouseUpEvent = function (event) { return _this.onMouseUp(event, params.eElement); }; var contextEvent = function (event) { return event.preventDefault(); }; var target = eDocument; var events = [ { target: target, type: 'mousemove', listener: mouseMoveEvent }, { target: target, type: 'mouseup', listener: mouseUpEvent }, { target: target, type: 'contextmenu', listener: contextEvent } ]; // temporally add these listeners, for the duration of the drag this.addTemporaryEvents(events); //see if we want to start dragging straight away if (params.dragStartPixels === 0) { this.onMouseMove(mouseEvent, params.eElement); } }; DragService.prototype.addTemporaryEvents = function (events) { events.forEach(function (currentEvent) { var target = currentEvent.target, type = currentEvent.type, listener = currentEvent.listener, options = currentEvent.options; target.addEventListener(type, listener, options); }); this.dragEndFunctions.push(function () { events.forEach(function (currentEvent) { var target = currentEvent.target, type = currentEvent.type, listener = currentEvent.listener, options = currentEvent.options; target.removeEventListener(type, listener, options); }); }); }; // returns true if the event is close to the original event by X pixels either vertically or horizontally. // we only start dragging after X pixels so this allows us to know if we should start dragging yet. DragService.prototype.isEventNearStartEvent = function (currentEvent, startEvent) { // by default, we wait 4 pixels before starting the drag var dragStartPixels = this.currentDragParams.dragStartPixels; var requiredPixelDiff = exists(dragStartPixels) ? dragStartPixels : 4; return areEventsNear(currentEvent, startEvent, requiredPixelDiff); }; DragService.prototype.getFirstActiveTouch = function (touchList) { for (var i = 0; i < touchList.length; i++) { if (touchList[i].identifier === this.touchStart.identifier) { return touchList[i]; } } return null; }; DragService.prototype.onCommonMove = function (currentEvent, startEvent, el) { if (!this.dragging) { // if mouse hasn't travelled from the start position enough, do nothing if (!this.dragging && this.isEventNearStartEvent(currentEvent, startEvent)) { return; } this.dragging = true; var event_1 = { type: Events.EVENT_DRAG_STARTED, target: el }; this.eventService.dispatchEvent(event_1); this.currentDragParams.onDragStart(startEvent); // we need ONE drag action at the startEvent, so that we are guaranteed the drop target // at the start gets notified. this is because the drag can start outside of the element // that started it, as the mouse is allowed drag away from the mouse down before it's // considered a drag (the isEventNearStartEvent() above). if we didn't do this, then // it would be possible to click a column by the edge, then drag outside of the drop zone // in less than 4 pixels and the drag officially starts outside of the header but the header // wouldn't be notified of the dragging. this.currentDragParams.onDragging(startEvent); } this.currentDragParams.onDragging(currentEvent); }; DragService.prototype.onTouchMove = function (touchEvent, el) { var touch = this.getFirstActiveTouch(touchEvent.touches); if (!touch) { return; } // this.___statusPanel.setInfoText(Math.random() + ' onTouchMove preventDefault stopPropagation'); this.onCommonMove(touch, this.touchStart, el); }; // only gets called after a mouse down - as this is only added after mouseDown // and is removed when mouseUp happens DragService.prototype.onMouseMove = function (mouseEvent, el) { // when `isEnableCellTextSelect` is `true`, we need to preventDefault on mouseMove // to avoid the grid text being selected while dragging components. // Note: Safari also has an issue, where `user-select: none` is not being respected. if ((this.gridOptionsService.is('enableCellTextSelection') || isBrowserSafari()) && // The event type can be `mousedown` when `dragStartPixels=0` // we should only preventDefault on `mousemove`. mouseEvent.type === 'mousemove' && mouseEvent.cancelable && this.mouseEventService.isEventFromThisGrid(mouseEvent) && // we should not prevent mouseMove when above a form field // as that would prevent the text in the field from being selected !this.isOverFormFieldElement(mouseEvent)) { mouseEvent.preventDefault(); } this.onCommonMove(mouseEvent, this.mouseStartEvent, el); }; DragService.prototype.isOverFormFieldElement = function (mouseEvent) { var el = mouseEvent.target; var tagName = el === null || el === void 0 ? void 0 : el.tagName.toLocaleLowerCase(); return !!(tagName === null || tagName === void 0 ? void 0 : tagName.match('^a$|textarea|input|select|button')); }; DragService.prototype.onTouchUp = function (touchEvent, el) { var touch = this.getFirstActiveTouch(touchEvent.changedTouches); // i haven't worked this out yet, but there is no matching touch // when we get the touch up event. to get around this, we swap in // the last touch. this is a hack to 'get it working' while we // figure out what's going on, why we are not getting a touch in // current event. if (!touch) { touch = this.touchLastTime; } // if mouse was left up before we started to move, then this is a tap. // we check this before onUpCommon as onUpCommon resets the dragging // let tap = !this.dragging; // let tapTarget = this.currentDragParams.eElement; this.onUpCommon(touch, el); // if tap, tell user // console.log(`${Math.random()} tap = ${tap}`); // if (tap) { // tapTarget.click(); // } }; DragService.prototype.onMouseUp = function (mouseEvent, el) { this.onUpCommon(mouseEvent, el); }; DragService.prototype.onUpCommon = function (eventOrTouch, el) { if (this.dragging) { this.dragging = false; this.currentDragParams.onDragStop(eventOrTouch); var event_2 = { type: Events.EVENT_DRAG_STOPPED, target: el }; this.eventService.dispatchEvent(event_2); } this.mouseStartEvent = null; this.touchStart = null; this.touchLastTime = null; this.currentDragParams = null; this.dragEndFunctions.forEach(function (func) { return func(); }); this.dragEndFunctions.length = 0; }; __decorate$H([ Autowired('loggerFactory') ], DragService.prototype, "loggerFactory", void 0); __decorate$H([ Autowired('mouseEventService') ], DragService.prototype, "mouseEventService", void 0); __decorate$H([ PostConstruct ], DragService.prototype, "init", null); __decorate$H([ PreDestroy ], DragService.prototype, "removeAllListeners", null); DragService = __decorate$H([ Bean('dragService') ], DragService); return DragService; }(BeanStub)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ (function (RowHighlightPosition) { RowHighlightPosition[RowHighlightPosition["Above"] = 0] = "Above"; RowHighlightPosition[RowHighlightPosition["Below"] = 1] = "Below"; })(exports.RowHighlightPosition || (exports.RowHighlightPosition = {})); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ (function (ClientSideRowModelSteps) { ClientSideRowModelSteps["EVERYTHING"] = "group"; ClientSideRowModelSteps["FILTER"] = "filter"; ClientSideRowModelSteps["SORT"] = "sort"; ClientSideRowModelSteps["MAP"] = "map"; ClientSideRowModelSteps["AGGREGATE"] = "aggregate"; ClientSideRowModelSteps["FILTER_AGGREGATES"] = "filter_aggregates"; ClientSideRowModelSteps["PIVOT"] = "pivot"; ClientSideRowModelSteps["NOTHING"] = "nothing"; })(exports.ClientSideRowModelSteps || (exports.ClientSideRowModelSteps = {})); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __decorate$I = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; function unwrapUserComp(comp) { var compAsAny = comp; var isProxy = compAsAny != null && compAsAny.getFrameworkComponentInstance != null; return isProxy ? compAsAny.getFrameworkComponentInstance() : comp; } var GridApi = /** @class */ (function () { function GridApi() { this.detailGridInfoMap = {}; this.destroyCalled = false; } GridApi.prototype.registerOverlayWrapperComp = function (overlayWrapperComp) { this.overlayWrapperComp = overlayWrapperComp; }; GridApi.prototype.registerSideBarComp = function (sideBarComp) { this.sideBarComp = sideBarComp; }; GridApi.prototype.init = function () { var _this = this; switch (this.rowModel.getType()) { case 'clientSide': this.clientSideRowModel = this.rowModel; break; case 'infinite': this.infiniteRowModel = this.rowModel; break; case 'serverSide': this.serverSideRowModel = this.rowModel; break; } this.ctrlsService.whenReady(function () { _this.gridBodyCtrl = _this.ctrlsService.getGridBodyCtrl(); }); }; /** Used internally by grid. Not intended to be used by the client. Interface may change between releases. */ GridApi.prototype.__getAlignedGridService = function () { return this.alignedGridsService; }; /** Used internally by grid. Not intended to be used by the client. Interface may change between releases. */ GridApi.prototype.__getContext = function () { return this.context; }; GridApi.prototype.getSetterMethod = function (key) { return "set" + key.charAt(0).toUpperCase() + key.substring(1); }; /** Used internally by grid. Not intended to be used by the client. Interface may change between releases. */ GridApi.prototype.__setProperty = function (propertyName, value) { // Ensure the GridOptions property gets updated and fires the change event as we // cannot assume that the dynamic Api call will updated GridOptions. this.gridOptionsService.set(propertyName, value); // If the dynamic api does update GridOptions then change detection in the // GridOptionsService will prevent the event being fired twice. var setterName = this.getSetterMethod(propertyName); var dynamicApi = this; if (dynamicApi[setterName]) { dynamicApi[setterName](value); } }; /** Register a detail grid with the master grid when it is created. */ GridApi.prototype.addDetailGridInfo = function (id, gridInfo) { this.detailGridInfoMap[id] = gridInfo; }; /** Unregister a detail grid from the master grid when it is destroyed. */ GridApi.prototype.removeDetailGridInfo = function (id) { this.detailGridInfoMap[id] = undefined; }; /** Returns the `DetailGridInfo` corresponding to the supplied `detailGridId`. */ GridApi.prototype.getDetailGridInfo = function (id) { return this.detailGridInfoMap[id]; }; /** Iterates through each `DetailGridInfo` in the grid and calls the supplied callback on each. */ GridApi.prototype.forEachDetailGridInfo = function (callback) { var index = 0; iterateObject(this.detailGridInfoMap, function (id, gridInfo) { // check for undefined, as old references will still be lying around if (exists(gridInfo)) { callback(gridInfo, index); index++; } }); }; /** Similar to `exportDataAsCsv`, except returns the result as a string rather than download it. */ GridApi.prototype.getDataAsCsv = function (params) { if (ModuleRegistry.assertRegistered(exports.ModuleNames.CsvExportModule, 'api.getDataAsCsv')) { return this.csvCreator.getDataAsCsv(params); } }; /** Downloads a CSV export of the grid's data. */ GridApi.prototype.exportDataAsCsv = function (params) { if (ModuleRegistry.assertRegistered(exports.ModuleNames.CsvExportModule, 'api.exportDataAsCSv')) { this.csvCreator.exportDataAsCsv(params); } }; GridApi.prototype.getExcelExportMode = function (params) { var baseParams = this.gridOptionsService.get('defaultExcelExportParams'); var mergedParams = Object.assign({ exportMode: 'xlsx' }, baseParams, params); return mergedParams.exportMode; }; GridApi.prototype.assertNotExcelMultiSheet = function (method, params) { if (!ModuleRegistry.assertRegistered(exports.ModuleNames.ExcelExportModule, 'api.' + method)) { return false; } var exportMode = this.getExcelExportMode(params); if (this.excelCreator.getFactoryMode(exportMode) === exports.ExcelFactoryMode.MULTI_SHEET) { console.warn("AG Grid: The Excel Exporter is currently on Multi Sheet mode. End that operation by calling 'api.getMultipleSheetAsExcel()' or 'api.exportMultipleSheetsAsExcel()'"); return false; } return true; }; /** Similar to `exportDataAsExcel`, except instead of downloading a file, it will return a [Blob](https://developer.mozilla.org/en-US/docs/Web/API/Blob) to be processed by the user. */ GridApi.prototype.getDataAsExcel = function (params) { if (this.assertNotExcelMultiSheet('getDataAsExcel', params)) { return this.excelCreator.getDataAsExcel(params); } }; /** Downloads an Excel export of the grid's data. */ GridApi.prototype.exportDataAsExcel = function (params) { if (this.assertNotExcelMultiSheet('exportDataAsExcel', params)) { this.excelCreator.exportDataAsExcel(params); } }; /** This is method to be used to get the grid's data as a sheet, that will later be exported either by `getMultipleSheetsAsExcel()` or `exportMultipleSheetsAsExcel()`. */ GridApi.prototype.getSheetDataForExcel = function (params) { if (!ModuleRegistry.assertRegistered(exports.ModuleNames.ExcelExportModule, 'api.getSheetDataForExcel')) { return; } var exportMode = this.getExcelExportMode(params); this.excelCreator.setFactoryMode(exports.ExcelFactoryMode.MULTI_SHEET, exportMode); return this.excelCreator.getSheetDataForExcel(params); }; /** Similar to `exportMultipleSheetsAsExcel`, except instead of downloading a file, it will return a [Blob](https://developer.mozilla.org/en-US/docs/Web/API/Blob) to be processed by the user. */ GridApi.prototype.getMultipleSheetsAsExcel = function (params) { if (ModuleRegistry.assertRegistered(exports.ModuleNames.ExcelExportModule, 'api.getMultipleSheetsAsExcel')) { return this.excelCreator.getMultipleSheetsAsExcel(params); } }; /** Downloads an Excel export of multiple sheets in one file. */ GridApi.prototype.exportMultipleSheetsAsExcel = function (params) { if (ModuleRegistry.assertRegistered(exports.ModuleNames.ExcelExportModule, 'api.exportMultipleSheetsAsExcel')) { return this.excelCreator.exportMultipleSheetsAsExcel(params); } }; /** * Sets an ARIA property in the grid panel (element with `role=\"grid\"`), and removes an ARIA property when the value is null. * * Example: `api.setGridAriaProperty('label', 'my grid')` will set `aria-label=\"my grid\"`. * * `api.setGridAriaProperty('label', null)` will remove the `aria-label` attribute from the grid element. */ GridApi.prototype.setGridAriaProperty = function (property, value) { if (!property) { return; } var eGrid = this.ctrlsService.getGridBodyCtrl().getGui(); var ariaProperty = "aria-" + property; if (value === null) { eGrid.removeAttribute(ariaProperty); } else { eGrid.setAttribute(ariaProperty, value); } }; GridApi.prototype.logMissingRowModel = function (apiMethod) { var requiredRowModels = []; for (var _i = 1; _i < arguments.length; _i++) { requiredRowModels[_i - 1] = arguments[_i]; } console.error("AG Grid: api." + apiMethod + " can only be called when gridOptions.rowModelType is " + requiredRowModels.join(' or ')); }; /** Set new datasource for Server-Side Row Model. */ GridApi.prototype.setServerSideDatasource = function (datasource) { if (this.serverSideRowModel) { this.serverSideRowModel.setDatasource(datasource); } else { this.logMissingRowModel('setServerSideDatasource', 'serverSide'); } }; /** * Updates the `cacheBlockSize` when requesting data from the server if `suppressServerSideInfiniteScroll` is not enabled. * * Note this purges all the cached data and reloads all the rows of the grid. * */ GridApi.prototype.setCacheBlockSize = function (blockSize) { if (this.serverSideRowModel) { this.gridOptionsService.set('cacheBlockSize', blockSize); this.serverSideRowModel.resetRootStore(); } else { this.logMissingRowModel('setCacheBlockSize', 'serverSide'); } }; /** Set new datasource for Infinite Row Model. */ GridApi.prototype.setDatasource = function (datasource) { if (this.gridOptionsService.isRowModelType('infinite')) { this.rowModel.setDatasource(datasource); } else { this.logMissingRowModel('setDatasource', 'infinite'); } }; /** Set new datasource for Viewport Row Model. */ GridApi.prototype.setViewportDatasource = function (viewportDatasource) { if (this.gridOptionsService.isRowModelType('viewport')) { // this is bad coding, because it's using an interface that's exposed in the enterprise. // really we should create an interface in the core for viewportDatasource and let // the enterprise implement it, rather than casting to 'any' here this.rowModel.setViewportDatasource(viewportDatasource); } else { this.logMissingRowModel('setViewportDatasource', 'viewport'); } }; /** Set the row data. */ GridApi.prototype.setRowData = function (rowData) { // immutable service is part of the CSRM module, if missing, no CSRM var missingImmutableService = this.immutableService == null; if (missingImmutableService) { this.logMissingRowModel('setRowData', 'clientSide'); return; } // if no keys provided provided for rows, then we can tread the operation as Immutable if (this.immutableService.isActive()) { this.immutableService.setRowData(rowData); } else { this.selectionService.reset(); this.clientSideRowModel.setRowData(rowData); } }; /** Set the top pinned rows. Call with no rows / undefined to clear top pinned rows. */ GridApi.prototype.setPinnedTopRowData = function (rows) { this.pinnedRowModel.setPinnedTopRowData(rows); }; /** Set the bottom pinned rows. Call with no rows / undefined to clear bottom pinned rows. */ GridApi.prototype.setPinnedBottomRowData = function (rows) { this.pinnedRowModel.setPinnedBottomRowData(rows); }; /** Gets the number of top pinned rows. */ GridApi.prototype.getPinnedTopRowCount = function () { return this.pinnedRowModel.getPinnedTopRowCount(); }; /** Gets the number of bottom pinned rows. */ GridApi.prototype.getPinnedBottomRowCount = function () { return this.pinnedRowModel.getPinnedBottomRowCount(); }; /** Gets the top pinned row with the specified index. */ GridApi.prototype.getPinnedTopRow = function (index) { return this.pinnedRowModel.getPinnedTopRow(index); }; /** Gets the top pinned row with the specified index. */ GridApi.prototype.getPinnedBottomRow = function (index) { return this.pinnedRowModel.getPinnedBottomRow(index); }; /** * Call to set new column definitions. The grid will redraw all the column headers, and then redraw all of the rows. */ GridApi.prototype.setColumnDefs = function (colDefs, source) { if (source === void 0) { source = "api"; } this.columnModel.setColumnDefs(colDefs, source); // Keep gridOptions.columnDefs in sync this.gridOptionsService.set('columnDefs', colDefs, true, { source: source }); }; /** Call to set new auto group column definition. The grid will recreate any auto-group columns if present. */ GridApi.prototype.setAutoGroupColumnDef = function (colDef, source) { if (source === void 0) { source = "api"; } this.gridOptionsService.set('autoGroupColumnDef', colDef, true, { source: source }); }; /** Call to set new Default Column Definition. */ GridApi.prototype.setDefaultColDef = function (colDef, source) { if (source === void 0) { source = "api"; } this.gridOptionsService.set('defaultColDef', colDef, true, { source: source }); }; /** Call to set new Column Types. */ GridApi.prototype.setColumnTypes = function (columnTypes, source) { if (source === void 0) { source = "api"; } this.gridOptionsService.set('columnTypes', columnTypes, true, { source: source }); }; GridApi.prototype.expireValueCache = function () { this.valueCache.expire(); }; /** * Returns an object with two properties: * - `top`: The top pixel position of the current scroll in the grid * - `bottom`: The bottom pixel position of the current scroll in the grid */ GridApi.prototype.getVerticalPixelRange = function () { return this.gridBodyCtrl.getScrollFeature().getVScrollPosition(); }; /** * Returns an object with two properties: * - `left`: The left pixel position of the current scroll in the grid * - `right`: The right pixel position of the current scroll in the grid */ GridApi.prototype.getHorizontalPixelRange = function () { return this.gridBodyCtrl.getScrollFeature().getHScrollPosition(); }; /** If `true`, the horizontal scrollbar will always be present, even if not required. Otherwise, it will only be displayed when necessary. */ GridApi.prototype.setAlwaysShowHorizontalScroll = function (show) { this.gridOptionsService.set('alwaysShowHorizontalScroll', show); }; /** If `true`, the vertical scrollbar will always be present, even if not required. Otherwise it will only be displayed when necessary. */ GridApi.prototype.setAlwaysShowVerticalScroll = function (show) { this.gridOptionsService.set('alwaysShowVerticalScroll', show); }; /** Performs change detection on all cells, refreshing cells where required. */ GridApi.prototype.refreshCells = function (params) { if (params === void 0) { params = {}; } this.rowRenderer.refreshCells(params); }; /** Flash rows, columns or individual cells. */ GridApi.prototype.flashCells = function (params) { if (params === void 0) { params = {}; } this.rowRenderer.flashCells(params); }; /** Remove row(s) from the DOM and recreate them again from scratch. */ GridApi.prototype.redrawRows = function (params) { if (params === void 0) { params = {}; } var rowNodes = params ? params.rowNodes : undefined; this.rowRenderer.redrawRows(rowNodes); }; GridApi.prototype.setFunctionsReadOnly = function (readOnly) { this.gridOptionsService.set('functionsReadOnly', readOnly); }; /** Redraws the header. Useful if a column name changes, or something else that changes how the column header is displayed. */ GridApi.prototype.refreshHeader = function () { this.ctrlsService.getHeaderRowContainerCtrls().forEach(function (c) { return c.refresh(); }); }; /** Returns `true` if any filter is set. This includes quick filter, advanced filter or external filter. */ GridApi.prototype.isAnyFilterPresent = function () { return this.filterManager.isAnyFilterPresent(); }; /** Returns `true` if any column filter is set, otherwise `false`. */ GridApi.prototype.isColumnFilterPresent = function () { return this.filterManager.isColumnFilterPresent() || this.filterManager.isAggregateFilterPresent(); }; /** Returns `true` if the Quick Filter is set, otherwise `false`. */ GridApi.prototype.isQuickFilterPresent = function () { return this.filterManager.isQuickFilterPresent(); }; /** * Returns the row model inside the table. * From here you can see the original rows, rows after filter has been applied, * rows after aggregation has been applied, and the final set of 'to be displayed' rows. */ GridApi.prototype.getModel = function () { return this.rowModel; }; /** Expand or collapse a specific row node, optionally expanding/collapsing all of its parent nodes. */ GridApi.prototype.setRowNodeExpanded = function (rowNode, expanded, expandParents) { if (rowNode) { // expand all parents recursively, except root node. if (expandParents && rowNode.parent && rowNode.parent.level !== -1) { this.setRowNodeExpanded(rowNode.parent, expanded, expandParents); } rowNode.setExpanded(expanded); } }; /** * Informs the grid that row group expanded state has changed and it needs to rerender the group nodes. * Typically called after updating the row node expanded state explicitly, i.e `rowNode.expanded = false`, * across multiple groups and you want to update the grid view in a single rerender instead of on every group change. */ GridApi.prototype.onGroupExpandedOrCollapsed = function () { if (missing(this.clientSideRowModel)) { this.logMissingRowModel('onGroupExpandedOrCollapsed', 'clientSide'); return; } // we don't really want the user calling this if only one rowNode was expanded, instead they should be // calling rowNode.setExpanded(boolean) - this way we do a 'keepRenderedRows=false' so that the whole // grid gets refreshed again - otherwise the row with the rowNodes that were changed won't get updated, // and thus the expand icon in the group cell won't get 'opened' or 'closed'. this.clientSideRowModel.refreshModel({ step: exports.ClientSideRowModelSteps.MAP }); }; /** * Refresh the Client-Side Row Model, executing the grouping, filtering and sorting again. * Optionally provide the step you wish the refresh to apply from. Defaults to `everything`. */ GridApi.prototype.refreshClientSideRowModel = function (step) { if (missing(this.clientSideRowModel)) { this.logMissingRowModel('refreshClientSideRowModel', 'clientSide'); return; } this.clientSideRowModel.refreshModel(step); }; /** Returns `true` when there are no more animation frames left to process. */ GridApi.prototype.isAnimationFrameQueueEmpty = function () { return this.animationFrameService.isQueueEmpty(); }; GridApi.prototype.flushAllAnimationFrames = function () { this.animationFrameService.flushAllFrames(); }; /** * Returns the row node with the given ID. * The row node ID is the one you provide from the callback `getRowId(params)`, * otherwise the ID is a number (cast as string) auto-generated by the grid when * the row data is set. */ GridApi.prototype.getRowNode = function (id) { return this.rowModel.getRowNode(id); }; /** * Gets the sizes that various UI elements will be rendered at with the current theme. * If you override the row or header height using `gridOptions`, the override value you provided will be returned. */ GridApi.prototype.getSizesForCurrentTheme = function () { return { rowHeight: this.gridOptionsService.getRowHeightAsNumber(), headerHeight: this.columnModel.getHeaderHeight() }; }; /** Expand all groups. */ GridApi.prototype.expandAll = function () { if (this.clientSideRowModel) { this.clientSideRowModel.expandOrCollapseAll(true); } else if (this.serverSideRowModel) { this.serverSideRowModel.expandAll(true); } else { this.logMissingRowModel('expandAll', 'clientSide', 'serverSide'); } }; /** Collapse all groups. */ GridApi.prototype.collapseAll = function () { if (this.clientSideRowModel) { this.clientSideRowModel.expandOrCollapseAll(false); } else if (this.serverSideRowModel) { this.serverSideRowModel.expandAll(false); } else { this.logMissingRowModel('expandAll', 'clientSide', 'serverSide'); } }; /** * Registers a callback to a virtual row. * A virtual row is a row that is visually rendered on the screen (rows that are not visible because of the scroll position are not rendered). * Unlike normal events, you do not need to unregister rendered row listeners. * When the rendered row is removed from the grid, all associated rendered row listeners will also be removed. * listen for this event if your `cellRenderer` needs to do cleanup when the row no longer exists. */ GridApi.prototype.addRenderedRowListener = function (eventName, rowIndex, callback) { this.rowRenderer.addRenderedRowListener(eventName, rowIndex, callback); }; /** Get the current Quick Filter text from the grid, or `undefined` if none is set. */ GridApi.prototype.getQuickFilter = function () { return this.gridOptionsService.get('quickFilterText'); }; /** Pass a Quick Filter text into the grid for filtering. */ GridApi.prototype.setQuickFilter = function (newFilter) { this.gridOptionsService.set('quickFilterText', newFilter); }; /** * Updates the `excludeHiddenColumnsFromQuickFilter` grid option. * Set to `true` to exclude hidden columns from being checked by the Quick Filter (or `false` to include them). * This can give a significant performance improvement when there are a large number of hidden columns, * and you are only interested in filtering on what's visible. */ GridApi.prototype.setExcludeHiddenColumnsFromQuickFilter = function (value) { this.gridOptionsService.set('excludeHiddenColumnsFromQuickFilter', value); }; /** * Select all rows, regardless of filtering and rows that are not visible due to grouping being enabled and their groups not expanded. * @param source Source property that will appear in the `selectionChanged` event. Default: `'apiSelectAll'` */ GridApi.prototype.selectAll = function (source) { if (source === void 0) { source = 'apiSelectAll'; } this.selectionService.selectAllRowNodes({ source: source }); }; /** * Clear all row selections, regardless of filtering. * @param source Source property that will appear in the `selectionChanged` event. Default: `'apiSelectAll'` */ GridApi.prototype.deselectAll = function (source) { if (source === void 0) { source = 'apiSelectAll'; } this.selectionService.deselectAllRowNodes({ source: source }); }; /** * Select all filtered rows. * @param source Source property that will appear in the `selectionChanged` event. Default: `'apiSelectAllFiltered'` */ GridApi.prototype.selectAllFiltered = function (source) { if (source === void 0) { source = 'apiSelectAllFiltered'; } this.selectionService.selectAllRowNodes({ source: source, justFiltered: true }); }; /** * Clear all filtered selections. * @param source Source property that will appear in the `selectionChanged` event. Default: `'apiSelectAllFiltered'` */ GridApi.prototype.deselectAllFiltered = function (source) { if (source === void 0) { source = 'apiSelectAllFiltered'; } this.selectionService.deselectAllRowNodes({ source: source, justFiltered: true }); }; /** * Returns an object containing rules matching the selected rows in the SSRM. * * If `groupSelectsChildren=false` the returned object will be flat, and will conform to IServerSideSelectionState. * If `groupSelectsChildren=true` the retuned object will be hierarchical, and will conform to IServerSideGroupSelectionState. */ GridApi.prototype.getServerSideSelectionState = function () { if (missing(this.serverSideRowModel)) { this.logMissingRowModel('getServerSideSelectionState', 'serverSide'); return null; } return this.selectionService.getServerSideSelectionState(); }; /** * Set the rules matching the selected rows in the SSRM. * * If `groupSelectsChildren=false` the param will be flat, and should conform to IServerSideSelectionState. * If `groupSelectsChildren=true` the param will be hierarchical, and should conform to IServerSideGroupSelectionState. */ GridApi.prototype.setServerSideSelectionState = function (state) { if (missing(this.serverSideRowModel)) { this.logMissingRowModel('setServerSideSelectionState', 'serverSide'); return; } this.selectionService.setServerSideSelectionState(state); }; /** * Select all rows on the current page. * @param source Source property that will appear in the `selectionChanged` event. Default: `'apiSelectAllCurrentPage'` */ GridApi.prototype.selectAllOnCurrentPage = function (source) { if (source === void 0) { source = 'apiSelectAllCurrentPage'; } this.selectionService.selectAllRowNodes({ source: source, justCurrentPage: true }); }; /** * Clear all filtered on the current page. * @param source Source property that will appear in the `selectionChanged` event. Default: `'apiSelectAllCurrentPage'` */ GridApi.prototype.deselectAllOnCurrentPage = function (source) { if (source === void 0) { source = 'apiSelectAllCurrentPage'; } this.selectionService.deselectAllRowNodes({ source: source, justCurrentPage: true }); }; /** * Sets columns to adjust in size to fit the grid horizontally. **/ GridApi.prototype.sizeColumnsToFit = function (params) { this.gridBodyCtrl.sizeColumnsToFit(params); }; /** Show the 'loading' overlay. */ GridApi.prototype.showLoadingOverlay = function () { this.overlayWrapperComp.showLoadingOverlay(); }; /** Show the 'no rows' overlay. */ GridApi.prototype.showNoRowsOverlay = function () { this.overlayWrapperComp.showNoRowsOverlay(); }; /** Hides the overlay if showing. */ GridApi.prototype.hideOverlay = function () { this.overlayWrapperComp.hideOverlay(); }; /** * Returns an unsorted list of selected nodes. * Getting the underlying node (rather than the data) is useful when working with tree / aggregated data, * as the node can be traversed. */ GridApi.prototype.getSelectedNodes = function () { return this.selectionService.getSelectedNodes(); }; /** Returns an unsorted list of selected rows (i.e. row data that you provided). */ GridApi.prototype.getSelectedRows = function () { return this.selectionService.getSelectedRows(); }; /** * Returns a list of all selected nodes at 'best cost', a feature to be used with groups / trees. * If a group has all its children selected, then the group appears in the result, but not the children. * Designed for use with `'children'` as the group selection type, where groups don't actually appear in the selection normally. */ GridApi.prototype.getBestCostNodeSelection = function () { if (missing(this.clientSideRowModel)) { this.logMissingRowModel('getBestCostNodeSelection', 'clientSide'); return; } return this.selectionService.getBestCostNodeSelection(); }; /** Retrieve rendered nodes. Due to virtualisation this will contain only the current visible rows and those in the buffer. */ GridApi.prototype.getRenderedNodes = function () { return this.rowRenderer.getRenderedNodes(); }; /** * Ensures the column is visible by scrolling the table if needed. * * This will have no effect before the firstDataRendered event has fired. * * @param key - The column to ensure visible * @param position - Where the column will be positioned. * - `auto` - Scrolls the minimum amount to make sure the column is visible. * - `start` - Scrolls the column to the start of the viewport. * - `middle` - Scrolls the column to the middle of the viewport. * - `end` - Scrolls the column to the end of the viewport. */ GridApi.prototype.ensureColumnVisible = function (key, position) { if (position === void 0) { position = 'auto'; } this.gridBodyCtrl.getScrollFeature().ensureColumnVisible(key, position); }; /** * Vertically scrolls the grid until the provided row index is inside the visible viewport. * If a position is provided, the grid will attempt to scroll until the row is at the given position within the viewport. * This will have no effect before the firstDataRendered event has fired. */ GridApi.prototype.ensureIndexVisible = function (index, position) { this.gridBodyCtrl.getScrollFeature().ensureIndexVisible(index, position); }; /** * Vertically scrolls the grid until the provided row (or a row matching the provided comparator) is inside the visible viewport. * If a position is provided, the grid will attempt to scroll until the row is at the given position within the viewport. * This will have no effect before the firstDataRendered event has fired. */ GridApi.prototype.ensureNodeVisible = function (nodeSelector, position) { if (position === void 0) { position = null; } this.gridBodyCtrl.getScrollFeature().ensureNodeVisible(nodeSelector, position); }; /** * Similar to `forEachNode`, except lists all the leaf nodes. * This effectively goes through all the data that you provided to the grid before the grid performed any grouping. * If using tree data, goes through all the nodes for the data you provided, including nodes that have children, * but excluding groups the grid created where gaps were missing in the hierarchy. */ GridApi.prototype.forEachLeafNode = function (callback) { if (missing(this.clientSideRowModel)) { this.logMissingRowModel('forEachLeafNode', 'clientSide'); return; } this.clientSideRowModel.forEachLeafNode(callback); }; /** * Iterates through each node (row) in the grid and calls the callback for each node. * This works similar to the `forEach` method on a JavaScript array. * This is called for every node, ignoring any filtering or sorting applied within the grid. * If using the Infinite Row Model, then this gets called for each page loaded in the page cache. */ GridApi.prototype.forEachNode = function (callback, includeFooterNodes) { this.rowModel.forEachNode(callback, includeFooterNodes); }; /** Similar to `forEachNode`, except skips any filtered out data. */ GridApi.prototype.forEachNodeAfterFilter = function (callback) { if (missing(this.clientSideRowModel)) { this.logMissingRowModel('forEachNodeAfterFilter', 'clientSide'); return; } this.clientSideRowModel.forEachNodeAfterFilter(callback); }; /** Similar to `forEachNodeAfterFilter`, except the callbacks are called in the order the rows are displayed in the grid. */ GridApi.prototype.forEachNodeAfterFilterAndSort = function (callback) { if (missing(this.clientSideRowModel)) { this.logMissingRowModel('forEachNodeAfterFilterAndSort', 'clientSide'); return; } this.clientSideRowModel.forEachNodeAfterFilterAndSort(callback); }; /** * Returns the filter component instance for a column. * `key` can be a string field name or a ColDef object (matches on object reference, useful if field names are not unique). * If your filter is created asynchronously, `getFilterInstance` will return `null` so you will need to use the `callback` to access the filter instance instead. */ GridApi.prototype.getFilterInstance = function (key, callback) { var res = this.getFilterInstanceImpl(key, function (instance) { if (!callback) { return; } var unwrapped = unwrapUserComp(instance); callback(unwrapped); }); var unwrapped = unwrapUserComp(res); return unwrapped; }; GridApi.prototype.getFilterInstanceImpl = function (key, callback) { var column = this.columnModel.getPrimaryColumn(key); if (!column) { return undefined; } var filterPromise = this.filterManager.getFilterComponent(column, 'NO_UI'); var currentValue = filterPromise && filterPromise.resolveNow(null, function (filterComp) { return filterComp; }); if (currentValue) { setTimeout(callback, 0, currentValue); } else if (filterPromise) { filterPromise.then(function (comp) { callback(comp); }); } return currentValue; }; /** Destroys a filter. Useful to force a particular filter to be created from scratch again. */ GridApi.prototype.destroyFilter = function (key) { var column = this.columnModel.getPrimaryColumn(key); if (column) { return this.filterManager.destroyFilter(column, 'api'); } }; /** Gets the status panel instance corresponding to the supplied `id`. */ GridApi.prototype.getStatusPanel = function (key) { if (!ModuleRegistry.assertRegistered(exports.ModuleNames.StatusBarModule, 'api.getStatusPanel')) { return; } var comp = this.statusBarService.getStatusPanel(key); return unwrapUserComp(comp); }; GridApi.prototype.getColumnDef = function (key) { var column = this.columnModel.getPrimaryColumn(key); if (column) { return column.getColDef(); } return null; }; /** * Returns the current column definitions. */ GridApi.prototype.getColumnDefs = function () { return this.columnModel.getColumnDefs(); }; /** Informs the grid that a filter has changed. This is typically called after a filter change through one of the filter APIs. */ GridApi.prototype.onFilterChanged = function () { this.filterManager.onFilterChanged(); }; /** * Gets the grid to act as if the sort was changed. * Useful if you update some values and want to get the grid to reorder them according to the new values. */ GridApi.prototype.onSortChanged = function () { this.sortController.onSortChanged('api'); }; /** Sets the state of all the advanced filters. Provide it with what you get from `getFilterModel()` to restore filter state. */ GridApi.prototype.setFilterModel = function (model) { this.filterManager.setFilterModel(model); }; /** Gets the current state of all the advanced filters. Used for saving filter state. */ GridApi.prototype.getFilterModel = function () { return this.filterManager.getFilterModel(); }; /** Returns the focused cell (or the last focused cell if the grid lost focus). */ GridApi.prototype.getFocusedCell = function () { return this.focusService.getFocusedCell(); }; /** Clears the focused cell. */ GridApi.prototype.clearFocusedCell = function () { return this.focusService.clearFocusedCell(); }; /** Sets the focus to the specified cell. `rowPinned` can be either 'top', 'bottom' or null (for not pinned). */ GridApi.prototype.setFocusedCell = function (rowIndex, colKey, rowPinned) { this.focusService.setFocusedCell({ rowIndex: rowIndex, column: colKey, rowPinned: rowPinned, forceBrowserFocus: true }); }; /** Sets the `suppressRowDrag` property. */ GridApi.prototype.setSuppressRowDrag = function (value) { this.gridOptionsService.set('suppressRowDrag', value); }; /** Sets the `suppressMoveWhenRowDragging` property. */ GridApi.prototype.setSuppressMoveWhenRowDragging = function (value) { this.gridOptionsService.set('suppressMoveWhenRowDragging', value); }; /** Sets the `suppressRowClickSelection` property. */ GridApi.prototype.setSuppressRowClickSelection = function (value) { this.gridOptionsService.set('suppressRowClickSelection', value); }; /** Adds a drop zone outside of the grid where rows can be dropped. */ GridApi.prototype.addRowDropZone = function (params) { this.gridBodyCtrl.getRowDragFeature().addRowDropZone(params); }; /** Removes an external drop zone added by `addRowDropZone`. */ GridApi.prototype.removeRowDropZone = function (params) { var activeDropTarget = this.dragAndDropService.findExternalZone(params); if (activeDropTarget) { this.dragAndDropService.removeDropTarget(activeDropTarget); } }; /** Returns the `RowDropZoneParams` to be used by another grid's `addRowDropZone` method. */ GridApi.prototype.getRowDropZoneParams = function (events) { return this.gridBodyCtrl.getRowDragFeature().getRowDropZone(events); }; /** Sets the height in pixels for the row containing the column label header. */ GridApi.prototype.setHeaderHeight = function (headerHeight) { this.gridOptionsService.set('headerHeight', headerHeight); }; /** * Switch between layout options: `normal`, `autoHeight`, `print`. * Defaults to `normal` if no domLayout provided. */ GridApi.prototype.setDomLayout = function (domLayout) { this.gridOptionsService.set('domLayout', domLayout); }; /** Sets the `enableCellTextSelection` property. */ GridApi.prototype.setEnableCellTextSelection = function (selectable) { this.gridBodyCtrl.setCellTextSelection(selectable); }; /** Sets the preferred direction for the selection fill handle. */ GridApi.prototype.setFillHandleDirection = function (direction) { this.gridOptionsService.set('fillHandleDirection', direction); }; /** Sets the height in pixels for the rows containing header column groups. */ GridApi.prototype.setGroupHeaderHeight = function (headerHeight) { this.gridOptionsService.set('groupHeaderHeight', headerHeight); }; /** Sets the height in pixels for the row containing the floating filters. */ GridApi.prototype.setFloatingFiltersHeight = function (headerHeight) { this.gridOptionsService.set('floatingFiltersHeight', headerHeight); }; /** Sets the height in pixels for the row containing the columns when in pivot mode. */ GridApi.prototype.setPivotHeaderHeight = function (headerHeight) { this.gridOptionsService.set('pivotHeaderHeight', headerHeight); }; /** Sets the height in pixels for the row containing header column groups when in pivot mode. */ GridApi.prototype.setPivotGroupHeaderHeight = function (headerHeight) { this.gridOptionsService.set('pivotGroupHeaderHeight', headerHeight); }; GridApi.prototype.setPivotMode = function (pivotMode) { this.columnModel.setPivotMode(pivotMode); }; GridApi.prototype.setAnimateRows = function (animateRows) { this.gridOptionsService.set('animateRows', animateRows); }; GridApi.prototype.setIsExternalFilterPresent = function (isExternalFilterPresentFunc) { this.gridOptionsService.set('isExternalFilterPresent', isExternalFilterPresentFunc); }; GridApi.prototype.setDoesExternalFilterPass = function (doesExternalFilterPassFunc) { this.gridOptionsService.set('doesExternalFilterPass', doesExternalFilterPassFunc); }; GridApi.prototype.setNavigateToNextCell = function (navigateToNextCellFunc) { this.gridOptionsService.set('navigateToNextCell', navigateToNextCellFunc); }; GridApi.prototype.setTabToNextCell = function (tabToNextCellFunc) { this.gridOptionsService.set('tabToNextCell', tabToNextCellFunc); }; GridApi.prototype.setTabToNextHeader = function (tabToNextHeaderFunc) { this.gridOptionsService.set('tabToNextHeader', tabToNextHeaderFunc); }; GridApi.prototype.setNavigateToNextHeader = function (navigateToNextHeaderFunc) { this.gridOptionsService.set('navigateToNextHeader', navigateToNextHeaderFunc); }; GridApi.prototype.setRowGroupPanelShow = function (rowGroupPanelShow) { this.gridOptionsService.set('rowGroupPanelShow', rowGroupPanelShow); }; /** @deprecated v27.2 - Use `setGetGroupRowAgg` instead. */ GridApi.prototype.setGroupRowAggNodes = function (groupRowAggNodesFunc) { logDeprecation('27.2', 'setGroupRowAggNodes', 'setGetGroupRowAgg'); this.gridOptionsService.set('groupRowAggNodes', groupRowAggNodesFunc); }; GridApi.prototype.setGetGroupRowAgg = function (getGroupRowAggFunc) { this.gridOptionsService.set('getGroupRowAgg', getGroupRowAggFunc); }; GridApi.prototype.setGetBusinessKeyForNode = function (getBusinessKeyForNodeFunc) { this.gridOptionsService.set('getBusinessKeyForNode', getBusinessKeyForNodeFunc); }; GridApi.prototype.setGetChildCount = function (getChildCountFunc) { this.gridOptionsService.set('getChildCount', getChildCountFunc); }; GridApi.prototype.setProcessRowPostCreate = function (processRowPostCreateFunc) { this.gridOptionsService.set('processRowPostCreate', processRowPostCreateFunc); }; /** @deprecated v27.1 Use `setGetRowId` instead */ GridApi.prototype.setGetRowNodeId = function (getRowNodeIdFunc) { logDeprecation('27.1', 'setGetRowNodeId', 'setGetRowId'); this.gridOptionsService.set('getRowNodeId', getRowNodeIdFunc); }; GridApi.prototype.setGetRowId = function (getRowIdFunc) { this.gridOptionsService.set('getRowId', getRowIdFunc); }; GridApi.prototype.setGetRowClass = function (rowClassFunc) { this.gridOptionsService.set('getRowClass', rowClassFunc); }; /** @deprecated v27.2 Use `setIsFullWidthRow` instead. */ GridApi.prototype.setIsFullWidthCell = function (isFullWidthCellFunc) { logDeprecation('27.2', 'setIsFullWidthCell', 'setIsFullWidthRow'); this.gridOptionsService.set('isFullWidthCell', isFullWidthCellFunc); }; GridApi.prototype.setIsFullWidthRow = function (isFullWidthRowFunc) { this.gridOptionsService.set('isFullWidthRow', isFullWidthRowFunc); }; GridApi.prototype.setIsRowSelectable = function (isRowSelectableFunc) { this.gridOptionsService.set('isRowSelectable', isRowSelectableFunc); }; GridApi.prototype.setIsRowMaster = function (isRowMasterFunc) { this.gridOptionsService.set('isRowMaster', isRowMasterFunc); }; /** @deprecated v27.2 Use `setPostSortRows` instead */ GridApi.prototype.setPostSort = function (postSortFunc) { logDeprecation('27.2', 'setPostSort', 'setPostSortRows'); this.gridOptionsService.set('postSort', postSortFunc); }; GridApi.prototype.setPostSortRows = function (postSortRowsFunc) { this.gridOptionsService.set('postSortRows', postSortRowsFunc); }; GridApi.prototype.setGetDocument = function (getDocumentFunc) { this.gridOptionsService.set('getDocument', getDocumentFunc); }; GridApi.prototype.setGetContextMenuItems = function (getContextMenuItemsFunc) { this.gridOptionsService.set('getContextMenuItems', getContextMenuItemsFunc); }; GridApi.prototype.setGetMainMenuItems = function (getMainMenuItemsFunc) { this.gridOptionsService.set('getMainMenuItems', getMainMenuItemsFunc); }; GridApi.prototype.setProcessCellForClipboard = function (processCellForClipboardFunc) { this.gridOptionsService.set('processCellForClipboard', processCellForClipboardFunc); }; GridApi.prototype.setSendToClipboard = function (sendToClipboardFunc) { this.gridOptionsService.set('sendToClipboard', sendToClipboardFunc); }; GridApi.prototype.setProcessCellFromClipboard = function (processCellFromClipboardFunc) { this.gridOptionsService.set('processCellFromClipboard', processCellFromClipboardFunc); }; /** @deprecated v28 use `setProcessPivotResultColDef` instead */ GridApi.prototype.setProcessSecondaryColDef = function (processSecondaryColDefFunc) { logDeprecation('28.0', 'setProcessSecondaryColDef', 'setProcessPivotResultColDef'); this.setProcessPivotResultColDef(processSecondaryColDefFunc); }; /** @deprecated v28 use `setProcessPivotResultColGroupDef` instead */ GridApi.prototype.setProcessSecondaryColGroupDef = function (processSecondaryColGroupDefFunc) { logDeprecation('28.0', 'setProcessSecondaryColGroupDef', 'setProcessPivotResultColGroupDef'); this.setProcessPivotResultColGroupDef(processSecondaryColGroupDefFunc); }; GridApi.prototype.setProcessPivotResultColDef = function (processPivotResultColDefFunc) { this.gridOptionsService.set('processPivotResultColDef', processPivotResultColDefFunc); }; GridApi.prototype.setProcessPivotResultColGroupDef = function (processPivotResultColGroupDefFunc) { this.gridOptionsService.set('processPivotResultColGroupDef', processPivotResultColGroupDefFunc); }; GridApi.prototype.setPostProcessPopup = function (postProcessPopupFunc) { this.gridOptionsService.set('postProcessPopup', postProcessPopupFunc); }; /** @deprecated v27.2 - Use `setInitialGroupOrderComparator` instead */ GridApi.prototype.setDefaultGroupOrderComparator = function (defaultGroupOrderComparatorFunc) { logDeprecation('27.2', 'setDefaultGroupOrderComparator', 'setInitialGroupOrderComparator'); this.gridOptionsService.set('defaultGroupOrderComparator', defaultGroupOrderComparatorFunc); }; GridApi.prototype.setInitialGroupOrderComparator = function (initialGroupOrderComparatorFunc) { this.gridOptionsService.set('initialGroupOrderComparator', initialGroupOrderComparatorFunc); }; GridApi.prototype.setGetChartToolbarItems = function (getChartToolbarItemsFunc) { this.gridOptionsService.set('getChartToolbarItems', getChartToolbarItemsFunc); }; GridApi.prototype.setPaginationNumberFormatter = function (paginationNumberFormatterFunc) { this.gridOptionsService.set('paginationNumberFormatter', paginationNumberFormatterFunc); }; /** @deprecated v28 use setGetServerSideGroupLevelParams instead */ GridApi.prototype.setGetServerSideStoreParams = function (getServerSideStoreParamsFunc) { logDeprecation('28.0', 'setGetServerSideStoreParams', 'setGetServerSideGroupLevelParams'); this.setGetServerSideGroupLevelParams(getServerSideStoreParamsFunc); }; GridApi.prototype.setGetServerSideGroupLevelParams = function (getServerSideGroupLevelParamsFunc) { this.gridOptionsService.set('getServerSideGroupLevelParams', getServerSideGroupLevelParamsFunc); }; GridApi.prototype.setIsServerSideGroupOpenByDefault = function (isServerSideGroupOpenByDefaultFunc) { this.gridOptionsService.set('isServerSideGroupOpenByDefault', isServerSideGroupOpenByDefaultFunc); }; GridApi.prototype.setIsApplyServerSideTransaction = function (isApplyServerSideTransactionFunc) { this.gridOptionsService.set('isApplyServerSideTransaction', isApplyServerSideTransactionFunc); }; GridApi.prototype.setIsServerSideGroup = function (isServerSideGroupFunc) { this.gridOptionsService.set('isServerSideGroup', isServerSideGroupFunc); }; GridApi.prototype.setGetServerSideGroupKey = function (getServerSideGroupKeyFunc) { this.gridOptionsService.set('getServerSideGroupKey', getServerSideGroupKeyFunc); }; GridApi.prototype.setGetRowStyle = function (rowStyleFunc) { this.gridOptionsService.set('getRowStyle', rowStyleFunc); }; GridApi.prototype.setGetRowHeight = function (rowHeightFunc) { this.gridOptionsService.set('getRowHeight', rowHeightFunc); }; GridApi.prototype.assertSideBarLoaded = function (apiMethod) { return ModuleRegistry.assertRegistered(exports.ModuleNames.SideBarModule, 'api.' + apiMethod); }; /** Returns `true` if the side bar is visible. */ GridApi.prototype.isSideBarVisible = function () { return this.assertSideBarLoaded('isSideBarVisible') && this.sideBarComp.isDisplayed(); }; /** Show/hide the entire side bar, including any visible panel and the tab buttons. */ GridApi.prototype.setSideBarVisible = function (show) { if (this.assertSideBarLoaded('setSideBarVisible')) { this.sideBarComp.setDisplayed(show); } }; /** Sets the side bar position relative to the grid. Possible values are `'left'` or `'right'`. */ GridApi.prototype.setSideBarPosition = function (position) { if (this.assertSideBarLoaded('setSideBarPosition')) { this.sideBarComp.setSideBarPosition(position); } }; /** Opens a particular tool panel. Provide the ID of the tool panel to open. */ GridApi.prototype.openToolPanel = function (key) { if (this.assertSideBarLoaded('openToolPanel')) { this.sideBarComp.openToolPanel(key, 'api'); } }; /** Closes the currently open tool panel (if any). */ GridApi.prototype.closeToolPanel = function () { if (this.assertSideBarLoaded('closeToolPanel')) { this.sideBarComp.close('api'); } }; /** Returns the ID of the currently shown tool panel if any, otherwise `null`. */ GridApi.prototype.getOpenedToolPanel = function () { if (this.assertSideBarLoaded('getOpenedToolPanel')) { return this.sideBarComp.openedItem(); } return null; }; /** Force refresh all tool panels by calling their `refresh` method. */ GridApi.prototype.refreshToolPanel = function () { if (this.assertSideBarLoaded('refreshToolPanel')) { this.sideBarComp.refresh(); } }; /** Returns `true` if the tool panel is showing, otherwise `false`. */ GridApi.prototype.isToolPanelShowing = function () { return this.assertSideBarLoaded('isToolPanelShowing') && this.sideBarComp.isToolPanelShowing(); }; /** Gets the tool panel instance corresponding to the supplied `id`. */ GridApi.prototype.getToolPanelInstance = function (id) { if (this.assertSideBarLoaded('getToolPanelInstance')) { var comp = this.sideBarComp.getToolPanelInstance(id); return unwrapUserComp(comp); } }; /** Returns the current side bar configuration. If a shortcut was used, returns the detailed long form. */ GridApi.prototype.getSideBar = function () { if (this.assertSideBarLoaded('getSideBar')) { return this.sideBarComp.getDef(); } return undefined; }; /** Resets the side bar to the provided configuration. The parameter is the same as the sideBar grid property. The side bar is re-created from scratch with the new config. */ GridApi.prototype.setSideBar = function (def) { this.gridOptionsService.set('sideBar', def); }; GridApi.prototype.setSuppressClipboardPaste = function (value) { this.gridOptionsService.set('suppressClipboardPaste', value); }; /** Tells the grid to recalculate the row heights. */ GridApi.prototype.resetRowHeights = function () { if (exists(this.clientSideRowModel)) { if (this.columnModel.isAutoRowHeightActive()) { console.warn('AG Grid: calling gridApi.resetRowHeights() makes no sense when using Auto Row Height.'); return; } this.clientSideRowModel.resetRowHeights(); } }; GridApi.prototype.setGroupRemoveSingleChildren = function (value) { this.gridOptionsService.set('groupRemoveSingleChildren', value); }; GridApi.prototype.setGroupRemoveLowestSingleChildren = function (value) { this.gridOptionsService.set('groupRemoveLowestSingleChildren', value); }; GridApi.prototype.setGroupDisplayType = function (value) { this.gridOptionsService.set('groupDisplayType', value); }; GridApi.prototype.setRowClass = function (className) { this.gridOptionsService.set('rowClass', className); }; /** Sets the `deltaSort` property */ GridApi.prototype.setDeltaSort = function (enable) { this.gridOptionsService.set('deltaSort', enable); }; /** * Sets the `rowCount` and `lastRowIndexKnown` properties. * The second parameter, `lastRowIndexKnown`, is optional and if left out, only `rowCount` is set. * Set `rowCount` to adjust the height of the vertical scroll. * Set `lastRowIndexKnown` to enable / disable searching for more rows. * Use this method if you add or remove rows into the dataset and need to reset the number of rows or put the data back into 'look for data' mode. */ GridApi.prototype.setRowCount = function (rowCount, maxRowFound) { if (this.serverSideRowModel) { if (this.columnModel.isRowGroupEmpty()) { this.serverSideRowModel.setRowCount(rowCount, maxRowFound); return; } console.error('AG Grid: setRowCount cannot be used while using row grouping.'); return; } if (this.infiniteRowModel) { this.infiniteRowModel.setRowCount(rowCount, maxRowFound); return; } this.logMissingRowModel('setRowCount', 'infinite', 'serverSide'); }; /** Tells the grid a row height has changed. To be used after calling `rowNode.setRowHeight(newHeight)`. */ GridApi.prototype.onRowHeightChanged = function () { if (this.clientSideRowModel) { this.clientSideRowModel.onRowHeightChanged(); } else if (this.serverSideRowModel) { this.serverSideRowModel.onRowHeightChanged(); } }; /** * Gets the value for a column for a particular `rowNode` (row). * This is useful if you want the raw value of a cell e.g. if implementing your own CSV export. */ GridApi.prototype.getValue = function (colKey, rowNode) { var column = this.columnModel.getPrimaryColumn(colKey); if (missing(column)) { column = this.columnModel.getGridColumn(colKey); } if (missing(column)) { return null; } return this.valueService.getValue(column, rowNode); }; /** Add an event listener for the specified `eventType`. Works similar to `addEventListener` for a browser DOM element. */ GridApi.prototype.addEventListener = function (eventType, listener) { var async = this.gridOptionsService.useAsyncEvents(); this.eventService.addEventListener(eventType, listener, async); }; /** Add an event listener for all event types coming from the grid. */ GridApi.prototype.addGlobalListener = function (listener) { var async = this.gridOptionsService.useAsyncEvents(); this.eventService.addGlobalListener(listener, async); }; /** Remove an event listener. */ GridApi.prototype.removeEventListener = function (eventType, listener) { var async = this.gridOptionsService.useAsyncEvents(); this.eventService.removeEventListener(eventType, listener, async); }; /** Remove a global event listener. */ GridApi.prototype.removeGlobalListener = function (listener) { var async = this.gridOptionsService.useAsyncEvents(); this.eventService.removeGlobalListener(listener, async); }; GridApi.prototype.dispatchEvent = function (event) { this.eventService.dispatchEvent(event); }; /** Will destroy the grid and release resources. If you are using a framework you do not need to call this, as the grid links in with the framework lifecycle. However if you are using Web Components or native JavaScript, you do need to call this, to avoid a memory leak in your application. */ GridApi.prototype.destroy = function () { // this is needed as GridAPI is a bean, and GridAPI.destroy() is called as part // of context.destroy(). so we need to stop the infinite loop. if (this.destroyCalled) { return; } this.destroyCalled = true; // destroy the UI first (as they use the services) var gridCtrl = this.ctrlsService.getGridCtrl(); if (gridCtrl) { gridCtrl.destroyGridUi(); } // destroy the services this.context.destroy(); }; GridApi.prototype.cleanDownReferencesToAvoidMemoryLeakInCaseApplicationIsKeepingReferenceToDestroyedGrid = function () { // some users were raising support issues with regards memory leaks. the problem was the customers applications // were keeping references to the API. trying to educate them all would be difficult, easier to just remove // all references in the API so at least the core grid can be garbage collected. // // wait about 100ms before clearing down the references, in case user has some cleanup to do, // and needs to deference the API first setTimeout(removeAllReferences.bind(window, this, 'Grid API'), 100); }; GridApi.prototype.warnIfDestroyed = function (methodName) { if (this.destroyCalled) { console.warn("AG Grid: Grid API method " + methodName + " was called on a grid that was destroyed."); } return this.destroyCalled; }; /** Reset the Quick Filter cache text on every rowNode. */ GridApi.prototype.resetQuickFilter = function () { if (this.warnIfDestroyed('resetQuickFilter')) { return; } this.filterManager.resetQuickFilterCache(); }; /** Returns the list of selected cell ranges. */ GridApi.prototype.getCellRanges = function () { if (this.rangeService) { return this.rangeService.getCellRanges(); } ModuleRegistry.assertRegistered(exports.ModuleNames.RangeSelectionModule, 'api.getCellRanges'); return null; }; /** Adds the provided cell range to the selected ranges. */ GridApi.prototype.addCellRange = function (params) { if (this.rangeService) { this.rangeService.addCellRange(params); return; } ModuleRegistry.assertRegistered(exports.ModuleNames.RangeSelectionModule, 'api.addCellRange'); }; /** Clears the selected ranges. */ GridApi.prototype.clearRangeSelection = function () { if (this.rangeService) { this.rangeService.removeAllCellRanges(); } ModuleRegistry.assertRegistered(exports.ModuleNames.RangeSelectionModule, 'gridApi.clearRangeSelection'); }; /** Reverts the last cell edit. */ GridApi.prototype.undoCellEditing = function () { this.undoRedoService.undo('api'); }; /** Re-applies the most recently undone cell edit. */ GridApi.prototype.redoCellEditing = function () { this.undoRedoService.redo('api'); }; /** Returns current number of available cell edit undo operations. */ GridApi.prototype.getCurrentUndoSize = function () { return this.undoRedoService.getCurrentUndoStackSize(); }; /** Returns current number of available cell edit redo operations. */ GridApi.prototype.getCurrentRedoSize = function () { return this.undoRedoService.getCurrentRedoStackSize(); }; /** Returns a list of models with information about the charts that are currently rendered from the grid. */ GridApi.prototype.getChartModels = function () { if (ModuleRegistry.assertRegistered(exports.ModuleNames.GridChartsModule, 'api.getChartModels')) { return this.chartService.getChartModels(); } }; /** Returns the `ChartRef` using the supplied `chartId`. */ GridApi.prototype.getChartRef = function (chartId) { if (ModuleRegistry.assertRegistered(exports.ModuleNames.GridChartsModule, 'api.getChartRef')) { return this.chartService.getChartRef(chartId); } }; /** Returns a base64-encoded image data URL for the referenced chartId. */ GridApi.prototype.getChartImageDataURL = function (params) { if (ModuleRegistry.assertRegistered(exports.ModuleNames.GridChartsModule, 'api.getChartImageDataURL')) { return this.chartService.getChartImageDataURL(params); } }; /** Starts a browser-based image download for the referenced chartId. */ GridApi.prototype.downloadChart = function (params) { if (ModuleRegistry.assertRegistered(exports.ModuleNames.GridChartsModule, 'api.downloadChart')) { return this.chartService.downloadChart(params); } }; /** Open the Chart Tool Panel. */ GridApi.prototype.openChartToolPanel = function (params) { if (ModuleRegistry.assertRegistered(exports.ModuleNames.GridChartsModule, 'api.openChartToolPanel')) { return this.chartService.openChartToolPanel(params); } }; /** Close the Chart Tool Panel. */ GridApi.prototype.closeChartToolPanel = function (params) { if (ModuleRegistry.assertRegistered(exports.ModuleNames.GridChartsModule, 'api.closeChartToolPanel')) { return this.chartService.closeChartToolPanel(params.chartId); } }; /** Used to programmatically create charts from a range. */ GridApi.prototype.createRangeChart = function (params) { if (ModuleRegistry.assertRegistered(exports.ModuleNames.GridChartsModule, 'api.createRangeChart')) { return this.chartService.createRangeChart(params); } }; /** Used to programmatically create cross filter charts from a range. */ GridApi.prototype.createCrossFilterChart = function (params) { if (ModuleRegistry.assertRegistered(exports.ModuleNames.GridChartsModule, 'api.createCrossFilterChart')) { return this.chartService.createCrossFilterChart(params); } }; /** Restores a chart using the `ChartModel` that was previously obtained from `getChartModels()`. */ GridApi.prototype.restoreChart = function (chartModel, chartContainer) { if (ModuleRegistry.assertRegistered(exports.ModuleNames.GridChartsModule, 'api.restoreChart')) { return this.chartService.restoreChart(chartModel, chartContainer); } }; /** Used to programmatically create pivot charts from a grid. */ GridApi.prototype.createPivotChart = function (params) { if (ModuleRegistry.assertRegistered(exports.ModuleNames.GridChartsModule, 'api.createPivotChart')) { return this.chartService.createPivotChart(params); } }; /** Copies data to clipboard by following the same rules as pressing Ctrl+C. */ GridApi.prototype.copyToClipboard = function (params) { if (ModuleRegistry.assertRegistered(exports.ModuleNames.ClipboardModule, 'api.copyToClipboard')) { this.clipboardService.copyToClipboard(params); } }; /** Cuts data to clipboard by following the same rules as pressing Ctrl+X. */ GridApi.prototype.cutToClipboard = function (params) { if (ModuleRegistry.assertRegistered(exports.ModuleNames.ClipboardModule, 'api.cutToClipboard')) { this.clipboardService.cutToClipboard(params); } }; /** Copies the selected rows to the clipboard. */ GridApi.prototype.copySelectedRowsToClipboard = function (params) { if (ModuleRegistry.assertRegistered(exports.ModuleNames.ClipboardModule, 'api.copySelectedRowsToClipboard')) { this.clipboardService.copySelectedRowsToClipboard(params); } }; /** Copies the selected ranges to the clipboard. */ GridApi.prototype.copySelectedRangeToClipboard = function (params) { if (ModuleRegistry.assertRegistered(exports.ModuleNames.ClipboardModule, 'api.copySelectedRangeToClipboard')) { this.clipboardService.copySelectedRangeToClipboard(params); } }; /** Copies the selected range down, similar to `Ctrl + D` in Excel. */ GridApi.prototype.copySelectedRangeDown = function () { if (ModuleRegistry.assertRegistered(exports.ModuleNames.ClipboardModule, 'api.copySelectedRangeDown')) { this.clipboardService.copyRangeDown(); } }; /** Shows the column menu after and positions it relative to the provided button element. Use in conjunction with your own header template. */ GridApi.prototype.showColumnMenuAfterButtonClick = function (colKey, buttonElement) { // use grid column so works with pivot mode var column = this.columnModel.getGridColumn(colKey); this.menuFactory.showMenuAfterButtonClick(column, buttonElement, 'columnMenu'); }; /** Shows the column menu after and positions it relative to the mouse event. Use in conjunction with your own header template. */ GridApi.prototype.showColumnMenuAfterMouseClick = function (colKey, mouseEvent) { // use grid column so works with pivot mode var column = this.columnModel.getGridColumn(colKey); if (!column) { column = this.columnModel.getPrimaryColumn(colKey); } if (!column) { console.error("AG Grid: column '" + colKey + "' not found"); return; } this.menuFactory.showMenuAfterMouseEvent(column, mouseEvent); }; /** Hides any visible context menu or column menu. */ GridApi.prototype.hidePopupMenu = function () { // hide the context menu if in enterprise if (this.contextMenuFactory) { this.contextMenuFactory.hideActiveMenu(); } // and hide the column menu always this.menuFactory.hideActiveMenu(); }; /** DOM element to use as the popup parent for grid popups (context menu, column menu etc). */ GridApi.prototype.setPopupParent = function (ePopupParent) { this.gridOptionsService.set('popupParent', ePopupParent); }; /** Navigates the grid focus to the next cell, as if tabbing. */ GridApi.prototype.tabToNextCell = function (event) { return this.navigationService.tabToNextCell(false, event); }; /** Navigates the grid focus to the previous cell, as if shift-tabbing. */ GridApi.prototype.tabToPreviousCell = function (event) { return this.navigationService.tabToNextCell(true, event); }; /** Returns the list of active cell renderer instances. */ GridApi.prototype.getCellRendererInstances = function (params) { if (params === void 0) { params = {}; } var res = this.rowRenderer.getCellRendererInstances(params); var unwrapped = res.map(unwrapUserComp); return unwrapped; }; /** Returns the list of active cell editor instances. Optionally provide parameters to restrict to certain columns / row nodes. */ GridApi.prototype.getCellEditorInstances = function (params) { if (params === void 0) { params = {}; } var res = this.rowRenderer.getCellEditorInstances(params); var unwrapped = res.map(unwrapUserComp); return unwrapped; }; /** If the grid is editing, returns back details of the editing cell(s). */ GridApi.prototype.getEditingCells = function () { return this.rowRenderer.getEditingCells(); }; /** If a cell is editing, it stops the editing. Pass `true` if you want to cancel the editing (i.e. don't accept changes). */ GridApi.prototype.stopEditing = function (cancel) { if (cancel === void 0) { cancel = false; } this.rowRenderer.stopEditing(cancel); }; /** Start editing the provided cell. If another cell is editing, the editing will be stopped in that other cell. */ GridApi.prototype.startEditingCell = function (params) { var column = this.columnModel.getGridColumn(params.colKey); if (!column) { console.warn("AG Grid: no column found for " + params.colKey); return; } var cellPosition = { rowIndex: params.rowIndex, rowPinned: params.rowPinned || null, column: column }; var notPinned = params.rowPinned == null; if (notPinned) { this.gridBodyCtrl.getScrollFeature().ensureIndexVisible(params.rowIndex); } var cell = this.navigationService.getCellByPosition(cellPosition); if (!cell) { return; } cell.startRowOrCellEdit(params.key, params.charPress); }; /** Add an aggregation function with the specified key. */ GridApi.prototype.addAggFunc = function (key, aggFunc) { if (this.aggFuncService) { this.aggFuncService.addAggFunc(key, aggFunc); } }; /** Add aggregations function with the specified keys. */ GridApi.prototype.addAggFuncs = function (aggFuncs) { if (this.aggFuncService) { this.aggFuncService.addAggFuncs(aggFuncs); } }; /** Clears all aggregation functions (including those provided by the grid). */ GridApi.prototype.clearAggFuncs = function () { if (this.aggFuncService) { this.aggFuncService.clear(); } }; /** Apply transactions to the server side row model. */ GridApi.prototype.applyServerSideTransaction = function (transaction) { if (!this.serverSideTransactionManager) { this.logMissingRowModel('applyServerSideTransaction', 'serverSide'); return; } return this.serverSideTransactionManager.applyTransaction(transaction); }; /** Batch apply transactions to the server side row model. */ GridApi.prototype.applyServerSideTransactionAsync = function (transaction, callback) { if (!this.serverSideTransactionManager) { this.logMissingRowModel('applyServerSideTransactionAsync', 'serverSide'); return; } return this.serverSideTransactionManager.applyTransactionAsync(transaction, callback); }; /** Gets all failed server side loads to retry. */ GridApi.prototype.retryServerSideLoads = function () { if (!this.serverSideRowModel) { this.logMissingRowModel('retryServerSideLoads', 'serverSide'); return; } this.serverSideRowModel.retryLoads(); }; GridApi.prototype.flushServerSideAsyncTransactions = function () { if (!this.serverSideTransactionManager) { this.logMissingRowModel('flushServerSideAsyncTransactions', 'serverSide'); return; } return this.serverSideTransactionManager.flushAsyncTransactions(); }; /** Update row data. Pass a transaction object with lists for `add`, `remove` and `update`. */ GridApi.prototype.applyTransaction = function (rowDataTransaction) { if (!this.clientSideRowModel) { this.logMissingRowModel('applyTransaction', 'clientSide'); return; } var res = this.clientSideRowModel.updateRowData(rowDataTransaction); // refresh all the full width rows this.rowRenderer.refreshFullWidthRows(res.update); // do change detection for all present cells if (!this.gridOptionsService.is('suppressChangeDetection')) { this.rowRenderer.refreshCells(); } return res; }; /** Same as `applyTransaction` except executes asynchronously for efficiency. */ GridApi.prototype.applyTransactionAsync = function (rowDataTransaction, callback) { if (!this.clientSideRowModel) { this.logMissingRowModel('applyTransactionAsync', 'clientSide'); return; } this.clientSideRowModel.batchUpdateRowData(rowDataTransaction, callback); }; /** Executes any remaining asynchronous grid transactions, if any are waiting to be executed. */ GridApi.prototype.flushAsyncTransactions = function () { if (!this.clientSideRowModel) { this.logMissingRowModel('flushAsyncTransactions', 'clientSide'); return; } this.clientSideRowModel.flushAsyncTransactions(); }; GridApi.prototype.setSuppressModelUpdateAfterUpdateTransaction = function (value) { this.gridOptionsService.set('suppressModelUpdateAfterUpdateTransaction', value); }; /** * Marks all the currently loaded blocks in the cache for reload. * If you have 10 blocks in the cache, all 10 will be marked for reload. * The old data will continue to be displayed until the new data is loaded. */ GridApi.prototype.refreshInfiniteCache = function () { if (this.infiniteRowModel) { this.infiniteRowModel.refreshCache(); } else { this.logMissingRowModel('refreshInfiniteCache', 'infinite'); } }; /** * Purges the cache. * The grid is then told to refresh. Only the blocks required to display the current data on screen are fetched (typically no more than 2). * The grid will display nothing while the new blocks are loaded. * Use this to immediately remove the old data from the user. */ GridApi.prototype.purgeInfiniteCache = function () { if (this.infiniteRowModel) { this.infiniteRowModel.purgeCache(); } else { this.logMissingRowModel('purgeInfiniteCache', 'infinite'); } }; /** * Refresh a server-side level. * If you pass no parameters, then the top level store is refreshed. * To refresh a child level, pass in the string of keys to get to the desired level. */ GridApi.prototype.refreshServerSide = function (params) { if (!this.serverSideRowModel) { this.logMissingRowModel('refreshServerSide', 'serverSide'); return; } this.serverSideRowModel.refreshStore(params); }; /** @deprecated v28 use `refreshServerSide` instead */ GridApi.prototype.refreshServerSideStore = function (params) { logDeprecation('28.0', 'refreshServerSideStore', 'refreshServerSide'); return this.refreshServerSide(params); }; /** @deprecated v28 use `getServerSideGroupLevelState` instead */ GridApi.prototype.getServerSideStoreState = function () { logDeprecation('28.0', 'getServerSideStoreState', 'getServerSideGroupLevelState'); return this.getServerSideGroupLevelState(); }; /** Returns info on all server side group levels. */ GridApi.prototype.getServerSideGroupLevelState = function () { if (!this.serverSideRowModel) { this.logMissingRowModel('getServerSideGroupLevelState', 'serverSide'); return []; } return this.serverSideRowModel.getStoreState(); }; /** The row count defines how many rows the grid allows scrolling to. */ GridApi.prototype.getInfiniteRowCount = function () { if (this.infiniteRowModel) { return this.infiniteRowModel.getRowCount(); } else { this.logMissingRowModel('getInfiniteRowCount', 'infinite'); } }; /** Returns `true` if grid allows for scrolling past the last row to load more rows, thus providing infinite scroll. */ GridApi.prototype.isLastRowIndexKnown = function () { if (this.infiniteRowModel) { return this.infiniteRowModel.isLastRowIndexKnown(); } else { this.logMissingRowModel('isLastRowIndexKnown', 'infinite'); } }; /** * Returns an object representing the state of the cache. This is useful for debugging and understanding how the cache is working. */ GridApi.prototype.getCacheBlockState = function () { return this.rowNodeBlockLoader.getBlockState(); }; /** Get the index of the first displayed row due to scrolling (includes invisible rendered rows in the buffer). */ GridApi.prototype.getFirstDisplayedRow = function () { return this.rowRenderer.getFirstVirtualRenderedRow(); }; /** Get the index of the last displayed row due to scrolling (includes invisible rendered rows in the buffer). */ GridApi.prototype.getLastDisplayedRow = function () { return this.rowRenderer.getLastVirtualRenderedRow(); }; /** Returns the displayed `RowNode` at the given `index`. */ GridApi.prototype.getDisplayedRowAtIndex = function (index) { return this.rowModel.getRow(index); }; /** Returns the total number of displayed rows. */ GridApi.prototype.getDisplayedRowCount = function () { return this.rowModel.getRowCount(); }; /** * Set whether the grid paginates the data or not. * - `true` to enable pagination * - `false` to disable pagination */ GridApi.prototype.setPagination = function (value) { this.gridOptionsService.set('pagination', value); }; /** * Returns `true` when the last page is known. * This will always be `true` if you are using the Client-Side Row Model for pagination. * Returns `false` when the last page is not known; this only happens when using Infinite Row Model. */ GridApi.prototype.paginationIsLastPageFound = function () { return this.paginationProxy.isLastPageFound(); }; /** Returns how many rows are being shown per page. */ GridApi.prototype.paginationGetPageSize = function () { return this.paginationProxy.getPageSize(); }; /** Sets the `paginationPageSize`, then re-paginates the grid so the changes are applied immediately. */ GridApi.prototype.paginationSetPageSize = function (size) { this.gridOptionsService.set('paginationPageSize', size); }; /** Returns the 0-based index of the page which is showing. */ GridApi.prototype.paginationGetCurrentPage = function () { return this.paginationProxy.getCurrentPage(); }; /** Returns the total number of pages. Returns `null` if `paginationIsLastPageFound() === false`. */ GridApi.prototype.paginationGetTotalPages = function () { return this.paginationProxy.getTotalPages(); }; /** The total number of rows. Returns `null` if `paginationIsLastPageFound() === false`. */ GridApi.prototype.paginationGetRowCount = function () { return this.paginationProxy.getMasterRowCount(); }; /** Navigates to the next page. */ GridApi.prototype.paginationGoToNextPage = function () { this.paginationProxy.goToNextPage(); }; /** Navigates to the previous page. */ GridApi.prototype.paginationGoToPreviousPage = function () { this.paginationProxy.goToPreviousPage(); }; /** Navigates to the first page. */ GridApi.prototype.paginationGoToFirstPage = function () { this.paginationProxy.goToFirstPage(); }; /** Navigates to the last page. */ GridApi.prototype.paginationGoToLastPage = function () { this.paginationProxy.goToLastPage(); }; /** Goes to the specified page. If the page requested doesn't exist, it will go to the last page. */ GridApi.prototype.paginationGoToPage = function (page) { this.paginationProxy.goToPage(page); }; __decorate$I([ Optional('immutableService') ], GridApi.prototype, "immutableService", void 0); __decorate$I([ Optional('csvCreator') ], GridApi.prototype, "csvCreator", void 0); __decorate$I([ Optional('excelCreator') ], GridApi.prototype, "excelCreator", void 0); __decorate$I([ Autowired('rowRenderer') ], GridApi.prototype, "rowRenderer", void 0); __decorate$I([ Autowired('navigationService') ], GridApi.prototype, "navigationService", void 0); __decorate$I([ Autowired('filterManager') ], GridApi.prototype, "filterManager", void 0); __decorate$I([ Autowired('columnModel') ], GridApi.prototype, "columnModel", void 0); __decorate$I([ Autowired('selectionService') ], GridApi.prototype, "selectionService", void 0); __decorate$I([ Autowired('gridOptionsService') ], GridApi.prototype, "gridOptionsService", void 0); __decorate$I([ Autowired('valueService') ], GridApi.prototype, "valueService", void 0); __decorate$I([ Autowired('alignedGridsService') ], GridApi.prototype, "alignedGridsService", void 0); __decorate$I([ Autowired('eventService') ], GridApi.prototype, "eventService", void 0); __decorate$I([ Autowired('pinnedRowModel') ], GridApi.prototype, "pinnedRowModel", void 0); __decorate$I([ Autowired('context') ], GridApi.prototype, "context", void 0); __decorate$I([ Autowired('rowModel') ], GridApi.prototype, "rowModel", void 0); __decorate$I([ Autowired('sortController') ], GridApi.prototype, "sortController", void 0); __decorate$I([ Autowired('paginationProxy') ], GridApi.prototype, "paginationProxy", void 0); __decorate$I([ Autowired('focusService') ], GridApi.prototype, "focusService", void 0); __decorate$I([ Autowired('dragAndDropService') ], GridApi.prototype, "dragAndDropService", void 0); __decorate$I([ Optional('rangeService') ], GridApi.prototype, "rangeService", void 0); __decorate$I([ Optional('clipboardService') ], GridApi.prototype, "clipboardService", void 0); __decorate$I([ Optional('aggFuncService') ], GridApi.prototype, "aggFuncService", void 0); __decorate$I([ Autowired('menuFactory') ], GridApi.prototype, "menuFactory", void 0); __decorate$I([ Optional('contextMenuFactory') ], GridApi.prototype, "contextMenuFactory", void 0); __decorate$I([ Autowired('valueCache') ], GridApi.prototype, "valueCache", void 0); __decorate$I([ Autowired('animationFrameService') ], GridApi.prototype, "animationFrameService", void 0); __decorate$I([ Optional('statusBarService') ], GridApi.prototype, "statusBarService", void 0); __decorate$I([ Optional('chartService') ], GridApi.prototype, "chartService", void 0); __decorate$I([ Optional('undoRedoService') ], GridApi.prototype, "undoRedoService", void 0); __decorate$I([ Optional('rowNodeBlockLoader') ], GridApi.prototype, "rowNodeBlockLoader", void 0); __decorate$I([ Optional('ssrmTransactionManager') ], GridApi.prototype, "serverSideTransactionManager", void 0); __decorate$I([ Autowired('ctrlsService') ], GridApi.prototype, "ctrlsService", void 0); __decorate$I([ PostConstruct ], GridApi.prototype, "init", null); __decorate$I([ PreDestroy ], GridApi.prototype, "cleanDownReferencesToAvoidMemoryLeakInCaseApplicationIsKeepingReferenceToDestroyedGrid", null); GridApi = __decorate$I([ Bean('gridApi') ], GridApi); return GridApi; }()); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$S = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __assign$a = (undefined && undefined.__assign) || function () { __assign$a = Object.assign || function(t) { for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; } return t; }; return __assign$a.apply(this, arguments); }; var __decorate$J = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var FilterManager = /** @class */ (function (_super) { __extends$S(FilterManager, _super); function FilterManager() { var _this = _super !== null && _super.apply(this, arguments) || this; _this.allColumnFilters = new Map(); _this.activeAggregateFilters = []; _this.activeColumnFilters = []; _this.quickFilter = null; _this.quickFilterParts = null; // this is true when the grid is processing the filter change. this is used by the cell comps, so that they // don't flash when data changes due to filter changes. there is no need to flash when filter changes as the // user is in control, so doesn't make sense to show flashing changes. for example, go to main demo where // this feature is turned off (hack code to always return false for isSuppressFlashingCellsBecauseFiltering(), put in) // 100,000 rows and group by country. then do some filtering. all the cells flash, which is silly. _this.processingFilterChange = false; return _this; } FilterManager_1 = FilterManager; FilterManager.prototype.init = function () { var _this = this; this.addManagedListener(this.eventService, Events.EVENT_GRID_COLUMNS_CHANGED, function () { return _this.onColumnsChanged(); }); this.addManagedListener(this.eventService, Events.EVENT_COLUMN_VALUE_CHANGED, function () { return _this.refreshFiltersForAggregations(); }); this.addManagedListener(this.eventService, Events.EVENT_COLUMN_PIVOT_CHANGED, function () { return _this.refreshFiltersForAggregations(); }); this.addManagedListener(this.eventService, Events.EVENT_COLUMN_PIVOT_MODE_CHANGED, function () { _this.refreshFiltersForAggregations(); _this.resetQuickFilterCache(); }); this.addManagedListener(this.eventService, Events.EVENT_NEW_COLUMNS_LOADED, function () { return _this.resetQuickFilterCache(); }); this.addManagedListener(this.eventService, Events.EVENT_COLUMN_ROW_GROUP_CHANGED, function () { return _this.resetQuickFilterCache(); }); this.addManagedListener(this.eventService, Events.EVENT_COLUMN_VISIBLE, function () { if (_this.gridOptionsService.is('excludeHiddenColumnsFromQuickFilter')) { _this.resetQuickFilterCache(); } }); this.addManagedPropertyListener('quickFilterText', function (e) { return _this.setQuickFilter(e.currentValue); }); this.addManagedPropertyListener('excludeHiddenColumnsFromQuickFilter', function () { return _this.onExcludeHiddenColumnsFromQuickFilterChanged(); }); this.quickFilter = this.parseQuickFilter(this.gridOptionsService.get('quickFilterText')); this.setQuickFilterParts(); this.allowShowChangeAfterFilter = this.gridOptionsService.is('allowShowChangeAfterFilter'); this.externalFilterPresent = this.isExternalFilterPresentCallback(); }; FilterManager.prototype.isExternalFilterPresentCallback = function () { var isFilterPresent = this.gridOptionsService.getCallback('isExternalFilterPresent'); if (typeof isFilterPresent === 'function') { return isFilterPresent({}); } return false; }; FilterManager.prototype.doesExternalFilterPass = function (node) { var doesFilterPass = this.gridOptionsService.get('doesExternalFilterPass'); if (typeof doesFilterPass === 'function') { return doesFilterPass(node); } return false; }; FilterManager.prototype.setQuickFilterParts = function () { this.quickFilterParts = this.quickFilter ? this.quickFilter.split(' ') : null; }; FilterManager.prototype.setFilterModel = function (model) { var _this = this; var allPromises = []; var previousModel = this.getFilterModel(); if (model) { // mark the filters as we set them, so any active filters left over we stop var modelKeys_1 = convertToSet(Object.keys(model)); this.allColumnFilters.forEach(function (filterWrapper, colId) { var newModel = model[colId]; allPromises.push(_this.setModelOnFilterWrapper(filterWrapper.filterPromise, newModel)); modelKeys_1.delete(colId); }); // at this point, processedFields contains data for which we don't have a filter working yet modelKeys_1.forEach(function (colId) { var column = _this.columnModel.getPrimaryColumn(colId) || _this.columnModel.getGridColumn(colId); if (!column) { console.warn('AG Grid: setFilterModel() - no column found for colId: ' + colId); return; } if (!column.isFilterAllowed()) { console.warn('AG Grid: setFilterModel() - unable to fully apply model, filtering disabled for colId: ' + colId); return; } var filterWrapper = _this.getOrCreateFilterWrapper(column, 'NO_UI'); if (!filterWrapper) { console.warn('AG-Grid: setFilterModel() - unable to fully apply model, unable to create filter for colId: ' + colId); return; } allPromises.push(_this.setModelOnFilterWrapper(filterWrapper.filterPromise, model[colId])); }); } else { this.allColumnFilters.forEach(function (filterWrapper) { allPromises.push(_this.setModelOnFilterWrapper(filterWrapper.filterPromise, null)); }); } AgPromise.all(allPromises).then(function () { var currentModel = _this.getFilterModel(); var columns = []; _this.allColumnFilters.forEach(function (filterWrapper, colId) { var before = previousModel ? previousModel[colId] : null; var after = currentModel ? currentModel[colId] : null; if (!_.jsonEquals(before, after)) { columns.push(filterWrapper.column); } }); if (columns.length > 0) { _this.onFilterChanged({ columns: columns }); } }); }; FilterManager.prototype.setModelOnFilterWrapper = function (filterPromise, newModel) { return new AgPromise(function (resolve) { filterPromise.then(function (filter) { if (typeof filter.setModel !== 'function') { console.warn('AG Grid: filter missing setModel method, which is needed for setFilterModel'); resolve(); } (filter.setModel(newModel) || AgPromise.resolve()).then(function () { return resolve(); }); }); }); }; FilterManager.prototype.getFilterModel = function () { var result = {}; this.allColumnFilters.forEach(function (filterWrapper, key) { // because user can provide filters, we provide useful error checking and messages var filterPromise = filterWrapper.filterPromise; var filter = filterPromise.resolveNow(null, function (promiseFilter) { return promiseFilter; }); if (filter == null) { return null; } if (typeof filter.getModel !== 'function') { console.warn('AG Grid: filter API missing getModel method, which is needed for getFilterModel'); return; } var model = filter.getModel(); if (exists(model)) { result[key] = model; } }); return result; }; FilterManager.prototype.isColumnFilterPresent = function () { return this.activeColumnFilters.length > 0; }; FilterManager.prototype.isAggregateFilterPresent = function () { return !!this.activeAggregateFilters.length; }; FilterManager.prototype.isExternalFilterPresent = function () { return this.externalFilterPresent; }; FilterManager.prototype.doAggregateFiltersPass = function (node, filterToSkip) { return this.doColumnFiltersPass(node, filterToSkip, true); }; // called by: // 1) onFilterChanged() // 2) onNewRowsLoaded() FilterManager.prototype.updateActiveFilters = function () { var _this = this; this.activeColumnFilters.length = 0; this.activeAggregateFilters.length = 0; var isFilterActive = function (filter) { if (!filter) { return false; } // this never happens, including to avoid compile error if (!filter.isFilterActive) { console.warn('AG Grid: Filter is missing isFilterActive() method'); return false; } return filter.isFilterActive(); }; var groupFilterEnabled = !!this.gridOptionsService.getGroupAggFiltering(); var isAggFilter = function (column) { var isSecondary = !column.isPrimary(); // the only filters that can appear on secondary columns are groupAgg filters if (isSecondary) { return true; } var isShowingPrimaryColumns = !_this.columnModel.isPivotActive(); var isValueActive = column.isValueActive(); // primary columns are only ever groupAgg filters if a) value is active and b) showing primary columns if (!isValueActive || !isShowingPrimaryColumns) { return false; } // from here on we know: isPrimary=true, isValueActive=true, isShowingPrimaryColumns=true if (_this.columnModel.isPivotMode()) { // primary column is pretending to be a pivot column, ie pivotMode=true, but we are // still showing primary columns return true; } // we are not pivoting, so we groupFilter when it's an agg column return groupFilterEnabled; }; this.allColumnFilters.forEach(function (filterWrapper) { if (filterWrapper.filterPromise.resolveNow(false, isFilterActive)) { var filterComp = filterWrapper.filterPromise.resolveNow(null, function (filter) { return filter; }); if (isAggFilter(filterWrapper.column)) { _this.activeAggregateFilters.push(filterComp); } else { _this.activeColumnFilters.push(filterComp); } } }); }; FilterManager.prototype.updateFilterFlagInColumns = function (source, additionalEventAttributes) { this.allColumnFilters.forEach(function (filterWrapper) { var isFilterActive = filterWrapper.filterPromise.resolveNow(false, function (filter) { return filter.isFilterActive(); }); filterWrapper.column.setFilterActive(isFilterActive, source, additionalEventAttributes); }); }; FilterManager.prototype.isAnyFilterPresent = function () { return this.isQuickFilterPresent() || this.isColumnFilterPresent() || this.isAggregateFilterPresent() || this.isExternalFilterPresent(); }; FilterManager.prototype.doColumnFiltersPass = function (node, filterToSkip, targetAggregates) { var data = node.data, aggData = node.aggData; var targetedFilters = targetAggregates ? this.activeAggregateFilters : this.activeColumnFilters; var targetedData = targetAggregates ? aggData : data; for (var i = 0; i < targetedFilters.length; i++) { var filter = targetedFilters[i]; if (filter == null || filter === filterToSkip) { continue; } if (typeof filter.doesFilterPass !== 'function') { // because users can do custom filters, give nice error message throw new Error('Filter is missing method doesFilterPass'); } if (!filter.doesFilterPass({ node: node, data: targetedData })) { return false; } } return true; }; FilterManager.prototype.parseQuickFilter = function (newFilter) { if (!exists(newFilter)) { return null; } if (!this.gridOptionsService.isRowModelType('clientSide')) { console.warn('AG Grid - Quick filtering only works with the Client-Side Row Model'); return null; } return newFilter.toUpperCase(); }; FilterManager.prototype.setQuickFilter = function (newFilter) { if (newFilter != null && typeof newFilter !== 'string') { console.warn("AG Grid - setQuickFilter() only supports string inputs, received: " + typeof newFilter); return; } var parsedFilter = this.parseQuickFilter(newFilter); if (this.quickFilter !== parsedFilter) { this.quickFilter = parsedFilter; this.setQuickFilterParts(); this.onFilterChanged(); } }; FilterManager.prototype.resetQuickFilterCache = function () { this.rowModel.forEachNode(function (node) { return node.quickFilterAggregateText = null; }); }; FilterManager.prototype.onExcludeHiddenColumnsFromQuickFilterChanged = function () { this.columnModel.refreshQuickFilterColumns(); this.resetQuickFilterCache(); if (this.isQuickFilterPresent()) { this.onFilterChanged(); } }; FilterManager.prototype.refreshFiltersForAggregations = function () { var isAggFiltering = this.gridOptionsService.getGroupAggFiltering(); if (isAggFiltering) { this.onFilterChanged(); } }; // sometimes (especially in React) the filter can call onFilterChanged when we are in the middle // of a render cycle. this would be bad, so we wait for render cycle to complete when this happens. // this happens in react when we change React State in the grid (eg setting RowCtrl's in RowContainer) // which results in React State getting applied in the main application, triggering a useEffect() to // be kicked off adn then the application calling the grid's API. in AG-6554, the custom filter was // getting it's useEffect() triggered in this way. FilterManager.prototype.callOnFilterChangedOutsideRenderCycle = function (params) { var _this = this; if (params === void 0) { params = {}; } var action = function () { return _this.onFilterChanged(params); }; if (this.rowRenderer.isRefreshInProgress()) { setTimeout(action, 0); } else { action(); } }; FilterManager.prototype.onFilterChanged = function (params) { if (params === void 0) { params = {}; } var filterInstance = params.filterInstance, additionalEventAttributes = params.additionalEventAttributes, columns = params.columns; this.updateDependantFilters(); this.updateActiveFilters(); this.updateFilterFlagInColumns('filterChanged', additionalEventAttributes); this.externalFilterPresent = this.isExternalFilterPresentCallback(); this.allColumnFilters.forEach(function (filterWrapper) { if (!filterWrapper.filterPromise) { return; } filterWrapper.filterPromise.then(function (filter) { if (filter && filter !== filterInstance && filter.onAnyFilterChanged) { filter.onAnyFilterChanged(); } }); }); var filterChangedEvent = { type: Events.EVENT_FILTER_CHANGED, columns: columns || [], }; if (additionalEventAttributes) { mergeDeep(filterChangedEvent, additionalEventAttributes); } // because internal events are not async in ag-grid, when the dispatchEvent // method comes back, we know all listeners have finished executing. this.processingFilterChange = true; this.eventService.dispatchEvent(filterChangedEvent); this.processingFilterChange = false; }; FilterManager.prototype.isSuppressFlashingCellsBecauseFiltering = function () { // if user has elected to always flash cell changes, then always return false, otherwise we suppress flashing // changes when filtering return !this.allowShowChangeAfterFilter && this.processingFilterChange; }; FilterManager.prototype.isQuickFilterPresent = function () { return this.quickFilter !== null; }; FilterManager.prototype.doesRowPassOtherFilters = function (filterToSkip, node) { return this.doesRowPassFilter({ rowNode: node, filterInstanceToSkip: filterToSkip }); }; FilterManager.prototype.doesRowPassQuickFilterNoCache = function (node, filterPart) { var _this = this; var columns = this.columnModel.getAllColumnsForQuickFilter(); return columns.some(function (column) { var part = _this.getQuickFilterTextForColumn(column, node); return exists(part) && part.indexOf(filterPart) >= 0; }); }; FilterManager.prototype.doesRowPassQuickFilterCache = function (node, filterPart) { if (!node.quickFilterAggregateText) { this.aggregateRowForQuickFilter(node); } return node.quickFilterAggregateText.indexOf(filterPart) >= 0; }; FilterManager.prototype.doesRowPassQuickFilter = function (node) { var _this = this; var usingCache = this.gridOptionsService.is('cacheQuickFilter'); // each part must pass, if any fails, then the whole filter fails return this.quickFilterParts.every(function (part) { return usingCache ? _this.doesRowPassQuickFilterCache(node, part) : _this.doesRowPassQuickFilterNoCache(node, part); }); }; FilterManager.prototype.doesRowPassAggregateFilters = function (params) { if (this.isAggregateFilterPresent() && !this.doAggregateFiltersPass(params.rowNode, params.filterInstanceToSkip)) { return false; } // got this far, all filters pass return true; }; FilterManager.prototype.doesRowPassFilter = function (params) { // the row must pass ALL of the filters, so if any of them fail, // we return true. that means if a row passes the quick filter, // but fails the column filter, it fails overall // first up, check quick filter if (this.isQuickFilterPresent() && !this.doesRowPassQuickFilter(params.rowNode)) { return false; } // secondly, give the client a chance to reject this row if (this.isExternalFilterPresent() && !this.doesExternalFilterPass(params.rowNode)) { return false; } // lastly, check column filter if (this.isColumnFilterPresent() && !this.doColumnFiltersPass(params.rowNode, params.filterInstanceToSkip)) { return false; } // got this far, all filters pass return true; }; FilterManager.prototype.getQuickFilterTextForColumn = function (column, node) { var value = this.valueService.getValue(column, node, true); var colDef = column.getColDef(); if (colDef.getQuickFilterText) { var params = { value: value, node: node, data: node.data, column: column, colDef: colDef, api: this.gridOptionsService.api, columnApi: this.gridOptionsService.columnApi, context: this.gridOptionsService.context }; value = colDef.getQuickFilterText(params); } return exists(value) ? value.toString().toUpperCase() : null; }; FilterManager.prototype.aggregateRowForQuickFilter = function (node) { var _this = this; var stringParts = []; var columns = this.columnModel.getAllColumnsForQuickFilter(); columns.forEach(function (column) { var part = _this.getQuickFilterTextForColumn(column, node); if (exists(part)) { stringParts.push(part); } }); node.quickFilterAggregateText = stringParts.join(FilterManager_1.QUICK_FILTER_SEPARATOR); }; FilterManager.prototype.onNewRowsLoaded = function (source) { this.allColumnFilters.forEach(function (filterWrapper) { filterWrapper.filterPromise.then(function (filter) { if (filter.onNewRowsLoaded) { filter.onNewRowsLoaded(); } }); }); this.updateFilterFlagInColumns(source, { afterDataChange: true }); this.updateActiveFilters(); }; FilterManager.prototype.createValueGetter = function (column) { var _this = this; return function (_a) { var node = _a.node; return _this.valueService.getValue(column, node, true); }; }; FilterManager.prototype.getFilterComponent = function (column, source, createIfDoesNotExist) { var _a; if (createIfDoesNotExist === void 0) { createIfDoesNotExist = true; } if (createIfDoesNotExist) { return ((_a = this.getOrCreateFilterWrapper(column, source)) === null || _a === void 0 ? void 0 : _a.filterPromise) || null; } var filterWrapper = this.cachedFilter(column); return filterWrapper ? filterWrapper.filterPromise : null; }; FilterManager.prototype.isFilterActive = function (column) { var filterWrapper = this.cachedFilter(column); return !!filterWrapper && filterWrapper.filterPromise.resolveNow(false, function (filter) { return filter.isFilterActive(); }); }; FilterManager.prototype.getOrCreateFilterWrapper = function (column, source) { if (!column.isFilterAllowed()) { return null; } var filterWrapper = this.cachedFilter(column); if (!filterWrapper) { filterWrapper = this.createFilterWrapper(column, source); this.allColumnFilters.set(column.getColId(), filterWrapper); } else if (source !== 'NO_UI') { this.putIntoGui(filterWrapper, source); } return filterWrapper; }; FilterManager.prototype.cachedFilter = function (column) { return this.allColumnFilters.get(column.getColId()); }; FilterManager.prototype.createFilterInstance = function (column) { var _this = this; var defaultFilter = ModuleRegistry.isRegistered(exports.ModuleNames.SetFilterModule) ? 'agSetColumnFilter' : 'agTextColumnFilter'; var colDef = column.getColDef(); var filterInstance; var params = __assign$a(__assign$a({}, this.createFilterParams(column, colDef)), { filterModifiedCallback: function () { var event = { type: Events.EVENT_FILTER_MODIFIED, column: column, filterInstance: filterInstance }; _this.eventService.dispatchEvent(event); }, filterChangedCallback: function (additionalEventAttributes) { var params = { filterInstance: filterInstance, additionalEventAttributes: additionalEventAttributes, columns: [column] }; _this.callOnFilterChangedOutsideRenderCycle(params); }, doesRowPassOtherFilter: function (node) { return _this.doesRowPassOtherFilters(filterInstance, node); } }); var compDetails = this.userComponentFactory.getFilterDetails(colDef, params, defaultFilter); if (!compDetails) { return null; } var componentPromise = compDetails.newAgStackInstance(); if (componentPromise) { componentPromise.then(function (r) { return filterInstance = r; }); } return componentPromise; }; FilterManager.prototype.createFilterParams = function (column, colDef) { var params = { column: column, colDef: cloneObject(colDef), rowModel: this.rowModel, filterChangedCallback: function () { }, filterModifiedCallback: function () { }, valueGetter: this.createValueGetter(column), doesRowPassOtherFilter: function () { return true; }, api: this.gridOptionsService.api, columnApi: this.gridOptionsService.columnApi, context: this.gridOptionsService.context, }; return params; }; FilterManager.prototype.createFilterWrapper = function (column, source) { var filterWrapper = { column: column, filterPromise: null, compiledElement: null, guiPromise: AgPromise.resolve(null) }; filterWrapper.filterPromise = this.createFilterInstance(column); if (filterWrapper.filterPromise) { this.putIntoGui(filterWrapper, source); } return filterWrapper; }; FilterManager.prototype.putIntoGui = function (filterWrapper, source) { var _this = this; var eFilterGui = document.createElement('div'); eFilterGui.className = 'ag-filter'; filterWrapper.guiPromise = new AgPromise(function (resolve) { filterWrapper.filterPromise.then(function (filter) { var guiFromFilter = filter.getGui(); if (!exists(guiFromFilter)) { console.warn("AG Grid: getGui method from filter returned " + guiFromFilter + ", it should be a DOM element or an HTML template string."); } // for backwards compatibility with Angular 1 - we // used to allow providing back HTML from getGui(). // once we move away from supporting Angular 1 // directly, we can change this. if (typeof guiFromFilter === 'string') { guiFromFilter = loadTemplate(guiFromFilter); } eFilterGui.appendChild(guiFromFilter); resolve(eFilterGui); var event = { type: Events.EVENT_FILTER_OPENED, column: filterWrapper.column, source: source, eGui: eFilterGui }; _this.eventService.dispatchEvent(event); }); }); }; FilterManager.prototype.onColumnsChanged = function () { var _this = this; var columns = []; this.allColumnFilters.forEach(function (wrapper, colId) { var currentColumn; if (wrapper.column.isPrimary()) { currentColumn = _this.columnModel.getPrimaryColumn(colId); } else { currentColumn = _this.columnModel.getGridColumn(colId); } if (currentColumn) { return; } columns.push(wrapper.column); _this.disposeFilterWrapper(wrapper, 'columnChanged'); }); if (columns.length > 0) { this.onFilterChanged({ columns: columns }); } else { // onFilterChanged does this already this.updateDependantFilters(); } }; FilterManager.prototype.updateDependantFilters = function () { var _this = this; // Group column filters can be dependant on underlying column filters, but don't normally get created until they're used for the first time. // Instead, create them by default when any filter changes. var groupColumns = this.columnModel.getGroupAutoColumns(); groupColumns === null || groupColumns === void 0 ? void 0 : groupColumns.forEach(function (groupColumn) { if (groupColumn.getColDef().filter === 'agGroupColumnFilter') { _this.getOrCreateFilterWrapper(groupColumn, 'NO_UI'); } }); }; // for group filters, can change dynamically whether they are allowed or not FilterManager.prototype.isFilterAllowed = function (column) { var _a, _b; var isFilterAllowed = column.isFilterAllowed(); if (!isFilterAllowed) { return false; } var filterWrapper = this.allColumnFilters.get(column.getColId()); return (_b = (_a = filterWrapper === null || filterWrapper === void 0 ? void 0 : filterWrapper.filterPromise) === null || _a === void 0 ? void 0 : _a.resolveNow(true, // defer to filter component isFilterAllowed if it exists function (filter) { var _a, _b; return (typeof ((_a = filter) === null || _a === void 0 ? void 0 : _a.isFilterAllowed) === 'function') ? (_b = filter) === null || _b === void 0 ? void 0 : _b.isFilterAllowed() : true; })) !== null && _b !== void 0 ? _b : true; }; FilterManager.prototype.getFloatingFilterCompDetails = function (column, showParentFilter) { var _this = this; var colDef = column.getColDef(); var filterParams = this.createFilterParams(column, colDef); var finalFilterParams = this.userComponentFactory.mergeParamsWithApplicationProvidedParams(colDef, FilterComponent, filterParams); var defaultFloatingFilterType = this.userComponentFactory.getDefaultFloatingFilterType(colDef); if (defaultFloatingFilterType == null) { defaultFloatingFilterType = 'agReadOnlyFloatingFilter'; } var parentFilterInstance = function (callback) { var filterComponent = _this.getFilterComponent(column, 'NO_UI'); if (filterComponent == null) { return; } filterComponent.then(function (instance) { callback(unwrapUserComp(instance)); }); }; var params = { column: column, filterParams: finalFilterParams, currentParentModel: function () { return _this.getCurrentFloatingFilterParentModel(column); }, parentFilterInstance: parentFilterInstance, showParentFilter: showParentFilter, suppressFilterButton: false // This one might be overridden from the colDef }; return this.userComponentFactory.getFloatingFilterCompDetails(colDef, params, defaultFloatingFilterType); }; FilterManager.prototype.getCurrentFloatingFilterParentModel = function (column) { var filterComponent = this.getFilterComponent(column, 'NO_UI', false); return filterComponent ? filterComponent.resolveNow(null, function (filter) { return filter && filter.getModel(); }) : null; }; // destroys the filter, so it no longer takes part /** * @param source if not calling this from the API, will need to add a new value */ FilterManager.prototype.destroyFilter = function (column, source) { if (source === void 0) { source = 'api'; } var filterWrapper = this.allColumnFilters.get(column.getColId()); if (filterWrapper) { this.disposeFilterWrapper(filterWrapper, source); this.onFilterChanged({ columns: [column] }); } }; FilterManager.prototype.disposeFilterWrapper = function (filterWrapper, source) { var _this = this; filterWrapper.filterPromise.then(function (filter) { (filter.setModel(null) || AgPromise.resolve()).then(function () { _this.getContext().destroyBean(filter); filterWrapper.column.setFilterActive(false, 'filterDestroyed'); _this.allColumnFilters.delete(filterWrapper.column.getColId()); var event = { type: Events.EVENT_FILTER_DESTROYED, source: source, column: filterWrapper.column, }; _this.eventService.dispatchEvent(event); }); }); }; FilterManager.prototype.destroy = function () { var _this = this; _super.prototype.destroy.call(this); this.allColumnFilters.forEach(function (filterWrapper) { return _this.disposeFilterWrapper(filterWrapper, 'gridDestroyed'); }); }; var FilterManager_1; FilterManager.QUICK_FILTER_SEPARATOR = '\n'; __decorate$J([ Autowired('valueService') ], FilterManager.prototype, "valueService", void 0); __decorate$J([ Autowired('columnModel') ], FilterManager.prototype, "columnModel", void 0); __decorate$J([ Autowired('rowModel') ], FilterManager.prototype, "rowModel", void 0); __decorate$J([ Autowired('userComponentFactory') ], FilterManager.prototype, "userComponentFactory", void 0); __decorate$J([ Autowired('rowRenderer') ], FilterManager.prototype, "rowRenderer", void 0); __decorate$J([ PostConstruct ], FilterManager.prototype, "init", null); FilterManager = FilterManager_1 = __decorate$J([ Bean('filterManager') ], FilterManager); return FilterManager; }(BeanStub)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$T = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var AbstractHeaderCellComp = /** @class */ (function (_super) { __extends$T(AbstractHeaderCellComp, _super); function AbstractHeaderCellComp(template, ctrl) { var _this = _super.call(this, template) || this; _this.ctrl = ctrl; return _this; } AbstractHeaderCellComp.prototype.getCtrl = function () { return this.ctrl; }; return AbstractHeaderCellComp; }(Component)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$U = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __decorate$K = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var HeaderFilterCellComp = /** @class */ (function (_super) { __extends$U(HeaderFilterCellComp, _super); function HeaderFilterCellComp(ctrl) { return _super.call(this, HeaderFilterCellComp.TEMPLATE, ctrl) || this; } HeaderFilterCellComp.prototype.postConstruct = function () { var _this = this; var eGui = this.getGui(); var compProxy = { addOrRemoveCssClass: function (cssClassName, on) { return _this.addOrRemoveCssClass(cssClassName, on); }, addOrRemoveBodyCssClass: function (cssClassName, on) { return _this.eFloatingFilterBody.classList.toggle(cssClassName, on); }, setButtonWrapperDisplayed: function (displayed) { return setDisplayed(_this.eButtonWrapper, displayed); }, setCompDetails: function (compDetails) { return _this.setCompDetails(compDetails); }, getFloatingFilterComp: function () { return _this.compPromise; }, setWidth: function (width) { return eGui.style.width = width; }, setMenuIcon: function (eIcon) { return _this.eButtonShowMainFilter.appendChild(eIcon); } }; this.ctrl.setComp(compProxy, eGui, this.eButtonShowMainFilter, this.eFloatingFilterBody); }; HeaderFilterCellComp.prototype.setCompDetails = function (compDetails) { var _this = this; // because we are providing defaultFloatingFilterType, we know it will never be undefined; this.compPromise = compDetails.newAgStackInstance(); this.compPromise.then(function (comp) { return _this.afterCompCreated(comp); }); }; HeaderFilterCellComp.prototype.afterCompCreated = function (comp) { var _this = this; if (!comp) { return; } this.addDestroyFunc(function () { return _this.context.destroyBean(comp); }); if (!this.isAlive()) { return; } this.eFloatingFilterBody.appendChild(comp.getGui()); if (comp.afterGuiAttached) { comp.afterGuiAttached(); } }; HeaderFilterCellComp.TEMPLATE = "
\n
\n
\n \n
\n
"; __decorate$K([ RefSelector('eFloatingFilterBody') ], HeaderFilterCellComp.prototype, "eFloatingFilterBody", void 0); __decorate$K([ RefSelector('eButtonWrapper') ], HeaderFilterCellComp.prototype, "eButtonWrapper", void 0); __decorate$K([ RefSelector('eButtonShowMainFilter') ], HeaderFilterCellComp.prototype, "eButtonShowMainFilter", void 0); __decorate$K([ PostConstruct ], HeaderFilterCellComp.prototype, "postConstruct", null); return HeaderFilterCellComp; }(AbstractHeaderCellComp)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$V = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __decorate$L = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; (function (LayoutCssClasses) { LayoutCssClasses["AUTO_HEIGHT"] = "ag-layout-auto-height"; LayoutCssClasses["NORMAL"] = "ag-layout-normal"; LayoutCssClasses["PRINT"] = "ag-layout-print"; })(exports.LayoutCssClasses || (exports.LayoutCssClasses = {})); var LayoutFeature = /** @class */ (function (_super) { __extends$V(LayoutFeature, _super); function LayoutFeature(view) { var _this = _super.call(this) || this; _this.view = view; return _this; } LayoutFeature.prototype.postConstruct = function () { this.addManagedPropertyListener('domLayout', this.updateLayoutClasses.bind(this)); this.updateLayoutClasses(); }; LayoutFeature.prototype.updateLayoutClasses = function () { var domLayout = this.getDomLayout(); var params = { autoHeight: domLayout === 'autoHeight', normal: domLayout === 'normal', print: domLayout === 'print' }; var cssClass = params.autoHeight ? exports.LayoutCssClasses.AUTO_HEIGHT : params.print ? exports.LayoutCssClasses.PRINT : exports.LayoutCssClasses.NORMAL; this.view.updateLayoutClasses(cssClass, params); }; // returns either 'print', 'autoHeight' or 'normal' (normal is the default) LayoutFeature.prototype.getDomLayout = function () { var _a; var domLayout = (_a = this.gridOptionsService.get('domLayout')) !== null && _a !== void 0 ? _a : 'normal'; var validLayouts = ['normal', 'print', 'autoHeight']; if (validLayouts.indexOf(domLayout) === -1) { doOnce(function () { return console.warn("AG Grid: " + domLayout + " is not valid for DOM Layout, valid values are 'normal', 'autoHeight', 'print'."); }, 'warn about dom layout values'); return 'normal'; } return domLayout; }; __decorate$L([ PostConstruct ], LayoutFeature.prototype, "postConstruct", null); return LayoutFeature; }(BeanStub)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$W = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __assign$b = (undefined && undefined.__assign) || function () { __assign$b = Object.assign || function(t) { for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; } return t; }; return __assign$b.apply(this, arguments); }; var __decorate$M = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var GridBodyScrollFeature = /** @class */ (function (_super) { __extends$W(GridBodyScrollFeature, _super); function GridBodyScrollFeature(eBodyViewport) { var _this = _super.call(this) || this; _this.scrollLeft = -1; _this.nextScrollTop = -1; _this.scrollTop = -1; _this.eBodyViewport = eBodyViewport; _this.resetLastHScrollDebounced = debounce(function () { return _this.eLastHScroll = null; }, 500); _this.resetLastVScrollDebounced = debounce(function () { return _this.eLastVScroll = null; }, 500); return _this; } GridBodyScrollFeature.prototype.postConstruct = function () { var _this = this; this.enableRtl = this.gridOptionsService.is('enableRtl'); this.addManagedListener(this.eventService, Events.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED, this.onDisplayedColumnsWidthChanged.bind(this)); this.ctrlsService.whenReady(function (p) { _this.centerRowContainerCtrl = p.centerRowContainerCtrl; _this.onDisplayedColumnsWidthChanged(); _this.addScrollListener(); }); }; GridBodyScrollFeature.prototype.addScrollListener = function () { var fakeHScroll = this.ctrlsService.getFakeHScrollComp(); var fakeVScroll = this.ctrlsService.getFakeVScrollComp(); this.addManagedListener(this.centerRowContainerCtrl.getViewportElement(), 'scroll', this.onHScroll.bind(this)); this.addManagedListener(fakeHScroll.getViewport(), 'scroll', this.onFakeHScroll.bind(this)); var isDebounce = this.gridOptionsService.is('debounceVerticalScrollbar'); var onVScroll = isDebounce ? debounce(this.onVScroll.bind(this), 100) : this.onVScroll.bind(this); var onFakeVScroll = isDebounce ? debounce(this.onFakeVScroll.bind(this), 100) : this.onFakeVScroll.bind(this); this.addManagedListener(this.eBodyViewport, 'scroll', onVScroll); this.addManagedListener(fakeVScroll.getViewport(), 'scroll', onFakeVScroll); }; GridBodyScrollFeature.prototype.onDisplayedColumnsWidthChanged = function () { if (this.enableRtl) { // because RTL is all backwards, a change in the width of the row // can cause a change in the scroll position, without a scroll event, // because the scroll position in RTL is a function that depends on // the width. to be convinced of this, take out this line, enable RTL, // scroll all the way to the left and then resize a column this.horizontallyScrollHeaderCenterAndFloatingCenter(); } }; GridBodyScrollFeature.prototype.horizontallyScrollHeaderCenterAndFloatingCenter = function (scrollLeft) { // when doing RTL, this method gets called once prematurely var notYetInitialised = this.centerRowContainerCtrl == null; if (notYetInitialised) { return; } if (scrollLeft === undefined) { scrollLeft = this.centerRowContainerCtrl.getCenterViewportScrollLeft(); } var offset = this.enableRtl ? scrollLeft : -scrollLeft; var topCenterContainer = this.ctrlsService.getTopCenterRowContainerCtrl(); var stickyTopCenterContainer = this.ctrlsService.getStickyTopCenterRowContainerCtrl(); var bottomCenterContainer = this.ctrlsService.getBottomCenterRowContainerCtrl(); var fakeHScroll = this.ctrlsService.getFakeHScrollComp(); var centerHeaderContainer = this.ctrlsService.getHeaderRowContainerCtrl(); centerHeaderContainer.setHorizontalScroll(offset); bottomCenterContainer.setContainerTranslateX(offset); topCenterContainer.setContainerTranslateX(offset); stickyTopCenterContainer.setContainerTranslateX(offset); var centerViewport = this.centerRowContainerCtrl.getViewportElement(); var isCenterViewportLastHorizontal = this.eLastHScroll === centerViewport; var partner = isCenterViewportLastHorizontal ? fakeHScroll.getViewport() : this.centerRowContainerCtrl.getViewportElement(); setScrollLeft(partner, Math.abs(scrollLeft), this.enableRtl); }; GridBodyScrollFeature.prototype.isControllingHScroll = function (eDiv) { if (!this.eLastHScroll) { this.eLastHScroll = eDiv; return true; } return eDiv === this.eLastHScroll; }; GridBodyScrollFeature.prototype.isControllingVScroll = function (eDiv) { if (!this.eLastVScroll) { this.eLastVScroll = eDiv; return true; } return eDiv === this.eLastVScroll; }; GridBodyScrollFeature.prototype.onFakeHScroll = function () { var fakeHScrollViewport = this.ctrlsService.getFakeHScrollComp().getViewport(); if (!this.isControllingHScroll(fakeHScrollViewport)) { return; } this.onHScrollCommon(fakeHScrollViewport); }; GridBodyScrollFeature.prototype.onHScroll = function () { var centerContainerViewport = this.centerRowContainerCtrl.getViewportElement(); if (!this.isControllingHScroll(centerContainerViewport)) { return; } this.onHScrollCommon(centerContainerViewport); }; GridBodyScrollFeature.prototype.onHScrollCommon = function (eSource) { var centerContainerViewport = this.centerRowContainerCtrl.getViewportElement(); var scrollLeft = centerContainerViewport.scrollLeft; if (this.shouldBlockScrollUpdate('horizontal', scrollLeft, true)) { return; } // we do Math.round() rather than Math.floor(), to mirror how scroll values are applied. // eg if a scale is applied (ie user has zoomed the browser), then applying scroll=200 // could result in 199.88, which then floor(199.88) = 199, however round(199.88) = 200. // initially Math.floor() was used, however this caused (almost) infinite loop with aligned grids, // as the scroll would move 1px at at time bouncing from one grid to the next (eg one grid would cause // scroll to 200px, the next to 199px, then the first back to 198px and so on). this.doHorizontalScroll(Math.round(getScrollLeft(eSource, this.enableRtl))); this.resetLastHScrollDebounced(); }; GridBodyScrollFeature.prototype.onFakeVScroll = function () { var fakeVScrollViewport = this.ctrlsService.getFakeVScrollComp().getViewport(); if (!this.isControllingVScroll(fakeVScrollViewport)) { return; } this.onVScrollCommon(fakeVScrollViewport); }; GridBodyScrollFeature.prototype.onVScroll = function () { if (!this.isControllingVScroll(this.eBodyViewport)) { return; } this.onVScrollCommon(this.eBodyViewport); }; GridBodyScrollFeature.prototype.onVScrollCommon = function (eSource) { var scrollTop = eSource.scrollTop; if (this.shouldBlockScrollUpdate('vertical', scrollTop, true)) { return; } this.animationFrameService.setScrollTop(scrollTop); this.nextScrollTop = scrollTop; if (eSource === this.eBodyViewport) { var fakeVScrollViewport = this.ctrlsService.getFakeVScrollComp().getViewport(); fakeVScrollViewport.scrollTop = scrollTop; } else { this.eBodyViewport.scrollTop = scrollTop; } // the `scrollGridIfNeeded` will recalculate the rows to be rendered by the grid // so it should only be called after `eBodyViewport` has been scrolled to the correct // position, otherwise the `first` and `last` row could be miscalculated. if (this.gridOptionsService.is('suppressAnimationFrame')) { this.scrollGridIfNeeded(); } else { this.animationFrameService.schedule(); } this.resetLastVScrollDebounced(); }; GridBodyScrollFeature.prototype.doHorizontalScroll = function (scrollLeft) { var fakeHScrollViewport = this.ctrlsService.getFakeHScrollComp().getViewport(); var fakeScrollLeft = getScrollLeft(fakeHScrollViewport, this.enableRtl); if (this.scrollLeft === scrollLeft && scrollLeft === fakeScrollLeft) { return; } this.scrollLeft = scrollLeft; this.fireScrollEvent('horizontal'); this.horizontallyScrollHeaderCenterAndFloatingCenter(scrollLeft); this.onHorizontalViewportChanged(); }; GridBodyScrollFeature.prototype.fireScrollEvent = function (direction) { var _this = this; var bodyScrollEvent = { type: Events.EVENT_BODY_SCROLL, direction: direction, left: this.scrollLeft, top: this.scrollTop }; this.eventService.dispatchEvent(bodyScrollEvent); window.clearTimeout(this.scrollTimer); this.scrollTimer = undefined; this.scrollTimer = window.setTimeout(function () { var bodyScrollEndEvent = __assign$b(__assign$b({}, bodyScrollEvent), { type: Events.EVENT_BODY_SCROLL_END }); _this.eventService.dispatchEvent(bodyScrollEndEvent); }, 100); }; GridBodyScrollFeature.prototype.shouldBlockScrollUpdate = function (direction, scrollTo, touchOnly) { // touch devices allow elastic scroll - which temporally scrolls the panel outside of the viewport // (eg user uses touch to go to the left of the grid, but drags past the left, the rows will actually // scroll past the left until the user releases the mouse). when this happens, we want ignore the scroll, // as otherwise it was causing the rows and header to flicker. if (touchOnly === void 0) { touchOnly = false; } // sometimes when scrolling, we got values that extended the maximum scroll allowed. we used to // ignore these scrolls. problem is the max scroll position could be skipped (eg the previous scroll event // could be 10px before the max position, and then current scroll event could be 20px after the max position). // if we just ignored the last event, we would be setting the scroll to 10px before the max position, when in // actual fact the user has exceeded the max scroll and thus scroll should be set to the max. if (touchOnly && !isIOSUserAgent()) { return false; } if (direction === 'vertical') { return this.shouldBlockVerticalScroll(scrollTo); } return this.shouldBlockHorizontalScroll(scrollTo); }; GridBodyScrollFeature.prototype.shouldBlockVerticalScroll = function (scrollTo) { var clientHeight = getInnerHeight(this.eBodyViewport); var scrollHeight = this.eBodyViewport.scrollHeight; if (scrollTo < 0 || (scrollTo + clientHeight > scrollHeight)) { return true; } return false; }; GridBodyScrollFeature.prototype.shouldBlockHorizontalScroll = function (scrollTo) { var clientWidth = this.centerRowContainerCtrl.getCenterWidth(); var scrollWidth = this.centerRowContainerCtrl.getViewportElement().scrollWidth; if (this.enableRtl && isRtlNegativeScroll()) { if (scrollTo > 0) { return true; } } else if (scrollTo < 0) { return true; } if (Math.abs(scrollTo) + clientWidth > scrollWidth) { return true; } return false; }; GridBodyScrollFeature.prototype.redrawRowsAfterScroll = function () { this.fireScrollEvent('vertical'); }; GridBodyScrollFeature.prototype.onHorizontalViewportChanged = function () { this.centerRowContainerCtrl.onHorizontalViewportChanged(); }; // this is to cater for AG-3274, where grid is removed from the dom and then inserted back in again. // (which happens with some implementations of tabbing). this can result in horizontal scroll getting // reset back to the left, however no scroll event is fired. so we need to get header to also scroll // back to the left to be kept in sync. // adding and removing the grid from the DOM both resets the scroll position and // triggers a resize event, so notify listeners if the scroll position has changed GridBodyScrollFeature.prototype.checkScrollLeft = function () { if (this.scrollLeft !== this.centerRowContainerCtrl.getCenterViewportScrollLeft()) { this.onHScrollCommon(this.centerRowContainerCtrl.getViewportElement()); } }; GridBodyScrollFeature.prototype.scrollGridIfNeeded = function () { var frameNeeded = this.scrollTop != this.nextScrollTop; if (frameNeeded) { this.scrollTop = this.nextScrollTop; this.redrawRowsAfterScroll(); } return frameNeeded; }; // called by scrollHorizontally method and alignedGridsService GridBodyScrollFeature.prototype.setHorizontalScrollPosition = function (hScrollPosition) { var minScrollLeft = 0; var maxScrollLeft = this.centerRowContainerCtrl.getViewportElement().scrollWidth - this.centerRowContainerCtrl.getCenterWidth(); if (this.shouldBlockScrollUpdate('horizontal', hScrollPosition)) { if (this.enableRtl && isRtlNegativeScroll()) { hScrollPosition = hScrollPosition > 0 ? 0 : maxScrollLeft; } else { hScrollPosition = Math.min(Math.max(hScrollPosition, minScrollLeft), maxScrollLeft); } } setScrollLeft(this.centerRowContainerCtrl.getViewportElement(), Math.abs(hScrollPosition), this.enableRtl); // we need to manually do the event handling (rather than wait for the event) // for the alignedGridsService, as if we don't, the aligned grid service gets // notified async, and then it's 'consuming' flag doesn't get used right, and // we can end up with an infinite loop this.doHorizontalScroll(hScrollPosition); }; GridBodyScrollFeature.prototype.setVerticalScrollPosition = function (vScrollPosition) { this.eBodyViewport.scrollTop = vScrollPosition; }; GridBodyScrollFeature.prototype.getVScrollPosition = function () { var result = { top: this.eBodyViewport.scrollTop, bottom: this.eBodyViewport.scrollTop + this.eBodyViewport.offsetHeight }; return result; }; GridBodyScrollFeature.prototype.getHScrollPosition = function () { return this.centerRowContainerCtrl.getHScrollPosition(); }; GridBodyScrollFeature.prototype.isHorizontalScrollShowing = function () { return this.centerRowContainerCtrl.isHorizontalScrollShowing(); }; // called by the headerRootComp and moveColumnController GridBodyScrollFeature.prototype.scrollHorizontally = function (pixels) { var oldScrollPosition = this.centerRowContainerCtrl.getViewportElement().scrollLeft; this.setHorizontalScrollPosition(oldScrollPosition + pixels); return this.centerRowContainerCtrl.getViewportElement().scrollLeft - oldScrollPosition; }; // gets called by rowRenderer when new data loaded, as it will want to scroll to the top GridBodyScrollFeature.prototype.scrollToTop = function () { this.eBodyViewport.scrollTop = 0; }; // Valid values for position are bottom, middle and top GridBodyScrollFeature.prototype.ensureNodeVisible = function (comparator, position) { if (position === void 0) { position = null; } // look for the node index we want to display var rowCount = this.rowModel.getRowCount(); var indexToSelect = -1; // go through all the nodes, find the one we want to show for (var i = 0; i < rowCount; i++) { var node = this.rowModel.getRow(i); if (typeof comparator === 'function') { // Have to assert type here, as type could be TData & Function var predicate = comparator; if (node && predicate(node)) { indexToSelect = i; break; } } else { // check object equality against node and data if (comparator === node || comparator === node.data) { indexToSelect = i; break; } } } if (indexToSelect >= 0) { this.ensureIndexVisible(indexToSelect, position); } }; // Valid values for position are bottom, middle and top // position should be {'top','middle','bottom', or undefined/null}. // if undefined/null, then the grid will to the minimal amount of scrolling, // eg if grid needs to scroll up, it scrolls until row is on top, // if grid needs to scroll down, it scrolls until row is on bottom, // if row is already in view, grid does not scroll GridBodyScrollFeature.prototype.ensureIndexVisible = function (index, position) { // if for print or auto height, everything is always visible if (this.gridOptionsService.isDomLayout('print')) { return; } var rowCount = this.paginationProxy.getRowCount(); if (typeof index !== 'number' || index < 0 || index >= rowCount) { console.warn('AG Grid: Invalid row index for ensureIndexVisible: ' + index); return; } var isPaging = this.gridOptionsService.is('pagination'); var paginationPanelEnabled = isPaging && !this.gridOptionsService.is('suppressPaginationPanel'); if (!paginationPanelEnabled) { this.paginationProxy.goToPageWithIndex(index); } var gridBodyCtrl = this.ctrlsService.getGridBodyCtrl(); var stickyTopHeight = gridBodyCtrl.getStickyTopHeight(); var rowNode = this.paginationProxy.getRow(index); var rowGotShiftedDuringOperation; do { var startingRowTop = rowNode.rowTop; var startingRowHeight = rowNode.rowHeight; var paginationOffset = this.paginationProxy.getPixelOffset(); var rowTopPixel = rowNode.rowTop - paginationOffset; var rowBottomPixel = rowTopPixel + rowNode.rowHeight; var scrollPosition = this.getVScrollPosition(); var heightOffset = this.heightScaler.getDivStretchOffset(); var vScrollTop = scrollPosition.top + heightOffset; var vScrollBottom = scrollPosition.bottom + heightOffset; var viewportHeight = vScrollBottom - vScrollTop; // work out the pixels for top, middle and bottom up front, // make the if/else below easier to read var pxTop = this.heightScaler.getScrollPositionForPixel(rowTopPixel); var pxBottom = this.heightScaler.getScrollPositionForPixel(rowBottomPixel - viewportHeight); // make sure if middle, the row is not outside the top of the grid var pxMiddle = Math.min((pxTop + pxBottom) / 2, rowTopPixel); var rowAboveViewport = (vScrollTop + stickyTopHeight) > rowTopPixel; var rowBelowViewport = vScrollBottom < rowBottomPixel; var newScrollPosition = null; if (position === 'top') { newScrollPosition = pxTop; } else if (position === 'bottom') { newScrollPosition = pxBottom; } else if (position === 'middle') { newScrollPosition = pxMiddle; } else if (rowAboveViewport) { // if row is before, scroll up with row at top newScrollPosition = pxTop - stickyTopHeight; } else if (rowBelowViewport) { // if row is after, scroll down with row at bottom newScrollPosition = pxBottom; } if (newScrollPosition !== null) { this.eBodyViewport.scrollTop = newScrollPosition; this.rowRenderer.redrawAfterScroll(); } // the row can get shifted if during the rendering (during rowRenderer.redrawAfterScroll()), // the height of a row changes due to lazy calculation of row heights when using // colDef.autoHeight or gridOptions.getRowHeight. // if row was shifted, then the position we scrolled to is incorrect. rowGotShiftedDuringOperation = (startingRowTop !== rowNode.rowTop) || (startingRowHeight !== rowNode.rowHeight); } while (rowGotShiftedDuringOperation); // so when we return back to user, the cells have rendered this.animationFrameService.flushAllFrames(); }; GridBodyScrollFeature.prototype.ensureColumnVisible = function (key, position) { if (position === void 0) { position = 'auto'; } var column = this.columnModel.getGridColumn(key); if (!column) { return; } // calling ensureColumnVisible on a pinned column doesn't make sense if (column.isPinned()) { return; } // defensive if (!this.columnModel.isColumnDisplayed(column)) { return; } var newHorizontalScroll = this.getPositionedHorizontalScroll(column, position); if (newHorizontalScroll !== null) { this.centerRowContainerCtrl.setCenterViewportScrollLeft(newHorizontalScroll); } // this will happen anyway, as the move will cause a 'scroll' event on the body, however // it is possible that the ensureColumnVisible method is called from within AG Grid and // the caller will need to have the columns rendered to continue, which will be before // the event has been worked on (which is the case for cell navigation). this.centerRowContainerCtrl.onHorizontalViewportChanged(); // so when we return back to user, the cells have rendered this.animationFrameService.flushAllFrames(); }; GridBodyScrollFeature.prototype.getPositionedHorizontalScroll = function (column, position) { var _a = this.isColumnOutsideViewport(column), columnBeforeStart = _a.columnBeforeStart, columnAfterEnd = _a.columnAfterEnd; var viewportTooSmallForColumn = this.centerRowContainerCtrl.getCenterWidth() < column.getActualWidth(); var viewportWidth = this.centerRowContainerCtrl.getCenterWidth(); var isRtl = this.enableRtl; var alignColToStart = (isRtl ? columnBeforeStart : columnAfterEnd) || viewportTooSmallForColumn; var alignColToEnd = isRtl ? columnAfterEnd : columnBeforeStart; if (position !== 'auto') { alignColToStart = position === 'start'; alignColToEnd = position === 'end'; } var isMiddle = position === 'middle'; if (alignColToStart || alignColToEnd || isMiddle) { var _b = this.getColumnBounds(column), colLeft = _b.colLeft, colMiddle = _b.colMiddle, colRight = _b.colRight; if (isMiddle) { return colMiddle - viewportWidth / 2; } if (alignColToStart) { return isRtl ? colRight : colLeft; } return isRtl ? (colLeft - viewportWidth) : (colRight - viewportWidth); } return null; }; GridBodyScrollFeature.prototype.isColumnOutsideViewport = function (column) { var _a = this.getViewportBounds(), viewportStart = _a.start, viewportEnd = _a.end; var _b = this.getColumnBounds(column), colLeft = _b.colLeft, colRight = _b.colRight; var isRtl = this.enableRtl; var columnBeforeStart = isRtl ? (viewportStart > colRight) : (viewportEnd < colRight); var columnAfterEnd = isRtl ? (viewportEnd < colLeft) : (viewportStart > colLeft); return { columnBeforeStart: columnBeforeStart, columnAfterEnd: columnAfterEnd }; }; GridBodyScrollFeature.prototype.getColumnBounds = function (column) { var isRtl = this.enableRtl; var bodyWidth = this.columnModel.getBodyContainerWidth(); var colWidth = column.getActualWidth(); var colLeft = column.getLeft(); var multiplier = isRtl ? -1 : 1; var colLeftPixel = isRtl ? (bodyWidth - colLeft) : colLeft; var colRightPixel = colLeftPixel + colWidth * multiplier; var colMidPixel = colLeftPixel + colWidth / 2 * multiplier; return { colLeft: colLeftPixel, colMiddle: colMidPixel, colRight: colRightPixel }; }; GridBodyScrollFeature.prototype.getViewportBounds = function () { var viewportWidth = this.centerRowContainerCtrl.getCenterWidth(); var scrollPosition = this.centerRowContainerCtrl.getCenterViewportScrollLeft(); var viewportStartPixel = scrollPosition; var viewportEndPixel = viewportWidth + scrollPosition; return { start: viewportStartPixel, end: viewportEndPixel, width: viewportWidth }; }; __decorate$M([ Autowired('ctrlsService') ], GridBodyScrollFeature.prototype, "ctrlsService", void 0); __decorate$M([ Autowired('animationFrameService') ], GridBodyScrollFeature.prototype, "animationFrameService", void 0); __decorate$M([ Autowired('paginationProxy') ], GridBodyScrollFeature.prototype, "paginationProxy", void 0); __decorate$M([ Autowired('rowModel') ], GridBodyScrollFeature.prototype, "rowModel", void 0); __decorate$M([ Autowired('rowContainerHeightService') ], GridBodyScrollFeature.prototype, "heightScaler", void 0); __decorate$M([ Autowired('rowRenderer') ], GridBodyScrollFeature.prototype, "rowRenderer", void 0); __decorate$M([ Autowired('columnModel') ], GridBodyScrollFeature.prototype, "columnModel", void 0); __decorate$M([ PostConstruct ], GridBodyScrollFeature.prototype, "postConstruct", null); return GridBodyScrollFeature; }(BeanStub)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var AutoScrollService = /** @class */ (function () { function AutoScrollService(params) { this.tickingInterval = null; this.onScrollCallback = null; this.scrollContainer = params.scrollContainer; this.scrollHorizontally = params.scrollAxis.indexOf('x') !== -1; this.scrollVertically = params.scrollAxis.indexOf('y') !== -1; this.scrollByTick = params.scrollByTick != null ? params.scrollByTick : 20; if (params.onScrollCallback) { this.onScrollCallback = params.onScrollCallback; } if (this.scrollVertically) { this.getVerticalPosition = params.getVerticalPosition; this.setVerticalPosition = params.setVerticalPosition; } if (this.scrollHorizontally) { this.getHorizontalPosition = params.getHorizontalPosition; this.setHorizontalPosition = params.setHorizontalPosition; } this.shouldSkipVerticalScroll = params.shouldSkipVerticalScroll || (function () { return false; }); this.shouldSkipHorizontalScroll = params.shouldSkipHorizontalScroll || (function () { return false; }); } AutoScrollService.prototype.check = function (mouseEvent, forceSkipVerticalScroll) { if (forceSkipVerticalScroll === void 0) { forceSkipVerticalScroll = false; } var skipVerticalScroll = forceSkipVerticalScroll || this.shouldSkipVerticalScroll(); if (skipVerticalScroll && this.shouldSkipHorizontalScroll()) { return; } var rect = this.scrollContainer.getBoundingClientRect(); var scrollTick = this.scrollByTick; this.tickLeft = mouseEvent.clientX < (rect.left + scrollTick); this.tickRight = mouseEvent.clientX > (rect.right - scrollTick); this.tickUp = mouseEvent.clientY < (rect.top + scrollTick) && !skipVerticalScroll; this.tickDown = mouseEvent.clientY > (rect.bottom - scrollTick) && !skipVerticalScroll; if (this.tickLeft || this.tickRight || this.tickUp || this.tickDown) { this.ensureTickingStarted(); } else { this.ensureCleared(); } }; AutoScrollService.prototype.ensureTickingStarted = function () { if (this.tickingInterval === null) { this.tickingInterval = window.setInterval(this.doTick.bind(this), 100); this.tickCount = 0; } }; AutoScrollService.prototype.doTick = function () { this.tickCount++; var tickAmount; tickAmount = this.tickCount > 20 ? 200 : (this.tickCount > 10 ? 80 : 40); if (this.scrollVertically) { var vScrollPosition = this.getVerticalPosition(); if (this.tickUp) { this.setVerticalPosition(vScrollPosition - tickAmount); } if (this.tickDown) { this.setVerticalPosition(vScrollPosition + tickAmount); } } if (this.scrollHorizontally) { var hScrollPosition = this.getHorizontalPosition(); if (this.tickLeft) { this.setHorizontalPosition(hScrollPosition - tickAmount); } if (this.tickRight) { this.setHorizontalPosition(hScrollPosition + tickAmount); } } if (this.onScrollCallback) { this.onScrollCallback(); } }; AutoScrollService.prototype.ensureCleared = function () { if (this.tickingInterval) { window.clearInterval(this.tickingInterval); this.tickingInterval = null; } }; return AutoScrollService; }()); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$X = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __assign$c = (undefined && undefined.__assign) || function () { __assign$c = Object.assign || function(t) { for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; } return t; }; return __assign$c.apply(this, arguments); }; var __decorate$N = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var __read$a = (undefined && undefined.__read) || function (o, n) { var m = typeof Symbol === "function" && o[Symbol.iterator]; if (!m) return o; var i = m.call(o), r, ar = [], e; try { while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); } catch (error) { e = { error: error }; } finally { try { if (r && !r.done && (m = i["return"])) m.call(i); } finally { if (e) throw e.error; } } return ar; }; var __spread$7 = (undefined && undefined.__spread) || function () { for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read$a(arguments[i])); return ar; }; var RowDragFeature = /** @class */ (function (_super) { __extends$X(RowDragFeature, _super); function RowDragFeature(eContainer) { var _this = _super.call(this) || this; _this.isMultiRowDrag = false; _this.isGridSorted = false; _this.isGridFiltered = false; _this.isRowGroupActive = false; _this.eContainer = eContainer; return _this; } RowDragFeature.prototype.postConstruct = function () { var _this = this; if (this.gridOptionsService.isRowModelType('clientSide')) { this.clientSideRowModel = this.rowModel; } var refreshStatus = function () { _this.onSortChanged(); _this.onFilterChanged(); _this.onRowGroupChanged(); }; this.addManagedListener(this.eventService, Events.EVENT_SORT_CHANGED, this.onSortChanged.bind(this)); this.addManagedListener(this.eventService, Events.EVENT_FILTER_CHANGED, this.onFilterChanged.bind(this)); this.addManagedListener(this.eventService, Events.EVENT_COLUMN_ROW_GROUP_CHANGED, this.onRowGroupChanged.bind(this)); this.addManagedListener(this.eventService, Events.EVENT_MODEL_UPDATED, function () { refreshStatus(); }); refreshStatus(); this.ctrlsService.whenReady(function () { var gridBodyCon = _this.ctrlsService.getGridBodyCtrl(); _this.autoScrollService = new AutoScrollService({ scrollContainer: gridBodyCon.getBodyViewportElement(), scrollAxis: 'y', getVerticalPosition: function () { return gridBodyCon.getScrollFeature().getVScrollPosition().top; }, setVerticalPosition: function (position) { return gridBodyCon.getScrollFeature().setVerticalScrollPosition(position); }, onScrollCallback: function () { _this.onDragging(_this.lastDraggingEvent); } }); }); }; RowDragFeature.prototype.onSortChanged = function () { this.isGridSorted = this.sortController.isSortActive(); }; RowDragFeature.prototype.onFilterChanged = function () { this.isGridFiltered = this.filterManager.isAnyFilterPresent(); }; RowDragFeature.prototype.onRowGroupChanged = function () { var rowGroups = this.columnModel.getRowGroupColumns(); this.isRowGroupActive = !missingOrEmpty(rowGroups); }; RowDragFeature.prototype.getContainer = function () { return this.eContainer; }; RowDragFeature.prototype.isInterestedIn = function (type) { return type === exports.DragSourceType.RowDrag; }; RowDragFeature.prototype.getIconName = function () { var managedDrag = this.gridOptionsService.is('rowDragManaged'); if (managedDrag && this.shouldPreventRowMove()) { return DragAndDropService.ICON_NOT_ALLOWED; } return DragAndDropService.ICON_MOVE; }; RowDragFeature.prototype.shouldPreventRowMove = function () { return this.isGridSorted || this.isGridFiltered || this.isRowGroupActive; }; RowDragFeature.prototype.getRowNodes = function (draggingEvent) { var _this = this; if (!this.isFromThisGrid(draggingEvent)) { return (draggingEvent.dragItem.rowNodes || []); } var isRowDragMultiRow = this.gridOptionsService.is('rowDragMultiRow'); var selectedNodes = __spread$7(this.selectionService.getSelectedNodes()).sort(function (a, b) { if (a.rowIndex == null || b.rowIndex == null) { return 0; } return _this.getRowIndexNumber(a) - _this.getRowIndexNumber(b); }); var currentNode = draggingEvent.dragItem.rowNode; if (isRowDragMultiRow && selectedNodes.indexOf(currentNode) !== -1) { this.isMultiRowDrag = true; return selectedNodes; } this.isMultiRowDrag = false; return [currentNode]; }; RowDragFeature.prototype.onDragEnter = function (draggingEvent) { // builds a lits of all rows being dragged before firing events draggingEvent.dragItem.rowNodes = this.getRowNodes(draggingEvent); // when entering, we fire the enter event, then in onEnterOrDragging, // we also fire the move event. so we get both events when entering. this.dispatchGridEvent(Events.EVENT_ROW_DRAG_ENTER, draggingEvent); this.getRowNodes(draggingEvent).forEach(function (rowNode) { rowNode.setDragging(true); }); this.onEnterOrDragging(draggingEvent); }; RowDragFeature.prototype.onDragging = function (draggingEvent) { this.onEnterOrDragging(draggingEvent); }; RowDragFeature.prototype.isFromThisGrid = function (draggingEvent) { var dragSourceDomDataKey = draggingEvent.dragSource.dragSourceDomDataKey; return dragSourceDomDataKey === this.gridOptionsService.getDomDataKey(); }; RowDragFeature.prototype.isDropZoneWithinThisGrid = function (draggingEvent) { var gridBodyCon = this.ctrlsService.getGridBodyCtrl(); var gridGui = gridBodyCon.getGui(); var dropZoneTarget = draggingEvent.dropZoneTarget; return !gridGui.contains(dropZoneTarget); }; RowDragFeature.prototype.onEnterOrDragging = function (draggingEvent) { // this event is fired for enter and move this.dispatchGridEvent(Events.EVENT_ROW_DRAG_MOVE, draggingEvent); this.lastDraggingEvent = draggingEvent; var pixel = this.mouseEventService.getNormalisedPosition(draggingEvent).y; var managedDrag = this.gridOptionsService.is('rowDragManaged'); if (managedDrag) { this.doManagedDrag(draggingEvent, pixel); } this.autoScrollService.check(draggingEvent.event); }; RowDragFeature.prototype.doManagedDrag = function (draggingEvent, pixel) { var isFromThisGrid = this.isFromThisGrid(draggingEvent); var managedDrag = this.gridOptionsService.is('rowDragManaged'); var rowNodes = draggingEvent.dragItem.rowNodes; if (managedDrag && this.shouldPreventRowMove()) { return; } if (this.gridOptionsService.is('suppressMoveWhenRowDragging') || !isFromThisGrid) { if (!this.isDropZoneWithinThisGrid(draggingEvent)) { this.clientSideRowModel.highlightRowAtPixel(rowNodes[0], pixel); } } else { this.moveRows(rowNodes, pixel); } }; RowDragFeature.prototype.getRowIndexNumber = function (rowNode) { return parseInt(last(rowNode.getRowIndexString().split('-')), 10); }; RowDragFeature.prototype.moveRowAndClearHighlight = function (draggingEvent) { var _this = this; var lastHighlightedRowNode = this.clientSideRowModel.getLastHighlightedRowNode(); var isBelow = lastHighlightedRowNode && lastHighlightedRowNode.highlighted === exports.RowHighlightPosition.Below; var pixel = this.mouseEventService.getNormalisedPosition(draggingEvent).y; var rowNodes = draggingEvent.dragItem.rowNodes; var increment = isBelow ? 1 : 0; if (this.isFromThisGrid(draggingEvent)) { rowNodes.forEach(function (rowNode) { if (rowNode.rowTop < pixel) { increment -= 1; } }); this.moveRows(rowNodes, pixel, increment); } else { var getRowIdFunc_1 = this.gridOptionsService.getRowIdFunc(); var addIndex = this.clientSideRowModel.getRowIndexAtPixel(pixel) + 1; if (this.clientSideRowModel.getHighlightPosition(pixel) === exports.RowHighlightPosition.Above) { addIndex--; } this.clientSideRowModel.updateRowData({ add: rowNodes .map(function (node) { return node.data; }) .filter(function (data) { return !_this.clientSideRowModel.getRowNode(getRowIdFunc_1 ? getRowIdFunc_1({ data: data, level: 0 }) : data.id); }), addIndex: addIndex }); } this.clearRowHighlight(); }; RowDragFeature.prototype.clearRowHighlight = function () { this.clientSideRowModel.highlightRowAtPixel(null); }; RowDragFeature.prototype.moveRows = function (rowNodes, pixel, increment) { if (increment === void 0) { increment = 0; } var rowWasMoved = this.clientSideRowModel.ensureRowsAtPixel(rowNodes, pixel, increment); if (rowWasMoved) { this.focusService.clearFocusedCell(); if (this.rangeService) { this.rangeService.removeAllCellRanges(); } } }; RowDragFeature.prototype.addRowDropZone = function (params) { var _this = this; if (!params.getContainer()) { doOnce(function () { return console.warn('AG Grid: addRowDropZone - A container target needs to be provided'); }, 'add-drop-zone-empty-target'); return; } if (this.dragAndDropService.findExternalZone(params)) { console.warn('AG Grid: addRowDropZone - target already exists in the list of DropZones. Use `removeRowDropZone` before adding it again.'); return; } var processedParams = { getContainer: params.getContainer }; if (params.fromGrid) { params.fromGrid = undefined; processedParams = params; } else { if (params.onDragEnter) { processedParams.onDragEnter = function (e) { params.onDragEnter(_this.draggingToRowDragEvent(Events.EVENT_ROW_DRAG_ENTER, e)); }; } if (params.onDragLeave) { processedParams.onDragLeave = function (e) { params.onDragLeave(_this.draggingToRowDragEvent(Events.EVENT_ROW_DRAG_LEAVE, e)); }; } if (params.onDragging) { processedParams.onDragging = function (e) { params.onDragging(_this.draggingToRowDragEvent(Events.EVENT_ROW_DRAG_MOVE, e)); }; } if (params.onDragStop) { processedParams.onDragStop = function (e) { params.onDragStop(_this.draggingToRowDragEvent(Events.EVENT_ROW_DRAG_END, e)); }; } } this.dragAndDropService.addDropTarget(__assign$c({ isInterestedIn: function (type) { return type === exports.DragSourceType.RowDrag; }, getIconName: function () { return DragAndDropService.ICON_MOVE; }, external: true }, processedParams)); }; RowDragFeature.prototype.getRowDropZone = function (events) { var _this = this; var getContainer = this.getContainer.bind(this); var onDragEnter = this.onDragEnter.bind(this); var onDragLeave = this.onDragLeave.bind(this); var onDragging = this.onDragging.bind(this); var onDragStop = this.onDragStop.bind(this); if (!events) { return { getContainer: getContainer, onDragEnter: onDragEnter, onDragLeave: onDragLeave, onDragging: onDragging, onDragStop: onDragStop, /* @private */ fromGrid: true }; } return { getContainer: getContainer, onDragEnter: events.onDragEnter ? (function (e) { onDragEnter(e); events.onDragEnter(_this.draggingToRowDragEvent(Events.EVENT_ROW_DRAG_ENTER, e)); }) : onDragEnter, onDragLeave: events.onDragLeave ? (function (e) { onDragLeave(e); events.onDragLeave(_this.draggingToRowDragEvent(Events.EVENT_ROW_DRAG_LEAVE, e)); }) : onDragLeave, onDragging: events.onDragging ? (function (e) { onDragging(e); events.onDragging(_this.draggingToRowDragEvent(Events.EVENT_ROW_DRAG_MOVE, e)); }) : onDragging, onDragStop: events.onDragStop ? (function (e) { onDragStop(e); events.onDragStop(_this.draggingToRowDragEvent(Events.EVENT_ROW_DRAG_END, e)); }) : onDragStop, fromGrid: true /* @private */ }; }; RowDragFeature.prototype.draggingToRowDragEvent = function (type, draggingEvent) { var yNormalised = this.mouseEventService.getNormalisedPosition(draggingEvent).y; var mouseIsPastLastRow = yNormalised > this.paginationProxy.getCurrentPageHeight(); var overIndex = -1; var overNode; if (!mouseIsPastLastRow) { overIndex = this.rowModel.getRowIndexAtPixel(yNormalised); overNode = this.rowModel.getRow(overIndex); } var vDirectionString; switch (draggingEvent.vDirection) { case exports.VerticalDirection.Down: vDirectionString = 'down'; break; case exports.VerticalDirection.Up: vDirectionString = 'up'; break; default: vDirectionString = null; break; } var event = { type: type, api: this.gridOptionsService.api, columnApi: this.gridOptionsService.columnApi, context: this.gridOptionsService.context, event: draggingEvent.event, node: draggingEvent.dragItem.rowNode, nodes: draggingEvent.dragItem.rowNodes, overIndex: overIndex, overNode: overNode, y: yNormalised, vDirection: vDirectionString }; return event; }; RowDragFeature.prototype.dispatchGridEvent = function (type, draggingEvent) { var event = this.draggingToRowDragEvent(type, draggingEvent); this.eventService.dispatchEvent(event); }; RowDragFeature.prototype.onDragLeave = function (draggingEvent) { this.dispatchGridEvent(Events.EVENT_ROW_DRAG_LEAVE, draggingEvent); this.stopDragging(draggingEvent); if (this.gridOptionsService.is('rowDragManaged')) { this.clearRowHighlight(); } if (this.isFromThisGrid(draggingEvent)) { this.isMultiRowDrag = false; } }; RowDragFeature.prototype.onDragStop = function (draggingEvent) { this.dispatchGridEvent(Events.EVENT_ROW_DRAG_END, draggingEvent); this.stopDragging(draggingEvent); if (this.gridOptionsService.is('rowDragManaged') && (this.gridOptionsService.is('suppressMoveWhenRowDragging') || !this.isFromThisGrid(draggingEvent)) && !this.isDropZoneWithinThisGrid(draggingEvent)) { this.moveRowAndClearHighlight(draggingEvent); } }; RowDragFeature.prototype.stopDragging = function (draggingEvent) { this.autoScrollService.ensureCleared(); this.getRowNodes(draggingEvent).forEach(function (rowNode) { rowNode.setDragging(false); }); }; __decorate$N([ Autowired('dragAndDropService') ], RowDragFeature.prototype, "dragAndDropService", void 0); __decorate$N([ Autowired('rowModel') ], RowDragFeature.prototype, "rowModel", void 0); __decorate$N([ Autowired('paginationProxy') ], RowDragFeature.prototype, "paginationProxy", void 0); __decorate$N([ Autowired('columnModel') ], RowDragFeature.prototype, "columnModel", void 0); __decorate$N([ Autowired('focusService') ], RowDragFeature.prototype, "focusService", void 0); __decorate$N([ Autowired('sortController') ], RowDragFeature.prototype, "sortController", void 0); __decorate$N([ Autowired('filterManager') ], RowDragFeature.prototype, "filterManager", void 0); __decorate$N([ Autowired('selectionService') ], RowDragFeature.prototype, "selectionService", void 0); __decorate$N([ Autowired('mouseEventService') ], RowDragFeature.prototype, "mouseEventService", void 0); __decorate$N([ Autowired('ctrlsService') ], RowDragFeature.prototype, "ctrlsService", void 0); __decorate$N([ Optional('rangeService') ], RowDragFeature.prototype, "rangeService", void 0); __decorate$N([ PostConstruct ], RowDragFeature.prototype, "postConstruct", null); return RowDragFeature; }(BeanStub)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$Y = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __decorate$O = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; (function (RowAnimationCssClasses) { RowAnimationCssClasses["ANIMATION_ON"] = "ag-row-animation"; RowAnimationCssClasses["ANIMATION_OFF"] = "ag-row-no-animation"; })(exports.RowAnimationCssClasses || (exports.RowAnimationCssClasses = {})); var CSS_CLASS_CELL_SELECTABLE = 'ag-selectable'; var CSS_CLASS_FORCE_VERTICAL_SCROLL = 'ag-force-vertical-scroll'; var CSS_CLASS_COLUMN_MOVING = 'ag-column-moving'; var GridBodyCtrl = /** @class */ (function (_super) { __extends$Y(GridBodyCtrl, _super); function GridBodyCtrl() { var _this = _super !== null && _super.apply(this, arguments) || this; _this.stickyTopHeight = 0; return _this; } GridBodyCtrl.prototype.getScrollFeature = function () { return this.bodyScrollFeature; }; GridBodyCtrl.prototype.getBodyViewportElement = function () { return this.eBodyViewport; }; GridBodyCtrl.prototype.setComp = function (comp, eGridBody, eBodyViewport, eTop, eBottom, eStickyTop) { this.comp = comp; this.eGridBody = eGridBody; this.eBodyViewport = eBodyViewport; this.eTop = eTop; this.eBottom = eBottom; this.eStickyTop = eStickyTop; this.setCellTextSelection(this.gridOptionsService.is('enableCellTextSelection')); this.createManagedBean(new LayoutFeature(this.comp)); this.bodyScrollFeature = this.createManagedBean(new GridBodyScrollFeature(this.eBodyViewport)); this.addRowDragListener(); this.setupRowAnimationCssClass(); this.addEventListeners(); this.addFocusListeners([eTop, eBodyViewport, eBottom, eStickyTop]); this.onGridColumnsChanged(); this.addBodyViewportListener(); this.setFloatingHeights(); this.disableBrowserDragging(); this.addStopEditingWhenGridLosesFocus(); this.ctrlsService.registerGridBodyCtrl(this); }; GridBodyCtrl.prototype.getComp = function () { return this.comp; }; GridBodyCtrl.prototype.addEventListeners = function () { this.addManagedListener(this.eventService, Events.EVENT_GRID_COLUMNS_CHANGED, this.onGridColumnsChanged.bind(this)); this.addManagedListener(this.eventService, Events.EVENT_SCROLL_VISIBILITY_CHANGED, this.onScrollVisibilityChanged.bind(this)); this.addManagedListener(this.eventService, Events.EVENT_PINNED_ROW_DATA_CHANGED, this.onPinnedRowDataChanged.bind(this)); this.addManagedListener(this.eventService, Events.EVENT_HEADER_HEIGHT_CHANGED, this.onHeaderHeightChanged.bind(this)); }; GridBodyCtrl.prototype.addFocusListeners = function (elements) { var _this = this; elements.forEach(function (element) { _this.addManagedListener(element, 'focusin', function (e) { var target = e.target; // element being focused is nested? var isFocusedElementNested = isElementChildOfClass(target, 'ag-root', element); element.classList.toggle('ag-has-focus', !isFocusedElementNested); }); _this.addManagedListener(element, 'focusout', function (e) { var target = e.target, relatedTarget = e.relatedTarget; var gridContainRelatedTarget = element.contains(relatedTarget); var isNestedRelatedTarget = isElementChildOfClass(relatedTarget, 'ag-root', element); var isNestedTarget = isElementChildOfClass(target, 'ag-root', element); // element losing focus belongs to a nested grid, // it should not be handled here. if (isNestedTarget) { return; } // the grid does not contain, or the focus element is within // a nested grid if (!gridContainRelatedTarget || isNestedRelatedTarget) { element.classList.remove('ag-has-focus'); } }); }); }; // used by ColumnAnimationService GridBodyCtrl.prototype.setColumnMovingCss = function (moving) { this.comp.setColumnMovingCss(CSS_CLASS_COLUMN_MOVING, moving); }; GridBodyCtrl.prototype.setCellTextSelection = function (selectable) { if (selectable === void 0) { selectable = false; } var cssClass = selectable ? CSS_CLASS_CELL_SELECTABLE : null; this.comp.setCellSelectableCss(cssClass, selectable); }; GridBodyCtrl.prototype.onScrollVisibilityChanged = function () { var visible = this.scrollVisibleService.isVerticalScrollShowing(); this.setVerticalScrollPaddingVisible(visible); this.setStickyTopWidth(visible); var scrollbarWidth = visible ? (this.gridOptionsService.getScrollbarWidth() || 0) : 0; var pad = isInvisibleScrollbar() ? 16 : 0; var width = "calc(100% + " + (scrollbarWidth + pad) + "px)"; this.comp.setBodyViewportWidth(width); }; GridBodyCtrl.prototype.onGridColumnsChanged = function () { var columns = this.columnModel.getAllGridColumns(); this.comp.setColumnCount(columns ? columns.length : 0); }; // if we do not do this, then the user can select a pic in the grid (eg an image in a custom cell renderer) // and then that will start the browser native drag n' drop, which messes up with our own drag and drop. GridBodyCtrl.prototype.disableBrowserDragging = function () { this.addManagedListener(this.eGridBody, 'dragstart', function (event) { if (event.target instanceof HTMLImageElement) { event.preventDefault(); return false; } }); }; GridBodyCtrl.prototype.addStopEditingWhenGridLosesFocus = function () { var _this = this; if (!this.gridOptionsService.is('stopEditingWhenCellsLoseFocus')) { return; } var focusOutListener = function (event) { // this is the element the focus is moving to var elementWithFocus = event.relatedTarget; if (getTabIndex(elementWithFocus) === null) { _this.rowRenderer.stopEditing(); return; } var clickInsideGrid = // see if click came from inside the viewports viewports.some(function (viewport) { return viewport.contains(elementWithFocus); }) // and also that it's not from a detail grid && _this.mouseEventService.isElementInThisGrid(elementWithFocus); if (!clickInsideGrid) { var popupService = _this.popupService; clickInsideGrid = popupService.getActivePopups().some(function (popup) { return popup.contains(elementWithFocus); }) || popupService.isElementWithinCustomPopup(elementWithFocus); } if (!clickInsideGrid) { _this.rowRenderer.stopEditing(); } }; var viewports = [this.eBodyViewport, this.eBottom, this.eTop, this.eStickyTop]; viewports.forEach(function (viewport) { return _this.addManagedListener(viewport, 'focusout', focusOutListener); }); }; GridBodyCtrl.prototype.updateRowCount = function () { var headerCount = this.headerNavigationService.getHeaderRowCount(); var rowCount = this.rowModel.isLastRowIndexKnown() ? this.rowModel.getRowCount() : -1; var total = rowCount === -1 ? -1 : (headerCount + rowCount); this.comp.setRowCount(total); }; GridBodyCtrl.prototype.registerBodyViewportResizeListener = function (listener) { this.comp.registerBodyViewportResizeListener(listener); }; GridBodyCtrl.prototype.setVerticalScrollPaddingVisible = function (visible) { var overflowY = visible ? 'scroll' : 'hidden'; this.comp.setPinnedTopBottomOverflowY(overflowY); }; GridBodyCtrl.prototype.isVerticalScrollShowing = function () { var show = this.gridOptionsService.is('alwaysShowVerticalScroll'); var cssClass = show ? CSS_CLASS_FORCE_VERTICAL_SCROLL : null; var allowVerticalScroll = this.gridOptionsService.isDomLayout('normal'); this.comp.setAlwaysVerticalScrollClass(cssClass, show); return show || (allowVerticalScroll && isVerticalScrollShowing(this.eBodyViewport)); }; GridBodyCtrl.prototype.setupRowAnimationCssClass = function () { var _this = this; var listener = function () { // we don't want to use row animation if scaling, as rows jump strangely as you scroll, // when scaling and doing row animation. var animateRows = _this.gridOptionsService.isAnimateRows() && !_this.rowContainerHeightService.isStretching(); var animateRowsCssClass = animateRows ? exports.RowAnimationCssClasses.ANIMATION_ON : exports.RowAnimationCssClasses.ANIMATION_OFF; _this.comp.setRowAnimationCssOnBodyViewport(animateRowsCssClass, animateRows); }; listener(); this.addManagedListener(this.eventService, Events.EVENT_HEIGHT_SCALE_CHANGED, listener); this.addManagedPropertyListener('animateRows', listener); }; GridBodyCtrl.prototype.getGridBodyElement = function () { return this.eGridBody; }; GridBodyCtrl.prototype.addBodyViewportListener = function () { var _this = this; // we want to listen for clicks directly on the eBodyViewport, so the user has a way of showing // the context menu if no rows or columns are displayed, or user simply clicks outside of a cell var listener = function (mouseEvent, touch, touchEvent) { if (!mouseEvent && !touchEvent) { return; } if (_this.gridOptionsService.is('preventDefaultOnContextMenu')) { var event_1 = (mouseEvent || touchEvent); event_1.preventDefault(); } var target = (mouseEvent || touch).target; if (target === _this.eBodyViewport || target === _this.ctrlsService.getCenterRowContainerCtrl().getViewportElement()) { // show it if (_this.contextMenuFactory) { if (mouseEvent) { _this.contextMenuFactory.onContextMenu(mouseEvent, null, null, null, null, _this.eGridBody); } else if (touchEvent) { _this.contextMenuFactory.onContextMenu(null, touchEvent, null, null, null, _this.eGridBody); } } } }; this.addManagedListener(this.eBodyViewport, 'contextmenu', listener); this.mockContextMenuForIPad(listener); this.addManagedListener(this.eBodyViewport, 'wheel', this.onBodyViewportWheel.bind(this)); this.addManagedListener(this.eStickyTop, 'wheel', this.onStickyTopWheel.bind(this)); }; GridBodyCtrl.prototype.mockContextMenuForIPad = function (listener) { // we do NOT want this when not in iPad if (!isIOSUserAgent()) { return; } var touchListener = new TouchListener(this.eBodyViewport); var longTapListener = function (event) { listener(undefined, event.touchStart, event.touchEvent); }; this.addManagedListener(touchListener, TouchListener.EVENT_LONG_TAP, longTapListener); this.addDestroyFunc(function () { return touchListener.destroy(); }); }; GridBodyCtrl.prototype.onBodyViewportWheel = function (e) { if (!this.gridOptionsService.is('suppressScrollWhenPopupsAreOpen')) { return; } if (this.popupService.hasAnchoredPopup()) { e.preventDefault(); } }; GridBodyCtrl.prototype.onStickyTopWheel = function (e) { e.preventDefault(); if (e.offsetY) { this.scrollVertically(e.deltaY); } }; GridBodyCtrl.prototype.getGui = function () { return this.eGridBody; }; // called by rowDragFeature GridBodyCtrl.prototype.scrollVertically = function (pixels) { var oldScrollPosition = this.eBodyViewport.scrollTop; this.bodyScrollFeature.setVerticalScrollPosition(oldScrollPosition + pixels); return this.eBodyViewport.scrollTop - oldScrollPosition; }; GridBodyCtrl.prototype.addRowDragListener = function () { this.rowDragFeature = this.createManagedBean(new RowDragFeature(this.eBodyViewport)); this.dragAndDropService.addDropTarget(this.rowDragFeature); }; GridBodyCtrl.prototype.getRowDragFeature = function () { return this.rowDragFeature; }; GridBodyCtrl.prototype.onPinnedRowDataChanged = function () { this.setFloatingHeights(); }; GridBodyCtrl.prototype.setFloatingHeights = function () { var pinnedRowModel = this.pinnedRowModel; var floatingTopHeight = pinnedRowModel.getPinnedTopTotalHeight(); if (floatingTopHeight) { // adding 1px for cell bottom border floatingTopHeight += 1; } var floatingBottomHeight = pinnedRowModel.getPinnedBottomTotalHeight(); if (floatingBottomHeight) { // adding 1px for cell bottom border floatingBottomHeight += 1; } this.comp.setTopHeight(floatingTopHeight); this.comp.setBottomHeight(floatingBottomHeight); this.comp.setTopDisplay(floatingTopHeight ? 'inherit' : 'none'); this.comp.setBottomDisplay(floatingBottomHeight ? 'inherit' : 'none'); this.setStickyTopOffsetTop(); }; GridBodyCtrl.prototype.setStickyTopHeight = function (height) { if (height === void 0) { height = 0; } // console.log('setting sticky top height ' + height); this.comp.setStickyTopHeight(height + "px"); this.stickyTopHeight = height; }; GridBodyCtrl.prototype.getStickyTopHeight = function () { return this.stickyTopHeight; }; GridBodyCtrl.prototype.setStickyTopWidth = function (vScrollVisible) { if (!vScrollVisible) { this.comp.setStickyTopWidth('100%'); } else { var scrollbarWidth = this.gridOptionsService.getScrollbarWidth(); this.comp.setStickyTopWidth("calc(100% - " + scrollbarWidth + "px)"); } }; GridBodyCtrl.prototype.onHeaderHeightChanged = function () { this.setStickyTopOffsetTop(); }; GridBodyCtrl.prototype.setStickyTopOffsetTop = function () { var headerCtrl = this.ctrlsService.getGridHeaderCtrl(); var headerHeight = headerCtrl.getHeaderHeight(); var pinnedTopHeight = this.pinnedRowModel.getPinnedTopTotalHeight(); var height = 0; if (headerHeight > 0) { height += headerHeight + 1; } if (pinnedTopHeight > 0) { height += pinnedTopHeight + 1; } this.comp.setStickyTopTop(height + "px"); }; // method will call itself if no available width. this covers if the grid // isn't visible, but is just about to be visible. GridBodyCtrl.prototype.sizeColumnsToFit = function (params, nextTimeout) { var _this = this; var removeScrollWidth = this.isVerticalScrollShowing(); var scrollWidthToRemove = removeScrollWidth ? this.gridOptionsService.getScrollbarWidth() : 0; // bodyViewportWidth should be calculated from eGridBody, not eBodyViewport // because we change the width of the bodyViewport to hide the real browser scrollbar var bodyViewportWidth = getInnerWidth(this.eGridBody); var availableWidth = bodyViewportWidth - scrollWidthToRemove; if (availableWidth > 0) { this.columnModel.sizeColumnsToFit(availableWidth, "sizeColumnsToFit", false, params); return; } if (nextTimeout === undefined) { window.setTimeout(function () { _this.sizeColumnsToFit(params, 100); }, 0); } else if (nextTimeout === 100) { window.setTimeout(function () { _this.sizeColumnsToFit(params, 500); }, 100); } else if (nextTimeout === 500) { window.setTimeout(function () { _this.sizeColumnsToFit(params, -1); }, 500); } else { console.warn('AG Grid: tried to call sizeColumnsToFit() but the grid is coming back with ' + 'zero width, maybe the grid is not visible yet on the screen?'); } }; // + rangeService GridBodyCtrl.prototype.addScrollEventListener = function (listener) { this.eBodyViewport.addEventListener('scroll', listener, { passive: true }); }; // + focusService GridBodyCtrl.prototype.removeScrollEventListener = function (listener) { this.eBodyViewport.removeEventListener('scroll', listener); }; __decorate$O([ Autowired('rowContainerHeightService') ], GridBodyCtrl.prototype, "rowContainerHeightService", void 0); __decorate$O([ Autowired('ctrlsService') ], GridBodyCtrl.prototype, "ctrlsService", void 0); __decorate$O([ Autowired('columnModel') ], GridBodyCtrl.prototype, "columnModel", void 0); __decorate$O([ Autowired('scrollVisibleService') ], GridBodyCtrl.prototype, "scrollVisibleService", void 0); __decorate$O([ Optional('contextMenuFactory') ], GridBodyCtrl.prototype, "contextMenuFactory", void 0); __decorate$O([ Autowired('headerNavigationService') ], GridBodyCtrl.prototype, "headerNavigationService", void 0); __decorate$O([ Autowired('dragAndDropService') ], GridBodyCtrl.prototype, "dragAndDropService", void 0); __decorate$O([ Autowired('pinnedRowModel') ], GridBodyCtrl.prototype, "pinnedRowModel", void 0); __decorate$O([ Autowired('rowRenderer') ], GridBodyCtrl.prototype, "rowRenderer", void 0); __decorate$O([ Autowired('popupService') ], GridBodyCtrl.prototype, "popupService", void 0); __decorate$O([ Autowired('mouseEventService') ], GridBodyCtrl.prototype, "mouseEventService", void 0); __decorate$O([ Autowired('rowModel') ], GridBodyCtrl.prototype, "rowModel", void 0); return GridBodyCtrl; }(BeanStub)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ (function (SelectionHandleType) { SelectionHandleType[SelectionHandleType["FILL"] = 0] = "FILL"; SelectionHandleType[SelectionHandleType["RANGE"] = 1] = "RANGE"; })(exports.SelectionHandleType || (exports.SelectionHandleType = {})); (function (CellRangeType) { CellRangeType[CellRangeType["VALUE"] = 0] = "VALUE"; CellRangeType[CellRangeType["DIMENSION"] = 1] = "DIMENSION"; })(exports.CellRangeType || (exports.CellRangeType = {})); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var CSS_CELL_RANGE_SELECTED = 'ag-cell-range-selected'; var CSS_CELL_RANGE_CHART = 'ag-cell-range-chart'; var CSS_CELL_RANGE_SINGLE_CELL = 'ag-cell-range-single-cell'; var CSS_CELL_RANGE_CHART_CATEGORY = 'ag-cell-range-chart-category'; var CSS_CELL_RANGE_HANDLE = 'ag-cell-range-handle'; var CSS_CELL_RANGE_TOP = 'ag-cell-range-top'; var CSS_CELL_RANGE_RIGHT = 'ag-cell-range-right'; var CSS_CELL_RANGE_BOTTOM = 'ag-cell-range-bottom'; var CSS_CELL_RANGE_LEFT = 'ag-cell-range-left'; var CellRangeFeature = /** @class */ (function () { function CellRangeFeature(beans, ctrl) { this.beans = beans; this.cellCtrl = ctrl; } CellRangeFeature.prototype.setComp = function (cellComp, eGui) { this.cellComp = cellComp; this.eGui = eGui; this.onRangeSelectionChanged(); }; CellRangeFeature.prototype.onRangeSelectionChanged = function () { // when using reactUi, given UI is async, it's possible this method is called before the comp is registered if (!this.cellComp) { return; } this.rangeCount = this.beans.rangeService.getCellRangeCount(this.cellCtrl.getCellPosition()); this.hasChartRange = this.getHasChartRange(); this.cellComp.addOrRemoveCssClass(CSS_CELL_RANGE_SELECTED, this.rangeCount !== 0); this.cellComp.addOrRemoveCssClass(CSS_CELL_RANGE_SELECTED + "-1", this.rangeCount === 1); this.cellComp.addOrRemoveCssClass(CSS_CELL_RANGE_SELECTED + "-2", this.rangeCount === 2); this.cellComp.addOrRemoveCssClass(CSS_CELL_RANGE_SELECTED + "-3", this.rangeCount === 3); this.cellComp.addOrRemoveCssClass(CSS_CELL_RANGE_SELECTED + "-4", this.rangeCount >= 4); this.cellComp.addOrRemoveCssClass(CSS_CELL_RANGE_CHART, this.hasChartRange); setAriaSelected(this.eGui, this.rangeCount > 0 ? true : undefined); this.cellComp.addOrRemoveCssClass(CSS_CELL_RANGE_SINGLE_CELL, this.isSingleCell()); this.updateRangeBorders(); this.refreshHandle(); }; CellRangeFeature.prototype.updateRangeBorders = function () { var rangeBorders = this.getRangeBorders(); var isSingleCell = this.isSingleCell(); var isTop = !isSingleCell && rangeBorders.top; var isRight = !isSingleCell && rangeBorders.right; var isBottom = !isSingleCell && rangeBorders.bottom; var isLeft = !isSingleCell && rangeBorders.left; this.cellComp.addOrRemoveCssClass(CSS_CELL_RANGE_TOP, isTop); this.cellComp.addOrRemoveCssClass(CSS_CELL_RANGE_RIGHT, isRight); this.cellComp.addOrRemoveCssClass(CSS_CELL_RANGE_BOTTOM, isBottom); this.cellComp.addOrRemoveCssClass(CSS_CELL_RANGE_LEFT, isLeft); }; CellRangeFeature.prototype.isSingleCell = function () { var rangeService = this.beans.rangeService; return this.rangeCount === 1 && rangeService && !rangeService.isMoreThanOneCell(); }; CellRangeFeature.prototype.getHasChartRange = function () { var rangeService = this.beans.rangeService; if (!this.rangeCount || !rangeService) { return false; } var cellRanges = rangeService.getCellRanges(); return cellRanges.length > 0 && cellRanges.every(function (range) { return includes([exports.CellRangeType.DIMENSION, exports.CellRangeType.VALUE], range.type); }); }; CellRangeFeature.prototype.updateRangeBordersIfRangeCount = function () { // we only need to update range borders if we are in a range if (this.rangeCount > 0) { this.updateRangeBorders(); this.refreshHandle(); } }; CellRangeFeature.prototype.getRangeBorders = function () { var _this = this; var isRtl = this.beans.gridOptionsService.is('enableRtl'); var top = false; var right = false; var bottom = false; var left = false; var thisCol = this.cellCtrl.getCellPosition().column; var _a = this.beans, rangeService = _a.rangeService, columnModel = _a.columnModel; var leftCol; var rightCol; if (isRtl) { leftCol = columnModel.getDisplayedColAfter(thisCol); rightCol = columnModel.getDisplayedColBefore(thisCol); } else { leftCol = columnModel.getDisplayedColBefore(thisCol); rightCol = columnModel.getDisplayedColAfter(thisCol); } var ranges = rangeService.getCellRanges().filter(function (range) { return rangeService.isCellInSpecificRange(_this.cellCtrl.getCellPosition(), range); }); // this means we are the first column in the grid if (!leftCol) { left = true; } // this means we are the last column in the grid if (!rightCol) { right = true; } for (var i = 0; i < ranges.length; i++) { if (top && right && bottom && left) { break; } var range = ranges[i]; var startRow = rangeService.getRangeStartRow(range); var endRow = rangeService.getRangeEndRow(range); if (!top && this.beans.rowPositionUtils.sameRow(startRow, this.cellCtrl.getCellPosition())) { top = true; } if (!bottom && this.beans.rowPositionUtils.sameRow(endRow, this.cellCtrl.getCellPosition())) { bottom = true; } if (!left && leftCol && range.columns.indexOf(leftCol) < 0) { left = true; } if (!right && rightCol && range.columns.indexOf(rightCol) < 0) { right = true; } } return { top: top, right: right, bottom: bottom, left: left }; }; CellRangeFeature.prototype.refreshHandle = function () { if (!this.beans.rangeService) { return; } var shouldHaveSelectionHandle = this.shouldHaveSelectionHandle(); if (this.selectionHandle && !shouldHaveSelectionHandle) { this.selectionHandle = this.beans.context.destroyBean(this.selectionHandle); } if (shouldHaveSelectionHandle) { this.addSelectionHandle(); } this.cellComp.addOrRemoveCssClass(CSS_CELL_RANGE_HANDLE, !!this.selectionHandle); }; CellRangeFeature.prototype.shouldHaveSelectionHandle = function () { var _a = this.beans, gridOptionsService = _a.gridOptionsService, rangeService = _a.rangeService; var cellRanges = rangeService.getCellRanges(); var rangesLen = cellRanges.length; if (this.rangeCount < 1 || rangesLen < 1) { return false; } var cellRange = last(cellRanges); var cellPosition = this.cellCtrl.getCellPosition(); var isFillHandleAvailable = gridOptionsService.is('enableFillHandle') && !this.cellCtrl.isSuppressFillHandle(); var isRangeHandleAvailable = gridOptionsService.is('enableRangeHandle'); var handleIsAvailable = rangesLen === 1 && !this.cellCtrl.isEditing() && (isFillHandleAvailable || isRangeHandleAvailable); if (this.hasChartRange) { var hasCategoryRange = cellRanges[0].type === exports.CellRangeType.DIMENSION; var isCategoryCell = hasCategoryRange && rangeService.isCellInSpecificRange(cellPosition, cellRanges[0]); this.cellComp.addOrRemoveCssClass(CSS_CELL_RANGE_CHART_CATEGORY, isCategoryCell); handleIsAvailable = cellRange.type === exports.CellRangeType.VALUE; } return handleIsAvailable && cellRange.endRow != null && rangeService.isContiguousRange(cellRange) && rangeService.isBottomRightCell(cellRange, cellPosition); }; CellRangeFeature.prototype.addSelectionHandle = function () { var _a = this.beans, gridOptionsService = _a.gridOptionsService, rangeService = _a.rangeService; var cellRangeType = last(rangeService.getCellRanges()).type; var selectionHandleFill = gridOptionsService.is('enableFillHandle') && missing(cellRangeType); var type = selectionHandleFill ? exports.SelectionHandleType.FILL : exports.SelectionHandleType.RANGE; if (this.selectionHandle && this.selectionHandle.getType() !== type) { this.selectionHandle = this.beans.context.destroyBean(this.selectionHandle); } if (!this.selectionHandle) { this.selectionHandle = this.beans.selectionHandleFactory.createSelectionHandle(type); } this.selectionHandle.refresh(this.cellCtrl); }; CellRangeFeature.prototype.destroy = function () { this.beans.context.destroyBean(this.selectionHandle); }; return CellRangeFeature; }()); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$Z = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); /** * Takes care of: * #) Cell Width (including when doing cell spanning, which makes width cover many columns) * #) Cell Height (when doing row span, otherwise we don't touch the height as it's just row height) * #) Cell Left (the horizontal positioning of the cell, the vertical positioning is on the row) */ var CellPositionFeature = /** @class */ (function (_super) { __extends$Z(CellPositionFeature, _super); function CellPositionFeature(ctrl, beans) { var _this = _super.call(this) || this; _this.cellCtrl = ctrl; _this.beans = beans; _this.column = ctrl.getColumn(); _this.rowNode = ctrl.getRowNode(); _this.setupColSpan(); _this.setupRowSpan(); return _this; } CellPositionFeature.prototype.setupRowSpan = function () { this.rowSpan = this.column.getRowSpan(this.rowNode); }; CellPositionFeature.prototype.setComp = function (eGui) { this.eGui = eGui; this.onLeftChanged(); this.onWidthChanged(); this.applyRowSpan(); }; CellPositionFeature.prototype.onDisplayColumnsChanged = function () { var colsSpanning = this.getColSpanningList(); if (!areEqual(this.colsSpanning, colsSpanning)) { this.colsSpanning = colsSpanning; this.onWidthChanged(); this.onLeftChanged(); // left changes when doing RTL } }; CellPositionFeature.prototype.setupColSpan = function () { // if no col span is active, then we don't set it up, as it would be wasteful of CPU if (this.column.getColDef().colSpan == null) { return; } this.colsSpanning = this.getColSpanningList(); // because we are col spanning, a reorder of the cols can change what cols we are spanning over this.addManagedListener(this.beans.eventService, Events.EVENT_DISPLAYED_COLUMNS_CHANGED, this.onDisplayColumnsChanged.bind(this)); // because we are spanning over multiple cols, we check for width any time any cols width changes. // this is expensive - really we should be explicitly checking only the cols we are spanning over // instead of every col, however it would be tricky code to track the cols we are spanning over, so // because hardly anyone will be using colSpan, am favouring this easier way for more maintainable code. this.addManagedListener(this.beans.eventService, Events.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED, this.onWidthChanged.bind(this)); }; CellPositionFeature.prototype.onWidthChanged = function () { if (!this.eGui) { return; } var width = this.getCellWidth(); this.eGui.style.width = width + "px"; }; CellPositionFeature.prototype.getCellWidth = function () { if (!this.colsSpanning) { return this.column.getActualWidth(); } return this.colsSpanning.reduce(function (width, col) { return width + col.getActualWidth(); }, 0); }; CellPositionFeature.prototype.getColSpanningList = function () { var colSpan = this.column.getColSpan(this.rowNode); var colsSpanning = []; // if just one col, the col span is just the column we are in if (colSpan === 1) { colsSpanning.push(this.column); } else { var pointer = this.column; var pinned = this.column.getPinned(); for (var i = 0; pointer && i < colSpan; i++) { colsSpanning.push(pointer); pointer = this.beans.columnModel.getDisplayedColAfter(pointer); if (!pointer || missing(pointer)) { break; } // we do not allow col spanning to span outside of pinned areas if (pinned !== pointer.getPinned()) { break; } } } return colsSpanning; }; CellPositionFeature.prototype.onLeftChanged = function () { if (!this.eGui) { return; } var left = this.modifyLeftForPrintLayout(this.getCellLeft()); this.eGui.style.left = left + 'px'; }; CellPositionFeature.prototype.getCellLeft = function () { var mostLeftCol; if (this.beans.gridOptionsService.is('enableRtl') && this.colsSpanning) { mostLeftCol = last(this.colsSpanning); } else { mostLeftCol = this.column; } return mostLeftCol.getLeft(); }; CellPositionFeature.prototype.modifyLeftForPrintLayout = function (leftPosition) { if (!this.cellCtrl.isPrintLayout() || this.column.getPinned() === 'left') { return leftPosition; } var leftWidth = this.beans.columnModel.getDisplayedColumnsLeftWidth(); if (this.column.getPinned() === 'right') { var bodyWidth = this.beans.columnModel.getBodyContainerWidth(); return leftWidth + bodyWidth + (leftPosition || 0); } // is in body return leftWidth + (leftPosition || 0); }; CellPositionFeature.prototype.applyRowSpan = function () { if (this.rowSpan === 1) { return; } var singleRowHeight = this.beans.gridOptionsService.getRowHeightAsNumber(); var totalRowHeight = singleRowHeight * this.rowSpan; this.eGui.style.height = totalRowHeight + "px"; this.eGui.style.zIndex = '1'; }; // overriding to make public, as we don't dispose this bean via context CellPositionFeature.prototype.destroy = function () { _super.prototype.destroy.call(this); }; return CellPositionFeature; }(BeanStub)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$_ = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var CellCustomStyleFeature = /** @class */ (function (_super) { __extends$_(CellCustomStyleFeature, _super); function CellCustomStyleFeature(ctrl, beans) { var _this = _super.call(this) || this; _this.staticClasses = []; _this.cellCtrl = ctrl; _this.beans = beans; _this.column = ctrl.getColumn(); _this.rowNode = ctrl.getRowNode(); return _this; } CellCustomStyleFeature.prototype.setComp = function (comp) { this.cellComp = comp; this.applyUserStyles(); this.applyCellClassRules(); this.applyClassesFromColDef(); }; CellCustomStyleFeature.prototype.applyCellClassRules = function () { var _this = this; var colDef = this.column.getColDef(); var cellClassParams = { value: this.cellCtrl.getValue(), data: this.rowNode.data, node: this.rowNode, colDef: colDef, column: this.column, rowIndex: this.rowNode.rowIndex, api: this.beans.gridOptionsService.api, columnApi: this.beans.gridOptionsService.columnApi, context: this.beans.gridOptionsService.context }; this.beans.stylingService.processClassRules(colDef.cellClassRules, cellClassParams, function (className) { return _this.cellComp.addOrRemoveCssClass(className, true); }, function (className) { return _this.cellComp.addOrRemoveCssClass(className, false); }); }; CellCustomStyleFeature.prototype.applyUserStyles = function () { var colDef = this.column.getColDef(); if (!colDef.cellStyle) { return; } var styles; if (typeof colDef.cellStyle === 'function') { var cellStyleParams = { column: this.column, value: this.cellCtrl.getValue(), colDef: colDef, data: this.rowNode.data, node: this.rowNode, rowIndex: this.rowNode.rowIndex, api: this.beans.gridOptionsService.api, columnApi: this.beans.gridOptionsService.columnApi, context: this.beans.gridOptionsService.context, }; var cellStyleFunc = colDef.cellStyle; styles = cellStyleFunc(cellStyleParams); } else { styles = colDef.cellStyle; } if (styles) { this.cellComp.setUserStyles(styles); } }; CellCustomStyleFeature.prototype.applyClassesFromColDef = function () { var _this = this; var colDef = this.column.getColDef(); var cellClassParams = { value: this.cellCtrl.getValue(), data: this.rowNode.data, node: this.rowNode, column: this.column, colDef: colDef, rowIndex: this.rowNode.rowIndex, api: this.beans.gridOptionsService.api, columnApi: this.beans.gridOptionsService.columnApi, context: this.beans.gridOptionsService.context }; if (this.staticClasses.length) { this.staticClasses.forEach(function (className) { return _this.cellComp.addOrRemoveCssClass(className, false); }); } this.staticClasses = this.beans.stylingService.getStaticCellClasses(colDef, cellClassParams); if (this.staticClasses.length) { this.staticClasses.forEach(function (className) { return _this.cellComp.addOrRemoveCssClass(className, true); }); } }; // overriding to make public, as we don't dispose this bean via context CellCustomStyleFeature.prototype.destroy = function () { _super.prototype.destroy.call(this); }; return CellCustomStyleFeature; }(BeanStub)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$$ = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var TooltipFeature = /** @class */ (function (_super) { __extends$$(TooltipFeature, _super); function TooltipFeature(ctrl, beans) { var _this = _super.call(this) || this; _this.ctrl = ctrl; _this.beans = beans; return _this; } TooltipFeature.prototype.setComp = function (comp) { this.comp = comp; this.setupTooltip(); }; TooltipFeature.prototype.setupTooltip = function () { this.browserTooltips = this.beans.gridOptionsService.is('enableBrowserTooltips'); this.updateTooltipText(); if (this.browserTooltips) { this.comp.setTitle(this.tooltip != null ? this.tooltip : undefined); } else { this.createTooltipFeatureIfNeeded(); } }; TooltipFeature.prototype.updateTooltipText = function () { this.tooltip = this.ctrl.getTooltipValue(); }; TooltipFeature.prototype.createTooltipFeatureIfNeeded = function () { var _this = this; if (this.genericTooltipFeature != null) { return; } var parent = { getTooltipParams: function () { return _this.getTooltipParams(); }, getGui: function () { return _this.ctrl.getGui(); } }; this.genericTooltipFeature = this.createManagedBean(new CustomTooltipFeature(parent), this.beans.context); }; TooltipFeature.prototype.refreshToolTip = function () { this.updateTooltipText(); if (this.browserTooltips) { this.comp.setTitle(this.tooltip != null ? this.tooltip : undefined); } }; TooltipFeature.prototype.getTooltipParams = function () { var ctrl = this.ctrl; var column = ctrl.getColumn ? ctrl.getColumn() : undefined; var colDef = ctrl.getColDef ? ctrl.getColDef() : undefined; var rowNode = ctrl.getRowNode ? ctrl.getRowNode() : undefined; return { location: ctrl.getLocation(), colDef: colDef, column: column, rowIndex: ctrl.getRowIndex ? ctrl.getRowIndex() : undefined, node: rowNode, data: rowNode ? rowNode.data : undefined, value: this.getTooltipText(), valueFormatted: ctrl.getValueFormatted ? ctrl.getValueFormatted() : undefined, }; }; TooltipFeature.prototype.getTooltipText = function () { return this.tooltip; }; // overriding to make public, as we don't dispose this bean via context TooltipFeature.prototype.destroy = function () { _super.prototype.destroy.call(this); }; return TooltipFeature; }(BeanStub)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __decorate$P = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; /** Using the IoC has a slight performance consideration, which is no problem most of the * time, unless we are trashing objects - which is the case when scrolling and rowComp * and cellComp. So for performance reasons, RowComp and CellComp do not get autowired * with the IoC. Instead they get passed this object which is all the beans the RowComp * and CellComp need. Not autowiring all the cells gives performance improvement. */ var Beans = /** @class */ (function () { function Beans() { } Beans.prototype.postConstruct = function () { this.doingMasterDetail = this.gridOptionsService.isMasterDetail(); if (this.gridOptionsService.isRowModelType('clientSide')) { this.clientSideRowModel = this.rowModel; } if (this.gridOptionsService.isRowModelType('serverSide')) { this.serverSideRowModel = this.rowModel; } }; __decorate$P([ Autowired('resizeObserverService') ], Beans.prototype, "resizeObserverService", void 0); __decorate$P([ Autowired('paginationProxy') ], Beans.prototype, "paginationProxy", void 0); __decorate$P([ Autowired('context') ], Beans.prototype, "context", void 0); __decorate$P([ Autowired('columnApi') ], Beans.prototype, "columnApi", void 0); __decorate$P([ Autowired('gridApi') ], Beans.prototype, "gridApi", void 0); __decorate$P([ Autowired('gridOptionsService') ], Beans.prototype, "gridOptionsService", void 0); __decorate$P([ Autowired('expressionService') ], Beans.prototype, "expressionService", void 0); __decorate$P([ Autowired('environment') ], Beans.prototype, "environment", void 0); __decorate$P([ Autowired('rowRenderer') ], Beans.prototype, "rowRenderer", void 0); __decorate$P([ Autowired('templateService') ], Beans.prototype, "templateService", void 0); __decorate$P([ Autowired('valueService') ], Beans.prototype, "valueService", void 0); __decorate$P([ Autowired('eventService') ], Beans.prototype, "eventService", void 0); __decorate$P([ Autowired('columnModel') ], Beans.prototype, "columnModel", void 0); __decorate$P([ Autowired('headerNavigationService') ], Beans.prototype, "headerNavigationService", void 0); __decorate$P([ Autowired('navigationService') ], Beans.prototype, "navigationService", void 0); __decorate$P([ Autowired('columnAnimationService') ], Beans.prototype, "columnAnimationService", void 0); __decorate$P([ Optional('rangeService') ], Beans.prototype, "rangeService", void 0); __decorate$P([ Autowired('focusService') ], Beans.prototype, "focusService", void 0); __decorate$P([ Optional('contextMenuFactory') ], Beans.prototype, "contextMenuFactory", void 0); __decorate$P([ Autowired('popupService') ], Beans.prototype, "popupService", void 0); __decorate$P([ Autowired('valueFormatterService') ], Beans.prototype, "valueFormatterService", void 0); __decorate$P([ Autowired('stylingService') ], Beans.prototype, "stylingService", void 0); __decorate$P([ Autowired('columnHoverService') ], Beans.prototype, "columnHoverService", void 0); __decorate$P([ Autowired('userComponentFactory') ], Beans.prototype, "userComponentFactory", void 0); __decorate$P([ Autowired('userComponentRegistry') ], Beans.prototype, "userComponentRegistry", void 0); __decorate$P([ Autowired('animationFrameService') ], Beans.prototype, "animationFrameService", void 0); __decorate$P([ Autowired('dragService') ], Beans.prototype, "dragService", void 0); __decorate$P([ Autowired('dragAndDropService') ], Beans.prototype, "dragAndDropService", void 0); __decorate$P([ Autowired('sortController') ], Beans.prototype, "sortController", void 0); __decorate$P([ Autowired('filterManager') ], Beans.prototype, "filterManager", void 0); __decorate$P([ Autowired('rowContainerHeightService') ], Beans.prototype, "rowContainerHeightService", void 0); __decorate$P([ Autowired('frameworkOverrides') ], Beans.prototype, "frameworkOverrides", void 0); __decorate$P([ Autowired('cellPositionUtils') ], Beans.prototype, "cellPositionUtils", void 0); __decorate$P([ Autowired('rowPositionUtils') ], Beans.prototype, "rowPositionUtils", void 0); __decorate$P([ Autowired('selectionService') ], Beans.prototype, "selectionService", void 0); __decorate$P([ Optional('selectionHandleFactory') ], Beans.prototype, "selectionHandleFactory", void 0); __decorate$P([ Autowired('rowCssClassCalculator') ], Beans.prototype, "rowCssClassCalculator", void 0); __decorate$P([ Autowired('rowModel') ], Beans.prototype, "rowModel", void 0); __decorate$P([ Autowired('ctrlsService') ], Beans.prototype, "ctrlsService", void 0); __decorate$P([ Autowired('ctrlsFactory') ], Beans.prototype, "ctrlsFactory", void 0); __decorate$P([ Autowired('agStackComponentsRegistry') ], Beans.prototype, "agStackComponentsRegistry", void 0); __decorate$P([ Autowired('valueCache') ], Beans.prototype, "valueCache", void 0); __decorate$P([ Autowired('rowNodeEventThrottle') ], Beans.prototype, "rowNodeEventThrottle", void 0); __decorate$P([ Autowired('localeService') ], Beans.prototype, "localeService", void 0); __decorate$P([ PostConstruct ], Beans.prototype, "postConstruct", null); Beans = __decorate$P([ Bean('beans') ], Beans); return Beans; }()); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$10 = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var CellMouseListenerFeature = /** @class */ (function (_super) { __extends$10(CellMouseListenerFeature, _super); function CellMouseListenerFeature(ctrl, beans, column) { var _this = _super.call(this) || this; _this.cellCtrl = ctrl; _this.beans = beans; _this.column = column; return _this; } CellMouseListenerFeature.prototype.onMouseEvent = function (eventName, mouseEvent) { if (isStopPropagationForAgGrid(mouseEvent)) { return; } switch (eventName) { case 'click': this.onCellClicked(mouseEvent); break; case 'mousedown': case 'touchstart': this.onMouseDown(mouseEvent); break; case 'dblclick': this.onCellDoubleClicked(mouseEvent); break; case 'mouseout': this.onMouseOut(mouseEvent); break; case 'mouseover': this.onMouseOver(mouseEvent); break; } }; CellMouseListenerFeature.prototype.onCellClicked = function (mouseEvent) { // iPad doesn't have double click - so we need to mimic it to enable editing for iPad. if (this.isDoubleClickOnIPad()) { this.onCellDoubleClicked(mouseEvent); mouseEvent.preventDefault(); // if we don't do this, then iPad zooms in return; } var _a = this.beans, eventService = _a.eventService, rangeService = _a.rangeService, gridOptionsService = _a.gridOptionsService; var multiKeyPressed = mouseEvent.ctrlKey || mouseEvent.metaKey; if (rangeService && multiKeyPressed) { // the mousedown event has created the range already, so we only intersect if there is more than one // range on this cell if (rangeService.getCellRangeCount(this.cellCtrl.getCellPosition()) > 1) { rangeService.intersectLastRange(true); } } var cellClickedEvent = this.cellCtrl.createEvent(mouseEvent, Events.EVENT_CELL_CLICKED); eventService.dispatchEvent(cellClickedEvent); var colDef = this.column.getColDef(); if (colDef.onCellClicked) { // to make callback async, do in a timeout window.setTimeout(function () { return colDef.onCellClicked(cellClickedEvent); }, 0); } var editOnSingleClick = (gridOptionsService.is('singleClickEdit') || colDef.singleClickEdit) && !gridOptionsService.is('suppressClickEdit'); if (editOnSingleClick) { this.cellCtrl.startRowOrCellEdit(); } }; // returns true if on iPad and this is second 'click' event in 200ms CellMouseListenerFeature.prototype.isDoubleClickOnIPad = function () { if (!isIOSUserAgent() || isEventSupported('dblclick')) { return false; } var nowMillis = new Date().getTime(); var res = nowMillis - this.lastIPadMouseClickEvent < 200; this.lastIPadMouseClickEvent = nowMillis; return res; }; CellMouseListenerFeature.prototype.onCellDoubleClicked = function (mouseEvent) { var colDef = this.column.getColDef(); // always dispatch event to eventService var cellDoubleClickedEvent = this.cellCtrl.createEvent(mouseEvent, Events.EVENT_CELL_DOUBLE_CLICKED); this.beans.eventService.dispatchEvent(cellDoubleClickedEvent); // check if colDef also wants to handle event if (typeof colDef.onCellDoubleClicked === 'function') { // to make the callback async, do in a timeout window.setTimeout(function () { return colDef.onCellDoubleClicked(cellDoubleClickedEvent); }, 0); } var editOnDoubleClick = !this.beans.gridOptionsService.is('singleClickEdit') && !this.beans.gridOptionsService.is('suppressClickEdit'); if (editOnDoubleClick) { this.cellCtrl.startRowOrCellEdit(null, null, mouseEvent); } }; CellMouseListenerFeature.prototype.onMouseDown = function (mouseEvent) { var ctrlKey = mouseEvent.ctrlKey, metaKey = mouseEvent.metaKey, shiftKey = mouseEvent.shiftKey; var target = mouseEvent.target; var _a = this.beans, eventService = _a.eventService, rangeService = _a.rangeService; // do not change the range for right-clicks inside an existing range if (this.isRightClickInExistingRange(mouseEvent)) { return; } var ranges = rangeService && rangeService.getCellRanges().length != 0; if (!shiftKey || !ranges) { // We only need to pass true to focusCell when the browser is Safari and we are trying // to focus the cell itself. This should never be true if the mousedown was triggered // due to a click on a cell editor for example. var forceBrowserFocus = (isBrowserSafari()) && !this.cellCtrl.isEditing() && !isFocusableFormField(target); this.cellCtrl.focusCell(forceBrowserFocus); } // if shift clicking, and a range exists, we keep the focus on the cell that started the // range as the user then changes the range selection. if (shiftKey && ranges) { // this stops the cell from getting focused mouseEvent.preventDefault(); } // if we are clicking on a checkbox, we need to make sure the cell wrapping that checkbox // is focused but we don't want to change the range selection, so return here. if (this.containsWidget(target)) { return; } if (rangeService) { var thisCell = this.cellCtrl.getCellPosition(); if (shiftKey) { rangeService.extendLatestRangeToCell(thisCell); } else { var ctrlKeyPressed = ctrlKey || metaKey; rangeService.setRangeToCell(thisCell, ctrlKeyPressed); } } eventService.dispatchEvent(this.cellCtrl.createEvent(mouseEvent, Events.EVENT_CELL_MOUSE_DOWN)); }; CellMouseListenerFeature.prototype.isRightClickInExistingRange = function (mouseEvent) { var rangeService = this.beans.rangeService; if (rangeService) { var cellInRange = rangeService.isCellInAnyRange(this.cellCtrl.getCellPosition()); if (cellInRange && mouseEvent.button === 2) { return true; } } return false; }; CellMouseListenerFeature.prototype.containsWidget = function (target) { return isElementChildOfClass(target, 'ag-selection-checkbox', 3); }; CellMouseListenerFeature.prototype.onMouseOut = function (mouseEvent) { if (this.mouseStayingInsideCell(mouseEvent)) { return; } var cellMouseOutEvent = this.cellCtrl.createEvent(mouseEvent, Events.EVENT_CELL_MOUSE_OUT); this.beans.eventService.dispatchEvent(cellMouseOutEvent); this.beans.columnHoverService.clearMouseOver(); }; CellMouseListenerFeature.prototype.onMouseOver = function (mouseEvent) { if (this.mouseStayingInsideCell(mouseEvent)) { return; } var cellMouseOverEvent = this.cellCtrl.createEvent(mouseEvent, Events.EVENT_CELL_MOUSE_OVER); this.beans.eventService.dispatchEvent(cellMouseOverEvent); this.beans.columnHoverService.setMouseOver([this.column]); }; CellMouseListenerFeature.prototype.mouseStayingInsideCell = function (e) { if (!e.target || !e.relatedTarget) { return false; } var eGui = this.cellCtrl.getGui(); var cellContainsTarget = eGui.contains(e.target); var cellContainsRelatedTarget = eGui.contains(e.relatedTarget); return cellContainsTarget && cellContainsRelatedTarget; }; CellMouseListenerFeature.prototype.destroy = function () { }; return CellMouseListenerFeature; }(Beans)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$11 = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var CellKeyboardListenerFeature = /** @class */ (function (_super) { __extends$11(CellKeyboardListenerFeature, _super); function CellKeyboardListenerFeature(ctrl, beans, column, rowNode, rowCtrl) { var _this = _super.call(this) || this; _this.cellCtrl = ctrl; _this.beans = beans; _this.rowNode = rowNode; _this.rowCtrl = rowCtrl; return _this; } CellKeyboardListenerFeature.prototype.setComp = function (eGui) { this.eGui = eGui; }; CellKeyboardListenerFeature.prototype.onKeyDown = function (event) { var key = event.key; switch (key) { case KeyCode.ENTER: this.onEnterKeyDown(event); break; case KeyCode.F2: this.onF2KeyDown(event); break; case KeyCode.ESCAPE: this.onEscapeKeyDown(event); break; case KeyCode.TAB: this.onTabKeyDown(event); break; case KeyCode.BACKSPACE: case KeyCode.DELETE: this.onBackspaceOrDeleteKeyPressed(key, event); break; case KeyCode.DOWN: case KeyCode.UP: case KeyCode.RIGHT: case KeyCode.LEFT: this.onNavigationKeyPressed(event, key); break; } }; CellKeyboardListenerFeature.prototype.onNavigationKeyPressed = function (event, key) { if (this.cellCtrl.isEditing()) { return; } if (event.shiftKey && this.cellCtrl.isRangeSelectionEnabled()) { this.onShiftRangeSelect(event); } else { this.beans.navigationService.navigateToNextCell(event, key, this.cellCtrl.getCellPosition(), true); } // if we don't prevent default, the grid will scroll with the navigation keys event.preventDefault(); }; CellKeyboardListenerFeature.prototype.onShiftRangeSelect = function (event) { if (!this.beans.rangeService) { return; } var endCell = this.beans.rangeService.extendLatestRangeInDirection(event); if (endCell) { this.beans.navigationService.ensureCellVisible(endCell); } }; CellKeyboardListenerFeature.prototype.onTabKeyDown = function (event) { this.beans.navigationService.onTabKeyDown(this.cellCtrl, event); }; CellKeyboardListenerFeature.prototype.onBackspaceOrDeleteKeyPressed = function (key, event) { var _a = this, cellCtrl = _a.cellCtrl, beans = _a.beans, rowNode = _a.rowNode; var gridOptionsService = beans.gridOptionsService, rangeService = beans.rangeService, eventService = beans.eventService; if (cellCtrl.isEditing()) { return; } eventService.dispatchEvent({ type: Events.EVENT_KEY_SHORTCUT_CHANGED_CELL_START }); if (isDeleteKey(key, gridOptionsService.is('enableCellEditingOnBackspace'))) { if (rangeService && gridOptionsService.isEnableRangeSelection()) { rangeService.clearCellRangeCellValues(); } else if (cellCtrl.isCellEditable()) { rowNode.setDataValue(cellCtrl.getColumn(), null, 'cellClear'); } } else { cellCtrl.startRowOrCellEdit(key, undefined, event); } eventService.dispatchEvent({ type: Events.EVENT_KEY_SHORTCUT_CHANGED_CELL_END }); }; CellKeyboardListenerFeature.prototype.onEnterKeyDown = function (e) { if (this.cellCtrl.isEditing() || this.rowCtrl.isEditing()) { this.cellCtrl.stopEditingAndFocus(); } else { if (this.beans.gridOptionsService.is('enterMovesDown')) { this.beans.navigationService.navigateToNextCell(null, KeyCode.DOWN, this.cellCtrl.getCellPosition(), false); } else { this.cellCtrl.startRowOrCellEdit(KeyCode.ENTER, undefined, e); if (this.cellCtrl.isEditing()) { // if we started editing, then we need to prevent default, otherwise the Enter action can get // applied to the cell editor. this happened, for example, with largeTextCellEditor where not // preventing default results in a 'new line' character getting inserted in the text area // when the editing was started e.preventDefault(); } } } }; CellKeyboardListenerFeature.prototype.onF2KeyDown = function (event) { if (!this.cellCtrl.isEditing()) { this.cellCtrl.startRowOrCellEdit(KeyCode.F2, undefined, event); } }; CellKeyboardListenerFeature.prototype.onEscapeKeyDown = function (event) { if (this.cellCtrl.isEditing()) { this.cellCtrl.stopRowOrCellEdit(true); this.cellCtrl.focusCell(true); } }; CellKeyboardListenerFeature.prototype.onKeyPress = function (event) { // check this, in case focus is on a (for example) a text field inside the cell, // in which cse we should not be listening for these key pressed var eventTarget = event.target; var eventOnChildComponent = eventTarget !== this.eGui; if (eventOnChildComponent || this.cellCtrl.isEditing()) { return; } var pressedChar = String.fromCharCode(event.charCode); if (pressedChar === ' ') { this.onSpaceKeyPressed(event); } else if (isEventFromPrintableCharacter(event)) { this.cellCtrl.startRowOrCellEdit(null, pressedChar, event); // if we don't prevent default, then the keypress also gets applied to the text field // (at least when doing the default editor), but we need to allow the editor to decide // what it wants to do. we only do this IF editing was started - otherwise it messes // up when the use is not doing editing, but using rendering with text fields in cellRenderer // (as it would block the the user from typing into text fields). event.preventDefault(); } }; CellKeyboardListenerFeature.prototype.onSpaceKeyPressed = function (event) { var gridOptionsService = this.beans.gridOptionsService; if (!this.cellCtrl.isEditing() && gridOptionsService.isRowSelection()) { var currentSelection = this.rowNode.isSelected(); var newSelection = !currentSelection; if (newSelection || !gridOptionsService.is('suppressRowDeselection')) { var groupSelectsFiltered = this.beans.gridOptionsService.is('groupSelectsFiltered'); var updatedCount = this.rowNode.setSelectedParams({ newValue: newSelection, rangeSelect: event.shiftKey, groupSelectsFiltered: groupSelectsFiltered, event: event, source: 'spacePressed' }); if (currentSelection === undefined && updatedCount === 0) { this.rowNode.setSelectedParams({ newValue: false, rangeSelect: event.shiftKey, groupSelectsFiltered: groupSelectsFiltered, event: event, source: 'spacePressed' }); } } } // prevent default as space key, by default, moves browser scroll down event.preventDefault(); }; CellKeyboardListenerFeature.prototype.destroy = function () { _super.prototype.destroy.call(this); }; return CellKeyboardListenerFeature; }(BeanStub)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$12 = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __decorate$Q = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var DndSourceComp = /** @class */ (function (_super) { __extends$12(DndSourceComp, _super); function DndSourceComp(rowNode, column, beans, eCell) { var _this = _super.call(this, "
") || this; _this.rowNode = rowNode; _this.column = column; _this.beans = beans; _this.eCell = eCell; return _this; } DndSourceComp.prototype.postConstruct = function () { var eGui = this.getGui(); eGui.appendChild(createIconNoSpan('rowDrag', this.beans.gridOptionsService, null)); // we need to stop the event propagation here to avoid starting a range selection while dragging this.addGuiEventListener('mousedown', function (e) { e.stopPropagation(); }); this.addDragSource(); this.checkVisibility(); }; DndSourceComp.prototype.addDragSource = function () { this.addGuiEventListener('dragstart', this.onDragStart.bind(this)); }; DndSourceComp.prototype.onDragStart = function (dragEvent) { var _this = this; var providedOnRowDrag = this.column.getColDef().dndSourceOnRowDrag; dragEvent.dataTransfer.setDragImage(this.eCell, 0, 0); // default behaviour is to convert data to json and set into drag component var defaultOnRowDrag = function () { try { var jsonData = JSON.stringify(_this.rowNode.data); dragEvent.dataTransfer.setData('application/json', jsonData); dragEvent.dataTransfer.setData('text/plain', jsonData); } catch (e) { // if we cannot convert the data to json, then we do not set the type } }; if (providedOnRowDrag) { var params = { rowNode: this.rowNode, dragEvent: dragEvent, api: this.gridOptionsService.api, columnApi: this.gridOptionsService.columnApi, context: this.gridOptionsService.context }; providedOnRowDrag(params); } else { defaultOnRowDrag(); } }; DndSourceComp.prototype.checkVisibility = function () { var visible = this.column.isDndSource(this.rowNode); this.setDisplayed(visible); }; __decorate$Q([ PostConstruct ], DndSourceComp.prototype, "postConstruct", null); return DndSourceComp; }(Component)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$13 = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __assign$d = (undefined && undefined.__assign) || function () { __assign$d = Object.assign || function(t) { for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; } return t; }; return __assign$d.apply(this, arguments); }; var CSS_CELL = 'ag-cell'; var CSS_AUTO_HEIGHT = 'ag-cell-auto-height'; var CSS_NORMAL_HEIGHT = 'ag-cell-normal-height'; var CSS_CELL_FOCUS = 'ag-cell-focus'; var CSS_CELL_FIRST_RIGHT_PINNED = 'ag-cell-first-right-pinned'; var CSS_CELL_LAST_LEFT_PINNED = 'ag-cell-last-left-pinned'; var CSS_CELL_NOT_INLINE_EDITING = 'ag-cell-not-inline-editing'; var CSS_COLUMN_HOVER = 'ag-column-hover'; var CSS_CELL_WRAP_TEXT = 'ag-cell-wrap-text'; var instanceIdSequence$1 = 0; var CellCtrl = /** @class */ (function (_super) { __extends$13(CellCtrl, _super); function CellCtrl(column, rowNode, beans, rowCtrl) { var _this = _super.call(this) || this; _this.cellRangeFeature = null; _this.cellPositionFeature = null; _this.cellCustomStyleFeature = null; _this.tooltipFeature = null; _this.cellMouseListenerFeature = null; _this.cellKeyboardListenerFeature = null; _this.suppressRefreshCell = false; _this.onCellCompAttachedFuncs = []; _this.column = column; _this.rowNode = rowNode; _this.beans = beans; _this.rowCtrl = rowCtrl; // unique id to this instance, including the column ID to help with debugging in React as it's used in 'key' _this.instanceId = column.getId() + '-' + instanceIdSequence$1++; _this.createCellPosition(); _this.addFeatures(); return _this; } CellCtrl.prototype.addFeatures = function () { var _this = this; this.cellPositionFeature = new CellPositionFeature(this, this.beans); this.addDestroyFunc(function () { var _a; (_a = _this.cellPositionFeature) === null || _a === void 0 ? void 0 : _a.destroy(); _this.cellPositionFeature = null; }); this.cellCustomStyleFeature = new CellCustomStyleFeature(this, this.beans); this.addDestroyFunc(function () { var _a; (_a = _this.cellCustomStyleFeature) === null || _a === void 0 ? void 0 : _a.destroy(); _this.cellCustomStyleFeature = null; }); this.cellMouseListenerFeature = new CellMouseListenerFeature(this, this.beans, this.column); this.addDestroyFunc(function () { var _a; (_a = _this.cellMouseListenerFeature) === null || _a === void 0 ? void 0 : _a.destroy(); _this.cellMouseListenerFeature = null; }); this.cellKeyboardListenerFeature = new CellKeyboardListenerFeature(this, this.beans, this.column, this.rowNode, this.rowCtrl); this.addDestroyFunc(function () { var _a; (_a = _this.cellKeyboardListenerFeature) === null || _a === void 0 ? void 0 : _a.destroy(); _this.cellKeyboardListenerFeature = null; }); var rangeSelectionEnabled = this.beans.rangeService && this.beans.gridOptionsService.isEnableRangeSelection(); if (rangeSelectionEnabled) { this.cellRangeFeature = new CellRangeFeature(this.beans, this); this.addDestroyFunc(function () { var _a; (_a = _this.cellRangeFeature) === null || _a === void 0 ? void 0 : _a.destroy(); _this.cellRangeFeature = null; }); } this.addTooltipFeature(); }; CellCtrl.prototype.addTooltipFeature = function () { var _this = this; var getTooltipValue = function () { var colDef = _this.column.getColDef(); var data = _this.rowNode.data; if (colDef.tooltipField && exists(data)) { return getValueUsingField(data, colDef.tooltipField, _this.column.isTooltipFieldContainsDots()); } var valueGetter = colDef.tooltipValueGetter; if (valueGetter) { return valueGetter({ location: 'cell', api: _this.beans.gridOptionsService.api, columnApi: _this.beans.gridOptionsService.columnApi, context: _this.beans.gridOptionsService.context, colDef: _this.column.getColDef(), column: _this.column, rowIndex: _this.cellPosition.rowIndex, node: _this.rowNode, data: _this.rowNode.data, value: _this.value, valueFormatted: _this.valueFormatted, }); } return null; }; var tooltipCtrl = { getColumn: function () { return _this.column; }, getColDef: function () { return _this.column.getColDef(); }, getRowIndex: function () { return _this.cellPosition.rowIndex; }, getRowNode: function () { return _this.rowNode; }, getGui: function () { return _this.getGui(); }, getLocation: function () { return 'cell'; }, getTooltipValue: getTooltipValue, // this makes no sense, why is the cell formatted value passed to the tooltip??? getValueFormatted: function () { return _this.valueFormatted; } }; this.tooltipFeature = new TooltipFeature(tooltipCtrl, this.beans); this.addDestroyFunc(function () { var _a; (_a = _this.tooltipFeature) === null || _a === void 0 ? void 0 : _a.destroy(); _this.tooltipFeature = null; }); }; CellCtrl.prototype.setComp = function (comp, eGui, eCellWrapper, printLayout, startEditing) { var _a, _b, _c, _d; this.cellComp = comp; this.eGui = eGui; this.printLayout = printLayout; // we force to make sure formatter gets called at least once, // even if value has not changed (is is undefined) this.updateAndFormatValue(true); this.addDomData(); this.onCellFocused(); this.applyStaticCssClasses(); this.setWrapText(); this.onFirstRightPinnedChanged(); this.onLastLeftPinnedChanged(); this.onColumnHover(); this.setupControlComps(); if (eCellWrapper) { this.setupAutoHeight(eCellWrapper); } this.setAriaColIndex(); if (!this.beans.gridOptionsService.is('suppressCellFocus')) { this.cellComp.setTabIndex(-1); } var colIdSanitised = escapeString(this.column.getId()); this.cellComp.setColId(colIdSanitised); this.cellComp.setRole('gridcell'); (_a = this.cellPositionFeature) === null || _a === void 0 ? void 0 : _a.setComp(eGui); (_b = this.cellCustomStyleFeature) === null || _b === void 0 ? void 0 : _b.setComp(comp); (_c = this.tooltipFeature) === null || _c === void 0 ? void 0 : _c.setComp(comp); (_d = this.cellKeyboardListenerFeature) === null || _d === void 0 ? void 0 : _d.setComp(this.eGui); if (this.cellRangeFeature) { this.cellRangeFeature.setComp(comp, eGui); } if (startEditing && this.isCellEditable()) { this.startEditing(); } else { this.showValue(); } if (this.onCellCompAttachedFuncs.length) { this.onCellCompAttachedFuncs.forEach(function (func) { return func(); }); this.onCellCompAttachedFuncs = []; } }; CellCtrl.prototype.setupAutoHeight = function (eCellWrapper) { var _this = this; if (!this.column.isAutoHeight()) { return; } var eParentCell = eCellWrapper.parentElement; // taking minRowHeight from getRowHeightForNode means the getRowHeight() callback is used, // thus allowing different min heights for different rows. var minRowHeight = this.beans.gridOptionsService.getRowHeightForNode(this.rowNode).height; var measureHeight = function (timesCalled) { if (_this.editing) { return; } // because of the retry's below, it's possible the retry's go beyond // the rows life. if (!_this.isAlive()) { return; } var _a = getElementSize(eParentCell), paddingTop = _a.paddingTop, paddingBottom = _a.paddingBottom, borderBottomWidth = _a.borderBottomWidth, borderTopWidth = _a.borderTopWidth; var extraHeight = paddingTop + paddingBottom + borderBottomWidth + borderTopWidth; var wrapperHeight = eCellWrapper.offsetHeight; var autoHeight = wrapperHeight + extraHeight; if (timesCalled < 5) { // if not in doc yet, means framework not yet inserted, so wait for next VM turn, // maybe it will be ready next VM turn var doc = _this.beans.gridOptionsService.getDocument(); var notYetInDom = !doc || !doc.contains(eCellWrapper); // this happens in React, where React hasn't put any content in. we say 'possibly' // as a) may not be React and b) the cell could be empty anyway var possiblyNoContentYet = autoHeight == 0; if (notYetInDom || possiblyNoContentYet) { _this.beans.frameworkOverrides.setTimeout(function () { return measureHeight(timesCalled + 1); }, 0); return; } } var newHeight = Math.max(autoHeight, minRowHeight); _this.rowNode.setRowAutoHeight(newHeight, _this.column); }; var listener = function () { return measureHeight(0); }; // do once to set size in case size doesn't change, common when cell is blank listener(); var destroyResizeObserver = this.beans.resizeObserverService.observeResize(eCellWrapper, listener); this.addDestroyFunc(function () { destroyResizeObserver(); _this.rowNode.setRowAutoHeight(undefined, _this.column); }); }; CellCtrl.prototype.getInstanceId = function () { return this.instanceId; }; CellCtrl.prototype.showValue = function (forceNewCellRendererInstance) { if (forceNewCellRendererInstance === void 0) { forceNewCellRendererInstance = false; } var valueToDisplay = this.valueFormatted != null ? this.valueFormatted : this.value; var params = this.createCellRendererParams(); var compDetails = this.beans.userComponentFactory.getCellRendererDetails(this.column.getColDef(), params); this.cellComp.setRenderDetails(compDetails, valueToDisplay, forceNewCellRendererInstance); this.refreshHandle(); }; CellCtrl.prototype.setupControlComps = function () { var colDef = this.column.getColDef(); this.includeSelection = this.isIncludeControl(colDef.checkboxSelection); this.includeRowDrag = this.isIncludeControl(colDef.rowDrag); this.includeDndSource = this.isIncludeControl(colDef.dndSource); this.cellComp.setIncludeSelection(this.includeSelection); this.cellComp.setIncludeDndSource(this.includeDndSource); this.cellComp.setIncludeRowDrag(this.includeRowDrag); }; CellCtrl.prototype.isForceWrapper = function () { // text selection requires the value to be wrapped in another element var forceWrapper = this.beans.gridOptionsService.is('enableCellTextSelection') || this.column.isAutoHeight(); return forceWrapper; }; CellCtrl.prototype.isIncludeControl = function (value) { var rowNodePinned = this.rowNode.rowPinned != null; var isFunc = typeof value === 'function'; var res = rowNodePinned ? false : isFunc || value === true; return res; }; CellCtrl.prototype.refreshShouldDestroy = function () { var colDef = this.column.getColDef(); var selectionChanged = this.includeSelection != this.isIncludeControl(colDef.checkboxSelection); var rowDragChanged = this.includeRowDrag != this.isIncludeControl(colDef.rowDrag); var dndSourceChanged = this.includeDndSource != this.isIncludeControl(colDef.dndSource); return selectionChanged || rowDragChanged || dndSourceChanged; }; // either called internally if single cell editing, or called by rowRenderer if row editing CellCtrl.prototype.startEditing = function (key, charPress, cellStartedEdit, event) { var _this = this; if (key === void 0) { key = null; } if (charPress === void 0) { charPress = null; } if (cellStartedEdit === void 0) { cellStartedEdit = false; } if (event === void 0) { event = null; } if (!this.isCellEditable() || this.editing) { return; } // because of async in React, the cellComp may not be set yet, if no cellComp then we are // yet to initialise the cell, so we re-schedule this operation for when celLComp is attached if (!this.cellComp) { this.onCellCompAttachedFuncs.push(function () { _this.startEditing(key, charPress, cellStartedEdit, event); }); return; } var editorParams = this.createCellEditorParams(key, charPress, cellStartedEdit); var colDef = this.column.getColDef(); var compDetails = this.beans.userComponentFactory.getCellEditorDetails(colDef, editorParams); // if cellEditorSelector was used, we give preference to popup and popupPosition from the selector var popup = (compDetails === null || compDetails === void 0 ? void 0 : compDetails.popupFromSelector) != null ? compDetails.popupFromSelector : !!colDef.cellEditorPopup; var position = (compDetails === null || compDetails === void 0 ? void 0 : compDetails.popupPositionFromSelector) != null ? compDetails.popupPositionFromSelector : colDef.cellEditorPopupPosition; this.setEditing(true); this.cellComp.setEditDetails(compDetails, popup, position); var e = this.createEvent(event, Events.EVENT_CELL_EDITING_STARTED); this.beans.eventService.dispatchEvent(e); }; CellCtrl.prototype.setEditing = function (editing) { if (this.editing === editing) { return; } this.editing = editing; this.refreshHandle(); }; // pass in 'true' to cancel the editing. CellCtrl.prototype.stopRowOrCellEdit = function (cancel) { if (cancel === void 0) { cancel = false; } if (this.beans.gridOptionsService.get('editType') === 'fullRow') { this.rowCtrl.stopRowEditing(cancel); } else { this.stopEditing(cancel); } }; CellCtrl.prototype.onPopupEditorClosed = function () { if (!this.isEditing()) { return; } // note: this happens because of a click outside of the grid or if the popupEditor // is closed with `Escape` key. if another cell was clicked, then the editing will // have already stopped and returned on the conditional above. this.stopEditingAndFocus(); }; CellCtrl.prototype.takeValueFromCellEditor = function (cancel) { var noValueResult = { newValueExists: false }; if (cancel) { return noValueResult; } var cellEditor = this.cellComp.getCellEditor(); if (!cellEditor) { return noValueResult; } var userWantsToCancel = cellEditor.isCancelAfterEnd && cellEditor.isCancelAfterEnd(); if (userWantsToCancel) { return noValueResult; } var newValue = cellEditor.getValue(); return { newValue: newValue, newValueExists: true }; }; /** * @returns `True` if the value changes, otherwise `False`. */ CellCtrl.prototype.saveNewValue = function (oldValue, newValue) { if (newValue === oldValue) { return false; } // we suppressRefreshCell because the call to rowNode.setDataValue() results in change detection // getting triggered, which results in all cells getting refreshed. we do not want this refresh // to happen on this call as we want to call it explicitly below. otherwise refresh gets called twice. // if we only did this refresh (and not the one below) then the cell would flash and not be forced. this.suppressRefreshCell = true; var valueChanged = this.rowNode.setDataValue(this.column, newValue, 'edit'); this.suppressRefreshCell = false; return valueChanged; }; /** * Ends the Cell Editing * @param cancel `True` if the edit process is being canceled. * @returns `True` if the value of the `GridCell` has been updated, otherwise `False`. */ CellCtrl.prototype.stopEditing = function (cancel) { if (cancel === void 0) { cancel = false; } if (!this.editing) { return false; } var _a = this.takeValueFromCellEditor(cancel), newValue = _a.newValue, newValueExists = _a.newValueExists; var oldValue = this.getValueFromValueService(); var valueChanged = false; if (newValueExists) { valueChanged = this.saveNewValue(oldValue, newValue); } this.setEditing(false); this.cellComp.setEditDetails(); // passing nothing stops editing this.updateAndFormatValue(); this.refreshCell({ forceRefresh: true, suppressFlash: true }); this.dispatchEditingStoppedEvent(oldValue, newValue, !cancel && !!valueChanged); return valueChanged; }; CellCtrl.prototype.dispatchEditingStoppedEvent = function (oldValue, newValue, valueChanged) { var editingStoppedEvent = __assign$d(__assign$d({}, this.createEvent(null, Events.EVENT_CELL_EDITING_STOPPED)), { oldValue: oldValue, newValue: newValue, valueChanged: valueChanged }); this.beans.eventService.dispatchEvent(editingStoppedEvent); }; CellCtrl.prototype.createCellEditorParams = function (key, charPress, cellStartedEdit) { return { value: this.getValueFromValueService(), eventKey: key, charPress: charPress, column: this.column, colDef: this.column.getColDef(), rowIndex: this.getCellPosition().rowIndex, node: this.rowNode, data: this.rowNode.data, api: this.beans.gridOptionsService.api, cellStartedEdit: cellStartedEdit, columnApi: this.beans.gridOptionsService.columnApi, context: this.beans.gridOptionsService.context, onKeyDown: this.onKeyDown.bind(this), stopEditing: this.stopEditingAndFocus.bind(this), eGridCell: this.getGui(), parseValue: this.parseValue.bind(this), formatValue: this.formatValue.bind(this) }; }; CellCtrl.prototype.createCellRendererParams = function () { var _this = this; var res = { value: this.value, valueFormatted: this.valueFormatted, getValue: this.getValueFromValueService.bind(this), setValue: function (value) { return _this.beans.valueService.setValue(_this.rowNode, _this.column, value); }, formatValue: this.formatValue.bind(this), data: this.rowNode.data, node: this.rowNode, pinned: this.column.getPinned(), colDef: this.column.getColDef(), column: this.column, rowIndex: this.getCellPosition().rowIndex, api: this.beans.gridOptionsService.api, columnApi: this.beans.gridOptionsService.columnApi, context: this.beans.gridOptionsService.context, refreshCell: this.refreshCell.bind(this), eGridCell: this.getGui(), eParentOfValue: this.cellComp.getParentOfValue(), registerRowDragger: function (rowDraggerElement, dragStartPixels, value, suppressVisibilityChange) { return _this.registerRowDragger(rowDraggerElement, dragStartPixels, suppressVisibilityChange); }, }; return res; }; CellCtrl.prototype.parseValue = function (newValue) { var colDef = this.column.getColDef(); var params = { node: this.rowNode, data: this.rowNode.data, oldValue: this.getValue(), newValue: newValue, colDef: colDef, column: this.column, api: this.beans.gridOptionsService.api, columnApi: this.beans.gridOptionsService.columnApi, context: this.beans.gridOptionsService.context }; var valueParser = colDef.valueParser; if (exists(valueParser)) { if (typeof valueParser === 'function') { return valueParser(params); } return this.beans.expressionService.evaluate(valueParser, params); } return newValue; }; CellCtrl.prototype.setFocusOutOnEditor = function () { if (!this.editing) { return; } var cellEditor = this.cellComp.getCellEditor(); if (cellEditor && cellEditor.focusOut) { cellEditor.focusOut(); } }; CellCtrl.prototype.setFocusInOnEditor = function () { if (!this.editing) { return; } var cellEditor = this.cellComp.getCellEditor(); if (cellEditor && cellEditor.focusIn) { // if the editor is present, then we just focus it cellEditor.focusIn(); } else { // if the editor is not present, it means async cell editor (eg React fibre) // and we are trying to set focus before the cell editor is present, so we // focus the cell instead this.focusCell(true); } }; CellCtrl.prototype.onCellChanged = function (event) { // because of async in React, the cellComp may not be set yet, if no cellComp then we are // yet to initialise the cell, so no need to refresh. if (!this.cellComp) { return; } var eventImpactsThisCell = event.column === this.column; if (eventImpactsThisCell) { this.refreshCell({}); } }; // + stop editing {forceRefresh: true, suppressFlash: true} // + event cellChanged {} // + cellRenderer.params.refresh() {} -> method passes 'as is' to the cellRenderer, so params could be anything // + rowCtrl: event dataChanged {suppressFlash: !update, newData: !update} // + rowCtrl: api refreshCells() {animate: true/false} // + rowRenderer: api softRefreshView() {} CellCtrl.prototype.refreshCell = function (params) { var _a, _b, _c; // if we are in the middle of 'stopEditing', then we don't refresh here, as refresh gets called explicitly if (this.suppressRefreshCell || this.editing) { return; } // In React, due to async, it's possible a refresh was asked for before the CellComp // has been set. If this happens, we skip the refresh, as the cell is going to be // initialised anyway once the CellComp is set. if (!this.cellComp) { return; } var colDef = this.column.getColDef(); var newData = params != null && !!params.newData; var suppressFlash = (params != null && !!params.suppressFlash) || !!colDef.suppressCellFlash; // we always refresh if cell has no value - this can happen when user provides Cell Renderer and the // cell renderer doesn't rely on a value, instead it could be looking directly at the data, or maybe // printing the current time (which would be silly)???. Generally speaking // non of {field, valueGetter, showRowGroup} is bad in the users application, however for this edge case, it's // best always refresh and take the performance hit rather than never refresh and users complaining in support // that cells are not updating. var noValueProvided = colDef.field == null && colDef.valueGetter == null && colDef.showRowGroup == null; var forceRefresh = (params && params.forceRefresh) || noValueProvided || newData; var valuesDifferent = this.updateAndFormatValue(); var dataNeedsUpdating = forceRefresh || valuesDifferent; if (dataNeedsUpdating) { // if it's 'new data', then we don't refresh the cellRenderer, even if refresh method is available. // this is because if the whole data is new (ie we are showing stock price 'BBA' now and not 'SSD') // then we are not showing a movement in the stock price, rather we are showing different stock. this.showValue(newData); // we don't want to flash the cells when processing a filter change, as otherwise the UI would // be to busy. see comment in FilterManager with regards processingFilterChange var processingFilterChange = this.beans.filterManager.isSuppressFlashingCellsBecauseFiltering(); var flashCell = !suppressFlash && !processingFilterChange && (this.beans.gridOptionsService.is('enableCellChangeFlash') || colDef.enableCellChangeFlash); if (flashCell) { this.flashCell(); } (_a = this.cellCustomStyleFeature) === null || _a === void 0 ? void 0 : _a.applyUserStyles(); (_b = this.cellCustomStyleFeature) === null || _b === void 0 ? void 0 : _b.applyClassesFromColDef(); } this.refreshToolTip(); // we do cellClassRules even if the value has not changed, so that users who have rules that // look at other parts of the row (where the other part of the row might of changed) will work. (_c = this.cellCustomStyleFeature) === null || _c === void 0 ? void 0 : _c.applyCellClassRules(); }; // cell editors call this, when they want to stop for reasons other // than what we pick up on. eg selecting from a dropdown ends editing. CellCtrl.prototype.stopEditingAndFocus = function (suppressNavigateAfterEdit) { if (suppressNavigateAfterEdit === void 0) { suppressNavigateAfterEdit = false; } this.stopRowOrCellEdit(); this.focusCell(true); if (!suppressNavigateAfterEdit) { this.navigateAfterEdit(); } }; CellCtrl.prototype.navigateAfterEdit = function () { var fullRowEdit = this.beans.gridOptionsService.get('editType') === 'fullRow'; if (fullRowEdit) { return; } var enterMovesDownAfterEdit = this.beans.gridOptionsService.is('enterMovesDownAfterEdit'); if (enterMovesDownAfterEdit) { this.beans.navigationService.navigateToNextCell(null, KeyCode.DOWN, this.getCellPosition(), false); } }; // user can also call this via API CellCtrl.prototype.flashCell = function (delays) { var flashDelay = delays && delays.flashDelay; var fadeDelay = delays && delays.fadeDelay; this.animateCell('data-changed', flashDelay, fadeDelay); }; CellCtrl.prototype.animateCell = function (cssName, flashDelay, fadeDelay) { var _this = this; var _a, _b; var fullName = "ag-cell-" + cssName; var animationFullName = "ag-cell-" + cssName + "-animation"; var gridOptionsService = this.beans.gridOptionsService; if (!flashDelay) { flashDelay = (_a = gridOptionsService.getNum('cellFlashDelay')) !== null && _a !== void 0 ? _a : 500; } if (!exists(fadeDelay)) { fadeDelay = (_b = gridOptionsService.getNum('cellFadeDelay')) !== null && _b !== void 0 ? _b : 1000; } // we want to highlight the cells, without any animation this.cellComp.addOrRemoveCssClass(fullName, true); this.cellComp.addOrRemoveCssClass(animationFullName, false); // then once that is applied, we remove the highlight with animation window.setTimeout(function () { if (!_this.isAlive()) { return; } _this.cellComp.addOrRemoveCssClass(fullName, false); _this.cellComp.addOrRemoveCssClass(animationFullName, true); _this.eGui.style.transition = "background-color " + fadeDelay + "ms"; window.setTimeout(function () { if (!_this.isAlive()) { return; } // and then to leave things as we got them, we remove the animation _this.cellComp.addOrRemoveCssClass(animationFullName, false); _this.eGui.style.transition = ''; }, fadeDelay); }, flashDelay); }; CellCtrl.prototype.onFlashCells = function (event) { if (!this.cellComp) { return; } var cellId = this.beans.cellPositionUtils.createId(this.getCellPosition()); var shouldFlash = event.cells[cellId]; if (shouldFlash) { this.animateCell('highlight'); } }; CellCtrl.prototype.isCellEditable = function () { return this.column.isCellEditable(this.rowNode); }; CellCtrl.prototype.isSuppressFillHandle = function () { return this.column.isSuppressFillHandle(); }; CellCtrl.prototype.formatValue = function (value) { var res = this.callValueFormatter(value); return res != null ? res : value; }; CellCtrl.prototype.callValueFormatter = function (value) { return this.beans.valueFormatterService.formatValue(this.column, this.rowNode, value); }; CellCtrl.prototype.updateAndFormatValue = function (force) { if (force === void 0) { force = false; } var oldValue = this.value; var oldValueFormatted = this.valueFormatted; this.value = this.getValueFromValueService(); this.valueFormatted = this.callValueFormatter(this.value); var valuesDifferent = force ? true : !this.valuesAreEqual(oldValue, this.value) || this.valueFormatted != oldValueFormatted; return valuesDifferent; }; CellCtrl.prototype.valuesAreEqual = function (val1, val2) { // if the user provided an equals method, use that, otherwise do simple comparison var colDef = this.column.getColDef(); return colDef.equals ? colDef.equals(val1, val2) : val1 === val2; }; CellCtrl.prototype.getComp = function () { return this.cellComp; }; CellCtrl.prototype.getValueFromValueService = function () { // if we don't check this, then the grid will render leaf groups as open even if we are not // allowing the user to open leaf groups. confused? remember for pivot mode we don't allow // opening leaf groups, so we have to force leafGroups to be closed in case the user expanded // them via the API, or user user expanded them in the UI before turning on pivot mode var lockedClosedGroup = this.rowNode.leafGroup && this.beans.columnModel.isPivotMode(); var isOpenGroup = this.rowNode.group && this.rowNode.expanded && !this.rowNode.footer && !lockedClosedGroup; // are we showing group footers var groupFootersEnabled = this.beans.gridOptionsService.is('groupIncludeFooter'); // if doing footers, we normally don't show agg data at group level when group is open var groupAlwaysShowAggData = this.beans.gridOptionsService.is('groupSuppressBlankHeader'); // if doing grouping and footers, we don't want to include the agg value // in the header when the group is open var ignoreAggData = (isOpenGroup && groupFootersEnabled) && !groupAlwaysShowAggData; var value = this.beans.valueService.getValue(this.column, this.rowNode, false, ignoreAggData); return value; }; CellCtrl.prototype.getValue = function () { return this.value; }; CellCtrl.prototype.getValueFormatted = function () { return this.valueFormatted; }; CellCtrl.prototype.addDomData = function () { var _this = this; var element = this.getGui(); this.beans.gridOptionsService.setDomData(element, CellCtrl.DOM_DATA_KEY_CELL_CTRL, this); this.addDestroyFunc(function () { return _this.beans.gridOptionsService.setDomData(element, CellCtrl.DOM_DATA_KEY_CELL_CTRL, null); }); }; CellCtrl.prototype.createEvent = function (domEvent, eventType) { var event = { type: eventType, node: this.rowNode, data: this.rowNode.data, value: this.value, column: this.column, colDef: this.column.getColDef(), context: this.beans.gridOptionsService.context, api: this.beans.gridApi, columnApi: this.beans.columnApi, rowPinned: this.rowNode.rowPinned, event: domEvent, rowIndex: this.rowNode.rowIndex }; return event; }; CellCtrl.prototype.onKeyPress = function (event) { var _a; (_a = this.cellKeyboardListenerFeature) === null || _a === void 0 ? void 0 : _a.onKeyPress(event); }; CellCtrl.prototype.onKeyDown = function (event) { var _a; (_a = this.cellKeyboardListenerFeature) === null || _a === void 0 ? void 0 : _a.onKeyDown(event); }; CellCtrl.prototype.onMouseEvent = function (eventName, mouseEvent) { var _a; (_a = this.cellMouseListenerFeature) === null || _a === void 0 ? void 0 : _a.onMouseEvent(eventName, mouseEvent); }; CellCtrl.prototype.getGui = function () { return this.eGui; }; CellCtrl.prototype.refreshToolTip = function () { var _a; (_a = this.tooltipFeature) === null || _a === void 0 ? void 0 : _a.refreshToolTip(); }; CellCtrl.prototype.getColSpanningList = function () { return this.cellPositionFeature.getColSpanningList(); }; CellCtrl.prototype.onLeftChanged = function () { var _a; if (!this.cellComp) { return; } (_a = this.cellPositionFeature) === null || _a === void 0 ? void 0 : _a.onLeftChanged(); }; CellCtrl.prototype.onDisplayedColumnsChanged = function () { if (!this.eGui) { return; } this.setAriaColIndex(); }; CellCtrl.prototype.setAriaColIndex = function () { var colIdx = this.beans.columnModel.getAriaColumnIndex(this.column); setAriaColIndex(this.getGui(), colIdx); // for react, we don't use JSX, as it slowed down column moving }; CellCtrl.prototype.isSuppressNavigable = function () { return this.column.isSuppressNavigable(this.rowNode); }; CellCtrl.prototype.onWidthChanged = function () { var _a; return (_a = this.cellPositionFeature) === null || _a === void 0 ? void 0 : _a.onWidthChanged(); }; CellCtrl.prototype.getColumn = function () { return this.column; }; CellCtrl.prototype.getRowNode = function () { return this.rowNode; }; CellCtrl.prototype.getBeans = function () { return this.beans; }; CellCtrl.prototype.isPrintLayout = function () { return this.printLayout; }; CellCtrl.prototype.appendChild = function (htmlElement) { this.eGui.appendChild(htmlElement); }; CellCtrl.prototype.refreshHandle = function () { if (this.cellRangeFeature) { this.cellRangeFeature.refreshHandle(); } }; CellCtrl.prototype.getCellPosition = function () { return this.cellPosition; }; CellCtrl.prototype.isEditing = function () { return this.editing; }; // called by rowRenderer when user navigates via tab key CellCtrl.prototype.startRowOrCellEdit = function (key, charPress, event) { if (event === void 0) { event = null; } if (!this.cellComp) { return; } if (this.beans.gridOptionsService.get('editType') === 'fullRow') { this.rowCtrl.startRowEditing(key, charPress, this); } else { this.startEditing(key, charPress, true, event); } }; CellCtrl.prototype.getRowCtrl = function () { return this.rowCtrl; }; CellCtrl.prototype.getRowPosition = function () { return { rowIndex: this.cellPosition.rowIndex, rowPinned: this.cellPosition.rowPinned }; }; CellCtrl.prototype.updateRangeBordersIfRangeCount = function () { if (!this.cellComp) { return; } if (this.cellRangeFeature) { this.cellRangeFeature.updateRangeBordersIfRangeCount(); } }; CellCtrl.prototype.onRangeSelectionChanged = function () { if (!this.cellComp) { return; } if (this.cellRangeFeature) { this.cellRangeFeature.onRangeSelectionChanged(); } }; CellCtrl.prototype.isRangeSelectionEnabled = function () { return this.cellRangeFeature != null; }; CellCtrl.prototype.focusCell = function (forceBrowserFocus) { if (forceBrowserFocus === void 0) { forceBrowserFocus = false; } this.beans.focusService.setFocusedCell({ rowIndex: this.getCellPosition().rowIndex, column: this.column, rowPinned: this.rowNode.rowPinned, forceBrowserFocus: forceBrowserFocus }); }; CellCtrl.prototype.onRowIndexChanged = function () { // when index changes, this influences items that need the index, so we update the // grid cell so they are working off the new index. this.createCellPosition(); // when the index of the row changes, ie means the cell may have lost or gained focus this.onCellFocused(); // check range selection if (this.cellRangeFeature) { this.cellRangeFeature.onRangeSelectionChanged(); } }; CellCtrl.prototype.onFirstRightPinnedChanged = function () { if (!this.cellComp) { return; } var firstRightPinned = this.column.isFirstRightPinned(); this.cellComp.addOrRemoveCssClass(CSS_CELL_FIRST_RIGHT_PINNED, firstRightPinned); }; CellCtrl.prototype.onLastLeftPinnedChanged = function () { if (!this.cellComp) { return; } var lastLeftPinned = this.column.isLastLeftPinned(); this.cellComp.addOrRemoveCssClass(CSS_CELL_LAST_LEFT_PINNED, lastLeftPinned); }; CellCtrl.prototype.onCellFocused = function (event) { if (!this.cellComp || this.beans.gridOptionsService.is('suppressCellFocus')) { return; } var cellFocused = this.beans.focusService.isCellFocused(this.cellPosition); this.cellComp.addOrRemoveCssClass(CSS_CELL_FOCUS, cellFocused); // see if we need to force browser focus - this can happen if focus is programmatically set if (cellFocused && event && event.forceBrowserFocus) { var focusEl = this.cellComp.getFocusableElement(); focusEl.focus({ preventScroll: !!event.preventScrollOnBrowserFocus }); } // if another cell was focused, and we are editing, then stop editing var fullRowEdit = this.beans.gridOptionsService.get('editType') === 'fullRow'; if (!cellFocused && !fullRowEdit && this.editing) { this.stopRowOrCellEdit(); } }; CellCtrl.prototype.createCellPosition = function () { this.cellPosition = { rowIndex: this.rowNode.rowIndex, rowPinned: makeNull(this.rowNode.rowPinned), column: this.column }; }; // CSS Classes that only get applied once, they never change CellCtrl.prototype.applyStaticCssClasses = function () { this.cellComp.addOrRemoveCssClass(CSS_CELL, true); this.cellComp.addOrRemoveCssClass(CSS_CELL_NOT_INLINE_EDITING, true); // normal cells fill the height of the row. autoHeight cells have no height to let them // fit the height of content. var autoHeight = this.column.isAutoHeight() == true; this.cellComp.addOrRemoveCssClass(CSS_AUTO_HEIGHT, autoHeight); this.cellComp.addOrRemoveCssClass(CSS_NORMAL_HEIGHT, !autoHeight); }; CellCtrl.prototype.onColumnHover = function () { if (!this.cellComp) { return; } if (!this.beans.gridOptionsService.is('columnHoverHighlight')) { return; } var isHovered = this.beans.columnHoverService.isHovered(this.column); this.cellComp.addOrRemoveCssClass(CSS_COLUMN_HOVER, isHovered); }; CellCtrl.prototype.onColDefChanged = function () { if (!this.cellComp) { return; } this.setWrapText(); if (!this.editing) { this.refreshCell({ forceRefresh: true, suppressFlash: true }); } }; CellCtrl.prototype.setWrapText = function () { var value = this.column.getColDef().wrapText == true; this.cellComp.addOrRemoveCssClass(CSS_CELL_WRAP_TEXT, value); }; CellCtrl.prototype.dispatchCellContextMenuEvent = function (event) { var colDef = this.column.getColDef(); var cellContextMenuEvent = this.createEvent(event, Events.EVENT_CELL_CONTEXT_MENU); this.beans.eventService.dispatchEvent(cellContextMenuEvent); if (colDef.onCellContextMenu) { // to make the callback async, do in a timeout window.setTimeout(function () { return colDef.onCellContextMenu(cellContextMenuEvent); }, 0); } }; CellCtrl.prototype.getCellRenderer = function () { return this.cellComp ? this.cellComp.getCellRenderer() : null; }; CellCtrl.prototype.getCellEditor = function () { return this.cellComp ? this.cellComp.getCellEditor() : null; }; CellCtrl.prototype.destroy = function () { this.onCellCompAttachedFuncs = []; _super.prototype.destroy.call(this); }; CellCtrl.prototype.createSelectionCheckbox = function () { var cbSelectionComponent = new CheckboxSelectionComponent(); this.beans.context.createBean(cbSelectionComponent); cbSelectionComponent.init({ rowNode: this.rowNode, column: this.column }); // put the checkbox in before the value return cbSelectionComponent; }; CellCtrl.prototype.createDndSource = function () { var dndSourceComp = new DndSourceComp(this.rowNode, this.column, this.beans, this.eGui); this.beans.context.createBean(dndSourceComp); return dndSourceComp; }; CellCtrl.prototype.registerRowDragger = function (customElement, dragStartPixels, suppressVisibilityChange) { var _this = this; // if previously existed, then we are only updating if (this.customRowDragComp) { this.customRowDragComp.setDragElement(customElement, dragStartPixels); return; } var newComp = this.createRowDragComp(customElement, dragStartPixels, suppressVisibilityChange); if (newComp) { this.customRowDragComp = newComp; this.addDestroyFunc(function () { _this.beans.context.destroyBean(newComp); _this.customRowDragComp = null; }); } }; CellCtrl.prototype.createRowDragComp = function (customElement, dragStartPixels, suppressVisibilityChange) { var _this = this; var pagination = this.beans.gridOptionsService.is('pagination'); var rowDragManaged = this.beans.gridOptionsService.is('rowDragManaged'); var clientSideRowModelActive = this.beans.gridOptionsService.isRowModelType('clientSide'); if (rowDragManaged) { // row dragging only available in default row model if (!clientSideRowModelActive) { doOnce(function () { return console.warn('AG Grid: managed row dragging is only allowed in the Client Side Row Model'); }, 'CellComp.addRowDragging'); return; } if (pagination) { doOnce(function () { return console.warn('AG Grid: managed row dragging is not possible when doing pagination'); }, 'CellComp.addRowDragging'); return; } } // otherwise (normal case) we are creating a RowDraggingComp for the first time var rowDragComp = new RowDragComp(function () { return _this.value; }, this.rowNode, this.column, customElement, dragStartPixels, suppressVisibilityChange); this.beans.context.createBean(rowDragComp); return rowDragComp; }; CellCtrl.DOM_DATA_KEY_CELL_CTRL = 'cellCtrl'; return CellCtrl; }(BeanStub)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$14 = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __values$3 = (undefined && undefined.__values) || function(o) { var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; if (m) return m.call(o); if (o && typeof o.length === "number") return { next: function () { if (o && i >= o.length) o = void 0; return { value: o && o[i++], done: !o }; } }; throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); }; var __read$b = (undefined && undefined.__read) || function (o, n) { var m = typeof Symbol === "function" && o[Symbol.iterator]; if (!m) return o; var i = m.call(o), r, ar = [], e; try { while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); } catch (error) { e = { error: error }; } finally { try { if (r && !r.done && (m = i["return"])) m.call(i); } finally { if (e) throw e.error; } } return ar; }; var __spread$8 = (undefined && undefined.__spread) || function () { for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read$b(arguments[i])); return ar; }; var RowType; (function (RowType) { RowType["Normal"] = "Normal"; RowType["FullWidth"] = "FullWidth"; RowType["FullWidthLoading"] = "FullWidthLoading"; RowType["FullWidthGroup"] = "FullWidthGroup"; RowType["FullWidthDetail"] = "FullWidthDetail"; })(RowType || (RowType = {})); var instanceIdSequence$2 = 0; var RowCtrl = /** @class */ (function (_super) { __extends$14(RowCtrl, _super); function RowCtrl(rowNode, beans, animateIn, useAnimationFrameForCreate, printLayout) { var _this = _super.call(this) || this; _this.allRowGuis = []; _this.active = true; _this.centerCellCtrls = { list: [], map: {} }; _this.leftCellCtrls = { list: [], map: {} }; _this.rightCellCtrls = { list: [], map: {} }; _this.slideInAnimation = { left: false, center: false, right: false, fullWidth: false }; _this.fadeInAnimation = { left: false, center: false, right: false, fullWidth: false }; _this.lastMouseDownOnDragger = false; _this.updateColumnListsPending = false; _this.businessKeySanitised = null; _this.beans = beans; _this.rowNode = rowNode; _this.paginationPage = _this.beans.paginationProxy.getCurrentPage(); _this.useAnimationFrameForCreate = useAnimationFrameForCreate; _this.printLayout = printLayout; _this.instanceId = rowNode.id + '-' + instanceIdSequence$2++; _this.setAnimateFlags(animateIn); _this.initRowBusinessKey(); _this.rowFocused = _this.beans.focusService.isRowFocused(_this.rowNode.rowIndex, _this.rowNode.rowPinned); _this.rowLevel = _this.beans.rowCssClassCalculator.calculateRowLevel(_this.rowNode); _this.setRowType(); _this.addListeners(); return _this; } RowCtrl.prototype.initRowBusinessKey = function () { var businessKeyForNodeFunc = this.beans.gridOptionsService.get('getBusinessKeyForNode'); if (typeof businessKeyForNodeFunc !== 'function') { return; } var businessKey = businessKeyForNodeFunc(this.rowNode); this.businessKeySanitised = escapeString(businessKey); }; RowCtrl.prototype.isSticky = function () { return this.rowNode.sticky; }; RowCtrl.prototype.getBeans = function () { return this.beans; }; RowCtrl.prototype.getInstanceId = function () { return this.instanceId; }; RowCtrl.prototype.setComp = function (rowComp, element, containerType) { var gui = { rowComp: rowComp, element: element, containerType: containerType }; this.allRowGuis.push(gui); if (containerType === exports.RowContainerType.LEFT) { this.leftGui = gui; } else if (containerType === exports.RowContainerType.RIGHT) { this.rightGui = gui; } else if (containerType === exports.RowContainerType.FULL_WIDTH) { this.fullWidthGui = gui; } else { this.centerGui = gui; } this.initialiseRowComp(gui); // pinned rows render before the main grid body in the SSRM, only fire the event after the main body has rendered. if (this.rowType !== 'FullWidthLoading' && !this.rowNode.rowPinned) { // this is fired within setComp as we know that the component renderer is now trying to render. // linked with the fact the function implementation queues behind requestAnimationFrame should allow // us to be certain that all rendering is done by the time the event fires. this.beans.rowRenderer.dispatchFirstDataRenderedEvent(); } }; RowCtrl.prototype.unsetComp = function (containerType) { this.allRowGuis = this.allRowGuis .filter(function (rowGui) { return rowGui.containerType !== containerType; }); if (containerType === exports.RowContainerType.LEFT) { this.leftGui = undefined; } else if (containerType === exports.RowContainerType.RIGHT) { this.rightGui = undefined; } else if (containerType === exports.RowContainerType.FULL_WIDTH) { this.fullWidthGui = undefined; } }; RowCtrl.prototype.isCacheable = function () { return this.rowType === RowType.FullWidthDetail && this.beans.gridOptionsService.is('keepDetailRows'); }; RowCtrl.prototype.setCached = function (cached) { var displayValue = cached ? 'none' : ''; this.allRowGuis.forEach(function (rg) { return rg.element.style.display = displayValue; }); }; RowCtrl.prototype.initialiseRowComp = function (gui) { var _this = this; var gos = this.beans.gridOptionsService; this.onRowHeightChanged(gui); this.updateRowIndexes(gui); this.setFocusedClasses(gui); this.setStylesFromGridOptions(gui); if (gos.isRowSelection() && this.rowNode.selectable) { this.onRowSelected(gui); } this.updateColumnLists(!this.useAnimationFrameForCreate); var comp = gui.rowComp; comp.setRole('row'); var initialRowClasses = this.getInitialRowClasses(gui.containerType); initialRowClasses.forEach(function (name) { return comp.addOrRemoveCssClass(name, true); }); this.executeSlideAndFadeAnimations(gui); if (this.rowNode.group) { setAriaExpanded(gui.element, this.rowNode.expanded == true); } var rowIdSanitised = escapeString(this.rowNode.id); if (rowIdSanitised != null) { comp.setRowId(rowIdSanitised); } if (this.businessKeySanitised != null) { comp.setRowBusinessKey(this.businessKeySanitised); } if (this.isFullWidth() && !this.beans.gridOptionsService.is('suppressCellFocus')) { comp.setTabIndex(-1); } // DOM DATA gos.setDomData(gui.element, RowCtrl.DOM_DATA_KEY_ROW_CTRL, this); this.addDestroyFunc(function () { return gos.setDomData(gui.element, RowCtrl.DOM_DATA_KEY_ROW_CTRL, null); }); // adding hover functionality adds listener to this row, so we // do it lazily in an animation frame if (this.useAnimationFrameForCreate) { this.beans.animationFrameService.createTask(this.addHoverFunctionality.bind(this, gui.element), this.rowNode.rowIndex, 'createTasksP2'); } else { this.addHoverFunctionality(gui.element); } if (this.isFullWidth()) { this.setupFullWidth(gui); } if (gos.is('rowDragEntireRow')) { this.addRowDraggerToRow(gui); } if (this.useAnimationFrameForCreate) { // the height animation we only want active after the row is alive for 1 second. // this stops the row animation working when rows are initially created. otherwise // auto-height rows get inserted into the dom and resized immediately, which gives // very bad UX (eg 10 rows get inserted, then all 10 expand, look particularly bad // when scrolling). so this makes sure when rows are shown for the first time, they // are resized immediately without animation. this.beans.animationFrameService.addDestroyTask(function () { if (!_this.isAlive()) { return; } gui.rowComp.addOrRemoveCssClass('ag-after-created', true); }); } this.executeProcessRowPostCreateFunc(); }; RowCtrl.prototype.executeSlideAndFadeAnimations = function (gui) { var _this = this; var containerType = gui.containerType; var shouldSlide = this.slideInAnimation[containerType]; if (shouldSlide) { executeNextVMTurn(function () { _this.onTopChanged(); }); this.slideInAnimation[containerType] = false; } var shouldFade = this.fadeInAnimation[containerType]; if (shouldFade) { executeNextVMTurn(function () { gui.rowComp.addOrRemoveCssClass('ag-opacity-zero', false); }); this.fadeInAnimation[containerType] = false; } }; RowCtrl.prototype.addRowDraggerToRow = function (gui) { if (this.beans.gridOptionsService.isEnableRangeSelection()) { doOnce(function () { console.warn('AG Grid: Setting `rowDragEntireRow: true` in the gridOptions doesn\'t work with `enableRangeSelection: true`'); }, 'rowDragAndRangeSelectionEnabled'); return; } var translate = this.beans.localeService.getLocaleTextFunc(); var rowDragComp = new RowDragComp(function () { return "1 " + translate('rowDragRow', 'row'); }, this.rowNode, undefined, gui.element, undefined, true); this.createManagedBean(rowDragComp, this.beans.context); }; RowCtrl.prototype.setupFullWidth = function (gui) { var pinned = this.getPinnedForContainer(gui.containerType); var params = this.createFullWidthParams(gui.element, pinned); if (this.rowType == RowType.FullWidthDetail) { if (!ModuleRegistry.assertRegistered(exports.ModuleNames.MasterDetailModule, "cell renderer 'agDetailCellRenderer' (for master detail)")) { return; } } var compDetails; switch (this.rowType) { case RowType.FullWidthDetail: compDetails = this.beans.userComponentFactory.getFullWidthDetailCellRendererDetails(params); break; case RowType.FullWidthGroup: compDetails = this.beans.userComponentFactory.getFullWidthGroupCellRendererDetails(params); break; case RowType.FullWidthLoading: compDetails = this.beans.userComponentFactory.getFullWidthLoadingCellRendererDetails(params); break; default: compDetails = this.beans.userComponentFactory.getFullWidthCellRendererDetails(params); break; } gui.rowComp.showFullWidth(compDetails); }; RowCtrl.prototype.isPrintLayout = function () { return this.printLayout; }; RowCtrl.prototype.getFullWidthCellRenderer = function () { var _a, _b; return (_b = (_a = this.fullWidthGui) === null || _a === void 0 ? void 0 : _a.rowComp) === null || _b === void 0 ? void 0 : _b.getFullWidthCellRenderer(); }; // use by autoWidthCalculator, as it clones the elements RowCtrl.prototype.getCellElement = function (column) { var cellCtrl = this.getCellCtrl(column); return cellCtrl ? cellCtrl.getGui() : null; }; RowCtrl.prototype.executeProcessRowPostCreateFunc = function () { var _a; var func = this.beans.gridOptionsService.getCallback('processRowPostCreate'); if (!func || !this.areAllContainersReady()) { return; } var params = { eRow: (_a = this.centerGui) === null || _a === void 0 ? void 0 : _a.element, ePinnedLeftRow: this.leftGui ? this.leftGui.element : undefined, ePinnedRightRow: this.rightGui ? this.rightGui.element : undefined, node: this.rowNode, rowIndex: this.rowNode.rowIndex, addRenderedRowListener: this.addEventListener.bind(this), }; func(params); }; RowCtrl.prototype.areAllContainersReady = function () { var isLeftReady = !!this.leftGui || !this.beans.columnModel.isPinningLeft(); var isCenterReady = !!this.centerGui; var isRightReady = !!this.rightGui || !this.beans.columnModel.isPinningRight(); return isLeftReady && isCenterReady && isRightReady; }; RowCtrl.prototype.setRowType = function () { var isStub = this.rowNode.stub; var isFullWidthCell = this.rowNode.isFullWidthCell(); var isDetailCell = this.beans.doingMasterDetail && this.rowNode.detail; var pivotMode = this.beans.columnModel.isPivotMode(); // we only use full width for groups, not footers. it wouldn't make sense to include footers if not looking // for totals. if users complain about this, then we should introduce a new property 'footerUseEntireRow' // so each can be set independently (as a customer complained about footers getting full width, hence // introducing this logic) var isGroupRow = !!this.rowNode.group && !this.rowNode.footer; var isFullWidthGroup = isGroupRow && this.beans.gridOptionsService.isGroupUseEntireRow(pivotMode); if (isStub) { this.rowType = RowType.FullWidthLoading; } else if (isDetailCell) { this.rowType = RowType.FullWidthDetail; } else if (isFullWidthCell) { this.rowType = RowType.FullWidth; } else if (isFullWidthGroup) { this.rowType = RowType.FullWidthGroup; } else { this.rowType = RowType.Normal; } }; RowCtrl.prototype.updateColumnLists = function (suppressAnimationFrame) { var _this = this; if (suppressAnimationFrame === void 0) { suppressAnimationFrame = false; } if (this.isFullWidth()) { return; } var noAnimation = suppressAnimationFrame || this.beans.gridOptionsService.is('suppressAnimationFrame') || this.printLayout; if (noAnimation) { this.updateColumnListsImpl(); return; } if (this.updateColumnListsPending) { return; } this.beans.animationFrameService.createTask(function () { if (!_this.active) { return; } _this.updateColumnListsImpl(); }, this.rowNode.rowIndex, 'createTasksP1'); this.updateColumnListsPending = true; }; RowCtrl.prototype.createCellCtrls = function (prev, cols, pinned) { var _this = this; if (pinned === void 0) { pinned = null; } var res = { list: [], map: {} }; var addCell = function (colInstanceId, cellCtrl) { res.list.push(cellCtrl); res.map[colInstanceId] = cellCtrl; }; cols.forEach(function (col) { // we use instanceId's rather than colId as it's possible there is a Column with same Id, // but it's referring to a different column instance. Happens a lot with pivot, as pivot col id's are // reused eg pivot_0, pivot_1 etc var colInstanceId = col.getInstanceId(); var cellCtrl = prev.map[colInstanceId]; if (!cellCtrl) { cellCtrl = new CellCtrl(col, _this.rowNode, _this.beans, _this); } addCell(colInstanceId, cellCtrl); }); prev.list.forEach(function (prevCellCtrl) { var cellInResult = res.map[prevCellCtrl.getColumn().getInstanceId()] != null; if (cellInResult) { return; } var keepCell = !_this.isCellEligibleToBeRemoved(prevCellCtrl, pinned); if (keepCell) { addCell(prevCellCtrl.getColumn().getInstanceId(), prevCellCtrl); return; } prevCellCtrl.destroy(); }); return res; }; RowCtrl.prototype.updateColumnListsImpl = function () { var _this = this; this.updateColumnListsPending = false; var columnModel = this.beans.columnModel; if (this.printLayout) { this.centerCellCtrls = this.createCellCtrls(this.centerCellCtrls, columnModel.getAllDisplayedColumns()); this.leftCellCtrls = { list: [], map: {} }; this.rightCellCtrls = { list: [], map: {} }; } else { var centerCols = columnModel.getViewportCenterColumnsForRow(this.rowNode); this.centerCellCtrls = this.createCellCtrls(this.centerCellCtrls, centerCols); var leftCols = columnModel.getDisplayedLeftColumnsForRow(this.rowNode); this.leftCellCtrls = this.createCellCtrls(this.leftCellCtrls, leftCols, 'left'); var rightCols = columnModel.getDisplayedRightColumnsForRow(this.rowNode); this.rightCellCtrls = this.createCellCtrls(this.rightCellCtrls, rightCols, 'right'); } this.allRowGuis.forEach(function (item) { var cellControls = item.containerType === exports.RowContainerType.LEFT ? _this.leftCellCtrls : item.containerType === exports.RowContainerType.RIGHT ? _this.rightCellCtrls : _this.centerCellCtrls; item.rowComp.setCellCtrls(cellControls.list); }); }; RowCtrl.prototype.isCellEligibleToBeRemoved = function (cellCtrl, nextContainerPinned) { var REMOVE_CELL = true; var KEEP_CELL = false; // always remove the cell if it's not rendered or if it's in the wrong pinned location var column = cellCtrl.getColumn(); if (column.getPinned() != nextContainerPinned) { return REMOVE_CELL; } // we want to try and keep editing and focused cells var editing = cellCtrl.isEditing(); var focused = this.beans.focusService.isCellFocused(cellCtrl.getCellPosition()); var mightWantToKeepCell = editing || focused; if (mightWantToKeepCell) { var column_1 = cellCtrl.getColumn(); var displayedColumns = this.beans.columnModel.getAllDisplayedColumns(); var cellStillDisplayed = displayedColumns.indexOf(column_1) >= 0; return cellStillDisplayed ? KEEP_CELL : REMOVE_CELL; } return REMOVE_CELL; }; RowCtrl.prototype.setAnimateFlags = function (animateIn) { if (this.isSticky() || !animateIn) { return; } var oldRowTopExists = exists(this.rowNode.oldRowTop); var pinningLeft = this.beans.columnModel.isPinningLeft(); var pinningRight = this.beans.columnModel.isPinningRight(); if (oldRowTopExists) { // if the row had a previous position, we slide it in this.slideInAnimation.center = true; this.slideInAnimation.left = pinningLeft; this.slideInAnimation.right = pinningRight; } else { // if the row had no previous position, we fade it in this.fadeInAnimation.center = true; this.fadeInAnimation.left = pinningLeft; this.fadeInAnimation.right = pinningRight; } }; RowCtrl.prototype.isEditing = function () { return this.editingRow; }; RowCtrl.prototype.stopRowEditing = function (cancel) { this.stopEditing(cancel); }; RowCtrl.prototype.isFullWidth = function () { return this.rowType !== RowType.Normal; }; RowCtrl.prototype.getRowType = function () { return this.rowType; }; RowCtrl.prototype.refreshFullWidth = function () { var _this = this; // returns 'true' if refresh succeeded var tryRefresh = function (gui, pinned) { if (!gui) { return true; } // no refresh needed var cellRenderer = gui.rowComp.getFullWidthCellRenderer(); // no cell renderer, either means comp not yet ready, or comp ready but now reference // to it (happens in react when comp is stateless). if comp not ready, we don't need to // refresh, however we don't know which one, so we refresh to cover the case where it's // react comp without reference so need to force a refresh if (!cellRenderer) { return false; } // no refresh method present, so can't refresh, hard refresh needed if (!cellRenderer.refresh) { return false; } var params = _this.createFullWidthParams(gui.element, pinned); var refreshSucceeded = cellRenderer.refresh(params); return refreshSucceeded; }; var fullWidthSuccess = tryRefresh(this.fullWidthGui, null); var centerSuccess = tryRefresh(this.centerGui, null); var leftSuccess = tryRefresh(this.leftGui, 'left'); var rightSuccess = tryRefresh(this.rightGui, 'right'); var allFullWidthRowsRefreshed = fullWidthSuccess && centerSuccess && leftSuccess && rightSuccess; return allFullWidthRowsRefreshed; }; RowCtrl.prototype.addListeners = function () { var _this = this; this.addManagedListener(this.rowNode, RowNode.EVENT_HEIGHT_CHANGED, function () { return _this.onRowHeightChanged(); }); this.addManagedListener(this.rowNode, RowNode.EVENT_ROW_SELECTED, function () { return _this.onRowSelected(); }); this.addManagedListener(this.rowNode, RowNode.EVENT_ROW_INDEX_CHANGED, this.onRowIndexChanged.bind(this)); this.addManagedListener(this.rowNode, RowNode.EVENT_TOP_CHANGED, this.onTopChanged.bind(this)); this.addManagedListener(this.rowNode, RowNode.EVENT_EXPANDED_CHANGED, this.updateExpandedCss.bind(this)); this.addManagedListener(this.rowNode, RowNode.EVENT_HAS_CHILDREN_CHANGED, this.updateExpandedCss.bind(this)); this.addManagedListener(this.rowNode, RowNode.EVENT_DATA_CHANGED, this.onRowNodeDataChanged.bind(this)); this.addManagedListener(this.rowNode, RowNode.EVENT_CELL_CHANGED, this.onRowNodeCellChanged.bind(this)); this.addManagedListener(this.rowNode, RowNode.EVENT_HIGHLIGHT_CHANGED, this.onRowNodeHighlightChanged.bind(this)); this.addManagedListener(this.rowNode, RowNode.EVENT_DRAGGING_CHANGED, this.onRowNodeDraggingChanged.bind(this)); this.addManagedListener(this.rowNode, RowNode.EVENT_UI_LEVEL_CHANGED, this.onUiLevelChanged.bind(this)); var eventService = this.beans.eventService; this.addManagedListener(eventService, Events.EVENT_PAGINATION_PIXEL_OFFSET_CHANGED, this.onPaginationPixelOffsetChanged.bind(this)); this.addManagedListener(eventService, Events.EVENT_HEIGHT_SCALE_CHANGED, this.onTopChanged.bind(this)); this.addManagedListener(eventService, Events.EVENT_DISPLAYED_COLUMNS_CHANGED, this.onDisplayedColumnsChanged.bind(this)); this.addManagedListener(eventService, Events.EVENT_VIRTUAL_COLUMNS_CHANGED, this.onVirtualColumnsChanged.bind(this)); this.addManagedListener(eventService, Events.EVENT_CELL_FOCUSED, this.onCellFocused.bind(this)); this.addManagedListener(eventService, Events.EVENT_CELL_FOCUS_CLEARED, this.onCellFocusCleared.bind(this)); this.addManagedListener(eventService, Events.EVENT_PAGINATION_CHANGED, this.onPaginationChanged.bind(this)); this.addManagedListener(eventService, Events.EVENT_MODEL_UPDATED, this.onModelUpdated.bind(this)); this.addManagedListener(eventService, Events.EVENT_COLUMN_MOVED, this.onColumnMoved.bind(this)); this.addListenersForCellComps(); }; RowCtrl.prototype.onColumnMoved = function () { this.updateColumnLists(); }; RowCtrl.prototype.addListenersForCellComps = function () { var _this = this; this.addManagedListener(this.rowNode, RowNode.EVENT_ROW_INDEX_CHANGED, function () { _this.getAllCellCtrls().forEach(function (cellCtrl) { return cellCtrl.onRowIndexChanged(); }); }); this.addManagedListener(this.rowNode, RowNode.EVENT_CELL_CHANGED, function (event) { _this.getAllCellCtrls().forEach(function (cellCtrl) { return cellCtrl.onCellChanged(event); }); }); }; RowCtrl.prototype.onRowNodeDataChanged = function (event) { // if this is an update, we want to refresh, as this will allow the user to put in a transition // into the cellRenderer refresh method. otherwise this might be completely new data, in which case // we will want to completely replace the cells this.getAllCellCtrls().forEach(function (cellCtrl) { return cellCtrl.refreshCell({ suppressFlash: !event.update, newData: !event.update }); }); // check for selected also, as this could be after lazy loading of the row data, in which case // the id might of just gotten set inside the row and the row selected state may of changed // as a result. this is what happens when selected rows are loaded in virtual pagination. // - niall note - since moving to the stub component, this may no longer be true, as replacing // the stub component now replaces the entire row this.onRowSelected(); // as data has changed, then the style and class needs to be recomputed this.postProcessCss(); }; RowCtrl.prototype.onRowNodeCellChanged = function () { // as data has changed, then the style and class needs to be recomputed this.postProcessCss(); }; RowCtrl.prototype.postProcessCss = function () { this.setStylesFromGridOptions(); this.postProcessClassesFromGridOptions(); this.postProcessRowClassRules(); this.postProcessRowDragging(); }; RowCtrl.prototype.onRowNodeHighlightChanged = function () { var highlighted = this.rowNode.highlighted; this.allRowGuis.forEach(function (gui) { var aboveOn = highlighted === exports.RowHighlightPosition.Above; var belowOn = highlighted === exports.RowHighlightPosition.Below; gui.rowComp.addOrRemoveCssClass('ag-row-highlight-above', aboveOn); gui.rowComp.addOrRemoveCssClass('ag-row-highlight-below', belowOn); }); }; RowCtrl.prototype.onRowNodeDraggingChanged = function () { this.postProcessRowDragging(); }; RowCtrl.prototype.postProcessRowDragging = function () { var dragging = this.rowNode.dragging; this.allRowGuis.forEach(function (gui) { return gui.rowComp.addOrRemoveCssClass('ag-row-dragging', dragging); }); }; RowCtrl.prototype.updateExpandedCss = function () { var expandable = this.rowNode.isExpandable(); var expanded = this.rowNode.expanded == true; this.allRowGuis.forEach(function (gui) { gui.rowComp.addOrRemoveCssClass('ag-row-group', expandable); gui.rowComp.addOrRemoveCssClass('ag-row-group-expanded', expandable && expanded); gui.rowComp.addOrRemoveCssClass('ag-row-group-contracted', expandable && !expanded); setAriaExpanded(gui.element, expandable && expanded); }); }; RowCtrl.prototype.onDisplayedColumnsChanged = function () { // we skip animations for onDisplayedColumnChanged, as otherwise the client could remove columns and // then set data, and any old valueGetter's (ie from cols that were removed) would still get called. this.updateColumnLists(true); if (this.beans.columnModel.wasAutoRowHeightEverActive()) { this.rowNode.checkAutoHeights(); } }; RowCtrl.prototype.onVirtualColumnsChanged = function () { this.updateColumnLists(); }; RowCtrl.prototype.getRowPosition = function () { return { rowPinned: makeNull(this.rowNode.rowPinned), rowIndex: this.rowNode.rowIndex }; }; RowCtrl.prototype.onKeyboardNavigate = function (keyboardEvent) { var currentFullWidthComp = this.allRowGuis.find(function (c) { return c.element.contains(keyboardEvent.target); }); var currentFullWidthContainer = currentFullWidthComp ? currentFullWidthComp.element : null; var isFullWidthContainerFocused = currentFullWidthContainer === keyboardEvent.target; if (!isFullWidthContainerFocused) { return; } var node = this.rowNode; var lastFocusedCell = this.beans.focusService.getFocusedCell(); var cellPosition = { rowIndex: node.rowIndex, rowPinned: node.rowPinned, column: (lastFocusedCell && lastFocusedCell.column) }; this.beans.navigationService.navigateToNextCell(keyboardEvent, keyboardEvent.key, cellPosition, true); keyboardEvent.preventDefault(); }; RowCtrl.prototype.onTabKeyDown = function (keyboardEvent) { if (keyboardEvent.defaultPrevented || isStopPropagationForAgGrid(keyboardEvent)) { return; } var currentFullWidthComp = this.allRowGuis.find(function (c) { return c.element.contains(keyboardEvent.target); }); var currentFullWidthContainer = currentFullWidthComp ? currentFullWidthComp.element : null; var isFullWidthContainerFocused = currentFullWidthContainer === keyboardEvent.target; var nextEl = null; if (!isFullWidthContainerFocused) { nextEl = this.beans.focusService.findNextFocusableElement(currentFullWidthContainer, false, keyboardEvent.shiftKey); } if ((this.isFullWidth() && isFullWidthContainerFocused) || !nextEl) { this.beans.navigationService.onTabKeyDown(this, keyboardEvent); } }; RowCtrl.prototype.onFullWidthRowFocused = function (event) { var _a; var node = this.rowNode; var isFocused = !event ? false : this.isFullWidth() && event.rowIndex === node.rowIndex && event.rowPinned == node.rowPinned; var element = this.fullWidthGui ? this.fullWidthGui.element : (_a = this.centerGui) === null || _a === void 0 ? void 0 : _a.element; if (!element) { return; } // can happen with react ui, comp not yet ready element.classList.toggle('ag-full-width-focus', isFocused); if (isFocused) { // we don't scroll normal rows into view when we focus them, so we don't want // to scroll Full Width rows either. element.focus({ preventScroll: true }); } }; RowCtrl.prototype.refreshCell = function (cellCtrl) { this.centerCellCtrls = this.removeCellCtrl(this.centerCellCtrls, cellCtrl); this.leftCellCtrls = this.removeCellCtrl(this.leftCellCtrls, cellCtrl); this.rightCellCtrls = this.removeCellCtrl(this.rightCellCtrls, cellCtrl); this.updateColumnLists(); }; RowCtrl.prototype.removeCellCtrl = function (prev, cellCtrlToRemove) { var res = { list: [], map: {} }; prev.list.forEach(function (cellCtrl) { if (cellCtrl === cellCtrlToRemove) { return; } res.list.push(cellCtrl); res.map[cellCtrl.getInstanceId()] = cellCtrl; }); return res; }; RowCtrl.prototype.onMouseEvent = function (eventName, mouseEvent) { switch (eventName) { case 'dblclick': this.onRowDblClick(mouseEvent); break; case 'click': this.onRowClick(mouseEvent); break; case 'touchstart': case 'mousedown': this.onRowMouseDown(mouseEvent); break; } }; RowCtrl.prototype.createRowEvent = function (type, domEvent) { return { type: type, node: this.rowNode, data: this.rowNode.data, rowIndex: this.rowNode.rowIndex, rowPinned: this.rowNode.rowPinned, context: this.beans.gridOptionsService.context, api: this.beans.gridOptionsService.api, columnApi: this.beans.gridOptionsService.columnApi, event: domEvent }; }; RowCtrl.prototype.createRowEventWithSource = function (type, domEvent) { var event = this.createRowEvent(type, domEvent); // when first developing this, we included the rowComp in the event. // this seems very weird. so when introducing the event types, i left the 'source' // out of the type, and just include the source in the two places where this event // was fired (rowClicked and rowDoubleClicked). it doesn't make sense for any // users to be using this, as the rowComp isn't an object we expose, so would be // very surprising if a user was using it. event.source = this; return event; }; RowCtrl.prototype.onRowDblClick = function (mouseEvent) { if (isStopPropagationForAgGrid(mouseEvent)) { return; } var agEvent = this.createRowEventWithSource(Events.EVENT_ROW_DOUBLE_CLICKED, mouseEvent); this.beans.eventService.dispatchEvent(agEvent); }; RowCtrl.prototype.onRowMouseDown = function (mouseEvent) { this.lastMouseDownOnDragger = isElementChildOfClass(mouseEvent.target, 'ag-row-drag', 3); if (!this.isFullWidth()) { return; } var node = this.rowNode; var columnModel = this.beans.columnModel; if (this.beans.rangeService) { this.beans.rangeService.removeAllCellRanges(); } this.beans.focusService.setFocusedCell({ rowIndex: node.rowIndex, column: columnModel.getAllDisplayedColumns()[0], rowPinned: node.rowPinned, forceBrowserFocus: true }); }; RowCtrl.prototype.onRowClick = function (mouseEvent) { var stop = isStopPropagationForAgGrid(mouseEvent) || this.lastMouseDownOnDragger; if (stop) { return; } var agEvent = this.createRowEventWithSource(Events.EVENT_ROW_CLICKED, mouseEvent); this.beans.eventService.dispatchEvent(agEvent); // ctrlKey for windows, metaKey for Apple var multiSelectKeyPressed = mouseEvent.ctrlKey || mouseEvent.metaKey; var shiftKeyPressed = mouseEvent.shiftKey; // we do not allow selecting the group by clicking, when groupSelectChildren, as the logic to // handle this is broken. to observe, change the logic below and allow groups to be selected. // you will see the group gets selected, then all children get selected, then the grid unselects // the children (as the default behaviour when clicking is to unselect other rows) which results // in the group getting unselected (as all children are unselected). the correct thing would be // to change this, so that children of the selected group are not then subsequenly un-selected. var groupSelectsChildren = this.beans.gridOptionsService.is('groupSelectsChildren'); if ( // we do not allow selecting groups by clicking (as the click here expands the group), or if it's a detail row, // so return if it's a group row (groupSelectsChildren && this.rowNode.group) || // this is needed so we don't unselect other rows when we click this row, eg if this row is not selectable, // and we click it, the selection should not change (ie any currently selected row should stay selected) !this.rowNode.selectable || // we also don't allow selection of pinned rows this.rowNode.rowPinned || // if no selection method enabled, do nothing !this.beans.gridOptionsService.isRowSelection() || // if click selection suppressed, do nothing this.beans.gridOptionsService.is('suppressRowClickSelection')) { return; } var multiSelectOnClick = this.beans.gridOptionsService.is('rowMultiSelectWithClick'); var rowDeselectionWithCtrl = !this.beans.gridOptionsService.is('suppressRowDeselection'); var source = 'rowClicked'; if (this.rowNode.isSelected()) { if (multiSelectOnClick) { this.rowNode.setSelectedParams({ newValue: false, event: mouseEvent, source: source }); } else if (multiSelectKeyPressed) { if (rowDeselectionWithCtrl) { this.rowNode.setSelectedParams({ newValue: false, event: mouseEvent, source: source }); } } else { // selected with no multi key, must make sure anything else is unselected this.rowNode.setSelectedParams({ newValue: true, clearSelection: !shiftKeyPressed, rangeSelect: shiftKeyPressed, event: mouseEvent, source: source }); } } else { var clearSelection = multiSelectOnClick ? false : !multiSelectKeyPressed; this.rowNode.setSelectedParams({ newValue: true, clearSelection: clearSelection, rangeSelect: shiftKeyPressed, event: mouseEvent, source: source }); } }; RowCtrl.prototype.setupDetailRowAutoHeight = function (eDetailGui) { var _this = this; if (this.rowType !== RowType.FullWidthDetail) { return; } if (!this.beans.gridOptionsService.is('detailRowAutoHeight')) { return; } var checkRowSizeFunc = function () { var clientHeight = eDetailGui.clientHeight; // if the UI is not ready, the height can be 0, which we ignore, as otherwise a flicker will occur // as UI goes from the default height, to 0, then to the real height as UI becomes ready. this means // it's not possible for have 0 as auto-height, however this is an improbable use case, as even an // empty detail grid would still have some styling around it giving at least a few pixels. if (clientHeight != null && clientHeight > 0) { // we do the update in a timeout, to make sure we are not calling from inside the grid // doing another update var updateRowHeightFunc = function () { _this.rowNode.setRowHeight(clientHeight); if (_this.beans.clientSideRowModel) { _this.beans.clientSideRowModel.onRowHeightChanged(); } else if (_this.beans.serverSideRowModel) { _this.beans.serverSideRowModel.onRowHeightChanged(); } }; _this.beans.frameworkOverrides.setTimeout(updateRowHeightFunc, 0); } }; var resizeObserverDestroyFunc = this.beans.resizeObserverService.observeResize(eDetailGui, checkRowSizeFunc); this.addDestroyFunc(resizeObserverDestroyFunc); checkRowSizeFunc(); }; RowCtrl.prototype.createFullWidthParams = function (eRow, pinned) { var _this = this; var params = { fullWidth: true, data: this.rowNode.data, node: this.rowNode, value: this.rowNode.key, valueFormatted: this.rowNode.key, rowIndex: this.rowNode.rowIndex, api: this.beans.gridOptionsService.api, columnApi: this.beans.gridOptionsService.columnApi, context: this.beans.gridOptionsService.context, // these need to be taken out, as part of 'afterAttached' now eGridCell: eRow, eParentOfValue: eRow, pinned: pinned, addRenderedRowListener: this.addEventListener.bind(this), registerRowDragger: function (rowDraggerElement, dragStartPixels, value, suppressVisibilityChange) { return _this.addFullWidthRowDragging(rowDraggerElement, dragStartPixels, value, suppressVisibilityChange); } }; return params; }; RowCtrl.prototype.addFullWidthRowDragging = function (rowDraggerElement, dragStartPixels, value, suppressVisibilityChange) { if (value === void 0) { value = ''; } if (!this.isFullWidth()) { return; } var rowDragComp = new RowDragComp(function () { return value; }, this.rowNode, undefined, rowDraggerElement, dragStartPixels, suppressVisibilityChange); this.createManagedBean(rowDragComp, this.beans.context); }; RowCtrl.prototype.onUiLevelChanged = function () { var newLevel = this.beans.rowCssClassCalculator.calculateRowLevel(this.rowNode); if (this.rowLevel != newLevel) { var classToAdd_1 = 'ag-row-level-' + newLevel; var classToRemove_1 = 'ag-row-level-' + this.rowLevel; this.allRowGuis.forEach(function (gui) { gui.rowComp.addOrRemoveCssClass(classToAdd_1, true); gui.rowComp.addOrRemoveCssClass(classToRemove_1, false); }); } this.rowLevel = newLevel; }; RowCtrl.prototype.isFirstRowOnPage = function () { return this.rowNode.rowIndex === this.beans.paginationProxy.getPageFirstRow(); }; RowCtrl.prototype.isLastRowOnPage = function () { return this.rowNode.rowIndex === this.beans.paginationProxy.getPageLastRow(); }; RowCtrl.prototype.onModelUpdated = function () { this.refreshFirstAndLastRowStyles(); }; RowCtrl.prototype.refreshFirstAndLastRowStyles = function () { var newFirst = this.isFirstRowOnPage(); var newLast = this.isLastRowOnPage(); if (this.firstRowOnPage !== newFirst) { this.firstRowOnPage = newFirst; this.allRowGuis.forEach(function (gui) { return gui.rowComp.addOrRemoveCssClass('ag-row-first', newFirst); }); } if (this.lastRowOnPage !== newLast) { this.lastRowOnPage = newLast; this.allRowGuis.forEach(function (gui) { return gui.rowComp.addOrRemoveCssClass('ag-row-last', newLast); }); } }; RowCtrl.prototype.stopEditing = function (cancel) { var e_1, _a; if (cancel === void 0) { cancel = false; } // if we are already stopping row edit, there is // no need to start this process again. if (this.stoppingRowEdit) { return; } var cellControls = this.getAllCellCtrls(); var isRowEdit = this.editingRow; this.stoppingRowEdit = true; var fireRowEditEvent = false; try { for (var cellControls_1 = __values$3(cellControls), cellControls_1_1 = cellControls_1.next(); !cellControls_1_1.done; cellControls_1_1 = cellControls_1.next()) { var ctrl = cellControls_1_1.value; var valueChanged = ctrl.stopEditing(cancel); if (isRowEdit && !cancel && !fireRowEditEvent && valueChanged) { fireRowEditEvent = true; } } } catch (e_1_1) { e_1 = { error: e_1_1 }; } finally { try { if (cellControls_1_1 && !cellControls_1_1.done && (_a = cellControls_1.return)) _a.call(cellControls_1); } finally { if (e_1) throw e_1.error; } } if (fireRowEditEvent) { var event_1 = this.createRowEvent(Events.EVENT_ROW_VALUE_CHANGED); this.beans.eventService.dispatchEvent(event_1); } if (isRowEdit) { this.setEditingRow(false); } this.stoppingRowEdit = false; }; RowCtrl.prototype.setInlineEditingCss = function (editing) { this.allRowGuis.forEach(function (gui) { gui.rowComp.addOrRemoveCssClass("ag-row-inline-editing", editing); gui.rowComp.addOrRemoveCssClass("ag-row-not-inline-editing", !editing); }); }; RowCtrl.prototype.setEditingRow = function (value) { this.editingRow = value; this.allRowGuis.forEach(function (gui) { return gui.rowComp.addOrRemoveCssClass('ag-row-editing', value); }); var event = value ? this.createRowEvent(Events.EVENT_ROW_EDITING_STARTED) : this.createRowEvent(Events.EVENT_ROW_EDITING_STOPPED); this.beans.eventService.dispatchEvent(event); }; RowCtrl.prototype.startRowEditing = function (key, charPress, sourceRenderedCell, event) { if (key === void 0) { key = null; } if (charPress === void 0) { charPress = null; } if (sourceRenderedCell === void 0) { sourceRenderedCell = null; } if (event === void 0) { event = null; } // don't do it if already editing if (this.editingRow) { return; } var atLeastOneEditing = this.getAllCellCtrls().reduce(function (prev, cellCtrl) { var cellStartedEdit = cellCtrl === sourceRenderedCell; if (cellStartedEdit) { cellCtrl.startEditing(key, charPress, cellStartedEdit, event); } else { cellCtrl.startEditing(null, null, cellStartedEdit, event); } if (prev) { return true; } return cellCtrl.isEditing(); }, false); if (atLeastOneEditing) { this.setEditingRow(true); } }; RowCtrl.prototype.getAllCellCtrls = function () { if (this.leftCellCtrls.list.length === 0 && this.rightCellCtrls.list.length === 0) { return this.centerCellCtrls.list; } var res = __spread$8(this.centerCellCtrls.list, this.leftCellCtrls.list, this.rightCellCtrls.list); return res; }; RowCtrl.prototype.postProcessClassesFromGridOptions = function () { var _this = this; var cssClasses = this.beans.rowCssClassCalculator.processClassesFromGridOptions(this.rowNode); if (!cssClasses || !cssClasses.length) { return; } cssClasses.forEach(function (classStr) { _this.allRowGuis.forEach(function (c) { return c.rowComp.addOrRemoveCssClass(classStr, true); }); }); }; RowCtrl.prototype.postProcessRowClassRules = function () { var _this = this; this.beans.rowCssClassCalculator.processRowClassRules(this.rowNode, function (className) { _this.allRowGuis.forEach(function (gui) { return gui.rowComp.addOrRemoveCssClass(className, true); }); }, function (className) { _this.allRowGuis.forEach(function (gui) { return gui.rowComp.addOrRemoveCssClass(className, false); }); }); }; RowCtrl.prototype.setStylesFromGridOptions = function (gui) { var rowStyles = this.processStylesFromGridOptions(); this.forEachGui(gui, function (gui) { return gui.rowComp.setUserStyles(rowStyles); }); }; RowCtrl.prototype.getPinnedForContainer = function (rowContainerType) { var pinned = rowContainerType === exports.RowContainerType.LEFT ? 'left' : rowContainerType === exports.RowContainerType.RIGHT ? 'right' : null; return pinned; }; RowCtrl.prototype.getInitialRowClasses = function (rowContainerType) { var pinned = this.getPinnedForContainer(rowContainerType); var params = { rowNode: this.rowNode, rowFocused: this.rowFocused, fadeRowIn: this.fadeInAnimation[rowContainerType], rowIsEven: this.rowNode.rowIndex % 2 === 0, rowLevel: this.rowLevel, fullWidthRow: this.isFullWidth(), firstRowOnPage: this.isFirstRowOnPage(), lastRowOnPage: this.isLastRowOnPage(), printLayout: this.printLayout, expandable: this.rowNode.isExpandable(), pinned: pinned }; return this.beans.rowCssClassCalculator.getInitialRowClasses(params); }; RowCtrl.prototype.processStylesFromGridOptions = function () { // part 1 - rowStyle var rowStyle = this.beans.gridOptionsService.get('rowStyle'); if (rowStyle && typeof rowStyle === 'function') { console.warn('AG Grid: rowStyle should be an object of key/value styles, not be a function, use getRowStyle() instead'); return; } // part 1 - rowStyleFunc var rowStyleFunc = this.beans.gridOptionsService.getCallback('getRowStyle'); var rowStyleFuncResult; if (rowStyleFunc) { var params = { data: this.rowNode.data, node: this.rowNode, rowIndex: this.rowNode.rowIndex }; rowStyleFuncResult = rowStyleFunc(params); } return Object.assign({}, rowStyle, rowStyleFuncResult); }; RowCtrl.prototype.onRowSelected = function (gui) { var _this = this; // Treat undefined as false, if we pass undefined down it gets treated as toggle class, rather than explicitly // setting the required value var selected = !!this.rowNode.isSelected(); this.forEachGui(gui, function (gui) { gui.rowComp.addOrRemoveCssClass('ag-row-selected', selected); setAriaSelected(gui.element, selected ? true : undefined); var ariaLabel = _this.createAriaLabel(); setAriaLabel(gui.element, ariaLabel == null ? '' : ariaLabel); }); }; RowCtrl.prototype.createAriaLabel = function () { var selected = this.rowNode.isSelected(); if (selected && this.beans.gridOptionsService.is('suppressRowDeselection')) { return undefined; } var translate = this.beans.localeService.getLocaleTextFunc(); var label = translate(selected ? 'ariaRowDeselect' : 'ariaRowSelect', "Press SPACE to " + (selected ? 'deselect' : 'select') + " this row."); return label; }; RowCtrl.prototype.isUseAnimationFrameForCreate = function () { return this.useAnimationFrameForCreate; }; RowCtrl.prototype.addHoverFunctionality = function (eRow) { var _this = this; // because we use animation frames to do this, it's possible the row no longer exists // by the time we get to add it if (!this.active) { return; } // because mouseenter and mouseleave do not propagate, we cannot listen on the gridPanel // like we do for all the other mouse events. // because of the pinning, we cannot simply add / remove the class based on the eRow. we // have to check all eRow's (body & pinned). so the trick is if any of the rows gets a // mouse hover, it sets such in the rowNode, and then all three reflect the change as // all are listening for event on the row node. // step 1 - add listener, to set flag on row node this.addManagedListener(eRow, 'mouseenter', function () { return _this.rowNode.onMouseEnter(); }); this.addManagedListener(eRow, 'mouseleave', function () { return _this.rowNode.onMouseLeave(); }); // step 2 - listen for changes on row node (which any eRow can trigger) this.addManagedListener(this.rowNode, RowNode.EVENT_MOUSE_ENTER, function () { // if hover turned off, we don't add the class. we do this here so that if the application // toggles this property mid way, we remove the hover form the last row, but we stop // adding hovers from that point onwards. Also, do not highlight while dragging elements around. if (!_this.beans.dragService.isDragging() && !_this.beans.gridOptionsService.is('suppressRowHoverHighlight')) { eRow.classList.add('ag-row-hover'); } }); this.addManagedListener(this.rowNode, RowNode.EVENT_MOUSE_LEAVE, function () { eRow.classList.remove('ag-row-hover'); }); }; // for animation, we don't want to animate entry or exit to a very far away pixel, // otherwise the row would move so fast, it would appear to disappear. so this method // moves the row closer to the viewport if it is far away, so the row slide in / out // at a speed the user can see. RowCtrl.prototype.roundRowTopToBounds = function (rowTop) { var gridBodyCon = this.beans.ctrlsService.getGridBodyCtrl(); var range = gridBodyCon.getScrollFeature().getVScrollPosition(); var minPixel = this.applyPaginationOffset(range.top, true) - 100; var maxPixel = this.applyPaginationOffset(range.bottom, true) + 100; return Math.min(Math.max(minPixel, rowTop), maxPixel); }; RowCtrl.prototype.getFrameworkOverrides = function () { return this.beans.frameworkOverrides; }; RowCtrl.prototype.forEachGui = function (gui, callback) { var list = gui ? [gui] : this.allRowGuis; list.forEach(callback); }; RowCtrl.prototype.onRowHeightChanged = function (gui) { // check for exists first - if the user is resetting the row height, then // it will be null (or undefined) momentarily until the next time the flatten // stage is called where the row will then update again with a new height if (this.rowNode.rowHeight == null) { return; } var rowHeight = this.rowNode.rowHeight; var defaultRowHeight = this.beans.environment.getDefaultRowHeight(); var isHeightFromFunc = this.beans.gridOptionsService.isGetRowHeightFunction(); var heightFromFunc = isHeightFromFunc ? this.beans.gridOptionsService.getRowHeightForNode(this.rowNode).height : undefined; var lineHeight = heightFromFunc ? Math.min(defaultRowHeight, heightFromFunc) - 2 + "px" : undefined; this.forEachGui(gui, function (gui) { gui.element.style.height = rowHeight + "px"; // If the row height is coming from a function, this means some rows can // be smaller than the theme had intended. so we set --ag-line-height on // the row, which is picked up by the theme CSS and is used in a calc // for the CSS line-height property, which makes sure the line-height is // not bigger than the row height, otherwise the row text would not fit. // We do not use rowNode.rowHeight here, as this could be the result of autoHeight, // and we found using the autoHeight result causes a loop, where changing the // line-height them impacts the cell height, resulting in a new autoHeight, // resulting in a new line-height and so on loop. // const heightFromFunc = this.beans.gridOptionsService.getRowHeightForNode(this.rowNode).height; if (lineHeight) { gui.element.style.setProperty('--ag-line-height', lineHeight); } }); }; RowCtrl.prototype.addEventListener = function (eventType, listener) { _super.prototype.addEventListener.call(this, eventType, listener); }; RowCtrl.prototype.removeEventListener = function (eventType, listener) { _super.prototype.removeEventListener.call(this, eventType, listener); }; // note - this is NOT called by context, as we don't wire / unwire the CellComp for performance reasons. RowCtrl.prototype.destroyFirstPass = function () { this.active = false; // why do we have this method? shouldn't everything below be added as a destroy func beside // the corresponding create logic? this.setupRemoveAnimation(); var event = this.createRowEvent(Events.EVENT_VIRTUAL_ROW_REMOVED); this.dispatchEvent(event); this.beans.eventService.dispatchEvent(event); _super.prototype.destroy.call(this); }; RowCtrl.prototype.setupRemoveAnimation = function () { // we don't animate sticky rows if (this.isSticky()) { return; } var rowStillVisibleJustNotInViewport = this.rowNode.rowTop != null; if (rowStillVisibleJustNotInViewport) { // if the row is not rendered, but in viewport, it means it has moved, // so we animate the row out. if the new location is very far away, // the animation will be so fast the row will look like it's just disappeared, // so instead we animate to a position just outside the viewport. var rowTop = this.roundRowTopToBounds(this.rowNode.rowTop); this.setRowTop(rowTop); } else { this.allRowGuis.forEach(function (gui) { return gui.rowComp.addOrRemoveCssClass('ag-opacity-zero', true); }); } }; RowCtrl.prototype.destroySecondPass = function () { this.allRowGuis.length = 0; var destroyCellCtrls = function (ctrls) { ctrls.list.forEach(function (c) { return c.destroy(); }); return { list: [], map: {} }; }; this.centerCellCtrls = destroyCellCtrls(this.centerCellCtrls); this.leftCellCtrls = destroyCellCtrls(this.leftCellCtrls); this.rightCellCtrls = destroyCellCtrls(this.rightCellCtrls); }; RowCtrl.prototype.setFocusedClasses = function (gui) { var _this = this; this.forEachGui(gui, function (gui) { gui.rowComp.addOrRemoveCssClass('ag-row-focus', _this.rowFocused); gui.rowComp.addOrRemoveCssClass('ag-row-no-focus', !_this.rowFocused); }); }; RowCtrl.prototype.onCellFocused = function () { this.onCellFocusChanged(); }; RowCtrl.prototype.onCellFocusCleared = function () { this.onCellFocusChanged(); }; RowCtrl.prototype.onCellFocusChanged = function () { var rowFocused = this.beans.focusService.isRowFocused(this.rowNode.rowIndex, this.rowNode.rowPinned); if (rowFocused !== this.rowFocused) { this.rowFocused = rowFocused; this.setFocusedClasses(); } // if we are editing, then moving the focus out of a row will stop editing if (!rowFocused && this.editingRow) { this.stopEditing(false); } }; RowCtrl.prototype.onPaginationChanged = function () { var currentPage = this.beans.paginationProxy.getCurrentPage(); // it is possible this row is in the new page, but the page number has changed, which means // it needs to reposition itself relative to the new page if (this.paginationPage !== currentPage) { this.paginationPage = currentPage; this.onTopChanged(); } this.refreshFirstAndLastRowStyles(); }; RowCtrl.prototype.onTopChanged = function () { this.setRowTop(this.rowNode.rowTop); }; RowCtrl.prototype.onPaginationPixelOffsetChanged = function () { // the pixel offset is used when calculating rowTop to set on the row DIV this.onTopChanged(); }; // applies pagination offset, eg if on second page, and page height is 500px, then removes // 500px from the top position, so a row with rowTop 600px is displayed at location 100px. // reverse will take the offset away rather than add. RowCtrl.prototype.applyPaginationOffset = function (topPx, reverse) { if (reverse === void 0) { reverse = false; } if (this.rowNode.isRowPinned()) { return topPx; } var pixelOffset = this.beans.paginationProxy.getPixelOffset(); var multiplier = reverse ? 1 : -1; return topPx + (pixelOffset * multiplier); }; RowCtrl.prototype.setRowTop = function (pixels) { // print layout uses normal flow layout for row positioning if (this.printLayout) { return; } // need to make sure rowTop is not null, as this can happen if the node was once // visible (ie parent group was expanded) but is now not visible if (exists(pixels)) { var afterPaginationPixels = this.applyPaginationOffset(pixels); var afterScalingPixels = this.rowNode.isRowPinned() ? afterPaginationPixels : this.beans.rowContainerHeightService.getRealPixelPosition(afterPaginationPixels); var topPx = afterScalingPixels + "px"; this.setRowTopStyle(topPx); } }; // the top needs to be set into the DOM element when the element is created, not updated afterwards. // otherwise the transition would not work, as it would be transitioning from zero (the unset value). // for example, suppose a row that is outside the viewport, then user does a filter to remove other rows // and this row now appears in the viewport, and the row moves up (ie it was under the viewport and not rendered, // but now is in the viewport) then a new RowComp is created, however it should have it's position initialised // to below the viewport, so the row will appear to animate up. if we didn't set the initial position at creation // time, the row would animate down (ie from position zero). RowCtrl.prototype.getInitialRowTop = function (rowContainerType) { var suppressRowTransform = this.beans.gridOptionsService.is('suppressRowTransform'); return suppressRowTransform ? this.getInitialRowTopShared(rowContainerType) : undefined; }; RowCtrl.prototype.getInitialTransform = function (rowContainerType) { var suppressRowTransform = this.beans.gridOptionsService.is('suppressRowTransform'); return suppressRowTransform ? undefined : "translateY(" + this.getInitialRowTopShared(rowContainerType) + ")"; }; RowCtrl.prototype.getInitialRowTopShared = function (rowContainerType) { // print layout uses normal flow layout for row positioning if (this.printLayout) { return ''; } var rowTop; if (this.isSticky()) { rowTop = this.rowNode.stickyRowTop; } else { // if sliding in, we take the old row top. otherwise we just set the current row top. var pixels = this.slideInAnimation[rowContainerType] ? this.roundRowTopToBounds(this.rowNode.oldRowTop) : this.rowNode.rowTop; var afterPaginationPixels = this.applyPaginationOffset(pixels); // we don't apply scaling if row is pinned rowTop = this.rowNode.isRowPinned() ? afterPaginationPixels : this.beans.rowContainerHeightService.getRealPixelPosition(afterPaginationPixels); } return rowTop + 'px'; }; RowCtrl.prototype.setRowTopStyle = function (topPx) { var suppressRowTransform = this.beans.gridOptionsService.is('suppressRowTransform'); this.allRowGuis.forEach(function (gui) { return suppressRowTransform ? gui.rowComp.setTop(topPx) : gui.rowComp.setTransform("translateY(" + topPx + ")"); }); }; RowCtrl.prototype.getRowNode = function () { return this.rowNode; }; RowCtrl.prototype.getCellCtrl = function (column) { // first up, check for cell directly linked to this column var res = null; this.getAllCellCtrls().forEach(function (cellCtrl) { if (cellCtrl.getColumn() == column) { res = cellCtrl; } }); if (res != null) { return res; } // second up, if not found, then check for spanned cols. // we do this second (and not at the same time) as this is // more expensive, as spanning cols is a // infrequently used feature so we don't need to do this most // of the time this.getAllCellCtrls().forEach(function (cellCtrl) { if (cellCtrl.getColSpanningList().indexOf(column) >= 0) { res = cellCtrl; } }); return res; }; RowCtrl.prototype.onRowIndexChanged = function () { // we only bother updating if the rowIndex is present. if it is not present, it means this row // is child of a group node, and the group node was closed, it's the only way to have no row index. // when this happens, row is about to be de-rendered, so we don't care, rowComp is about to die! if (this.rowNode.rowIndex != null) { this.onCellFocusChanged(); this.updateRowIndexes(); this.postProcessCss(); } }; RowCtrl.prototype.updateRowIndexes = function (gui) { var rowIndexStr = this.rowNode.getRowIndexString(); var headerRowCount = this.beans.headerNavigationService.getHeaderRowCount(); var rowIsEven = this.rowNode.rowIndex % 2 === 0; var ariaRowIndex = headerRowCount + this.rowNode.rowIndex + 1; this.forEachGui(gui, function (c) { c.rowComp.setRowIndex(rowIndexStr); c.rowComp.addOrRemoveCssClass('ag-row-even', rowIsEven); c.rowComp.addOrRemoveCssClass('ag-row-odd', !rowIsEven); setAriaRowIndex(c.element, ariaRowIndex); }); }; // returns the pinned left container, either the normal one, or the embedded full with one if exists RowCtrl.prototype.getPinnedLeftRowElement = function () { return this.leftGui ? this.leftGui.element : undefined; }; // returns the pinned right container, either the normal one, or the embedded full with one if exists RowCtrl.prototype.getPinnedRightRowElement = function () { return this.rightGui ? this.rightGui.element : undefined; }; // returns the body container, either the normal one, or the embedded full with one if exists RowCtrl.prototype.getBodyRowElement = function () { return this.centerGui ? this.centerGui.element : undefined; }; // returns the full width container RowCtrl.prototype.getFullWidthRowElement = function () { return this.fullWidthGui ? this.fullWidthGui.element : undefined; }; RowCtrl.DOM_DATA_KEY_ROW_CTRL = 'renderedRow'; return RowCtrl; }(BeanStub)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$15 = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __decorate$R = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var __read$c = (undefined && undefined.__read) || function (o, n) { var m = typeof Symbol === "function" && o[Symbol.iterator]; if (!m) return o; var i = m.call(o), r, ar = [], e; try { while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); } catch (error) { e = { error: error }; } finally { try { if (r && !r.done && (m = i["return"])) m.call(i); } finally { if (e) throw e.error; } } return ar; }; var RowContainerEventsFeature = /** @class */ (function (_super) { __extends$15(RowContainerEventsFeature, _super); function RowContainerEventsFeature(element) { var _this = _super.call(this) || this; _this.element = element; return _this; } RowContainerEventsFeature.prototype.postConstruct = function () { this.addMouseListeners(); this.mockContextMenuForIPad(); this.addKeyboardEvents(); }; RowContainerEventsFeature.prototype.addKeyboardEvents = function () { var _this = this; var eventNames = ['keydown', 'keypress']; eventNames.forEach(function (eventName) { var listener = _this.processKeyboardEvent.bind(_this, eventName); _this.addManagedListener(_this.element, eventName, listener); }); }; RowContainerEventsFeature.prototype.addMouseListeners = function () { var _this = this; var mouseDownEvent = isEventSupported('touchstart') ? 'touchstart' : 'mousedown'; var eventNames = ['dblclick', 'contextmenu', 'mouseover', 'mouseout', 'click', mouseDownEvent]; eventNames.forEach(function (eventName) { var listener = _this.processMouseEvent.bind(_this, eventName); _this.addManagedListener(_this.element, eventName, listener); }); }; RowContainerEventsFeature.prototype.processMouseEvent = function (eventName, mouseEvent) { if (!this.mouseEventService.isEventFromThisGrid(mouseEvent) || isStopPropagationForAgGrid(mouseEvent)) { return; } var rowComp = this.getRowForEvent(mouseEvent); var cellCtrl = this.mouseEventService.getRenderedCellForEvent(mouseEvent); if (eventName === "contextmenu") { this.handleContextMenuMouseEvent(mouseEvent, null, rowComp, cellCtrl); } else { if (cellCtrl) { cellCtrl.onMouseEvent(eventName, mouseEvent); } if (rowComp) { rowComp.onMouseEvent(eventName, mouseEvent); } } }; RowContainerEventsFeature.prototype.mockContextMenuForIPad = function () { var _this = this; // we do NOT want this when not in iPad, otherwise we will be doing if (!isIOSUserAgent()) { return; } var touchListener = new TouchListener(this.element); var longTapListener = function (event) { var rowComp = _this.getRowForEvent(event.touchEvent); var cellComp = _this.mouseEventService.getRenderedCellForEvent(event.touchEvent); _this.handleContextMenuMouseEvent(null, event.touchEvent, rowComp, cellComp); }; this.addManagedListener(touchListener, TouchListener.EVENT_LONG_TAP, longTapListener); this.addDestroyFunc(function () { return touchListener.destroy(); }); }; RowContainerEventsFeature.prototype.getRowForEvent = function (event) { var sourceElement = event.target; while (sourceElement) { var rowCon = this.gridOptionsService.getDomData(sourceElement, RowCtrl.DOM_DATA_KEY_ROW_CTRL); if (rowCon) { return rowCon; } sourceElement = sourceElement.parentElement; } return null; }; RowContainerEventsFeature.prototype.handleContextMenuMouseEvent = function (mouseEvent, touchEvent, rowComp, cellCtrl) { var rowNode = rowComp ? rowComp.getRowNode() : null; var column = cellCtrl ? cellCtrl.getColumn() : null; var value = null; if (column) { var event_1 = mouseEvent ? mouseEvent : touchEvent; cellCtrl.dispatchCellContextMenuEvent(event_1); value = this.valueService.getValue(column, rowNode); } // if user clicked on a cell, anchor to that cell, otherwise anchor to the grid panel var gridBodyCon = this.ctrlsService.getGridBodyCtrl(); var anchorToElement = cellCtrl ? cellCtrl.getGui() : gridBodyCon.getGridBodyElement(); if (this.contextMenuFactory) { this.contextMenuFactory.onContextMenu(mouseEvent, touchEvent, rowNode, column, value, anchorToElement); } }; RowContainerEventsFeature.prototype.processKeyboardEvent = function (eventName, keyboardEvent) { var cellComp = getCtrlForEvent(this.gridOptionsService, keyboardEvent, CellCtrl.DOM_DATA_KEY_CELL_CTRL); var rowComp = getCtrlForEvent(this.gridOptionsService, keyboardEvent, RowCtrl.DOM_DATA_KEY_ROW_CTRL); if (keyboardEvent.defaultPrevented) { return; } if (cellComp) { this.processCellKeyboardEvent(cellComp, eventName, keyboardEvent); } else if (rowComp && rowComp.isFullWidth()) { this.processFullWidthRowKeyboardEvent(rowComp, eventName, keyboardEvent); } }; RowContainerEventsFeature.prototype.processCellKeyboardEvent = function (cellCtrl, eventName, keyboardEvent) { var rowNode = cellCtrl.getRowNode(); var column = cellCtrl.getColumn(); var editing = cellCtrl.isEditing(); var gridProcessingAllowed = !isUserSuppressingKeyboardEvent(this.gridOptionsService, keyboardEvent, rowNode, column, editing); if (gridProcessingAllowed) { switch (eventName) { case 'keydown': // first see if it's a scroll key, page up / down, home / end etc var wasScrollKey = !editing && this.navigationService.handlePageScrollingKey(keyboardEvent); // if not a scroll key, then we pass onto cell if (!wasScrollKey) { cellCtrl.onKeyDown(keyboardEvent); } // perform clipboard and undo / redo operations this.doGridOperations(keyboardEvent, cellCtrl.isEditing()); break; case 'keypress': cellCtrl.onKeyPress(keyboardEvent); break; } } if (eventName === 'keydown') { var cellKeyDownEvent = cellCtrl.createEvent(keyboardEvent, Events.EVENT_CELL_KEY_DOWN); this.eventService.dispatchEvent(cellKeyDownEvent); } if (eventName === 'keypress') { var cellKeyPressEvent = cellCtrl.createEvent(keyboardEvent, Events.EVENT_CELL_KEY_PRESS); this.eventService.dispatchEvent(cellKeyPressEvent); } }; RowContainerEventsFeature.prototype.processFullWidthRowKeyboardEvent = function (rowComp, eventName, keyboardEvent) { var rowNode = rowComp.getRowNode(); var focusedCell = this.focusService.getFocusedCell(); var column = (focusedCell && focusedCell.column); var gridProcessingAllowed = !isUserSuppressingKeyboardEvent(this.gridOptionsService, keyboardEvent, rowNode, column, false); if (gridProcessingAllowed) { var key = keyboardEvent.key; if (eventName === 'keydown') { switch (key) { case KeyCode.PAGE_HOME: case KeyCode.PAGE_END: this.navigationService.handlePageScrollingKey(keyboardEvent); break; case KeyCode.UP: case KeyCode.DOWN: rowComp.onKeyboardNavigate(keyboardEvent); break; case KeyCode.TAB: rowComp.onTabKeyDown(keyboardEvent); break; default: } } } if (eventName === 'keydown') { var cellKeyDownEvent = rowComp.createRowEvent(Events.EVENT_CELL_KEY_DOWN, keyboardEvent); this.eventService.dispatchEvent(cellKeyDownEvent); } if (eventName === 'keypress') { var cellKeyPressEvent = rowComp.createRowEvent(Events.EVENT_CELL_KEY_PRESS, keyboardEvent); this.eventService.dispatchEvent(cellKeyPressEvent); } }; RowContainerEventsFeature.prototype.doGridOperations = function (keyboardEvent, editing) { // check if ctrl or meta key pressed if (!keyboardEvent.ctrlKey && !keyboardEvent.metaKey) { return; } // if the cell the event came from is editing, then we do not // want to do the default shortcut keys, otherwise the editor // (eg a text field) would not be able to do the normal cut/copy/paste if (editing) { return; } // for copy / paste, we don't want to execute when the event // was from a child grid (happens in master detail) if (!this.mouseEventService.isEventFromThisGrid(keyboardEvent)) { return; } var keyCode = normaliseQwertyAzerty(keyboardEvent); if (keyCode === KeyCode.A) { return this.onCtrlAndA(keyboardEvent); } if (keyCode === KeyCode.C) { return this.onCtrlAndC(keyboardEvent); } if (keyCode === KeyCode.X) { return this.onCtrlAndX(keyboardEvent); } if (keyCode === KeyCode.V) { return this.onCtrlAndV(); } if (keyCode === KeyCode.D) { return this.onCtrlAndD(keyboardEvent); } if (keyCode === KeyCode.Z) { return this.onCtrlAndZ(keyboardEvent); } if (keyCode === KeyCode.Y) { return this.onCtrlAndY(); } }; RowContainerEventsFeature.prototype.onCtrlAndA = function (event) { var _a = this, pinnedRowModel = _a.pinnedRowModel, paginationProxy = _a.paginationProxy, rangeService = _a.rangeService; if (rangeService && paginationProxy.isRowsToRender()) { var _b = __read$c([ pinnedRowModel.isEmpty('top'), pinnedRowModel.isEmpty('bottom') ], 2), isEmptyPinnedTop = _b[0], isEmptyPinnedBottom = _b[1]; var floatingStart = isEmptyPinnedTop ? null : 'top'; var floatingEnd = void 0; var rowEnd = void 0; if (isEmptyPinnedBottom) { floatingEnd = null; rowEnd = this.paginationProxy.getRowCount() - 1; } else { floatingEnd = 'bottom'; rowEnd = pinnedRowModel.getPinnedBottomRowData().length - 1; } var allDisplayedColumns = this.columnModel.getAllDisplayedColumns(); if (missingOrEmpty(allDisplayedColumns)) { return; } rangeService.setCellRange({ rowStartIndex: 0, rowStartPinned: floatingStart, rowEndIndex: rowEnd, rowEndPinned: floatingEnd, columnStart: allDisplayedColumns[0], columnEnd: last(allDisplayedColumns) }); } event.preventDefault(); }; RowContainerEventsFeature.prototype.onCtrlAndC = function (event) { if (!this.clipboardService || this.gridOptionsService.is('enableCellTextSelection')) { return; } this.clipboardService.copyToClipboard(); event.preventDefault(); }; RowContainerEventsFeature.prototype.onCtrlAndX = function (event) { if (!this.clipboardService || this.gridOptionsService.is('enableCellTextSelection') || this.gridOptionsService.is('suppressCutToClipboard')) { return; } this.clipboardService.cutToClipboard(); event.preventDefault(); }; RowContainerEventsFeature.prototype.onCtrlAndV = function () { if (ModuleRegistry.isRegistered(exports.ModuleNames.ClipboardModule) && !this.gridOptionsService.is('suppressClipboardPaste')) { this.clipboardService.pasteFromClipboard(); } }; RowContainerEventsFeature.prototype.onCtrlAndD = function (event) { if (ModuleRegistry.isRegistered(exports.ModuleNames.ClipboardModule) && !this.gridOptionsService.is('suppressClipboardPaste')) { this.clipboardService.copyRangeDown(); } event.preventDefault(); }; RowContainerEventsFeature.prototype.onCtrlAndZ = function (event) { if (!this.gridOptionsService.is('undoRedoCellEditing')) { return; } event.preventDefault(); if (event.shiftKey) { this.undoRedoService.redo('ui'); } else { this.undoRedoService.undo('ui'); } }; RowContainerEventsFeature.prototype.onCtrlAndY = function () { this.undoRedoService.redo('ui'); }; __decorate$R([ Autowired('mouseEventService') ], RowContainerEventsFeature.prototype, "mouseEventService", void 0); __decorate$R([ Autowired('valueService') ], RowContainerEventsFeature.prototype, "valueService", void 0); __decorate$R([ Optional('contextMenuFactory') ], RowContainerEventsFeature.prototype, "contextMenuFactory", void 0); __decorate$R([ Autowired('ctrlsService') ], RowContainerEventsFeature.prototype, "ctrlsService", void 0); __decorate$R([ Autowired('navigationService') ], RowContainerEventsFeature.prototype, "navigationService", void 0); __decorate$R([ Autowired('focusService') ], RowContainerEventsFeature.prototype, "focusService", void 0); __decorate$R([ Autowired('undoRedoService') ], RowContainerEventsFeature.prototype, "undoRedoService", void 0); __decorate$R([ Autowired('columnModel') ], RowContainerEventsFeature.prototype, "columnModel", void 0); __decorate$R([ Autowired('paginationProxy') ], RowContainerEventsFeature.prototype, "paginationProxy", void 0); __decorate$R([ Autowired('pinnedRowModel') ], RowContainerEventsFeature.prototype, "pinnedRowModel", void 0); __decorate$R([ Optional('rangeService') ], RowContainerEventsFeature.prototype, "rangeService", void 0); __decorate$R([ Optional('clipboardService') ], RowContainerEventsFeature.prototype, "clipboardService", void 0); __decorate$R([ PostConstruct ], RowContainerEventsFeature.prototype, "postConstruct", null); return RowContainerEventsFeature; }(BeanStub)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$16 = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __decorate$S = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; // listens to changes in the center viewport size, for column and row virtualisation, // and adjusts grid as necessary. there are two viewports, one for horizontal and one for // vertical scrolling. var ViewportSizeFeature = /** @class */ (function (_super) { __extends$16(ViewportSizeFeature, _super); function ViewportSizeFeature(centerContainerCtrl) { var _this = _super.call(this) || this; _this.centerContainerCtrl = centerContainerCtrl; return _this; } ViewportSizeFeature.prototype.postConstruct = function () { var _this = this; this.ctrlsService.whenReady(function () { _this.gridBodyCtrl = _this.ctrlsService.getGridBodyCtrl(); _this.listenForResize(); }); this.addManagedListener(this.eventService, Events.EVENT_SCROLLBAR_WIDTH_CHANGED, this.onScrollbarWidthChanged.bind(this)); }; ViewportSizeFeature.prototype.listenForResize = function () { var _this = this; var listener = function () { return _this.onCenterViewportResized(); }; // centerContainer gets horizontal resizes this.centerContainerCtrl.registerViewportResizeListener(listener); // eBodyViewport gets vertical resizes this.gridBodyCtrl.registerBodyViewportResizeListener(listener); }; ViewportSizeFeature.prototype.onScrollbarWidthChanged = function () { this.checkViewportAndScrolls(); }; ViewportSizeFeature.prototype.onCenterViewportResized = function () { if (this.centerContainerCtrl.isViewportVisible()) { this.checkViewportAndScrolls(); var newWidth = this.centerContainerCtrl.getCenterWidth(); if (newWidth !== this.centerWidth) { this.centerWidth = newWidth; this.columnModel.refreshFlexedColumns({ viewportWidth: this.centerWidth, updateBodyWidths: true, fireResizedEvent: true }); } } else { this.bodyHeight = 0; } }; // gets called every time the viewport size changes. we use this to check visibility of scrollbars // in the grid panel, and also to check size and position of viewport for row and column virtualisation. ViewportSizeFeature.prototype.checkViewportAndScrolls = function () { // results in updating anything that depends on scroll showing this.updateScrollVisibleService(); // fires event if height changes, used by PaginationService, HeightScalerService, RowRenderer this.checkBodyHeight(); // check for virtual columns for ColumnController this.onHorizontalViewportChanged(); this.gridBodyCtrl.getScrollFeature().checkScrollLeft(); }; ViewportSizeFeature.prototype.getBodyHeight = function () { return this.bodyHeight; }; ViewportSizeFeature.prototype.checkBodyHeight = function () { var eBodyViewport = this.gridBodyCtrl.getBodyViewportElement(); var bodyHeight = getInnerHeight(eBodyViewport); if (this.bodyHeight !== bodyHeight) { this.bodyHeight = bodyHeight; var event_1 = { type: Events.EVENT_BODY_HEIGHT_CHANGED }; this.eventService.dispatchEvent(event_1); } }; ViewportSizeFeature.prototype.updateScrollVisibleService = function () { // because of column animation (which takes 200ms), we have to do this twice. // eg if user removes cols anywhere except at the RHS, then the cols on the RHS // will animate to the left to fill the gap. this animation means just after // the cols are removed, the remaining cols are still in the original location // at the start of the animation, so pre animation the H scrollbar is still needed, // but post animation it is not. this.updateScrollVisibleServiceImpl(); setTimeout(this.updateScrollVisibleServiceImpl.bind(this), 500); }; ViewportSizeFeature.prototype.updateScrollVisibleServiceImpl = function () { var params = { horizontalScrollShowing: this.isHorizontalScrollShowing(), verticalScrollShowing: this.gridBodyCtrl.isVerticalScrollShowing() }; this.scrollVisibleService.setScrollsVisible(params); // fix - gridComp should just listen to event from above this.gridBodyCtrl.setVerticalScrollPaddingVisible(params.verticalScrollShowing); }; ViewportSizeFeature.prototype.isHorizontalScrollShowing = function () { var isAlwaysShowHorizontalScroll = this.gridOptionsService.is('alwaysShowHorizontalScroll'); return isAlwaysShowHorizontalScroll || this.centerContainerCtrl.isViewportHScrollShowing(); }; // this gets called whenever a change in the viewport, so we can inform column controller it has to work // out the virtual columns again. gets called from following locations: // + ensureColVisible, scroll, init, layoutChanged, displayedColumnsChanged ViewportSizeFeature.prototype.onHorizontalViewportChanged = function () { var scrollWidth = this.centerContainerCtrl.getCenterWidth(); var scrollPosition = this.centerContainerCtrl.getViewportScrollLeft(); this.columnModel.setViewportPosition(scrollWidth, scrollPosition); }; __decorate$S([ Autowired('ctrlsService') ], ViewportSizeFeature.prototype, "ctrlsService", void 0); __decorate$S([ Autowired('columnModel') ], ViewportSizeFeature.prototype, "columnModel", void 0); __decorate$S([ Autowired('scrollVisibleService') ], ViewportSizeFeature.prototype, "scrollVisibleService", void 0); __decorate$S([ PostConstruct ], ViewportSizeFeature.prototype, "postConstruct", null); return ViewportSizeFeature; }(BeanStub)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$17 = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __decorate$T = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var SetPinnedLeftWidthFeature = /** @class */ (function (_super) { __extends$17(SetPinnedLeftWidthFeature, _super); function SetPinnedLeftWidthFeature(element) { var _this = _super.call(this) || this; _this.element = element; return _this; } SetPinnedLeftWidthFeature.prototype.postConstruct = function () { this.addManagedListener(this.eventService, Events.EVENT_LEFT_PINNED_WIDTH_CHANGED, this.onPinnedLeftWidthChanged.bind(this)); }; SetPinnedLeftWidthFeature.prototype.onPinnedLeftWidthChanged = function () { var leftWidth = this.pinnedWidthService.getPinnedLeftWidth(); var displayed = leftWidth > 0; setDisplayed(this.element, displayed); setFixedWidth(this.element, leftWidth); }; SetPinnedLeftWidthFeature.prototype.getWidth = function () { return this.pinnedWidthService.getPinnedLeftWidth(); }; __decorate$T([ Autowired('pinnedWidthService') ], SetPinnedLeftWidthFeature.prototype, "pinnedWidthService", void 0); __decorate$T([ PostConstruct ], SetPinnedLeftWidthFeature.prototype, "postConstruct", null); return SetPinnedLeftWidthFeature; }(BeanStub)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$18 = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __decorate$U = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var SetPinnedRightWidthFeature = /** @class */ (function (_super) { __extends$18(SetPinnedRightWidthFeature, _super); function SetPinnedRightWidthFeature(element) { var _this = _super.call(this) || this; _this.element = element; return _this; } SetPinnedRightWidthFeature.prototype.postConstruct = function () { this.addManagedListener(this.eventService, Events.EVENT_RIGHT_PINNED_WIDTH_CHANGED, this.onPinnedRightWidthChanged.bind(this)); }; SetPinnedRightWidthFeature.prototype.onPinnedRightWidthChanged = function () { var rightWidth = this.pinnedWidthService.getPinnedRightWidth(); var displayed = rightWidth > 0; setDisplayed(this.element, displayed); setFixedWidth(this.element, rightWidth); }; SetPinnedRightWidthFeature.prototype.getWidth = function () { return this.pinnedWidthService.getPinnedRightWidth(); }; __decorate$U([ Autowired('pinnedWidthService') ], SetPinnedRightWidthFeature.prototype, "pinnedWidthService", void 0); __decorate$U([ PostConstruct ], SetPinnedRightWidthFeature.prototype, "postConstruct", null); return SetPinnedRightWidthFeature; }(BeanStub)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$19 = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __decorate$V = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var SetHeightFeature = /** @class */ (function (_super) { __extends$19(SetHeightFeature, _super); function SetHeightFeature(eContainer, eWrapper) { var _this = _super.call(this) || this; _this.eContainer = eContainer; _this.eWrapper = eWrapper; return _this; } SetHeightFeature.prototype.postConstruct = function () { this.addManagedListener(this.eventService, Events.EVENT_ROW_CONTAINER_HEIGHT_CHANGED, this.onHeightChanged.bind(this)); }; SetHeightFeature.prototype.onHeightChanged = function () { var height = this.maxDivHeightScaler.getUiContainerHeight(); var heightString = height != null ? height + "px" : ""; this.eContainer.style.height = heightString; if (this.eWrapper) { this.eWrapper.style.height = heightString; } }; __decorate$V([ Autowired("rowContainerHeightService") ], SetHeightFeature.prototype, "maxDivHeightScaler", void 0); __decorate$V([ PostConstruct ], SetHeightFeature.prototype, "postConstruct", null); return SetHeightFeature; }(BeanStub)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$1a = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __decorate$W = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var DragListenerFeature = /** @class */ (function (_super) { __extends$1a(DragListenerFeature, _super); function DragListenerFeature(eContainer) { var _this = _super.call(this) || this; _this.eContainer = eContainer; return _this; } DragListenerFeature.prototype.postConstruct = function () { var _this = this; if (!this.gridOptionsService.isEnableRangeSelection() || // no range selection if no property missing(this.rangeService) // no range selection if not enterprise version ) { return; } var params = { eElement: this.eContainer, onDragStart: this.rangeService.onDragStart.bind(this.rangeService), onDragStop: this.rangeService.onDragStop.bind(this.rangeService), onDragging: this.rangeService.onDragging.bind(this.rangeService) }; this.dragService.addDragSource(params); this.addDestroyFunc(function () { return _this.dragService.removeDragSource(params); }); }; __decorate$W([ Optional('rangeService') ], DragListenerFeature.prototype, "rangeService", void 0); __decorate$W([ Autowired('dragService') ], DragListenerFeature.prototype, "dragService", void 0); __decorate$W([ PostConstruct ], DragListenerFeature.prototype, "postConstruct", null); return DragListenerFeature; }(BeanStub)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$1b = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __decorate$X = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var CenterWidthFeature = /** @class */ (function (_super) { __extends$1b(CenterWidthFeature, _super); function CenterWidthFeature(callback) { var _this = _super.call(this) || this; _this.callback = callback; return _this; } CenterWidthFeature.prototype.postConstruct = function () { var listener = this.setWidth.bind(this); this.addManagedPropertyListener('domLayout', listener); this.addManagedListener(this.eventService, Events.EVENT_DISPLAYED_COLUMNS_CHANGED, listener); this.addManagedListener(this.eventService, Events.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED, listener); this.setWidth(); }; CenterWidthFeature.prototype.setWidth = function () { var columnModel = this.columnModel; var printLayout = this.gridOptionsService.isDomLayout('print'); var centerWidth = columnModel.getBodyContainerWidth(); var leftWidth = columnModel.getDisplayedColumnsLeftWidth(); var rightWidth = columnModel.getDisplayedColumnsRightWidth(); var totalWidth = printLayout ? centerWidth + leftWidth + rightWidth : centerWidth; this.callback(totalWidth); }; __decorate$X([ Autowired('columnModel') ], CenterWidthFeature.prototype, "columnModel", void 0); __decorate$X([ PostConstruct ], CenterWidthFeature.prototype, "postConstruct", null); return CenterWidthFeature; }(BeanStub)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$1c = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __decorate$Y = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var __read$d = (undefined && undefined.__read) || function (o, n) { var m = typeof Symbol === "function" && o[Symbol.iterator]; if (!m) return o; var i = m.call(o), r, ar = [], e; try { while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); } catch (error) { e = { error: error }; } finally { try { if (r && !r.done && (m = i["return"])) m.call(i); } finally { if (e) throw e.error; } } return ar; }; var __spread$9 = (undefined && undefined.__spread) || function () { for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read$d(arguments[i])); return ar; }; (function (RowContainerName) { RowContainerName["LEFT"] = "left"; RowContainerName["RIGHT"] = "right"; RowContainerName["CENTER"] = "center"; RowContainerName["FULL_WIDTH"] = "fullWidth"; RowContainerName["TOP_LEFT"] = "topLeft"; RowContainerName["TOP_RIGHT"] = "topRight"; RowContainerName["TOP_CENTER"] = "topCenter"; RowContainerName["TOP_FULL_WIDTH"] = "topFullWidth"; RowContainerName["STICKY_TOP_LEFT"] = "stickyTopLeft"; RowContainerName["STICKY_TOP_RIGHT"] = "stickyTopRight"; RowContainerName["STICKY_TOP_CENTER"] = "stickyTopCenter"; RowContainerName["STICKY_TOP_FULL_WIDTH"] = "stickyTopFullWidth"; RowContainerName["BOTTOM_LEFT"] = "bottomLeft"; RowContainerName["BOTTOM_RIGHT"] = "bottomRight"; RowContainerName["BOTTOM_CENTER"] = "bottomCenter"; RowContainerName["BOTTOM_FULL_WIDTH"] = "bottomFullWidth"; })(exports.RowContainerName || (exports.RowContainerName = {})); (function (RowContainerType) { RowContainerType["LEFT"] = "left"; RowContainerType["RIGHT"] = "right"; RowContainerType["CENTER"] = "center"; RowContainerType["FULL_WIDTH"] = "fullWidth"; })(exports.RowContainerType || (exports.RowContainerType = {})); function getRowContainerTypeForName(name) { switch (name) { case exports.RowContainerName.CENTER: case exports.RowContainerName.TOP_CENTER: case exports.RowContainerName.STICKY_TOP_CENTER: case exports.RowContainerName.BOTTOM_CENTER: return exports.RowContainerType.CENTER; case exports.RowContainerName.LEFT: case exports.RowContainerName.TOP_LEFT: case exports.RowContainerName.STICKY_TOP_LEFT: case exports.RowContainerName.BOTTOM_LEFT: return exports.RowContainerType.LEFT; case exports.RowContainerName.RIGHT: case exports.RowContainerName.TOP_RIGHT: case exports.RowContainerName.STICKY_TOP_RIGHT: case exports.RowContainerName.BOTTOM_RIGHT: return exports.RowContainerType.RIGHT; case exports.RowContainerName.FULL_WIDTH: case exports.RowContainerName.TOP_FULL_WIDTH: case exports.RowContainerName.STICKY_TOP_FULL_WIDTH: case exports.RowContainerName.BOTTOM_FULL_WIDTH: return exports.RowContainerType.FULL_WIDTH; default: throw Error('Invalid Row Container Type'); } } var ContainerCssClasses = convertToMap([ [exports.RowContainerName.CENTER, 'ag-center-cols-container'], [exports.RowContainerName.LEFT, 'ag-pinned-left-cols-container'], [exports.RowContainerName.RIGHT, 'ag-pinned-right-cols-container'], [exports.RowContainerName.FULL_WIDTH, 'ag-full-width-container'], [exports.RowContainerName.TOP_CENTER, 'ag-floating-top-container'], [exports.RowContainerName.TOP_LEFT, 'ag-pinned-left-floating-top'], [exports.RowContainerName.TOP_RIGHT, 'ag-pinned-right-floating-top'], [exports.RowContainerName.TOP_FULL_WIDTH, 'ag-floating-top-full-width-container'], [exports.RowContainerName.STICKY_TOP_CENTER, 'ag-sticky-top-container'], [exports.RowContainerName.STICKY_TOP_LEFT, 'ag-pinned-left-sticky-top'], [exports.RowContainerName.STICKY_TOP_RIGHT, 'ag-pinned-right-sticky-top'], [exports.RowContainerName.STICKY_TOP_FULL_WIDTH, 'ag-sticky-top-full-width-container'], [exports.RowContainerName.BOTTOM_CENTER, 'ag-floating-bottom-container'], [exports.RowContainerName.BOTTOM_LEFT, 'ag-pinned-left-floating-bottom'], [exports.RowContainerName.BOTTOM_RIGHT, 'ag-pinned-right-floating-bottom'], [exports.RowContainerName.BOTTOM_FULL_WIDTH, 'ag-floating-bottom-full-width-container'], ]); var ViewportCssClasses = convertToMap([ [exports.RowContainerName.CENTER, 'ag-center-cols-viewport'], [exports.RowContainerName.TOP_CENTER, 'ag-floating-top-viewport'], [exports.RowContainerName.STICKY_TOP_CENTER, 'ag-sticky-top-viewport'], [exports.RowContainerName.BOTTOM_CENTER, 'ag-floating-bottom-viewport'], ]); var WrapperCssClasses = convertToMap([ [exports.RowContainerName.CENTER, 'ag-center-cols-clipper'], ]); var RowContainerCtrl = /** @class */ (function (_super) { __extends$1c(RowContainerCtrl, _super); function RowContainerCtrl(name) { var _this = _super.call(this) || this; _this.visible = true; // Maintaining a constant reference enables optimization in React. _this.EMPTY_CTRLS = []; _this.name = name; _this.isFullWithContainer = _this.name === exports.RowContainerName.TOP_FULL_WIDTH || _this.name === exports.RowContainerName.STICKY_TOP_FULL_WIDTH || _this.name === exports.RowContainerName.BOTTOM_FULL_WIDTH || _this.name === exports.RowContainerName.FULL_WIDTH; return _this; } RowContainerCtrl.getRowContainerCssClasses = function (name) { var containerClass = ContainerCssClasses.get(name); var viewportClass = ViewportCssClasses.get(name); var wrapperClass = WrapperCssClasses.get(name); return { container: containerClass, viewport: viewportClass, wrapper: wrapperClass }; }; RowContainerCtrl.getPinned = function (name) { switch (name) { case exports.RowContainerName.BOTTOM_LEFT: case exports.RowContainerName.TOP_LEFT: case exports.RowContainerName.STICKY_TOP_LEFT: case exports.RowContainerName.LEFT: return 'left'; case exports.RowContainerName.BOTTOM_RIGHT: case exports.RowContainerName.TOP_RIGHT: case exports.RowContainerName.STICKY_TOP_RIGHT: case exports.RowContainerName.RIGHT: return 'right'; default: return null; } }; RowContainerCtrl.prototype.postConstruct = function () { var _this = this; this.enableRtl = this.gridOptionsService.is('enableRtl'); this.embedFullWidthRows = this.gridOptionsService.is('embedFullWidthRows'); this.forContainers([exports.RowContainerName.CENTER], function () { return _this.viewportSizeFeature = _this.createManagedBean(new ViewportSizeFeature(_this)); }); }; RowContainerCtrl.prototype.registerWithCtrlsService = function () { switch (this.name) { case exports.RowContainerName.CENTER: this.ctrlsService.registerCenterRowContainerCtrl(this); break; case exports.RowContainerName.LEFT: this.ctrlsService.registerLeftRowContainerCtrl(this); break; case exports.RowContainerName.RIGHT: this.ctrlsService.registerRightRowContainerCtrl(this); break; case exports.RowContainerName.TOP_CENTER: this.ctrlsService.registerTopCenterRowContainerCtrl(this); break; case exports.RowContainerName.TOP_LEFT: this.ctrlsService.registerTopLeftRowContainerCon(this); break; case exports.RowContainerName.TOP_RIGHT: this.ctrlsService.registerTopRightRowContainerCtrl(this); break; case exports.RowContainerName.STICKY_TOP_CENTER: this.ctrlsService.registerStickyTopCenterRowContainerCtrl(this); break; case exports.RowContainerName.STICKY_TOP_LEFT: this.ctrlsService.registerStickyTopLeftRowContainerCon(this); break; case exports.RowContainerName.STICKY_TOP_RIGHT: this.ctrlsService.registerStickyTopRightRowContainerCtrl(this); break; case exports.RowContainerName.BOTTOM_CENTER: this.ctrlsService.registerBottomCenterRowContainerCtrl(this); break; case exports.RowContainerName.BOTTOM_LEFT: this.ctrlsService.registerBottomLeftRowContainerCtrl(this); break; case exports.RowContainerName.BOTTOM_RIGHT: this.ctrlsService.registerBottomRightRowContainerCtrl(this); break; } }; RowContainerCtrl.prototype.forContainers = function (names, callback) { if (names.indexOf(this.name) >= 0) { callback(); } }; RowContainerCtrl.prototype.getContainerElement = function () { return this.eContainer; }; RowContainerCtrl.prototype.getViewportSizeFeature = function () { return this.viewportSizeFeature; }; RowContainerCtrl.prototype.setComp = function (view, eContainer, eViewport, eWrapper) { var _this = this; this.comp = view; this.eContainer = eContainer; this.eViewport = eViewport; this.eWrapper = eWrapper; this.createManagedBean(new RowContainerEventsFeature(this.eContainer)); this.addPreventScrollWhileDragging(); this.listenOnDomOrder(); this.stopHScrollOnPinnedRows(); var allTopNoFW = [exports.RowContainerName.TOP_CENTER, exports.RowContainerName.TOP_LEFT, exports.RowContainerName.TOP_RIGHT]; var allStickyTopNoFW = [exports.RowContainerName.STICKY_TOP_CENTER, exports.RowContainerName.STICKY_TOP_LEFT, exports.RowContainerName.STICKY_TOP_RIGHT]; var allBottomNoFW = [exports.RowContainerName.BOTTOM_CENTER, exports.RowContainerName.BOTTOM_LEFT, exports.RowContainerName.BOTTOM_RIGHT]; var allMiddleNoFW = [exports.RowContainerName.CENTER, exports.RowContainerName.LEFT, exports.RowContainerName.RIGHT]; var allNoFW = __spread$9(allTopNoFW, allBottomNoFW, allMiddleNoFW, allStickyTopNoFW); var allMiddle = [exports.RowContainerName.CENTER, exports.RowContainerName.LEFT, exports.RowContainerName.RIGHT, exports.RowContainerName.FULL_WIDTH]; var allCenter = [exports.RowContainerName.CENTER, exports.RowContainerName.TOP_CENTER, exports.RowContainerName.STICKY_TOP_CENTER, exports.RowContainerName.BOTTOM_CENTER]; var allLeft = [exports.RowContainerName.LEFT, exports.RowContainerName.BOTTOM_LEFT, exports.RowContainerName.TOP_LEFT, exports.RowContainerName.STICKY_TOP_LEFT]; var allRight = [exports.RowContainerName.RIGHT, exports.RowContainerName.BOTTOM_RIGHT, exports.RowContainerName.TOP_RIGHT, exports.RowContainerName.STICKY_TOP_RIGHT]; this.forContainers(allLeft, function () { _this.pinnedWidthFeature = _this.createManagedBean(new SetPinnedLeftWidthFeature(_this.eContainer)); _this.addManagedListener(_this.eventService, Events.EVENT_LEFT_PINNED_WIDTH_CHANGED, function () { return _this.onPinnedWidthChanged(); }); }); this.forContainers(allRight, function () { _this.pinnedWidthFeature = _this.createManagedBean(new SetPinnedRightWidthFeature(_this.eContainer)); _this.addManagedListener(_this.eventService, Events.EVENT_RIGHT_PINNED_WIDTH_CHANGED, function () { return _this.onPinnedWidthChanged(); }); }); this.forContainers(allMiddle, function () { return _this.createManagedBean(new SetHeightFeature(_this.eContainer, _this.eWrapper)); }); this.forContainers(allNoFW, function () { return _this.createManagedBean(new DragListenerFeature(_this.eContainer)); }); this.forContainers(allCenter, function () { return _this.createManagedBean(new CenterWidthFeature(function (width) { return _this.comp.setContainerWidth(width + "px"); })); }); if (isInvisibleScrollbar()) { this.forContainers([exports.RowContainerName.CENTER], function () { var pinnedWidthChangedEvent = _this.enableRtl ? Events.EVENT_LEFT_PINNED_WIDTH_CHANGED : Events.EVENT_RIGHT_PINNED_WIDTH_CHANGED; _this.addManagedListener(_this.eventService, pinnedWidthChangedEvent, function () { return _this.refreshPaddingForFakeScrollbar(); }); }); this.refreshPaddingForFakeScrollbar(); } this.addListeners(); this.registerWithCtrlsService(); }; RowContainerCtrl.prototype.refreshPaddingForFakeScrollbar = function () { var _a = this, enableRtl = _a.enableRtl, columnModel = _a.columnModel, name = _a.name, eWrapper = _a.eWrapper, eContainer = _a.eContainer; var sideToCheck = enableRtl ? exports.RowContainerName.LEFT : exports.RowContainerName.RIGHT; this.forContainers([exports.RowContainerName.CENTER, sideToCheck], function () { var pinnedWidth = columnModel.getContainerWidth(sideToCheck); var marginSide = enableRtl ? 'marginLeft' : 'marginRight'; if (name === exports.RowContainerName.CENTER) { eWrapper.style[marginSide] = pinnedWidth ? '0px' : '16px'; } else { eContainer.style[marginSide] = pinnedWidth ? '16px' : '0px'; } }); }; RowContainerCtrl.prototype.addListeners = function () { var _this = this; this.addManagedListener(this.eventService, Events.EVENT_SCROLL_VISIBILITY_CHANGED, function () { return _this.onScrollVisibilityChanged(); }); this.addManagedListener(this.eventService, Events.EVENT_DISPLAYED_COLUMNS_CHANGED, function () { return _this.onDisplayedColumnsChanged(); }); this.addManagedListener(this.eventService, Events.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED, function () { return _this.onDisplayedColumnsWidthChanged(); }); this.addManagedListener(this.eventService, Events.EVENT_DISPLAYED_ROWS_CHANGED, function () { return _this.onDisplayedRowsChanged(); }); this.onScrollVisibilityChanged(); this.onDisplayedColumnsChanged(); this.onDisplayedColumnsWidthChanged(); this.onDisplayedRowsChanged(); }; RowContainerCtrl.prototype.listenOnDomOrder = function () { var _this = this; // sticky section must show rows in set order var allStickyContainers = [exports.RowContainerName.STICKY_TOP_CENTER, exports.RowContainerName.STICKY_TOP_LEFT, exports.RowContainerName.STICKY_TOP_RIGHT, exports.RowContainerName.STICKY_TOP_FULL_WIDTH]; var isStickContainer = allStickyContainers.indexOf(this.name) >= 0; if (isStickContainer) { this.comp.setDomOrder(true); return; } var listener = function () { var isEnsureDomOrder = _this.gridOptionsService.is('ensureDomOrder'); var isPrintLayout = _this.gridOptionsService.isDomLayout('print'); _this.comp.setDomOrder(isEnsureDomOrder || isPrintLayout); }; this.addManagedPropertyListener('domLayout', listener); listener(); }; // when editing a pinned row, if the cell is half outside the scrollable area, the browser can // scroll the column into view. we do not want this, the pinned sections should never scroll. // so we listen to scrolls on these containers and reset the scroll if we find one. RowContainerCtrl.prototype.stopHScrollOnPinnedRows = function () { var _this = this; this.forContainers([exports.RowContainerName.TOP_CENTER, exports.RowContainerName.STICKY_TOP_CENTER, exports.RowContainerName.BOTTOM_CENTER], function () { var resetScrollLeft = function () { return _this.eViewport.scrollLeft = 0; }; _this.addManagedListener(_this.eViewport, 'scroll', resetScrollLeft); }); }; RowContainerCtrl.prototype.onDisplayedColumnsChanged = function () { var _this = this; this.forContainers([exports.RowContainerName.CENTER], function () { return _this.onHorizontalViewportChanged(); }); }; RowContainerCtrl.prototype.onDisplayedColumnsWidthChanged = function () { var _this = this; this.forContainers([exports.RowContainerName.CENTER], function () { return _this.onHorizontalViewportChanged(); }); }; RowContainerCtrl.prototype.onScrollVisibilityChanged = function () { if (this.name !== exports.RowContainerName.CENTER) { return; } var visible = this.scrollVisibleService.isHorizontalScrollShowing(); var scrollbarWidth = visible ? (this.gridOptionsService.getScrollbarWidth() || 0) : 0; var height = scrollbarWidth == 0 ? '100%' : "calc(100% + " + scrollbarWidth + "px)"; this.comp.setViewportHeight(height); }; // this methods prevents the grid views from being scrolled while the dragService is being used // eg. the view should not scroll up and down while dragging rows using the rowDragComp. RowContainerCtrl.prototype.addPreventScrollWhileDragging = function () { var _this = this; var preventScroll = function (e) { if (_this.dragService.isDragging()) { if (e.cancelable) { e.preventDefault(); } } }; this.eContainer.addEventListener('touchmove', preventScroll, { passive: false }); this.addDestroyFunc(function () { return _this.eContainer.removeEventListener('touchmove', preventScroll); }); }; // this gets called whenever a change in the viewport, so we can inform column controller it has to work // out the virtual columns again. gets called from following locations: // + ensureColVisible, scroll, init, layoutChanged, displayedColumnsChanged RowContainerCtrl.prototype.onHorizontalViewportChanged = function () { var scrollWidth = this.getCenterWidth(); var scrollPosition = this.getCenterViewportScrollLeft(); this.columnModel.setViewportPosition(scrollWidth, scrollPosition); }; RowContainerCtrl.prototype.getCenterWidth = function () { return getInnerWidth(this.eViewport); }; RowContainerCtrl.prototype.getCenterViewportScrollLeft = function () { // we defer to a util, as how you calculated scrollLeft when doing RTL depends on the browser return getScrollLeft(this.eViewport, this.enableRtl); }; RowContainerCtrl.prototype.registerViewportResizeListener = function (listener) { var unsubscribeFromResize = this.resizeObserverService.observeResize(this.eViewport, listener); this.addDestroyFunc(function () { return unsubscribeFromResize(); }); }; RowContainerCtrl.prototype.isViewportVisible = function () { return isVisible(this.eViewport); }; RowContainerCtrl.prototype.isViewportHScrollShowing = function () { return isHorizontalScrollShowing(this.eViewport); }; RowContainerCtrl.prototype.getViewportScrollLeft = function () { return getScrollLeft(this.eViewport, this.enableRtl); }; RowContainerCtrl.prototype.isHorizontalScrollShowing = function () { var isAlwaysShowHorizontalScroll = this.gridOptionsService.is('alwaysShowHorizontalScroll'); return isAlwaysShowHorizontalScroll || isHorizontalScrollShowing(this.eViewport); }; RowContainerCtrl.prototype.getViewportElement = function () { return this.eViewport; }; RowContainerCtrl.prototype.setContainerTranslateX = function (amount) { this.eContainer.style.transform = "translateX(" + amount + "px)"; }; RowContainerCtrl.prototype.getHScrollPosition = function () { var res = { left: this.eViewport.scrollLeft, right: this.eViewport.scrollLeft + this.eViewport.offsetWidth }; return res; }; RowContainerCtrl.prototype.setCenterViewportScrollLeft = function (value) { // we defer to a util, as how you calculated scrollLeft when doing RTL depends on the browser setScrollLeft(this.eViewport, value, this.enableRtl); }; RowContainerCtrl.prototype.isContainerVisible = function () { var pinned = RowContainerCtrl.getPinned(this.name); return !pinned || (!!this.pinnedWidthFeature && this.pinnedWidthFeature.getWidth() > 0); }; RowContainerCtrl.prototype.onPinnedWidthChanged = function () { var visible = this.isContainerVisible(); if (this.visible != visible) { this.visible = visible; this.onDisplayedRowsChanged(); } if (isInvisibleScrollbar()) { this.refreshPaddingForFakeScrollbar(); } }; RowContainerCtrl.prototype.onDisplayedRowsChanged = function () { var _this = this; if (this.visible) { var printLayout_1 = this.gridOptionsService.isDomLayout('print'); var doesRowMatch = function (rowCtrl) { var fullWidthRow = rowCtrl.isFullWidth(); var embedFW = _this.embedFullWidthRows || printLayout_1; var match = _this.isFullWithContainer ? !embedFW && fullWidthRow : embedFW || !fullWidthRow; return match; }; // this list contains either all pinned top, center or pinned bottom rows // this filters out rows not for this container, eg if it's a full with row, but we are not full with container var rowsThisContainer = this.getRowCtrls().filter(doesRowMatch); this.comp.setRowCtrls(rowsThisContainer); } else { this.comp.setRowCtrls(this.EMPTY_CTRLS); } }; RowContainerCtrl.prototype.getRowCtrls = function () { switch (this.name) { case exports.RowContainerName.TOP_CENTER: case exports.RowContainerName.TOP_LEFT: case exports.RowContainerName.TOP_RIGHT: case exports.RowContainerName.TOP_FULL_WIDTH: return this.rowRenderer.getTopRowCtrls(); case exports.RowContainerName.STICKY_TOP_CENTER: case exports.RowContainerName.STICKY_TOP_LEFT: case exports.RowContainerName.STICKY_TOP_RIGHT: case exports.RowContainerName.STICKY_TOP_FULL_WIDTH: return this.rowRenderer.getStickyTopRowCtrls(); case exports.RowContainerName.BOTTOM_CENTER: case exports.RowContainerName.BOTTOM_LEFT: case exports.RowContainerName.BOTTOM_RIGHT: case exports.RowContainerName.BOTTOM_FULL_WIDTH: return this.rowRenderer.getBottomRowCtrls(); default: return this.rowRenderer.getRowCtrls(); } }; __decorate$Y([ Autowired('scrollVisibleService') ], RowContainerCtrl.prototype, "scrollVisibleService", void 0); __decorate$Y([ Autowired('dragService') ], RowContainerCtrl.prototype, "dragService", void 0); __decorate$Y([ Autowired('ctrlsService') ], RowContainerCtrl.prototype, "ctrlsService", void 0); __decorate$Y([ Autowired('columnModel') ], RowContainerCtrl.prototype, "columnModel", void 0); __decorate$Y([ Autowired('resizeObserverService') ], RowContainerCtrl.prototype, "resizeObserverService", void 0); __decorate$Y([ Autowired('rowRenderer') ], RowContainerCtrl.prototype, "rowRenderer", void 0); __decorate$Y([ PostConstruct ], RowContainerCtrl.prototype, "postConstruct", null); return RowContainerCtrl; }(BeanStub)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$1d = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __decorate$Z = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var GRID_BODY_TEMPLATE = /* html */ "
\n \n
\n \n \n \n \n
\n
\n
\n
\n \n \n \n \n
\n
\n \n
\n
\n \n \n \n \n
\n
\n \n \n \n \n
\n \n \n
"; var GridBodyComp = /** @class */ (function (_super) { __extends$1d(GridBodyComp, _super); function GridBodyComp() { return _super.call(this, GRID_BODY_TEMPLATE) || this; } GridBodyComp.prototype.init = function () { var _this = this; var setHeight = function (height, element) { var heightString = height + "px"; element.style.minHeight = heightString; element.style.height = heightString; }; var compProxy = { setRowAnimationCssOnBodyViewport: function (cssClass, animate) { return _this.setRowAnimationCssOnBodyViewport(cssClass, animate); }, setColumnCount: function (count) { return setAriaColCount(_this.getGui(), count); }, setRowCount: function (count) { return setAriaRowCount(_this.getGui(), count); }, setTopHeight: function (height) { return setHeight(height, _this.eTop); }, setBottomHeight: function (height) { return setHeight(height, _this.eBottom); }, setTopDisplay: function (display) { return _this.eTop.style.display = display; }, setBottomDisplay: function (display) { return _this.eBottom.style.display = display; }, setStickyTopHeight: function (height) { return _this.eStickyTop.style.height = height; }, setStickyTopTop: function (top) { return _this.eStickyTop.style.top = top; }, setStickyTopWidth: function (width) { return _this.eStickyTop.style.width = width; }, setColumnMovingCss: function (cssClass, flag) { return _this.addOrRemoveCssClass(cssClass, flag); }, updateLayoutClasses: function (cssClass, params) { var classLists = [ _this.eBodyViewport.classList, _this.eBodyClipper.classList, _this.eBody.classList ]; classLists.forEach(function (classList) { classList.toggle(exports.LayoutCssClasses.AUTO_HEIGHT, params.autoHeight); classList.toggle(exports.LayoutCssClasses.NORMAL, params.normal); classList.toggle(exports.LayoutCssClasses.PRINT, params.print); }); _this.addOrRemoveCssClass(exports.LayoutCssClasses.AUTO_HEIGHT, params.autoHeight); _this.addOrRemoveCssClass(exports.LayoutCssClasses.NORMAL, params.normal); _this.addOrRemoveCssClass(exports.LayoutCssClasses.PRINT, params.print); }, setAlwaysVerticalScrollClass: function (cssClass, on) { return _this.eBodyViewport.classList.toggle(CSS_CLASS_FORCE_VERTICAL_SCROLL, on); }, registerBodyViewportResizeListener: function (listener) { var unsubscribeFromResize = _this.resizeObserverService.observeResize(_this.eBodyViewport, listener); _this.addDestroyFunc(function () { return unsubscribeFromResize(); }); }, setPinnedTopBottomOverflowY: function (overflow) { return _this.eTop.style.overflowY = _this.eBottom.style.overflowY = overflow; }, setCellSelectableCss: function (cssClass, selectable) { [_this.eTop, _this.eBodyViewport, _this.eBottom] .forEach(function (ct) { return ct.classList.toggle(CSS_CLASS_CELL_SELECTABLE, selectable); }); }, setBodyViewportWidth: function (width) { return _this.eBodyViewport.style.width = width; } }; this.ctrl = this.createManagedBean(new GridBodyCtrl()); this.ctrl.setComp(compProxy, this.getGui(), this.eBodyViewport, this.eTop, this.eBottom, this.eStickyTop); if (this.rangeService || this.gridOptionsService.get('rowSelection') === 'multiple') { setAriaMultiSelectable(this.getGui(), true); } }; GridBodyComp.prototype.setRowAnimationCssOnBodyViewport = function (cssClass, animateRows) { var bodyViewportClassList = this.eBodyViewport.classList; bodyViewportClassList.toggle(exports.RowAnimationCssClasses.ANIMATION_ON, animateRows); bodyViewportClassList.toggle(exports.RowAnimationCssClasses.ANIMATION_OFF, !animateRows); }; GridBodyComp.prototype.getFloatingTopBottom = function () { return [this.eTop, this.eBottom]; }; __decorate$Z([ Autowired('resizeObserverService') ], GridBodyComp.prototype, "resizeObserverService", void 0); __decorate$Z([ Optional('rangeService') ], GridBodyComp.prototype, "rangeService", void 0); __decorate$Z([ RefSelector('eBodyViewport') ], GridBodyComp.prototype, "eBodyViewport", void 0); __decorate$Z([ RefSelector('eStickyTop') ], GridBodyComp.prototype, "eStickyTop", void 0); __decorate$Z([ RefSelector('eTop') ], GridBodyComp.prototype, "eTop", void 0); __decorate$Z([ RefSelector('eBottom') ], GridBodyComp.prototype, "eBottom", void 0); __decorate$Z([ RefSelector('gridHeader') ], GridBodyComp.prototype, "headerRootComp", void 0); __decorate$Z([ RefSelector('eBodyClipper') ], GridBodyComp.prototype, "eBodyClipper", void 0); __decorate$Z([ RefSelector('eBody') ], GridBodyComp.prototype, "eBody", void 0); __decorate$Z([ PostConstruct ], GridBodyComp.prototype, "init", null); return GridBodyComp; }(Component)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$1e = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __decorate$_ = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var ScrollVisibleService = /** @class */ (function (_super) { __extends$1e(ScrollVisibleService, _super); function ScrollVisibleService() { return _super !== null && _super.apply(this, arguments) || this; } ScrollVisibleService.prototype.postConstruct = function () { this.addManagedListener(this.eventService, Events.EVENT_DISPLAYED_COLUMNS_CHANGED, this.onDisplayedColumnsChanged.bind(this)); this.addManagedListener(this.eventService, Events.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED, this.onDisplayedColumnsWidthChanged.bind(this)); }; ScrollVisibleService.prototype.onDisplayedColumnsChanged = function () { this.update(); }; ScrollVisibleService.prototype.onDisplayedColumnsWidthChanged = function () { this.update(); }; ScrollVisibleService.prototype.update = function () { // because of column animation (which takes 200ms), we have to do this twice. // eg if user removes cols anywhere except at the RHS, then the cols on the RHS // will animate to the left to fill the gap. this animation means just after // the cols are removed, the remaining cols are still in the original location // at the start of the animation, so pre animation the H scrollbar is still needed, // but post animation it is not. this.updateImpl(); setTimeout(this.updateImpl.bind(this), 500); }; ScrollVisibleService.prototype.updateImpl = function () { var centerRowCtrl = this.ctrlsService.getCenterRowContainerCtrl(); if (!centerRowCtrl) { return; } var params = { horizontalScrollShowing: centerRowCtrl.isHorizontalScrollShowing(), verticalScrollShowing: this.isVerticalScrollShowing() }; this.setScrollsVisible(params); }; ScrollVisibleService.prototype.setScrollsVisible = function (params) { var atLeastOneDifferent = this.horizontalScrollShowing !== params.horizontalScrollShowing || this.verticalScrollShowing !== params.verticalScrollShowing; if (atLeastOneDifferent) { this.horizontalScrollShowing = params.horizontalScrollShowing; this.verticalScrollShowing = params.verticalScrollShowing; var event_1 = { type: Events.EVENT_SCROLL_VISIBILITY_CHANGED }; this.eventService.dispatchEvent(event_1); } }; // used by pagination service - to know page height ScrollVisibleService.prototype.isHorizontalScrollShowing = function () { return this.horizontalScrollShowing; }; // used by header container ScrollVisibleService.prototype.isVerticalScrollShowing = function () { return this.verticalScrollShowing; }; __decorate$_([ Autowired('ctrlsService') ], ScrollVisibleService.prototype, "ctrlsService", void 0); __decorate$_([ PostConstruct ], ScrollVisibleService.prototype, "postConstruct", null); ScrollVisibleService = __decorate$_([ Bean('scrollVisibleService') ], ScrollVisibleService); return ScrollVisibleService; }(BeanStub)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$1f = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __decorate$$ = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var MouseEventService = /** @class */ (function (_super) { __extends$1f(MouseEventService, _super); function MouseEventService() { var _this = _super !== null && _super.apply(this, arguments) || this; _this.gridInstanceId = MouseEventService_1.gridInstanceSequence.next(); return _this; } MouseEventService_1 = MouseEventService; // we put the instance id onto the main DOM element. this is used for events, when grids are inside grids, // so the grid can work out if the even came from this grid or a grid inside this one. see the ctrl+v logic // for where this is used. MouseEventService.prototype.stampTopLevelGridCompWithGridInstance = function (eGridDiv) { eGridDiv[MouseEventService_1.GRID_DOM_KEY] = this.gridInstanceId; }; MouseEventService.prototype.getRenderedCellForEvent = function (event) { return getCtrlForEvent(this.gridOptionsService, event, CellCtrl.DOM_DATA_KEY_CELL_CTRL); }; // walks the path of the event, and returns true if this grid is the first one that it finds. if doing // master / detail grids, and a child grid is found, then it returns false. this stops things like copy/paste // getting executed on many grids at the same time. MouseEventService.prototype.isEventFromThisGrid = function (event) { var res = this.isElementInThisGrid(event.target); return res; }; MouseEventService.prototype.isElementInThisGrid = function (element) { var pointer = element; while (pointer) { var instanceId = pointer[MouseEventService_1.GRID_DOM_KEY]; if (exists(instanceId)) { var eventFromThisGrid = instanceId === this.gridInstanceId; return eventFromThisGrid; } pointer = pointer.parentElement; } return false; }; MouseEventService.prototype.getCellPositionForEvent = function (event) { var cellComp = this.getRenderedCellForEvent(event); return cellComp ? cellComp.getCellPosition() : null; }; MouseEventService.prototype.getNormalisedPosition = function (event) { var gridPanelHasScrolls = this.gridOptionsService.isDomLayout('normal'); var e = event; var x; var y; if (e.clientX != null || e.clientY != null) { x = e.clientX; y = e.clientY; } else { x = e.x; y = e.y; } if (gridPanelHasScrolls) { var gridBodyCon = this.ctrlsService.getGridBodyCtrl(); var vRange = gridBodyCon.getScrollFeature().getVScrollPosition(); var hRange = gridBodyCon.getScrollFeature().getHScrollPosition(); x += hRange.left; y += vRange.top; } return { x: x, y: y }; }; var MouseEventService_1; MouseEventService.gridInstanceSequence = new NumberSequence(); MouseEventService.GRID_DOM_KEY = '__ag_grid_instance'; __decorate$$([ Autowired('ctrlsService') ], MouseEventService.prototype, "ctrlsService", void 0); MouseEventService = MouseEventService_1 = __decorate$$([ Bean('mouseEventService') ], MouseEventService); return MouseEventService; }(BeanStub)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$1g = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __assign$e = (undefined && undefined.__assign) || function () { __assign$e = Object.assign || function(t) { for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; } return t; }; return __assign$e.apply(this, arguments); }; var __decorate$10 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var NavigationService = /** @class */ (function (_super) { __extends$1g(NavigationService, _super); function NavigationService() { var _this = _super.call(this) || this; _this.onPageDown = throttle(_this.onPageDown, 100); _this.onPageUp = throttle(_this.onPageUp, 100); return _this; } NavigationService.prototype.postConstruct = function () { var _this = this; this.ctrlsService.whenReady(function (p) { _this.gridBodyCon = p.gridBodyCtrl; }); }; NavigationService.prototype.handlePageScrollingKey = function (event) { var key = event.key; var alt = event.altKey; var ctrl = event.ctrlKey || event.metaKey; var rangeServiceShouldHandleShift = !!this.rangeService && event.shiftKey; // home and end can be processed without knowing the currently selected cell, this can occur for full width rows. var currentCell = this.mouseEventService.getCellPositionForEvent(event); var processed = false; switch (key) { case KeyCode.PAGE_HOME: case KeyCode.PAGE_END: // handle home and end when ctrl & alt are NOT pressed if (!ctrl && !alt) { this.onHomeOrEndKey(key); processed = true; } break; case KeyCode.LEFT: case KeyCode.RIGHT: case KeyCode.UP: case KeyCode.DOWN: if (!currentCell) { return false; } // handle when ctrl is pressed only, if shift is pressed // it will be handled by the rangeService if (ctrl && !alt && !rangeServiceShouldHandleShift) { this.onCtrlUpDownLeftRight(key, currentCell); processed = true; } break; case KeyCode.PAGE_DOWN: if (!currentCell) { return false; } // handle page up and page down when ctrl & alt are NOT pressed if (!ctrl && !alt) { this.onPageDown(currentCell); processed = true; } break; case KeyCode.PAGE_UP: if (!currentCell) { return false; } // handle page up and page down when ctrl & alt are NOT pressed if (!ctrl && !alt) { this.onPageUp(currentCell); processed = true; } break; } if (processed) { event.preventDefault(); } return processed; }; NavigationService.prototype.navigateTo = function (navigateParams) { var scrollIndex = navigateParams.scrollIndex, scrollType = navigateParams.scrollType, scrollColumn = navigateParams.scrollColumn, focusIndex = navigateParams.focusIndex, focusColumn = navigateParams.focusColumn; if (exists(scrollColumn) && !scrollColumn.isPinned()) { this.gridBodyCon.getScrollFeature().ensureColumnVisible(scrollColumn); } if (exists(scrollIndex)) { this.gridBodyCon.getScrollFeature().ensureIndexVisible(scrollIndex, scrollType); } // setFocusedCell relies on the browser default focus behavior to scroll the focused cell into view, // however, this behavior will cause the cell border to be cut off, or if we have sticky rows, the // cell will be completely hidden, so we call ensureIndexVisible without a position to guarantee // minimal scroll to get the row into view. if (!navigateParams.isAsync) { this.gridBodyCon.getScrollFeature().ensureIndexVisible(focusIndex); } // if we don't do this, the range will be left on the last cell, which will leave the last focused cell // highlighted. this.focusService.setFocusedCell({ rowIndex: focusIndex, column: focusColumn, rowPinned: null, forceBrowserFocus: true }); if (this.rangeService) { var cellPosition = { rowIndex: focusIndex, rowPinned: null, column: focusColumn }; this.rangeService.setRangeToCell(cellPosition); } }; NavigationService.prototype.onPageDown = function (gridCell) { var gridBodyCon = this.ctrlsService.getGridBodyCtrl(); var scrollPosition = gridBodyCon.getScrollFeature().getVScrollPosition(); var pixelsInOnePage = this.getViewportHeight(); var pagingPixelOffset = this.paginationProxy.getPixelOffset(); var currentPageBottomPixel = scrollPosition.top + pixelsInOnePage; var currentPageBottomRow = this.paginationProxy.getRowIndexAtPixel(currentPageBottomPixel + pagingPixelOffset); if (this.columnModel.isAutoRowHeightActive()) { this.navigateToNextPageWithAutoHeight(gridCell, currentPageBottomRow); } else { this.navigateToNextPage(gridCell, currentPageBottomRow); } }; NavigationService.prototype.onPageUp = function (gridCell) { var gridBodyCon = this.ctrlsService.getGridBodyCtrl(); var scrollPosition = gridBodyCon.getScrollFeature().getVScrollPosition(); var pagingPixelOffset = this.paginationProxy.getPixelOffset(); var currentPageTopPixel = scrollPosition.top; var currentPageTopRow = this.paginationProxy.getRowIndexAtPixel(currentPageTopPixel + pagingPixelOffset); if (this.columnModel.isAutoRowHeightActive()) { this.navigateToNextPageWithAutoHeight(gridCell, currentPageTopRow, true); } else { this.navigateToNextPage(gridCell, currentPageTopRow, true); } }; NavigationService.prototype.navigateToNextPage = function (gridCell, scrollIndex, up) { if (up === void 0) { up = false; } var pixelsInOnePage = this.getViewportHeight(); var firstRow = this.paginationProxy.getPageFirstRow(); var lastRow = this.paginationProxy.getPageLastRow(); var pagingPixelOffset = this.paginationProxy.getPixelOffset(); var currentRowNode = this.paginationProxy.getRow(gridCell.rowIndex); var rowPixelDiff = up ? ((currentRowNode === null || currentRowNode === void 0 ? void 0 : currentRowNode.rowHeight) - pixelsInOnePage - pagingPixelOffset) : (pixelsInOnePage - pagingPixelOffset); var nextCellPixel = (currentRowNode === null || currentRowNode === void 0 ? void 0 : currentRowNode.rowTop) + rowPixelDiff; var focusIndex = this.paginationProxy.getRowIndexAtPixel(nextCellPixel + pagingPixelOffset); if (focusIndex === gridCell.rowIndex) { var diff = up ? -1 : 1; scrollIndex = focusIndex = gridCell.rowIndex + diff; } var scrollType; if (up) { scrollType = 'bottom'; if (focusIndex < firstRow) { focusIndex = firstRow; } if (scrollIndex < firstRow) { scrollIndex = firstRow; } } else { scrollType = 'top'; if (focusIndex > lastRow) { focusIndex = lastRow; } if (scrollIndex > lastRow) { scrollIndex = lastRow; } } if (this.isRowTallerThanView(focusIndex)) { scrollIndex = focusIndex; scrollType = 'top'; } this.navigateTo({ scrollIndex: scrollIndex, scrollType: scrollType, scrollColumn: null, focusIndex: focusIndex, focusColumn: gridCell.column }); }; NavigationService.prototype.navigateToNextPageWithAutoHeight = function (gridCell, scrollIndex, up) { var _this = this; if (up === void 0) { up = false; } // because autoHeight will calculate the height of rows after scroll // first we scroll towards the required point, then we add a small // delay to allow the height to be recalculated, check which index // should be focused and then finally navigate to that index. // TODO: we should probably have an event fired once to scrollbar has // settled and all rowHeights have been calculated instead of relying // on a setTimeout of 50ms. this.navigateTo({ scrollIndex: scrollIndex, scrollType: up ? 'bottom' : 'top', scrollColumn: null, focusIndex: scrollIndex, focusColumn: gridCell.column }); setTimeout(function () { var focusIndex = _this.getNextFocusIndexForAutoHeight(gridCell, up); _this.navigateTo({ scrollIndex: scrollIndex, scrollType: up ? 'bottom' : 'top', scrollColumn: null, focusIndex: focusIndex, focusColumn: gridCell.column, isAsync: true }); }, 50); }; NavigationService.prototype.getNextFocusIndexForAutoHeight = function (gridCell, up) { var _a; if (up === void 0) { up = false; } var step = up ? -1 : 1; var pixelsInOnePage = this.getViewportHeight(); var lastRowIndex = this.paginationProxy.getPageLastRow(); var pixelSum = 0; var currentIndex = gridCell.rowIndex; while (currentIndex >= 0 && currentIndex <= lastRowIndex) { var currentCell = this.paginationProxy.getRow(currentIndex); if (currentCell) { var currentCellHeight = (_a = currentCell.rowHeight) !== null && _a !== void 0 ? _a : 0; if (pixelSum + currentCellHeight > pixelsInOnePage) { break; } pixelSum += currentCellHeight; } currentIndex += step; } return Math.max(0, Math.min(currentIndex, lastRowIndex)); }; NavigationService.prototype.getViewportHeight = function () { var gridBodyCon = this.ctrlsService.getGridBodyCtrl(); var scrollPosition = gridBodyCon.getScrollFeature().getVScrollPosition(); var scrollbarWidth = this.gridOptionsService.getScrollbarWidth(); var pixelsInOnePage = scrollPosition.bottom - scrollPosition.top; if (this.ctrlsService.getCenterRowContainerCtrl().isHorizontalScrollShowing()) { pixelsInOnePage -= scrollbarWidth; } return pixelsInOnePage; }; NavigationService.prototype.isRowTallerThanView = function (rowIndex) { var rowNode = this.paginationProxy.getRow(rowIndex); if (!rowNode) { return false; } var rowHeight = rowNode.rowHeight; if (typeof rowHeight !== 'number') { return false; } return rowHeight > this.getViewportHeight(); }; NavigationService.prototype.onCtrlUpDownLeftRight = function (key, gridCell) { var cellToFocus = this.cellNavigationService.getNextCellToFocus(key, gridCell, true); var rowIndex = cellToFocus.rowIndex, column = cellToFocus.column; this.navigateTo({ scrollIndex: rowIndex, scrollType: null, scrollColumn: column, focusIndex: rowIndex, focusColumn: column }); }; // home brings focus to top left cell, end brings focus to bottom right, grid scrolled to bring // same cell into view (which means either scroll all the way up, or all the way down). NavigationService.prototype.onHomeOrEndKey = function (key) { var homeKey = key === KeyCode.PAGE_HOME; var allColumns = this.columnModel.getAllDisplayedColumns(); var columnToSelect = homeKey ? allColumns[0] : last(allColumns); var scrollIndex = homeKey ? this.paginationProxy.getPageFirstRow() : this.paginationProxy.getPageLastRow(); this.navigateTo({ scrollIndex: scrollIndex, scrollType: null, scrollColumn: columnToSelect, focusIndex: scrollIndex, focusColumn: columnToSelect }); }; // result of keyboard event NavigationService.prototype.onTabKeyDown = function (previous, keyboardEvent) { var backwards = keyboardEvent.shiftKey; var movedToNextCell = this.tabToNextCellCommon(previous, backwards, keyboardEvent); if (movedToNextCell) { // only prevent default if we found a cell. so if user is on last cell and hits tab, then we default // to the normal tabbing so user can exit the grid. keyboardEvent.preventDefault(); return; } // if we didn't move to next cell, then need to tab out of the cells, ie to the header (if going // backwards) if (backwards) { var _a = previous.getRowPosition(), rowIndex = _a.rowIndex, rowPinned = _a.rowPinned; var firstRow = rowPinned ? rowIndex === 0 : rowIndex === this.paginationProxy.getPageFirstRow(); if (firstRow) { keyboardEvent.preventDefault(); this.focusService.focusLastHeader(keyboardEvent); } } else { // if the case it's a popup editor, the focus is on the editor and not the previous cell. // in order for the tab navigation to work, we need to focus the browser back onto the // previous cell. if (previous instanceof CellCtrl) { previous.focusCell(true); } if (this.focusService.focusNextGridCoreContainer(backwards)) { keyboardEvent.preventDefault(); } } }; // comes from API NavigationService.prototype.tabToNextCell = function (backwards, event) { var focusedCell = this.focusService.getFocusedCell(); // if no focus, then cannot navigate if (!focusedCell) { return false; } var cellOrRow = this.getCellByPosition(focusedCell); // if cell is not rendered, means user has scrolled away from the cell // or that the focusedCell is a Full Width Row if (!cellOrRow) { cellOrRow = this.rowRenderer.getRowByPosition(focusedCell); if (!cellOrRow || !cellOrRow.isFullWidth()) { return false; } } return this.tabToNextCellCommon(cellOrRow, backwards, event); }; NavigationService.prototype.tabToNextCellCommon = function (previous, backwards, event) { var editing = previous.isEditing(); // if cell is not editing, there is still chance row is editing if it's Full Row Editing if (!editing && previous instanceof CellCtrl) { var cell = previous; var row = cell.getRowCtrl(); if (row) { editing = row.isEditing(); } } var res; if (editing) { // if we are editing, we know it's not a Full Width Row (RowComp) if (this.gridOptionsService.get('editType') === 'fullRow') { res = this.moveToNextEditingRow(previous, backwards, event); } else { res = this.moveToNextEditingCell(previous, backwards, event); } } else { res = this.moveToNextCellNotEditing(previous, backwards); } // if a cell wasn't found, it's possible that focus was moved to the header return res || !!this.focusService.getFocusedHeader(); }; NavigationService.prototype.moveToNextEditingCell = function (previousCell, backwards, event) { if (event === void 0) { event = null; } var previousPos = previousCell.getCellPosition(); // before we stop editing, we need to focus the cell element // so the grid doesn't detect that focus has left the grid previousCell.getGui().focus(); // need to do this before getting next cell to edit, in case the next cell // has editable function (eg colDef.editable=func() ) and it depends on the // result of this cell, so need to save updates from the first edit, in case // the value is referenced in the function. previousCell.stopEditing(); // find the next cell to start editing var nextCell = this.findNextCellToFocusOn(previousPos, backwards, true); if (nextCell == null) { return false; } // only prevent default if we found a cell. so if user is on last cell and hits tab, then we default // to the normal tabbing so user can exit the grid. nextCell.startEditing(null, null, true, event); nextCell.focusCell(false); return true; }; NavigationService.prototype.moveToNextEditingRow = function (previousCell, backwards, event) { if (event === void 0) { event = null; } var previousPos = previousCell.getCellPosition(); // find the next cell to start editing var nextCell = this.findNextCellToFocusOn(previousPos, backwards, true); if (nextCell == null) { return false; } var nextPos = nextCell.getCellPosition(); var previousEditable = this.isCellEditable(previousPos); var nextEditable = this.isCellEditable(nextPos); var rowsMatch = nextPos && previousPos.rowIndex === nextPos.rowIndex && previousPos.rowPinned === nextPos.rowPinned; if (previousEditable) { previousCell.setFocusOutOnEditor(); } if (!rowsMatch) { var pRow = previousCell.getRowCtrl(); pRow.stopEditing(); var nRow = nextCell.getRowCtrl(); nRow.startRowEditing(undefined, undefined, undefined, event); } if (nextEditable) { nextCell.setFocusInOnEditor(); nextCell.focusCell(); } else { nextCell.focusCell(true); } return true; }; NavigationService.prototype.moveToNextCellNotEditing = function (previousCell, backwards) { var displayedColumns = this.columnModel.getAllDisplayedColumns(); var cellPos; if (previousCell instanceof RowCtrl) { cellPos = __assign$e(__assign$e({}, previousCell.getRowPosition()), { column: backwards ? displayedColumns[0] : last(displayedColumns) }); } else { cellPos = previousCell.getCellPosition(); } // find the next cell to start editing var nextCell = this.findNextCellToFocusOn(cellPos, backwards, false); // only prevent default if we found a cell. so if user is on last cell and hits tab, then we default // to the normal tabbing so user can exit the grid. if (nextCell instanceof CellCtrl) { nextCell.focusCell(true); } else if (nextCell) { return this.tryToFocusFullWidthRow(nextCell.getRowPosition(), backwards); } return exists(nextCell); }; // called by the cell, when tab is pressed while editing. // @return: RenderedCell when navigation successful, otherwise null NavigationService.prototype.findNextCellToFocusOn = function (previousPosition, backwards, startEditing) { var nextPosition = previousPosition; while (true) { if (previousPosition !== nextPosition) { previousPosition = nextPosition; } if (!backwards) { nextPosition = this.getLastCellOfColSpan(nextPosition); } nextPosition = this.cellNavigationService.getNextTabbedCell(nextPosition, backwards); // allow user to override what cell to go to next var userFunc = this.gridOptionsService.getCallback('tabToNextCell'); if (exists(userFunc)) { var params = { backwards: backwards, editing: startEditing, previousCellPosition: previousPosition, nextCellPosition: nextPosition ? nextPosition : null }; var userCell = userFunc(params); if (exists(userCell)) { if (userCell.floating) { doOnce(function () { console.warn("AG Grid: tabToNextCellFunc return type should have attributes: rowIndex, rowPinned, column. However you had 'floating', maybe you meant 'rowPinned'?"); }, 'no floating in userCell'); userCell.rowPinned = userCell.floating; } nextPosition = { rowIndex: userCell.rowIndex, column: userCell.column, rowPinned: userCell.rowPinned }; } else { nextPosition = null; } } // if no 'next cell', means we have got to last cell of grid, so nothing to move to, // so bottom right cell going forwards, or top left going backwards if (!nextPosition) { return null; } if (nextPosition.rowIndex < 0) { var headerLen = this.headerNavigationService.getHeaderRowCount(); this.focusService.focusHeaderPosition({ headerPosition: { headerRowIndex: headerLen + (nextPosition.rowIndex), column: nextPosition.column } }); return null; } // if editing, but cell not editable, skip cell. we do this before we do all of // the 'ensure index visible' and 'flush all frames', otherwise if we are skipping // a bunch of cells (eg 10 rows) then all the work on ensuring cell visible is useless // (except for the last one) which causes grid to stall for a while. // note - for full row edit, we do focus non-editable cells, as the row stays in edit mode. var fullRowEdit = this.gridOptionsService.get('editType') === 'fullRow'; if (startEditing && !fullRowEdit) { var cellIsEditable = this.isCellEditable(nextPosition); if (!cellIsEditable) { continue; } } this.ensureCellVisible(nextPosition); // we have to call this after ensureColumnVisible - otherwise it could be a virtual column // or row that is not currently in view, hence the renderedCell would not exist var nextCell = this.getCellByPosition(nextPosition); // if next cell is fullWidth row, then no rendered cell, // as fullWidth rows have no cells, so we skip it if (!nextCell) { var row = this.rowRenderer.getRowByPosition(nextPosition); if (!row || !row.isFullWidth() || startEditing) { continue; } return row; } if (nextCell.isSuppressNavigable()) { continue; } // by default, when we click a cell, it gets selected into a range, so to keep keyboard navigation // consistent, we set into range here also. if (this.rangeService) { this.rangeService.setRangeToCell(nextPosition); } // we successfully tabbed onto a grid cell, so return true return nextCell; } }; NavigationService.prototype.isCellEditable = function (cell) { var rowNode = this.lookupRowNodeForCell(cell); if (rowNode) { return cell.column.isCellEditable(rowNode); } return false; }; NavigationService.prototype.getCellByPosition = function (cellPosition) { var rowCtrl = this.rowRenderer.getRowByPosition(cellPosition); if (!rowCtrl) { return null; } return rowCtrl.getCellCtrl(cellPosition.column); }; NavigationService.prototype.lookupRowNodeForCell = function (cell) { if (cell.rowPinned === 'top') { return this.pinnedRowModel.getPinnedTopRow(cell.rowIndex); } if (cell.rowPinned === 'bottom') { return this.pinnedRowModel.getPinnedBottomRow(cell.rowIndex); } return this.paginationProxy.getRow(cell.rowIndex); }; // we use index for rows, but column object for columns, as the next column (by index) might not // be visible (header grouping) so it's not reliable, so using the column object instead. NavigationService.prototype.navigateToNextCell = function (event, key, currentCell, allowUserOverride) { // we keep searching for a next cell until we find one. this is how the group rows get skipped var nextCell = currentCell; var hitEdgeOfGrid = false; while (nextCell && (nextCell === currentCell || !this.isValidNavigateCell(nextCell))) { // if the current cell is spanning across multiple columns, we need to move // our current position to be the last cell on the right before finding the // the next target. if (this.gridOptionsService.is('enableRtl')) { if (key === KeyCode.LEFT) { nextCell = this.getLastCellOfColSpan(nextCell); } } else if (key === KeyCode.RIGHT) { nextCell = this.getLastCellOfColSpan(nextCell); } nextCell = this.cellNavigationService.getNextCellToFocus(key, nextCell); // eg if going down, and nextCell=undefined, means we are gone past the last row hitEdgeOfGrid = missing(nextCell); } if (hitEdgeOfGrid && event && event.key === KeyCode.UP) { nextCell = { rowIndex: -1, rowPinned: null, column: currentCell.column }; } // allow user to override what cell to go to next. when doing normal cell navigation (with keys) // we allow this, however if processing 'enter after edit' we don't allow override if (allowUserOverride) { var userFunc = this.gridOptionsService.getCallback('navigateToNextCell'); if (exists(userFunc)) { var params = { key: key, previousCellPosition: currentCell, nextCellPosition: nextCell ? nextCell : null, event: event }; var userCell = userFunc(params); if (exists(userCell)) { if (userCell.floating) { doOnce(function () { console.warn("AG Grid: tabToNextCellFunc return type should have attributes: rowIndex, rowPinned, column. However you had 'floating', maybe you meant 'rowPinned'?"); }, 'no floating in userCell'); userCell.rowPinned = userCell.floating; } nextCell = { rowPinned: userCell.rowPinned, rowIndex: userCell.rowIndex, column: userCell.column }; } else { nextCell = null; } } } // no next cell means we have reached a grid boundary, eg left, right, top or bottom of grid if (!nextCell) { return; } if (nextCell.rowIndex < 0) { var headerLen = this.headerNavigationService.getHeaderRowCount(); this.focusService.focusHeaderPosition({ headerPosition: { headerRowIndex: headerLen + (nextCell.rowIndex), column: currentCell.column }, event: event || undefined }); return; } // in case we have col spanning we get the cellComp and use it to get the // position. This was we always focus the first cell inside the spanning. var normalisedPosition = this.getNormalisedPosition(nextCell); if (normalisedPosition) { this.focusPosition(normalisedPosition); } else { this.tryToFocusFullWidthRow(nextCell); } }; NavigationService.prototype.getNormalisedPosition = function (cellPosition) { // ensureCellVisible first, to make sure cell at position is rendered. this.ensureCellVisible(cellPosition); var cellCtrl = this.getCellByPosition(cellPosition); // not guaranteed to have a cellComp when using the SSRM as blocks are loading. if (!cellCtrl) { return null; } cellPosition = cellCtrl.getCellPosition(); // we call this again, as nextCell can be different to it's previous value due to Column Spanning // (ie if cursor moving from right to left, and cell is spanning columns, then nextCell was the // last column in the group, however now it's the first column in the group). if we didn't do // ensureCellVisible again, then we could only be showing the last portion (last column) of the // merged cells. this.ensureCellVisible(cellPosition); return cellPosition; }; NavigationService.prototype.tryToFocusFullWidthRow = function (position, backwards) { if (backwards === void 0) { backwards = false; } var displayedColumns = this.columnModel.getAllDisplayedColumns(); var rowComp = this.rowRenderer.getRowByPosition(position); if (!rowComp || !rowComp.isFullWidth()) { return false; } var currentCellFocused = this.focusService.getFocusedCell(); var cellPosition = { rowIndex: position.rowIndex, rowPinned: position.rowPinned, column: position.column || (backwards ? last(displayedColumns) : displayedColumns[0]) }; this.focusPosition(cellPosition); var fromBelow = currentCellFocused != null ? this.rowPositionUtils.before(cellPosition, currentCellFocused) : false; var focusEvent = { type: Events.EVENT_FULL_WIDTH_ROW_FOCUSED, rowIndex: cellPosition.rowIndex, rowPinned: cellPosition.rowPinned, column: cellPosition.column, isFullWidthCell: true, floating: cellPosition.rowPinned, fromBelow: fromBelow }; this.eventService.dispatchEvent(focusEvent); return true; }; NavigationService.prototype.focusPosition = function (cellPosition) { this.focusService.setFocusedCell({ rowIndex: cellPosition.rowIndex, column: cellPosition.column, rowPinned: cellPosition.rowPinned, forceBrowserFocus: true }); if (this.rangeService) { this.rangeService.setRangeToCell(cellPosition); } }; NavigationService.prototype.isValidNavigateCell = function (cell) { var rowNode = this.rowPositionUtils.getRowNode(cell); // we do not allow focusing on detail rows and full width rows return !!rowNode; }; NavigationService.prototype.getLastCellOfColSpan = function (cell) { var cellCtrl = this.getCellByPosition(cell); if (!cellCtrl) { return cell; } var colSpanningList = cellCtrl.getColSpanningList(); if (colSpanningList.length === 1) { return cell; } return { rowIndex: cell.rowIndex, column: last(colSpanningList), rowPinned: cell.rowPinned }; }; NavigationService.prototype.ensureCellVisible = function (gridCell) { var isGroupStickyEnabled = this.gridOptionsService.is('groupRowsSticky'); var rowNode = this.rowModel.getRow(gridCell.rowIndex); // sticky rows are always visible, so the grid shouldn't scroll to focus them. var skipScrollToRow = isGroupStickyEnabled && (rowNode === null || rowNode === void 0 ? void 0 : rowNode.sticky); // this scrolls the row into view if (!skipScrollToRow && missing(gridCell.rowPinned)) { this.gridBodyCon.getScrollFeature().ensureIndexVisible(gridCell.rowIndex); } if (!gridCell.column.isPinned()) { this.gridBodyCon.getScrollFeature().ensureColumnVisible(gridCell.column); } }; __decorate$10([ Autowired('mouseEventService') ], NavigationService.prototype, "mouseEventService", void 0); __decorate$10([ Autowired('paginationProxy') ], NavigationService.prototype, "paginationProxy", void 0); __decorate$10([ Autowired('focusService') ], NavigationService.prototype, "focusService", void 0); __decorate$10([ Optional('rangeService') ], NavigationService.prototype, "rangeService", void 0); __decorate$10([ Autowired('columnModel') ], NavigationService.prototype, "columnModel", void 0); __decorate$10([ Autowired('rowModel') ], NavigationService.prototype, "rowModel", void 0); __decorate$10([ Autowired('ctrlsService') ], NavigationService.prototype, "ctrlsService", void 0); __decorate$10([ Autowired('rowRenderer') ], NavigationService.prototype, "rowRenderer", void 0); __decorate$10([ Autowired('headerNavigationService') ], NavigationService.prototype, "headerNavigationService", void 0); __decorate$10([ Autowired("rowPositionUtils") ], NavigationService.prototype, "rowPositionUtils", void 0); __decorate$10([ Autowired("cellNavigationService") ], NavigationService.prototype, "cellNavigationService", void 0); __decorate$10([ Autowired("pinnedRowModel") ], NavigationService.prototype, "pinnedRowModel", void 0); __decorate$10([ PostConstruct ], NavigationService.prototype, "postConstruct", null); NavigationService = __decorate$10([ Bean('navigationService') ], NavigationService); return NavigationService; }(BeanStub)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$1h = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __decorate$11 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var PopupEditorWrapper = /** @class */ (function (_super) { __extends$1h(PopupEditorWrapper, _super); function PopupEditorWrapper(params) { var _this = _super.call(this, /* html */ "
") || this; _this.params = params; return _this; } PopupEditorWrapper.prototype.postConstruct = function () { this.gridOptionsService.setDomData(this.getGui(), PopupEditorWrapper.DOM_KEY_POPUP_EDITOR_WRAPPER, true); this.addKeyDownListener(); }; PopupEditorWrapper.prototype.addKeyDownListener = function () { var _this = this; var eGui = this.getGui(); var params = this.params; var listener = function (event) { if (!isUserSuppressingKeyboardEvent(_this.gridOptionsService, event, params.node, params.column, true)) { params.onKeyDown(event); } }; this.addManagedListener(eGui, 'keydown', listener); }; PopupEditorWrapper.DOM_KEY_POPUP_EDITOR_WRAPPER = 'popupEditorWrapper'; __decorate$11([ PostConstruct ], PopupEditorWrapper.prototype, "postConstruct", null); return PopupEditorWrapper; }(PopupComponent)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$1i = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var CellComp = /** @class */ (function (_super) { __extends$1i(CellComp, _super); function CellComp(beans, cellCtrl, printLayout, eRow, editingRow) { var _this = _super.call(this) || this; // every time we go into edit mode, or back again, this gets incremented. // it's the components way of dealing with the async nature of framework components, // so if a framework component takes a while to be created, we know if the object // is still relevant when creating is finished. eg we could click edit / un-edit 20 // times before the first React edit component comes back - we should discard // the first 19. _this.rendererVersion = 0; _this.editorVersion = 0; _this.beans = beans; _this.column = cellCtrl.getColumn(); _this.rowNode = cellCtrl.getRowNode(); _this.rowCtrl = cellCtrl.getRowCtrl(); _this.eRow = eRow; _this.setTemplate(/* html */ "
"); var eGui = _this.getGui(); _this.forceWrapper = cellCtrl.isForceWrapper(); _this.refreshWrapper(false); var setAttribute = function (name, value, element) { var actualElement = element ? element : eGui; if (value != null && value != '') { actualElement.setAttribute(name, value); } else { actualElement.removeAttribute(name); } }; var compProxy = { addOrRemoveCssClass: function (cssClassName, on) { return _this.addOrRemoveCssClass(cssClassName, on); }, setUserStyles: function (styles) { return addStylesToElement(eGui, styles); }, getFocusableElement: function () { return _this.getFocusableElement(); }, setTabIndex: function (tabIndex) { return setAttribute('tabindex', tabIndex.toString()); }, setRole: function (role) { return setAriaRole(eGui, role); }, setColId: function (colId) { return setAttribute('col-id', colId); }, setTitle: function (title) { return setAttribute('title', title); }, setIncludeSelection: function (include) { return _this.includeSelection = include; }, setIncludeRowDrag: function (include) { return _this.includeRowDrag = include; }, setIncludeDndSource: function (include) { return _this.includeDndSource = include; }, setRenderDetails: function (compDetails, valueToDisplay, force) { return _this.setRenderDetails(compDetails, valueToDisplay, force); }, setEditDetails: function (compDetails, popup, position) { return _this.setEditDetails(compDetails, popup, position); }, getCellEditor: function () { return _this.cellEditor || null; }, getCellRenderer: function () { return _this.cellRenderer || null; }, getParentOfValue: function () { return _this.getParentOfValue(); } }; _this.cellCtrl = cellCtrl; cellCtrl.setComp(compProxy, _this.getGui(), _this.eCellWrapper, printLayout, editingRow); return _this; } CellComp.prototype.getParentOfValue = function () { if (this.eCellValue) { // if not editing, and using wrapper, then value goes in eCellValue return this.eCellValue; } if (this.eCellWrapper) { // if editing, and using wrapper, value (cell editor) goes in eCellWrapper return this.eCellWrapper; } // if editing or rendering, and not using wrapper, value (or comp) is directly inside cell return this.getGui(); }; CellComp.prototype.setRenderDetails = function (compDetails, valueToDisplay, forceNewCellRendererInstance) { // this can happen if the users asks for the cell to refresh, but we are not showing the vale as we are editing var isInlineEditing = this.cellEditor && !this.cellEditorPopupWrapper; if (isInlineEditing) { return; } // this means firstRender will be true for one pass only, as it's initialised to undefined this.firstRender = this.firstRender == null; // if display template has changed, means any previous Cell Renderer is in the wrong location var controlWrapperChanged = this.refreshWrapper(false); this.refreshEditStyles(false); // all of these have dependencies on the eGui, so only do them after eGui is set if (compDetails) { var neverRefresh = forceNewCellRendererInstance || controlWrapperChanged; var cellRendererRefreshSuccessful = neverRefresh ? false : this.refreshCellRenderer(compDetails); if (!cellRendererRefreshSuccessful) { this.destroyRenderer(); this.createCellRendererInstance(compDetails); } } else { this.destroyRenderer(); this.insertValueWithoutCellRenderer(valueToDisplay); } }; CellComp.prototype.setEditDetails = function (compDetails, popup, position) { if (compDetails) { this.createCellEditorInstance(compDetails, popup, position); } else { this.destroyEditor(); } }; CellComp.prototype.removeControls = function () { this.checkboxSelectionComp = this.beans.context.destroyBean(this.checkboxSelectionComp); this.dndSourceComp = this.beans.context.destroyBean(this.dndSourceComp); this.rowDraggingComp = this.beans.context.destroyBean(this.rowDraggingComp); }; // returns true if wrapper was changed CellComp.prototype.refreshWrapper = function (editing) { var providingControls = this.includeRowDrag || this.includeDndSource || this.includeSelection; var usingWrapper = providingControls || this.forceWrapper; var putWrapperIn = usingWrapper && this.eCellWrapper == null; if (putWrapperIn) { this.eCellWrapper = loadTemplate(/* html */ "
"); this.getGui().appendChild(this.eCellWrapper); } var takeWrapperOut = !usingWrapper && this.eCellWrapper != null; if (takeWrapperOut) { removeFromParent(this.eCellWrapper); this.eCellWrapper = undefined; } this.addOrRemoveCssClass('ag-cell-value', !usingWrapper); var usingCellValue = !editing && usingWrapper; var putCellValueIn = usingCellValue && this.eCellValue == null; if (putCellValueIn) { this.eCellValue = loadTemplate(/* html */ ""); this.eCellWrapper.appendChild(this.eCellValue); } var takeCellValueOut = !usingCellValue && this.eCellValue != null; if (takeCellValueOut) { removeFromParent(this.eCellValue); this.eCellValue = undefined; } var templateChanged = putWrapperIn || takeWrapperOut || putCellValueIn || takeCellValueOut; if (templateChanged) { this.removeControls(); } if (!editing) { if (providingControls) { this.addControls(); } } return templateChanged; }; CellComp.prototype.addControls = function () { if (this.includeRowDrag) { if (this.rowDraggingComp == null) { this.rowDraggingComp = this.cellCtrl.createRowDragComp(); if (this.rowDraggingComp) { // put the checkbox in before the value this.eCellWrapper.insertBefore(this.rowDraggingComp.getGui(), this.eCellValue); } } } if (this.includeDndSource) { if (this.dndSourceComp == null) { this.dndSourceComp = this.cellCtrl.createDndSource(); // put the checkbox in before the value this.eCellWrapper.insertBefore(this.dndSourceComp.getGui(), this.eCellValue); } } if (this.includeSelection) { if (this.checkboxSelectionComp == null) { this.checkboxSelectionComp = this.cellCtrl.createSelectionCheckbox(); this.eCellWrapper.insertBefore(this.checkboxSelectionComp.getGui(), this.eCellValue); } } }; CellComp.prototype.createCellEditorInstance = function (compDetails, popup, position) { var _this = this; var versionCopy = this.editorVersion; var cellEditorPromise = compDetails.newAgStackInstance(); if (!cellEditorPromise) { return; } // if empty, userComponentFactory already did a console message var params = compDetails.params; cellEditorPromise.then(function (c) { return _this.afterCellEditorCreated(versionCopy, c, params, popup, position); }); // if we don't do this, and editor component is async, then there will be a period // when the component isn't present and keyboard navigation won't work - so example // of user hitting tab quickly (more quickly than renderers getting created) won't work var cellEditorAsync = missing(this.cellEditor); if (cellEditorAsync && params.cellStartedEdit) { this.cellCtrl.focusCell(true); } }; CellComp.prototype.insertValueWithoutCellRenderer = function (valueToDisplay) { var eParent = this.getParentOfValue(); clearElement(eParent); var escapedValue = valueToDisplay != null ? escapeString(valueToDisplay) : null; if (escapedValue != null) { eParent.innerHTML = escapedValue; } }; CellComp.prototype.destroyEditorAndRenderer = function () { this.destroyRenderer(); this.destroyEditor(); }; CellComp.prototype.destroyRenderer = function () { var context = this.beans.context; this.cellRenderer = context.destroyBean(this.cellRenderer); removeFromParent(this.cellRendererGui); this.cellRendererGui = null; this.rendererVersion++; }; CellComp.prototype.destroyEditor = function () { var context = this.beans.context; if (this.hideEditorPopup) { this.hideEditorPopup(); } this.hideEditorPopup = undefined; this.cellEditor = context.destroyBean(this.cellEditor); this.cellEditorPopupWrapper = context.destroyBean(this.cellEditorPopupWrapper); removeFromParent(this.cellEditorGui); this.cellEditorGui = null; this.editorVersion++; }; CellComp.prototype.refreshCellRenderer = function (compClassAndParams) { if (this.cellRenderer == null || this.cellRenderer.refresh == null) { return false; } // if different Cell Renderer configured this time (eg user is using selector, and // returns different component) then don't refresh, force recreate of Cell Renderer if (this.cellRendererClass !== compClassAndParams.componentClass) { return false; } // take any custom params off of the user var result = this.cellRenderer.refresh(compClassAndParams.params); // NOTE on undefined: previous version of the cellRenderer.refresh() interface // returned nothing, if the method existed, we assumed it refreshed. so for // backwards compatibility, we assume if method exists and returns nothing, // that it was successful. return result === true || result === undefined; }; CellComp.prototype.createCellRendererInstance = function (compDetails) { var _this = this; // never use task service if animation frame service is turned off. // and lastly we never use it if doing auto-height, as the auto-height service checks the // row height directly after the cell is created, it doesn't wait around for the tasks to complete var suppressAnimationFrame = this.beans.gridOptionsService.is('suppressAnimationFrame'); var useTaskService = !suppressAnimationFrame; var displayComponentVersionCopy = this.rendererVersion; var componentClass = compDetails.componentClass; var createCellRendererFunc = function () { var staleTask = _this.rendererVersion !== displayComponentVersionCopy || !_this.isAlive(); if (staleTask) { return; } // this can return null in the event that the user has switched from a renderer component to nothing, for example // when using a cellRendererSelect to return a component or null depending on row data etc var componentPromise = compDetails.newAgStackInstance(); var callback = _this.afterCellRendererCreated.bind(_this, displayComponentVersionCopy, componentClass); if (componentPromise) { componentPromise.then(callback); } }; // we only use task service when rendering for first time, which means it is not used when doing edits. // if we changed this (always use task service) would make sense, however it would break tests, possibly // test of users. if (useTaskService && this.firstRender) { this.beans.animationFrameService.createTask(createCellRendererFunc, this.rowNode.rowIndex, 'createTasksP2'); } else { createCellRendererFunc(); } }; CellComp.prototype.getCtrl = function () { return this.cellCtrl; }; CellComp.prototype.getRowCtrl = function () { return this.rowCtrl; }; CellComp.prototype.getCellRenderer = function () { return this.cellRenderer; }; CellComp.prototype.getCellEditor = function () { return this.cellEditor; }; CellComp.prototype.afterCellRendererCreated = function (cellRendererVersion, cellRendererClass, cellRenderer) { var staleTask = !this.isAlive() || cellRendererVersion !== this.rendererVersion; if (staleTask) { this.beans.context.destroyBean(cellRenderer); return; } this.cellRenderer = cellRenderer; this.cellRendererClass = cellRendererClass; this.cellRendererGui = this.cellRenderer.getGui(); if (this.cellRendererGui != null) { var eParent = this.getParentOfValue(); clearElement(eParent); eParent.appendChild(this.cellRendererGui); } }; CellComp.prototype.afterCellEditorCreated = function (requestVersion, cellEditor, params, popup, position) { // if editingCell=false, means user cancelled the editor before component was ready. // if versionMismatch, then user cancelled the edit, then started the edit again, and this // is the first editor which is now stale. var staleComp = requestVersion !== this.editorVersion; if (staleComp) { this.beans.context.destroyBean(cellEditor); return; } var editingCancelledByUserComp = cellEditor.isCancelBeforeStart && cellEditor.isCancelBeforeStart(); if (editingCancelledByUserComp) { this.beans.context.destroyBean(cellEditor); this.cellCtrl.stopEditing(true); return; } if (!cellEditor.getGui) { console.warn("AG Grid: cellEditor for column " + this.column.getId() + " is missing getGui() method"); this.beans.context.destroyBean(cellEditor); return; } this.cellEditor = cellEditor; this.cellEditorGui = cellEditor.getGui(); var cellEditorInPopup = popup || (cellEditor.isPopup !== undefined && cellEditor.isPopup()); if (cellEditorInPopup) { this.addPopupCellEditor(params, position); } else { this.addInCellEditor(); } this.refreshEditStyles(true, cellEditorInPopup); if (cellEditor.afterGuiAttached) { cellEditor.afterGuiAttached(); } }; CellComp.prototype.refreshEditStyles = function (editing, isPopup) { var _a; this.addOrRemoveCssClass('ag-cell-inline-editing', editing && !isPopup); this.addOrRemoveCssClass('ag-cell-popup-editing', editing && !!isPopup); this.addOrRemoveCssClass('ag-cell-not-inline-editing', !editing || !!isPopup); (_a = this.rowCtrl) === null || _a === void 0 ? void 0 : _a.setInlineEditingCss(editing); }; CellComp.prototype.addInCellEditor = function () { var eGui = this.getGui(); // if focus is inside the cell, we move focus to the cell itself // before removing it's contents, otherwise errors could be thrown. var eDocument = this.beans.gridOptionsService.getDocument(); if (eGui.contains(eDocument.activeElement)) { eGui.focus(); } this.destroyRenderer(); this.refreshWrapper(true); this.clearParentOfValue(); if (this.cellEditorGui) { var eParent = this.getParentOfValue(); eParent.appendChild(this.cellEditorGui); } }; CellComp.prototype.addPopupCellEditor = function (params, position) { var _this = this; if (this.beans.gridOptionsService.get('editType') === 'fullRow') { console.warn('AG Grid: popup cellEditor does not work with fullRowEdit - you cannot use them both ' + '- either turn off fullRowEdit, or stop using popup editors.'); } var cellEditor = this.cellEditor; // if a popup, then we wrap in a popup editor and return the popup this.cellEditorPopupWrapper = this.beans.context.createBean(new PopupEditorWrapper(params)); var ePopupGui = this.cellEditorPopupWrapper.getGui(); if (this.cellEditorGui) { ePopupGui.appendChild(this.cellEditorGui); } var popupService = this.beans.popupService; var useModelPopup = this.beans.gridOptionsService.is('stopEditingWhenCellsLoseFocus'); // see if position provided by colDef, if not then check old way of method on cellComp var positionToUse = position != null ? position : cellEditor.getPopupPosition ? cellEditor.getPopupPosition() : 'over'; var isRtl = this.beans.gridOptionsService.is('enableRtl'); var positionParams = { ePopup: ePopupGui, column: this.column, rowNode: this.rowNode, type: 'popupCellEditor', eventSource: this.getGui(), position: positionToUse, alignSide: isRtl ? 'right' : 'left', keepWithinBounds: true }; var positionCallback = popupService.positionPopupByComponent.bind(popupService, positionParams); var translate = this.beans.localeService.getLocaleTextFunc(); var addPopupRes = popupService.addPopup({ modal: useModelPopup, eChild: ePopupGui, closeOnEsc: true, closedCallback: function () { _this.cellCtrl.onPopupEditorClosed(); }, anchorToElement: this.getGui(), positionCallback: positionCallback, ariaLabel: translate('ariaLabelCellEditor', 'Cell Editor') }); if (addPopupRes) { this.hideEditorPopup = addPopupRes.hideFunc; } }; CellComp.prototype.detach = function () { this.eRow.removeChild(this.getGui()); }; // if the row is also getting destroyed, then we don't need to remove from dom, // as the row will also get removed, so no need to take out the cells from the row // if the row is going (removing is an expensive operation, so only need to remove // the top part) // // note - this is NOT called by context, as we don't wire / unwire the CellComp for performance reasons. CellComp.prototype.destroy = function () { this.cellCtrl.stopEditing(); this.destroyEditorAndRenderer(); this.removeControls(); _super.prototype.destroy.call(this); }; CellComp.prototype.clearParentOfValue = function () { var eGui = this.getGui(); // if focus is inside the cell, we move focus to the cell itself // before removing it's contents, otherwise errors could be thrown. var eDocument = this.beans.gridOptionsService.getDocument(); if (eGui.contains(eDocument.activeElement) && browserSupportsPreventScroll()) { eGui.focus({ preventScroll: true }); } clearElement(this.getParentOfValue()); }; return CellComp; }(Component)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$1j = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var RowComp = /** @class */ (function (_super) { __extends$1j(RowComp, _super); function RowComp(ctrl, beans, containerType) { var _this = _super.call(this) || this; _this.cellComps = {}; _this.beans = beans; _this.rowCtrl = ctrl; _this.setTemplate(/* html */ "
"); var eGui = _this.getGui(); var style = eGui.style; var compProxy = { setDomOrder: function (domOrder) { return _this.domOrder = domOrder; }, setCellCtrls: function (cellCtrls) { return _this.setCellCtrls(cellCtrls); }, showFullWidth: function (compDetails) { return _this.showFullWidth(compDetails); }, getFullWidthCellRenderer: function () { return _this.getFullWidthCellRenderer(); }, addOrRemoveCssClass: function (name, on) { return _this.addOrRemoveCssClass(name, on); }, setUserStyles: function (styles) { return addStylesToElement(eGui, styles); }, setTop: function (top) { return style.top = top; }, setTransform: function (transform) { return style.transform = transform; }, setRowIndex: function (rowIndex) { return eGui.setAttribute('row-index', rowIndex); }, setRole: function (role) { return setAriaRole(eGui, role); }, setRowId: function (rowId) { return eGui.setAttribute('row-id', rowId); }, setRowBusinessKey: function (businessKey) { return eGui.setAttribute('row-business-key', businessKey); }, setTabIndex: function (tabIndex) { return eGui.setAttribute('tabindex', tabIndex.toString()); } }; ctrl.setComp(compProxy, _this.getGui(), containerType); _this.addDestroyFunc(function () { ctrl.unsetComp(containerType); }); return _this; } RowComp.prototype.getInitialStyle = function (containerType) { var transform = this.rowCtrl.getInitialTransform(containerType); var top = this.rowCtrl.getInitialRowTop(containerType); return transform ? "transform: " + transform : "top: " + top; }; RowComp.prototype.showFullWidth = function (compDetails) { var _this = this; var callback = function (cellRenderer) { if (_this.isAlive()) { var eGui = cellRenderer.getGui(); _this.getGui().appendChild(eGui); _this.rowCtrl.setupDetailRowAutoHeight(eGui); _this.setFullWidthRowComp(cellRenderer); } else { _this.beans.context.destroyBean(cellRenderer); } }; // if not in cache, create new one var res = compDetails.newAgStackInstance(); if (!res) { return; } res.then(callback); }; RowComp.prototype.setCellCtrls = function (cellCtrls) { var _this = this; var cellsToRemove = Object.assign({}, this.cellComps); cellCtrls.forEach(function (cellCtrl) { var key = cellCtrl.getInstanceId(); var existingCellComp = _this.cellComps[key]; if (existingCellComp == null) { _this.newCellComp(cellCtrl); } else { cellsToRemove[key] = null; } }); var cellCompsToRemove = getAllValuesInObject(cellsToRemove) .filter(function (cellComp) { return cellComp != null; }); this.destroyCells(cellCompsToRemove); this.ensureDomOrder(cellCtrls); }; RowComp.prototype.ensureDomOrder = function (cellCtrls) { var _this = this; if (!this.domOrder) { return; } var elementsInOrder = []; cellCtrls.forEach(function (cellCtrl) { var cellComp = _this.cellComps[cellCtrl.getInstanceId()]; if (cellComp) { elementsInOrder.push(cellComp.getGui()); } }); setDomChildOrder(this.getGui(), elementsInOrder); }; RowComp.prototype.newCellComp = function (cellCtrl) { var cellComp = new CellComp(this.beans, cellCtrl, this.rowCtrl.isPrintLayout(), this.getGui(), this.rowCtrl.isEditing()); this.cellComps[cellCtrl.getInstanceId()] = cellComp; this.getGui().appendChild(cellComp.getGui()); }; RowComp.prototype.destroy = function () { _super.prototype.destroy.call(this); this.destroyAllCells(); }; RowComp.prototype.destroyAllCells = function () { var cellsToDestroy = getAllValuesInObject(this.cellComps).filter(function (cp) { return cp != null; }); this.destroyCells(cellsToDestroy); }; RowComp.prototype.setFullWidthRowComp = function (fullWidthRowComponent) { var _this = this; if (this.fullWidthCellRenderer) { console.error('AG Grid - should not be setting fullWidthRowComponent twice'); } this.fullWidthCellRenderer = fullWidthRowComponent; this.addDestroyFunc(function () { _this.fullWidthCellRenderer = _this.beans.context.destroyBean(_this.fullWidthCellRenderer); }); }; RowComp.prototype.getFullWidthCellRenderer = function () { return this.fullWidthCellRenderer; }; RowComp.prototype.destroyCells = function (cellComps) { var _this = this; cellComps.forEach(function (cellComp) { // could be old reference, ie removed cell if (!cellComp) { return; } // check cellComp belongs in this container var instanceId = cellComp.getCtrl().getInstanceId(); if (_this.cellComps[instanceId] !== cellComp) { return; } cellComp.detach(); cellComp.destroy(); _this.cellComps[instanceId] = null; }); }; return RowComp; }(Component)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$1k = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __assign$f = (undefined && undefined.__assign) || function () { __assign$f = Object.assign || function(t) { for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; } return t; }; return __assign$f.apply(this, arguments); }; var __decorate$12 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; function templateFactory() { var name = Component.elementGettingCreated.getAttribute('name'); var cssClasses = RowContainerCtrl.getRowContainerCssClasses(name); var res; var template1 = name === exports.RowContainerName.CENTER; var template2 = name === exports.RowContainerName.TOP_CENTER || name === exports.RowContainerName.STICKY_TOP_CENTER || name === exports.RowContainerName.BOTTOM_CENTER; if (template1) { res = /* html */ "
\n
\n
\n
\n
"; } else if (template2) { res = /* html */ "
\n
\n
"; } else { res = /* html */ "
"; } return res; } var RowContainerComp = /** @class */ (function (_super) { __extends$1k(RowContainerComp, _super); function RowContainerComp() { var _this = _super.call(this, templateFactory()) || this; _this.rowComps = {}; _this.name = Component.elementGettingCreated.getAttribute('name'); _this.type = getRowContainerTypeForName(_this.name); return _this; } RowContainerComp.prototype.postConstruct = function () { var _this = this; var compProxy = { setViewportHeight: function (height) { return _this.eViewport.style.height = height; }, setRowCtrls: function (rowCtrls) { return _this.setRowCtrls(rowCtrls); }, setDomOrder: function (domOrder) { _this.domOrder = domOrder; }, setContainerWidth: function (width) { return _this.eContainer.style.width = width; } }; var ctrl = this.createManagedBean(new RowContainerCtrl(this.name)); ctrl.setComp(compProxy, this.eContainer, this.eViewport, this.eWrapper); }; RowContainerComp.prototype.preDestroy = function () { // destroys all row comps this.setRowCtrls([]); }; RowContainerComp.prototype.setRowCtrls = function (rowCtrls) { var _this = this; var oldRows = __assign$f({}, this.rowComps); this.rowComps = {}; this.lastPlacedElement = null; var processRow = function (rowCon) { var instanceId = rowCon.getInstanceId(); var existingRowComp = oldRows[instanceId]; if (existingRowComp) { _this.rowComps[instanceId] = existingRowComp; delete oldRows[instanceId]; _this.ensureDomOrder(existingRowComp.getGui()); } else { var rowComp = new RowComp(rowCon, _this.beans, _this.type); _this.rowComps[instanceId] = rowComp; _this.appendRow(rowComp.getGui()); } }; rowCtrls.forEach(processRow); getAllValuesInObject(oldRows).forEach(function (oldRowComp) { _this.eContainer.removeChild(oldRowComp.getGui()); oldRowComp.destroy(); }); setAriaRole(this.eContainer, rowCtrls.length ? "rowgroup" : "presentation"); }; RowContainerComp.prototype.appendRow = function (element) { if (this.domOrder) { insertWithDomOrder(this.eContainer, element, this.lastPlacedElement); } else { this.eContainer.appendChild(element); } this.lastPlacedElement = element; }; RowContainerComp.prototype.ensureDomOrder = function (eRow) { if (this.domOrder) { ensureDomOrder(this.eContainer, eRow, this.lastPlacedElement); this.lastPlacedElement = eRow; } }; __decorate$12([ Autowired('beans') ], RowContainerComp.prototype, "beans", void 0); __decorate$12([ RefSelector('eViewport') ], RowContainerComp.prototype, "eViewport", void 0); __decorate$12([ RefSelector('eContainer') ], RowContainerComp.prototype, "eContainer", void 0); __decorate$12([ RefSelector('eWrapper') ], RowContainerComp.prototype, "eWrapper", void 0); __decorate$12([ PostConstruct ], RowContainerComp.prototype, "postConstruct", null); __decorate$12([ PreDestroy ], RowContainerComp.prototype, "preDestroy", null); return RowContainerComp; }(Component)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __decorate$13 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var BodyDropPivotTarget = /** @class */ (function () { function BodyDropPivotTarget(pinned) { this.columnsToAggregate = []; this.columnsToGroup = []; this.columnsToPivot = []; this.pinned = pinned; } /** Callback for when drag enters */ BodyDropPivotTarget.prototype.onDragEnter = function (draggingEvent) { var _this = this; this.clearColumnsList(); // in pivot mode, we don't accept any drops if functions are read only if (this.gridOptionsService.is('functionsReadOnly')) { return; } var dragColumns = draggingEvent.dragItem.columns; if (!dragColumns) { return; } dragColumns.forEach(function (column) { // we don't allow adding secondary columns if (!column.isPrimary()) { return; } if (column.isAnyFunctionActive()) { return; } if (column.isAllowValue()) { _this.columnsToAggregate.push(column); } else if (column.isAllowRowGroup()) { _this.columnsToGroup.push(column); } else if (column.isAllowPivot()) { _this.columnsToPivot.push(column); } }); }; BodyDropPivotTarget.prototype.getIconName = function () { var totalColumns = this.columnsToAggregate.length + this.columnsToGroup.length + this.columnsToPivot.length; if (totalColumns > 0) { return this.pinned ? DragAndDropService.ICON_PINNED : DragAndDropService.ICON_MOVE; } return null; }; /** Callback for when drag leaves */ BodyDropPivotTarget.prototype.onDragLeave = function (draggingEvent) { // if we are taking columns out of the center, then we remove them from the report this.clearColumnsList(); }; BodyDropPivotTarget.prototype.clearColumnsList = function () { this.columnsToAggregate.length = 0; this.columnsToGroup.length = 0; this.columnsToPivot.length = 0; }; /** Callback for when dragging */ BodyDropPivotTarget.prototype.onDragging = function (draggingEvent) { }; /** Callback for when drag stops */ BodyDropPivotTarget.prototype.onDragStop = function (draggingEvent) { if (this.columnsToAggregate.length > 0) { this.columnModel.addValueColumns(this.columnsToAggregate, "toolPanelDragAndDrop"); } if (this.columnsToGroup.length > 0) { this.columnModel.addRowGroupColumns(this.columnsToGroup, "toolPanelDragAndDrop"); } if (this.columnsToPivot.length > 0) { this.columnModel.addPivotColumns(this.columnsToPivot, "toolPanelDragAndDrop"); } }; __decorate$13([ Autowired('columnModel') ], BodyDropPivotTarget.prototype, "columnModel", void 0); __decorate$13([ Autowired('gridOptionsService') ], BodyDropPivotTarget.prototype, "gridOptionsService", void 0); return BodyDropPivotTarget; }()); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __decorate$14 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var __read$e = (undefined && undefined.__read) || function (o, n) { var m = typeof Symbol === "function" && o[Symbol.iterator]; if (!m) return o; var i = m.call(o), r, ar = [], e; try { while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); } catch (error) { e = { error: error }; } finally { try { if (r && !r.done && (m = i["return"])) m.call(i); } finally { if (e) throw e.error; } } return ar; }; var MoveColumnFeature = /** @class */ (function () { function MoveColumnFeature(pinned, eContainer) { this.needToMoveLeft = false; this.needToMoveRight = false; this.lastMovedInfo = null; this.pinned = pinned; this.eContainer = eContainer; this.centerContainer = !exists(pinned); } MoveColumnFeature.prototype.init = function () { var _this = this; this.ctrlsService.whenReady(function () { _this.gridBodyCon = _this.ctrlsService.getGridBodyCtrl(); }); }; MoveColumnFeature.prototype.getIconName = function () { return this.pinned ? DragAndDropService.ICON_PINNED : DragAndDropService.ICON_MOVE; }; MoveColumnFeature.prototype.onDragEnter = function (draggingEvent) { // we do dummy drag, so make sure column appears in the right location when first placed var columns = draggingEvent.dragItem.columns; var dragCameFromToolPanel = draggingEvent.dragSource.type === exports.DragSourceType.ToolPanel; if (dragCameFromToolPanel) { // the if statement doesn't work if drag leaves grid, then enters again this.setColumnsVisible(columns, true, "uiColumnDragged"); } else { // restore previous state of visible columns upon re-entering. this means if the user drags // a group out, and then drags the group back in, only columns that were originally visible // will be visible again. otherwise a group with three columns (but only two visible) could // be dragged out, then when it's dragged in again, all three are visible. this stops that. var visibleState_1 = draggingEvent.dragItem.visibleState; var visibleColumns = (columns || []).filter(function (column) { return visibleState_1[column.getId()]; }); this.setColumnsVisible(visibleColumns, true, "uiColumnDragged"); } this.setColumnsPinned(columns, this.pinned, "uiColumnDragged"); this.onDragging(draggingEvent, true, true); }; MoveColumnFeature.prototype.onDragLeave = function () { this.ensureIntervalCleared(); this.lastMovedInfo = null; }; MoveColumnFeature.prototype.setColumnsVisible = function (columns, visible, source) { if (source === void 0) { source = "api"; } if (columns) { var allowedCols = columns.filter(function (c) { return !c.getColDef().lockVisible; }); this.columnModel.setColumnsVisible(allowedCols, visible, source); } }; MoveColumnFeature.prototype.setColumnsPinned = function (columns, pinned, source) { if (source === void 0) { source = "api"; } if (columns) { var allowedCols = columns.filter(function (c) { return !c.getColDef().lockPinned; }); this.columnModel.setColumnsPinned(allowedCols, pinned, source); } }; MoveColumnFeature.prototype.onDragStop = function () { this.onDragging(this.lastDraggingEvent, false, true, true); this.ensureIntervalCleared(); this.lastMovedInfo = null; }; MoveColumnFeature.prototype.normaliseX = function (x) { // flip the coordinate if doing RTL if (this.gridOptionsService.is('enableRtl')) { var clientWidth = this.eContainer.clientWidth; x = clientWidth - x; } // adjust for scroll only if centre container (the pinned containers don't scroll) if (this.centerContainer) { x += this.ctrlsService.getCenterRowContainerCtrl().getCenterViewportScrollLeft(); } return x; }; MoveColumnFeature.prototype.checkCenterForScrolling = function (xAdjustedForScroll) { if (this.centerContainer) { // scroll if the mouse has gone outside the grid (or just outside the scrollable part if pinning) // putting in 50 buffer, so even if user gets to edge of grid, a scroll will happen var firstVisiblePixel = this.ctrlsService.getCenterRowContainerCtrl().getCenterViewportScrollLeft(); var lastVisiblePixel = firstVisiblePixel + this.ctrlsService.getCenterRowContainerCtrl().getCenterWidth(); if (this.gridOptionsService.is('enableRtl')) { this.needToMoveRight = xAdjustedForScroll < (firstVisiblePixel + 50); this.needToMoveLeft = xAdjustedForScroll > (lastVisiblePixel - 50); } else { this.needToMoveLeft = xAdjustedForScroll < (firstVisiblePixel + 50); this.needToMoveRight = xAdjustedForScroll > (lastVisiblePixel - 50); } if (this.needToMoveLeft || this.needToMoveRight) { this.ensureIntervalStarted(); } else { this.ensureIntervalCleared(); } } }; MoveColumnFeature.prototype.onDragging = function (draggingEvent, fromEnter, fakeEvent, finished) { var _this = this; var _a; if (draggingEvent === void 0) { draggingEvent = this.lastDraggingEvent; } if (fromEnter === void 0) { fromEnter = false; } if (fakeEvent === void 0) { fakeEvent = false; } if (finished === void 0) { finished = false; } if (finished) { if (this.lastMovedInfo) { var _b = this.lastMovedInfo, columns = _b.columns, toIndex = _b.toIndex; this.moveColumns(columns, toIndex, 'uiColumnMoved', true); } return; } this.lastDraggingEvent = draggingEvent; // if moving up or down (ie not left or right) then do nothing if (missing(draggingEvent.hDirection)) { return; } var mouseX = this.normaliseX(draggingEvent.x); // if the user is dragging into the panel, ie coming from the side panel into the main grid, // we don't want to scroll the grid this time, it would appear like the table is jumping // each time a column is dragged in. if (!fromEnter) { this.checkCenterForScrolling(mouseX); } var hDirection = this.normaliseDirection(draggingEvent.hDirection); var dragSourceType = draggingEvent.dragSource.type; var allMovingColumns = ((_a = draggingEvent.dragSource.getDragItem().columns) === null || _a === void 0 ? void 0 : _a.filter(function (col) { if (col.getColDef().lockPinned) { // if locked return true only if both col and container are same pin type. // double equals (==) here on purpose so that null==undefined is true (for not pinned options) return col.getPinned() == _this.pinned; } // if not pin locked, then always allowed to be in this container return true; })) || []; this.attemptMoveColumns({ dragSourceType: dragSourceType, allMovingColumns: allMovingColumns, hDirection: hDirection, mouseX: mouseX, fromEnter: fromEnter, fakeEvent: fakeEvent }); }; MoveColumnFeature.prototype.normaliseDirection = function (hDirection) { if (this.gridOptionsService.is('enableRtl')) { switch (hDirection) { case exports.HorizontalDirection.Left: return exports.HorizontalDirection.Right; case exports.HorizontalDirection.Right: return exports.HorizontalDirection.Left; default: console.error("AG Grid: Unknown direction " + hDirection); } } else { return hDirection; } }; MoveColumnFeature.prototype.attemptMoveColumns = function (params) { var dragSourceType = params.dragSourceType, hDirection = params.hDirection, mouseX = params.mouseX, fromEnter = params.fromEnter, fakeEvent = params.fakeEvent; var draggingLeft = hDirection === exports.HorizontalDirection.Left; var draggingRight = hDirection === exports.HorizontalDirection.Right; var allMovingColumns = params.allMovingColumns; if (dragSourceType === exports.DragSourceType.HeaderCell) { // If the columns we're dragging are the only visible columns of their group, move the hidden ones too var newCols_1 = []; allMovingColumns.forEach(function (col) { var movingGroup = null; var parent = col.getParent(); while (parent != null && parent.getDisplayedLeafColumns().length === 1) { movingGroup = parent; parent = parent.getParent(); } if (movingGroup != null) { movingGroup.getLeafColumns().forEach(function (newCol) { if (!newCols_1.includes(newCol)) { newCols_1.push(newCol); } }); } else if (!newCols_1.includes(col)) { newCols_1.push(col); } }); allMovingColumns = newCols_1; } // it is important to sort the moving columns as they are in grid columns, as the list of moving columns // could themselves be part of 'married children' groups, which means we need to maintain the order within // the moving list. var allMovingColumnsOrdered = allMovingColumns.slice(); this.columnModel.sortColumnsLikeGridColumns(allMovingColumnsOrdered); var validMoves = this.calculateValidMoves(allMovingColumnsOrdered, draggingRight, mouseX); // if cols are not adjacent, then this returns null. when moving, we constrain the direction of the move // (ie left or right) to the mouse direction. however var oldIndex = this.calculateOldIndex(allMovingColumnsOrdered); if (validMoves.length === 0) { return; } var firstValidMove = validMoves[0]; // the two check below stop an error when the user grabs a group my a middle column, then // it is possible the mouse pointer is to the right of a column while been dragged left. // so we need to make sure that the mouse pointer is actually left of the left most column // if moving left, and right of the right most column if moving right // we check 'fromEnter' below so we move the column to the new spot if the mouse is coming from // outside the grid, eg if the column is moving from side panel, mouse is moving left, then we should // place the column to the RHS even if the mouse is moving left and the column is already on // the LHS. otherwise we stick to the rule described above. var constrainDirection = oldIndex !== null && !fromEnter; // don't consider 'fromEnter' when dragging header cells, otherwise group can jump to opposite direction of drag if (dragSourceType == exports.DragSourceType.HeaderCell) { constrainDirection = oldIndex !== null; } // if the event was faked by a change in column pin state, then the original location of the column // is not reliable for dictating where the column may now be placed. if (constrainDirection && !fakeEvent) { // only allow left drag if this column is moving left if (draggingLeft && firstValidMove >= oldIndex) { return; } // only allow right drag if this column is moving right if (draggingRight && firstValidMove <= oldIndex) { return; } } // From when we find a move that passes all the rules // Remember what that move would look like in terms of displayed cols // keep going with further moves until we find a different result in displayed output // In this way potentialMoves contains all potential moves over 'hidden' columns var displayedCols = this.columnModel.getAllDisplayedColumns(); var potentialMoves = []; var targetOrder = null; for (var i = 0; i < validMoves.length; i++) { var move = validMoves[i]; var order = this.columnModel.getProposedColumnOrder(allMovingColumnsOrdered, move); if (!this.columnModel.doesOrderPassRules(order)) { continue; } var displayedOrder = order.filter(function (col) { return displayedCols.includes(col); }); if (targetOrder === null) { targetOrder = displayedOrder; } else if (!_.areEqual(displayedOrder, targetOrder)) { break; // Stop looking for potential moves if the displayed result changes from the target } var fragCount = this.groupFragCount(order); potentialMoves.push({ move: move, fragCount: fragCount }); } if (potentialMoves.length === 0) { return; } // The best move is the move with least group fragmentation potentialMoves.sort(function (a, b) { return a.fragCount - b.fragCount; }); this.moveColumns(allMovingColumns, potentialMoves[0].move, 'uiColumnMoved', false); }; // returns the index of the first column in the list ONLY if the cols are all beside // each other. if the cols are not beside each other, then returns null MoveColumnFeature.prototype.calculateOldIndex = function (movingCols) { var gridCols = this.columnModel.getAllGridColumns(); var indexes = sortNumerically(movingCols.map(function (col) { return gridCols.indexOf(col); })); var firstIndex = indexes[0]; var lastIndex = last(indexes); var spread = lastIndex - firstIndex; var gapsExist = spread !== indexes.length - 1; return gapsExist ? null : firstIndex; }; MoveColumnFeature.prototype.moveColumns = function (columns, toIndex, source, finished) { this.columnModel.moveColumns(columns, toIndex, source, finished); this.lastMovedInfo = finished ? null : { columns: columns, toIndex: toIndex }; }; // A measure of how fragmented in terms of groups an order of columns is MoveColumnFeature.prototype.groupFragCount = function (columns) { function parents(col) { var result = []; var parent = col.getOriginalParent(); while (parent != null) { result.push(parent); parent = parent.getOriginalParent(); } return result; } var count = 0; var _loop_1 = function (i) { var _a; var a = parents(columns[i]); var b = parents(columns[i + 1]); // iterate over the longest one _a = __read$e(a.length > b.length ? [a, b] : [b, a], 2), a = _a[0], b = _a[1]; a.forEach(function (parent) { if (b.indexOf(parent) === -1) { count++; // More fragmented if other column doesn't share the parent } }); }; for (var i = 0; i < columns.length - 1; i++) { _loop_1(i); } return count; }; MoveColumnFeature.prototype.calculateValidMoves = function (movingCols, draggingRight, mouseX) { var isMoveBlocked = this.gridOptionsService.is('suppressMovableColumns') || movingCols.some(function (col) { return col.getColDef().suppressMovable; }); if (isMoveBlocked) { return []; } // this is the list of cols on the screen, so it's these we use when comparing the x mouse position var allDisplayedCols = this.columnModel.getDisplayedColumns(this.pinned); // but this list is the list of all cols, when we move a col it's the index within this list that gets used, // so the result we return has to be and index location for this list var allGridCols = this.columnModel.getAllGridColumns(); var movingDisplayedCols = allDisplayedCols.filter(function (col) { return includes(movingCols, col); }); var otherDisplayedCols = allDisplayedCols.filter(function (col) { return !includes(movingCols, col); }); var otherGridCols = allGridCols.filter(function (col) { return !includes(movingCols, col); }); // work out how many DISPLAYED columns fit before the 'x' position. this gives us the displayIndex. // for example, if cols are a,b,c,d and we find a,b fit before 'x', then we want to place the moving // col between b and c (so that it is under the mouse position). var displayIndex = 0; var availableWidth = mouseX; // if we are dragging right, then the columns will be to the left of the mouse, so we also want to // include the width of the moving columns if (draggingRight) { var widthOfMovingDisplayedCols_1 = 0; movingDisplayedCols.forEach(function (col) { return widthOfMovingDisplayedCols_1 += col.getActualWidth(); }); availableWidth -= widthOfMovingDisplayedCols_1; } if (availableWidth > 0) { // now count how many of the displayed columns will fit to the left for (var i = 0; i < otherDisplayedCols.length; i++) { var col = otherDisplayedCols[i]; availableWidth -= col.getActualWidth(); if (availableWidth < 0) { break; } displayIndex++; } // trial and error, if going right, we adjust by one, i didn't manage to quantify why, but it works if (draggingRight) { displayIndex++; } } // the display index is with respect to all the showing columns, however when we move, it's with // respect to all grid columns, so we need to translate from display index to grid index var firstValidMove; if (displayIndex > 0) { var leftColumn = otherDisplayedCols[displayIndex - 1]; firstValidMove = otherGridCols.indexOf(leftColumn) + 1; } else { firstValidMove = otherGridCols.indexOf(otherDisplayedCols[0]); if (firstValidMove === -1) { firstValidMove = 0; } } var validMoves = [firstValidMove]; var numberComparator = function (a, b) { return a - b; }; // add in other valid moves due to hidden columns and married children. for example, a particular // move might break a group that has married children (so move isn't valid), however there could // be hidden columns (not displayed) that we could jump over to make the move valid. because // they are hidden, user doesn't see any different, however it allows moves that would otherwise // not work. for example imagine a group with 9 columns and all columns are hidden except the // middle one (so 4 hidden to left, 4 hidden to right), then when moving 'firstValidMove' will // be relative to the not-shown column, however we need to consider the move jumping over all the // hidden children. if we didn't do this, then if the group just described was at the end (RHS) of the // grid, there would be no way to put a column after it (as the grid would only consider beside the // visible column, which would fail valid move rules). if (draggingRight) { // if dragging right, then we add all the additional moves to the right. so in other words // if the next move is not valid, find the next move to the right that is valid. var pointer = firstValidMove + 1; var lastIndex = allGridCols.length - 1; while (pointer <= lastIndex) { validMoves.push(pointer); pointer++; } // adding columns here means the order is now messed up validMoves.sort(numberComparator); } else { // if dragging left we do the reverse of dragging right, we add in all the valid moves to the // left. however we also have to consider moves to the right for all hidden columns first. // (this logic is hard to reason with, it was worked out with trial and error, // more observation rather than science). // add moves to the right var pointer = firstValidMove; var lastIndex = allGridCols.length - 1; var displacedCol = allGridCols[pointer]; while (pointer <= lastIndex && this.isColumnHidden(allDisplayedCols, displacedCol)) { pointer++; validMoves.push(pointer); displacedCol = allGridCols[pointer]; } // add moves to the left pointer = firstValidMove - 1; var firstDisplayIndex = 0; while (pointer >= firstDisplayIndex) { validMoves.push(pointer); pointer--; } // adding columns here means the order is now messed up validMoves.sort(numberComparator).reverse(); } return validMoves; }; // isHidden takes into account visible=false and group=closed, ie it is not displayed MoveColumnFeature.prototype.isColumnHidden = function (displayedColumns, col) { return displayedColumns.indexOf(col) < 0; }; MoveColumnFeature.prototype.ensureIntervalStarted = function () { if (!this.movingIntervalId) { this.intervalCount = 0; this.failedMoveAttempts = 0; this.movingIntervalId = window.setInterval(this.moveInterval.bind(this), 100); if (this.needToMoveLeft) { this.dragAndDropService.setGhostIcon(DragAndDropService.ICON_LEFT, true); } else { this.dragAndDropService.setGhostIcon(DragAndDropService.ICON_RIGHT, true); } } }; MoveColumnFeature.prototype.ensureIntervalCleared = function () { if (this.movingIntervalId) { window.clearInterval(this.movingIntervalId); this.movingIntervalId = null; this.dragAndDropService.setGhostIcon(DragAndDropService.ICON_MOVE); } }; MoveColumnFeature.prototype.moveInterval = function () { // the amounts we move get bigger at each interval, so the speed accelerates, starting a bit slow // and getting faster. this is to give smoother user experience. we max at 100px to limit the speed. var pixelsToMove; this.intervalCount++; pixelsToMove = 10 + (this.intervalCount * 5); if (pixelsToMove > 100) { pixelsToMove = 100; } var pixelsMoved = null; var scrollFeature = this.gridBodyCon.getScrollFeature(); if (this.needToMoveLeft) { pixelsMoved = scrollFeature.scrollHorizontally(-pixelsToMove); } else if (this.needToMoveRight) { pixelsMoved = scrollFeature.scrollHorizontally(pixelsToMove); } if (pixelsMoved !== 0) { this.onDragging(this.lastDraggingEvent); this.failedMoveAttempts = 0; } else { // we count the failed move attempts. if we fail to move 7 times, then we pin the column. // this is how we achieve pining by dragging the column to the edge of the grid. this.failedMoveAttempts++; var columns = this.lastDraggingEvent.dragItem.columns; var columnsThatCanPin = columns.filter(function (c) { return !c.getColDef().lockPinned; }); if (columnsThatCanPin.length > 0) { this.dragAndDropService.setGhostIcon(DragAndDropService.ICON_PINNED); if (this.failedMoveAttempts > 7) { var pinType = this.needToMoveLeft ? 'left' : 'right'; this.setColumnsPinned(columnsThatCanPin, pinType, "uiColumnDragged"); this.dragAndDropService.nudge(); } } } }; __decorate$14([ Autowired('columnModel') ], MoveColumnFeature.prototype, "columnModel", void 0); __decorate$14([ Autowired('dragAndDropService') ], MoveColumnFeature.prototype, "dragAndDropService", void 0); __decorate$14([ Autowired('gridOptionsService') ], MoveColumnFeature.prototype, "gridOptionsService", void 0); __decorate$14([ Autowired('ctrlsService') ], MoveColumnFeature.prototype, "ctrlsService", void 0); __decorate$14([ PostConstruct ], MoveColumnFeature.prototype, "init", null); return MoveColumnFeature; }()); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$1l = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __decorate$15 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var BodyDropTarget = /** @class */ (function (_super) { __extends$1l(BodyDropTarget, _super); function BodyDropTarget(pinned, eContainer) { var _this = _super.call(this) || this; _this.pinned = pinned; _this.eContainer = eContainer; return _this; } BodyDropTarget.prototype.postConstruct = function () { var _this = this; this.ctrlsService.whenReady(function (p) { switch (_this.pinned) { case 'left': _this.eSecondaryContainers = [ [p.gridBodyCtrl.getBodyViewportElement(), p.leftRowContainerCtrl.getContainerElement()], [p.bottomLeftRowContainerCtrl.getContainerElement()], [p.topLeftRowContainerCtrl.getContainerElement()] ]; break; case 'right': _this.eSecondaryContainers = [ [p.gridBodyCtrl.getBodyViewportElement(), p.rightRowContainerCtrl.getContainerElement()], [p.bottomRightRowContainerCtrl.getContainerElement()], [p.topRightRowContainerCtrl.getContainerElement()] ]; break; default: _this.eSecondaryContainers = [ [p.gridBodyCtrl.getBodyViewportElement(), p.centerRowContainerCtrl.getViewportElement()], [p.bottomCenterRowContainerCtrl.getViewportElement()], [p.topCenterRowContainerCtrl.getViewportElement()] ]; break; } }); }; BodyDropTarget.prototype.isInterestedIn = function (type) { return type === exports.DragSourceType.HeaderCell || (type === exports.DragSourceType.ToolPanel && this.gridOptionsService.is('allowDragFromColumnsToolPanel')); }; BodyDropTarget.prototype.getSecondaryContainers = function () { return this.eSecondaryContainers; }; BodyDropTarget.prototype.getContainer = function () { return this.eContainer; }; BodyDropTarget.prototype.init = function () { this.moveColumnFeature = this.createManagedBean(new MoveColumnFeature(this.pinned, this.eContainer)); this.bodyDropPivotTarget = this.createManagedBean(new BodyDropPivotTarget(this.pinned)); this.dragAndDropService.addDropTarget(this); }; BodyDropTarget.prototype.getIconName = function () { return this.currentDropListener.getIconName(); }; // we want to use the bodyPivotTarget if the user is dragging columns in from the toolPanel // and we are in pivot mode, as it has to logic to set pivot/value/group on the columns when // dropped into the grid's body. BodyDropTarget.prototype.isDropColumnInPivotMode = function (draggingEvent) { // in pivot mode, then if moving a column (ie didn't come from toolpanel) then it's // a standard column move, however if it came from the toolpanel, then we are introducing // dimensions or values to the grid return this.columnModel.isPivotMode() && draggingEvent.dragSource.type === exports.DragSourceType.ToolPanel; }; BodyDropTarget.prototype.onDragEnter = function (draggingEvent) { // we pick the drop listener depending on whether we are in pivot mode are not. if we are // in pivot mode, then dropping cols changes the row group, pivot, value stats. otherwise // we change visibility state and position. this.currentDropListener = this.isDropColumnInPivotMode(draggingEvent) ? this.bodyDropPivotTarget : this.moveColumnFeature; this.currentDropListener.onDragEnter(draggingEvent); }; BodyDropTarget.prototype.onDragLeave = function (params) { this.currentDropListener.onDragLeave(params); }; BodyDropTarget.prototype.onDragging = function (params) { this.currentDropListener.onDragging(params); }; BodyDropTarget.prototype.onDragStop = function (params) { this.currentDropListener.onDragStop(params); }; __decorate$15([ Autowired('dragAndDropService') ], BodyDropTarget.prototype, "dragAndDropService", void 0); __decorate$15([ Autowired('columnModel') ], BodyDropTarget.prototype, "columnModel", void 0); __decorate$15([ Autowired('ctrlsService') ], BodyDropTarget.prototype, "ctrlsService", void 0); __decorate$15([ PostConstruct ], BodyDropTarget.prototype, "postConstruct", null); __decorate$15([ PostConstruct ], BodyDropTarget.prototype, "init", null); return BodyDropTarget; }(BeanStub)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __read$f = (undefined && undefined.__read) || function (o, n) { var m = typeof Symbol === "function" && o[Symbol.iterator]; if (!m) return o; var i = m.call(o), r, ar = [], e; try { while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); } catch (error) { e = { error: error }; } finally { try { if (r && !r.done && (m = i["return"])) m.call(i); } finally { if (e) throw e.error; } } return ar; }; var __spread$a = (undefined && undefined.__spread) || function () { for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read$f(arguments[i])); return ar; }; var CssClassApplier = /** @class */ (function () { function CssClassApplier() { } CssClassApplier.getHeaderClassesFromColDef = function (abstractColDef, gridOptionsService, column, columnGroup) { if (missing(abstractColDef)) { return []; } return this.getColumnClassesFromCollDef(abstractColDef.headerClass, abstractColDef, gridOptionsService, column, columnGroup); }; CssClassApplier.getToolPanelClassesFromColDef = function (abstractColDef, gridOptionsService, column, columnGroup) { if (missing(abstractColDef)) { return []; } return this.getColumnClassesFromCollDef(abstractColDef.toolPanelClass, abstractColDef, gridOptionsService, column, columnGroup); }; CssClassApplier.getClassParams = function (abstractColDef, gridOptionsService, column, columnGroup) { return { // bad naming, as colDef here can be a group or a column, // however most people won't appreciate the difference, // so keeping it as colDef to avoid confusion. colDef: abstractColDef, column: column, columnGroup: columnGroup, api: gridOptionsService.api, columnApi: gridOptionsService.columnApi, context: gridOptionsService.context }; }; CssClassApplier.getColumnClassesFromCollDef = function (classesOrFunc, abstractColDef, gridOptionsService, column, columnGroup) { if (missing(classesOrFunc)) { return []; } var classToUse; if (typeof classesOrFunc === 'function') { var params = this.getClassParams(abstractColDef, gridOptionsService, column, columnGroup); classToUse = classesOrFunc(params); } else { classToUse = classesOrFunc; } if (typeof classToUse === 'string') { return [classToUse]; } if (Array.isArray(classToUse)) { return __spread$a(classToUse); } return []; }; return CssClassApplier; }()); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$1m = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __decorate$16 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var HeaderCellComp = /** @class */ (function (_super) { __extends$1m(HeaderCellComp, _super); function HeaderCellComp(ctrl) { var _this = _super.call(this, HeaderCellComp.TEMPLATE, ctrl) || this; _this.headerCompVersion = 0; _this.column = ctrl.getColumnGroupChild(); _this.pinned = ctrl.getPinned(); return _this; } HeaderCellComp.prototype.postConstruct = function () { var _this = this; var eGui = this.getGui(); var setAttribute = function (name, value, element) { var actualElement = element ? element : eGui; if (value != null && value != '') { actualElement.setAttribute(name, value); } else { actualElement.removeAttribute(name); } }; var compProxy = { setWidth: function (width) { return eGui.style.width = width; }, addOrRemoveCssClass: function (cssClassName, on) { return _this.addOrRemoveCssClass(cssClassName, on); }, setColId: function (id) { return setAttribute('col-id', id); }, setTitle: function (title) { return setAttribute('title', title); }, setAriaDescription: function (label) { return setAriaDescription(eGui, label); }, setAriaSort: function (sort) { return sort ? setAriaSort(eGui, sort) : removeAriaSort(eGui); }, setUserCompDetails: function (compDetails) { return _this.setUserCompDetails(compDetails); }, getUserCompInstance: function () { return _this.headerComp; } }; this.ctrl.setComp(compProxy, this.getGui(), this.eResize, this.eHeaderCompWrapper); var selectAllGui = this.ctrl.getSelectAllGui(); this.eResize.insertAdjacentElement('afterend', selectAllGui); }; HeaderCellComp.prototype.destroyHeaderComp = function () { if (this.headerComp) { this.eHeaderCompWrapper.removeChild(this.headerCompGui); this.headerComp = this.destroyBean(this.headerComp); this.headerCompGui = undefined; } }; HeaderCellComp.prototype.setUserCompDetails = function (compDetails) { var _this = this; this.headerCompVersion++; var versionCopy = this.headerCompVersion; compDetails.newAgStackInstance().then(function (comp) { return _this.afterCompCreated(versionCopy, comp); }); }; HeaderCellComp.prototype.afterCompCreated = function (version, headerComp) { if (version != this.headerCompVersion || !this.isAlive()) { this.destroyBean(headerComp); return; } this.destroyHeaderComp(); this.headerComp = headerComp; this.headerCompGui = headerComp.getGui(); this.eHeaderCompWrapper.appendChild(this.headerCompGui); this.ctrl.setDragSource(this.getGui()); }; HeaderCellComp.TEMPLATE = "
\n
\n
\n
"; __decorate$16([ RefSelector('eResize') ], HeaderCellComp.prototype, "eResize", void 0); __decorate$16([ RefSelector('eHeaderCompWrapper') ], HeaderCellComp.prototype, "eHeaderCompWrapper", void 0); __decorate$16([ PostConstruct ], HeaderCellComp.prototype, "postConstruct", null); __decorate$16([ PreDestroy ], HeaderCellComp.prototype, "destroyHeaderComp", null); return HeaderCellComp; }(AbstractHeaderCellComp)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$1n = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __decorate$17 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var HeaderGroupCellComp = /** @class */ (function (_super) { __extends$1n(HeaderGroupCellComp, _super); function HeaderGroupCellComp(ctrl) { return _super.call(this, HeaderGroupCellComp.TEMPLATE, ctrl) || this; } HeaderGroupCellComp.prototype.postConstruct = function () { var _this = this; var eGui = this.getGui(); var setAttribute = function (key, value) { return value != undefined ? eGui.setAttribute(key, value) : eGui.removeAttribute(key); }; var compProxy = { addOrRemoveCssClass: function (cssClassName, on) { return _this.addOrRemoveCssClass(cssClassName, on); }, setResizableDisplayed: function (displayed) { return setDisplayed(_this.eResize, displayed); }, setWidth: function (width) { return eGui.style.width = width; }, setColId: function (id) { return eGui.setAttribute("col-id", id); }, setAriaExpanded: function (expanded) { return setAttribute('aria-expanded', expanded); }, setTitle: function (title) { return setAttribute("title", title); }, setUserCompDetails: function (details) { return _this.setUserCompDetails(details); } }; this.ctrl.setComp(compProxy, eGui, this.eResize); }; HeaderGroupCellComp.prototype.setUserCompDetails = function (details) { var _this = this; details.newAgStackInstance().then(function (comp) { return _this.afterHeaderCompCreated(comp); }); }; HeaderGroupCellComp.prototype.afterHeaderCompCreated = function (headerGroupComp) { var _this = this; var destroyFunc = function () { return _this.destroyBean(headerGroupComp); }; if (!this.isAlive()) { destroyFunc(); return; } this.getGui().appendChild(headerGroupComp.getGui()); this.addDestroyFunc(destroyFunc); this.ctrl.setDragSource(headerGroupComp.getGui()); }; HeaderGroupCellComp.TEMPLATE = "
\n
\n
"; __decorate$17([ Autowired('userComponentFactory') ], HeaderGroupCellComp.prototype, "userComponentFactory", void 0); __decorate$17([ RefSelector('eResize') ], HeaderGroupCellComp.prototype, "eResize", void 0); __decorate$17([ PostConstruct ], HeaderGroupCellComp.prototype, "postConstruct", null); return HeaderGroupCellComp; }(AbstractHeaderCellComp)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$1o = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __decorate$18 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; (function (HeaderRowType) { HeaderRowType["COLUMN_GROUP"] = "group"; HeaderRowType["COLUMN"] = "column"; HeaderRowType["FLOATING_FILTER"] = "filter"; })(exports.HeaderRowType || (exports.HeaderRowType = {})); var HeaderRowComp = /** @class */ (function (_super) { __extends$1o(HeaderRowComp, _super); function HeaderRowComp(ctrl) { var _this = _super.call(this) || this; _this.headerComps = {}; var extraClass = ctrl.getType() == exports.HeaderRowType.COLUMN_GROUP ? "ag-header-row-column-group" : ctrl.getType() == exports.HeaderRowType.FLOATING_FILTER ? "ag-header-row-column-filter" : "ag-header-row-column"; _this.setTemplate(/* html */ "
"); _this.ctrl = ctrl; return _this; } //noinspection JSUnusedLocalSymbols HeaderRowComp.prototype.init = function () { var _this = this; var compProxy = { setTransform: function (transform) { return _this.getGui().style.transform = transform; }, setHeight: function (height) { return _this.getGui().style.height = height; }, setTop: function (top) { return _this.getGui().style.top = top; }, setHeaderCtrls: function (ctrls) { return _this.setHeaderCtrls(ctrls); }, setWidth: function (width) { return _this.getGui().style.width = width; }, setAriaRowIndex: function (rowIndex) { return setAriaRowIndex(_this.getGui(), rowIndex); } }; this.ctrl.setComp(compProxy); }; HeaderRowComp.prototype.destroyHeaderCtrls = function () { this.setHeaderCtrls([]); }; HeaderRowComp.prototype.setHeaderCtrls = function (ctrls) { var _this = this; if (!this.isAlive()) { return; } var oldComps = this.headerComps; this.headerComps = {}; ctrls.forEach(function (ctrl) { var id = ctrl.getInstanceId(); var comp = oldComps[id]; delete oldComps[id]; if (comp == null) { comp = _this.createHeaderComp(ctrl); _this.getGui().appendChild(comp.getGui()); } _this.headerComps[id] = comp; }); iterateObject(oldComps, function (id, comp) { _this.getGui().removeChild(comp.getGui()); _this.destroyBean(comp); }); var isEnsureDomOrder = this.gridOptionsService.is('ensureDomOrder'); var isPrintLayout = this.gridOptionsService.isDomLayout('print'); if (isEnsureDomOrder || isPrintLayout) { var comps = getAllValuesInObject(this.headerComps); // ordering the columns by left position orders them in the order they appear on the screen comps.sort(function (a, b) { var leftA = a.getCtrl().getColumnGroupChild().getLeft(); var leftB = b.getCtrl().getColumnGroupChild().getLeft(); return leftA - leftB; }); var elementsInOrder = comps.map(function (c) { return c.getGui(); }); setDomChildOrder(this.getGui(), elementsInOrder); } }; HeaderRowComp.prototype.createHeaderComp = function (headerCtrl) { var result; switch (this.ctrl.getType()) { case exports.HeaderRowType.COLUMN_GROUP: result = new HeaderGroupCellComp(headerCtrl); break; case exports.HeaderRowType.FLOATING_FILTER: result = new HeaderFilterCellComp(headerCtrl); break; default: result = new HeaderCellComp(headerCtrl); break; } this.createBean(result); result.setParentComponent(this); return result; }; __decorate$18([ PostConstruct ], HeaderRowComp.prototype, "init", null); __decorate$18([ PreDestroy ], HeaderRowComp.prototype, "destroyHeaderCtrls", null); return HeaderRowComp; }(Component)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$1p = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __decorate$19 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var instanceIdSequence$3 = 0; var AbstractHeaderCellCtrl = /** @class */ (function (_super) { __extends$1p(AbstractHeaderCellCtrl, _super); function AbstractHeaderCellCtrl(columnGroupChild, parentRowCtrl) { var _this = _super.call(this) || this; _this.lastFocusEvent = null; _this.columnGroupChild = columnGroupChild; _this.parentRowCtrl = parentRowCtrl; // unique id to this instance, including the column ID to help with debugging in React as it's used in 'key' _this.instanceId = columnGroupChild.getUniqueId() + '-' + instanceIdSequence$3++; return _this; } AbstractHeaderCellCtrl.prototype.shouldStopEventPropagation = function (e) { var _a = this.focusService.getFocusedHeader(), headerRowIndex = _a.headerRowIndex, column = _a.column; return isUserSuppressingHeaderKeyboardEvent(this.gridOptionsService, e, headerRowIndex, column); }; AbstractHeaderCellCtrl.prototype.getWrapperHasFocus = function () { var eDocument = this.gridOptionsService.getDocument(); var activeEl = eDocument.activeElement; return activeEl === this.eGui; }; AbstractHeaderCellCtrl.prototype.setGui = function (eGui) { this.eGui = eGui; this.addDomData(); }; AbstractHeaderCellCtrl.prototype.handleKeyDown = function (e) { var wrapperHasFocus = this.getWrapperHasFocus(); switch (e.key) { case KeyCode.PAGE_DOWN: case KeyCode.PAGE_UP: case KeyCode.PAGE_HOME: case KeyCode.PAGE_END: if (wrapperHasFocus) { e.preventDefault(); } } }; AbstractHeaderCellCtrl.prototype.addDomData = function () { var _this = this; var key = AbstractHeaderCellCtrl.DOM_DATA_KEY_HEADER_CTRL; this.gridOptionsService.setDomData(this.eGui, key, this); this.addDestroyFunc(function () { return _this.gridOptionsService.setDomData(_this.eGui, key, null); }); }; AbstractHeaderCellCtrl.prototype.getGui = function () { return this.eGui; }; AbstractHeaderCellCtrl.prototype.focus = function (event) { if (!this.eGui) { return false; } this.lastFocusEvent = event || null; this.eGui.focus(); return true; }; AbstractHeaderCellCtrl.prototype.getRowIndex = function () { return this.parentRowCtrl.getRowIndex(); }; AbstractHeaderCellCtrl.prototype.getParentRowCtrl = function () { return this.parentRowCtrl; }; AbstractHeaderCellCtrl.prototype.getPinned = function () { return this.parentRowCtrl.getPinned(); }; AbstractHeaderCellCtrl.prototype.getInstanceId = function () { return this.instanceId; }; AbstractHeaderCellCtrl.prototype.getColumnGroupChild = function () { return this.columnGroupChild; }; AbstractHeaderCellCtrl.DOM_DATA_KEY_HEADER_CTRL = 'headerCtrl'; __decorate$19([ Autowired('focusService') ], AbstractHeaderCellCtrl.prototype, "focusService", void 0); __decorate$19([ Autowired('beans') ], AbstractHeaderCellCtrl.prototype, "beans", void 0); __decorate$19([ Autowired('userComponentFactory') ], AbstractHeaderCellCtrl.prototype, "userComponentFactory", void 0); return AbstractHeaderCellCtrl; }(BeanStub)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$1q = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __decorate$1a = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var SetLeftFeature = /** @class */ (function (_super) { __extends$1q(SetLeftFeature, _super); function SetLeftFeature(columnOrGroup, eCell, beans, colsSpanning) { var _this = _super.call(this) || this; _this.columnOrGroup = columnOrGroup; _this.eCell = eCell; _this.ariaEl = _this.eCell.querySelector('[role=columnheader]') || _this.eCell; _this.colsSpanning = colsSpanning; _this.beans = beans; return _this; } SetLeftFeature.prototype.setColsSpanning = function (colsSpanning) { this.colsSpanning = colsSpanning; this.onLeftChanged(); }; SetLeftFeature.prototype.getColumnOrGroup = function () { if (this.beans.gridOptionsService.is('enableRtl') && this.colsSpanning) { return last(this.colsSpanning); } return this.columnOrGroup; }; SetLeftFeature.prototype.postConstruct = function () { this.addManagedListener(this.columnOrGroup, Column.EVENT_LEFT_CHANGED, this.onLeftChanged.bind(this)); this.setLeftFirstTime(); // when in print layout, the left position is also dependent on the width of the pinned sections. // so additionally update left if any column width changes. this.addManagedListener(this.eventService, Events.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED, this.onLeftChanged.bind(this)); // setting left has a dependency on print layout this.addManagedPropertyListener('domLayout', this.onLeftChanged.bind(this)); }; SetLeftFeature.prototype.setLeftFirstTime = function () { var suppressMoveAnimation = this.beans.gridOptionsService.is('suppressColumnMoveAnimation'); var oldLeftExists = exists(this.columnOrGroup.getOldLeft()); var animateColumnMove = this.beans.columnAnimationService.isActive() && oldLeftExists && !suppressMoveAnimation; if (animateColumnMove) { this.animateInLeft(); } else { this.onLeftChanged(); } }; SetLeftFeature.prototype.animateInLeft = function () { var _this = this; var colOrGroup = this.getColumnOrGroup(); var left = colOrGroup.getLeft(); var oldLeft = colOrGroup.getOldLeft(); var oldActualLeft = this.modifyLeftForPrintLayout(colOrGroup, oldLeft); var actualLeft = this.modifyLeftForPrintLayout(colOrGroup, left); this.setLeft(oldActualLeft); // we must keep track of the left we want to set to, as this would otherwise lead to a race // condition, if the user changed the left value many times in one VM turn, then we want to make // make sure the actualLeft we set in the timeout below (in the next VM turn) is the correct left // position. eg if user changes column position twice, then setLeft() below executes twice in next // VM turn, but only one (the correct one) should get applied. this.actualLeft = actualLeft; this.beans.columnAnimationService.executeNextVMTurn(function () { // test this left value is the latest one to be applied, and if not, do nothing if (_this.actualLeft === actualLeft) { _this.setLeft(actualLeft); } }); }; SetLeftFeature.prototype.onLeftChanged = function () { var colOrGroup = this.getColumnOrGroup(); var left = colOrGroup.getLeft(); this.actualLeft = this.modifyLeftForPrintLayout(colOrGroup, left); this.setLeft(this.actualLeft); }; SetLeftFeature.prototype.modifyLeftForPrintLayout = function (colOrGroup, leftPosition) { var printLayout = this.beans.gridOptionsService.isDomLayout('print'); if (!printLayout) { return leftPosition; } if (colOrGroup.getPinned() === 'left') { return leftPosition; } var leftWidth = this.beans.columnModel.getDisplayedColumnsLeftWidth(); if (colOrGroup.getPinned() === 'right') { var bodyWidth = this.beans.columnModel.getBodyContainerWidth(); return leftWidth + bodyWidth + leftPosition; } // is in body return leftWidth + leftPosition; }; SetLeftFeature.prototype.setLeft = function (value) { // if the value is null, then that means the column is no longer // displayed. there is logic in the rendering to fade these columns // out, so we don't try and change their left positions. if (exists(value)) { this.eCell.style.left = value + "px"; } var indexColumn; if (this.columnOrGroup instanceof Column) { indexColumn = this.columnOrGroup; } else { var columnGroup = this.columnOrGroup; var children = columnGroup.getLeafColumns(); if (!children.length) { return; } if (children.length > 1) { setAriaColSpan(this.ariaEl, children.length); } indexColumn = children[0]; } var index = this.beans.columnModel.getAriaColumnIndex(indexColumn); setAriaColIndex(this.ariaEl, index); }; __decorate$1a([ PostConstruct ], SetLeftFeature.prototype, "postConstruct", null); return SetLeftFeature; }(BeanStub)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$1r = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __decorate$1b = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var HoverFeature = /** @class */ (function (_super) { __extends$1r(HoverFeature, _super); function HoverFeature(columns, element) { var _this = _super.call(this) || this; _this.columns = columns; _this.element = element; return _this; } HoverFeature.prototype.postConstruct = function () { if (this.gridOptionsService.is('columnHoverHighlight')) { this.addMouseHoverListeners(); } }; HoverFeature.prototype.addMouseHoverListeners = function () { this.addManagedListener(this.element, 'mouseout', this.onMouseOut.bind(this)); this.addManagedListener(this.element, 'mouseover', this.onMouseOver.bind(this)); }; HoverFeature.prototype.onMouseOut = function () { this.columnHoverService.clearMouseOver(); }; HoverFeature.prototype.onMouseOver = function () { this.columnHoverService.setMouseOver(this.columns); }; __decorate$1b([ Autowired('columnHoverService') ], HoverFeature.prototype, "columnHoverService", void 0); __decorate$1b([ PostConstruct ], HoverFeature.prototype, "postConstruct", null); return HoverFeature; }(BeanStub)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$1s = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __decorate$1c = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var HeaderFilterCellCtrl = /** @class */ (function (_super) { __extends$1s(HeaderFilterCellCtrl, _super); function HeaderFilterCellCtrl(column, parentRowCtrl) { var _this = _super.call(this, column, parentRowCtrl) || this; _this.column = column; return _this; } HeaderFilterCellCtrl.prototype.setComp = function (comp, eGui, eButtonShowMainFilter, eFloatingFilterBody) { _super.prototype.setGui.call(this, eGui); this.comp = comp; this.eButtonShowMainFilter = eButtonShowMainFilter; this.eFloatingFilterBody = eFloatingFilterBody; var colDef = this.column.getColDef(); var filterExists = !!colDef.filter || !!colDef.filterFramework; var floatingFilterExists = !!colDef.floatingFilter; this.active = filterExists && floatingFilterExists; this.setupWidth(); this.setupLeft(); this.setupHover(); this.setupFocus(); this.setupUserComp(); this.setupSyncWithFilter(); this.setupUi(); this.addManagedListener(this.eButtonShowMainFilter, 'click', this.showParentFilter.bind(this)); if (this.active) { this.addManagedListener(this.column, Column.EVENT_FILTER_CHANGED, this.updateFilterButton.bind(this)); } }; HeaderFilterCellCtrl.prototype.setupUi = function () { this.comp.setButtonWrapperDisplayed(!this.suppressFilterButton && this.active); if (!this.active) { return; } this.comp.addOrRemoveBodyCssClass('ag-floating-filter-full-body', this.suppressFilterButton); this.comp.addOrRemoveBodyCssClass('ag-floating-filter-body', !this.suppressFilterButton); var eMenuIcon = createIconNoSpan('filter', this.gridOptionsService, this.column); if (eMenuIcon) { this.eButtonShowMainFilter.appendChild(eMenuIcon); } }; HeaderFilterCellCtrl.prototype.setupFocus = function () { this.createManagedBean(new ManagedFocusFeature(this.eGui, { shouldStopEventPropagation: this.shouldStopEventPropagation.bind(this), onTabKeyDown: this.onTabKeyDown.bind(this), handleKeyDown: this.handleKeyDown.bind(this), onFocusIn: this.onFocusIn.bind(this) })); }; HeaderFilterCellCtrl.prototype.onTabKeyDown = function (e) { var eDocument = this.gridOptionsService.getDocument(); var activeEl = eDocument.activeElement; var wrapperHasFocus = activeEl === this.eGui; if (wrapperHasFocus) { return; } var nextFocusableEl = this.focusService.findNextFocusableElement(this.eGui, null, e.shiftKey); if (nextFocusableEl) { this.beans.headerNavigationService.scrollToColumn(this.column); e.preventDefault(); nextFocusableEl.focus(); return; } var nextFocusableColumn = this.findNextColumnWithFloatingFilter(e.shiftKey); if (!nextFocusableColumn) { return; } if (this.focusService.focusHeaderPosition({ headerPosition: { headerRowIndex: this.getParentRowCtrl().getRowIndex(), column: nextFocusableColumn }, event: e })) { e.preventDefault(); } }; HeaderFilterCellCtrl.prototype.findNextColumnWithFloatingFilter = function (backwards) { var columModel = this.beans.columnModel; var nextCol = this.column; do { nextCol = backwards ? columModel.getDisplayedColBefore(nextCol) : columModel.getDisplayedColAfter(nextCol); if (!nextCol) { break; } } while (!nextCol.getColDef().filter || !nextCol.getColDef().floatingFilter); return nextCol; }; HeaderFilterCellCtrl.prototype.handleKeyDown = function (e) { _super.prototype.handleKeyDown.call(this, e); var wrapperHasFocus = this.getWrapperHasFocus(); switch (e.key) { case KeyCode.UP: case KeyCode.DOWN: if (!wrapperHasFocus) { e.preventDefault(); } case KeyCode.LEFT: case KeyCode.RIGHT: if (wrapperHasFocus) { return; } e.stopPropagation(); case KeyCode.ENTER: if (wrapperHasFocus) { if (this.focusService.focusInto(this.eGui)) { e.preventDefault(); } } break; case KeyCode.ESCAPE: if (!wrapperHasFocus) { this.eGui.focus(); } } }; HeaderFilterCellCtrl.prototype.onFocusIn = function (e) { var isRelatedWithin = this.eGui.contains(e.relatedTarget); // when the focus is already within the component, // we default to the browser's behavior if (isRelatedWithin) { return; } var notFromHeaderWrapper = !!e.relatedTarget && !e.relatedTarget.classList.contains('ag-floating-filter'); var fromWithinHeader = !!e.relatedTarget && isElementChildOfClass(e.relatedTarget, 'ag-floating-filter'); if (notFromHeaderWrapper && fromWithinHeader && e.target === this.eGui) { var lastFocusEvent = this.lastFocusEvent; var fromTab = !!(lastFocusEvent && lastFocusEvent.key === KeyCode.TAB); if (lastFocusEvent && fromTab) { var shouldFocusLast = lastFocusEvent.shiftKey; this.focusService.focusInto(this.eGui, shouldFocusLast); } } var rowIndex = this.getRowIndex(); this.beans.focusService.setFocusedHeader(rowIndex, this.column); }; HeaderFilterCellCtrl.prototype.setupHover = function () { var _this = this; this.createManagedBean(new HoverFeature([this.column], this.eGui)); var listener = function () { if (!_this.gridOptionsService.is('columnHoverHighlight')) { return; } var hovered = _this.columnHoverService.isHovered(_this.column); _this.comp.addOrRemoveCssClass('ag-column-hover', hovered); }; this.addManagedListener(this.eventService, Events.EVENT_COLUMN_HOVER_CHANGED, listener); listener(); }; HeaderFilterCellCtrl.prototype.setupLeft = function () { var setLeftFeature = new SetLeftFeature(this.column, this.eGui, this.beans); this.createManagedBean(setLeftFeature); }; HeaderFilterCellCtrl.prototype.setupUserComp = function () { var _this = this; if (!this.active) { return; } var colDef = this.column.getColDef(); // this is unusual - we need a params value OUTSIDE the component the params are for. // the params are for the floating filter component, but this property is actually for the wrapper. this.suppressFilterButton = colDef.floatingFilterComponentParams ? !!colDef.floatingFilterComponentParams.suppressFilterButton : false; var compDetails = this.filterManager.getFloatingFilterCompDetails(this.column, function () { return _this.showParentFilter(); }); if (compDetails) { this.comp.setCompDetails(compDetails); } }; HeaderFilterCellCtrl.prototype.showParentFilter = function () { var eventSource = this.suppressFilterButton ? this.eFloatingFilterBody : this.eButtonShowMainFilter; this.menuFactory.showMenuAfterButtonClick(this.column, eventSource, 'floatingFilter', 'filterMenuTab', ['filterMenuTab']); }; HeaderFilterCellCtrl.prototype.setupSyncWithFilter = function () { var _this = this; if (!this.active) { return; } var syncWithFilter = function (filterChangedEvent) { var compPromise = _this.comp.getFloatingFilterComp(); if (!compPromise) { return; } var parentModel = _this.filterManager.getCurrentFloatingFilterParentModel(_this.column); compPromise.then(function (comp) { if (comp) { comp.onParentModelChanged(parentModel, filterChangedEvent); } }); }; this.addManagedListener(this.column, Column.EVENT_FILTER_CHANGED, syncWithFilter); if (this.filterManager.isFilterActive(this.column)) { syncWithFilter(null); } }; HeaderFilterCellCtrl.prototype.setupWidth = function () { var _this = this; var listener = function () { var width = _this.column.getActualWidth() + "px"; _this.comp.setWidth(width); }; this.addManagedListener(this.column, Column.EVENT_WIDTH_CHANGED, listener); listener(); }; HeaderFilterCellCtrl.prototype.updateFilterButton = function () { if (!this.suppressFilterButton && this.comp) { this.comp.setButtonWrapperDisplayed(this.filterManager.isFilterAllowed(this.column)); } }; __decorate$1c([ Autowired('filterManager') ], HeaderFilterCellCtrl.prototype, "filterManager", void 0); __decorate$1c([ Autowired('columnHoverService') ], HeaderFilterCellCtrl.prototype, "columnHoverService", void 0); __decorate$1c([ Autowired('menuFactory') ], HeaderFilterCellCtrl.prototype, "menuFactory", void 0); return HeaderFilterCellCtrl; }(AbstractHeaderCellCtrl)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$1t = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __decorate$1d = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var ResizeFeature = /** @class */ (function (_super) { __extends$1t(ResizeFeature, _super); function ResizeFeature(pinned, column, eResize, comp, ctrl) { var _this = _super.call(this) || this; _this.pinned = pinned; _this.column = column; _this.eResize = eResize; _this.comp = comp; _this.ctrl = ctrl; return _this; } ResizeFeature.prototype.postConstruct = function () { var _this = this; var colDef = this.column.getColDef(); var destroyResizeFuncs = []; var canResize; var canAutosize; var addResize = function () { setDisplayed(_this.eResize, canResize); if (!canResize) { return; } var finishedWithResizeFunc = _this.horizontalResizeService.addResizeBar({ eResizeBar: _this.eResize, onResizeStart: _this.onResizeStart.bind(_this), onResizing: _this.onResizing.bind(_this, false), onResizeEnd: _this.onResizing.bind(_this, true) }); destroyResizeFuncs.push(finishedWithResizeFunc); if (canAutosize) { var skipHeaderOnAutoSize_1 = _this.gridOptionsService.is('skipHeaderOnAutoSize'); var autoSizeColListener_1 = function () { _this.columnModel.autoSizeColumn(_this.column, skipHeaderOnAutoSize_1, "uiColumnResized"); }; _this.eResize.addEventListener('dblclick', autoSizeColListener_1); var touchListener_1 = new TouchListener(_this.eResize); touchListener_1.addEventListener(TouchListener.EVENT_DOUBLE_TAP, autoSizeColListener_1); _this.addDestroyFunc(function () { _this.eResize.removeEventListener('dblclick', autoSizeColListener_1); touchListener_1.removeEventListener(TouchListener.EVENT_DOUBLE_TAP, autoSizeColListener_1); touchListener_1.destroy(); }); } }; var removeResize = function () { destroyResizeFuncs.forEach(function (f) { return f(); }); destroyResizeFuncs.length = 0; }; var refresh = function () { var resize = _this.column.isResizable(); var autoSize = !_this.gridOptionsService.is('suppressAutoSize') && !colDef.suppressAutoSize; var propertyChange = resize !== canResize || autoSize !== canAutosize; if (propertyChange) { canResize = resize; canAutosize = autoSize; removeResize(); addResize(); } }; refresh(); this.addDestroyFunc(removeResize); this.ctrl.addRefreshFunction(refresh); }; ResizeFeature.prototype.onResizing = function (finished, resizeAmount) { var resizeAmountNormalised = this.normaliseResizeAmount(resizeAmount); var columnWidths = [{ key: this.column, newWidth: this.resizeStartWidth + resizeAmountNormalised }]; this.columnModel.setColumnWidths(columnWidths, this.resizeWithShiftKey, finished, "uiColumnDragged"); if (finished) { this.comp.addOrRemoveCssClass('ag-column-resizing', false); } }; ResizeFeature.prototype.onResizeStart = function (shiftKey) { this.resizeStartWidth = this.column.getActualWidth(); this.resizeWithShiftKey = shiftKey; this.comp.addOrRemoveCssClass('ag-column-resizing', true); }; // optionally inverts the drag, depending on pinned and RTL // note - this method is duplicated in RenderedHeaderGroupCell - should refactor out? ResizeFeature.prototype.normaliseResizeAmount = function (dragChange) { var result = dragChange; var notPinningLeft = this.pinned !== 'left'; var pinningRight = this.pinned === 'right'; if (this.gridOptionsService.is('enableRtl')) { // for RTL, dragging left makes the col bigger, except when pinning left if (notPinningLeft) { result *= -1; } } else { // for LTR (ie normal), dragging left makes the col smaller, except when pinning right if (pinningRight) { result *= -1; } } return result; }; __decorate$1d([ Autowired('horizontalResizeService') ], ResizeFeature.prototype, "horizontalResizeService", void 0); __decorate$1d([ Autowired('columnModel') ], ResizeFeature.prototype, "columnModel", void 0); __decorate$1d([ PostConstruct ], ResizeFeature.prototype, "postConstruct", null); return ResizeFeature; }(BeanStub)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$1u = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __decorate$1e = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var SelectAllFeature = /** @class */ (function (_super) { __extends$1u(SelectAllFeature, _super); function SelectAllFeature(column) { var _this = _super.call(this) || this; _this.cbSelectAllVisible = false; _this.processingEventFromCheckbox = false; _this.column = column; var colDef = column.getColDef(); _this.filteredOnly = !!(colDef === null || colDef === void 0 ? void 0 : colDef.headerCheckboxSelectionFilteredOnly); _this.currentPageOnly = !!(colDef === null || colDef === void 0 ? void 0 : colDef.headerCheckboxSelectionCurrentPageOnly); return _this; } SelectAllFeature.prototype.onSpaceKeyPressed = function (e) { var checkbox = this.cbSelectAll; var eDocument = this.gridOptionsService.getDocument(); if (checkbox.isDisplayed() && !checkbox.getGui().contains(eDocument.activeElement)) { e.preventDefault(); checkbox.setValue(!checkbox.getValue()); } }; SelectAllFeature.prototype.getCheckboxGui = function () { return this.cbSelectAll.getGui(); }; SelectAllFeature.prototype.setComp = function (ctrl) { this.headerCellCtrl = ctrl; this.cbSelectAll = this.createManagedBean(new AgCheckbox()); this.cbSelectAll.addCssClass('ag-header-select-all'); setAriaRole(this.cbSelectAll.getGui(), 'presentation'); this.showOrHideSelectAll(); this.addManagedListener(this.eventService, Events.EVENT_NEW_COLUMNS_LOADED, this.showOrHideSelectAll.bind(this)); this.addManagedListener(this.eventService, Events.EVENT_DISPLAYED_COLUMNS_CHANGED, this.showOrHideSelectAll.bind(this)); this.addManagedListener(this.eventService, Events.EVENT_SELECTION_CHANGED, this.onSelectionChanged.bind(this)); this.addManagedListener(this.eventService, Events.EVENT_PAGINATION_CHANGED, this.onSelectionChanged.bind(this)); this.addManagedListener(this.eventService, Events.EVENT_MODEL_UPDATED, this.onModelChanged.bind(this)); this.addManagedListener(this.cbSelectAll, AgCheckbox.EVENT_CHANGED, this.onCbSelectAll.bind(this)); setAriaHidden(this.cbSelectAll.getGui(), true); this.cbSelectAll.getInputElement().setAttribute('tabindex', '-1'); this.refreshSelectAllLabel(); }; SelectAllFeature.prototype.showOrHideSelectAll = function () { this.cbSelectAllVisible = this.isCheckboxSelection(); this.cbSelectAll.setDisplayed(this.cbSelectAllVisible, { skipAriaHidden: true }); if (this.cbSelectAllVisible) { // in case user is trying this feature with the wrong model type this.checkRightRowModelType('selectAllCheckbox'); // make sure checkbox is showing the right state this.updateStateOfCheckbox(); } this.refreshSelectAllLabel(); }; SelectAllFeature.prototype.onModelChanged = function () { if (!this.cbSelectAllVisible) { return; } this.updateStateOfCheckbox(); }; SelectAllFeature.prototype.onSelectionChanged = function () { if (!this.cbSelectAllVisible) { return; } this.updateStateOfCheckbox(); }; SelectAllFeature.prototype.updateStateOfCheckbox = function () { if (this.processingEventFromCheckbox) { return; } this.processingEventFromCheckbox = true; var allSelected = this.selectionService.getSelectAllState(); this.cbSelectAll.setValue(allSelected); this.refreshSelectAllLabel(); this.processingEventFromCheckbox = false; }; SelectAllFeature.prototype.refreshSelectAllLabel = function () { if (!this.cbSelectAllVisible) { this.headerCellCtrl.setAriaDescriptionProperty('selectAll', null); this.cbSelectAll.setInputAriaLabel(null); } else { var translate = this.localeService.getLocaleTextFunc(); var checked = this.cbSelectAll.getValue(); var ariaStatus = checked ? translate('ariaChecked', 'checked') : translate('ariaUnchecked', 'unchecked'); var ariaLabel = translate('ariaRowSelectAll', 'Press Space to toggle all rows selection'); this.headerCellCtrl.setAriaDescriptionProperty('selectAll', ariaLabel + " (" + ariaStatus + ")"); this.cbSelectAll.setInputAriaLabel(ariaLabel + " (" + ariaStatus + ")"); } this.headerCellCtrl.refreshAriaDescription(); }; SelectAllFeature.prototype.checkRightRowModelType = function (feature) { var rowModelType = this.rowModel.getType(); var rowModelMatches = rowModelType === 'clientSide' || rowModelType === 'serverSide'; if (!rowModelMatches) { console.warn("AG Grid: " + feature + " is only available if using 'clientSide' or 'serverSide' rowModelType, you are using " + rowModelType + "."); return false; } return true; }; SelectAllFeature.prototype.onCbSelectAll = function () { if (this.processingEventFromCheckbox) { return; } if (!this.cbSelectAllVisible) { return; } var value = this.cbSelectAll.getValue(); var source = 'uiSelectAll'; if (this.currentPageOnly) source = 'uiSelectAllCurrentPage'; else if (this.filteredOnly) source = 'uiSelectAllFiltered'; var params = { source: source, justFiltered: this.filteredOnly, justCurrentPage: this.currentPageOnly, }; if (value) { this.selectionService.selectAllRowNodes(params); } else { this.selectionService.deselectAllRowNodes(params); } }; SelectAllFeature.prototype.isCheckboxSelection = function () { var result = this.column.getColDef().headerCheckboxSelection; if (typeof result === 'function') { var func = result; var params = { column: this.column, colDef: this.column.getColDef(), columnApi: this.columnApi, api: this.gridApi, context: this.gridOptionsService.context }; result = func(params); } if (result) { return this.checkRightRowModelType('headerCheckboxSelection'); } return false; }; __decorate$1e([ Autowired('gridApi') ], SelectAllFeature.prototype, "gridApi", void 0); __decorate$1e([ Autowired('columnApi') ], SelectAllFeature.prototype, "columnApi", void 0); __decorate$1e([ Autowired('rowModel') ], SelectAllFeature.prototype, "rowModel", void 0); __decorate$1e([ Autowired('selectionService') ], SelectAllFeature.prototype, "selectionService", void 0); return SelectAllFeature; }(BeanStub)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$1v = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __decorate$1f = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var HeaderCellCtrl = /** @class */ (function (_super) { __extends$1v(HeaderCellCtrl, _super); function HeaderCellCtrl(column, parentRowCtrl) { var _this = _super.call(this, column, parentRowCtrl) || this; _this.refreshFunctions = []; _this.userHeaderClasses = new Set(); _this.ariaDescriptionProperties = new Map(); _this.column = column; return _this; } HeaderCellCtrl.prototype.setComp = function (comp, eGui, eResize, eHeaderCompWrapper) { var _this = this; _super.prototype.setGui.call(this, eGui); this.comp = comp; this.updateState(); this.setupWidth(); this.setupMovingCss(); this.setupMenuClass(); this.setupSortableClass(); this.setupWrapTextClass(); this.refreshSpanHeaderHeight(); this.setupAutoHeight(eHeaderCompWrapper); this.addColumnHoverListener(); this.setupFilterCss(); this.setupColId(); this.setupClassesFromColDef(); this.setupTooltip(); this.addActiveHeaderMouseListeners(); this.setupSelectAll(); this.setupUserComp(); this.refreshAria(); this.createManagedBean(new ResizeFeature(this.getPinned(), this.column, eResize, comp, this)); this.createManagedBean(new HoverFeature([this.column], eGui)); this.createManagedBean(new SetLeftFeature(this.column, eGui, this.beans)); this.createManagedBean(new ManagedFocusFeature(eGui, { shouldStopEventPropagation: function (e) { return _this.shouldStopEventPropagation(e); }, onTabKeyDown: function () { return null; }, handleKeyDown: this.handleKeyDown.bind(this), onFocusIn: this.onFocusIn.bind(this), onFocusOut: this.onFocusOut.bind(this) })); this.addManagedListener(this.column, Column.EVENT_COL_DEF_CHANGED, this.onColDefChanged.bind(this)); this.addManagedListener(this.eventService, Events.EVENT_COLUMN_VALUE_CHANGED, this.onColumnValueChanged.bind(this)); this.addManagedListener(this.eventService, Events.EVENT_COLUMN_ROW_GROUP_CHANGED, this.onColumnRowGroupChanged.bind(this)); this.addManagedListener(this.eventService, Events.EVENT_COLUMN_PIVOT_CHANGED, this.onColumnPivotChanged.bind(this)); this.addManagedListener(this.eventService, Events.EVENT_HEADER_HEIGHT_CHANGED, this.onHeaderHeightChanged.bind(this)); }; HeaderCellCtrl.prototype.setupUserComp = function () { var compDetails = this.lookupUserCompDetails(); this.setCompDetails(compDetails); }; HeaderCellCtrl.prototype.setCompDetails = function (compDetails) { this.userCompDetails = compDetails; this.comp.setUserCompDetails(compDetails); }; HeaderCellCtrl.prototype.lookupUserCompDetails = function () { var params = this.createParams(); var colDef = this.column.getColDef(); return this.userComponentFactory.getHeaderCompDetails(colDef, params); }; HeaderCellCtrl.prototype.createParams = function () { var _this = this; var colDef = this.column.getColDef(); var params = { column: this.column, displayName: this.displayName, enableSorting: colDef.sortable, enableMenu: this.menuEnabled, showColumnMenu: function (source) { _this.gridApi.showColumnMenuAfterButtonClick(_this.column, source); }, progressSort: function (multiSort) { _this.sortController.progressSort(_this.column, !!multiSort, "uiColumnSorted"); }, setSort: function (sort, multiSort) { _this.sortController.setSortForColumn(_this.column, sort, !!multiSort, "uiColumnSorted"); }, api: this.gridApi, columnApi: this.columnApi, context: this.gridOptionsService.context, eGridHeader: this.getGui() }; return params; }; HeaderCellCtrl.prototype.setupSelectAll = function () { this.selectAllFeature = this.createManagedBean(new SelectAllFeature(this.column)); this.selectAllFeature.setComp(this); }; HeaderCellCtrl.prototype.getSelectAllGui = function () { return this.selectAllFeature.getCheckboxGui(); }; HeaderCellCtrl.prototype.handleKeyDown = function (e) { _super.prototype.handleKeyDown.call(this, e); if (e.key === KeyCode.SPACE) { this.selectAllFeature.onSpaceKeyPressed(e); } if (e.key === KeyCode.ENTER) { this.onEnterKeyPressed(e); } }; HeaderCellCtrl.prototype.onEnterKeyPressed = function (e) { /// THIS IS BAD - we are assuming the header is not a user provided comp var headerComp = this.comp.getUserCompInstance(); if (!headerComp) { return; } if (e.ctrlKey || e.metaKey) { if (this.menuEnabled && headerComp.showMenu) { e.preventDefault(); headerComp.showMenu(); } } else if (this.sortable) { var multiSort = e.shiftKey; this.sortController.progressSort(this.column, multiSort, "uiColumnSorted"); } }; HeaderCellCtrl.prototype.isMenuEnabled = function () { return this.menuEnabled; }; HeaderCellCtrl.prototype.onFocusIn = function (e) { if (!this.getGui().contains(e.relatedTarget)) { var rowIndex = this.getRowIndex(); this.focusService.setFocusedHeader(rowIndex, this.column); } this.setActiveHeader(true); }; HeaderCellCtrl.prototype.onFocusOut = function (e) { if (this.getGui().contains(e.relatedTarget)) { return; } this.setActiveHeader(false); }; HeaderCellCtrl.prototype.setupTooltip = function () { var _this = this; var tooltipCtrl = { getColumn: function () { return _this.column; }, getColDef: function () { return _this.column.getColDef(); }, getGui: function () { return _this.eGui; }, getLocation: function () { return 'header'; }, getTooltipValue: function () { var res = _this.column.getColDef().headerTooltip; return res; }, }; var tooltipFeature = this.createManagedBean(new TooltipFeature(tooltipCtrl, this.beans)); tooltipFeature.setComp(this.comp); this.refreshFunctions.push(function () { return tooltipFeature.refreshToolTip(); }); }; HeaderCellCtrl.prototype.setupClassesFromColDef = function () { var _this = this; var refreshHeaderClasses = function () { var colDef = _this.column.getColDef(); var classes = CssClassApplier.getHeaderClassesFromColDef(colDef, _this.gridOptionsService, _this.column, null); var oldClasses = _this.userHeaderClasses; _this.userHeaderClasses = new Set(classes); classes.forEach(function (c) { if (oldClasses.has(c)) { // class already added, no need to apply it, but remove from old set oldClasses.delete(c); } else { // class new since last time, so apply it _this.comp.addOrRemoveCssClass(c, true); } }); // now old set only has classes that were applied last time, but not this time, so remove them oldClasses.forEach(function (c) { return _this.comp.addOrRemoveCssClass(c, false); }); }; this.refreshFunctions.push(refreshHeaderClasses); refreshHeaderClasses(); }; HeaderCellCtrl.prototype.setDragSource = function (eSource) { var _this = this; this.dragSourceElement = eSource; this.removeDragSource(); if (!eSource) { return; } if (!this.draggable) { return; } var hideColumnOnExit = !this.gridOptionsService.is('suppressDragLeaveHidesColumns'); this.moveDragSource = { type: exports.DragSourceType.HeaderCell, eElement: eSource, defaultIconName: hideColumnOnExit ? DragAndDropService.ICON_HIDE : DragAndDropService.ICON_NOT_ALLOWED, getDragItem: function () { return _this.createDragItem(); }, dragItemName: this.displayName, onDragStarted: function () { return _this.column.setMoving(true, "uiColumnMoved"); }, onDragStopped: function () { return _this.column.setMoving(false, "uiColumnMoved"); }, onGridEnter: function (dragItem) { var _a; if (hideColumnOnExit) { var unlockedColumns = ((_a = dragItem === null || dragItem === void 0 ? void 0 : dragItem.columns) === null || _a === void 0 ? void 0 : _a.filter(function (col) { return !col.getColDef().lockVisible; })) || []; _this.columnModel.setColumnsVisible(unlockedColumns, true, "uiColumnMoved"); } }, onGridExit: function (dragItem) { var _a; if (hideColumnOnExit) { var unlockedColumns = ((_a = dragItem === null || dragItem === void 0 ? void 0 : dragItem.columns) === null || _a === void 0 ? void 0 : _a.filter(function (col) { return !col.getColDef().lockVisible; })) || []; _this.columnModel.setColumnsVisible(unlockedColumns, false, "uiColumnMoved"); } }, }; this.dragAndDropService.addDragSource(this.moveDragSource, true); }; HeaderCellCtrl.prototype.createDragItem = function () { var visibleState = {}; visibleState[this.column.getId()] = this.column.isVisible(); return { columns: [this.column], visibleState: visibleState }; }; HeaderCellCtrl.prototype.removeDragSource = function () { if (this.moveDragSource) { this.dragAndDropService.removeDragSource(this.moveDragSource); this.moveDragSource = undefined; } }; HeaderCellCtrl.prototype.onColDefChanged = function () { this.refresh(); }; HeaderCellCtrl.prototype.updateState = function () { var colDef = this.column.getColDef(); this.menuEnabled = this.menuFactory.isMenuEnabled(this.column) && !colDef.suppressMenu; this.sortable = colDef.sortable; this.displayName = this.calculateDisplayName(); this.draggable = this.workOutDraggable(); }; HeaderCellCtrl.prototype.addRefreshFunction = function (func) { this.refreshFunctions.push(func); }; HeaderCellCtrl.prototype.refresh = function () { this.updateState(); this.refreshHeaderComp(); this.refreshAria(); this.refreshFunctions.forEach(function (f) { return f(); }); }; HeaderCellCtrl.prototype.refreshHeaderComp = function () { var newCompDetails = this.lookupUserCompDetails(); var compInstance = this.comp.getUserCompInstance(); // only try refresh if old comp exists adn it is the correct type var attemptRefresh = compInstance != null && this.userCompDetails.componentClass == newCompDetails.componentClass; var headerCompRefreshed = attemptRefresh ? this.attemptHeaderCompRefresh(newCompDetails.params) : false; if (headerCompRefreshed) { // we do this as a refresh happens after colDefs change, and it's possible the column has had it's // draggable property toggled. no need to call this if not refreshing, as setDragSource is done // as part of appendHeaderComp this.setDragSource(this.dragSourceElement); } else { this.setCompDetails(newCompDetails); } }; HeaderCellCtrl.prototype.attemptHeaderCompRefresh = function (params) { var headerComp = this.comp.getUserCompInstance(); if (!headerComp) { return false; } // if no refresh method, then we want to replace the headerComp if (!headerComp.refresh) { return false; } var res = headerComp.refresh(params); return res; }; HeaderCellCtrl.prototype.calculateDisplayName = function () { return this.columnModel.getDisplayNameForColumn(this.column, 'header', true); }; HeaderCellCtrl.prototype.checkDisplayName = function () { // display name can change if aggFunc different, eg sum(Gold) is now max(Gold) if (this.displayName !== this.calculateDisplayName()) { this.refresh(); } }; HeaderCellCtrl.prototype.workOutDraggable = function () { var colDef = this.column.getColDef(); var isSuppressMovableColumns = this.gridOptionsService.is('suppressMovableColumns'); var colCanMove = !isSuppressMovableColumns && !colDef.suppressMovable && !colDef.lockPosition; // we should still be allowed drag the column, even if it can't be moved, if the column // can be dragged to a rowGroup or pivot drop zone return !!colCanMove || !!colDef.enableRowGroup || !!colDef.enablePivot; }; HeaderCellCtrl.prototype.onColumnRowGroupChanged = function () { this.checkDisplayName(); }; HeaderCellCtrl.prototype.onColumnPivotChanged = function () { this.checkDisplayName(); }; HeaderCellCtrl.prototype.onColumnValueChanged = function () { this.checkDisplayName(); }; HeaderCellCtrl.prototype.setupWidth = function () { var _this = this; var listener = function () { var columnWidth = _this.column.getActualWidth(); _this.comp.setWidth(columnWidth + "px"); }; this.addManagedListener(this.column, Column.EVENT_WIDTH_CHANGED, listener); listener(); }; HeaderCellCtrl.prototype.setupMovingCss = function () { var _this = this; var listener = function () { // this is what makes the header go dark when it is been moved (gives impression to // user that the column was picked up). _this.comp.addOrRemoveCssClass('ag-header-cell-moving', _this.column.isMoving()); }; this.addManagedListener(this.column, Column.EVENT_MOVING_CHANGED, listener); listener(); }; HeaderCellCtrl.prototype.setupMenuClass = function () { var _this = this; var listener = function () { _this.comp.addOrRemoveCssClass('ag-column-menu-visible', _this.column.isMenuVisible()); }; this.addManagedListener(this.column, Column.EVENT_MENU_VISIBLE_CHANGED, listener); listener(); }; HeaderCellCtrl.prototype.setupSortableClass = function () { var _this = this; var updateSortableCssClass = function () { _this.comp.addOrRemoveCssClass('ag-header-cell-sortable', !!_this.sortable); }; updateSortableCssClass(); this.addRefreshFunction(updateSortableCssClass); this.addManagedListener(this.eventService, Column.EVENT_SORT_CHANGED, this.refreshAriaSort.bind(this)); }; HeaderCellCtrl.prototype.setupWrapTextClass = function () { var _this = this; var listener = function () { var wrapText = !!_this.column.getColDef().wrapHeaderText; _this.comp.addOrRemoveCssClass('ag-header-cell-wrap-text', wrapText); }; listener(); this.addRefreshFunction(listener); }; HeaderCellCtrl.prototype.onHeaderHeightChanged = function () { this.refreshSpanHeaderHeight(); }; HeaderCellCtrl.prototype.refreshSpanHeaderHeight = function () { var _a = this, eGui = _a.eGui, column = _a.column, comp = _a.comp, columnModel = _a.columnModel, gridOptionsService = _a.gridOptionsService; if (!column.isSpanHeaderHeight()) { return; } var _b = this.getColumnGroupPaddingInfo(), numberOfParents = _b.numberOfParents, isSpanningTotal = _b.isSpanningTotal; comp.addOrRemoveCssClass('ag-header-span-height', numberOfParents > 0); if (numberOfParents === 0) { return; } comp.addOrRemoveCssClass('ag-header-span-total', isSpanningTotal); var pivotMode = gridOptionsService.is('pivotMode'); var groupHeaderHeight = pivotMode ? columnModel.getPivotGroupHeaderHeight() : columnModel.getGroupHeaderHeight(); var headerHeight = columnModel.getColumnHeaderRowHeight(); var extraHeight = numberOfParents * groupHeaderHeight; eGui.style.setProperty('top', -extraHeight + "px"); eGui.style.setProperty('height', headerHeight + extraHeight + "px"); }; HeaderCellCtrl.prototype.getColumnGroupPaddingInfo = function () { var parent = this.column.getParent(); if (!parent || !parent.isPadding()) { return { numberOfParents: 0, isSpanningTotal: false }; } var numberOfParents = parent.getPaddingLevel() + 1; var isSpanningTotal = true; while (parent) { if (!parent.isPadding()) { isSpanningTotal = false; break; } parent = parent.getParent(); } return { numberOfParents: numberOfParents, isSpanningTotal: isSpanningTotal }; }; HeaderCellCtrl.prototype.setupAutoHeight = function (wrapperElement) { var _this = this; var measureHeight = function (timesCalled) { if (!_this.isAlive()) { return; } var _a = getElementSize(_this.getGui()), paddingTop = _a.paddingTop, paddingBottom = _a.paddingBottom, borderBottomWidth = _a.borderBottomWidth, borderTopWidth = _a.borderTopWidth; var extraHeight = paddingTop + paddingBottom + borderBottomWidth + borderTopWidth; var wrapperHeight = wrapperElement.offsetHeight; var autoHeight = wrapperHeight + extraHeight; if (timesCalled < 5) { // if not in doc yet, means framework not yet inserted, so wait for next VM turn, // maybe it will be ready next VM turn var doc = _this.beans.gridOptionsService.getDocument(); var notYetInDom = !doc || !doc.contains(wrapperElement); // this happens in React, where React hasn't put any content in. we say 'possibly' // as a) may not be React and b) the cell could be empty anyway var possiblyNoContentYet = autoHeight == 0; if (notYetInDom || possiblyNoContentYet) { _this.beans.frameworkOverrides.setTimeout(function () { return measureHeight(timesCalled + 1); }, 0); return; } } _this.columnModel.setColumnHeaderHeight(_this.column, autoHeight); }; var isMeasuring = false; var stopResizeObserver; var checkMeasuring = function () { var isSpanHeaderHeight = _this.column.isSpanHeaderHeight(); var newValue = _this.column.isAutoHeaderHeight(); if (isSpanHeaderHeight) { stopMeasuring(); if (newValue) { var message_1 = "AG Grid: The properties `spanHeaderHeight` and `autoHeaderHeight` cannot be used together in the same column."; doOnce(function () { return console.warn(message_1); }, 'HeaderCellCtrl.spanHeaderHeightAndAutoHeaderHeight'); } return; } if (newValue && !isMeasuring) { startMeasuring(); } if (!newValue && isMeasuring) { stopMeasuring(); } }; var startMeasuring = function () { isMeasuring = true; measureHeight(0); _this.comp.addOrRemoveCssClass('ag-header-cell-auto-height', true); stopResizeObserver = _this.resizeObserverService.observeResize(wrapperElement, function () { return measureHeight(0); }); }; var stopMeasuring = function () { isMeasuring = false; if (stopResizeObserver) { stopResizeObserver(); } _this.comp.addOrRemoveCssClass('ag-header-cell-auto-height', false); stopResizeObserver = undefined; }; checkMeasuring(); this.addDestroyFunc(function () { return stopMeasuring(); }); // In theory we could rely on the resize observer for everything - but since it's debounced // it can be a little janky for smooth movement. in this case its better to react to our own events // And unfortunately we cant _just_ rely on our own events, since custom components can change whenever this.addManagedListener(this.column, Column.EVENT_WIDTH_CHANGED, function () { return isMeasuring && measureHeight(0); }); // Displaying the sort icon changes the available area for text, so sort changes can affect height this.addManagedListener(this.eventService, Column.EVENT_SORT_CHANGED, function () { // Rendering changes for sort, happen after the event... not ideal if (isMeasuring) { _this.beans.frameworkOverrides.setTimeout(function () { return measureHeight(0); }); } }); this.addRefreshFunction(checkMeasuring); }; HeaderCellCtrl.prototype.refreshAriaSort = function () { if (this.sortable) { var translate = this.localeService.getLocaleTextFunc(); var sort = this.sortController.getDisplaySortForColumn(this.column) || null; this.comp.setAriaSort(getAriaSortState(sort)); this.setAriaDescriptionProperty('sort', translate('ariaSortableColumn', 'Press ENTER to sort.')); } else { this.comp.setAriaSort(); this.setAriaDescriptionProperty('sort', null); } }; HeaderCellCtrl.prototype.refreshAriaMenu = function () { if (this.menuEnabled) { var translate = this.localeService.getLocaleTextFunc(); this.setAriaDescriptionProperty('menu', translate('ariaMenuColumn', 'Press CTRL ENTER to open column menu.')); } else { this.setAriaDescriptionProperty('menu', null); } }; HeaderCellCtrl.prototype.setAriaDescriptionProperty = function (property, value) { if (value != null) { this.ariaDescriptionProperties.set(property, value); } else { this.ariaDescriptionProperties.delete(property); } }; HeaderCellCtrl.prototype.refreshAriaDescription = function () { var descriptionArray = Array.from(this.ariaDescriptionProperties.values()); this.comp.setAriaDescription(descriptionArray.length ? descriptionArray.join(' ') : undefined); }; HeaderCellCtrl.prototype.refreshAria = function () { this.refreshAriaSort(); this.refreshAriaMenu(); this.refreshAriaDescription(); }; HeaderCellCtrl.prototype.addColumnHoverListener = function () { var _this = this; var listener = function () { if (!_this.gridOptionsService.is('columnHoverHighlight')) { return; } var isHovered = _this.columnHoverService.isHovered(_this.column); _this.comp.addOrRemoveCssClass('ag-column-hover', isHovered); }; this.addManagedListener(this.eventService, Events.EVENT_COLUMN_HOVER_CHANGED, listener); listener(); }; HeaderCellCtrl.prototype.setupFilterCss = function () { var _this = this; var listener = function () { _this.comp.addOrRemoveCssClass('ag-header-cell-filtered', _this.column.isFilterActive()); }; this.addManagedListener(this.column, Column.EVENT_FILTER_ACTIVE_CHANGED, listener); listener(); }; HeaderCellCtrl.prototype.setupColId = function () { this.comp.setColId(this.column.getColId()); }; HeaderCellCtrl.prototype.addActiveHeaderMouseListeners = function () { var _this = this; var listener = function (e) { return _this.setActiveHeader(e.type === 'mouseenter'); }; this.addManagedListener(this.getGui(), 'mouseenter', listener); this.addManagedListener(this.getGui(), 'mouseleave', listener); }; HeaderCellCtrl.prototype.setActiveHeader = function (active) { this.comp.addOrRemoveCssClass('ag-header-active', active); }; __decorate$1f([ Autowired('columnModel') ], HeaderCellCtrl.prototype, "columnModel", void 0); __decorate$1f([ Autowired('columnHoverService') ], HeaderCellCtrl.prototype, "columnHoverService", void 0); __decorate$1f([ Autowired('sortController') ], HeaderCellCtrl.prototype, "sortController", void 0); __decorate$1f([ Autowired('menuFactory') ], HeaderCellCtrl.prototype, "menuFactory", void 0); __decorate$1f([ Autowired('dragAndDropService') ], HeaderCellCtrl.prototype, "dragAndDropService", void 0); __decorate$1f([ Autowired('resizeObserverService') ], HeaderCellCtrl.prototype, "resizeObserverService", void 0); __decorate$1f([ Autowired('gridApi') ], HeaderCellCtrl.prototype, "gridApi", void 0); __decorate$1f([ Autowired('columnApi') ], HeaderCellCtrl.prototype, "columnApi", void 0); __decorate$1f([ PreDestroy ], HeaderCellCtrl.prototype, "removeDragSource", null); return HeaderCellCtrl; }(AbstractHeaderCellCtrl)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$1w = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __decorate$1g = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var GroupResizeFeature = /** @class */ (function (_super) { __extends$1w(GroupResizeFeature, _super); function GroupResizeFeature(comp, eResize, pinned, columnGroup) { var _this = _super.call(this) || this; _this.eResize = eResize; _this.comp = comp; _this.pinned = pinned; _this.columnGroup = columnGroup; return _this; } GroupResizeFeature.prototype.postConstruct = function () { var _this = this; if (!this.columnGroup.isResizable()) { this.comp.setResizableDisplayed(false); return; } var finishedWithResizeFunc = this.horizontalResizeService.addResizeBar({ eResizeBar: this.eResize, onResizeStart: this.onResizeStart.bind(this), onResizing: this.onResizing.bind(this, false), onResizeEnd: this.onResizing.bind(this, true) }); this.addDestroyFunc(finishedWithResizeFunc); if (!this.gridOptionsService.is('suppressAutoSize')) { var skipHeaderOnAutoSize_1 = this.gridOptionsService.is('skipHeaderOnAutoSize'); this.eResize.addEventListener('dblclick', function () { // get list of all the column keys we are responsible for var keys = []; var leafCols = _this.columnGroup.getDisplayedLeafColumns(); leafCols.forEach(function (column) { // not all cols in the group may be participating with auto-resize if (!column.getColDef().suppressAutoSize) { keys.push(column.getColId()); } }); if (keys.length > 0) { _this.columnModel.autoSizeColumns({ columns: keys, skipHeader: skipHeaderOnAutoSize_1, stopAtGroup: _this.columnGroup, source: 'uiColumnResized' }); } _this.resizeLeafColumnsToFit(); }); } }; GroupResizeFeature.prototype.onResizeStart = function (shiftKey) { var _this = this; this.calculateInitialValues(); var takeFromGroup = null; if (shiftKey) { takeFromGroup = this.columnModel.getDisplayedGroupAfter(this.columnGroup); } if (takeFromGroup) { var takeFromLeafCols = takeFromGroup.getDisplayedLeafColumns(); this.resizeTakeFromCols = takeFromLeafCols.filter(function (col) { return col.isResizable(); }); this.resizeTakeFromStartWidth = 0; this.resizeTakeFromCols.forEach(function (col) { return _this.resizeTakeFromStartWidth += col.getActualWidth(); }); this.resizeTakeFromRatios = []; this.resizeTakeFromCols.forEach(function (col) { return _this.resizeTakeFromRatios.push(col.getActualWidth() / _this.resizeTakeFromStartWidth); }); } else { this.resizeTakeFromCols = null; this.resizeTakeFromStartWidth = null; this.resizeTakeFromRatios = null; } this.comp.addOrRemoveCssClass('ag-column-resizing', true); }; GroupResizeFeature.prototype.onResizing = function (finished, resizeAmount) { var resizeAmountNormalised = this.normaliseDragChange(resizeAmount); var width = this.resizeStartWidth + resizeAmountNormalised; this.resizeColumns(width, finished); }; GroupResizeFeature.prototype.resizeLeafColumnsToFit = function () { var preferredSize = this.autoWidthCalculator.getPreferredWidthForColumnGroup(this.columnGroup); this.calculateInitialValues(); if (preferredSize > this.resizeStartWidth) { this.resizeColumns(preferredSize, true); } }; GroupResizeFeature.prototype.resizeColumns = function (totalWidth, finished) { if (finished === void 0) { finished = true; } var resizeSets = []; resizeSets.push({ columns: this.resizeCols, ratios: this.resizeRatios, width: totalWidth }); if (this.resizeTakeFromCols) { var diff = totalWidth - this.resizeStartWidth; resizeSets.push({ columns: this.resizeTakeFromCols, ratios: this.resizeTakeFromRatios, width: this.resizeTakeFromStartWidth - diff }); } this.columnModel.resizeColumnSets({ resizeSets: resizeSets, finished: finished, source: 'uiColumnDragged' }); if (finished) { this.comp.addOrRemoveCssClass('ag-column-resizing', false); } }; GroupResizeFeature.prototype.calculateInitialValues = function () { var _this = this; var leafCols = this.columnGroup.getDisplayedLeafColumns(); this.resizeCols = leafCols.filter(function (col) { return col.isResizable(); }); this.resizeStartWidth = 0; this.resizeCols.forEach(function (col) { return _this.resizeStartWidth += col.getActualWidth(); }); this.resizeRatios = []; this.resizeCols.forEach(function (col) { return _this.resizeRatios.push(col.getActualWidth() / _this.resizeStartWidth); }); }; // optionally inverts the drag, depending on pinned and RTL // note - this method is duplicated in RenderedHeaderCell - should refactor out? GroupResizeFeature.prototype.normaliseDragChange = function (dragChange) { var result = dragChange; if (this.gridOptionsService.is('enableRtl')) { // for RTL, dragging left makes the col bigger, except when pinning left if (this.pinned !== 'left') { result *= -1; } } else if (this.pinned === 'right') { // for LTR (ie normal), dragging left makes the col smaller, except when pinning right result *= -1; } return result; }; __decorate$1g([ Autowired('horizontalResizeService') ], GroupResizeFeature.prototype, "horizontalResizeService", void 0); __decorate$1g([ Autowired('autoWidthCalculator') ], GroupResizeFeature.prototype, "autoWidthCalculator", void 0); __decorate$1g([ Autowired('columnModel') ], GroupResizeFeature.prototype, "columnModel", void 0); __decorate$1g([ PostConstruct ], GroupResizeFeature.prototype, "postConstruct", null); return GroupResizeFeature; }(BeanStub)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$1x = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __decorate$1h = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var GroupWidthFeature = /** @class */ (function (_super) { __extends$1x(GroupWidthFeature, _super); function GroupWidthFeature(comp, columnGroup) { var _this = _super.call(this) || this; // the children can change, we keep destroy functions related to listening to the children here _this.removeChildListenersFuncs = []; _this.columnGroup = columnGroup; _this.comp = comp; return _this; } GroupWidthFeature.prototype.postConstruct = function () { // we need to listen to changes in child columns, as they impact our width this.addListenersToChildrenColumns(); // the children belonging to this group can change, so we need to add and remove listeners as they change this.addManagedListener(this.columnGroup, ColumnGroup.EVENT_DISPLAYED_CHILDREN_CHANGED, this.onDisplayedChildrenChanged.bind(this)); this.onWidthChanged(); // the child listeners are not tied to this components life-cycle, as children can get added and removed // to the group - hence they are on a different life-cycle. so we must make sure the existing children // listeners are removed when we finally get destroyed this.addDestroyFunc(this.removeListenersOnChildrenColumns.bind(this)); }; GroupWidthFeature.prototype.addListenersToChildrenColumns = function () { var _this = this; // first destroy any old listeners this.removeListenersOnChildrenColumns(); // now add new listeners to the new set of children var widthChangedListener = this.onWidthChanged.bind(this); this.columnGroup.getLeafColumns().forEach(function (column) { column.addEventListener('widthChanged', widthChangedListener); column.addEventListener('visibleChanged', widthChangedListener); _this.removeChildListenersFuncs.push(function () { column.removeEventListener('widthChanged', widthChangedListener); column.removeEventListener('visibleChanged', widthChangedListener); }); }); }; GroupWidthFeature.prototype.removeListenersOnChildrenColumns = function () { this.removeChildListenersFuncs.forEach(function (func) { return func(); }); this.removeChildListenersFuncs = []; }; GroupWidthFeature.prototype.onDisplayedChildrenChanged = function () { this.addListenersToChildrenColumns(); this.onWidthChanged(); }; GroupWidthFeature.prototype.onWidthChanged = function () { var columnWidth = this.columnGroup.getActualWidth(); this.comp.setWidth(columnWidth + "px"); this.comp.addOrRemoveCssClass('ag-hidden', columnWidth === 0); }; __decorate$1h([ PostConstruct ], GroupWidthFeature.prototype, "postConstruct", null); return GroupWidthFeature; }(BeanStub)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$1y = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __decorate$1i = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var HeaderGroupCellCtrl = /** @class */ (function (_super) { __extends$1y(HeaderGroupCellCtrl, _super); function HeaderGroupCellCtrl(columnGroup, parentRowCtrl) { var _this = _super.call(this, columnGroup, parentRowCtrl) || this; _this.columnGroup = columnGroup; return _this; } HeaderGroupCellCtrl.prototype.setComp = function (comp, eGui, eResize) { _super.prototype.setGui.call(this, eGui); this.comp = comp; this.displayName = this.columnModel.getDisplayNameForColumnGroup(this.columnGroup, 'header'); this.addClasses(); this.addAttributes(); this.setupMovingCss(); this.setupExpandable(); this.setupTooltip(); this.setupUserComp(); var pinned = this.getParentRowCtrl().getPinned(); var leafCols = this.columnGroup.getProvidedColumnGroup().getLeafColumns(); this.createManagedBean(new HoverFeature(leafCols, eGui)); this.createManagedBean(new SetLeftFeature(this.columnGroup, eGui, this.beans)); this.createManagedBean(new GroupWidthFeature(comp, this.columnGroup)); this.groupResizeFeature = this.createManagedBean(new GroupResizeFeature(comp, eResize, pinned, this.columnGroup)); this.createManagedBean(new ManagedFocusFeature(eGui, { shouldStopEventPropagation: this.shouldStopEventPropagation.bind(this), onTabKeyDown: function () { return undefined; }, handleKeyDown: this.handleKeyDown.bind(this), onFocusIn: this.onFocusIn.bind(this) })); }; HeaderGroupCellCtrl.prototype.resizeLeafColumnsToFit = function () { var _a, _b; // AG-8205 Temp null check to avoid throwing when a component has not been setup yet (React 18) (_a = this.groupResizeFeature) === null || _a === void 0 ? void 0 : _a.onResizeStart(false); (_b = this.groupResizeFeature) === null || _b === void 0 ? void 0 : _b.resizeLeafColumnsToFit(); }; HeaderGroupCellCtrl.prototype.setupUserComp = function () { var _this = this; var displayName = this.displayName; var params = { displayName: this.displayName, columnGroup: this.columnGroup, setExpanded: function (expanded) { _this.columnModel.setColumnGroupOpened(_this.columnGroup.getProvidedColumnGroup(), expanded, "gridInitializing"); }, api: this.gridApi, columnApi: this.columnApi, context: this.gridOptionsService.context }; if (!displayName) { var columnGroup = this.columnGroup; var leafCols = columnGroup.getLeafColumns(); // find the top most column group that represents the same columns. so if we are dragging a group, we also // want to visually show the parent groups dragging for the same column set. for example imaging 5 levels // of grouping, with each group only containing the next group, and the last group containing three columns, // then when you move any group (even the lowest level group) you are in-fact moving all the groups, as all // the groups represent the same column set. while (columnGroup.getParent() && columnGroup.getParent().getLeafColumns().length === leafCols.length) { columnGroup = columnGroup.getParent(); } var colGroupDef = columnGroup.getColGroupDef(); if (colGroupDef) { displayName = colGroupDef.headerName; } if (!displayName) { displayName = leafCols ? this.columnModel.getDisplayNameForColumn(leafCols[0], 'header', true) : ''; } } var compDetails = this.userComponentFactory.getHeaderGroupCompDetails(params); this.comp.setUserCompDetails(compDetails); }; HeaderGroupCellCtrl.prototype.setupTooltip = function () { var _this = this; var colGroupDef = this.columnGroup.getColGroupDef(); var tooltipCtrl = { getColumn: function () { return _this.columnGroup; }, getGui: function () { return _this.eGui; }, getLocation: function () { return 'headerGroup'; }, getTooltipValue: function () { return colGroupDef && colGroupDef.headerTooltip; } }; if (colGroupDef) { tooltipCtrl.getColDef = function () { return colGroupDef; }; } var tooltipFeature = this.createManagedBean(new TooltipFeature(tooltipCtrl, this.beans)); tooltipFeature.setComp(this.comp); }; HeaderGroupCellCtrl.prototype.setupExpandable = function () { var providedColGroup = this.columnGroup.getProvidedColumnGroup(); this.refreshExpanded(); this.addManagedListener(providedColGroup, ProvidedColumnGroup.EVENT_EXPANDABLE_CHANGED, this.refreshExpanded.bind(this)); this.addManagedListener(providedColGroup, ProvidedColumnGroup.EVENT_EXPANDED_CHANGED, this.refreshExpanded.bind(this)); }; HeaderGroupCellCtrl.prototype.refreshExpanded = function () { var column = this.columnGroup; this.expandable = column.isExpandable(); var expanded = column.isExpanded(); if (this.expandable) { this.comp.setAriaExpanded(expanded ? 'true' : 'false'); } else { this.comp.setAriaExpanded(undefined); } }; HeaderGroupCellCtrl.prototype.addAttributes = function () { this.comp.setColId(this.columnGroup.getUniqueId()); }; HeaderGroupCellCtrl.prototype.addClasses = function () { var _this = this; var colGroupDef = this.columnGroup.getColGroupDef(); var classes = CssClassApplier.getHeaderClassesFromColDef(colGroupDef, this.gridOptionsService, null, this.columnGroup); // having different classes below allows the style to not have a bottom border // on the group header, if no group is specified if (this.columnGroup.isPadding()) { classes.push('ag-header-group-cell-no-group'); var leafCols = this.columnGroup.getLeafColumns(); if (leafCols.every(function (col) { return col.isSpanHeaderHeight(); })) { classes.push('ag-header-span-height'); } } else { classes.push('ag-header-group-cell-with-group'); } classes.forEach(function (c) { return _this.comp.addOrRemoveCssClass(c, true); }); }; HeaderGroupCellCtrl.prototype.setupMovingCss = function () { var _this = this; var providedColumnGroup = this.columnGroup.getProvidedColumnGroup(); var leafColumns = providedColumnGroup.getLeafColumns(); // this function adds or removes the moving css, based on if the col is moving. // this is what makes the header go dark when it is been moved (gives impression to // user that the column was picked up). var listener = function () { return _this.comp.addOrRemoveCssClass('ag-header-cell-moving', _this.columnGroup.isMoving()); }; leafColumns.forEach(function (col) { _this.addManagedListener(col, Column.EVENT_MOVING_CHANGED, listener); }); listener(); }; HeaderGroupCellCtrl.prototype.onFocusIn = function (e) { if (!this.eGui.contains(e.relatedTarget)) { var rowIndex = this.getRowIndex(); this.beans.focusService.setFocusedHeader(rowIndex, this.columnGroup); } }; HeaderGroupCellCtrl.prototype.handleKeyDown = function (e) { _super.prototype.handleKeyDown.call(this, e); var wrapperHasFocus = this.getWrapperHasFocus(); if (!this.expandable || !wrapperHasFocus) { return; } if (e.key === KeyCode.ENTER) { var column = this.columnGroup; var newExpandedValue = !column.isExpanded(); this.columnModel.setColumnGroupOpened(column.getProvidedColumnGroup(), newExpandedValue, "uiColumnExpanded"); } }; // unlike columns, this will only get called once, as we don't react on props on column groups // (we will always destroy and recreate this comp if something changes) HeaderGroupCellCtrl.prototype.setDragSource = function (eHeaderGroup) { var _this = this; if (this.isSuppressMoving()) { return; } var allLeafColumns = this.columnGroup.getProvidedColumnGroup().getLeafColumns(); var hideColumnOnExit = !this.gridOptionsService.is('suppressDragLeaveHidesColumns'); var dragSource = { type: exports.DragSourceType.HeaderCell, eElement: eHeaderGroup, defaultIconName: hideColumnOnExit ? DragAndDropService.ICON_HIDE : DragAndDropService.ICON_NOT_ALLOWED, dragItemName: this.displayName, // we add in the original group leaf columns, so we move both visible and non-visible items getDragItem: this.getDragItemForGroup.bind(this), onDragStarted: function () { return allLeafColumns.forEach(function (col) { return col.setMoving(true, "uiColumnDragged"); }); }, onDragStopped: function () { return allLeafColumns.forEach(function (col) { return col.setMoving(false, "uiColumnDragged"); }); }, onGridEnter: function (dragItem) { var _a; if (hideColumnOnExit) { var unlockedColumns = ((_a = dragItem === null || dragItem === void 0 ? void 0 : dragItem.columns) === null || _a === void 0 ? void 0 : _a.filter(function (col) { return !col.getColDef().lockVisible; })) || []; _this.columnModel.setColumnsVisible(unlockedColumns, true, "uiColumnMoved"); } }, onGridExit: function (dragItem) { var _a; if (hideColumnOnExit) { var unlockedColumns = ((_a = dragItem === null || dragItem === void 0 ? void 0 : dragItem.columns) === null || _a === void 0 ? void 0 : _a.filter(function (col) { return !col.getColDef().lockVisible; })) || []; _this.columnModel.setColumnsVisible(unlockedColumns, false, "uiColumnMoved"); } }, }; this.dragAndDropService.addDragSource(dragSource, true); this.addDestroyFunc(function () { return _this.dragAndDropService.removeDragSource(dragSource); }); }; // when moving the columns, we want to move all the columns (contained within the DragItem) in this group in one go, // and in the order they are currently in the screen. HeaderGroupCellCtrl.prototype.getDragItemForGroup = function () { var allColumnsOriginalOrder = this.columnGroup.getProvidedColumnGroup().getLeafColumns(); // capture visible state, used when re-entering grid to dictate which columns should be visible var visibleState = {}; allColumnsOriginalOrder.forEach(function (column) { return visibleState[column.getId()] = column.isVisible(); }); var allColumnsCurrentOrder = []; this.columnModel.getAllDisplayedColumns().forEach(function (column) { if (allColumnsOriginalOrder.indexOf(column) >= 0) { allColumnsCurrentOrder.push(column); removeFromArray(allColumnsOriginalOrder, column); } }); // we are left with non-visible columns, stick these in at the end allColumnsOriginalOrder.forEach(function (column) { return allColumnsCurrentOrder.push(column); }); // create and return dragItem return { columns: allColumnsCurrentOrder, visibleState: visibleState }; }; HeaderGroupCellCtrl.prototype.isSuppressMoving = function () { // if any child is fixed, then don't allow moving var childSuppressesMoving = false; this.columnGroup.getLeafColumns().forEach(function (column) { if (column.getColDef().suppressMovable || column.getColDef().lockPosition) { childSuppressesMoving = true; } }); var result = childSuppressesMoving || this.gridOptionsService.is('suppressMovableColumns'); return result; }; __decorate$1i([ Autowired('columnModel') ], HeaderGroupCellCtrl.prototype, "columnModel", void 0); __decorate$1i([ Autowired('dragAndDropService') ], HeaderGroupCellCtrl.prototype, "dragAndDropService", void 0); __decorate$1i([ Autowired('gridApi') ], HeaderGroupCellCtrl.prototype, "gridApi", void 0); __decorate$1i([ Autowired('columnApi') ], HeaderGroupCellCtrl.prototype, "columnApi", void 0); return HeaderGroupCellCtrl; }(AbstractHeaderCellCtrl)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$1z = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __decorate$1j = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var instanceIdSequence$4 = 0; var HeaderRowCtrl = /** @class */ (function (_super) { __extends$1z(HeaderRowCtrl, _super); function HeaderRowCtrl(rowIndex, pinned, type) { var _this = _super.call(this) || this; _this.instanceId = instanceIdSequence$4++; _this.headerCellCtrls = {}; _this.rowIndex = rowIndex; _this.pinned = pinned; _this.type = type; return _this; } HeaderRowCtrl.prototype.getInstanceId = function () { return this.instanceId; }; HeaderRowCtrl.prototype.setComp = function (comp) { this.comp = comp; this.onRowHeightChanged(); this.onVirtualColumnsChanged(); this.setWidth(); this.addEventListeners(); if (isBrowserSafari()) { // fix for a Safari rendering bug that caused the header to flicker above chart panels // as you move the mouse over the header this.comp.setTransform('translateZ(0)'); } comp.setAriaRowIndex(this.rowIndex + 1); }; HeaderRowCtrl.prototype.addEventListeners = function () { this.addManagedListener(this.eventService, Events.EVENT_COLUMN_RESIZED, this.onColumnResized.bind(this)); this.addManagedListener(this.eventService, Events.EVENT_DISPLAYED_COLUMNS_CHANGED, this.onDisplayedColumnsChanged.bind(this)); this.addManagedListener(this.eventService, Events.EVENT_VIRTUAL_COLUMNS_CHANGED, this.onVirtualColumnsChanged.bind(this)); this.addManagedListener(this.eventService, Events.EVENT_COLUMN_HEADER_HEIGHT_CHANGED, this.onRowHeightChanged.bind(this)); this.addManagedListener(this.eventService, Events.EVENT_GRID_STYLES_CHANGED, this.onRowHeightChanged.bind(this)); // when print layout changes, it changes what columns are in what section this.addManagedPropertyListener('domLayout', this.onDisplayedColumnsChanged.bind(this)); this.addManagedPropertyListener('headerHeight', this.onRowHeightChanged.bind(this)); this.addManagedPropertyListener('pivotHeaderHeight', this.onRowHeightChanged.bind(this)); this.addManagedPropertyListener('groupHeaderHeight', this.onRowHeightChanged.bind(this)); this.addManagedPropertyListener('pivotGroupHeaderHeight', this.onRowHeightChanged.bind(this)); this.addManagedPropertyListener('floatingFiltersHeight', this.onRowHeightChanged.bind(this)); }; HeaderRowCtrl.prototype.getHeaderCellCtrl = function (column) { return values(this.headerCellCtrls).find(function (cellCtrl) { return cellCtrl.getColumnGroupChild() === column; }); }; HeaderRowCtrl.prototype.onDisplayedColumnsChanged = function () { this.onVirtualColumnsChanged(); this.setWidth(); this.onRowHeightChanged(); }; HeaderRowCtrl.prototype.getType = function () { return this.type; }; HeaderRowCtrl.prototype.onColumnResized = function () { this.setWidth(); }; HeaderRowCtrl.prototype.setWidth = function () { var width = this.getWidthForRow(); this.comp.setWidth(width + "px"); }; HeaderRowCtrl.prototype.getWidthForRow = function () { var printLayout = this.gridOptionsService.isDomLayout('print'); if (printLayout) { var pinned = this.pinned != null; if (pinned) { return 0; } return this.columnModel.getContainerWidth('right') + this.columnModel.getContainerWidth('left') + this.columnModel.getContainerWidth(null); } // if not printing, just return the width as normal return this.columnModel.getContainerWidth(this.pinned); }; HeaderRowCtrl.prototype.onRowHeightChanged = function () { var headerRowCount = this.columnModel.getHeaderRowCount(); var sizes = []; var numberOfFloating = 0; if (this.columnModel.hasFloatingFilters()) { headerRowCount++; numberOfFloating = 1; } var groupHeight = this.columnModel.getColumnGroupHeaderRowHeight(); var headerHeight = this.columnModel.getColumnHeaderRowHeight(); var numberOfNonGroups = 1 + numberOfFloating; var numberOfGroups = headerRowCount - numberOfNonGroups; for (var i = 0; i < numberOfGroups; i++) { sizes.push(groupHeight); } sizes.push(headerHeight); for (var i = 0; i < numberOfFloating; i++) { sizes.push(this.columnModel.getFloatingFiltersHeight()); } var topOffset = 0; for (var i = 0; i < this.rowIndex; i++) { topOffset += sizes[i]; } var thisRowHeight = sizes[this.rowIndex] + 'px'; this.comp.setTop(topOffset + 'px'); this.comp.setHeight(thisRowHeight); }; HeaderRowCtrl.prototype.getPinned = function () { return this.pinned; }; HeaderRowCtrl.prototype.getRowIndex = function () { return this.rowIndex; }; HeaderRowCtrl.prototype.onVirtualColumnsChanged = function () { var _this = this; var oldCtrls = this.headerCellCtrls; this.headerCellCtrls = {}; var columns = this.getColumnsInViewport(); columns.forEach(function (child) { // skip groups that have no displayed children. this can happen when the group is broken, // and this section happens to have nothing to display for the open / closed state. // (a broken group is one that is split, ie columns in the group have a non-group column // in between them) if (child.isEmptyGroup()) { return; } var idOfChild = child.getUniqueId(); // if we already have this cell rendered, do nothing var headerCtrl = oldCtrls[idOfChild]; delete oldCtrls[idOfChild]; // it's possible there is a new Column with the same ID, but it's for a different Column. // this is common with pivoting, where the pivot cols change, but the id's are still pivot_0, // pivot_1 etc. so if new col but same ID, need to remove the old col here first as we are // about to replace it in the this.headerComps map. var forOldColumn = headerCtrl && headerCtrl.getColumnGroupChild() != child; if (forOldColumn) { _this.destroyBean(headerCtrl); headerCtrl = undefined; } if (headerCtrl == null) { switch (_this.type) { case exports.HeaderRowType.FLOATING_FILTER: headerCtrl = _this.createBean(new HeaderFilterCellCtrl(child, _this)); break; case exports.HeaderRowType.COLUMN_GROUP: headerCtrl = _this.createBean(new HeaderGroupCellCtrl(child, _this)); break; default: headerCtrl = _this.createBean(new HeaderCellCtrl(child, _this)); break; } } _this.headerCellCtrls[idOfChild] = headerCtrl; }); // we want to keep columns that are focused, otherwise keyboard navigation breaks var isFocusedAndDisplayed = function (ctrl) { var isFocused = _this.focusService.isHeaderWrapperFocused(ctrl); if (!isFocused) { return false; } var isDisplayed = _this.columnModel.isDisplayed(ctrl.getColumnGroupChild()); return isDisplayed; }; iterateObject(oldCtrls, function (id, oldCtrl) { var keepCtrl = isFocusedAndDisplayed(oldCtrl); if (keepCtrl) { _this.headerCellCtrls[id] = oldCtrl; } else { _this.destroyBean(oldCtrl); } }); var ctrlsToDisplay = getAllValuesInObject(this.headerCellCtrls); this.comp.setHeaderCtrls(ctrlsToDisplay); }; HeaderRowCtrl.prototype.getColumnsInViewport = function () { var printLayout = this.gridOptionsService.isDomLayout('print'); return printLayout ? this.getColumnsInViewportPrintLayout() : this.getColumnsInViewportNormalLayout(); }; HeaderRowCtrl.prototype.getColumnsInViewportPrintLayout = function () { var _this = this; // for print layout, we add all columns into the center if (this.pinned != null) { return []; } var viewportColumns = []; var actualDepth = this.getActualDepth(); ['left', null, 'right'].forEach(function (pinned) { var items = _this.columnModel.getVirtualHeaderGroupRow(pinned, actualDepth); viewportColumns = viewportColumns.concat(items); }); return viewportColumns; }; HeaderRowCtrl.prototype.getActualDepth = function () { return this.type == exports.HeaderRowType.FLOATING_FILTER ? this.rowIndex - 1 : this.rowIndex; }; HeaderRowCtrl.prototype.getColumnsInViewportNormalLayout = function () { // when in normal layout, we add the columns for that container only return this.columnModel.getVirtualHeaderGroupRow(this.pinned, this.getActualDepth()); }; HeaderRowCtrl.prototype.focusHeader = function (column, event) { var allCtrls = getAllValuesInObject(this.headerCellCtrls); var ctrl = allCtrls.find(function (ctrl) { return ctrl.getColumnGroupChild() == column; }); if (!ctrl) { return false; } ctrl.focus(event); return true; }; HeaderRowCtrl.prototype.destroy = function () { var _this = this; iterateObject(this.headerCellCtrls, function (key, ctrl) { _this.destroyBean(ctrl); }); this.headerCellCtrls = {}; _super.prototype.destroy.call(this); }; __decorate$1j([ Autowired('columnModel') ], HeaderRowCtrl.prototype, "columnModel", void 0); __decorate$1j([ Autowired('focusService') ], HeaderRowCtrl.prototype, "focusService", void 0); return HeaderRowCtrl; }(BeanStub)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$1A = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __decorate$1k = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var __read$g = (undefined && undefined.__read) || function (o, n) { var m = typeof Symbol === "function" && o[Symbol.iterator]; if (!m) return o; var i = m.call(o), r, ar = [], e; try { while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); } catch (error) { e = { error: error }; } finally { try { if (r && !r.done && (m = i["return"])) m.call(i); } finally { if (e) throw e.error; } } return ar; }; var __spread$b = (undefined && undefined.__spread) || function () { for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read$g(arguments[i])); return ar; }; var HeaderRowContainerCtrl = /** @class */ (function (_super) { __extends$1A(HeaderRowContainerCtrl, _super); function HeaderRowContainerCtrl(pinned) { var _this = _super.call(this) || this; _this.hidden = false; _this.groupsRowCtrls = []; _this.pinned = pinned; return _this; } HeaderRowContainerCtrl.prototype.setComp = function (comp, eGui) { this.comp = comp; this.eViewport = eGui; this.setupCenterWidth(); this.setupPinnedWidth(); this.setupDragAndDrop(this.eViewport); this.addManagedListener(this.eventService, Events.EVENT_GRID_COLUMNS_CHANGED, this.onGridColumnsChanged.bind(this)); this.addManagedListener(this.eViewport, 'scroll', this.resetScrollLeft.bind(this)); this.ctrlsService.registerHeaderContainer(this, this.pinned); if (this.columnModel.isReady()) { this.refresh(); } }; HeaderRowContainerCtrl.prototype.setupDragAndDrop = function (dropContainer) { var bodyDropTarget = new BodyDropTarget(this.pinned, dropContainer); this.createManagedBean(bodyDropTarget); }; HeaderRowContainerCtrl.prototype.refresh = function (keepColumns) { var _this = this; if (keepColumns === void 0) { keepColumns = false; } var sequence = new NumberSequence(); var focusedHeaderPosition = this.focusService.getFocusHeaderToUseAfterRefresh(); var refreshColumnGroups = function () { var groupRowCount = _this.columnModel.getHeaderRowCount() - 1; _this.groupsRowCtrls = _this.destroyBeans(_this.groupsRowCtrls); for (var i = 0; i < groupRowCount; i++) { var ctrl = _this.createBean(new HeaderRowCtrl(sequence.next(), _this.pinned, exports.HeaderRowType.COLUMN_GROUP)); _this.groupsRowCtrls.push(ctrl); } }; var refreshColumns = function () { var rowIndex = sequence.next(); var needNewInstance = !_this.hidden && (_this.columnsRowCtrl == null || !keepColumns || _this.columnsRowCtrl.getRowIndex() !== rowIndex); var shouldDestroyInstance = needNewInstance || _this.hidden; if (shouldDestroyInstance) { _this.columnsRowCtrl = _this.destroyBean(_this.columnsRowCtrl); } if (needNewInstance) { _this.columnsRowCtrl = _this.createBean(new HeaderRowCtrl(rowIndex, _this.pinned, exports.HeaderRowType.COLUMN)); } }; var refreshFilters = function () { var includeFloatingFilter = _this.columnModel.hasFloatingFilters() && !_this.hidden; var destroyPreviousComp = function () { _this.filtersRowCtrl = _this.destroyBean(_this.filtersRowCtrl); }; if (!includeFloatingFilter) { destroyPreviousComp(); return; } var rowIndex = sequence.next(); if (_this.filtersRowCtrl) { var rowIndexMismatch = _this.filtersRowCtrl.getRowIndex() !== rowIndex; if (!keepColumns || rowIndexMismatch) { destroyPreviousComp(); } } if (!_this.filtersRowCtrl) { _this.filtersRowCtrl = _this.createBean(new HeaderRowCtrl(rowIndex, _this.pinned, exports.HeaderRowType.FLOATING_FILTER)); } }; refreshColumnGroups(); refreshColumns(); refreshFilters(); var allCtrls = this.getAllCtrls(); this.comp.setCtrls(allCtrls); this.restoreFocusOnHeader(focusedHeaderPosition); }; HeaderRowContainerCtrl.prototype.restoreFocusOnHeader = function (position) { if (position == null || position.column.getPinned() != this.pinned) { return; } this.focusService.focusHeaderPosition({ headerPosition: position }); }; HeaderRowContainerCtrl.prototype.getAllCtrls = function () { var res = __spread$b(this.groupsRowCtrls); if (this.columnsRowCtrl) { res.push(this.columnsRowCtrl); } if (this.filtersRowCtrl) { res.push(this.filtersRowCtrl); } return res; }; // grid cols have changed - this also means the number of rows in the header can have // changed. so we remove all the old rows and insert new ones for a complete refresh HeaderRowContainerCtrl.prototype.onGridColumnsChanged = function () { this.refresh(true); }; HeaderRowContainerCtrl.prototype.setupCenterWidth = function () { var _this = this; if (this.pinned != null) { return; } this.createManagedBean(new CenterWidthFeature(function (width) { return _this.comp.setCenterWidth(width + "px"); })); }; HeaderRowContainerCtrl.prototype.setHorizontalScroll = function (offset) { this.comp.setContainerTransform("translateX(" + offset + "px)"); }; HeaderRowContainerCtrl.prototype.resetScrollLeft = function () { this.eViewport.scrollLeft = 0; }; HeaderRowContainerCtrl.prototype.setupPinnedWidth = function () { var _this = this; if (this.pinned == null) { return; } var pinningLeft = this.pinned === 'left'; var pinningRight = this.pinned === 'right'; this.hidden = true; var listener = function () { var width = pinningLeft ? _this.pinnedWidthService.getPinnedLeftWidth() : _this.pinnedWidthService.getPinnedRightWidth(); if (width == null) { return; } // can happen at initialisation, width not yet set var hidden = (width == 0); var hiddenChanged = _this.hidden !== hidden; var isRtl = _this.gridOptionsService.is('enableRtl'); var scrollbarWidth = _this.gridOptionsService.getScrollbarWidth(); // if there is a scroll showing (and taking up space, so Windows, and not iOS) // in the body, then we add extra space to keep header aligned with the body, // as body width fits the cols and the scrollbar var addPaddingForScrollbar = _this.scrollVisibleService.isVerticalScrollShowing() && ((isRtl && pinningLeft) || (!isRtl && pinningRight)); var widthWithPadding = addPaddingForScrollbar ? width + scrollbarWidth : width; _this.comp.setPinnedContainerWidth(widthWithPadding + "px"); _this.comp.setDisplayed(!hidden); if (hiddenChanged) { _this.hidden = hidden; _this.refresh(); } }; this.addManagedListener(this.eventService, Events.EVENT_LEFT_PINNED_WIDTH_CHANGED, listener); this.addManagedListener(this.eventService, Events.EVENT_RIGHT_PINNED_WIDTH_CHANGED, listener); this.addManagedListener(this.eventService, Events.EVENT_SCROLL_VISIBILITY_CHANGED, listener); this.addManagedListener(this.eventService, Events.EVENT_SCROLLBAR_WIDTH_CHANGED, listener); }; HeaderRowContainerCtrl.prototype.getHeaderCtrlForColumn = function (column) { if (column instanceof Column) { if (!this.columnsRowCtrl) { return; } return this.columnsRowCtrl.getHeaderCellCtrl(column); } if (this.groupsRowCtrls.length === 0) { return; } for (var i = 0; i < this.groupsRowCtrls.length; i++) { var ctrl = this.groupsRowCtrls[i].getHeaderCellCtrl(column); if (ctrl) { return ctrl; } } }; HeaderRowContainerCtrl.prototype.getHtmlElementForColumnHeader = function (column) { /* tslint:enable */ var cellCtrl = this.getHeaderCtrlForColumn(column); if (!cellCtrl) { return null; } return cellCtrl.getGui(); }; HeaderRowContainerCtrl.prototype.getRowType = function (rowIndex) { var allCtrls = this.getAllCtrls(); var ctrl = allCtrls[rowIndex]; return ctrl ? ctrl.getType() : undefined; }; HeaderRowContainerCtrl.prototype.focusHeader = function (rowIndex, column, event) { var allCtrls = this.getAllCtrls(); var ctrl = allCtrls[rowIndex]; if (!ctrl) { return false; } return ctrl.focusHeader(column, event); }; HeaderRowContainerCtrl.prototype.getRowCount = function () { return this.getAllCtrls().length; }; HeaderRowContainerCtrl.prototype.destroy = function () { if (this.filtersRowCtrl) { this.filtersRowCtrl = this.destroyBean(this.filtersRowCtrl); } if (this.columnsRowCtrl) { this.columnsRowCtrl = this.destroyBean(this.columnsRowCtrl); } if (this.groupsRowCtrls && this.groupsRowCtrls.length) { this.groupsRowCtrls = this.destroyBeans(this.groupsRowCtrls); } _super.prototype.destroy.call(this); }; __decorate$1k([ Autowired('ctrlsService') ], HeaderRowContainerCtrl.prototype, "ctrlsService", void 0); __decorate$1k([ Autowired('scrollVisibleService') ], HeaderRowContainerCtrl.prototype, "scrollVisibleService", void 0); __decorate$1k([ Autowired('pinnedWidthService') ], HeaderRowContainerCtrl.prototype, "pinnedWidthService", void 0); __decorate$1k([ Autowired('columnModel') ], HeaderRowContainerCtrl.prototype, "columnModel", void 0); __decorate$1k([ Autowired('focusService') ], HeaderRowContainerCtrl.prototype, "focusService", void 0); return HeaderRowContainerCtrl; }(BeanStub)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$1B = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __decorate$1l = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var HeaderRowContainerComp = /** @class */ (function (_super) { __extends$1B(HeaderRowContainerComp, _super); function HeaderRowContainerComp(pinned) { var _this = _super.call(this) || this; _this.headerRowComps = {}; _this.rowCompsList = []; _this.pinned = pinned; return _this; } HeaderRowContainerComp.prototype.init = function () { var _this = this; this.selectAndSetTemplate(); var compProxy = { setDisplayed: function (displayed) { return _this.setDisplayed(displayed); }, setCtrls: function (ctrls) { return _this.setCtrls(ctrls); }, // only gets called for center section setCenterWidth: function (width) { return _this.eCenterContainer.style.width = width; }, setContainerTransform: function (transform) { return _this.eCenterContainer.style.transform = transform; }, // only gets called for pinned sections setPinnedContainerWidth: function (width) { var eGui = _this.getGui(); eGui.style.width = width; eGui.style.maxWidth = width; eGui.style.minWidth = width; } }; var ctrl = this.createManagedBean(new HeaderRowContainerCtrl(this.pinned)); ctrl.setComp(compProxy, this.getGui()); }; HeaderRowContainerComp.prototype.selectAndSetTemplate = function () { var pinnedLeft = this.pinned == 'left'; var pinnedRight = this.pinned == 'right'; var template = pinnedLeft ? HeaderRowContainerComp.PINNED_LEFT_TEMPLATE : pinnedRight ? HeaderRowContainerComp.PINNED_RIGHT_TEMPLATE : HeaderRowContainerComp.CENTER_TEMPLATE; this.setTemplate(template); // for left and right, we add rows directly to the root element, // but for center container we add elements to the child container. this.eRowContainer = this.eCenterContainer ? this.eCenterContainer : this.getGui(); }; HeaderRowContainerComp.prototype.destroyRowComps = function () { this.setCtrls([]); }; HeaderRowContainerComp.prototype.destroyRowComp = function (rowComp) { this.destroyBean(rowComp); this.eRowContainer.removeChild(rowComp.getGui()); }; HeaderRowContainerComp.prototype.setCtrls = function (ctrls) { var _this = this; var oldRowComps = this.headerRowComps; this.headerRowComps = {}; this.rowCompsList = []; var prevGui; var appendEnsuringDomOrder = function (rowComp) { var eGui = rowComp.getGui(); var notAlreadyIn = eGui.parentElement != _this.eRowContainer; if (notAlreadyIn) { _this.eRowContainer.appendChild(eGui); } if (prevGui) { ensureDomOrder(_this.eRowContainer, eGui, prevGui); } prevGui = eGui; }; ctrls.forEach(function (ctrl) { var ctrlId = ctrl.getInstanceId(); var existingComp = oldRowComps[ctrlId]; delete oldRowComps[ctrlId]; var rowComp = existingComp ? existingComp : _this.createBean(new HeaderRowComp(ctrl)); _this.headerRowComps[ctrlId] = rowComp; _this.rowCompsList.push(rowComp); appendEnsuringDomOrder(rowComp); }); getAllValuesInObject(oldRowComps).forEach(function (c) { return _this.destroyRowComp(c); }); }; HeaderRowContainerComp.PINNED_LEFT_TEMPLATE = "
"; HeaderRowContainerComp.PINNED_RIGHT_TEMPLATE = "
"; HeaderRowContainerComp.CENTER_TEMPLATE = "
\n
\n
"; __decorate$1l([ RefSelector('eCenterContainer') ], HeaderRowContainerComp.prototype, "eCenterContainer", void 0); __decorate$1l([ PostConstruct ], HeaderRowContainerComp.prototype, "init", null); __decorate$1l([ PreDestroy ], HeaderRowContainerComp.prototype, "destroyRowComps", null); return HeaderRowContainerComp; }(Component)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$1C = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __decorate$1m = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; (function (HeaderNavigationDirection) { HeaderNavigationDirection[HeaderNavigationDirection["UP"] = 0] = "UP"; HeaderNavigationDirection[HeaderNavigationDirection["DOWN"] = 1] = "DOWN"; HeaderNavigationDirection[HeaderNavigationDirection["LEFT"] = 2] = "LEFT"; HeaderNavigationDirection[HeaderNavigationDirection["RIGHT"] = 3] = "RIGHT"; })(exports.HeaderNavigationDirection || (exports.HeaderNavigationDirection = {})); var HeaderNavigationService = /** @class */ (function (_super) { __extends$1C(HeaderNavigationService, _super); function HeaderNavigationService() { return _super !== null && _super.apply(this, arguments) || this; } HeaderNavigationService.prototype.postConstruct = function () { var _this = this; this.ctrlsService.whenReady(function (p) { _this.gridBodyCon = p.gridBodyCtrl; }); }; HeaderNavigationService.prototype.getHeaderRowCount = function () { var centerHeaderContainer = this.ctrlsService.getHeaderRowContainerCtrl(); return centerHeaderContainer ? centerHeaderContainer.getRowCount() : 0; }; /* * This method navigates grid header vertically * @return {boolean} true to preventDefault on the event that caused this navigation. */ HeaderNavigationService.prototype.navigateVertically = function (direction, fromHeader, event) { if (!fromHeader) { fromHeader = this.focusService.getFocusedHeader(); } if (!fromHeader) { return false; } var headerRowIndex = fromHeader.headerRowIndex, column = fromHeader.column; var rowLen = this.getHeaderRowCount(); var isUp = direction === exports.HeaderNavigationDirection.UP; var _a = isUp ? this.headerPositionUtils.getColumnVisibleParent(column, headerRowIndex) : this.headerPositionUtils.getColumnVisibleChild(column, headerRowIndex), nextRow = _a.nextRow, nextFocusColumn = _a.nextFocusColumn; var skipColumn = false; if (nextRow < 0) { nextRow = 0; nextFocusColumn = column; skipColumn = true; } if (nextRow >= rowLen) { nextRow = -1; // -1 indicates the focus should move to grid rows. } if (!skipColumn && !nextFocusColumn) { return false; } return this.focusService.focusHeaderPosition({ headerPosition: { headerRowIndex: nextRow, column: nextFocusColumn }, allowUserOverride: true, event: event }); }; /* * This method navigates grid header horizontally * @return {boolean} true to preventDefault on the event that caused this navigation. */ HeaderNavigationService.prototype.navigateHorizontally = function (direction, fromTab, event) { if (fromTab === void 0) { fromTab = false; } var focusedHeader = this.focusService.getFocusedHeader(); var isLeft = direction === exports.HeaderNavigationDirection.LEFT; var isRtl = this.gridOptionsService.is('enableRtl'); var nextHeader; var normalisedDirection; // either navigating to the left or isRtl (cannot be both) if (isLeft !== isRtl) { normalisedDirection = 'Before'; nextHeader = this.headerPositionUtils.findHeader(focusedHeader, normalisedDirection); } else { normalisedDirection = 'After'; nextHeader = this.headerPositionUtils.findHeader(focusedHeader, normalisedDirection); } if (nextHeader || !fromTab) { return this.focusService.focusHeaderPosition({ headerPosition: nextHeader, direction: normalisedDirection, fromTab: fromTab, allowUserOverride: true, event: event }); } return this.focusNextHeaderRow(focusedHeader, normalisedDirection, event); }; HeaderNavigationService.prototype.focusNextHeaderRow = function (focusedHeader, direction, event) { var currentIndex = focusedHeader.headerRowIndex; var nextPosition = null; var nextRowIndex; if (direction === 'Before') { if (currentIndex > 0) { nextRowIndex = currentIndex - 1; nextPosition = this.headerPositionUtils.findColAtEdgeForHeaderRow(nextRowIndex, 'end'); } } else { nextRowIndex = currentIndex + 1; nextPosition = this.headerPositionUtils.findColAtEdgeForHeaderRow(nextRowIndex, 'start'); } return this.focusService.focusHeaderPosition({ headerPosition: nextPosition, direction: direction, fromTab: true, allowUserOverride: true, event: event }); }; HeaderNavigationService.prototype.scrollToColumn = function (column, direction) { if (direction === void 0) { direction = 'After'; } if (column.getPinned()) { return; } var columnToScrollTo; if (column instanceof ColumnGroup) { var columns = column.getDisplayedLeafColumns(); columnToScrollTo = direction === 'Before' ? last(columns) : columns[0]; } else { columnToScrollTo = column; } this.gridBodyCon.getScrollFeature().ensureColumnVisible(columnToScrollTo); }; __decorate$1m([ Autowired('focusService') ], HeaderNavigationService.prototype, "focusService", void 0); __decorate$1m([ Autowired('headerPositionUtils') ], HeaderNavigationService.prototype, "headerPositionUtils", void 0); __decorate$1m([ Autowired('ctrlsService') ], HeaderNavigationService.prototype, "ctrlsService", void 0); __decorate$1m([ PostConstruct ], HeaderNavigationService.prototype, "postConstruct", null); HeaderNavigationService = __decorate$1m([ Bean('headerNavigationService') ], HeaderNavigationService); return HeaderNavigationService; }(BeanStub)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$1D = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __decorate$1n = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var GridHeaderCtrl = /** @class */ (function (_super) { __extends$1D(GridHeaderCtrl, _super); function GridHeaderCtrl() { return _super !== null && _super.apply(this, arguments) || this; } GridHeaderCtrl.prototype.setComp = function (comp, eGui, eFocusableElement) { this.comp = comp; this.eGui = eGui; this.createManagedBean(new ManagedFocusFeature(eFocusableElement, { onTabKeyDown: this.onTabKeyDown.bind(this), handleKeyDown: this.handleKeyDown.bind(this), onFocusOut: this.onFocusOut.bind(this) })); // for setting ag-pivot-on / ag-pivot-off CSS classes this.addManagedListener(this.eventService, Events.EVENT_COLUMN_PIVOT_MODE_CHANGED, this.onPivotModeChanged.bind(this)); this.addManagedListener(this.eventService, Events.EVENT_DISPLAYED_COLUMNS_CHANGED, this.onDisplayedColumnsChanged.bind(this)); this.onPivotModeChanged(); this.setupHeaderHeight(); this.ctrlsService.registerGridHeaderCtrl(this); }; GridHeaderCtrl.prototype.setupHeaderHeight = function () { var listener = this.setHeaderHeight.bind(this); listener(); this.addManagedPropertyListener('headerHeight', listener); this.addManagedPropertyListener('pivotHeaderHeight', listener); this.addManagedPropertyListener('groupHeaderHeight', listener); this.addManagedPropertyListener('pivotGroupHeaderHeight', listener); this.addManagedPropertyListener('floatingFiltersHeight', listener); this.addManagedListener(this.eventService, Events.EVENT_DISPLAYED_COLUMNS_CHANGED, listener); this.addManagedListener(this.eventService, Events.EVENT_COLUMN_HEADER_HEIGHT_CHANGED, listener); this.addManagedListener(this.eventService, Events.EVENT_GRID_STYLES_CHANGED, listener); }; GridHeaderCtrl.prototype.getHeaderHeight = function () { return this.headerHeight; }; GridHeaderCtrl.prototype.setHeaderHeight = function () { var columnModel = this.columnModel; var numberOfFloating = 0; var headerRowCount = columnModel.getHeaderRowCount(); var totalHeaderHeight; var hasFloatingFilters = columnModel.hasFloatingFilters(); if (hasFloatingFilters) { headerRowCount++; numberOfFloating = 1; } var groupHeight = this.columnModel.getColumnGroupHeaderRowHeight(); var headerHeight = this.columnModel.getColumnHeaderRowHeight(); var numberOfNonGroups = 1 + numberOfFloating; var numberOfGroups = headerRowCount - numberOfNonGroups; totalHeaderHeight = numberOfFloating * columnModel.getFloatingFiltersHeight(); totalHeaderHeight += numberOfGroups * groupHeight; totalHeaderHeight += headerHeight; if (this.headerHeight === totalHeaderHeight) { return; } this.headerHeight = totalHeaderHeight; // one extra pixel is needed here to account for the // height of the border var px = totalHeaderHeight + 1 + "px"; this.comp.setHeightAndMinHeight(px); this.eventService.dispatchEvent({ type: Events.EVENT_HEADER_HEIGHT_CHANGED }); }; GridHeaderCtrl.prototype.onPivotModeChanged = function () { var pivotMode = this.columnModel.isPivotMode(); this.comp.addOrRemoveCssClass('ag-pivot-on', pivotMode); this.comp.addOrRemoveCssClass('ag-pivot-off', !pivotMode); }; GridHeaderCtrl.prototype.onDisplayedColumnsChanged = function () { var columns = this.columnModel.getAllDisplayedColumns(); var shouldAllowOverflow = columns.some(function (col) { return col.isSpanHeaderHeight(); }); this.comp.addOrRemoveCssClass('ag-header-allow-overflow', shouldAllowOverflow); }; GridHeaderCtrl.prototype.onTabKeyDown = function (e) { var isRtl = this.gridOptionsService.is('enableRtl'); var direction = e.shiftKey !== isRtl ? exports.HeaderNavigationDirection.LEFT : exports.HeaderNavigationDirection.RIGHT; if (this.headerNavigationService.navigateHorizontally(direction, true, e) || this.focusService.focusNextGridCoreContainer(e.shiftKey)) { e.preventDefault(); } }; GridHeaderCtrl.prototype.handleKeyDown = function (e) { var direction = null; switch (e.key) { case KeyCode.LEFT: direction = exports.HeaderNavigationDirection.LEFT; case KeyCode.RIGHT: if (!exists(direction)) { direction = exports.HeaderNavigationDirection.RIGHT; } this.headerNavigationService.navigateHorizontally(direction, false, e); break; case KeyCode.UP: direction = exports.HeaderNavigationDirection.UP; case KeyCode.DOWN: if (!exists(direction)) { direction = exports.HeaderNavigationDirection.DOWN; } if (this.headerNavigationService.navigateVertically(direction, null, e)) { e.preventDefault(); } break; default: return; } }; GridHeaderCtrl.prototype.onFocusOut = function (e) { var eDocument = this.gridOptionsService.getDocument(); var relatedTarget = e.relatedTarget; if (!relatedTarget && this.eGui.contains(eDocument.activeElement)) { return; } if (!this.eGui.contains(relatedTarget)) { this.focusService.clearFocusedHeader(); } }; __decorate$1n([ Autowired('headerNavigationService') ], GridHeaderCtrl.prototype, "headerNavigationService", void 0); __decorate$1n([ Autowired('focusService') ], GridHeaderCtrl.prototype, "focusService", void 0); __decorate$1n([ Autowired('columnModel') ], GridHeaderCtrl.prototype, "columnModel", void 0); __decorate$1n([ Autowired('ctrlsService') ], GridHeaderCtrl.prototype, "ctrlsService", void 0); return GridHeaderCtrl; }(BeanStub)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$1E = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __decorate$1o = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var GridHeaderComp = /** @class */ (function (_super) { __extends$1E(GridHeaderComp, _super); function GridHeaderComp() { return _super.call(this, GridHeaderComp.TEMPLATE) || this; } GridHeaderComp.prototype.postConstruct = function () { var _this = this; var compProxy = { addOrRemoveCssClass: function (cssClassName, on) { return _this.addOrRemoveCssClass(cssClassName, on); }, setHeightAndMinHeight: function (height) { _this.getGui().style.height = height; _this.getGui().style.minHeight = height; } }; var ctrl = this.createManagedBean(new GridHeaderCtrl()); ctrl.setComp(compProxy, this.getGui(), this.getFocusableElement()); var addContainer = function (container) { _this.createManagedBean(container); _this.appendChild(container); }; addContainer(new HeaderRowContainerComp('left')); addContainer(new HeaderRowContainerComp(null)); addContainer(new HeaderRowContainerComp('right')); }; GridHeaderComp.TEMPLATE = "
"; __decorate$1o([ PostConstruct ], GridHeaderComp.prototype, "postConstruct", null); return GridHeaderComp; }(Component)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$1F = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __decorate$1p = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var HorizontalResizeService = /** @class */ (function (_super) { __extends$1F(HorizontalResizeService, _super); function HorizontalResizeService() { return _super !== null && _super.apply(this, arguments) || this; } HorizontalResizeService.prototype.addResizeBar = function (params) { var _this = this; var dragSource = { dragStartPixels: params.dragStartPixels || 0, eElement: params.eResizeBar, onDragStart: this.onDragStart.bind(this, params), onDragStop: this.onDragStop.bind(this, params), onDragging: this.onDragging.bind(this, params) }; this.dragService.addDragSource(dragSource, true); // we pass remove func back to the caller, so call can tell us when they // are finished, and then we remove the listener from the drag source var finishedWithResizeFunc = function () { return _this.dragService.removeDragSource(dragSource); }; return finishedWithResizeFunc; }; HorizontalResizeService.prototype.onDragStart = function (params, mouseEvent) { this.dragStartX = mouseEvent.clientX; this.setResizeIcons(); var shiftKey = mouseEvent instanceof MouseEvent && mouseEvent.shiftKey === true; params.onResizeStart(shiftKey); }; HorizontalResizeService.prototype.setResizeIcons = function () { var ctrl = this.ctrlsService.getGridCtrl(); // change the body cursor, so when drag moves out of the drag bar, the cursor is still 'resize' (or 'move' ctrl.setResizeCursor(true); // we don't want text selection outside the grid (otherwise it looks weird as text highlights when we move) ctrl.disableUserSelect(true); }; HorizontalResizeService.prototype.onDragStop = function (params, mouseEvent) { params.onResizeEnd(this.resizeAmount); this.resetIcons(); }; HorizontalResizeService.prototype.resetIcons = function () { var ctrl = this.ctrlsService.getGridCtrl(); ctrl.setResizeCursor(false); ctrl.disableUserSelect(false); }; HorizontalResizeService.prototype.onDragging = function (params, mouseEvent) { this.resizeAmount = mouseEvent.clientX - this.dragStartX; params.onResizing(this.resizeAmount); }; __decorate$1p([ Autowired('dragService') ], HorizontalResizeService.prototype, "dragService", void 0); __decorate$1p([ Autowired('ctrlsService') ], HorizontalResizeService.prototype, "ctrlsService", void 0); HorizontalResizeService = __decorate$1p([ Bean('horizontalResizeService') ], HorizontalResizeService); return HorizontalResizeService; }(BeanStub)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$1G = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __decorate$1q = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var StandardMenuFactory = /** @class */ (function (_super) { __extends$1G(StandardMenuFactory, _super); function StandardMenuFactory() { return _super !== null && _super.apply(this, arguments) || this; } StandardMenuFactory.prototype.hideActiveMenu = function () { if (this.hidePopup) { this.hidePopup(); } }; StandardMenuFactory.prototype.showMenuAfterMouseEvent = function (column, mouseEvent) { var _this = this; this.showPopup(column, function (eMenu) { _this.popupService.positionPopupUnderMouseEvent({ column: column, type: 'columnMenu', mouseEvent: mouseEvent, ePopup: eMenu }); }, 'columnMenu', mouseEvent.target); }; StandardMenuFactory.prototype.showMenuAfterButtonClick = function (column, eventSource, containerType) { var _this = this; this.showPopup(column, function (eMenu) { _this.popupService.positionPopupByComponent({ type: containerType, eventSource: eventSource, ePopup: eMenu, keepWithinBounds: true, position: 'under', column: column, shouldSetMaxHeight: true }); }, containerType, eventSource); }; StandardMenuFactory.prototype.showPopup = function (column, positionCallback, containerType, eventSource) { var _this = this; var filterWrapper = this.filterManager.getOrCreateFilterWrapper(column, 'COLUMN_MENU'); if (!filterWrapper) { throw new Error('AG Grid - unable to show popup filter, filter instantiation failed'); } var eMenu = document.createElement('div'); setAriaRole(eMenu, 'presentation'); eMenu.classList.add('ag-menu'); this.tabListener = this.addManagedListener(eMenu, 'keydown', function (e) { return _this.trapFocusWithin(e, eMenu); }); filterWrapper.guiPromise.then(function (gui) { return eMenu.appendChild(gui); }); var hidePopup; var afterGuiDetached = function () { var _a; return (_a = filterWrapper.filterPromise) === null || _a === void 0 ? void 0 : _a.then(function (filter) { var _a; return (_a = filter === null || filter === void 0 ? void 0 : filter.afterGuiDetached) === null || _a === void 0 ? void 0 : _a.call(filter); }); }; var anchorToElement = eventSource || this.ctrlsService.getGridBodyCtrl().getGui(); var closedCallback = function (e) { column.setMenuVisible(false, 'contextMenu'); var isKeyboardEvent = e instanceof KeyboardEvent; if (_this.tabListener) { _this.tabListener = _this.tabListener(); } if (isKeyboardEvent && eventSource && isVisible(eventSource)) { var focusableEl = _this.focusService.findTabbableParent(eventSource); if (focusableEl) { focusableEl.focus(); } } afterGuiDetached(); }; var translate = this.localeService.getLocaleTextFunc(); var addPopupRes = this.popupService.addPopup({ modal: true, eChild: eMenu, closeOnEsc: true, closedCallback: closedCallback, positionCallback: function () { return positionCallback(eMenu); }, anchorToElement: anchorToElement, ariaLabel: translate('ariaLabelColumnMenu', 'Column Menu') }); if (addPopupRes) { this.hidePopup = hidePopup = addPopupRes.hideFunc; } filterWrapper.filterPromise.then(function (filter) { // need to make sure the filter is present before positioning, as only // after filter it is visible can we find out what the width of it is positionCallback(eMenu); if (filter.afterGuiAttached) { filter.afterGuiAttached({ container: containerType, hidePopup: hidePopup }); } }); column.setMenuVisible(true, 'contextMenu'); }; StandardMenuFactory.prototype.trapFocusWithin = function (e, menu) { if (e.key !== KeyCode.TAB || e.defaultPrevented || this.focusService.findNextFocusableElement(menu, false, e.shiftKey)) { return; } e.preventDefault(); this.focusService.focusInto(menu, e.shiftKey); }; StandardMenuFactory.prototype.isMenuEnabled = function (column) { // for standard, we show menu if filter is enabled, and the menu is not suppressed return column.isFilterAllowed(); }; __decorate$1q([ Autowired('filterManager') ], StandardMenuFactory.prototype, "filterManager", void 0); __decorate$1q([ Autowired('popupService') ], StandardMenuFactory.prototype, "popupService", void 0); __decorate$1q([ Autowired('focusService') ], StandardMenuFactory.prototype, "focusService", void 0); __decorate$1q([ Autowired('ctrlsService') ], StandardMenuFactory.prototype, "ctrlsService", void 0); StandardMenuFactory = __decorate$1q([ Bean('menuFactory') ], StandardMenuFactory); return StandardMenuFactory; }(BeanStub)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$1H = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __decorate$1r = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var TabbedLayout = /** @class */ (function (_super) { __extends$1H(TabbedLayout, _super); function TabbedLayout(params) { var _this = _super.call(this, TabbedLayout.getTemplate(params.cssClass)) || this; _this.items = []; _this.tabbedItemScrollMap = new Map(); _this.params = params; if (params.items) { params.items.forEach(function (item) { return _this.addItem(item); }); } return _this; } TabbedLayout.prototype.postConstruct = function () { var _this = this; this.createManagedBean(new ManagedFocusFeature(this.getFocusableElement(), { onTabKeyDown: this.onTabKeyDown.bind(this), handleKeyDown: this.handleKeyDown.bind(this) })); this.addDestroyFunc(function () { var _a, _b, _c; return (_c = (_b = (_a = _this.activeItem) === null || _a === void 0 ? void 0 : _a.tabbedItem) === null || _b === void 0 ? void 0 : _b.afterDetachedCallback) === null || _c === void 0 ? void 0 : _c.call(_b); }); }; TabbedLayout.getTemplate = function (cssClass) { return /* html */ "
\n
\n
\n
"; }; TabbedLayout.prototype.handleKeyDown = function (e) { var eDocument = this.gridOptionsService.getDocument(); switch (e.key) { case KeyCode.RIGHT: case KeyCode.LEFT: if (!this.eHeader.contains(eDocument.activeElement)) { return; } var isRightKey = e.key === KeyCode.RIGHT; var isRtl = this.gridOptionsService.is('enableRtl'); var currentPosition = this.items.indexOf(this.activeItem); var nextPosition = isRightKey !== isRtl ? Math.min(currentPosition + 1, this.items.length - 1) : Math.max(currentPosition - 1, 0); if (currentPosition === nextPosition) { return; } e.preventDefault(); var nextItem = this.items[nextPosition]; this.showItemWrapper(nextItem); nextItem.eHeaderButton.focus(); break; case KeyCode.UP: case KeyCode.DOWN: e.stopPropagation(); break; } }; TabbedLayout.prototype.onTabKeyDown = function (e) { if (e.defaultPrevented) { return; } var _a = this, focusService = _a.focusService, eHeader = _a.eHeader, eBody = _a.eBody, activeItem = _a.activeItem; var eDocument = this.gridOptionsService.getDocument(); var activeElement = eDocument.activeElement; var target = e.target; e.preventDefault(); if (eHeader.contains(activeElement)) { // focus is in header, move into body of popup focusService.focusInto(eBody, e.shiftKey); return; } var nextEl = null; if (focusService.isTargetUnderManagedComponent(eBody, target)) { if (e.shiftKey) { nextEl = this.focusService.findFocusableElementBeforeTabGuard(eBody, target); } if (!nextEl) { nextEl = activeItem.eHeaderButton; } } if (!nextEl && eBody.contains(activeElement)) { nextEl = focusService.findNextFocusableElement(eBody, false, e.shiftKey); if (!nextEl) { nextEl = activeItem.eHeaderButton; } } if (nextEl) { nextEl.focus(); } }; TabbedLayout.prototype.setAfterAttachedParams = function (params) { this.afterAttachedParams = params; }; TabbedLayout.prototype.showFirstItem = function () { if (this.items.length > 0) { this.showItemWrapper(this.items[0]); } }; TabbedLayout.prototype.addItem = function (item) { var eHeaderButton = document.createElement('span'); setAriaRole(eHeaderButton, 'tab'); eHeaderButton.setAttribute('tabIndex', '-1'); eHeaderButton.appendChild(item.title); eHeaderButton.classList.add('ag-tab'); this.eHeader.appendChild(eHeaderButton); setAriaLabel(eHeaderButton, item.titleLabel); var wrapper = { tabbedItem: item, eHeaderButton: eHeaderButton }; this.items.push(wrapper); eHeaderButton.addEventListener('click', this.showItemWrapper.bind(this, wrapper)); }; TabbedLayout.prototype.showItem = function (tabbedItem) { var itemWrapper = this.items.find(function (wrapper) { return wrapper.tabbedItem === tabbedItem; }); if (itemWrapper) { this.showItemWrapper(itemWrapper); } }; TabbedLayout.prototype.showItemWrapper = function (wrapper) { var _this = this; var _a, _b; var tabbedItem = wrapper.tabbedItem, eHeaderButton = wrapper.eHeaderButton; if (this.params.onItemClicked) { this.params.onItemClicked({ item: tabbedItem }); } if (this.activeItem === wrapper) { callIfPresent(this.params.onActiveItemClicked); return; } if (this.lastScrollListener) { this.lastScrollListener = this.lastScrollListener(); } clearElement(this.eBody); tabbedItem.bodyPromise.then(function (body) { _this.eBody.appendChild(body); var onlyUnmanaged = !_this.focusService.isKeyboardMode(); _this.focusService.focusInto(_this.eBody, false, onlyUnmanaged); if (tabbedItem.afterAttachedCallback) { tabbedItem.afterAttachedCallback(_this.afterAttachedParams); } if (_this.params.keepScrollPosition) { var scrollableContainer_1 = (tabbedItem.getScrollableContainer && tabbedItem.getScrollableContainer()) || body; _this.lastScrollListener = _this.addManagedListener(scrollableContainer_1, 'scroll', function () { _this.tabbedItemScrollMap.set(tabbedItem.name, scrollableContainer_1.scrollTop); }); var scrollPosition_1 = _this.tabbedItemScrollMap.get(tabbedItem.name); if (scrollPosition_1 !== undefined) { // Safari needs a small timeout or it will fire a scroll event to position 0 setTimeout(function () { scrollableContainer_1.scrollTop = scrollPosition_1; }, 0); } } }); if (this.activeItem) { this.activeItem.eHeaderButton.classList.remove('ag-tab-selected'); (_b = (_a = this.activeItem.tabbedItem).afterDetachedCallback) === null || _b === void 0 ? void 0 : _b.call(_a); } eHeaderButton.classList.add('ag-tab-selected'); this.activeItem = wrapper; }; __decorate$1r([ Autowired('focusService') ], TabbedLayout.prototype, "focusService", void 0); __decorate$1r([ RefSelector('eHeader') ], TabbedLayout.prototype, "eHeader", void 0); __decorate$1r([ RefSelector('eBody') ], TabbedLayout.prototype, "eBody", void 0); __decorate$1r([ PostConstruct ], TabbedLayout.prototype, "postConstruct", null); return TabbedLayout; }(Component)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ /** * @deprecated Since v29 simpleHttpRequest has been deprecated as it was only meant for use in internal AG Grid documentation examples. Please use the browser fetch api directly. */ function simpleHttpRequest(params) { doOnce(function () { return console.warn("AG Grid: Since v29 simpleHttpRequest has been deprecated as it was only meant for use in internal AG Grid documentation examples. Please use the browser fetch api directly."); }, 'simpleHttpRequest'); return new AgPromise(function (resolve) { var httpRequest = new XMLHttpRequest(); httpRequest.open('GET', params.url); httpRequest.send(); httpRequest.onreadystatechange = function () { if (httpRequest.readyState === 4 && httpRequest.status === 200) { resolve(JSON.parse(httpRequest.responseText)); } }; }); } /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$1I = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __decorate$1s = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var DEBOUNCE_DELAY = 50; var ResizeObserverService = /** @class */ (function (_super) { __extends$1I(ResizeObserverService, _super); function ResizeObserverService() { var _this = _super !== null && _super.apply(this, arguments) || this; _this.polyfillFunctions = []; return _this; } ResizeObserverService.prototype.observeResize = function (element, callback) { var _this = this; var eDocument = this.gridOptionsService.getDocument(); var win = (eDocument.defaultView || window); // this gets fired too often and might cause some relayout issues // so we add a debounce to the callback here to avoid the flashing effect. var debouncedCallback = debounce(callback, DEBOUNCE_DELAY); var useBrowserResizeObserver = function () { var resizeObserver = new win.ResizeObserver(debouncedCallback); resizeObserver.observe(element); return function () { return resizeObserver.disconnect(); }; }; var usePolyfill = function () { // initialise to the current width and height, so first call will have no changes var widthLastTime = offsetWidth(element); var heightLastTime = offsetHeight(element); // when finished, this gets turned to false. var running = true; var periodicallyCheckWidthAndHeight = function () { if (running) { var newWidth = offsetWidth(element); var newHeight = offsetHeight(element); var changed = newWidth !== widthLastTime || newHeight !== heightLastTime; if (changed) { widthLastTime = newWidth; heightLastTime = newHeight; callback(); } _this.doNextPolyfillTurn(periodicallyCheckWidthAndHeight); } }; periodicallyCheckWidthAndHeight(); // the callback function we return sets running to false return function () { return running = false; }; }; var suppressResize = this.gridOptionsService.is('suppressBrowserResizeObserver'); var resizeObserverExists = !!win.ResizeObserver; if (resizeObserverExists && !suppressResize) { return useBrowserResizeObserver(); } return usePolyfill(); }; ResizeObserverService.prototype.doNextPolyfillTurn = function (func) { this.polyfillFunctions.push(func); this.schedulePolyfill(); }; ResizeObserverService.prototype.schedulePolyfill = function () { var _this = this; if (this.polyfillScheduled) { return; } var executeAllFuncs = function () { var funcs = _this.polyfillFunctions; // make sure set scheduled to false and clear clear array // before executing the funcs, as the funcs could add more funcs _this.polyfillScheduled = false; _this.polyfillFunctions = []; funcs.forEach(function (f) { return f(); }); }; this.polyfillScheduled = true; this.getFrameworkOverrides().setTimeout(executeAllFuncs, DEBOUNCE_DELAY); }; ResizeObserverService = __decorate$1s([ Bean('resizeObserverService') ], ResizeObserverService); return ResizeObserverService; }(BeanStub)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$1J = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __decorate$1t = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var AnimationFrameService = /** @class */ (function (_super) { __extends$1J(AnimationFrameService, _super); function AnimationFrameService() { var _this = _super !== null && _super.apply(this, arguments) || this; // p1 and p2 are create tasks are to do with row and cell creation. // for them we want to execute according to row order, so we use // TaskItem so we know what index the item is for. _this.createTasksP1 = { list: [], sorted: false }; // eg drawing back-ground of rows _this.createTasksP2 = { list: [], sorted: false }; // eg cell renderers, adding hover functionality // destroy tasks are to do with row removal. they are done after row creation as the user will need to see new // rows first (as blank is scrolled into view), when we remove the old rows (no longer in view) is not as // important. _this.destroyTasks = []; _this.ticking = false; // we need to know direction of scroll, to build up rows in the direction of // the scroll. eg if user scrolls down, we extend the rows by building down. _this.scrollGoingDown = true; _this.lastPage = 0; _this.lastScrollTop = 0; _this.taskCount = 0; _this.cancelledTasks = new Set(); return _this; } AnimationFrameService.prototype.setScrollTop = function (scrollTop) { var isPaginationActive = this.gridOptionsService.is('pagination'); this.scrollGoingDown = scrollTop >= this.lastScrollTop; if (isPaginationActive && scrollTop === 0) { var currentPage = this.paginationProxy.getCurrentPage(); if (currentPage !== this.lastPage) { this.lastPage = currentPage; this.scrollGoingDown = true; } } this.lastScrollTop = scrollTop; }; AnimationFrameService.prototype.init = function () { this.useAnimationFrame = !this.gridOptionsService.is('suppressAnimationFrame'); }; AnimationFrameService.prototype.isOn = function () { return this.useAnimationFrame; }; // this method is for our AG Grid sanity only - if animation frames are turned off, // then no place in the code should be looking to add any work to be done in animation // frames. this stops bugs - where some code is asking for a frame to be executed // when it should not. AnimationFrameService.prototype.verifyAnimationFrameOn = function (methodName) { if (this.useAnimationFrame === false) { console.warn("AG Grid: AnimationFrameService." + methodName + " called but animation frames are off"); } }; AnimationFrameService.prototype.createTask = function (task, index, list) { this.verifyAnimationFrameOn(list); var taskItem = { task: task, index: index, createOrder: ++this.taskCount }; this.addTaskToList(this[list], taskItem); this.schedule(); }; AnimationFrameService.prototype.cancelTask = function (task) { this.cancelledTasks.add(task); }; AnimationFrameService.prototype.addTaskToList = function (taskList, task) { taskList.list.push(task); taskList.sorted = false; }; AnimationFrameService.prototype.sortTaskList = function (taskList) { if (taskList.sorted) { return; } var sortDirection = this.scrollGoingDown ? 1 : -1; // sort first by row index (taking into account scroll direction), then by // order of task creation (always ascending, so cells will render left-to-right) taskList.list.sort(function (a, b) { return a.index !== b.index ? sortDirection * (b.index - a.index) : b.createOrder - a.createOrder; }); taskList.sorted = true; }; AnimationFrameService.prototype.addDestroyTask = function (task) { this.verifyAnimationFrameOn('createTasksP3'); this.destroyTasks.push(task); this.schedule(); }; AnimationFrameService.prototype.executeFrame = function (millis) { this.verifyAnimationFrameOn('executeFrame'); var p1TaskList = this.createTasksP1; var p1Tasks = p1TaskList.list; var p2TaskList = this.createTasksP2; var p2Tasks = p2TaskList.list; var destroyTasks = this.destroyTasks; var frameStart = new Date().getTime(); var duration = (new Date().getTime()) - frameStart; // 16ms is 60 fps var noMaxMillis = millis <= 0; var gridBodyCon = this.ctrlsService.getGridBodyCtrl(); while (noMaxMillis || duration < millis) { var gridBodyDidSomething = gridBodyCon.getScrollFeature().scrollGridIfNeeded(); if (!gridBodyDidSomething) { var task = void 0; if (p1Tasks.length) { this.sortTaskList(p1TaskList); task = p1Tasks.pop().task; } else if (p2Tasks.length) { this.sortTaskList(p2TaskList); task = p2Tasks.pop().task; } else if (destroyTasks.length) { task = destroyTasks.pop(); } else { this.cancelledTasks.clear(); break; } if (!this.cancelledTasks.has(task)) { task(); } } duration = (new Date().getTime()) - frameStart; } if (p1Tasks.length || p2Tasks.length || destroyTasks.length) { this.requestFrame(); } else { this.stopTicking(); } }; AnimationFrameService.prototype.stopTicking = function () { this.ticking = false; }; AnimationFrameService.prototype.flushAllFrames = function () { if (!this.useAnimationFrame) { return; } this.executeFrame(-1); }; AnimationFrameService.prototype.schedule = function () { if (!this.useAnimationFrame) { return; } if (!this.ticking) { this.ticking = true; this.requestFrame(); } }; AnimationFrameService.prototype.requestFrame = function () { // check for the existence of requestAnimationFrame, and if // it's missing, then we polyfill it with setTimeout() var callback = this.executeFrame.bind(this, 60); var eDocument = this.gridOptionsService.getDocument(); var win = (eDocument.defaultView || window); if (win.requestAnimationFrame) { win.requestAnimationFrame(callback); } else if (win.webkitRequestAnimationFrame) { win.webkitRequestAnimationFrame(callback); } else { win.setTimeout(callback, 0); } }; AnimationFrameService.prototype.isQueueEmpty = function () { return !this.ticking; }; // a debounce utility used for parts of the app involved with rendering. // the advantage over normal debounce is the client can call flushAllFrames() // to make sure all rendering is complete. we don't wait any milliseconds, // as this is intended to batch calls in one VM turn. AnimationFrameService.prototype.debounce = function (func) { var _this = this; var pending = false; return function () { if (!_this.isOn()) { _this.getFrameworkOverrides().setTimeout(func, 0); return; } if (pending) { return; } pending = true; _this.addDestroyTask(function () { pending = false; func(); }); }; }; __decorate$1t([ Autowired('ctrlsService') ], AnimationFrameService.prototype, "ctrlsService", void 0); __decorate$1t([ Autowired('paginationProxy') ], AnimationFrameService.prototype, "paginationProxy", void 0); __decorate$1t([ PostConstruct ], AnimationFrameService.prototype, "init", null); AnimationFrameService = __decorate$1t([ Bean('animationFrameService') ], AnimationFrameService); return AnimationFrameService; }(BeanStub)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$1K = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __decorate$1u = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var AutoWidthCalculator = /** @class */ (function (_super) { __extends$1K(AutoWidthCalculator, _super); function AutoWidthCalculator() { return _super !== null && _super.apply(this, arguments) || this; } AutoWidthCalculator.prototype.postConstruct = function () { var _this = this; this.ctrlsService.whenReady(function (p) { _this.centerRowContainerCtrl = p.centerRowContainerCtrl; }); }; // this is the trick: we create a dummy container and clone all the cells // into the dummy, then check the dummy's width. then destroy the dummy // as we don't need it any more. // drawback: only the cells visible on the screen are considered AutoWidthCalculator.prototype.getPreferredWidthForColumn = function (column, skipHeader) { var eHeaderCell = this.getHeaderCellForColumn(column); // cell isn't visible if (!eHeaderCell) { return -1; } var elements = this.rowRenderer.getAllCellsForColumn(column); if (!skipHeader) { // we only consider the lowest level cell, not the group cell. in 99% of the time, this // will be enough. if we consider groups, then it gets too complicated for what it's worth, // as the groups can span columns and this class only considers one column at a time. elements.push(eHeaderCell); } return this.addElementsToContainerAndGetWidth(elements); }; AutoWidthCalculator.prototype.getPreferredWidthForColumnGroup = function (columnGroup) { var eHeaderCell = this.getHeaderCellForColumn(columnGroup); if (!eHeaderCell) { return -1; } return this.addElementsToContainerAndGetWidth([eHeaderCell]); }; AutoWidthCalculator.prototype.addElementsToContainerAndGetWidth = function (elements) { var _this = this; // this element has to be a form, otherwise form elements within a cell // will be validated while being cloned. This can cause issues such as // radio buttons being reset and losing their values. var eDummyContainer = document.createElement('form'); // position fixed, so it isn't restricted to the boundaries of the parent eDummyContainer.style.position = 'fixed'; // we put the dummy into the body container, so it will inherit all the // css styles that the real cells are inheriting var eBodyContainer = this.centerRowContainerCtrl.getContainerElement(); eBodyContainer.appendChild(eDummyContainer); elements.forEach(function (el) { return _this.cloneItemIntoDummy(el, eDummyContainer); }); // at this point, all the clones are lined up vertically with natural widths. the dummy // container will have a width wide enough just to fit the largest. var dummyContainerWidth = eDummyContainer.offsetWidth; // we are finished with the dummy container, so get rid of it eBodyContainer.removeChild(eDummyContainer); // we add padding as I found sometimes the gui still put '...' after some of the texts. so the // user can configure the grid to add a few more pixels after the calculated width var autoSizePadding = this.getAutoSizePadding(); return dummyContainerWidth + autoSizePadding; }; AutoWidthCalculator.prototype.getAutoSizePadding = function () { var value = this.gridOptionsService.getNum('autoSizePadding'); return value != null && value >= 0 ? value : 20; }; AutoWidthCalculator.prototype.getHeaderCellForColumn = function (column) { /* tslint:enable */ var element = null; this.ctrlsService.getHeaderRowContainerCtrls().forEach(function (container) { var res = container.getHtmlElementForColumnHeader(column); if (res != null) { element = res; } }); return element; }; AutoWidthCalculator.prototype.cloneItemIntoDummy = function (eCell, eDummyContainer) { // make a deep clone of the cell var eCellClone = eCell.cloneNode(true); // the original has a fixed width, we remove this to allow the natural width based on content eCellClone.style.width = ''; // the original has position = absolute, we need to remove this so it's positioned normally eCellClone.style.position = 'static'; eCellClone.style.left = ''; // we put the cell into a containing div, as otherwise the cells would just line up // on the same line, standard flow layout, by putting them into divs, they are laid // out one per line var eCloneParent = document.createElement('div'); var eCloneParentClassList = eCloneParent.classList; var isHeader = ['ag-header-cell', 'ag-header-group-cell'].some(function (cls) { return eCellClone.classList.contains(cls); }); if (isHeader) { eCloneParentClassList.add('ag-header', 'ag-header-row'); eCloneParent.style.position = 'static'; } else { eCloneParentClassList.add('ag-row'); } // find parent using classes (headers have ag-header-cell, rows have ag-row), and copy classes from it. // if we didn't do this, things like ag-row-level-2 would be missing if present, which sets indents // onto group items. var pointer = eCell.parentElement; while (pointer) { var isRow = ['ag-header-row', 'ag-row'].some(function (cls) { return pointer.classList.contains(cls); }); if (isRow) { for (var i = 0; i < pointer.classList.length; i++) { var item = pointer.classList[i]; // we skip ag-row-position-absolute, as this has structural CSS applied that stops the // element from fitting into it's parent, and we need the element to stretch the parent // as we are measuring the parents width if (item != 'ag-row-position-absolute') { eCloneParentClassList.add(item); } } break; } pointer = pointer.parentElement; } // the twig on the branch, the branch on the tree, the tree in the hole, // the hole in the bog, the bog in the clone, the clone in the parent, // the parent in the dummy, and the dummy down in the vall-e-ooo, OOOOOOOOO! Oh row the rattling bog.... eCloneParent.appendChild(eCellClone); eDummyContainer.appendChild(eCloneParent); }; __decorate$1u([ Autowired('rowRenderer') ], AutoWidthCalculator.prototype, "rowRenderer", void 0); __decorate$1u([ Autowired('ctrlsService') ], AutoWidthCalculator.prototype, "ctrlsService", void 0); __decorate$1u([ Autowired('rowCssClassCalculator') ], AutoWidthCalculator.prototype, "rowCssClassCalculator", void 0); __decorate$1u([ PostConstruct ], AutoWidthCalculator.prototype, "postConstruct", null); AutoWidthCalculator = __decorate$1u([ Bean('autoWidthCalculator') ], AutoWidthCalculator); return AutoWidthCalculator; }(BeanStub)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$1L = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __decorate$1v = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var __values$4 = (undefined && undefined.__values) || function(o) { var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; if (m) return m.call(o); if (o && typeof o.length === "number") return { next: function () { if (o && i >= o.length) o = void 0; return { value: o && o[i++], done: !o }; } }; throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); }; var __read$h = (undefined && undefined.__read) || function (o, n) { var m = typeof Symbol === "function" && o[Symbol.iterator]; if (!m) return o; var i = m.call(o), r, ar = [], e; try { while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); } catch (error) { e = { error: error }; } finally { try { if (r && !r.done && (m = i["return"])) m.call(i); } finally { if (e) throw e.error; } } return ar; }; var __spread$c = (undefined && undefined.__spread) || function () { for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read$h(arguments[i])); return ar; }; var StickyRowFeature = /** @class */ (function (_super) { __extends$1L(StickyRowFeature, _super); function StickyRowFeature(createRowCon, destroyRowCtrls) { var _this = _super.call(this) || this; _this.createRowCon = createRowCon; _this.destroyRowCtrls = destroyRowCtrls; _this.stickyRowCtrls = []; _this.containerHeight = 0; return _this; } StickyRowFeature.prototype.postConstruct = function () { var _this = this; this.ctrlsService.whenReady(function (params) { _this.gridBodyCtrl = params.gridBodyCtrl; }); }; StickyRowFeature.prototype.getStickyRowCtrls = function () { return this.stickyRowCtrls; }; StickyRowFeature.prototype.checkStickyRows = function () { var height = 0; if (!this.gridOptionsService.is('groupRowsSticky')) { this.refreshNodesAndContainerHeight([], height); return; } var stickyRows = []; var firstPixel = this.rowRenderer.getFirstVisibleVerticalPixel(); var addStickyRow = function (stickyRow) { stickyRows.push(stickyRow); var lastAncester = stickyRow; while (lastAncester.expanded) { lastAncester = last(lastAncester.childrenAfterSort); } var lastChildBottom = lastAncester.rowTop + lastAncester.rowHeight; var stickRowBottom = firstPixel + height + stickyRow.rowHeight; if (lastChildBottom < stickRowBottom) { stickyRow.stickyRowTop = height + (lastChildBottom - stickRowBottom); } else { stickyRow.stickyRowTop = height; } height = 0; stickyRows.forEach(function (rowNode) { var thisRowLastPx = rowNode.stickyRowTop + rowNode.rowHeight; if (height < thisRowLastPx) { height = thisRowLastPx; } }); }; while (true) { var firstPixelAfterStickyRows = firstPixel + height; var firstIndex = this.rowModel.getRowIndexAtPixel(firstPixelAfterStickyRows); var firstRow = this.rowModel.getRow(firstIndex); if (firstRow == null) { break; } // only happens when pivoting, and we are showing root node if (firstRow.level < 0) { break; } var parents = []; var p = firstRow.parent; while (p.level >= 0) { parents.push(p); p = p.parent; } var firstMissingParent = parents.reverse().find(function (parent) { return stickyRows.indexOf(parent) < 0 && parent.displayed; }); if (firstMissingParent) { addStickyRow(firstMissingParent); continue; } // if first row is an open group, and practically shown, it needs // to be stuck if (firstRow.group && firstRow.expanded && !firstRow.footer && firstRow.rowTop < firstPixelAfterStickyRows) { addStickyRow(firstRow); continue; } break; } this.refreshNodesAndContainerHeight(stickyRows, height); }; StickyRowFeature.prototype.refreshNodesAndContainerHeight = function (allStickyNodes, height) { var e_1, _a, _b; var _this = this; var removedCtrls = this.stickyRowCtrls.filter(function (ctrl) { return allStickyNodes.indexOf(ctrl.getRowNode()) === -1; }); var addedNodes = allStickyNodes.filter(function (rowNode) { return _this.stickyRowCtrls.findIndex(function (ctrl) { return ctrl.getRowNode() === rowNode; }) === -1; }); var ctrlsToDestroy = {}; removedCtrls.forEach(function (removedCtrl) { ctrlsToDestroy[removedCtrl.getRowNode().id] = removedCtrl; _this.stickyRowCtrls = _this.stickyRowCtrls.filter(function (ctrl) { return ctrl !== removedCtrl; }); }); try { for (var _c = __values$4(Object.values(ctrlsToDestroy)), _d = _c.next(); !_d.done; _d = _c.next()) { var ctrl = _d.value; ctrl.getRowNode().sticky = false; } } catch (e_1_1) { e_1 = { error: e_1_1 }; } finally { try { if (_d && !_d.done && (_a = _c.return)) _a.call(_c); } finally { if (e_1) throw e_1.error; } } this.destroyRowCtrls(ctrlsToDestroy, false); var newCtrls = addedNodes.map(function (rowNode) { rowNode.sticky = true; return _this.createRowCon(rowNode, false, false); }); (_b = this.stickyRowCtrls).push.apply(_b, __spread$c(newCtrls)); this.stickyRowCtrls.forEach(function (ctrl) { return ctrl.setRowTop(ctrl.getRowNode().stickyRowTop); }); this.stickyRowCtrls.sort(function (a, b) { return b.getRowNode().rowIndex - a.getRowNode().rowIndex; }); if (this.containerHeight !== height) { this.containerHeight = height; this.gridBodyCtrl.setStickyTopHeight(height); } }; __decorate$1v([ Autowired("rowModel") ], StickyRowFeature.prototype, "rowModel", void 0); __decorate$1v([ Autowired("rowRenderer") ], StickyRowFeature.prototype, "rowRenderer", void 0); __decorate$1v([ Autowired("ctrlsService") ], StickyRowFeature.prototype, "ctrlsService", void 0); __decorate$1v([ PostConstruct ], StickyRowFeature.prototype, "postConstruct", null); return StickyRowFeature; }(BeanStub)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$1M = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __decorate$1w = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var __read$i = (undefined && undefined.__read) || function (o, n) { var m = typeof Symbol === "function" && o[Symbol.iterator]; if (!m) return o; var i = m.call(o), r, ar = [], e; try { while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); } catch (error) { e = { error: error }; } finally { try { if (r && !r.done && (m = i["return"])) m.call(i); } finally { if (e) throw e.error; } } return ar; }; var __spread$d = (undefined && undefined.__spread) || function () { for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read$i(arguments[i])); return ar; }; var __values$5 = (undefined && undefined.__values) || function(o) { var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; if (m) return m.call(o); if (o && typeof o.length === "number") return { next: function () { if (o && i >= o.length) o = void 0; return { value: o && o[i++], done: !o }; } }; throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); }; var DEFAULT_KEEP_DETAIL_ROW_COUNT = 10; var RowRenderer = /** @class */ (function (_super) { __extends$1M(RowRenderer, _super); function RowRenderer() { var _this = _super !== null && _super.apply(this, arguments) || this; _this.destroyFuncsForColumnListeners = []; // map of row ids to row objects. keeps track of which elements // are rendered for which rows in the dom. _this.rowCtrlsByRowIndex = {}; _this.zombieRowCtrls = {}; _this.allRowCtrls = []; _this.topRowCtrls = []; _this.bottomRowCtrls = []; // we only allow one refresh at a time, otherwise the internal memory structure here // will get messed up. this can happen if the user has a cellRenderer, and inside the // renderer they call an API method that results in another pass of the refresh, // then it will be trying to draw rows in the middle of a refresh. _this.refreshInProgress = false; _this.dataFirstRenderedFired = false; return _this; } RowRenderer.prototype.postConstruct = function () { var _this = this; this.ctrlsService.whenReady(function () { _this.gridBodyCtrl = _this.ctrlsService.getGridBodyCtrl(); _this.initialise(); }); }; RowRenderer.prototype.initialise = function () { this.addManagedListener(this.eventService, Events.EVENT_PAGINATION_CHANGED, this.onPageLoaded.bind(this)); this.addManagedListener(this.eventService, Events.EVENT_PINNED_ROW_DATA_CHANGED, this.onPinnedRowDataChanged.bind(this)); this.addManagedListener(this.eventService, Events.EVENT_DISPLAYED_COLUMNS_CHANGED, this.onDisplayedColumnsChanged.bind(this)); this.addManagedListener(this.eventService, Events.EVENT_BODY_SCROLL, this.onBodyScroll.bind(this)); this.addManagedListener(this.eventService, Events.EVENT_BODY_HEIGHT_CHANGED, this.redrawAfterScroll.bind(this)); this.addManagedPropertyListener('domLayout', this.onDomLayoutChanged.bind(this)); this.addManagedPropertyListener('rowClass', this.redrawRows.bind(this)); if (this.gridOptionsService.is('groupRowsSticky')) { if (this.rowModel.getType() != 'clientSide') { doOnce(function () { return console.warn('AG Grid: The feature Sticky Row Groups only works with the Client Side Row Model'); }, 'rowRenderer.stickyWorksWithCsrmOnly'); } else if (this.gridOptionsService.isTreeData()) { doOnce(function () { return console.warn('AG Grid: The feature Sticky Row Groups does not work with Tree Data.'); }, 'rowRenderer.stickyDoesNotWorkWithTreeData'); } else { this.stickyRowFeature = this.createManagedBean(new StickyRowFeature(this.createRowCon.bind(this), this.destroyRowCtrls.bind(this))); } } this.registerCellEventListeners(); this.initialiseCache(); this.printLayout = this.gridOptionsService.isDomLayout('print'); this.embedFullWidthRows = this.printLayout || this.gridOptionsService.is('embedFullWidthRows'); this.redrawAfterModelUpdate(); }; RowRenderer.prototype.initialiseCache = function () { if (this.gridOptionsService.is('keepDetailRows')) { var countProp = this.getKeepDetailRowsCount(); var count = countProp != null ? countProp : 3; this.cachedRowCtrls = new RowCtrlCache(count); } }; RowRenderer.prototype.getKeepDetailRowsCount = function () { var keepDetailRowsCount = this.gridOptionsService.getNum('keepDetailRowsCount'); if (exists(keepDetailRowsCount) && keepDetailRowsCount > 0) { return keepDetailRowsCount; } return DEFAULT_KEEP_DETAIL_ROW_COUNT; }; RowRenderer.prototype.getRowCtrls = function () { return this.allRowCtrls; }; RowRenderer.prototype.getStickyTopRowCtrls = function () { if (!this.stickyRowFeature) { return []; } return this.stickyRowFeature.getStickyRowCtrls(); }; RowRenderer.prototype.updateAllRowCtrls = function () { var liveList = getAllValuesInObject(this.rowCtrlsByRowIndex); var isEnsureDomOrder = this.gridOptionsService.is('ensureDomOrder'); var isPrintLayout = this.gridOptionsService.isDomLayout('print'); if (isEnsureDomOrder || isPrintLayout) { liveList.sort(function (a, b) { return a.getRowNode().rowIndex - b.getRowNode.rowIndex; }); } var zombieList = getAllValuesInObject(this.zombieRowCtrls); var cachedList = this.cachedRowCtrls ? this.cachedRowCtrls.getEntries() : []; this.allRowCtrls = __spread$d(liveList, zombieList, cachedList); }; RowRenderer.prototype.onCellFocusChanged = function (event) { this.getAllCellCtrls().forEach(function (cellCtrl) { return cellCtrl.onCellFocused(event); }); this.getFullWidthRowCtrls().forEach(function (rowCtrl) { return rowCtrl.onFullWidthRowFocused(event); }); }; // in a clean design, each cell would register for each of these events. however when scrolling, all the cells // registering and de-registering for events is a performance bottleneck. so we register here once and inform // all active cells. RowRenderer.prototype.registerCellEventListeners = function () { var _this = this; this.addManagedListener(this.eventService, Events.EVENT_CELL_FOCUSED, function (event) { _this.onCellFocusChanged(event); }); this.addManagedListener(this.eventService, Events.EVENT_CELL_FOCUS_CLEARED, function () { _this.onCellFocusChanged(); }); this.addManagedListener(this.eventService, Events.EVENT_FLASH_CELLS, function (event) { _this.getAllCellCtrls().forEach(function (cellCtrl) { return cellCtrl.onFlashCells(event); }); }); this.addManagedListener(this.eventService, Events.EVENT_COLUMN_HOVER_CHANGED, function () { _this.getAllCellCtrls().forEach(function (cellCtrl) { return cellCtrl.onColumnHover(); }); }); this.addManagedListener(this.eventService, Events.EVENT_DISPLAYED_COLUMNS_CHANGED, function () { _this.getAllCellCtrls().forEach(function (cellCtrl) { return cellCtrl.onDisplayedColumnsChanged(); }); }); // only for printLayout - because we are rendering all the cells in the same row, regardless of pinned state, // then changing the width of the containers will impact left position. eg the center cols all have their // left position adjusted by the width of the left pinned column, so if the pinned left column width changes, // all the center cols need to be shifted to accommodate this. when in normal layout, the pinned cols are // in different containers so doesn't impact. this.addManagedListener(this.eventService, Events.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED, function () { if (_this.printLayout) { _this.getAllCellCtrls().forEach(function (cellCtrl) { return cellCtrl.onLeftChanged(); }); } }); var rangeSelectionEnabled = this.gridOptionsService.isEnableRangeSelection(); if (rangeSelectionEnabled) { this.addManagedListener(this.eventService, Events.EVENT_RANGE_SELECTION_CHANGED, function () { _this.getAllCellCtrls().forEach(function (cellCtrl) { return cellCtrl.onRangeSelectionChanged(); }); }); this.addManagedListener(this.eventService, Events.EVENT_COLUMN_MOVED, function () { _this.getAllCellCtrls().forEach(function (cellCtrl) { return cellCtrl.updateRangeBordersIfRangeCount(); }); }); this.addManagedListener(this.eventService, Events.EVENT_COLUMN_PINNED, function () { _this.getAllCellCtrls().forEach(function (cellCtrl) { return cellCtrl.updateRangeBordersIfRangeCount(); }); }); this.addManagedListener(this.eventService, Events.EVENT_COLUMN_VISIBLE, function () { _this.getAllCellCtrls().forEach(function (cellCtrl) { return cellCtrl.updateRangeBordersIfRangeCount(); }); }); } // add listeners to the grid columns this.refreshListenersToColumnsForCellComps(); // if the grid columns change, then refresh the listeners again this.addManagedListener(this.eventService, Events.EVENT_GRID_COLUMNS_CHANGED, this.refreshListenersToColumnsForCellComps.bind(this)); this.addDestroyFunc(this.removeGridColumnListeners.bind(this)); }; // executes all functions in destroyFuncsForColumnListeners and then clears the list RowRenderer.prototype.removeGridColumnListeners = function () { this.destroyFuncsForColumnListeners.forEach(function (func) { return func(); }); this.destroyFuncsForColumnListeners.length = 0; }; // this function adds listeners onto all the grid columns, which are the column that we could have cellComps for. // when the grid columns change, we add listeners again. in an ideal design, each CellComp would just register to // the column it belongs to on creation, however this was a bottleneck with the number of cells, so do it here // once instead. RowRenderer.prototype.refreshListenersToColumnsForCellComps = function () { var _this = this; this.removeGridColumnListeners(); var cols = this.columnModel.getAllGridColumns(); if (!cols) { return; } cols.forEach(function (col) { var forEachCellWithThisCol = function (callback) { _this.getAllCellCtrls().forEach(function (cellCtrl) { if (cellCtrl.getColumn() === col) { callback(cellCtrl); } }); }; var leftChangedListener = function () { forEachCellWithThisCol(function (cellCtrl) { return cellCtrl.onLeftChanged(); }); }; var widthChangedListener = function () { forEachCellWithThisCol(function (cellCtrl) { return cellCtrl.onWidthChanged(); }); }; var firstRightPinnedChangedListener = function () { forEachCellWithThisCol(function (cellCtrl) { return cellCtrl.onFirstRightPinnedChanged(); }); }; var lastLeftPinnedChangedListener = function () { forEachCellWithThisCol(function (cellCtrl) { return cellCtrl.onLastLeftPinnedChanged(); }); }; var colDefChangedListener = function () { forEachCellWithThisCol(function (cellCtrl) { return cellCtrl.onColDefChanged(); }); }; col.addEventListener('leftChanged', leftChangedListener); col.addEventListener('widthChanged', widthChangedListener); col.addEventListener('firstRightPinnedChanged', firstRightPinnedChangedListener); col.addEventListener('lastLeftPinnedChanged', lastLeftPinnedChangedListener); col.addEventListener('colDefChanged', colDefChangedListener); _this.destroyFuncsForColumnListeners.push(function () { col.removeEventListener('leftChanged', leftChangedListener); col.removeEventListener('widthChanged', widthChangedListener); col.removeEventListener('firstRightPinnedChanged', firstRightPinnedChangedListener); col.removeEventListener('lastLeftPinnedChanged', lastLeftPinnedChangedListener); col.removeEventListener('colDefChanged', colDefChangedListener); }); }); }; RowRenderer.prototype.onDomLayoutChanged = function () { var printLayout = this.gridOptionsService.isDomLayout('print'); var embedFullWidthRows = printLayout || this.gridOptionsService.is('embedFullWidthRows'); // if moving towards or away from print layout, means we need to destroy all rows, as rows are not laid // out using absolute positioning when doing print layout var destroyRows = embedFullWidthRows !== this.embedFullWidthRows || this.printLayout !== printLayout; this.printLayout = printLayout; this.embedFullWidthRows = embedFullWidthRows; if (destroyRows) { this.redrawAfterModelUpdate({ domLayoutChanged: true }); } }; // for row models that have datasources, when we update the datasource, we need to force the rowRenderer // to redraw all rows. otherwise the old rows from the old datasource will stay displayed. RowRenderer.prototype.datasourceChanged = function () { this.firstRenderedRow = 0; this.lastRenderedRow = -1; var rowIndexesToRemove = Object.keys(this.rowCtrlsByRowIndex); this.removeRowCtrls(rowIndexesToRemove); }; RowRenderer.prototype.onPageLoaded = function (event) { var params = { recycleRows: event.keepRenderedRows, animate: event.animate, newData: event.newData, newPage: event.newPage, // because this is a model updated event (not pinned rows), we // can skip updating the pinned rows. this is needed so that if user // is doing transaction updates, the pinned rows are not getting constantly // trashed - or editing cells in pinned rows are not refreshed and put into read mode onlyBody: true }; this.redrawAfterModelUpdate(params); }; RowRenderer.prototype.getAllCellsForColumn = function (column) { var res = []; this.getAllRowCtrls().forEach(function (rowCtrl) { var eCell = rowCtrl.getCellElement(column); if (eCell) { res.push(eCell); } }); return res; }; RowRenderer.prototype.refreshFloatingRowComps = function () { this.refreshFloatingRows(this.topRowCtrls, this.pinnedRowModel.getPinnedTopRowData()); this.refreshFloatingRows(this.bottomRowCtrls, this.pinnedRowModel.getPinnedBottomRowData()); }; RowRenderer.prototype.getTopRowCtrls = function () { return this.topRowCtrls; }; RowRenderer.prototype.getBottomRowCtrls = function () { return this.bottomRowCtrls; }; RowRenderer.prototype.refreshFloatingRows = function (rowComps, rowNodes) { var _this = this; rowComps.forEach(function (row) { row.destroyFirstPass(); row.destroySecondPass(); }); rowComps.length = 0; if (!rowNodes) { return; } rowNodes.forEach(function (rowNode) { var rowCtrl = new RowCtrl(rowNode, _this.beans, false, false, _this.printLayout); rowComps.push(rowCtrl); }); }; RowRenderer.prototype.onPinnedRowDataChanged = function () { // recycling rows in order to ensure cell editing is not cancelled var params = { recycleRows: true }; this.redrawAfterModelUpdate(params); }; // if the row nodes are not rendered, no index is returned RowRenderer.prototype.getRenderedIndexesForRowNodes = function (rowNodes) { var result = []; if (missing(rowNodes)) { return result; } iterateObject(this.rowCtrlsByRowIndex, function (index, renderedRow) { var rowNode = renderedRow.getRowNode(); if (rowNodes.indexOf(rowNode) >= 0) { result.push(index); } }); return result; }; RowRenderer.prototype.redrawRows = function (rowNodes) { // if no row nodes provided, then refresh everything var partialRefresh = rowNodes != null && rowNodes.length > 0; if (partialRefresh) { var indexesToRemove = this.getRenderedIndexesForRowNodes(rowNodes); // remove the rows this.removeRowCtrls(indexesToRemove); } // add draw them again this.redrawAfterModelUpdate({ recycleRows: partialRefresh }); }; RowRenderer.prototype.getCellToRestoreFocusToAfterRefresh = function (params) { var focusedCell = (params === null || params === void 0 ? void 0 : params.suppressKeepFocus) ? null : this.focusService.getFocusCellToUseAfterRefresh(); if (focusedCell == null) { return null; } // if the dom is not actually focused on a cell, then we don't try to refocus. the problem this // solves is with editing - if the user is editing, eg focus is on a text field, and not on the // cell itself, then the cell can be registered as having focus, however it's the text field that // has the focus and not the cell div. therefore, when the refresh is finished, the grid will focus // the cell, and not the textfield. that means if the user is in a text field, and the grid refreshes, // the focus is lost from the text field. we do not want this. var eDocument = this.gridOptionsService.getDocument(); var activeElement = eDocument.activeElement; var cellDomData = this.gridOptionsService.getDomData(activeElement, CellCtrl.DOM_DATA_KEY_CELL_CTRL); var rowDomData = this.gridOptionsService.getDomData(activeElement, RowCtrl.DOM_DATA_KEY_ROW_CTRL); var gridElementFocused = cellDomData || rowDomData; return gridElementFocused ? focusedCell : null; }; // gets called from: // +) initialisation (in registerGridComp) params = null // +) onDomLayoutChanged, params = null // +) onPageLoaded, recycleRows, animate, newData, newPage from event, onlyBody=true // +) onPinnedRowDataChanged, recycleRows = true // +) redrawRows (from Grid API), recycleRows = true/false RowRenderer.prototype.redrawAfterModelUpdate = function (params) { if (params === void 0) { params = {}; } this.getLockOnRefresh(); var focusedCell = this.getCellToRestoreFocusToAfterRefresh(params); this.updateContainerHeights(); this.scrollToTopIfNewData(params); // never recycle rows on layout change as rows could change from normal DOM layout // back to the grid's row positioning. var recycleRows = !params.domLayoutChanged && !!params.recycleRows; var animate = params.animate && this.gridOptionsService.isAnimateRows(); // after modelUpdate, row indexes can change, so we clear out the rowsByIndex map, // however we can reuse the rows, so we keep them but index by rowNode.id var rowsToRecycle = recycleRows ? this.recycleRows() : null; if (!recycleRows) { this.removeAllRowComps(); } this.redraw(rowsToRecycle, animate); this.gridBodyCtrl.updateRowCount(); if (!params.onlyBody) { this.refreshFloatingRowComps(); } this.dispatchDisplayedRowsChanged(); // if a cell was focused before, ensure focus now. if (focusedCell != null) { this.restoreFocusedCell(focusedCell); } this.releaseLockOnRefresh(); }; RowRenderer.prototype.scrollToTopIfNewData = function (params) { var scrollToTop = params.newData || params.newPage; var suppressScrollToTop = this.gridOptionsService.is('suppressScrollOnNewData'); if (scrollToTop && !suppressScrollToTop) { this.gridBodyCtrl.getScrollFeature().scrollToTop(); } }; RowRenderer.prototype.updateContainerHeights = function () { // when doing print layout, we don't explicitly set height on the containers if (this.printLayout) { this.rowContainerHeightService.setModelHeight(null); return; } var containerHeight = this.paginationProxy.getCurrentPageHeight(); // we need at least 1 pixel for the horizontal scroll to work. so if there are now rows, // we still want the scroll to be present, otherwise there would be no way to scroll the header // which might be needed us user wants to access columns // on the RHS - and if that was where the filter was that cause no rows to be presented, there // is no way to remove the filter. if (containerHeight === 0) { containerHeight = 1; } this.rowContainerHeightService.setModelHeight(containerHeight); }; RowRenderer.prototype.getLockOnRefresh = function () { if (this.refreshInProgress) { throw new Error("AG Grid: cannot get grid to draw rows when it is in the middle of drawing rows. " + "Your code probably called a grid API method while the grid was in the render stage. To overcome " + "this, put the API call into a timeout, e.g. instead of api.redrawRows(), " + "call setTimeout(function() { api.redrawRows(); }, 0). To see what part of your code " + "that caused the refresh check this stacktrace."); } this.refreshInProgress = true; }; RowRenderer.prototype.releaseLockOnRefresh = function () { this.refreshInProgress = false; }; RowRenderer.prototype.isRefreshInProgress = function () { return this.refreshInProgress; }; // sets the focus to the provided cell, if the cell is provided. this way, the user can call refresh without // worry about the focus been lost. this is important when the user is using keyboard navigation to do edits // and the cellEditor is calling 'refresh' to get other cells to update (as other cells might depend on the // edited cell). RowRenderer.prototype.restoreFocusedCell = function (cellPosition) { if (cellPosition) { // we don't wish to dispatch an event as the rowRenderer is not capable of changing the selected cell, // so we mock a change event for the full width rows and cells to ensure they update to the newly selected // state this.onCellFocusChanged({ rowIndex: cellPosition.rowIndex, column: cellPosition.column, rowPinned: cellPosition.rowPinned, forceBrowserFocus: true, preventScrollOnBrowserFocus: true, api: this.beans.gridApi, columnApi: this.beans.columnApi, context: this.beans.gridOptionsService.context, type: 'mock', }); } }; RowRenderer.prototype.stopEditing = function (cancel) { if (cancel === void 0) { cancel = false; } this.getAllRowCtrls().forEach(function (rowCtrl) { rowCtrl.stopEditing(cancel); }); }; RowRenderer.prototype.getAllCellCtrls = function () { var res = []; var rowCtrls = this.getAllRowCtrls(); var rowCtrlsLength = rowCtrls.length; for (var i = 0; i < rowCtrlsLength; i++) { var cellCtrls = rowCtrls[i].getAllCellCtrls(); var cellCtrlsLength = cellCtrls.length; for (var j = 0; j < cellCtrlsLength; j++) { res.push(cellCtrls[j]); } } return res; }; RowRenderer.prototype.getAllRowCtrls = function () { var e_1, _a; var stickyRowCtrls = (this.stickyRowFeature && this.stickyRowFeature.getStickyRowCtrls()) || []; var res = __spread$d(this.topRowCtrls, this.bottomRowCtrls, stickyRowCtrls); try { for (var _b = __values$5(Object.keys(this.rowCtrlsByRowIndex)), _c = _b.next(); !_c.done; _c = _b.next()) { var key = _c.value; res.push(this.rowCtrlsByRowIndex[key]); } } catch (e_1_1) { e_1 = { error: e_1_1 }; } finally { try { if (_c && !_c.done && (_a = _b.return)) _a.call(_b); } finally { if (e_1) throw e_1.error; } } return res; }; RowRenderer.prototype.addRenderedRowListener = function (eventName, rowIndex, callback) { var rowComp = this.rowCtrlsByRowIndex[rowIndex]; if (rowComp) { rowComp.addEventListener(eventName, callback); } }; RowRenderer.prototype.flashCells = function (params) { if (params === void 0) { params = {}; } var flashDelay = params.flashDelay, fadeDelay = params.fadeDelay; this.getCellCtrls(params.rowNodes, params.columns) .forEach(function (cellCtrl) { return cellCtrl.flashCell({ flashDelay: flashDelay, fadeDelay: fadeDelay }); }); }; RowRenderer.prototype.refreshCells = function (params) { if (params === void 0) { params = {}; } var refreshCellParams = { forceRefresh: params.force, newData: false, suppressFlash: params.suppressFlash }; this.getCellCtrls(params.rowNodes, params.columns) .forEach(function (cellCtrl) { if (cellCtrl.refreshShouldDestroy()) { var rowCtrl = cellCtrl.getRowCtrl(); if (rowCtrl) { rowCtrl.refreshCell(cellCtrl); } } else { cellCtrl.refreshCell(refreshCellParams); } }); this.getFullWidthRowCtrls(params.rowNodes).forEach(function (fullWidthRowCtrl) { fullWidthRowCtrl.refreshFullWidth(); }); }; RowRenderer.prototype.getCellRendererInstances = function (params) { var _this = this; var _a; var cellRenderers = this.getCellCtrls(params.rowNodes, params.columns) .map(function (cellCtrl) { return cellCtrl.getCellRenderer(); }) .filter(function (renderer) { return renderer != null; }); if ((_a = params.columns) === null || _a === void 0 ? void 0 : _a.length) { return cellRenderers; } var fullWidthRenderers = []; var rowIdMap = this.mapRowNodes(params.rowNodes); this.getAllRowCtrls().forEach(function (rowCtrl) { if (rowIdMap && !_this.isRowInMap(rowCtrl.getRowNode(), rowIdMap)) { return; } if (!rowCtrl.isFullWidth()) { return; } var fullWidthRenderer = rowCtrl.getFullWidthCellRenderer(); if (fullWidthRenderer) { fullWidthRenderers.push(fullWidthRenderer); } }); return __spread$d(fullWidthRenderers, cellRenderers); }; RowRenderer.prototype.getCellEditorInstances = function (params) { var res = []; this.getCellCtrls(params.rowNodes, params.columns).forEach(function (cellCtrl) { var cellEditor = cellCtrl.getCellEditor(); if (cellEditor) { res.push(cellEditor); } }); return res; }; RowRenderer.prototype.getEditingCells = function () { var res = []; this.getAllCellCtrls().forEach(function (cellCtrl) { if (cellCtrl.isEditing()) { var cellPosition = cellCtrl.getCellPosition(); res.push(cellPosition); } }); return res; }; RowRenderer.prototype.mapRowNodes = function (rowNodes) { if (!rowNodes) { return; } var res = { top: {}, bottom: {}, normal: {} }; rowNodes.forEach(function (rowNode) { var id = rowNode.id; if (rowNode.rowPinned === 'top') { res.top[id] = rowNode; } else if (rowNode.rowPinned === 'bottom') { res.bottom[id] = rowNode; } else { res.normal[id] = rowNode; } }); return res; }; RowRenderer.prototype.isRowInMap = function (rowNode, rowIdsMap) { // skip this row if it is missing from the provided list var id = rowNode.id; var floating = rowNode.rowPinned; if (floating === 'bottom') { return rowIdsMap.bottom[id] != null; } if (floating === 'top') { return rowIdsMap.top[id] != null; } return rowIdsMap.normal[id] != null; }; // returns CellCtrl's that match the provided rowNodes and columns. eg if one row node // and two columns provided, that identifies 4 cells, so 4 CellCtrl's returned. RowRenderer.prototype.getCellCtrls = function (rowNodes, columns) { var _this = this; var rowIdsMap = this.mapRowNodes(rowNodes); var res = []; var colIdsMap; if (exists(columns)) { colIdsMap = {}; columns.forEach(function (colKey) { var column = _this.columnModel.getGridColumn(colKey); if (exists(column)) { colIdsMap[column.getId()] = true; } }); } var processRow = function (rowCtrl) { var rowNode = rowCtrl.getRowNode(); // skip this row if it is missing from the provided list if (rowIdsMap != null && !_this.isRowInMap(rowNode, rowIdsMap)) { return; } rowCtrl.getAllCellCtrls().forEach(function (cellCtrl) { var colId = cellCtrl.getColumn().getId(); var excludeColFromRefresh = colIdsMap && !colIdsMap[colId]; if (excludeColFromRefresh) { return; } res.push(cellCtrl); }); }; this.getAllRowCtrls().forEach(function (row) { return processRow(row); }); return res; }; RowRenderer.prototype.destroy = function () { this.removeAllRowComps(); _super.prototype.destroy.call(this); }; RowRenderer.prototype.removeAllRowComps = function () { var rowIndexesToRemove = Object.keys(this.rowCtrlsByRowIndex); this.removeRowCtrls(rowIndexesToRemove); }; RowRenderer.prototype.recycleRows = function () { // remove all stub nodes, they can't be reused, as no rowNode id var stubNodeIndexes = []; iterateObject(this.rowCtrlsByRowIndex, function (index, rowComp) { var stubNode = rowComp.getRowNode().id == null; if (stubNode) { stubNodeIndexes.push(index); } }); this.removeRowCtrls(stubNodeIndexes); // then clear out rowCompsByIndex, but before that take a copy, but index by id, not rowIndex var ctrlsByIdMap = {}; iterateObject(this.rowCtrlsByRowIndex, function (index, rowComp) { var rowNode = rowComp.getRowNode(); ctrlsByIdMap[rowNode.id] = rowComp; }); this.rowCtrlsByRowIndex = {}; return ctrlsByIdMap; }; // takes array of row indexes RowRenderer.prototype.removeRowCtrls = function (rowsToRemove) { var _this = this; // if no fromIndex then set to -1, which will refresh everything // let realFromIndex = -1; rowsToRemove.forEach(function (indexToRemove) { var rowCtrl = _this.rowCtrlsByRowIndex[indexToRemove]; if (rowCtrl) { rowCtrl.destroyFirstPass(); rowCtrl.destroySecondPass(); } delete _this.rowCtrlsByRowIndex[indexToRemove]; }); }; RowRenderer.prototype.onBodyScroll = function (e) { if (e.direction !== 'vertical') { return; } this.redrawAfterScroll(); }; // gets called when rows don't change, but viewport does, so after: // 1) height of grid body changes, ie number of displayed rows has changed // 2) grid scrolled to new position // 3) ensure index visible (which is a scroll) RowRenderer.prototype.redrawAfterScroll = function () { var cellFocused; // only try to refocus cells shifting in and out of sticky container // if the browser supports focus ({ preventScroll }) if (this.stickyRowFeature && browserSupportsPreventScroll()) { cellFocused = this.getCellToRestoreFocusToAfterRefresh() || undefined; } this.getLockOnRefresh(); this.redraw(null, false, true); this.releaseLockOnRefresh(); this.dispatchDisplayedRowsChanged(); if (cellFocused != null) { var newFocusedCell = this.getCellToRestoreFocusToAfterRefresh(); if (cellFocused != null && newFocusedCell == null) { this.animationFrameService.flushAllFrames(); this.restoreFocusedCell(cellFocused); } } }; RowRenderer.prototype.removeRowCompsNotToDraw = function (indexesToDraw) { // for speedy lookup, dump into map var indexesToDrawMap = {}; indexesToDraw.forEach(function (index) { return (indexesToDrawMap[index] = true); }); var existingIndexes = Object.keys(this.rowCtrlsByRowIndex); var indexesNotToDraw = existingIndexes.filter(function (index) { return !indexesToDrawMap[index]; }); this.removeRowCtrls(indexesNotToDraw); }; RowRenderer.prototype.calculateIndexesToDraw = function (rowsToRecycle) { var _this = this; // all in all indexes in the viewport var indexesToDraw = createArrayOfNumbers(this.firstRenderedRow, this.lastRenderedRow); var checkRowToDraw = function (indexStr, rowComp) { var index = rowComp.getRowNode().rowIndex; if (index == null) { return; } if (index < _this.firstRenderedRow || index > _this.lastRenderedRow) { if (_this.doNotUnVirtualiseRow(rowComp)) { indexesToDraw.push(index); } } }; // if we are redrawing due to scrolling change, then old rows are in this.rowCompsByIndex iterateObject(this.rowCtrlsByRowIndex, checkRowToDraw); // if we are redrawing due to model update, then old rows are in rowsToRecycle iterateObject(rowsToRecycle, checkRowToDraw); indexesToDraw.sort(function (a, b) { return a - b; }); indexesToDraw = indexesToDraw.filter(function (index) { var rowNode = _this.paginationProxy.getRow(index); return rowNode && !rowNode.sticky; }); return indexesToDraw; }; RowRenderer.prototype.redraw = function (rowsToRecycle, animate, afterScroll) { var _this = this; if (animate === void 0) { animate = false; } if (afterScroll === void 0) { afterScroll = false; } this.rowContainerHeightService.updateOffset(); this.workOutFirstAndLastRowsToRender(); if (this.stickyRowFeature) { this.stickyRowFeature.checkStickyRows(); } // the row can already exist and be in the following: // rowsToRecycle -> if model change, then the index may be different, however row may // exist here from previous time (mapped by id). // this.rowCompsByIndex -> if just a scroll, then this will contain what is currently in the viewport // this is all the indexes we want, including those that already exist, so this method // will end up going through each index and drawing only if the row doesn't already exist var indexesToDraw = this.calculateIndexesToDraw(rowsToRecycle); this.removeRowCompsNotToDraw(indexesToDraw); // never animate when doing print layout - as we want to get things ready to print as quickly as possible, // otherwise we risk the printer printing a row that's half faded (half way through fading in) if (this.printLayout) { animate = false; } indexesToDraw.forEach(function (rowIndex) { var rowCtrl = _this.createOrUpdateRowCtrl(rowIndex, rowsToRecycle, animate, afterScroll); if (exists(rowCtrl)) ; }); if (rowsToRecycle) { var useAnimationFrame = afterScroll && !this.gridOptionsService.is('suppressAnimationFrame') && !this.printLayout; if (useAnimationFrame) { this.beans.animationFrameService.addDestroyTask(function () { _this.destroyRowCtrls(rowsToRecycle, animate); _this.updateAllRowCtrls(); _this.dispatchDisplayedRowsChanged(); }); } else { this.destroyRowCtrls(rowsToRecycle, animate); } } this.updateAllRowCtrls(); }; RowRenderer.prototype.dispatchDisplayedRowsChanged = function () { var event = { type: Events.EVENT_DISPLAYED_ROWS_CHANGED }; this.eventService.dispatchEvent(event); }; RowRenderer.prototype.onDisplayedColumnsChanged = function () { var pinningLeft = this.columnModel.isPinningLeft(); var pinningRight = this.columnModel.isPinningRight(); var atLeastOneChanged = this.pinningLeft !== pinningLeft || pinningRight !== this.pinningRight; if (atLeastOneChanged) { this.pinningLeft = pinningLeft; this.pinningRight = pinningRight; if (this.embedFullWidthRows) { this.redrawFullWidthEmbeddedRows(); } } }; // when embedding, what gets showed in each section depends on what is pinned. eg if embedding group expand / collapse, // then it should go into the pinned left area if pinning left, or the center area if not pinning. RowRenderer.prototype.redrawFullWidthEmbeddedRows = function () { // if either of the pinned panels has shown / hidden, then need to redraw the fullWidth bits when // embedded, as what appears in each section depends on whether we are pinned or not var rowsToRemove = []; this.getFullWidthRowCtrls().forEach(function (fullWidthCtrl) { var rowIndex = fullWidthCtrl.getRowNode().rowIndex; rowsToRemove.push(rowIndex.toString()); }); this.refreshFloatingRowComps(); this.removeRowCtrls(rowsToRemove); this.redrawAfterScroll(); }; RowRenderer.prototype.getFullWidthRowCtrls = function (rowNodes) { var _this = this; var rowNodesMap = this.mapRowNodes(rowNodes); return getAllValuesInObject(this.rowCtrlsByRowIndex).filter(function (rowCtrl) { // include just full width if (!rowCtrl.isFullWidth()) { return false; } // if Row Nodes provided, we exclude where Row Node is missing var rowNode = rowCtrl.getRowNode(); if (rowNodesMap != null && !_this.isRowInMap(rowNode, rowNodesMap)) { return false; } return true; }); }; RowRenderer.prototype.refreshFullWidthRows = function (rowNodesToRefresh) { var rowsToRemove = []; var selectivelyRefreshing = !!rowNodesToRefresh; var idsToRefresh = selectivelyRefreshing ? {} : undefined; if (selectivelyRefreshing && idsToRefresh) { rowNodesToRefresh.forEach(function (r) { return idsToRefresh[r.id] = true; }); } this.getFullWidthRowCtrls().forEach(function (fullWidthRowCtrl) { var rowNode = fullWidthRowCtrl.getRowNode(); if (selectivelyRefreshing && idsToRefresh) { // we refresh if a) this node is present or b) this parents nodes is present. checking parent // node is important for master/detail, as we want detail to refresh on changes to parent node. // it's also possible, if user is provider their own fullWidth, that details panels contain // some info on the parent, eg if in tree data and child row shows some data from parent row also. var parentId = (rowNode.level > 0 && rowNode.parent) ? rowNode.parent.id : undefined; var skipThisNode = !idsToRefresh[rowNode.id] && !idsToRefresh[parentId]; if (skipThisNode) { return; } } var fullWidthRowsRefreshed = fullWidthRowCtrl.refreshFullWidth(); if (!fullWidthRowsRefreshed) { var rowIndex = fullWidthRowCtrl.getRowNode().rowIndex; rowsToRemove.push(rowIndex.toString()); } }); this.removeRowCtrls(rowsToRemove); this.redrawAfterScroll(); }; RowRenderer.prototype.createOrUpdateRowCtrl = function (rowIndex, rowsToRecycle, animate, afterScroll) { var rowNode; var rowCtrl = this.rowCtrlsByRowIndex[rowIndex]; // if no row comp, see if we can get it from the previous rowComps if (!rowCtrl) { rowNode = this.paginationProxy.getRow(rowIndex); if (exists(rowNode) && exists(rowsToRecycle) && rowsToRecycle[rowNode.id] && rowNode.alreadyRendered) { rowCtrl = rowsToRecycle[rowNode.id]; rowsToRecycle[rowNode.id] = null; } } var creatingNewRowCtrl = !rowCtrl; if (creatingNewRowCtrl) { // create a new one if (!rowNode) { rowNode = this.paginationProxy.getRow(rowIndex); } if (exists(rowNode)) { rowCtrl = this.createRowCon(rowNode, animate, afterScroll); } else { // this should never happen - if somehow we are trying to create // a row for a rowNode that does not exist. return; } } if (rowNode) { // set node as 'alreadyRendered' to ensure we only recycle rowComps that have been rendered, this ensures // we don't reuse rowComps that have been removed and then re-added in the same batch transaction. rowNode.alreadyRendered = true; } this.rowCtrlsByRowIndex[rowIndex] = rowCtrl; return rowCtrl; }; RowRenderer.prototype.destroyRowCtrls = function (rowCtrlsMap, animate) { var _this = this; var executeInAWhileFuncs = []; iterateObject(rowCtrlsMap, function (nodeId, rowCtrl) { // if row was used, then it's null if (!rowCtrl) { return; } if (_this.cachedRowCtrls && rowCtrl.isCacheable()) { _this.cachedRowCtrls.addRow(rowCtrl); return; } rowCtrl.destroyFirstPass(); if (animate) { _this.zombieRowCtrls[rowCtrl.getInstanceId()] = rowCtrl; executeInAWhileFuncs.push(function () { rowCtrl.destroySecondPass(); delete _this.zombieRowCtrls[rowCtrl.getInstanceId()]; }); } else { rowCtrl.destroySecondPass(); } }); if (animate) { // this ensures we fire displayedRowsChanged AFTER all the 'executeInAWhileFuncs' get // executed, as we added it to the end of the list. executeInAWhileFuncs.push(function () { _this.updateAllRowCtrls(); _this.dispatchDisplayedRowsChanged(); }); executeInAWhile(executeInAWhileFuncs); } }; RowRenderer.prototype.getRowBuffer = function () { var rowBuffer = this.gridOptionsService.getNum('rowBuffer'); if (typeof rowBuffer === 'number') { if (rowBuffer < 0) { doOnce(function () { return console.warn("AG Grid: rowBuffer should not be negative"); }, 'warn rowBuffer negative'); rowBuffer = 0; this.gridOptionsService.set('rowBuffer', 0); } } else { rowBuffer = 10; } return rowBuffer; }; RowRenderer.prototype.getRowBufferInPixels = function () { var rowsToBuffer = this.getRowBuffer(); var defaultRowHeight = this.gridOptionsService.getRowHeightAsNumber(); return rowsToBuffer * defaultRowHeight; }; RowRenderer.prototype.workOutFirstAndLastRowsToRender = function () { var newFirst; var newLast; if (!this.paginationProxy.isRowsToRender()) { newFirst = 0; newLast = -1; // setting to -1 means nothing in range } else if (this.printLayout) { newFirst = this.paginationProxy.getPageFirstRow(); newLast = this.paginationProxy.getPageLastRow(); } else { var bufferPixels = this.getRowBufferInPixels(); var gridBodyCtrl = this.ctrlsService.getGridBodyCtrl(); var suppressRowVirtualisation = this.gridOptionsService.is('suppressRowVirtualisation'); var rowHeightsChanged = false; var firstPixel = void 0; var lastPixel = void 0; do { var paginationOffset = this.paginationProxy.getPixelOffset(); var _a = this.paginationProxy.getCurrentPagePixelRange(), pageFirstPixel = _a.pageFirstPixel, pageLastPixel = _a.pageLastPixel; var divStretchOffset = this.rowContainerHeightService.getDivStretchOffset(); var bodyVRange = gridBodyCtrl.getScrollFeature().getVScrollPosition(); var bodyTopPixel = bodyVRange.top; var bodyBottomPixel = bodyVRange.bottom; if (suppressRowVirtualisation) { firstPixel = pageFirstPixel + divStretchOffset; lastPixel = pageLastPixel + divStretchOffset; } else { firstPixel = Math.max(bodyTopPixel + paginationOffset - bufferPixels, pageFirstPixel) + divStretchOffset; lastPixel = Math.min(bodyBottomPixel + paginationOffset + bufferPixels, pageLastPixel) + divStretchOffset; } this.firstVisibleVPixel = Math.max(bodyTopPixel + paginationOffset, pageFirstPixel) + divStretchOffset; // if the rows we are about to display get their heights changed, then that upsets the calcs from above. rowHeightsChanged = this.ensureAllRowsInRangeHaveHeightsCalculated(firstPixel, lastPixel); } while (rowHeightsChanged); var firstRowIndex = this.paginationProxy.getRowIndexAtPixel(firstPixel); var lastRowIndex = this.paginationProxy.getRowIndexAtPixel(lastPixel); var pageFirstRow = this.paginationProxy.getPageFirstRow(); var pageLastRow = this.paginationProxy.getPageLastRow(); // adjust, in case buffer extended actual size if (firstRowIndex < pageFirstRow) { firstRowIndex = pageFirstRow; } if (lastRowIndex > pageLastRow) { lastRowIndex = pageLastRow; } newFirst = firstRowIndex; newLast = lastRowIndex; } // sometimes user doesn't set CSS right and ends up with grid with no height and grid ends up // trying to render all the rows, eg 10,000+ rows. this will kill the browser. so instead of // killing the browser, we limit the number of rows. just in case some use case we didn't think // of, we also have a property to not do this operation. var rowLayoutNormal = this.gridOptionsService.isDomLayout('normal'); var suppressRowCountRestriction = this.gridOptionsService.is('suppressMaxRenderedRowRestriction'); var rowBufferMaxSize = Math.max(this.getRowBuffer(), 500); if (rowLayoutNormal && !suppressRowCountRestriction) { if (newLast - newFirst > rowBufferMaxSize) { newLast = newFirst + rowBufferMaxSize; } } var firstDiffers = newFirst !== this.firstRenderedRow; var lastDiffers = newLast !== this.lastRenderedRow; if (firstDiffers || lastDiffers) { this.firstRenderedRow = newFirst; this.lastRenderedRow = newLast; var event_1 = { type: Events.EVENT_VIEWPORT_CHANGED, firstRow: newFirst, lastRow: newLast }; this.eventService.dispatchEvent(event_1); } }; /** * This event will only be fired once, and is queued until after the browser next renders. * This allows us to fire an event during the start of the render cycle, when we first see data being rendered * but not execute the event until all of the data has finished being rendered to the dom. */ RowRenderer.prototype.dispatchFirstDataRenderedEvent = function () { var _this = this; if (this.dataFirstRenderedFired) { return; } this.dataFirstRenderedFired = true; var event = { type: Events.EVENT_FIRST_DATA_RENDERED, firstRow: this.firstRenderedRow, lastRow: this.lastRenderedRow, }; // See AG-7018 window.requestAnimationFrame(function () { _this.beans.eventService.dispatchEvent(event); }); }; RowRenderer.prototype.ensureAllRowsInRangeHaveHeightsCalculated = function (topPixel, bottomPixel) { // ensureRowHeightsVisible only works with CSRM, as it's the only row model that allows lazy row height calcs. // all the other row models just hard code so the method just returns back false var res = this.paginationProxy.ensureRowHeightsValid(topPixel, bottomPixel, -1, -1); if (res) { this.updateContainerHeights(); } return res; }; RowRenderer.prototype.getFirstVisibleVerticalPixel = function () { return this.firstVisibleVPixel; }; RowRenderer.prototype.getFirstVirtualRenderedRow = function () { return this.firstRenderedRow; }; RowRenderer.prototype.getLastVirtualRenderedRow = function () { return this.lastRenderedRow; }; // check that none of the rows to remove are editing or focused as: // a) if editing, we want to keep them, otherwise the user will loose the context of the edit, // eg user starts editing, enters some text, then scrolls down and then up, next time row rendered // the edit is reset - so we want to keep it rendered. // b) if focused, we want ot keep keyboard focus, so if user ctrl+c, it goes to clipboard, // otherwise the user can range select and drag (with focus cell going out of the viewport) // and then ctrl+c, nothing will happen if cell is removed from dom. // c) if detail record of master detail, as users complained that the context of detail rows // was getting lost when detail row out of view. eg user expands to show detail row, // then manipulates the detail panel (eg sorts the detail grid), then context is lost // after detail panel is scrolled out of / into view. RowRenderer.prototype.doNotUnVirtualiseRow = function (rowComp) { var REMOVE_ROW = false; var KEEP_ROW = true; var rowNode = rowComp.getRowNode(); var rowHasFocus = this.focusService.isRowNodeFocused(rowNode); var rowIsEditing = rowComp.isEditing(); var rowIsDetail = rowNode.detail; var mightWantToKeepRow = rowHasFocus || rowIsEditing || rowIsDetail; // if we deffo don't want to keep it, if (!mightWantToKeepRow) { return REMOVE_ROW; } // editing row, only remove if it is no longer rendered, eg filtered out or new data set. // the reason we want to keep is if user is scrolling up and down, we don't want to loose // the context of the editing in process. var rowNodePresent = this.paginationProxy.isRowPresent(rowNode); return rowNodePresent ? KEEP_ROW : REMOVE_ROW; }; RowRenderer.prototype.createRowCon = function (rowNode, animate, afterScroll) { var rowCtrlFromCache = this.cachedRowCtrls ? this.cachedRowCtrls.getRow(rowNode) : null; if (rowCtrlFromCache) { return rowCtrlFromCache; } // we don't use animations frames for printing, so the user can put the grid into print mode // and immediately print - otherwise the user would have to wait for the rows to draw in the background // (via the animation frames) which is awkward to do from code. // we only do the animation frames after scrolling, as this is where we want the smooth user experience. // having animation frames for other times makes the grid look 'jumpy'. var suppressAnimationFrame = this.gridOptionsService.is('suppressAnimationFrame'); var useAnimationFrameForCreate = afterScroll && !suppressAnimationFrame && !this.printLayout; var res = new RowCtrl(rowNode, this.beans, animate, useAnimationFrameForCreate, this.printLayout); return res; }; RowRenderer.prototype.getRenderedNodes = function () { var renderedRows = this.rowCtrlsByRowIndex; return Object.keys(renderedRows).map(function (key) { return renderedRows[key].getRowNode(); }); }; RowRenderer.prototype.getRowByPosition = function (rowPosition) { var rowCtrl; var rowIndex = rowPosition.rowIndex; switch (rowPosition.rowPinned) { case 'top': rowCtrl = this.topRowCtrls[rowIndex]; break; case 'bottom': rowCtrl = this.bottomRowCtrls[rowIndex]; break; default: rowCtrl = this.rowCtrlsByRowIndex[rowIndex]; if (!rowCtrl) { rowCtrl = this.getStickyTopRowCtrls().find(function (ctrl) { return ctrl.getRowNode().rowIndex === rowIndex; }) || null; } break; } return rowCtrl; }; RowRenderer.prototype.getRowNode = function (gridRow) { switch (gridRow.rowPinned) { case 'top': return this.pinnedRowModel.getPinnedTopRowData()[gridRow.rowIndex]; case 'bottom': return this.pinnedRowModel.getPinnedBottomRowData()[gridRow.rowIndex]; default: return this.rowModel.getRow(gridRow.rowIndex); } }; // returns true if any row between startIndex and endIndex is rendered. used by // SSRM or IRM, as they don't want to purge visible blocks from cache. RowRenderer.prototype.isRangeInRenderedViewport = function (startIndex, endIndex) { // parent closed means the parent node is not expanded, thus these blocks are not visible var parentClosed = startIndex == null || endIndex == null; if (parentClosed) { return false; } var blockAfterViewport = startIndex > this.lastRenderedRow; var blockBeforeViewport = endIndex < this.firstRenderedRow; var blockInsideViewport = !blockBeforeViewport && !blockAfterViewport; return blockInsideViewport; }; __decorate$1w([ Autowired("animationFrameService") ], RowRenderer.prototype, "animationFrameService", void 0); __decorate$1w([ Autowired("paginationProxy") ], RowRenderer.prototype, "paginationProxy", void 0); __decorate$1w([ Autowired("columnModel") ], RowRenderer.prototype, "columnModel", void 0); __decorate$1w([ Autowired("pinnedRowModel") ], RowRenderer.prototype, "pinnedRowModel", void 0); __decorate$1w([ Autowired("rowModel") ], RowRenderer.prototype, "rowModel", void 0); __decorate$1w([ Autowired("focusService") ], RowRenderer.prototype, "focusService", void 0); __decorate$1w([ Autowired("beans") ], RowRenderer.prototype, "beans", void 0); __decorate$1w([ Autowired("rowContainerHeightService") ], RowRenderer.prototype, "rowContainerHeightService", void 0); __decorate$1w([ Autowired("ctrlsService") ], RowRenderer.prototype, "ctrlsService", void 0); __decorate$1w([ PostConstruct ], RowRenderer.prototype, "postConstruct", null); RowRenderer = __decorate$1w([ Bean("rowRenderer") ], RowRenderer); return RowRenderer; }(BeanStub)); var RowCtrlCache = /** @class */ (function () { function RowCtrlCache(maxCount) { // map for fast access this.entriesMap = {}; // list for keeping order this.entriesList = []; this.maxCount = maxCount; } RowCtrlCache.prototype.addRow = function (rowCtrl) { this.entriesMap[rowCtrl.getRowNode().id] = rowCtrl; this.entriesList.push(rowCtrl); rowCtrl.setCached(true); if (this.entriesList.length > this.maxCount) { var rowCtrlToDestroy = this.entriesList[0]; rowCtrlToDestroy.destroyFirstPass(); rowCtrlToDestroy.destroySecondPass(); this.removeFromCache(rowCtrlToDestroy); } }; RowCtrlCache.prototype.getRow = function (rowNode) { if (rowNode == null || rowNode.id == null) { return null; } var res = this.entriesMap[rowNode.id]; if (!res) { return null; } this.removeFromCache(res); res.setCached(false); // this can happen if user reloads data, and a new RowNode is reusing // the same ID as the old one var rowNodeMismatch = res.getRowNode() != rowNode; return rowNodeMismatch ? null : res; }; RowCtrlCache.prototype.removeFromCache = function (rowCtrl) { var rowNodeId = rowCtrl.getRowNode().id; delete this.entriesMap[rowNodeId]; removeFromArray(this.entriesList, rowCtrl); }; RowCtrlCache.prototype.getEntries = function () { return this.entriesList; }; return RowCtrlCache; }()); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$1N = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __decorate$1x = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var ValueFormatterService = /** @class */ (function (_super) { __extends$1N(ValueFormatterService, _super); function ValueFormatterService() { return _super !== null && _super.apply(this, arguments) || this; } ValueFormatterService.prototype.formatValue = function (column, node, value, suppliedFormatter, useFormatterFromColumn) { if (useFormatterFromColumn === void 0) { useFormatterFromColumn = true; } var result = null; var formatter; var colDef = column.getColDef(); if (suppliedFormatter) { // use supplied formatter if provided, e.g. set filter items can have their own value formatters formatter = suppliedFormatter; } else if (useFormatterFromColumn) { formatter = colDef.valueFormatter; } if (formatter) { var params = { value: value, node: node, data: node ? node.data : null, colDef: colDef, column: column, api: this.gridOptionsService.api, columnApi: this.gridOptionsService.columnApi, context: this.gridOptionsService.context }; if (typeof formatter === 'function') { result = formatter(params); } else { result = this.expressionService.evaluate(formatter, params); } } else if (colDef.refData) { return colDef.refData[value] || ''; } // if we don't do this, then arrays get displayed as 1,2,3, but we want 1, 2, 3 (i.e. with spaces) if (result == null && Array.isArray(value)) { result = value.join(', '); } return result; }; __decorate$1x([ Autowired('expressionService') ], ValueFormatterService.prototype, "expressionService", void 0); ValueFormatterService = __decorate$1x([ Bean('valueFormatterService') ], ValueFormatterService); return ValueFormatterService; }(BeanStub)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$1O = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __decorate$1y = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var PinnedRowModel = /** @class */ (function (_super) { __extends$1O(PinnedRowModel, _super); function PinnedRowModel() { return _super !== null && _super.apply(this, arguments) || this; } PinnedRowModel.prototype.init = function () { this.setPinnedTopRowData(this.gridOptionsService.get('pinnedTopRowData')); this.setPinnedBottomRowData(this.gridOptionsService.get('pinnedBottomRowData')); }; PinnedRowModel.prototype.isEmpty = function (floating) { var rows = floating === 'top' ? this.pinnedTopRows : this.pinnedBottomRows; return missingOrEmpty(rows); }; PinnedRowModel.prototype.isRowsToRender = function (floating) { return !this.isEmpty(floating); }; PinnedRowModel.prototype.getRowAtPixel = function (pixel, floating) { var rows = floating === 'top' ? this.pinnedTopRows : this.pinnedBottomRows; if (missingOrEmpty(rows)) { return 0; // this should never happen, just in case, 0 is graceful failure } for (var i = 0; i < rows.length; i++) { var rowNode = rows[i]; var rowTopPixel = rowNode.rowTop + rowNode.rowHeight - 1; // only need to range check against the top pixel, as we are going through the list // in order, first row to hit the pixel wins if (rowTopPixel >= pixel) { return i; } } return rows.length - 1; }; PinnedRowModel.prototype.setPinnedTopRowData = function (rowData) { this.pinnedTopRows = this.createNodesFromData(rowData, true); var event = { type: Events.EVENT_PINNED_ROW_DATA_CHANGED }; this.eventService.dispatchEvent(event); }; PinnedRowModel.prototype.setPinnedBottomRowData = function (rowData) { this.pinnedBottomRows = this.createNodesFromData(rowData, false); var event = { type: Events.EVENT_PINNED_ROW_DATA_CHANGED }; this.eventService.dispatchEvent(event); }; PinnedRowModel.prototype.createNodesFromData = function (allData, isTop) { var _this = this; var rowNodes = []; if (allData) { var nextRowTop_1 = 0; allData.forEach(function (dataItem, index) { var rowNode = new RowNode(_this.beans); rowNode.data = dataItem; var idPrefix = isTop ? RowNode.ID_PREFIX_TOP_PINNED : RowNode.ID_PREFIX_BOTTOM_PINNED; rowNode.id = idPrefix + index; rowNode.rowPinned = isTop ? 'top' : 'bottom'; rowNode.setRowTop(nextRowTop_1); rowNode.setRowHeight(_this.gridOptionsService.getRowHeightForNode(rowNode).height); rowNode.setRowIndex(index); nextRowTop_1 += rowNode.rowHeight; rowNodes.push(rowNode); }); } return rowNodes; }; PinnedRowModel.prototype.getPinnedTopRowData = function () { return this.pinnedTopRows; }; PinnedRowModel.prototype.getPinnedBottomRowData = function () { return this.pinnedBottomRows; }; PinnedRowModel.prototype.getPinnedTopTotalHeight = function () { return this.getTotalHeight(this.pinnedTopRows); }; PinnedRowModel.prototype.getPinnedTopRowCount = function () { return this.pinnedTopRows ? this.pinnedTopRows.length : 0; }; PinnedRowModel.prototype.getPinnedBottomRowCount = function () { return this.pinnedBottomRows ? this.pinnedBottomRows.length : 0; }; PinnedRowModel.prototype.getPinnedTopRow = function (index) { return this.pinnedTopRows[index]; }; PinnedRowModel.prototype.getPinnedBottomRow = function (index) { return this.pinnedBottomRows[index]; }; PinnedRowModel.prototype.forEachPinnedTopRow = function (callback) { if (missingOrEmpty(this.pinnedTopRows)) { return; } this.pinnedTopRows.forEach(callback); }; PinnedRowModel.prototype.forEachPinnedBottomRow = function (callback) { if (missingOrEmpty(this.pinnedBottomRows)) { return; } this.pinnedBottomRows.forEach(callback); }; PinnedRowModel.prototype.getPinnedBottomTotalHeight = function () { return this.getTotalHeight(this.pinnedBottomRows); }; PinnedRowModel.prototype.getTotalHeight = function (rowNodes) { if (!rowNodes || rowNodes.length === 0) { return 0; } var lastNode = last(rowNodes); return lastNode.rowTop + lastNode.rowHeight; }; __decorate$1y([ Autowired('beans') ], PinnedRowModel.prototype, "beans", void 0); __decorate$1y([ PostConstruct ], PinnedRowModel.prototype, "init", null); PinnedRowModel = __decorate$1y([ Bean('pinnedRowModel') ], PinnedRowModel); return PinnedRowModel; }(BeanStub)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ (function (ServerSideTransactionResultStatus) { /** Transaction was successfully applied */ ServerSideTransactionResultStatus["Applied"] = "Applied"; /** * Store was not found, transaction not applied. * Either invalid route, or the parent row has not yet been expanded. */ ServerSideTransactionResultStatus["StoreNotFound"] = "StoreNotFound"; /** * Store is loading, transaction not applied. */ ServerSideTransactionResultStatus["StoreLoading"] = "StoreLoading"; /** * Store is loading (as max loads exceeded), transaction not applied. */ ServerSideTransactionResultStatus["StoreWaitingToLoad"] = "StoreWaitingToLoad"; /** * Store load attempt failed, transaction not applied. */ ServerSideTransactionResultStatus["StoreLoadingFailed"] = "StoreLoadingFailed"; /** * Store is type Partial, which doesn't accept transactions */ ServerSideTransactionResultStatus["StoreWrongType"] = "StoreWrongType"; /** * Transaction was cancelled, due to grid. * Callback isApplyServerSideTransaction() returning false */ ServerSideTransactionResultStatus["Cancelled"] = "Cancelled"; })(exports.ServerSideTransactionResultStatus || (exports.ServerSideTransactionResultStatus = {})); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ // when doing transactions, or change detection, and grouping is present // in the data, there is no need for the ClientSideRowModel to update each // group after an update, ony parts that were impacted by the change. // this class keeps track of all groups that were impacted by a transaction. // the the different CSRM operations (filter, sort etc) use the forEach method // to visit each group that was changed. var ChangedPath = /** @class */ (function () { function ChangedPath(keepingColumns, rootNode) { // whether changed path is active of not. it is active when a) doing // a transaction update or b) doing change detection. if we are doing // a CSRM refresh for other reasons (after sort or filter, or user calling // setRowData() without delta mode) then we are not active. we are also // marked as not active if secondary columns change in pivot (as this impacts // aggregations) this.active = true; // for each node in the change path, we also store which columns need // to be re-aggregated. this.nodeIdsToColumns = {}; // for quick lookup, all items in the change path are mapped by nodeId this.mapToItems = {}; this.keepingColumns = keepingColumns; this.pathRoot = { rowNode: rootNode, children: null }; this.mapToItems[rootNode.id] = this.pathRoot; } // can be set inactive by: // a) ClientSideRowModel, if no transactions or // b) PivotService, if secondary columns changed ChangedPath.prototype.setInactive = function () { this.active = false; }; ChangedPath.prototype.isActive = function () { return this.active; }; ChangedPath.prototype.depthFirstSearchChangedPath = function (pathItem, callback) { if (pathItem.children) { for (var i = 0; i < pathItem.children.length; i++) { this.depthFirstSearchChangedPath(pathItem.children[i], callback); } } callback(pathItem.rowNode); }; ChangedPath.prototype.depthFirstSearchEverything = function (rowNode, callback, traverseEverything) { if (rowNode.childrenAfterGroup) { for (var i = 0; i < rowNode.childrenAfterGroup.length; i++) { var childNode = rowNode.childrenAfterGroup[i]; if (childNode.childrenAfterGroup) { this.depthFirstSearchEverything(rowNode.childrenAfterGroup[i], callback, traverseEverything); } else if (traverseEverything) { callback(childNode); } } } callback(rowNode); }; // traverseLeafNodes -> used when NOT doing changed path, ie traversing everything. the callback // will be called for child nodes in addition to parent nodes. ChangedPath.prototype.forEachChangedNodeDepthFirst = function (callback, traverseLeafNodes, includeUnchangedNodes) { if (traverseLeafNodes === void 0) { traverseLeafNodes = false; } if (includeUnchangedNodes === void 0) { includeUnchangedNodes = false; } if (this.active && !includeUnchangedNodes) { // if we are active, then use the change path to callback // only for updated groups this.depthFirstSearchChangedPath(this.pathRoot, callback); } else { // we are not active, so callback for everything, walk the entire path this.depthFirstSearchEverything(this.pathRoot.rowNode, callback, traverseLeafNodes); } }; ChangedPath.prototype.executeFromRootNode = function (callback) { callback(this.pathRoot.rowNode); }; ChangedPath.prototype.createPathItems = function (rowNode) { var pointer = rowNode; var newEntryCount = 0; while (!this.mapToItems[pointer.id]) { var newEntry = { rowNode: pointer, children: null }; this.mapToItems[pointer.id] = newEntry; newEntryCount++; pointer = pointer.parent; } return newEntryCount; }; ChangedPath.prototype.populateColumnsMap = function (rowNode, columns) { var _this = this; if (!this.keepingColumns || !columns) { return; } var pointer = rowNode; while (pointer) { // if columns, add the columns in all the way to parent, merging // in any other columns that might be there already if (!this.nodeIdsToColumns[pointer.id]) { this.nodeIdsToColumns[pointer.id] = {}; } columns.forEach(function (col) { return _this.nodeIdsToColumns[pointer.id][col.getId()] = true; }); pointer = pointer.parent; } }; ChangedPath.prototype.linkPathItems = function (rowNode, newEntryCount) { var pointer = rowNode; for (var i = 0; i < newEntryCount; i++) { var thisItem = this.mapToItems[pointer.id]; var parentItem = this.mapToItems[pointer.parent.id]; if (!parentItem.children) { parentItem.children = []; } parentItem.children.push(thisItem); pointer = pointer.parent; } }; // called by // 1) change detection (provides cols) and // 2) groupStage if doing transaction update (doesn't provide cols) ChangedPath.prototype.addParentNode = function (rowNode, columns) { if (!rowNode || rowNode.isRowPinned()) { return; } // we cannot do both steps below in the same loop as // the second loop has a dependency on the first loop. // ie the hierarchy cannot be stitched up yet because // we don't have it built yet // create the new PathItem objects. var newEntryCount = this.createPathItems(rowNode); // link in the node items this.linkPathItems(rowNode, newEntryCount); // update columns this.populateColumnsMap(rowNode, columns); }; ChangedPath.prototype.canSkip = function (rowNode) { return this.active && !this.mapToItems[rowNode.id]; }; ChangedPath.prototype.getValueColumnsForNode = function (rowNode, valueColumns) { if (!this.keepingColumns) { return valueColumns; } var colsForThisNode = this.nodeIdsToColumns[rowNode.id]; var result = valueColumns.filter(function (col) { return colsForThisNode[col.getId()]; }); return result; }; ChangedPath.prototype.getNotValueColumnsForNode = function (rowNode, valueColumns) { if (!this.keepingColumns) { return null; } var colsForThisNode = this.nodeIdsToColumns[rowNode.id]; var result = valueColumns.filter(function (col) { return !colsForThisNode[col.getId()]; }); return result; }; return ChangedPath; }()); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$1P = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var RowNodeBlock = /** @class */ (function (_super) { __extends$1P(RowNodeBlock, _super); function RowNodeBlock(id) { var _this = _super.call(this) || this; _this.state = RowNodeBlock.STATE_WAITING_TO_LOAD; _this.version = 0; _this.id = id; return _this; } RowNodeBlock.prototype.getId = function () { return this.id; }; RowNodeBlock.prototype.load = function () { this.state = RowNodeBlock.STATE_LOADING; this.loadFromDatasource(); }; RowNodeBlock.prototype.getVersion = function () { return this.version; }; RowNodeBlock.prototype.setStateWaitingToLoad = function () { // in case any current loads in progress, this will have their results ignored this.version++; this.state = RowNodeBlock.STATE_WAITING_TO_LOAD; }; RowNodeBlock.prototype.getState = function () { return this.state; }; RowNodeBlock.prototype.pageLoadFailed = function (version) { var requestMostRecentAndLive = this.isRequestMostRecentAndLive(version); if (requestMostRecentAndLive) { this.state = RowNodeBlock.STATE_FAILED; this.processServerFail(); } this.dispatchLoadCompleted(false); }; RowNodeBlock.prototype.success = function (version, params) { this.successCommon(version, params); }; RowNodeBlock.prototype.pageLoaded = function (version, rows, lastRow) { this.successCommon(version, { rowData: rows, rowCount: lastRow }); }; RowNodeBlock.prototype.isRequestMostRecentAndLive = function (version) { // thisIsMostRecentRequest - if block was refreshed, then another request // could of been sent after this one. var thisIsMostRecentRequest = version === this.version; // weAreNotDestroyed - if InfiniteStore is purged, then blocks are destroyed // and new blocks created. so data loads of old blocks are discarded. var weAreNotDestroyed = this.isAlive(); return thisIsMostRecentRequest && weAreNotDestroyed; }; RowNodeBlock.prototype.successCommon = function (version, params) { // need to dispatch load complete before processing the data, as PaginationComp checks // RowNodeBlockLoader to see if it is still loading, so the RowNodeBlockLoader needs to // be updated first (via LoadComplete event) before PaginationComp updates (via processServerResult method) this.dispatchLoadCompleted(); var requestMostRecentAndLive = this.isRequestMostRecentAndLive(version); if (requestMostRecentAndLive) { this.state = RowNodeBlock.STATE_LOADED; this.processServerResult(params); } }; RowNodeBlock.prototype.dispatchLoadCompleted = function (success) { if (success === void 0) { success = true; } // we fire event regardless of processing data or now, as we want // the concurrentLoadRequests count to be reduced in BlockLoader var event = { type: RowNodeBlock.EVENT_LOAD_COMPLETE, success: success, block: this }; this.dispatchEvent(event); }; RowNodeBlock.EVENT_LOAD_COMPLETE = 'loadComplete'; RowNodeBlock.STATE_WAITING_TO_LOAD = 'needsLoading'; RowNodeBlock.STATE_LOADING = 'loading'; RowNodeBlock.STATE_LOADED = 'loaded'; RowNodeBlock.STATE_FAILED = 'failed'; return RowNodeBlock; }(BeanStub)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$1Q = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __decorate$1z = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var __param$3 = (undefined && undefined.__param) || function (paramIndex, decorator) { return function (target, key) { decorator(target, key, paramIndex); } }; var RowNodeBlockLoader = /** @class */ (function (_super) { __extends$1Q(RowNodeBlockLoader, _super); function RowNodeBlockLoader() { var _this = _super !== null && _super.apply(this, arguments) || this; _this.activeBlockLoadsCount = 0; _this.blocks = []; _this.active = true; return _this; } RowNodeBlockLoader_1 = RowNodeBlockLoader; RowNodeBlockLoader.prototype.postConstruct = function () { this.maxConcurrentRequests = this.getMaxConcurrentDatasourceRequests(); var blockLoadDebounceMillis = this.gridOptionsService.getNum('blockLoadDebounceMillis'); if (blockLoadDebounceMillis && blockLoadDebounceMillis > 0) { this.checkBlockToLoadDebounce = _.debounce(this.performCheckBlocksToLoad.bind(this), blockLoadDebounceMillis); } }; RowNodeBlockLoader.prototype.setBeans = function (loggerFactory) { this.logger = loggerFactory.create('RowNodeBlockLoader'); }; RowNodeBlockLoader.prototype.getMaxConcurrentDatasourceRequests = function () { var res = this.gridOptionsService.getNum('maxConcurrentDatasourceRequests'); if (res == null) { return 2; } // 2 is the default if (res <= 0) { return; } // negative number, eg -1, means no max restriction return res; }; RowNodeBlockLoader.prototype.addBlock = function (block) { this.blocks.push(block); // note that we do not remove this listener when removing the block. this is because the // cache can get destroyed (and containing blocks) when a block is loading. however the loading block // is still counted as an active loading block and we must decrement activeBlockLoadsCount when it finishes. block.addEventListener(RowNodeBlock.EVENT_LOAD_COMPLETE, this.loadComplete.bind(this)); this.checkBlockToLoad(); }; RowNodeBlockLoader.prototype.removeBlock = function (block) { _.removeFromArray(this.blocks, block); }; RowNodeBlockLoader.prototype.destroy = function () { _super.prototype.destroy.call(this); this.active = false; }; RowNodeBlockLoader.prototype.loadComplete = function () { this.activeBlockLoadsCount--; this.checkBlockToLoad(); this.dispatchEvent({ type: RowNodeBlockLoader_1.BLOCK_LOADED_EVENT }); if (this.activeBlockLoadsCount == 0) { this.dispatchEvent({ type: RowNodeBlockLoader_1.BLOCK_LOADER_FINISHED_EVENT }); } }; RowNodeBlockLoader.prototype.checkBlockToLoad = function () { if (this.checkBlockToLoadDebounce) { this.checkBlockToLoadDebounce(); } else { this.performCheckBlocksToLoad(); } }; RowNodeBlockLoader.prototype.performCheckBlocksToLoad = function () { if (!this.active) { return; } this.printCacheStatus(); if (this.maxConcurrentRequests != null && this.activeBlockLoadsCount >= this.maxConcurrentRequests) { this.logger.log("checkBlockToLoad: max loads exceeded"); return; } var loadAvailability = this.getAvailableLoadingCount(); var blocksToLoad = this.blocks.filter(function (block) { return (block.getState() === RowNodeBlock.STATE_WAITING_TO_LOAD); }).slice(0, loadAvailability); this.registerLoads(blocksToLoad.length); blocksToLoad.forEach(function (block) { return block.load(); }); this.printCacheStatus(); }; RowNodeBlockLoader.prototype.getBlockState = function () { if (this.gridOptionsService.isRowModelType('serverSide')) { var ssrm = this.rowModel; return ssrm.getBlockStates(); } var result = {}; this.blocks.forEach(function (block) { var _a = block.getBlockStateJson(), id = _a.id, state = _a.state; result[id] = state; }); return result; }; RowNodeBlockLoader.prototype.printCacheStatus = function () { if (this.logger.isLogging()) { this.logger.log("printCacheStatus: activePageLoadsCount = " + this.activeBlockLoadsCount + "," + (" blocks = " + JSON.stringify(this.getBlockState()))); } }; RowNodeBlockLoader.prototype.isLoading = function () { return this.activeBlockLoadsCount > 0; }; RowNodeBlockLoader.prototype.registerLoads = function (count) { this.activeBlockLoadsCount += count; }; RowNodeBlockLoader.prototype.getAvailableLoadingCount = function () { return this.maxConcurrentRequests !== undefined ? this.maxConcurrentRequests - this.activeBlockLoadsCount : undefined; }; var RowNodeBlockLoader_1; RowNodeBlockLoader.BLOCK_LOADED_EVENT = 'blockLoaded'; RowNodeBlockLoader.BLOCK_LOADER_FINISHED_EVENT = 'blockLoaderFinished'; __decorate$1z([ Autowired('rowModel') ], RowNodeBlockLoader.prototype, "rowModel", void 0); __decorate$1z([ PostConstruct ], RowNodeBlockLoader.prototype, "postConstruct", null); __decorate$1z([ __param$3(0, Qualifier('loggerFactory')) ], RowNodeBlockLoader.prototype, "setBeans", null); RowNodeBlockLoader = RowNodeBlockLoader_1 = __decorate$1z([ Bean('rowNodeBlockLoader') ], RowNodeBlockLoader); return RowNodeBlockLoader; }(BeanStub)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$1R = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __decorate$1A = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var PaginationProxy = /** @class */ (function (_super) { __extends$1R(PaginationProxy, _super); function PaginationProxy() { var _this = _super !== null && _super.apply(this, arguments) || this; _this.currentPage = 0; _this.topDisplayedRowIndex = 0; _this.bottomDisplayedRowIndex = 0; _this.pixelOffset = 0; _this.masterRowCount = 0; return _this; } PaginationProxy.prototype.postConstruct = function () { this.active = this.gridOptionsService.is('pagination'); this.paginateChildRows = this.isPaginateChildRows(); this.addManagedListener(this.eventService, Events.EVENT_MODEL_UPDATED, this.onModelUpdated.bind(this)); this.addManagedPropertyListener('pagination', this.onPaginationPageSizeChanged.bind(this)); this.addManagedPropertyListener('paginationPageSize', this.onPaginationPageSizeChanged.bind(this)); this.onModelUpdated(); }; PaginationProxy.prototype.ensureRowHeightsValid = function (startPixel, endPixel, startLimitIndex, endLimitIndex) { var res = this.rowModel.ensureRowHeightsValid(startPixel, endPixel, this.getPageFirstRow(), this.getPageLastRow()); if (res) { this.calculatePages(); } return res; }; PaginationProxy.prototype.isPaginateChildRows = function () { var shouldPaginate = this.gridOptionsService.is('groupRemoveSingleChildren') || this.gridOptionsService.is('groupRemoveLowestSingleChildren'); if (shouldPaginate) { return true; } return this.gridOptionsService.is('paginateChildRows'); }; PaginationProxy.prototype.onModelUpdated = function (modelUpdatedEvent) { this.calculatePages(); var paginationChangedEvent = { type: Events.EVENT_PAGINATION_CHANGED, animate: modelUpdatedEvent ? modelUpdatedEvent.animate : false, newData: modelUpdatedEvent ? modelUpdatedEvent.newData : false, newPage: modelUpdatedEvent ? modelUpdatedEvent.newPage : false, keepRenderedRows: modelUpdatedEvent ? modelUpdatedEvent.keepRenderedRows : false }; this.eventService.dispatchEvent(paginationChangedEvent); }; PaginationProxy.prototype.onPaginationPageSizeChanged = function () { this.active = this.gridOptionsService.is('pagination'); this.calculatePages(); var paginationChangedEvent = { type: Events.EVENT_PAGINATION_CHANGED, animate: false, newData: false, newPage: false, // important to keep rendered rows, otherwise every time grid is resized, // we would destroy all the rows. keepRenderedRows: true }; this.eventService.dispatchEvent(paginationChangedEvent); }; PaginationProxy.prototype.goToPage = function (page) { if (!this.active || this.currentPage === page || typeof this.currentPage !== 'number') { return; } this.currentPage = page; var event = { type: Events.EVENT_MODEL_UPDATED, animate: false, keepRenderedRows: false, newData: false, newPage: true }; this.onModelUpdated(event); }; PaginationProxy.prototype.getPixelOffset = function () { return this.pixelOffset; }; PaginationProxy.prototype.getRow = function (index) { return this.rowModel.getRow(index); }; PaginationProxy.prototype.getRowNode = function (id) { return this.rowModel.getRowNode(id); }; PaginationProxy.prototype.getRowIndexAtPixel = function (pixel) { return this.rowModel.getRowIndexAtPixel(pixel); }; PaginationProxy.prototype.getCurrentPageHeight = function () { if (missing(this.topRowBounds) || missing(this.bottomRowBounds)) { return 0; } return Math.max(this.bottomRowBounds.rowTop + this.bottomRowBounds.rowHeight - this.topRowBounds.rowTop, 0); }; PaginationProxy.prototype.getCurrentPagePixelRange = function () { var pageFirstPixel = this.topRowBounds ? this.topRowBounds.rowTop : 0; var pageLastPixel = this.bottomRowBounds ? this.bottomRowBounds.rowTop + this.bottomRowBounds.rowHeight : 0; return { pageFirstPixel: pageFirstPixel, pageLastPixel: pageLastPixel }; }; PaginationProxy.prototype.isRowPresent = function (rowNode) { if (!this.rowModel.isRowPresent(rowNode)) { return false; } var nodeIsInPage = rowNode.rowIndex >= this.topDisplayedRowIndex && rowNode.rowIndex <= this.bottomDisplayedRowIndex; return nodeIsInPage; }; PaginationProxy.prototype.isEmpty = function () { return this.rowModel.isEmpty(); }; PaginationProxy.prototype.isRowsToRender = function () { return this.rowModel.isRowsToRender(); }; PaginationProxy.prototype.forEachNode = function (callback) { return this.rowModel.forEachNode(callback); }; PaginationProxy.prototype.forEachNodeOnPage = function (callback) { var firstRow = this.getPageFirstRow(); var lastRow = this.getPageLastRow(); for (var i = firstRow; i <= lastRow; i++) { var node = this.getRow(i); if (node) { callback(node); } } }; PaginationProxy.prototype.getType = function () { return this.rowModel.getType(); }; PaginationProxy.prototype.getRowBounds = function (index) { var res = this.rowModel.getRowBounds(index); res.rowIndex = index; return res; }; PaginationProxy.prototype.getPageFirstRow = function () { return this.topRowBounds ? this.topRowBounds.rowIndex : -1; }; PaginationProxy.prototype.getPageLastRow = function () { return this.bottomRowBounds ? this.bottomRowBounds.rowIndex : -1; }; PaginationProxy.prototype.getRowCount = function () { return this.rowModel.getRowCount(); }; PaginationProxy.prototype.getPageForIndex = function (index) { return Math.floor(index / this.pageSize); }; PaginationProxy.prototype.goToPageWithIndex = function (index) { if (!this.active) { return; } var pageNumber = this.getPageForIndex(index); this.goToPage(pageNumber); }; PaginationProxy.prototype.isRowInPage = function (row) { if (!this.active) { return true; } var rowPage = this.getPageForIndex(row.rowIndex); return rowPage === this.currentPage; }; PaginationProxy.prototype.isLastPageFound = function () { return this.rowModel.isLastRowIndexKnown(); }; PaginationProxy.prototype.getCurrentPage = function () { return this.currentPage; }; PaginationProxy.prototype.goToNextPage = function () { this.goToPage(this.currentPage + 1); }; PaginationProxy.prototype.goToPreviousPage = function () { this.goToPage(this.currentPage - 1); }; PaginationProxy.prototype.goToFirstPage = function () { this.goToPage(0); }; PaginationProxy.prototype.goToLastPage = function () { var rowCount = this.rowModel.getRowCount(); var lastPage = Math.floor(rowCount / this.pageSize); this.goToPage(lastPage); }; PaginationProxy.prototype.getPageSize = function () { return this.pageSize; }; PaginationProxy.prototype.getTotalPages = function () { return this.totalPages; }; PaginationProxy.prototype.setPageSize = function () { // show put this into super class this.pageSize = this.gridOptionsService.getNum('paginationPageSize'); if (this.pageSize == null || this.pageSize < 1) { this.pageSize = 100; } }; PaginationProxy.prototype.calculatePages = function () { if (this.active) { this.setPageSize(); if (this.paginateChildRows) { this.calculatePagesAllRows(); } else { this.calculatePagesMasterRowsOnly(); } } else { this.calculatedPagesNotActive(); } this.topRowBounds = this.rowModel.getRowBounds(this.topDisplayedRowIndex); if (this.topRowBounds) { this.topRowBounds.rowIndex = this.topDisplayedRowIndex; } this.bottomRowBounds = this.rowModel.getRowBounds(this.bottomDisplayedRowIndex); if (this.bottomRowBounds) { this.bottomRowBounds.rowIndex = this.bottomDisplayedRowIndex; } this.setPixelOffset(exists(this.topRowBounds) ? this.topRowBounds.rowTop : 0); }; PaginationProxy.prototype.setPixelOffset = function (value) { if (this.pixelOffset === value) { return; } this.pixelOffset = value; this.eventService.dispatchEvent({ type: Events.EVENT_PAGINATION_PIXEL_OFFSET_CHANGED }); }; PaginationProxy.prototype.setZeroRows = function () { this.masterRowCount = 0; this.topDisplayedRowIndex = 0; this.bottomDisplayedRowIndex = -1; this.currentPage = 0; this.totalPages = 0; }; PaginationProxy.prototype.adjustCurrentPageIfInvalid = function () { if (this.currentPage >= this.totalPages) { this.currentPage = this.totalPages - 1; } if (!isFinite(this.currentPage) || isNaN(this.currentPage) || this.currentPage < 0) { this.currentPage = 0; } }; PaginationProxy.prototype.calculatePagesMasterRowsOnly = function () { // const csrm = this.rowModel; // const rootNode = csrm.getRootNode(); // const masterRows = rootNode.childrenAfterSort; this.masterRowCount = this.rowModel.getTopLevelRowCount(); // we say <=0 (rather than =0) as viewport returns -1 when no rows if (this.masterRowCount <= 0) { this.setZeroRows(); return; } var masterLastRowIndex = this.masterRowCount - 1; this.totalPages = Math.floor((masterLastRowIndex) / this.pageSize) + 1; this.adjustCurrentPageIfInvalid(); var masterPageStartIndex = this.pageSize * this.currentPage; var masterPageEndIndex = (this.pageSize * (this.currentPage + 1)) - 1; if (masterPageEndIndex > masterLastRowIndex) { masterPageEndIndex = masterLastRowIndex; } this.topDisplayedRowIndex = this.rowModel.getTopLevelRowDisplayedIndex(masterPageStartIndex); // masterRows[masterPageStartIndex].rowIndex; if (masterPageEndIndex === masterLastRowIndex) { // if showing the last master row, then we want to show the very last row of the model this.bottomDisplayedRowIndex = this.rowModel.getRowCount() - 1; } else { var firstIndexNotToShow = this.rowModel.getTopLevelRowDisplayedIndex(masterPageEndIndex + 1); //masterRows[masterPageEndIndex + 1].rowIndex; // this gets the index of the last child - eg current row is open, we want to display all children, // the index of the last child is one less than the index of the next parent row. this.bottomDisplayedRowIndex = firstIndexNotToShow - 1; } }; PaginationProxy.prototype.getMasterRowCount = function () { return this.masterRowCount; }; PaginationProxy.prototype.calculatePagesAllRows = function () { this.masterRowCount = this.rowModel.getRowCount(); if (this.masterRowCount === 0) { this.setZeroRows(); return; } var maxRowIndex = this.masterRowCount - 1; this.totalPages = Math.floor((maxRowIndex) / this.pageSize) + 1; this.adjustCurrentPageIfInvalid(); this.topDisplayedRowIndex = this.pageSize * this.currentPage; this.bottomDisplayedRowIndex = (this.pageSize * (this.currentPage + 1)) - 1; if (this.bottomDisplayedRowIndex > maxRowIndex) { this.bottomDisplayedRowIndex = maxRowIndex; } }; PaginationProxy.prototype.calculatedPagesNotActive = function () { this.pageSize = this.rowModel.getRowCount(); this.totalPages = 1; this.currentPage = 0; this.topDisplayedRowIndex = 0; this.bottomDisplayedRowIndex = this.rowModel.getRowCount() - 1; }; __decorate$1A([ Autowired('rowModel') ], PaginationProxy.prototype, "rowModel", void 0); __decorate$1A([ PostConstruct ], PaginationProxy.prototype, "postConstruct", null); PaginationProxy = __decorate$1A([ Bean('paginationProxy') ], PaginationProxy); return PaginationProxy; }(BeanStub)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$1S = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __decorate$1B = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var StylingService = /** @class */ (function (_super) { __extends$1S(StylingService, _super); function StylingService() { return _super !== null && _super.apply(this, arguments) || this; } StylingService.prototype.processAllCellClasses = function (colDef, params, onApplicableClass, onNotApplicableClass) { this.processClassRules(colDef.cellClassRules, params, onApplicableClass, onNotApplicableClass); this.processStaticCellClasses(colDef, params, onApplicableClass); }; StylingService.prototype.processClassRules = function (classRules, params, onApplicableClass, onNotApplicableClass) { if (classRules == null) { return; } var classNames = Object.keys(classRules); var classesToApply = {}; var classesToRemove = {}; var _loop_1 = function (i) { var className = classNames[i]; var rule = classRules[className]; var resultOfRule; if (typeof rule === 'string') { resultOfRule = this_1.expressionService.evaluate(rule, params); } else if (typeof rule === 'function') { resultOfRule = rule(params); } // in case className = 'my-class1 my-class2', we need to split into individual class names className.split(' ').forEach(function (singleClass) { if (singleClass == null || singleClass.trim() == '') { return; } resultOfRule ? classesToApply[singleClass] = true : classesToRemove[singleClass] = true; }); }; var this_1 = this; for (var i = 0; i < classNames.length; i++) { _loop_1(i); } // we remove all classes first, then add all classes second, // in case a class appears in more than one rule, this means it will be added // if appears in at least one truthy rule if (onNotApplicableClass) { Object.keys(classesToRemove).forEach(onNotApplicableClass); } Object.keys(classesToApply).forEach(onApplicableClass); }; StylingService.prototype.getStaticCellClasses = function (colDef, params) { var cellClass = colDef.cellClass; if (!cellClass) { return []; } var classOrClasses; if (typeof cellClass === 'function') { var cellClassFunc = cellClass; classOrClasses = cellClassFunc(params); } else { classOrClasses = cellClass; } if (typeof classOrClasses === 'string') { classOrClasses = [classOrClasses]; } return classOrClasses || []; }; StylingService.prototype.processStaticCellClasses = function (colDef, params, onApplicableClass) { var classOrClasses = this.getStaticCellClasses(colDef, params); classOrClasses.forEach(function (cssClassItem) { onApplicableClass(cssClassItem); }); }; __decorate$1B([ Autowired('expressionService') ], StylingService.prototype, "expressionService", void 0); StylingService = __decorate$1B([ Bean('stylingService') ], StylingService); return StylingService; }(BeanStub)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$1T = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var AgToggleButton = /** @class */ (function (_super) { __extends$1T(AgToggleButton, _super); function AgToggleButton(config) { return _super.call(this, config, 'ag-toggle-button') || this; } AgToggleButton.prototype.setValue = function (value, silent) { _super.prototype.setValue.call(this, value, silent); this.addOrRemoveCssClass('ag-selected', this.getValue()); return this; }; return AgToggleButton; }(AgCheckbox)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$1U = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var AgInputTextArea = /** @class */ (function (_super) { __extends$1U(AgInputTextArea, _super); function AgInputTextArea(config) { return _super.call(this, config, 'ag-text-area', null, 'textarea') || this; } AgInputTextArea.prototype.setValue = function (value, silent) { var ret = _super.prototype.setValue.call(this, value, silent); this.eInput.value = value; return ret; }; AgInputTextArea.prototype.setCols = function (cols) { this.eInput.cols = cols; return this; }; AgInputTextArea.prototype.setRows = function (rows) { this.eInput.rows = rows; return this; }; return AgInputTextArea; }(AgAbstractInputField)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$1V = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var AgInputRange = /** @class */ (function (_super) { __extends$1V(AgInputRange, _super); function AgInputRange(config) { return _super.call(this, config, 'ag-range-field', 'range') || this; } AgInputRange.prototype.postConstruct = function () { _super.prototype.postConstruct.call(this); var _a = this.config, min = _a.min, max = _a.max, step = _a.step; if (min != null) { this.setMinValue(min); } if (max != null) { this.setMaxValue(max); } this.setStep(step || 1); }; AgInputRange.prototype.addInputListeners = function () { var _this = this; this.addManagedListener(this.eInput, 'input', function (e) { var value = e.target.value; _this.setValue(value); }); }; AgInputRange.prototype.setMinValue = function (value) { this.min = value; this.eInput.setAttribute('min', value.toString()); return this; }; AgInputRange.prototype.setMaxValue = function (value) { this.max = value; this.eInput.setAttribute('max', value.toString()); return this; }; AgInputRange.prototype.setStep = function (value) { this.eInput.setAttribute('step', value.toString()); return this; }; AgInputRange.prototype.setValue = function (value, silent) { if (this.min != null) { value = Math.max(parseFloat(value), this.min).toString(); } if (this.max != null) { value = Math.min(parseFloat(value), this.max).toString(); } var ret = _super.prototype.setValue.call(this, value, silent); this.eInput.value = value; return ret; }; return AgInputRange; }(AgAbstractInputField)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$1W = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __decorate$1C = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var AgSlider = /** @class */ (function (_super) { __extends$1W(AgSlider, _super); function AgSlider(config) { var _this = _super.call(this, config, AgSlider.TEMPLATE) || this; _this.labelAlignment = 'top'; return _this; } AgSlider.prototype.init = function () { this.eSlider.addCssClass('ag-slider-field'); }; AgSlider.prototype.onValueChange = function (callbackFn) { var _this = this; var eventChanged = AgAbstractField.EVENT_CHANGED; this.addManagedListener(this.eText, eventChanged, function () { var textValue = parseFloat(_this.eText.getValue()); _this.eSlider.setValue(textValue.toString(), true); callbackFn(textValue || 0); }); this.addManagedListener(this.eSlider, eventChanged, function () { var sliderValue = _this.eSlider.getValue(); _this.eText.setValue(sliderValue, true); callbackFn(parseFloat(sliderValue)); }); return this; }; AgSlider.prototype.setSliderWidth = function (width) { this.eSlider.setWidth(width); return this; }; AgSlider.prototype.setTextFieldWidth = function (width) { this.eText.setWidth(width); return this; }; AgSlider.prototype.setMinValue = function (minValue) { this.eSlider.setMinValue(minValue); this.eText.setMin(minValue); return this; }; AgSlider.prototype.setMaxValue = function (maxValue) { this.eSlider.setMaxValue(maxValue); this.eText.setMax(maxValue); return this; }; AgSlider.prototype.getValue = function () { return this.eText.getValue(); }; AgSlider.prototype.setValue = function (value) { if (this.getValue() === value) { return this; } this.eText.setValue(value, true); this.eSlider.setValue(value, true); this.dispatchEvent({ type: AgAbstractField.EVENT_CHANGED }); return this; }; AgSlider.prototype.setStep = function (step) { this.eSlider.setStep(step); this.eText.setStep(step); return this; }; AgSlider.TEMPLATE = "
\n \n
\n \n \n
\n
"; __decorate$1C([ RefSelector('eLabel') ], AgSlider.prototype, "eLabel", void 0); __decorate$1C([ RefSelector('eSlider') ], AgSlider.prototype, "eSlider", void 0); __decorate$1C([ RefSelector('eText') ], AgSlider.prototype, "eText", void 0); __decorate$1C([ PostConstruct ], AgSlider.prototype, "init", null); return AgSlider; }(AgAbstractLabel)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$1X = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __decorate$1D = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var AgGroupComponent = /** @class */ (function (_super) { __extends$1X(AgGroupComponent, _super); function AgGroupComponent(params) { if (params === void 0) { params = {}; } var _this = _super.call(this, AgGroupComponent.getTemplate(params)) || this; _this.suppressEnabledCheckbox = true; _this.suppressOpenCloseIcons = false; var title = params.title, enabled = params.enabled, items = params.items, suppressEnabledCheckbox = params.suppressEnabledCheckbox, suppressOpenCloseIcons = params.suppressOpenCloseIcons; _this.title = title; _this.cssIdentifier = params.cssIdentifier || 'default'; _this.enabled = enabled != null ? enabled : true; _this.items = items || []; _this.alignItems = params.alignItems || 'center'; if (suppressEnabledCheckbox != null) { _this.suppressEnabledCheckbox = suppressEnabledCheckbox; } if (suppressOpenCloseIcons != null) { _this.suppressOpenCloseIcons = suppressOpenCloseIcons; } return _this; } AgGroupComponent.getTemplate = function (params) { var cssIdentifier = params.cssIdentifier || 'default'; var direction = params.direction || 'vertical'; return /* html */ "
\n
\n \n \n \n
\n
\n \n
\n
\n
"; }; AgGroupComponent.prototype.postConstruct = function () { if (this.items.length) { var initialItems = this.items; this.items = []; this.addItems(initialItems); } var localeTextFunc = this.localeService.getLocaleTextFunc(); this.cbGroupEnabled.setLabel(localeTextFunc('enabled', 'Enabled')); if (this.title) { this.setTitle(this.title); } if (this.enabled) { this.setEnabled(this.enabled); } this.setAlignItems(this.alignItems); this.hideEnabledCheckbox(this.suppressEnabledCheckbox); this.hideOpenCloseIcons(this.suppressOpenCloseIcons); this.setupExpandContract(); this.refreshAriaStatus(); this.refreshChildDisplay(); }; AgGroupComponent.prototype.setupExpandContract = function () { var _this = this; this.eGroupClosedIcon.appendChild(createIcon('columnSelectClosed', this.gridOptionsService, null)); this.eGroupOpenedIcon.appendChild(createIcon('columnSelectOpen', this.gridOptionsService, null)); this.addManagedListener(this.eTitleBar, 'click', function () { return _this.toggleGroupExpand(); }); this.addManagedListener(this.eTitleBar, 'keydown', function (e) { switch (e.key) { case KeyCode.ENTER: case KeyCode.SPACE: e.preventDefault(); _this.toggleGroupExpand(); break; case KeyCode.RIGHT: case KeyCode.LEFT: e.preventDefault(); _this.toggleGroupExpand(e.key === KeyCode.RIGHT); break; } }); }; AgGroupComponent.prototype.refreshAriaStatus = function () { if (!this.suppressOpenCloseIcons) { setAriaExpanded(this.eTitleBar, this.expanded); } }; AgGroupComponent.prototype.refreshChildDisplay = function () { var showIcon = !this.suppressOpenCloseIcons; setDisplayed(this.eToolbar, this.expanded && !this.suppressEnabledCheckbox); setDisplayed(this.eGroupOpenedIcon, showIcon && this.expanded); setDisplayed(this.eGroupClosedIcon, showIcon && !this.expanded); }; AgGroupComponent.prototype.isExpanded = function () { return this.expanded; }; AgGroupComponent.prototype.setAlignItems = function (alignment) { if (this.alignItems !== alignment) { this.removeCssClass("ag-group-item-alignment-" + this.alignItems); } this.alignItems = alignment; var newCls = "ag-group-item-alignment-" + this.alignItems; this.addCssClass(newCls); return this; }; AgGroupComponent.prototype.toggleGroupExpand = function (expanded) { if (this.suppressOpenCloseIcons) { this.expanded = true; this.refreshChildDisplay(); setDisplayed(this.eContainer, true); return this; } expanded = expanded != null ? expanded : !this.expanded; if (this.expanded === expanded) { return this; } this.expanded = expanded; this.refreshAriaStatus(); this.refreshChildDisplay(); setDisplayed(this.eContainer, expanded); this.dispatchEvent({ type: this.expanded ? AgGroupComponent.EVENT_EXPANDED : AgGroupComponent.EVENT_COLLAPSED }); return this; }; AgGroupComponent.prototype.addItems = function (items) { var _this = this; items.forEach(function (item) { return _this.addItem(item); }); }; AgGroupComponent.prototype.addItem = function (item) { var container = this.eContainer; var el = item instanceof Component ? item.getGui() : item; el.classList.add('ag-group-item', "ag-" + this.cssIdentifier + "-group-item"); container.appendChild(el); this.items.push(el); }; AgGroupComponent.prototype.hideItem = function (hide, index) { var itemToHide = this.items[index]; setDisplayed(itemToHide, !hide); }; AgGroupComponent.prototype.setTitle = function (title) { this.eTitle.innerText = title; return this; }; AgGroupComponent.prototype.addCssClassToTitleBar = function (cssClass) { this.eTitleBar.classList.add(cssClass); }; AgGroupComponent.prototype.setEnabled = function (enabled, skipToggle) { this.enabled = enabled; this.refreshDisabledStyles(); this.toggleGroupExpand(enabled); if (!skipToggle) { this.cbGroupEnabled.setValue(enabled); } return this; }; AgGroupComponent.prototype.isEnabled = function () { return this.enabled; }; AgGroupComponent.prototype.onEnableChange = function (callbackFn) { var _this = this; this.cbGroupEnabled.onValueChange(function (newSelection) { _this.setEnabled(newSelection, true); callbackFn(newSelection); }); return this; }; AgGroupComponent.prototype.hideEnabledCheckbox = function (hide) { this.suppressEnabledCheckbox = hide; this.refreshChildDisplay(); this.refreshDisabledStyles(); return this; }; AgGroupComponent.prototype.hideOpenCloseIcons = function (hide) { this.suppressOpenCloseIcons = hide; if (hide) { this.toggleGroupExpand(true); } return this; }; AgGroupComponent.prototype.refreshDisabledStyles = function () { this.addOrRemoveCssClass('ag-disabled', !this.enabled); if (this.suppressEnabledCheckbox && !this.enabled) { this.eTitleBar.classList.add('ag-disabled-group-title-bar'); this.eTitleBar.removeAttribute('tabindex'); } else { this.eTitleBar.classList.remove('ag-disabled-group-title-bar'); this.eTitleBar.setAttribute('tabindex', '0'); } this.eContainer.classList.toggle('ag-disabled-group-container', !this.enabled); }; AgGroupComponent.EVENT_EXPANDED = 'expanded'; AgGroupComponent.EVENT_COLLAPSED = 'collapsed'; __decorate$1D([ RefSelector('eTitleBar') ], AgGroupComponent.prototype, "eTitleBar", void 0); __decorate$1D([ RefSelector('eGroupOpenedIcon') ], AgGroupComponent.prototype, "eGroupOpenedIcon", void 0); __decorate$1D([ RefSelector('eGroupClosedIcon') ], AgGroupComponent.prototype, "eGroupClosedIcon", void 0); __decorate$1D([ RefSelector('eToolbar') ], AgGroupComponent.prototype, "eToolbar", void 0); __decorate$1D([ RefSelector('cbGroupEnabled') ], AgGroupComponent.prototype, "cbGroupEnabled", void 0); __decorate$1D([ RefSelector('eTitle') ], AgGroupComponent.prototype, "eTitle", void 0); __decorate$1D([ RefSelector('eContainer') ], AgGroupComponent.prototype, "eContainer", void 0); __decorate$1D([ PostConstruct ], AgGroupComponent.prototype, "postConstruct", null); return AgGroupComponent; }(Component)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$1Y = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __decorate$1E = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; (function (TabGuardClassNames) { TabGuardClassNames["TAB_GUARD"] = "ag-tab-guard"; TabGuardClassNames["TAB_GUARD_TOP"] = "ag-tab-guard-top"; TabGuardClassNames["TAB_GUARD_BOTTOM"] = "ag-tab-guard-bottom"; })(exports.TabGuardClassNames || (exports.TabGuardClassNames = {})); var TabGuardCtrl = /** @class */ (function (_super) { __extends$1Y(TabGuardCtrl, _super); function TabGuardCtrl(params) { var _this = _super.call(this) || this; _this.skipTabGuardFocus = false; var comp = params.comp, eTopGuard = params.eTopGuard, eBottomGuard = params.eBottomGuard, focusInnerElement = params.focusInnerElement, onFocusIn = params.onFocusIn, onFocusOut = params.onFocusOut, shouldStopEventPropagation = params.shouldStopEventPropagation, onTabKeyDown = params.onTabKeyDown, handleKeyDown = params.handleKeyDown, eFocusableElement = params.eFocusableElement; _this.comp = comp; _this.eTopGuard = eTopGuard; _this.eBottomGuard = eBottomGuard; _this.providedFocusInnerElement = focusInnerElement; _this.eFocusableElement = eFocusableElement; _this.providedFocusIn = onFocusIn; _this.providedFocusOut = onFocusOut; _this.providedShouldStopEventPropagation = shouldStopEventPropagation; _this.providedOnTabKeyDown = onTabKeyDown; _this.providedHandleKeyDown = handleKeyDown; return _this; } TabGuardCtrl.prototype.postConstruct = function () { var _this = this; this.createManagedBean(new ManagedFocusFeature(this.eFocusableElement, { shouldStopEventPropagation: function () { return _this.shouldStopEventPropagation(); }, onTabKeyDown: function (e) { return _this.onTabKeyDown(e); }, handleKeyDown: function (e) { return _this.handleKeyDown(e); }, onFocusIn: function (e) { return _this.onFocusIn(e); }, onFocusOut: function (e) { return _this.onFocusOut(e); } })); this.activateTabGuards(); [this.eTopGuard, this.eBottomGuard].forEach(function (guard) { return _this.addManagedListener(guard, 'focus', _this.onFocus.bind(_this)); }); }; TabGuardCtrl.prototype.handleKeyDown = function (e) { if (this.providedHandleKeyDown) { this.providedHandleKeyDown(e); } }; TabGuardCtrl.prototype.tabGuardsAreActive = function () { return !!this.eTopGuard && this.eTopGuard.hasAttribute('tabIndex'); }; TabGuardCtrl.prototype.shouldStopEventPropagation = function () { if (this.providedShouldStopEventPropagation) { return this.providedShouldStopEventPropagation(); } return false; }; TabGuardCtrl.prototype.activateTabGuards = function () { this.comp.setTabIndex(this.getGridTabIndex()); }; TabGuardCtrl.prototype.deactivateTabGuards = function () { this.comp.setTabIndex(); }; TabGuardCtrl.prototype.onFocus = function (e) { if (this.skipTabGuardFocus) { this.skipTabGuardFocus = false; return; } var fromBottom = e.target === this.eBottomGuard; if (this.providedFocusInnerElement) { this.providedFocusInnerElement(fromBottom); } else { this.focusInnerElement(fromBottom); } }; TabGuardCtrl.prototype.onFocusIn = function (e) { if (this.providedFocusIn && this.providedFocusIn(e)) { return; } this.deactivateTabGuards(); }; TabGuardCtrl.prototype.onFocusOut = function (e) { if (this.providedFocusOut && this.providedFocusOut(e)) { return; } if (!this.eFocusableElement.contains(e.relatedTarget)) { this.activateTabGuards(); } }; TabGuardCtrl.prototype.onTabKeyDown = function (e) { var _this = this; if (this.providedOnTabKeyDown) { this.providedOnTabKeyDown(e); return; } if (e.defaultPrevented) { return; } var tabGuardsAreActive = this.tabGuardsAreActive(); if (tabGuardsAreActive) { this.deactivateTabGuards(); } var nextRoot = this.getNextFocusableElement(e.shiftKey); if (tabGuardsAreActive) { // ensure the tab guards are only re-instated once the event has finished processing, to avoid the browser // tabbing to the tab guard from inside the component setTimeout(function () { return _this.activateTabGuards(); }, 0); } if (!nextRoot) { return; } nextRoot.focus(); e.preventDefault(); }; TabGuardCtrl.prototype.getGridTabIndex = function () { return (this.gridOptionsService.getNum('tabIndex') || 0).toString(); }; TabGuardCtrl.prototype.focusInnerElement = function (fromBottom) { if (fromBottom === void 0) { fromBottom = false; } var focusable = this.focusService.findFocusableElements(this.eFocusableElement); if (this.tabGuardsAreActive()) { // remove tab guards from this component from list of focusable elements focusable.splice(0, 1); focusable.splice(focusable.length - 1, 1); } if (!focusable.length) { return; } focusable[fromBottom ? focusable.length - 1 : 0].focus(); }; TabGuardCtrl.prototype.getNextFocusableElement = function (backwards) { return this.focusService.findNextFocusableElement(this.eFocusableElement, false, backwards); }; TabGuardCtrl.prototype.forceFocusOutOfContainer = function (up) { if (up === void 0) { up = false; } var tabGuardToFocus = up ? this.eTopGuard : this.eBottomGuard; this.activateTabGuards(); this.skipTabGuardFocus = true; tabGuardToFocus.focus(); }; __decorate$1E([ Autowired('focusService') ], TabGuardCtrl.prototype, "focusService", void 0); __decorate$1E([ PostConstruct ], TabGuardCtrl.prototype, "postConstruct", null); return TabGuardCtrl; }(BeanStub)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$1Z = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __read$j = (undefined && undefined.__read) || function (o, n) { var m = typeof Symbol === "function" && o[Symbol.iterator]; if (!m) return o; var i = m.call(o), r, ar = [], e; try { while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); } catch (error) { e = { error: error }; } finally { try { if (r && !r.done && (m = i["return"])) m.call(i); } finally { if (e) throw e.error; } } return ar; }; var __spread$e = (undefined && undefined.__spread) || function () { for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read$j(arguments[i])); return ar; }; var TabGuardComp = /** @class */ (function (_super) { __extends$1Z(TabGuardComp, _super); function TabGuardComp() { return _super !== null && _super.apply(this, arguments) || this; } TabGuardComp.prototype.initialiseTabGuard = function (params) { this.eTopGuard = this.createTabGuard('top'); this.eBottomGuard = this.createTabGuard('bottom'); this.eFocusableElement = this.getFocusableElement(); var tabGuards = [this.eTopGuard, this.eBottomGuard]; var compProxy = { setTabIndex: function (tabIndex) { tabGuards.forEach(function (tabGuard) { return tabIndex != null ? tabGuard.setAttribute('tabIndex', tabIndex) : tabGuard.removeAttribute('tabIndex'); }); } }; this.addTabGuards(this.eTopGuard, this.eBottomGuard); this.tabGuardCtrl = this.createManagedBean(new TabGuardCtrl({ comp: compProxy, eTopGuard: this.eTopGuard, eBottomGuard: this.eBottomGuard, eFocusableElement: this.eFocusableElement, onFocusIn: params.onFocusIn, onFocusOut: params.onFocusOut, focusInnerElement: params.focusInnerElement, handleKeyDown: params.handleKeyDown, onTabKeyDown: params.onTabKeyDown, shouldStopEventPropagation: params.shouldStopEventPropagation })); }; TabGuardComp.prototype.createTabGuard = function (side) { var tabGuard = document.createElement('div'); var cls = side === 'top' ? exports.TabGuardClassNames.TAB_GUARD_TOP : exports.TabGuardClassNames.TAB_GUARD_BOTTOM; tabGuard.classList.add(exports.TabGuardClassNames.TAB_GUARD, cls); setAriaRole(tabGuard, 'presentation'); return tabGuard; }; TabGuardComp.prototype.addTabGuards = function (topTabGuard, bottomTabGuard) { this.eFocusableElement.insertAdjacentElement('afterbegin', topTabGuard); this.eFocusableElement.insertAdjacentElement('beforeend', bottomTabGuard); }; TabGuardComp.prototype.removeAllChildrenExceptTabGuards = function () { var tabGuards = [this.eTopGuard, this.eBottomGuard]; clearElement(this.getFocusableElement()); this.addTabGuards.apply(this, __spread$e(tabGuards)); }; TabGuardComp.prototype.forceFocusOutOfContainer = function (up) { if (up === void 0) { up = false; } this.tabGuardCtrl.forceFocusOutOfContainer(up); }; TabGuardComp.prototype.appendChild = function (newChild, container) { if (!isNodeOrElement(newChild)) { newChild = newChild.getGui(); } var bottomTabGuard = this.eBottomGuard; if (bottomTabGuard) { bottomTabGuard.insertAdjacentElement('beforebegin', newChild); } else { _super.prototype.appendChild.call(this, newChild, container); } }; return TabGuardComp; }(Component)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$1_ = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __assign$g = (undefined && undefined.__assign) || function () { __assign$g = Object.assign || function(t) { for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; } return t; }; return __assign$g.apply(this, arguments); }; var __decorate$1F = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var AgMenuList = /** @class */ (function (_super) { __extends$1_(AgMenuList, _super); function AgMenuList(level) { if (level === void 0) { level = 1; } var _this = _super.call(this, /* html */ "
") || this; _this.level = level; _this.menuItems = []; return _this; } AgMenuList.prototype.postConstruct = function () { var _this = this; this.initialiseTabGuard({ onTabKeyDown: function (e) { return _this.onTabKeyDown(e); }, handleKeyDown: function (e) { return _this.handleKeyDown(e); } }); }; AgMenuList.prototype.onTabKeyDown = function (e) { var parent = this.getParentComponent(); var parentGui = parent && parent.getGui(); var isManaged = parentGui && parentGui.classList.contains('ag-focus-managed'); if (!isManaged) { e.preventDefault(); } if (e.shiftKey) { this.closeIfIsChild(e); } }; AgMenuList.prototype.handleKeyDown = function (e) { switch (e.key) { case KeyCode.UP: case KeyCode.RIGHT: case KeyCode.DOWN: case KeyCode.LEFT: e.preventDefault(); this.handleNavKey(e.key); break; case KeyCode.ESCAPE: var topMenu = this.findTopMenu(); if (topMenu) { this.focusService.focusInto(topMenu.getGui()); } break; } }; AgMenuList.prototype.clearActiveItem = function () { if (this.activeMenuItem) { this.activeMenuItem.deactivate(); this.activeMenuItem = null; } }; AgMenuList.prototype.addMenuItems = function (menuItems) { var _this = this; if (menuItems == null) { return; } menuItems.forEach(function (menuItemOrString) { if (menuItemOrString === 'separator') { _this.addSeparator(); } else if (typeof menuItemOrString === 'string') { console.warn("AG Grid: unrecognised menu item " + menuItemOrString); } else { _this.addItem(menuItemOrString); } }); }; AgMenuList.prototype.addItem = function (menuItemDef) { var _this = this; var menuItem = this.createManagedBean(new AgMenuItemComponent(__assign$g(__assign$g({}, menuItemDef), { isAnotherSubMenuOpen: function () { return _this.menuItems.some(function (m) { return m.isSubMenuOpen(); }); } }))); menuItem.setParentComponent(this); setAriaLevel(menuItem.getGui(), this.level); this.menuItems.push(menuItem); this.appendChild(menuItem.getGui()); this.addManagedListener(menuItem, AgMenuItemComponent.EVENT_MENU_ITEM_SELECTED, function (event) { _this.dispatchEvent(event); }); this.addManagedListener(menuItem, AgMenuItemComponent.EVENT_MENU_ITEM_ACTIVATED, function (event) { if (_this.activeMenuItem && _this.activeMenuItem !== event.menuItem) { _this.activeMenuItem.deactivate(); } _this.activeMenuItem = event.menuItem; }); }; AgMenuList.prototype.activateFirstItem = function () { var item = this.menuItems.filter(function (currentItem) { return !currentItem.isDisabled(); })[0]; if (!item) { return; } item.activate(); }; AgMenuList.prototype.addSeparator = function () { var separatorHtml = /* html */ "\n
\n
\n
\n
\n
\n
"; this.appendChild(loadTemplate(separatorHtml)); }; AgMenuList.prototype.findTopMenu = function () { var parent = this.getParentComponent(); if (!parent && this instanceof AgMenuList) { return this; } while (true) { var nextParent = parent && parent.getParentComponent && parent.getParentComponent(); if (!nextParent || (!(nextParent instanceof AgMenuList || nextParent instanceof AgMenuItemComponent))) { break; } parent = nextParent; } return parent instanceof AgMenuList ? parent : undefined; }; AgMenuList.prototype.handleNavKey = function (key) { switch (key) { case KeyCode.UP: case KeyCode.DOWN: var nextItem = this.findNextItem(key === KeyCode.UP); if (nextItem && nextItem !== this.activeMenuItem) { nextItem.activate(); } return; } var left = this.gridOptionsService.is('enableRtl') ? KeyCode.RIGHT : KeyCode.LEFT; if (key === left) { this.closeIfIsChild(); } else { this.openChild(); } }; AgMenuList.prototype.closeIfIsChild = function (e) { var parentItem = this.getParentComponent(); if (parentItem && parentItem instanceof AgMenuItemComponent) { if (e) { e.preventDefault(); } parentItem.closeSubMenu(); parentItem.getGui().focus(); } }; AgMenuList.prototype.openChild = function () { if (this.activeMenuItem) { this.activeMenuItem.openSubMenu(true); } }; AgMenuList.prototype.findNextItem = function (up) { var items = this.menuItems.filter(function (item) { return !item.isDisabled(); }); if (!items.length) { return; } if (!this.activeMenuItem) { return up ? last(items) : items[0]; } if (up) { items.reverse(); } var nextItem; var foundCurrent = false; for (var i = 0; i < items.length; i++) { var item = items[i]; if (!foundCurrent) { if (item === this.activeMenuItem) { foundCurrent = true; } continue; } nextItem = item; break; } return nextItem || this.activeMenuItem; }; AgMenuList.prototype.destroy = function () { this.clearActiveItem(); _super.prototype.destroy.call(this); }; __decorate$1F([ Autowired('focusService') ], AgMenuList.prototype, "focusService", void 0); __decorate$1F([ PostConstruct ], AgMenuList.prototype, "postConstruct", null); return AgMenuList; }(TabGuardComp)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$1$ = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __decorate$1G = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var AgMenuPanel = /** @class */ (function (_super) { __extends$1$(AgMenuPanel, _super); function AgMenuPanel(wrappedComponent) { var _this = _super.call(this) || this; _this.wrappedComponent = wrappedComponent; _this.setTemplateFromElement(wrappedComponent.getGui()); return _this; } AgMenuPanel.prototype.postConstruct = function () { var _this = this; this.initialiseTabGuard({ onTabKeyDown: function (e) { return _this.onTabKeyDown(e); }, handleKeyDown: function (e) { return _this.handleKeyDown(e); } }); }; AgMenuPanel.prototype.handleKeyDown = function (e) { if (e.key === KeyCode.ESCAPE) { this.closePanel(); } }; AgMenuPanel.prototype.onTabKeyDown = function (e) { if (e.defaultPrevented) { return; } this.closePanel(); e.preventDefault(); }; AgMenuPanel.prototype.closePanel = function () { var menuItem = this.parentComponent; menuItem.closeSubMenu(); setTimeout(function () { return menuItem.getGui().focus(); }, 0); }; __decorate$1G([ PostConstruct ], AgMenuPanel.prototype, "postConstruct", null); return AgMenuPanel; }(TabGuardComp)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$20 = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __decorate$1H = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var AgMenuItemComponent = /** @class */ (function (_super) { __extends$20(AgMenuItemComponent, _super); function AgMenuItemComponent(params) { var _this = _super.call(this) || this; _this.params = params; _this.isActive = false; _this.subMenuIsOpen = false; _this.setTemplate(/* html */ "
"); return _this; } AgMenuItemComponent.prototype.init = function () { var _this = this; this.addIcon(); this.addName(); this.addShortcut(); this.addSubMenu(); this.addTooltip(); var eGui = this.getGui(); if (this.params.disabled) { this.addCssClass(this.getClassName('disabled')); setAriaDisabled(eGui, true); } else { this.addGuiEventListener('click', function (e) { return _this.onItemSelected(e); }); this.addGuiEventListener('keydown', function (e) { if (e.key === KeyCode.ENTER || e.key === KeyCode.SPACE) { e.preventDefault(); _this.onItemSelected(e); } }); this.addGuiEventListener('mousedown', function (e) { // Prevent event bubbling to other event handlers such as PopupService triggering // premature closing of any open sub-menu popup. e.stopPropagation(); e.preventDefault(); }); this.addGuiEventListener('mouseenter', function () { return _this.onMouseEnter(); }); this.addGuiEventListener('mouseleave', function () { return _this.onMouseLeave(); }); } if (this.params.cssClasses) { this.params.cssClasses.forEach(function (it) { return _this.addCssClass(it); }); } }; AgMenuItemComponent.prototype.isDisabled = function () { return !!this.params.disabled; }; AgMenuItemComponent.prototype.openSubMenu = function (activateFirstItem) { var _this = this; if (activateFirstItem === void 0) { activateFirstItem = false; } this.closeSubMenu(); if (!this.params.subMenu) { return; } var ePopup = loadTemplate(/* html */ "
"); var destroySubMenu; if (this.params.subMenu instanceof Array) { var currentLevel = getAriaLevel(this.getGui()); var nextLevel = isNaN(currentLevel) ? 1 : (currentLevel + 1); var childMenu_1 = this.createBean(new AgMenuList(nextLevel)); childMenu_1.setParentComponent(this); childMenu_1.addMenuItems(this.params.subMenu); ePopup.appendChild(childMenu_1.getGui()); // bubble menu item selected events this.addManagedListener(childMenu_1, AgMenuItemComponent.EVENT_MENU_ITEM_SELECTED, function (e) { return _this.dispatchEvent(e); }); childMenu_1.addGuiEventListener('mouseenter', function () { return _this.cancelDeactivate(); }); destroySubMenu = function () { return _this.destroyBean(childMenu_1); }; if (activateFirstItem) { setTimeout(function () { return childMenu_1.activateFirstItem(); }, 0); } } else { var subMenu_1 = this.params.subMenu; var menuPanel = this.createBean(new AgMenuPanel(subMenu_1)); menuPanel.setParentComponent(this); var subMenuGui_1 = menuPanel.getGui(); var mouseEvent_1 = 'mouseenter'; var mouseEnterListener_1 = function () { return _this.cancelDeactivate(); }; subMenuGui_1.addEventListener(mouseEvent_1, mouseEnterListener_1); destroySubMenu = function () { return subMenuGui_1.removeEventListener(mouseEvent_1, mouseEnterListener_1); }; ePopup.appendChild(subMenuGui_1); if (subMenu_1.afterGuiAttached) { setTimeout(function () { return subMenu_1.afterGuiAttached(); }, 0); } } var eGui = this.getGui(); var positionCallback = this.popupService.positionPopupForMenu.bind(this.popupService, { eventSource: eGui, ePopup: ePopup, shouldSetMaxHeight: this.params.shouldSetMaxHeight }); var translate = this.localeService.getLocaleTextFunc(); var addPopupRes = this.popupService.addPopup({ modal: true, eChild: ePopup, positionCallback: positionCallback, anchorToElement: eGui, ariaLabel: translate('ariaLabelSubMenu', 'SubMenu') }); this.subMenuIsOpen = true; setAriaExpanded(eGui, true); this.hideSubMenu = function () { if (addPopupRes) { addPopupRes.hideFunc(); } _this.subMenuIsOpen = false; setAriaExpanded(eGui, false); destroySubMenu(); }; }; AgMenuItemComponent.prototype.closeSubMenu = function () { if (!this.hideSubMenu) { return; } this.hideSubMenu(); this.hideSubMenu = null; setAriaExpanded(this.getGui(), false); }; AgMenuItemComponent.prototype.isSubMenuOpen = function () { return this.subMenuIsOpen; }; AgMenuItemComponent.prototype.activate = function (openSubMenu) { var _this = this; this.cancelActivate(); if (this.params.disabled) { return; } this.isActive = true; this.addCssClass(this.getClassName('active')); this.getGui().focus(); if (openSubMenu && this.params.subMenu) { window.setTimeout(function () { if (_this.isAlive() && _this.isActive) { _this.openSubMenu(); } }, 300); } this.onItemActivated(); }; AgMenuItemComponent.prototype.deactivate = function () { this.cancelDeactivate(); this.removeCssClass(this.getClassName('active')); this.isActive = false; if (this.subMenuIsOpen) { this.hideSubMenu(); } }; AgMenuItemComponent.prototype.addIcon = function () { if (!this.params.checked && !this.params.icon && this.params.isCompact) { return; } var icon = loadTemplate(/* html */ ""); if (this.params.checked) { icon.appendChild(createIconNoSpan('check', this.gridOptionsService)); } else if (this.params.icon) { if (isNodeOrElement(this.params.icon)) { icon.appendChild(this.params.icon); } else if (typeof this.params.icon === 'string') { icon.innerHTML = this.params.icon; } else { console.warn('AG Grid: menu item icon must be DOM node or string'); } } this.getGui().appendChild(icon); }; AgMenuItemComponent.prototype.addName = function () { if (!this.params.name && this.params.isCompact) { return; } var name = loadTemplate(/* html */ "" + (this.params.name || '') + ""); this.getGui().appendChild(name); }; AgMenuItemComponent.prototype.addTooltip = function () { if (!this.params.tooltip) { return; } this.tooltip = this.params.tooltip; if (this.gridOptionsService.is('enableBrowserTooltips')) { this.getGui().setAttribute('title', this.tooltip); } else { this.createManagedBean(new CustomTooltipFeature(this)); } }; AgMenuItemComponent.prototype.getTooltipParams = function () { return { location: 'menu', value: this.tooltip }; }; AgMenuItemComponent.prototype.addShortcut = function () { if (!this.params.shortcut && this.params.isCompact) { return; } var shortcut = loadTemplate(/* html */ "" + (this.params.shortcut || '') + ""); this.getGui().appendChild(shortcut); }; AgMenuItemComponent.prototype.addSubMenu = function () { if (!this.params.subMenu && this.params.isCompact) { return; } var pointer = loadTemplate(/* html */ ""); var eGui = this.getGui(); if (this.params.subMenu) { var iconName = this.gridOptionsService.is('enableRtl') ? 'smallLeft' : 'smallRight'; setAriaExpanded(eGui, false); pointer.appendChild(createIconNoSpan(iconName, this.gridOptionsService)); } eGui.appendChild(pointer); }; AgMenuItemComponent.prototype.onItemSelected = function (event) { if (this.params.action) { this.params.action(); } else { this.openSubMenu(event && event.type === 'keydown'); } if (this.params.subMenu && !this.params.action) { return; } var e = { type: AgMenuItemComponent.EVENT_MENU_ITEM_SELECTED, action: this.params.action, checked: this.params.checked, cssClasses: this.params.cssClasses, disabled: this.params.disabled, icon: this.params.icon, name: this.params.name, shortcut: this.params.shortcut, subMenu: this.params.subMenu, tooltip: this.params.tooltip, event: event }; this.dispatchEvent(e); }; AgMenuItemComponent.prototype.onItemActivated = function () { var event = { type: AgMenuItemComponent.EVENT_MENU_ITEM_ACTIVATED, menuItem: this, }; this.dispatchEvent(event); }; AgMenuItemComponent.prototype.cancelActivate = function () { if (this.activateTimeoutId) { window.clearTimeout(this.activateTimeoutId); this.activateTimeoutId = 0; } }; AgMenuItemComponent.prototype.cancelDeactivate = function () { if (this.deactivateTimeoutId) { window.clearTimeout(this.deactivateTimeoutId); this.deactivateTimeoutId = 0; } }; AgMenuItemComponent.prototype.onMouseEnter = function () { var _this = this; this.cancelDeactivate(); if (this.params.isAnotherSubMenuOpen()) { // wait to see if the user enters the open sub-menu this.activateTimeoutId = window.setTimeout(function () { return _this.activate(true); }, AgMenuItemComponent.ACTIVATION_DELAY); } else { // activate immediately this.activate(true); } }; AgMenuItemComponent.prototype.onMouseLeave = function () { var _this = this; this.cancelActivate(); if (this.isSubMenuOpen()) { // wait to see if the user enters the sub-menu this.deactivateTimeoutId = window.setTimeout(function () { return _this.deactivate(); }, AgMenuItemComponent.ACTIVATION_DELAY); } else { // de-activate immediately this.deactivate(); } }; AgMenuItemComponent.prototype.getClassName = function (suffix) { var prefix = this.params.isCompact ? 'ag-compact-menu-option' : 'ag-menu-option'; return suffix ? prefix + "-" + suffix : prefix; }; AgMenuItemComponent.EVENT_MENU_ITEM_SELECTED = 'menuItemSelected'; AgMenuItemComponent.EVENT_MENU_ITEM_ACTIVATED = 'menuItemActivated'; AgMenuItemComponent.ACTIVATION_DELAY = 80; __decorate$1H([ Autowired('popupService') ], AgMenuItemComponent.prototype, "popupService", void 0); __decorate$1H([ PostConstruct ], AgMenuItemComponent.prototype, "init", null); return AgMenuItemComponent; }(Component)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$21 = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __decorate$1I = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var AgPanel = /** @class */ (function (_super) { __extends$21(AgPanel, _super); function AgPanel(config) { var _this = _super.call(this, AgPanel.getTemplate(config)) || this; _this.closable = true; _this.config = config; return _this; } AgPanel.getTemplate = function (config) { var cssIdentifier = (config && config.cssIdentifier) || 'default'; return /* html */ "
\n
\n \n
\n
\n
\n
"; }; AgPanel.prototype.postConstruct = function () { var _this = this; var _a = this.config, component = _a.component, closable = _a.closable, hideTitleBar = _a.hideTitleBar, title = _a.title, _b = _a.minWidth, minWidth = _b === void 0 ? 250 : _b, width = _a.width, _c = _a.minHeight, minHeight = _c === void 0 ? 250 : _c, height = _a.height, centered = _a.centered, popup = _a.popup, x = _a.x, y = _a.y; this.positionableFeature = new PositionableFeature(this.getGui(), { minWidth: minWidth, width: width, minHeight: minHeight, height: height, centered: centered, x: x, y: y, popup: popup, calculateTopBuffer: function () { return _this.positionableFeature.getHeight() - _this.getBodyHeight(); } }); this.createManagedBean(this.positionableFeature); var eGui = this.getGui(); if (component) { this.setBodyComponent(component); } if (!hideTitleBar) { if (title) { this.setTitle(title); } this.setClosable(closable != null ? closable : this.closable); } else { setDisplayed(this.eTitleBar, false); } this.addManagedListener(this.eTitleBar, 'mousedown', function (e) { var eDocument = _this.gridOptionsService.getDocument(); if (eGui.contains(e.relatedTarget) || eGui.contains(eDocument.activeElement) || _this.eTitleBarButtons.contains(e.target)) { e.preventDefault(); return; } var focusEl = _this.eContentWrapper.querySelector('button, [href], input, select, textarea, [tabindex]'); if (focusEl) { focusEl.focus(); } }); if (popup && this.positionableFeature.isPositioned()) { return; } if (this.renderComponent) { this.renderComponent(); } this.positionableFeature.initialisePosition(); this.eContentWrapper.style.height = '0'; }; AgPanel.prototype.renderComponent = function () { var _this = this; var eGui = this.getGui(); eGui.focus(); this.close = function () { eGui.parentElement.removeChild(eGui); _this.destroy(); }; }; AgPanel.prototype.getHeight = function () { return this.positionableFeature.getHeight(); }; AgPanel.prototype.setHeight = function (height) { this.positionableFeature.setHeight(height); }; AgPanel.prototype.getWidth = function () { return this.positionableFeature.getWidth(); }; AgPanel.prototype.setWidth = function (width) { this.positionableFeature.setWidth(width); }; AgPanel.prototype.setClosable = function (closable) { if (closable !== this.closable) { this.closable = closable; } if (closable) { var closeButtonComp = this.closeButtonComp = new Component(AgPanel.CLOSE_BTN_TEMPLATE); this.getContext().createBean(closeButtonComp); var eGui = closeButtonComp.getGui(); var child = createIconNoSpan('close', this.gridOptionsService); child.classList.add('ag-panel-title-bar-button-icon'); eGui.appendChild(child); this.addTitleBarButton(closeButtonComp); closeButtonComp.addManagedListener(eGui, 'click', this.onBtClose.bind(this)); } else if (this.closeButtonComp) { var eGui = this.closeButtonComp.getGui(); eGui.parentElement.removeChild(eGui); this.closeButtonComp = this.destroyBean(this.closeButtonComp); } }; AgPanel.prototype.setBodyComponent = function (bodyComponent) { bodyComponent.setParentComponent(this); this.eContentWrapper.appendChild(bodyComponent.getGui()); }; AgPanel.prototype.addTitleBarButton = function (button, position) { var eTitleBarButtons = this.eTitleBarButtons; var buttons = eTitleBarButtons.children; var len = buttons.length; if (position == null) { position = len; } position = Math.max(0, Math.min(position, len)); button.addCssClass('ag-panel-title-bar-button'); var eGui = button.getGui(); if (position === 0) { eTitleBarButtons.insertAdjacentElement('afterbegin', eGui); } else if (position === len) { eTitleBarButtons.insertAdjacentElement('beforeend', eGui); } else { buttons[position - 1].insertAdjacentElement('afterend', eGui); } button.setParentComponent(this); }; AgPanel.prototype.getBodyHeight = function () { return getInnerHeight(this.eContentWrapper); }; AgPanel.prototype.getBodyWidth = function () { return getInnerWidth(this.eContentWrapper); }; AgPanel.prototype.setTitle = function (title) { this.eTitle.innerText = title; }; // called when user hits the 'x' in the top right AgPanel.prototype.onBtClose = function () { this.close(); }; AgPanel.prototype.destroy = function () { if (this.closeButtonComp) { this.closeButtonComp = this.destroyBean(this.closeButtonComp); } var eGui = this.getGui(); if (eGui && eGui.offsetParent) { this.close(); } _super.prototype.destroy.call(this); }; AgPanel.CLOSE_BTN_TEMPLATE = "
"; __decorate$1I([ RefSelector('eContentWrapper') ], AgPanel.prototype, "eContentWrapper", void 0); __decorate$1I([ RefSelector('eTitleBar') ], AgPanel.prototype, "eTitleBar", void 0); __decorate$1I([ RefSelector('eTitleBarButtons') ], AgPanel.prototype, "eTitleBarButtons", void 0); __decorate$1I([ RefSelector('eTitle') ], AgPanel.prototype, "eTitle", void 0); __decorate$1I([ PostConstruct ], AgPanel.prototype, "postConstruct", null); return AgPanel; }(Component)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$22 = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __assign$h = (undefined && undefined.__assign) || function () { __assign$h = Object.assign || function(t) { for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; } return t; }; return __assign$h.apply(this, arguments); }; var __decorate$1J = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var AgDialog = /** @class */ (function (_super) { __extends$22(AgDialog, _super); function AgDialog(config) { var _this = _super.call(this, __assign$h(__assign$h({}, config), { popup: true })) || this; _this.isMaximizable = false; _this.isMaximized = false; _this.maximizeListeners = []; _this.resizeListenerDestroy = null; _this.lastPosition = { x: 0, y: 0, width: 0, height: 0 }; return _this; } AgDialog.prototype.postConstruct = function () { var _this = this; var eGui = this.getGui(); var _a = this.config, movable = _a.movable, resizable = _a.resizable, maximizable = _a.maximizable; this.addCssClass('ag-dialog'); _super.prototype.postConstruct.call(this); this.addManagedListener(eGui, 'focusin', function (e) { if (eGui.contains(e.relatedTarget)) { return; } _this.popupService.bringPopupToFront(eGui); }); if (movable) { this.setMovable(movable); } if (maximizable) { this.setMaximizable(maximizable); } if (resizable) { this.setResizable(resizable); } }; AgDialog.prototype.renderComponent = function () { var eGui = this.getGui(); var _a = this.config, alwaysOnTop = _a.alwaysOnTop, modal = _a.modal, title = _a.title; var translate = this.localeService.getLocaleTextFunc(); var addPopupRes = this.popupService.addPopup({ modal: modal, eChild: eGui, closeOnEsc: true, closedCallback: this.destroy.bind(this), alwaysOnTop: alwaysOnTop, ariaLabel: title || translate('ariaLabelDialog', 'Dialog') }); if (addPopupRes) { this.close = addPopupRes.hideFunc; } }; AgDialog.prototype.toggleMaximize = function () { var position = this.positionableFeature.getPosition(); if (this.isMaximized) { var _a = this.lastPosition, x = _a.x, y = _a.y, width = _a.width, height = _a.height; this.setWidth(width); this.setHeight(height); this.positionableFeature.offsetElement(x, y); } else { this.lastPosition.width = this.getWidth(); this.lastPosition.height = this.getHeight(); this.lastPosition.x = position.x; this.lastPosition.y = position.y; this.positionableFeature.offsetElement(0, 0); this.setHeight('100%'); this.setWidth('100%'); } this.isMaximized = !this.isMaximized; this.refreshMaximizeIcon(); }; AgDialog.prototype.refreshMaximizeIcon = function () { setDisplayed(this.maximizeIcon, !this.isMaximized); setDisplayed(this.minimizeIcon, this.isMaximized); }; AgDialog.prototype.clearMaximizebleListeners = function () { if (this.maximizeListeners.length) { this.maximizeListeners.forEach(function (destroyListener) { return destroyListener(); }); this.maximizeListeners.length = 0; } if (this.resizeListenerDestroy) { this.resizeListenerDestroy(); this.resizeListenerDestroy = null; } }; AgDialog.prototype.destroy = function () { this.maximizeButtonComp = this.destroyBean(this.maximizeButtonComp); this.clearMaximizebleListeners(); _super.prototype.destroy.call(this); }; AgDialog.prototype.setResizable = function (resizable) { this.positionableFeature.setResizable(resizable); }; AgDialog.prototype.setMovable = function (movable) { this.positionableFeature.setMovable(movable, this.eTitleBar); }; AgDialog.prototype.setMaximizable = function (maximizable) { var _this = this; if (!maximizable) { this.clearMaximizebleListeners(); if (this.maximizeButtonComp) { this.destroyBean(this.maximizeButtonComp); this.maximizeButtonComp = this.maximizeIcon = this.minimizeIcon = undefined; } return; } var eTitleBar = this.eTitleBar; if (!eTitleBar || maximizable === this.isMaximizable) { return; } var maximizeButtonComp = this.buildMaximizeAndMinimizeElements(); this.refreshMaximizeIcon(); maximizeButtonComp.addManagedListener(maximizeButtonComp.getGui(), 'click', this.toggleMaximize.bind(this)); this.addTitleBarButton(maximizeButtonComp, 0); this.maximizeListeners.push(this.addManagedListener(eTitleBar, 'dblclick', this.toggleMaximize.bind(this))); this.resizeListenerDestroy = this.addManagedListener(this, 'resize', function () { _this.isMaximized = false; _this.refreshMaximizeIcon(); }); }; AgDialog.prototype.buildMaximizeAndMinimizeElements = function () { var maximizeButtonComp = this.maximizeButtonComp = this.createBean(new Component(/* html */ "
")); var eGui = maximizeButtonComp.getGui(); this.maximizeIcon = createIconNoSpan('maximize', this.gridOptionsService); eGui.appendChild(this.maximizeIcon); this.maximizeIcon.classList.add('ag-panel-title-bar-button-icon'); this.minimizeIcon = createIconNoSpan('minimize', this.gridOptionsService); eGui.appendChild(this.minimizeIcon); this.minimizeIcon.classList.add('ag-panel-title-bar-button-icon'); return maximizeButtonComp; }; __decorate$1J([ Autowired('popupService') ], AgDialog.prototype, "popupService", void 0); return AgDialog; }(AgPanel)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$23 = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __assign$i = (undefined && undefined.__assign) || function () { __assign$i = Object.assign || function(t) { for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; } return t; }; return __assign$i.apply(this, arguments); }; var __decorate$1K = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var __read$k = (undefined && undefined.__read) || function (o, n) { var m = typeof Symbol === "function" && o[Symbol.iterator]; if (!m) return o; var i = m.call(o), r, ar = [], e; try { while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); } catch (error) { e = { error: error }; } finally { try { if (r && !r.done && (m = i["return"])) m.call(i); } finally { if (e) throw e.error; } } return ar; }; var __spread$f = (undefined && undefined.__spread) || function () { for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read$k(arguments[i])); return ar; }; var FocusService = /** @class */ (function (_super) { __extends$23(FocusService, _super); function FocusService() { return _super !== null && _super.apply(this, arguments) || this; } FocusService_1 = FocusService; /** * Adds a gridCore to the list of the gridCores monitoring Keyboard Mode * in a specific HTMLDocument. * * @param doc {Document} - The Document containing the gridCore. * @param gridCore {GridComp} - The GridCore to be monitored. */ FocusService.addKeyboardModeEvents = function (doc, controller) { var docControllers = FocusService_1.instancesMonitored.get(doc); if (docControllers && docControllers.length > 0) { if (docControllers.indexOf(controller) === -1) { docControllers.push(controller); } } else { FocusService_1.instancesMonitored.set(doc, [controller]); doc.addEventListener('keydown', FocusService_1.toggleKeyboardMode); doc.addEventListener('mousedown', FocusService_1.toggleKeyboardMode); } }; /** * Removes a gridCore from the list of the gridCores monitoring Keyboard Mode * in a specific HTMLDocument. * * @param doc {Document} - The Document containing the gridCore. * @param gridCore {GridComp} - The GridCore to be removed. */ FocusService.removeKeyboardModeEvents = function (doc, controller) { var docControllers = FocusService_1.instancesMonitored.get(doc); var newControllers = []; if (docControllers && docControllers.length) { newControllers = __spread$f(docControllers).filter(function (currentGridCore) { return currentGridCore !== controller; }); FocusService_1.instancesMonitored.set(doc, newControllers); } if (newControllers.length === 0) { doc.removeEventListener('keydown', FocusService_1.toggleKeyboardMode); doc.removeEventListener('mousedown', FocusService_1.toggleKeyboardMode); } }; /** * This method will be called by `keydown` and `mousedown` events on all Documents monitoring * KeyboardMode. It will then fire a KEYBOARD_FOCUS, MOUSE_FOCUS on each gridCore present in * the Document allowing each gridCore to maintain a state for KeyboardMode. * * @param event {KeyboardEvent | MouseEvent | TouchEvent} - The event triggered. */ FocusService.toggleKeyboardMode = function (event) { var isKeyboardActive = FocusService_1.keyboardModeActive; var isKeyboardEvent = event.type === 'keydown'; if (isKeyboardEvent) { // the following keys should not toggle keyboard mode. if (event.ctrlKey || event.metaKey || event.altKey) { return; } } if (isKeyboardActive && isKeyboardEvent || !isKeyboardActive && !isKeyboardEvent) { return; } FocusService_1.keyboardModeActive = isKeyboardEvent; var doc = event.target.ownerDocument; if (!doc) { return; } var controllersForDoc = FocusService_1.instancesMonitored.get(doc); if (controllersForDoc) { controllersForDoc.forEach(function (controller) { controller.dispatchEvent({ type: isKeyboardEvent ? Events.EVENT_KEYBOARD_FOCUS : Events.EVENT_MOUSE_FOCUS }); }); } }; FocusService.prototype.init = function () { var _this = this; var clearFocusedCellListener = this.clearFocusedCell.bind(this); this.addManagedListener(this.eventService, Events.EVENT_COLUMN_PIVOT_MODE_CHANGED, clearFocusedCellListener); this.addManagedListener(this.eventService, Events.EVENT_NEW_COLUMNS_LOADED, this.onColumnEverythingChanged.bind(this)); this.addManagedListener(this.eventService, Events.EVENT_COLUMN_GROUP_OPENED, clearFocusedCellListener); this.addManagedListener(this.eventService, Events.EVENT_COLUMN_ROW_GROUP_CHANGED, clearFocusedCellListener); this.ctrlsService.whenReady(function (p) { _this.gridCtrl = p.gridCtrl; var doc = _this.gridOptionsService.getDocument(); FocusService_1.addKeyboardModeEvents(doc, _this.gridCtrl); _this.addDestroyFunc(function () { return _this.unregisterGridCompController(_this.gridCtrl); }); }); }; FocusService.prototype.unregisterGridCompController = function (gridCompController) { var doc = this.gridOptionsService.getDocument(); FocusService_1.removeKeyboardModeEvents(doc, gridCompController); }; FocusService.prototype.onColumnEverythingChanged = function () { // if the columns change, check and see if this column still exists. if it does, then // we can keep the focused cell. if it doesn't, then we need to drop the focused cell. if (!this.focusedCellPosition) { return; } var col = this.focusedCellPosition.column; var colFromColumnModel = this.columnModel.getGridColumn(col.getId()); if (col !== colFromColumnModel) { this.clearFocusedCell(); } }; FocusService.prototype.isKeyboardMode = function () { return FocusService_1.keyboardModeActive; }; // we check if the browser is focusing something, and if it is, and // it's the cell we think is focused, then return the cell. so this // methods returns the cell if a) we think it has focus and b) the // browser thinks it has focus. this then returns nothing if we // first focus a cell, then second click outside the grid, as then the // grid cell will still be focused as far as the grid is concerned, // however the browser focus will have moved somewhere else. FocusService.prototype.getFocusCellToUseAfterRefresh = function () { var eDocument = this.gridOptionsService.getDocument(); if (this.gridOptionsService.is('suppressFocusAfterRefresh') || !this.focusedCellPosition) { return null; } // we check that the browser is actually focusing on the grid, if it is not, then // we have nothing to worry about. we check for ROW data, as this covers both focused Rows (for Full Width Rows) // and Cells (covers cells as cells live in rows) if (this.isDomDataMissingInHierarchy(eDocument.activeElement, RowCtrl.DOM_DATA_KEY_ROW_CTRL)) { return null; } return this.focusedCellPosition; }; FocusService.prototype.getFocusHeaderToUseAfterRefresh = function () { var eDocument = this.gridOptionsService.getDocument(); if (this.gridOptionsService.is('suppressFocusAfterRefresh') || !this.focusedHeaderPosition) { return null; } // we check that the browser is actually focusing on the grid, if it is not, then // we have nothing to worry about if (this.isDomDataMissingInHierarchy(eDocument.activeElement, AbstractHeaderCellCtrl.DOM_DATA_KEY_HEADER_CTRL)) { return null; } return this.focusedHeaderPosition; }; FocusService.prototype.isDomDataMissingInHierarchy = function (eBrowserCell, key) { var ePointer = eBrowserCell; while (ePointer) { var data = this.gridOptionsService.getDomData(ePointer, key); if (data) { return false; } ePointer = ePointer.parentNode; } return true; }; FocusService.prototype.getFocusedCell = function () { return this.focusedCellPosition; }; FocusService.prototype.getFocusEventParams = function () { var _a = this.focusedCellPosition, rowIndex = _a.rowIndex, rowPinned = _a.rowPinned, column = _a.column; var params = { rowIndex: rowIndex, rowPinned: rowPinned, column: column, isFullWidthCell: false }; var rowCtrl = this.rowRenderer.getRowByPosition({ rowIndex: rowIndex, rowPinned: rowPinned }); if (rowCtrl) { params.isFullWidthCell = rowCtrl.isFullWidth(); } return params; }; FocusService.prototype.clearFocusedCell = function () { if (this.focusedCellPosition == null) { return; } var event = __assign$i({ type: Events.EVENT_CELL_FOCUS_CLEARED }, this.getFocusEventParams()); this.focusedCellPosition = null; this.eventService.dispatchEvent(event); }; FocusService.prototype.setFocusedCell = function (params) { var column = params.column, rowIndex = params.rowIndex, rowPinned = params.rowPinned, _a = params.forceBrowserFocus, forceBrowserFocus = _a === void 0 ? false : _a, _b = params.preventScrollOnBrowserFocus, preventScrollOnBrowserFocus = _b === void 0 ? false : _b; var gridColumn = this.columnModel.getGridColumn(column); // if column doesn't exist, then blank the focused cell and return. this can happen when user sets new columns, // and the focused cell is in a column that no longer exists. after columns change, the grid refreshes and tries // to re-focus the focused cell. if (!gridColumn) { this.focusedCellPosition = null; return; } this.focusedCellPosition = gridColumn ? { rowIndex: rowIndex, rowPinned: makeNull(rowPinned), column: gridColumn } : null; var event = __assign$i(__assign$i({ type: Events.EVENT_CELL_FOCUSED }, this.getFocusEventParams()), { forceBrowserFocus: forceBrowserFocus, preventScrollOnBrowserFocus: preventScrollOnBrowserFocus, floating: null }); this.eventService.dispatchEvent(event); }; FocusService.prototype.isCellFocused = function (cellPosition) { if (this.focusedCellPosition == null) { return false; } return this.focusedCellPosition.column === cellPosition.column && this.isRowFocused(cellPosition.rowIndex, cellPosition.rowPinned); }; FocusService.prototype.isRowNodeFocused = function (rowNode) { return this.isRowFocused(rowNode.rowIndex, rowNode.rowPinned); }; FocusService.prototype.isHeaderWrapperFocused = function (headerCtrl) { if (this.focusedHeaderPosition == null) { return false; } var column = headerCtrl.getColumnGroupChild(); var headerRowIndex = headerCtrl.getRowIndex(); var pinned = headerCtrl.getPinned(); var _a = this.focusedHeaderPosition, focusedColumn = _a.column, focusedHeaderRowIndex = _a.headerRowIndex; return column === focusedColumn && headerRowIndex === focusedHeaderRowIndex && pinned == focusedColumn.getPinned(); }; FocusService.prototype.clearFocusedHeader = function () { this.focusedHeaderPosition = null; }; FocusService.prototype.getFocusedHeader = function () { return this.focusedHeaderPosition; }; FocusService.prototype.setFocusedHeader = function (headerRowIndex, column) { this.focusedHeaderPosition = { headerRowIndex: headerRowIndex, column: column }; }; FocusService.prototype.focusHeaderPosition = function (params) { var direction = params.direction, fromTab = params.fromTab, allowUserOverride = params.allowUserOverride, event = params.event; var headerPosition = params.headerPosition; if (allowUserOverride) { var currentPosition = this.getFocusedHeader(); var headerRowCount = this.headerNavigationService.getHeaderRowCount(); if (fromTab) { var userFunc = this.gridOptionsService.getCallback('tabToNextHeader'); if (userFunc) { var params_1 = { backwards: direction === 'Before', previousHeaderPosition: currentPosition, nextHeaderPosition: headerPosition, headerRowCount: headerRowCount, }; headerPosition = userFunc(params_1); } } else { var userFunc = this.gridOptionsService.getCallback('navigateToNextHeader'); if (userFunc && event) { var params_2 = { key: event.key, previousHeaderPosition: currentPosition, nextHeaderPosition: headerPosition, headerRowCount: headerRowCount, event: event, }; headerPosition = userFunc(params_2); } } } if (!headerPosition) { return false; } if (headerPosition.headerRowIndex === -1) { return this.focusGridView(headerPosition.column); } this.headerNavigationService.scrollToColumn(headerPosition.column, direction); var headerRowContainerCtrl = this.ctrlsService.getHeaderRowContainerCtrl(headerPosition.column.getPinned()); // this will automatically call the setFocusedHeader method above var focusSuccess = headerRowContainerCtrl.focusHeader(headerPosition.headerRowIndex, headerPosition.column, event); return focusSuccess; }; FocusService.prototype.focusFirstHeader = function () { var firstColumn = this.columnModel.getAllDisplayedColumns()[0]; if (!firstColumn) { return false; } if (firstColumn.getParent()) { firstColumn = this.columnModel.getColumnGroupAtLevel(firstColumn, 0); } return this.focusHeaderPosition({ headerPosition: { headerRowIndex: 0, column: firstColumn } }); }; FocusService.prototype.focusLastHeader = function (event) { var headerRowIndex = this.headerNavigationService.getHeaderRowCount() - 1; var column = last(this.columnModel.getAllDisplayedColumns()); return this.focusHeaderPosition({ headerPosition: { headerRowIndex: headerRowIndex, column: column }, event: event }); }; FocusService.prototype.isAnyCellFocused = function () { return !!this.focusedCellPosition; }; FocusService.prototype.isRowFocused = function (rowIndex, floating) { if (this.focusedCellPosition == null) { return false; } return this.focusedCellPosition.rowIndex === rowIndex && this.focusedCellPosition.rowPinned === makeNull(floating); }; FocusService.prototype.findFocusableElements = function (rootNode, exclude, onlyUnmanaged) { if (onlyUnmanaged === void 0) { onlyUnmanaged = false; } var focusableString = FOCUSABLE_SELECTOR; var excludeString = FOCUSABLE_EXCLUDE; if (exclude) { excludeString += ', ' + exclude; } if (onlyUnmanaged) { excludeString += ', [tabindex="-1"]'; } var nodes = Array.prototype.slice.apply(rootNode.querySelectorAll(focusableString)); var excludeNodes = Array.prototype.slice.apply(rootNode.querySelectorAll(excludeString)); if (!excludeNodes.length) { return nodes; } var diff = function (a, b) { return a.filter(function (element) { return b.indexOf(element) === -1; }); }; return diff(nodes, excludeNodes); }; FocusService.prototype.focusInto = function (rootNode, up, onlyUnmanaged) { if (up === void 0) { up = false; } if (onlyUnmanaged === void 0) { onlyUnmanaged = false; } var focusableElements = this.findFocusableElements(rootNode, null, onlyUnmanaged); var toFocus = up ? last(focusableElements) : focusableElements[0]; if (toFocus) { toFocus.focus(); return true; } return false; }; FocusService.prototype.findFocusableElementBeforeTabGuard = function (rootNode, referenceElement) { if (!referenceElement) { return null; } var focusableElements = this.findFocusableElements(rootNode); var referenceIndex = focusableElements.indexOf(referenceElement); if (referenceIndex === -1) { return null; } var lastTabGuardIndex = -1; for (var i = referenceIndex - 1; i >= 0; i--) { if (focusableElements[i].classList.contains(exports.TabGuardClassNames.TAB_GUARD_TOP)) { lastTabGuardIndex = i; break; } } if (lastTabGuardIndex <= 0) { return null; } return focusableElements[lastTabGuardIndex - 1]; }; FocusService.prototype.findNextFocusableElement = function (rootNode, onlyManaged, backwards) { if (rootNode === void 0) { rootNode = this.eGridDiv; } var focusable = this.findFocusableElements(rootNode, onlyManaged ? ':not([tabindex="-1"])' : null); var eDocument = this.gridOptionsService.getDocument(); var activeEl = eDocument.activeElement; var currentIndex; if (onlyManaged) { currentIndex = focusable.findIndex(function (el) { return el.contains(activeEl); }); } else { currentIndex = focusable.indexOf(activeEl); } var nextIndex = currentIndex + (backwards ? -1 : 1); if (nextIndex < 0 || nextIndex >= focusable.length) { return null; } return focusable[nextIndex]; }; FocusService.prototype.isTargetUnderManagedComponent = function (rootNode, target) { if (!target) { return false; } var managedContainers = rootNode.querySelectorAll("." + ManagedFocusFeature.FOCUS_MANAGED_CLASS); if (!managedContainers.length) { return false; } for (var i = 0; i < managedContainers.length; i++) { if (managedContainers[i].contains(target)) { return true; } } return false; }; FocusService.prototype.findTabbableParent = function (node, limit) { if (limit === void 0) { limit = 5; } var counter = 0; while (node && getTabIndex(node) === null && ++counter <= limit) { node = node.parentElement; } if (getTabIndex(node) === null) { return null; } return node; }; FocusService.prototype.focusGridView = function (column, backwards) { // if suppressCellFocus is `true`, it means the user does not want to // navigate between the cells using tab. Instead, we put focus on either // the header or after the grid, depending on whether tab or shift-tab was pressed. if (this.gridOptionsService.is('suppressCellFocus')) { if (backwards) { return this.focusLastHeader(); } return this.focusNextGridCoreContainer(false); } var nextRow = backwards ? this.rowPositionUtils.getLastRow() : this.rowPositionUtils.getFirstRow(); if (!nextRow) { return false; } var rowIndex = nextRow.rowIndex, rowPinned = nextRow.rowPinned; var focusedHeader = this.getFocusedHeader(); if (!column && focusedHeader) { column = focusedHeader.column; } if (rowIndex == null || !column) { return false; } this.navigationService.ensureCellVisible({ rowIndex: rowIndex, column: column, rowPinned: rowPinned }); this.setFocusedCell({ rowIndex: rowIndex, column: column, rowPinned: makeNull(rowPinned), forceBrowserFocus: true }); if (this.rangeService) { var cellPosition = { rowIndex: rowIndex, rowPinned: rowPinned, column: column }; this.rangeService.setRangeToCell(cellPosition); } return true; }; FocusService.prototype.focusNextGridCoreContainer = function (backwards) { if (this.gridCtrl.focusNextInnerContainer(backwards)) { return true; } if (!backwards && !this.gridCtrl.isDetailGrid()) { this.gridCtrl.forceFocusOutOfContainer(); } return false; }; var FocusService_1; FocusService.AG_KEYBOARD_FOCUS = 'ag-keyboard-focus'; FocusService.keyboardModeActive = false; FocusService.instancesMonitored = new Map(); __decorate$1K([ Autowired('eGridDiv') ], FocusService.prototype, "eGridDiv", void 0); __decorate$1K([ Autowired('columnModel') ], FocusService.prototype, "columnModel", void 0); __decorate$1K([ Autowired('headerNavigationService') ], FocusService.prototype, "headerNavigationService", void 0); __decorate$1K([ Autowired('rowRenderer') ], FocusService.prototype, "rowRenderer", void 0); __decorate$1K([ Autowired('rowPositionUtils') ], FocusService.prototype, "rowPositionUtils", void 0); __decorate$1K([ Optional('rangeService') ], FocusService.prototype, "rangeService", void 0); __decorate$1K([ Autowired('navigationService') ], FocusService.prototype, "navigationService", void 0); __decorate$1K([ Autowired('ctrlsService') ], FocusService.prototype, "ctrlsService", void 0); __decorate$1K([ PostConstruct ], FocusService.prototype, "init", null); FocusService = FocusService_1 = __decorate$1K([ Bean('focusService') ], FocusService); return FocusService; }(BeanStub)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$24 = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __decorate$1L = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var __read$l = (undefined && undefined.__read) || function (o, n) { var m = typeof Symbol === "function" && o[Symbol.iterator]; if (!m) return o; var i = m.call(o), r, ar = [], e; try { while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); } catch (error) { e = { error: error }; } finally { try { if (r && !r.done && (m = i["return"])) m.call(i); } finally { if (e) throw e.error; } } return ar; }; var __spread$g = (undefined && undefined.__spread) || function () { for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read$l(arguments[i])); return ar; }; var DIRECTION; (function (DIRECTION) { DIRECTION[DIRECTION["vertical"] = 0] = "vertical"; DIRECTION[DIRECTION["horizontal"] = 1] = "horizontal"; })(DIRECTION || (DIRECTION = {})); var instanceIdSeq = 0; var PopupService = /** @class */ (function (_super) { __extends$24(PopupService, _super); function PopupService() { var _this = _super !== null && _super.apply(this, arguments) || this; _this.popupList = []; return _this; } PopupService_1 = PopupService; PopupService.prototype.postConstruct = function () { var _this = this; this.ctrlsService.whenReady(function (p) { _this.gridCtrl = p.gridCtrl; _this.addManagedListener(_this.gridCtrl, Events.EVENT_KEYBOARD_FOCUS, function () { _this.popupList.forEach(function (popup) { return popup.element.classList.add(FocusService.AG_KEYBOARD_FOCUS); }); }); _this.addManagedListener(_this.gridCtrl, Events.EVENT_MOUSE_FOCUS, function () { _this.popupList.forEach(function (popup) { return popup.element.classList.remove(FocusService.AG_KEYBOARD_FOCUS); }); }); }); }; PopupService.prototype.getPopupParent = function () { var ePopupParent = this.gridOptionsService.get('popupParent'); if (ePopupParent) { return ePopupParent; } return this.gridCtrl.getGui(); }; PopupService.prototype.positionPopupForMenu = function (params) { var sourceRect = params.eventSource.getBoundingClientRect(); var parentRect = this.getParentRect(); this.checkClearMaxHeight(params.ePopup, params.shouldSetMaxHeight); var y = this.keepXYWithinBounds(params.ePopup, sourceRect.top - parentRect.top, DIRECTION.vertical); var minWidth = (params.ePopup.clientWidth > 0) ? params.ePopup.clientWidth : 200; params.ePopup.style.minWidth = minWidth + "px"; var widthOfParent = parentRect.right - parentRect.left; var maxX = widthOfParent - minWidth; // the x position of the popup depends on RTL or LTR. for normal cases, LTR, we put the child popup // to the right, unless it doesn't fit and we then put it to the left. for RTL it's the other way around, // we try place it first to the left, and then if not to the right. var x; if (this.gridOptionsService.is('enableRtl')) { // for RTL, try left first x = xLeftPosition(); if (x < 0) { x = xRightPosition(); } if (x > maxX) { x = 0; } } else { // for LTR, try right first x = xRightPosition(); if (x > maxX) { x = xLeftPosition(); } if (x < 0) { x = 0; } } params.ePopup.style.left = x + "px"; params.ePopup.style.top = y + "px"; this.checkSetMaxHeight(params.ePopup, y, params.shouldSetMaxHeight); function xRightPosition() { return sourceRect.right - parentRect.left - 2; } function xLeftPosition() { return sourceRect.left - parentRect.left - minWidth; } }; PopupService.prototype.positionPopupUnderMouseEvent = function (params) { var _this = this; var ePopup = params.ePopup, nudgeX = params.nudgeX, nudgeY = params.nudgeY, skipObserver = params.skipObserver, shouldSetMaxHeight = params.shouldSetMaxHeight; this.positionPopup({ ePopup: ePopup, nudgeX: nudgeX, nudgeY: nudgeY, keepWithinBounds: true, skipObserver: skipObserver, shouldSetMaxHeight: shouldSetMaxHeight, updatePosition: function () { return _this.calculatePointerAlign(params.mouseEvent); }, postProcessCallback: function () { return _this.callPostProcessPopup(params.type, params.ePopup, null, params.mouseEvent, params.column, params.rowNode); } }); }; PopupService.prototype.calculatePointerAlign = function (e) { var parentRect = this.getParentRect(); return { x: e.clientX - parentRect.left, y: e.clientY - parentRect.top }; }; PopupService.prototype.positionPopupByComponent = function (params) { var _this = this; var sourceRect = params.eventSource.getBoundingClientRect(); var alignSide = params.alignSide || 'left'; var position = params.position || 'over'; var parentRect = this.getParentRect(); var updatePosition = function () { var x = sourceRect.left - parentRect.left; if (alignSide === 'right') { x -= (params.ePopup.offsetWidth - sourceRect.width); } var y = position === 'over' ? (sourceRect.top - parentRect.top) : (sourceRect.top - parentRect.top + sourceRect.height); return { x: x, y: y }; }; this.positionPopup({ ePopup: params.ePopup, nudgeX: params.nudgeX, nudgeY: params.nudgeY, keepWithinBounds: params.keepWithinBounds, shouldSetMaxHeight: params.shouldSetMaxHeight, updatePosition: updatePosition, postProcessCallback: function () { return _this.callPostProcessPopup(params.type, params.ePopup, params.eventSource, null, params.column, params.rowNode); } }); }; PopupService.prototype.callPostProcessPopup = function (type, ePopup, eventSource, mouseEvent, column, rowNode) { var callback = this.gridOptionsService.getCallback('postProcessPopup'); if (callback) { var params = { column: column, rowNode: rowNode, ePopup: ePopup, type: type, eventSource: eventSource, mouseEvent: mouseEvent }; callback(params); } }; PopupService.prototype.positionPopup = function (params) { var _this = this; var ePopup = params.ePopup, keepWithinBounds = params.keepWithinBounds, nudgeX = params.nudgeX, nudgeY = params.nudgeY, skipObserver = params.skipObserver, shouldSetMaxHeight = params.shouldSetMaxHeight, updatePosition = params.updatePosition; var lastSize = { width: 0, height: 0 }; var updatePopupPosition = function (fromResizeObserver) { if (fromResizeObserver === void 0) { fromResizeObserver = false; } var _a = updatePosition(), x = _a.x, y = _a.y; if (fromResizeObserver && ePopup.clientWidth === lastSize.width && ePopup.clientHeight === lastSize.height) { return; } lastSize.width = ePopup.clientWidth; lastSize.height = ePopup.clientHeight; if (nudgeX) { x += nudgeX; } if (nudgeY) { y += nudgeY; } _this.checkClearMaxHeight(ePopup, shouldSetMaxHeight); // if popup is overflowing to the bottom, move it up if (keepWithinBounds) { x = _this.keepXYWithinBounds(ePopup, x, DIRECTION.horizontal); y = _this.keepXYWithinBounds(ePopup, y, DIRECTION.vertical); } ePopup.style.left = x + "px"; ePopup.style.top = y + "px"; _this.checkSetMaxHeight(ePopup, y, shouldSetMaxHeight); if (params.postProcessCallback) { params.postProcessCallback(); } }; updatePopupPosition(); // Mouse tracking will recalculate positioning when moving, so won't need to recalculate here if (!skipObserver) { // Since rendering popup contents can be asynchronous, use a resize observer to // reposition the popup after initial updates to the size of the contents var resizeObserverDestroyFunc_1 = this.resizeObserverService.observeResize(ePopup, function () { return updatePopupPosition(true); }); // Only need to reposition when first open, so can clean up after a bit of time setTimeout(function () { return resizeObserverDestroyFunc_1(); }, PopupService_1.WAIT_FOR_POPUP_CONTENT_RESIZE); } }; PopupService.prototype.getActivePopups = function () { return this.popupList.map(function (popup) { return popup.element; }); }; PopupService.prototype.getPopupList = function () { return this.popupList; }; PopupService.prototype.getParentRect = function () { // subtract the popup parent borders, because popupParent.getBoundingClientRect // returns the rect outside the borders, but the 0,0 coordinate for absolute // positioning is inside the border, leading the popup to be off by the width // of the border var eDocument = this.gridOptionsService.getDocument(); var popupParent = this.getPopupParent(); if (popupParent === eDocument.body) { popupParent = eDocument.documentElement; } else if (getComputedStyle(popupParent).position === 'static') { popupParent = popupParent.offsetParent; } var style = getComputedStyle(popupParent); var bounds = popupParent.getBoundingClientRect(); return { top: bounds.top + parseFloat(style.borderTopWidth) || 0, left: bounds.left + parseFloat(style.borderLeftWidth) || 0, right: bounds.right + parseFloat(style.borderRightWidth) || 0, bottom: bounds.bottom + parseFloat(style.borderBottomWidth) || 0, }; }; PopupService.prototype.keepXYWithinBounds = function (ePopup, position, direction) { var isVertical = direction === DIRECTION.vertical; var sizeProperty = isVertical ? 'clientHeight' : 'clientWidth'; var anchorProperty = isVertical ? 'top' : 'left'; var offsetProperty = isVertical ? 'offsetHeight' : 'offsetWidth'; var scrollPositionProperty = isVertical ? 'scrollTop' : 'scrollLeft'; var eDocument = this.gridOptionsService.getDocument(); var docElement = eDocument.documentElement; var popupParent = this.getPopupParent(); var parentRect = popupParent.getBoundingClientRect(); var documentRect = eDocument.documentElement.getBoundingClientRect(); var isBody = popupParent === eDocument.body; var offsetSize = ePopup[offsetProperty]; var getSize = isVertical ? getAbsoluteHeight : getAbsoluteWidth; var sizeOfParent = isBody ? (getSize(docElement) + docElement[scrollPositionProperty]) : popupParent[sizeProperty]; if (isBody) { sizeOfParent -= Math.abs(documentRect[anchorProperty] - parentRect[anchorProperty]); } var max = sizeOfParent - offsetSize; return Math.min(Math.max(position, 0), Math.abs(max)); }; PopupService.prototype.keepPopupPositionedRelativeTo = function (params) { var _this = this; var eParent = this.getPopupParent(); var parentRect = eParent.getBoundingClientRect(); var sourceRect = params.element.getBoundingClientRect(); var initialDiffTop = parentRect.top - sourceRect.top; var initialDiffLeft = parentRect.left - sourceRect.left; var lastDiffTop = initialDiffTop; var lastDiffLeft = initialDiffLeft; var topPx = params.ePopup.style.top; var top = parseInt(topPx.substring(0, topPx.length - 1), 10); var leftPx = params.ePopup.style.left; var left = parseInt(leftPx.substring(0, leftPx.length - 1), 10); return new AgPromise(function (resolve) { _this.getFrameworkOverrides().setInterval(function () { var pRect = eParent.getBoundingClientRect(); var sRect = params.element.getBoundingClientRect(); var elementNotInDom = sRect.top == 0 && sRect.left == 0 && sRect.height == 0 && sRect.width == 0; if (elementNotInDom) { params.hidePopup(); return; } var currentDiffTop = pRect.top - sRect.top; if (currentDiffTop != lastDiffTop) { var newTop = _this.keepXYWithinBounds(params.ePopup, top + initialDiffTop - currentDiffTop, DIRECTION.vertical); params.ePopup.style.top = newTop + "px"; } lastDiffTop = currentDiffTop; var currentDiffLeft = pRect.left - sRect.left; if (currentDiffLeft != lastDiffLeft) { var newLeft = _this.keepXYWithinBounds(params.ePopup, left + initialDiffLeft - currentDiffLeft, DIRECTION.horizontal); params.ePopup.style.left = newLeft + "px"; } lastDiffLeft = currentDiffLeft; }, 200).then(function (intervalId) { var result = function () { if (intervalId != null) { window.clearInterval(intervalId); } }; resolve(result); }); }); }; PopupService.prototype.addPopup = function (params) { var _a; var _this = this; var modal = params.modal, eChild = params.eChild, closeOnEsc = params.closeOnEsc, closedCallback = params.closedCallback, click = params.click, alwaysOnTop = params.alwaysOnTop, afterGuiAttached = params.afterGuiAttached, positionCallback = params.positionCallback, anchorToElement = params.anchorToElement, ariaLabel = params.ariaLabel; var eDocument = this.gridOptionsService.getDocument(); var destroyPositionTracker = new AgPromise(function (resolve) { return resolve(function () { }); }); if (!eDocument) { console.warn('AG Grid: could not find the document, document is empty'); return { hideFunc: function () { }, stopAnchoringPromise: destroyPositionTracker }; } var pos = this.popupList.findIndex(function (popup) { return popup.element === eChild; }); if (pos !== -1) { var popup = this.popupList[pos]; return { hideFunc: popup.hideFunc, stopAnchoringPromise: popup.stopAnchoringPromise }; } var ePopupParent = this.getPopupParent(); if (eChild.style.top == null) { eChild.style.top = '0px'; } if (eChild.style.left == null) { eChild.style.left = '0px'; } // add env CSS class to child, in case user provided a popup parent, which means // theme class may be missing var eWrapper = document.createElement('div'); var allThemes = this.environment.getTheme().allThemes; if (allThemes.length) { (_a = eWrapper.classList).add.apply(_a, __spread$g(allThemes)); } eWrapper.classList.add('ag-popup'); eChild.classList.add(this.gridOptionsService.is('enableRtl') ? 'ag-rtl' : 'ag-ltr', 'ag-popup-child'); if (!eChild.hasAttribute('role')) { setAriaRole(eChild, 'dialog'); } setAriaLabel(eChild, ariaLabel); if (this.focusService.isKeyboardMode()) { eChild.classList.add(FocusService.AG_KEYBOARD_FOCUS); } eWrapper.appendChild(eChild); ePopupParent.appendChild(eWrapper); if (alwaysOnTop) { this.setAlwaysOnTop(eWrapper, true); } else { this.bringPopupToFront(eWrapper); } var popupHidden = false; var hidePopupOnKeyboardEvent = function (event) { if (!eWrapper.contains(eDocument.activeElement)) { return; } var key = event.key; if (key === KeyCode.ESCAPE) { hidePopup({ keyboardEvent: event }); } }; var hidePopupOnMouseEvent = function (event) { return hidePopup({ mouseEvent: event }); }; var hidePopupOnTouchEvent = function (event) { return hidePopup({ touchEvent: event }); }; var hidePopup = function (popupParams) { if (popupParams === void 0) { popupParams = {}; } var mouseEvent = popupParams.mouseEvent, touchEvent = popupParams.touchEvent, keyboardEvent = popupParams.keyboardEvent; if ( // we don't hide popup if the event was on the child, or any // children of this child _this.isEventFromCurrentPopup({ mouseEvent: mouseEvent, touchEvent: touchEvent }, eChild) || // if the event to close is actually the open event, then ignore it _this.isEventSameChainAsOriginalEvent({ originalMouseEvent: click, mouseEvent: mouseEvent, touchEvent: touchEvent }) || // this method should only be called once. the client can have different // paths, each one wanting to close, so this method may be called multiple times. popupHidden) { return; } popupHidden = true; ePopupParent.removeChild(eWrapper); eDocument.removeEventListener('keydown', hidePopupOnKeyboardEvent); eDocument.removeEventListener('mousedown', hidePopupOnMouseEvent); eDocument.removeEventListener('touchstart', hidePopupOnTouchEvent); eDocument.removeEventListener('contextmenu', hidePopupOnMouseEvent); _this.eventService.removeEventListener(Events.EVENT_DRAG_STARTED, hidePopupOnMouseEvent); if (closedCallback) { closedCallback(mouseEvent || touchEvent || keyboardEvent); } _this.popupList = _this.popupList.filter(function (popup) { return popup.element !== eChild; }); if (destroyPositionTracker) { destroyPositionTracker.then(function (destroyFunc) { return destroyFunc && destroyFunc(); }); } }; if (afterGuiAttached) { afterGuiAttached({ hidePopup: hidePopup }); } // if we add these listeners now, then the current mouse // click will be included, which we don't want window.setTimeout(function () { if (closeOnEsc) { eDocument.addEventListener('keydown', hidePopupOnKeyboardEvent); } if (modal) { eDocument.addEventListener('mousedown', hidePopupOnMouseEvent); _this.eventService.addEventListener(Events.EVENT_DRAG_STARTED, hidePopupOnMouseEvent); eDocument.addEventListener('touchstart', hidePopupOnTouchEvent); eDocument.addEventListener('contextmenu', hidePopupOnMouseEvent); } }, 0); if (positionCallback) { positionCallback(); } if (anchorToElement) { // keeps popup positioned under created, eg if context menu, if user scrolls // using touchpad and the cell moves, it moves the popup to keep it with the cell. destroyPositionTracker = this.keepPopupPositionedRelativeTo({ element: anchorToElement, ePopup: eChild, hidePopup: hidePopup }); } this.popupList.push({ element: eChild, wrapper: eWrapper, hideFunc: hidePopup, stopAnchoringPromise: destroyPositionTracker, instanceId: instanceIdSeq++, isAnchored: !!anchorToElement }); return { hideFunc: hidePopup, stopAnchoringPromise: destroyPositionTracker }; }; PopupService.prototype.hasAnchoredPopup = function () { return this.popupList.some(function (popup) { return popup.isAnchored; }); }; PopupService.prototype.isEventFromCurrentPopup = function (params, target) { var mouseEvent = params.mouseEvent, touchEvent = params.touchEvent; var event = mouseEvent ? mouseEvent : touchEvent; if (!event) { return false; } var indexOfThisChild = this.popupList.findIndex(function (popup) { return popup.element === target; }); if (indexOfThisChild === -1) { return false; } for (var i = indexOfThisChild; i < this.popupList.length; i++) { var popup = this.popupList[i]; if (isElementInEventPath(popup.element, event)) { return true; } } // if the user did not write their own Custom Element to be rendered as popup // and this component has an additional popup element, they should have the // `ag-custom-component-popup` class to be detected as part of the Custom Component return this.isElementWithinCustomPopup(event.target); }; PopupService.prototype.isElementWithinCustomPopup = function (el) { var eDocument = this.gridOptionsService.getDocument(); while (el && el !== eDocument.body) { if (el.classList.contains('ag-custom-component-popup') || el.parentElement === null) { return true; } el = el.parentElement; } return false; }; // in some browsers, the context menu event can be fired before the click event, which means // the context menu event could open the popup, but then the click event closes it straight away. PopupService.prototype.isEventSameChainAsOriginalEvent = function (params) { var originalMouseEvent = params.originalMouseEvent, mouseEvent = params.mouseEvent, touchEvent = params.touchEvent; // we check the coordinates of the event, to see if it's the same event. there is a 1 / 1000 chance that // the event is a different event, however that is an edge case that is not very relevant (the user clicking // twice on the same location isn't a normal path). // event could be mouse event or touch event. var mouseEventOrTouch = null; if (mouseEvent) { // mouse event can be used direction, it has coordinates mouseEventOrTouch = mouseEvent; } else if (touchEvent) { // touch event doesn't have coordinates, need it's touch object mouseEventOrTouch = touchEvent.touches[0]; } if (mouseEventOrTouch && originalMouseEvent) { // for x, allow 4px margin, to cover iPads, where touch (which opens menu) is followed // by browser click (when you finger up, touch is interrupted as click in browser) var screenX_1 = mouseEvent ? mouseEvent.screenX : 0; var screenY_1 = mouseEvent ? mouseEvent.screenY : 0; var xMatch = Math.abs(originalMouseEvent.screenX - screenX_1) < 5; var yMatch = Math.abs(originalMouseEvent.screenY - screenY_1) < 5; if (xMatch && yMatch) { return true; } } return false; }; PopupService.prototype.getWrapper = function (ePopup) { while (!ePopup.classList.contains('ag-popup') && ePopup.parentElement) { ePopup = ePopup.parentElement; } return ePopup.classList.contains('ag-popup') ? ePopup : null; }; PopupService.prototype.setAlwaysOnTop = function (ePopup, alwaysOnTop) { var eWrapper = this.getWrapper(ePopup); if (!eWrapper) { return; } eWrapper.classList.toggle('ag-always-on-top', !!alwaysOnTop); if (alwaysOnTop) { this.bringPopupToFront(eWrapper); } }; PopupService.prototype.bringPopupToFront = function (ePopup) { var parent = this.getPopupParent(); var popupList = Array.prototype.slice.call(parent.querySelectorAll('.ag-popup')); var popupLen = popupList.length; var alwaysOnTopList = Array.prototype.slice.call(parent.querySelectorAll('.ag-popup.ag-always-on-top')); var onTopLength = alwaysOnTopList.length; var eWrapper = this.getWrapper(ePopup); if (!eWrapper || popupLen <= 1 || !parent.contains(ePopup)) { return; } var pos = popupList.indexOf(eWrapper); var innerEls = eWrapper.querySelectorAll('div'); var innerElsScrollMap = []; innerEls.forEach(function (el) { if (el.scrollTop !== 0) { innerElsScrollMap.push([el, el.scrollTop]); } }); if (onTopLength) { var isPopupAlwaysOnTop = eWrapper.classList.contains('ag-always-on-top'); if (isPopupAlwaysOnTop) { if (pos !== popupLen - 1) { last(alwaysOnTopList).insertAdjacentElement('afterend', eWrapper); } } else if (pos !== popupLen - onTopLength - 1) { alwaysOnTopList[0].insertAdjacentElement('beforebegin', eWrapper); } } else if (pos !== popupLen - 1) { last(popupList).insertAdjacentElement('afterend', eWrapper); } while (innerElsScrollMap.length) { var currentEl = innerElsScrollMap.pop(); currentEl[0].scrollTop = currentEl[1]; } var params = { type: 'popupToFront', api: this.gridOptionsService.api, columnApi: this.gridOptionsService.columnApi, eWrapper: eWrapper }; this.eventService.dispatchEvent(params); }; PopupService.prototype.checkClearMaxHeight = function (ePopup, shouldSetMaxHeight) { if (shouldSetMaxHeight) { // positionPopup can be called multiple times, so need to clear before bounds check ePopup.style.removeProperty('max-height'); } }; PopupService.prototype.checkSetMaxHeight = function (ePopup, y, shouldSetMaxHeight) { if (shouldSetMaxHeight && getComputedStyle(ePopup).maxHeight === '100%') { // max height could be overridden, so only set if the default (100%) ePopup.style.maxHeight = "calc(100% - " + y + "px)"; } }; var PopupService_1; PopupService.WAIT_FOR_POPUP_CONTENT_RESIZE = 200; __decorate$1L([ Autowired('focusService') ], PopupService.prototype, "focusService", void 0); __decorate$1L([ Autowired('ctrlsService') ], PopupService.prototype, "ctrlsService", void 0); __decorate$1L([ Autowired('resizeObserverService') ], PopupService.prototype, "resizeObserverService", void 0); __decorate$1L([ PostConstruct ], PopupService.prototype, "postConstruct", null); PopupService = PopupService_1 = __decorate$1L([ Bean('popupService') ], PopupService); return PopupService; }(BeanStub)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$25 = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __decorate$1M = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var VirtualList = /** @class */ (function (_super) { __extends$25(VirtualList, _super); function VirtualList(cssIdentifier, ariaRole, listName) { if (cssIdentifier === void 0) { cssIdentifier = 'default'; } if (ariaRole === void 0) { ariaRole = 'listbox'; } var _this = _super.call(this, VirtualList.getTemplate(cssIdentifier)) || this; _this.cssIdentifier = cssIdentifier; _this.ariaRole = ariaRole; _this.listName = listName; _this.renderedRows = new Map(); _this.rowHeight = 20; return _this; } VirtualList.prototype.postConstruct = function () { var _this = this; this.addScrollListener(); this.rowHeight = this.getItemHeight(); this.addResizeObserver(); this.initialiseTabGuard({ onFocusIn: function (e) { return _this.onFocusIn(e); }, onFocusOut: function (e) { return _this.onFocusOut(e); }, focusInnerElement: function (fromBottom) { return _this.focusInnerElement(fromBottom); }, onTabKeyDown: function (e) { return _this.onTabKeyDown(e); }, handleKeyDown: function (e) { return _this.handleKeyDown(e); } }); this.setAriaProperties(); this.addManagedListener(this.eventService, Events.EVENT_GRID_STYLES_CHANGED, this.onGridStylesChanged.bind(this)); }; VirtualList.prototype.onGridStylesChanged = function () { this.rowHeight = this.getItemHeight(); this.refresh(); }; VirtualList.prototype.setAriaProperties = function () { var translate = this.localeService.getLocaleTextFunc(); var listName = translate('ariaDefaultListName', this.listName || 'List'); var ariaEl = this.eContainer; setAriaRole(ariaEl, this.ariaRole); setAriaLabel(ariaEl, listName); }; VirtualList.prototype.addResizeObserver = function () { var _this = this; var listener = function () { return _this.drawVirtualRows(); }; var destroyObserver = this.resizeObserverService.observeResize(this.getGui(), listener); this.addDestroyFunc(destroyObserver); }; VirtualList.prototype.focusInnerElement = function (fromBottom) { this.focusRow(fromBottom ? this.model.getRowCount() - 1 : 0); }; VirtualList.prototype.onFocusIn = function (e) { var target = e.target; if (target.classList.contains('ag-virtual-list-item')) { this.lastFocusedRowIndex = getAriaPosInSet(target) - 1; } return false; }; VirtualList.prototype.onFocusOut = function (e) { if (!this.getFocusableElement().contains(e.relatedTarget)) { this.lastFocusedRowIndex = null; } return false; }; VirtualList.prototype.handleKeyDown = function (e) { switch (e.key) { case KeyCode.UP: case KeyCode.DOWN: if (this.navigate(e.key === KeyCode.UP)) { e.preventDefault(); } break; } }; VirtualList.prototype.onTabKeyDown = function (e) { if (this.navigate(e.shiftKey)) { e.preventDefault(); } else { this.forceFocusOutOfContainer(e.shiftKey); } }; VirtualList.prototype.navigate = function (up) { if (this.lastFocusedRowIndex == null) { return false; } var nextRow = this.lastFocusedRowIndex + (up ? -1 : 1); if (nextRow < 0 || nextRow >= this.model.getRowCount()) { return false; } this.focusRow(nextRow); return true; }; VirtualList.prototype.getLastFocusedRow = function () { return this.lastFocusedRowIndex; }; VirtualList.prototype.focusRow = function (rowNumber) { var _this = this; this.ensureIndexVisible(rowNumber); window.setTimeout(function () { if (!_this.isAlive()) { return; } var renderedRow = _this.renderedRows.get(rowNumber); if (renderedRow) { renderedRow.eDiv.focus(); } }, 10); }; VirtualList.prototype.getComponentAt = function (rowIndex) { var comp = this.renderedRows.get(rowIndex); return comp && comp.rowComponent; }; VirtualList.prototype.forEachRenderedRow = function (func) { this.renderedRows.forEach(function (value, key) { return func(value.rowComponent, key); }); }; VirtualList.getTemplate = function (cssIdentifier) { return /* html */ "\n
\n
\n
"; }; VirtualList.prototype.getItemHeight = function () { return this.environment.getListItemHeight(); }; VirtualList.prototype.ensureIndexVisible = function (index) { var lastRow = this.model.getRowCount(); if (typeof index !== 'number' || index < 0 || index >= lastRow) { console.warn('AG Grid: invalid row index for ensureIndexVisible: ' + index); return; } var rowTopPixel = index * this.rowHeight; var rowBottomPixel = rowTopPixel + this.rowHeight; var eGui = this.getGui(); var viewportTopPixel = eGui.scrollTop; var viewportHeight = eGui.offsetHeight; var viewportBottomPixel = viewportTopPixel + viewportHeight; var viewportScrolledPastRow = viewportTopPixel > rowTopPixel; var viewportScrolledBeforeRow = viewportBottomPixel < rowBottomPixel; if (viewportScrolledPastRow) { // if row is before, scroll up with row at top eGui.scrollTop = rowTopPixel; } else if (viewportScrolledBeforeRow) { // if row is below, scroll down with row at bottom var newScrollPosition = rowBottomPixel - viewportHeight; eGui.scrollTop = newScrollPosition; } }; VirtualList.prototype.setComponentCreator = function (componentCreator) { this.componentCreator = componentCreator; }; VirtualList.prototype.setComponentUpdater = function (componentUpdater) { this.componentUpdater = componentUpdater; }; VirtualList.prototype.getRowHeight = function () { return this.rowHeight; }; VirtualList.prototype.getScrollTop = function () { return this.getGui().scrollTop; }; VirtualList.prototype.setRowHeight = function (rowHeight) { this.rowHeight = rowHeight; this.refresh(); }; VirtualList.prototype.refresh = function (softRefresh) { var _this = this; if (this.model == null || !this.isAlive()) { return; } var rowCount = this.model.getRowCount(); this.eContainer.style.height = rowCount * this.rowHeight + "px"; // ensure height is applied before attempting to redraw rows waitUntil(function () { return _this.eContainer.clientHeight >= rowCount * _this.rowHeight; }, function () { if (!_this.isAlive()) { return; } if (_this.canSoftRefresh(softRefresh)) { _this.drawVirtualRows(true); } else { _this.clearVirtualRows(); _this.drawVirtualRows(); } }); }; VirtualList.prototype.canSoftRefresh = function (softRefresh) { return !!(softRefresh && this.renderedRows.size && typeof this.model.areRowsEqual === 'function' && this.componentUpdater); }; VirtualList.prototype.clearVirtualRows = function () { var _this = this; this.renderedRows.forEach(function (_, rowIndex) { return _this.removeRow(rowIndex); }); }; VirtualList.prototype.drawVirtualRows = function (softRefresh) { if (!this.isAlive()) { return; } var gui = this.getGui(); var topPixel = gui.scrollTop; var bottomPixel = topPixel + gui.offsetHeight; var firstRow = Math.floor(topPixel / this.rowHeight); var lastRow = Math.floor(bottomPixel / this.rowHeight); this.ensureRowsRendered(firstRow, lastRow, softRefresh); }; VirtualList.prototype.ensureRowsRendered = function (start, finish, softRefresh) { var _this = this; // remove any rows that are no longer required this.renderedRows.forEach(function (_, rowIndex) { if ((rowIndex < start || rowIndex > finish) && rowIndex !== _this.lastFocusedRowIndex) { _this.removeRow(rowIndex); } }); if (softRefresh) { // refresh any existing rows this.refreshRows(); } // insert any required new rows for (var rowIndex = start; rowIndex <= finish; rowIndex++) { if (this.renderedRows.has(rowIndex)) { continue; } // check this row actually exists (in case overflow buffer window exceeds real data) if (rowIndex < this.model.getRowCount()) { this.insertRow(rowIndex); } } }; VirtualList.prototype.insertRow = function (rowIndex) { var _this = this; var value = this.model.getRow(rowIndex); var eDiv = document.createElement('div'); eDiv.classList.add('ag-virtual-list-item', "ag-" + this.cssIdentifier + "-virtual-list-item"); setAriaRole(eDiv, this.ariaRole === 'tree' ? 'treeitem' : 'option'); setAriaSetSize(eDiv, this.model.getRowCount()); setAriaPosInSet(eDiv, rowIndex + 1); eDiv.setAttribute('tabindex', '-1'); if (typeof this.model.isRowSelected === 'function') { var isSelected = this.model.isRowSelected(rowIndex); setAriaSelected(eDiv, !!isSelected); setAriaChecked(eDiv, isSelected); } eDiv.style.height = this.rowHeight + "px"; eDiv.style.top = this.rowHeight * rowIndex + "px"; var rowComponent = this.componentCreator(value, eDiv); rowComponent.addGuiEventListener('focusin', function () { return _this.lastFocusedRowIndex = rowIndex; }); eDiv.appendChild(rowComponent.getGui()); // keep the DOM order consistent with the order of the rows if (this.renderedRows.has(rowIndex - 1)) { this.renderedRows.get(rowIndex - 1).eDiv.insertAdjacentElement('afterend', eDiv); } else if (this.renderedRows.has(rowIndex + 1)) { this.renderedRows.get(rowIndex + 1).eDiv.insertAdjacentElement('beforebegin', eDiv); } else { this.eContainer.appendChild(eDiv); } this.renderedRows.set(rowIndex, { rowComponent: rowComponent, eDiv: eDiv, value: value }); }; VirtualList.prototype.removeRow = function (rowIndex) { var component = this.renderedRows.get(rowIndex); this.eContainer.removeChild(component.eDiv); this.destroyBean(component.rowComponent); this.renderedRows.delete(rowIndex); }; VirtualList.prototype.refreshRows = function () { var _this = this; var rowCount = this.model.getRowCount(); this.renderedRows.forEach(function (row, rowIndex) { var _a, _b; if (rowIndex >= rowCount) { _this.removeRow(rowIndex); } else { var newValue = _this.model.getRow(rowIndex); if ((_b = (_a = _this.model).areRowsEqual) === null || _b === void 0 ? void 0 : _b.call(_a, row.value, newValue)) { _this.componentUpdater(newValue, row.rowComponent); } else { // to be replaced later _this.removeRow(rowIndex); } } }); }; VirtualList.prototype.addScrollListener = function () { var _this = this; this.addGuiEventListener('scroll', function () { return _this.drawVirtualRows(); }, { passive: true }); }; VirtualList.prototype.setModel = function (model) { this.model = model; }; VirtualList.prototype.destroy = function () { if (!this.isAlive()) { return; } this.clearVirtualRows(); _super.prototype.destroy.call(this); }; __decorate$1M([ Autowired('resizeObserverService') ], VirtualList.prototype, "resizeObserverService", void 0); __decorate$1M([ RefSelector('eContainer') ], VirtualList.prototype, "eContainer", void 0); __decorate$1M([ PostConstruct ], VirtualList.prototype, "postConstruct", null); return VirtualList; }(TabGuardComp)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var OUTSIDE_ANGULAR_EVENTS = ['mouseover', 'mouseout', 'mouseenter', 'mouseleave']; var PASSIVE_EVENTS$1 = ['touchstart', 'touchend', 'touchmove', 'touchcancel']; /** The base frameworks, eg React & Angular, override this bean with implementations specific to their requirement. */ var VanillaFrameworkOverrides = /** @class */ (function () { function VanillaFrameworkOverrides() { this.isOutsideAngular = function (eventType) { return includes(OUTSIDE_ANGULAR_EVENTS, eventType); }; } // for Vanilla JS, we use simple timeout VanillaFrameworkOverrides.prototype.setTimeout = function (action, timeout) { window.setTimeout(action, timeout); }; VanillaFrameworkOverrides.prototype.setInterval = function (action, timeout) { return new AgPromise(function (resolve) { resolve(window.setInterval(action, timeout)); }); }; // for Vanilla JS, we just add the event to the element VanillaFrameworkOverrides.prototype.addEventListener = function (element, type, listener, useCapture) { var isPassive = includes(PASSIVE_EVENTS$1, type); element.addEventListener(type, listener, { capture: !!useCapture, passive: isPassive }); }; // for Vanilla JS, we just execute the listener VanillaFrameworkOverrides.prototype.dispatchEvent = function (eventType, listener, global) { listener(); }; VanillaFrameworkOverrides.prototype.frameworkComponent = function (name) { return null; }; VanillaFrameworkOverrides.prototype.isFrameworkComponent = function (comp) { return false; }; return VanillaFrameworkOverrides; }()); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$26 = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __decorate$1N = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var __read$m = (undefined && undefined.__read) || function (o, n) { var m = typeof Symbol === "function" && o[Symbol.iterator]; if (!m) return o; var i = m.call(o), r, ar = [], e; try { while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); } catch (error) { e = { error: error }; } finally { try { if (r && !r.done && (m = i["return"])) m.call(i); } finally { if (e) throw e.error; } } return ar; }; var __spread$h = (undefined && undefined.__spread) || function () { for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read$m(arguments[i])); return ar; }; var CellNavigationService = /** @class */ (function (_super) { __extends$26(CellNavigationService, _super); function CellNavigationService() { return _super !== null && _super.apply(this, arguments) || this; } // returns null if no cell to focus on, ie at the end of the grid CellNavigationService.prototype.getNextCellToFocus = function (key, focusedCell, ctrlPressed) { if (ctrlPressed === void 0) { ctrlPressed = false; } if (ctrlPressed) { return this.getNextCellToFocusWithCtrlPressed(key, focusedCell); } return this.getNextCellToFocusWithoutCtrlPressed(key, focusedCell); }; CellNavigationService.prototype.getNextCellToFocusWithCtrlPressed = function (key, focusedCell) { var upKey = key === KeyCode.UP; var downKey = key === KeyCode.DOWN; var leftKey = key === KeyCode.LEFT; var column; var rowIndex; if (upKey || downKey) { rowIndex = upKey ? this.paginationProxy.getPageFirstRow() : this.paginationProxy.getPageLastRow(); column = focusedCell.column; } else { var allColumns = this.columnModel.getAllDisplayedColumns(); var isRtl = this.gridOptionsService.is('enableRtl'); rowIndex = focusedCell.rowIndex; column = leftKey !== isRtl ? allColumns[0] : last(allColumns); } return { rowIndex: rowIndex, rowPinned: null, column: column }; }; CellNavigationService.prototype.getNextCellToFocusWithoutCtrlPressed = function (key, focusedCell) { // starting with the provided cell, we keep moving until we find a cell we can // focus on. var pointer = focusedCell; var finished = false; // finished will be true when either: // a) cell found that we can focus on // b) run out of cells (ie the method returns null) while (!finished) { switch (key) { case KeyCode.UP: pointer = this.getCellAbove(pointer); break; case KeyCode.DOWN: pointer = this.getCellBelow(pointer); break; case KeyCode.RIGHT: if (this.gridOptionsService.is('enableRtl')) { pointer = this.getCellToLeft(pointer); } else { pointer = this.getCellToRight(pointer); } break; case KeyCode.LEFT: if (this.gridOptionsService.is('enableRtl')) { pointer = this.getCellToRight(pointer); } else { pointer = this.getCellToLeft(pointer); } break; default: pointer = null; console.warn('AG Grid: unknown key for navigation ' + key); break; } if (pointer) { finished = this.isCellGoodToFocusOn(pointer); } else { finished = true; } } return pointer; }; CellNavigationService.prototype.isCellGoodToFocusOn = function (gridCell) { var column = gridCell.column; var rowNode; switch (gridCell.rowPinned) { case 'top': rowNode = this.pinnedRowModel.getPinnedTopRow(gridCell.rowIndex); break; case 'bottom': rowNode = this.pinnedRowModel.getPinnedBottomRow(gridCell.rowIndex); break; default: rowNode = this.rowModel.getRow(gridCell.rowIndex); break; } if (!rowNode) { return false; } var suppressNavigable = column.isSuppressNavigable(rowNode); return !suppressNavigable; }; CellNavigationService.prototype.getCellToLeft = function (lastCell) { if (!lastCell) { return null; } var colToLeft = this.columnModel.getDisplayedColBefore(lastCell.column); if (!colToLeft) { return null; } return { rowIndex: lastCell.rowIndex, column: colToLeft, rowPinned: lastCell.rowPinned }; }; CellNavigationService.prototype.getCellToRight = function (lastCell) { if (!lastCell) { return null; } var colToRight = this.columnModel.getDisplayedColAfter(lastCell.column); // if already on right, do nothing if (!colToRight) { return null; } return { rowIndex: lastCell.rowIndex, column: colToRight, rowPinned: lastCell.rowPinned }; }; CellNavigationService.prototype.getRowBelow = function (rowPosition) { // if already on top row, do nothing var index = rowPosition.rowIndex; var pinned = rowPosition.rowPinned; if (this.isLastRowInContainer(rowPosition)) { switch (pinned) { case 'bottom': // never any rows after pinned bottom return null; case 'top': // if on last row of pinned top, then next row is main body (if rows exist), // otherwise it's the pinned bottom if (this.rowModel.isRowsToRender()) { return { rowIndex: this.paginationProxy.getPageFirstRow(), rowPinned: null }; } if (this.pinnedRowModel.isRowsToRender('bottom')) { return { rowIndex: 0, rowPinned: 'bottom' }; } return null; default: // if in the main body, then try pinned bottom, otherwise return nothing if (this.pinnedRowModel.isRowsToRender('bottom')) { return { rowIndex: 0, rowPinned: 'bottom' }; } return null; } } var rowNode = this.rowModel.getRow(rowPosition.rowIndex); var nextStickyPosition = this.getNextStickyPosition(rowNode); if (nextStickyPosition) { return nextStickyPosition; } return { rowIndex: index + 1, rowPinned: pinned }; }; CellNavigationService.prototype.getNextStickyPosition = function (rowNode, up) { if (!this.gridOptionsService.is('groupRowsSticky') || !rowNode || !rowNode.sticky) { return; } var stickyRowCtrls = __spread$h(this.rowRenderer.getStickyTopRowCtrls()).sort(function (a, b) { return a.getRowNode().rowIndex - b.getRowNode().rowIndex; }); var diff = up ? -1 : 1; var idx = stickyRowCtrls.findIndex(function (ctrl) { return ctrl.getRowNode().rowIndex === rowNode.rowIndex; }); var nextCtrl = stickyRowCtrls[idx + diff]; if (nextCtrl) { return { rowIndex: nextCtrl.getRowNode().rowIndex, rowPinned: null }; } }; CellNavigationService.prototype.getCellBelow = function (lastCell) { if (!lastCell) { return null; } var rowBelow = this.getRowBelow(lastCell); if (rowBelow) { return { rowIndex: rowBelow.rowIndex, column: lastCell.column, rowPinned: rowBelow.rowPinned }; } return null; }; CellNavigationService.prototype.isLastRowInContainer = function (rowPosition) { var pinned = rowPosition.rowPinned; var index = rowPosition.rowIndex; if (pinned === 'top') { var lastTopIndex = this.pinnedRowModel.getPinnedTopRowData().length - 1; return lastTopIndex <= index; } if (pinned === 'bottom') { var lastBottomIndex = this.pinnedRowModel.getPinnedBottomRowData().length - 1; return lastBottomIndex <= index; } var lastBodyIndex = this.paginationProxy.getPageLastRow(); return lastBodyIndex <= index; }; CellNavigationService.prototype.getRowAbove = function (rowPosition) { // if already on top row, do nothing var index = rowPosition.rowIndex; var pinned = rowPosition.rowPinned; var isFirstRow = pinned ? index === 0 : index === this.paginationProxy.getPageFirstRow(); // if already on top row, do nothing if (isFirstRow) { if (pinned === 'top') { return null; } if (!pinned) { if (this.pinnedRowModel.isRowsToRender('top')) { return this.getLastFloatingTopRow(); } return null; } // last floating bottom if (this.rowModel.isRowsToRender()) { return this.getLastBodyCell(); } if (this.pinnedRowModel.isRowsToRender('top')) { return this.getLastFloatingTopRow(); } return null; } var rowNode = this.rowModel.getRow(rowPosition.rowIndex); var nextStickyPosition = this.getNextStickyPosition(rowNode, true); if (nextStickyPosition) { return nextStickyPosition; } return { rowIndex: index - 1, rowPinned: pinned }; }; CellNavigationService.prototype.getCellAbove = function (lastCell) { if (!lastCell) { return null; } var rowAbove = this.getRowAbove({ rowIndex: lastCell.rowIndex, rowPinned: lastCell.rowPinned }); if (rowAbove) { return { rowIndex: rowAbove.rowIndex, column: lastCell.column, rowPinned: rowAbove.rowPinned }; } return null; }; CellNavigationService.prototype.getLastBodyCell = function () { var lastBodyRow = this.paginationProxy.getPageLastRow(); return { rowIndex: lastBodyRow, rowPinned: null }; }; CellNavigationService.prototype.getLastFloatingTopRow = function () { var lastFloatingRow = this.pinnedRowModel.getPinnedTopRowData().length - 1; return { rowIndex: lastFloatingRow, rowPinned: 'top' }; }; CellNavigationService.prototype.getNextTabbedCell = function (gridCell, backwards) { if (backwards) { return this.getNextTabbedCellBackwards(gridCell); } return this.getNextTabbedCellForwards(gridCell); }; CellNavigationService.prototype.getNextTabbedCellForwards = function (gridCell) { var displayedColumns = this.columnModel.getAllDisplayedColumns(); var newRowIndex = gridCell.rowIndex; var newFloating = gridCell.rowPinned; // move along to the next cell var newColumn = this.columnModel.getDisplayedColAfter(gridCell.column); // check if end of the row, and if so, go forward a row if (!newColumn) { newColumn = displayedColumns[0]; var rowBelow = this.getRowBelow(gridCell); if (missing(rowBelow)) { return null; } // If we are tabbing and there is a paging panel present, tabbing should go // to the paging panel instead of loading the next page. if (!rowBelow.rowPinned && !this.paginationProxy.isRowInPage(rowBelow)) { return null; } newRowIndex = rowBelow ? rowBelow.rowIndex : null; newFloating = rowBelow ? rowBelow.rowPinned : null; } return { rowIndex: newRowIndex, column: newColumn, rowPinned: newFloating }; }; CellNavigationService.prototype.getNextTabbedCellBackwards = function (gridCell) { var displayedColumns = this.columnModel.getAllDisplayedColumns(); var newRowIndex = gridCell.rowIndex; var newFloating = gridCell.rowPinned; // move along to the next cell var newColumn = this.columnModel.getDisplayedColBefore(gridCell.column); // check if end of the row, and if so, go forward a row if (!newColumn) { newColumn = last(displayedColumns); var rowAbove = this.getRowAbove({ rowIndex: gridCell.rowIndex, rowPinned: gridCell.rowPinned }); if (missing(rowAbove)) { return null; } // If we are tabbing and there is a paging panel present, tabbing should go // to the paging panel instead of loading the next page. if (!rowAbove.rowPinned && !this.paginationProxy.isRowInPage(rowAbove)) { return null; } newRowIndex = rowAbove ? rowAbove.rowIndex : null; newFloating = rowAbove ? rowAbove.rowPinned : null; } return { rowIndex: newRowIndex, column: newColumn, rowPinned: newFloating }; }; __decorate$1N([ Autowired('columnModel') ], CellNavigationService.prototype, "columnModel", void 0); __decorate$1N([ Autowired('rowModel') ], CellNavigationService.prototype, "rowModel", void 0); __decorate$1N([ Autowired('rowRenderer') ], CellNavigationService.prototype, "rowRenderer", void 0); __decorate$1N([ Autowired('pinnedRowModel') ], CellNavigationService.prototype, "pinnedRowModel", void 0); __decorate$1N([ Autowired('paginationProxy') ], CellNavigationService.prototype, "paginationProxy", void 0); CellNavigationService = __decorate$1N([ Bean('cellNavigationService') ], CellNavigationService); return CellNavigationService; }(BeanStub)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$27 = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __decorate$1O = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var __param$4 = (undefined && undefined.__param) || function (paramIndex, decorator) { return function (target, key) { decorator(target, key, paramIndex); } }; var AlignedGridsService = /** @class */ (function (_super) { __extends$27(AlignedGridsService, _super); function AlignedGridsService() { var _this = _super !== null && _super.apply(this, arguments) || this; // flag to mark if we are consuming. to avoid cyclic events (ie other grid firing back to master // while processing a master event) we mark this if consuming an event, and if we are, then // we don't fire back any events. _this.consuming = false; return _this; } AlignedGridsService.prototype.setBeans = function (loggerFactory) { this.logger = loggerFactory.create('AlignedGridsService'); }; AlignedGridsService.prototype.init = function () { this.addManagedListener(this.eventService, Events.EVENT_COLUMN_MOVED, this.fireColumnEvent.bind(this)); this.addManagedListener(this.eventService, Events.EVENT_COLUMN_VISIBLE, this.fireColumnEvent.bind(this)); this.addManagedListener(this.eventService, Events.EVENT_COLUMN_PINNED, this.fireColumnEvent.bind(this)); this.addManagedListener(this.eventService, Events.EVENT_COLUMN_GROUP_OPENED, this.fireColumnEvent.bind(this)); this.addManagedListener(this.eventService, Events.EVENT_COLUMN_RESIZED, this.fireColumnEvent.bind(this)); this.addManagedListener(this.eventService, Events.EVENT_BODY_SCROLL, this.fireScrollEvent.bind(this)); }; // common logic across all the fire methods AlignedGridsService.prototype.fireEvent = function (callback) { // if we are already consuming, then we are acting on an event from a master, // so we don't cause a cyclic firing of events if (this.consuming) { return; } // iterate through the aligned grids, and pass each aligned grid service to the callback var otherGrids = this.gridOptionsService.get('alignedGrids'); if (otherGrids) { otherGrids.forEach(function (otherGridOptions) { if (otherGridOptions.api) { var alignedGridService = otherGridOptions.api.__getAlignedGridService(); callback(alignedGridService); } }); } }; // common logic across all consume methods. very little common logic, however extracting // guarantees consistency across the methods. AlignedGridsService.prototype.onEvent = function (callback) { this.consuming = true; callback(); this.consuming = false; }; AlignedGridsService.prototype.fireColumnEvent = function (event) { this.fireEvent(function (alignedGridsService) { alignedGridsService.onColumnEvent(event); }); }; AlignedGridsService.prototype.fireScrollEvent = function (event) { if (event.direction !== 'horizontal') { return; } this.fireEvent(function (alignedGridsService) { alignedGridsService.onScrollEvent(event); }); }; AlignedGridsService.prototype.onScrollEvent = function (event) { var _this = this; this.onEvent(function () { var gridBodyCon = _this.ctrlsService.getGridBodyCtrl(); gridBodyCon.getScrollFeature().setHorizontalScrollPosition(event.left); }); }; AlignedGridsService.prototype.getMasterColumns = function (event) { var result = []; if (event.columns) { event.columns.forEach(function (column) { result.push(column); }); } else if (event.column) { result.push(event.column); } return result; }; AlignedGridsService.prototype.getColumnIds = function (event) { var result = []; if (event.columns) { event.columns.forEach(function (column) { result.push(column.getColId()); }); } else if (event.column) { result.push(event.column.getColId()); } return result; }; AlignedGridsService.prototype.onColumnEvent = function (event) { var _this = this; this.onEvent(function () { switch (event.type) { case Events.EVENT_COLUMN_MOVED: case Events.EVENT_COLUMN_VISIBLE: case Events.EVENT_COLUMN_PINNED: case Events.EVENT_COLUMN_RESIZED: var colEvent = event; _this.processColumnEvent(colEvent); break; case Events.EVENT_COLUMN_GROUP_OPENED: var groupOpenedEvent = event; _this.processGroupOpenedEvent(groupOpenedEvent); break; case Events.EVENT_COLUMN_PIVOT_CHANGED: // we cannot support pivoting with aligned grids as the columns will be out of sync as the // grids will have columns created based on the row data of the grid. console.warn('AG Grid: pivoting is not supported with aligned grids. ' + 'You can only use one of these features at a time in a grid.'); break; } }); }; AlignedGridsService.prototype.processGroupOpenedEvent = function (groupOpenedEvent) { // likewise for column group var masterColumnGroup = groupOpenedEvent.columnGroup; var otherColumnGroup = null; if (masterColumnGroup) { var groupId = masterColumnGroup.getGroupId(); otherColumnGroup = this.columnModel.getProvidedColumnGroup(groupId); } if (masterColumnGroup && !otherColumnGroup) { return; } this.logger.log('onColumnEvent-> processing ' + groupOpenedEvent + ' expanded = ' + masterColumnGroup.isExpanded()); this.columnModel.setColumnGroupOpened(otherColumnGroup, masterColumnGroup.isExpanded(), "alignedGridChanged"); }; AlignedGridsService.prototype.processColumnEvent = function (colEvent) { var _this = this; var _a; // the column in the event is from the master grid. need to // look up the equivalent from this (other) grid var masterColumn = colEvent.column; var otherColumn = null; if (masterColumn) { otherColumn = this.columnModel.getPrimaryColumn(masterColumn.getColId()); } // if event was with respect to a master column, that is not present in this // grid, then we ignore the event if (masterColumn && !otherColumn) { return; } // in time, all the methods below should use the column ids, it's a more generic way // of handling columns, and also allows for single or multi column events var masterColumns = this.getMasterColumns(colEvent); switch (colEvent.type) { case Events.EVENT_COLUMN_MOVED: // when the user moves columns via applyColumnState, we can't depend on moving specific columns // to an index, as there maybe be many indexes columns moved to (as wasn't result of a mouse drag). // so only way to be sure is match the order of all columns using Column State. { var movedEvent = colEvent; var srcColState = colEvent.columnApi.getColumnState(); var destColState = srcColState.map(function (s) { return ({ colId: s.colId }); }); this.columnModel.applyColumnState({ state: destColState, applyOrder: true }, "alignedGridChanged"); this.logger.log("onColumnEvent-> processing " + colEvent.type + " toIndex = " + movedEvent.toIndex); } break; case Events.EVENT_COLUMN_VISIBLE: // when the user changes visibility via applyColumnState, we can't depend on visibility flag in event // as there maybe be mix of true/false (as wasn't result of a mouse click to set visiblity). // so only way to be sure is match the visibility of all columns using Column State. { var visibleEvent = colEvent; var srcColState = colEvent.columnApi.getColumnState(); var destColState = srcColState.map(function (s) { return ({ colId: s.colId, hide: s.hide }); }); this.columnModel.applyColumnState({ state: destColState }, "alignedGridChanged"); this.logger.log("onColumnEvent-> processing " + colEvent.type + " visible = " + visibleEvent.visible); } break; case Events.EVENT_COLUMN_PINNED: { var pinnedEvent = colEvent; var srcColState = colEvent.columnApi.getColumnState(); var destColState = srcColState.map(function (s) { return ({ colId: s.colId, pinned: s.pinned }); }); this.columnModel.applyColumnState({ state: destColState }, "alignedGridChanged"); this.logger.log("onColumnEvent-> processing " + colEvent.type + " pinned = " + pinnedEvent.pinned); } break; case Events.EVENT_COLUMN_RESIZED: var resizedEvent = colEvent; var columnWidths_1 = {}; masterColumns.forEach(function (column) { _this.logger.log("onColumnEvent-> processing " + colEvent.type + " actualWidth = " + column.getActualWidth()); columnWidths_1[column.getId()] = { key: column.getColId(), newWidth: column.getActualWidth() }; }); // don't set flex columns width (_a = resizedEvent.flexColumns) === null || _a === void 0 ? void 0 : _a.forEach(function (col) { if (columnWidths_1[col.getId()]) { delete columnWidths_1[col.getId()]; } }); this.columnModel.setColumnWidths(Object.values(columnWidths_1), false, resizedEvent.finished, "alignedGridChanged"); break; } var gridBodyCon = this.ctrlsService.getGridBodyCtrl(); var isVerticalScrollShowing = gridBodyCon.isVerticalScrollShowing(); var alignedGrids = this.gridOptionsService.get('alignedGrids'); if (alignedGrids) { alignedGrids.forEach(function (grid) { if (grid.api) { grid.api.setAlwaysShowVerticalScroll(isVerticalScrollShowing); } }); } }; __decorate$1O([ Autowired('columnModel') ], AlignedGridsService.prototype, "columnModel", void 0); __decorate$1O([ Autowired('ctrlsService') ], AlignedGridsService.prototype, "ctrlsService", void 0); __decorate$1O([ __param$4(0, Qualifier('loggerFactory')) ], AlignedGridsService.prototype, "setBeans", null); __decorate$1O([ PostConstruct ], AlignedGridsService.prototype, "init", null); AlignedGridsService = __decorate$1O([ Bean('alignedGridsService') ], AlignedGridsService); return AlignedGridsService; }(BeanStub)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$28 = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __assign$j = (undefined && undefined.__assign) || function () { __assign$j = Object.assign || function(t) { for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; } return t; }; return __assign$j.apply(this, arguments); }; var __decorate$1P = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var __param$5 = (undefined && undefined.__param) || function (paramIndex, decorator) { return function (target, key) { decorator(target, key, paramIndex); } }; var __read$n = (undefined && undefined.__read) || function (o, n) { var m = typeof Symbol === "function" && o[Symbol.iterator]; if (!m) return o; var i = m.call(o), r, ar = [], e; try { while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); } catch (error) { e = { error: error }; } finally { try { if (r && !r.done && (m = i["return"])) m.call(i); } finally { if (e) throw e.error; } } return ar; }; var SelectionService = /** @class */ (function (_super) { __extends$28(SelectionService, _super); function SelectionService() { return _super !== null && _super.apply(this, arguments) || this; } SelectionService.prototype.setBeans = function (loggerFactory) { this.logger = loggerFactory.create('selectionService'); this.reset(); }; SelectionService.prototype.init = function () { var _this = this; this.groupSelectsChildren = this.gridOptionsService.is('groupSelectsChildren'); this.addManagedPropertyListener('groupSelectsChildren', function (propChange) { return _this.groupSelectsChildren = propChange.currentValue; }); this.rowSelection = this.gridOptionsService.get('rowSelection'); this.addManagedPropertyListener('rowSelection', function (propChange) { return _this.rowSelection = propChange.currentValue; }); this.addManagedListener(this.eventService, Events.EVENT_ROW_SELECTED, this.onRowSelected.bind(this)); }; SelectionService.prototype.isMultiselect = function () { return this.rowSelection === 'multiple'; }; SelectionService.prototype.setNodeSelected = function (params) { var _a; var newValue = params.newValue, clearSelection = params.clearSelection, suppressFinishActions = params.suppressFinishActions, rangeSelect = params.rangeSelect, event = params.event, node = params.node, _b = params.source, source = _b === void 0 ? 'api' : _b; // groupSelectsFiltered only makes sense when group selects children var groupSelectsFiltered = this.groupSelectsChildren && (params.groupSelectsFiltered === true); if (node.id === undefined) { console.warn('AG Grid: cannot select node until id for node is known'); return 0; } if (node.rowPinned) { console.warn('AG Grid: cannot select pinned rows'); return 0; } // if we are a footer, we don't do selection, just pass the info // to the sibling (the parent of the group) if (node.footer) { return this.setNodeSelected(__assign$j(__assign$j({}, params), { node: node.sibling })); } var lastSelectedNode = this.getLastSelectedNode(); if (rangeSelect && lastSelectedNode) { var newRowClicked = lastSelectedNode !== node; if (newRowClicked && this.isMultiselect()) { var nodesChanged = this.selectRange(node, lastSelectedNode, params.newValue, source); this.setLastSelectedNode(node); return nodesChanged; } } // when groupSelectsFiltered, then this node may end up intermediate despite // trying to set it to true / false. this group will be calculated further on // down when we call calculatedSelectedForAllGroupNodes(). we need to skip it // here, otherwise the updatedCount would include it. var skipThisNode = groupSelectsFiltered && node.group; var updatedCount = 0; if (!skipThisNode) { var thisNodeWasSelected = node.selectThisNode(newValue, params.event, source); if (thisNodeWasSelected) { updatedCount++; } } if (this.groupSelectsChildren && ((_a = node.childrenAfterGroup) === null || _a === void 0 ? void 0 : _a.length)) { updatedCount += this.selectChildren(node, newValue, groupSelectsFiltered, source); } // clear other nodes if not doing multi select if (!suppressFinishActions) { var clearOtherNodes = newValue && (clearSelection || !this.isMultiselect()); if (clearOtherNodes) { updatedCount += this.clearOtherNodes(node, source); } // only if we selected something, then update groups and fire events if (updatedCount > 0) { this.updateGroupsFromChildrenSelections(source); // this is the very end of the 'action node', so we are finished all the updates, // include any parent / child changes that this method caused var event_1 = { type: Events.EVENT_SELECTION_CHANGED, source: source }; this.eventService.dispatchEvent(event_1); } // so if user next does shift-select, we know where to start the selection from if (newValue) { this.setLastSelectedNode(node); } } return updatedCount; }; // selects all rows between this node and the last selected node (or the top if this is the first selection). // not to be mixed up with 'cell range selection' where you drag the mouse, this is row range selection, by // holding down 'shift'. SelectionService.prototype.selectRange = function (fromNode, toNode, value, source) { var _this = this; if (value === void 0) { value = true; } var nodesToSelect = this.rowModel.getNodesInRangeForSelection(fromNode, toNode); var updatedCount = 0; nodesToSelect.forEach(function (rowNode) { if (rowNode.group && _this.groupSelectsChildren || (value === false && fromNode === rowNode)) { return; } var nodeWasSelected = rowNode.selectThisNode(value, undefined, source); if (nodeWasSelected) { updatedCount++; } }); this.updateGroupsFromChildrenSelections(source); var event = { type: Events.EVENT_SELECTION_CHANGED, source: source }; this.eventService.dispatchEvent(event); return updatedCount; }; SelectionService.prototype.selectChildren = function (node, newValue, groupSelectsFiltered, source) { var children = groupSelectsFiltered ? node.childrenAfterAggFilter : node.childrenAfterGroup; if (_.missing(children)) { return 0; } var updatedCount = 0; for (var i = 0; i < children.length; i++) { updatedCount += children[i].setSelectedParams({ newValue: newValue, clearSelection: false, suppressFinishActions: true, groupSelectsFiltered: groupSelectsFiltered, source: source }); } return updatedCount; }; SelectionService.prototype.setLastSelectedNode = function (rowNode) { this.lastSelectedNode = rowNode; }; SelectionService.prototype.getLastSelectedNode = function () { return this.lastSelectedNode; }; SelectionService.prototype.getSelectedNodes = function () { var selectedNodes = []; iterateObject(this.selectedNodes, function (key, rowNode) { if (rowNode) { selectedNodes.push(rowNode); } }); return selectedNodes; }; SelectionService.prototype.getSelectedRows = function () { var selectedRows = []; iterateObject(this.selectedNodes, function (key, rowNode) { if (rowNode && rowNode.data) { selectedRows.push(rowNode.data); } }); return selectedRows; }; SelectionService.prototype.getSelectionCount = function () { return Object.values(this.selectedNodes).length; }; /** * This method is used by the CSRM to remove groups which are being disposed of, * events do not need fired in this case */ SelectionService.prototype.filterFromSelection = function (predicate) { var newSelectedNodes = {}; Object.entries(this.selectedNodes).forEach(function (_a) { var _b = __read$n(_a, 2), key = _b[0], node = _b[1]; var passesPredicate = node && predicate(node); if (passesPredicate) { newSelectedNodes[key] = node; } }); this.selectedNodes = newSelectedNodes; }; // should only be called if groupSelectsChildren=true SelectionService.prototype.updateGroupsFromChildrenSelections = function (source, changedPath) { // we only do this when group selection state depends on selected children if (!this.groupSelectsChildren) { return false; } // also only do it if CSRM (code should never allow this anyway) if (this.rowModel.getType() !== 'clientSide') { return false; } var clientSideRowModel = this.rowModel; var rootNode = clientSideRowModel.getRootNode(); if (!changedPath) { changedPath = new ChangedPath(true, rootNode); changedPath.setInactive(); } var selectionChanged = false; changedPath.forEachChangedNodeDepthFirst(function (rowNode) { if (rowNode !== rootNode) { var selected = rowNode.calculateSelectedFromChildren(); selectionChanged = rowNode.selectThisNode(selected === null ? false : selected, undefined, source) || selectionChanged; } }); return selectionChanged; }; SelectionService.prototype.clearOtherNodes = function (rowNodeToKeepSelected, source) { var _this = this; var groupsToRefresh = {}; var updatedCount = 0; iterateObject(this.selectedNodes, function (key, otherRowNode) { if (otherRowNode && otherRowNode.id !== rowNodeToKeepSelected.id) { var rowNode = _this.selectedNodes[otherRowNode.id]; updatedCount += rowNode.setSelectedParams({ newValue: false, clearSelection: false, suppressFinishActions: true, source: source }); if (_this.groupSelectsChildren && otherRowNode.parent) { groupsToRefresh[otherRowNode.parent.id] = otherRowNode.parent; } } }); iterateObject(groupsToRefresh, function (key, group) { var selected = group.calculateSelectedFromChildren(); group.selectThisNode(selected === null ? false : selected, undefined, source); }); return updatedCount; }; SelectionService.prototype.onRowSelected = function (event) { var rowNode = event.node; // we do not store the group rows when the groups select children if (this.groupSelectsChildren && rowNode.group) { return; } if (rowNode.isSelected()) { this.selectedNodes[rowNode.id] = rowNode; } else { this.selectedNodes[rowNode.id] = undefined; } }; SelectionService.prototype.syncInRowNode = function (rowNode, oldNode) { this.syncInOldRowNode(rowNode, oldNode); this.syncInNewRowNode(rowNode); }; // if the id has changed for the node, then this means the rowNode // is getting used for a different data item, which breaks // our selectedNodes, as the node now is mapped by the old id // which is inconsistent. so to keep the old node as selected, // we swap in the clone (with the old id and old data). this means // the oldNode is effectively a daemon we keep a reference to, // so if client calls api.getSelectedNodes(), it gets the daemon // in the result. when the client un-selects, the reference to the // daemon is removed. the daemon, because it's an oldNode, is not // used by the grid for rendering, it's a copy of what the node used // to be like before the id was changed. SelectionService.prototype.syncInOldRowNode = function (rowNode, oldNode) { var oldNodeHasDifferentId = exists(oldNode) && (rowNode.id !== oldNode.id); if (oldNodeHasDifferentId && oldNode) { var id = oldNode.id; var oldNodeSelected = this.selectedNodes[id] == rowNode; if (oldNodeSelected) { this.selectedNodes[oldNode.id] = oldNode; } } }; SelectionService.prototype.syncInNewRowNode = function (rowNode) { if (exists(this.selectedNodes[rowNode.id])) { rowNode.setSelectedInitialValue(true); this.selectedNodes[rowNode.id] = rowNode; } else { rowNode.setSelectedInitialValue(false); } }; SelectionService.prototype.reset = function () { this.logger.log('reset'); this.selectedNodes = {}; this.lastSelectedNode = null; }; // returns a list of all nodes at 'best cost' - a feature to be used // with groups / trees. if a group has all it's children selected, // then the group appears in the result, but not the children. // Designed for use with 'children' as the group selection type, // where groups don't actually appear in the selection normally. SelectionService.prototype.getBestCostNodeSelection = function () { if (this.rowModel.getType() !== 'clientSide') { // Error logged as part of gridApi as that is only call point for this method. return; } var clientSideRowModel = this.rowModel; var topLevelNodes = clientSideRowModel.getTopLevelNodes(); if (topLevelNodes === null) { return; } var result = []; // recursive function, to find the selected nodes function traverse(nodes) { for (var i = 0, l = nodes.length; i < l; i++) { var node = nodes[i]; if (node.isSelected()) { result.push(node); } else { // if not selected, then if it's a group, and the group // has children, continue to search for selections var maybeGroup = node; if (maybeGroup.group && maybeGroup.children) { traverse(maybeGroup.children); } } } } traverse(topLevelNodes); return result; }; SelectionService.prototype.isEmpty = function () { var count = 0; iterateObject(this.selectedNodes, function (nodeId, rowNode) { if (rowNode) { count++; } }); return count === 0; }; SelectionService.prototype.deselectAllRowNodes = function (params) { var callback = function (rowNode) { return rowNode.selectThisNode(false, undefined, source); }; var rowModelClientSide = this.rowModel.getType() === 'clientSide'; var source = params.source, justFiltered = params.justFiltered, justCurrentPage = params.justCurrentPage; if (justCurrentPage || justFiltered) { if (!rowModelClientSide) { console.error("AG Grid: selecting just filtered only works when gridOptions.rowModelType='clientSide'"); return; } this.getNodesToSelect(justFiltered, justCurrentPage).forEach(callback); } else { iterateObject(this.selectedNodes, function (id, rowNode) { // remember the reference can be to null, as we never 'delete' from the map if (rowNode) { callback(rowNode); } }); // this clears down the map (whereas above only sets the items in map to 'undefined') this.reset(); } // the above does not clean up the parent rows if they are selected if (rowModelClientSide && this.groupSelectsChildren) { this.updateGroupsFromChildrenSelections(source); } var event = { type: Events.EVENT_SELECTION_CHANGED, source: source }; this.eventService.dispatchEvent(event); }; SelectionService.prototype.getSelectAllState = function (justFiltered, justCurrentPage) { var _this = this; var selectedCount = 0; var notSelectedCount = 0; var callback = function (node) { if (_this.groupSelectsChildren && node.group) { return; } if (node.isSelected()) { selectedCount++; } else if (!node.selectable) ; else { notSelectedCount++; } }; this.getNodesToSelect(justFiltered, justCurrentPage).forEach(callback); // if no rows, always have it unselected if (selectedCount === 0 && notSelectedCount === 0) { return false; } // if mix of selected and unselected, this is indeterminate if (selectedCount > 0 && notSelectedCount > 0) { return null; } // only selected return selectedCount > 0; }; /** * @param justFiltered whether to just include nodes which have passed the filter * @param justCurrentPage whether to just include nodes on the current page * @returns all nodes including unselectable nodes which are the target of this selection attempt */ SelectionService.prototype.getNodesToSelect = function (justFiltered, justCurrentPage) { var _this = this; if (justFiltered === void 0) { justFiltered = false; } if (justCurrentPage === void 0) { justCurrentPage = false; } if (this.rowModel.getType() !== 'clientSide') { throw new Error("selectAll only available when rowModelType='clientSide', ie not " + this.rowModel.getType()); } var nodes = []; if (justCurrentPage) { this.paginationProxy.forEachNodeOnPage(function (node) { if (!node.group) { nodes.push(node); return; } if (!node.expanded) { // even with groupSelectsChildren, do this recursively as only the filtered children // are considered as the current page var recursivelyAddChildren_1 = function (child) { var _a; nodes.push(child); if ((_a = child.childrenAfterFilter) === null || _a === void 0 ? void 0 : _a.length) { child.childrenAfterFilter.forEach(recursivelyAddChildren_1); } }; recursivelyAddChildren_1(node); return; } // if the group node is expanded, the pagination proxy will include the visible nodes to select if (!_this.groupSelectsChildren) { nodes.push(node); } }); return nodes; } var clientSideRowModel = this.rowModel; if (justFiltered) { clientSideRowModel.forEachNodeAfterFilter(function (node) { nodes.push(node); }); return nodes; } clientSideRowModel.forEachNode(function (node) { nodes.push(node); }); return nodes; }; SelectionService.prototype.selectAllRowNodes = function (params) { if (this.rowModel.getType() !== 'clientSide') { throw new Error("selectAll only available when rowModelType='clientSide', ie not " + this.rowModel.getType()); } var source = params.source, justFiltered = params.justFiltered, justCurrentPage = params.justCurrentPage; var callback = function (rowNode) { return rowNode.selectThisNode(true, undefined, source); }; this.getNodesToSelect(justFiltered, justCurrentPage).forEach(callback); // the above does not clean up the parent rows if they are selected if (this.rowModel.getType() === 'clientSide' && this.groupSelectsChildren) { this.updateGroupsFromChildrenSelections(source); } var event = { type: Events.EVENT_SELECTION_CHANGED, source: source }; this.eventService.dispatchEvent(event); }; // Used by SSRM SelectionService.prototype.getServerSideSelectionState = function () { return null; }; SelectionService.prototype.setServerSideSelectionState = function (state) { }; __decorate$1P([ Autowired('rowModel') ], SelectionService.prototype, "rowModel", void 0); __decorate$1P([ Autowired('paginationProxy') ], SelectionService.prototype, "paginationProxy", void 0); __decorate$1P([ __param$5(0, Qualifier('loggerFactory')) ], SelectionService.prototype, "setBeans", null); __decorate$1P([ PostConstruct ], SelectionService.prototype, "init", null); SelectionService = __decorate$1P([ Bean('selectionService') ], SelectionService); return SelectionService; }(BeanStub)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __decorate$1Q = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var ColumnApi = /** @class */ (function () { function ColumnApi() { } /** Gets the grid to size the columns to the specified width in pixels, e.g. `sizeColumnsToFit(900)`. To have the grid fit the columns to the grid's width, use the Grid API `gridApi.sizeColumnsToFit()` instead. */ ColumnApi.prototype.sizeColumnsToFit = function (gridWidth) { // AG-3403 validate that gridWidth is provided because this method has the same name as // a method on the grid API that takes no arguments, and it's easy to confuse the two if (typeof gridWidth === "undefined") { console.error('AG Grid: missing parameter to columnApi.sizeColumnsToFit(gridWidth)'); } this.columnModel.sizeColumnsToFit(gridWidth, 'api'); }; /** Call this if you want to open or close a column group. */ ColumnApi.prototype.setColumnGroupOpened = function (group, newValue) { this.columnModel.setColumnGroupOpened(group, newValue, 'api'); }; /** Returns the column group with the given name. */ ColumnApi.prototype.getColumnGroup = function (name, instanceId) { return this.columnModel.getColumnGroup(name, instanceId); }; /** Returns the provided column group with the given name. */ ColumnApi.prototype.getProvidedColumnGroup = function (name) { return this.columnModel.getProvidedColumnGroup(name); }; /** Returns the display name for a column. Useful if you are doing your own header rendering and want the grid to work out if `headerValueGetter` is used, or if you are doing your own column management GUI, to know what to show as the column name. */ ColumnApi.prototype.getDisplayNameForColumn = function (column, location) { return this.columnModel.getDisplayNameForColumn(column, location) || ''; }; /** Returns the display name for a column group (when grouping columns). */ ColumnApi.prototype.getDisplayNameForColumnGroup = function (columnGroup, location) { return this.columnModel.getDisplayNameForColumnGroup(columnGroup, location) || ''; }; /** Returns the column with the given `colKey`, which can either be the `colId` (a string) or the `colDef` (an object). */ ColumnApi.prototype.getColumn = function (key) { return this.columnModel.getPrimaryColumn(key); }; /** Returns all the columns, regardless of visible or not. */ ColumnApi.prototype.getColumns = function () { return this.columnModel.getAllPrimaryColumns(); }; /** Applies the state of the columns from a previous state. Returns `false` if one or more columns could not be found. */ ColumnApi.prototype.applyColumnState = function (params) { return this.columnModel.applyColumnState(params, 'api'); }; /** Gets the state of the columns. Typically used when saving column state. */ ColumnApi.prototype.getColumnState = function () { return this.columnModel.getColumnState(); }; /** Sets the state back to match the originally provided column definitions. */ ColumnApi.prototype.resetColumnState = function () { this.columnModel.resetColumnState('api'); }; /** Gets the state of the column groups. Typically used when saving column group state. */ ColumnApi.prototype.getColumnGroupState = function () { return this.columnModel.getColumnGroupState(); }; /** Sets the state of the column group state from a previous state. */ ColumnApi.prototype.setColumnGroupState = function (stateItems) { this.columnModel.setColumnGroupState(stateItems, 'api'); }; /** Sets the state back to match the originally provided column definitions. */ ColumnApi.prototype.resetColumnGroupState = function () { this.columnModel.resetColumnGroupState('api'); }; /** Returns `true` if pinning left or right, otherwise `false`. */ ColumnApi.prototype.isPinning = function () { return this.columnModel.isPinningLeft() || this.columnModel.isPinningRight(); }; /** Returns `true` if pinning left, otherwise `false`. */ ColumnApi.prototype.isPinningLeft = function () { return this.columnModel.isPinningLeft(); }; /** Returns `true` if pinning right, otherwise `false`. */ ColumnApi.prototype.isPinningRight = function () { return this.columnModel.isPinningRight(); }; /** Returns the column to the right of the provided column, taking into consideration open / closed column groups and visible columns. This is useful if you need to know what column is beside yours e.g. if implementing your own cell navigation. */ ColumnApi.prototype.getDisplayedColAfter = function (col) { return this.columnModel.getDisplayedColAfter(col); }; /** Same as `getVisibleColAfter` except gives column to the left. */ ColumnApi.prototype.getDisplayedColBefore = function (col) { return this.columnModel.getDisplayedColBefore(col); }; /** Sets the visibility of a column. Key can be the column ID or `Column` object. */ ColumnApi.prototype.setColumnVisible = function (key, visible) { this.columnModel.setColumnVisible(key, visible, 'api'); }; /** Same as `setColumnVisible`, but provide a list of column keys. */ ColumnApi.prototype.setColumnsVisible = function (keys, visible) { this.columnModel.setColumnsVisible(keys, visible, 'api'); }; /** Sets the column pinned / unpinned. Key can be the column ID, field, `ColDef` object or `Column` object. */ ColumnApi.prototype.setColumnPinned = function (key, pinned) { this.columnModel.setColumnPinned(key, pinned, 'api'); }; /** Same as `setColumnPinned`, but provide a list of column keys. */ ColumnApi.prototype.setColumnsPinned = function (keys, pinned) { this.columnModel.setColumnsPinned(keys, pinned, 'api'); }; /** * Returns all the grid columns, same as `getColumns()`, except * * a) it has the order of the columns that are presented in the grid * * b) it's after the 'pivot' step, so if pivoting, has the value columns for the pivot. */ ColumnApi.prototype.getAllGridColumns = function () { return this.columnModel.getAllGridColumns(); }; /** Same as `getAllDisplayedColumns` but just for the pinned left portion of the grid. */ ColumnApi.prototype.getDisplayedLeftColumns = function () { return this.columnModel.getDisplayedLeftColumns(); }; /** Same as `getAllDisplayedColumns` but just for the center portion of the grid. */ ColumnApi.prototype.getDisplayedCenterColumns = function () { return this.columnModel.getDisplayedCenterColumns(); }; /** Same as `getAllDisplayedColumns` but just for the pinned right portion of the grid. */ ColumnApi.prototype.getDisplayedRightColumns = function () { return this.columnModel.getDisplayedRightColumns(); }; /** Returns all columns currently displayed (e.g. are visible and if in a group, the group is showing the columns) for the pinned left, centre and pinned right portions of the grid. */ ColumnApi.prototype.getAllDisplayedColumns = function () { return this.columnModel.getAllDisplayedColumns(); }; /** Same as `getAllGridColumns()`, except only returns rendered columns, i.e. columns that are not within the viewport and therefore not rendered, due to column virtualisation, are not displayed. */ ColumnApi.prototype.getAllDisplayedVirtualColumns = function () { return this.columnModel.getViewportColumns(); }; /** Moves a column to `toIndex`. The column is first removed, then added at the `toIndex` location, thus index locations will change to the right of the column after the removal. */ ColumnApi.prototype.moveColumn = function (key, toIndex) { this.columnModel.moveColumn(key, toIndex, 'api'); }; /** Same as `moveColumn` but works on index locations. */ ColumnApi.prototype.moveColumnByIndex = function (fromIndex, toIndex) { this.columnModel.moveColumnByIndex(fromIndex, toIndex, 'api'); }; /** Same as `moveColumn` but works on list. */ ColumnApi.prototype.moveColumns = function (columnsToMoveKeys, toIndex) { this.columnModel.moveColumns(columnsToMoveKeys, toIndex, 'api'); }; /** Move the column to a new position in the row grouping order. */ ColumnApi.prototype.moveRowGroupColumn = function (fromIndex, toIndex) { this.columnModel.moveRowGroupColumn(fromIndex, toIndex); }; /** Sets the agg function for a column. `aggFunc` can be one of the built-in aggregations or a custom aggregation by name or direct function. */ ColumnApi.prototype.setColumnAggFunc = function (key, aggFunc) { this.columnModel.setColumnAggFunc(key, aggFunc); }; /** Sets the column width on a single column. The finished flag gets included in the resulting event and not used internally by the grid. The finished flag is intended for dragging, where a dragging action will produce many `columnWidth` events, so the consumer of events knows when it receives the last event in a stream. The finished parameter is optional, and defaults to `true`. */ ColumnApi.prototype.setColumnWidth = function (key, newWidth, finished, source) { if (finished === void 0) { finished = true; } this.columnModel.setColumnWidths([{ key: key, newWidth: newWidth }], false, finished, source); }; /** Sets the column widths on multiple columns. This method offers better performance than calling `setColumnWidth` multiple times. The finished flag gets included in the resulting event and not used internally by the grid. The finished flag is intended for dragging, where a dragging action will produce many `columnWidth` events, so the consumer of events knows when it receives the last event in a stream. The finished parameter is optional, and defaults to `true`. */ ColumnApi.prototype.setColumnWidths = function (columnWidths, finished, source) { if (finished === void 0) { finished = true; } this.columnModel.setColumnWidths(columnWidths, false, finished, source); }; /** Set the pivot mode. */ ColumnApi.prototype.setPivotMode = function (pivotMode) { this.columnModel.setPivotMode(pivotMode); }; /** Get the pivot mode. */ ColumnApi.prototype.isPivotMode = function () { return this.columnModel.isPivotMode(); }; /** Returns the pivot result column for the given `pivotKeys` and `valueColId`. Useful to then call operations on the pivot column. */ ColumnApi.prototype.getPivotResultColumn = function (pivotKeys, valueColKey) { return this.columnModel.getSecondaryPivotColumn(pivotKeys, valueColKey); }; /** Set the value columns to the provided list of columns. */ ColumnApi.prototype.setValueColumns = function (colKeys) { this.columnModel.setValueColumns(colKeys, 'api'); }; /** Get a list of the existing value columns. */ ColumnApi.prototype.getValueColumns = function () { return this.columnModel.getValueColumns(); }; /** Remove the given column from the existing set of value columns. */ ColumnApi.prototype.removeValueColumn = function (colKey) { this.columnModel.removeValueColumn(colKey, 'api'); }; /** Like `removeValueColumn` but remove the given list of columns from the existing set of value columns. */ ColumnApi.prototype.removeValueColumns = function (colKeys) { this.columnModel.removeValueColumns(colKeys, 'api'); }; /** Add the given column to the set of existing value columns. */ ColumnApi.prototype.addValueColumn = function (colKey) { this.columnModel.addValueColumn(colKey, 'api'); }; /** Like `addValueColumn` but add the given list of columns to the existing set of value columns. */ ColumnApi.prototype.addValueColumns = function (colKeys) { this.columnModel.addValueColumns(colKeys, 'api'); }; /** Set the row group columns. */ ColumnApi.prototype.setRowGroupColumns = function (colKeys) { this.columnModel.setRowGroupColumns(colKeys, 'api'); }; /** Remove a column from the row groups. */ ColumnApi.prototype.removeRowGroupColumn = function (colKey) { this.columnModel.removeRowGroupColumn(colKey, 'api'); }; /** Same as `removeRowGroupColumn` but provide a list of columns. */ ColumnApi.prototype.removeRowGroupColumns = function (colKeys) { this.columnModel.removeRowGroupColumns(colKeys, 'api'); }; /** Add a column to the row groups. */ ColumnApi.prototype.addRowGroupColumn = function (colKey) { this.columnModel.addRowGroupColumn(colKey, 'api'); }; /** Same as `addRowGroupColumn` but provide a list of columns. */ ColumnApi.prototype.addRowGroupColumns = function (colKeys) { this.columnModel.addRowGroupColumns(colKeys, 'api'); }; /** Get row group columns. */ ColumnApi.prototype.getRowGroupColumns = function () { return this.columnModel.getRowGroupColumns(); }; /** Set the pivot columns. */ ColumnApi.prototype.setPivotColumns = function (colKeys) { this.columnModel.setPivotColumns(colKeys, 'api'); }; /** Remove a pivot column. */ ColumnApi.prototype.removePivotColumn = function (colKey) { this.columnModel.removePivotColumn(colKey, 'api'); }; /** Same as `removePivotColumn` but provide a list of columns. */ ColumnApi.prototype.removePivotColumns = function (colKeys) { this.columnModel.removePivotColumns(colKeys, 'api'); }; /** Add a pivot column. */ ColumnApi.prototype.addPivotColumn = function (colKey) { this.columnModel.addPivotColumn(colKey, 'api'); }; /** Same as `addPivotColumn` but provide a list of columns. */ ColumnApi.prototype.addPivotColumns = function (colKeys) { this.columnModel.addPivotColumns(colKeys, 'api'); }; /** Get the pivot columns. */ ColumnApi.prototype.getPivotColumns = function () { return this.columnModel.getPivotColumns(); }; /** Same as `getAllDisplayedColumnGroups` but just for the pinned left portion of the grid. */ ColumnApi.prototype.getLeftDisplayedColumnGroups = function () { return this.columnModel.getDisplayedTreeLeft(); }; /** Same as `getAllDisplayedColumnGroups` but just for the center portion of the grid. */ ColumnApi.prototype.getCenterDisplayedColumnGroups = function () { return this.columnModel.getDisplayedTreeCentre(); }; /** Same as `getAllDisplayedColumnGroups` but just for the pinned right portion of the grid. */ ColumnApi.prototype.getRightDisplayedColumnGroups = function () { return this.columnModel.getDisplayedTreeRight(); }; /** Returns all 'root' column headers. If you are not grouping columns, these return the columns. If you are grouping, these return the top level groups - you can navigate down through each one to get the other lower level headers and finally the columns at the bottom. */ ColumnApi.prototype.getAllDisplayedColumnGroups = function () { return this.columnModel.getAllDisplayedTrees(); }; /** Auto-sizes a column based on its contents. */ ColumnApi.prototype.autoSizeColumn = function (key, skipHeader) { return this.columnModel.autoSizeColumn(key, skipHeader, 'api'); }; /** Same as `autoSizeColumn`, but provide a list of column keys. */ ColumnApi.prototype.autoSizeColumns = function (keys, skipHeader) { this.columnModel.autoSizeColumns({ columns: keys, skipHeader: skipHeader }); }; /** Calls `autoSizeColumns` on all displayed columns. */ ColumnApi.prototype.autoSizeAllColumns = function (skipHeader) { this.columnModel.autoSizeAllColumns(skipHeader, 'api'); }; /** Set the pivot result columns. */ ColumnApi.prototype.setPivotResultColumns = function (colDefs) { this.columnModel.setSecondaryColumns(colDefs, 'api'); }; /** Returns the grid's pivot result columns. */ ColumnApi.prototype.getPivotResultColumns = function () { return this.columnModel.getSecondaryColumns(); }; ColumnApi.prototype.cleanDownReferencesToAvoidMemoryLeakInCaseApplicationIsKeepingReferenceToDestroyedGrid = function () { // some users were raising support issues with regards memory leaks. the problem was the customers applications // were keeping references to the API. trying to educate them all would be difficult, easier to just remove // all references in the API so at least the core grid can be garbage collected. // // wait about 100ms before clearing down the references, in case user has some cleanup to do, // and needs to deference the API first setTimeout(_.removeAllReferences.bind(window, this, 'Column API'), 100); }; /** @deprecated v28 Use `getColumns` instead */ ColumnApi.prototype.getAllColumns = function () { logDeprecation('28.0', 'getAllColumns', 'getColumns'); return this.getColumns(); }; /** @deprecated v27 getOriginalColumnGroup is deprecated, use getProvidedColumnGroup. */ ColumnApi.prototype.getOriginalColumnGroup = function (name) { logDeprecation('27.0', 'getOriginalColumnGroup', 'getProvidedColumnGroup'); return this.columnModel.getProvidedColumnGroup(name); }; /** @deprecated v28 Use `getColumns` instead. */ ColumnApi.prototype.getPrimaryColumns = function () { logDeprecation('28.0', 'getPrimaryColumns', 'getColumns'); return this.getColumns(); }; /** @deprecated v28 Use `getPivotResultColumns` instead. */ ColumnApi.prototype.getSecondaryColumns = function () { logDeprecation('28.0', 'getSecondaryColumns', 'getPivotResultColumns'); return this.getPivotResultColumns(); }; /** @deprecated v28 Use `setPivotResultColumns` instead. */ ColumnApi.prototype.setSecondaryColumns = function (colDefs) { logDeprecation('28.0', 'setSecondaryColumns', 'setPivotResultColumns'); this.setPivotResultColumns(colDefs); }; /** @deprecated v28 Use `getPivotResultColumn` instead */ ColumnApi.prototype.getSecondaryPivotColumn = function (pivotKeys, valueColKey) { logDeprecation('28.0', 'getSecondaryPivotColumn', 'getPivotResultColumn'); return this.getPivotResultColumn(pivotKeys, valueColKey); }; __decorate$1Q([ Autowired('columnModel') ], ColumnApi.prototype, "columnModel", void 0); __decorate$1Q([ PreDestroy ], ColumnApi.prototype, "cleanDownReferencesToAvoidMemoryLeakInCaseApplicationIsKeepingReferenceToDestroyedGrid", null); ColumnApi = __decorate$1Q([ Bean('columnApi') ], ColumnApi); return ColumnApi; }()); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$29 = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __decorate$1R = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var ValueService = /** @class */ (function (_super) { __extends$29(ValueService, _super); function ValueService() { var _this = _super !== null && _super.apply(this, arguments) || this; _this.initialised = false; return _this; } ValueService.prototype.init = function () { var _this = this; this.cellExpressions = this.gridOptionsService.is('enableCellExpressions'); this.isTreeData = this.gridOptionsService.is('treeData'); this.initialised = true; // We listen to our own event and use it to call the columnSpecific callback, // this way the handler calls are correctly interleaved with other global events this.eventService.addEventListener(Events.EVENT_CELL_VALUE_CHANGED, function (event) { return _this.callColumnCellValueChangedHandler(event); }, this.gridOptionsService.useAsyncEvents()); this.addManagedPropertyListener('treeData', function (propChange) { return _this.isTreeData = propChange.currentValue; }); }; ValueService.prototype.getValue = function (column, rowNode, forFilter, ignoreAggData) { if (forFilter === void 0) { forFilter = false; } if (ignoreAggData === void 0) { ignoreAggData = false; } // hack - the grid is getting refreshed before this bean gets initialised, race condition. // really should have a way so they get initialised in the right order??? if (!this.initialised) { this.init(); } if (!rowNode) { return; } // pull these out to make code below easier to read var colDef = column.getColDef(); var field = colDef.field; var colId = column.getColId(); var data = rowNode.data; var result; // if there is a value getter, this gets precedence over a field var groupDataExists = rowNode.groupData && rowNode.groupData[colId] !== undefined; var aggDataExists = !ignoreAggData && rowNode.aggData && rowNode.aggData[colId] !== undefined; if (forFilter && colDef.filterValueGetter) { result = this.executeFilterValueGetter(colDef.filterValueGetter, data, column, rowNode); } else if (this.isTreeData && aggDataExists) { result = rowNode.aggData[colId]; } else if (this.isTreeData && colDef.valueGetter) { result = this.executeValueGetter(colDef.valueGetter, data, column, rowNode); } else if (this.isTreeData && (field && data)) { result = getValueUsingField(data, field, column.isFieldContainsDots()); } else if (groupDataExists) { result = rowNode.groupData[colId]; } else if (aggDataExists) { result = rowNode.aggData[colId]; } else if (colDef.valueGetter) { result = this.executeValueGetter(colDef.valueGetter, data, column, rowNode); } else if (field && data) { result = getValueUsingField(data, field, column.isFieldContainsDots()); } // the result could be an expression itself, if we are allowing cell values to be expressions if (this.cellExpressions && (typeof result === 'string') && result.indexOf('=') === 0) { var cellValueGetter = result.substring(1); result = this.executeValueGetter(cellValueGetter, data, column, rowNode); } if (result == null) { var openedGroup = this.getOpenedGroup(rowNode, column); if (openedGroup != null) { return openedGroup; } } return result; }; ValueService.prototype.getOpenedGroup = function (rowNode, column) { if (!this.gridOptionsService.is('showOpenedGroup')) { return; } var colDef = column.getColDef(); if (!colDef.showRowGroup) { return; } var showRowGroup = column.getColDef().showRowGroup; var pointer = rowNode.parent; while (pointer != null) { if (pointer.rowGroupColumn && (showRowGroup === true || showRowGroup === pointer.rowGroupColumn.getColId())) { return pointer.key; } pointer = pointer.parent; } return undefined; }; /** * Sets the value of a GridCell * @param rowNode The `RowNode` to be updated * @param colKey The `Column` to be updated * @param newValue The new value to be set * @param eventSource The event source * @returns `True` if the value has been updated, otherwise`False`. */ ValueService.prototype.setValue = function (rowNode, colKey, newValue, eventSource) { var column = this.columnModel.getPrimaryColumn(colKey); if (!rowNode || !column) { return false; } // this will only happen if user is trying to paste into a group row, which doesn't make sense // the user should not be trying to paste into group rows if (missing(rowNode.data)) { rowNode.data = {}; } var _a = column.getColDef(), field = _a.field, valueSetter = _a.valueSetter; if (missing(field) && missing(valueSetter)) { console.warn("AG Grid: you need either field or valueSetter set on colDef for editing to work"); return false; } var params = { node: rowNode, data: rowNode.data, oldValue: this.getValue(column, rowNode), newValue: newValue, colDef: column.getColDef(), column: column, api: this.gridOptionsService.api, columnApi: this.gridOptionsService.columnApi, context: this.gridOptionsService.context }; params.newValue = newValue; var valueWasDifferent; if (exists(valueSetter)) { if (typeof valueSetter === 'function') { valueWasDifferent = valueSetter(params); } else { valueWasDifferent = this.expressionService.evaluate(valueSetter, params); } } else { valueWasDifferent = this.setValueUsingField(rowNode.data, field, newValue, column.isFieldContainsDots()); } // in case user forgot to return something (possible if they are not using TypeScript // and just forgot we default the return value to true, so we always refresh. if (valueWasDifferent === undefined) { valueWasDifferent = true; } // if no change to the value, then no need to do the updating, or notifying via events. // otherwise the user could be tabbing around the grid, and cellValueChange would get called // all the time. if (!valueWasDifferent) { return false; } // reset quick filter on this row rowNode.resetQuickFilterAggregateText(); this.valueCache.onDataChanged(); params.newValue = this.getValue(column, rowNode); var event = { type: Events.EVENT_CELL_VALUE_CHANGED, event: null, rowIndex: rowNode.rowIndex, rowPinned: rowNode.rowPinned, column: params.column, api: params.api, columnApi: params.columnApi, colDef: params.colDef, context: params.context, data: rowNode.data, node: rowNode, oldValue: params.oldValue, newValue: params.newValue, value: params.newValue, source: eventSource }; this.eventService.dispatchEvent(event); return true; }; ValueService.prototype.callColumnCellValueChangedHandler = function (event) { var onCellValueChanged = event.colDef.onCellValueChanged; if (typeof onCellValueChanged === 'function') { onCellValueChanged({ node: event.node, data: event.data, oldValue: event.oldValue, newValue: event.newValue, colDef: event.colDef, column: event.column, api: event.api, columnApi: event.columnApi, context: event.context }); } }; ValueService.prototype.setValueUsingField = function (data, field, newValue, isFieldContainsDots) { if (!field) { return false; } // if no '.', then it's not a deep value var valuesAreSame = false; if (!isFieldContainsDots) { // soft comparison to match strings and numbers valuesAreSame = data[field] == newValue; if (!valuesAreSame) { data[field] = newValue; } } else { // otherwise it is a deep value, so need to dig for it var fieldPieces = field.split('.'); var currentObject = data; while (fieldPieces.length > 0 && currentObject) { var fieldPiece = fieldPieces.shift(); if (fieldPieces.length === 0) { // soft comparison to match strings and numbers valuesAreSame = currentObject[fieldPiece] == newValue; if (!valuesAreSame) { currentObject[fieldPiece] = newValue; } } else { currentObject = currentObject[fieldPiece]; } } } return !valuesAreSame; }; ValueService.prototype.executeFilterValueGetter = function (valueGetter, data, column, rowNode) { var params = { data: data, node: rowNode, column: column, colDef: column.getColDef(), api: this.gridOptionsService.api, columnApi: this.gridOptionsService.columnApi, context: this.gridOptionsService.context, getValue: this.getValueCallback.bind(this, rowNode) }; if (typeof valueGetter === 'function') { return valueGetter(params); } return this.expressionService.evaluate(valueGetter, params); }; ValueService.prototype.executeValueGetter = function (valueGetter, data, column, rowNode) { var colId = column.getColId(); // if inside the same turn, just return back the value we got last time var valueFromCache = this.valueCache.getValue(rowNode, colId); if (valueFromCache !== undefined) { return valueFromCache; } var params = { data: data, node: rowNode, column: column, colDef: column.getColDef(), api: this.gridOptionsService.api, columnApi: this.gridOptionsService.columnApi, context: this.gridOptionsService.context, getValue: this.getValueCallback.bind(this, rowNode) }; var result; if (typeof valueGetter === 'function') { result = valueGetter(params); } else { result = this.expressionService.evaluate(valueGetter, params); } // if a turn is active, store the value in case the grid asks for it again this.valueCache.setValue(rowNode, colId, result); return result; }; ValueService.prototype.getValueCallback = function (node, field) { var otherColumn = this.columnModel.getPrimaryColumn(field); if (otherColumn) { return this.getValue(otherColumn, node); } return null; }; // used by row grouping and pivot, to get key for a row. col can be a pivot col or a row grouping col ValueService.prototype.getKeyForNode = function (col, rowNode) { var value = this.getValue(col, rowNode); var keyCreator = col.getColDef().keyCreator; var result = value; if (keyCreator) { var keyParams = { value: value, colDef: col.getColDef(), column: col, node: rowNode, data: rowNode.data, api: this.gridOptionsService.api, columnApi: this.gridOptionsService.columnApi, context: this.gridOptionsService.context }; result = keyCreator(keyParams); } // if already a string, or missing, just return it if (typeof result === 'string' || result == null) { return result; } result = String(result); if (result === '[object Object]') { doOnce(function () { console.warn('AG Grid: a column you are grouping or pivoting by has objects as values. If you want to group by complex objects then either a) use a colDef.keyCreator (se AG Grid docs) or b) to toString() on the object to return a key'); }, 'getKeyForNode - warn about [object,object]'); } return result; }; __decorate$1R([ Autowired('expressionService') ], ValueService.prototype, "expressionService", void 0); __decorate$1R([ Autowired('columnModel') ], ValueService.prototype, "columnModel", void 0); __decorate$1R([ Autowired('valueCache') ], ValueService.prototype, "valueCache", void 0); __decorate$1R([ PostConstruct ], ValueService.prototype, "init", null); ValueService = __decorate$1R([ Bean('valueService') ], ValueService); return ValueService; }(BeanStub)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$2a = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __decorate$1S = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var __param$6 = (undefined && undefined.__param) || function (paramIndex, decorator) { return function (target, key) { decorator(target, key, paramIndex); } }; var ExpressionService = /** @class */ (function (_super) { __extends$2a(ExpressionService, _super); function ExpressionService() { var _this = _super !== null && _super.apply(this, arguments) || this; _this.expressionToFunctionCache = {}; return _this; } ExpressionService.prototype.setBeans = function (loggerFactory) { this.logger = loggerFactory.create('ExpressionService'); }; ExpressionService.prototype.evaluate = function (expression, params) { if (typeof expression === 'string') { // valueGetter is an expression, so execute the expression return this.evaluateExpression(expression, params); } else { console.error('AG Grid: value should be either a string or a function', expression); } }; ExpressionService.prototype.evaluateExpression = function (expression, params) { try { var javaScriptFunction = this.createExpressionFunction(expression); // the params don't have all these values, rather we add every possible // value a params can have, which makes whatever is in the params available. var result = javaScriptFunction(params.value, params.context, params.oldValue, params.newValue, params.value, params.node, params.data, params.colDef, params.rowIndex, params.api, params.columnApi, params.getValue, params.column, params.columnGroup); return result; } catch (e) { // the expression failed, which can happen, as it's the client that // provides the expression. so print a nice message // tslint:disable-next-line console.log('Processing of the expression failed'); // tslint:disable-next-line console.log('Expression = ' + expression); // tslint:disable-next-line console.log('Params =', params); // tslint:disable-next-line console.log('Exception = ' + e); return null; } }; ExpressionService.prototype.createExpressionFunction = function (expression) { // check cache first if (this.expressionToFunctionCache[expression]) { return this.expressionToFunctionCache[expression]; } // if not found in cache, return the function var functionBody = this.createFunctionBody(expression); var theFunction = new Function('x, ctx, oldValue, newValue, value, node, data, colDef, rowIndex, api, columnApi, getValue, column, columnGroup', functionBody); // store in cache this.expressionToFunctionCache[expression] = theFunction; return theFunction; }; ExpressionService.prototype.createFunctionBody = function (expression) { // if the expression has the 'return' word in it, then use as is, // if not, then wrap it with return and ';' to make a function if (expression.indexOf('return') >= 0) { return expression; } else { return 'return ' + expression + ';'; } }; __decorate$1S([ __param$6(0, Qualifier('loggerFactory')) ], ExpressionService.prototype, "setBeans", null); ExpressionService = __decorate$1S([ Bean('expressionService') ], ExpressionService); return ExpressionService; }(BeanStub)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$2b = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __decorate$1T = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var TemplateService = /** @class */ (function (_super) { __extends$2b(TemplateService, _super); function TemplateService() { var _this = _super !== null && _super.apply(this, arguments) || this; _this.templateCache = {}; _this.waitingCallbacks = {}; return _this; } // returns the template if it is loaded, or null if it is not loaded // but will call the callback when it is loaded TemplateService.prototype.getTemplate = function (url, callback) { var templateFromCache = this.templateCache[url]; if (templateFromCache) { return templateFromCache; } var callbackList = this.waitingCallbacks[url]; var that = this; if (!callbackList) { // first time this was called, so need a new list for callbacks callbackList = []; this.waitingCallbacks[url] = callbackList; // and also need to do the http request var client = new XMLHttpRequest(); client.onload = function () { that.handleHttpResult(this, url); }; client.open("GET", url); client.send(); } // add this callback if (callback) { callbackList.push(callback); } // caller needs to wait for template to load, so return null return null; }; TemplateService.prototype.handleHttpResult = function (httpResult, url) { if (httpResult.status !== 200 || httpResult.response === null) { console.warn("AG Grid: Unable to get template error " + httpResult.status + " - " + url); return; } // response success, so process it // in IE9 the response is in - responseText this.templateCache[url] = httpResult.response || httpResult.responseText; // inform all listeners that this is now in the cache var callbacks = this.waitingCallbacks[url]; for (var i = 0; i < callbacks.length; i++) { var callback = callbacks[i]; // we could pass the callback the response, however we know the client of this code // is the cell renderer, and it passes the 'cellRefresh' method in as the callback // which doesn't take any parameters. callback(); } }; TemplateService = __decorate$1T([ Bean('templateService') ], TemplateService); return TemplateService; }(BeanStub)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$2c = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __decorate$1U = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var __param$7 = (undefined && undefined.__param) || function (paramIndex, decorator) { return function (target, key) { decorator(target, key, paramIndex); } }; var LoggerFactory = /** @class */ (function (_super) { __extends$2c(LoggerFactory, _super); function LoggerFactory() { return _super !== null && _super.apply(this, arguments) || this; } LoggerFactory.prototype.setBeans = function (gridOptionsService) { this.logging = gridOptionsService.is('debug'); }; LoggerFactory.prototype.create = function (name) { return new Logger(name, this.isLogging.bind(this)); }; LoggerFactory.prototype.isLogging = function () { return this.logging; }; __decorate$1U([ __param$7(0, Qualifier('gridOptionsService')) ], LoggerFactory.prototype, "setBeans", null); LoggerFactory = __decorate$1U([ Bean('loggerFactory') ], LoggerFactory); return LoggerFactory; }(BeanStub)); var Logger = /** @class */ (function () { function Logger(name, isLoggingFunc) { this.name = name; this.isLoggingFunc = isLoggingFunc; } Logger.prototype.isLogging = function () { return this.isLoggingFunc(); }; Logger.prototype.log = function (message) { if (this.isLoggingFunc()) { // tslint:disable-next-line console.log('AG Grid.' + this.name + ': ' + message); } }; return Logger; }()); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$2d = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __decorate$1V = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var GridCtrl = /** @class */ (function (_super) { __extends$2d(GridCtrl, _super); function GridCtrl() { return _super !== null && _super.apply(this, arguments) || this; } GridCtrl.prototype.setComp = function (view, eGridDiv, eGui) { var _this = this; this.view = view; this.eGridHostDiv = eGridDiv; this.eGui = eGui; // this drop target is just used to see if the drop event is inside the grid this.dragAndDropService.addDropTarget({ getContainer: function () { return _this.eGui; }, isInterestedIn: function (type) { return type === exports.DragSourceType.HeaderCell || type === exports.DragSourceType.ToolPanel; }, getIconName: function () { return DragAndDropService.ICON_NOT_ALLOWED; }, }); this.mouseEventService.stampTopLevelGridCompWithGridInstance(eGridDiv); this.createManagedBean(new LayoutFeature(this.view)); this.addRtlSupport(); this.addManagedListener(this, Events.EVENT_KEYBOARD_FOCUS, function () { _this.view.addOrRemoveKeyboardFocusClass(true); }); this.addManagedListener(this, Events.EVENT_MOUSE_FOCUS, function () { _this.view.addOrRemoveKeyboardFocusClass(false); }); var unsubscribeFromResize = this.resizeObserverService.observeResize(this.eGridHostDiv, this.onGridSizeChanged.bind(this)); this.addDestroyFunc(function () { return unsubscribeFromResize(); }); this.ctrlsService.registerGridCtrl(this); }; GridCtrl.prototype.isDetailGrid = function () { var _a; var el = this.focusService.findTabbableParent(this.getGui()); return ((_a = el === null || el === void 0 ? void 0 : el.getAttribute('row-id')) === null || _a === void 0 ? void 0 : _a.startsWith('detail')) || false; }; GridCtrl.prototype.showDropZones = function () { return ModuleRegistry.isRegistered(exports.ModuleNames.RowGroupingModule); }; GridCtrl.prototype.showSideBar = function () { return ModuleRegistry.isRegistered(exports.ModuleNames.SideBarModule); }; GridCtrl.prototype.showStatusBar = function () { return ModuleRegistry.isRegistered(exports.ModuleNames.StatusBarModule); }; GridCtrl.prototype.showWatermark = function () { return ModuleRegistry.isRegistered(exports.ModuleNames.EnterpriseCoreModule); }; GridCtrl.prototype.onGridSizeChanged = function () { var event = { type: Events.EVENT_GRID_SIZE_CHANGED, clientWidth: this.eGridHostDiv.clientWidth, clientHeight: this.eGridHostDiv.clientHeight }; this.eventService.dispatchEvent(event); }; GridCtrl.prototype.addRtlSupport = function () { var cssClass = this.gridOptionsService.is('enableRtl') ? 'ag-rtl' : 'ag-ltr'; this.view.setRtlClass(cssClass); }; GridCtrl.prototype.destroyGridUi = function () { this.view.destroyGridUi(); }; GridCtrl.prototype.getGui = function () { return this.eGui; }; GridCtrl.prototype.setResizeCursor = function (on) { this.view.setCursor(on ? 'ew-resize' : null); }; GridCtrl.prototype.disableUserSelect = function (on) { this.view.setUserSelect(on ? 'none' : null); }; GridCtrl.prototype.focusNextInnerContainer = function (backwards) { var eDocument = this.gridOptionsService.getDocument(); var focusableContainers = this.view.getFocusableContainers(); var idxWithFocus = focusableContainers.findIndex(function (container) { return container.contains(eDocument.activeElement); }); var nextIdx = idxWithFocus + (backwards ? -1 : 1); if (nextIdx <= 0 || nextIdx >= focusableContainers.length) { return false; } return this.focusService.focusInto(focusableContainers[nextIdx]); }; GridCtrl.prototype.focusInnerElement = function (fromBottom) { var focusableContainers = this.view.getFocusableContainers(); if (fromBottom) { if (focusableContainers.length > 1) { return this.focusService.focusInto(last(focusableContainers), true); } var lastColumn = last(this.columnModel.getAllDisplayedColumns()); if (this.focusService.focusGridView(lastColumn, true)) { return true; } } return this.focusService.focusFirstHeader(); }; GridCtrl.prototype.forceFocusOutOfContainer = function (up) { if (up === void 0) { up = false; } this.view.forceFocusOutOfContainer(up); }; __decorate$1V([ Autowired('focusService') ], GridCtrl.prototype, "focusService", void 0); __decorate$1V([ Autowired('resizeObserverService') ], GridCtrl.prototype, "resizeObserverService", void 0); __decorate$1V([ Autowired('columnModel') ], GridCtrl.prototype, "columnModel", void 0); __decorate$1V([ Autowired('ctrlsService') ], GridCtrl.prototype, "ctrlsService", void 0); __decorate$1V([ Autowired('mouseEventService') ], GridCtrl.prototype, "mouseEventService", void 0); __decorate$1V([ Autowired('dragAndDropService') ], GridCtrl.prototype, "dragAndDropService", void 0); return GridCtrl; }(BeanStub)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$2e = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __decorate$1W = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var GridComp = /** @class */ (function (_super) { __extends$2e(GridComp, _super); function GridComp(eGridDiv) { var _this = _super.call(this) || this; _this.eGridDiv = eGridDiv; return _this; } GridComp.prototype.postConstruct = function () { var _this = this; this.logger = this.loggerFactory.create('GridComp'); var compProxy = { destroyGridUi: function () { return _this.destroyBean(_this); }, setRtlClass: function (cssClass) { return _this.addCssClass(cssClass); }, addOrRemoveKeyboardFocusClass: function (addOrRemove) { return _this.addOrRemoveCssClass(FocusService.AG_KEYBOARD_FOCUS, addOrRemove); }, forceFocusOutOfContainer: this.forceFocusOutOfContainer.bind(this), updateLayoutClasses: this.updateLayoutClasses.bind(this), getFocusableContainers: this.getFocusableContainers.bind(this), setUserSelect: function (value) { _this.getGui().style.userSelect = value != null ? value : ''; _this.getGui().style.webkitUserSelect = value != null ? value : ''; }, setCursor: function (value) { _this.getGui().style.cursor = value != null ? value : ''; } }; this.ctrl = this.createManagedBean(new GridCtrl()); var template = this.createTemplate(); this.setTemplate(template); this.ctrl.setComp(compProxy, this.eGridDiv, this.getGui()); this.insertGridIntoDom(); this.initialiseTabGuard({ // we want to override the default behaviour to do nothing for onTabKeyDown onTabKeyDown: function () { return undefined; }, focusInnerElement: function (fromBottom) { return _this.ctrl.focusInnerElement(fromBottom); } }); }; GridComp.prototype.insertGridIntoDom = function () { var _this = this; var eGui = this.getGui(); this.eGridDiv.appendChild(eGui); this.addDestroyFunc(function () { _this.eGridDiv.removeChild(eGui); _this.logger.log('Grid removed from DOM'); }); }; GridComp.prototype.updateLayoutClasses = function (cssClass, params) { var eRootWrapperBodyClassList = this.eRootWrapperBody.classList; eRootWrapperBodyClassList.toggle(exports.LayoutCssClasses.AUTO_HEIGHT, params.autoHeight); eRootWrapperBodyClassList.toggle(exports.LayoutCssClasses.NORMAL, params.normal); eRootWrapperBodyClassList.toggle(exports.LayoutCssClasses.PRINT, params.print); this.addOrRemoveCssClass(exports.LayoutCssClasses.AUTO_HEIGHT, params.autoHeight); this.addOrRemoveCssClass(exports.LayoutCssClasses.NORMAL, params.normal); this.addOrRemoveCssClass(exports.LayoutCssClasses.PRINT, params.print); }; GridComp.prototype.createTemplate = function () { var dropZones = this.ctrl.showDropZones() ? '' : ''; var sideBar = this.ctrl.showSideBar() ? '' : ''; var statusBar = this.ctrl.showStatusBar() ? '' : ''; var watermark = this.ctrl.showWatermark() ? '' : ''; var template = /* html */ "
\n " + dropZones + "\n
\n \n " + sideBar + "\n
\n " + statusBar + "\n \n " + watermark + "\n
"; return template; }; GridComp.prototype.getFocusableElement = function () { return this.eRootWrapperBody; }; GridComp.prototype.getFocusableContainers = function () { var focusableContainers = [ this.gridBodyComp.getGui() ]; if (this.sideBarComp) { focusableContainers.push(this.sideBarComp.getGui()); } return focusableContainers.filter(function (el) { return isVisible(el); }); }; __decorate$1W([ Autowired('loggerFactory') ], GridComp.prototype, "loggerFactory", void 0); __decorate$1W([ RefSelector('gridBody') ], GridComp.prototype, "gridBodyComp", void 0); __decorate$1W([ RefSelector('sideBar') ], GridComp.prototype, "sideBarComp", void 0); __decorate$1W([ RefSelector('rootWrapperBody') ], GridComp.prototype, "eRootWrapperBody", void 0); __decorate$1W([ PostConstruct ], GridComp.prototype, "postConstruct", null); return GridComp; }(TabGuardComp)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$2f = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __decorate$1X = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var __read$o = (undefined && undefined.__read) || function (o, n) { var m = typeof Symbol === "function" && o[Symbol.iterator]; if (!m) return o; var i = m.call(o), r, ar = [], e; try { while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); } catch (error) { e = { error: error }; } finally { try { if (r && !r.done && (m = i["return"])) m.call(i); } finally { if (e) throw e.error; } } return ar; }; var __spread$i = (undefined && undefined.__spread) || function () { for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read$o(arguments[i])); return ar; }; var SortController = /** @class */ (function (_super) { __extends$2f(SortController, _super); function SortController() { return _super !== null && _super.apply(this, arguments) || this; } SortController_1 = SortController; SortController.prototype.progressSort = function (column, multiSort, source) { var nextDirection = this.getNextSortDirection(column); this.setSortForColumn(column, nextDirection, multiSort, source); }; SortController.prototype.setSortForColumn = function (column, sort, multiSort, source) { // auto correct - if sort not legal value, then set it to 'no sort' (which is null) if (sort !== 'asc' && sort !== 'desc') { sort = null; } var isColumnsSortingCoupledToGroup = this.gridOptionsService.isColumnsSortingCoupledToGroup(); var columnsToUpdate = [column]; if (isColumnsSortingCoupledToGroup && column.getColDef().showRowGroup) { if (!column.getColDef().field) { // if no field is present, this column shouldn't have it's own sort direction columnsToUpdate = []; } var rowGroupColumns = this.columnModel.getSourceColumnsForGroupColumn(column); var sortableRowGroupColumns = rowGroupColumns === null || rowGroupColumns === void 0 ? void 0 : rowGroupColumns.filter(function (col) { return col.getColDef().sortable; }); if (sortableRowGroupColumns) { columnsToUpdate = __spread$i(columnsToUpdate, sortableRowGroupColumns); } } columnsToUpdate.forEach(function (col) { return col.setSort(sort, source); }); var doingMultiSort = (multiSort || this.gridOptionsService.is('alwaysMultiSort')) && !this.gridOptionsService.is('suppressMultiSort'); // clear sort on all columns except those changed, and update the icons if (!doingMultiSort) { this.clearSortBarTheseColumns(columnsToUpdate, source); } // sortIndex used for knowing order of cols when multi-col sort this.updateSortIndex(column); this.dispatchSortChangedEvents(source); }; SortController.prototype.updateSortIndex = function (lastColToChange) { var isCoupled = this.gridOptionsService.isColumnsSortingCoupledToGroup(); var groupParent = this.columnModel.getGroupDisplayColumnForGroup(lastColToChange.getId()); var lastSortIndexCol = isCoupled ? groupParent || lastColToChange : lastColToChange; var allSortedCols = this.getColumnsWithSortingOrdered(true); // reset sort index on everything this.columnModel.getPrimaryAndSecondaryAndAutoColumns().forEach(function (col) { return col.setSortIndex(null); }); var allSortedColsWithoutChanges = allSortedCols.filter(function (col) { return col !== lastSortIndexCol; }); var sortedColsWithIndices = !!lastSortIndexCol.getSort() ? __spread$i(allSortedColsWithoutChanges, [lastSortIndexCol]) : allSortedColsWithoutChanges; sortedColsWithIndices.forEach(function (col, idx) { return (col.setSortIndex(idx)); }); }; // gets called by API, so if data changes, use can call this, which will end up // working out the sort order again of the rows. SortController.prototype.onSortChanged = function (source) { this.dispatchSortChangedEvents(source); }; SortController.prototype.isSortActive = function () { // pull out all the columns that have sorting set var allCols = this.columnModel.getPrimaryAndSecondaryAndAutoColumns(); var sortedCols = allCols.filter(function (column) { return !!column.getSort(); }); return sortedCols && sortedCols.length > 0; }; SortController.prototype.dispatchSortChangedEvents = function (source) { var event = { type: Events.EVENT_SORT_CHANGED, source: source }; this.eventService.dispatchEvent(event); }; SortController.prototype.clearSortBarTheseColumns = function (columnsToSkip, source) { this.columnModel.getPrimaryAndSecondaryAndAutoColumns().forEach(function (columnToClear) { // Do not clear if either holding shift, or if column in question was clicked if (!columnsToSkip.includes(columnToClear)) { // setting to 'undefined' as null means 'none' rather than cleared, otherwise issue will arise // if sort order is: ['desc', null , 'asc'], as it will start at null rather than 'desc'. columnToClear.setSort(undefined, source); } }); }; SortController.prototype.getNextSortDirection = function (column) { var sortingOrder; if (column.getColDef().sortingOrder) { sortingOrder = column.getColDef().sortingOrder; } else if (this.gridOptionsService.get('sortingOrder')) { sortingOrder = this.gridOptionsService.get('sortingOrder'); } else { sortingOrder = SortController_1.DEFAULT_SORTING_ORDER; } if (!Array.isArray(sortingOrder) || sortingOrder.length <= 0) { console.warn("AG Grid: sortingOrder must be an array with at least one element, currently it's " + sortingOrder); return null; } // if a field is present, this column could have it's own sort, otherwise it's calculated from other columns var currentSort = !!column.getColDef().field ? column.getSort() : this.getDisplaySortForColumn(column); var result = sortingOrder[0]; if (currentSort !== 'mixed') { var currentIndex = sortingOrder.indexOf(currentSort); var notInArray = currentIndex < 0; var lastItemInArray = currentIndex == sortingOrder.length - 1; if (notInArray || lastItemInArray) { result = sortingOrder[0]; } else { result = sortingOrder[currentIndex + 1]; } } // verify the sort type exists, as the user could provide the sortingOrder, need to make sure it's valid if (SortController_1.DEFAULT_SORTING_ORDER.indexOf(result) < 0) { console.warn('AG Grid: invalid sort type ' + result); return null; } return result; }; /** * @param includeRedundantColumns whether to include non-grouped, non-secondary, non-aggregated columns when pivot active * @returns a map of sort indexes for every sorted column, if groups sort primaries then they will have equivalent indices */ SortController.prototype.getIndexedSortMap = function (includeRedundantColumns) { var _this = this; if (includeRedundantColumns === void 0) { includeRedundantColumns = false; } // pull out all the columns that have sorting set var allSortedCols = this.columnModel.getPrimaryAndSecondaryAndAutoColumns() .filter(function (col) { return !!col.getSort(); }); if (!includeRedundantColumns && this.columnModel.isPivotMode()) { allSortedCols = allSortedCols.filter(function (col) { return (!!col.getAggFunc() || !col.isPrimary() || _this.columnModel.getGroupDisplayColumnForGroup(col.getId())); }); } var sortedRowGroupCols = this.columnModel.getRowGroupColumns() .filter(function (col) { return !!col.getSort(); }); var isSortLinked = this.gridOptionsService.isColumnsSortingCoupledToGroup() && !!sortedRowGroupCols.length; if (isSortLinked) { allSortedCols = __spread$i(new Set( // if linked sorting, replace all columns with the display group column for index purposes, and ensure uniqueness allSortedCols.map(function (col) { var _a; return (_a = _this.columnModel.getGroupDisplayColumnForGroup(col.getId())) !== null && _a !== void 0 ? _a : col; }))); } // when both cols are missing sortIndex, we use the position of the col in all cols list. // this means if colDefs only have sort, but no sortIndex, we deterministically pick which // cols is sorted by first. var allColsIndexes = {}; allSortedCols.forEach(function (col, index) { return allColsIndexes[col.getId()] = index; }); // put the columns in order of which one got sorted first allSortedCols.sort(function (a, b) { var iA = a.getSortIndex(); var iB = b.getSortIndex(); if (iA != null && iB != null) { return iA - iB; // both present, normal comparison } else if (iA == null && iB == null) { // both missing, compare using column positions var posA = allColsIndexes[a.getId()]; var posB = allColsIndexes[b.getId()]; return posA > posB ? 1 : -1; } else if (iB == null) { return -1; // iB missing } else { return 1; // iA missing } }); var indexMap = new Map(); allSortedCols.forEach(function (col, idx) { return indexMap.set(col, idx); }); // add the row group cols back if (isSortLinked) { sortedRowGroupCols.forEach(function (col) { var groupDisplayCol = _this.columnModel.getGroupDisplayColumnForGroup(col.getId()); indexMap.set(col, indexMap.get(groupDisplayCol)); }); } return indexMap; }; SortController.prototype.getColumnsWithSortingOrdered = function (includeRedundantColumns) { if (includeRedundantColumns === void 0) { includeRedundantColumns = false; } // pull out all the columns that have sorting set return __spread$i(this.getIndexedSortMap(includeRedundantColumns).entries()).sort(function (_a, _b) { var _c = __read$o(_a, 2), col1 = _c[0], idx1 = _c[1]; var _d = __read$o(_b, 2), col2 = _d[0], idx2 = _d[1]; return idx1 - idx2; }) .map(function (_a) { var _b = __read$o(_a, 1), col = _b[0]; return col; }); }; // used by server side row models, to sent sort to server SortController.prototype.getSortModel = function () { // because this is used by the SSRM, we include redundant options and let the server decide return this.getColumnsWithSortingOrdered(true).map(function (column) { return ({ sort: column.getSort(), colId: column.getId() }); }); }; SortController.prototype.getSortOptions = function () { // this is used for client side sorting, as such we can ignore redundant column sorts return this.getColumnsWithSortingOrdered().map(function (column) { return ({ sort: column.getSort(), column: column }); }); }; SortController.prototype.canColumnDisplayMixedSort = function (column) { var isColumnSortCouplingActive = this.gridOptionsService.isColumnsSortingCoupledToGroup(); var isGroupDisplayColumn = !!column.getColDef().showRowGroup; return isColumnSortCouplingActive && isGroupDisplayColumn; }; SortController.prototype.getDisplaySortForColumn = function (column) { var linkedColumns = this.columnModel.getSourceColumnsForGroupColumn(column); if (!this.canColumnDisplayMixedSort(column) || !(linkedColumns === null || linkedColumns === void 0 ? void 0 : linkedColumns.length)) { return column.getSort(); } // if column has unique data, its sorting is independent - but can still be mixed var columnHasUniqueData = !!column.getColDef().field; var sortableColumns = columnHasUniqueData ? __spread$i([column], linkedColumns) : linkedColumns; var firstSort = sortableColumns[0].getSort(); // the == is intentional, as null and undefined both represent no sort, which means they are equivalent var allMatch = sortableColumns.every(function (col) { return col.getSort() == firstSort; }); if (!allMatch) { return 'mixed'; } return firstSort; }; SortController.prototype.getDisplaySortIndexForColumn = function (column) { return this.getIndexedSortMap().get(column); }; var SortController_1; SortController.DEFAULT_SORTING_ORDER = ['asc', 'desc', null]; __decorate$1X([ Autowired('columnModel') ], SortController.prototype, "columnModel", void 0); SortController = SortController_1 = __decorate$1X([ Bean('sortController') ], SortController); return SortController; }(BeanStub)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$2g = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __decorate$1Y = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var ColumnHoverService = /** @class */ (function (_super) { __extends$2g(ColumnHoverService, _super); function ColumnHoverService() { return _super !== null && _super.apply(this, arguments) || this; } ColumnHoverService.prototype.setMouseOver = function (columns) { this.selectedColumns = columns; var event = { type: Events.EVENT_COLUMN_HOVER_CHANGED }; this.eventService.dispatchEvent(event); }; ColumnHoverService.prototype.clearMouseOver = function () { this.selectedColumns = null; var event = { type: Events.EVENT_COLUMN_HOVER_CHANGED }; this.eventService.dispatchEvent(event); }; ColumnHoverService.prototype.isHovered = function (column) { return !!this.selectedColumns && this.selectedColumns.indexOf(column) >= 0; }; ColumnHoverService = __decorate$1Y([ Bean('columnHoverService') ], ColumnHoverService); return ColumnHoverService; }(BeanStub)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$2h = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __decorate$1Z = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var ColumnAnimationService = /** @class */ (function (_super) { __extends$2h(ColumnAnimationService, _super); function ColumnAnimationService() { var _this = _super !== null && _super.apply(this, arguments) || this; _this.executeNextFuncs = []; _this.executeLaterFuncs = []; _this.active = false; _this.animationThreadCount = 0; return _this; } ColumnAnimationService.prototype.postConstruct = function () { var _this = this; this.ctrlsService.whenReady(function (p) { return _this.gridBodyCtrl = p.gridBodyCtrl; }); }; ColumnAnimationService.prototype.isActive = function () { return this.active; }; ColumnAnimationService.prototype.start = function () { if (this.active) { return; } if (this.gridOptionsService.is('suppressColumnMoveAnimation')) { return; } // if doing RTL, we don't animate open / close as due to how the pixels are inverted, // the animation moves all the row the the right rather than to the left (ie it's the static // columns that actually get their coordinates updated) if (this.gridOptionsService.is('enableRtl')) { return; } this.ensureAnimationCssClassPresent(); this.active = true; }; ColumnAnimationService.prototype.finish = function () { if (!this.active) { return; } this.flush(); this.active = false; }; ColumnAnimationService.prototype.executeNextVMTurn = function (func) { if (this.active) { this.executeNextFuncs.push(func); } else { func(); } }; ColumnAnimationService.prototype.executeLaterVMTurn = function (func) { if (this.active) { this.executeLaterFuncs.push(func); } else { func(); } }; ColumnAnimationService.prototype.ensureAnimationCssClassPresent = function () { var _this = this; // up the count, so we can tell if someone else has updated the count // by the time the 'wait' func executes this.animationThreadCount++; var animationThreadCountCopy = this.animationThreadCount; this.gridBodyCtrl.setColumnMovingCss(true); this.executeLaterFuncs.push(function () { // only remove the class if this thread was the last one to update it if (_this.animationThreadCount === animationThreadCountCopy) { _this.gridBodyCtrl.setColumnMovingCss(false); } }); }; ColumnAnimationService.prototype.flush = function () { var nowFuncs = this.executeNextFuncs; this.executeNextFuncs = []; var waitFuncs = this.executeLaterFuncs; this.executeLaterFuncs = []; if (nowFuncs.length === 0 && waitFuncs.length === 0) { return; } window.setTimeout(function () { return nowFuncs.forEach(function (func) { return func(); }); }, 0); window.setTimeout(function () { return waitFuncs.forEach(function (func) { return func(); }); }, 300); }; __decorate$1Z([ Autowired('ctrlsService') ], ColumnAnimationService.prototype, "ctrlsService", void 0); __decorate$1Z([ PostConstruct ], ColumnAnimationService.prototype, "postConstruct", null); ColumnAnimationService = __decorate$1Z([ Bean('columnAnimationService') ], ColumnAnimationService); return ColumnAnimationService; }(BeanStub)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$2i = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __decorate$1_ = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var PaginationAutoPageSizeService = /** @class */ (function (_super) { __extends$2i(PaginationAutoPageSizeService, _super); function PaginationAutoPageSizeService() { return _super !== null && _super.apply(this, arguments) || this; } PaginationAutoPageSizeService.prototype.postConstruct = function () { var _this = this; this.ctrlsService.whenReady(function (p) { _this.centerRowContainerCon = p.centerRowContainerCtrl; _this.addManagedListener(_this.eventService, Events.EVENT_BODY_HEIGHT_CHANGED, _this.onBodyHeightChanged.bind(_this)); _this.addManagedListener(_this.eventService, Events.EVENT_SCROLL_VISIBILITY_CHANGED, _this.onScrollVisibilityChanged.bind(_this)); _this.checkPageSize(); }); }; PaginationAutoPageSizeService.prototype.notActive = function () { return !this.gridOptionsService.is('paginationAutoPageSize'); }; PaginationAutoPageSizeService.prototype.onScrollVisibilityChanged = function () { this.checkPageSize(); }; PaginationAutoPageSizeService.prototype.onBodyHeightChanged = function () { this.checkPageSize(); }; PaginationAutoPageSizeService.prototype.checkPageSize = function () { if (this.notActive()) { return; } var rowHeight = this.gridOptionsService.getRowHeightAsNumber(); var bodyHeight = this.centerRowContainerCon.getViewportSizeFeature().getBodyHeight(); if (bodyHeight > 0) { var newPageSize = Math.floor(bodyHeight / rowHeight); this.gridOptionsService.set('paginationPageSize', newPageSize); } }; __decorate$1_([ Autowired('ctrlsService') ], PaginationAutoPageSizeService.prototype, "ctrlsService", void 0); __decorate$1_([ PostConstruct ], PaginationAutoPageSizeService.prototype, "postConstruct", null); PaginationAutoPageSizeService = __decorate$1_([ Bean('paginationAutoPageSizeService') ], PaginationAutoPageSizeService); return PaginationAutoPageSizeService; }(BeanStub)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$2j = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __decorate$1$ = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var ValueCache = /** @class */ (function (_super) { __extends$2j(ValueCache, _super); function ValueCache() { var _this = _super !== null && _super.apply(this, arguments) || this; _this.cacheVersion = 0; return _this; } ValueCache.prototype.init = function () { this.active = this.gridOptionsService.is('valueCache'); this.neverExpires = this.gridOptionsService.is('valueCacheNeverExpires'); }; ValueCache.prototype.onDataChanged = function () { if (this.neverExpires) { return; } this.expire(); }; ValueCache.prototype.expire = function () { this.cacheVersion++; }; ValueCache.prototype.setValue = function (rowNode, colId, value) { if (this.active) { if (rowNode.__cacheVersion !== this.cacheVersion) { rowNode.__cacheVersion = this.cacheVersion; rowNode.__cacheData = {}; } rowNode.__cacheData[colId] = value; } }; ValueCache.prototype.getValue = function (rowNode, colId) { if (!this.active || rowNode.__cacheVersion !== this.cacheVersion) { return undefined; } return rowNode.__cacheData[colId]; }; __decorate$1$([ PostConstruct ], ValueCache.prototype, "init", null); ValueCache = __decorate$1$([ Bean('valueCache') ], ValueCache); return ValueCache; }(BeanStub)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$2k = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __decorate$20 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; // Matches value in clipboard module var SOURCE_PASTE = 'paste'; var ChangeDetectionService = /** @class */ (function (_super) { __extends$2k(ChangeDetectionService, _super); function ChangeDetectionService() { return _super !== null && _super.apply(this, arguments) || this; } ChangeDetectionService.prototype.init = function () { if (this.rowModel.getType() === 'clientSide') { this.clientSideRowModel = this.rowModel; } this.addManagedListener(this.eventService, Events.EVENT_CELL_VALUE_CHANGED, this.onCellValueChanged.bind(this)); }; ChangeDetectionService.prototype.onCellValueChanged = function (event) { // Clipboard service manages its own change detection, so no need to do it here. // The clipboard manages its own as otherwise this would happen once for every cell // that got updated as part of a paste operation, so e.g. if 100 cells in a paste operation, // this doChangeDetection would get called 100 times (once for each cell), instead clipboard // service executes the logic we have here once (in essence batching up all cell changes // into one change detection). if (event.source === SOURCE_PASTE) { return; } this.doChangeDetection(event.node, event.column); }; ChangeDetectionService.prototype.doChangeDetection = function (rowNode, column) { if (this.gridOptionsService.is('suppressChangeDetection')) { return; } // step 1 of change detection is to update the aggregated values if (this.clientSideRowModel && !rowNode.isRowPinned()) { var onlyChangedColumns = this.gridOptionsService.is('aggregateOnlyChangedColumns'); var changedPath = new ChangedPath(onlyChangedColumns, this.clientSideRowModel.getRootNode()); changedPath.addParentNode(rowNode.parent, [column]); this.clientSideRowModel.doAggregate(changedPath); } // step 2 of change detection is to refresh the cells this.rowRenderer.refreshCells(); }; __decorate$20([ Autowired('rowModel') ], ChangeDetectionService.prototype, "rowModel", void 0); __decorate$20([ Autowired('rowRenderer') ], ChangeDetectionService.prototype, "rowRenderer", void 0); __decorate$20([ PostConstruct ], ChangeDetectionService.prototype, "init", null); ChangeDetectionService = __decorate$20([ Bean('changeDetectionService') ], ChangeDetectionService); return ChangeDetectionService; }(BeanStub)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$2l = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __decorate$21 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var AgComponentUtils = /** @class */ (function (_super) { __extends$2l(AgComponentUtils, _super); function AgComponentUtils() { return _super !== null && _super.apply(this, arguments) || this; } AgComponentUtils.prototype.adaptFunction = function (propertyName, jsCompFunc) { var metadata = this.componentMetadataProvider.retrieve(propertyName); if (metadata && metadata.functionAdapter) { return metadata.functionAdapter(jsCompFunc); } return null; }; AgComponentUtils.prototype.adaptCellRendererFunction = function (callback) { var Adapter = /** @class */ (function () { function Adapter() { } Adapter.prototype.refresh = function (params) { return false; }; Adapter.prototype.getGui = function () { return this.eGui; }; Adapter.prototype.init = function (params) { var callbackResult = callback(params); var type = typeof callbackResult; if (type === 'string' || type === 'number' || type === 'boolean') { this.eGui = loadTemplate('' + callbackResult + ''); return; } if (callbackResult == null) { this.eGui = loadTemplate(''); return; } this.eGui = callbackResult; }; return Adapter; }()); return Adapter; }; AgComponentUtils.prototype.doesImplementIComponent = function (candidate) { if (!candidate) { return false; } return candidate.prototype && 'getGui' in candidate.prototype; }; __decorate$21([ Autowired("componentMetadataProvider") ], AgComponentUtils.prototype, "componentMetadataProvider", void 0); AgComponentUtils = __decorate$21([ Bean("agComponentUtils") ], AgComponentUtils); return AgComponentUtils; }(BeanStub)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$2m = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __decorate$22 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var ComponentMetadataProvider = /** @class */ (function (_super) { __extends$2m(ComponentMetadataProvider, _super); function ComponentMetadataProvider() { return _super !== null && _super.apply(this, arguments) || this; } ComponentMetadataProvider.prototype.postConstruct = function () { this.componentMetaData = { dateComponent: { mandatoryMethodList: ['getDate', 'setDate'], optionalMethodList: ['afterGuiAttached', 'setInputPlaceholder', 'setInputAriaLabel'] }, detailCellRenderer: { mandatoryMethodList: [], optionalMethodList: ['refresh'], functionAdapter: this.agComponentUtils.adaptCellRendererFunction.bind(this.agComponentUtils) }, headerComponent: { mandatoryMethodList: [], optionalMethodList: ['refresh'] }, headerGroupComponent: { mandatoryMethodList: [], optionalMethodList: [] }, loadingCellRenderer: { mandatoryMethodList: [], optionalMethodList: [] }, loadingOverlayComponent: { mandatoryMethodList: [], optionalMethodList: [] }, noRowsOverlayComponent: { mandatoryMethodList: [], optionalMethodList: [] }, floatingFilterComponent: { mandatoryMethodList: ['onParentModelChanged'], optionalMethodList: ['afterGuiAttached'] }, floatingFilterWrapperComponent: { mandatoryMethodList: [], optionalMethodList: [] }, cellRenderer: { mandatoryMethodList: [], optionalMethodList: ['refresh', 'afterGuiAttached'], functionAdapter: this.agComponentUtils.adaptCellRendererFunction.bind(this.agComponentUtils) }, cellEditor: { mandatoryMethodList: ['getValue'], optionalMethodList: ['isPopup', 'isCancelBeforeStart', 'isCancelAfterEnd', 'getPopupPosition', 'focusIn', 'focusOut', 'afterGuiAttached'] }, innerRenderer: { mandatoryMethodList: [], optionalMethodList: ['afterGuiAttached'], functionAdapter: this.agComponentUtils.adaptCellRendererFunction.bind(this.agComponentUtils) }, fullWidthCellRenderer: { mandatoryMethodList: [], optionalMethodList: ['refresh', 'afterGuiAttached'], functionAdapter: this.agComponentUtils.adaptCellRendererFunction.bind(this.agComponentUtils) }, groupRowRenderer: { mandatoryMethodList: [], optionalMethodList: ['afterGuiAttached'], functionAdapter: this.agComponentUtils.adaptCellRendererFunction.bind(this.agComponentUtils) }, filter: { mandatoryMethodList: ['isFilterActive', 'doesFilterPass', 'getModel', 'setModel'], optionalMethodList: ['afterGuiAttached', 'afterGuiDetached', 'onNewRowsLoaded', 'getModelAsString', 'onFloatingFilterChanged', 'onAnyFilterChanged'] }, filterComponent: { mandatoryMethodList: ['isFilterActive', 'doesFilterPass', 'getModel', 'setModel'], optionalMethodList: ['afterGuiAttached', 'afterGuiDetached', 'onNewRowsLoaded', 'getModelAsString', 'onFloatingFilterChanged', 'onAnyFilterChanged'] }, statusPanel: { mandatoryMethodList: [], optionalMethodList: ['afterGuiAttached'], }, toolPanel: { mandatoryMethodList: [], optionalMethodList: ['refresh', 'afterGuiAttached'] }, tooltipComponent: { mandatoryMethodList: [], optionalMethodList: [] } }; }; ComponentMetadataProvider.prototype.retrieve = function (name) { return this.componentMetaData[name]; }; __decorate$22([ Autowired("agComponentUtils") ], ComponentMetadataProvider.prototype, "agComponentUtils", void 0); __decorate$22([ PostConstruct ], ComponentMetadataProvider.prototype, "postConstruct", null); ComponentMetadataProvider = __decorate$22([ Bean("componentMetadataProvider") ], ComponentMetadataProvider); return ComponentMetadataProvider; }(BeanStub)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$2n = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __decorate$23 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var __read$p = (undefined && undefined.__read) || function (o, n) { var m = typeof Symbol === "function" && o[Symbol.iterator]; if (!m) return o; var i = m.call(o), r, ar = [], e; try { while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); } catch (error) { e = { error: error }; } finally { try { if (r && !r.done && (m = i["return"])) m.call(i); } finally { if (e) throw e.error; } } return ar; }; var __spread$j = (undefined && undefined.__spread) || function () { for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read$p(arguments[i])); return ar; }; var DEFAULT_ROW_HEIGHT = 25; var MIN_COL_WIDTH = 10; var MAT_GRID_SIZE = 8; var BASE_GRID_SIZE = 4; var BALHAM_GRID_SIZE = 4; var ALPINE_GRID_SIZE = 6; var HARD_CODED_SIZES = { // this item is required for custom themes 'ag-theme-custom': { headerHeight: 25, headerCellMinWidth: 24, listItemHeight: BASE_GRID_SIZE * 5, rowHeight: 25, chartMenuPanelWidth: 220 }, 'ag-theme-material': { headerHeight: MAT_GRID_SIZE * 7, headerCellMinWidth: 48, listItemHeight: MAT_GRID_SIZE * 4, rowHeight: MAT_GRID_SIZE * 6, chartMenuPanelWidth: 240 }, 'ag-theme-balham': { headerHeight: BALHAM_GRID_SIZE * 8, headerCellMinWidth: 24, listItemHeight: BALHAM_GRID_SIZE * 6, rowHeight: BALHAM_GRID_SIZE * 7, chartMenuPanelWidth: 220 }, 'ag-theme-alpine': { headerHeight: ALPINE_GRID_SIZE * 8, headerCellMinWidth: 36, listItemHeight: ALPINE_GRID_SIZE * 4, rowHeight: ALPINE_GRID_SIZE * 7, chartMenuPanelWidth: 240 } }; /** * this object contains a list of Sass variables and an array * of CSS styles required to get the correct value. * eg. $virtual-item-height requires a structure, so we can get its height. *
*
*
*
*
*/ var SASS_PROPERTY_BUILDER = { headerHeight: ['ag-header-row'], headerCellMinWidth: ['ag-header-cell'], listItemHeight: ['ag-virtual-list-item'], rowHeight: ['ag-row'], chartMenuPanelWidth: ['ag-chart-docked-container'] }; var Environment = /** @class */ (function (_super) { __extends$2n(Environment, _super); function Environment() { var _this = _super !== null && _super.apply(this, arguments) || this; _this.calculatedSizes = {}; return _this; } Environment.prototype.postConstruct = function () { var _this = this; var _a; var el = (_a = this.getTheme().el) !== null && _a !== void 0 ? _a : this.eGridDiv; this.mutationObserver = new MutationObserver(function () { _this.calculatedSizes = {}; _this.fireGridStylesChangedEvent(); }); this.mutationObserver.observe(el || this.eGridDiv, { attributes: true, attributeFilter: ['class'] }); }; Environment.prototype.fireGridStylesChangedEvent = function () { var event = { type: Events.EVENT_GRID_STYLES_CHANGED }; this.eventService.dispatchEvent(event); }; Environment.prototype.getSassVariable = function (key) { var _a = this.getTheme(), themeFamily = _a.themeFamily, el = _a.el; if (!themeFamily || themeFamily.indexOf('ag-theme') !== 0) { return; } if (!this.calculatedSizes) { this.calculatedSizes = {}; } if (!this.calculatedSizes[themeFamily]) { this.calculatedSizes[themeFamily] = {}; } var size = this.calculatedSizes[themeFamily][key]; if (size != null) { return size; } this.calculatedSizes[themeFamily][key] = this.calculateValueForSassProperty(key, themeFamily, el); return this.calculatedSizes[themeFamily][key]; }; Environment.prototype.calculateValueForSassProperty = function (property, theme, themeElement) { var _a; var useTheme = 'ag-theme-' + (theme.match('material') ? 'material' : theme.match('balham') ? 'balham' : theme.match('alpine') ? 'alpine' : 'custom'); var defaultValue = HARD_CODED_SIZES[useTheme][property]; var eDocument = this.gridOptionsService.getDocument(); if (!themeElement) { themeElement = this.eGridDiv; } if (!SASS_PROPERTY_BUILDER[property]) { return defaultValue; } var classList = SASS_PROPERTY_BUILDER[property]; var div = eDocument.createElement('div'); // this will apply SASS variables that were manually added to the current theme var classesFromThemeElement = Array.from(themeElement.classList); (_a = div.classList).add.apply(_a, __spread$j([theme], classesFromThemeElement)); div.style.position = 'absolute'; var el = classList.reduce(function (prevEl, currentClass) { var currentDiv = eDocument.createElement('div'); currentDiv.style.position = 'static'; currentDiv.classList.add(currentClass); prevEl.appendChild(currentDiv); return currentDiv; }, div); var calculatedValue = 0; if (eDocument.body) { eDocument.body.appendChild(div); var sizeName = property.toLowerCase().indexOf('height') !== -1 ? 'height' : 'width'; calculatedValue = parseInt(window.getComputedStyle(el)[sizeName], 10); eDocument.body.removeChild(div); } return calculatedValue || defaultValue; }; Environment.prototype.isThemeDark = function () { var theme = this.getTheme().theme; return !!theme && theme.indexOf('dark') >= 0; }; Environment.prototype.chartMenuPanelWidth = function () { return this.getSassVariable('chartMenuPanelWidth'); }; Environment.prototype.getTheme = function () { var reg = /\bag-(material|(?:theme-([\w\-]*)))\b/g; var el = this.eGridDiv; var themeMatch = null; var allThemes = []; while (el) { themeMatch = reg.exec(el.className); if (!themeMatch) { el = el.parentElement || undefined; } else { var matched = el.className.match(reg); if (matched) { allThemes = matched; } break; } } if (!themeMatch) { return { allThemes: allThemes }; } var theme = themeMatch[0]; return { theme: theme, el: el, themeFamily: theme.replace(/-dark$/, ''), allThemes: allThemes }; }; Environment.prototype.getFromTheme = function (defaultValue, sassVariableName) { var _a; return (_a = this.getSassVariable(sassVariableName)) !== null && _a !== void 0 ? _a : defaultValue; }; Environment.prototype.getDefaultRowHeight = function () { return this.getFromTheme(DEFAULT_ROW_HEIGHT, 'rowHeight'); }; Environment.prototype.getListItemHeight = function () { return this.getFromTheme(20, 'listItemHeight'); }; Environment.prototype.setRowHeightVariable = function (height) { var oldRowHeight = this.eGridDiv.style.getPropertyValue('--ag-line-height').trim(); var newRowHeight = height + "px"; if (oldRowHeight != newRowHeight) { this.eGridDiv.style.setProperty('--ag-line-height', newRowHeight); } }; Environment.prototype.getMinColWidth = function () { var measuredMin = this.getFromTheme(null, 'headerCellMinWidth'); return exists(measuredMin) ? Math.max(measuredMin, MIN_COL_WIDTH) : MIN_COL_WIDTH; }; Environment.prototype.destroy = function () { this.calculatedSizes = null; if (this.mutationObserver) { this.mutationObserver.disconnect(); } _super.prototype.destroy.call(this); }; __decorate$23([ Autowired('eGridDiv') ], Environment.prototype, "eGridDiv", void 0); __decorate$23([ PostConstruct ], Environment.prototype, "postConstruct", null); Environment = __decorate$23([ Bean('environment') ], Environment); return Environment; }(BeanStub)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$2o = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __decorate$24 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var __param$8 = (undefined && undefined.__param) || function (paramIndex, decorator) { return function (target, key) { decorator(target, key, paramIndex); } }; /** * This class solves the 'max height' problem, where the user might want to show more data than * the max div height actually allows. */ var RowContainerHeightService = /** @class */ (function (_super) { __extends$2o(RowContainerHeightService, _super); function RowContainerHeightService() { var _this = _super !== null && _super.apply(this, arguments) || this; // the scrollY position _this.scrollY = 0; // how tall the body is _this.uiBodyHeight = 0; return _this; } RowContainerHeightService.prototype.agWire = function (loggerFactory) { this.logger = loggerFactory.create("RowContainerHeightService"); }; RowContainerHeightService.prototype.postConstruct = function () { this.addManagedListener(this.eventService, Events.EVENT_BODY_HEIGHT_CHANGED, this.updateOffset.bind(this)); this.maxDivHeight = getMaxDivHeight(); this.logger.log('maxDivHeight = ' + this.maxDivHeight); }; RowContainerHeightService.prototype.isStretching = function () { return this.stretching; }; RowContainerHeightService.prototype.getDivStretchOffset = function () { return this.divStretchOffset; }; RowContainerHeightService.prototype.updateOffset = function () { if (!this.stretching) { return; } var gridBodyCon = this.ctrlsService.getGridBodyCtrl(); var newScrollY = gridBodyCon.getScrollFeature().getVScrollPosition().top; var newBodyHeight = this.getUiBodyHeight(); var atLeastOneChanged = newScrollY !== this.scrollY || newBodyHeight !== this.uiBodyHeight; if (atLeastOneChanged) { this.scrollY = newScrollY; this.uiBodyHeight = newBodyHeight; this.calculateOffset(); } }; RowContainerHeightService.prototype.calculateOffset = function () { this.setUiContainerHeight(this.maxDivHeight); this.pixelsToShave = this.modelHeight - this.uiContainerHeight; this.maxScrollY = this.uiContainerHeight - this.uiBodyHeight; var scrollPercent = this.scrollY / this.maxScrollY; var divStretchOffset = scrollPercent * this.pixelsToShave; this.logger.log("Div Stretch Offset = " + divStretchOffset + " (" + this.pixelsToShave + " * " + scrollPercent + ")"); this.setDivStretchOffset(divStretchOffset); }; RowContainerHeightService.prototype.setUiContainerHeight = function (height) { if (height !== this.uiContainerHeight) { this.uiContainerHeight = height; this.eventService.dispatchEvent({ type: Events.EVENT_ROW_CONTAINER_HEIGHT_CHANGED }); } }; RowContainerHeightService.prototype.clearOffset = function () { this.setUiContainerHeight(this.modelHeight); this.pixelsToShave = 0; this.setDivStretchOffset(0); }; RowContainerHeightService.prototype.setDivStretchOffset = function (newOffset) { // because we are talking pixels, no point in confusing things with half numbers var newOffsetFloor = typeof newOffset === 'number' ? Math.floor(newOffset) : null; if (this.divStretchOffset === newOffsetFloor) { return; } this.divStretchOffset = newOffsetFloor; this.eventService.dispatchEvent({ type: Events.EVENT_HEIGHT_SCALE_CHANGED }); }; RowContainerHeightService.prototype.setModelHeight = function (modelHeight) { this.modelHeight = modelHeight; this.stretching = modelHeight != null // null happens when in print layout && this.maxDivHeight > 0 && modelHeight > this.maxDivHeight; if (this.stretching) { this.calculateOffset(); } else { this.clearOffset(); } }; RowContainerHeightService.prototype.getUiContainerHeight = function () { return this.uiContainerHeight; }; RowContainerHeightService.prototype.getRealPixelPosition = function (modelPixel) { return modelPixel - this.divStretchOffset; }; RowContainerHeightService.prototype.getUiBodyHeight = function () { var gridBodyCon = this.ctrlsService.getGridBodyCtrl(); var pos = gridBodyCon.getScrollFeature().getVScrollPosition(); return pos.bottom - pos.top; }; RowContainerHeightService.prototype.getScrollPositionForPixel = function (rowTop) { if (this.pixelsToShave <= 0) { return rowTop; } var modelMaxScroll = this.modelHeight - this.getUiBodyHeight(); var scrollPercent = rowTop / modelMaxScroll; var scrollPixel = this.maxScrollY * scrollPercent; return scrollPixel; }; __decorate$24([ Autowired('ctrlsService') ], RowContainerHeightService.prototype, "ctrlsService", void 0); __decorate$24([ __param$8(0, Qualifier("loggerFactory")) ], RowContainerHeightService.prototype, "agWire", null); __decorate$24([ PostConstruct ], RowContainerHeightService.prototype, "postConstruct", null); RowContainerHeightService = __decorate$24([ Bean('rowContainerHeightService') ], RowContainerHeightService); return RowContainerHeightService; }(BeanStub)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$2p = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __decorate$25 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var SelectableService = /** @class */ (function (_super) { __extends$2p(SelectableService, _super); function SelectableService() { return _super !== null && _super.apply(this, arguments) || this; } SelectableService.prototype.init = function () { this.groupSelectsChildren = this.gridOptionsService.is('groupSelectsChildren'); this.isRowSelectableFunc = this.gridOptionsService.get('isRowSelectable'); }; SelectableService.prototype.updateSelectableAfterGrouping = function (rowNode) { if (this.isRowSelectableFunc) { var nextChildrenFunc = function (node) { return node.childrenAfterGroup; }; this.recurseDown(rowNode.childrenAfterGroup, nextChildrenFunc); } }; SelectableService.prototype.recurseDown = function (children, nextChildrenFunc) { var _this = this; if (!children) { return; } children.forEach(function (child) { if (!child.group) { return; } // only interested in groups if (child.hasChildren()) { _this.recurseDown(nextChildrenFunc(child), nextChildrenFunc); } var rowSelectable; if (_this.groupSelectsChildren) { // have this group selectable if at least one direct child is selectable var firstSelectable = (nextChildrenFunc(child) || []).find(function (rowNode) { return rowNode.selectable === true; }); rowSelectable = exists(firstSelectable); } else { // directly retrieve selectable value from user callback rowSelectable = _this.isRowSelectableFunc ? _this.isRowSelectableFunc(child) : false; } child.setRowSelectable(rowSelectable); }); }; __decorate$25([ PostConstruct ], SelectableService.prototype, "init", null); SelectableService = __decorate$25([ Bean('selectableService') ], SelectableService); return SelectableService; }(BeanStub)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$2q = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __decorate$26 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var PaginationComp = /** @class */ (function (_super) { __extends$2q(PaginationComp, _super); function PaginationComp() { var _this = _super.call(this) || this; _this.previousAndFirstButtonsDisabled = false; _this.nextButtonDisabled = false; _this.lastButtonDisabled = false; _this.areListenersSetup = false; return _this; } PaginationComp.prototype.postConstruct = function () { var isRtl = this.gridOptionsService.is('enableRtl'); this.setTemplate(this.getTemplate()); this.btFirst.insertAdjacentElement('afterbegin', createIconNoSpan(isRtl ? 'last' : 'first', this.gridOptionsService)); this.btPrevious.insertAdjacentElement('afterbegin', createIconNoSpan(isRtl ? 'next' : 'previous', this.gridOptionsService)); this.btNext.insertAdjacentElement('afterbegin', createIconNoSpan(isRtl ? 'previous' : 'next', this.gridOptionsService)); this.btLast.insertAdjacentElement('afterbegin', createIconNoSpan(isRtl ? 'first' : 'last', this.gridOptionsService)); this.addManagedPropertyListener('pagination', this.onPaginationChanged.bind(this)); this.addManagedPropertyListener('suppressPaginationPanel', this.onPaginationChanged.bind(this)); this.onPaginationChanged(); }; PaginationComp.prototype.onPaginationChanged = function () { var isPaging = this.gridOptionsService.is('pagination'); var paginationPanelEnabled = isPaging && !this.gridOptionsService.is('suppressPaginationPanel'); this.setDisplayed(paginationPanelEnabled); if (!paginationPanelEnabled) { return; } this.setupListeners(); this.enableOrDisableButtons(); this.updateRowLabels(); this.setCurrentPageLabel(); this.setTotalLabels(); }; PaginationComp.prototype.setupListeners = function () { var _this = this; if (!this.areListenersSetup) { this.addManagedListener(this.eventService, Events.EVENT_PAGINATION_CHANGED, this.onPaginationChanged.bind(this)); [ { el: this.btFirst, fn: this.onBtFirst.bind(this) }, { el: this.btPrevious, fn: this.onBtPrevious.bind(this) }, { el: this.btNext, fn: this.onBtNext.bind(this) }, { el: this.btLast, fn: this.onBtLast.bind(this) } ].forEach(function (item) { var el = item.el, fn = item.fn; _this.addManagedListener(el, 'click', fn); _this.addManagedListener(el, 'keydown', function (e) { if (e.key === KeyCode.ENTER || e.key === KeyCode.SPACE) { e.preventDefault(); fn(); } }); }); this.areListenersSetup = true; } }; PaginationComp.prototype.onBtFirst = function () { if (!this.previousAndFirstButtonsDisabled) { this.paginationProxy.goToFirstPage(); } }; PaginationComp.prototype.setCurrentPageLabel = function () { var pagesExist = this.paginationProxy.getTotalPages() > 0; var currentPage = this.paginationProxy.getCurrentPage(); var toDisplay = pagesExist ? currentPage + 1 : 0; this.lbCurrent.innerHTML = this.formatNumber(toDisplay); }; PaginationComp.prototype.formatNumber = function (value) { var userFunc = this.gridOptionsService.getCallback('paginationNumberFormatter'); if (userFunc) { var params = { value: value }; return userFunc(params); } var localeTextFunc = this.localeService.getLocaleTextFunc(); var thousandSeparator = localeTextFunc('thousandSeparator', ','); var decimalSeparator = localeTextFunc('decimalSeparator', '.'); return formatNumberCommas(value, thousandSeparator, decimalSeparator); }; PaginationComp.prototype.getTemplate = function () { var localeTextFunc = this.localeService.getLocaleTextFunc(); var strPage = localeTextFunc('page', 'Page'); var strTo = localeTextFunc('to', 'to'); var strOf = localeTextFunc('of', 'of'); var strFirst = localeTextFunc('firstPage', 'First Page'); var strPrevious = localeTextFunc('previousPage', 'Previous Page'); var strNext = localeTextFunc('nextPage', 'Next Page'); var strLast = localeTextFunc('lastPage', 'Last Page'); var compId = this.getCompId(); return /* html */ "
\n \n \n " + strTo + "\n \n " + strOf + "\n \n \n \n
\n
\n \n " + strPage + "\n \n " + strOf + "\n \n \n
\n
\n
\n
"; }; PaginationComp.prototype.onBtNext = function () { if (!this.nextButtonDisabled) { this.paginationProxy.goToNextPage(); } }; PaginationComp.prototype.onBtPrevious = function () { if (!this.previousAndFirstButtonsDisabled) { this.paginationProxy.goToPreviousPage(); } }; PaginationComp.prototype.onBtLast = function () { if (!this.lastButtonDisabled) { this.paginationProxy.goToLastPage(); } }; PaginationComp.prototype.enableOrDisableButtons = function () { var currentPage = this.paginationProxy.getCurrentPage(); var maxRowFound = this.paginationProxy.isLastPageFound(); var totalPages = this.paginationProxy.getTotalPages(); this.previousAndFirstButtonsDisabled = currentPage === 0; this.toggleButtonDisabled(this.btFirst, this.previousAndFirstButtonsDisabled); this.toggleButtonDisabled(this.btPrevious, this.previousAndFirstButtonsDisabled); var zeroPagesToDisplay = this.isZeroPagesToDisplay(); var onLastPage = maxRowFound && currentPage === (totalPages - 1); this.nextButtonDisabled = onLastPage || zeroPagesToDisplay; this.lastButtonDisabled = !maxRowFound || zeroPagesToDisplay || currentPage === (totalPages - 1); this.toggleButtonDisabled(this.btNext, this.nextButtonDisabled); this.toggleButtonDisabled(this.btLast, this.lastButtonDisabled); }; PaginationComp.prototype.toggleButtonDisabled = function (button, disabled) { setAriaDisabled(button, disabled); button.classList.toggle('ag-disabled', disabled); if (disabled) { button.removeAttribute('tabindex'); } else { button.setAttribute('tabindex', '0'); } }; PaginationComp.prototype.updateRowLabels = function () { var currentPage = this.paginationProxy.getCurrentPage(); var pageSize = this.paginationProxy.getPageSize(); var maxRowFound = this.paginationProxy.isLastPageFound(); var rowCount = this.paginationProxy.isLastPageFound() ? this.paginationProxy.getMasterRowCount() : null; var startRow; var endRow; if (this.isZeroPagesToDisplay()) { startRow = endRow = 0; } else { startRow = (pageSize * currentPage) + 1; endRow = startRow + pageSize - 1; if (maxRowFound && endRow > rowCount) { endRow = rowCount; } } this.lbFirstRowOnPage.innerHTML = this.formatNumber(startRow); if (this.rowNodeBlockLoader.isLoading()) { this.lbLastRowOnPage.innerHTML = '?'; } else { this.lbLastRowOnPage.innerHTML = this.formatNumber(endRow); } }; PaginationComp.prototype.isZeroPagesToDisplay = function () { var maxRowFound = this.paginationProxy.isLastPageFound(); var totalPages = this.paginationProxy.getTotalPages(); return maxRowFound && totalPages === 0; }; PaginationComp.prototype.setTotalLabels = function () { var lastPageFound = this.paginationProxy.isLastPageFound(); var totalPages = this.paginationProxy.getTotalPages(); var rowCount = lastPageFound ? this.paginationProxy.getMasterRowCount() : null; // When `pivotMode=true` and no grouping or value columns exist, a single 'hidden' group row (root node) is in // the grid and the pagination totals will correctly display total = 1. However this is confusing to users as // they can't see it. To address this UX issue we simply set the totals to zero in the pagination panel. if (rowCount === 1) { var firstRow = this.paginationProxy.getRow(0); // a group node with no group or agg data will not be visible to users var hiddenGroupRow = firstRow && firstRow.group && !(firstRow.groupData || firstRow.aggData); if (hiddenGroupRow) { this.setTotalLabelsToZero(); return; } } if (lastPageFound) { this.lbTotal.innerHTML = this.formatNumber(totalPages); this.lbRecordCount.innerHTML = this.formatNumber(rowCount); } else { var moreText = this.localeService.getLocaleTextFunc()('more', 'more'); this.lbTotal.innerHTML = moreText; this.lbRecordCount.innerHTML = moreText; } }; PaginationComp.prototype.setTotalLabelsToZero = function () { this.lbFirstRowOnPage.innerHTML = this.formatNumber(0); this.lbCurrent.innerHTML = this.formatNumber(0); this.lbLastRowOnPage.innerHTML = this.formatNumber(0); this.lbTotal.innerHTML = this.formatNumber(0); this.lbRecordCount.innerHTML = this.formatNumber(0); }; __decorate$26([ Autowired('paginationProxy') ], PaginationComp.prototype, "paginationProxy", void 0); __decorate$26([ Autowired('rowNodeBlockLoader') ], PaginationComp.prototype, "rowNodeBlockLoader", void 0); __decorate$26([ RefSelector('btFirst') ], PaginationComp.prototype, "btFirst", void 0); __decorate$26([ RefSelector('btPrevious') ], PaginationComp.prototype, "btPrevious", void 0); __decorate$26([ RefSelector('btNext') ], PaginationComp.prototype, "btNext", void 0); __decorate$26([ RefSelector('btLast') ], PaginationComp.prototype, "btLast", void 0); __decorate$26([ RefSelector('lbRecordCount') ], PaginationComp.prototype, "lbRecordCount", void 0); __decorate$26([ RefSelector('lbFirstRowOnPage') ], PaginationComp.prototype, "lbFirstRowOnPage", void 0); __decorate$26([ RefSelector('lbLastRowOnPage') ], PaginationComp.prototype, "lbLastRowOnPage", void 0); __decorate$26([ RefSelector('lbCurrent') ], PaginationComp.prototype, "lbCurrent", void 0); __decorate$26([ RefSelector('lbTotal') ], PaginationComp.prototype, "lbTotal", void 0); __decorate$26([ PostConstruct ], PaginationComp.prototype, "postConstruct", null); return PaginationComp; }(Component)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$2r = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __decorate$27 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var LoadingType; (function (LoadingType) { LoadingType[LoadingType["Loading"] = 0] = "Loading"; LoadingType[LoadingType["NoRows"] = 1] = "NoRows"; })(LoadingType || (LoadingType = {})); var OverlayWrapperComponent = /** @class */ (function (_super) { __extends$2r(OverlayWrapperComponent, _super); function OverlayWrapperComponent() { var _this = _super.call(this, OverlayWrapperComponent.TEMPLATE) || this; _this.inProgress = false; _this.destroyRequested = false; _this.manuallyDisplayed = false; return _this; } OverlayWrapperComponent.prototype.updateLayoutClasses = function (cssClass, params) { var overlayWrapperClassList = this.eOverlayWrapper.classList; overlayWrapperClassList.toggle(exports.LayoutCssClasses.AUTO_HEIGHT, params.autoHeight); overlayWrapperClassList.toggle(exports.LayoutCssClasses.NORMAL, params.normal); overlayWrapperClassList.toggle(exports.LayoutCssClasses.PRINT, params.print); }; OverlayWrapperComponent.prototype.postConstruct = function () { this.createManagedBean(new LayoutFeature(this)); this.setDisplayed(false, { skipAriaHidden: true }); this.addManagedListener(this.eventService, Events.EVENT_ROW_DATA_UPDATED, this.onRowDataUpdated.bind(this)); this.addManagedListener(this.eventService, Events.EVENT_NEW_COLUMNS_LOADED, this.onNewColumnsLoaded.bind(this)); if (this.gridOptionsService.isRowModelType('clientSide') && !this.gridOptionsService.get('rowData')) { this.showLoadingOverlay(); } this.gridApi.registerOverlayWrapperComp(this); }; OverlayWrapperComponent.prototype.setWrapperTypeClass = function (loadingType) { var overlayWrapperClassList = this.eOverlayWrapper.classList; overlayWrapperClassList.toggle('ag-overlay-loading-wrapper', loadingType === LoadingType.Loading); overlayWrapperClassList.toggle('ag-overlay-no-rows-wrapper', loadingType === LoadingType.NoRows); }; OverlayWrapperComponent.prototype.showLoadingOverlay = function () { if (this.gridOptionsService.is('suppressLoadingOverlay')) { return; } var params = {}; var compDetails = this.userComponentFactory.getLoadingOverlayCompDetails(params); var promise = compDetails.newAgStackInstance(); this.showOverlay(promise, LoadingType.Loading); }; OverlayWrapperComponent.prototype.showNoRowsOverlay = function () { if (this.gridOptionsService.is('suppressNoRowsOverlay')) { return; } var params = {}; var compDetails = this.userComponentFactory.getNoRowsOverlayCompDetails(params); var promise = compDetails.newAgStackInstance(); this.showOverlay(promise, LoadingType.NoRows); }; OverlayWrapperComponent.prototype.showOverlay = function (workItem, type) { var _this = this; if (this.inProgress) { return; } this.setWrapperTypeClass(type); this.destroyActiveOverlay(); this.inProgress = true; if (workItem) { workItem.then(function (comp) { _this.inProgress = false; _this.eOverlayWrapper.appendChild(comp.getGui()); _this.activeOverlay = comp; if (_this.destroyRequested) { _this.destroyRequested = false; _this.destroyActiveOverlay(); } }); } this.manuallyDisplayed = this.columnModel.isReady() && !this.paginationProxy.isEmpty(); this.setDisplayed(true, { skipAriaHidden: true }); }; OverlayWrapperComponent.prototype.destroyActiveOverlay = function () { if (this.inProgress) { this.destroyRequested = true; return; } if (!this.activeOverlay) { return; } this.activeOverlay = this.getContext().destroyBean(this.activeOverlay); clearElement(this.eOverlayWrapper); }; OverlayWrapperComponent.prototype.hideOverlay = function () { this.manuallyDisplayed = false; this.destroyActiveOverlay(); this.setDisplayed(false, { skipAriaHidden: true }); }; OverlayWrapperComponent.prototype.destroy = function () { this.destroyActiveOverlay(); _super.prototype.destroy.call(this); }; OverlayWrapperComponent.prototype.showOrHideOverlay = function () { var isEmpty = this.paginationProxy.isEmpty(); var isSuppressNoRowsOverlay = this.gridOptionsService.is('suppressNoRowsOverlay'); if (isEmpty && !isSuppressNoRowsOverlay) { this.showNoRowsOverlay(); } else { this.hideOverlay(); } }; OverlayWrapperComponent.prototype.onRowDataUpdated = function () { this.showOrHideOverlay(); }; OverlayWrapperComponent.prototype.onNewColumnsLoaded = function () { // hide overlay if columns and rows exist, this can happen if columns are loaded after data. // this problem exists before of the race condition between the services (column controller in this case) // and the view (grid panel). if the model beans were all initialised first, and then the view beans second, // this race condition would not happen. if (this.columnModel.isReady() && !this.paginationProxy.isEmpty() && !this.manuallyDisplayed) { this.hideOverlay(); } }; // wrapping in outer div, and wrapper, is needed to center the loading icon OverlayWrapperComponent.TEMPLATE = "\n
\n
\n
\n
\n
"; __decorate$27([ Autowired('userComponentFactory') ], OverlayWrapperComponent.prototype, "userComponentFactory", void 0); __decorate$27([ Autowired('paginationProxy') ], OverlayWrapperComponent.prototype, "paginationProxy", void 0); __decorate$27([ Autowired('gridApi') ], OverlayWrapperComponent.prototype, "gridApi", void 0); __decorate$27([ Autowired('columnModel') ], OverlayWrapperComponent.prototype, "columnModel", void 0); __decorate$27([ RefSelector('eOverlayWrapper') ], OverlayWrapperComponent.prototype, "eOverlayWrapper", void 0); __decorate$27([ PostConstruct ], OverlayWrapperComponent.prototype, "postConstruct", null); return OverlayWrapperComponent; }(Component)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$2s = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __decorate$28 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var RowPositionUtils = /** @class */ (function (_super) { __extends$2s(RowPositionUtils, _super); function RowPositionUtils() { return _super !== null && _super.apply(this, arguments) || this; } RowPositionUtils.prototype.getFirstRow = function () { var rowIndex = 0; var rowPinned; if (this.pinnedRowModel.getPinnedTopRowCount()) { rowPinned = 'top'; } else if (this.rowModel.getRowCount()) { rowPinned = null; rowIndex = this.paginationProxy.getPageFirstRow(); } else if (this.pinnedRowModel.getPinnedBottomRowCount()) { rowPinned = 'bottom'; } return rowPinned === undefined ? null : { rowIndex: rowIndex, rowPinned: rowPinned }; }; RowPositionUtils.prototype.getLastRow = function () { var rowIndex; var rowPinned = null; var pinnedBottomCount = this.pinnedRowModel.getPinnedBottomRowCount(); var pinnedTopCount = this.pinnedRowModel.getPinnedTopRowCount(); if (pinnedBottomCount) { rowPinned = 'bottom'; rowIndex = pinnedBottomCount - 1; } else if (this.rowModel.getRowCount()) { rowPinned = null; rowIndex = this.paginationProxy.getPageLastRow(); } else if (pinnedTopCount) { rowPinned = 'top'; rowIndex = pinnedTopCount - 1; } return rowIndex === undefined ? null : { rowIndex: rowIndex, rowPinned: rowPinned }; }; RowPositionUtils.prototype.getRowNode = function (gridRow) { switch (gridRow.rowPinned) { case 'top': return this.pinnedRowModel.getPinnedTopRowData()[gridRow.rowIndex]; case 'bottom': return this.pinnedRowModel.getPinnedBottomRowData()[gridRow.rowIndex]; default: return this.rowModel.getRow(gridRow.rowIndex); } }; RowPositionUtils.prototype.sameRow = function (rowA, rowB) { // if both missing if (!rowA && !rowB) { return true; } // if only one missing if ((rowA && !rowB) || (!rowA && rowB)) { return false; } // otherwise compare (use == to compare rowPinned because it can be null or undefined) return rowA.rowIndex === rowB.rowIndex && rowA.rowPinned == rowB.rowPinned; }; // tests if this row selection is before the other row selection RowPositionUtils.prototype.before = function (rowA, rowB) { switch (rowA.rowPinned) { case 'top': // we we are floating top, and other isn't, then we are always before if (rowB.rowPinned !== 'top') { return true; } break; case 'bottom': // if we are floating bottom, and the other isn't, then we are never before if (rowB.rowPinned !== 'bottom') { return false; } break; default: // if we are not floating, but the other one is floating... if (exists(rowB.rowPinned)) { return rowB.rowPinned !== 'top'; } break; } return rowA.rowIndex < rowB.rowIndex; }; RowPositionUtils.prototype.rowMax = function (rows) { var _this = this; var max; rows.forEach(function (row) { if (max === undefined || _this.before(max, row)) { max = row; } }); return max; }; RowPositionUtils.prototype.rowMin = function (rows) { var _this = this; var min; rows.forEach(function (row) { if (min === undefined || _this.before(row, min)) { min = row; } }); return min; }; __decorate$28([ Autowired('rowModel') ], RowPositionUtils.prototype, "rowModel", void 0); __decorate$28([ Autowired('pinnedRowModel') ], RowPositionUtils.prototype, "pinnedRowModel", void 0); __decorate$28([ Autowired('paginationProxy') ], RowPositionUtils.prototype, "paginationProxy", void 0); RowPositionUtils = __decorate$28([ Bean('rowPositionUtils') ], RowPositionUtils); return RowPositionUtils; }(BeanStub)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$2t = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __decorate$29 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var CellPositionUtils = /** @class */ (function (_super) { __extends$2t(CellPositionUtils, _super); function CellPositionUtils() { return _super !== null && _super.apply(this, arguments) || this; } CellPositionUtils.prototype.createId = function (cellPosition) { var rowIndex = cellPosition.rowIndex, rowPinned = cellPosition.rowPinned, column = cellPosition.column; return this.createIdFromValues({ rowIndex: rowIndex, column: column, rowPinned: rowPinned }); }; CellPositionUtils.prototype.createIdFromValues = function (cellPosition) { var rowIndex = cellPosition.rowIndex, rowPinned = cellPosition.rowPinned, column = cellPosition.column; return rowIndex + "." + (rowPinned == null ? 'null' : rowPinned) + "." + column.getId(); }; CellPositionUtils.prototype.equals = function (cellA, cellB) { var colsMatch = cellA.column === cellB.column; var floatingMatch = cellA.rowPinned === cellB.rowPinned; var indexMatch = cellA.rowIndex === cellB.rowIndex; return colsMatch && floatingMatch && indexMatch; }; CellPositionUtils = __decorate$29([ Bean('cellPositionUtils') ], CellPositionUtils); return CellPositionUtils; }(BeanStub)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$2u = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var UndoRedoAction = /** @class */ (function () { function UndoRedoAction(cellValueChanges) { this.cellValueChanges = cellValueChanges; } return UndoRedoAction; }()); var RangeUndoRedoAction = /** @class */ (function (_super) { __extends$2u(RangeUndoRedoAction, _super); function RangeUndoRedoAction(cellValueChanges, initialRange, finalRange, ranges) { var _this = _super.call(this, cellValueChanges) || this; _this.initialRange = initialRange; _this.finalRange = finalRange; _this.ranges = ranges; return _this; } return RangeUndoRedoAction; }(UndoRedoAction)); var UndoRedoStack = /** @class */ (function () { function UndoRedoStack(maxStackSize) { this.actionStack = []; this.maxStackSize = maxStackSize ? maxStackSize : UndoRedoStack.DEFAULT_STACK_SIZE; this.actionStack = new Array(this.maxStackSize); } UndoRedoStack.prototype.pop = function () { return this.actionStack.pop(); }; UndoRedoStack.prototype.push = function (item) { var shouldAddActions = item.cellValueChanges && item.cellValueChanges.length > 0; if (!shouldAddActions) { return; } if (this.actionStack.length === this.maxStackSize) { this.actionStack.shift(); } this.actionStack.push(item); }; UndoRedoStack.prototype.clear = function () { this.actionStack = []; }; UndoRedoStack.prototype.getCurrentStackSize = function () { return this.actionStack.length; }; UndoRedoStack.DEFAULT_STACK_SIZE = 10; return UndoRedoStack; }()); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$2v = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __assign$k = (undefined && undefined.__assign) || function () { __assign$k = Object.assign || function(t) { for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; } return t; }; return __assign$k.apply(this, arguments); }; var __decorate$2a = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var __read$q = (undefined && undefined.__read) || function (o, n) { var m = typeof Symbol === "function" && o[Symbol.iterator]; if (!m) return o; var i = m.call(o), r, ar = [], e; try { while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); } catch (error) { e = { error: error }; } finally { try { if (r && !r.done && (m = i["return"])) m.call(i); } finally { if (e) throw e.error; } } return ar; }; var __spread$k = (undefined && undefined.__spread) || function () { for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read$q(arguments[i])); return ar; }; var UndoRedoService = /** @class */ (function (_super) { __extends$2v(UndoRedoService, _super); function UndoRedoService() { var _this = _super !== null && _super.apply(this, arguments) || this; _this.cellValueChanges = []; _this.activeCellEdit = null; _this.activeRowEdit = null; _this.isPasting = false; _this.isRangeInAction = false; _this.onCellValueChanged = function (event) { var eventCell = { column: event.column, rowIndex: event.rowIndex, rowPinned: event.rowPinned }; var isCellEditing = _this.activeCellEdit !== null && _this.cellPositionUtils.equals(_this.activeCellEdit, eventCell); var isRowEditing = _this.activeRowEdit !== null && _this.rowPositionUtils.sameRow(_this.activeRowEdit, eventCell); var shouldCaptureAction = isCellEditing || isRowEditing || _this.isPasting || _this.isRangeInAction; if (!shouldCaptureAction) { return; } var rowPinned = event.rowPinned, rowIndex = event.rowIndex, column = event.column, oldValue = event.oldValue, value = event.value; var cellValueChange = { rowPinned: rowPinned, rowIndex: rowIndex, columnId: column.getColId(), newValue: value, oldValue: oldValue }; _this.cellValueChanges.push(cellValueChange); }; _this.clearStacks = function () { _this.undoStack.clear(); _this.redoStack.clear(); }; return _this; } UndoRedoService.prototype.init = function () { var _this = this; if (!this.gridOptionsService.is('undoRedoCellEditing')) { return; } var undoRedoLimit = this.gridOptionsService.getNum('undoRedoCellEditingLimit'); if (undoRedoLimit <= 0) { return; } this.undoStack = new UndoRedoStack(undoRedoLimit); this.redoStack = new UndoRedoStack(undoRedoLimit); this.addRowEditingListeners(); this.addCellEditingListeners(); this.addPasteListeners(); this.addFillListeners(); this.addCellKeyListeners(); this.addManagedListener(this.eventService, Events.EVENT_CELL_VALUE_CHANGED, this.onCellValueChanged); // undo / redo is restricted to actual editing so we clear the stacks when other operations are // performed that change the order of the row / cols. this.addManagedListener(this.eventService, Events.EVENT_MODEL_UPDATED, function (e) { if (!e.keepUndoRedoStack) { _this.clearStacks(); } }); this.addManagedListener(this.eventService, Events.EVENT_COLUMN_PIVOT_MODE_CHANGED, this.clearStacks); this.addManagedListener(this.eventService, Events.EVENT_NEW_COLUMNS_LOADED, this.clearStacks); this.addManagedListener(this.eventService, Events.EVENT_COLUMN_GROUP_OPENED, this.clearStacks); this.addManagedListener(this.eventService, Events.EVENT_COLUMN_ROW_GROUP_CHANGED, this.clearStacks); this.addManagedListener(this.eventService, Events.EVENT_COLUMN_MOVED, this.clearStacks); this.addManagedListener(this.eventService, Events.EVENT_COLUMN_PINNED, this.clearStacks); this.addManagedListener(this.eventService, Events.EVENT_COLUMN_VISIBLE, this.clearStacks); this.addManagedListener(this.eventService, Events.EVENT_ROW_DRAG_END, this.clearStacks); this.ctrlsService.whenReady(function () { _this.gridBodyCtrl = _this.ctrlsService.getGridBodyCtrl(); }); }; UndoRedoService.prototype.getCurrentUndoStackSize = function () { return this.undoStack ? this.undoStack.getCurrentStackSize() : 0; }; UndoRedoService.prototype.getCurrentRedoStackSize = function () { return this.redoStack ? this.redoStack.getCurrentStackSize() : 0; }; UndoRedoService.prototype.undo = function (source) { var startEvent = { type: Events.EVENT_UNDO_STARTED, source: source }; this.eventService.dispatchEvent(startEvent); var operationPerformed = this.undoRedo(this.undoStack, this.redoStack, 'initialRange', 'oldValue', 'undo'); var endEvent = { type: Events.EVENT_UNDO_ENDED, source: source, operationPerformed: operationPerformed }; this.eventService.dispatchEvent(endEvent); }; UndoRedoService.prototype.redo = function (source) { var startEvent = { type: Events.EVENT_REDO_STARTED, source: source }; this.eventService.dispatchEvent(startEvent); var operationPerformed = this.undoRedo(this.redoStack, this.undoStack, 'finalRange', 'newValue', 'redo'); var endEvent = { type: Events.EVENT_REDO_ENDED, source: source, operationPerformed: operationPerformed }; this.eventService.dispatchEvent(endEvent); }; UndoRedoService.prototype.undoRedo = function (undoRedoStack, opposingUndoRedoStack, rangeProperty, cellValueChangeProperty, source) { if (!undoRedoStack) { return false; } var undoRedoAction = undoRedoStack.pop(); if (!undoRedoAction || !undoRedoAction.cellValueChanges) { return false; } this.processAction(undoRedoAction, function (cellValueChange) { return cellValueChange[cellValueChangeProperty]; }, source); if (undoRedoAction instanceof RangeUndoRedoAction) { this.processRange(undoRedoAction.ranges || [undoRedoAction[rangeProperty]]); } else { this.processCell(undoRedoAction.cellValueChanges); } opposingUndoRedoStack.push(undoRedoAction); return true; }; UndoRedoService.prototype.processAction = function (action, valueExtractor, source) { var _this = this; action.cellValueChanges.forEach(function (cellValueChange) { var rowIndex = cellValueChange.rowIndex, rowPinned = cellValueChange.rowPinned, columnId = cellValueChange.columnId; var rowPosition = { rowIndex: rowIndex, rowPinned: rowPinned }; var currentRow = _this.getRowNode(rowPosition); // checks if the row has been filtered out if (!currentRow.displayed) { return; } currentRow.setDataValue(columnId, valueExtractor(cellValueChange), source); }); }; UndoRedoService.prototype.processRange = function (ranges) { var _this = this; var lastFocusedCell; this.rangeService.removeAllCellRanges(true); ranges.forEach(function (range, idx) { if (!range) { return; } var startRow = range.startRow; var endRow = range.endRow; if (idx === ranges.length - 1) { lastFocusedCell = { rowPinned: startRow.rowPinned, rowIndex: startRow.rowIndex, columnId: range.startColumn.getColId() }; _this.setLastFocusedCell(lastFocusedCell); } var cellRangeParams = { rowStartIndex: startRow.rowIndex, rowStartPinned: startRow.rowPinned, rowEndIndex: endRow.rowIndex, rowEndPinned: endRow.rowPinned, columnStart: range.startColumn, columns: range.columns }; _this.rangeService.addCellRange(cellRangeParams); }); }; UndoRedoService.prototype.processCell = function (cellValueChanges) { var cellValueChange = cellValueChanges[0]; var rowIndex = cellValueChange.rowIndex, rowPinned = cellValueChange.rowPinned; var rowPosition = { rowIndex: rowIndex, rowPinned: rowPinned }; var row = this.getRowNode(rowPosition); var lastFocusedCell = { rowPinned: cellValueChange.rowPinned, rowIndex: row.rowIndex, columnId: cellValueChange.columnId }; // when single cells are being processed, they should be considered // as ranges when the rangeService is present (singleCellRanges). // otherwise focus will be restore but the range will not. this.setLastFocusedCell(lastFocusedCell, !!this.rangeService); }; UndoRedoService.prototype.setLastFocusedCell = function (lastFocusedCell, setRangeToCell) { var rowIndex = lastFocusedCell.rowIndex, columnId = lastFocusedCell.columnId, rowPinned = lastFocusedCell.rowPinned; var scrollFeature = this.gridBodyCtrl.getScrollFeature(); var column = this.columnModel.getGridColumn(columnId); if (!column) { return; } scrollFeature.ensureIndexVisible(rowIndex); scrollFeature.ensureColumnVisible(column); var cellPosition = { rowIndex: rowIndex, column: column, rowPinned: rowPinned }; this.focusService.setFocusedCell(__assign$k(__assign$k({}, cellPosition), { forceBrowserFocus: true })); if (setRangeToCell) { this.rangeService.setRangeToCell(cellPosition); } }; UndoRedoService.prototype.addRowEditingListeners = function () { var _this = this; this.addManagedListener(this.eventService, Events.EVENT_ROW_EDITING_STARTED, function (e) { _this.activeRowEdit = { rowIndex: e.rowIndex, rowPinned: e.rowPinned }; }); this.addManagedListener(this.eventService, Events.EVENT_ROW_EDITING_STOPPED, function () { var action = new UndoRedoAction(_this.cellValueChanges); _this.pushActionsToUndoStack(action); _this.activeRowEdit = null; }); }; UndoRedoService.prototype.addCellEditingListeners = function () { var _this = this; this.addManagedListener(this.eventService, Events.EVENT_CELL_EDITING_STARTED, function (e) { _this.activeCellEdit = { column: e.column, rowIndex: e.rowIndex, rowPinned: e.rowPinned }; }); this.addManagedListener(this.eventService, Events.EVENT_CELL_EDITING_STOPPED, function (e) { _this.activeCellEdit = null; var shouldPushAction = e.valueChanged && !_this.activeRowEdit && !_this.isPasting && !_this.isRangeInAction; if (shouldPushAction) { var action = new UndoRedoAction(_this.cellValueChanges); _this.pushActionsToUndoStack(action); } }); }; UndoRedoService.prototype.addPasteListeners = function () { var _this = this; this.addManagedListener(this.eventService, Events.EVENT_PASTE_START, function () { _this.isPasting = true; }); this.addManagedListener(this.eventService, Events.EVENT_PASTE_END, function () { var action = new UndoRedoAction(_this.cellValueChanges); _this.pushActionsToUndoStack(action); _this.isPasting = false; }); }; UndoRedoService.prototype.addFillListeners = function () { var _this = this; this.addManagedListener(this.eventService, Events.EVENT_FILL_START, function () { _this.isRangeInAction = true; }); this.addManagedListener(this.eventService, Events.EVENT_FILL_END, function (event) { var action = new RangeUndoRedoAction(_this.cellValueChanges, event.initialRange, event.finalRange); _this.pushActionsToUndoStack(action); _this.isRangeInAction = false; }); }; UndoRedoService.prototype.addCellKeyListeners = function () { var _this = this; this.addManagedListener(this.eventService, Events.EVENT_KEY_SHORTCUT_CHANGED_CELL_START, function () { _this.isRangeInAction = true; }); this.addManagedListener(this.eventService, Events.EVENT_KEY_SHORTCUT_CHANGED_CELL_END, function () { var action; if (_this.rangeService && _this.gridOptionsService.isEnableRangeSelection()) { action = new RangeUndoRedoAction(_this.cellValueChanges, undefined, undefined, __spread$k(_this.rangeService.getCellRanges())); } else { action = new UndoRedoAction(_this.cellValueChanges); } _this.pushActionsToUndoStack(action); _this.isRangeInAction = false; }); }; UndoRedoService.prototype.pushActionsToUndoStack = function (action) { this.undoStack.push(action); this.cellValueChanges = []; this.redoStack.clear(); }; UndoRedoService.prototype.getRowNode = function (gridRow) { switch (gridRow.rowPinned) { case 'top': return this.pinnedRowModel.getPinnedTopRowData()[gridRow.rowIndex]; case 'bottom': return this.pinnedRowModel.getPinnedBottomRowData()[gridRow.rowIndex]; default: return this.rowModel.getRow(gridRow.rowIndex); } }; __decorate$2a([ Autowired('focusService') ], UndoRedoService.prototype, "focusService", void 0); __decorate$2a([ Autowired('ctrlsService') ], UndoRedoService.prototype, "ctrlsService", void 0); __decorate$2a([ Autowired('rowModel') ], UndoRedoService.prototype, "rowModel", void 0); __decorate$2a([ Autowired('pinnedRowModel') ], UndoRedoService.prototype, "pinnedRowModel", void 0); __decorate$2a([ Autowired('cellPositionUtils') ], UndoRedoService.prototype, "cellPositionUtils", void 0); __decorate$2a([ Autowired('rowPositionUtils') ], UndoRedoService.prototype, "rowPositionUtils", void 0); __decorate$2a([ Autowired('columnModel') ], UndoRedoService.prototype, "columnModel", void 0); __decorate$2a([ Optional('rangeService') ], UndoRedoService.prototype, "rangeService", void 0); __decorate$2a([ PostConstruct ], UndoRedoService.prototype, "init", null); UndoRedoService = __decorate$2a([ Bean('undoRedoService') ], UndoRedoService); return UndoRedoService; }(BeanStub)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$2w = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __decorate$2b = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var HeaderPositionUtils = /** @class */ (function (_super) { __extends$2w(HeaderPositionUtils, _super); function HeaderPositionUtils() { return _super !== null && _super.apply(this, arguments) || this; } HeaderPositionUtils.prototype.findHeader = function (focusedHeader, direction) { var nextColumn; var getGroupMethod; var getColMethod; if (focusedHeader.column instanceof ColumnGroup) { getGroupMethod = "getDisplayedGroup" + direction; nextColumn = this.columnModel[getGroupMethod](focusedHeader.column); } else { getColMethod = "getDisplayedCol" + direction; nextColumn = this.columnModel[getColMethod](focusedHeader.column); } if (!nextColumn) { return; } var headerRowIndex = focusedHeader.headerRowIndex; var currentRowType = this.getHeaderRowType(headerRowIndex); if (currentRowType === exports.HeaderRowType.COLUMN_GROUP) { var columnGroup = nextColumn; if (columnGroup.isPadding() && this.isAnyChildSpanningHeaderHeight(columnGroup)) { var _a = this.getColumnVisibleChild(columnGroup, headerRowIndex, direction), nextFocusColumn = _a.nextFocusColumn, nextRow = _a.nextRow; if (nextFocusColumn) { nextColumn = nextFocusColumn; headerRowIndex = nextRow; } } } return { column: nextColumn, headerRowIndex: headerRowIndex }; }; HeaderPositionUtils.prototype.isAnyChildSpanningHeaderHeight = function (columnGroup) { if (!columnGroup) { return false; } return columnGroup.getLeafColumns().some(function (col) { return col.isSpanHeaderHeight(); }); }; HeaderPositionUtils.prototype.getColumnVisibleParent = function (currentColumn, currentIndex) { var currentRowType = this.getHeaderRowType(currentIndex); var isFloatingFilter = currentRowType === exports.HeaderRowType.FLOATING_FILTER; var isColumn = currentRowType === exports.HeaderRowType.COLUMN; var nextFocusColumn = isFloatingFilter ? currentColumn : currentColumn.getParent(); var nextRow = currentIndex - 1; if (isColumn && this.isAnyChildSpanningHeaderHeight(currentColumn.getParent())) { while (nextFocusColumn && nextFocusColumn.isPadding()) { nextFocusColumn = nextFocusColumn.getParent(); nextRow--; } if (nextRow < 0) { nextFocusColumn = currentColumn; nextRow = currentIndex; } } return { nextFocusColumn: nextFocusColumn, nextRow: nextRow }; }; HeaderPositionUtils.prototype.getColumnVisibleChild = function (column, currentIndex, direction) { if (direction === void 0) { direction = 'After'; } var currentRowType = this.getHeaderRowType(currentIndex); var nextFocusColumn = column; var nextRow = currentIndex + 1; if (currentRowType === exports.HeaderRowType.COLUMN_GROUP) { var leafColumns = column.getLeafColumns(); var leafChild = direction === 'After' ? leafColumns[0] : last(leafColumns); if (this.isAnyChildSpanningHeaderHeight(leafChild.getParent())) { nextFocusColumn = leafChild; var currentColumn = leafChild.getParent(); while (currentColumn && currentColumn !== column) { currentColumn = currentColumn.getParent(); nextRow++; } } else { nextFocusColumn = column.getDisplayedChildren()[0]; } } return { nextFocusColumn: nextFocusColumn, nextRow: nextRow }; }; HeaderPositionUtils.prototype.getHeaderRowType = function (rowIndex) { var centerHeaderContainer = this.ctrlsService.getHeaderRowContainerCtrl(); if (centerHeaderContainer) { return centerHeaderContainer.getRowType(rowIndex); } }; HeaderPositionUtils.prototype.findColAtEdgeForHeaderRow = function (level, position) { var displayedColumns = this.columnModel.getAllDisplayedColumns(); var column = displayedColumns[position === 'start' ? 0 : displayedColumns.length - 1]; if (!column) { return; } var childContainer = this.ctrlsService.getHeaderRowContainerCtrl(column.getPinned()); var type = childContainer.getRowType(level); if (type == exports.HeaderRowType.COLUMN_GROUP) { var columnGroup = this.columnModel.getColumnGroupAtLevel(column, level); return { headerRowIndex: level, column: columnGroup }; } return { // if type==null, means the header level didn't exist headerRowIndex: type == null ? -1 : level, column: column }; }; __decorate$2b([ Autowired('columnModel') ], HeaderPositionUtils.prototype, "columnModel", void 0); __decorate$2b([ Autowired('ctrlsService') ], HeaderPositionUtils.prototype, "ctrlsService", void 0); HeaderPositionUtils = __decorate$2b([ Bean('headerPositionUtils') ], HeaderPositionUtils); return HeaderPositionUtils; }(BeanStub)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __decorate$2c = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var ColumnDefFactory = /** @class */ (function () { function ColumnDefFactory() { } ColumnDefFactory.prototype.buildColumnDefs = function (cols, rowGroupColumns, pivotColumns) { var _this = this; var res = []; var colGroupDefs = {}; cols.forEach(function (col) { var colDef = _this.createDefFromColumn(col, rowGroupColumns, pivotColumns); var addToResult = true; var childDef = colDef; var pointer = col.getOriginalParent(); while (pointer) { var parentDef = null; // we don't include padding groups, as the column groups provided // by application didn't have these. the whole point of padding groups // is to balance the column tree that the user provided. if (pointer.isPadding()) { pointer = pointer.getOriginalParent(); continue; } // if colDef for this group already exists, use it var existingParentDef = colGroupDefs[pointer.getGroupId()]; if (existingParentDef) { existingParentDef.children.push(childDef); // if we added to result, it would be the second time we did it addToResult = false; // we don't want to continue up the tree, as it has already been // done for this group break; } parentDef = _this.createDefFromGroup(pointer); if (parentDef) { parentDef.children = [childDef]; colGroupDefs[parentDef.groupId] = parentDef; childDef = parentDef; pointer = pointer.getOriginalParent(); } } if (addToResult) { res.push(childDef); } }); return res; }; ColumnDefFactory.prototype.createDefFromGroup = function (group) { var defCloned = deepCloneDefinition(group.getColGroupDef(), ['children']); if (defCloned) { defCloned.groupId = group.getGroupId(); } return defCloned; }; ColumnDefFactory.prototype.createDefFromColumn = function (col, rowGroupColumns, pivotColumns) { var colDefCloned = deepCloneDefinition(col.getColDef()); colDefCloned.colId = col.getColId(); colDefCloned.width = col.getActualWidth(); colDefCloned.rowGroup = col.isRowGroupActive(); colDefCloned.rowGroupIndex = col.isRowGroupActive() ? rowGroupColumns.indexOf(col) : null; colDefCloned.pivot = col.isPivotActive(); colDefCloned.pivotIndex = col.isPivotActive() ? pivotColumns.indexOf(col) : null; colDefCloned.aggFunc = col.isValueActive() ? col.getAggFunc() : null; colDefCloned.hide = col.isVisible() ? undefined : true; colDefCloned.pinned = col.isPinned() ? col.getPinned() : null; colDefCloned.sort = col.getSort() ? col.getSort() : null; colDefCloned.sortIndex = col.getSortIndex() != null ? col.getSortIndex() : null; return colDefCloned; }; ColumnDefFactory = __decorate$2c([ Bean('columnDefFactory') ], ColumnDefFactory); return ColumnDefFactory; }()); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __decorate$2d = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var RowCssClassCalculator = /** @class */ (function () { function RowCssClassCalculator() { } RowCssClassCalculator.prototype.getInitialRowClasses = function (params) { var classes = []; if (exists(params.extraCssClass)) { classes.push(params.extraCssClass); } classes.push('ag-row'); classes.push(params.rowFocused ? 'ag-row-focus' : 'ag-row-no-focus'); if (params.fadeRowIn) { classes.push('ag-opacity-zero'); } classes.push(params.rowIsEven ? 'ag-row-even' : 'ag-row-odd'); if (params.rowNode.isRowPinned()) { classes.push('ag-row-pinned'); } if (params.rowNode.isSelected()) { classes.push('ag-row-selected'); } if (params.rowNode.footer) { classes.push('ag-row-footer'); } classes.push('ag-row-level-' + params.rowLevel); if (params.rowNode.stub) { classes.push('ag-row-loading'); } if (params.fullWidthRow) { classes.push('ag-full-width-row'); } if (params.expandable) { classes.push('ag-row-group'); classes.push(params.rowNode.expanded ? 'ag-row-group-expanded' : 'ag-row-group-contracted'); } if (params.rowNode.dragging) { classes.push('ag-row-dragging'); } pushAll(classes, this.processClassesFromGridOptions(params.rowNode)); pushAll(classes, this.preProcessRowClassRules(params.rowNode)); // we use absolute position unless we are doing print layout classes.push(params.printLayout ? 'ag-row-position-relative' : 'ag-row-position-absolute'); if (params.firstRowOnPage) { classes.push('ag-row-first'); } if (params.lastRowOnPage) { classes.push('ag-row-last'); } if (params.fullWidthRow) { if (params.pinned === 'left') { classes.push('ag-cell-last-left-pinned'); } if (params.pinned === 'right') { classes.push('ag-cell-first-right-pinned'); } } return classes; }; RowCssClassCalculator.prototype.processClassesFromGridOptions = function (rowNode) { var res = []; var process = function (rowCls) { if (typeof rowCls === 'string') { res.push(rowCls); } else if (Array.isArray(rowCls)) { rowCls.forEach(function (e) { return res.push(e); }); } }; // part 1 - rowClass var rowClass = this.gridOptionsService.get('rowClass'); if (rowClass) { if (typeof rowClass === 'function') { console.warn('AG Grid: rowClass should not be a function, please use getRowClass instead'); return []; } process(rowClass); } // part 2 - rowClassFunc var rowClassFunc = this.gridOptionsService.getCallback('getRowClass'); if (rowClassFunc) { var params = { data: rowNode.data, node: rowNode, rowIndex: rowNode.rowIndex }; var rowClassFuncResult = rowClassFunc(params); process(rowClassFuncResult); } return res; }; RowCssClassCalculator.prototype.preProcessRowClassRules = function (rowNode) { var res = []; this.processRowClassRules(rowNode, function (className) { res.push(className); }, function (className) { // not catered for, if creating, no need // to remove class as it was never there }); return res; }; RowCssClassCalculator.prototype.processRowClassRules = function (rowNode, onApplicableClass, onNotApplicableClass) { var rowClassParams = { data: rowNode.data, node: rowNode, rowIndex: rowNode.rowIndex, api: this.gridOptionsService.api, columnApi: this.gridOptionsService.columnApi, context: this.gridOptionsService.context }; this.stylingService.processClassRules(this.gridOptionsService.get('rowClassRules'), rowClassParams, onApplicableClass, onNotApplicableClass); }; RowCssClassCalculator.prototype.calculateRowLevel = function (rowNode) { if (rowNode.group) { return rowNode.level; } // if a leaf, and a parent exists, put a level of the parent, else put level of 0 for top level item return rowNode.parent ? (rowNode.parent.level + 1) : 0; }; __decorate$2d([ Autowired('stylingService') ], RowCssClassCalculator.prototype, "stylingService", void 0); __decorate$2d([ Autowired('gridOptionsService') ], RowCssClassCalculator.prototype, "gridOptionsService", void 0); RowCssClassCalculator = __decorate$2d([ Bean('rowCssClassCalculator') ], RowCssClassCalculator); return RowCssClassCalculator; }()); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$2x = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __decorate$2e = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; // this logic is used by both SSRM and CSRM var RowNodeSorter = /** @class */ (function (_super) { __extends$2x(RowNodeSorter, _super); function RowNodeSorter() { return _super !== null && _super.apply(this, arguments) || this; } RowNodeSorter.prototype.init = function () { var _this = this; this.isAccentedSort = this.gridOptionsService.is('accentedSort'); this.primaryColumnsSortGroups = this.gridOptionsService.isColumnsSortingCoupledToGroup(); this.addManagedPropertyListener('accentedSort', function (propChange) { return _this.isAccentedSort = propChange.currentValue; }); this.addManagedPropertyListener('autoGroupColumnDef', function () { return _this.primaryColumnsSortGroups = _this.gridOptionsService.isColumnsSortingCoupledToGroup(); }); }; RowNodeSorter.prototype.doFullSort = function (rowNodes, sortOptions) { var mapper = function (rowNode, pos) { return ({ currentPos: pos, rowNode: rowNode }); }; var sortedRowNodes = rowNodes.map(mapper); sortedRowNodes.sort(this.compareRowNodes.bind(this, sortOptions)); return sortedRowNodes.map(function (item) { return item.rowNode; }); }; RowNodeSorter.prototype.compareRowNodes = function (sortOptions, sortedNodeA, sortedNodeB) { var nodeA = sortedNodeA.rowNode; var nodeB = sortedNodeB.rowNode; // Iterate columns, return the first that doesn't match for (var i = 0, len = sortOptions.length; i < len; i++) { var sortOption = sortOptions[i]; var isDescending = sortOption.sort === 'desc'; var valueA = this.getValue(nodeA, sortOption.column); var valueB = this.getValue(nodeB, sortOption.column); var comparatorResult = void 0; var providedComparator = this.getComparator(sortOption, nodeA); if (providedComparator) { //if comparator provided, use it comparatorResult = providedComparator(valueA, valueB, nodeA, nodeB, isDescending); } else { //otherwise do our own comparison comparatorResult = _.defaultComparator(valueA, valueB, this.isAccentedSort); } // user provided comparators can return 'NaN' if they don't correctly handle 'undefined' values, this // typically occurs when the comparator is used on a group row var validResult = !isNaN(comparatorResult); if (validResult && comparatorResult !== 0) { return sortOption.sort === 'asc' ? comparatorResult : comparatorResult * -1; } } // All matched, we make is so that the original sort order is kept: return sortedNodeA.currentPos - sortedNodeB.currentPos; }; RowNodeSorter.prototype.getComparator = function (sortOption, rowNode) { var column = sortOption.column; // comparator on col get preference over everything else var comparatorOnCol = column.getColDef().comparator; if (comparatorOnCol != null) { return comparatorOnCol; } if (!column.getColDef().showRowGroup) { return; } // if a 'field' is supplied on the autoGroupColumnDef we need to use the associated column comparator var groupLeafField = !rowNode.group && column.getColDef().field; if (!groupLeafField) { return; } var primaryColumn = this.columnModel.getPrimaryColumn(groupLeafField); if (!primaryColumn) { return; } return primaryColumn.getColDef().comparator; }; RowNodeSorter.prototype.getValue = function (node, column) { var _a, _b; if (!this.primaryColumnsSortGroups) { return this.valueService.getValue(column, node, false, false); } var isNodeGroupedAtLevel = node.rowGroupColumn === column; if (isNodeGroupedAtLevel) { var isGroupRows = this.gridOptionsService.isGroupUseEntireRow(this.columnModel.isPivotActive()); if (isGroupRows) { // if the column has a provided a keyCreator, we have to use the key, as the group could be // irrelevant to the column value var keyCreator = column.getColDef().keyCreator; if (keyCreator) { return node.key; } // if the group was generated from the column data, all the leaf children should return the same // value var leafChild = (_a = node.allLeafChildren) === null || _a === void 0 ? void 0 : _a[0]; if (leafChild) { return this.valueService.getValue(column, leafChild, false, false); } return undefined; } var displayCol = this.columnModel.getGroupDisplayColumnForGroup(column.getId()); if (!displayCol) { return undefined; } return (_b = node.groupData) === null || _b === void 0 ? void 0 : _b[displayCol.getId()]; } if (node.group && column.getColDef().showRowGroup) { return undefined; } return this.valueService.getValue(column, node, false, false); }; __decorate$2e([ Autowired('valueService') ], RowNodeSorter.prototype, "valueService", void 0); __decorate$2e([ Autowired('columnModel') ], RowNodeSorter.prototype, "columnModel", void 0); __decorate$2e([ PostConstruct ], RowNodeSorter.prototype, "init", null); RowNodeSorter = __decorate$2e([ Bean('rowNodeSorter') ], RowNodeSorter); return RowNodeSorter; }(BeanStub)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$2y = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __decorate$2f = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var CtrlsService = /** @class */ (function (_super) { __extends$2y(CtrlsService, _super); function CtrlsService() { var _this = _super !== null && _super.apply(this, arguments) || this; _this.ready = false; _this.readyCallbacks = []; return _this; } CtrlsService_1 = CtrlsService; CtrlsService.prototype.checkReady = function () { this.ready = this.gridCtrl != null && this.gridBodyCtrl != null && this.centerRowContainerCtrl != null && this.leftRowContainerCtrl != null && this.rightRowContainerCtrl != null && this.bottomCenterRowContainerCtrl != null && this.bottomLeftRowContainerCtrl != null && this.bottomRightRowContainerCtrl != null && this.topCenterRowContainerCtrl != null && this.topLeftRowContainerCtrl != null && this.topRightRowContainerCtrl != null && this.stickyTopCenterRowContainerCtrl != null && this.stickyTopLeftRowContainerCtrl != null && this.stickyTopRightRowContainerCtrl != null && this.centerHeaderRowContainerCtrl != null && this.leftHeaderRowContainerCtrl != null && this.rightHeaderRowContainerCtrl != null && this.fakeHScrollComp != null && this.fakeVScrollComp != null && this.gridHeaderCtrl != null; if (this.ready) { var p_1 = this.createReadyParams(); this.readyCallbacks.forEach(function (c) { return c(p_1); }); this.readyCallbacks.length = 0; } }; CtrlsService.prototype.whenReady = function (callback) { if (this.ready) { callback(this.createReadyParams()); } else { this.readyCallbacks.push(callback); } }; CtrlsService.prototype.createReadyParams = function () { return { centerRowContainerCtrl: this.centerRowContainerCtrl, leftRowContainerCtrl: this.leftRowContainerCtrl, rightRowContainerCtrl: this.rightRowContainerCtrl, bottomCenterRowContainerCtrl: this.bottomCenterRowContainerCtrl, bottomLeftRowContainerCtrl: this.bottomLeftRowContainerCtrl, bottomRightRowContainerCtrl: this.bottomRightRowContainerCtrl, topCenterRowContainerCtrl: this.topCenterRowContainerCtrl, topLeftRowContainerCtrl: this.topLeftRowContainerCtrl, topRightRowContainerCtrl: this.topRightRowContainerCtrl, stickyTopCenterRowContainerCtrl: this.stickyTopCenterRowContainerCtrl, stickyTopLeftRowContainerCtrl: this.stickyTopLeftRowContainerCtrl, stickyTopRightRowContainerCtrl: this.stickyTopRightRowContainerCtrl, centerHeaderRowContainerCtrl: this.centerHeaderRowContainerCtrl, leftHeaderRowContainerCtrl: this.leftHeaderRowContainerCtrl, rightHeaderRowContainerCtrl: this.rightHeaderRowContainerCtrl, fakeHScrollComp: this.fakeHScrollComp, fakeVScrollComp: this.fakeVScrollComp, gridBodyCtrl: this.gridBodyCtrl, gridCtrl: this.gridCtrl, gridHeaderCtrl: this.gridHeaderCtrl, }; }; CtrlsService.prototype.registerFakeHScrollComp = function (comp) { this.fakeHScrollComp = comp; this.checkReady(); }; CtrlsService.prototype.registerFakeVScrollComp = function (comp) { this.fakeVScrollComp = comp; this.checkReady(); }; CtrlsService.prototype.registerGridHeaderCtrl = function (gridHeaderCtrl) { this.gridHeaderCtrl = gridHeaderCtrl; this.checkReady(); }; CtrlsService.prototype.registerCenterRowContainerCtrl = function (ctrl) { this.centerRowContainerCtrl = ctrl; this.checkReady(); }; CtrlsService.prototype.registerLeftRowContainerCtrl = function (ctrl) { this.leftRowContainerCtrl = ctrl; this.checkReady(); }; CtrlsService.prototype.registerRightRowContainerCtrl = function (ctrl) { this.rightRowContainerCtrl = ctrl; this.checkReady(); }; CtrlsService.prototype.registerTopCenterRowContainerCtrl = function (ctrl) { this.topCenterRowContainerCtrl = ctrl; this.checkReady(); }; CtrlsService.prototype.registerTopLeftRowContainerCon = function (ctrl) { this.topLeftRowContainerCtrl = ctrl; this.checkReady(); }; CtrlsService.prototype.registerTopRightRowContainerCtrl = function (ctrl) { this.topRightRowContainerCtrl = ctrl; this.checkReady(); }; CtrlsService.prototype.registerStickyTopCenterRowContainerCtrl = function (ctrl) { this.stickyTopCenterRowContainerCtrl = ctrl; this.checkReady(); }; CtrlsService.prototype.registerStickyTopLeftRowContainerCon = function (ctrl) { this.stickyTopLeftRowContainerCtrl = ctrl; this.checkReady(); }; CtrlsService.prototype.registerStickyTopRightRowContainerCtrl = function (ctrl) { this.stickyTopRightRowContainerCtrl = ctrl; this.checkReady(); }; CtrlsService.prototype.registerBottomCenterRowContainerCtrl = function (ctrl) { this.bottomCenterRowContainerCtrl = ctrl; this.checkReady(); }; CtrlsService.prototype.registerBottomLeftRowContainerCtrl = function (ctrl) { this.bottomLeftRowContainerCtrl = ctrl; this.checkReady(); }; CtrlsService.prototype.registerBottomRightRowContainerCtrl = function (ctrl) { this.bottomRightRowContainerCtrl = ctrl; this.checkReady(); }; CtrlsService.prototype.registerHeaderContainer = function (ctrl, pinned) { switch (pinned) { case 'left': this.leftHeaderRowContainerCtrl = ctrl; break; case 'right': this.rightHeaderRowContainerCtrl = ctrl; break; default: this.centerHeaderRowContainerCtrl = ctrl; break; } this.checkReady(); }; CtrlsService.prototype.registerGridBodyCtrl = function (ctrl) { this.gridBodyCtrl = ctrl; this.checkReady(); }; CtrlsService.prototype.registerGridCtrl = function (ctrl) { this.gridCtrl = ctrl; this.checkReady(); }; CtrlsService.prototype.getFakeHScrollComp = function () { return this.fakeHScrollComp; }; CtrlsService.prototype.getFakeVScrollComp = function () { return this.fakeVScrollComp; }; CtrlsService.prototype.getGridHeaderCtrl = function () { return this.gridHeaderCtrl; }; CtrlsService.prototype.getGridCtrl = function () { return this.gridCtrl; }; CtrlsService.prototype.getCenterRowContainerCtrl = function () { return this.centerRowContainerCtrl; }; CtrlsService.prototype.getTopCenterRowContainerCtrl = function () { return this.topCenterRowContainerCtrl; }; CtrlsService.prototype.getBottomCenterRowContainerCtrl = function () { return this.bottomCenterRowContainerCtrl; }; CtrlsService.prototype.getStickyTopCenterRowContainerCtrl = function () { return this.stickyTopCenterRowContainerCtrl; }; CtrlsService.prototype.getGridBodyCtrl = function () { return this.gridBodyCtrl; }; CtrlsService.prototype.getHeaderRowContainerCtrls = function () { return [this.leftHeaderRowContainerCtrl, this.rightHeaderRowContainerCtrl, this.centerHeaderRowContainerCtrl]; }; CtrlsService.prototype.getHeaderRowContainerCtrl = function (pinned) { switch (pinned) { case 'left': return this.leftHeaderRowContainerCtrl; case 'right': return this.rightHeaderRowContainerCtrl; default: return this.centerHeaderRowContainerCtrl; } }; var CtrlsService_1; CtrlsService.NAME = 'ctrlsService'; CtrlsService = CtrlsService_1 = __decorate$2f([ Bean(CtrlsService_1.NAME) ], CtrlsService); return CtrlsService; }(BeanStub)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$2z = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __decorate$2g = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var CtrlsFactory = /** @class */ (function (_super) { __extends$2z(CtrlsFactory, _super); function CtrlsFactory() { var _this = _super !== null && _super.apply(this, arguments) || this; _this.registry = {}; return _this; } CtrlsFactory.prototype.register = function (meta) { this.registry[meta.controllerName] = meta.controllerClass; }; CtrlsFactory.prototype.getInstance = function (name) { var ControllerClass = this.registry[name]; if (ControllerClass == null) { return undefined; } return new ControllerClass(); }; CtrlsFactory = __decorate$2g([ Bean('ctrlsFactory') ], CtrlsFactory); return CtrlsFactory; }(BeanStub)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$2A = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __decorate$2h = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var AbstractFakeScrollComp = /** @class */ (function (_super) { __extends$2A(AbstractFakeScrollComp, _super); function AbstractFakeScrollComp(template, direction) { var _this = _super.call(this, template) || this; _this.direction = direction; _this.hideTimeout = null; return _this; } AbstractFakeScrollComp.prototype.postConstruct = function () { this.addManagedListener(this.eventService, Events.EVENT_SCROLL_VISIBILITY_CHANGED, this.onScrollVisibilityChanged.bind(this)); this.onScrollVisibilityChanged(); this.addOrRemoveCssClass('ag-apple-scrollbar', isMacOsUserAgent() || isIOSUserAgent()); }; AbstractFakeScrollComp.prototype.initialiseInvisibleScrollbar = function () { if (this.invisibleScrollbar !== undefined) { return; } this.invisibleScrollbar = isInvisibleScrollbar(); if (this.invisibleScrollbar) { this.hideAndShowInvisibleScrollAsNeeded(); this.addActiveListenerToggles(); } }; AbstractFakeScrollComp.prototype.addActiveListenerToggles = function () { var _this = this; var activateEvents = ['mouseenter', 'mousedown', 'touchstart']; var deactivateEvents = ['mouseleave', 'touchend']; var eGui = this.getGui(); activateEvents.forEach(function (eventName) { return _this.addManagedListener(eGui, eventName, function () { return _this.addOrRemoveCssClass('ag-scrollbar-active', true); }); }); deactivateEvents.forEach(function (eventName) { return _this.addManagedListener(eGui, eventName, function () { return _this.addOrRemoveCssClass('ag-scrollbar-active', false); }); }); }; AbstractFakeScrollComp.prototype.onScrollVisibilityChanged = function () { // initialiseInvisibleScrollbar should only be called once, but the reason // this can't be inside `setComp` or `PostConstruct` is the DOM might not // be ready, so we call it until eventually, it gets calculated. if (this.invisibleScrollbar === undefined) { this.initialiseInvisibleScrollbar(); } this.setScrollVisible(); }; AbstractFakeScrollComp.prototype.hideAndShowInvisibleScrollAsNeeded = function () { var _this = this; this.addManagedListener(this.eventService, Events.EVENT_BODY_SCROLL, function (params) { if (params.direction === _this.direction) { if (_this.hideTimeout !== null) { window.clearTimeout(_this.hideTimeout); _this.hideTimeout = null; } _this.addOrRemoveCssClass('ag-scrollbar-scrolling', true); } }); this.addManagedListener(this.eventService, Events.EVENT_BODY_SCROLL_END, function () { _this.hideTimeout = window.setTimeout(function () { _this.addOrRemoveCssClass('ag-scrollbar-scrolling', false); _this.hideTimeout = null; }, 400); }); }; AbstractFakeScrollComp.prototype.getViewport = function () { return this.eViewport; }; AbstractFakeScrollComp.prototype.getContainer = function () { return this.eContainer; }; __decorate$2h([ RefSelector('eViewport') ], AbstractFakeScrollComp.prototype, "eViewport", void 0); __decorate$2h([ RefSelector('eContainer') ], AbstractFakeScrollComp.prototype, "eContainer", void 0); __decorate$2h([ Autowired('scrollVisibleService') ], AbstractFakeScrollComp.prototype, "scrollVisibleService", void 0); __decorate$2h([ Autowired('ctrlsService') ], AbstractFakeScrollComp.prototype, "ctrlsService", void 0); return AbstractFakeScrollComp; }(Component)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$2B = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __decorate$2i = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var FakeHScrollComp = /** @class */ (function (_super) { __extends$2B(FakeHScrollComp, _super); function FakeHScrollComp() { return _super.call(this, FakeHScrollComp.TEMPLATE, 'horizontal') || this; } FakeHScrollComp.prototype.postConstruct = function () { var _this = this; _super.prototype.postConstruct.call(this); // When doing printing, this changes whether cols are pinned or not var spacerWidthsListener = this.setFakeHScrollSpacerWidths.bind(this); this.addManagedListener(this.eventService, Events.EVENT_DISPLAYED_COLUMNS_CHANGED, spacerWidthsListener); this.addManagedListener(this.eventService, Events.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED, spacerWidthsListener); this.addManagedListener(this.eventService, Events.EVENT_PINNED_ROW_DATA_CHANGED, this.onPinnedRowDataChanged.bind(this)); this.addManagedPropertyListener('domLayout', spacerWidthsListener); this.ctrlsService.registerFakeHScrollComp(this); this.createManagedBean(new CenterWidthFeature(function (width) { return _this.eContainer.style.width = width + "px"; })); }; FakeHScrollComp.prototype.initialiseInvisibleScrollbar = function () { if (this.invisibleScrollbar !== undefined) { return; } this.enableRtl = this.gridOptionsService.is('enableRtl'); _super.prototype.initialiseInvisibleScrollbar.call(this); if (this.invisibleScrollbar) { this.refreshCompBottom(); } }; FakeHScrollComp.prototype.onPinnedRowDataChanged = function () { this.refreshCompBottom(); }; FakeHScrollComp.prototype.refreshCompBottom = function () { if (!this.invisibleScrollbar) { return; } var bottomPinnedHeight = this.pinnedRowModel.getPinnedBottomTotalHeight(); this.getGui().style.bottom = bottomPinnedHeight + "px"; }; FakeHScrollComp.prototype.onScrollVisibilityChanged = function () { _super.prototype.onScrollVisibilityChanged.call(this); this.setFakeHScrollSpacerWidths(); }; FakeHScrollComp.prototype.setFakeHScrollSpacerWidths = function () { var vScrollShowing = this.scrollVisibleService.isVerticalScrollShowing(); // we pad the right based on a) if cols are pinned to the right and // b) if v scroll is showing on the right (normal position of scroll) var rightSpacing = this.columnModel.getDisplayedColumnsRightWidth(); var scrollOnRight = !this.enableRtl && vScrollShowing; var scrollbarWidth = this.gridOptionsService.getScrollbarWidth(); if (scrollOnRight) { rightSpacing += scrollbarWidth; } setFixedWidth(this.eRightSpacer, rightSpacing); this.eRightSpacer.classList.toggle('ag-scroller-corner', rightSpacing <= scrollbarWidth); // we pad the left based on a) if cols are pinned to the left and // b) if v scroll is showing on the left (happens in LTR layout only) var leftSpacing = this.columnModel.getDisplayedColumnsLeftWidth(); var scrollOnLeft = this.enableRtl && vScrollShowing; if (scrollOnLeft) { leftSpacing += scrollbarWidth; } setFixedWidth(this.eLeftSpacer, leftSpacing); this.eLeftSpacer.classList.toggle('ag-scroller-corner', leftSpacing <= scrollbarWidth); }; FakeHScrollComp.prototype.setScrollVisible = function () { var hScrollShowing = this.scrollVisibleService.isHorizontalScrollShowing(); var invisibleScrollbar = this.invisibleScrollbar; var isSuppressHorizontalScroll = this.gridOptionsService.is('suppressHorizontalScroll'); var scrollbarWidth = hScrollShowing ? (this.gridOptionsService.getScrollbarWidth() || 0) : 0; var adjustedScrollbarWidth = (scrollbarWidth === 0 && invisibleScrollbar) ? 16 : scrollbarWidth; var scrollContainerSize = !isSuppressHorizontalScroll ? adjustedScrollbarWidth : 0; this.addOrRemoveCssClass('ag-scrollbar-invisible', invisibleScrollbar); setFixedHeight(this.getGui(), scrollContainerSize); setFixedHeight(this.eViewport, scrollContainerSize); setFixedHeight(this.eContainer, scrollContainerSize); this.setDisplayed(hScrollShowing, { skipAriaHidden: true }); }; FakeHScrollComp.TEMPLATE = "
\n
\n
\n
\n
\n
\n
"; __decorate$2i([ RefSelector('eLeftSpacer') ], FakeHScrollComp.prototype, "eLeftSpacer", void 0); __decorate$2i([ RefSelector('eRightSpacer') ], FakeHScrollComp.prototype, "eRightSpacer", void 0); __decorate$2i([ Autowired('columnModel') ], FakeHScrollComp.prototype, "columnModel", void 0); __decorate$2i([ Autowired('pinnedRowModel') ], FakeHScrollComp.prototype, "pinnedRowModel", void 0); __decorate$2i([ PostConstruct ], FakeHScrollComp.prototype, "postConstruct", null); return FakeHScrollComp; }(AbstractFakeScrollComp)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$2C = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __decorate$2j = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var PinnedWidthService = /** @class */ (function (_super) { __extends$2C(PinnedWidthService, _super); function PinnedWidthService() { return _super !== null && _super.apply(this, arguments) || this; } PinnedWidthService.prototype.postConstruct = function () { var listener = this.checkContainerWidths.bind(this); this.addManagedListener(this.eventService, Events.EVENT_DISPLAYED_COLUMNS_CHANGED, listener); this.addManagedListener(this.eventService, Events.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED, listener); this.addManagedPropertyListener('domLayout', listener); }; PinnedWidthService.prototype.checkContainerWidths = function () { var printLayout = this.gridOptionsService.isDomLayout('print'); var newLeftWidth = printLayout ? 0 : this.columnModel.getDisplayedColumnsLeftWidth(); var newRightWidth = printLayout ? 0 : this.columnModel.getDisplayedColumnsRightWidth(); if (newLeftWidth != this.leftWidth) { this.leftWidth = newLeftWidth; this.eventService.dispatchEvent({ type: Events.EVENT_LEFT_PINNED_WIDTH_CHANGED }); } if (newRightWidth != this.rightWidth) { this.rightWidth = newRightWidth; this.eventService.dispatchEvent({ type: Events.EVENT_RIGHT_PINNED_WIDTH_CHANGED }); } }; PinnedWidthService.prototype.getPinnedRightWidth = function () { return this.rightWidth; }; PinnedWidthService.prototype.getPinnedLeftWidth = function () { return this.leftWidth; }; __decorate$2j([ Autowired('columnModel') ], PinnedWidthService.prototype, "columnModel", void 0); __decorate$2j([ PostConstruct ], PinnedWidthService.prototype, "postConstruct", null); PinnedWidthService = __decorate$2j([ Bean('pinnedWidthService') ], PinnedWidthService); return PinnedWidthService; }(BeanStub)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$2D = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __decorate$2k = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var RowNodeEventThrottle = /** @class */ (function (_super) { __extends$2D(RowNodeEventThrottle, _super); function RowNodeEventThrottle() { var _this = _super !== null && _super.apply(this, arguments) || this; _this.events = []; return _this; } RowNodeEventThrottle.prototype.postConstruct = function () { if (this.rowModel.getType() == 'clientSide') { this.clientSideRowModel = this.rowModel; } }; // because the user can call rowNode.setExpanded() many times in one VM turn, // we throttle the calls to ClientSideRowModel using animationFrameService. this means for 100 // row nodes getting expanded, we only update the CSRM once, and then we fire all events after // CSRM has updated. // // if we did not do this, then the user could call setExpanded on 100+ rows, causing the grid // to re-render 100+ times, which would be a performance lag. // // we use animationFrameService // rather than _.debounce() so this will get done if anyone flushes the animationFrameService // (eg user calls api.ensureRowVisible(), which in turn flushes ). RowNodeEventThrottle.prototype.dispatchExpanded = function (event) { var _this = this; // if not using CSRM, we don't debounce. otherwise this breaks the SSRM. if (this.clientSideRowModel == null) { this.eventService.dispatchEvent(event); return; } this.events.push(event); var func = function () { if (_this.clientSideRowModel) { _this.clientSideRowModel.onRowGroupOpened(); } _this.events.forEach(function (e) { return _this.eventService.dispatchEvent(e); }); _this.events = []; }; if (this.dispatchExpandedDebounced == null) { this.dispatchExpandedDebounced = this.animationFrameService.debounce(func); } this.dispatchExpandedDebounced(); }; __decorate$2k([ Autowired('animationFrameService') ], RowNodeEventThrottle.prototype, "animationFrameService", void 0); __decorate$2k([ Autowired('rowModel') ], RowNodeEventThrottle.prototype, "rowModel", void 0); __decorate$2k([ PostConstruct ], RowNodeEventThrottle.prototype, "postConstruct", null); RowNodeEventThrottle = __decorate$2k([ Bean('rowNodeEventThrottle') ], RowNodeEventThrottle); return RowNodeEventThrottle; }(BeanStub)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __assign$l = (undefined && undefined.__assign) || function () { __assign$l = Object.assign || function(t) { for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; } return t; }; return __assign$l.apply(this, arguments); }; var __decorate$2l = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var __param$9 = (undefined && undefined.__param) || function (paramIndex, decorator) { return function (target, key) { decorator(target, key, paramIndex); } }; var __read$r = (undefined && undefined.__read) || function (o, n) { var m = typeof Symbol === "function" && o[Symbol.iterator]; if (!m) return o; var i = m.call(o), r, ar = [], e; try { while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); } catch (error) { e = { error: error }; } finally { try { if (r && !r.done && (m = i["return"])) m.call(i); } finally { if (e) throw e.error; } } return ar; }; var __spread$l = (undefined && undefined.__spread) || function () { for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read$r(arguments[i])); return ar; }; function toNumber(value) { if (typeof value == 'number') { return value; } if (typeof value == 'string') { return parseInt(value, 10); } } function isTrue(value) { return value === true || value === 'true'; } var GridOptionsService = /** @class */ (function () { function GridOptionsService() { this.destroyed = false; this.domDataKey = '__AG_' + Math.random().toString(); this.propertyEventService = new EventService(); } Object.defineProperty(GridOptionsService.prototype, "context", { // This is quicker then having code call gridOptionsService.get('context') get: function () { return this.gridOptions['context']; }, enumerable: false, configurable: true }); GridOptionsService.prototype.agWire = function (gridApi, columnApi) { this.gridOptions.api = gridApi; this.gridOptions.columnApi = columnApi; this.api = gridApi; this.columnApi = columnApi; }; GridOptionsService.prototype.init = function () { this.gridOptionLookup = new Set(__spread$l(ComponentUtil.ALL_PROPERTIES, ComponentUtil.EVENT_CALLBACKS)); var async = !this.is('suppressAsyncEvents'); this.eventService.addGlobalListener(this.globalEventHandler.bind(this), async); // sets an initial calculation for the scrollbar width this.getScrollbarWidth(); }; GridOptionsService.prototype.destroy = function () { // need to remove these, as we don't own the lifecycle of the gridOptions, we need to // remove the references in case the user keeps the grid options, we want the rest // of the grid to be picked up by the garbage collector this.gridOptions.api = null; this.gridOptions.columnApi = null; this.destroyed = true; }; /** * Is the given GridOption property set to true. * @param property GridOption property that has the type `boolean | undefined` */ GridOptionsService.prototype.is = function (property) { return isTrue(this.gridOptions[property]); }; /** * Get the raw value of the GridOptions property provided. * @param property */ GridOptionsService.prototype.get = function (property) { return this.gridOptions[property]; }; /** * Get the GridOption property as a number, raw value is returned via a toNumber coercion function. * @param property GridOption property that has the type `number | undefined` */ GridOptionsService.prototype.getNum = function (property) { return toNumber(this.gridOptions[property]); }; /** * Get the GridOption callback but wrapped so that the common params of api,columnApi and context are automatically applied to the params. * @param property GridOption callback properties based on the fact that this property has a callback with params extending AgGridCommon */ GridOptionsService.prototype.getCallback = function (property) { return this.mergeGridCommonParams(this.gridOptions[property]); }; /** * Returns `true` if a value has been specified for this GridOption. * @param property GridOption property */ GridOptionsService.prototype.exists = function (property) { return exists(this.gridOptions[property]); }; /** * Wrap the user callback and attach the api, columnApi and context to the params object on the way through. * @param callback User provided callback * @returns Wrapped callback where the params object not require api, columnApi and context */ GridOptionsService.prototype.mergeGridCommonParams = function (callback) { var _this = this; if (callback) { var wrapped = function (callbackParams) { var mergedParams = callbackParams; mergedParams.api = _this.api; mergedParams.columnApi = _this.columnApi; mergedParams.context = _this.context; return callback(mergedParams); }; return wrapped; } return callback; }; /** * * @param key - key of the GridOption property to update * @param newValue - new value for this property * @param force - force the property change Event to be fired even if the value has not changed * @param eventParams - additional params to merge into the property changed event */ GridOptionsService.prototype.set = function (key, newValue, force, eventParams) { if (force === void 0) { force = false; } if (eventParams === void 0) { eventParams = {}; } if (this.gridOptionLookup.has(key)) { var previousValue = this.gridOptions[key]; if (force || previousValue !== newValue) { this.gridOptions[key] = newValue; var event_1 = __assign$l({ type: key, currentValue: newValue, previousValue: previousValue }, eventParams); this.propertyEventService.dispatchEvent(event_1); } } }; GridOptionsService.prototype.addEventListener = function (key, listener) { this.propertyEventService.addEventListener(key, listener); }; GridOptionsService.prototype.removeEventListener = function (key, listener) { this.propertyEventService.removeEventListener(key, listener); }; // responsible for calling the onXXX functions on gridOptions GridOptionsService.prototype.globalEventHandler = function (eventName, event) { // prevent events from being fired _after_ the grid has been destroyed if (this.destroyed) { return; } var callbackMethodName = ComponentUtil.getCallbackForEvent(eventName); if (typeof this.gridOptions[callbackMethodName] === 'function') { this.gridOptions[callbackMethodName](event); } }; // *************** Helper methods ************************** // // Methods to share common GridOptions related logic that goes above accessing a single property // the user might be using some non-standard scrollbar, eg a scrollbar that has zero // width and overlays (like the Safari scrollbar, but presented in Chrome). so we // allow the user to provide the scroll width before we work it out. GridOptionsService.prototype.getScrollbarWidth = function () { if (this.scrollbarWidth == null) { var useGridOptions = typeof this.gridOptions.scrollbarWidth === 'number' && this.gridOptions.scrollbarWidth >= 0; var scrollbarWidth = useGridOptions ? this.gridOptions.scrollbarWidth : getScrollbarWidth(); if (scrollbarWidth != null) { this.scrollbarWidth = scrollbarWidth; this.eventService.dispatchEvent({ type: Events.EVENT_SCROLLBAR_WIDTH_CHANGED }); } } return this.scrollbarWidth; }; GridOptionsService.prototype.isRowModelType = function (rowModelType) { return this.gridOptions.rowModelType === rowModelType || (rowModelType === 'clientSide' && missing(this.gridOptions.rowModelType)); }; GridOptionsService.prototype.isDomLayout = function (domLayout) { var _a; var gridLayout = (_a = this.gridOptions.domLayout) !== null && _a !== void 0 ? _a : 'normal'; return gridLayout === domLayout; }; GridOptionsService.prototype.isRowSelection = function () { return this.gridOptions.rowSelection === 'single' || this.gridOptions.rowSelection === 'multiple'; }; GridOptionsService.prototype.useAsyncEvents = function () { return !this.is('suppressAsyncEvents'); }; GridOptionsService.prototype.isGetRowHeightFunction = function () { return typeof this.gridOptions.getRowHeight === 'function'; }; GridOptionsService.prototype.getRowHeightForNode = function (rowNode, allowEstimate, defaultRowHeight) { if (allowEstimate === void 0) { allowEstimate = false; } if (defaultRowHeight == null) { defaultRowHeight = this.environment.getDefaultRowHeight(); } // check the function first, in case use set both function and // number, when using virtual pagination then function can be // used for pinned rows and the number for the body rows. if (this.isGetRowHeightFunction()) { if (allowEstimate) { return { height: defaultRowHeight, estimated: true }; } var params = { node: rowNode, data: rowNode.data }; var height = this.getCallback('getRowHeight')(params); if (this.isNumeric(height)) { if (height === 0) { doOnce(function () { return console.warn('AG Grid: The return of `getRowHeight` cannot be zero. If the intention is to hide rows, use a filter instead.'); }, 'invalidRowHeight'); } return { height: Math.max(1, height), estimated: false }; } } if (rowNode.detail && this.is('masterDetail')) { return this.getMasterDetailRowHeight(); } var rowHeight = this.gridOptions.rowHeight && this.isNumeric(this.gridOptions.rowHeight) ? this.gridOptions.rowHeight : defaultRowHeight; return { height: rowHeight, estimated: false }; }; GridOptionsService.prototype.getMasterDetailRowHeight = function () { // if autoHeight, we want the height to grow to the new height starting at 1, as otherwise a flicker would happen, // as the detail goes to the default (eg 200px) and then immediately shrink up/down to the new measured height // (due to auto height) which looks bad, especially if doing row animation. if (this.is('detailRowAutoHeight')) { return { height: 1, estimated: false }; } if (this.isNumeric(this.gridOptions.detailRowHeight)) { return { height: this.gridOptions.detailRowHeight, estimated: false }; } return { height: 300, estimated: false }; }; // we don't allow dynamic row height for virtual paging GridOptionsService.prototype.getRowHeightAsNumber = function () { if (!this.gridOptions.rowHeight || missing(this.gridOptions.rowHeight)) { return this.environment.getDefaultRowHeight(); } var rowHeight = this.gridOptions.rowHeight; if (rowHeight && this.isNumeric(rowHeight)) { this.environment.setRowHeightVariable(rowHeight); return rowHeight; } console.warn('AG Grid row height must be a number if not using standard row model'); return this.environment.getDefaultRowHeight(); }; GridOptionsService.prototype.isNumeric = function (value) { return !isNaN(value) && typeof value === 'number' && isFinite(value); }; GridOptionsService.prototype.getDomDataKey = function () { return this.domDataKey; }; // returns the dom data, or undefined if not found GridOptionsService.prototype.getDomData = function (element, key) { var domData = element[this.getDomDataKey()]; return domData ? domData[key] : undefined; }; GridOptionsService.prototype.setDomData = function (element, key, value) { var domDataKey = this.getDomDataKey(); var domData = element[domDataKey]; if (missing(domData)) { domData = {}; element[domDataKey] = domData; } domData[key] = value; }; GridOptionsService.prototype.getDocument = function () { // if user is providing document, we use the users one, // otherwise we use the document on the global namespace. var result = null; if (this.gridOptions.getDocument && exists(this.gridOptions.getDocument)) { result = this.gridOptions.getDocument(); } else if (this.eGridDiv) { result = this.eGridDiv.ownerDocument; } if (result && exists(result)) { return result; } return document; }; GridOptionsService.prototype.getRootNode = function () { return this.eGridDiv.getRootNode(); }; GridOptionsService.prototype.getRowIdFunc = function () { var getRowId = this.getCallback('getRowId'); if (getRowId) { return getRowId; } // this is the deprecated way, so provide a proxy to make it compatible var getRowNodeId = this.gridOptions.getRowNodeId; if (getRowNodeId) { return function (params) { return getRowNodeId(params.data); }; } }; GridOptionsService.prototype.getAsyncTransactionWaitMillis = function () { return exists(this.gridOptions.asyncTransactionWaitMillis) ? this.gridOptions.asyncTransactionWaitMillis : 50; }; GridOptionsService.prototype.isAnimateRows = function () { // never allow animating if enforcing the row order if (this.is('ensureDomOrder')) { return false; } return this.is('animateRows'); }; GridOptionsService.prototype.isTreeData = function () { return this.is('treeData') && ModuleRegistry.assertRegistered(exports.ModuleNames.RowGroupingModule, 'Tree Data'); }; GridOptionsService.prototype.isMasterDetail = function () { return this.is('masterDetail') && ModuleRegistry.assertRegistered(exports.ModuleNames.MasterDetailModule, 'masterDetail'); }; GridOptionsService.prototype.isEnableRangeSelection = function () { return this.is('enableRangeSelection') && ModuleRegistry.isRegistered(exports.ModuleNames.RangeSelectionModule); }; GridOptionsService.prototype.isColumnsSortingCoupledToGroup = function () { var autoGroupColumnDef = this.gridOptions.autoGroupColumnDef; var isClientSideRowModel = this.isRowModelType('clientSide'); return isClientSideRowModel && !(autoGroupColumnDef === null || autoGroupColumnDef === void 0 ? void 0 : autoGroupColumnDef.comparator); }; GridOptionsService.prototype.getGroupAggFiltering = function () { var userValue = this.gridOptions.groupAggFiltering; if (typeof userValue === 'function') { return this.getCallback('groupAggFiltering'); } if (isTrue(userValue)) { return function () { return true; }; } return undefined; }; GridOptionsService.prototype.isGroupMultiAutoColumn = function () { if (this.gridOptions.groupDisplayType) { return matchesGroupDisplayType('multipleColumns', this.gridOptions.groupDisplayType); } // if we are doing hideOpenParents we also show multiple columns, otherwise hideOpenParents would not work return this.is('groupHideOpenParents'); }; GridOptionsService.prototype.isGroupUseEntireRow = function (pivotMode) { // we never allow groupDisplayType = 'groupRows' if in pivot mode, otherwise we won't see the pivot values. if (pivotMode) { return false; } return this.gridOptions.groupDisplayType ? matchesGroupDisplayType('groupRows', this.gridOptions.groupDisplayType) : false; }; __decorate$2l([ Autowired('gridOptions') ], GridOptionsService.prototype, "gridOptions", void 0); __decorate$2l([ Autowired('eventService') ], GridOptionsService.prototype, "eventService", void 0); __decorate$2l([ Autowired('environment') ], GridOptionsService.prototype, "environment", void 0); __decorate$2l([ Autowired('eGridDiv') ], GridOptionsService.prototype, "eGridDiv", void 0); __decorate$2l([ __param$9(0, Qualifier('gridApi')), __param$9(1, Qualifier('columnApi')) ], GridOptionsService.prototype, "agWire", null); __decorate$2l([ PostConstruct ], GridOptionsService.prototype, "init", null); __decorate$2l([ PreDestroy ], GridOptionsService.prototype, "destroy", null); GridOptionsService = __decorate$2l([ Bean('gridOptionsService') ], GridOptionsService); return GridOptionsService; }()); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$2E = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __decorate$2m = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var LocaleService = /** @class */ (function (_super) { __extends$2E(LocaleService, _super); function LocaleService() { return _super !== null && _super.apply(this, arguments) || this; } LocaleService.prototype.getLocaleTextFunc = function () { var getLocaleText = this.gridOptionsService.getCallback('getLocaleText'); if (getLocaleText) { //key: string, defaultValue: string, variableValues?: string[] return function (key, defaultValue, variableValues) { var params = { key: key, defaultValue: defaultValue, variableValues: variableValues }; return getLocaleText(params); }; } var localeTextFunc = this.gridOptionsService.get('localeTextFunc'); if (localeTextFunc) { return localeTextFunc; } var localeText = this.gridOptionsService.get('localeText'); return function (key, defaultValue, variableValues) { var localisedText = localeText && localeText[key]; if (localisedText && variableValues && variableValues.length) { var found = 0; while (true) { if (found >= variableValues.length) { break; } var idx = localisedText.indexOf('${variable}'); if (idx === -1) { break; } localisedText = localisedText.replace('${variable}', variableValues[found++]); } } return localisedText !== null && localisedText !== void 0 ? localisedText : defaultValue; }; }; LocaleService = __decorate$2m([ Bean('localeService') ], LocaleService); return LocaleService; }(BeanStub)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __extends$2F = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __decorate$2n = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var FakeVScrollComp = /** @class */ (function (_super) { __extends$2F(FakeVScrollComp, _super); function FakeVScrollComp() { return _super.call(this, FakeVScrollComp.TEMPLATE, 'vertical') || this; } FakeVScrollComp.prototype.postConstruct = function () { _super.prototype.postConstruct.call(this); this.createManagedBean(new SetHeightFeature(this.eContainer)); this.ctrlsService.registerFakeVScrollComp(this); }; FakeVScrollComp.prototype.setScrollVisible = function () { var vScrollShowing = this.scrollVisibleService.isVerticalScrollShowing(); var invisibleScrollbar = this.invisibleScrollbar; var scrollbarWidth = vScrollShowing ? (this.gridOptionsService.getScrollbarWidth() || 0) : 0; var adjustedScrollbarWidth = (scrollbarWidth === 0 && invisibleScrollbar) ? 16 : scrollbarWidth; this.addOrRemoveCssClass('ag-scrollbar-invisible', invisibleScrollbar); setFixedWidth(this.getGui(), adjustedScrollbarWidth); setFixedWidth(this.eViewport, adjustedScrollbarWidth); setFixedWidth(this.eContainer, adjustedScrollbarWidth); this.setDisplayed(vScrollShowing, { skipAriaHidden: true }); }; FakeVScrollComp.TEMPLATE = "
\n
\n
\n
\n
"; __decorate$2n([ PostConstruct ], FakeVScrollComp.prototype, "postConstruct", null); return FakeVScrollComp; }(AbstractFakeScrollComp)); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var __read$s = (undefined && undefined.__read) || function (o, n) { var m = typeof Symbol === "function" && o[Symbol.iterator]; if (!m) return o; var i = m.call(o), r, ar = [], e; try { while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); } catch (error) { e = { error: error }; } finally { try { if (r && !r.done && (m = i["return"])) m.call(i); } finally { if (e) throw e.error; } } return ar; }; var __spread$m = (undefined && undefined.__spread) || function () { for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read$s(arguments[i])); return ar; }; // creates JavaScript vanilla Grid, including JavaScript (ag-stack) components, which can // be wrapped by the framework wrappers var Grid = /** @class */ (function () { function Grid(eGridDiv, gridOptions, params) { if (!gridOptions) { console.error('AG Grid: no gridOptions provided to the grid'); return; } this.gridOptions = gridOptions; new GridCoreCreator().create(eGridDiv, gridOptions, function (context) { var gridComp = new GridComp(eGridDiv); context.createBean(gridComp); }, undefined, params); } Grid.prototype.destroy = function () { if (this.gridOptions && this.gridOptions.api) { this.gridOptions.api.destroy(); } }; return Grid; }()); // created services of grid only, no UI, so frameworks can use this if providing // their own UI var GridCoreCreator = /** @class */ (function () { function GridCoreCreator() { } GridCoreCreator.prototype.create = function (eGridDiv, gridOptions, createUi, acceptChanges, params) { var _this = this; var debug = !!gridOptions.debug; var registeredModules = this.getRegisteredModules(params); var beanClasses = this.createBeansList(gridOptions.rowModelType, registeredModules); var providedBeanInstances = this.createProvidedBeans(eGridDiv, gridOptions, params); if (!beanClasses) { return; } // happens when no row model found var contextParams = { providedBeanInstances: providedBeanInstances, beanClasses: beanClasses, debug: debug }; var logger = new Logger('AG Grid', function () { return gridOptions.debug; }); var contextLogger = new Logger('Context', function () { return contextParams.debug; }); var context = new Context(contextParams, contextLogger); var beans = context.getBean('beans'); this.registerModuleUserComponents(beans, registeredModules); this.registerStackComponents(beans, registeredModules); this.registerControllers(beans, registeredModules); createUi(context); // we wait until the UI has finished initialising before setting in columns and rows beans.ctrlsService.whenReady(function () { _this.setColumnsAndData(beans); _this.dispatchGridReadyEvent(beans); var isEnterprise = ModuleRegistry.isRegistered(exports.ModuleNames.EnterpriseCoreModule); logger.log("initialised successfully, enterprise = " + isEnterprise); }); if (acceptChanges) { acceptChanges(context); } }; GridCoreCreator.prototype.registerControllers = function (beans, registeredModules) { registeredModules.forEach(function (module) { if (module.controllers) { module.controllers.forEach(function (meta) { return beans.ctrlsFactory.register(meta); }); } }); }; GridCoreCreator.prototype.registerStackComponents = function (beans, registeredModules) { var agStackComponents = this.createAgStackComponentsList(registeredModules); beans.agStackComponentsRegistry.setupComponents(agStackComponents); }; GridCoreCreator.prototype.getRegisteredModules = function (params) { var passedViaConstructor = params ? params.modules : null; var registered = ModuleRegistry.getRegisteredModules(); var allModules = []; var mapNames = {}; // adds to list and removes duplicates function addModule(moduleBased, mod) { function addIndividualModule(currentModule) { if (!mapNames[currentModule.moduleName]) { mapNames[currentModule.moduleName] = true; allModules.push(currentModule); ModuleRegistry.register(currentModule, moduleBased); } } addIndividualModule(mod); if (mod.dependantModules) { mod.dependantModules.forEach(addModule.bind(null, moduleBased)); } } if (passedViaConstructor) { passedViaConstructor.forEach(addModule.bind(null, true)); } if (registered) { registered.forEach(addModule.bind(null, !ModuleRegistry.isPackageBased())); } return allModules; }; GridCoreCreator.prototype.registerModuleUserComponents = function (beans, registeredModules) { var moduleUserComps = this.extractModuleEntity(registeredModules, function (module) { return module.userComponents ? module.userComponents : []; }); moduleUserComps.forEach(function (compMeta) { beans.userComponentRegistry.registerDefaultComponent(compMeta.componentName, compMeta.componentClass); }); }; GridCoreCreator.prototype.createProvidedBeans = function (eGridDiv, gridOptions, params) { var frameworkOverrides = params ? params.frameworkOverrides : null; if (missing(frameworkOverrides)) { frameworkOverrides = new VanillaFrameworkOverrides(); } var seed = { gridOptions: gridOptions, eGridDiv: eGridDiv, globalEventListener: params ? params.globalEventListener : null, frameworkOverrides: frameworkOverrides }; if (params && params.providedBeanInstances) { Object.assign(seed, params.providedBeanInstances); } return seed; }; GridCoreCreator.prototype.createAgStackComponentsList = function (registeredModules) { var components = [ { componentName: 'AgCheckbox', componentClass: AgCheckbox }, { componentName: 'AgRadioButton', componentClass: AgRadioButton }, { componentName: 'AgToggleButton', componentClass: AgToggleButton }, { componentName: 'AgInputTextField', componentClass: AgInputTextField }, { componentName: 'AgInputTextArea', componentClass: AgInputTextArea }, { componentName: 'AgInputNumberField', componentClass: AgInputNumberField }, { componentName: 'AgInputRange', componentClass: AgInputRange }, { componentName: 'AgSelect', componentClass: AgSelect }, { componentName: 'AgSlider', componentClass: AgSlider }, { componentName: 'AgGridBody', componentClass: GridBodyComp }, { componentName: 'AgHeaderRoot', componentClass: GridHeaderComp }, { componentName: 'AgSortIndicator', componentClass: SortIndicatorComp }, { componentName: 'AgPagination', componentClass: PaginationComp }, { componentName: 'AgOverlayWrapper', componentClass: OverlayWrapperComponent }, { componentName: 'AgGroupComponent', componentClass: AgGroupComponent }, { componentName: 'AgPanel', componentClass: AgPanel }, { componentName: 'AgDialog', componentClass: AgDialog }, { componentName: 'AgRowContainer', componentClass: RowContainerComp }, { componentName: 'AgFakeHorizontalScroll', componentClass: FakeHScrollComp }, { componentName: 'AgFakeVerticalScroll', componentClass: FakeVScrollComp } ]; var moduleAgStackComps = this.extractModuleEntity(registeredModules, function (module) { return module.agStackComponents ? module.agStackComponents : []; }); components = components.concat(moduleAgStackComps); return components; }; GridCoreCreator.prototype.createBeansList = function (rowModelType, registeredModules) { if (rowModelType === void 0) { rowModelType = 'clientSide'; } // only load beans matching the required row model var rowModelModules = registeredModules.filter(function (module) { return !module.rowModel || module.rowModel === rowModelType; }); // assert that the relevant module has been loaded var rowModelModuleNames = { clientSide: exports.ModuleNames.ClientSideRowModelModule, infinite: exports.ModuleNames.InfiniteRowModelModule, serverSide: exports.ModuleNames.ServerSideRowModelModule, viewport: exports.ModuleNames.ViewportRowModelModule }; if (!rowModelModuleNames[rowModelType]) { console.error('AG Grid: could not find row model for rowModelType = ' + rowModelType); return; } if (!ModuleRegistry.assertRegistered(rowModelModuleNames[rowModelType], "rowModelType = '" + rowModelType + "'")) { return; } // beans should only contain SERVICES, it should NEVER contain COMPONENTS var beans = [ Beans, RowPositionUtils, CellPositionUtils, HeaderPositionUtils, PaginationAutoPageSizeService, GridApi, UserComponentRegistry, AgComponentUtils, ComponentMetadataProvider, ResizeObserverService, UserComponentFactory, RowContainerHeightService, HorizontalResizeService, LocaleService, GridOptionsValidator, PinnedRowModel, DragService, DisplayedGroupCreator, EventService, GridOptionsService, PopupService, SelectionService, FilterManager, ColumnModel, HeaderNavigationService, PaginationProxy, RowRenderer, ExpressionService, ColumnFactory, TemplateService, AlignedGridsService, NavigationService, ValueCache, ValueService, LoggerFactory, ColumnUtils, AutoWidthCalculator, StandardMenuFactory, DragAndDropService, ColumnApi, FocusService, MouseEventService, Environment, CellNavigationService, ValueFormatterService, StylingService, ScrollVisibleService, SortController, ColumnHoverService, ColumnAnimationService, SelectableService, AutoGroupColService, ChangeDetectionService, AnimationFrameService, UndoRedoService, AgStackComponentsRegistry, ColumnDefFactory, RowCssClassCalculator, RowNodeBlockLoader, RowNodeSorter, CtrlsService, PinnedWidthService, RowNodeEventThrottle, CtrlsFactory ]; var moduleBeans = this.extractModuleEntity(rowModelModules, function (module) { return module.beans ? module.beans : []; }); beans.push.apply(beans, __spread$m(moduleBeans)); // check for duplicates, as different modules could include the same beans that // they depend on, eg ClientSideRowModel in enterprise, and ClientSideRowModel in community var beansNoDuplicates = []; beans.forEach(function (bean) { if (beansNoDuplicates.indexOf(bean) < 0) { beansNoDuplicates.push(bean); } }); return beansNoDuplicates; }; GridCoreCreator.prototype.extractModuleEntity = function (moduleEntities, extractor) { return [].concat.apply([], __spread$m(moduleEntities.map(extractor))); }; GridCoreCreator.prototype.setColumnsAndData = function (beans) { var columnDefs = beans.gridOptionsService.get('columnDefs'); beans.columnModel.setColumnDefs(columnDefs || [], "gridInitializing"); beans.rowModel.start(); }; GridCoreCreator.prototype.dispatchGridReadyEvent = function (beans) { var readyEvent = { type: Events.EVENT_GRID_READY, }; beans.eventService.dispatchEvent(readyEvent); }; return GridCoreCreator; }()); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var BaseComponentWrapper = /** @class */ (function () { function BaseComponentWrapper() { } BaseComponentWrapper.prototype.wrap = function (OriginalConstructor, mandatoryMethodList, optionalMethodList, componentType) { var _this = this; if (optionalMethodList === void 0) { optionalMethodList = []; } var wrapper = this.createWrapper(OriginalConstructor, componentType); mandatoryMethodList.forEach((function (methodName) { _this.createMethod(wrapper, methodName, true); })); optionalMethodList.forEach((function (methodName) { _this.createMethod(wrapper, methodName, false); })); return wrapper; }; BaseComponentWrapper.prototype.unwrap = function (comp) { return comp; }; BaseComponentWrapper.prototype.createMethod = function (wrapper, methodName, mandatory) { wrapper.addMethod(methodName, this.createMethodProxy(wrapper, methodName, mandatory)); }; BaseComponentWrapper.prototype.createMethodProxy = function (wrapper, methodName, mandatory) { return function () { if (wrapper.hasMethod(methodName)) { return wrapper.callMethod(methodName, arguments); } if (mandatory) { console.warn('AG Grid: Framework component is missing the method ' + methodName + '()'); } return null; }; }; return BaseComponentWrapper; }()); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var DEFAULT_CHART_GROUPS = { columnGroup: [ 'column', 'stackedColumn', 'normalizedColumn' ], barGroup: [ 'bar', 'stackedBar', 'normalizedBar' ], pieGroup: [ 'pie', 'doughnut' ], lineGroup: [ 'line' ], scatterGroup: [ 'scatter', 'bubble' ], areaGroup: [ 'area', 'stackedArea', 'normalizedArea' ], histogramGroup: [ 'histogram' ], combinationGroup: [ 'columnLineCombo', 'areaColumnCombo', 'customCombo' ] }; var CHART_TOOL_PANEL_ALLOW_LIST = [ 'chartSettings', 'chartData', 'chartFormat' ]; var CHART_TOOLBAR_ALLOW_LIST = [ 'chartUnlink', 'chartLink', 'chartDownload' ]; var CHART_TOOL_PANEL_MENU_OPTIONS = { settings: "chartSettings", data: "chartData", format: "chartFormat" }; /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ /** * Internal Use Only: Used to ensure this file is treated as a module until we can use moduleDetection flag in Ts v4.7 */ var __FORCE_MODULE_DETECTION = 0; /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ (function (BarColumnLabelPlacement) { BarColumnLabelPlacement["InsideBase"] = "insideBase"; BarColumnLabelPlacement["InsideEnd"] = "insideEnd"; BarColumnLabelPlacement["Center"] = "center"; BarColumnLabelPlacement["OutsideEnd"] = "outsideEnd"; })(exports.BarColumnLabelPlacement || (exports.BarColumnLabelPlacement = {})); /** * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.2.0 * @link https://www.ag-grid.com/ * @license MIT */ var globalObj = typeof global === 'undefined' ? {} : global; globalObj.HTMLElement = typeof HTMLElement === 'undefined' ? {} : HTMLElement; globalObj.HTMLButtonElement = typeof HTMLButtonElement === 'undefined' ? {} : HTMLButtonElement; globalObj.HTMLSelectElement = typeof HTMLSelectElement === 'undefined' ? {} : HTMLSelectElement; globalObj.HTMLInputElement = typeof HTMLInputElement === 'undefined' ? {} : HTMLInputElement; globalObj.Node = typeof Node === 'undefined' ? {} : Node; globalObj.MouseEvent = typeof MouseEvent === 'undefined' ? {} : MouseEvent; var __read$t = (undefined && undefined.__read) || function (o, n) { var m = typeof Symbol === "function" && o[Symbol.iterator]; if (!m) return o; var i = m.call(o), r, ar = [], e; try { while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); } catch (error) { e = { error: error }; } finally { try { if (r && !r.done && (m = i["return"])) m.call(i); } finally { if (e) throw e.error; } } return ar; }; var __spread$n = (undefined && undefined.__spread) || function () { for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read$t(arguments[i])); return ar; }; var ClientSideNodeManager = /** @class */ (function () { function ClientSideNodeManager(rootNode, gridOptionsService, eventService, columnModel, selectionService, beans) { this.nextId = 0; // when user is provide the id's, we also keep a map of ids to row nodes for convenience this.allNodesMap = {}; this.rootNode = rootNode; this.gridOptionsService = gridOptionsService; this.eventService = eventService; this.columnModel = columnModel; this.beans = beans; this.selectionService = selectionService; this.rootNode.group = true; this.rootNode.level = -1; this.rootNode.id = ClientSideNodeManager.ROOT_NODE_ID; this.rootNode.allLeafChildren = []; this.rootNode.childrenAfterGroup = []; this.rootNode.childrenAfterSort = []; this.rootNode.childrenAfterAggFilter = []; this.rootNode.childrenAfterFilter = []; // if we make this class a bean, then can annotate postConstruct this.postConstruct(); } // @PostConstruct - this is not a bean, so postConstruct called by constructor ClientSideNodeManager.prototype.postConstruct = function () { // func below doesn't have 'this' pointer, so need to pull out these bits this.suppressParentsInRowNodes = this.gridOptionsService.is('suppressParentsInRowNodes'); this.isRowMasterFunc = this.gridOptionsService.get('isRowMaster'); this.doingTreeData = this.gridOptionsService.isTreeData(); this.doingMasterDetail = this.gridOptionsService.isMasterDetail(); }; ClientSideNodeManager.prototype.getCopyOfNodesMap = function () { return _.cloneObject(this.allNodesMap); }; ClientSideNodeManager.prototype.getRowNode = function (id) { return this.allNodesMap[id]; }; ClientSideNodeManager.prototype.setRowData = function (rowData) { var _this = this; if (typeof rowData === 'string') { console.warn('AG Grid: rowData must be an array, however you passed in a string. If you are loading JSON, make sure you convert the JSON string to JavaScript objects first'); return; } var rootNode = this.rootNode; var sibling = this.rootNode.sibling; rootNode.childrenAfterFilter = null; rootNode.childrenAfterGroup = null; rootNode.childrenAfterAggFilter = null; rootNode.childrenAfterSort = null; rootNode.childrenMapped = null; rootNode.updateHasChildren(); this.nextId = 0; this.allNodesMap = {}; if (rowData) { // we use rootNode as the parent, however if using ag-grid-enterprise, the grouping stage // sets the parent node on each row (even if we are not grouping). so setting parent node // here is for benefit of ag-grid-community users rootNode.allLeafChildren = rowData.map(function (dataItem) { return _this.createNode(dataItem, _this.rootNode, ClientSideNodeManager.TOP_LEVEL); }); } else { rootNode.allLeafChildren = []; rootNode.childrenAfterGroup = []; } if (sibling) { sibling.childrenAfterFilter = rootNode.childrenAfterFilter; sibling.childrenAfterGroup = rootNode.childrenAfterGroup; sibling.childrenAfterAggFilter = rootNode.childrenAfterAggFilter; sibling.childrenAfterSort = rootNode.childrenAfterSort; sibling.childrenMapped = rootNode.childrenMapped; sibling.allLeafChildren = rootNode.allLeafChildren; } }; ClientSideNodeManager.prototype.updateRowData = function (rowDataTran, rowNodeOrder) { var rowNodeTransaction = { remove: [], update: [], add: [] }; var nodesToUnselect = []; this.executeRemove(rowDataTran, rowNodeTransaction, nodesToUnselect); this.executeUpdate(rowDataTran, rowNodeTransaction, nodesToUnselect); this.executeAdd(rowDataTran, rowNodeTransaction); this.updateSelection(nodesToUnselect, 'rowDataChanged'); if (rowNodeOrder) { _.sortRowNodesByOrder(this.rootNode.allLeafChildren, rowNodeOrder); } return rowNodeTransaction; }; ClientSideNodeManager.prototype.updateSelection = function (nodesToUnselect, source) { var selectionChanged = nodesToUnselect.length > 0; if (selectionChanged) { nodesToUnselect.forEach(function (rowNode) { rowNode.setSelected(false, false, true, source); }); } // we do this regardless of nodes to unselect or not, as it's possible // a new node was inserted, so a parent that was previously selected (as all // children were selected) should not be tri-state (as new one unselected against // all other selected children). this.selectionService.updateGroupsFromChildrenSelections(source); if (selectionChanged) { var event_1 = { type: Events.EVENT_SELECTION_CHANGED, source: source }; this.eventService.dispatchEvent(event_1); } }; ClientSideNodeManager.prototype.executeAdd = function (rowDataTran, rowNodeTransaction) { var _this = this; var _a; var add = rowDataTran.add, addIndex = rowDataTran.addIndex; if (_.missingOrEmpty(add)) { return; } // create new row nodes for each data item var newNodes = add.map(function (item) { return _this.createNode(item, _this.rootNode, ClientSideNodeManager.TOP_LEVEL); }); if (typeof addIndex === 'number' && addIndex >= 0) { // new rows are inserted in one go by concatenating them in between the existing rows at the desired index. // this is much faster than splicing them individually into 'allLeafChildren' when there are large inserts. var allLeafChildren = this.rootNode.allLeafChildren; var len = allLeafChildren.length; var normalisedAddIndex = addIndex; if (this.doingTreeData && addIndex > 0 && len > 0) { for (var i = 0; i < len; i++) { if (((_a = allLeafChildren[i]) === null || _a === void 0 ? void 0 : _a.rowIndex) == addIndex - 1) { normalisedAddIndex = i + 1; break; } } } var nodesBeforeIndex = allLeafChildren.slice(0, normalisedAddIndex); var nodesAfterIndex = allLeafChildren.slice(normalisedAddIndex, allLeafChildren.length); this.rootNode.allLeafChildren = __spread$n(nodesBeforeIndex, newNodes, nodesAfterIndex); } else { this.rootNode.allLeafChildren = __spread$n(this.rootNode.allLeafChildren, newNodes); } if (this.rootNode.sibling) { this.rootNode.sibling.allLeafChildren = this.rootNode.allLeafChildren; } // add new row nodes to the transaction add items rowNodeTransaction.add = newNodes; }; ClientSideNodeManager.prototype.executeRemove = function (rowDataTran, rowNodeTransaction, nodesToUnselect) { var _this = this; var remove = rowDataTran.remove; if (_.missingOrEmpty(remove)) { return; } var rowIdsRemoved = {}; remove.forEach(function (item) { var rowNode = _this.lookupRowNode(item); if (!rowNode) { return; } // do delete - setting 'suppressFinishActions = true' to ensure EVENT_SELECTION_CHANGED is not raised for // each row node updated, instead it is raised once by the calling code if any selected nodes exist. if (rowNode.isSelected()) { nodesToUnselect.push(rowNode); } // so row renderer knows to fade row out (and not reposition it) rowNode.clearRowTopAndRowIndex(); // NOTE: were we could remove from allLeaveChildren, however _.removeFromArray() is expensive, especially // if called multiple times (eg deleting lots of rows) and if allLeafChildren is a large list rowIdsRemoved[rowNode.id] = true; // _.removeFromArray(this.rootNode.allLeafChildren, rowNode); delete _this.allNodesMap[rowNode.id]; rowNodeTransaction.remove.push(rowNode); }); this.rootNode.allLeafChildren = this.rootNode.allLeafChildren.filter(function (rowNode) { return !rowIdsRemoved[rowNode.id]; }); if (this.rootNode.sibling) { this.rootNode.sibling.allLeafChildren = this.rootNode.allLeafChildren; } }; ClientSideNodeManager.prototype.executeUpdate = function (rowDataTran, rowNodeTransaction, nodesToUnselect) { var _this = this; var update = rowDataTran.update; if (_.missingOrEmpty(update)) { return; } update.forEach(function (item) { var rowNode = _this.lookupRowNode(item); if (!rowNode) { return; } rowNode.updateData(item); if (!rowNode.selectable && rowNode.isSelected()) { nodesToUnselect.push(rowNode); } _this.setMasterForRow(rowNode, item, ClientSideNodeManager.TOP_LEVEL, false); rowNodeTransaction.update.push(rowNode); }); }; ClientSideNodeManager.prototype.lookupRowNode = function (data) { var getRowIdFunc = this.gridOptionsService.getRowIdFunc(); var rowNode; if (getRowIdFunc) { // find rowNode using id var id = getRowIdFunc({ data: data, level: 0 }); rowNode = this.allNodesMap[id]; if (!rowNode) { console.error("AG Grid: could not find row id=" + id + ", data item was not found for this id"); return null; } } else { // find rowNode using object references rowNode = this.rootNode.allLeafChildren.find(function (node) { return node.data === data; }); if (!rowNode) { console.error("AG Grid: could not find data item as object was not found", data); console.error("Consider using getRowId to help the Grid find matching row data"); return null; } } return rowNode || null; }; ClientSideNodeManager.prototype.createNode = function (dataItem, parent, level) { var node = new RowNode(this.beans); node.group = false; this.setMasterForRow(node, dataItem, level, true); if (parent && !this.suppressParentsInRowNodes) { node.parent = parent; } node.level = level; node.setDataAndId(dataItem, this.nextId.toString()); if (this.allNodesMap[node.id]) { console.warn("AG Grid: duplicate node id '" + node.id + "' detected from getRowId callback, this could cause issues in your grid."); } this.allNodesMap[node.id] = node; this.nextId++; return node; }; ClientSideNodeManager.prototype.setMasterForRow = function (rowNode, data, level, setExpanded) { if (this.doingTreeData) { rowNode.setMaster(false); if (setExpanded) { rowNode.expanded = false; } } else { // this is the default, for when doing grid data if (this.doingMasterDetail) { // if we are doing master detail, then the // default is that everything can be a Master Row. if (this.isRowMasterFunc) { rowNode.setMaster(this.isRowMasterFunc(data)); } else { rowNode.setMaster(true); } } else { rowNode.setMaster(false); } if (setExpanded) { var rowGroupColumns = this.columnModel.getRowGroupColumns(); var numRowGroupColumns = rowGroupColumns ? rowGroupColumns.length : 0; // need to take row group into account when determining level var masterRowLevel = level + numRowGroupColumns; rowNode.expanded = rowNode.master ? this.isExpanded(masterRowLevel) : false; } } }; ClientSideNodeManager.prototype.isExpanded = function (level) { var expandByDefault = this.gridOptionsService.getNum('groupDefaultExpanded'); if (expandByDefault === -1) { return true; } return level < expandByDefault; }; ClientSideNodeManager.TOP_LEVEL = 0; ClientSideNodeManager.ROOT_NODE_ID = 'ROOT_NODE_ID'; return ClientSideNodeManager; }()); var __extends$2G = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __decorate$2o = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var __read$u = (undefined && undefined.__read) || function (o, n) { var m = typeof Symbol === "function" && o[Symbol.iterator]; if (!m) return o; var i = m.call(o), r, ar = [], e; try { while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); } catch (error) { e = { error: error }; } finally { try { if (r && !r.done && (m = i["return"])) m.call(i); } finally { if (e) throw e.error; } } return ar; }; var __spread$o = (undefined && undefined.__spread) || function () { for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read$u(arguments[i])); return ar; }; var RecursionType; (function (RecursionType) { RecursionType[RecursionType["Normal"] = 0] = "Normal"; RecursionType[RecursionType["AfterFilter"] = 1] = "AfterFilter"; RecursionType[RecursionType["AfterFilterAndSort"] = 2] = "AfterFilterAndSort"; RecursionType[RecursionType["PivotNodes"] = 3] = "PivotNodes"; })(RecursionType || (RecursionType = {})); var ClientSideRowModel = /** @class */ (function (_super) { __extends$2G(ClientSideRowModel, _super); function ClientSideRowModel() { var _this = _super !== null && _super.apply(this, arguments) || this; _this.onRowHeightChanged_debounced = _.debounce(_this.onRowHeightChanged.bind(_this), 100); _this.rowsToDisplay = []; // the rows mapped to rows to display return _this; } ClientSideRowModel.prototype.init = function () { var refreshEverythingFunc = this.refreshModel.bind(this, { step: exports.ClientSideRowModelSteps.EVERYTHING }); var animate = !this.gridOptionsService.is('suppressAnimationFrame'); var refreshEverythingAfterColsChangedFunc = this.refreshModel.bind(this, { step: exports.ClientSideRowModelSteps.EVERYTHING, afterColumnsChanged: true, keepRenderedRows: true, animate: animate }); this.addManagedListener(this.eventService, Events.EVENT_NEW_COLUMNS_LOADED, refreshEverythingAfterColsChangedFunc); this.addManagedListener(this.eventService, Events.EVENT_COLUMN_ROW_GROUP_CHANGED, refreshEverythingFunc); this.addManagedListener(this.eventService, Events.EVENT_COLUMN_VALUE_CHANGED, this.onValueChanged.bind(this)); this.addManagedListener(this.eventService, Events.EVENT_COLUMN_PIVOT_CHANGED, this.refreshModel.bind(this, { step: exports.ClientSideRowModelSteps.PIVOT })); this.addManagedListener(this.eventService, Events.EVENT_FILTER_CHANGED, this.onFilterChanged.bind(this)); this.addManagedListener(this.eventService, Events.EVENT_SORT_CHANGED, this.onSortChanged.bind(this)); this.addManagedListener(this.eventService, Events.EVENT_COLUMN_PIVOT_MODE_CHANGED, refreshEverythingFunc); this.addManagedListener(this.eventService, Events.EVENT_GRID_STYLES_CHANGED, this.resetRowHeights.bind(this)); var refreshMapListener = this.refreshModel.bind(this, { step: exports.ClientSideRowModelSteps.MAP, keepRenderedRows: true, animate: animate }); this.addManagedPropertyListener('groupRemoveSingleChildren', refreshMapListener); this.addManagedPropertyListener('groupRemoveLowestSingleChildren', refreshMapListener); this.rootNode = new RowNode(this.beans); this.nodeManager = new ClientSideNodeManager(this.rootNode, this.gridOptionsService, this.eventService, this.columnModel, this.selectionService, this.beans); }; ClientSideRowModel.prototype.start = function () { var rowData = this.gridOptionsService.get('rowData'); if (rowData) { this.setRowData(rowData); } }; ClientSideRowModel.prototype.ensureRowHeightsValid = function (startPixel, endPixel, startLimitIndex, endLimitIndex) { var atLeastOneChange; var res = false; // we do this multiple times as changing the row heights can also change the first and last rows, // so the first pass can make lots of rows smaller, which means the second pass we end up changing // more rows. do { atLeastOneChange = false; var rowAtStartPixel = this.getRowIndexAtPixel(startPixel); var rowAtEndPixel = this.getRowIndexAtPixel(endPixel); // keep check to current page if doing pagination var firstRow = Math.max(rowAtStartPixel, startLimitIndex); var lastRow = Math.min(rowAtEndPixel, endLimitIndex); for (var rowIndex = firstRow; rowIndex <= lastRow; rowIndex++) { var rowNode = this.getRow(rowIndex); if (rowNode.rowHeightEstimated) { var rowHeight = this.gridOptionsService.getRowHeightForNode(rowNode); rowNode.setRowHeight(rowHeight.height); atLeastOneChange = true; res = true; } } if (atLeastOneChange) { this.setRowTopAndRowIndex(); } } while (atLeastOneChange); return res; }; ClientSideRowModel.prototype.setRowTopAndRowIndex = function () { var defaultRowHeight = this.environment.getDefaultRowHeight(); var nextRowTop = 0; // mapping displayed rows is not needed for this method, however it's used in // clearRowTopAndRowIndex(), and given we are looping through this.rowsToDisplay here, // we create the map here for performance reasons, so we don't loop a second time // in clearRowTopAndRowIndex() var displayedRowsMapped = new Set(); // we don't estimate if doing fullHeight or autoHeight, as all rows get rendered all the time // with these two layouts. var allowEstimate = this.gridOptionsService.isDomLayout('normal'); for (var i = 0; i < this.rowsToDisplay.length; i++) { var rowNode = this.rowsToDisplay[i]; if (rowNode.id != null) { displayedRowsMapped.add(rowNode.id); } if (rowNode.rowHeight == null) { var rowHeight = this.gridOptionsService.getRowHeightForNode(rowNode, allowEstimate, defaultRowHeight); rowNode.setRowHeight(rowHeight.height, rowHeight.estimated); } rowNode.setRowTop(nextRowTop); rowNode.setRowIndex(i); nextRowTop += rowNode.rowHeight; } return displayedRowsMapped; }; ClientSideRowModel.prototype.clearRowTopAndRowIndex = function (changedPath, displayedRowsMapped) { var changedPathActive = changedPath.isActive(); var clearIfNotDisplayed = function (rowNode) { if (rowNode && rowNode.id != null && !displayedRowsMapped.has(rowNode.id)) { rowNode.clearRowTopAndRowIndex(); } }; var recurse = function (rowNode) { clearIfNotDisplayed(rowNode); clearIfNotDisplayed(rowNode.detailNode); clearIfNotDisplayed(rowNode.sibling); if (rowNode.hasChildren()) { if (rowNode.childrenAfterGroup) { // if a changedPath is active, it means we are here because of a transaction update or // a change detection. neither of these impacts the open/closed state of groups. so if // a group is not open this time, it was not open last time. so we know all closed groups // already have their top positions cleared. so there is no need to traverse all the way // when changedPath is active and the rowNode is not expanded. var isRootNode = rowNode.level == -1; // we need to give special consideration for root node, // as expanded=undefined for root node var skipChildren = changedPathActive && !isRootNode && !rowNode.expanded; if (!skipChildren) { rowNode.childrenAfterGroup.forEach(recurse); } } } }; recurse(this.rootNode); }; // returns false if row was moved, otherwise true ClientSideRowModel.prototype.ensureRowsAtPixel = function (rowNodes, pixel, increment) { var _this = this; if (increment === void 0) { increment = 0; } var indexAtPixelNow = this.getRowIndexAtPixel(pixel); var rowNodeAtPixelNow = this.getRow(indexAtPixelNow); var animate = !this.gridOptionsService.is('suppressAnimationFrame'); if (rowNodeAtPixelNow === rowNodes[0]) { return false; } rowNodes.forEach(function (rowNode) { _.removeFromArray(_this.rootNode.allLeafChildren, rowNode); }); rowNodes.forEach(function (rowNode, idx) { _.insertIntoArray(_this.rootNode.allLeafChildren, rowNode, Math.max(indexAtPixelNow + increment, 0) + idx); }); this.refreshModel({ step: exports.ClientSideRowModelSteps.EVERYTHING, keepRenderedRows: true, keepEditingRows: true, animate: animate }); return true; }; ClientSideRowModel.prototype.highlightRowAtPixel = function (rowNode, pixel) { var indexAtPixelNow = pixel != null ? this.getRowIndexAtPixel(pixel) : null; var rowNodeAtPixelNow = indexAtPixelNow != null ? this.getRow(indexAtPixelNow) : null; if (!rowNodeAtPixelNow || !rowNode || rowNodeAtPixelNow === rowNode || pixel == null) { if (this.lastHighlightedRow) { this.lastHighlightedRow.setHighlighted(null); this.lastHighlightedRow = null; } return; } var highlight = this.getHighlightPosition(pixel, rowNodeAtPixelNow); if (this.lastHighlightedRow && this.lastHighlightedRow !== rowNodeAtPixelNow) { this.lastHighlightedRow.setHighlighted(null); this.lastHighlightedRow = null; } rowNodeAtPixelNow.setHighlighted(highlight); this.lastHighlightedRow = rowNodeAtPixelNow; }; ClientSideRowModel.prototype.getHighlightPosition = function (pixel, rowNode) { if (!rowNode) { var index = this.getRowIndexAtPixel(pixel); rowNode = this.getRow(index || 0); if (!rowNode) { return exports.RowHighlightPosition.Below; } } var rowTop = rowNode.rowTop, rowHeight = rowNode.rowHeight; return pixel - rowTop < rowHeight / 2 ? exports.RowHighlightPosition.Above : exports.RowHighlightPosition.Below; }; ClientSideRowModel.prototype.getLastHighlightedRowNode = function () { return this.lastHighlightedRow; }; ClientSideRowModel.prototype.isLastRowIndexKnown = function () { return true; }; ClientSideRowModel.prototype.getRowCount = function () { if (this.rowsToDisplay) { return this.rowsToDisplay.length; } return 0; }; ClientSideRowModel.prototype.getTopLevelRowCount = function () { var showingRootNode = this.rowsToDisplay && this.rowsToDisplay[0] === this.rootNode; if (showingRootNode) { return 1; } var filteredChildren = this.rootNode.childrenAfterAggFilter; return filteredChildren ? filteredChildren.length : 0; }; ClientSideRowModel.prototype.getTopLevelRowDisplayedIndex = function (topLevelIndex) { var showingRootNode = this.rowsToDisplay && this.rowsToDisplay[0] === this.rootNode; if (showingRootNode) { return topLevelIndex; } var rowNode = this.rootNode.childrenAfterSort[topLevelIndex]; if (this.gridOptionsService.is('groupHideOpenParents')) { // if hideOpenParents, and this row open, then this row is now displayed at this index, first child is while (rowNode.expanded && rowNode.childrenAfterSort && rowNode.childrenAfterSort.length > 0) { rowNode = rowNode.childrenAfterSort[0]; } } return rowNode.rowIndex; }; ClientSideRowModel.prototype.getRowBounds = function (index) { if (_.missing(this.rowsToDisplay)) { return null; } var rowNode = this.rowsToDisplay[index]; if (rowNode) { return { rowTop: rowNode.rowTop, rowHeight: rowNode.rowHeight }; } return null; }; ClientSideRowModel.prototype.onRowGroupOpened = function () { var animate = this.gridOptionsService.isAnimateRows(); this.refreshModel({ step: exports.ClientSideRowModelSteps.MAP, keepRenderedRows: true, animate: animate }); }; ClientSideRowModel.prototype.onFilterChanged = function (event) { if (event.afterDataChange) { return; } var animate = this.gridOptionsService.isAnimateRows(); var primaryOrQuickFilterChanged = event.columns.length === 0 || event.columns.some(function (col) { return col.isPrimary(); }); var step = primaryOrQuickFilterChanged ? exports.ClientSideRowModelSteps.FILTER : exports.ClientSideRowModelSteps.FILTER_AGGREGATES; this.refreshModel({ step: step, keepRenderedRows: true, animate: animate }); }; ClientSideRowModel.prototype.onSortChanged = function () { var animate = this.gridOptionsService.isAnimateRows(); this.refreshModel({ step: exports.ClientSideRowModelSteps.SORT, keepRenderedRows: true, animate: animate, keepEditingRows: true }); }; ClientSideRowModel.prototype.getType = function () { return 'clientSide'; }; ClientSideRowModel.prototype.onValueChanged = function () { if (this.columnModel.isPivotActive()) { this.refreshModel({ step: exports.ClientSideRowModelSteps.PIVOT }); } else { this.refreshModel({ step: exports.ClientSideRowModelSteps.AGGREGATE }); } }; ClientSideRowModel.prototype.createChangePath = function (rowNodeTransactions) { // for updates, if the row is updated at all, then we re-calc all the values // in that row. we could compare each value to each old value, however if we // did this, we would be calling the valueService twice, once on the old value // and once on the new value. so it's less valueGetter calls if we just assume // each column is different. that way the changedPath is used so that only // the impacted parent rows are recalculated, parents who's children have // not changed are not impacted. var noTransactions = _.missingOrEmpty(rowNodeTransactions); var changedPath = new ChangedPath(false, this.rootNode); if (noTransactions || this.gridOptionsService.isTreeData()) { changedPath.setInactive(); } return changedPath; }; ClientSideRowModel.prototype.isSuppressModelUpdateAfterUpdateTransaction = function (params) { if (!this.gridOptionsService.is('suppressModelUpdateAfterUpdateTransaction')) { return false; } // return true if we are only doing update transactions if (params.rowNodeTransactions == null) { return false; } var transWithAddsOrDeletes = params.rowNodeTransactions.filter(function (tx) { return (tx.add != null && tx.add.length > 0) || (tx.remove != null && tx.remove.length > 0); }); var transactionsContainUpdatesOnly = transWithAddsOrDeletes == null || transWithAddsOrDeletes.length == 0; return transactionsContainUpdatesOnly; }; ClientSideRowModel.prototype.buildRefreshModelParams = function (step) { var paramsStep = exports.ClientSideRowModelSteps.EVERYTHING; var stepsMapped = { everything: exports.ClientSideRowModelSteps.EVERYTHING, group: exports.ClientSideRowModelSteps.EVERYTHING, filter: exports.ClientSideRowModelSteps.FILTER, map: exports.ClientSideRowModelSteps.MAP, aggregate: exports.ClientSideRowModelSteps.AGGREGATE, sort: exports.ClientSideRowModelSteps.SORT, pivot: exports.ClientSideRowModelSteps.PIVOT }; if (_.exists(step)) { paramsStep = stepsMapped[step]; } if (_.missing(paramsStep)) { console.error("AG Grid: invalid step " + step + ", available steps are " + Object.keys(stepsMapped).join(', ')); return undefined; } var animate = !this.gridOptionsService.is('suppressAnimationFrame'); var modelParams = { step: paramsStep, keepRenderedRows: true, keepEditingRows: true, animate: animate }; return modelParams; }; ClientSideRowModel.prototype.refreshModel = function (paramsOrStep) { var params = typeof paramsOrStep === 'object' && "step" in paramsOrStep ? paramsOrStep : this.buildRefreshModelParams(paramsOrStep); if (!params) { return; } if (this.isSuppressModelUpdateAfterUpdateTransaction(params)) { return; } // this goes through the pipeline of stages. what's in my head is similar // to the diagram on this page: // http://commons.apache.org/sandbox/commons-pipeline/pipeline_basics.html // however we want to keep the results of each stage, hence we manually call // each step rather than have them chain each other. // fallthrough in below switch is on purpose, // eg if STEP_FILTER, then all steps below this // step get done // let start: number; // console.log('======= start ======='); var changedPath = this.createChangePath(params.rowNodeTransactions); switch (params.step) { case exports.ClientSideRowModelSteps.EVERYTHING: this.doRowGrouping(params.groupState, params.rowNodeTransactions, params.rowNodeOrder, changedPath, !!params.afterColumnsChanged); case exports.ClientSideRowModelSteps.FILTER: this.doFilter(changedPath); case exports.ClientSideRowModelSteps.PIVOT: this.doPivot(changedPath); case exports.ClientSideRowModelSteps.AGGREGATE: // depends on agg fields this.doAggregate(changedPath); case exports.ClientSideRowModelSteps.FILTER_AGGREGATES: this.doFilterAggregates(changedPath); case exports.ClientSideRowModelSteps.SORT: this.doSort(params.rowNodeTransactions, changedPath); case exports.ClientSideRowModelSteps.MAP: this.doRowsToDisplay(); } // set all row tops to null, then set row tops on all visible rows. if we don't // do this, then the algorithm below only sets row tops, old row tops from old rows // will still lie around var displayedNodesMapped = this.setRowTopAndRowIndex(); this.clearRowTopAndRowIndex(changedPath, displayedNodesMapped); var event = { type: Events.EVENT_MODEL_UPDATED, animate: params.animate, keepRenderedRows: params.keepRenderedRows, newData: params.newData, newPage: false, keepUndoRedoStack: params.keepUndoRedoStack }; this.eventService.dispatchEvent(event); }; ClientSideRowModel.prototype.isEmpty = function () { var rowsMissing = _.missing(this.rootNode.allLeafChildren) || this.rootNode.allLeafChildren.length === 0; return _.missing(this.rootNode) || rowsMissing || !this.columnModel.isReady(); }; ClientSideRowModel.prototype.isRowsToRender = function () { return _.exists(this.rowsToDisplay) && this.rowsToDisplay.length > 0; }; ClientSideRowModel.prototype.getNodesInRangeForSelection = function (firstInRange, lastInRange) { // if lastSelectedNode is missing, we start at the first row var firstRowHit = !lastInRange; var lastRowHit = false; var lastRow; var result = []; var groupsSelectChildren = this.gridOptionsService.is('groupSelectsChildren'); this.forEachNodeAfterFilterAndSort(function (rowNode) { var lookingForLastRow = firstRowHit && !lastRowHit; // check if we need to flip the select switch if (!firstRowHit) { if (rowNode === lastInRange || rowNode === firstInRange) { firstRowHit = true; } } var skipThisGroupNode = rowNode.group && groupsSelectChildren; if (!skipThisGroupNode) { var inRange = firstRowHit && !lastRowHit; var childOfLastRow = rowNode.isParentOfNode(lastRow); if (inRange || childOfLastRow) { result.push(rowNode); } } if (lookingForLastRow) { if (rowNode === lastInRange || rowNode === firstInRange) { lastRowHit = true; if (rowNode === lastInRange) { lastRow = lastInRange; } else { lastRow = firstInRange; } } } }); return result; }; ClientSideRowModel.prototype.setDatasource = function (datasource) { console.error('AG Grid: should never call setDatasource on clientSideRowController'); }; ClientSideRowModel.prototype.getTopLevelNodes = function () { return this.rootNode ? this.rootNode.childrenAfterGroup : null; }; ClientSideRowModel.prototype.getRootNode = function () { return this.rootNode; }; ClientSideRowModel.prototype.getRow = function (index) { return this.rowsToDisplay[index]; }; ClientSideRowModel.prototype.isRowPresent = function (rowNode) { return this.rowsToDisplay.indexOf(rowNode) >= 0; }; ClientSideRowModel.prototype.getRowIndexAtPixel = function (pixelToMatch) { if (this.isEmpty() || this.rowsToDisplay.length === 0) { return -1; } // do binary search of tree // http://oli.me.uk/2013/06/08/searching-javascript-arrays-with-a-binary-search/ var bottomPointer = 0; var topPointer = this.rowsToDisplay.length - 1; // quick check, if the pixel is out of bounds, then return last row if (pixelToMatch <= 0) { // if pixel is less than or equal zero, it's always the first row return 0; } var lastNode = _.last(this.rowsToDisplay); if (lastNode.rowTop <= pixelToMatch) { return this.rowsToDisplay.length - 1; } var oldBottomPointer = -1; var oldTopPointer = -1; while (true) { var midPointer = Math.floor((bottomPointer + topPointer) / 2); var currentRowNode = this.rowsToDisplay[midPointer]; if (this.isRowInPixel(currentRowNode, pixelToMatch)) { return midPointer; } if (currentRowNode.rowTop < pixelToMatch) { bottomPointer = midPointer + 1; } else if (currentRowNode.rowTop > pixelToMatch) { topPointer = midPointer - 1; } // infinite loops happen when there is space between rows. this can happen // when Auto Height is active, cos we re-calculate row tops asyncronously // when row heights change, which can temporarly result in gaps between rows. var caughtInInfiniteLoop = oldBottomPointer === bottomPointer && oldTopPointer === topPointer; if (caughtInInfiniteLoop) { return midPointer; } oldBottomPointer = bottomPointer; oldTopPointer = topPointer; } }; ClientSideRowModel.prototype.isRowInPixel = function (rowNode, pixelToMatch) { var topPixel = rowNode.rowTop; var bottomPixel = rowNode.rowTop + rowNode.rowHeight; var pixelInRow = topPixel <= pixelToMatch && bottomPixel > pixelToMatch; return pixelInRow; }; ClientSideRowModel.prototype.forEachLeafNode = function (callback) { if (this.rootNode.allLeafChildren) { this.rootNode.allLeafChildren.forEach(function (rowNode, index) { return callback(rowNode, index); }); } }; ClientSideRowModel.prototype.forEachNode = function (callback, includeFooterNodes) { if (includeFooterNodes === void 0) { includeFooterNodes = false; } this.recursivelyWalkNodesAndCallback({ nodes: __spread$o((this.rootNode.childrenAfterGroup || [])), callback: callback, recursionType: RecursionType.Normal, index: 0, includeFooterNodes: includeFooterNodes }); }; ClientSideRowModel.prototype.forEachNodeAfterFilter = function (callback, includeFooterNodes) { if (includeFooterNodes === void 0) { includeFooterNodes = false; } this.recursivelyWalkNodesAndCallback({ nodes: __spread$o((this.rootNode.childrenAfterAggFilter || [])), callback: callback, recursionType: RecursionType.AfterFilter, index: 0, includeFooterNodes: includeFooterNodes }); }; ClientSideRowModel.prototype.forEachNodeAfterFilterAndSort = function (callback, includeFooterNodes) { if (includeFooterNodes === void 0) { includeFooterNodes = false; } this.recursivelyWalkNodesAndCallback({ nodes: __spread$o((this.rootNode.childrenAfterSort || [])), callback: callback, recursionType: RecursionType.AfterFilterAndSort, index: 0, includeFooterNodes: includeFooterNodes }); }; ClientSideRowModel.prototype.forEachPivotNode = function (callback, includeFooterNodes) { if (includeFooterNodes === void 0) { includeFooterNodes = false; } this.recursivelyWalkNodesAndCallback({ nodes: [this.rootNode], callback: callback, recursionType: RecursionType.PivotNodes, index: 0, includeFooterNodes: includeFooterNodes }); }; // iterates through each item in memory, and calls the callback function // nodes - the rowNodes to traverse // callback - the user provided callback // recursion type - need this to know what child nodes to recurse, eg if looking at all nodes, or filtered notes etc // index - works similar to the index in forEach in javascript's array function ClientSideRowModel.prototype.recursivelyWalkNodesAndCallback = function (params) { var _a; var nodes = params.nodes, callback = params.callback, recursionType = params.recursionType, includeFooterNodes = params.includeFooterNodes; var index = params.index; var firstNode = nodes[0]; if (includeFooterNodes && ((_a = firstNode === null || firstNode === void 0 ? void 0 : firstNode.parent) === null || _a === void 0 ? void 0 : _a.sibling)) { nodes.push(firstNode.parent.sibling); } for (var i = 0; i < nodes.length; i++) { var node = nodes[i]; callback(node, index++); // go to the next level if it is a group if (node.hasChildren() && !node.footer) { // depending on the recursion type, we pick a difference set of children var nodeChildren = null; switch (recursionType) { case RecursionType.Normal: nodeChildren = node.childrenAfterGroup; break; case RecursionType.AfterFilter: nodeChildren = node.childrenAfterAggFilter; break; case RecursionType.AfterFilterAndSort: nodeChildren = node.childrenAfterSort; break; case RecursionType.PivotNodes: // for pivot, we don't go below leafGroup levels nodeChildren = !node.leafGroup ? node.childrenAfterSort : null; break; } if (nodeChildren) { index = this.recursivelyWalkNodesAndCallback({ nodes: __spread$o(nodeChildren), callback: callback, recursionType: recursionType, index: index, includeFooterNodes: includeFooterNodes }); } } } return index; }; // it's possible to recompute the aggregate without doing the other parts // + api.refreshClientSideRowModel('aggregate') ClientSideRowModel.prototype.doAggregate = function (changedPath) { if (this.aggregationStage) { this.aggregationStage.execute({ rowNode: this.rootNode, changedPath: changedPath }); } }; ClientSideRowModel.prototype.doFilterAggregates = function (changedPath) { if (this.filterAggregatesStage) { this.filterAggregatesStage.execute({ rowNode: this.rootNode, changedPath: changedPath }); } else { // If filterAggregatesStage is undefined, then so is the grouping stage, so all children should be on the rootNode. this.rootNode.childrenAfterAggFilter = this.rootNode.childrenAfterFilter; } }; // + gridApi.expandAll() // + gridApi.collapseAll() ClientSideRowModel.prototype.expandOrCollapseAll = function (expand) { var usingTreeData = this.gridOptionsService.isTreeData(); var usingPivotMode = this.columnModel.isPivotActive(); var recursiveExpandOrCollapse = function (rowNodes) { if (!rowNodes) { return; } rowNodes.forEach(function (rowNode) { var actionRow = function () { rowNode.expanded = expand; recursiveExpandOrCollapse(rowNode.childrenAfterGroup); }; if (usingTreeData) { var hasChildren = _.exists(rowNode.childrenAfterGroup); if (hasChildren) { actionRow(); } return; } if (usingPivotMode) { var notLeafGroup = !rowNode.leafGroup; if (notLeafGroup) { actionRow(); } return; } var isRowGroup = rowNode.group; if (isRowGroup) { actionRow(); } }); }; if (this.rootNode) { recursiveExpandOrCollapse(this.rootNode.childrenAfterGroup); } this.refreshModel({ step: exports.ClientSideRowModelSteps.MAP }); var eventSource = expand ? 'expandAll' : 'collapseAll'; var event = { type: Events.EVENT_EXPAND_COLLAPSE_ALL, source: eventSource }; this.eventService.dispatchEvent(event); }; ClientSideRowModel.prototype.doSort = function (rowNodeTransactions, changedPath) { this.sortStage.execute({ rowNode: this.rootNode, rowNodeTransactions: rowNodeTransactions, changedPath: changedPath }); }; ClientSideRowModel.prototype.doRowGrouping = function (groupState, rowNodeTransactions, rowNodeOrder, changedPath, afterColumnsChanged) { if (this.groupStage) { if (rowNodeTransactions) { this.groupStage.execute({ rowNode: this.rootNode, rowNodeTransactions: rowNodeTransactions, rowNodeOrder: rowNodeOrder, changedPath: changedPath }); } else { this.groupStage.execute({ rowNode: this.rootNode, changedPath: changedPath, afterColumnsChanged: afterColumnsChanged }); // set open/closed state on groups this.restoreGroupState(groupState); } if (this.gridOptionsService.is('groupSelectsChildren')) { var selectionChanged = this.selectionService.updateGroupsFromChildrenSelections('rowGroupChanged', changedPath); if (selectionChanged) { var event_1 = { type: Events.EVENT_SELECTION_CHANGED, source: 'rowGroupChanged' }; this.eventService.dispatchEvent(event_1); } } } else { this.rootNode.childrenAfterGroup = this.rootNode.allLeafChildren; if (this.rootNode.sibling) { this.rootNode.sibling.childrenAfterGroup = this.rootNode.childrenAfterGroup; } this.rootNode.updateHasChildren(); } }; ClientSideRowModel.prototype.restoreGroupState = function (groupState) { if (!groupState) { return; } _.traverseNodesWithKey(this.rootNode.childrenAfterGroup, function (node, key) { // if the group was open last time, then open it this time. however // if was not open last time, then don't touch the group, so the 'groupDefaultExpanded' // setting will take effect. if (typeof groupState[key] === 'boolean') { node.expanded = groupState[key]; } }); }; ClientSideRowModel.prototype.doFilter = function (changedPath) { this.filterStage.execute({ rowNode: this.rootNode, changedPath: changedPath }); }; ClientSideRowModel.prototype.doPivot = function (changedPath) { if (this.pivotStage) { this.pivotStage.execute({ rowNode: this.rootNode, changedPath: changedPath }); } }; ClientSideRowModel.prototype.getGroupState = function () { if (!this.rootNode.childrenAfterGroup || !this.gridOptionsService.is('rememberGroupStateWhenNewData')) { return null; } var result = {}; _.traverseNodesWithKey(this.rootNode.childrenAfterGroup, function (node, key) { return result[key] = node.expanded; }); return result; }; ClientSideRowModel.prototype.getCopyOfNodesMap = function () { return this.nodeManager.getCopyOfNodesMap(); }; ClientSideRowModel.prototype.getRowNode = function (id) { // although id is typed a string, this could be called by the user, and they could have passed a number var idIsGroup = typeof id == 'string' && id.indexOf(RowNode.ID_PREFIX_ROW_GROUP) == 0; if (idIsGroup) { // only one users complained about getRowNode not working for groups, after years of // this working for normal rows. so have done quick implementation. if users complain // about performance, then GroupStage should store / manage created groups in a map, // which is a chunk of work. var res_1 = undefined; this.forEachNode(function (node) { if (node.id === id) { res_1 = node; } }); return res_1; } return this.nodeManager.getRowNode(id); }; // rows: the rows to put into the model ClientSideRowModel.prototype.setRowData = function (rowData) { // no need to invalidate cache, as the cache is stored on the rowNode, // so new rowNodes means the cache is wiped anyway. // remember group state, so we can expand groups that should be expanded var groupState = this.getGroupState(); this.nodeManager.setRowData(rowData); // - clears selection this.selectionService.reset(); // - updates filters this.filterManager.onNewRowsLoaded('rowDataUpdated'); // this event kicks off: // - shows 'no rows' overlay if needed var rowDataUpdatedEvent = { type: Events.EVENT_ROW_DATA_UPDATED }; this.eventService.dispatchEvent(rowDataUpdatedEvent); this.refreshModel({ step: exports.ClientSideRowModelSteps.EVERYTHING, groupState: groupState, newData: true }); }; ClientSideRowModel.prototype.batchUpdateRowData = function (rowDataTransaction, callback) { var _this = this; if (this.applyAsyncTransactionsTimeout == null) { this.rowDataTransactionBatch = []; var waitMillis = this.gridOptionsService.getAsyncTransactionWaitMillis(); this.applyAsyncTransactionsTimeout = window.setTimeout(function () { _this.executeBatchUpdateRowData(); }, waitMillis); } this.rowDataTransactionBatch.push({ rowDataTransaction: rowDataTransaction, callback: callback }); }; ClientSideRowModel.prototype.flushAsyncTransactions = function () { if (this.applyAsyncTransactionsTimeout != null) { clearTimeout(this.applyAsyncTransactionsTimeout); this.executeBatchUpdateRowData(); } }; ClientSideRowModel.prototype.executeBatchUpdateRowData = function () { var _this = this; this.valueCache.onDataChanged(); var callbackFuncsBound = []; var rowNodeTrans = []; // The rowGroup stage uses rowNodeOrder if order was provided. if we didn't pass 'true' to // commonUpdateRowData, using addIndex would have no effect when grouping. var forceRowNodeOrder = false; if (this.rowDataTransactionBatch) { this.rowDataTransactionBatch.forEach(function (tranItem) { var rowNodeTran = _this.nodeManager.updateRowData(tranItem.rowDataTransaction, undefined); rowNodeTrans.push(rowNodeTran); if (tranItem.callback) { callbackFuncsBound.push(tranItem.callback.bind(null, rowNodeTran)); } if (typeof tranItem.rowDataTransaction.addIndex === 'number') { forceRowNodeOrder = true; } }); } this.commonUpdateRowData(rowNodeTrans, undefined, forceRowNodeOrder); // do callbacks in next VM turn so it's async if (callbackFuncsBound.length > 0) { window.setTimeout(function () { callbackFuncsBound.forEach(function (func) { return func(); }); }, 0); } if (rowNodeTrans.length > 0) { var event_2 = { type: Events.EVENT_ASYNC_TRANSACTIONS_FLUSHED, results: rowNodeTrans }; this.eventService.dispatchEvent(event_2); } this.rowDataTransactionBatch = null; this.applyAsyncTransactionsTimeout = undefined; }; ClientSideRowModel.prototype.updateRowData = function (rowDataTran, rowNodeOrder) { this.valueCache.onDataChanged(); var rowNodeTran = this.nodeManager.updateRowData(rowDataTran, rowNodeOrder); // if doing immutableData, addIndex is never present. however if doing standard transaction, and user // provided addIndex, then this is used in updateRowData. However if doing Enterprise, then the rowGroup // stage also uses the var forceRowNodeOrder = typeof rowDataTran.addIndex === 'number'; this.commonUpdateRowData([rowNodeTran], rowNodeOrder, forceRowNodeOrder); return rowNodeTran; }; ClientSideRowModel.prototype.createRowNodeOrder = function () { var suppressSortOrder = this.gridOptionsService.is('suppressMaintainUnsortedOrder'); if (suppressSortOrder) { return; } var orderMap = {}; if (this.rootNode && this.rootNode.allLeafChildren) { for (var index = 0; index < this.rootNode.allLeafChildren.length; index++) { var node = this.rootNode.allLeafChildren[index]; orderMap[node.id] = index; } } return orderMap; }; // common to updateRowData and batchUpdateRowData ClientSideRowModel.prototype.commonUpdateRowData = function (rowNodeTrans, rowNodeOrder, forceRowNodeOrder) { var animate = !this.gridOptionsService.is('suppressAnimationFrame'); if (forceRowNodeOrder) { rowNodeOrder = this.createRowNodeOrder(); } this.refreshModel({ step: exports.ClientSideRowModelSteps.EVERYTHING, rowNodeTransactions: rowNodeTrans, rowNodeOrder: rowNodeOrder, keepRenderedRows: true, keepEditingRows: true, animate: animate }); // - updates filters this.filterManager.onNewRowsLoaded('rowDataUpdated'); var event = { type: Events.EVENT_ROW_DATA_UPDATED }; this.eventService.dispatchEvent(event); }; ClientSideRowModel.prototype.doRowsToDisplay = function () { this.rowsToDisplay = this.flattenStage.execute({ rowNode: this.rootNode }); }; ClientSideRowModel.prototype.onRowHeightChanged = function () { this.refreshModel({ step: exports.ClientSideRowModelSteps.MAP, keepRenderedRows: true, keepEditingRows: true, keepUndoRedoStack: true }); }; /** This method is debounced. It is used for row auto-height. If we don't debounce, * then the Row Models will end up recalculating each row position * for each row height change and result in the Row Renderer laying out rows. * This is particularly bad if using print layout, and showing eg 1,000 rows, * each row will change it's height, causing Row Model to update 1,000 times. */ ClientSideRowModel.prototype.onRowHeightChangedDebounced = function () { this.onRowHeightChanged_debounced(); }; ClientSideRowModel.prototype.resetRowHeights = function () { var atLeastOne = false; this.forEachNode(function (rowNode) { rowNode.setRowHeight(rowNode.rowHeight, true); // we keep the height each row is at, however we set estimated=true rather than clear the height. // this means the grid will not reset the row heights back to defaults, rather it will re-calc // the height for each row as the row is displayed. otherwise the scroll will jump when heights are reset. var detailNode = rowNode.detailNode; if (detailNode) { detailNode.setRowHeight(detailNode.rowHeight, true); } atLeastOne = true; }); // when pivotMode but pivot not active, root node is displayed on its own // because it's only ever displayed alone, refreshing the model (onRowHeightChanged) is not required this.rootNode.setRowHeight(this.rootNode.rowHeight, true); if (atLeastOne) { this.onRowHeightChanged(); } }; __decorate$2o([ Autowired('columnModel') ], ClientSideRowModel.prototype, "columnModel", void 0); __decorate$2o([ Autowired('selectionService') ], ClientSideRowModel.prototype, "selectionService", void 0); __decorate$2o([ Autowired('filterManager') ], ClientSideRowModel.prototype, "filterManager", void 0); __decorate$2o([ Autowired('valueCache') ], ClientSideRowModel.prototype, "valueCache", void 0); __decorate$2o([ Autowired('beans') ], ClientSideRowModel.prototype, "beans", void 0); __decorate$2o([ Autowired('filterStage') ], ClientSideRowModel.prototype, "filterStage", void 0); __decorate$2o([ Autowired('sortStage') ], ClientSideRowModel.prototype, "sortStage", void 0); __decorate$2o([ Autowired('flattenStage') ], ClientSideRowModel.prototype, "flattenStage", void 0); __decorate$2o([ Optional('groupStage') ], ClientSideRowModel.prototype, "groupStage", void 0); __decorate$2o([ Optional('aggregationStage') ], ClientSideRowModel.prototype, "aggregationStage", void 0); __decorate$2o([ Optional('pivotStage') ], ClientSideRowModel.prototype, "pivotStage", void 0); __decorate$2o([ Optional('filterAggregatesStage') ], ClientSideRowModel.prototype, "filterAggregatesStage", void 0); __decorate$2o([ PostConstruct ], ClientSideRowModel.prototype, "init", null); ClientSideRowModel = __decorate$2o([ Bean('rowModel') ], ClientSideRowModel); return ClientSideRowModel; }(BeanStub)); var __extends$2H = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __decorate$2p = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var FilterStage = /** @class */ (function (_super) { __extends$2H(FilterStage, _super); function FilterStage() { return _super !== null && _super.apply(this, arguments) || this; } FilterStage.prototype.execute = function (params) { var changedPath = params.changedPath; this.filterService.filter(changedPath); }; __decorate$2p([ Autowired('filterService') ], FilterStage.prototype, "filterService", void 0); FilterStage = __decorate$2p([ Bean('filterStage') ], FilterStage); return FilterStage; }(BeanStub)); var __extends$2I = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __decorate$2q = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var SortStage = /** @class */ (function (_super) { __extends$2I(SortStage, _super); function SortStage() { return _super !== null && _super.apply(this, arguments) || this; } SortStage.prototype.execute = function (params) { var _this = this; var sortOptions = this.sortController.getSortOptions(); var sortActive = _.exists(sortOptions) && sortOptions.length > 0; var deltaSort = sortActive && _.exists(params.rowNodeTransactions) // in time we can remove this check, so that delta sort is always // on if transactions are present. it's off for now so that we can // selectively turn it on and test it with some select users before // rolling out to everyone. && this.gridOptionsService.is('deltaSort'); var sortContainsGroupColumns = sortOptions.some(function (opt) { return !!_this.columnModel.getGroupDisplayColumnForGroup(opt.column.getId()); }); this.sortService.sort(sortOptions, sortActive, deltaSort, params.rowNodeTransactions, params.changedPath, sortContainsGroupColumns); }; __decorate$2q([ Autowired('sortService') ], SortStage.prototype, "sortService", void 0); __decorate$2q([ Autowired('sortController') ], SortStage.prototype, "sortController", void 0); __decorate$2q([ Autowired('columnModel') ], SortStage.prototype, "columnModel", void 0); SortStage = __decorate$2q([ Bean('sortStage') ], SortStage); return SortStage; }(BeanStub)); var __extends$2J = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __decorate$2r = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var FlattenStage = /** @class */ (function (_super) { __extends$2J(FlattenStage, _super); function FlattenStage() { return _super !== null && _super.apply(this, arguments) || this; } FlattenStage.prototype.execute = function (params) { var rootNode = params.rowNode; // even if not doing grouping, we do the mapping, as the client might // of passed in data that already has a grouping in it somewhere var result = []; // putting value into a wrapper so it's passed by reference var nextRowTop = { value: 0 }; var skipLeafNodes = this.columnModel.isPivotMode(); // if we are reducing, and not grouping, then we want to show the root node, as that // is where the pivot values are var showRootNode = skipLeafNodes && rootNode.leafGroup; var topList = showRootNode ? [rootNode] : rootNode.childrenAfterSort; this.recursivelyAddToRowsToDisplay(topList, result, nextRowTop, skipLeafNodes, 0); // we do not want the footer total if the gris is empty var atLeastOneRowPresent = result.length > 0; var includeGroupTotalFooter = !showRootNode // don't show total footer when showRootNode is true (i.e. in pivot mode and no groups) && atLeastOneRowPresent && this.gridOptionsService.is('groupIncludeTotalFooter'); if (includeGroupTotalFooter) { rootNode.createFooter(); this.addRowNodeToRowsToDisplay(rootNode.sibling, result, nextRowTop, 0); } return result; }; FlattenStage.prototype.recursivelyAddToRowsToDisplay = function (rowsToFlatten, result, nextRowTop, skipLeafNodes, uiLevel) { if (_.missingOrEmpty(rowsToFlatten)) { return; } var hideOpenParents = this.gridOptionsService.is('groupHideOpenParents'); // these two are mutually exclusive, so if first set, we don't set the second var groupRemoveSingleChildren = this.gridOptionsService.is('groupRemoveSingleChildren'); var groupRemoveLowestSingleChildren = !groupRemoveSingleChildren && this.gridOptionsService.is('groupRemoveLowestSingleChildren'); for (var i = 0; i < rowsToFlatten.length; i++) { var rowNode = rowsToFlatten[i]; // check all these cases, for working out if this row should be included in the final mapped list var isParent = rowNode.hasChildren(); var isSkippedLeafNode = skipLeafNodes && !isParent; var isRemovedSingleChildrenGroup = groupRemoveSingleChildren && isParent && rowNode.childrenAfterGroup.length === 1; var isRemovedLowestSingleChildrenGroup = groupRemoveLowestSingleChildren && isParent && rowNode.leafGroup && rowNode.childrenAfterGroup.length === 1; // hide open parents means when group is open, we don't show it. we also need to make sure the // group is expandable in the first place (as leaf groups are not expandable if pivot mode is on). // the UI will never allow expanding leaf groups, however the user might via the API (or menu option 'expand all') var neverAllowToExpand = skipLeafNodes && rowNode.leafGroup; var isHiddenOpenParent = hideOpenParents && rowNode.expanded && !rowNode.master && (!neverAllowToExpand); var thisRowShouldBeRendered = !isSkippedLeafNode && !isHiddenOpenParent && !isRemovedSingleChildrenGroup && !isRemovedLowestSingleChildrenGroup; if (thisRowShouldBeRendered) { this.addRowNodeToRowsToDisplay(rowNode, result, nextRowTop, uiLevel); } // if we are pivoting, we never map below the leaf group if (skipLeafNodes && rowNode.leafGroup) { continue; } if (isParent) { var excludedParent = isRemovedSingleChildrenGroup || isRemovedLowestSingleChildrenGroup; // we traverse the group if it is expended, however we always traverse if the parent node // was removed (as the group will never be opened if it is not displayed, we show the children instead) if (rowNode.expanded || excludedParent) { // if the parent was excluded, then ui level is that of the parent var uiLevelForChildren = excludedParent ? uiLevel : uiLevel + 1; this.recursivelyAddToRowsToDisplay(rowNode.childrenAfterSort, result, nextRowTop, skipLeafNodes, uiLevelForChildren); // put a footer in if user is looking for it if (this.gridOptionsService.is('groupIncludeFooter')) { this.addRowNodeToRowsToDisplay(rowNode.sibling, result, nextRowTop, uiLevel); } } } else if (rowNode.master && rowNode.expanded) { var detailNode = this.createDetailNode(rowNode); this.addRowNodeToRowsToDisplay(detailNode, result, nextRowTop, uiLevel); } } }; // duplicated method, it's also in floatingRowModel FlattenStage.prototype.addRowNodeToRowsToDisplay = function (rowNode, result, nextRowTop, uiLevel) { var isGroupMultiAutoColumn = this.gridOptionsService.isGroupMultiAutoColumn(); result.push(rowNode); rowNode.setUiLevel(isGroupMultiAutoColumn ? 0 : uiLevel); }; FlattenStage.prototype.createDetailNode = function (masterNode) { if (_.exists(masterNode.detailNode)) { return masterNode.detailNode; } var detailNode = new RowNode(this.beans); detailNode.detail = true; detailNode.selectable = false; detailNode.parent = masterNode; if (_.exists(masterNode.id)) { detailNode.id = 'detail_' + masterNode.id; } detailNode.data = masterNode.data; detailNode.level = masterNode.level + 1; masterNode.detailNode = detailNode; return detailNode; }; __decorate$2r([ Autowired('columnModel') ], FlattenStage.prototype, "columnModel", void 0); __decorate$2r([ Autowired('beans') ], FlattenStage.prototype, "beans", void 0); FlattenStage = __decorate$2r([ Bean('flattenStage') ], FlattenStage); return FlattenStage; }(BeanStub)); var __extends$2K = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __decorate$2s = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var SortService = /** @class */ (function (_super) { __extends$2K(SortService, _super); function SortService() { return _super !== null && _super.apply(this, arguments) || this; } SortService.prototype.init = function () { this.postSortFunc = this.getPostSortFunc(); }; SortService.prototype.sort = function (sortOptions, sortActive, useDeltaSort, rowNodeTransactions, changedPath, sortContainsGroupColumns) { var _this = this; var groupMaintainOrder = this.gridOptionsService.is('groupMaintainOrder'); var groupColumnsPresent = this.columnModel.getAllGridColumns().some(function (c) { return c.isRowGroupActive(); }); var allDirtyNodes = {}; if (useDeltaSort && rowNodeTransactions) { allDirtyNodes = this.calculateDirtyNodes(rowNodeTransactions); } var isPivotMode = this.columnModel.isPivotMode(); var callback = function (rowNode) { // we clear out the 'pull down open parents' first, as the values mix up the sorting _this.pullDownGroupDataForHideOpenParents(rowNode.childrenAfterAggFilter, true); // It's pointless to sort rows which aren't being displayed. in pivot mode we don't need to sort the leaf group children. var skipSortingPivotLeafs = isPivotMode && rowNode.leafGroup; // Javascript sort is non deterministic when all the array items are equals, ie Comparator always returns 0, // so to ensure the array keeps its order, add an additional sorting condition manually, in this case we // are going to inspect the original array position. This is what sortedRowNodes is for. var skipSortingGroups = groupMaintainOrder && groupColumnsPresent && !rowNode.leafGroup && !sortContainsGroupColumns; if (skipSortingGroups) { var childrenToBeSorted = rowNode.childrenAfterAggFilter.slice(0); if (rowNode.childrenAfterSort) { var indexedOrders_1 = {}; rowNode.childrenAfterSort.forEach(function (node, idx) { indexedOrders_1[node.id] = idx; }); childrenToBeSorted.sort(function (row1, row2) { var _a, _b; return ((_a = indexedOrders_1[row1.id]) !== null && _a !== void 0 ? _a : 0) - ((_b = indexedOrders_1[row2.id]) !== null && _b !== void 0 ? _b : 0); }); } rowNode.childrenAfterSort = childrenToBeSorted; } else if (!sortActive || skipSortingPivotLeafs) { // if there's no sort to make, skip this step rowNode.childrenAfterSort = rowNode.childrenAfterAggFilter.slice(0); } else if (useDeltaSort) { rowNode.childrenAfterSort = _this.doDeltaSort(rowNode, allDirtyNodes, changedPath, sortOptions); } else { rowNode.childrenAfterSort = _this.rowNodeSorter.doFullSort(rowNode.childrenAfterAggFilter, sortOptions); } if (rowNode.sibling) { rowNode.sibling.childrenAfterSort = rowNode.childrenAfterSort; } _this.updateChildIndexes(rowNode); if (_this.postSortFunc) { var params = { nodes: rowNode.childrenAfterSort }; _this.postSortFunc(params); } }; if (changedPath) { changedPath.forEachChangedNodeDepthFirst(callback); } this.updateGroupDataForHideOpenParents(changedPath); }; SortService.prototype.getPostSortFunc = function () { var postSortRows = this.gridOptionsService.getCallback('postSortRows'); if (postSortRows) { return postSortRows; } // this is the deprecated way, so provide a proxy to make it compatible var postSort = this.gridOptionsService.get('postSort'); if (postSort) { return function (params) { return postSort(params.nodes); }; } }; SortService.prototype.calculateDirtyNodes = function (rowNodeTransactions) { var dirtyNodes = {}; var addNodesFunc = function (rowNodes) { if (rowNodes) { rowNodes.forEach(function (rowNode) { return dirtyNodes[rowNode.id] = true; }); } }; // all leaf level nodes in the transaction were impacted if (rowNodeTransactions) { rowNodeTransactions.forEach(function (tran) { addNodesFunc(tran.add); addNodesFunc(tran.update); addNodesFunc(tran.remove); }); } return dirtyNodes; }; SortService.prototype.doDeltaSort = function (rowNode, allTouchedNodes, changedPath, sortOptions) { var _this = this; var unsortedRows = rowNode.childrenAfterAggFilter; var oldSortedRows = rowNode.childrenAfterSort; if (!oldSortedRows) { return this.rowNodeSorter.doFullSort(unsortedRows, sortOptions); } var untouchedRowsMap = {}; var touchedRows = []; unsortedRows.forEach(function (row) { if (allTouchedNodes[row.id] || !changedPath.canSkip(row)) { touchedRows.push(row); } else { untouchedRowsMap[row.id] = true; } }); var sortedUntouchedRows = oldSortedRows.filter(function (child) { return untouchedRowsMap[child.id]; }); var mapNodeToSortedNode = function (rowNode, pos) { return ({ currentPos: pos, rowNode: rowNode }); }; var sortedChangedRows = touchedRows .map(mapNodeToSortedNode) .sort(function (a, b) { return _this.rowNodeSorter.compareRowNodes(sortOptions, a, b); }); return this.mergeSortedArrays(sortOptions, sortedChangedRows, sortedUntouchedRows.map(mapNodeToSortedNode)).map(function (_a) { var rowNode = _a.rowNode; return rowNode; }); }; // Merge two sorted arrays into each other SortService.prototype.mergeSortedArrays = function (sortOptions, arr1, arr2) { var res = []; var i = 0; var j = 0; // Traverse both array, adding them in order while (i < arr1.length && j < arr2.length) { // Check if current element of first // array is smaller than current element // of second array. If yes, store first // array element and increment first array // index. Otherwise do same with second array var compareResult = this.rowNodeSorter.compareRowNodes(sortOptions, arr1[i], arr2[j]); if (compareResult < 0) { res.push(arr1[i++]); } else { res.push(arr2[j++]); } } // add remaining from arr1 while (i < arr1.length) { res.push(arr1[i++]); } // add remaining from arr2 while (j < arr2.length) { res.push(arr2[j++]); } return res; }; SortService.prototype.updateChildIndexes = function (rowNode) { if (_.missing(rowNode.childrenAfterSort)) { return; } var listToSort = rowNode.childrenAfterSort; for (var i = 0; i < listToSort.length; i++) { var child = listToSort[i]; var firstChild = i === 0; var lastChild = i === rowNode.childrenAfterSort.length - 1; child.setFirstChild(firstChild); child.setLastChild(lastChild); child.setChildIndex(i); } }; SortService.prototype.updateGroupDataForHideOpenParents = function (changedPath) { var _this = this; if (!this.gridOptionsService.is('groupHideOpenParents')) { return; } if (this.gridOptionsService.isTreeData()) { var msg_1 = "AG Grid: The property hideOpenParents dose not work with Tree Data. This is because Tree Data has values at the group level, it doesn't make sense to hide them (as opposed to Row Grouping, which only has Aggregated Values at the group level)."; _.doOnce(function () { return console.warn(msg_1); }, 'sortService.hideOpenParentsWithTreeData'); return false; } // recurse breadth first over group nodes after sort to 'pull down' group data to child groups var callback = function (rowNode) { _this.pullDownGroupDataForHideOpenParents(rowNode.childrenAfterSort, false); rowNode.childrenAfterSort.forEach(function (child) { if (child.hasChildren()) { callback(child); } }); }; if (changedPath) { changedPath.executeFromRootNode(function (rowNode) { return callback(rowNode); }); } }; SortService.prototype.pullDownGroupDataForHideOpenParents = function (rowNodes, clearOperation) { var _this = this; if (!this.gridOptionsService.is('groupHideOpenParents') || _.missing(rowNodes)) { return; } rowNodes.forEach(function (childRowNode) { var groupDisplayCols = _this.columnModel.getGroupDisplayColumns(); groupDisplayCols.forEach(function (groupDisplayCol) { var showRowGroup = groupDisplayCol.getColDef().showRowGroup; if (typeof showRowGroup !== 'string') { console.error('AG Grid: groupHideOpenParents only works when specifying specific columns for colDef.showRowGroup'); return; } var displayingGroupKey = showRowGroup; var rowGroupColumn = _this.columnModel.getPrimaryColumn(displayingGroupKey); var thisRowNodeMatches = rowGroupColumn === childRowNode.rowGroupColumn; if (thisRowNodeMatches) { return; } if (clearOperation) { // if doing a clear operation, we clear down the value for every possible group column childRowNode.setGroupValue(groupDisplayCol.getId(), undefined); } else { // if doing a set operation, we set only where the pull down is to occur var parentToStealFrom = childRowNode.getFirstChildOfFirstChild(rowGroupColumn); if (parentToStealFrom) { childRowNode.setGroupValue(groupDisplayCol.getId(), parentToStealFrom.key); } } }); }); }; __decorate$2s([ Autowired('columnModel') ], SortService.prototype, "columnModel", void 0); __decorate$2s([ Autowired('rowNodeSorter') ], SortService.prototype, "rowNodeSorter", void 0); __decorate$2s([ PostConstruct ], SortService.prototype, "init", null); SortService = __decorate$2s([ Bean('sortService') ], SortService); return SortService; }(BeanStub)); var __extends$2L = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __decorate$2t = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var FilterService = /** @class */ (function (_super) { __extends$2L(FilterService, _super); function FilterService() { return _super !== null && _super.apply(this, arguments) || this; } FilterService.prototype.filter = function (changedPath) { var filterActive = this.filterManager.isColumnFilterPresent() || this.filterManager.isQuickFilterPresent() || this.filterManager.isExternalFilterPresent(); this.filterNodes(filterActive, changedPath); }; FilterService.prototype.filterNodes = function (filterActive, changedPath) { var _this = this; var filterCallback = function (rowNode, includeChildNodes) { // recursively get all children that are groups to also filter if (rowNode.hasChildren()) { // result of filter for this node. when filtering tree data, includeChildNodes = true when parent passes if (filterActive && !includeChildNodes) { rowNode.childrenAfterFilter = rowNode.childrenAfterGroup.filter(function (childNode) { // a group is included in the result if it has any children of it's own. // by this stage, the child groups are already filtered var passBecauseChildren = childNode.childrenAfterFilter && childNode.childrenAfterFilter.length > 0; // both leaf level nodes and tree data nodes have data. these get added if // the data passes the filter var passBecauseDataPasses = childNode.data && _this.filterManager.doesRowPassFilter({ rowNode: childNode }); // note - tree data nodes pass either if a) they pass themselves or b) any children of that node pass return passBecauseChildren || passBecauseDataPasses; }); } else { // if not filtering, the result is the original list rowNode.childrenAfterFilter = rowNode.childrenAfterGroup; } } else { rowNode.childrenAfterFilter = rowNode.childrenAfterGroup; } if (rowNode.sibling) { rowNode.sibling.childrenAfterFilter = rowNode.childrenAfterFilter; } }; if (this.doingTreeDataFiltering()) { var treeDataDepthFirstFilter_1 = function (rowNode, alreadyFoundInParent) { // tree data filter traverses the hierarchy depth first and includes child nodes if parent passes // filter, and parent nodes will be include if any children exist. if (rowNode.childrenAfterGroup) { for (var i = 0; i < rowNode.childrenAfterGroup.length; i++) { var childNode = rowNode.childrenAfterGroup[i]; // first check if current node passes filter before invoking child nodes var foundInParent = alreadyFoundInParent || _this.filterManager.doesRowPassFilter({ rowNode: childNode }); if (childNode.childrenAfterGroup) { treeDataDepthFirstFilter_1(rowNode.childrenAfterGroup[i], foundInParent); } else { filterCallback(childNode, foundInParent); } } } filterCallback(rowNode, alreadyFoundInParent); }; var treeDataFilterCallback = function (rowNode) { return treeDataDepthFirstFilter_1(rowNode, false); }; changedPath.executeFromRootNode(treeDataFilterCallback); } else { var defaultFilterCallback = function (rowNode) { return filterCallback(rowNode, false); }; changedPath.forEachChangedNodeDepthFirst(defaultFilterCallback, true); } }; FilterService.prototype.doingTreeDataFiltering = function () { return this.gridOptionsService.isTreeData() && !this.gridOptionsService.is('excludeChildrenWhenTreeDataFiltering'); }; __decorate$2t([ Autowired('filterManager') ], FilterService.prototype, "filterManager", void 0); FilterService = __decorate$2t([ Bean("filterService") ], FilterService); return FilterService; }(BeanStub)); var __extends$2M = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __decorate$2u = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var __read$v = (undefined && undefined.__read) || function (o, n) { var m = typeof Symbol === "function" && o[Symbol.iterator]; if (!m) return o; var i = m.call(o), r, ar = [], e; try { while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); } catch (error) { e = { error: error }; } finally { try { if (r && !r.done && (m = i["return"])) m.call(i); } finally { if (e) throw e.error; } } return ar; }; var ImmutableService = /** @class */ (function (_super) { __extends$2M(ImmutableService, _super); function ImmutableService() { return _super !== null && _super.apply(this, arguments) || this; } ImmutableService.prototype.postConstruct = function () { if (this.rowModel.getType() === 'clientSide') { this.clientSideRowModel = this.rowModel; } }; ImmutableService.prototype.isActive = function () { // we used to have a property immutableData for this. however this was deprecated // in favour of having Immutable Data on by default when getRowId is provided var getRowIdProvided = this.gridOptionsService.exists('getRowId'); var immutableData = this.gridOptionsService.is('immutableData'); // this property is a backwards compatibility property, for those who want // the old behaviour of Row ID's but NOT Immutable Data. var resetRowDataOnUpdate = this.gridOptionsService.is('resetRowDataOnUpdate'); if (resetRowDataOnUpdate) { return false; } return getRowIdProvided || immutableData; }; ImmutableService.prototype.setRowData = function (rowData) { var transactionAndMap = this.createTransactionForRowData(rowData); if (!transactionAndMap) { return; } var _a = __read$v(transactionAndMap, 2), transaction = _a[0], orderIdMap = _a[1]; var nodeTransaction = this.clientSideRowModel.updateRowData(transaction, orderIdMap); // need to force updating of full width rows - note this wouldn't be necessary the full width cell comp listened // to the data change event on the row node and refreshed itself. if (nodeTransaction) { this.rowRenderer.refreshFullWidthRows(nodeTransaction.update); } }; // converts the setRowData() command to a transaction ImmutableService.prototype.createTransactionForRowData = function (rowData) { if (_.missing(this.clientSideRowModel)) { console.error('AG Grid: ImmutableService only works with ClientSideRowModel'); return; } var getRowIdFunc = this.gridOptionsService.getRowIdFunc(); if (getRowIdFunc == null) { console.error('AG Grid: ImmutableService requires getRowId() callback to be implemented, your row data needs IDs!'); return; } // convert the data into a transaction object by working out adds, removes and updates var transaction = { remove: [], update: [], add: [] }; var existingNodesMap = this.clientSideRowModel.getCopyOfNodesMap(); var suppressSortOrder = this.gridOptionsService.is('suppressMaintainUnsortedOrder'); var orderMap = suppressSortOrder ? undefined : {}; if (_.exists(rowData)) { // split all the new data in the following: // if new, push to 'add' // if update, push to 'update' // if not changed, do not include in the transaction rowData.forEach(function (data, index) { var id = getRowIdFunc({ data: data, level: 0 }); var existingNode = existingNodesMap[id]; if (orderMap) { orderMap[id] = index; } if (existingNode) { var dataHasChanged = existingNode.data !== data; if (dataHasChanged) { transaction.update.push(data); } // otherwise, if data not changed, we just don't include it anywhere, as it's not a delta // remove from list, so we know the item is not to be removed existingNodesMap[id] = undefined; } else { transaction.add.push(data); } }); } // at this point, all rows that are left, should be removed _.iterateObject(existingNodesMap, function (id, rowNode) { if (rowNode) { transaction.remove.push(rowNode.data); } }); return [transaction, orderMap]; }; __decorate$2u([ Autowired('rowModel') ], ImmutableService.prototype, "rowModel", void 0); __decorate$2u([ Autowired('rowRenderer') ], ImmutableService.prototype, "rowRenderer", void 0); __decorate$2u([ PostConstruct ], ImmutableService.prototype, "postConstruct", null); ImmutableService = __decorate$2u([ Bean('immutableService') ], ImmutableService); return ImmutableService; }(BeanStub)); // DO NOT UPDATE MANUALLY: Generated from script during build time var VERSION = '29.2.0'; var ClientSideRowModelModule = { version: VERSION, moduleName: exports.ModuleNames.ClientSideRowModelModule, rowModel: 'clientSide', beans: [ClientSideRowModel, FilterStage, SortStage, FlattenStage, SortService, FilterService, ImmutableService], }; var __extends$2N = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __decorate$2v = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var InfiniteBlock = /** @class */ (function (_super) { __extends$2N(InfiniteBlock, _super); function InfiniteBlock(id, parentCache, params) { var _this = _super.call(this, id) || this; _this.parentCache = parentCache; _this.params = params; // we don't need to calculate these now, as the inputs don't change, // however it makes the code easier to read if we work them out up front _this.startRow = id * params.blockSize; _this.endRow = _this.startRow + params.blockSize; return _this; } InfiniteBlock.prototype.postConstruct = function () { this.createRowNodes(); }; InfiniteBlock.prototype.getBlockStateJson = function () { return { id: '' + this.getId(), state: { blockNumber: this.getId(), startRow: this.getStartRow(), endRow: this.getEndRow(), pageStatus: this.getState() } }; }; InfiniteBlock.prototype.setDataAndId = function (rowNode, data, index) { // if there's no id and the rowNode was rendered before, it means this // was a placeholder rowNode and should not be recycled. Setting // `alreadyRendered` to `false` forces the rowRenderer to flush it. if (!rowNode.id && rowNode.alreadyRendered) { rowNode.alreadyRendered = false; } if (_.exists(data)) { // this means if the user is not providing id's we just use the // index for the row. this will allow selection to work (that is based // on index) as long user is not inserting or deleting rows, // or wanting to keep selection between server side sorting or filtering rowNode.setDataAndId(data, index.toString()); } else { rowNode.setDataAndId(undefined, undefined); } }; InfiniteBlock.prototype.loadFromDatasource = function () { var _this = this; var params = this.createLoadParams(); if (_.missing(this.params.datasource.getRows)) { console.warn("AG Grid: datasource is missing getRows method"); return; } // put in timeout, to force result to be async window.setTimeout(function () { _this.params.datasource.getRows(params); }, 0); }; InfiniteBlock.prototype.processServerFail = function () { // todo - this method has better handling in SSRM }; InfiniteBlock.prototype.createLoadParams = function () { // PROBLEM . . . . when the user sets sort via colDef.sort, then this code // is executing before the sort is set up, so server is not getting the sort // model. need to change with regards order - so the server side request is // AFTER thus it gets the right sort model. var params = { startRow: this.getStartRow(), endRow: this.getEndRow(), successCallback: this.pageLoaded.bind(this, this.getVersion()), failCallback: this.pageLoadFailed.bind(this, this.getVersion()), sortModel: this.params.sortModel, filterModel: this.params.filterModel, context: this.gridOptionsService.context }; return params; }; InfiniteBlock.prototype.forEachNode = function (callback, sequence, rowCount) { var _this = this; this.rowNodes.forEach(function (rowNode, index) { var rowIndex = _this.startRow + index; if (rowIndex < rowCount) { callback(rowNode, sequence.next()); } }); }; InfiniteBlock.prototype.getLastAccessed = function () { return this.lastAccessed; }; InfiniteBlock.prototype.getRow = function (rowIndex, dontTouchLastAccessed) { if (dontTouchLastAccessed === void 0) { dontTouchLastAccessed = false; } if (!dontTouchLastAccessed) { this.lastAccessed = this.params.lastAccessedSequence.next(); } var localIndex = rowIndex - this.startRow; return this.rowNodes[localIndex]; }; InfiniteBlock.prototype.getStartRow = function () { return this.startRow; }; InfiniteBlock.prototype.getEndRow = function () { return this.endRow; }; // creates empty row nodes, data is missing as not loaded yet InfiniteBlock.prototype.createRowNodes = function () { this.rowNodes = []; for (var i = 0; i < this.params.blockSize; i++) { var rowIndex = this.startRow + i; var rowNode = new RowNode(this.beans); rowNode.setRowHeight(this.params.rowHeight); rowNode.uiLevel = 0; rowNode.setRowIndex(rowIndex); rowNode.setRowTop(this.params.rowHeight * rowIndex); this.rowNodes.push(rowNode); } }; InfiniteBlock.prototype.processServerResult = function (params) { var _this = this; this.rowNodes.forEach(function (rowNode, index) { var data = params.rowData ? params.rowData[index] : undefined; _this.setDataAndId(rowNode, data, _this.startRow + index); }); var finalRowCount = params.rowCount != null && params.rowCount >= 0 ? params.rowCount : undefined; this.parentCache.pageLoaded(this, finalRowCount); }; InfiniteBlock.prototype.destroyRowNodes = function () { this.rowNodes.forEach(function (rowNode) { // this is needed, so row render knows to fade out the row, otherwise it // sees row top is present, and thinks the row should be shown. rowNode.clearRowTopAndRowIndex(); }); }; __decorate$2v([ Autowired('beans') ], InfiniteBlock.prototype, "beans", void 0); __decorate$2v([ PostConstruct ], InfiniteBlock.prototype, "postConstruct", null); __decorate$2v([ PreDestroy ], InfiniteBlock.prototype, "destroyRowNodes", null); return InfiniteBlock; }(RowNodeBlock)); var __extends$2O = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __decorate$2w = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var __param$a = (undefined && undefined.__param) || function (paramIndex, decorator) { return function (target, key) { decorator(target, key, paramIndex); } }; var InfiniteCache = /** @class */ (function (_super) { __extends$2O(InfiniteCache, _super); function InfiniteCache(params) { var _this = _super.call(this) || this; _this.lastRowIndexKnown = false; _this.blocks = {}; _this.blockCount = 0; _this.rowCount = params.initialRowCount; _this.params = params; return _this; } InfiniteCache.prototype.setBeans = function (loggerFactory) { this.logger = loggerFactory.create('InfiniteCache'); }; // the rowRenderer will not pass dontCreatePage, meaning when rendering the grid, // it will want new pages in the cache as it asks for rows. only when we are inserting / // removing rows via the api is dontCreatePage set, where we move rows between the pages. InfiniteCache.prototype.getRow = function (rowIndex, dontCreatePage) { if (dontCreatePage === void 0) { dontCreatePage = false; } var blockId = Math.floor(rowIndex / this.params.blockSize); var block = this.blocks[blockId]; if (!block) { if (dontCreatePage) { return undefined; } block = this.createBlock(blockId); } return block.getRow(rowIndex); }; InfiniteCache.prototype.createBlock = function (blockNumber) { var newBlock = this.createBean(new InfiniteBlock(blockNumber, this, this.params)); this.blocks[newBlock.getId()] = newBlock; this.blockCount++; this.purgeBlocksIfNeeded(newBlock); this.params.rowNodeBlockLoader.addBlock(newBlock); return newBlock; }; // we have this on infinite row model only, not server side row model, // because for server side, it would leave the children in inconsistent // state - eg if a node had children, but after the refresh it had data // for a different row, then the children would be with the wrong row node. InfiniteCache.prototype.refreshCache = function () { var nothingToRefresh = this.blockCount == 0; if (nothingToRefresh) { this.purgeCache(); return; } this.getBlocksInOrder().forEach(function (block) { return block.setStateWaitingToLoad(); }); this.params.rowNodeBlockLoader.checkBlockToLoad(); }; InfiniteCache.prototype.destroyAllBlocks = function () { var _this = this; this.getBlocksInOrder().forEach(function (block) { return _this.destroyBlock(block); }); }; InfiniteCache.prototype.getRowCount = function () { return this.rowCount; }; InfiniteCache.prototype.isLastRowIndexKnown = function () { return this.lastRowIndexKnown; }; // block calls this, when page loaded InfiniteCache.prototype.pageLoaded = function (block, lastRow) { // if we are not active, then we ignore all events, otherwise we could end up getting the // grid to refresh even though we are no longer the active cache if (!this.isAlive()) { return; } this.logger.log("onPageLoaded: page = " + block.getId() + ", lastRow = " + lastRow); this.checkRowCount(block, lastRow); // we fire cacheUpdated even if the row count has not changed, as some items need updating even // if no new rows to render. for example the pagination panel has '?' as the total rows when loading // is underway, which would need to get updated when loading finishes. this.onCacheUpdated(); }; InfiniteCache.prototype.purgeBlocksIfNeeded = function (blockToExclude) { var _this = this; // we exclude checking for the page just created, as this has yet to be accessed and hence // the lastAccessed stamp will not be updated for the first time yet var blocksForPurging = this.getBlocksInOrder().filter(function (b) { return b != blockToExclude; }); var lastAccessedComparator = function (a, b) { return b.getLastAccessed() - a.getLastAccessed(); }; blocksForPurging.sort(lastAccessedComparator); // we remove (maxBlocksInCache - 1) as we already excluded the 'just created' page. // in other words, after the splice operation below, we have taken out the blocks // we want to keep, which means we are left with blocks that we can potentially purge var maxBlocksProvided = this.params.maxBlocksInCache > 0; var blocksToKeep = maxBlocksProvided ? this.params.maxBlocksInCache - 1 : null; var emptyBlocksToKeep = InfiniteCache.MAX_EMPTY_BLOCKS_TO_KEEP - 1; blocksForPurging.forEach(function (block, index) { var purgeBecauseBlockEmpty = block.getState() === InfiniteBlock.STATE_WAITING_TO_LOAD && index >= emptyBlocksToKeep; var purgeBecauseCacheFull = maxBlocksProvided ? index >= blocksToKeep : false; if (purgeBecauseBlockEmpty || purgeBecauseCacheFull) { // if the block currently has rows been displayed, then don't remove it either. // this can happen if user has maxBlocks=2, and blockSize=5 (thus 10 max rows in cache) // but the screen is showing 20 rows, so at least 4 blocks are needed. if (_this.isBlockCurrentlyDisplayed(block)) { return; } // don't want to loose keyboard focus, so keyboard navigation can continue. so keep focused blocks. if (_this.isBlockFocused(block)) { return; } // at this point, block is not needed, so burn baby burn _this.removeBlockFromCache(block); } }); }; InfiniteCache.prototype.isBlockFocused = function (block) { var focusedCell = this.focusService.getFocusCellToUseAfterRefresh(); if (!focusedCell) { return false; } if (focusedCell.rowPinned != null) { return false; } var blockIndexStart = block.getStartRow(); var blockIndexEnd = block.getEndRow(); var hasFocus = focusedCell.rowIndex >= blockIndexStart && focusedCell.rowIndex < blockIndexEnd; return hasFocus; }; InfiniteCache.prototype.isBlockCurrentlyDisplayed = function (block) { var startIndex = block.getStartRow(); var endIndex = block.getEndRow() - 1; return this.rowRenderer.isRangeInRenderedViewport(startIndex, endIndex); }; InfiniteCache.prototype.removeBlockFromCache = function (blockToRemove) { if (!blockToRemove) { return; } this.destroyBlock(blockToRemove); // we do not want to remove the 'loaded' event listener, as the // concurrent loads count needs to be updated when the load is complete // if the purged page is in loading state }; InfiniteCache.prototype.checkRowCount = function (block, lastRow) { // if client provided a last row, we always use it, as it could change between server calls // if user deleted data and then called refresh on the grid. if (typeof lastRow === 'number' && lastRow >= 0) { this.rowCount = lastRow; this.lastRowIndexKnown = true; } else if (!this.lastRowIndexKnown) { // otherwise, see if we need to add some virtual rows var lastRowIndex = (block.getId() + 1) * this.params.blockSize; var lastRowIndexPlusOverflow = lastRowIndex + this.params.overflowSize; if (this.rowCount < lastRowIndexPlusOverflow) { this.rowCount = lastRowIndexPlusOverflow; } } }; InfiniteCache.prototype.setRowCount = function (rowCount, lastRowIndexKnown) { this.rowCount = rowCount; // if undefined is passed, we do not set this value, if one of {true,false} // is passed, we do set the value. if (_.exists(lastRowIndexKnown)) { this.lastRowIndexKnown = lastRowIndexKnown; } // if we are still searching, then the row count must not end at the end // of a particular page, otherwise the searching will not pop into the // next page if (!this.lastRowIndexKnown) { if (this.rowCount % this.params.blockSize === 0) { this.rowCount++; } } this.onCacheUpdated(); }; InfiniteCache.prototype.forEachNodeDeep = function (callback) { var _this = this; var sequence = new NumberSequence(); this.getBlocksInOrder().forEach(function (block) { return block.forEachNode(callback, sequence, _this.rowCount); }); }; InfiniteCache.prototype.getBlocksInOrder = function () { // get all page id's as NUMBERS (not strings, as we need to sort as numbers) and in descending order var blockComparator = function (a, b) { return a.getId() - b.getId(); }; var blocks = _.getAllValuesInObject(this.blocks).sort(blockComparator); return blocks; }; InfiniteCache.prototype.destroyBlock = function (block) { delete this.blocks[block.getId()]; this.destroyBean(block); this.blockCount--; this.params.rowNodeBlockLoader.removeBlock(block); }; // gets called 1) row count changed 2) cache purged 3) items inserted InfiniteCache.prototype.onCacheUpdated = function () { if (this.isAlive()) { // if the virtualRowCount is shortened, then it's possible blocks exist that are no longer // in the valid range. so we must remove these. this can happen if user explicitly sets // the virtual row count, or the datasource returns a result and sets lastRow to something // less than virtualRowCount (can happen if user scrolls down, server reduces dataset size). this.destroyAllBlocksPastVirtualRowCount(); // this results in both row models (infinite and server side) firing ModelUpdated, // however server side row model also updates the row indexes first var event_1 = { type: Events.EVENT_STORE_UPDATED }; this.eventService.dispatchEvent(event_1); } }; InfiniteCache.prototype.destroyAllBlocksPastVirtualRowCount = function () { var _this = this; var blocksToDestroy = []; this.getBlocksInOrder().forEach(function (block) { var startRow = block.getId() * _this.params.blockSize; if (startRow >= _this.rowCount) { blocksToDestroy.push(block); } }); if (blocksToDestroy.length > 0) { blocksToDestroy.forEach(function (block) { return _this.destroyBlock(block); }); } }; InfiniteCache.prototype.purgeCache = function () { var _this = this; this.getBlocksInOrder().forEach(function (block) { return _this.removeBlockFromCache(block); }); this.lastRowIndexKnown = false; // if zero rows in the cache, we need to get the SSRM to start asking for rows again. // otherwise if set to zero rows last time, and we don't update the row count, then after // the purge there will still be zero rows, meaning the SSRM won't request any rows. // to kick things off, at least one row needs to be asked for. if (this.rowCount === 0) { this.rowCount = this.params.initialRowCount; } this.onCacheUpdated(); }; InfiniteCache.prototype.getRowNodesInRange = function (firstInRange, lastInRange) { var _this = this; var result = []; var lastBlockId = -1; var inActiveRange = false; var numberSequence = new NumberSequence(); // if only one node passed, we start the selection at the top if (_.missing(firstInRange)) { inActiveRange = true; } var foundGapInSelection = false; this.getBlocksInOrder().forEach(function (block) { if (foundGapInSelection) { return; } if (inActiveRange && (lastBlockId + 1 !== block.getId())) { foundGapInSelection = true; return; } lastBlockId = block.getId(); block.forEachNode(function (rowNode) { var hitFirstOrLast = rowNode === firstInRange || rowNode === lastInRange; if (inActiveRange || hitFirstOrLast) { result.push(rowNode); } if (hitFirstOrLast) { inActiveRange = !inActiveRange; } }, numberSequence, _this.rowCount); }); // inActiveRange will be still true if we never hit the second rowNode var invalidRange = foundGapInSelection || inActiveRange; return invalidRange ? [] : result; }; // this property says how many empty blocks should be in a cache, eg if scrolls down fast and creates 10 // blocks all for loading, the grid will only load the last 2 - it will assume the blocks the user quickly // scrolled over are not needed to be loaded. InfiniteCache.MAX_EMPTY_BLOCKS_TO_KEEP = 2; __decorate$2w([ Autowired('rowRenderer') ], InfiniteCache.prototype, "rowRenderer", void 0); __decorate$2w([ Autowired("focusService") ], InfiniteCache.prototype, "focusService", void 0); __decorate$2w([ __param$a(0, Qualifier('loggerFactory')) ], InfiniteCache.prototype, "setBeans", null); __decorate$2w([ PreDestroy ], InfiniteCache.prototype, "destroyAllBlocks", null); return InfiniteCache; }(BeanStub)); var __extends$2P = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __decorate$2x = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var InfiniteRowModel = /** @class */ (function (_super) { __extends$2P(InfiniteRowModel, _super); function InfiniteRowModel() { return _super !== null && _super.apply(this, arguments) || this; } InfiniteRowModel.prototype.getRowBounds = function (index) { return { rowHeight: this.rowHeight, rowTop: this.rowHeight * index }; }; // we don't implement as lazy row heights is not supported in this row model InfiniteRowModel.prototype.ensureRowHeightsValid = function (startPixel, endPixel, startLimitIndex, endLimitIndex) { return false; }; InfiniteRowModel.prototype.init = function () { var _this = this; if (!this.gridOptionsService.isRowModelType('infinite')) { return; } this.rowHeight = this.gridOptionsService.getRowHeightAsNumber(); this.addEventListeners(); this.addDestroyFunc(function () { return _this.destroyCache(); }); this.verifyProps(); }; InfiniteRowModel.prototype.verifyProps = function () { if (this.gridOptionsService.exists('initialGroupOrderComparator') || this.gridOptionsService.exists('defaultGroupOrderComparator')) { var message_1 = "AG Grid: initialGroupOrderComparator cannot be used with Infinite Row Model. If using Infinite Row Model, then sorting is done on the server side, nothing to do with the client."; _.doOnce(function () { return console.warn(message_1); }, 'IRM.InitialGroupOrderComparator'); } }; InfiniteRowModel.prototype.start = function () { this.setDatasource(this.gridOptionsService.get('datasource')); }; InfiniteRowModel.prototype.destroyDatasource = function () { if (this.datasource) { this.getContext().destroyBean(this.datasource); this.rowRenderer.datasourceChanged(); this.datasource = null; } }; InfiniteRowModel.prototype.addEventListeners = function () { this.addManagedListener(this.eventService, Events.EVENT_FILTER_CHANGED, this.onFilterChanged.bind(this)); this.addManagedListener(this.eventService, Events.EVENT_SORT_CHANGED, this.onSortChanged.bind(this)); this.addManagedListener(this.eventService, Events.EVENT_NEW_COLUMNS_LOADED, this.onColumnEverything.bind(this)); this.addManagedListener(this.eventService, Events.EVENT_STORE_UPDATED, this.onCacheUpdated.bind(this)); }; InfiniteRowModel.prototype.onFilterChanged = function () { this.reset(); }; InfiniteRowModel.prototype.onSortChanged = function () { this.reset(); }; InfiniteRowModel.prototype.onColumnEverything = function () { var resetRequired; // if cache params, we require reset only if sort model has changed. we don't need to check // for filter model, as the filter manager will fire an event when columns change that result // in the filter changing. if (this.cacheParams) { resetRequired = this.isSortModelDifferent(); } else { // if no cacheParams, means first time creating the cache, so always create one resetRequired = true; } if (resetRequired) { this.reset(); } }; InfiniteRowModel.prototype.isSortModelDifferent = function () { return !_.jsonEquals(this.cacheParams.sortModel, this.sortController.getSortModel()); }; InfiniteRowModel.prototype.getType = function () { return 'infinite'; }; InfiniteRowModel.prototype.setDatasource = function (datasource) { this.destroyDatasource(); this.datasource = datasource; // only reset if we have a valid datasource to working with if (datasource) { this.reset(); } }; InfiniteRowModel.prototype.isEmpty = function () { return !this.infiniteCache; }; InfiniteRowModel.prototype.isRowsToRender = function () { return !!this.infiniteCache; }; InfiniteRowModel.prototype.getNodesInRangeForSelection = function (firstInRange, lastInRange) { return this.infiniteCache ? this.infiniteCache.getRowNodesInRange(firstInRange, lastInRange) : []; }; InfiniteRowModel.prototype.reset = function () { // important to return here, as the user could be setting filter or sort before // data-source is set if (!this.datasource) { return; } // if user is providing id's, then this means we can keep the selection between datasource hits, // as the rows will keep their unique id's even if, for example, server side sorting or filtering // is done. var getRowIdFunc = this.gridOptionsService.getRowIdFunc(); var userGeneratingIds = getRowIdFunc != null; if (!userGeneratingIds) { this.selectionService.reset(); } this.resetCache(); var event = this.createModelUpdatedEvent(); this.eventService.dispatchEvent(event); }; InfiniteRowModel.prototype.createModelUpdatedEvent = function () { return { type: Events.EVENT_MODEL_UPDATED, // not sure if these should all be false - noticed if after implementing, // maybe they should be true? newPage: false, newData: false, keepRenderedRows: true, animate: false }; }; InfiniteRowModel.prototype.resetCache = function () { // if not first time creating a cache, need to destroy the old one this.destroyCache(); this.cacheParams = { // the user provided datasource datasource: this.datasource, // sort and filter model filterModel: this.filterManager.getFilterModel(), sortModel: this.sortController.getSortModel(), rowNodeBlockLoader: this.rowNodeBlockLoader, // properties - this way we take a snapshot of them, so if user changes any, they will be // used next time we create a new cache, which is generally after a filter or sort change, // or a new datasource is set initialRowCount: this.defaultIfInvalid(this.gridOptionsService.getNum('infiniteInitialRowCount'), 1), maxBlocksInCache: this.gridOptionsService.getNum('maxBlocksInCache'), rowHeight: this.gridOptionsService.getRowHeightAsNumber(), // if user doesn't provide overflow, we use default overflow of 1, so user can scroll past // the current page and request first row of next page overflowSize: this.defaultIfInvalid(this.gridOptionsService.getNum('cacheOverflowSize'), 1), // page size needs to be 1 or greater. having it at 1 would be silly, as you would be hitting the // server for one page at a time. so the default if not specified is 100. blockSize: this.defaultIfInvalid(this.gridOptionsService.getNum('cacheBlockSize'), 100), // the cache could create this, however it is also used by the pages, so handy to create it // here as the settings are also passed to the pages lastAccessedSequence: new NumberSequence() }; this.infiniteCache = this.createBean(new InfiniteCache(this.cacheParams)); }; InfiniteRowModel.prototype.defaultIfInvalid = function (value, defaultValue) { return value > 0 ? value : defaultValue; }; InfiniteRowModel.prototype.destroyCache = function () { if (this.infiniteCache) { this.infiniteCache = this.destroyBean(this.infiniteCache); } }; InfiniteRowModel.prototype.onCacheUpdated = function () { var event = this.createModelUpdatedEvent(); this.eventService.dispatchEvent(event); }; InfiniteRowModel.prototype.getRow = function (rowIndex) { if (!this.infiniteCache) { return undefined; } if (rowIndex >= this.infiniteCache.getRowCount()) { return undefined; } return this.infiniteCache.getRow(rowIndex); }; InfiniteRowModel.prototype.getRowNode = function (id) { var result; this.forEachNode(function (rowNode) { if (rowNode.id === id) { result = rowNode; } }); return result; }; InfiniteRowModel.prototype.forEachNode = function (callback) { if (this.infiniteCache) { this.infiniteCache.forEachNodeDeep(callback); } }; InfiniteRowModel.prototype.getTopLevelRowCount = function () { return this.getRowCount(); }; InfiniteRowModel.prototype.getTopLevelRowDisplayedIndex = function (topLevelIndex) { return topLevelIndex; }; InfiniteRowModel.prototype.getRowIndexAtPixel = function (pixel) { if (this.rowHeight !== 0) { // avoid divide by zero error var rowIndexForPixel = Math.floor(pixel / this.rowHeight); var lastRowIndex = this.getRowCount() - 1; if (rowIndexForPixel > lastRowIndex) { return lastRowIndex; } return rowIndexForPixel; } return 0; }; InfiniteRowModel.prototype.getRowCount = function () { return this.infiniteCache ? this.infiniteCache.getRowCount() : 0; }; InfiniteRowModel.prototype.isRowPresent = function (rowNode) { var foundRowNode = this.getRowNode(rowNode.id); return !!foundRowNode; }; InfiniteRowModel.prototype.refreshCache = function () { if (this.infiniteCache) { this.infiniteCache.refreshCache(); } }; InfiniteRowModel.prototype.purgeCache = function () { if (this.infiniteCache) { this.infiniteCache.purgeCache(); } }; // for iRowModel InfiniteRowModel.prototype.isLastRowIndexKnown = function () { if (this.infiniteCache) { return this.infiniteCache.isLastRowIndexKnown(); } return false; }; InfiniteRowModel.prototype.setRowCount = function (rowCount, lastRowIndexKnown) { if (this.infiniteCache) { this.infiniteCache.setRowCount(rowCount, lastRowIndexKnown); } }; __decorate$2x([ Autowired('filterManager') ], InfiniteRowModel.prototype, "filterManager", void 0); __decorate$2x([ Autowired('sortController') ], InfiniteRowModel.prototype, "sortController", void 0); __decorate$2x([ Autowired('selectionService') ], InfiniteRowModel.prototype, "selectionService", void 0); __decorate$2x([ Autowired('rowRenderer') ], InfiniteRowModel.prototype, "rowRenderer", void 0); __decorate$2x([ Autowired('rowNodeBlockLoader') ], InfiniteRowModel.prototype, "rowNodeBlockLoader", void 0); __decorate$2x([ PostConstruct ], InfiniteRowModel.prototype, "init", null); __decorate$2x([ PreDestroy ], InfiniteRowModel.prototype, "destroyDatasource", null); InfiniteRowModel = __decorate$2x([ Bean('rowModel') ], InfiniteRowModel); return InfiniteRowModel; }(BeanStub)); // DO NOT UPDATE MANUALLY: Generated from script during build time var VERSION$1 = '29.2.0'; var InfiniteRowModelModule = { version: VERSION$1, moduleName: exports.ModuleNames.InfiniteRowModelModule, rowModel: 'infinite', beans: [InfiniteRowModel], }; var BaseCreator = /** @class */ (function () { function BaseCreator() { } BaseCreator.prototype.setBeans = function (beans) { this.beans = beans; }; BaseCreator.prototype.getFileName = function (fileName) { var extension = this.getDefaultFileExtension(); if (fileName == null || !fileName.length) { fileName = this.getDefaultFileName(); } return fileName.indexOf('.') === -1 ? fileName + "." + extension : fileName; }; BaseCreator.prototype.getData = function (params) { var serializingSession = this.createSerializingSession(params); var data = this.beans.gridSerializer.serialize(serializingSession, params); return data; }; return BaseCreator; }()); var BaseGridSerializingSession = /** @class */ (function () { function BaseGridSerializingSession(config) { this.groupColumns = []; var columnModel = config.columnModel, valueService = config.valueService, gridOptionsService = config.gridOptionsService, processCellCallback = config.processCellCallback, processHeaderCallback = config.processHeaderCallback, processGroupHeaderCallback = config.processGroupHeaderCallback, processRowGroupCallback = config.processRowGroupCallback; this.columnModel = columnModel; this.valueService = valueService; this.gridOptionsService = gridOptionsService; this.processCellCallback = processCellCallback; this.processHeaderCallback = processHeaderCallback; this.processGroupHeaderCallback = processGroupHeaderCallback; this.processRowGroupCallback = processRowGroupCallback; } BaseGridSerializingSession.prototype.prepare = function (columnsToExport) { this.groupColumns = columnsToExport.filter(function (col) { return !!col.getColDef().showRowGroup; }); }; BaseGridSerializingSession.prototype.extractHeaderValue = function (column) { var value = this.getHeaderName(this.processHeaderCallback, column); return value != null ? value : ''; }; BaseGridSerializingSession.prototype.extractRowCellValue = function (column, index, accumulatedRowIndex, type, node) { // we render the group summary text e.g. "-> Parent -> Child"... var hideOpenParents = this.gridOptionsService.is('groupHideOpenParents'); var value = (!hideOpenParents && this.shouldRenderGroupSummaryCell(node, column, index)) ? this.createValueForGroupNode(node) : this.valueService.getValue(column, node); var processedValue = this.processCell({ accumulatedRowIndex: accumulatedRowIndex, rowNode: node, column: column, value: value, processCellCallback: this.processCellCallback, type: type }); return processedValue != null ? processedValue : ''; }; BaseGridSerializingSession.prototype.shouldRenderGroupSummaryCell = function (node, column, currentColumnIndex) { var _a; var isGroupNode = node && node.group; // only on group rows if (!isGroupNode) { return false; } var currentColumnGroupIndex = this.groupColumns.indexOf(column); if (currentColumnGroupIndex !== -1) { if ((_a = node.groupData) === null || _a === void 0 ? void 0 : _a[column.getId()]) { return true; } // if this is a top level footer, always render`Total` in the left-most cell if (node.footer && node.level === -1) { var colDef = column.getColDef(); var isFullWidth = colDef == null || colDef.showRowGroup === true; return isFullWidth || colDef.showRowGroup === this.columnModel.getRowGroupColumns()[0].getId(); } } var isGroupUseEntireRow = this.gridOptionsService.isGroupUseEntireRow(this.columnModel.isPivotMode()); return currentColumnIndex === 0 && isGroupUseEntireRow; }; BaseGridSerializingSession.prototype.getHeaderName = function (callback, column) { if (callback) { return callback({ column: column, api: this.gridOptionsService.api, columnApi: this.gridOptionsService.columnApi, context: this.gridOptionsService.context }); } return this.columnModel.getDisplayNameForColumn(column, 'csv', true); }; BaseGridSerializingSession.prototype.createValueForGroupNode = function (node) { if (this.processRowGroupCallback) { return this.processRowGroupCallback({ node: node, api: this.gridOptionsService.api, columnApi: this.gridOptionsService.columnApi, context: this.gridOptionsService.context, }); } var isFooter = node.footer; var keys = [node.key]; if (!this.gridOptionsService.isGroupMultiAutoColumn()) { while (node.parent) { node = node.parent; keys.push(node.key); } } var groupValue = keys.reverse().join(' -> '); return isFooter ? "Total " + groupValue : groupValue; }; BaseGridSerializingSession.prototype.processCell = function (params) { var accumulatedRowIndex = params.accumulatedRowIndex, rowNode = params.rowNode, column = params.column, value = params.value, processCellCallback = params.processCellCallback, type = params.type; if (processCellCallback) { return processCellCallback({ accumulatedRowIndex: accumulatedRowIndex, column: column, node: rowNode, value: value, api: this.gridOptionsService.api, columnApi: this.gridOptionsService.columnApi, context: this.gridOptionsService.context, type: type }); } return value != null ? value : ''; }; return BaseGridSerializingSession; }()); var Downloader = /** @class */ (function () { function Downloader() { } Downloader.download = function (fileName, content) { var win = document.defaultView || window; if (!win) { console.warn('AG Grid: There is no `window` associated with the current `document`'); return; } var element = document.createElement('a'); // @ts-ignore var url = win.URL.createObjectURL(content); element.setAttribute('href', url); element.setAttribute('download', fileName); element.style.display = 'none'; document.body.appendChild(element); element.dispatchEvent(new MouseEvent('click', { bubbles: false, cancelable: true, view: win })); document.body.removeChild(element); win.setTimeout(function () { // @ts-ignore win.URL.revokeObjectURL(url); }, 0); }; return Downloader; }()); var __extends$2Q = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var LINE_SEPARATOR = '\r\n'; var CsvSerializingSession = /** @class */ (function (_super) { __extends$2Q(CsvSerializingSession, _super); function CsvSerializingSession(config) { var _this = _super.call(this, config) || this; _this.isFirstLine = true; _this.result = ''; var suppressQuotes = config.suppressQuotes, columnSeparator = config.columnSeparator; _this.suppressQuotes = suppressQuotes; _this.columnSeparator = columnSeparator; return _this; } CsvSerializingSession.prototype.addCustomContent = function (content) { var _this = this; if (!content) { return; } if (typeof content === 'string') { if (!/^\s*\n/.test(content)) { this.beginNewLine(); } // replace whatever newlines are supplied with the style we're using content = content.replace(/\r?\n/g, LINE_SEPARATOR); this.result += content; } else { content.forEach(function (row) { _this.beginNewLine(); row.forEach(function (cell, index) { if (index !== 0) { _this.result += _this.columnSeparator; } _this.result += _this.putInQuotes(cell.data.value || ''); if (cell.mergeAcross) { _this.appendEmptyCells(cell.mergeAcross); } }); }); } }; CsvSerializingSession.prototype.onNewHeaderGroupingRow = function () { this.beginNewLine(); return { onColumn: this.onNewHeaderGroupingRowColumn.bind(this) }; }; CsvSerializingSession.prototype.onNewHeaderGroupingRowColumn = function (columnGroup, header, index, span) { if (index != 0) { this.result += this.columnSeparator; } this.result += this.putInQuotes(header); this.appendEmptyCells(span); }; CsvSerializingSession.prototype.appendEmptyCells = function (count) { for (var i = 1; i <= count; i++) { this.result += this.columnSeparator + this.putInQuotes(""); } }; CsvSerializingSession.prototype.onNewHeaderRow = function () { this.beginNewLine(); return { onColumn: this.onNewHeaderRowColumn.bind(this) }; }; CsvSerializingSession.prototype.onNewHeaderRowColumn = function (column, index) { if (index != 0) { this.result += this.columnSeparator; } this.result += this.putInQuotes(this.extractHeaderValue(column)); }; CsvSerializingSession.prototype.onNewBodyRow = function () { this.beginNewLine(); return { onColumn: this.onNewBodyRowColumn.bind(this) }; }; CsvSerializingSession.prototype.onNewBodyRowColumn = function (column, index, node) { if (index != 0) { this.result += this.columnSeparator; } this.result += this.putInQuotes(this.extractRowCellValue(column, index, index, 'csv', node)); }; CsvSerializingSession.prototype.putInQuotes = function (value) { if (this.suppressQuotes) { return value; } if (value === null || value === undefined) { return '""'; } var stringValue; if (typeof value === 'string') { stringValue = value; } else if (typeof value.toString === 'function') { stringValue = value.toString(); } else { console.warn('AG Grid: unknown value type during csv conversion'); stringValue = ''; } // replace each " with "" (ie two sets of double quotes is how to do double quotes in csv) var valueEscaped = stringValue.replace(/"/g, "\"\""); return '"' + valueEscaped + '"'; }; CsvSerializingSession.prototype.parse = function () { return this.result; }; CsvSerializingSession.prototype.beginNewLine = function () { if (!this.isFirstLine) { this.result += LINE_SEPARATOR; } this.isFirstLine = false; }; return CsvSerializingSession; }(BaseGridSerializingSession)); var __extends$2R = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __decorate$2y = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var CsvCreator = /** @class */ (function (_super) { __extends$2R(CsvCreator, _super); function CsvCreator() { return _super !== null && _super.apply(this, arguments) || this; } CsvCreator.prototype.postConstruct = function () { this.setBeans({ gridSerializer: this.gridSerializer, gridOptionsService: this.gridOptionsService }); }; CsvCreator.prototype.getMergedParams = function (params) { var baseParams = this.gridOptionsService.get('defaultCsvExportParams'); return Object.assign({}, baseParams, params); }; CsvCreator.prototype.export = function (userParams) { if (this.isExportSuppressed()) { console.warn("AG Grid: Export cancelled. Export is not allowed as per your configuration."); return ''; } var mergedParams = this.getMergedParams(userParams); var data = this.getData(mergedParams); var packagedFile = new Blob(["\ufeff", data], { type: 'text/plain' }); Downloader.download(this.getFileName(mergedParams.fileName), packagedFile); return data; }; CsvCreator.prototype.exportDataAsCsv = function (params) { return this.export(params); }; CsvCreator.prototype.getDataAsCsv = function (params, skipDefaultParams) { if (skipDefaultParams === void 0) { skipDefaultParams = false; } var mergedParams = skipDefaultParams ? Object.assign({}, params) : this.getMergedParams(params); return this.getData(mergedParams); }; CsvCreator.prototype.getDefaultFileName = function () { return 'export.csv'; }; CsvCreator.prototype.getDefaultFileExtension = function () { return 'csv'; }; CsvCreator.prototype.createSerializingSession = function (params) { var _a = this, columnModel = _a.columnModel, valueService = _a.valueService, gridOptionsService = _a.gridOptionsService; var _b = params, processCellCallback = _b.processCellCallback, processHeaderCallback = _b.processHeaderCallback, processGroupHeaderCallback = _b.processGroupHeaderCallback, processRowGroupCallback = _b.processRowGroupCallback, suppressQuotes = _b.suppressQuotes, columnSeparator = _b.columnSeparator; return new CsvSerializingSession({ columnModel: columnModel, valueService: valueService, gridOptionsService: gridOptionsService, processCellCallback: processCellCallback || undefined, processHeaderCallback: processHeaderCallback || undefined, processGroupHeaderCallback: processGroupHeaderCallback || undefined, processRowGroupCallback: processRowGroupCallback || undefined, suppressQuotes: suppressQuotes || false, columnSeparator: columnSeparator || ',' }); }; CsvCreator.prototype.isExportSuppressed = function () { return this.gridOptionsService.is('suppressCsvExport'); }; __decorate$2y([ Autowired('columnModel') ], CsvCreator.prototype, "columnModel", void 0); __decorate$2y([ Autowired('valueService') ], CsvCreator.prototype, "valueService", void 0); __decorate$2y([ Autowired('gridSerializer') ], CsvCreator.prototype, "gridSerializer", void 0); __decorate$2y([ Autowired('gridOptionsService') ], CsvCreator.prototype, "gridOptionsService", void 0); __decorate$2y([ PostConstruct ], CsvCreator.prototype, "postConstruct", null); CsvCreator = __decorate$2y([ Bean('csvCreator') ], CsvCreator); return CsvCreator; }(BaseCreator)); var __extends$2S = (undefined && undefined.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __decorate$2z = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; (function (RowType) { RowType[RowType["HEADER_GROUPING"] = 0] = "HEADER_GROUPING"; RowType[RowType["HEADER"] = 1] = "HEADER"; RowType[RowType["BODY"] = 2] = "BODY"; })(exports.RowType || (exports.RowType = {})); var GridSerializer = /** @class */ (function (_super) { __extends$2S(GridSerializer, _super); function GridSerializer() { return _super !== null && _super.apply(this, arguments) || this; } GridSerializer.prototype.serialize = function (gridSerializingSession, params) { if (params === void 0) { params = {}; } var columnsToExport = this.getColumnsToExport(params.allColumns, params.columnKeys); var serializeChain = _.compose( // first pass, put in the header names of the cols this.prepareSession(columnsToExport), this.prependContent(params), this.exportColumnGroups(params, columnsToExport), this.exportHeaders(params, columnsToExport), this.processPinnedTopRows(params, columnsToExport), this.processRows(params, columnsToExport), this.processPinnedBottomRows(params, columnsToExport), this.appendContent(params)); return serializeChain(gridSerializingSession).parse(); }; GridSerializer.prototype.processRow = function (gridSerializingSession, params, columnsToExport, node) { var rowSkipper = params.shouldRowBeSkipped || (function () { return false; }); var context = this.gridOptionsService.context; var api = this.gridOptionsService.api; var columnApi = this.gridOptionsService.columnApi; var skipSingleChildrenGroup = this.gridOptionsService.is('groupRemoveSingleChildren'); var skipLowestSingleChildrenGroup = this.gridOptionsService.is('groupRemoveLowestSingleChildren'); // if onlySelected, we ignore groupHideOpenParents as the user has explicitly selected the rows they wish to export. // similarly, if specific rowNodes are provided we do the same. (the clipboard service uses rowNodes to define which rows to export) var isClipboardExport = params.rowPositions != null; var isExplicitExportSelection = isClipboardExport || !!params.onlySelected; var hideOpenParents = this.gridOptionsService.is('groupHideOpenParents') && !isExplicitExportSelection; var isLeafNode = this.columnModel.isPivotMode() ? node.leafGroup : !node.group; var skipRowGroups = params.skipGroups || params.skipRowGroups; var shouldSkipLowestGroup = skipLowestSingleChildrenGroup && node.leafGroup; var shouldSkipCurrentGroup = node.allChildrenCount === 1 && (skipSingleChildrenGroup || shouldSkipLowestGroup); if (skipRowGroups && params.skipGroups) { _.doOnce(function () { return console.warn('AG Grid: Since v25.2 `skipGroups` has been renamed to `skipRowGroups`.'); }, 'gridSerializer-skipGroups'); } if ((!isLeafNode && (params.skipRowGroups || shouldSkipCurrentGroup || hideOpenParents)) || (params.onlySelected && !node.isSelected()) || (params.skipPinnedTop && node.rowPinned === 'top') || (params.skipPinnedBottom && node.rowPinned === 'bottom')) { return; } // if we are in pivotMode, then the grid will show the root node only // if it's not a leaf group var nodeIsRootNode = node.level === -1; if (nodeIsRootNode && !node.leafGroup && !node.footer) { return; } var shouldRowBeSkipped = rowSkipper({ node: node, api: api, columnApi: columnApi, context: context }); if (shouldRowBeSkipped) { return; } var rowAccumulator = gridSerializingSession.onNewBodyRow(); columnsToExport.forEach(function (column, index) { rowAccumulator.onColumn(column, index, node); }); if (params.getCustomContentBelowRow) { var content = params.getCustomContentBelowRow({ node: node, api: api, columnApi: columnApi, context: context }); if (content) { gridSerializingSession.addCustomContent(content); } } }; GridSerializer.prototype.appendContent = function (params) { return function (gridSerializingSession) { var appendContent = params.customFooter || params.appendContent; if (appendContent) { if (params.customFooter) { _.doOnce(function () { return console.warn('AG Grid: Since version 25.2.0 the `customFooter` param has been deprecated. Use `appendContent` instead.'); }, 'gridSerializer-customFooter'); } gridSerializingSession.addCustomContent(appendContent); } return gridSerializingSession; }; }; GridSerializer.prototype.prependContent = function (params) { return function (gridSerializingSession) { var prependContent = params.customHeader || params.prependContent; if (prependContent) { if (params.customHeader) { _.doOnce(function () { return console.warn('AG Grid: Since version 25.2.0 the `customHeader` param has been deprecated. Use `prependContent` instead.'); }, 'gridSerializer-customHeader'); } gridSerializingSession.addCustomContent(prependContent); } return gridSerializingSession; }; }; GridSerializer.prototype.prepareSession = function (columnsToExport) { return function (gridSerializingSession) { gridSerializingSession.prepare(columnsToExport); return gridSerializingSession; }; }; GridSerializer.prototype.exportColumnGroups = function (params, columnsToExport) { var _this = this; return function (gridSerializingSession) { if (!params.skipColumnGroupHeaders) { var groupInstanceIdCreator = new GroupInstanceIdCreator(); var displayedGroups = _this.displayedGroupCreator.createDisplayedGroups(columnsToExport, _this.columnModel.getGridBalancedTree(), groupInstanceIdCreator, null); _this.recursivelyAddHeaderGroups(displayedGroups, gridSerializingSession, params.processGroupHeaderCallback); } else if (params.columnGroups) { _.doOnce(function () { return console.warn('AG Grid: Since v25.2 the `columnGroups` param has deprecated, and groups are exported by default.'); }, 'gridSerializer-columnGroups'); } return gridSerializingSession; }; }; GridSerializer.prototype.exportHeaders = function (params, columnsToExport) { return function (gridSerializingSession) { if (!params.skipHeader && !params.skipColumnHeaders) { var gridRowIterator_1 = gridSerializingSession.onNewHeaderRow(); columnsToExport.forEach(function (column, index) { gridRowIterator_1.onColumn(column, index, undefined); }); } else if (params.skipHeader) { _.doOnce(function () { return console.warn('AG Grid: Since v25.2 the `skipHeader` param has been renamed to `skipColumnHeaders`.'); }, 'gridSerializer-skipHeader'); } return gridSerializingSession; }; }; GridSerializer.prototype.processPinnedTopRows = function (params, columnsToExport) { var _this = this; return function (gridSerializingSession) { var processRow = _this.processRow.bind(_this, gridSerializingSession, params, columnsToExport); if (params.rowPositions) { params.rowPositions // only pinnedTop rows, other models are processed by `processRows` and `processPinnedBottomsRows` .filter(function (position) { return position.rowPinned === 'top'; }) .sort(function (a, b) { return a.rowIndex - b.rowIndex; }) .map(function (position) { return _this.pinnedRowModel.getPinnedTopRow(position.rowIndex); }) .forEach(processRow); } else { _this.pinnedRowModel.forEachPinnedTopRow(processRow); } return gridSerializingSession; }; }; GridSerializer.prototype.processRows = function (params, columnsToExport) { var _this = this; return function (gridSerializingSession) { // when in pivot mode, we always render cols on screen, never 'all columns' var rowModel = _this.rowModel; var rowModelType = rowModel.getType(); var usingCsrm = rowModelType === 'clientSide'; var usingSsrm = rowModelType === 'serverSide'; var onlySelectedNonStandardModel = !usingCsrm && params.onlySelected; var processRow = _this.processRow.bind(_this, gridSerializingSession, params, columnsToExport); var _a = params.exportedRows, exportedRows = _a === void 0 ? 'filteredAndSorted' : _a; if (params.rowPositions) { params.rowPositions // pinnedRows are processed by `processPinnedTopRows` and `processPinnedBottomsRows` .filter(function (position) { return position.rowPinned == null; }) .sort(function (a, b) { return a.rowIndex - b.rowIndex; }) .map(function (position) { return rowModel.getRow(position.rowIndex); }) .forEach(processRow); } else if (_this.columnModel.isPivotMode()) { if (usingCsrm) { rowModel.forEachPivotNode(processRow, true); } else { // must be enterprise, so we can just loop through all the nodes rowModel.forEachNode(processRow); } } else { // onlySelectedAllPages: user doing pagination and wants selected items from // other pages, so cannot use the standard row model as it won't have rows from // other pages. // onlySelectedNonStandardModel: if user wants selected in non standard row model // (eg viewport) then again RowModel cannot be used, so need to use selected instead. if (params.onlySelectedAllPages || onlySelectedNonStandardModel) { var selectedNodes = _this.selectionService.getSelectedNodes(); _this.replicateSortedOrder(selectedNodes); // serialize each node selectedNodes.forEach(processRow); } else { // here is everything else - including standard row model and selected. we don't use // the selection model even when just using selected, so that the result is the order // of the rows appearing on the screen. if (exportedRows === 'all') { rowModel.forEachNode(processRow); } else if (usingCsrm) { rowModel.forEachNodeAfterFilterAndSort(processRow, true); } else if (usingSsrm) { rowModel.forEachNodeAfterFilterAndSort(processRow); } else { rowModel.forEachNode(processRow); } } } return gridSerializingSession; }; }; GridSerializer.prototype.replicateSortedOrder = function (rows) { var _this = this; var sortOptions = this.sortController.getSortOptions(); var compareNodes = function (rowA, rowB) { var _a, _b, _c, _d; if (rowA.rowIndex != null && rowB.rowIndex != null) { // if the rows have rowIndexes, this is the easiest way to compare, // as they're already ordered return rowA.rowIndex - rowB.rowIndex; } // if the level is the same, compare these nodes, or their parents if (rowA.level === rowB.level) { if (((_a = rowA.parent) === null || _a === void 0 ? void 0 : _a.id) === ((_b = rowB.parent) === null || _b === void 0 ? void 0 : _b.id)) { return _this.rowNodeSorter.compareRowNodes(sortOptions, { rowNode: rowA, currentPos: (_c = rowA.rowIndex) !== null && _c !== void 0 ? _c : -1, }, { rowNode: rowB, currentPos: (_d = rowB.rowIndex) !== null && _d !== void 0 ? _d : -1, }); } // level is same, but parent isn't, compare parents return compareNodes(rowA.parent, rowB.parent); } // if level is different, match levels if (rowA.level > rowB.level) { return compareNodes(rowA.parent, rowB); } return compareNodes(rowA, rowB.parent); }; // sort the nodes either by existing row index or compare them rows.sort(compareNodes); }; GridSerializer.prototype.processPinnedBottomRows = function (params, columnsToExport) { var _this = this; return function (gridSerializingSession) { var processRow = _this.processRow.bind(_this, gridSerializingSession, params, columnsToExport); if (params.rowPositions) { params.rowPositions // only pinnedBottom rows, other models are processed by `processRows` and `processPinnedTopRows` .filter(function (position) { return position.rowPinned === 'bottom'; }) .sort(function (a, b) { return a.rowIndex - b.rowIndex; }) .map(function (position) { return _this.pinnedRowModel.getPinnedBottomRow(position.rowIndex); }) .forEach(processRow); } else { _this.pinnedRowModel.forEachPinnedBottomRow(processRow); } return gridSerializingSession; }; }; GridSerializer.prototype.getColumnsToExport = function (allColumns, columnKeys) { if (allColumns === void 0) { allColumns = false; } var isPivotMode = this.columnModel.isPivotMode(); if (columnKeys && columnKeys.length) { return this.columnModel.getGridColumns(columnKeys); } if (allColumns && !isPivotMode) { // add auto group column for tree data var columns = this.gridOptionsService.isTreeData() ? this.columnModel.getGridColumns([GROUP_AUTO_COLUMN_ID]) : []; return columns.concat(this.columnModel.getAllPrimaryColumns() || []); } return this.columnModel.getAllDisplayedColumns(); }; GridSerializer.prototype.recursivelyAddHeaderGroups = function (displayedGroups, gridSerializingSession, processGroupHeaderCallback) { var directChildrenHeaderGroups = []; displayedGroups.forEach(function (columnGroupChild) { var columnGroup = columnGroupChild; if (!columnGroup.getChildren) { return; } columnGroup.getChildren().forEach(function (it) { return directChildrenHeaderGroups.push(it); }); }); if (displayedGroups.length > 0 && displayedGroups[0] instanceof ColumnGroup) { this.doAddHeaderHeader(gridSerializingSession, displayedGroups, processGroupHeaderCallback); } if (directChildrenHeaderGroups && directChildrenHeaderGroups.length > 0) { this.recursivelyAddHeaderGroups(directChildrenHeaderGroups, gridSerializingSession, processGroupHeaderCallback); } }; GridSerializer.prototype.doAddHeaderHeader = function (gridSerializingSession, displayedGroups, processGroupHeaderCallback) { var _this = this; var gridRowIterator = gridSerializingSession.onNewHeaderGroupingRow(); var columnIndex = 0; displayedGroups.forEach(function (columnGroupChild) { var columnGroup = columnGroupChild; var name; if (processGroupHeaderCallback) { name = processGroupHeaderCallback({ columnGroup: columnGroup, api: _this.gridOptionsService.api, columnApi: _this.gridOptionsService.columnApi, context: _this.gridOptionsService.context }); } else { name = _this.columnModel.getDisplayNameForColumnGroup(columnGroup, 'header'); } var collapsibleGroupRanges = columnGroup.getLeafColumns().reduce(function (collapsibleGroups, currentColumn, currentIdx, arr) { var lastGroup = _.last(collapsibleGroups); var groupShow = currentColumn.getColumnGroupShow() === 'open'; if (!groupShow) { if (lastGroup && lastGroup[1] == null) { lastGroup[1] = currentIdx - 1; } } else if (!lastGroup || lastGroup[1] != null) { lastGroup = [currentIdx]; collapsibleGroups.push(lastGroup); } if (currentIdx === arr.length - 1 && lastGroup && lastGroup[1] == null) { lastGroup[1] = currentIdx; } return collapsibleGroups; }, []); gridRowIterator.onColumn(columnGroup, name || '', columnIndex++, columnGroup.getLeafColumns().length - 1, collapsibleGroupRanges); }); }; __decorate$2z([ Autowired('displayedGroupCreator') ], GridSerializer.prototype, "displayedGroupCreator", void 0); __decorate$2z([ Autowired('columnModel') ], GridSerializer.prototype, "columnModel", void 0); __decorate$2z([ Autowired('rowModel') ], GridSerializer.prototype, "rowModel", void 0); __decorate$2z([ Autowired('pinnedRowModel') ], GridSerializer.prototype, "pinnedRowModel", void 0); __decorate$2z([ Autowired('selectionService') ], GridSerializer.prototype, "selectionService", void 0); __decorate$2z([ Autowired('rowNodeSorter') ], GridSerializer.prototype, "rowNodeSorter", void 0); __decorate$2z([ Autowired('sortController') ], GridSerializer.prototype, "sortController", void 0); GridSerializer = __decorate$2z([ Bean("gridSerializer") ], GridSerializer); return GridSerializer; }(BeanStub)); // DO NOT UPDATE MANUALLY: Generated from script during build time var VERSION$2 = '29.2.0'; var CsvExportModule = { version: VERSION$2, moduleName: exports.ModuleNames.CsvExportModule, beans: [CsvCreator, GridSerializer] }; var LINE_SEPARATOR$1 = '\r\n'; var XmlFactory = /** @class */ (function () { function XmlFactory() { } XmlFactory.createHeader = function (headerElement) { if (headerElement === void 0) { headerElement = {}; } var headerStart = ''; var keys = ['version']; if (!headerElement.version) { headerElement.version = "1.0"; } if (headerElement.encoding) { keys.push('encoding'); } if (headerElement.standalone) { keys.push('standalone'); } var att = keys.map(function (key) { return key + "=\"" + headerElement[key] + "\""; }).join(' '); return headerStart + "xml " + att + " " + headerEnd; }; XmlFactory.createXml = function (xmlElement, booleanTransformer) { var _this = this; var props = ''; if (xmlElement.properties) { if (xmlElement.properties.prefixedAttributes) { xmlElement.properties.prefixedAttributes.forEach(function (prefixedSet) { Object.keys(prefixedSet.map).forEach(function (key) { props += _this.returnAttributeIfPopulated(prefixedSet.prefix + key, prefixedSet.map[key], booleanTransformer); }); }); } if (xmlElement.properties.rawMap) { Object.keys(xmlElement.properties.rawMap).forEach(function (key) { props += _this.returnAttributeIfPopulated(key, xmlElement.properties.rawMap[key], booleanTransformer); }); } } var result = '<' + xmlElement.name + props; if (!xmlElement.children && xmlElement.textNode == null) { return result + '/>' + LINE_SEPARATOR$1; } if (xmlElement.textNode != null) { return result + '>' + xmlElement.textNode + '' + LINE_SEPARATOR$1; } result += '>' + LINE_SEPARATOR$1; if (xmlElement.children) { xmlElement.children.forEach(function (it) { result += _this.createXml(it, booleanTransformer); }); } return result + '' + LINE_SEPARATOR$1; }; XmlFactory.returnAttributeIfPopulated = function (key, value, booleanTransformer) { if (!value && value !== '' && value !== 0) { return ''; } var xmlValue = value; if ((typeof (value) === 'boolean')) { if (booleanTransformer) { xmlValue = booleanTransformer(value); } } return " " + key + "=\"" + xmlValue + "\""; }; return XmlFactory; }()); var __values$6 = (undefined && undefined.__values) || function(o) { var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; if (m) return m.call(o); if (o && typeof o.length === "number") return { next: function () { if (o && i >= o.length) o = void 0; return { value: o && o[i++], done: !o }; } }; throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); }; // table for crc calculation // from: https://referencesource.microsoft.com/#System/sys/System/IO/compression/Crc32Helper.cs,3b31978c7d7f7246,references var crcTable = new Uint32Array([ 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f, 0xe963a535, 0x9e6495a3, 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988, 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91, 0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de, 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7, 0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9, 0xfa0f3d63, 0x8d080df5, 0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172, 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b, 0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940, 0x32d86ce3, 0x45df5c75, 0xdcd60dcf, 0xabd13d59, 0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423, 0xcfba9599, 0xb8bda50f, 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924, 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, 0x76dc4190, 0x01db7106, 0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f, 0x9fbfe4a5, 0xe8b8d433, 0x7807c9a2, 0x0f00f934, 0x9609a88e, 0xe10e9818, 0x7f6a0dbb, 0x086d3d2d, 0x91646c97, 0xe6635c01, 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, 0x6c0695ed, 0x1b01a57b, 0x8208f4c1, 0xf50fc457, 0x65b0d9c6, 0x12b7e950, 0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, 0xfbd44c65, 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, 0x4adfa541, 0x3dd895d7, 0xa4d1c46d, 0xd3d6f4fb, 0x4369e96a, 0x346ed9fc, 0xad678846, 0xda60b8d0, 0x44042d73, 0x33031de5, 0xaa0a4c5f, 0xdd0d7cc9, 0x5005713c, 0x270241aa, 0xbe0b1010, 0xc90c2086, 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f, 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17, 0x2eb40d81, 0xb7bd5c3b, 0xc0ba6cad, 0xedb88320, 0x9abfb3b6, 0x03b6e20c, 0x74b1d29a, 0xead54739, 0x9dd277af, 0x04db2615, 0x73dc1683, 0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8, 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1, 0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb, 0x196c3671, 0x6e6b06e7, 0xfed41b76, 0x89d32be0, 0x10da7a5a, 0x67dd4acc, 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5, 0xd6d6a3e8, 0xa1d1937e, 0x38d8c2c4, 0x4fdff252, 0xd1bb67f1, 0xa6bc5767, 0x3fb506dd, 0x48b2364b, 0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55, 0x316e8eef, 0x4669be79, 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236, 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, 0xc5ba3bbe, 0xb2bd0b28, 0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31, 0x2cd99e8b, 0x5bdeae1d, 0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a, 0x9c0906a9, 0xeb0e363f, 0x72076785, 0x05005713, 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, 0x92d28e9b, 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, 0x86d3d2d4, 0xf1d4e242, 0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1, 0x18b74777, 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, 0x8f659eff, 0xf862ae69, 0x616bffd3, 0x166ccf45, 0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2, 0xa7672661, 0xd06016f7, 0x4969474d, 0x3e6e77db, 0xaed16a4a, 0xd9d65adc, 0x40df0b66, 0x37d83bf0, 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9, 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605, 0xcdd70693, 0x54de5729, 0x23d967bf, 0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94, 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d ]); var ZipContainer = /** @class */ (function () { function ZipContainer() { } ZipContainer.addFolders = function (paths) { paths.forEach(this.addFolder.bind(this)); }; ZipContainer.addFolder = function (path) { this.folders.push({ path: path, created: new Date(), isBase64: false }); }; ZipContainer.addFile = function (path, content, isBase64) { if (isBase64 === void 0) { isBase64 = false; } this.files.push({ path: path, created: new Date(), content: content, isBase64: isBase64 }); }; ZipContainer.getContent = function (mimeType) { if (mimeType === void 0) { mimeType = 'application/zip'; } var textOutput = this.buildFileStream(); var uInt8Output = this.buildUint8Array(textOutput); this.clearStream(); return new Blob([uInt8Output], { type: mimeType }); }; ZipContainer.clearStream = function () { this.folders = []; this.files = []; }; ZipContainer.buildFileStream = function (fData) { var e_1, _a; if (fData === void 0) { fData = ''; } var totalFiles = this.folders.concat(this.files); var len = totalFiles.length; var foData = ''; var lL = 0; var cL = 0; try { for (var totalFiles_1 = __values$6(totalFiles), totalFiles_1_1 = totalFiles_1.next(); !totalFiles_1_1.done; totalFiles_1_1 = totalFiles_1.next()) { var currentFile = totalFiles_1_1.value; var _b = this.getHeader(currentFile, lL), fileHeader = _b.fileHeader, folderHeader = _b.folderHeader, content = _b.content; lL += fileHeader.length + content.length; cL += folderHeader.length; fData += fileHeader + content; foData += folderHeader; } } catch (e_1_1) { e_1 = { error: e_1_1 }; } finally { try { if (totalFiles_1_1 && !totalFiles_1_1.done && (_a = totalFiles_1.return)) _a.call(totalFiles_1); } finally { if (e_1) throw e_1.error; } } var foEnd = this.buildFolderEnd(len, cL, lL); return fData + foData + foEnd; }; ZipContainer.getHeader = function (currentFile, offset) { var content = currentFile.content, path = currentFile.path, created = currentFile.created, isBase64 = currentFile.isBase64; var utf8_encode = _.utf8_encode, decToHex = _.decToHex; var utfPath = utf8_encode(path); var isUTF8 = utfPath !== path; var time = this.convertTime(created); var dt = this.convertDate(created); var extraFields = ''; if (isUTF8) { var uExtraFieldPath = decToHex(1, 1) + decToHex(this.getFromCrc32Table(utfPath), 4) + utfPath; extraFields = "\x75\x70" + decToHex(uExtraFieldPath.length, 2) + uExtraFieldPath; } var _a = !content ? { size: 0, content: '' } : this.getConvertedContent(content, isBase64), size = _a.size, convertedContent = _a.content; var header = '\x0A\x00' + (isUTF8 ? '\x00\x08' : '\x00\x00') + '\x00\x00' + decToHex(time, 2) + // last modified time decToHex(dt, 2) + // last modified date decToHex(size ? this.getFromCrc32Table(convertedContent) : 0, 4) + decToHex(size, 4) + // compressed size decToHex(size, 4) + // uncompressed size decToHex(utfPath.length, 2) + // file name length decToHex(extraFields.length, 2); // extra field length var fileHeader = 'PK\x03\x04' + header + utfPath + extraFields; var folderHeader = 'PK\x01\x02' + // central header '\x14\x00' + header + // file header '\x00\x00' + '\x00\x00' + '\x00\x00' + (content ? '\x00\x00\x00\x00' : '\x10\x00\x00\x00') + // external file attributes decToHex(offset, 4) + // relative offset of local header utfPath + // file name extraFields; // extra field return { fileHeader: fileHeader, folderHeader: folderHeader, content: convertedContent || '' }; }; ZipContainer.getConvertedContent = function (content, isBase64) { if (isBase64 === void 0) { isBase64 = false; } if (isBase64) { content = content.split(';base64,')[1]; } content = isBase64 ? atob(content) : content; return { size: content.length, content: content }; }; ZipContainer.buildFolderEnd = function (tLen, cLen, lLen) { var decToHex = _.decToHex; return 'PK\x05\x06' + // central folder end '\x00\x00' + '\x00\x00' + decToHex(tLen, 2) + // total number of entries in the central folder decToHex(tLen, 2) + // total number of entries in the central folder decToHex(cLen, 4) + // size of the central folder decToHex(lLen, 4) + // central folder start offset '\x00\x00'; }; ZipContainer.buildUint8Array = function (content) { var uint8 = new Uint8Array(content.length); for (var i = 0; i < uint8.length; i++) { uint8[i] = content.charCodeAt(i); } return uint8; }; ZipContainer.getFromCrc32Table = function (content) { if (!content.length) { return 0; } var size = content.length; var iterable = new Uint8Array(size); for (var i = 0; i < size; i++) { iterable[i] = content.charCodeAt(i); } var crc = 0 ^ (-1); var j = 0; var k = 0; var l = 0; for (var i = 0; i < size; i++) { j = iterable[i]; k = (crc ^ j) & 0xFF; l = crcTable[k]; crc = (crc >>> 8) ^ l; } return crc ^ (-1); }; ZipContainer.convertTime = function (date) { var time = date.getHours(); time <<= 6; time = time | date.getMinutes(); time <<= 5; time = time | date.getSeconds() / 2; return time; }; ZipContainer.convertDate = function (date) { var dt = date.getFullYear() - 1980; dt <<= 4; dt = dt | (date.getMonth() + 1); dt <<= 5; dt = dt | date.getDate(); return dt; }; ZipContainer.folders = []; ZipContainer.files = []; return ZipContainer; }()); ModuleRegistry.register(ClientSideRowModelModule, false); ModuleRegistry.register(InfiniteRowModelModule, false); ModuleRegistry.register(CsvExportModule, false); exports.AbstractHeaderCellCtrl = AbstractHeaderCellCtrl; exports.AgAbstractField = AgAbstractField; exports.AgAbstractLabel = AgAbstractLabel; exports.AgCheckbox = AgCheckbox; exports.AgDialog = AgDialog; exports.AgGroupComponent = AgGroupComponent; exports.AgInputNumberField = AgInputNumberField; exports.AgInputRange = AgInputRange; exports.AgInputTextArea = AgInputTextArea; exports.AgInputTextField = AgInputTextField; exports.AgMenuItemComponent = AgMenuItemComponent; exports.AgMenuList = AgMenuList; exports.AgMenuPanel = AgMenuPanel; exports.AgPanel = AgPanel; exports.AgPickerField = AgPickerField; exports.AgPromise = AgPromise; exports.AgRadioButton = AgRadioButton; exports.AgSelect = AgSelect; exports.AgSlider = AgSlider; exports.AgStackComponentsRegistry = AgStackComponentsRegistry; exports.AgToggleButton = AgToggleButton; exports.AlignedGridsService = AlignedGridsService; exports.AnimateShowChangeCellRenderer = AnimateShowChangeCellRenderer; exports.AnimateSlideCellRenderer = AnimateSlideCellRenderer; exports.AnimationFrameService = AnimationFrameService; exports.AutoScrollService = AutoScrollService; exports.AutoWidthCalculator = AutoWidthCalculator; exports.Autowired = Autowired; exports.BaseComponentWrapper = BaseComponentWrapper; exports.BaseCreator = BaseCreator; exports.BaseGridSerializingSession = BaseGridSerializingSession; exports.Bean = Bean; exports.BeanStub = BeanStub; exports.Beans = Beans; exports.BodyDropPivotTarget = BodyDropPivotTarget; exports.BodyDropTarget = BodyDropTarget; exports.CHART_TOOLBAR_ALLOW_LIST = CHART_TOOLBAR_ALLOW_LIST; exports.CHART_TOOL_PANEL_ALLOW_LIST = CHART_TOOL_PANEL_ALLOW_LIST; exports.CHART_TOOL_PANEL_MENU_OPTIONS = CHART_TOOL_PANEL_MENU_OPTIONS; exports.CellComp = CellComp; exports.CellCtrl = CellCtrl; exports.CellNavigationService = CellNavigationService; exports.CellPositionUtils = CellPositionUtils; exports.ChangedPath = ChangedPath; exports.CheckboxSelectionComponent = CheckboxSelectionComponent; exports.ColDefUtil = ColDefUtil; exports.Column = Column; exports.ColumnApi = ColumnApi; exports.ColumnFactory = ColumnFactory; exports.ColumnGroup = ColumnGroup; exports.ColumnKeyCreator = ColumnKeyCreator; exports.ColumnModel = ColumnModel; exports.ColumnUtils = ColumnUtils; exports.Component = Component; exports.ComponentUtil = ComponentUtil; exports.Context = Context; exports.CssClassApplier = CssClassApplier; exports.CssClassManager = CssClassManager; exports.CsvCreator = CsvCreator; exports.CsvExportModule = CsvExportModule; exports.CtrlsService = CtrlsService; exports.CustomTooltipFeature = CustomTooltipFeature; exports.DEFAULT_CHART_GROUPS = DEFAULT_CHART_GROUPS; exports.DateFilter = DateFilter; exports.DisplayedGroupCreator = DisplayedGroupCreator; exports.Downloader = Downloader; exports.DragAndDropService = DragAndDropService; exports.DragService = DragService; exports.Environment = Environment; exports.EventService = EventService; exports.Events = Events; exports.ExpressionService = ExpressionService; exports.FilterManager = FilterManager; exports.FloatingFilterMapper = FloatingFilterMapper; exports.FocusService = FocusService; exports.GROUP_AUTO_COLUMN_ID = GROUP_AUTO_COLUMN_ID; exports.Grid = Grid; exports.GridApi = GridApi; exports.GridBodyComp = GridBodyComp; exports.GridBodyCtrl = GridBodyCtrl; exports.GridComp = GridComp; exports.GridCoreCreator = GridCoreCreator; exports.GridCtrl = GridCtrl; exports.GridHeaderComp = GridHeaderComp; exports.GridHeaderCtrl = GridHeaderCtrl; exports.GridOptionsService = GridOptionsService; exports.GridSerializer = GridSerializer; exports.GroupCellRenderer = GroupCellRenderer; exports.GroupCellRendererCtrl = GroupCellRendererCtrl; exports.GroupInstanceIdCreator = GroupInstanceIdCreator; exports.HeaderCellCtrl = HeaderCellCtrl; exports.HeaderFilterCellComp = HeaderFilterCellComp; exports.HeaderFilterCellCtrl = HeaderFilterCellCtrl; exports.HeaderGroupCellCtrl = HeaderGroupCellCtrl; exports.HeaderNavigationService = HeaderNavigationService; exports.HeaderPositionUtils = HeaderPositionUtils; exports.HeaderRowComp = HeaderRowComp; exports.HeaderRowContainerComp = HeaderRowContainerComp; exports.HeaderRowContainerCtrl = HeaderRowContainerCtrl; exports.HeaderRowCtrl = HeaderRowCtrl; exports.HorizontalResizeService = HorizontalResizeService; exports.KeyCode = KeyCode; exports.LargeTextCellEditor = LargeTextCellEditor; exports.LocaleService = LocaleService; exports.Logger = Logger; exports.LoggerFactory = LoggerFactory; exports.ManagedFocusFeature = ManagedFocusFeature; exports.ModuleRegistry = ModuleRegistry; exports.MouseEventService = MouseEventService; exports.MoveColumnFeature = MoveColumnFeature; exports.NavigationService = NavigationService; exports.NumberFilter = NumberFilter; exports.NumberSequence = NumberSequence; exports.Optional = Optional; exports.PaginationProxy = PaginationProxy; exports.PinnedRowModel = PinnedRowModel; exports.PopupComponent = PopupComponent; exports.PopupEditorWrapper = PopupEditorWrapper; exports.PopupService = PopupService; exports.PositionableFeature = PositionableFeature; exports.PostConstruct = PostConstruct; exports.PreConstruct = PreConstruct; exports.PreDestroy = PreDestroy; exports.PropertyKeys = PropertyKeys; exports.ProvidedColumnGroup = ProvidedColumnGroup; exports.ProvidedFilter = ProvidedFilter; exports.Qualifier = Qualifier; exports.QuerySelector = QuerySelector; exports.RefSelector = RefSelector; exports.ResizeObserverService = ResizeObserverService; exports.RowContainerComp = RowContainerComp; exports.RowContainerCtrl = RowContainerCtrl; exports.RowCtrl = RowCtrl; exports.RowNode = RowNode; exports.RowNodeBlock = RowNodeBlock; exports.RowNodeBlockLoader = RowNodeBlockLoader; exports.RowNodeSorter = RowNodeSorter; exports.RowPositionUtils = RowPositionUtils; exports.RowRenderer = RowRenderer; exports.ScalarFilter = ScalarFilter; exports.ScrollVisibleService = ScrollVisibleService; exports.SelectCellEditor = SelectCellEditor; exports.SelectableService = SelectableService; exports.SetLeftFeature = SetLeftFeature; exports.SimpleFilter = SimpleFilter; exports.SortController = SortController; exports.SortIndicatorComp = SortIndicatorComp; exports.StandardMenuFactory = StandardMenuFactory; exports.StylingService = StylingService; exports.TabGuardComp = TabGuardComp; exports.TabGuardCtrl = TabGuardCtrl; exports.TabbedLayout = TabbedLayout; exports.TemplateService = TemplateService; exports.TextCellEditor = TextCellEditor; exports.TextFilter = TextFilter; exports.TextFloatingFilter = TextFloatingFilter; exports.Timer = Timer; exports.TouchListener = TouchListener; exports.UserComponentFactory = UserComponentFactory; exports.UserComponentRegistry = UserComponentRegistry; exports.ValueCache = ValueCache; exports.ValueFormatterService = ValueFormatterService; exports.ValueService = ValueService; exports.VanillaFrameworkOverrides = VanillaFrameworkOverrides; exports.VirtualList = VirtualList; exports.XmlFactory = XmlFactory; exports.ZipContainer = ZipContainer; exports._ = _; exports.__FORCE_MODULE_DETECTION = __FORCE_MODULE_DETECTION; exports.getRowContainerTypeForName = getRowContainerTypeForName; exports.simpleHttpRequest = simpleHttpRequest; /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("./node_modules/webpack/buildin/global.js"))) /***/ }), /***/ "./node_modules/ag-grid-community/styles/ag-grid.css": /***/ (function(module, exports, __webpack_require__) { var api = __webpack_require__("./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"); var content = __webpack_require__("./node_modules/css-loader/dist/cjs.js!./node_modules/ag-grid-community/styles/ag-grid.css"); content = content.__esModule ? content.default : content; if (typeof content === 'string') { content = [[module.i, content, '']]; } var options = {}; options.insert = "head"; options.singleton = false; var update = api(content, options); module.exports = content.locals || {}; /***/ }), /***/ "./node_modules/ag-grid-community/styles/ag-theme-alpine.css": /***/ (function(module, exports, __webpack_require__) { var api = __webpack_require__("./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"); var content = __webpack_require__("./node_modules/css-loader/dist/cjs.js!./node_modules/ag-grid-community/styles/ag-theme-alpine.css"); content = content.__esModule ? content.default : content; if (typeof content === 'string') { content = [[module.i, content, '']]; } var options = {}; options.insert = "head"; options.singleton = false; var update = api(content, options); module.exports = content.locals || {}; /***/ }), /***/ "./node_modules/ag-grid-react/lib/agGridReact.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; // ag-grid-react v29.2.0 var __extends = (this && this.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __assign = (this && this.__assign) || function () { __assign = Object.assign || function(t) { for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; } return t; }; return __assign.apply(this, arguments); }; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }); var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.AgGridReact = void 0; var react_1 = __importStar(__webpack_require__("./node_modules/react/index.js")); var agGridReactLegacy_1 = __webpack_require__("./node_modules/ag-grid-react/lib/legacy/agGridReactLegacy.js"); var agGridReactUi_1 = __webpack_require__("./node_modules/ag-grid-react/lib/reactUi/agGridReactUi.js"); var AgGridReact = /** @class */ (function (_super) { __extends(AgGridReact, _super); function AgGridReact() { var _this = _super !== null && _super.apply(this, arguments) || this; _this.setGridApi = function (api, columnApi) { _this.api = api; _this.columnApi = columnApi; }; return _this; } AgGridReact.prototype.render = function () { var ReactComponentToUse = this.props.suppressReactUi ? react_1.default.createElement(agGridReactLegacy_1.AgGridReactLegacy, __assign({}, this.props, { setGridApi: this.setGridApi })) : react_1.default.createElement(agGridReactUi_1.AgGridReactUi, __assign({}, this.props, { setGridApi: this.setGridApi })); return ReactComponentToUse; }; return AgGridReact; }(react_1.Component)); exports.AgGridReact = AgGridReact; /***/ }), /***/ "./node_modules/ag-grid-react/lib/legacy/agGridReactLegacy.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; // ag-grid-react v29.2.0 var __extends = (this && this.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __assign = (this && this.__assign) || function () { __assign = Object.assign || function(t) { for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; } return t; }; return __assign.apply(this, arguments); }; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }); var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.AgGridReactLegacy = void 0; var ag_grid_community_1 = __webpack_require__("./node_modules/ag-grid-community/dist/ag-grid-community.cjs.js"); var prop_types_1 = __importDefault(__webpack_require__("./node_modules/prop-types/index.js")); var react_1 = __importStar(__webpack_require__("./node_modules/react/index.js")); var legacyReactComponent_1 = __webpack_require__("./node_modules/ag-grid-react/lib/legacy/legacyReactComponent.js"); var newReactComponent_1 = __webpack_require__("./node_modules/ag-grid-react/lib/shared/newReactComponent.js"); var portalManager_1 = __webpack_require__("./node_modules/ag-grid-react/lib/shared/portalManager.js"); var reactFrameworkOverrides_1 = __webpack_require__("./node_modules/ag-grid-react/lib/shared/reactFrameworkOverrides.js"); var AgGridReactLegacy = /** @class */ (function (_super) { __extends(AgGridReactLegacy, _super); function AgGridReactLegacy(props) { var _this = _super.call(this, props) || this; _this.props = props; _this.api = null; _this.destroyed = false; _this.SYNCHRONOUS_CHANGE_PROPERTIES = ['context']; _this.portalManager = new portalManager_1.PortalManager(_this, props.componentWrappingElement, props.maxComponentCreationTimeMs); return _this; } AgGridReactLegacy.prototype.render = function () { var _this = this; return react_1.default.createElement('div', { style: this.createStyleForDiv(), className: this.props.className, ref: function (e) { _this.eGridDiv = e; } }, this.portalManager.getPortals()); }; AgGridReactLegacy.prototype.createStyleForDiv = function () { return __assign({ height: '100%' }, (this.props.containerStyle || {})); }; AgGridReactLegacy.prototype.componentDidMount = function () { var modules = this.props.modules || []; var gridParams = { providedBeanInstances: { agGridReact: this, frameworkComponentWrapper: new ReactFrameworkComponentWrapper(this, this.portalManager) }, modules: modules, frameworkOverrides: new reactFrameworkOverrides_1.ReactFrameworkOverrides(false) }; var gridOptions = this.props.gridOptions || {}; this.gridOptions = ag_grid_community_1.ComponentUtil.copyAttributesToGridOptions(gridOptions, this.props); this.checkForDeprecations(this.props); // don't need the return value new ag_grid_community_1.Grid(this.eGridDiv, this.gridOptions, gridParams); this.api = this.gridOptions.api; this.columnApi = this.gridOptions.columnApi; this.props.setGridApi(this.api, this.columnApi); }; AgGridReactLegacy.prototype.checkForDeprecations = function (props) { if (props.rowDataChangeDetectionStrategy) { ag_grid_community_1._.doOnce(function () { return console.warn('AG Grid: Since v29 rowDataChangeDetectionStrategy has been deprecated. Row data property changes will be compared by reference via triple equals ===. See https://ag-grid.com/react-data-grid/react-hooks/'); }, 'rowDataChangeDetectionStrategy_Deprecation'); } }; AgGridReactLegacy.prototype.shouldComponentUpdate = function (nextProps) { this.processPropsChanges(this.props, nextProps); // we want full control of the dom, as AG Grid doesn't use React internally, // so for performance reasons we tell React we don't need render called after // property changes. return false; }; AgGridReactLegacy.prototype.componentDidUpdate = function (prevProps) { this.processPropsChanges(prevProps, this.props); }; AgGridReactLegacy.prototype.processPropsChanges = function (prevProps, nextProps) { var changes = {}; this.extractGridPropertyChanges(prevProps, nextProps, changes); this.processSynchronousChanges(changes); this.processAsynchronousChanges(changes); }; AgGridReactLegacy.prototype.extractGridPropertyChanges = function (prevProps, nextProps, changes) { var debugLogging = !!nextProps.debug; Object.keys(nextProps).forEach(function (propKey) { if (ag_grid_community_1.ComponentUtil.ALL_PROPERTIES_SET.has(propKey)) { if (prevProps[propKey] !== nextProps[propKey]) { if (debugLogging) { console.log("agGridReact: [" + propKey + "] property changed"); } changes[propKey] = { previousValue: prevProps[propKey], currentValue: nextProps[propKey] }; } } }); ag_grid_community_1.ComponentUtil.EVENT_CALLBACKS.forEach(function (funcName) { if (prevProps[funcName] !== nextProps[funcName]) { if (debugLogging) { console.log("agGridReact: [" + funcName + "] event callback changed"); } changes[funcName] = { previousValue: prevProps[funcName], currentValue: nextProps[funcName] }; } }); }; AgGridReactLegacy.prototype.componentWillUnmount = function () { if (this.api) { this.api.destroy(); this.api = null; } this.destroyed = true; this.portalManager.destroy(); }; AgGridReactLegacy.prototype.isDisableStaticMarkup = function () { return this.props.disableStaticMarkup === true; }; AgGridReactLegacy.prototype.isLegacyComponentRendering = function () { return this.props.legacyComponentRendering === true; }; AgGridReactLegacy.prototype.processSynchronousChanges = function (changes) { var asyncChanges = __assign({}, changes); if (Object.keys(asyncChanges).length > 0) { var synchronousChanges_1 = {}; this.SYNCHRONOUS_CHANGE_PROPERTIES.forEach(function (synchronousChangeProperty) { if (asyncChanges[synchronousChangeProperty]) { synchronousChanges_1[synchronousChangeProperty] = asyncChanges[synchronousChangeProperty]; delete asyncChanges[synchronousChangeProperty]; } }); if (Object.keys(synchronousChanges_1).length > 0 && !!this.api) { ag_grid_community_1.ComponentUtil.processOnChange(synchronousChanges_1, this.api); } } return asyncChanges; }; AgGridReactLegacy.prototype.processAsynchronousChanges = function (changes) { var _this = this; if (Object.keys(changes).length > 0) { window.setTimeout(function () { // destroyed? if (_this.api) { ag_grid_community_1.ComponentUtil.processOnChange(changes, _this.api); } }); } }; AgGridReactLegacy.MAX_COMPONENT_CREATION_TIME_IN_MS = 1000; // a second should be more than enough to instantiate a component AgGridReactLegacy.defaultProps = { legacyComponentRendering: false, disableStaticMarkup: false, maxComponentCreationTimeMs: AgGridReactLegacy.MAX_COMPONENT_CREATION_TIME_IN_MS }; return AgGridReactLegacy; }(react_1.Component)); exports.AgGridReactLegacy = AgGridReactLegacy; AgGridReactLegacy.propTypes = { gridOptions: prop_types_1.default.object }; addProperties(ag_grid_community_1.ComponentUtil.EVENT_CALLBACKS, prop_types_1.default.func); addProperties(ag_grid_community_1.ComponentUtil.BOOLEAN_PROPERTIES, prop_types_1.default.bool); addProperties(ag_grid_community_1.ComponentUtil.STRING_PROPERTIES, prop_types_1.default.string); addProperties(ag_grid_community_1.ComponentUtil.OBJECT_PROPERTIES, prop_types_1.default.object); addProperties(ag_grid_community_1.ComponentUtil.ARRAY_PROPERTIES, prop_types_1.default.array); addProperties(ag_grid_community_1.ComponentUtil.NUMBER_PROPERTIES, prop_types_1.default.number); addProperties(ag_grid_community_1.ComponentUtil.FUNCTION_PROPERTIES, prop_types_1.default.func); function addProperties(listOfProps, propType) { listOfProps.forEach(function (propKey) { AgGridReactLegacy[propKey] = propType; }); } var ReactFrameworkComponentWrapper = /** @class */ (function (_super) { __extends(ReactFrameworkComponentWrapper, _super); function ReactFrameworkComponentWrapper(agGridReact, portalManager) { var _this = _super.call(this) || this; _this.agGridReact = agGridReact; _this.portalManager = portalManager; return _this; } ReactFrameworkComponentWrapper.prototype.createWrapper = function (UserReactComponent, componentType) { if (this.agGridReact.isLegacyComponentRendering()) { return new legacyReactComponent_1.LegacyReactComponent(UserReactComponent, this.agGridReact, this.portalManager, componentType); } else { return new newReactComponent_1.NewReactComponent(UserReactComponent, this.portalManager, componentType); } }; return ReactFrameworkComponentWrapper; }(ag_grid_community_1.BaseComponentWrapper)); /***/ }), /***/ "./node_modules/ag-grid-react/lib/legacy/legacyReactComponent.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; // ag-grid-react v29.2.0 var __extends = (this && this.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.LegacyReactComponent = void 0; var react_1 = __webpack_require__("./node_modules/react/index.js"); var react_dom_1 = __webpack_require__("./node_modules/react-dom/index.js"); var ag_grid_community_1 = __webpack_require__("./node_modules/ag-grid-community/dist/ag-grid-community.cjs.js"); var reactComponent_1 = __webpack_require__("./node_modules/ag-grid-react/lib/shared/reactComponent.js"); var server_1 = __webpack_require__("./node_modules/react-dom/server.browser.js"); var keyGenerator_1 = __importDefault(__webpack_require__("./node_modules/ag-grid-react/lib/shared/keyGenerator.js")); var LegacyReactComponent = /** @class */ (function (_super) { __extends(LegacyReactComponent, _super); function LegacyReactComponent(reactComponent, parentComponent, portalManager, componentType) { var _this = _super.call(this, reactComponent, portalManager, componentType) || this; _this.staticMarkup = null; _this.staticRenderTime = 0; _this.parentComponent = parentComponent; return _this; } LegacyReactComponent.prototype.init = function (params) { var _this = this; this.eParentElement = this.createParentElement(params); this.renderStaticMarkup(params); return new ag_grid_community_1.AgPromise(function (resolve) { return _this.createReactComponent(params, resolve); }); }; LegacyReactComponent.prototype.createReactComponent = function (params, resolve) { var _this = this; // regular components (ie not functional) if (!this.isStatelessComponent()) { // grab hold of the actual instance created params.ref = function (element) { _this.componentInstance = element; _this.addParentContainerStyleAndClasses(); _this.removeStaticMarkup(); }; } var reactComponent = react_1.createElement(this.reactComponent, params); var portal = react_dom_1.createPortal(reactComponent, this.eParentElement, keyGenerator_1.default() // fixed deltaRowModeRefreshCompRenderer ); this.portal = portal; this.portalManager.mountReactPortal(portal, this, function (value) { resolve(value); // functional/stateless components have a slightly different lifecycle (no refs) so we'll clean them up // here if (_this.isStatelessComponent()) { if (_this.isSlowRenderer()) { _this.removeStaticMarkup(); } setTimeout(function () { _this.removeStaticMarkup(); }); } }); }; LegacyReactComponent.prototype.fallbackMethodAvailable = function (name) { return false; }; LegacyReactComponent.prototype.fallbackMethod = function (name, params) { }; LegacyReactComponent.prototype.isSlowRenderer = function () { return this.staticRenderTime >= LegacyReactComponent.SLOW_RENDERING_THRESHOLD; }; LegacyReactComponent.prototype.isNullValue = function () { return this.staticMarkup === ''; }; /* * Attempt to render the component as static markup if possible * What this does is eliminate any visible flicker for the user in the scenario where a component is destroyed and * recreated with exactly the same data (ie with force refresh) * Note: Some use cases will throw an error (ie when using Context) so if an error occurs just ignore it any move on */ LegacyReactComponent.prototype.renderStaticMarkup = function (params) { if (this.parentComponent.isDisableStaticMarkup() || !this.componentType.cellRenderer) { return; } var originalConsoleError = console.error; var reactComponent = react_1.createElement(this.reactComponent, params); try { // if a user is doing anything that uses useLayoutEffect (like material ui) then it will throw and we // can't do anything to stop it; this is just a warning and has no effect on anything so just suppress it // for this single operation console.error = function () { }; var start = Date.now(); var staticMarkup = server_1.renderToStaticMarkup(reactComponent); this.staticRenderTime = Date.now() - start; console.error = originalConsoleError; // if the render method returns null the result will be an empty string if (staticMarkup === '') { this.staticMarkup = staticMarkup; } else { if (staticMarkup) { // we wrap the content as if there is "trailing" text etc it's not easy to safely remove // the same is true for memoized renderers, renderers that that return simple strings or NaN etc this.staticMarkup = document.createElement('span'); this.staticMarkup.innerHTML = staticMarkup; this.eParentElement.appendChild(this.staticMarkup); } } } catch (e) { // we tried - this can happen with certain (rare) edge cases } finally { console.error = originalConsoleError; } }; LegacyReactComponent.prototype.removeStaticMarkup = function () { if (this.parentComponent.isDisableStaticMarkup() || !this.componentType.cellRenderer) { return; } if (this.staticMarkup) { if (this.staticMarkup.remove) { // everyone else in the world this.staticMarkup.remove(); this.staticMarkup = null; } else if (this.eParentElement.removeChild) { // ie11... this.eParentElement.removeChild(this.staticMarkup); this.staticMarkup = null; } } }; LegacyReactComponent.prototype.rendered = function () { return this.isNullValue() || !!this.staticMarkup || (this.isStatelessComponent() && this.statelessComponentRendered()) || !!(!this.isStatelessComponent() && this.getFrameworkComponentInstance()); }; LegacyReactComponent.SLOW_RENDERING_THRESHOLD = 3; return LegacyReactComponent; }(reactComponent_1.ReactComponent)); exports.LegacyReactComponent = LegacyReactComponent; /***/ }), /***/ "./node_modules/ag-grid-react/lib/reactUi/agGridReactUi.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; // ag-grid-react v29.2.0 var __extends = (this && this.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __assign = (this && this.__assign) || function () { __assign = Object.assign || function(t) { for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; } return t; }; return __assign.apply(this, arguments); }; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }); var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.AgGridReactUi = void 0; var ag_grid_community_1 = __webpack_require__("./node_modules/ag-grid-community/dist/ag-grid-community.cjs.js"); var react_1 = __importStar(__webpack_require__("./node_modules/react/index.js")); var newReactComponent_1 = __webpack_require__("./node_modules/ag-grid-react/lib/shared/newReactComponent.js"); var portalManager_1 = __webpack_require__("./node_modules/ag-grid-react/lib/shared/portalManager.js"); var gridComp_1 = __importDefault(__webpack_require__("./node_modules/ag-grid-react/lib/reactUi/gridComp.js")); var reactFrameworkOverrides_1 = __webpack_require__("./node_modules/ag-grid-react/lib/shared/reactFrameworkOverrides.js"); function debug(msg, obj) { // console.log(msg, obj); } var AgGridReactUi = /** @class */ (function (_super) { __extends(AgGridReactUi, _super); // Would like props to be of type AgReactUiProps but currently breaks build function AgGridReactUi(props) { var _this = _super.call(this, props) || this; _this.props = props; _this.destroyFuncs = []; _this.eGui = react_1.default.createRef(); _this.whenReadyFuncs = []; _this.ready = false; _this.renderedAfterMount = false; _this.mounted = false; debug('AgGridReactUi.constructor'); _this.state = { context: undefined }; _this.portalManager = new portalManager_1.PortalManager(_this, props.componentWrappingElement, props.maxComponentCreationTimeMs); _this.destroyFuncs.push(function () { return _this.portalManager.destroy(); }); return _this; } AgGridReactUi.prototype.render = function () { debug('AgGridReactUi.render, context = ' + (this.state.context)); if (this.state.context) { this.renderedAfterMount = true; } return (react_1.default.createElement("div", { style: this.createStyleForDiv(), className: this.props.className, ref: this.eGui }, this.state.context && react_1.default.createElement(gridComp_1.default, { context: this.state.context }), this.portalManager.getPortals())); }; AgGridReactUi.prototype.createStyleForDiv = function () { return __assign({ height: '100%' }, (this.props.containerStyle || {})); }; AgGridReactUi.prototype.componentDidMount = function () { var _this = this; if (this.mounted) { debug('AgGridReactUi.componentDidMount - skipping'); return; } debug('AgGridReactUi.componentDidMount'); this.mounted = true; var modules = this.props.modules || []; var gridParams = { providedBeanInstances: { frameworkComponentWrapper: new ReactFrameworkComponentWrapper(this.portalManager) }, modules: modules, frameworkOverrides: new reactFrameworkOverrides_1.ReactFrameworkOverrides(true) }; this.gridOptions = this.props.gridOptions || {}; this.gridOptions = ag_grid_community_1.ComponentUtil.copyAttributesToGridOptions(this.gridOptions, this.props); this.checkForDeprecations(this.props); var createUiCallback = function (context) { _this.setState({ context: context }); // because React is Async, we need to wait for the UI to be initialised before exposing the API's var ctrlsService = context.getBean(ag_grid_community_1.CtrlsService.NAME); ctrlsService.whenReady(function () { debug('AgGridReactUi.createUiCallback'); _this.api = _this.gridOptions.api; _this.columnApi = _this.gridOptions.columnApi; _this.props.setGridApi(_this.api, _this.columnApi); _this.destroyFuncs.push(function () { return _this.api.destroy(); }); }); }; // this callback adds to ctrlsService.whenReady(), just like above, however because whenReady() executes // funcs in the order they were received, we know adding items here will be AFTER the grid has set columns // and data. this is because GridCoreCreator sets these between calling createUiCallback and acceptChangesCallback var acceptChangesCallback = function (context) { var ctrlsService = context.getBean(ag_grid_community_1.CtrlsService.NAME); ctrlsService.whenReady(function () { debug('AgGridReactUi.acceptChangesCallback'); _this.whenReadyFuncs.forEach(function (f) { return f(); }); _this.whenReadyFuncs.length = 0; _this.ready = true; }); }; // don't need the return value var gridCoreCreator = new ag_grid_community_1.GridCoreCreator(); gridCoreCreator.create(this.eGui.current, this.gridOptions, createUiCallback, acceptChangesCallback, gridParams); }; AgGridReactUi.prototype.checkForDeprecations = function (props) { if (props.rowDataChangeDetectionStrategy) { ag_grid_community_1._.doOnce(function () { return console.warn('AG Grid: Since v29 rowDataChangeDetectionStrategy has been deprecated. Row data property changes will be compared by reference via triple equals ===. See https://ag-grid.com/react-data-grid/react-hooks/'); }, 'rowDataChangeDetectionStrategy_Deprecation'); } }; AgGridReactUi.prototype.componentWillUnmount = function () { if (this.renderedAfterMount) { debug('AgGridReactUi.componentWillUnmount - executing'); this.destroyFuncs.forEach(function (f) { return f(); }); this.destroyFuncs.length = 0; } else { debug('AgGridReactUi.componentWillUnmount - skipping'); } }; AgGridReactUi.prototype.componentDidUpdate = function (prevProps) { this.processPropsChanges(prevProps, this.props); }; AgGridReactUi.prototype.processPropsChanges = function (prevProps, nextProps) { var changes = {}; this.extractGridPropertyChanges(prevProps, nextProps, changes); this.processChanges(changes); }; AgGridReactUi.prototype.extractGridPropertyChanges = function (prevProps, nextProps, changes) { var debugLogging = !!nextProps.debug; Object.keys(nextProps).forEach(function (propKey) { if (ag_grid_community_1.ComponentUtil.ALL_PROPERTIES_SET.has(propKey)) { if (prevProps[propKey] !== nextProps[propKey]) { if (debugLogging) { console.log("agGridReact: [" + propKey + "] property changed"); } changes[propKey] = { previousValue: prevProps[propKey], currentValue: nextProps[propKey] }; } } }); ag_grid_community_1.ComponentUtil.EVENT_CALLBACKS.forEach(function (funcName) { if (prevProps[funcName] !== nextProps[funcName]) { if (debugLogging) { console.log("agGridReact: [" + funcName + "] event callback changed"); } changes[funcName] = { previousValue: prevProps[funcName], currentValue: nextProps[funcName] }; } }); }; AgGridReactUi.prototype.processChanges = function (changes) { var _this = this; this.processWhenReady(function () { return ag_grid_community_1.ComponentUtil.processOnChange(changes, _this.api); }); }; AgGridReactUi.prototype.processWhenReady = function (func) { if (this.ready) { debug('AgGridReactUi.processWhenReady sync'); func(); } else { debug('AgGridReactUi.processWhenReady async'); this.whenReadyFuncs.push(func); } }; return AgGridReactUi; }(react_1.Component)); exports.AgGridReactUi = AgGridReactUi; var ReactFrameworkComponentWrapper = /** @class */ (function (_super) { __extends(ReactFrameworkComponentWrapper, _super); function ReactFrameworkComponentWrapper(parent) { var _this = _super.call(this) || this; _this.parent = parent; return _this; } ReactFrameworkComponentWrapper.prototype.createWrapper = function (UserReactComponent, componentType) { return new newReactComponent_1.NewReactComponent(UserReactComponent, this.parent, componentType); }; return ReactFrameworkComponentWrapper; }(ag_grid_community_1.BaseComponentWrapper)); /***/ }), /***/ "./node_modules/ag-grid-react/lib/reactUi/beansContext.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; // ag-grid-react v29.2.0 var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.BeansContext = void 0; var react_1 = __importDefault(__webpack_require__("./node_modules/react/index.js")); exports.BeansContext = react_1.default.createContext({}); /***/ }), /***/ "./node_modules/ag-grid-react/lib/reactUi/cellRenderer/detailCellRenderer.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; // ag-grid-react v29.2.0 var __assign = (this && this.__assign) || function () { __assign = Object.assign || function(t) { for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; } return t; }; return __assign.apply(this, arguments); }; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }); var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; Object.defineProperty(exports, "__esModule", { value: true }); var react_1 = __importStar(__webpack_require__("./node_modules/react/index.js")); var utils_1 = __webpack_require__("./node_modules/ag-grid-react/lib/reactUi/utils.js"); var beansContext_1 = __webpack_require__("./node_modules/ag-grid-react/lib/reactUi/beansContext.js"); var agGridReactUi_1 = __webpack_require__("./node_modules/ag-grid-react/lib/reactUi/agGridReactUi.js"); var useEffectOnce_1 = __webpack_require__("./node_modules/ag-grid-react/lib/reactUi/useEffectOnce.js"); var DetailCellRenderer = function (props, ref) { var _a = react_1.useContext(beansContext_1.BeansContext), ctrlsFactory = _a.ctrlsFactory, context = _a.context, gridOptionsService = _a.gridOptionsService, resizeObserverService = _a.resizeObserverService, clientSideRowModel = _a.clientSideRowModel, serverSideRowModel = _a.serverSideRowModel; var _b = react_1.useState(new utils_1.CssClasses()), cssClasses = _b[0], setCssClasses = _b[1]; var _c = react_1.useState(new utils_1.CssClasses()), gridCssClasses = _c[0], setGridCssClasses = _c[1]; var _d = react_1.useState(), detailGridOptions = _d[0], setDetailGridOptions = _d[1]; var _e = react_1.useState(), detailRowData = _e[0], setDetailRowData = _e[1]; var ctrlRef = react_1.useRef(); var eGuiRef = react_1.useRef(null); var topClassName = react_1.useMemo(function () { return cssClasses.toString() + ' ag-details-row'; }, [cssClasses]); var gridClassName = react_1.useMemo(function () { return gridCssClasses.toString() + ' ag-details-grid'; }, [gridCssClasses]); if (ref) { react_1.useImperativeHandle(ref, function () { return ({ refresh: function () { return ctrlRef.current.refresh(); } }); }); } useEffectOnce_1.useEffectOnce(function () { if (props.template && typeof props.template === 'string') { console.warn('AG Grid: detailCellRendererParams.template is not supported by React - this only works with frameworks that work against String templates. To change the template, please provide your own React Detail Cell Renderer.'); } }); useEffectOnce_1.useEffectOnce(function () { var compProxy = { addOrRemoveCssClass: function (name, on) { return setCssClasses(function (prev) { return prev.setClass(name, on); }); }, addOrRemoveDetailGridCssClass: function (name, on) { return setGridCssClasses(function (prev) { return prev.setClass(name, on); }); }, setDetailGrid: function (gridOptions) { return setDetailGridOptions(gridOptions); }, setRowData: function (rowData) { return setDetailRowData(rowData); }, getGui: function () { return eGuiRef.current; } }; var ctrl = ctrlsFactory.getInstance('detailCellRenderer'); if (!ctrl) { return; } // should never happen, means master/detail module not loaded context.createBean(ctrl); ctrl.init(compProxy, props); ctrlRef.current = ctrl; var resizeObserverDestroyFunc; if (gridOptionsService.is('detailRowAutoHeight')) { var checkRowSizeFunc = function () { // when disposed, current is null, so nothing to do, and the resize observer will // be disposed of soon if (eGuiRef.current == null) { return; } var clientHeight = eGuiRef.current.clientHeight; // if the UI is not ready, the height can be 0, which we ignore, as otherwise a flicker will occur // as UI goes from the default height, to 0, then to the real height as UI becomes ready. this means // it's not possible for have 0 as auto-height, however this is an improbable use case, as even an // empty detail grid would still have some styling around it giving at least a few pixels. if (clientHeight != null && clientHeight > 0) { // we do the update in a timeout, to make sure we are not calling from inside the grid // doing another update var updateRowHeightFunc = function () { props.node.setRowHeight(clientHeight); if (clientSideRowModel) { clientSideRowModel.onRowHeightChanged(); } else if (serverSideRowModel) { serverSideRowModel.onRowHeightChanged(); } }; setTimeout(updateRowHeightFunc, 0); } }; resizeObserverDestroyFunc = resizeObserverService.observeResize(eGuiRef.current, checkRowSizeFunc); checkRowSizeFunc(); } return function () { context.destroyBean(ctrl); if (resizeObserverDestroyFunc) { resizeObserverDestroyFunc(); } }; }); var setGridApi = react_1.useCallback(function (api, columnApi) { ctrlRef.current.registerDetailWithMaster(api, columnApi); }, []); return (react_1.default.createElement("div", { className: topClassName, ref: eGuiRef }, detailGridOptions && react_1.default.createElement(agGridReactUi_1.AgGridReactUi, __assign({ className: gridClassName }, detailGridOptions, { rowData: detailRowData, setGridApi: setGridApi })))); }; exports.default = react_1.forwardRef(DetailCellRenderer); /***/ }), /***/ "./node_modules/ag-grid-react/lib/reactUi/cellRenderer/groupCellRenderer.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; // ag-grid-react v29.2.0 var __assign = (this && this.__assign) || function () { __assign = Object.assign || function(t) { for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; } return t; }; return __assign.apply(this, arguments); }; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }); var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; Object.defineProperty(exports, "__esModule", { value: true }); var ag_grid_community_1 = __webpack_require__("./node_modules/ag-grid-community/dist/ag-grid-community.cjs.js"); var react_1 = __importStar(__webpack_require__("./node_modules/react/index.js")); var beansContext_1 = __webpack_require__("./node_modules/ag-grid-react/lib/reactUi/beansContext.js"); var jsComp_1 = __webpack_require__("./node_modules/ag-grid-react/lib/reactUi/jsComp.js"); var useEffectOnce_1 = __webpack_require__("./node_modules/ag-grid-react/lib/reactUi/useEffectOnce.js"); var utils_1 = __webpack_require__("./node_modules/ag-grid-react/lib/reactUi/utils.js"); var GroupCellRenderer = react_1.forwardRef(function (props, ref) { var context = react_1.useContext(beansContext_1.BeansContext).context; var eGui = react_1.useRef(null); var eValueRef = react_1.useRef(null); var eCheckboxRef = react_1.useRef(null); var eExpandedRef = react_1.useRef(null); var eContractedRef = react_1.useRef(null); var _a = react_1.useState(), innerCompDetails = _a[0], setInnerCompDetails = _a[1]; var _b = react_1.useState(), childCount = _b[0], setChildCount = _b[1]; var _c = react_1.useState(), value = _c[0], setValue = _c[1]; var _d = react_1.useState(new utils_1.CssClasses()), cssClasses = _d[0], setCssClasses = _d[1]; var _e = react_1.useState(new utils_1.CssClasses('ag-hidden')), expandedCssClasses = _e[0], setExpandedCssClasses = _e[1]; var _f = react_1.useState(new utils_1.CssClasses('ag-hidden')), contractedCssClasses = _f[0], setContractedCssClasses = _f[1]; var _g = react_1.useState(new utils_1.CssClasses('ag-invisible')), checkboxCssClasses = _g[0], setCheckboxCssClasses = _g[1]; react_1.useImperativeHandle(ref, function () { return { // force new instance when grid tries to refresh refresh: function () { return false; } }; }); react_1.useLayoutEffect(function () { return jsComp_1.showJsComp(innerCompDetails, context, eValueRef.current); }, [innerCompDetails]); useEffectOnce_1.useLayoutEffectOnce(function () { var compProxy = { setInnerRenderer: function (details, valueToDisplay) { setInnerCompDetails(details); setValue(valueToDisplay); }, setChildCount: function (count) { return setChildCount(count); }, addOrRemoveCssClass: function (name, on) { return setCssClasses(function (prev) { return prev.setClass(name, on); }); }, setContractedDisplayed: function (displayed) { return setContractedCssClasses(function (prev) { return prev.setClass('ag-hidden', !displayed); }); }, setExpandedDisplayed: function (displayed) { return setExpandedCssClasses(function (prev) { return prev.setClass('ag-hidden', !displayed); }); }, setCheckboxVisible: function (visible) { return setCheckboxCssClasses(function (prev) { return prev.setClass('ag-invisible', !visible); }); } }; var ctrl = context.createBean(new ag_grid_community_1.GroupCellRendererCtrl()); ctrl.init(compProxy, eGui.current, eCheckboxRef.current, eExpandedRef.current, eContractedRef.current, GroupCellRenderer, props); return function () { context.destroyBean(ctrl); }; }); var className = react_1.useMemo(function () { return "ag-cell-wrapper " + cssClasses.toString(); }, [cssClasses]); var expandedClassName = react_1.useMemo(function () { return "ag-group-expanded " + expandedCssClasses.toString(); }, [expandedCssClasses]); var contractedClassName = react_1.useMemo(function () { return "ag-group-contracted " + contractedCssClasses.toString(); }, [contractedCssClasses]); var checkboxClassName = react_1.useMemo(function () { return "ag-group-checkbox " + checkboxCssClasses.toString(); }, [checkboxCssClasses]); var useFwRenderer = innerCompDetails && innerCompDetails.componentFromFramework; var FwRenderer = useFwRenderer ? innerCompDetails.componentClass : undefined; var useValue = innerCompDetails == null && value != null; var escapedValue = ag_grid_community_1._.escapeString(value, true); return (react_1.default.createElement("span", __assign({ className: className, ref: eGui }, (!props.colDef ? { role: 'gridcell' } : {})), react_1.default.createElement("span", { className: expandedClassName, ref: eExpandedRef }), react_1.default.createElement("span", { className: contractedClassName, ref: eContractedRef }), react_1.default.createElement("span", { className: checkboxClassName, ref: eCheckboxRef }), react_1.default.createElement("span", { className: "ag-group-value", ref: eValueRef }, useValue && react_1.default.createElement(react_1.default.Fragment, null, escapedValue), useFwRenderer && react_1.default.createElement(FwRenderer, __assign({}, innerCompDetails.params))), react_1.default.createElement("span", { className: "ag-group-child-count" }, childCount))); }); // we do not memo() here, as it would stop the forwardRef working exports.default = GroupCellRenderer; /***/ }), /***/ "./node_modules/ag-grid-react/lib/reactUi/cells/cellComp.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; // ag-grid-react v29.2.0 var __assign = (this && this.__assign) || function () { __assign = Object.assign || function(t) { for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; } return t; }; return __assign.apply(this, arguments); }; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }); var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.CellCompState = void 0; var ag_grid_community_1 = __webpack_require__("./node_modules/ag-grid-community/dist/ag-grid-community.cjs.js"); var react_1 = __importStar(__webpack_require__("./node_modules/react/index.js")); var utils_1 = __webpack_require__("./node_modules/ag-grid-react/lib/reactUi/utils.js"); var popupEditorComp_1 = __importDefault(__webpack_require__("./node_modules/ag-grid-react/lib/reactUi/cells/popupEditorComp.js")); var showJsRenderer_1 = __importDefault(__webpack_require__("./node_modules/ag-grid-react/lib/reactUi/cells/showJsRenderer.js")); var beansContext_1 = __webpack_require__("./node_modules/ag-grid-react/lib/reactUi/beansContext.js"); var jsComp_1 = __webpack_require__("./node_modules/ag-grid-react/lib/reactUi/jsComp.js"); var useEffectOnce_1 = __webpack_require__("./node_modules/ag-grid-react/lib/reactUi/useEffectOnce.js"); var CellCompState; (function (CellCompState) { CellCompState[CellCompState["ShowValue"] = 0] = "ShowValue"; CellCompState[CellCompState["EditValue"] = 1] = "EditValue"; })(CellCompState = exports.CellCompState || (exports.CellCompState = {})); var checkCellEditorDeprecations = function (popup, cellEditor, cellCtrl) { var col = cellCtrl.getColumn(); // cellEditor is written to be a popup editor, however colDef.cellEditorPopup is not set if (!popup && cellEditor.isPopup && cellEditor.isPopup()) { var msg_1 = "AG Grid: Found an issue in column " + col.getColId() + ". If using React, specify an editor is a popup using colDef.cellEditorPopup=true. AG Grid React cannot depend on the editor component specifying if it's in a popup (via the isPopup() method on the editor), as React needs to know this information BEFORE the component is created."; ag_grid_community_1._.doOnce(function () { return console.warn(msg_1); }, 'jsEditorComp-isPopup-' + cellCtrl.getColumn().getColId()); } // cellEditor is a popup and is trying to position itself the deprecated way if (popup && cellEditor.getPopupPosition && cellEditor.getPopupPosition() != null) { var msg_2 = "AG Grid: Found an issue in column " + col.getColId() + ". If using React, specify an editor popup position using colDef.cellEditorPopupPosition=true. AG Grid React cannot depend on the editor component specifying it's position (via the getPopupPosition() method on the editor), as React needs to know this information BEFORE the component is created."; ag_grid_community_1._.doOnce(function () { return console.warn(msg_2); }, 'jsEditorComp-getPopupPosition-' + cellCtrl.getColumn().getColId()); } }; var jsxEditValue = function (editDetails, setInlineCellEditorRef, setPopupCellEditorRef, eGui, cellCtrl, jsEditorComp) { var compDetails = editDetails.compDetails; var CellEditorClass = compDetails.componentClass; var reactInlineEditor = compDetails.componentFromFramework && !editDetails.popup; var reactPopupEditor = compDetails.componentFromFramework && editDetails.popup; var jsPopupEditor = !compDetails.componentFromFramework && editDetails.popup; return (react_1.default.createElement(react_1.default.Fragment, null, reactInlineEditor && react_1.default.createElement(CellEditorClass, __assign({}, editDetails.compDetails.params, { ref: setInlineCellEditorRef })), reactPopupEditor && react_1.default.createElement(popupEditorComp_1.default, { editDetails: editDetails, cellCtrl: cellCtrl, eParentCell: eGui, wrappedContent: react_1.default.createElement(CellEditorClass, __assign({}, editDetails.compDetails.params, { ref: setPopupCellEditorRef })) }), jsPopupEditor && jsEditorComp && react_1.default.createElement(popupEditorComp_1.default, { editDetails: editDetails, cellCtrl: cellCtrl, eParentCell: eGui, jsChildComp: jsEditorComp }))); }; var jsxShowValue = function (showDetails, key, parentId, cellRendererRef, showCellWrapper, reactCellRendererStateless, setECellValue) { var compDetails = showDetails.compDetails, value = showDetails.value; var noCellRenderer = !compDetails; var reactCellRenderer = compDetails && compDetails.componentFromFramework; var CellRendererClass = compDetails && compDetails.componentClass; // if we didn't do this, objects would cause React error. we depend on objects for things // like the aggregation functions avg and count, which return objects and depend on toString() // getting called. var valueForNoCellRenderer = (value === null || value === void 0 ? void 0 : value.toString) ? value.toString() : value; var bodyJsxFunc = function () { return (react_1.default.createElement(react_1.default.Fragment, null, noCellRenderer && react_1.default.createElement(react_1.default.Fragment, null, valueForNoCellRenderer), reactCellRenderer && !reactCellRendererStateless && react_1.default.createElement(CellRendererClass, __assign({}, compDetails.params, { key: key, ref: cellRendererRef })), reactCellRenderer && reactCellRendererStateless && react_1.default.createElement(CellRendererClass, __assign({}, compDetails.params, { key: key })))); }; return (react_1.default.createElement(react_1.default.Fragment, null, showCellWrapper ? (react_1.default.createElement("span", { role: "presentation", id: "cell-" + parentId, className: "ag-cell-value", ref: setECellValue }, bodyJsxFunc())) : bodyJsxFunc())); }; var CellComp = function (props) { var context = react_1.useContext(beansContext_1.BeansContext).context; var cellCtrl = props.cellCtrl, printLayout = props.printLayout, editingRow = props.editingRow; var _a = react_1.useState(), renderDetails = _a[0], setRenderDetails = _a[1]; var _b = react_1.useState(), editDetails = _b[0], setEditDetails = _b[1]; var _c = react_1.useState(1), renderKey = _c[0], setRenderKey = _c[1]; var _d = react_1.useState(), userStyles = _d[0], setUserStyles = _d[1]; var _e = react_1.useState(), tabIndex = _e[0], setTabIndex = _e[1]; var _f = react_1.useState(), role = _f[0], setRole = _f[1]; var _g = react_1.useState(), colId = _g[0], setColId = _g[1]; var _h = react_1.useState(), title = _h[0], setTitle = _h[1]; var _j = react_1.useState(false), includeSelection = _j[0], setIncludeSelection = _j[1]; var _k = react_1.useState(false), includeRowDrag = _k[0], setIncludeRowDrag = _k[1]; var _l = react_1.useState(false), includeDndSource = _l[0], setIncludeDndSource = _l[1]; var _m = react_1.useState(), jsEditorComp = _m[0], setJsEditorComp = _m[1]; var forceWrapper = react_1.useMemo(function () { return cellCtrl.isForceWrapper(); }, []); var eGui = react_1.useRef(null); var cellRendererRef = react_1.useRef(null); var jsCellRendererRef = react_1.useRef(); var cellEditorRef = react_1.useRef(); // when setting the ref, we also update the state item to force a re-render var eCellWrapper = react_1.useRef(); var _o = react_1.useState(0), cellWrapperVersion = _o[0], setCellWrapperVersion = _o[1]; var setCellWrapperRef = react_1.useCallback(function (ref) { eCellWrapper.current = ref; setCellWrapperVersion(function (v) { return v + 1; }); }, []); // when setting the ref, we also update the state item to force a re-render var eCellValue = react_1.useRef(); var _p = react_1.useState(0), cellValueVersion = _p[0], setCellValueVersion = _p[1]; var setCellValueRef = react_1.useCallback(function (ref) { eCellValue.current = ref; setCellValueVersion(function (v) { return v + 1; }); }, []); var showTools = renderDetails != null && (includeSelection || includeDndSource || includeRowDrag); var showCellWrapper = forceWrapper || showTools; var setCellEditorRef = react_1.useCallback(function (popup, cellEditor) { cellEditorRef.current = cellEditor; if (cellEditor) { checkCellEditorDeprecations(popup, cellEditor, cellCtrl); var editingCancelledByUserComp = cellEditor.isCancelBeforeStart && cellEditor.isCancelBeforeStart(); if (editingCancelledByUserComp) { // we cannot set state inside render, so hack is to do it in next VM turn setTimeout(function () { cellCtrl.stopEditing(true); cellCtrl.focusCell(true); }); } } }, []); var setPopupCellEditorRef = react_1.useCallback(function (cellRenderer) { return setCellEditorRef(true, cellRenderer); }, []); var setInlineCellEditorRef = react_1.useCallback(function (cellRenderer) { return setCellEditorRef(false, cellRenderer); }, []); var cssClassManager = react_1.useMemo(function () { return new ag_grid_community_1.CssClassManager(function () { return eGui.current; }); }, []); showJsRenderer_1.default(renderDetails, showCellWrapper, eCellValue.current, cellValueVersion, jsCellRendererRef, eGui); // if RenderDetails changed, need to call refresh. This is not our preferred way (the preferred // way for React is just allow the new props to propagate down to the React Cell Renderer) // however we do this for backwards compatibility, as having refresh used to be supported. var lastRenderDetails = react_1.useRef(); react_1.useEffect(function () { var oldDetails = lastRenderDetails.current; var newDetails = renderDetails; lastRenderDetails.current = renderDetails; // if not updating renderDetails, do nothing if (oldDetails == null || oldDetails.compDetails == null || newDetails == null || newDetails.compDetails == null) { return; } var oldCompDetails = oldDetails.compDetails; var newCompDetails = newDetails.compDetails; // if different Cell Renderer, then do nothing, as renderer will be recreated if (oldCompDetails.componentClass != newCompDetails.componentClass) { return; } // if no refresh method, do nothing if (cellRendererRef.current == null || cellRendererRef.current.refresh == null) { return; } var result = cellRendererRef.current.refresh(newCompDetails.params); if (result != true) { // increasing the render key forces the refresh. this is undocumented (for React users, // we don't document the refresh method, instead we tell them to act on new params). // however the GroupCellRenderer has this logic in it and would need a small refactor // to get it working without using refresh() returning false. so this hack staying in, // in React if refresh() is implemented and returns false (or undefined), we force a refresh setRenderKey(function (prev) { return prev + 1; }); } }, [renderDetails]); react_1.useEffect(function () { var doingJsEditor = editDetails && !editDetails.compDetails.componentFromFramework; if (!doingJsEditor) { return; } var compDetails = editDetails.compDetails; var isPopup = editDetails.popup === true; var cellEditor = jsComp_1.createSyncJsComp(compDetails); if (!cellEditor) { return; } var compGui = cellEditor.getGui(); setCellEditorRef(isPopup, cellEditor); if (!isPopup) { var parentEl = (forceWrapper ? eCellWrapper : eGui).current; parentEl === null || parentEl === void 0 ? void 0 : parentEl.appendChild(compGui); cellEditor.afterGuiAttached && cellEditor.afterGuiAttached(); } setJsEditorComp(cellEditor); return function () { context.destroyBean(cellEditor); setCellEditorRef(isPopup, undefined); setJsEditorComp(undefined); if (compGui && compGui.parentElement) { compGui.parentElement.removeChild(compGui); } }; }, [editDetails]); // tool widgets effect react_1.useEffect(function () { if (!cellCtrl || !context) { return; } if (!eCellWrapper.current || !showCellWrapper) { return; } var destroyFuncs = []; var addComp = function (comp) { if (comp) { var eGui_1 = comp.getGui(); eCellWrapper.current.insertAdjacentElement('afterbegin', eGui_1); destroyFuncs.push(function () { context.destroyBean(comp); ag_grid_community_1._.removeFromParent(eGui_1); }); } return comp; }; if (includeSelection) { var checkboxSelectionComp = cellCtrl.createSelectionCheckbox(); addComp(checkboxSelectionComp); } if (includeDndSource) { addComp(cellCtrl.createDndSource()); } if (includeRowDrag) { addComp(cellCtrl.createRowDragComp()); } return function () { return destroyFuncs.forEach(function (f) { return f(); }); }; }, [showCellWrapper, includeDndSource, includeRowDrag, includeSelection, cellWrapperVersion]); // we use layout effect here as we want to synchronously process setComp and it's side effects // to ensure the component is fully initialised prior to the first browser paint. See AG-7018. useEffectOnce_1.useLayoutEffectOnce(function () { if (!cellCtrl) { return; } var compProxy = { addOrRemoveCssClass: function (name, on) { return cssClassManager.addOrRemoveCssClass(name, on); }, setUserStyles: function (styles) { return setUserStyles(styles); }, getFocusableElement: function () { return eGui.current; }, setTabIndex: function (tabIndex) { return setTabIndex(tabIndex); }, setRole: function (role) { return setRole(role); }, setColId: function (colId) { return setColId(colId); }, setTitle: function (title) { return setTitle(title); }, setIncludeSelection: function (include) { return setIncludeSelection(include); }, setIncludeRowDrag: function (include) { return setIncludeRowDrag(include); }, setIncludeDndSource: function (include) { return setIncludeDndSource(include); }, getCellEditor: function () { return cellEditorRef.current || null; }, getCellRenderer: function () { return cellRendererRef.current ? cellRendererRef.current : jsCellRendererRef.current; }, getParentOfValue: function () { return eCellValue.current ? eCellValue.current : eCellWrapper.current ? eCellWrapper.current : eGui.current; }, setRenderDetails: function (compDetails, value, force) { setRenderDetails({ value: value, compDetails: compDetails, force: force }); }, setEditDetails: function (compDetails, popup, popupPosition) { if (compDetails) { // start editing setEditDetails({ compDetails: compDetails, popup: popup, popupPosition: popupPosition }); if (!popup) { setRenderDetails(undefined); } } else { // stop editing setEditDetails(undefined); } } }; var cellWrapperOrUndefined = eCellWrapper.current || undefined; cellCtrl.setComp(compProxy, eGui.current, cellWrapperOrUndefined, printLayout, editingRow); }); var reactCellRendererStateless = react_1.useMemo(function () { var res = renderDetails && renderDetails.compDetails && renderDetails.compDetails.componentFromFramework && utils_1.isComponentStateless(renderDetails.compDetails.componentClass); return !!res; }, [renderDetails]); react_1.useEffect(function () { var _a; if (!eGui.current) { return; } cssClassManager.addOrRemoveCssClass('ag-cell-value', !showCellWrapper); cssClassManager.addOrRemoveCssClass('ag-cell-inline-editing', !!editDetails && !editDetails.popup); cssClassManager.addOrRemoveCssClass('ag-cell-popup-editing', !!editDetails && !!editDetails.popup); cssClassManager.addOrRemoveCssClass('ag-cell-not-inline-editing', !editDetails || !!editDetails.popup); (_a = cellCtrl.getRowCtrl()) === null || _a === void 0 ? void 0 : _a.setInlineEditingCss(!!editDetails); }); var cellInstanceId = react_1.useMemo(function () { return cellCtrl.getInstanceId(); }, []); var showContents = function () { return (react_1.default.createElement(react_1.default.Fragment, null, (renderDetails != null && jsxShowValue(renderDetails, renderKey, cellInstanceId, cellRendererRef, showCellWrapper, reactCellRendererStateless, setCellValueRef)), (editDetails != null && jsxEditValue(editDetails, setInlineCellEditorRef, setPopupCellEditorRef, eGui.current, cellCtrl, jsEditorComp)))); }; return (react_1.default.createElement("div", { ref: eGui, style: userStyles, tabIndex: tabIndex, role: role, "col-id": colId, title: title }, showCellWrapper ? (react_1.default.createElement("div", { className: "ag-cell-wrapper", role: "presentation", ref: setCellWrapperRef }, showContents())) : showContents())); }; exports.default = react_1.memo(CellComp); /***/ }), /***/ "./node_modules/ag-grid-react/lib/reactUi/cells/popupEditorComp.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; // ag-grid-react v29.2.0 var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }); var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; Object.defineProperty(exports, "__esModule", { value: true }); var ag_grid_community_1 = __webpack_require__("./node_modules/ag-grid-community/dist/ag-grid-community.cjs.js"); var react_1 = __importStar(__webpack_require__("./node_modules/react/index.js")); var react_dom_1 = __webpack_require__("./node_modules/react-dom/index.js"); var beansContext_1 = __webpack_require__("./node_modules/ag-grid-react/lib/reactUi/beansContext.js"); var useEffectOnce_1 = __webpack_require__("./node_modules/ag-grid-react/lib/reactUi/useEffectOnce.js"); var PopupEditorComp = function (props) { var _a = react_1.useState(), popupEditorWrapper = _a[0], setPopupEditorWrapper = _a[1]; var _b = react_1.useContext(beansContext_1.BeansContext), context = _b.context, popupService = _b.popupService, localeService = _b.localeService, gridOptionsService = _b.gridOptionsService; useEffectOnce_1.useEffectOnce(function () { var editDetails = props.editDetails, cellCtrl = props.cellCtrl, eParentCell = props.eParentCell; var compDetails = editDetails.compDetails; var useModelPopup = gridOptionsService.is('stopEditingWhenCellsLoseFocus'); var wrapper = context.createBean(new ag_grid_community_1.PopupEditorWrapper(compDetails.params)); var ePopupGui = wrapper.getGui(); if (props.jsChildComp) { var eChildGui = props.jsChildComp.getGui(); if (eChildGui) { ePopupGui.appendChild(eChildGui); } } var positionParams = { column: cellCtrl.getColumn(), rowNode: cellCtrl.getRowNode(), type: 'popupCellEditor', eventSource: eParentCell, ePopup: ePopupGui, position: editDetails.popupPosition, keepWithinBounds: true }; var positionCallback = popupService.positionPopupByComponent.bind(popupService, positionParams); var translate = localeService.getLocaleTextFunc(); var addPopupRes = popupService.addPopup({ modal: useModelPopup, eChild: ePopupGui, closeOnEsc: true, closedCallback: function () { cellCtrl.onPopupEditorClosed(); }, anchorToElement: eParentCell, positionCallback: positionCallback, ariaLabel: translate('ariaLabelCellEditor', 'Cell Editor') }); var hideEditorPopup = addPopupRes ? addPopupRes.hideFunc : undefined; setPopupEditorWrapper(wrapper); props.jsChildComp && props.jsChildComp.afterGuiAttached && props.jsChildComp.afterGuiAttached(); return function () { if (hideEditorPopup != null) { hideEditorPopup(); } context.destroyBean(wrapper); }; }); return (react_1.default.createElement(react_1.default.Fragment, null, popupEditorWrapper && props.wrappedContent && react_dom_1.createPortal(props.wrappedContent, popupEditorWrapper.getGui()))); }; exports.default = react_1.memo(PopupEditorComp); /***/ }), /***/ "./node_modules/ag-grid-react/lib/reactUi/cells/showJsRenderer.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; // ag-grid-react v29.2.0 Object.defineProperty(exports, "__esModule", { value: true }); var react_1 = __webpack_require__("./node_modules/react/index.js"); var beansContext_1 = __webpack_require__("./node_modules/ag-grid-react/lib/reactUi/beansContext.js"); var useEffectOnce_1 = __webpack_require__("./node_modules/ag-grid-react/lib/reactUi/useEffectOnce.js"); var useJsCellRenderer = function (showDetails, showTools, eCellValue, cellValueVersion, jsCellRendererRef, eGui) { var _a = react_1.useContext(beansContext_1.BeansContext), context = _a.context, userComponentFactory = _a.userComponentFactory; var destroyCellRenderer = react_1.useCallback(function () { var comp = jsCellRendererRef.current; if (!comp) { return; } var compGui = comp.getGui(); if (compGui && compGui.parentElement) { compGui.parentElement.removeChild(compGui); } context.destroyBean(comp); jsCellRendererRef.current = undefined; }, []); // create or refresh JS cell renderer react_1.useEffect(function () { var showValue = showDetails != null; var jsCompDetails = showDetails && showDetails.compDetails && !showDetails.compDetails.componentFromFramework; var waitingForToolsSetup = showTools && eCellValue == null; var showComp = showValue && jsCompDetails && !waitingForToolsSetup; // if not showing comp, destroy any existing one and return if (!showComp) { destroyCellRenderer(); return; } var compDetails = showDetails.compDetails; if (jsCellRendererRef.current) { // attempt refresh if refresh method exists var comp_1 = jsCellRendererRef.current; var attemptRefresh = comp_1.refresh != null && showDetails.force == false; var refreshResult = attemptRefresh ? comp_1.refresh(compDetails.params) : false; var refreshWorked = refreshResult === true || refreshResult === undefined; // if refresh worked, nothing else to do if (refreshWorked) { return; } // if refresh didn't work, we destroy it and continue, so new cell renderer created below destroyCellRenderer(); } var promise = compDetails.newAgStackInstance(); ; if (!promise) { return; } var comp = promise.resolveNow(null, function (x) { return x; }); // js comps are never async if (!comp) { return; } var compGui = comp.getGui(); if (!compGui) { return; } var parent = showTools ? eCellValue : eGui.current; parent.appendChild(compGui); jsCellRendererRef.current = comp; }, [showDetails, showTools, cellValueVersion]); // this effect makes sure destroyCellRenderer gets called when the // component is destroyed. as the other effect only updates when there // is a change in state useEffectOnce_1.useEffectOnce(function () { return destroyCellRenderer; }); }; exports.default = useJsCellRenderer; /***/ }), /***/ "./node_modules/ag-grid-react/lib/reactUi/gridBodyComp.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; // ag-grid-react v29.2.0 var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }); var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); var ag_grid_community_1 = __webpack_require__("./node_modules/ag-grid-community/dist/ag-grid-community.cjs.js"); var react_1 = __importStar(__webpack_require__("./node_modules/react/index.js")); var beansContext_1 = __webpack_require__("./node_modules/ag-grid-react/lib/reactUi/beansContext.js"); var gridHeaderComp_1 = __importDefault(__webpack_require__("./node_modules/ag-grid-react/lib/reactUi/header/gridHeaderComp.js")); var reactComment_1 = __importDefault(__webpack_require__("./node_modules/ag-grid-react/lib/reactUi/reactComment.js")); var rowContainerComp_1 = __importDefault(__webpack_require__("./node_modules/ag-grid-react/lib/reactUi/rows/rowContainerComp.js")); var useEffectOnce_1 = __webpack_require__("./node_modules/ag-grid-react/lib/reactUi/useEffectOnce.js"); var utils_1 = __webpack_require__("./node_modules/ag-grid-react/lib/reactUi/utils.js"); var GridBodyComp = function () { var _a = react_1.useContext(beansContext_1.BeansContext), context = _a.context, agStackComponentsRegistry = _a.agStackComponentsRegistry, resizeObserverService = _a.resizeObserverService; var _b = react_1.useState(''), rowAnimationClass = _b[0], setRowAnimationClass = _b[1]; var _c = react_1.useState(0), ariaColCount = _c[0], setAriaColCount = _c[1]; var _d = react_1.useState(0), ariaRowCount = _d[0], setAriaRowCount = _d[1]; var _e = react_1.useState(0), topHeight = _e[0], setTopHeight = _e[1]; var _f = react_1.useState(0), bottomHeight = _f[0], setBottomHeight = _f[1]; var _g = react_1.useState('0px'), stickyTopHeight = _g[0], setStickyTopHeight = _g[1]; var _h = react_1.useState('0px'), stickyTopTop = _h[0], setStickyTopTop = _h[1]; var _j = react_1.useState('100%'), stickyTopWidth = _j[0], setStickyTopWidth = _j[1]; var _k = react_1.useState(''), topDisplay = _k[0], setTopDisplay = _k[1]; var _l = react_1.useState(''), bottomDisplay = _l[0], setBottomDisplay = _l[1]; var _m = react_1.useState(''), bodyViewportWidth = _m[0], setBodyViewportWidth = _m[1]; var _o = react_1.useState(null), forceVerticalScrollClass = _o[0], setForceVerticalScrollClass = _o[1]; var _p = react_1.useState(''), topAndBottomOverflowY = _p[0], setTopAndBottomOverflowY = _p[1]; var _q = react_1.useState(null), cellSelectableCss = _q[0], setCellSelectableCss = _q[1]; // we initialise layoutClass to 'ag-layout-normal', because if we don't, the comp will initially // render with no width (as ag-layout-normal sets width to 0, which is needed for flex) which // gives the grid a massive width, which then renders a massive amount of columns. this problem // is due to React been async, for the non-async version (ie when not using React) this is not a // problem as the UI will finish initialising before we set data. var _r = react_1.useState('ag-layout-normal'), layoutClass = _r[0], setLayoutClass = _r[1]; var cssClassManager = react_1.useMemo(function () { return new ag_grid_community_1.CssClassManager(function () { return eRoot.current; }); }, []); var eRoot = react_1.useRef(null); var eTop = react_1.useRef(null); var eStickyTop = react_1.useRef(null); var eBody = react_1.useRef(null); var eBodyViewport = react_1.useRef(null); var eBottom = react_1.useRef(null); reactComment_1.default(' AG Grid Body ', eRoot); reactComment_1.default(' AG Pinned Top ', eTop); reactComment_1.default(' AG Sticky Top ', eStickyTop); reactComment_1.default(' AG Middle ', eBodyViewport); reactComment_1.default(' AG Pinned Bottom ', eBottom); useEffectOnce_1.useEffectOnce(function () { var beansToDestroy = []; var destroyFuncs = []; if (!context) { return; } var newComp = function (tag) { var CompClass = agStackComponentsRegistry.getComponentClass(tag); var comp = context.createBean(new CompClass()); beansToDestroy.push(comp); return comp; }; eRoot.current.appendChild(document.createComment(' AG Fake Horizontal Scroll ')); eRoot.current.appendChild(newComp('AG-FAKE-HORIZONTAL-SCROLL').getGui()); eRoot.current.appendChild(document.createComment(' AG Overlay Wrapper ')); eRoot.current.appendChild(newComp('AG-OVERLAY-WRAPPER').getGui()); eBody.current.appendChild(document.createComment(' AG Fake Vertical Scroll ')); eBody.current.appendChild(newComp('AG-FAKE-VERTICAL-SCROLL').getGui()); var compProxy = { setRowAnimationCssOnBodyViewport: setRowAnimationClass, setColumnCount: setAriaColCount, setRowCount: setAriaRowCount, setTopHeight: setTopHeight, setBottomHeight: setBottomHeight, setStickyTopHeight: setStickyTopHeight, setStickyTopTop: setStickyTopTop, setStickyTopWidth: setStickyTopWidth, setTopDisplay: setTopDisplay, setBottomDisplay: setBottomDisplay, setColumnMovingCss: function (cssClass, flag) { return cssClassManager.addOrRemoveCssClass(cssClass, flag); }, updateLayoutClasses: setLayoutClass, setAlwaysVerticalScrollClass: setForceVerticalScrollClass, setPinnedTopBottomOverflowY: setTopAndBottomOverflowY, setCellSelectableCss: setCellSelectableCss, setBodyViewportWidth: setBodyViewportWidth, registerBodyViewportResizeListener: function (listener) { var unsubscribeFromResize = resizeObserverService.observeResize(eBodyViewport.current, listener); destroyFuncs.push(function () { return unsubscribeFromResize(); }); } }; var ctrl = context.createBean(new ag_grid_community_1.GridBodyCtrl()); beansToDestroy.push(ctrl); ctrl.setComp(compProxy, eRoot.current, eBodyViewport.current, eTop.current, eBottom.current, eStickyTop.current); return function () { context.destroyBeans(beansToDestroy); destroyFuncs.forEach(function (f) { return f(); }); }; }); var rootClasses = react_1.useMemo(function () { return utils_1.classesList('ag-root', 'ag-unselectable', layoutClass); }, [layoutClass]); var bodyViewportClasses = react_1.useMemo(function () { return utils_1.classesList('ag-body-viewport', rowAnimationClass, layoutClass, forceVerticalScrollClass, cellSelectableCss); }, [rowAnimationClass, layoutClass, forceVerticalScrollClass, cellSelectableCss]); var bodyClasses = react_1.useMemo(function () { return utils_1.classesList('ag-body', layoutClass); }, [layoutClass]); var bodyClipperClasses = react_1.useMemo(function () { return utils_1.classesList('ag-body-clipper', layoutClass); }, [layoutClass]); var topClasses = react_1.useMemo(function () { return utils_1.classesList('ag-floating-top', cellSelectableCss); }, [cellSelectableCss]); var stickyTopClasses = react_1.useMemo(function () { return utils_1.classesList('ag-sticky-top', cellSelectableCss); }, [cellSelectableCss]); var bottomClasses = react_1.useMemo(function () { return utils_1.classesList('ag-floating-bottom', cellSelectableCss); }, [cellSelectableCss]); var topStyle = react_1.useMemo(function () { return ({ height: topHeight, minHeight: topHeight, display: topDisplay, overflowY: topAndBottomOverflowY }); }, [topHeight, topDisplay, topAndBottomOverflowY]); var stickyTopStyle = react_1.useMemo(function () { return ({ height: stickyTopHeight, top: stickyTopTop, width: stickyTopWidth }); }, [stickyTopHeight, stickyTopTop, stickyTopWidth]); var bottomStyle = react_1.useMemo(function () { return ({ height: bottomHeight, minHeight: bottomHeight, display: bottomDisplay, overflowY: topAndBottomOverflowY }); }, [bottomHeight, bottomDisplay, topAndBottomOverflowY]); var bodyViewportStyle = react_1.useMemo(function () { return ({ width: bodyViewportWidth }); }, [bodyViewportWidth]); var createRowContainer = function (container) { return react_1.default.createElement(rowContainerComp_1.default, { name: container, key: container + "-container" }); }; var createSection = function (_a) { var section = _a.section, children = _a.children, className = _a.className, style = _a.style; return (react_1.default.createElement("div", { ref: section, className: className, role: "presentation", style: style }, children.map(createRowContainer))); }; return (react_1.default.createElement("div", { ref: eRoot, className: rootClasses, role: "treegrid", "aria-colcount": ariaColCount, "aria-rowcount": ariaRowCount }, react_1.default.createElement(gridHeaderComp_1.default, null), createSection({ section: eTop, className: topClasses, style: topStyle, children: [ ag_grid_community_1.RowContainerName.TOP_LEFT, ag_grid_community_1.RowContainerName.TOP_CENTER, ag_grid_community_1.RowContainerName.TOP_RIGHT, ag_grid_community_1.RowContainerName.TOP_FULL_WIDTH, ] }), react_1.default.createElement("div", { className: bodyClasses, ref: eBody, role: "presentation" }, react_1.default.createElement("div", { className: bodyClipperClasses, role: "presentation" }, createSection({ section: eBodyViewport, className: bodyViewportClasses, style: bodyViewportStyle, children: [ ag_grid_community_1.RowContainerName.LEFT, ag_grid_community_1.RowContainerName.CENTER, ag_grid_community_1.RowContainerName.RIGHT, ag_grid_community_1.RowContainerName.FULL_WIDTH, ] }))), createSection({ section: eStickyTop, className: stickyTopClasses, style: stickyTopStyle, children: [ ag_grid_community_1.RowContainerName.STICKY_TOP_LEFT, ag_grid_community_1.RowContainerName.STICKY_TOP_CENTER, ag_grid_community_1.RowContainerName.STICKY_TOP_RIGHT, ag_grid_community_1.RowContainerName.STICKY_TOP_FULL_WIDTH, ] }), createSection({ section: eBottom, className: bottomClasses, style: bottomStyle, children: [ ag_grid_community_1.RowContainerName.BOTTOM_LEFT, ag_grid_community_1.RowContainerName.BOTTOM_CENTER, ag_grid_community_1.RowContainerName.BOTTOM_RIGHT, ag_grid_community_1.RowContainerName.BOTTOM_FULL_WIDTH, ] }))); }; exports.default = react_1.memo(GridBodyComp); /***/ }), /***/ "./node_modules/ag-grid-react/lib/reactUi/gridComp.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; // ag-grid-react v29.2.0 var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }); var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); var ag_grid_community_1 = __webpack_require__("./node_modules/ag-grid-community/dist/ag-grid-community.cjs.js"); var react_1 = __importStar(__webpack_require__("./node_modules/react/index.js")); var beansContext_1 = __webpack_require__("./node_modules/ag-grid-react/lib/reactUi/beansContext.js"); var gridBodyComp_1 = __importDefault(__webpack_require__("./node_modules/ag-grid-react/lib/reactUi/gridBodyComp.js")); var reactComment_1 = __importDefault(__webpack_require__("./node_modules/ag-grid-react/lib/reactUi/reactComment.js")); var tabGuardComp_1 = __importDefault(__webpack_require__("./node_modules/ag-grid-react/lib/reactUi/tabGuardComp.js")); var useEffectOnce_1 = __webpack_require__("./node_modules/ag-grid-react/lib/reactUi/useEffectOnce.js"); var utils_1 = __webpack_require__("./node_modules/ag-grid-react/lib/reactUi/utils.js"); var GridComp = function (_a) { var context = _a.context; var _b = react_1.useState(''), rtlClass = _b[0], setRtlClass = _b[1]; var _c = react_1.useState(''), keyboardFocusClass = _c[0], setKeyboardFocusClass = _c[1]; var _d = react_1.useState(''), layoutClass = _d[0], setLayoutClass = _d[1]; var _e = react_1.useState(null), cursor = _e[0], setCursor = _e[1]; var _f = react_1.useState(null), userSelect = _f[0], setUserSelect = _f[1]; var _g = react_1.useState(false), initialised = _g[0], setInitialised = _g[1]; var _h = react_1.useState(), tabGuardReady = _h[0], setTabGuardReady = _h[1]; var gridCtrlRef = react_1.useRef(null); var eRootWrapperRef = react_1.useRef(null); var tabGuardRef = react_1.useRef(); var eGridBodyParentRef = react_1.useRef(null); var focusInnerElementRef = react_1.useRef(function () { return undefined; }); var onTabKeyDown = react_1.useCallback(function () { return undefined; }, []); var beans = react_1.useMemo(function () { return context.getBean('beans'); }, []); reactComment_1.default(' AG Grid ', eRootWrapperRef); // create shared controller. useEffectOnce_1.useEffectOnce(function () { var currentController = gridCtrlRef.current = context.createBean(new ag_grid_community_1.GridCtrl()); return function () { context.destroyBean(currentController); gridCtrlRef.current = null; }; }); // initialise the UI useEffectOnce_1.useEffectOnce(function () { var gridCtrl = gridCtrlRef.current; focusInnerElementRef.current = gridCtrl.focusInnerElement.bind(gridCtrl); var compProxy = { destroyGridUi: function () { }, setRtlClass: setRtlClass, addOrRemoveKeyboardFocusClass: function (addOrRemove) { return setKeyboardFocusClass(addOrRemove ? ag_grid_community_1.FocusService.AG_KEYBOARD_FOCUS : ''); }, forceFocusOutOfContainer: function () { tabGuardRef.current.forceFocusOutOfContainer(); }, updateLayoutClasses: setLayoutClass, getFocusableContainers: function () { var els = []; var gridBodyCompEl = eRootWrapperRef.current.querySelector('.ag-root'); var sideBarEl = eRootWrapperRef.current.querySelector('.ag-side-bar:not(.ag-hidden)'); if (gridBodyCompEl) { els.push(gridBodyCompEl); } if (sideBarEl) { els.push(sideBarEl); } return els; }, setCursor: setCursor, setUserSelect: setUserSelect }; gridCtrl.setComp(compProxy, eRootWrapperRef.current, eRootWrapperRef.current); setInitialised(true); }); // initialise the extra components react_1.useEffect(function () { if (!tabGuardReady) { return; } var gridCtrl = gridCtrlRef.current; var beansToDestroy = []; var agStackComponentsRegistry = beans.agStackComponentsRegistry; var HeaderDropZonesClass = agStackComponentsRegistry.getComponentClass('AG-GRID-HEADER-DROP-ZONES'); var SideBarClass = agStackComponentsRegistry.getComponentClass('AG-SIDE-BAR'); var StatusBarClass = agStackComponentsRegistry.getComponentClass('AG-STATUS-BAR'); var WatermarkClass = agStackComponentsRegistry.getComponentClass('AG-WATERMARK'); var PaginationClass = agStackComponentsRegistry.getComponentClass('AG-PAGINATION'); var additionalEls = []; var eRootWrapper = eRootWrapperRef.current; var eGridBodyParent = eGridBodyParentRef.current; if (gridCtrl.showDropZones() && HeaderDropZonesClass) { var headerDropZonesComp = context.createBean(new HeaderDropZonesClass()); var eGui = headerDropZonesComp.getGui(); eRootWrapper.insertAdjacentElement('afterbegin', eGui); additionalEls.push(eGui); beansToDestroy.push(headerDropZonesComp); } if (gridCtrl.showSideBar() && SideBarClass) { var sideBarComp = context.createBean(new SideBarClass()); var eGui = sideBarComp.getGui(); var bottomTabGuard = eGridBodyParent.querySelector('.ag-tab-guard-bottom'); if (bottomTabGuard) { bottomTabGuard.insertAdjacentElement('beforebegin', eGui); additionalEls.push(eGui); } beansToDestroy.push(sideBarComp); } if (gridCtrl.showStatusBar() && StatusBarClass) { var statusBarComp = context.createBean(new StatusBarClass()); var eGui = statusBarComp.getGui(); eRootWrapper.insertAdjacentElement('beforeend', eGui); additionalEls.push(eGui); beansToDestroy.push(statusBarComp); } if (PaginationClass) { var paginationComp = context.createBean(new PaginationClass()); var eGui = paginationComp.getGui(); eRootWrapper.insertAdjacentElement('beforeend', eGui); additionalEls.push(eGui); beansToDestroy.push(paginationComp); } if (gridCtrl.showWatermark() && WatermarkClass) { var watermarkComp = context.createBean(new WatermarkClass()); var eGui = watermarkComp.getGui(); eRootWrapper.insertAdjacentElement('beforeend', eGui); additionalEls.push(eGui); beansToDestroy.push(watermarkComp); } return function () { context.destroyBeans(beansToDestroy); additionalEls.forEach(function (el) { if (el.parentElement) { el.parentElement.removeChild(el); } }); }; }, [tabGuardReady]); var rootWrapperClasses = react_1.useMemo(function () { return utils_1.classesList('ag-root-wrapper', rtlClass, keyboardFocusClass, layoutClass); }, [rtlClass, keyboardFocusClass, layoutClass]); var rootWrapperBodyClasses = react_1.useMemo(function () { return utils_1.classesList('ag-root-wrapper-body', 'ag-focus-managed', layoutClass); }, [layoutClass]); var topStyle = react_1.useMemo(function () { return ({ userSelect: userSelect != null ? userSelect : '', WebkitUserSelect: userSelect != null ? userSelect : '', cursor: cursor != null ? cursor : '' }); }, [userSelect, cursor]); var eGridBodyParent = eGridBodyParentRef.current; var setTabGuardCompRef = react_1.useCallback(function (ref) { tabGuardRef.current = ref; setTabGuardReady(true); }, []); return (react_1.default.createElement("div", { ref: eRootWrapperRef, className: rootWrapperClasses, style: topStyle, role: "presentation" }, react_1.default.createElement("div", { className: rootWrapperBodyClasses, ref: eGridBodyParentRef, role: "presentation" }, initialised && eGridBodyParent && react_1.default.createElement(beansContext_1.BeansContext.Provider, { value: beans }, react_1.default.createElement(tabGuardComp_1.default, { ref: setTabGuardCompRef, eFocusableElement: eGridBodyParent, onTabKeyDown: onTabKeyDown, gridCtrl: gridCtrlRef.current }, // we wait for initialised before rending the children, so GridComp has created and registered with it's // GridCtrl before we create the child GridBodyComp. Otherwise the GridBodyComp would initialise first, // before we have set the the Layout CSS classes, causing the GridBodyComp to render rows to a grid that // doesn't have it's height specified, which would result if all the rows getting rendered (and if many rows, // hangs the UI) react_1.default.createElement(gridBodyComp_1.default, null)))))); }; exports.default = react_1.memo(GridComp); /***/ }), /***/ "./node_modules/ag-grid-react/lib/reactUi/header/gridHeaderComp.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; // ag-grid-react v29.2.0 var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }); var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); var react_1 = __importStar(__webpack_require__("./node_modules/react/index.js")); var beansContext_1 = __webpack_require__("./node_modules/ag-grid-react/lib/reactUi/beansContext.js"); var ag_grid_community_1 = __webpack_require__("./node_modules/ag-grid-community/dist/ag-grid-community.cjs.js"); var utils_1 = __webpack_require__("./node_modules/ag-grid-react/lib/reactUi/utils.js"); var headerRowContainerComp_1 = __importDefault(__webpack_require__("./node_modules/ag-grid-react/lib/reactUi/header/headerRowContainerComp.js")); var useEffectOnce_1 = __webpack_require__("./node_modules/ag-grid-react/lib/reactUi/useEffectOnce.js"); var GridHeaderComp = function () { var _a = react_1.useState(new utils_1.CssClasses()), cssClasses = _a[0], setCssClasses = _a[1]; var _b = react_1.useState(), height = _b[0], setHeight = _b[1]; var context = react_1.useContext(beansContext_1.BeansContext).context; var eGui = react_1.useRef(null); useEffectOnce_1.useLayoutEffectOnce(function () { var compProxy = { addOrRemoveCssClass: function (name, on) { return setCssClasses(function (prev) { return prev.setClass(name, on); }); }, setHeightAndMinHeight: function (height) { return setHeight(height); } }; var ctrl = context.createBean(new ag_grid_community_1.GridHeaderCtrl()); ctrl.setComp(compProxy, eGui.current, eGui.current); return function () { context.destroyBean(ctrl); }; }); var className = react_1.useMemo(function () { var res = cssClasses.toString(); return 'ag-header ' + res; }, [cssClasses]); var style = react_1.useMemo(function () { return ({ height: height, minHeight: height }); }, [height]); return (react_1.default.createElement("div", { ref: eGui, className: className, style: style, role: "presentation" }, react_1.default.createElement(headerRowContainerComp_1.default, { pinned: 'left' }), react_1.default.createElement(headerRowContainerComp_1.default, { pinned: null }), react_1.default.createElement(headerRowContainerComp_1.default, { pinned: 'right' }))); }; exports.default = react_1.memo(GridHeaderComp); /***/ }), /***/ "./node_modules/ag-grid-react/lib/reactUi/header/headerCellComp.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; // ag-grid-react v29.2.0 var __assign = (this && this.__assign) || function () { __assign = Object.assign || function(t) { for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; } return t; }; return __assign.apply(this, arguments); }; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }); var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; Object.defineProperty(exports, "__esModule", { value: true }); var react_1 = __importStar(__webpack_require__("./node_modules/react/index.js")); var beansContext_1 = __webpack_require__("./node_modules/ag-grid-react/lib/reactUi/beansContext.js"); var ag_grid_community_1 = __webpack_require__("./node_modules/ag-grid-community/dist/ag-grid-community.cjs.js"); var utils_1 = __webpack_require__("./node_modules/ag-grid-react/lib/reactUi/utils.js"); var jsComp_1 = __webpack_require__("./node_modules/ag-grid-react/lib/reactUi/jsComp.js"); var useEffectOnce_1 = __webpack_require__("./node_modules/ag-grid-react/lib/reactUi/useEffectOnce.js"); var HeaderCellComp = function (props) { var context = react_1.useContext(beansContext_1.BeansContext).context; var _a = react_1.useState(), width = _a[0], setWidth = _a[1]; var _b = react_1.useState(), title = _b[0], setTitle = _b[1]; var _c = react_1.useState(), colId = _c[0], setColId = _c[1]; var _d = react_1.useState(), ariaSort = _d[0], setAriaSort = _d[1]; var _e = react_1.useState(), ariaDescription = _e[0], setAriaDescription = _e[1]; var _f = react_1.useState(), userCompDetails = _f[0], setUserCompDetails = _f[1]; var eGui = react_1.useRef(null); var eResize = react_1.useRef(null); var eHeaderCompWrapper = react_1.useRef(null); var userCompRef = react_1.useRef(); var ctrl = props.ctrl; var cssClassManager = react_1.useMemo(function () { return new ag_grid_community_1.CssClassManager(function () { return eGui.current; }); }, []); useEffectOnce_1.useLayoutEffectOnce(function () { var compProxy = { setWidth: function (width) { return setWidth(width); }, addOrRemoveCssClass: function (name, on) { return cssClassManager.addOrRemoveCssClass(name, on); }, setColId: function (id) { return setColId(id); }, setTitle: function (title) { return setTitle(title); }, setAriaDescription: function (description) { return setAriaDescription(description); }, setAriaSort: function (sort) { return setAriaSort(sort); }, setUserCompDetails: function (compDetails) { return setUserCompDetails(compDetails); }, getUserCompInstance: function () { return userCompRef.current || undefined; } }; ctrl.setComp(compProxy, eGui.current, eResize.current, eHeaderCompWrapper.current); var selectAllGui = ctrl.getSelectAllGui(); eResize.current.insertAdjacentElement('afterend', selectAllGui); }); // js comps react_1.useLayoutEffect(function () { return jsComp_1.showJsComp(userCompDetails, context, eHeaderCompWrapper.current, userCompRef); }, [userCompDetails]); // add drag handling, must be done after component is added to the dom react_1.useEffect(function () { ctrl.setDragSource(eGui.current); }, [userCompDetails]); var style = react_1.useMemo(function () { return ({ width: width }); }, [width]); var userCompStateless = react_1.useMemo(function () { var res = (userCompDetails === null || userCompDetails === void 0 ? void 0 : userCompDetails.componentFromFramework) && utils_1.isComponentStateless(userCompDetails.componentClass); return !!res; }, [userCompDetails]); var reactUserComp = userCompDetails && userCompDetails.componentFromFramework; var UserCompClass = userCompDetails && userCompDetails.componentClass; return (react_1.default.createElement("div", { ref: eGui, className: "ag-header-cell", style: style, title: title, "col-id": colId, "aria-sort": ariaSort, role: "columnheader", tabIndex: -1, "aria-description": ariaDescription }, react_1.default.createElement("div", { ref: eResize, className: "ag-header-cell-resize", role: "presentation" }), react_1.default.createElement("div", { ref: eHeaderCompWrapper, className: "ag-header-cell-comp-wrapper", role: "presentation" }, reactUserComp && userCompStateless && react_1.default.createElement(UserCompClass, __assign({}, userCompDetails.params)), reactUserComp && !userCompStateless && react_1.default.createElement(UserCompClass, __assign({}, userCompDetails.params, { ref: userCompRef }))))); }; exports.default = react_1.memo(HeaderCellComp); /***/ }), /***/ "./node_modules/ag-grid-react/lib/reactUi/header/headerFilterCellComp.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; // ag-grid-react v29.2.0 var __assign = (this && this.__assign) || function () { __assign = Object.assign || function(t) { for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; } return t; }; return __assign.apply(this, arguments); }; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }); var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; Object.defineProperty(exports, "__esModule", { value: true }); var react_1 = __importStar(__webpack_require__("./node_modules/react/index.js")); var beansContext_1 = __webpack_require__("./node_modules/ag-grid-react/lib/reactUi/beansContext.js"); var ag_grid_community_1 = __webpack_require__("./node_modules/ag-grid-community/dist/ag-grid-community.cjs.js"); var utils_1 = __webpack_require__("./node_modules/ag-grid-react/lib/reactUi/utils.js"); var jsComp_1 = __webpack_require__("./node_modules/ag-grid-react/lib/reactUi/jsComp.js"); var useEffectOnce_1 = __webpack_require__("./node_modules/ag-grid-react/lib/reactUi/useEffectOnce.js"); var HeaderFilterCellComp = function (props) { var context = react_1.useContext(beansContext_1.BeansContext).context; var _a = react_1.useState(new utils_1.CssClasses('ag-header-cell', 'ag-floating-filter')), cssClasses = _a[0], setCssClasses = _a[1]; var _b = react_1.useState(new utils_1.CssClasses()), cssBodyClasses = _b[0], setBodyCssClasses = _b[1]; var _c = react_1.useState(new utils_1.CssClasses('ag-floating-filter-button', 'ag-hidden')), cssButtonWrapperClasses = _c[0], setButtonWrapperCssClasses = _c[1]; var _d = react_1.useState("false"), buttonWrapperAriaHidden = _d[0], setButtonWrapperAriaHidden = _d[1]; var _e = react_1.useState(), width = _e[0], setWidth = _e[1]; var _f = react_1.useState(), userCompDetails = _f[0], setUserCompDetails = _f[1]; var eGui = react_1.useRef(null); var eFloatingFilterBody = react_1.useRef(null); var eButtonWrapper = react_1.useRef(null); var eButtonShowMainFilter = react_1.useRef(null); var alreadyResolved = react_1.useRef(false); var userCompResolve = react_1.useRef(); var userCompPromise = react_1.useRef(); useEffectOnce_1.useLayoutEffectOnce(function () { userCompPromise.current = new ag_grid_community_1.AgPromise(function (resolve) { userCompResolve.current = resolve; }); }); var userCompRef = function (value) { // i don't know why, but react was calling this method multiple // times, thus un-setting, them immediately setting the reference again. // because we are resolving a promise, it's not good to be resolving // the promise multiple times, so we only resolve the first time. if (alreadyResolved.current) { return; } // we also skip when it's un-setting if (value == null) { return; } userCompResolve.current && userCompResolve.current(value); alreadyResolved.current = true; }; var ctrl = props.ctrl; useEffectOnce_1.useLayoutEffectOnce(function () { var compProxy = { addOrRemoveCssClass: function (name, on) { return setCssClasses(function (prev) { return prev.setClass(name, on); }); }, addOrRemoveBodyCssClass: function (name, on) { return setBodyCssClasses(function (prev) { return prev.setClass(name, on); }); }, setButtonWrapperDisplayed: function (displayed) { setButtonWrapperCssClasses(function (prev) { return prev.setClass('ag-hidden', !displayed); }); setButtonWrapperAriaHidden(!displayed ? "true" : "false"); }, setWidth: function (width) { return setWidth(width); }, setCompDetails: function (compDetails) { return setUserCompDetails(compDetails); }, getFloatingFilterComp: function () { return userCompPromise.current ? userCompPromise.current : null; }, setMenuIcon: function (eIcon) { return eButtonShowMainFilter.current.appendChild(eIcon); } }; ctrl.setComp(compProxy, eGui.current, eButtonShowMainFilter.current, eFloatingFilterBody.current); }); // js comps react_1.useLayoutEffect(function () { return jsComp_1.showJsComp(userCompDetails, context, eFloatingFilterBody.current, userCompRef); }, [userCompDetails]); var style = react_1.useMemo(function () { return ({ width: width }); }, [width]); var className = react_1.useMemo(function () { return cssClasses.toString(); }, [cssClasses]); var bodyClassName = react_1.useMemo(function () { return cssBodyClasses.toString(); }, [cssBodyClasses]); var buttonWrapperClassName = react_1.useMemo(function () { return cssButtonWrapperClasses.toString(); }, [cssButtonWrapperClasses]); var userCompStateless = react_1.useMemo(function () { var res = userCompDetails && userCompDetails.componentFromFramework && utils_1.isComponentStateless(userCompDetails.componentClass); return !!res; }, [userCompDetails]); var reactUserComp = userCompDetails && userCompDetails.componentFromFramework; var UserCompClass = userCompDetails && userCompDetails.componentClass; return (react_1.default.createElement("div", { ref: eGui, className: className, style: style, role: "gridcell", tabIndex: -1 }, react_1.default.createElement("div", { ref: eFloatingFilterBody, className: bodyClassName, role: "presentation" }, reactUserComp && userCompStateless && react_1.default.createElement(UserCompClass, __assign({}, userCompDetails.params)), reactUserComp && !userCompStateless && react_1.default.createElement(UserCompClass, __assign({}, userCompDetails.params, { ref: userCompRef }))), react_1.default.createElement("div", { ref: eButtonWrapper, "aria-hidden": buttonWrapperAriaHidden, className: buttonWrapperClassName, role: "presentation" }, react_1.default.createElement("button", { ref: eButtonShowMainFilter, type: "button", "aria-label": "Open Filter Menu", className: "ag-floating-filter-button-button", tabIndex: -1 })))); }; exports.default = react_1.memo(HeaderFilterCellComp); /***/ }), /***/ "./node_modules/ag-grid-react/lib/reactUi/header/headerGroupCellComp.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; // ag-grid-react v29.2.0 var __assign = (this && this.__assign) || function () { __assign = Object.assign || function(t) { for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; } return t; }; return __assign.apply(this, arguments); }; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }); var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; Object.defineProperty(exports, "__esModule", { value: true }); var react_1 = __importStar(__webpack_require__("./node_modules/react/index.js")); var beansContext_1 = __webpack_require__("./node_modules/ag-grid-react/lib/reactUi/beansContext.js"); var jsComp_1 = __webpack_require__("./node_modules/ag-grid-react/lib/reactUi/jsComp.js"); var useEffectOnce_1 = __webpack_require__("./node_modules/ag-grid-react/lib/reactUi/useEffectOnce.js"); var utils_1 = __webpack_require__("./node_modules/ag-grid-react/lib/reactUi/utils.js"); var HeaderGroupCellComp = function (props) { var context = react_1.useContext(beansContext_1.BeansContext).context; var _a = react_1.useState(new utils_1.CssClasses()), cssClasses = _a[0], setCssClasses = _a[1]; var _b = react_1.useState(new utils_1.CssClasses()), cssResizableClasses = _b[0], setResizableCssClasses = _b[1]; var _c = react_1.useState("false"), resizableAriaHidden = _c[0], setResizableAriaHidden = _c[1]; var _d = react_1.useState(), width = _d[0], setWidth = _d[1]; var _e = react_1.useState(), title = _e[0], setTitle = _e[1]; var _f = react_1.useState(), colId = _f[0], setColId = _f[1]; var _g = react_1.useState(), ariaExpanded = _g[0], setAriaExpanded = _g[1]; var _h = react_1.useState(), userCompDetails = _h[0], setUserCompDetails = _h[1]; var eGui = react_1.useRef(null); var eResize = react_1.useRef(null); var ctrl = props.ctrl; useEffectOnce_1.useLayoutEffectOnce(function () { var compProxy = { setWidth: function (width) { return setWidth(width); }, addOrRemoveCssClass: function (name, on) { return setCssClasses(function (prev) { return prev.setClass(name, on); }); }, setColId: function (id) { return setColId(id); }, setTitle: function (title) { return setTitle(title); }, setUserCompDetails: function (compDetails) { return setUserCompDetails(compDetails); }, setResizableDisplayed: function (displayed) { setResizableCssClasses(function (prev) { return prev.setClass('ag-hidden', !displayed); }); setResizableAriaHidden(!displayed ? "true" : "false"); }, setAriaExpanded: function (expanded) { return setAriaExpanded(expanded); } }; ctrl.setComp(compProxy, eGui.current, eResize.current); }); // js comps react_1.useLayoutEffect(function () { return jsComp_1.showJsComp(userCompDetails, context, eGui.current); }, [userCompDetails]); // add drag handling, must be done after component is added to the dom react_1.useEffect(function () { var userCompDomElement = undefined; eGui.current.childNodes.forEach(function (node) { if (node != null && node !== eResize.current) { userCompDomElement = node; } }); userCompDomElement && ctrl.setDragSource(userCompDomElement); }, [userCompDetails]); var style = react_1.useMemo(function () { return ({ width: width }); }, [width]); var className = react_1.useMemo(function () { return 'ag-header-group-cell ' + cssClasses.toString(); }, [cssClasses]); var resizableClassName = react_1.useMemo(function () { return 'ag-header-cell-resize ' + cssResizableClasses.toString(); }, [cssResizableClasses]); var reactUserComp = userCompDetails && userCompDetails.componentFromFramework; var UserCompClass = userCompDetails && userCompDetails.componentClass; return (react_1.default.createElement("div", { ref: eGui, className: className, style: style, title: title, "col-id": colId, role: "columnheader", tabIndex: -1, "aria-expanded": ariaExpanded }, reactUserComp && react_1.default.createElement(UserCompClass, __assign({}, userCompDetails.params)), react_1.default.createElement("div", { ref: eResize, "aria-hidden": resizableAriaHidden, className: resizableClassName }))); }; exports.default = react_1.memo(HeaderGroupCellComp); /***/ }), /***/ "./node_modules/ag-grid-react/lib/reactUi/header/headerRowComp.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; // ag-grid-react v29.2.0 var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }); var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; var __spreadArrays = (this && this.__spreadArrays) || function () { for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; for (var r = Array(s), k = 0, i = 0; i < il; i++) for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) r[k] = a[j]; return r; }; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); var ag_grid_community_1 = __webpack_require__("./node_modules/ag-grid-community/dist/ag-grid-community.cjs.js"); var react_1 = __importStar(__webpack_require__("./node_modules/react/index.js")); var beansContext_1 = __webpack_require__("./node_modules/ag-grid-react/lib/reactUi/beansContext.js"); var headerCellComp_1 = __importDefault(__webpack_require__("./node_modules/ag-grid-react/lib/reactUi/header/headerCellComp.js")); var headerGroupCellComp_1 = __importDefault(__webpack_require__("./node_modules/ag-grid-react/lib/reactUi/header/headerGroupCellComp.js")); var headerFilterCellComp_1 = __importDefault(__webpack_require__("./node_modules/ag-grid-react/lib/reactUi/header/headerFilterCellComp.js")); var useEffectOnce_1 = __webpack_require__("./node_modules/ag-grid-react/lib/reactUi/useEffectOnce.js"); var HeaderRowComp = function (props) { var gridOptionsService = react_1.useContext(beansContext_1.BeansContext).gridOptionsService; var _a = react_1.useState(), transform = _a[0], setTransform = _a[1]; var _b = react_1.useState(), height = _b[0], setHeight = _b[1]; var _c = react_1.useState(), top = _c[0], setTop = _c[1]; var _d = react_1.useState(), width = _d[0], setWidth = _d[1]; var _e = react_1.useState(), ariaRowIndex = _e[0], setAriaRowIndex = _e[1]; var _f = react_1.useState([]), cellCtrls = _f[0], setCellCtrls = _f[1]; var eGui = react_1.useRef(null); var ctrl = props.ctrl; var typeColumn = ctrl.getType() === ag_grid_community_1.HeaderRowType.COLUMN; var typeGroup = ctrl.getType() === ag_grid_community_1.HeaderRowType.COLUMN_GROUP; var typeFilter = ctrl.getType() === ag_grid_community_1.HeaderRowType.FLOATING_FILTER; var setCellCtrlsMaintainOrder = react_1.useCallback(function (prev, next) { var isEnsureDomOrder = gridOptionsService.is('ensureDomOrder'); var isPrintLayout = gridOptionsService.isDomLayout('print'); // if we are ensuring dom order, we set the ctrls into the dom in the same order they appear on screen if (isEnsureDomOrder || isPrintLayout) { return next; } // if not maintaining order, we want to keep the dom elements we have and add new ones to the end, // otherwise we will loose transition effects as elements are placed in different dom locations var prevMap = ag_grid_community_1._.mapById(prev, function (c) { return c.getInstanceId(); }); var nextMap = ag_grid_community_1._.mapById(next, function (c) { return c.getInstanceId(); }); var oldCtrlsWeAreKeeping = prev.filter(function (c) { return nextMap.has(c.getInstanceId()); }); var newCtrls = next.filter(function (c) { return !prevMap.has(c.getInstanceId()); }); return __spreadArrays(oldCtrlsWeAreKeeping, newCtrls); }, []); useEffectOnce_1.useLayoutEffectOnce(function () { var compProxy = { setTransform: function (transform) { return setTransform(transform); }, setHeight: function (height) { return setHeight(height); }, setTop: function (top) { return setTop(top); }, setHeaderCtrls: function (ctrls) { return setCellCtrls(function (prev) { return setCellCtrlsMaintainOrder(prev, ctrls); }); }, setWidth: function (width) { return setWidth(width); }, setAriaRowIndex: function (rowIndex) { return setAriaRowIndex(rowIndex); } }; ctrl.setComp(compProxy); }); var style = react_1.useMemo(function () { return ({ transform: transform, height: height, top: top, width: width }); }, [transform, height, top, width]); var className = react_1.useMemo(function () { var res = ["ag-header-row"]; typeColumn && res.push("ag-header-row-column"); typeGroup && res.push("ag-header-row-column-group"); typeFilter && res.push("ag-header-row-column-filter"); return res.join(' '); }, []); var createCellJsx = react_1.useCallback(function (cellCtrl) { switch (ctrl.getType()) { case ag_grid_community_1.HeaderRowType.COLUMN_GROUP: return react_1.default.createElement(headerGroupCellComp_1.default, { ctrl: cellCtrl, key: cellCtrl.getInstanceId() }); case ag_grid_community_1.HeaderRowType.FLOATING_FILTER: return react_1.default.createElement(headerFilterCellComp_1.default, { ctrl: cellCtrl, key: cellCtrl.getInstanceId() }); default: return react_1.default.createElement(headerCellComp_1.default, { ctrl: cellCtrl, key: cellCtrl.getInstanceId() }); } }, []); return (react_1.default.createElement("div", { ref: eGui, className: className, role: "row", style: style, "aria-rowindex": ariaRowIndex }, cellCtrls.map(createCellJsx))); }; exports.default = react_1.memo(HeaderRowComp); /***/ }), /***/ "./node_modules/ag-grid-react/lib/reactUi/header/headerRowContainerComp.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; // ag-grid-react v29.2.0 var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }); var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); var react_1 = __importStar(__webpack_require__("./node_modules/react/index.js")); var beansContext_1 = __webpack_require__("./node_modules/ag-grid-react/lib/reactUi/beansContext.js"); var ag_grid_community_1 = __webpack_require__("./node_modules/ag-grid-community/dist/ag-grid-community.cjs.js"); var utils_1 = __webpack_require__("./node_modules/ag-grid-react/lib/reactUi/utils.js"); var headerRowComp_1 = __importDefault(__webpack_require__("./node_modules/ag-grid-react/lib/reactUi/header/headerRowComp.js")); var useEffectOnce_1 = __webpack_require__("./node_modules/ag-grid-react/lib/reactUi/useEffectOnce.js"); var HeaderRowContainerComp = function (props) { var _a = react_1.useState(new utils_1.CssClasses()), cssClasses = _a[0], setCssClasses = _a[1]; var _b = react_1.useState(false), ariaHidden = _b[0], setAriaHidden = _b[1]; var _c = react_1.useState([]), headerRowCtrls = _c[0], setHeaderRowCtrls = _c[1]; var context = react_1.useContext(beansContext_1.BeansContext).context; var eGui = react_1.useRef(null); var eCenterContainer = react_1.useRef(null); var pinnedLeft = props.pinned === 'left'; var pinnedRight = props.pinned === 'right'; var centre = !pinnedLeft && !pinnedRight; useEffectOnce_1.useLayoutEffectOnce(function () { var compProxy = { setDisplayed: function (displayed) { setCssClasses(function (prev) { return prev.setClass('ag-hidden', !displayed); }); setAriaHidden(!displayed); }, setCtrls: function (ctrls) { return setHeaderRowCtrls(ctrls); }, // centre only setCenterWidth: function (width) { if (eCenterContainer.current) { eCenterContainer.current.style.width = width; } }, setContainerTransform: function (transform) { if (eCenterContainer.current) { eCenterContainer.current.style.transform = transform; } }, // pinned only setPinnedContainerWidth: function (width) { eGui.current.style.width = width; eGui.current.style.minWidth = width; eGui.current.style.maxWidth = width; } }; var ctrl = context.createBean(new ag_grid_community_1.HeaderRowContainerCtrl(props.pinned)); ctrl.setComp(compProxy, eGui.current); return function () { context.destroyBean(ctrl); }; }); var className = react_1.useMemo(function () { return cssClasses.toString(); }, [cssClasses]); var insertRowsJsx = function () { return headerRowCtrls.map(function (ctrl) { return react_1.default.createElement(headerRowComp_1.default, { ctrl: ctrl, key: ctrl.getInstanceId() }); }); }; return (react_1.default.createElement(react_1.default.Fragment, null, pinnedLeft && react_1.default.createElement("div", { ref: eGui, className: "ag-pinned-left-header " + className, "aria-hidden": ariaHidden, role: "presentation" }, insertRowsJsx()), pinnedRight && react_1.default.createElement("div", { ref: eGui, className: "ag-pinned-right-header " + className, "aria-hidden": ariaHidden, role: "presentation" }, insertRowsJsx()), centre && react_1.default.createElement("div", { ref: eGui, className: "ag-header-viewport " + className, role: "presentation" }, react_1.default.createElement("div", { ref: eCenterContainer, className: "ag-header-container", role: "rowgroup" }, insertRowsJsx())))); }; exports.default = react_1.memo(HeaderRowContainerComp); /***/ }), /***/ "./node_modules/ag-grid-react/lib/reactUi/jsComp.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; // ag-grid-react v29.2.0 Object.defineProperty(exports, "__esModule", { value: true }); exports.createSyncJsComp = exports.showJsComp = void 0; /** * Show a JS Component * @returns Effect Cleanup function */ exports.showJsComp = function (compDetails, context, eParent, ref) { var doNothing = !compDetails || compDetails.componentFromFramework; if (doNothing) { return; } var promise = compDetails.newAgStackInstance(); if (!promise) { return; } // almost all JS Comps are NOT async, however the Floating Multi Filter is Async as it could // be wrapping a React filter, so we need to cater for async comps here. var comp; var compGui; var destroyed = false; promise.then(function (c) { if (destroyed) { context.destroyBean(c); return; } comp = c; compGui = comp.getGui(); eParent.appendChild(compGui); setRef(ref, comp); }); return function () { destroyed = true; if (!comp) { return; } // in case we were destroyed before async comp was returned if (compGui && compGui.parentElement) { compGui.parentElement.removeChild(compGui); } context.destroyBean(comp); if (ref) { setRef(ref, undefined); } }; }; var setRef = function (ref, value) { if (!ref) { return; } if (ref instanceof Function) { var refCallback = ref; refCallback(value); } else { var refObj = ref; refObj.current = value; } }; exports.createSyncJsComp = function (compDetails) { var promise = compDetails.newAgStackInstance(); if (!promise) { return; } return promise.resolveNow(null, function (x) { return x; }); // js comps are never async }; /***/ }), /***/ "./node_modules/ag-grid-react/lib/reactUi/reactComment.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; // ag-grid-react v29.2.0 Object.defineProperty(exports, "__esModule", { value: true }); var useEffectOnce_1 = __webpack_require__("./node_modules/ag-grid-react/lib/reactUi/useEffectOnce.js"); var useReactCommentEffect = function (comment, eForCommentRef) { useEffectOnce_1.useEffectOnce(function () { var eForComment = eForCommentRef.current; var eParent = eForComment.parentElement; if (!eParent) { return; } var eComment = document.createComment(comment); eParent.insertBefore(eComment, eForComment); return function () { eParent.removeChild(eComment); }; }); }; exports.default = useReactCommentEffect; /***/ }), /***/ "./node_modules/ag-grid-react/lib/reactUi/rows/rowComp.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; // ag-grid-react v29.2.0 var __assign = (this && this.__assign) || function () { __assign = Object.assign || function(t) { for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; } return t; }; return __assign.apply(this, arguments); }; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }); var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; var __spreadArrays = (this && this.__spreadArrays) || function () { for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; for (var r = Array(s), k = 0, i = 0; i < il; i++) for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) r[k] = a[j]; return r; }; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); var react_1 = __importStar(__webpack_require__("./node_modules/react/index.js")); var ag_grid_community_1 = __webpack_require__("./node_modules/ag-grid-community/dist/ag-grid-community.cjs.js"); var jsComp_1 = __webpack_require__("./node_modules/ag-grid-react/lib/reactUi/jsComp.js"); var utils_1 = __webpack_require__("./node_modules/ag-grid-react/lib/reactUi/utils.js"); var beansContext_1 = __webpack_require__("./node_modules/ag-grid-react/lib/reactUi/beansContext.js"); var cellComp_1 = __importDefault(__webpack_require__("./node_modules/ag-grid-react/lib/reactUi/cells/cellComp.js")); var useEffectOnce_1 = __webpack_require__("./node_modules/ag-grid-react/lib/reactUi/useEffectOnce.js"); var maintainOrderOnColumns = function (prev, next, domOrder) { if (domOrder) { var res_1 = { list: next, instanceIdMap: new Map() }; next.forEach(function (c) { return res_1.instanceIdMap.set(c.getInstanceId(), c); }); return res_1; } // if dom order not important, we don't want to change the order // of the elements in the dom, as this would break transition styles var oldCellCtrls = []; var newCellCtrls = []; var newInstanceIdMap = new Map(); var tempMap = new Map(); next.forEach(function (c) { return tempMap.set(c.getInstanceId(), c); }); prev.list.forEach(function (c) { var instanceId = c.getInstanceId(); if (tempMap.has(instanceId)) { oldCellCtrls.push(c); newInstanceIdMap.set(instanceId, c); } }); next.forEach(function (c) { var instanceId = c.getInstanceId(); if (!prev.instanceIdMap.has(instanceId)) { newCellCtrls.push(c); newInstanceIdMap.set(instanceId, c); } }); var res = { list: __spreadArrays(oldCellCtrls, newCellCtrls), instanceIdMap: newInstanceIdMap }; return res; }; var RowComp = function (params) { var context = react_1.useContext(beansContext_1.BeansContext).context; var rowCtrl = params.rowCtrl, containerType = params.containerType; var _a = react_1.useState(), rowIndex = _a[0], setRowIndex = _a[1]; var _b = react_1.useState(), rowId = _b[0], setRowId = _b[1]; var _c = react_1.useState(), role = _c[0], setRole = _c[1]; var _d = react_1.useState(), rowBusinessKey = _d[0], setRowBusinessKey = _d[1]; var _e = react_1.useState(), tabIndex = _e[0], setTabIndex = _e[1]; var _f = react_1.useState(), userStyles = _f[0], setUserStyles = _f[1]; var _g = react_1.useState({ list: [], instanceIdMap: new Map() }), cellCtrls = _g[0], setCellCtrls = _g[1]; var _h = react_1.useState(), fullWidthCompDetails = _h[0], setFullWidthCompDetails = _h[1]; var _j = react_1.useState(false), domOrder = _j[0], setDomOrder = _j[1]; // these styles have initial values, so element is placed into the DOM with them, // rather than an transition getting applied. var _k = react_1.useState(rowCtrl.getInitialRowTop(containerType)), top = _k[0], setTop = _k[1]; var _l = react_1.useState(rowCtrl.getInitialTransform(containerType)), transform = _l[0], setTransform = _l[1]; var eGui = react_1.useRef(null); var fullWidthCompRef = react_1.useRef(); var autoHeightSetup = react_1.useRef(false); var _m = react_1.useState(0), autoHeightSetupAttempt = _m[0], setAutoHeightSetupAttempt = _m[1]; // puts autoHeight onto full with detail rows. this needs trickery, as we need // the HTMLElement for the provided Detail Cell Renderer, however the Detail Cell Renderer // could be a stateless React Func Comp which won't work with useRef, so we need // to poll (we limit to 10) looking for the Detail HTMLElement (which will be the only // child) after the fullWidthCompDetails is set. react_1.useEffect(function () { var _a; if (autoHeightSetup.current) { return; } if (!fullWidthCompDetails) { return; } if (autoHeightSetupAttempt > 10) { return; } var eChild = (_a = eGui.current) === null || _a === void 0 ? void 0 : _a.firstChild; if (eChild) { rowCtrl.setupDetailRowAutoHeight(eChild); autoHeightSetup.current = true; } else { setAutoHeightSetupAttempt(function (prev) { return prev + 1; }); } }, [fullWidthCompDetails, autoHeightSetupAttempt]); var cssClassManager = react_1.useMemo(function () { return new ag_grid_community_1.CssClassManager(function () { return eGui.current; }); }, []); // we use layout effect here as we want to synchronously process setComp and it's side effects // to ensure the component is fully initialised prior to the first browser paint. See AG-7018. useEffectOnce_1.useLayoutEffectOnce(function () { // because React is asynchronous, it's possible the RowCtrl is no longer a valid RowCtrl. This can // happen if user calls two API methods one after the other, with the second API invalidating the rows // the first call created. Thus the rows for the first call could still get created even though no longer needed. if (!rowCtrl.isAlive()) { return; } var compProxy = { // the rowTop is managed by state, instead of direct style manipulation by rowCtrl (like all the other styles) // as we need to have an initial value when it's placed into he DOM for the first time, for animation to work. setTop: function (value) { return setTop(value); }, setTransform: function (value) { return setTransform(value); }, // i found using React for managing classes at the row level was to slow, as modifying classes caused a lot of // React code to execute, so avoiding React for managing CSS Classes made the grid go much faster. addOrRemoveCssClass: function (name, on) { return cssClassManager.addOrRemoveCssClass(name, on); }, setDomOrder: function (domOrder) { return setDomOrder(domOrder); }, setRowIndex: function (value) { return setRowIndex(value); }, setRowId: function (value) { return setRowId(value); }, setRowBusinessKey: function (value) { return setRowBusinessKey(value); }, setTabIndex: function (value) { return setTabIndex(value); }, setUserStyles: function (styles) { return setUserStyles(styles); }, setRole: function (value) { return setRole(value); }, // if we don't maintain the order, then cols will be ripped out and into the dom // when cols reordered, which would stop the CSS transitions from working setCellCtrls: function (next) { return setCellCtrls(function (prev) { return maintainOrderOnColumns(prev, next, domOrder); }); }, showFullWidth: function (compDetails) { return setFullWidthCompDetails(compDetails); }, getFullWidthCellRenderer: function () { return fullWidthCompRef.current; }, }; rowCtrl.setComp(compProxy, eGui.current, containerType); return function () { rowCtrl.unsetComp(containerType); }; }); react_1.useLayoutEffect(function () { return jsComp_1.showJsComp(fullWidthCompDetails, context, eGui.current, fullWidthCompRef); }, [fullWidthCompDetails]); var rowStyles = react_1.useMemo(function () { var res = { top: top, transform: transform }; Object.assign(res, userStyles); return res; }, [top, transform, userStyles]); var showFullWidthFramework = fullWidthCompDetails && fullWidthCompDetails.componentFromFramework; var showCells = cellCtrls != null; var reactFullWidthCellRendererStateless = react_1.useMemo(function () { var res = (fullWidthCompDetails === null || fullWidthCompDetails === void 0 ? void 0 : fullWidthCompDetails.componentFromFramework) && utils_1.isComponentStateless(fullWidthCompDetails.componentClass); return !!res; }, [fullWidthCompDetails]); var showCellsJsx = function () { return cellCtrls.list.map(function (cellCtrl) { return (react_1.default.createElement(cellComp_1.default, { cellCtrl: cellCtrl, editingRow: rowCtrl.isEditing(), printLayout: rowCtrl.isPrintLayout(), key: cellCtrl.getInstanceId() })); }); }; var showFullWidthFrameworkJsx = function () { var FullWidthComp = fullWidthCompDetails.componentClass; return (react_1.default.createElement(react_1.default.Fragment, null, reactFullWidthCellRendererStateless && react_1.default.createElement(FullWidthComp, __assign({}, fullWidthCompDetails.params)), !reactFullWidthCellRendererStateless && react_1.default.createElement(FullWidthComp, __assign({}, fullWidthCompDetails.params, { ref: fullWidthCompRef })))); }; return (react_1.default.createElement("div", { ref: eGui, role: role, style: rowStyles, "row-index": rowIndex, "row-id": rowId, "row-business-key": rowBusinessKey, tabIndex: tabIndex }, showCells && showCellsJsx(), showFullWidthFramework && showFullWidthFrameworkJsx())); }; exports.default = react_1.memo(RowComp); /***/ }), /***/ "./node_modules/ag-grid-react/lib/reactUi/rows/rowContainerComp.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; // ag-grid-react v29.2.0 var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }); var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; var __spreadArrays = (this && this.__spreadArrays) || function () { for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; for (var r = Array(s), k = 0, i = 0; i < il; i++) for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) r[k] = a[j]; return r; }; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); var ag_grid_community_1 = __webpack_require__("./node_modules/ag-grid-community/dist/ag-grid-community.cjs.js"); var react_1 = __importStar(__webpack_require__("./node_modules/react/index.js")); var utils_1 = __webpack_require__("./node_modules/ag-grid-react/lib/reactUi/utils.js"); var reactComment_1 = __importDefault(__webpack_require__("./node_modules/ag-grid-react/lib/reactUi/reactComment.js")); var rowComp_1 = __importDefault(__webpack_require__("./node_modules/ag-grid-react/lib/reactUi/rows/rowComp.js")); var beansContext_1 = __webpack_require__("./node_modules/ag-grid-react/lib/reactUi/beansContext.js"); var useEffectOnce_1 = __webpack_require__("./node_modules/ag-grid-react/lib/reactUi/useEffectOnce.js"); var RowContainerComp = function (params) { var context = react_1.useContext(beansContext_1.BeansContext).context; var _a = react_1.useState(''), viewportHeight = _a[0], setViewportHeight = _a[1]; var _b = react_1.useState([]), rowCtrlsOrdered = _b[0], setRowCtrlsOrdered = _b[1]; var _c = react_1.useState(''), containerWidth = _c[0], setContainerWidth = _c[1]; var name = params.name; var containerType = react_1.useMemo(function () { return ag_grid_community_1.getRowContainerTypeForName(name); }, [name]); var eWrapper = react_1.useRef(null); var eViewport = react_1.useRef(null); var eContainer = react_1.useRef(null); var rowCtrlsRef = react_1.useRef([]); var domOrderRef = react_1.useRef(false); var cssClasses = react_1.useMemo(function () { return ag_grid_community_1.RowContainerCtrl.getRowContainerCssClasses(name); }, [name]); var wrapperClasses = react_1.useMemo(function () { return utils_1.classesList(cssClasses.wrapper); }, []); var viewportClasses = react_1.useMemo(function () { return utils_1.classesList(cssClasses.viewport); }, []); var containerClasses = react_1.useMemo(function () { return utils_1.classesList(cssClasses.container); }, []); // no need to useMemo for boolean types var template1 = name === ag_grid_community_1.RowContainerName.CENTER; var template2 = name === ag_grid_community_1.RowContainerName.TOP_CENTER || name === ag_grid_community_1.RowContainerName.BOTTOM_CENTER || name === ag_grid_community_1.RowContainerName.STICKY_TOP_CENTER; var template3 = !template1 && !template2; var topLevelRef = template1 ? eWrapper : template2 ? eViewport : eContainer; reactComment_1.default(' AG Row Container ' + name + ' ', topLevelRef); // if domOrder=true, then we just copy rowCtrls into rowCtrlsOrdered observing order, // however if false, then we need to keep the order as they are in the dom, otherwise rowAnimation breaks function updateRowCtrlsOrdered() { setRowCtrlsOrdered(function (prev) { var rowCtrls = rowCtrlsRef.current; if (domOrderRef.current) { return rowCtrls; } // if dom order not important, we don't want to change the order // of the elements in the dom, as this would break transition styles var oldRows = prev.filter(function (r) { return rowCtrls.indexOf(r) >= 0; }); var newRows = rowCtrls.filter(function (r) { return oldRows.indexOf(r) < 0; }); return __spreadArrays(oldRows, newRows); }); } useEffectOnce_1.useLayoutEffectOnce(function () { var beansToDestroy = []; var compProxy = { setViewportHeight: setViewportHeight, setRowCtrls: function (rowCtrls) { if (rowCtrlsRef.current !== rowCtrls) { rowCtrlsRef.current = rowCtrls; updateRowCtrlsOrdered(); } }, setDomOrder: function (domOrder) { if (domOrderRef.current != domOrder) { domOrderRef.current = domOrder; updateRowCtrlsOrdered(); } }, setContainerWidth: function (width) { return setContainerWidth(width); } }; var ctrl = context.createBean(new ag_grid_community_1.RowContainerCtrl(name)); beansToDestroy.push(ctrl); ctrl.setComp(compProxy, eContainer.current, eViewport.current, eWrapper.current); return function () { context.destroyBeans(beansToDestroy); }; }); var viewportStyle = react_1.useMemo(function () { return ({ height: viewportHeight }); }, [viewportHeight]); var containerStyle = react_1.useMemo(function () { return ({ width: containerWidth }); }, [containerWidth]); var buildContainer = function () { return (react_1.default.createElement("div", { className: containerClasses, ref: eContainer, role: rowCtrlsOrdered.length ? "rowgroup" : "presentation", style: containerStyle }, rowCtrlsOrdered.map(function (rowCtrl) { return react_1.default.createElement(rowComp_1.default, { rowCtrl: rowCtrl, containerType: containerType, key: rowCtrl.getInstanceId() }); }))); }; return (react_1.default.createElement(react_1.default.Fragment, null, template1 && react_1.default.createElement("div", { className: wrapperClasses, ref: eWrapper, role: "presentation" }, react_1.default.createElement("div", { className: viewportClasses, ref: eViewport, role: "presentation", style: viewportStyle }, buildContainer())), template2 && react_1.default.createElement("div", { className: viewportClasses, ref: eViewport, role: "presentation", style: viewportStyle }, buildContainer()), template3 && buildContainer())); }; exports.default = react_1.memo(RowContainerComp); /***/ }), /***/ "./node_modules/ag-grid-react/lib/reactUi/tabGuardComp.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; // ag-grid-react v29.2.0 var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }); var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; Object.defineProperty(exports, "__esModule", { value: true }); var react_1 = __importStar(__webpack_require__("./node_modules/react/index.js")); var ag_grid_community_1 = __webpack_require__("./node_modules/ag-grid-community/dist/ag-grid-community.cjs.js"); var beansContext_1 = __webpack_require__("./node_modules/ag-grid-react/lib/reactUi/beansContext.js"); var useEffectOnce_1 = __webpack_require__("./node_modules/ag-grid-react/lib/reactUi/useEffectOnce.js"); var TabGuardCompRef = function (props, forwardRef) { var children = props.children, eFocusableElement = props.eFocusableElement, onTabKeyDown = props.onTabKeyDown, gridCtrl = props.gridCtrl; var context = react_1.useContext(beansContext_1.BeansContext).context; var topTabGuardRef = react_1.useRef(null); var bottomTabGuardRef = react_1.useRef(null); var tabGuardCtrlRef = react_1.useRef(); var _a = react_1.useState(), tabIndex = _a[0], setTabIndex = _a[1]; react_1.useImperativeHandle(forwardRef, function () { return ({ forceFocusOutOfContainer: function () { tabGuardCtrlRef.current.forceFocusOutOfContainer(); } }); }); useEffectOnce_1.useEffectOnce(function () { var eTopGuard = topTabGuardRef.current; var eBottomGuard = bottomTabGuardRef.current; var compProxy = { setTabIndex: function (value) { return value == null ? setTabIndex(undefined) : setTabIndex(parseInt(value, 10)); } }; var ctrl = tabGuardCtrlRef.current = context.createBean(new ag_grid_community_1.TabGuardCtrl({ comp: compProxy, eTopGuard: eTopGuard, eBottomGuard: eBottomGuard, eFocusableElement: eFocusableElement, onTabKeyDown: onTabKeyDown, focusInnerElement: function (fromBottom) { return gridCtrl.focusInnerElement(fromBottom); } })); return function () { context.destroyBean(ctrl); }; }); var createTabGuard = function (side) { var className = side === 'top' ? ag_grid_community_1.TabGuardClassNames.TAB_GUARD_TOP : ag_grid_community_1.TabGuardClassNames.TAB_GUARD_BOTTOM; return (react_1.default.createElement("div", { className: ag_grid_community_1.TabGuardClassNames.TAB_GUARD + " " + className, role: "presentation", tabIndex: tabIndex, ref: side === 'top' ? topTabGuardRef : bottomTabGuardRef })); }; return (react_1.default.createElement(react_1.default.Fragment, null, createTabGuard('top'), children, createTabGuard('bottom'))); }; var TabGuardComp = react_1.forwardRef(TabGuardCompRef); exports.default = react_1.memo(TabGuardComp); /***/ }), /***/ "./node_modules/ag-grid-react/lib/reactUi/useEffectOnce.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; // ag-grid-react v29.2.0 Object.defineProperty(exports, "__esModule", { value: true }); exports.useLayoutEffectOnce = exports.useEffectOnce = void 0; var react_1 = __webpack_require__("./node_modules/react/index.js"); exports.useEffectOnce = function (effect) { var effectFn = react_1.useRef(effect); var destroyFn = react_1.useRef(); var effectCalled = react_1.useRef(false); var rendered = react_1.useRef(false); var _a = react_1.useState(0), setVal = _a[1]; if (effectCalled.current) { rendered.current = true; } react_1.useEffect(function () { // only execute the effect first time around if (!effectCalled.current) { destroyFn.current = effectFn.current(); effectCalled.current = true; } // this forces one render after the effect is run setVal(function (val) { return val + 1; }); return function () { // if the comp didn't render since the useEffect was called, // we know it's the dummy React cycle if (!rendered.current) { return; } // otherwise this is not a dummy destroy, so call the destroy func if (destroyFn.current) { destroyFn.current(); } }; }, []); }; exports.useLayoutEffectOnce = function (effect) { var effectFn = react_1.useRef(effect); var destroyFn = react_1.useRef(); var effectCalled = react_1.useRef(false); var rendered = react_1.useRef(false); var _a = react_1.useState(0), setVal = _a[1]; if (effectCalled.current) { rendered.current = true; } react_1.useLayoutEffect(function () { // only execute the effect first time around if (!effectCalled.current) { destroyFn.current = effectFn.current(); effectCalled.current = true; } // this forces one render after the effect is run setVal(function (val) { return val + 1; }); return function () { // if the comp didn't render since the useEffect was called, // we know it's the dummy React cycle if (!rendered.current) { return; } // otherwise this is not a dummy destroy, so call the destroy func if (destroyFn.current) { destroyFn.current(); } }; }, []); }; /***/ }), /***/ "./node_modules/ag-grid-react/lib/reactUi/utils.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; // ag-grid-react v29.2.0 var __assign = (this && this.__assign) || function () { __assign = Object.assign || function(t) { for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; } return t; }; return __assign.apply(this, arguments); }; Object.defineProperty(exports, "__esModule", { value: true }); exports.isComponentStateless = exports.CssClasses = exports.classesList = void 0; exports.classesList = function () { var list = []; for (var _i = 0; _i < arguments.length; _i++) { list[_i] = arguments[_i]; } var filtered = list.filter(function (s) { return s != null && s !== ''; }); return filtered.join(' '); }; var CssClasses = /** @class */ (function () { function CssClasses() { var _this = this; var initialClasses = []; for (var _i = 0; _i < arguments.length; _i++) { initialClasses[_i] = arguments[_i]; } this.classesMap = {}; initialClasses.forEach(function (className) { _this.classesMap[className] = true; }); } CssClasses.prototype.setClass = function (className, on) { // important to not make a copy if nothing has changed, so react // won't trigger a render cycle on new object instance var nothingHasChanged = !!this.classesMap[className] == on; if (nothingHasChanged) { return this; } var res = new CssClasses(); res.classesMap = __assign({}, this.classesMap); res.classesMap[className] = on; return res; }; CssClasses.prototype.toString = function () { var _this = this; var res = Object.keys(this.classesMap).filter(function (key) { return _this.classesMap[key]; }).join(' '); return res; }; return CssClasses; }()); exports.CssClasses = CssClasses; exports.isComponentStateless = function (Component) { var hasSymbol = function () { return typeof Symbol === 'function' && Symbol.for; }; var getMemoType = function () { return hasSymbol() ? Symbol.for('react.memo') : 0xead3; }; return (typeof Component === 'function' && !(Component.prototype && Component.prototype.isReactComponent)) || (typeof Component === 'object' && Component.$$typeof === getMemoType()); }; /***/ }), /***/ "./node_modules/ag-grid-react/lib/shared/interfaces.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; // ag-grid-react v29.2.0 Object.defineProperty(exports, "__esModule", { value: true }); exports.ChangeDetectionStrategyType = void 0; /** @deprecated v29 ChangeDetectionStrategyType has been deprecated. IdentityCheck will always be used now for a more consistent approach. */ var ChangeDetectionStrategyType; (function (ChangeDetectionStrategyType) { ChangeDetectionStrategyType["IdentityCheck"] = "IdentityCheck"; ChangeDetectionStrategyType["DeepValueCheck"] = "DeepValueCheck"; ChangeDetectionStrategyType["NoCheck"] = "NoCheck"; })(ChangeDetectionStrategyType = exports.ChangeDetectionStrategyType || (exports.ChangeDetectionStrategyType = {})); /***/ }), /***/ "./node_modules/ag-grid-react/lib/shared/keyGenerator.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; // ag-grid-react v29.2.0 Object.defineProperty(exports, "__esModule", { value: true }); var counter = 0; function generateNewKey() { return "agPortalKey_" + ++counter; } exports.default = generateNewKey; /***/ }), /***/ "./node_modules/ag-grid-react/lib/shared/newReactComponent.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; // ag-grid-react v29.2.0 var __extends = (this && this.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __assign = (this && this.__assign) || function () { __assign = Object.assign || function(t) { for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; } return t; }; return __assign.apply(this, arguments); }; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.NewReactComponent = void 0; var react_1 = __webpack_require__("./node_modules/react/index.js"); var react_dom_1 = __webpack_require__("./node_modules/react-dom/index.js"); var ag_grid_community_1 = __webpack_require__("./node_modules/ag-grid-community/dist/ag-grid-community.cjs.js"); var reactComponent_1 = __webpack_require__("./node_modules/ag-grid-react/lib/shared/reactComponent.js"); var server_1 = __webpack_require__("./node_modules/react-dom/server.browser.js"); var keyGenerator_1 = __importDefault(__webpack_require__("./node_modules/ag-grid-react/lib/shared/keyGenerator.js")); var NewReactComponent = /** @class */ (function (_super) { __extends(NewReactComponent, _super); function NewReactComponent(reactComponent, parentComponent, componentType) { var _this = _super.call(this, reactComponent, parentComponent, componentType) || this; _this.oldPortal = null; _this.key = keyGenerator_1.default(); _this.portalKey = keyGenerator_1.default(); return _this; } NewReactComponent.prototype.init = function (params) { var _this = this; this.eParentElement = this.createParentElement(params); this.params = params; this.createOrUpdatePortal(params); return new ag_grid_community_1.AgPromise(function (resolve) { return _this.createReactComponent(resolve); }); }; NewReactComponent.prototype.createOrUpdatePortal = function (params) { var _this = this; if (!this.isStatelessComponent()) { // grab hold of the actual instance created params.ref = function (element) { _this.componentInstance = element; _this.addParentContainerStyleAndClasses(); }; } this.reactElement = react_1.createElement(this.reactComponent, __assign(__assign({}, params), { key: this.key })); this.portal = react_dom_1.createPortal(this.reactElement, this.eParentElement, this.portalKey // fixed deltaRowModeRefreshCompRenderer ); }; NewReactComponent.prototype.createReactComponent = function (resolve) { this.portalManager.mountReactPortal(this.portal, this, function (value) { resolve(value); }); }; NewReactComponent.prototype.isNullValue = function () { return this.valueRenderedIsNull(this.params); }; NewReactComponent.prototype.rendered = function () { return (this.isStatelessComponent() && this.statelessComponentRendered()) || !!(!this.isStatelessComponent() && this.getFrameworkComponentInstance()); }; NewReactComponent.prototype.valueRenderedIsNull = function (params) { // we only do this for cellRenderers if (!this.componentType.cellRenderer) { return false; } // we've no way of knowing if a component returns null without rendering it first // so we render it to markup and check the output - if it'll be null we know and won't timeout // waiting for a component that will never be created var originalConsoleError = console.error; try { // if a user is doing anything that uses useLayoutEffect (like material ui) then it will throw and we // can't do anything to stop it; this is just a warning and has no effect on anything so just suppress it // for this single operation console.error = function () { }; var staticMarkup = server_1.renderToStaticMarkup(react_1.createElement(this.reactComponent, params)); return staticMarkup === ''; } catch (ignore) { } finally { console.error = originalConsoleError; } return false; }; /* * fallback methods - these will be invoked if a corresponding instance method is not present * for example if refresh is called and is not available on the component instance, then refreshComponent on this * class will be invoked instead * * Currently only refresh is supported */ NewReactComponent.prototype.refreshComponent = function (args) { this.oldPortal = this.portal; this.createOrUpdatePortal(args); this.portalManager.updateReactPortal(this.oldPortal, this.portal); }; NewReactComponent.prototype.fallbackMethod = function (name, params) { var method = this[name + "Component"]; if (!!method) { return method.bind(this)(params); } }; NewReactComponent.prototype.fallbackMethodAvailable = function (name) { var method = this[name + "Component"]; return !!method; }; return NewReactComponent; }(reactComponent_1.ReactComponent)); exports.NewReactComponent = NewReactComponent; /***/ }), /***/ "./node_modules/ag-grid-react/lib/shared/portalManager.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; // ag-grid-react v29.2.0 var __spreadArrays = (this && this.__spreadArrays) || function () { for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; for (var r = Array(s), k = 0, i = 0; i < il; i++) for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) r[k] = a[j]; return r; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.PortalManager = void 0; var PortalManager = /** @class */ (function () { function PortalManager(parent, wrappingElement, maxComponentCreationTimeMs) { this.destroyed = false; this.portals = []; this.hasPendingPortalUpdate = false; this.wrappingElement = wrappingElement ? wrappingElement : 'div'; this.parent = parent; this.maxComponentCreationTimeMs = maxComponentCreationTimeMs ? maxComponentCreationTimeMs : PortalManager.MAX_COMPONENT_CREATION_TIME_IN_MS; } PortalManager.prototype.getPortals = function () { return this.portals; }; PortalManager.prototype.destroy = function () { this.destroyed = true; }; PortalManager.prototype.destroyPortal = function (portal) { this.portals = this.portals.filter(function (curPortal) { return curPortal !== portal; }); this.batchUpdate(); }; PortalManager.prototype.getComponentWrappingElement = function () { return this.wrappingElement; }; PortalManager.prototype.mountReactPortal = function (portal, reactComponent, resolve) { this.portals = __spreadArrays(this.portals, [portal]); this.waitForInstance(reactComponent, resolve); this.batchUpdate(); }; PortalManager.prototype.updateReactPortal = function (oldPortal, newPortal) { this.portals[this.portals.indexOf(oldPortal)] = newPortal; this.batchUpdate(); }; PortalManager.prototype.batchUpdate = function () { var _this = this; if (this.hasPendingPortalUpdate) { return; } setTimeout(function () { if (!_this.destroyed) { // destroyed? _this.parent.forceUpdate(function () { _this.hasPendingPortalUpdate = false; }); } }); this.hasPendingPortalUpdate = true; }; PortalManager.prototype.waitForInstance = function (reactComponent, resolve, startTime) { var _this = this; if (startTime === void 0) { startTime = Date.now(); } // if the grid has been destroyed in the meantime just resolve if (this.destroyed) { resolve(null); return; } if (reactComponent.rendered()) { resolve(reactComponent); } else { if (Date.now() - startTime >= this.maxComponentCreationTimeMs && !this.hasPendingPortalUpdate) { // last check - we check if this is a null value being rendered - we do this last as using SSR to check the value // can mess up contexts if (reactComponent.isNullValue()) { resolve(reactComponent); return; } console.error("AG Grid: React Component '" + reactComponent.getReactComponentName() + "' not created within " + this.maxComponentCreationTimeMs + "ms"); return; } window.setTimeout(function () { _this.waitForInstance(reactComponent, resolve, startTime); }); } }; PortalManager.MAX_COMPONENT_CREATION_TIME_IN_MS = 1000; // a second should be more than enough to instantiate a component return PortalManager; }()); exports.PortalManager = PortalManager; /***/ }), /***/ "./node_modules/ag-grid-react/lib/shared/reactComponent.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; // ag-grid-react v29.2.0 var __extends = (this && this.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); Object.defineProperty(exports, "__esModule", { value: true }); exports.ReactComponent = void 0; var BaseReactComponent = /** @class */ (function () { function BaseReactComponent() { } return BaseReactComponent; }()); var ReactComponent = /** @class */ (function (_super) { __extends(ReactComponent, _super); function ReactComponent(reactComponent, portalManager, componentType) { var _this = _super.call(this) || this; _this.portal = null; _this.reactComponent = reactComponent; _this.portalManager = portalManager; _this.componentType = componentType; _this.statelessComponent = _this.isStateless(_this.reactComponent); return _this; } ReactComponent.prototype.getGui = function () { return this.eParentElement; }; ReactComponent.prototype.destroy = function () { if (this.componentInstance && typeof this.componentInstance.destroy == 'function') { this.componentInstance.destroy(); } return this.portalManager.destroyPortal(this.portal); }; ReactComponent.prototype.createParentElement = function (params) { var componentWrappingElement = this.portalManager.getComponentWrappingElement(); var eParentElement = document.createElement(componentWrappingElement || 'div'); eParentElement.classList.add('ag-react-container'); // DEPRECATED - use componentInstance.getReactContainerStyle or componentInstance.getReactContainerClasses instead // so user can have access to the react container, to add css class or style params.reactContainer = eParentElement; return eParentElement; }; ReactComponent.prototype.addParentContainerStyleAndClasses = function () { var _this = this; if (!this.componentInstance) { return; } if (this.componentInstance.getReactContainerStyle && this.componentInstance.getReactContainerStyle()) { Object.assign(this.eParentElement.style, this.componentInstance.getReactContainerStyle()); } if (this.componentInstance.getReactContainerClasses && this.componentInstance.getReactContainerClasses()) { var parentContainerClasses = this.componentInstance.getReactContainerClasses(); parentContainerClasses.forEach(function (className) { return _this.eParentElement.classList.add(className); }); } }; ReactComponent.prototype.statelessComponentRendered = function () { // fixed fragmentsFuncRendererCreateDestroy funcRendererWithNan (changeDetectionService too for NaN) return this.eParentElement.childElementCount > 0 || this.eParentElement.childNodes.length > 0; }; ReactComponent.prototype.getFrameworkComponentInstance = function () { return this.componentInstance; }; ReactComponent.prototype.isStatelessComponent = function () { return this.statelessComponent; }; ReactComponent.prototype.getReactComponentName = function () { return this.reactComponent.name; }; ReactComponent.prototype.getMemoType = function () { return this.hasSymbol() ? Symbol.for('react.memo') : 0xead3; }; ReactComponent.prototype.hasSymbol = function () { return typeof Symbol === 'function' && Symbol.for; }; ReactComponent.prototype.isStateless = function (Component) { return (typeof Component === 'function' && !(Component.prototype && Component.prototype.isReactComponent)) || (typeof Component === 'object' && Component.$$typeof === this.getMemoType()); }; ReactComponent.prototype.hasMethod = function (name) { var frameworkComponentInstance = this.getFrameworkComponentInstance(); return (!!frameworkComponentInstance && frameworkComponentInstance[name] !== null) || this.fallbackMethodAvailable(name); }; ReactComponent.prototype.callMethod = function (name, args) { var _this = this; var frameworkComponentInstance = this.getFrameworkComponentInstance(); if (this.isStatelessComponent()) { return this.fallbackMethod(name, !!args && args[0] ? args[0] : {}); } else if (!(!!frameworkComponentInstance)) { // instance not ready yet - wait for it setTimeout(function () { return _this.callMethod(name, args); }); return; } var method = frameworkComponentInstance[name]; if (!!method) { return method.apply(frameworkComponentInstance, args); } if (this.fallbackMethodAvailable(name)) { return this.fallbackMethod(name, !!args && args[0] ? args[0] : {}); } }; ReactComponent.prototype.addMethod = function (name, callback) { this[name] = callback; }; return ReactComponent; }(BaseReactComponent)); exports.ReactComponent = ReactComponent; /***/ }), /***/ "./node_modules/ag-grid-react/lib/shared/reactFrameworkOverrides.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; // ag-grid-react v29.2.0 var __extends = (this && this.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.ReactFrameworkOverrides = void 0; var ag_grid_community_1 = __webpack_require__("./node_modules/ag-grid-community/dist/ag-grid-community.cjs.js"); var groupCellRenderer_1 = __importDefault(__webpack_require__("./node_modules/ag-grid-react/lib/reactUi/cellRenderer/groupCellRenderer.js")); var detailCellRenderer_1 = __importDefault(__webpack_require__("./node_modules/ag-grid-react/lib/reactUi/cellRenderer/detailCellRenderer.js")); var ReactFrameworkOverrides = /** @class */ (function (_super) { __extends(ReactFrameworkOverrides, _super); function ReactFrameworkOverrides(reactUi) { var _this = _super.call(this) || this; _this.frameworkComponents = { agGroupCellRenderer: groupCellRenderer_1.default, agGroupRowRenderer: groupCellRenderer_1.default, agDetailCellRenderer: detailCellRenderer_1.default }; _this.reactUi = reactUi; return _this; } ReactFrameworkOverrides.prototype.frameworkComponent = function (name) { if (!this.reactUi) { return; } return this.frameworkComponents[name]; }; ReactFrameworkOverrides.prototype.isFrameworkComponent = function (comp) { if (!comp) { return false; } var prototype = comp.prototype; var isJsComp = prototype && 'getGui' in prototype; return !isJsComp; }; return ReactFrameworkOverrides; }(ag_grid_community_1.VanillaFrameworkOverrides)); exports.ReactFrameworkOverrides = ReactFrameworkOverrides; /***/ }), /***/ "./node_modules/ag-grid-react/main.js": /***/ (function(module, exports, __webpack_require__) { exports.AgGridReact = __webpack_require__("./node_modules/ag-grid-react/lib/agGridReact.js").AgGridReact; exports.ChangeDetectionStrategyType = __webpack_require__("./node_modules/ag-grid-react/lib/shared/interfaces.js").ChangeDetectionStrategyType; exports.AgGridReactUi = __webpack_require__("./node_modules/ag-grid-react/lib/reactUi/agGridReactUi.js").AgGridReactUi; /***/ }), /***/ "./node_modules/altrac-application-status/lib/MoistureSensor.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; // MoistureSensor.js /* eslint-disable */ var tools = __webpack_require__("./node_modules/altrac-application-status/node_modules/altrac-conversions/lib/index.js"); var statusMoistureSensor = function statusMoistureSensor(status, device) { var reading0 = device.reading0 || {}; var physical = device.physical || {}; var inputPower = reading0['186'] & 0x4; if (inputPower) { status.other.push({ id: 'moistureSensorPowerOn', rank: 100, code: 'normal', category: 'power', shortMessage: 'MoistureSensor Device has power', message: 'MoistureSensor Device ' + device.physical.deviceNumber + ' has power.' }); } else { status.other.push({ id: 'moistureSensorPowerOff', rank: 15, code: 'disconnected', category: 'power', shortMessage: 'MoistureSensor Device does not have power', message: 'MoistureSensor Device ' + device.physical.deviceNumber + ' does not have power.' }); status.deviceHeadlineDanger.enabled = true; status.deviceHeadlineDanger.text.push('Altrac is not receiving power'); } var moistureLevel = tools.displayFormula('moistureSensor', 100, 0, null, '1', reading0, null, physical); if (moistureLevel === 'NOT\nSET') { status.other.push({ id: 'moistureSensorNoThresholdSettings', rank: 1, code: 'disconnected', category: 'moisture', shortMessage: 'Moisture Sensor Thresholds Not Set', message: 'Moisture Sensor ' + device.physical.deviceNumber + ' thresholds not set.' }); } else if (moistureLevel === 'ERR') { status.other.push({ id: 'moistureSensorLevelError', rank: 1, code: 'danger', category: 'moisture', shortMessage: 'Bad data received from moisture probe. Please check probe installation.', message: 'Moisture Sensor ' + device.physical.deviceNumber + ' level sensor bad data.' }); status.deviceHeadlineDanger.enabled = true; status.deviceHeadlineDanger.text.push('Bad data received from moisture probe. Please check probe installation.'); } else if (moistureLevel === 'NC') { status.other.push({ id: 'moistureSensorConnectionError', rank: 1, code: 'danger', category: 'moisture', shortMessage: 'No data received from moisture probe. Please check probe wiring.', message: 'Moisture Sensor ' + device.physical.deviceNumber + ' level sensor bad data.' }); status.deviceHeadlineDanger.enabled = true; status.deviceHeadlineDanger.text.push('No data received from moisture probe. Please check probe wiring.'); } else if (moistureLevel >= 100) { status.other.push({ id: 'moistureSensorLevelWet', rank: 1, code: 'info', category: 'moisture', shortMessage: 'Moisture Sensor Above Max Threshold', message: 'Moisture Sensor ' + device.physical.deviceNumber + ' is above max moisture threshold.' }); } else if (moistureLevel <= 0) { status.other.push({ id: 'moistureSensorLevelDry', rank: 1, code: 'warning', category: 'moisture', shortMessage: 'Moisture Sensor Below Min Threshold', message: 'Moisture Sensor ' + device.physical.deviceNumber + ' is below min moisture threshold.' }); } else if (moistureLevel > 0 && moistureLevel < 100) { status.other.push({ id: 'moistureSensorLevelBetween', rank: 20, code: 'normal', category: 'moisture', shortMessage: 'Moisture Sensor Between Thresholds', message: 'Moisture Sensor ' + device.physical.deviceNumber + ' is between moisture thresholds.' }); } else { status.other.push({ id: 'moistureSensorLevelUnknown', rank: 100, code: 'normal', category: 'moisture', shortMessage: 'Moisture Sensor Value Unknown', message: 'Moisture Sensor Value Unknown.' }); } }; module.exports = statusMoistureSensor; /***/ }), /***/ "./node_modules/altrac-application-status/lib/Pump.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; /* eslint-disable no-param-reassign */ // Pump.js var tools = __webpack_require__("./node_modules/altrac-application-status/node_modules/altrac-conversions/lib/index.js"); var machineState = function machineState(runSignal, offRpm, highRpm) { if (offRpm && highRpm) { var runSignalTextState = tools.runSignalToState(runSignal, offRpm, highRpm); return !!(runSignalTextState.toUpperCase() === 'LOW' || runSignalTextState.toUpperCase() === 'HIGH'); } return runSignal > 0; }; var controllerNotIntegrated = function controllerNotIntegrated(statusO, machineOnOff, machineRunning, deviceName, important) { if (machineOnOff && machineRunning) { statusO.other.push({ id: 'pumpRunningState', rank: important ? 10 : 100, code: 'success', category: 'engine', shortMessage: 'Machine Running', message: "Pump ".concat(deviceName, " is running") }); } else if (!machineOnOff && machineRunning) { statusO.other.push({ id: 'pumpShouldBeOffState', rank: important ? 30 : 100, code: 'warning', category: 'engine', shortMessage: 'Machine Running', message: "Pump ".concat(deviceName, " should be off, but is running") }); } else if (machineOnOff && !machineRunning) { statusO.other.push({ id: 'pumpShouldBeOnState', rank: important ? 10 : 100, code: 'danger', category: 'engine', shortMessage: 'Not Running', message: "Pump ".concat(deviceName, " should be running") }); } else { statusO.other.push({ id: 'pumpStoppedState', rank: important ? 100 : 100, code: 'normal', category: 'engine', shortMessage: 'Engine Off', message: "Engine at pump ".concat(deviceName, " is off") }); } }; /** * Calculate time in seconds since equipment last started. * @param {Reading} reading * @returns {int} seconds */ var calculateTimeSinceStart = function calculateTimeSinceStart(reading) { var nowSeconds = new Date().getTime() / 1000; var startTime = tools.isNumber(reading.R1T) ? reading.R1T : reading[132]; var timeDiff = nowSeconds - startTime; var seconds = timeDiff > 0 ? timeDiff : 0; return seconds; }; var controllerInverter = function controllerInverter(statusO, reading0, machineOnOff, machineRunning, deviceName) { var engineState = tools.isNumber(reading0.R1S) ? reading0.R1S : reading0[140]; var timeSinceStartSeconds = calculateTimeSinceStart(reading0); var controllerAutoMode = tools.isNumber(reading0.XA) ? reading0.XA : reading0[202]; var controllerAutoSwitch = tools.isNumber(reading0.DI1) ? reading0.DI1 : reading0['143'] > 9000 ? 1 : 0; var controllerRunMode = tools.isNumber(reading0.XR) ? reading0.XR : reading0[203]; if (controllerAutoMode === 1) { statusO.other.push({ id: 'pumpControllerAutoOn', rank: 100, code: 'normal', category: 'controller', shortMessage: 'A/S Auto On', message: "Pump ".concat(deviceName, " controller is in auto mode") }); statusO.stateIndicator = true; } else { statusO.other.push({ id: 'pumpControllerAutoOff', rank: 50, code: 'normal', category: 'controller', shortMessage: 'A/S Auto Off', message: "Pump ".concat(deviceName, " controller is not in auto mode") }); statusO.stateIndicator = false; } if (!controllerAutoMode && controllerRunMode) { if (controllerAutoSwitch) { statusO.other.push({ id: 'pumpControllerManualRun', rank: 100, code: 'normal', category: 'controller', shortMessage: 'A/S Auto On', message: "Pump ".concat(deviceName, " controller is in manual and switch position relay has power") }); } else { statusO.other.push({ id: 'pumpControllerManualRunSwitchOff', rank: 20, code: 'disconnected', category: 'controller', shortMessage: 'A/S switch off', message: "Pump ".concat(deviceName, " controller is in manual should be running, but switch is in wrong position") }); statusO.stateIndicator = false; statusO.deviceHeadlineDanger.enabled = true; statusO.deviceHeadlineDanger.text.push('Switch on equipment is not in auto position'); } } else if (!controllerAutoSwitch) { statusO.other.push({ id: 'pumpControllerManualRunSwitchOff', rank: 50, code: 'normal', category: 'controller', shortMessage: 'A/S switch off', message: "Pump ".concat(deviceName, " controller is in manual switch is off") }); statusO.stateIndicator = false; statusO.deviceHeadlineWarning.enabled = true; statusO.deviceHeadlineWarning.text.push('Switch on equipment is not in auto position'); } var controllerId = 'pump'; var controllerRank = 10; var controllerCode = 'normal'; var controllerShortMessage = 'Unknown issue'; var controllerMessage = 'Unknown issue'; switch (engineState) { case 0: case 1: case 2: controllerId = 'pumpControllerEngineStopped'; controllerRank = 100; controllerCode = 'normal'; controllerShortMessage = 'Engine Stopped'; controllerMessage = "Pump ".concat(deviceName, " is stopped"); break; case 3: case 4: case 5: case 6: case 7: controllerId = 'pumpControllerCrankOn'; controllerRank = 10; controllerCode = 'info'; controllerShortMessage = 'Crank on'; controllerMessage = "Pump ".concat(deviceName, " crank on"); break; case 8: controllerId = 'pumpControllerFalseStart'; controllerRank = 10; controllerCode = 'danger'; controllerShortMessage = 'False Start'; controllerMessage = "Pump ".concat(deviceName, " false start"); break; case 9: controllerId = 'pumpControllerWarmup'; controllerRank = 10; controllerCode = 'info'; controllerShortMessage = 'Warmup'; controllerMessage = "Pump ".concat(deviceName, " warmup"); break; case 10: case 11: case 12: controllerId = 'pumpControllerRunning'; controllerRank = 10; controllerCode = 'success'; controllerShortMessage = 'Running'; controllerMessage = "Pump ".concat(deviceName, " running loaded"); break; case 13: case 14: case 15: case 16: controllerId = 'pumpControllerCooldown'; controllerRank = 10; controllerCode = 'info'; controllerShortMessage = 'Cooldown'; controllerMessage = "Pump ".concat(deviceName, " cooldown"); break; default: controllerId = 'pumpControllerUnknownEngineState'; controllerRank = 30; controllerCode = 'danger'; controllerShortMessage = 'Unknown engine state'; controllerMessage = "Pump ".concat(deviceName, " unexpected engine state"); break; } statusO.other.push({ id: controllerId, rank: controllerRank, code: controllerCode, category: 'controller', shortMessage: controllerShortMessage, message: controllerMessage }); if (engineState >= 8 && engineState <= 13 && !machineRunning) { statusO.deviceHeadlineDanger.enabled = true; statusO.deviceHeadlineDanger.text.unshift('Machine should be ON'); statusO.other.push({ id: 'pumpShouldBeOnState', rank: 1, code: 'danger', category: 'engine', shortMessage: 'Controller Issue', message: "Run signal is off, pump ".concat(deviceName, " should be running ") }); if (timeSinceStartSeconds > 300) { statusO.other.push({ id: 'pumpShouldBeOnStatePastDue', rank: 2, code: 'danger', category: 'engine', shortMessage: 'Controller Issue', message: "Run signal is off, pump ".concat(deviceName, " should have started ").concat(Math.round(timeSinceStartSeconds / 60), " min ago") }); } } }; var pressureState = function pressureState(statusO, reading0, machineOnOff, machineRunning, deviceName, physical) { var controllerAutoMode = tools.isNumber(reading0.XA) ? reading0.XA : reading0[202]; /* Pressure sensor status */ var pressure = tools.fourToTwenty(tools.isNumber(reading0.AN1) ? reading0.AN1 : reading0['133'], physical.min || 0, physical.max || 100, physical.zero || 0, physical.precision || 0); if (pressure === 'ERH' || pressure === 'OFF') { if (!controllerAutoMode && (machineRunning || machineOnOff)) { statusO.other.push({ id: 'pumpControllerAutoPressureBadReading', rank: 5, code: statusO.other.slice(-1)[0].code, category: 'sensors', shortMessage: 'Pump running pressure sensor bad', message: "Pump ".concat(deviceName, " is running but pressure sensor is bad") }); } statusO.other.push({ id: 'pressureBadReading', rank: 20, code: 'deviceProblem', category: 'sensors', shortMessage: 'Pressure sensor reading bad', message: "Pump ".concat(deviceName, " pressure sensor reading is bad") }); statusO.deviceHeadlineDanger.enabled = true; statusO.deviceHeadlineDanger.text.push('Pressure sensor fault'); } }; var powerState = function powerState(statusO, reading0, physical) { var inputPower = (tools.isNumber(reading0.PM8) ? reading0.PM8 : reading0['186']) & 0x4; /* //System Status Register //NOTE: This is a read-only register REG08 BIT --- VBUS status 7: VBUS_STAT[1] | 00: Unknown (no input, or DPDM detection incomplete), 01: USB host 6: VBUS_STAT[0] | 10: Adapter port, 11: OTG --- Charging status 5: CHRG_STAT[1] | 00: Not Charging, 01: Pre-charge ( VSYSMIN) 1: In VSYSMIN regulation (BAT < VSYSMIN)ault is 3.5V (101) 0: Reserved */ if (inputPower) { statusO.other.push({ id: 'pumpControllerPowerOn', rank: 100, code: 'normal', category: 'electricity', shortMessage: 'Controller has power', message: "Controller has power at ".concat(physical.deviceNumber, " ") }); } else { statusO.other.push({ id: 'pumpControllerPowerOff', rank: 15, code: 'disconnected', category: 'controller', shortMessage: 'Controller does not have power', message: "Controller does not have power at ".concat(physical.deviceNumber, " ") }); statusO.deviceHeadlineDanger.enabled = true; statusO.deviceHeadlineDanger.text.push('Altrac is not receiving power'); return false; } return true; }; /* What we want out of this: - All the calculated statuses of the machines - Encoded in a ranked array of items Strategy: - Determine whether device thinks engine should be on - Determine current engine state - For non-modbus controlled engines, do this based on RPM and time since machine started - For modbus controlled engines, do this based on feedback from controller - Determine what the RPM is of the machine and whether reasonable - Determine if machine's temperature reading is valid - Use temperature reading to determine if engine should be on */ var status = function status(statusO, device) { /* Determine if machine should be running based on temperature */ var deviceName = device.physical.deviceNumber; var reading0 = device.reading0 || {}; var machineOnOff = ((tools.isNumber(reading0.R1) ? reading0.R1 : reading0['131']) & 1) >>> 0; var machineRunning = machineState(tools.isNumber(reading0.R1F) ? reading0.R1F : reading0['134']); powerState(statusO, reading0, device.physical); /* Controller and engine status */ var controller = 'notIntegrated'; if (device.interface_versioned && device.interface_versioned.data && device.interface_versioned.data.other && device.interface_versioned.data.other.controller) { controller = device.interface_versioned.data.other.controller; } else if (device.physical && device.physical.controller) { controller = device.physical.controller; } var noController = false; switch (controller) { case 'inverter': controllerInverter(statusO, reading0, machineOnOff, machineRunning, deviceName, device.physical); break; case 'flow': break; default: noController = true; } controllerNotIntegrated(statusO, machineOnOff, machineRunning, deviceName, noController); /* Other pump sensors */ if (device.interface_versioned && device.interface_versioned.data && device.interface_versioned.data.other && device.interface_versioned.data.other.inThree) { switch (device.interface_versioned.data.other.inThree) { case 'pressure': pressureState(statusO, reading0, machineOnOff, machineRunning, deviceName, device.physical); break; default: break; } } }; module.exports = { controllerNotIntegrated: controllerNotIntegrated, controllerInverter: controllerInverter, powerState: powerState, pressureState: pressureState, status: status }; /***/ }), /***/ "./node_modules/altrac-application-status/lib/Pump2.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports["default"] = Pump2; exports.machineState = void 0; // Pump2.js var _require = __webpack_require__("./node_modules/altrac-application-status/node_modules/altrac-conversions/lib/index.js"), isNumber = _require.isNumber, fourToTwenty = _require.fourToTwenty, map = _require.map; var APPLICATION_VALID = [{ name: 'None', value: 0 }, { name: 'Schedule', value: 1 }]; /** * Calculate time in seconds since equipment last started. * @param {Reading} reading * @returns {int} seconds */ var calculateTimeSinceStart = function calculateTimeSinceStart(reading, relay) { var nowSeconds = new Date().getTime() / 1000; var startTime = relay === 1 ? reading.R1T : reading.R2T; var timeDiff = nowSeconds - startTime; var seconds = timeDiff > 0 ? timeDiff : 0; return seconds; }; var machineState = function machineState(statusO, machineOnOff, machineRunningArr, reading0, deviceName) { var number = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 1; var important = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : true; var machineRunningEnabled = false; var machineRunning = machineRunningArr.reduce(function (acc, item) { if (item.use === "machine".concat(number, "Feedback")) { machineRunningEnabled = true; var value = reading0[item.key]; switch (item.type) { case 'closure': if (value - 4 > item.low) return true; return false; case 'digitalInput': if (value > item.low) return true; return false; case 'current4To20': { var mapped = map(value, 4, 20, item.min, item.max); if (mapped > item.low) return true; return false; } case 'voltage0To10': { var _mapped = map(value, 0, 10, item.min, item.max); if (_mapped > item.low) return true; return false; } default: return acc; } } return acc; }, false); if (machineRunningEnabled) { if (machineOnOff && machineRunning) { statusO.other.push({ id: "pumpRunningState".concat(number), rank: important ? 10 : 100, code: 'success', category: 'engine', shortMessage: 'Machine Running', message: "".concat(deviceName, " is running") }); } else if (!machineOnOff && machineRunning) { statusO.other.push({ id: "pumpShouldBeOffState".concat(number), rank: important ? 30 : 100, code: 'warning', category: 'engine', shortMessage: 'Machine Running', message: "".concat(deviceName, " should be off, but is running") }); statusO.deviceHeadlineWarning.enabled = true; statusO.deviceHeadlineWarning.text.push("".concat(deviceName, " running in manual")); } else if (machineOnOff && !machineRunning) { statusO.other.push({ id: "pumpShouldBeOnState".concat(number), rank: important ? 9 : 100, code: 'danger', category: 'engine', shortMessage: 'Not Running', message: "".concat(deviceName, " should be running") }); statusO.deviceHeadlineDanger.enabled = true; statusO.deviceHeadlineDanger.text.unshift("".concat(deviceName, " should be running")); if (calculateTimeSinceStart(reading0, number) > 300) { statusO.other.push({ id: "pumpShouldBeOnState".concat(number, "Past5Min"), rank: 100, code: 'danger', category: 'engine', shortMessage: 'Not Running', message: "".concat(deviceName, " should be running") }); } } else { statusO.other.push({ id: "pumpStoppedState".concat(number), rank: important ? 100 : 100, code: 'normal', category: 'engine', shortMessage: 'Engine Off', message: "".concat(deviceName, " is off") }); } } }; exports.machineState = machineState; var autoSwitchState = function autoSwitchState(statusO, reading0, autoSwitchArr, deviceName, number) { var autoDetectEnabled = false; var autoDetect = autoSwitchArr.reduce(function (acc, item) { if (item.use === "autoDetectPump".concat(number)) { var value = reading0[item.key]; autoDetectEnabled = true; if (!value) return false; return acc; } return acc; }, true); if (autoDetectEnabled) { if (autoDetect) { statusO.other.push({ id: "autoSwitchDetect".concat(number, "On"), rank: 100, code: 'normal', category: 'engine', shortMessage: 'Auto switch detect 1 on', message: "Switch at ".concat(deviceName, " set to auto") }); } else { statusO.other.push({ id: "autoSwitchDetect".concat(number, "Off"), rank: 50, code: 'normal', category: 'controller', shortMessage: 'A/S switch off', message: "Switch at ".concat(deviceName, " is not in auto position") }); statusO.stateIndicator = false; statusO.deviceHeadlineWarning.enabled = true; statusO.deviceHeadlineWarning.text.push("Switch on ".concat(deviceName, " is not in auto position")); } } }; function Pump2(status, device, language) { var _device$physical = device.physical, deviceName = _device$physical.deviceNumber, _device$physical$r1FU = _device$physical.r1FUse, r1FUse = _device$physical$r1FU === void 0 ? 'machine1Feedback' : _device$physical$r1FU, _device$physical$r1FT = _device$physical.r1FType, r1FType = _device$physical$r1FT === void 0 ? 'closure' : _device$physical$r1FT, _device$physical$r1FM = _device$physical.r1FMax, r1FMax = _device$physical$r1FM === void 0 ? 16 : _device$physical$r1FM, _device$physical$r1FM2 = _device$physical.r1FMin, r1FMin = _device$physical$r1FM2 === void 0 ? 0 : _device$physical$r1FM2, _device$physical$r1FL = _device$physical.r1FLow, r1FLow = _device$physical$r1FL === void 0 ? 1 : _device$physical$r1FL, _device$physical$r2FU = _device$physical.r2FUse, r2FUse = _device$physical$r2FU === void 0 ? 'machine2Feedback' : _device$physical$r2FU, _device$physical$r2FT = _device$physical.r2FType, r2FType = _device$physical$r2FT === void 0 ? 'closure' : _device$physical$r2FT, _device$physical$r2FM = _device$physical.r2FMax, r2FMax = _device$physical$r2FM === void 0 ? 16 : _device$physical$r2FM, _device$physical$r2FM2 = _device$physical.r2FMin, r2FMin = _device$physical$r2FM2 === void 0 ? 0 : _device$physical$r2FM2, _device$physical$r2FL = _device$physical.r2FLow, r2FLow = _device$physical$r2FL === void 0 ? 1 : _device$physical$r2FL, _device$physical$aIn = _device$physical.aIn1Use, aIn1Use = _device$physical$aIn === void 0 ? 'none' : _device$physical$aIn, _device$physical$aIn2 = _device$physical.aIn1Type, aIn1Type = _device$physical$aIn2 === void 0 ? 'current4To20' : _device$physical$aIn2, _device$physical$aIn3 = _device$physical.aIn1Max, aIn1Max = _device$physical$aIn3 === void 0 ? 100 : _device$physical$aIn3, _device$physical$aIn4 = _device$physical.aIn1Min, aIn1Min = _device$physical$aIn4 === void 0 ? 0 : _device$physical$aIn4, _device$physical$aIn5 = _device$physical.aIn1Low, aIn1Low = _device$physical$aIn5 === void 0 ? 0 : _device$physical$aIn5, _device$physical$aIn6 = _device$physical.aIn2Use, aIn2Use = _device$physical$aIn6 === void 0 ? 'none' : _device$physical$aIn6, _device$physical$aIn7 = _device$physical.aIn2Type, aIn2Type = _device$physical$aIn7 === void 0 ? 'current4To20' : _device$physical$aIn7, _device$physical$aIn8 = _device$physical.aIn2Max, aIn2Max = _device$physical$aIn8 === void 0 ? 100 : _device$physical$aIn8, _device$physical$aIn9 = _device$physical.aIn2Min, aIn2Min = _device$physical$aIn9 === void 0 ? 0 : _device$physical$aIn9, _device$physical$aIn10 = _device$physical.aIn2Low, aIn2Low = _device$physical$aIn10 === void 0 ? 0 : _device$physical$aIn10, _device$physical$flow = _device$physical.flowUse, flowUse = _device$physical$flow === void 0 ? 'none' : _device$physical$flow, _device$physical$flow2 = _device$physical.flowType, flowType = _device$physical$flow2 === void 0 ? 'flow' : _device$physical$flow2, _device$physical$flow3 = _device$physical.flowLow, flowLow = _device$physical$flow3 === void 0 ? 0 : _device$physical$flow3, _device$physical$prim = _device$physical.primaryPumpLabel, primaryPumpLabel = _device$physical$prim === void 0 ? 'Primary Pump' : _device$physical$prim, _device$physical$seco = _device$physical.secondaryPumpLabel, secondaryPumpLabel = _device$physical$seco === void 0 ? 'Secondary Pump' : _device$physical$seco, _device$physical$ioDi = _device$physical.ioDigUse1, ioDigUse1 = _device$physical$ioDi === void 0 ? 'none' : _device$physical$ioDi, _device$physical$ioDi2 = _device$physical.ioDigUse2, ioDigUse2 = _device$physical$ioDi2 === void 0 ? 'none' : _device$physical$ioDi2, _device$physical$ioDi3 = _device$physical.ioDigUse3, ioDigUse3 = _device$physical$ioDi3 === void 0 ? 'none' : _device$physical$ioDi3, _device$reading = device.reading0, reading0 = _device$reading === void 0 ? {} : _device$reading, _device$interface_ver = device.interface_versioned; _device$interface_ver = _device$interface_ver === void 0 ? {} : _device$interface_ver; var _device$interface_ver2 = _device$interface_ver.data; _device$interface_ver2 = _device$interface_ver2 === void 0 ? {} : _device$interface_ver2; var _device$interface_ver3 = _device$interface_ver2.other; _device$interface_ver3 = _device$interface_ver3 === void 0 ? {} : _device$interface_ver3; var _device$interface_ver4 = _device$interface_ver3.page, page = _device$interface_ver4 === void 0 ? 'pump' : _device$interface_ver4; if (page !== 'pump') return; var _ref = reading0 || {}, _ref$R = _ref.R1, R1 = _ref$R === void 0 ? 0 : _ref$R, _ref$R2 = _ref.R2, R2 = _ref$R2 === void 0 ? 0 : _ref$R2, _ref$XA = _ref.XA, XA = _ref$XA === void 0 ? 0 : _ref$XA, _ref$XB = _ref.XB, XB = _ref$XB === void 0 ? 0 : _ref$XB; var machineOnOff1 = !!R1; var machineOnOff2 = !!R2; var autoMode1 = !!XA; var autoMode2 = !!XB; var application1 = isNumber(reading0['X!']) && Number(reading0['X!']) >= 0 && Number(reading0['X!']) <= 1 ? APPLICATION_VALID.find(function (app) { return Number(reading0['X!']) === app.value; }) : APPLICATION_VALID[0]; var application2 = isNumber(reading0['X@']) && Number(reading0['X@']) >= 0 && Number(reading0['X@']) <= 1 ? APPLICATION_VALID.find(function (app) { return Number(reading0['X@']) === app.value; }) : APPLICATION_VALID[0]; var machineRunningArr = [{ use: r1FUse, key: 'R1F', type: r1FType, max: r1FMax, min: r1FMin, low: r1FLow }, { use: r2FUse, key: 'R2F', type: r2FType, max: r2FMax, min: r2FMin, low: r2FLow }, { use: aIn1Use, key: 'AN1', type: aIn1Type, max: aIn1Max, min: aIn1Min, low: aIn1Low }, { use: aIn2Use, key: 'AN2', type: aIn2Type, max: aIn2Max, min: aIn2Min, low: aIn2Low }, { use: flowUse, key: 'PC', type: flowType, low: flowLow }, { use: ioDigUse1, key: 'DI1', type: 'digitalInput', low: 0 }, { use: ioDigUse2, key: 'DI2', type: 'digitalInput', low: 0 }, { use: ioDigUse3, key: 'DI3', type: 'digitalInput', low: 0 }]; // run in reverse order so warning go in correct order machineState(status, machineOnOff2, machineRunningArr, reading0, secondaryPumpLabel, 2, true); machineState(status, machineOnOff1, machineRunningArr, reading0, primaryPumpLabel, 1, true); var autoSwitchArr = [{ use: ioDigUse1, key: 'DI1' }, { use: ioDigUse2, key: 'DI2' }, { use: ioDigUse3, key: 'DI3' }]; // run in reverse order so warning go in correct order autoSwitchState(status, reading0, autoSwitchArr, secondaryPumpLabel, 2); autoSwitchState(status, reading0, autoSwitchArr, primaryPumpLabel, 1); var configIssue = false; if (autoMode1) { status.other.push({ id: 'pump1AutoMode', rank: 100, code: 'normal', category: 'configuration', shortMessage: 'Relay 1 in auto mode', message: "".concat(primaryPumpLabel, " in auto mode") }); status.stateIndicator = true; if (application1.value <= 0) { status.other.push({ id: 'pump1AutoConfigurationApplicationIssue', rank: 100, code: 'normal', category: 'configuration', shortMessage: 'Relay 1 application configuration issue', message: "".concat(primaryPumpLabel, " will not run in auto mode because no application has been set") }); status.warningIndicator = true; status.deviceHeadlineWarning.enabled = true; status.deviceHeadlineWarning.text.push("".concat(primaryPumpLabel, " will not run in auto mode because no application has been set")); configIssue = true; } else { status.other.push({ id: 'pump1AutoConfigurationApplicationOK', rank: 100, code: 'normal', category: 'configuration', shortMessage: 'Relay 1 application configuration OK', message: "".concat(primaryPumpLabel, " is set to Auto and application is correctly set") }); } } if (autoMode2) { status.other.push({ id: 'pump1AutoMode', rank: 100, code: 'normal', category: 'configuration', shortMessage: 'Relay 1 in auto mode', message: "".concat(primaryPumpLabel, " in auto mode") }); status.stateIndicator = true; if (application2.value <= 0) { status.other.push({ id: 'pump2AutoConfigurationApplicationIssue', rank: 100, code: 'normal', category: 'configuration', shortMessage: 'Relay 2 application configuration issue', message: "".concat(secondaryPumpLabel, " will not run in auto mode because no application has been set") }); status.warningIndicator = true; status.deviceHeadlineWarning.enabled = true; status.deviceHeadlineWarning.text.push("".concat(secondaryPumpLabel, " will not run in auto mode because no application has been set")); configIssue = true; } else { status.other.push({ id: 'pump2AutoConfigurationApplicationOK', rank: 100, code: 'normal', category: 'configuration', shortMessage: 'Relay 2 application configuration OK', message: "".concat(secondaryPumpLabel, " is set to Auto and application is correctly set") }); } } if (configIssue) { status.stateIndicator = false; } /* We need to calculate status on the following: - Relay 1 & feedback doing what it is supposed to - Relay 2 & feedback doing what it is supposed to - What about machine state based on other inputs? analog or flow? - Do we need a machine state calculator for the above? - Digital inputs in use for HOA switches - Show error for misconfiguration */ } /***/ }), /***/ "./node_modules/altrac-application-status/lib/StatusInfo.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; var _Pump = _interopRequireDefault(__webpack_require__("./node_modules/altrac-application-status/lib/Pump2.js")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } // StatusInfo.js // eslint-disable-next-line import/no-import-module-exports // eslint-disable-next-line no-underscore-dangle var _sortBy = __webpack_require__("./node_modules/lodash/sortBy.js"); var formatMessage = __webpack_require__("./node_modules/format-message/index.js"); var tools = __webpack_require__("./node_modules/altrac-application-status/node_modules/altrac-conversions/lib/index.js"); var intl = __webpack_require__("./node_modules/altrac-application-status/lib/translations/intl.js"); var statusWindMachine = __webpack_require__("./node_modules/altrac-application-status/lib/WindMachine.js"); var Pump = __webpack_require__("./node_modules/altrac-application-status/lib/Pump.js"); var statusValve = __webpack_require__("./node_modules/altrac-application-status/lib/Valve.js"); var statusTemperature = __webpack_require__("./node_modules/altrac-application-status/lib/Temperature.js"); var statusWeather = __webpack_require__("./node_modules/altrac-application-status/lib/Weather.js"); var statusMoistureSensor = __webpack_require__("./node_modules/altrac-application-status/lib/MoistureSensor.js"); var statusCalculate = function statusCalculate(device, _language, callback) { var language = 'en'; if (typeof _language === 'string' && (_language === 'en' || _language === 'es')) { language = _language; } // code options: // normal // primary // success // info // warning // danger // see bottom for examples of return values var _device$reading = device.reading0, reading0 = _device$reading === void 0 ? {} : _device$reading; var status = { code: 'normal', shortMessage: 'OK', message: 'No Issues', id: 'none', other: [], deviceHeadlineDanger: { enabled: false, text: [], color: 'danger' }, deviceHeadlineWarning: { enabled: false, text: [], color: 'warning' }, warningIndicator: false, stateIndicator: false }; var deviceType = device.physical && device.physical.deviceType ? device.physical.deviceType : 'Unknown'; if (device.interface_versioned && device.interface_versioned.data && device.interface_versioned.data.other && typeof device.interface_versioned.data.other.deviceType === 'string') { deviceType = device.interface_versioned.data.other.deviceType; } var statusType; if (device.interface_versioned && device.interface_versioned.data && device.interface_versioned.data.other && typeof device.interface_versioned.data.other.statusType === 'string') { statusType = device.interface_versioned.data.other.statusType; } /* variables required for status calculating */ var connected = true; var currentTime = new Date().getTime(); var sleepInterval = reading0['135'] * 1000; var resetTimeAllowed = 6 * 60 * 1000; if (reading0['135'] === 0 || typeof reading0['135'] === 'undefined') { sleepInterval = 10 * 60 * 1000; // up to 10 min between checkins when sleep is 0 resetTimeAllowed = 3 * 60 * 1000; } // 30 sec is length of time it might take a device to connect cloud after waking var nextSeen = new Date(reading0.date).getTime() + sleepInterval + 30 * 1000; var missedCheckinMilliseconds = currentTime - nextSeen; var minutesPast = Math.round(missedCheckinMilliseconds / 1000 / 60); /* altrac device connection We want the device to show offline gradually to give the customer the best information possible This varies with what the device is doing. If its online all the time, it should show as disconnected quicker. If its online only every 15 min, it should show offline after a longer period of time not sleeping resets should take 3 minute sleeping resets should take 6 minutes bc reconnecting to tower takes longer and they're not as critical if the device is sleeping if its online all the time or asleep less than or equal to 3 minutes: it should checkin every 10 minutes if we don't see it for 19 minutes (1 missed check plus 3 resets) show yellow indicator its offline after 31 minutes show red indicator its offline (1 missed, 7 resets) after 43 minutes show offline red wifi icon (1 miseed, 11 resets) if its sleeping for more than 3 minutes it should checkin to match the last sleepInterval (e.g. 15 min) after 33 minutes show yellow indicator its offline (1 missed, 3 sleep resets) after 57 minutes show red indicator its offline (1 missed, 7 sleep resets) after 81 minutes show offline red wifi icon (1 miseed, 11 sleep resets) */ if (missedCheckinMilliseconds > resetTimeAllowed * 11) { connected = false; status.other.push({ id: 'notConnected', rank: 1, code: 'deviceProblem', category: 'device', shortMessage: 'Not Connected', message: "Device ".concat(device.physical.deviceNumber, " is ").concat(minutesPast, " minutes late reporting") }); status.deviceHeadlineDanger.enabled = true; status.deviceHeadlineDanger.text.push(formatMessage(intl.get(language, 'headline.notConnectedSince', 'Altrac device has not connected to the cloud since {sinceTime}'), { sinceTime: new Date(reading0.date).toLocaleDateString() })); } else if (missedCheckinMilliseconds > resetTimeAllowed * 7) { status.other.push({ id: 'deviceMissedCheckinDanger', rank: 5, code: 'danger', category: 'device', shortMessage: 'Not Connected', message: "Device ".concat(device.physical.deviceNumber, " is ").concat(minutesPast, " minutes late reporting") }); status.deviceHeadlineDanger.enabled = true; status.deviceHeadlineDanger.text.push(formatMessage(intl.get(language, 'headline.notConnectedXMinutes', 'Altrac device has not checked in with cloud for {minutes} minutes.'), { minutes: minutesPast })); } else if (missedCheckinMilliseconds > resetTimeAllowed * 3) { status.other.push({ id: 'deviceMissedCheckinWarning', rank: 100, code: 'normal', category: 'device', shortMessage: 'Not Connected', message: "Device ".concat(device.physical.deviceNumber, " is ").concat(minutesPast, " minutes late reporting") }); status.warningIndicator = true; status.deviceHeadlineWarning.enabled = true; status.deviceHeadlineWarning.text.push(formatMessage(intl.get(language, 'headline.notConnectedXMinutes', 'Altrac device has not checked in with cloud for {minutes} minutes.'), { minutes: minutesPast })); } else { status.other.push({ id: 'connected', rank: 100, code: 'normal', category: 'device', shortMessage: 'Connected', message: "Device ".concat(device.physical.deviceNumber, " is connected") }); } if (connected) { if (deviceType === 'windMachine') { statusWindMachine(status, device, language); } if (deviceType === 'coldAirDrain') { statusWindMachine(status, device, language); } if (deviceType === 'pumpFrostWater') { statusWindMachine(status, device, language); } if (deviceType === 'pump') { if (statusType && statusType === 'pump2') { (0, _Pump["default"])(status, device, language); } else { Pump.status(status, device, language); } } if (deviceType === 'flow') { Pump.status(status, device, language); } if (deviceType === 'valve') { statusValve(status, device, language); } if (deviceType === 'temperature') { statusTemperature(status, device, language); } if (deviceType === 'weather') { statusWeather(status, device, language); } if (deviceType === 'moistureSensor') { statusMoistureSensor(status, device, language); } } else if (deviceType === 'windMachine') { statusWindMachine.offline(status, device, language); } /* sensor */ var batteryInternalWarning = 0.20; var batteryInternal = tools.isNumber(reading0.IB) ? reading0.IB : reading0['129']; if (batteryInternal < batteryInternalWarning) { status.other.push({ id: 'batteryLow', rank: 100, code: 'normal', category: 'sensor', shortMessage: 'Altrac Battery Low', message: "Int Batt at ".concat(device.physical.deviceNumber, " is ").concat(Math.round(batteryInternal * 100), "% which is below the ").concat(Math.round(batteryInternalWarning * 100), "% warning level.") }); if (connected) { status.warningIndicator = true; status.deviceHeadlineWarning.enabled = true; status.deviceHeadlineWarning.text.push(intl.get(language, 'heading.internalBatteryLow', 'Altrac internal battery low')); } } status.other = _sortBy(status.other, [function (o) { return o.rank; }]); if (status.other.length > 0) { status.code = status.other[0].code; status.id = status.other[0].id; status.category = 'multiple'; status.shortMessage = status.other[0].shortMessage; status.message = status.other[0].message; } else { status.code = status.other[0].code; status.id = status.other[0].id; status.category = status.other[0].category; status.shortMessage = status.other[0].shortMessage; status.message = status.other[0].message; } if (callback) { callback(null, status); } return status; }; module.exports = statusCalculate; /* this should return something like this: var status = { code: 'warning', message: 'Multiple issues', other: [ { rank: 10, code: 'warning', category: 'controller', message: 'Engine controller is not Connected', }, { rank: 10, code: 'warning', category: 'controller', message: 'Engine controller is not in autostart mode', }, { rank: 5, code: 'warning', category: 'device', message: 'Internal battery is less than 20%', }, ], }; var status = { code: 'danger', shortMessage: 'Engine fault', message: 'Engine did not start properly', other: [ { rank: 1, code: 'danger', category: 'engine', shortMessage: 'Engine fault', message: 'Engine did not start properly', }, { rank: 10, code: 'warning', category: 'controller', shortMessage: 'Autostart Off', message: 'Engine controller is not in autostart mode', }, { rank: 5, code: 'warning', category: 'device', shortMessage: 'Low device batt', message: 'Internal battery is less than 20%', }, ], }; */ /***/ }), /***/ "./node_modules/altrac-application-status/lib/Temperature.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; // Temperature.js /* eslint-disable */ var tools = __webpack_require__("./node_modules/altrac-application-status/node_modules/altrac-conversions/lib/index.js"); var intl = __webpack_require__("./node_modules/altrac-application-status/lib/translations/intl.js"); var statusTemperature = function statusTemperature(status, device, language) { var reading0 = device.reading0 || {}; // const reading1 = device.reading1 || {}; var setPoints = device.physical && device.physical.temperatureSetPoints === true ? true : false; var tempState128_0 = temperatureState(reading0, device.application_settings); switch (tempState128_0) { case 'temperatureOldReading': case 'temperatureBadReading': status.other.push({ id: 'temperatureBadReading', rank: 20, code: 'deviceProblem', category: 'temperature', shortMessage: 'Temperature Sensor Error', message: 'Temperature Device ' + device.physical.deviceNumber + ' has a bad temperature reading' }); status.deviceHeadlineDanger.enabled = true; status.deviceHeadlineDanger.text.push(intl.get(language, 'headline.temperatureProbeFault', 'Temperature Probe Fault')); break; case 'temperatureBadSetPoints': status.other.push({ id: 'temperatureBadSetPoints', rank: setPoints ? 20 : 100, code: setPoints ? 'deviceProblem' : 'normal', category: 'temperature', shortMessage: 'Bad set points', message: 'Temperature Device ' + device.physical.deviceNumber + ' has bad start and stop points' }); break; case 'temperatureBelowStart': status.other.push({ id: 'temperatureBelowStart', rank: setPoints ? 20 : 100, code: setPoints ? 'deviceProblem' : 'normal', category: 'protection', shortMessage: 'Temperature below start set point', message: 'Temperature Device ' + device.physical.deviceNumber + ' is below start set point.' }); if (!setPoints) { break; } status.deviceHeadlineDanger.enabled = true; status.deviceHeadlineDanger.text.push(intl.get(language, 'headline.temperatureBelowStart', 'Ambient temperature is below start temperature')); break; case 'temperatureBetweenStartAndStop': status.other.push({ id: 'temperatureBetweenSetPoints', rank: setPoints ? 20 : 100, code: 'normal', category: 'protection', shortMessage: 'Temperature between set points', message: 'Temperature Device ' + device.physical.deviceNumber + ' is between set points.' }); break; case 'temperatureAboveStop': status.other.push({ id: 'temperatureAboveStop', rank: setPoints ? 50 : 100, code: 'normal', category: 'protection', shortMessage: 'Temperature above stop point', message: 'Temperature Device ' + device.physical.deviceNumber + ' is above stop point.' }); break; default: } var inputPower = reading0['186'] & 0x4; if (inputPower) { status.other.push({ id: 'temperatureDevicePowerOn', rank: 100, code: 'normal', category: 'electricity', shortMessage: 'Temperature Device has power', message: 'Temperature Device ' + device.physical.deviceNumber + ' has power.' }); } else { status.other.push({ id: 'temperatureDevicePowerOff', rank: 15, code: 'disconnected', category: 'controller', shortMessage: 'Temperature Device does not have power', message: 'Temperature Device ' + device.physical.deviceNumber + ' does not have power.' }); status.deviceHeadlineDanger.enabled = true; status.deviceHeadlineDanger.text.push(intl.get(language, 'headline.altracNotReceivingPower', 'Altrac is not receiving power')); return false; } }; module.exports = statusTemperature; var temperatureState = function temperatureState(reading0, application_settings, temperatureKey) { var temperatureMax = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 85; temperatureKey = typeof temperatureKey === 'string' ? temperatureKey : '128'; var currentTime = new Date().getTime(); var temperatureDate = new Date(reading0[temperatureKey + 'Date']).getTime(); if (!temperatureDate || temperatureDate < currentTime - 1000 * 60 * 60 * 2) { return 'temperatureOldReading'; } var temp = reading0[temperatureKey]; var tempStart = 0; if (application_settings && application_settings.settings.tempStart) { tempStart = application_settings.settings.tempStart; } var tempStop = 0; if (application_settings && application_settings.settings.tempStop) { tempStop = application_settings.settings.tempStop; } if (temp && (temp === 327.67 || temp <= -40 || temp >= temperatureMax)) { return 'temperatureBadReading'; } else if (tempStart > tempStop) { return 'temperatureBadSetPoints'; } else if (temp < tempStart) { return 'temperatureBelowStart'; } else if (temp >= tempStart && temp <= tempStop) { return 'temperatureBetweenStartAndStop'; } else if (temp > tempStop) { return 'temperatureAboveStop'; } else { return 'temperatureBadReading'; } }; module.exports.temperatureState = temperatureState; /***/ }), /***/ "./node_modules/altrac-application-status/lib/Valve.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; // Valve.js var tools = __webpack_require__("./node_modules/altrac-application-status/node_modules/altrac-conversions/lib/index.js"); var moment = __webpack_require__("./node_modules/moment/moment.js"); var TIMEBLOCK_MAX = 10080; var expectedsolenoidState = function expectedsolenoidState(s, valveNumber) { var solenoidStateShouldBe = 0; var valveRecent = false; var settings = s.settings; var valveTime = settings.valveTime; var timeblocks = settings.timeblocks; if (timeblocks) { if (timeblocks[String(valveNumber)]) { var block = timeblocks[String(valveNumber)]; block.forEach(function (individual, x) { var start = individual.start; var stop = individual.stop; var diff = stop - start; var currentMin = moment.utc().diff(moment.utc().startOf('week'), 'minutes'); if (currentMin > start && currentMin < stop || diff < 0 && currentMin > start && currentMin > stop || diff < 0 // e.g. start = 9000, stop = 1000, currentMin = 950 && currentMin < start && currentMin < stop // e.g. start = 9000, stop = 1000, currentMin = 500 ) { solenoidStateShouldBe = 1; } var recentStartForward = start - currentMin; var recentStartBackward = start - currentMin - TIMEBLOCK_MAX; var recentStart = Math.abs(recentStartForward) > Math.abs(recentStartBackward) ? recentStartBackward : recentStartForward; var recentStopForward = stop - currentMin; var recentStopBackward = stop - currentMin - TIMEBLOCK_MAX; var recentStop = Math.abs(recentStopForward) > Math.abs(recentStopBackward) ? recentStopBackward : recentStopForward; if (Math.abs(recentStart) <= 5 || Math.abs(recentStop) <= 5) { valveRecent = true; } }); } return { solenoidStateShouldBe: solenoidStateShouldBe, valveRecent: valveRecent }; } var now = new Date().getTime(); if (valveTime) { var valveTimes = tools.nextValveTimeToEpochMillis(valveTime, valveNumber); if (valveTimes[0] === 0 && valveTimes[1] === 0) { valveTimes = tools.lastValveTimeToEpochMillis(valveTime, valveNumber); } if (now < valveTimes[0] || valveTimes[0] === 0 && valveTimes[1] === 0) { solenoidStateShouldBe = 0; } else if (now > valveTimes[0] && now < valveTimes[1]) { solenoidStateShouldBe = 1; } else { solenoidStateShouldBe = 0; } valveRecent = now - valveTimes[0] < 300000; // 5 minutes } return { solenoidStateShouldBe: solenoidStateShouldBe, valveRecent: valveRecent }; }; var statusValve = function StatusValve(status, device) { var reading0 = {}; if (device.reading0) { reading0 = device.reading0; } else if (device.readingLast) { reading0 = device.readingLast; } var valveNumber = 1; var _device$interface_ver = device.interface_versioned.data; _device$interface_ver = _device$interface_ver === void 0 ? {} : _device$interface_ver; var _device$interface_ver2 = _device$interface_ver.other; _device$interface_ver2 = _device$interface_ver2 === void 0 ? {} : _device$interface_ver2; var _device$interface_ver3 = _device$interface_ver2.page, page = _device$interface_ver3 === void 0 ? 'valve' : _device$interface_ver3, _device$interface_ver4 = _device$interface_ver2.valveNumber, valveNumberInterface = _device$interface_ver4 === void 0 ? 1 : _device$interface_ver4; if (page !== 'valve') return; if (Number(valveNumberInterface) > 0) { valveNumber = Number(valveNumberInterface); } var solenoidState = tools.numberToBinary(reading0['131'], valveNumber - 1) ? 1 : 0; // Solenoid State var pressureState = tools.numberToBinary(reading0['134'], valveNumber - 1) ? 1 : 0; // Pressure State var solenoidResult = valveNumber === 1 ? reading0['154'] : reading0['157']; // Solenoid Result var expectedsolenoidStateVar = expectedsolenoidState(device.application_settings, valveNumber); var solenoidStateShouldBe = expectedsolenoidStateVar.solenoidStateShouldBe; var valveRecent = expectedsolenoidStateVar.valveRecent; var valveRank = '50'; var valveId = 'none'; var valveCode = 'normal'; var valveShortMessage = 'No data'; var valveMessage = 'No data'; var deviceName = device && device.physical && device.physical.deviceNumber ? device.physical.deviceNumber : 'no name'; if (solenoidStateShouldBe === 1) { if (solenoidResult === 0) { if (solenoidState === 1 && pressureState === 1) { valveShortMessage = "Valve ".concat(deviceName, " on"); valveMessage = "Valve ".concat(deviceName, " is on"); valveRank = 10; valveId = 'valveOnAndShouldBeOn'; valveCode = 'success'; status.stateIndicator = true; } else if (pressureState === 0 && solenoidState === 1) { if (valveRecent) { // 5 min valveShortMessage = "Valve ".concat(deviceName, " on"); valveMessage = "Valve ".concat(deviceName, " is on"); valveRank = 2; valveId = 'valvePressureOffSolenoidOnScheduledRecent'; valveCode = 'info'; status.stateIndicator = true; } else { valveShortMessage = "Valve ".concat(deviceName, " on"); valveMessage = "Valve ".concat(deviceName, " is on"); valveRank = 2; valveId = 'valvePressureOffSolenoidOnScheduled'; valveCode = 'danger'; status.stateIndicator = true; } status.deviceHeadlineWarning.enabled = true; status.deviceHeadlineWarning.text.push('No pressure'); status.stateIndicator = true; } } else if (pressureState === 1) { valveShortMessage = "Valve ".concat(deviceName, " on / solenoid error"); valveMessage = "Valve ".concat(deviceName, " is on / solenoid error"); valveRank = 10; valveId = 'valvePressureOnSolenoidErrorScheduled'; valveCode = 'success'; status.stateIndicator = true; } else { valveShortMessage = "Valve ".concat(deviceName, " off / solenoid error"); valveMessage = "Valve ".concat(deviceName, " is off / solenoid error"); valveRank = 2; valveId = 'valvePressureOffSolenoidErrorScheduled'; valveCode = 'danger'; status.stateIndicator = true; } } else if (valveRecent && pressureState === 1) { // 5 min valveShortMessage = "Valve ".concat(deviceName, " on"); valveMessage = "Valve ".concat(deviceName, " should be on"); valveRank = 2; valveId = 'valveOnAndShouldBeOffScheduled'; valveCode = 'info'; status.deviceHeadlineWarning.enabled = true; status.deviceHeadlineWarning.text.push('Valve not open'); } else if (pressureState === 1 && solenoidState === 0) { valveShortMessage = "Valve ".concat(deviceName, " on"); valveMessage = "Valve ".concat(deviceName, " is on"); valveRank = 10; valveId = 'valvePressureOnSolenoidOffNotScheduled'; valveCode = 'success'; status.manualIndicator = true; } else if (pressureState === 1 && solenoidState === 1) { valveRank = 2; valveCode = 'success'; status.deviceHeadlineDanger.enabled = true; valveId = 'valvePressureOnSolenoidOnNotScheduled'; status.deviceHeadlineDanger.text.push('Block should be off, valve open'); status.manualIndicator = true; } status.other.push({ rank: valveRank, id: valveId, code: valveCode, category: 'valve', shortMessage: valveShortMessage, message: valveMessage }); if (reading0['138'] || reading0['138'] === 0) { switch (reading0['138']) { case 2: status.other.push({ rank: 1, id: 'solenoidDriverNotConnected', code: 'deviceProblem', category: 'sensor', shortMessage: "Valve ".concat(deviceName, " solenoid Driver Not Connected"), message: "Valve ".concat(deviceName, " solenoid driver is not connected to the device") }); status.deviceHeadlineDanger.enabled = true; status.deviceHeadlineDanger.text.push('Solenoid driver is not connected'); break; case 3: status.other.push({ rank: 100, id: 'solenoidDriverConnected', code: 'normal', category: 'sensor', shortMessage: "Valve ".concat(deviceName, " solenoid Driver Connected"), message: "Valve ".concat(deviceName, " solenoid driver is connected") }); break; default: } } var batteryExternalWarning = 2.2; var batteryExternal = tools.percentTo20V(reading0['130']); if (batteryExternal < batteryExternalWarning) { status.other.push({ rank: 10, id: 'solenoidDriverLowPower', code: 'deviceProblem', category: 'sensor', shortMessage: "Valve ".concat(deviceName, " low SD Power"), message: "Valve ".concat(deviceName, " solenoid power is ").concat(batteryExternal, "V which is below the ").concat(batteryExternalWarning, "V warning level.") }); status.deviceHeadlineDanger.enabled = true; status.deviceHeadlineDanger.text.push('Solenoid power is below 2.3V'); } }; module.exports = statusValve; /***/ }), /***/ "./node_modules/altrac-application-status/lib/Weather.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; // Weather.js /* eslint-disable */ var tools = __webpack_require__("./node_modules/altrac-application-status/node_modules/altrac-conversions/lib/index.js"); var statusWeather = function statusWeather(status, device) { var reading0 = device.reading0 || {}; // const reading1 = device.reading1 || {}; var inputPower = reading0['186'] & 0x4; if (inputPower) { status.other.push({ id: 'weatherDevicePowerOn', rank: 100, code: 'normal', category: 'electricity', shortMessage: 'Weather Device has power', message: 'Weather Device ' + device.physical.deviceNumber + ' has power.' }); } else { status.other.push({ id: 'weatherDevicePowerOff', rank: 15, code: 'disconnected', category: 'controller', shortMessage: 'Weather Device does not have power', message: 'Weather Device ' + device.physical.deviceNumber + ' does not have power.' }); status.deviceHeadlineDanger.enabled = true; status.deviceHeadlineDanger.text.push('Altrac is not receiving power'); return false; } }; module.exports = statusWeather; /***/ }), /***/ "./node_modules/altrac-application-status/lib/WindMachine.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } // WindMachine.js /* eslint-disable */ var tools = __webpack_require__("./node_modules/altrac-application-status/node_modules/altrac-conversions/lib/index.js"); var intl = __webpack_require__("./node_modules/altrac-application-status/lib/translations/intl.js"); var temperatureState = __webpack_require__("./node_modules/altrac-application-status/lib/Temperature.js").temperatureState; /* What we want out of this: - All the calculated statuses of the machines - Encoded in a ranked array of items Strategy: - Determine whether device thinks engine should be on - Determine current engine state - For non-modbus controlled engines, do this based on RPM and time since machine started - For modbus controlled engines, do this based on feedback from controller - Determine what the RPM is of the machine and whether reasonable - Determine if machine's temperature reading is valid - Use temperature reading to determine if engine should be on */ var statusWindMachine = function StatusWindMachine(status, device, language) { /* Determine if machine should be running based on tempeature */ var reading0 = device.reading0 || {}; var reading1 = device.reading1 || {}; var engineOnOff = (reading0['131'] & 1) >>> 0; var engineRPMUp = false; var controller = 'notIntegrated'; if (device.interface_versioned && device.interface_versioned.data && device.interface_versioned.data.other && device.interface_versioned.data.other.controller) { controller = device.interface_versioned.data.other.controller; } else if (device.physical && device.physical.controller) { controller = device.physical.controller; } var controllerState = ((reading0[144] & 0xFF) >>> 0) - 10; var setPointState = reading0[144] >>> 8; var noController = false; var tempMax = controller === 'mpc20' || controller === 'mpc20_rpmControl' ? 45 : 85; var tempState = temperatureState(reading0, device.application_settings, '128', tempMax); var tempState1 = temperatureState(reading1, device.application_settings, '128', tempMax); if (device.application_settings && device.application_settings.settings && device.application_settings.settings.calibrate1 && device.application_settings.settings.calibrate2) { engineRPMUp = rpmState(reading0['134'], device.application_settings.settings.calibrate1, device.application_settings.settings.calibrate2); } else if (device.physical.offRpm && device.physical.highRpm) { engineRPMUp = rpmState(reading0['134'], device.physical.offRpm, device.physical.highRpm); } else { engineRPMUp = rpmState(reading0['134']); } var powerStatus = powerState(status, reading0, device.physical, language); switch (tempState) { case 'temperatureOldReading': case 'temperatureBadReading': status.other.push({ id: 'temperatureBadReading', rank: 20, code: 'deviceProblem', category: 'temperature', shortMessage: 'Temperature Sensor Error', message: 'Wind Machine ' + device.physical.deviceNumber + ' has a bad temperature reading' }); if ((controller === 'mpc20' || controller === 'mpc20_rpmControl') && controllerState <= 0) { status.deviceHeadlineWarning.enabled = true; status.deviceHeadlineWarning.text.push(intl.get(language, 'headline.temperatureNotAvailable', 'Temperature data not available when MPC-20 switched off')); } else { status.deviceHeadlineDanger.enabled = true; status.deviceHeadlineDanger.text.push(intl.get(language, 'headline.temperatureProbeFault', 'Temperature Probe Fault')); } break; case 'temperatureBadSetPoints': status.other.push({ id: 'windMachineBadSetPoints', rank: 20, code: 'deviceProblem', category: 'temperature', shortMessage: 'Bad set points', message: 'Wind Machine ' + device.physical.deviceNumber + ' has bad start and stop points' }); break; case 'temperatureBelowStart': if (!engineOnOff || !engineRPMUp) { status.deviceHeadlineDanger.enabled = true; status.deviceHeadlineDanger.text.push(intl.get(language, 'headline.temperatureBelowStart', 'Ambient temperature is below start temperature')); // this means the engine is not running and its too cold! if (tempState1 === 'temperatureBelowStart') { status.other.push({ id: 'windMachineBelowStartNotRunningConfirmed', rank: 14, code: 'danger', category: 'protection', shortMessage: 'Below start not running', message: 'Wind Machine ' + device.physical.deviceNumber + ' is below start point, but not running.' }); } else { status.other.push({ id: 'windMachineBelowStartNotRunning', rank: 100, code: 'normal', category: 'protection', shortMessage: 'Below start not running', message: 'Wind Machine ' + device.physical.deviceNumber + ' is below start point, but not running.' }); } } else { status.deviceHeadlineWarning.enabled = true; status.deviceHeadlineWarning.text.push(intl.get(language, 'headline.temperatureBelowStart', 'Ambient temperature is below start temperature')); status.other.push({ id: 'windMachineBelowStartRunning', rank: 20, code: 'normal', category: 'protection', shortMessage: 'Below start running', message: 'Wind Machine ' + device.physical.deviceNumber + ' is below start point, running.' }); } break; case 'temperatureBetweenStartAndStop': if (!engineOnOff || !engineRPMUp) { // this means the engine is not running and its too cold! status.other.push({ id: 'windMachineBetweenSetPointsNotRunning', rank: 100, code: 'normal', category: 'protection', shortMessage: 'Between set points not running', message: 'Wind Machine ' + device.physical.deviceNumber + ' is between set points and not running' }); } else { status.other.push({ id: 'windMachineBetweenSetPointsRunning', rank: 20, code: 'normal', category: 'protection', shortMessage: 'Between set points running', message: 'Wind Machine ' + device.physical.deviceNumber + ' is between set points and running.' }); } break; case 'temperatureAboveStop': if (!engineOnOff || !engineRPMUp) { // this means the engine is not running and its too cold! status.other.push({ id: 'windMachineAboveStopNotRunning', rank: 100, code: 'normal', category: 'protection', shortMessage: 'Above stop point not running', message: 'Wind Machine ' + device.physical.deviceNumber + ' is above stop point and not running' }); } else { status.other.push({ id: 'windMachineAboveStopRunning', rank: 50, code: 'normal', category: 'protection', shortMessage: 'Above stop point running', message: 'Wind Machine ' + device.physical.deviceNumber + ' is above stop point and running.' }); status.warningIndicator = true; status.deviceHeadlineWarning.enabled = true; status.deviceHeadlineWarning.text.push(intl.get(language, 'headline.temperatureAboveStop', 'Ambient temperature is above stop temperature')); } break; default: } /* Controller and engine status */ switch (controller) { case 'pv101': case 'callToStart': status.other.push({ id: 'windMachineControllerConnected', rank: 100, code: 'normal', category: 'controller', shortMessage: 'A/S Connected', message: 'Wind Machine ' + device.physical.deviceNumber + ' controller is connected' }); controllerPv101(status, reading0, engineRPMUp, device.physical, language); break; case 'mpc20': case 'mpc20_rpmControl': case 'emsProLite': if (controllerState > 0) { status.other.push({ id: 'windMachineControllerConnected', rank: 100, code: 'normal', category: 'controller', shortMessage: 'A/S Connected', message: 'Wind Machine ' + device.physical.deviceNumber + ' controller is connected' }); controllerMpc20(status, reading0, engineRPMUp, device.physical.deviceNumber, tempState, language); } else { status.other.push({ id: 'windMachineControllerDisconnected', rank: 15, code: 'disconnected', category: 'controller', shortMessage: 'A/S Disconnected', message: 'Wind Machine ' + device.physical.deviceNumber + ' controller is not connected' }); noController = true; } break; case 'electric': status.other.push({ id: 'windMachineControllerNotIntegrated', rank: 100, code: 'disconnected', category: 'controller', shortMessage: 'No A/S Integration', message: 'Wind Machine ' + device.physical.deviceNumber + ' does not have an A/S controller Altrac integrates with' }); controllerElectric(status, reading0, engineRPMUp, device.physical, tempState, language); break; default: status.other.push({ id: 'windMachineControllerNotIntegrated', rank: 100, code: 'disconnected', category: 'controller', shortMessage: 'No A/S Integration', message: 'Wind Machine ' + device.physical.deviceNumber + ' does not have an A/S controller Altrac integrates with' }); noController = true; } controllerNotIntegrated(status, engineOnOff, engineRPMUp, device.physical.deviceNumber, noController); /* Other wind machine sensors */ fuelLevelState(status, reading0, device.physical, language); }; module.exports = statusWindMachine; var rpmState = function rpmState(rpm, offRpm, highRpm) { if (offRpm && highRpm) { var rpmTextState = tools.rpmToState(rpm, offRpm, highRpm); return rpmTextState.toUpperCase() === 'LOW' || rpmTextState.toUpperCase() === 'HIGH' ? true : false; } else { return rpm > 500 ? true : false; } }; var controllerNotIntegrated = function controllerNotIntegrated(status, engineOnOff, engineRPMUp, deviceNumber, important) { if (engineOnOff && engineRPMUp) { status.other.push({ id: 'windMachineRunningState', rank: important ? 10 : 100, code: 'success', category: 'engine', shortMessage: 'Engine Running', message: 'Wind Machine ' + deviceNumber + ' is running' }); } else if (!engineOnOff && engineRPMUp) { status.other.push({ id: 'windMachineShouldBeOffState', rank: important ? 30 : 100, code: 'warning', category: 'engine', shortMessage: 'Engine Running', message: 'Wind Machine ' + deviceNumber + ' should be off, but is running' }); } else if (engineOnOff && !engineRPMUp) { status.other.push({ id: 'windMachineShouldBeOnState', rank: important ? 10 : 100, code: 'danger', category: 'engine', shortMessage: 'Not Running', message: 'Wind Machine ' + deviceNumber + ' should be running' }); } else { status.other.push({ id: 'windMachineStoppedState', rank: important ? 100 : 100, code: 'normal', category: 'engine', shortMessage: 'Engine Off', message: 'Engine at wind machine ' + deviceNumber + ' is off' }); } }; var controllerMpc20 = function controllerMpc20(status, reading0, engineRPMUp, deviceNumber, tempState, language) { var engineState = reading0[140]; var controllerAutoMode = reading0[202]; if (controllerAutoMode === 1) { status.other.push({ id: 'windMachineControllerAutoOn', rank: 100, code: 'normal', category: 'controller', shortMessage: 'A/S Auto On', message: 'Wind Machine ' + deviceNumber + ' controller is in auto mode' }); status.stateIndicator = true; } else { status.other.push({ id: 'windMachineControllerAutoOff', rank: 20, code: 'normal', category: 'controller', shortMessage: 'A/S Auto Off', message: 'Wind Machine ' + deviceNumber + ' controller is not in auto mode' }); status.stateIndicator = false; } var controllerId = 'windMachine'; var controllerRank = 10; var controllerCode = 'normal'; var controllerShortMessage = 'Unknown issue'; var controllerMessage = 'Unknown issue'; switch (engineState) { case 0: controllerId = 'windMachineControllerECUDelay'; controllerRank = 100; controllerCode = 'normal'; controllerShortMessage = 'ECU Delay'; controllerMessage = 'Wind Machine ' + deviceNumber + ' is in ECU delay'; break; case 1: controllerId = 'windMachineControllerEngineStopped'; controllerRank = 100; controllerCode = 'normal'; controllerShortMessage = 'Engine Stopped'; controllerMessage = 'Wind Machine ' + deviceNumber + ' is stopped'; break; case 2: controllerId = 'windMachineControllerStandby'; controllerRank = 100; controllerCode = 'normal'; controllerShortMessage = 'Controller Standby'; controllerMessage = 'Wind Machine ' + deviceNumber + ' MPC-20 controller in standby'; break; case 3: controllerId = 'windMachineControllerPrestart1'; controllerRank = 10; controllerCode = 'info'; controllerShortMessage = 'Prestart 1'; controllerMessage = 'Wind Machine ' + deviceNumber + ' in prestart delay 1'; break; case 4: controllerId = 'windMachineControllerChecksafe'; controllerRank = 10; controllerCode = 'info'; controllerShortMessage = 'Checksafe'; controllerMessage = 'Wind Machine ' + deviceNumber + ' in checksafe'; break; case 5: controllerId = 'windMachineControllerPrestart2'; controllerRank = 10; controllerCode = 'info'; controllerShortMessage = 'Prestart 2'; controllerMessage = 'Wind Machine ' + deviceNumber + ' in prestart delay 2'; break; case 6: controllerId = 'windMachineControllerCrankOn'; controllerRank = 10; controllerCode = 'info'; controllerShortMessage = 'Crank on'; controllerMessage = 'Wind Machine ' + deviceNumber + ' crank on'; break; case 7: controllerId = 'windMachineControllerCrankReset'; controllerRank = 10; controllerCode = 'info'; controllerShortMessage = 'Crank Rest'; controllerMessage = 'Wind Machine ' + deviceNumber + ' crank rest'; break; case 8: controllerId = 'windMachineControllerFalseStart'; controllerRank = 1; controllerCode = 'danger'; controllerShortMessage = 'False Start'; controllerMessage = 'Wind Machine ' + deviceNumber + ' false start'; break; case 9: controllerId = 'windMachineControllerWarmup'; controllerRank = 10; controllerCode = 'info'; controllerShortMessage = 'Warmup'; controllerMessage = 'Wind Machine ' + deviceNumber + ' in warmup delay'; break; case 10: controllerId = 'windMachineControllerLineFill1'; controllerRank = 10; controllerCode = 'success'; controllerShortMessage = 'Line Fill 1'; controllerMessage = 'Wind Machine ' + deviceNumber + ' in line fill 1'; break; case 11: controllerId = 'windMachineControllerLineFill2'; controllerRank = 10; controllerCode = 'success'; controllerShortMessage = 'Line Fill 2'; controllerMessage = 'Wind Machine ' + deviceNumber + ' in line fill 2'; break; case 12: controllerId = 'windMachineControllerRunning'; controllerRank = 10; controllerCode = 'success'; controllerShortMessage = 'Running'; controllerMessage = 'Wind Machine ' + deviceNumber + ' running loaded'; break; case 13: controllerId = 'windMachineControllerCooldown'; controllerRank = 10; controllerCode = 'info'; controllerShortMessage = 'Cooldown'; controllerMessage = 'Wind Machine ' + deviceNumber + ' in cooldown delay'; break; case 14: controllerId = 'windMachineControllerStopping'; controllerRank = 10; controllerCode = 'info'; controllerShortMessage = 'Stopping'; controllerMessage = 'Wind Machine ' + deviceNumber + ' energize to stop'; break; case 15: controllerId = 'windMachineControllerSpindown'; controllerRank = 10; controllerCode = 'info'; controllerShortMessage = 'Spindown'; controllerMessage = 'Wind Machine ' + deviceNumber + ' in spindown delay'; break; case 16: controllerId = 'windMachineControllerWaitToStart'; controllerRank = 10; controllerCode = 'info'; controllerShortMessage = 'Wait To Start'; controllerMessage = 'Wind Machine ' + deviceNumber + ' in wait to start delay'; break; default: controllerId = 'windMachineControllerMPC20Issue'; controllerRank = 30; controllerCode = 'danger'; controllerShortMessage = 'MPC-20 Issue'; controllerMessage = 'Wind Machine ' + deviceNumber + ' unexpected engine state'; break; } status.other.push({ id: controllerId, rank: controllerRank, code: controllerCode, category: 'controller', shortMessage: controllerShortMessage, message: controllerMessage }); if (engineState >= 8 && engineState <= 13 && !engineRPMUp) { status.deviceHeadlineDanger.enabled = true; status.deviceHeadlineDanger.text.unshift(intl.get(language, 'headline.machineShouldBeOn', 'Machine should be ON')); status.other.push({ id: 'windMachineControllerIssue', rank: 1, code: 'danger', category: 'engine', shortMessage: 'Controller Issue', message: 'RPM is too low for controller state at wind machine ' + deviceNumber + ' ' }); } /* Deal with warning and shutdown status */ // first shutdown if (reading0['141']) { status.deviceHeadlineDanger.enabled = true; if (reading0['141'] & Math.pow(2, 0)) { status.deviceHeadlineDanger.text.push('Overspeed SD'); } if (reading0['141'] & Math.pow(2, 1)) { status.deviceHeadlineDanger.text.push('Underspeed SD'); } if (reading0['141'] & Math.pow(2, 2)) { status.deviceHeadlineDanger.text.push('Overcrank SD'); } if (reading0['141'] & Math.pow(2, 3)) { status.deviceHeadlineDanger.text.push('Low Oil Pressure SD'); } if (reading0['141'] & Math.pow(2, 4)) { status.deviceHeadlineDanger.text.push('High Engine Temp SD'); } if (reading0['141'] & Math.pow(2, 5)) { status.deviceHeadlineDanger.text.push('Low Fuel SD'); } if (reading0['141'] & Math.pow(2, 6)) { status.deviceHeadlineDanger.text.push('Low Discharge Pressure SD'); } if (reading0['141'] & Math.pow(2, 7)) { status.deviceHeadlineDanger.text.push('High Discharge Pressure SD'); } if (reading0['141'] & Math.pow(2, 8)) { status.deviceHeadlineDanger.text.push('Speed Signal Lost SD'); } if (reading0['141'] & Math.pow(2, 9)) { status.deviceHeadlineDanger.text.push('Low Lube Level SD'); } if (reading0['141'] & Math.pow(2, 10)) { status.deviceHeadlineDanger.text.push('Fuel Leak SD'); } if (reading0['141'] & Math.pow(2, 11)) { status.deviceHeadlineDanger.text.push('Fuel Filter Restriction SD'); } if (reading0['141'] & Math.pow(2, 12)) { status.deviceHeadlineDanger.text.push('Air Damper Closed SD no'); } if (reading0['141'] & Math.pow(2, 13)) { status.deviceHeadlineDanger.text.push('Air Filter Restriction SD'); } if (reading0['141'] & Math.pow(2, 14)) { status.deviceHeadlineDanger.text.push('Oil Filter Restriction SD'); } if (reading0['141'] & Math.pow(2, 15)) { status.deviceHeadlineDanger.text.push('Remote Stop SD'); } if (reading0['141'] & Math.pow(2, 16)) { status.deviceHeadlineDanger.text.push('Coolant Level SD'); } if (reading0['141'] & Math.pow(2, 17)) { status.deviceHeadlineDanger.text.push('High Level SD'); } if (reading0['141'] & Math.pow(2, 18)) { status.deviceHeadlineDanger.text.push('Low Level SD'); } if (reading0['141'] & Math.pow(2, 19)) { status.deviceHeadlineDanger.text.push('High Flow SD'); } if (reading0['141'] & Math.pow(2, 20)) { status.deviceHeadlineDanger.text.push('Low Flow SD'); } if (reading0['141'] & Math.pow(2, 21)) { status.deviceHeadlineDanger.text.push('High Pump Oil Temp SD'); } if (reading0['141'] & Math.pow(2, 22)) { status.deviceHeadlineDanger.text.push('High Pump Housing Temp SD'); } if (reading0['141'] & Math.pow(2, 23)) { status.deviceHeadlineDanger.text.push('Water in Fuel SD'); } if (reading0['141'] & Math.pow(2, 24)) { status.deviceHeadlineDanger.text.push('Low Suction SD'); } if (reading0['141'] & Math.pow(2, 25)) { status.deviceHeadlineDanger.text.push('High Suction SD'); } if (reading0['141'] & Math.pow(2, 26)) { status.deviceHeadlineDanger.text.push('High Engine Oil Pressure SD'); } if (reading0['141'] & Math.pow(2, 27)) { status.deviceHeadlineDanger.text.push('High Engine Oil Temp SD'); } if (reading0['141'] & Math.pow(2, 28)) { status.deviceHeadlineDanger.text.push('Low Gear Box Pressure SD'); } if (reading0['141'] & Math.pow(2, 29)) { status.deviceHeadlineDanger.text.push('High Gear Box Pressure SD'); } if (reading0['141'] & Math.pow(2, 30)) { status.deviceHeadlineDanger.text.push('Battery Charger Fail SD'); } if (reading0['141'] & Math.pow(2, 31)) { status.deviceHeadlineDanger.text.push('Red Lamp Status'); } status.other.push({ id: 'windMachineControllerSDMessage', rank: 1, code: 'danger', category: 'controller', shortMessage: 'Shutdown Message from Controller', message: 'Refer to headline for more information on this shutdown message' }); } // second warning if (reading0['142']) { status.deviceHeadlineWarning.enabled = true; status.warningIndicator = true; if (reading0['142'] & Math.pow(2, 0)) { status.deviceHeadlineWarning.text.push('Low Fuel Warn'); } if (reading0['142'] & Math.pow(2, 1)) { status.deviceHeadlineWarning.text.push('Fuel Leak Warn'); } if (reading0['142'] & Math.pow(2, 2)) { status.deviceHeadlineWarning.text.push('Fuel Filter Restriction Warn'); } if (reading0['142'] & Math.pow(2, 3)) { status.deviceHeadlineWarning.text.push('Low Lube Level W arn'); } if (reading0['142'] & Math.pow(2, 4)) { status.deviceHeadlineWarning.text.push('Coolant Level Warn'); } if (reading0['142'] & Math.pow(2, 5)) { status.deviceHeadlineWarning.text.push('Water in Fuel Warn'); } if (reading0['142'] & Math.pow(2, 6)) { status.deviceHeadlineWarning.text.push('No Flow Warn'); } if (reading0['142'] & Math.pow(2, 7)) { status.deviceHeadlineWarning.text.push('High Engine Oil Temp Warn'); } if (reading0['142'] & Math.pow(2, 8)) { status.deviceHeadlineWarning.text.push('Low Oil Pressure Warn'); } if (reading0['142'] & Math.pow(2, 9)) { status.deviceHeadlineWarning.text.push('High Engine Temp Warn'); } if (reading0['142'] & Math.pow(2, 10)) { status.deviceHeadlineWarning.text.push('High Discharge Pressure Warn'); } if (reading0['142'] & Math.pow(2, 11)) { status.deviceHeadlineWarning.text.push('Low Discharge Pressure Warn'); } if (reading0['142'] & Math.pow(2, 12)) { status.deviceHeadlineWarning.text.push('High Suction Warn'); } if (reading0['142'] & Math.pow(2, 13)) { status.deviceHeadlineWarning.text.push('Low Suction Warn'); } if (reading0['142'] & Math.pow(2, 14)) { status.deviceHeadlineWarning.text.push('High Level Warn'); } if (reading0['142'] & Math.pow(2, 15)) { status.deviceHeadlineWarning.text.push('Low Level Warn'); } if (reading0['142'] & Math.pow(2, 16)) { status.deviceHeadlineWarning.text.push('High Flow Warn'); } if (reading0['142'] & Math.pow(2, 17)) { status.deviceHeadlineWarning.text.push('Low Flow Warn'); } if (reading0['142'] & Math.pow(2, 18)) { status.deviceHeadlineWarning.text.push('High Pump Oil Temp Warn'); } if (reading0['142'] & Math.pow(2, 19)) { status.deviceHeadlineWarning.text.push('High Pump Housing Temp Warn'); } if (reading0['142'] & Math.pow(2, 20)) { status.deviceHeadlineWarning.text.push('Low Gear Box Pressure Warn'); } if (reading0['142'] & Math.pow(2, 21)) { status.deviceHeadlineWarning.text.push('High Gear Box Pressure Warn'); } if (reading0['142'] & Math.pow(2, 22)) { status.deviceHeadlineWarning.text.push('Air Damper Closed Warn'); } if (reading0['142'] & Math.pow(2, 23)) { status.deviceHeadlineWarning.text.push('Air Filter Restriction Warn'); } if (reading0['142'] & Math.pow(2, 24)) { status.deviceHeadlineWarning.text.push('Oil Filter Restriction Warn'); } if (reading0['142'] & Math.pow(2, 25)) { status.deviceHeadlineWarning.text.push('Low Engine Temp Warn'); } if (reading0['142'] & Math.pow(2, 26)) { status.deviceHeadlineWarning.text.push('High Engine Oil Pressure Warn'); } if (reading0['142'] & Math.pow(2, 27)) { status.deviceHeadlineWarning.text.push('Battery Charger Fail Warn'); } if (reading0['142'] & Math.pow(2, 28)) { status.deviceHeadlineWarning.text.push('Run To Destruct Warn'); } if (reading0['142'] & Math.pow(2, 29)) { status.deviceHeadlineWarning.text.push('Battery High Warn'); } if (reading0['142'] & Math.pow(2, 30)) { status.deviceHeadlineWarning.text.push('Battery Low Warn'); } if (reading0['142'] & Math.pow(2, 31)) { status.deviceHeadlineWarning.text.push('Amber Lamp Status'); } status.other.push({ id: 'windMachineControllerWarningMessage', rank: 100, code: 'warning', category: 'controller', shortMessage: 'Warning Message from Controller', message: 'Refer to headline for more information on this warning message' }); } }; var controllerPv101 = function controllerPv101(status, reading0, engineRPMUp, physical, language) { var engineState = reading0[140]; var controllerAutoMode = reading0[202]; var controllerAutoSwitch = 0; if (physical.sensorAutoSwitch === true || typeof physical.sensorAutoSwitch === 'undefined') { controllerAutoSwitch = reading0['143'] > 9000 ? 1 : 0; } else if (physical.sensorAutoSwitch === false) { controllerAutoSwitch = 1; } var engineStateTime = reading0['132'] || 0; var settlingTimeStart = physical.settlingTimeStart || 300; var now = new Date().getTime() / 1000; var diff = now - engineStateTime; var settlingTimeStartLapsed = diff > settlingTimeStart; if (controllerAutoMode === 1 && controllerAutoSwitch > 0) { status.other.push({ id: 'windMachineControllerAutoOn', rank: 100, code: 'normal', category: 'controller', shortMessage: 'A/S Auto On', message: 'Wind Machine ' + physical.deviceNumber + ' controller is in auto mode' }); status.stateIndicator = true; } else if ( /*controllerAutoMode > 0 && */ controllerAutoSwitch < 1) { status.other.push({ id: 'windMachineControllerSwitchOff', rank: 25, code: 'disconnected', category: 'controller', shortMessage: 'A/S Auto Switch Off', message: 'Wind Machine ' + physical.deviceNumber + ' auto mode switch is off' }); status.stateIndicator = false; status.deviceHeadlineDanger.enabled = true; status.deviceHeadlineDanger.text.push(intl.get(language, 'headline.windMachineSwitchInManualPosition', 'Switch on wind machine is in manual position')); } else { status.other.push({ id: 'windMachineControllerAutoOff', rank: 25, code: 'normal', category: 'controller', shortMessage: 'A/S Auto Off', message: 'Wind Machine ' + physical.deviceNumber + ' controller is not in auto mode' }); status.stateIndicator = false; } var controllerId = 'windMachine'; var controllerRank = 10; var controllerCode = 'normal'; var controllerShortMessage = 'Unknown issue'; var controllerMessage = 'Unknown issue'; switch (engineState) { case 1: controllerId = 'windMachineControllerEngineStopped'; controllerRank = 100; controllerCode = 'normal'; controllerShortMessage = 'Engine Stopped'; controllerMessage = 'Wind Machine ' + physical.deviceNumber + ' is stopped'; break; case 2: controllerId = 'windMachineControllerStandby'; controllerRank = 100; controllerCode = 'normal'; controllerShortMessage = 'Controller Standby'; controllerMessage = 'Wind Machine ' + physical.deviceNumber + ' is in standby'; break; case 3: controllerId = 'windMachineControllerPrestart1'; controllerRank = 10; controllerCode = 'info'; controllerShortMessage = 'Prestart 1'; controllerMessage = 'Wind Machine ' + physical.deviceNumber + ' in prestart delay 1'; break; case 6: controllerId = 'windMachineControllerCrankOn'; controllerRank = 10; controllerCode = 'info'; controllerShortMessage = 'Crank on'; controllerMessage = 'Wind Machine ' + physical.deviceNumber + ' crank on'; break; case 8: status.deviceHeadlineDanger.enabled = true; status.deviceHeadlineDanger.text.unshift(intl.get(language, 'headline.machineShouldBeOn', 'Machine should be ON')); if (settlingTimeStartLapsed) { controllerId = 'windMachineControllerFalseStart'; controllerRank = 10; controllerCode = 'danger'; controllerShortMessage = 'False Start'; controllerMessage = 'Wind Machine ' + physical.deviceNumber + ' false start'; } else { controllerId = 'windMachineControllerFalseStart'; controllerRank = 10; controllerCode = 'info'; controllerShortMessage = 'Crank on waiting'; controllerMessage = 'Wind Machine ' + physical.deviceNumber + ' crank on waiting'; } break; case 9: controllerId = 'windMachineControllerWarmup'; controllerRank = 10; controllerCode = 'info'; controllerShortMessage = 'Warmup'; controllerMessage = 'Wind Machine ' + physical.deviceNumber + ' in warmup delay'; break; case 12: controllerId = 'windMachineControllerRunning'; controllerRank = 10; controllerCode = 'success'; controllerShortMessage = 'Running'; controllerMessage = 'Wind Machine ' + physical.deviceNumber + ' running loaded'; break; case 13: controllerId = 'windMachineControllerCooldown'; controllerRank = 10; controllerCode = 'info'; controllerShortMessage = 'Cooldown'; controllerMessage = 'Wind Machine ' + physical.deviceNumber + ' in cooldown delay'; break; default: controllerId = 'windMachineControllerUnknownEngineState'; controllerRank = 30; controllerCode = 'danger'; controllerShortMessage = 'Unknown engine state'; controllerMessage = 'Wind Machine ' + physical.deviceNumber + ' unexpected engine state'; break; } status.other.push({ id: controllerId, rank: controllerRank, code: controllerCode, category: 'controller', shortMessage: controllerShortMessage, message: controllerMessage }); if (engineState >= 9 && engineState <= 13 && !engineRPMUp) { status.deviceHeadlineDanger.enabled = true; status.deviceHeadlineDanger.text.unshift(intl.get(language, 'headline.machineShouldBeOn', 'Machine should be ON')); status.other.push({ id: 'windMachineShouldBeOnState', rank: 1, code: 'danger', category: 'engine', shortMessage: 'RPM Low', message: 'RPM is too low for controller state at wind machine ' + physical.deviceNumber + ' ' }); } else if (engineState === 8 && !engineRPMUp) { if (settlingTimeStartLapsed) { status.other.push({ id: 'windMachineShouldBeOnState', rank: 1, code: 'danger', category: 'engine', shortMessage: 'RPM Low', message: 'RPM is too low for controller state at wind machine ' + physical.deviceNumber + ' ' }); } } }; var controllerElectric = function controllerElectric(status, reading0, engineRPMUp, physical, tempState, language) { var engineState = reading0[140]; var controllerAutoMode = reading0[202]; var controllerAutoSwitch = 0; if (physical.sensorAutoSwitch === true || typeof physical.sensorAutoSwitch === 'undefined') { controllerAutoSwitch = reading0['143'] > 9000 ? 1 : 0; } else if (physical.sensorAutoSwitch === false) { controllerAutoSwitch = 1; } if (controllerAutoMode === 1 && controllerAutoSwitch > 0) { status.other.push({ id: 'windMachineControllerAutoOn', rank: 100, code: 'normal', category: 'controller', shortMessage: 'A/S Auto On', message: 'Wind Machine ' + physical.deviceNumber + ' controller is in auto mode' }); status.stateIndicator = true; } else if ( /*controllerAutoMode > 0 && */ controllerAutoSwitch < 1) { status.other.push({ id: 'windMachineControllerSwitchOff', rank: 25, code: 'disconnected', category: 'controller', shortMessage: 'A/S Auto Switch Off', message: 'Wind Machine ' + physical.deviceNumber + ' auto mode switch is off' }); status.stateIndicator = false; status.deviceHeadlineDanger.enabled = true; status.deviceHeadlineDanger.text.push(intl.get(language, 'headline.windMachineSwitchInManualPosition', 'Switch on wind machine is in manual position.')); } else { status.other.push({ id: 'windMachineControllerAutoOff', rank: 25, code: 'normal', category: 'controller', shortMessage: 'A/S Auto Off', message: 'Wind Machine ' + physical.deviceNumber + ' controller is not in auto mode' }); status.stateIndicator = false; } var controllerId = 'windMachine'; var controllerRank = 10; var controllerCode = 'normal'; var controllerShortMessage = 'Unknown issue'; var controllerMessage = 'Unknown issue'; switch (engineState) { case 1: controllerId = 'windMachineControllerEngineStopped'; controllerRank = 100; controllerCode = 'normal'; controllerShortMessage = 'Engine Stopped'; controllerMessage = 'Wind Machine ' + physical.deviceNumber + ' is stopped'; break; case 6: controllerId = 'windMachineControllerCrankOn'; controllerRank = 10; controllerCode = 'info'; controllerShortMessage = 'Crank on'; controllerMessage = 'Wind Machine ' + physical.deviceNumber + ' crank on'; break; case 8: controllerId = 'windMachineControllerFalseStart'; controllerRank = 10; controllerCode = 'danger'; controllerShortMessage = 'False Start'; controllerMessage = 'Wind Machine ' + physical.deviceNumber + ' false start'; break; case 12: controllerId = 'windMachineControllerRunning'; controllerRank = 10; controllerCode = 'success'; controllerShortMessage = 'Running'; controllerMessage = 'Wind Machine ' + physical.deviceNumber + ' running loaded'; break; default: controllerId = 'windMachineControllerUnknownEngineState'; controllerRank = 30; controllerCode = 'danger'; controllerShortMessage = 'Unknown engine state'; controllerMessage = 'Wind Machine ' + physical.deviceNumber + ' unexpected engine state'; break; } status.other.push({ id: controllerId, rank: controllerRank, code: controllerCode, category: 'controller', shortMessage: controllerShortMessage, message: controllerMessage }); if (engineState >= 8 && engineState <= 13 && !engineRPMUp) { status.deviceHeadlineDanger.enabled = true; status.deviceHeadlineDanger.text.unshift(intl.get(language, 'headline.machineShouldBeOn', 'Machine should be ON')); status.other.push({ id: 'windMachineShouldBeOnState', rank: 1, code: 'danger', category: 'engine', shortMessage: 'Controller Issue', message: 'Current switch is off, wind machine ' + physical.deviceNumber + ' should be running ' }); } }; var fuelLevelState = function fuelLevelState(status, reading0, physical, language) { var tankSize = 5.0; if (_typeof(physical) === 'object' && tools.isNumber(physical.fuelTankSize)) { tankSize = physical.fuelTankSize; } var sensorRange = 5.557; if (_typeof(physical) === 'object' && tools.isNumber(physical.fuelSensorRange)) { sensorRange = physical.fuelSensorRange; } var fuelLevelWarning = -1; if (_typeof(physical) === 'object' && tools.isNumber(physical.fuelLevelWarning)) { fuelLevelWarning = physical.fuelLevelWarning / 100; } var fuelLevelConv = tools.fuelLevel(reading0[133] || 0, tankSize, sensorRange); if (fuelLevelConv >= 0 && fuelLevelConv < fuelLevelWarning) { status.other.push({ id: 'windMachineFuelLow', rank: 50, code: 'normal', category: 'sensor', shortMessage: 'Fuel Low', message: 'Fuel level at wind machine ' + physical.deviceNumber + ' is ' + Math.round(fuelLevelConv * 100) + '% which is below the ' + Math.round(fuelLevelWarning * 100) + '% warning level.' }); status.warningIndicator = true; status.deviceHeadlineWarning.enabled = true; status.deviceHeadlineWarning.text.push(intl.get(language, 'headling.fuelLow', 'Low Fuel')); } else { status.other.push({ id: 'windMachineFuelNormal', rank: 100, code: 'normal', category: 'sensor', shortMessage: 'Fuel Normal', message: 'Fuel level at wind machine ' + physical.deviceNumber + ' is ' + Math.round(fuelLevelConv * 100) + '%' }); } }; var powerState = function powerState(status, reading0, physical, language) { if (physical.powered) { var inputPower = reading0['186'] & 0x4; /* //System Status Register //NOTE: This is a read-only register REG08 BIT --- VBUS status 7: VBUS_STAT[1] | 00: Unknown (no input, or DPDM detection incomplete), 01: USB host 6: VBUS_STAT[0] | 10: Adapter port, 11: OTG --- Charging status 5: CHRG_STAT[1] | 00: Not Charging, 01: Pre-charge ( VSYSMIN) 1: In VSYSMIN regulation (BAT < VSYSMIN)ault is 3.5V (101) 0: Reserved */ if (inputPower) { status.other.push({ id: 'windMachineControllerPowerOn', rank: 100, code: 'normal', category: 'electricity', shortMessage: 'Controller has power', message: 'Controller has power at ' + physical.deviceNumber + ' ' }); } else { status.other.push({ id: 'windMachineControllerPowerOff', rank: 15, code: 'disconnected', category: 'controller', shortMessage: 'Controller does not have power', message: 'Controller does not have power at ' + physical.deviceNumber + ' ' }); status.deviceHeadlineDanger.enabled = true; status.deviceHeadlineDanger.text.push(intl.get(language, 'headline.altracNotReceivingPower', 'Altrac is not receiving power')); return false; } return true; } else { var batteryExternalWarning = physical.batteryExternalWarning || 11.8; var batteryExternalDead = physical.batteryExternalDead || 8; var batteryExternal = tools.displayFormula('percentTo20V', 1, 2, null, '130', reading0, null, physical); if (batteryExternal <= batteryExternalDead) { status.other.push({ id: 'windMachineExternalBatteryDead', rank: 15, code: 'disconnected', category: 'sensor', shortMessage: 'Battery Dead', message: 'External Battery at wind machine ' + physical.deviceNumber + ' is ' + batteryExternal + 'V, engine will not start' }); status.deviceHeadlineDanger.enabled = true; status.deviceHeadlineDanger.text.push(intl.get(language, 'headline.windMachineDeadBattery', 'Dead Wind Machine Battery')); status.deviceHeadlineDanger.text.push(intl.get(language, 'headline.altracNotReceivingPower', 'Altrac is not receiving power')); return false; } else if (batteryExternal <= batteryExternalWarning) { status.warningIndicator = true; status.other.push({ id: 'windMachineExternalBatteryLow', rank: 80, code: 'normal', category: 'sensor', shortMessage: 'Battery Low', message: 'External Battery at wind machine ' + physical.deviceNumber + ' is ' + batteryExternal + 'V which is below the ' + batteryExternalWarning + 'V warning level.' }); status.deviceHeadlineWarning.enabled = true; status.deviceHeadlineWarning.text.push(intl.get(language, 'headline.windMachineLowBattery', 'Low Wind Machine Battery')); } else { status.other.push({ id: 'windMachineExternalBatteryGood', rank: 100, code: 'normal', category: 'sensor', shortMessage: 'Battery Good', message: 'External Battery at wind machine ' + physical.deviceNumber + ' is ' + batteryExternal + 'V' }); } return true; } }; var offline = function offline(status, device, language) { var reason = false; var reading0 = device.reading0 || {}; var powerStatus = powerState(status, reading0, device.physical, language); if (!powerStatus) reason = true; // if (!reason) { // status.other.push({ // id: 'windMachineOfflineNoReason', // rank: 100, // code: 'normal', // category: 'sensor', // shortMessage: 'No reason wind machine is offline', // message: 'Reason for wind machine device being offline cannot be determined', // }); // status.deviceHeadlineDanger.enabled = true; // status.deviceHeadlineDanger.text.push( // intl.get( // language, // 'headline.offlineNoReason', // 'The reason the device is offline cannot be determined. Please check device in person' // ) // ); // } }; module.exports.offline = offline; /***/ }), /***/ "./node_modules/altrac-application-status/lib/translations/en.json": /***/ (function(module) { module.exports = JSON.parse("{\"headline.altracNotReceivingPower\":\"Altrac is not receiving power\",\"headline.machineShouldBeOn\":\"Machine should be ON\",\"headline.notConnected\":\"Altrac device has not connected to the cloud since {sinceTime}\",\"headline.notConnectedXMinutes\":\"Altrac device has not checked in with cloud for {minutes} minutes\",\"headline.temperatureAboveStop\":\"Ambient temperature is above stop temperature\",\"headline.temperatureBelowStart\":\"Ambient temperature is below start temperature\",\"headline.temperatureProbeFault\":\"Temperature Probe Fault\",\"headline.windMachineDeadBattery\":\"Dead Battery\",\"headline.windMachineLowBattery\":\"Low Battery\",\"headline.windMachineSwitchInManualPosition\":\"Switch is in the manual position.\",\"headling.fuelLow\":\"Low Fuel\",\"headling.internalBatteryLow\":\"Altrac internal battery low\"}"); /***/ }), /***/ "./node_modules/altrac-application-status/lib/translations/es.json": /***/ (function(module) { module.exports = JSON.parse("{\"headline.altracNotReceivingPower\":\"El dispositivo Altrac no está recibiendo energía\",\"headline.machineShouldBeOn\":\"La máquina debería estar ENCENDIDA\",\"headline.notConnected\":\"El dispositivo Altrac no está conectado a internet desde {sinceTime}\",\"headline.notConnectedXMinutes\":\"El dispositivo Altrac no se ha conectado a internet en {minutes} minutos\",\"headline.temperatureAboveStop\":\"Temperatura ambiente está por encima de la temperatura de apagado\",\"headline.temperatureBelowStart\":\"Temperatura ambiente está por debajo de la temperatura de encendido\",\"headline.temperatureProbeFault\":\"Falla en Sensor de Temperatura\",\"headline.windMachineDeadBattery\":\"Bateria Descargada\",\"headline.windMachineLowBattery\":\"Batería Baja\",\"headline.windMachineSwitchInManualPosition\":\"El interruptor está en posición manual\",\"headling.fuelLow\":\"Combustible Bajo\",\"headling.internalBatteryLow\":\"La batería interna del dispositivo Altrac está baja\"}"); /***/ }), /***/ "./node_modules/altrac-application-status/lib/translations/intl.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } /* eslint-disable */ var en = __webpack_require__("./node_modules/altrac-application-status/lib/translations/en.json"); var es = __webpack_require__("./node_modules/altrac-application-status/lib/translations/es.json"); var get = function get(language, _identifier, _defaultValue) { var defaultValue = ''; if (typeof _defaultValue === 'string' && _defaultValue) { defaultValue = _defaultValue; } var identifier = '***NO_TRANSLATION_KEY_PROVIDED***'; if (typeof _identifier === 'string' && _identifier && _identifier.length > 0) { identifier = _identifier; } if (identifier === '***NO_TRANSLATION_KEY_PROVIDED***') { return defaultValue; } if (language === 'es') { if (_typeof(es) === 'object' && es[identifier]) { return es[identifier]; } return defaultValue; } if (_typeof(en) === 'object' && en[identifier]) { return en[identifier]; } return defaultValue; }; module.exports = { get: get }; /***/ }), /***/ "./node_modules/altrac-application-status/node_modules/altrac-conversions/lib/index.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } // index.js var round = function round(n, d) { var decimalPlaces; switch (d) { case 0: decimalPlaces = 1; break; case 1: decimalPlaces = 10; break; case 2: decimalPlaces = 100; break; case 3: decimalPlaces = 1000; break; default: return n; } return Math.round(n * decimalPlaces) / decimalPlaces; }; var isNumber = function isNumber(n) { return !Number.isNaN(parseFloat(n)) && Number.isFinite(parseFloat(n)); }; var isNumberFormat = function isNumberFormat(n) { return !Number.isNaN(parseFloat(n)) && Number.isFinite(n); }; var splitTemplate = function split(input, physical, string) { if (!input) return null; if (typeof input !== 'string') return input; var output = input.match(/\{\{([a-zA-Z0-9. _]*\|[a-zA-Z0-9. _]*)\}\}/); if (!output) { return input; } var arr = output[1].split('|'); var returnValue; if (physical && _typeof(physical) === 'object' && Object.prototype.hasOwnProperty.call(physical, arr[0])) { returnValue = physical[arr[0]]; } else { var _arr2 = _slicedToArray(arr, 1); returnValue = _arr2[0]; } if (isNumber(returnValue) && !string) returnValue = Number(returnValue); return returnValue; }; var map = function map(value, x1, y1, x2, y2) { return (value - x1) * (y2 - x2) / (y1 - x1) + x2; }; var voltToVWC = function voltToVWC(v) { /* 0 to 1.1V VWC= 10*V-1 1.1V to 1.3V VWC= 25*V- 17.5 1.3V to 1.82V VWC= 48.08*V- 47.5 1.82V to 2.2V VWC= 26.32*V- 7.89 */ if (v < 0.1) { return 0; } if (v >= 0.1 && v < 1.1) { return 10 * v - 1; } if (v >= 1.1 && v < 1.3) { return 25 * v - 17.5; } if (v >= 1.3 && v < 1.82) { return 48.04 * v - 47.5; } if (v >= 1.82 && v <= 3) { // went to 3, since this is supposedly the max return 26.32 * v - 7.89; } return 'ERR'; }; var percentToVWC = function percentToVWC(p) { var v = p * 5; return voltToVWC(v); }; var analogToVWC = function analogToVWC(a) { var v = a / 1023 * 5; return voltToVWC(v); }; var percentToDigital = function percentToDigital(a) { if (a > 0.5) { return 1; } return 0; }; var analogToDigital = function analogToDigital(a) { if (a > 511) { return 1; } return 0; }; var percentToDigitalInverse = function percentToDigitalInverse(a) { return percentToDigital(a) === 1 ? 0 : 1; }; var analogToDigitalInverse = function analogToDigitalInverse(a) { return analogToDigital(a) === 1 ? 0 : 1; }; var voltToCentibar = function voltToCentibar(v) { var centibar = 'ERR'; if (v < 0) { centibar = 'VLO'; } else if (v >= 0 && v <= 3.1) { centibar = 1 / 0.0117155 * v; } else { centibar = 'VHI'; } return round(centibar, 0); }; var percentToCentibar = function percentToCentibar(p) { var v = p * 5; return voltToCentibar(v); }; var analogToCentibar = function analogToCentibar(a) { var v = a / 1023 * 5; return voltToCentibar(v); }; var metersPerSecondToMilesPerHour = function metersPerSecondToMilesPerHour(ms, precision) { var precisionValue = 0; if (precision && !Number.isNaN(precision)) { precisionValue = Number(precision); } return round(ms * 2.23694, precisionValue); }; var millimetersToInches = function millimetersToInches(mm, precision) { var precisionValue = 0; if (precision && !Number.isNaN(precision)) { precisionValue = Number(precision); } return round(mm * 0.0393701, precisionValue); }; var kilometersToMiles = function kilometersToMiles(km, precision) { var precisionValue = 0; if (precision && !Number.isNaN(precision)) { precisionValue = Number(precision); } return round(km * 0.621371, precisionValue); }; var kPaToInchesMercury = function kPaToInchesMercury(kpa, precision) { var precisionValue = 0; if (precision && !Number.isNaN(precision)) { precisionValue = Number(precision); } return round(kpa * 0.2953, precisionValue); }; var numberMap = function numberMap(value, inMin, inMax, outMin, outMax) { return (value - inMin) * (outMax - outMin) / (inMax - inMin) + outMin; }; var valveStatus = function valveStatus(status) { if (status === 0xFFFF) { return 0; } return status & 1 ? 1 : 0; }; var valveStatusString = function valveStatusString(status) { if (status === 0xFFFF) { return 'ERR'; } return valveStatus(status) ? 'ON' : 'OFF'; }; var cToF = function cToF(c) { return c * 1.8 + 32; }; var fToC = function fToC(f) { return (f - 32) / 1.8; }; var cellSignalToRssi = function cellSignalToRssi(signal) { return signal >>> 8; }; var cellSignalToQuality = function cellSignalToQuality(signal) { return (signal & 0xFF) >>> 0; }; var cellSignalToBars = function cellSignalToBars(signal, signalType, quality, qualityType, service) { var signalStrength = 0; var signalQuality = 0; // Strength of the signal if (service === 'LTE Cat-M1' || service === 'LTE' || service === 'LTE_OLD') { if (signalType === 'RSRP' && qualityType === 'RSRQ' || signal > 0 && quality > 0) { if (signal <= 90 && signal > 0) { signalStrength = 5; } else if (signal < 105) { signalStrength = 4; } else if (signal < 111) { signalStrength = 3; } else if (signal < 116) { signalStrength = 2; } else if (signal <= 119) { signalStrength = 1; } else if (signal >= 120) { signalStrength = 0; } if (quality <= 5 && quality > 0) { signalQuality = 5; } else if (quality <= 10) { signalQuality = 4; } else if (quality <= 15) { signalQuality = 3; } else if (quality < 17) { signalQuality = 2; } else if (quality <= 19) { signalQuality = 1; } else if (quality > 19) { signalQuality = 0; } else { signalQuality = -1; } } else { signalStrength = -1; signalQuality = -1; } } else if (service === 'UMTS' || signalType === 'RSCP' && qualityType === 'ECN0') { if (signal === 0) { signalStrength = 0; } else if (signal <= 70) { signalStrength = 5; } else if (signal <= 85) { signalStrength = 4; } else if (signal < 100) { signalStrength = 3; } else if (signal < 105) { signalStrength = 2; } else if (signal <= 110) { signalStrength = 1; } else if (signal >= 110) { signalStrength = 0; } if (quality <= 5 && quality > 0) { signalQuality = 5; } else if (quality <= 10) { signalQuality = 4; } else if (quality <= 15) { signalQuality = 3; } else if (quality < 20) { signalQuality = 2; } else { signalQuality = -1; } } else if (signalType === 'RXLEV' || quality === 0 && signal > 10) { // 2G if (signal <= 70) { signalStrength = 5; signalQuality = 5; } else if (signal <= 85) { signalStrength = 4; signalQuality = 4; } else if (signal < 100) { signalStrength = 3; signalQuality = 3; } else if (signal < 105) { signalStrength = 2; signalQuality = 2; } else if (signal <= 110) { signalStrength = 1; signalQuality = 1; } else if (signal >= 110) { signalStrength = 0; signalQuality = 0; } else if (signal === 0) { signalStrength = 0; signalQuality = 0; } } else if (quality > 0 && signal > 0) { // old 3G calculation if (signal <= 80) { signalStrength = 5; } else if (signal <= 90) { signalStrength = 4; } else if (signal < 100) { signalStrength = 3; } else if (signal < 105) { signalStrength = 2; } else if (signal <= 110) { signalStrength = 1; } else if (signal >= 110) { signalStrength = 0; } else if (signal === 0) { signalStrength = 0; } if (quality <= 5 && quality > 0) { signalQuality = 0; } else if (quality <= 10) { signalQuality = 1; } else if (quality <= 15) { signalQuality = 2; } else if (quality < 23) { signalQuality = 3; } else if (quality <= 30) { signalQuality = 4; } else if (quality < 100) { signalQuality = 5; } else { signalQuality = -1; } } else { signalStrength = -1; signalQuality = -1; } // Get average of the signal if Strength or Quality of the signal // drops into the red zone return the SignalTotal as 1 if no // connection return 0 var totalSignal = 0; if (signalStrength >= 1 && signalQuality >= 1) { totalSignal = Math.floor((signalStrength + signalQuality) / 2); } else if (signalStrength === 0 && signalQuality === 0) { totalSignal = 0; } else if (signalStrength === -1 || signalQuality === -1) { totalSignal = -1; } else { totalSignal = 1; } return totalSignal; }; var fromC = function fromC(c, tempConv, precision) { var returnValue = null; if (c <= 120 && c >= -50) { if (tempConv === 'f') { returnValue = round(cToF(c), precision); } else if (tempConv === 'c') { returnValue = round(c, precision); } } return returnValue; }; var fromCMultiplier = function fromCMultiplier(c, tempConv, precision) { return fromC(c / 100, tempConv, precision); }; var toC = function toC(v, tempConv, precision) { var returnValue = -99; if (tempConv === 'f') { returnValue = fToC(v); } else if (tempConv === 'c') { returnValue = v; } return round(returnValue, precision); }; var valveTimeToValveNumber = function valveTimeToValveNumber(valveTime) { return (Number(valveTime) >> 28 & 0x7) >>> 0; }; var valveTimeToEpoch = function valveTimeToEpoch(valveTime) { return (Number(valveTime) & 0xFFFFFFF) * 60; }; var valveTimeToEpochMillis = function valveTimeToEpochMillis(valveTime) { return (Number(valveTime) & 0xFFFFFFF) * 60 * 1000; }; var valveTimeToDate = function valveTimeToDate(valveTime) { return new Date(valveTimeToEpochMillis(valveTime)); }; var lastValveTime = function lastValveTime(valveTimeArr, valveNumber) { var valveNumberC = 1; if (valveNumber && valveNumber >= 0 && valveNumber <= 8) { valveNumberC = valveNumber; } var returnValue = [0, 0]; if (valveTimeArr) { for (var i = 0; i < valveTimeArr.length; i += 2) { if (valveTimeToValveNumber(valveTimeArr[i]) === valveNumberC && valveTimeToValveNumber(valveTimeArr[i + 1]) === valveNumberC && valveTimeToEpochMillis(valveTimeArr[i]) < new Date().getTime() && valveTimeToEpochMillis(valveTimeArr[i + 1]) < new Date().getTime()) { if (valveTimeToValveNumber(valveTimeArr[i]) === valveNumberC && valveTimeToValveNumber(valveTimeArr[i + 1]) === valveNumberC && (valveTimeArr[i] > returnValue[0] || returnValue[0] === 0)) { returnValue[0] = valveTimeArr[i]; returnValue[1] = valveTimeArr[i + 1]; } else {// do nothing } } else {// do nothing } } } return returnValue; }; var nextValveTime = function nextValveTime(valveTimeArr, valveNumber) { var valveNumberC = 1; if (valveNumber && valveNumber >= 0 && valveNumber <= 8) { valveNumberC = valveNumber; } var returnValue = [0, 0]; if (valveTimeArr) { for (var i = 0; i < valveTimeArr.length; i += 2) { if (valveTimeToEpochMillis(valveTimeArr[i]) < new Date().getTime() && valveTimeToEpochMillis(valveTimeArr[i + 1]) < new Date().getTime()) {// nothing to do here } else if (valveTimeToValveNumber(valveTimeArr[i]) === valveNumberC && valveTimeToValveNumber(valveTimeArr[i + 1]) === valveNumberC && (valveTimeArr[i] < returnValue[0] || returnValue[0] === 0)) { returnValue[0] = valveTimeArr[i]; returnValue[1] = valveTimeArr[i + 1]; } else {// do nothing } } } return returnValue; }; var nextValveTimeToEpochMillis = function nextValveTimeToEpochMillis(valveTimeArr, valveNumber) { var nextTimes = nextValveTime(valveTimeArr, valveNumber); var returnValue = [0, 0]; returnValue[0] = valveTimeToEpochMillis(nextTimes[0]); returnValue[1] = valveTimeToEpochMillis(nextTimes[1]); return returnValue; }; var lastValveTimeToEpochMillis = function lastValveTimeToEpochMillis(valveTimeArr, valveNumber) { var nextTimes = lastValveTime(valveTimeArr, valveNumber); var returnValue = [0, 0]; returnValue[0] = valveTimeToEpochMillis(nextTimes[0]); returnValue[1] = valveTimeToEpochMillis(nextTimes[1]); return returnValue; }; var toValveTime = function toValveTime(state, valve, epoch) { var statePrep = state << 31 >>> 0; var valvePrep = valve << 28 >>> 0; var epochPrep = epoch / 60; var returnVal = (statePrep | valvePrep | epochPrep) >>> 0; return returnVal; }; var secondsToHHMMSS = function secondsToHHMMSS(totalSeconds) { var hours = Math.floor(totalSeconds / 3600); var minutes = Math.floor((totalSeconds - hours * 3600) / 60); var seconds = totalSeconds - hours * 3600 - minutes * 60; var result = ''; // round seconds seconds = Math.round(seconds * 100) / 100; result += hours > 0 ? "".concat(hours, " hours, ") : ''; result += minutes > 0 ? "".concat(minutes, " minutes, ") : ''; result += seconds > 0 ? "".concat(seconds, " seconds") : ''; return result; }; var percentTo20V = function percentTo20V(p, precision, resistor1, resistor2, voltageReference) { var resistor1Temp = typeof resistor1 !== 'undefined' ? resistor1 : 1800; var resistor2Temp = typeof resistor2 !== 'undefined' ? resistor2 : 10000; var voltageReferenceTemp = typeof voltageReference !== 'undefined' ? voltageReference : 3.3; return round(p * (1 / (resistor1Temp / (resistor1Temp + resistor2Temp))) * voltageReferenceTemp, precision || 2); }; var fourToTwenty = function fourToTwenty(p, min, max, zero, precision) { var reference = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 3.34; var minNumber = 0; var maxNumber = 100; var precisionNumber = 0; if (!Number.isNaN(min)) { minNumber = Number(min); } if (!Number.isNaN(max)) { maxNumber = Number(max); } var zeroNumber = minNumber; if (!Number.isNaN(zero)) { zeroNumber = Number(zero); } if (!Number.isNaN(precision)) { precisionNumber = Number(precision); } var volt = p * reference; var mA = volt * 10; var mAP = (mA - 4) / 16; var returnValue = mAP * (maxNumber - minNumber) + minNumber; if (mA > 3.5 && returnValue < zeroNumber) { return 0; } if (returnValue < zeroNumber) { return 'OFF'; } if (returnValue > maxNumber) { return 'ERH'; } return round(returnValue, precisionNumber); }; var fuelLevel = function fuelLevel(percent, size, maxSize) { return percent * (1 / (size / maxSize)); }; var ftToM = function ftToM(ft) { return ft * 0.3048; }; var mToFt = function mToFt(m) { return m * 3.28084; }; var millisecondsPastExpectedConnection = function millisecondsPastExpectedConnection(lastConnection, sleepTime) { var currentTime = new Date().getTime(); var sleepInterval = sleepTime * 1000; if (!sleepTime || sleepTime === 0) { sleepInterval = 60 * 10 * 1000 + 20000; // checks in every ten minutes, max } var nextSeen = new Date(new Date(lastConnection).getTime() + sleepInterval).getTime(); if (nextSeen < currentTime) { return currentTime - nextSeen; } return 0; }; var spaceCamel = function spaceCamel(s) { return s.replace(/([A-Z])/g, ' $1').replace(/^./, function (str) { return str.toUpperCase(); }); }; var dewPoint = function dewPoint(t, rh) { var h = (Math.log10(rh) - 2) / 0.4343 + 17.62 * t / (243.12 + t); var dp = 243.12 * h / (17.62 - h); // this is the dew point in Celsius return dp; }; var pumpState = function pumpState(state) { var deviceStatus = ''; switch (state & 0xF) { case 1: deviceStatus = 'FWD'; break; case 2: deviceStatus = 'REV'; break; case 4: deviceStatus = 'BRK'; break; case 8: deviceStatus = 'STP'; break; default: deviceStatus = 'ERR'; } return deviceStatus; }; var flowMeterState = function flowMeterState(value) { if (value > 0) { return 'RUN'; } return 'STP'; }; var pumpOutput = function pumpOutput(readingCurrent, readingLast, currentTime, lastTime, multiplierValue) { var diff = (readingCurrent - readingLast) / multiplierValue; if (readingCurrent - readingLast < 0 && readingCurrent - readingLast >= -60000) { return 0; } if (readingCurrent - readingLast < -60000) { diff = (readingCurrent - readingLast + 65535) / multiplierValue; } if (currentTime === lastTime) { return 0; } var current = new Date(isNumberFormat(currentTime) ? currentTime * 1000 : currentTime).getTime(); var previous = new Date(isNumberFormat(lastTime) ? lastTime * 1000 : lastTime).getTime(); var diffMinutes = (current - previous) / 1000 / 60; var output = Math.round(diff / diffMinutes); return Number.isNaN(output) ? 0 : output; }; var rpmToState = function rpmToState(rpm, off, high) { var returnValue = 'OFF'; var offTest = 150; if (off) { offTest = off; } var highTest = 350; if (high) { highTest = high; } var rpmTest = 0; if (rpm) { rpmTest = rpm; } if (rpmTest < offTest) { returnValue = 'OFF'; } else if (rpmTest >= offTest && rpmTest < highTest) { returnValue = 'LOW'; } else { returnValue = 'HIGH'; } return returnValue; }; var autoSwitchAnalog = function autoSwitchAnalog(value) { return value > 9000 ? 1 : 0; }; var autoSwitchMPC20 = function autoSwitchMPC20(value) { return ((value & 0xFF) >>> 0) - 10 === 1 ? 1 : 0; }; var powerGood = function powerGood(value) { return value & 0x4 ? 1 : 0; }; var engineStateCalculator = function engineStateCalculator(rpm, intention, timestamp, offRpm, highRpm) { var rpmTemp = !rpm ? 0 : rpm; var intentionTemp = !intention ? 0 : intention; var timestampTemp = !timestamp ? new Date().getTime() / 1000 : timestamp; var offRpmTemp = !offRpm ? 750 : offRpm; var highRpmTemp = !highRpm ? 1600 : highRpm; var returnValue = 0; var timeDiff = new Date().getTime() / 1000 - timestampTemp; if (intentionTemp) { if (rpmTemp < offRpmTemp) { if (timeDiff >= 120) { returnValue = 8; // STATE_FALSE_START } else { returnValue = 6; // STATE_CRANK_ON } } else if (rpmTemp >= offRpmTemp && rpmTemp <= highRpmTemp) { returnValue = 9; // STATE_WARMUP_DELAY } else { returnValue = 12; // STATE_RUNNING_LOADED } } else if (rpmTemp < offRpmTemp) { returnValue = 1; // STATE_ENGINE_STOPPED } else if (rpmTemp >= offRpmTemp && rpmTemp <= highRpmTemp) { returnValue = 9; // STATE_WARMUP_DELAY } else { returnValue = 13; // STATE_COOLDOWN_DELAY } return returnValue; }; var rpmOrchardRiteAutometer9117 = function rpmOrchardRiteAutometer9117(rpm) { var returnValue = Math.round((rpm / -170.1244909 + 8.572735138) * rpm); if (returnValue < 0) { return 0; } if (returnValue > 3000) { return 3000; } return returnValue; }; var lineFit = function lineFit(val, m, b, precision, max, min) { var maxValue = max || 4294967295; var minValue = min || 0; var returnValue = val * m + b; returnValue = round(returnValue, precision || 0); if (returnValue < minValue) { return minValue; } if (returnValue > maxValue) { return maxValue; } return returnValue; }; var binLevel = function binLevel(binLevelCurrent, binLevelLast, debounce, powered, numberOfBins) { var fullness = 0; if (!debounce) { fullness = binLevelCurrent; } else if (binLevelCurrent === binLevelLast) { fullness = binLevelCurrent; } else if (binLevelCurrent < binLevelLast) { fullness = binLevelCurrent; } else { fullness = binLevelLast; } var iterations = 4; var totalBins = 4; if (numberOfBins && numberOfBins > 0 && numberOfBins < 5) { iterations = numberOfBins; totalBins = numberOfBins; } var i = 1; if (powered) { i = 2; iterations += 1; } var numberFull = 0; for (i; i <= iterations; i += 1) { if ((fullness & Math.pow(2, i - 1)) === Math.pow(2, i - 1)) { numberFull += 1; } else { numberFull += 0; } } return "".concat(numberFull, "/").concat(totalBins); }; var windMachineChangeStatus = function windMachineChangeStatus(cs) { var returnValue = ''; switch (cs) { case 0: returnValue = 'No Change'; break; case 1: returnValue = 'A/S New'; break; case 2: returnValue = 'EP New'; break; case 254: returnValue = 'Error'; break; case 255: returnValue = 'No A/S'; break; default: returnValue = cs; } return returnValue; }; var windMachineCommunicationStatus = function windMachineCommunicationStatus(cs) { var returnValue = ''; switch (cs) { case -2: returnValue = 'Comm Error'; break; case -1: returnValue = 'Not Connected'; break; case 0: returnValue = 'No Attempt'; break; case 1: returnValue = 'Connected'; break; default: returnValue = cs; } return returnValue; }; var windMachineEngineState = function windMachineEngineState(cs) { var returnValue = ''; switch (cs) { case 0: returnValue = 'ECU Delay'; break; case 1: returnValue = 'Engine Stopped'; break; case 2: returnValue = 'Controller Standby'; break; case 3: returnValue = 'Prestart 1'; break; case 4: returnValue = 'Checksafe'; break; case 5: returnValue = 'Prestart 2'; break; case 6: returnValue = 'Crank on'; break; case 7: returnValue = 'Crank Rest'; break; case 8: returnValue = 'False Start'; break; case 9: returnValue = 'Warmup'; break; case 10: returnValue = 'Line Fill 1'; break; case 11: returnValue = 'Line Fill 2'; break; case 12: returnValue = 'Running'; break; case 13: returnValue = 'Cooldown'; break; case 14: returnValue = 'Stopping'; break; case 15: returnValue = 'Spindown'; break; case 16: returnValue = 'Wait To Start'; break; default: returnValue = cs; } return returnValue; }; var windMachineMPC20ShutdownStatus = function windMachineMPC20ShutdownStatus(sd) { var returnArray = []; if (sd & Math.pow(2, 0)) { returnArray.push('Overspeed SD'); } if (sd & Math.pow(2, 1)) { returnArray.push('Underspeed SD'); } if (sd & Math.pow(2, 2)) { returnArray.push('Overcrank SD'); } if (sd & Math.pow(2, 3)) { returnArray.push('Low Oil Pressure SD'); } if (sd & Math.pow(2, 4)) { returnArray.push('High Engine Temp SD'); } if (sd & Math.pow(2, 5)) { returnArray.push('Low Fuel SD'); } if (sd & Math.pow(2, 6)) { returnArray.push('Low Discharge Pressure SD'); } if (sd & Math.pow(2, 7)) { returnArray.push('High Discharge Pressure SD'); } if (sd & Math.pow(2, 8)) { returnArray.push('Speed Signal Lost SD'); } if (sd & Math.pow(2, 9)) { returnArray.push('Low Lube Level SD'); } if (sd & Math.pow(2, 10)) { returnArray.push('Fuel Leak SD'); } if (sd & Math.pow(2, 11)) { returnArray.push('Fuel Filter Restriction SD'); } if (sd & Math.pow(2, 12)) { returnArray.push('Air Damper Closed SD no'); } if (sd & Math.pow(2, 13)) { returnArray.push('Air Filter Restriction SD'); } if (sd & Math.pow(2, 14)) { returnArray.push('Oil Filter Restriction SD'); } if (sd & Math.pow(2, 15)) { returnArray.push('Remote Stop SD'); } if (sd & Math.pow(2, 16)) { returnArray.push('Coolant Level SD'); } if (sd & Math.pow(2, 17)) { returnArray.push('High Level SD'); } if (sd & Math.pow(2, 18)) { returnArray.push('Low Level SD'); } if (sd & Math.pow(2, 19)) { returnArray.push('High Flow SD'); } if (sd & Math.pow(2, 20)) { returnArray.push('Low Flow SD'); } if (sd & Math.pow(2, 21)) { returnArray.push('High Pump Oil Temp SD'); } if (sd & Math.pow(2, 22)) { returnArray.push('High Pump Housing Temp SD'); } if (sd & Math.pow(2, 23)) { returnArray.push('Water in Fuel SD'); } if (sd & Math.pow(2, 24)) { returnArray.push('Low Suction SD'); } if (sd & Math.pow(2, 25)) { returnArray.push('High Suction SD'); } if (sd & Math.pow(2, 26)) { returnArray.push('High Engine Oil Pressure SD'); } if (sd & Math.pow(2, 27)) { returnArray.push('High Engine Oil Temp SD'); } if (sd & Math.pow(2, 28)) { returnArray.push('Low Gear Box Pressure SD'); } if (sd & Math.pow(2, 29)) { returnArray.push('High Gear Box Pressure SD'); } if (sd & Math.pow(2, 30)) { returnArray.push('Battery Charger Fail SD'); } if (sd & Math.pow(2, 31)) { returnArray.push('Red Lamp Status'); } return returnArray; }; var windMachineMPC20WarningStatus = function windMachineMPC20WarningStatus(wd) { var returnArray = []; if (wd & Math.pow(2, 0)) { returnArray.push('Low Fuel Warn'); } if (wd & Math.pow(2, 1)) { returnArray.push('Fuel Leak Warn'); } if (wd & Math.pow(2, 2)) { returnArray.push('Fuel Filter Restriction Warn'); } if (wd & Math.pow(2, 3)) { returnArray.push('Low Lube Level W arn'); } if (wd & Math.pow(2, 4)) { returnArray.push('Coolant Level Warn'); } if (wd & Math.pow(2, 5)) { returnArray.push('Water in Fuel Warn'); } if (wd & Math.pow(2, 6)) { returnArray.push('No Flow Warn'); } if (wd & Math.pow(2, 7)) { returnArray.push('High Engine Oil Temp Warn'); } if (wd & Math.pow(2, 8)) { returnArray.push('Low Oil Pressure Warn'); } if (wd & Math.pow(2, 9)) { returnArray.push('High Engine Temp Warn'); } if (wd & Math.pow(2, 10)) { returnArray.push('High Discharge Pressure Warn'); } if (wd & Math.pow(2, 11)) { returnArray.push('Low Discharge Pressure Warn'); } if (wd & Math.pow(2, 12)) { returnArray.push('High Suction Warn'); } if (wd & Math.pow(2, 13)) { returnArray.push('Low Suction Warn'); } if (wd & Math.pow(2, 14)) { returnArray.push('High Level Warn'); } if (wd & Math.pow(2, 15)) { returnArray.push('Low Level Warn'); } if (wd & Math.pow(2, 16)) { returnArray.push('High Flow Warn'); } if (wd & Math.pow(2, 17)) { returnArray.push('Low Flow Warn'); } if (wd & Math.pow(2, 18)) { returnArray.push('High Pump Oil Temp Warn'); } if (wd & Math.pow(2, 19)) { returnArray.push('High Pump Housing Temp Warn'); } if (wd & Math.pow(2, 20)) { returnArray.push('Low Gear Box Pressure Warn'); } if (wd & Math.pow(2, 21)) { returnArray.push('High Gear Box Pressure Warn'); } if (wd & Math.pow(2, 22)) { returnArray.push('Air Damper Closed Warn'); } if (wd & Math.pow(2, 23)) { returnArray.push('Air Filter Restriction Warn'); } if (wd & Math.pow(2, 24)) { returnArray.push('Oil Filter Restriction Warn'); } if (wd & Math.pow(2, 25)) { returnArray.push('Low Engine Temp Warn'); } if (wd & Math.pow(2, 26)) { returnArray.push('High Engine Oil Pressure Warn'); } if (wd & Math.pow(2, 27)) { returnArray.push('Battery Charger Fail Warn'); } if (wd & Math.pow(2, 28)) { returnArray.push('Run To Destruct Warn'); } if (wd & Math.pow(2, 29)) { returnArray.push('Battery High Warn'); } if (wd & Math.pow(2, 30)) { returnArray.push('Battery Low Warn'); } if (wd & Math.pow(2, 31)) { returnArray.push('Amber Lamp Status'); } return returnArray; }; var chartDimensions = function chartDimensions(windowWidth) { var windowWidthTemp = windowWidth; var chartWidth = 288; var chartHeight = 288 - 30; if (windowWidthTemp >= 600) { chartWidth = 614; chartHeight = 470; } else if (windowWidthTemp >= 375) { chartWidth = 350; chartHeight = 320; } chartWidth -= 20; chartHeight -= 20; return { width: "".concat(chartWidth, "px"), height: "".concat(chartHeight, "px"), widthNumber: chartWidth, heightNumber: chartHeight }; }; var numberToBinary = function numberToBinary(value, bit) { return (value & Math.pow(2, bit)) >>> 0; }; var numberToBinaryFE = function numberToBinaryFE(value, bit) { return numberToBinary(value, bit) ? 'F' : 'E'; }; var numberToBinaryOnOff = function numberToBinaryOnOff(value, bit) { return numberToBinary(value, bit) ? 'ON' : 'OFF'; }; /** * @param {number} mA value > 0 * @returns true when value > 5 else false */ var mAToBoolean = function mAToBoolean(mA) { return isNumber(mA) && Number(mA) > 5; }; /** * @param {number} state value > 0 * @returns true when value > 5 else false */ var stateToBoolean = function stateToBoolean(state) { return isNumber(state) && Number(state) >= 9 && Number(state) <= 13; }; /** * @param {any} value - 1/0, true/false, 'string'/'', thing/undefined * @returns true when value is truthy. */ var toBoolean = function toBoolean(value) { if (!value) return false; // matches '', 0, false, undefined if (typeof value === 'boolean') return value; if (isNumber(value) && Number.isFinite(value)) return !!value; if (typeof value === 'string') return !!/^(true|t|on)$/i.test(value); return !!value; }; var gallonsToAcreFeet = function gallonsToAcreFeet(value, precision) { var returnValue = 0; if (!Number.isNaN(value) && Number(value) > 0) { returnValue = round(Number(value) / 325851, precision); } return returnValue; }; function litersToUserPreference(value, userPreference, unitType, precision) { var returnValue = 0; if (!Number.isNaN(value) && Number(value) > 0) { if (unitType === 'volume') { if (userPreference === 'liters') { returnValue = value; } else if (userPreference === 'gallons') { returnValue = round(Number(value) / 3.78541, precision); } else if (userPreference === 'acreInch') { returnValue = round(Number(value) / 102790.15313, precision); } else if (userPreference === 'cubicFeet') { returnValue = round(Number(value) / 28.316846592, precision); } else if (userPreference === 'hectareM') { returnValue = round(Number(value) / 10000000, precision); } else if (userPreference === 'cubicM') { returnValue = round(Number(value) / 1000, precision); } else { returnValue = round(Number(value) / 1233481.8553199936, precision); } } else if (unitType === 'flow') { if (userPreference === 'lpm') { returnValue = round(Number(value), precision); } else { returnValue = round(Number(value) / 3.78541, precision); } } } return returnValue; } /** * Generates the display value for a collection of moisture sensor readings. * @param {*} reading * @param {*} physical * @param {*} multiplier * @param {*} precision * @param {*} valueKey */ var moistureSensor = function moistureSensor(reading, physical, multiplier, precision, valueKey) { var total = 0; var denominator = 0; var keyList; if (valueKey && Array.isArray(valueKey) && valueKey.length) { keyList = valueKey; } else { keyList = []; for (var i = 1; i <= 16; i++) { keyList.push(i); } } keyList.forEach(function (key) { var rawValue = reading[key]; var rawDate = reading["".concat(key, "Date")] || new Date(); if (isNumber(rawValue) && Date.parse(rawDate) > new Date().getTime() - 86400000) { var value = Number(rawValue) / multiplier; if (value > 2 && value < 99) { total += value; denominator += 1; } } }); if (denominator === 0) return 'ERR'; var average = total / denominator; if (new Date().getTime() - Date.parse(reading['1Date']) > 21600000) { // 6 hours return 'NC'; } var moistureSensorSettings = physical.moistureSensorSettings || {}; var moistureCombined = moistureSensorSettings.moistureCombined || {}; var goalMax = moistureCombined.goalMax || 0; var goalMin = moistureCombined.goalMin || 0; if (isNumber(goalMax) && Number(goalMax) > 0 && isNumber(goalMin) && Number(goalMin) > 0 && Number(goalMax) > Number(goalMin)) { goalMax = Number(goalMax); goalMin = Number(goalMin); } else { return 'NOT\nSET'; } var returnValue = round((average - goalMin) / (goalMax - goalMin) * 100, precision); return returnValue; }; /** * Generates the average of a collection of moisture sensor readings. * @param {*} reading * @param {*} physical * @param {*} multiplier * @param {*} precision * @param {*} valueKey */ var soilMoistureSensorAverage = function soilMoistureSensorAverage(reading, physical, multiplier, precision, valueKey) { var total = 0; var denominator = 0; var keyList; if (valueKey && Array.isArray(valueKey)) { keyList = valueKey; } else { keyList = []; for (var i = 1; i <= 16; i++) { keyList.push(i); } } keyList.forEach(function (key) { var rawValue = reading[key]; if (isNumber(rawValue)) { var value = Number(rawValue) / multiplier; if (value > 10 && value < 99) { total += value; denominator += 1; } } }); if (denominator === 0) return undefined; var average = round(total / denominator); return average; }; /** * Generates the average of a collection of salinity sensor readings. * @param {*} reading * @param {*} physical * @param {*} multiplier * @param {*} precision * @param {*} valueKey */ var soilSalinitySensorAverage = function soilSalinitySensorAverage(reading, physical, multiplier, precision, valueKey) { var total = 0; var denominator = 0; var keyList; if (valueKey && Array.isArray(valueKey)) { keyList = valueKey; } else { keyList = []; for (var i = 1; i <= 16; i++) { keyList.push(i); } } keyList.forEach(function (key) { var rawValue = reading[key]; if (isNumber(rawValue)) { var value = Number(rawValue) / multiplier; if (value > 10 && value < 99) { total += value; denominator += 1; } } }); if (denominator === 0) return undefined; var average = round(total / denominator, precision); return average; }; /** * Generates the average of a collection of soil temperature readings. * @param {*} reading * @param {*} physical * @param {*} multiplier * @param {*} precision * @param {*} tempConv */ var soilTemperatureSensorAverage = function soilTemperatureSensorAverage(reading, physical, multiplier, precision, valueKey, tempConv) { var total = 0; var denominator = 0; var keyList; if (valueKey && Array.isArray(valueKey)) { keyList = valueKey; } else { keyList = []; for (var i = 1; i <= 16; i++) { keyList.push(i); } } keyList.forEach(function (key) { var rawValue = reading[key]; if (isNumber(rawValue)) { var value = Number(rawValue) / multiplier; if (value > 10 && value < 99) { total += value; denominator += 1; } } }); if (denominator === 0) return undefined; var average = total / denominator; var returnResult = round(tempConv === 'f' ? cToF(average) : average, precision); return returnResult; }; var windDirection = function windDirection(wd) { if (wd > 360 || wd < 0) { return 'ERR'; } var dir = 'ERR'; if (wd < 0 || wd > 360) { // eslint-disable-next-line no-console console.error('Enter a degree between 0 and 360 degrees.'); } else if (wd >= 0 && wd <= 11.25) { dir = 'N'; } else if (wd > 348.75 && wd <= 360) { dir = 'N'; } else if (wd > 11.25 && wd <= 33.75) { dir = 'NNE'; } else if (wd > 33.75 && wd <= 56.25) { dir = 'NE'; } else if (wd > 56.25 && wd <= 78.75) { dir = 'ENE'; } else if (wd > 78.75 && wd <= 101.25) { dir = 'E'; } else if (wd > 101.25 && wd <= 123.75) { dir = 'ESE'; } else if (wd > 123.75 && wd <= 146.25) { dir = 'SE'; } else if (wd > 146.25 && wd <= 168.75) { dir = 'SSE'; } else if (wd > 168.75 && wd <= 191.25) { dir = 'S'; } else if (wd > 191.25 && wd <= 213.75) { dir = 'SSW'; } else if (wd > 213.75 && wd <= 236.25) { dir = 'SW'; } else if (wd > 236.25 && wd <= 258.75) { dir = 'WSW'; } else if (wd > 258.75 && wd <= 281.25) { dir = 'W'; } else if (wd > 281.25 && wd <= 303.75) { dir = 'WNW'; } else if (wd > 303.75 && wd <= 326.25) { dir = 'NW'; } else if (wd > 326.25 && wd <= 348.75) { dir = 'NNW'; } return dir; }; function valueCalculator(formula, value, context, unitType, userPreference, precision) { var returnValue = value; switch (formula) { case 'valveStatus': returnValue = valveStatus(value); break; case 'valveStatusString': returnValue = valveStatusString(value); break; case 'fromC': case 'temperature': returnValue = fromC(value, context.tempConv, precision); break; case 'temperatureF': returnValue = fromC(value, 'f', precision); break; case 'temperatureC': returnValue = fromC(value, 'c', precision); break; case 'percentToCentibar': returnValue = percentToCentibar(value); break; case 'percentToVWC': returnValue = percentToVWC(value); break; case 'metersPerSecondToMilesPerHour': returnValue = metersPerSecondToMilesPerHour(value, precision); break; case 'windDirection': returnValue = windDirection(value); break; case 'mAToBoolean': returnValue = mAToBoolean(value); break; case 'stateToBoolean': returnValue = stateToBoolean(value); break; case 'toBoolean': returnValue = toBoolean(value); break; case 'millimetersToInches': returnValue = millimetersToInches(value, precision); break; case 'kilometersToMiles': returnValue = kilometersToMiles(value, precision); break; case 'kPaToInchesMercury': returnValue = kPaToInchesMercury(value, precision); break; case 'analogToCentibar': returnValue = analogToCentibar(value); break; case 'analogToVWC': returnValue = analogToVWC(value); break; case 'analogToDigitalInverseString': returnValue = analogToDigitalInverse(value) === 1 ? 'ON' : 'OFF'; break; case 'percentToDigitalInverseString': returnValue = percentToDigitalInverse(value) === 1 ? 'ON' : 'OFF'; break; case 'analogToDigitalInverse': returnValue = analogToDigitalInverse(value); break; case 'percentToDigitalInverse': returnValue = percentToDigitalInverse(value); break; case 'analogToDigitalString': returnValue = analogToDigital(value) === 1 ? 'ON' : 'OFF'; break; case 'percentToDigitalString': returnValue = percentToDigital(value) === 1 ? 'ON' : 'OFF'; break; case 'percentToDigitalStringFullEmpty': returnValue = percentToDigital(value) === 1 ? 'FULL' : 'EMP'; break; case 'lowPercentToDigital': returnValue = percentToDigital(value + 0.3); break; case 'lowPercentToDigitalString': returnValue = percentToDigital(value + 0.3) === 1 ? 'ON' : 'OFF'; break; case 'analogToDigital': returnValue = analogToDigital(value); break; case 'percentToDigital': returnValue = percentToDigital(value); break; case 'pumpState': returnValue = pumpState(value); break; case 'autoSwitchAnalog': returnValue = autoSwitchAnalog(value); break; case 'autoSwitchMPC20': returnValue = autoSwitchMPC20(value); break; case 'rpmOrchardRiteAutometer9117': returnValue = rpmOrchardRiteAutometer9117(value); break; case 'powerGood': returnValue = powerGood(value); break; case 'gallonsToAcreFeet': returnValue = gallonsToAcreFeet(value, precision); break; case 'litersToUserPreference': returnValue = litersToUserPreference(value, userPreference, unitType, precision); break; case 'flowMeterState': returnValue = flowMeterState(value); break; case 'cellSignalToRssi': returnValue = cellSignalToRssi(value); break; case 'cellSignalToQuality': returnValue = cellSignalToQuality(value); break; case 'numberToBinary0': returnValue = numberToBinary(value, 0); break; case 'numberToBinary1': returnValue = numberToBinary(value, 1); break; case 'numberToBinary2': returnValue = numberToBinary(value, 2); break; case 'numberToBinary3': returnValue = numberToBinary(value, 3); break; case 'numberToBinary4': returnValue = numberToBinary(value, 4); break; case 'numberToBinary5': returnValue = numberToBinary(value, 5); break; case 'numberToBinary6': returnValue = numberToBinary(value, 6); break; case 'numberToBinary7': returnValue = numberToBinary(value, 7); break; case 'numberToBinaryFE0': returnValue = numberToBinaryFE(value, 0); break; case 'numberToBinaryFE1': returnValue = numberToBinaryFE(value, 1); break; case 'numberToBinaryFE2': returnValue = numberToBinaryFE(value, 2); break; case 'numberToBinaryFE3': returnValue = numberToBinaryFE(value, 3); break; case 'numberToBinaryFE4': returnValue = numberToBinaryFE(value, 4); break; case 'numberToBinaryFE5': returnValue = numberToBinaryFE(value, 5); break; case 'numberToBinaryFE6': returnValue = numberToBinaryFE(value, 6); break; case 'numberToBinaryFE7': returnValue = numberToBinaryFE(value, 7); break; case 'numberToBinaryOnOff0': returnValue = numberToBinaryOnOff(value, 0); break; case 'numberToBinaryOnOff1': returnValue = numberToBinaryOnOff(value, 1); break; case 'numberToBinaryOnOff2': returnValue = numberToBinaryOnOff(value, 2); break; case 'numberToBinaryOnOff3': returnValue = numberToBinaryOnOff(value, 3); break; case 'numberToBinaryOnOff4': returnValue = numberToBinaryOnOff(value, 4); break; case 'numberToBinaryOnOff5': returnValue = numberToBinaryOnOff(value, 5); break; case 'numberToBinaryOnOff6': returnValue = numberToBinaryOnOff(value, 6); break; case 'numberToBinaryOnOff7': returnValue = numberToBinaryOnOff(value, 7); break; default: returnValue = round(value, precision); } return returnValue; } var displayFormula = function displayFormula(formula, multiplier, precision, context, _valueKey, readingCurrent, readingLast, physical, mapValues) { var ERROR = 'ERR'; var isInvalidReading = function isInvalidReading(x) { return x === 4294967295 || x === 65535 || x === -32768 || !isNumber(x); }; var returnValue; var valueKey = _valueKey; if (typeof _valueKey === 'string' && (_valueKey.startsWith('[') || _valueKey.startsWith('{'))) { valueKey = JSON.parse(_valueKey); } switch (_typeof(valueKey)) { case 'number': case 'string': returnValue = readingCurrent[valueKey]; if (isInvalidReading(returnValue)) return ERROR; break; case 'object': break; default: return ERROR; } var multiplierValue = 1; if (multiplier) { multiplierValue = multiplier; } var precisionValue = 0; if (precision) { precisionValue = precision; } var formulaValue = formula; var formulaValueSecondary = ''; if (formula && formula.substr(formula.length - 'Rolling'.length) === 'Rolling') { formulaValue = 'rolling'; formulaValueSecondary = formula.substr(0, formula.length - 'Rolling'.length); } var physicalValue = {}; if (physical && _typeof(physical) === 'object') { physicalValue = physical; } switch (formulaValue) { case 'difference': { var valueKey0 = valueKey[0]; var valueKey1 = valueKey[1]; var value0; var value1; if (_typeof(valueKey0) === 'object') { value0 = valueCalculator(valueKey0.formula, readingCurrent[valueKey0.valueKey] / (valueKey0.multiplier || 1), valueKey0.context || '', valueKey0.precision || 0); value1 = valueCalculator(valueKey1.formula, readingCurrent[valueKey1.valueKey] / (valueKey1.multiplier || 1), valueKey1.context || '', valueKey1.precision || 0); } else { value0 = valueCalculator(formula, readingCurrent[valueKey0] / multiplierValue, context, precisionValue); value1 = valueCalculator(formula, readingCurrent[valueKey1] / multiplierValue, context, precisionValue); } if (isNumber(value0) && isNumber(value1)) { returnValue = Math.abs(value0 - value1); } else { returnValue = 'ERR'; } } break; case 'toBoolean': returnValue = toBoolean(readingCurrent[valueKey] / multiplierValue); break; case 'mAToBoolean': returnValue = mAToBoolean(readingCurrent[valueKey] / multiplierValue); break; case 'stateToBoolean': returnValue = stateToBoolean(readingCurrent[valueKey] / multiplierValue); break; case 'percentToDigitalStringAND': returnValue = 'ON'; if (Array.isArray(valueKey)) { returnValue = valueKey.reduce(function (acc, key) { var output = percentToDigital(readingCurrent[key] / multiplierValue) === 1 ? 'ON' : 'OFF'; if (output === 'OFF') return output; return acc; }, 'OFF'); } else { returnValue = 'OFF'; } break; case 'percentToDigitalStringOR': returnValue = 'OFF'; if (Array.isArray(valueKey)) { returnValue = valueKey.reduce(function (acc, key) { var output = percentToDigital(readingCurrent[key] / multiplierValue) === 1 ? 'ON' : 'OFF'; if (output === 'ON') return output; return acc; }, 'OFF'); } else { returnValue = 'OFF'; } break; case 'binLevel': returnValue = binLevel(readingCurrent['131'], readingLast['131'], physicalValue.debounce, physicalValue.powered, physicalValue.bins); break; case 'pumpOutput': { var flowTime = 132; if (physicalValue.flowTimestampKey) { flowTime = physicalValue.flowTimestampKey; } returnValue = pumpOutput(readingCurrent[valueKey], readingLast[valueKey], readingCurrent[flowTime] || readingCurrent.date, readingLast[flowTime] || readingLast.date, multiplierValue); } break; case 'flowRate': { var _flowTime = 132; if (physicalValue.flowTimestampKey) { _flowTime = physicalValue.flowTimestampKey; } if (physicalValue.unitsPerPulse) { multiplierValue = 1 / Number(physicalValue.unitsPerPulse); } else if (physicalValue.pulseMultiplier) { multiplierValue = Number(physicalValue.pulseMultiplier); } returnValue = pumpOutput(readingCurrent[valueKey], readingLast[valueKey], readingCurrent[_flowTime] || readingCurrent.date, readingLast[_flowTime] || readingLast.date, multiplierValue); } break; case 'temperatureAutoDecimal': returnValue = fromC(readingCurrent[valueKey] / multiplierValue, context.tempConv); if (returnValue < 10 && returnValue > -10) { precisionValue = 1; } else { precisionValue = 0; } break; case 'fuelLevel': { var fuelTankSize = 5.0; if (physicalValue && physicalValue.fuelTankSize) { fuelTankSize = physicalValue.fuelTankSize; } var fuelSensorRange = 5.557; if (physicalValue && physicalValue.fuelSensorRange) { fuelSensorRange = physicalValue.fuelSensorRange; } // 0.25V is based on the Rochester R3D-LP + 5V from ISBD // 0.25V = 5% * 5V var fuelSensorMinV = 0.25; // based on the Rochester R3D-LP Gauge if (physicalValue && physicalValue.fuelSensorMinV) { fuelSensorMinV = physicalValue.fuelSensorMinV; } // 4.6V is based on the Rochester R3D-LP + 5V + Experience with Zirkle // Rochester says 80% of in voltage is max, so 5V * 80% = 4V // But @ Zirkle, some gauges show 4.6V, and look like they are working var fuelSensorMaxV = 4.6; // based on the Rochester R3D-LP Gauge if (physicalValue && physicalValue.fuelSensorMaxV) { fuelSensorMaxV = physicalValue.fuelSensorMaxV; } var fuelSensorVCal = 5.557; if (physicalValue && physicalValue.fuelSensorVCal) { fuelSensorVCal = physicalValue.fuelSensorVCal; } if (readingCurrent[valueKey] * fuelSensorVCal > fuelSensorMaxV) { returnValue = 'Error High'; } else if (readingCurrent[valueKey] * fuelSensorVCal < fuelSensorMinV) { returnValue = 'Not Connected'; } else { returnValue = round(fuelLevel(readingCurrent[valueKey] / multiplierValue, fuelTankSize, fuelSensorRange)); } } break; case 'fourToTwenty': returnValue = fourToTwenty(readingCurrent[valueKey] / multiplierValue, physicalValue.min || 0, physicalValue.max || 100, physicalValue.zero || 0, physicalValue.precision || 0); break; case 'fourToTwentySD1': returnValue = fourToTwenty(readingCurrent[valueKey] / multiplierValue, physicalValue.minSD1 || 0, physicalValue.maxSD1 || 100, physicalValue.zeroSD1 || 0, physicalValue.precisionSD1 || 0, 2.048); break; case 'fourToTwentySD2': returnValue = fourToTwenty(readingCurrent[valueKey] / multiplierValue, physicalValue.minSD2 || 0, physicalValue.maxSD2 || 100, physicalValue.zeroSD2 || 0, physicalValue.precisionSD2 || 0, 2.048); break; case 'current4To20': if (valueKey === 'AN1') { returnValue = map(readingCurrent[valueKey] / multiplierValue, physicalValue.anIn1SigMin || 4, physicalValue.anIn1SigMax || 20, physicalValue.anIn1Min || 0, physicalValue.anIn1Max || 100); if (returnValue < physicalValue.anIn1Min) returnValue = physicalValue.anIn1Min; if (returnValue > physicalValue.anIn1Max) returnValue = physicalValue.anIn1Max; } else if (valueKey === 'AN2') { returnValue = map(readingCurrent[valueKey] / multiplierValue, physicalValue.anIn2SigMin || 4, physicalValue.anIn2SigMax || 20, physicalValue.anIn2Min || 0, physicalValue.anIn2Max || 100); if (returnValue < physicalValue.anIn2Min) returnValue = physicalValue.anIn2Min; if (returnValue > physicalValue.anIn2Max) returnValue = physicalValue.anIn2Max; } else if (valueKey === 'R1F') { returnValue = map(readingCurrent[valueKey] / multiplierValue, physicalValue.r1FSigMin || 4, physicalValue.r1FSigMax || 20, physicalValue.r1FMin || 0, physicalValue.r1FMax || 100); if (returnValue < physicalValue.r1FMin) returnValue = physicalValue.r1FMin; if (returnValue > physicalValue.r1FMax) returnValue = physicalValue.r1FMax; } else if (valueKey === 'R2F') { returnValue = map(readingCurrent[valueKey] / multiplierValue, physicalValue.r2FSigMin || 4, physicalValue.r2FSigMax || 20, physicalValue.r2FMin || 0, physicalValue.r2FMax || 100); if (returnValue < physicalValue.r2FMin) returnValue = physicalValue.r2FMin; if (returnValue > physicalValue.r2FMax) returnValue = physicalValue.r2FMax; } break; case 'voltage0To10': if (valueKey === 'AN1') { returnValue = map(readingCurrent[valueKey] / multiplierValue, physicalValue.anIn1SigMin || 0, physicalValue.anIn1SigMax || 10, physicalValue.anIn1Min || 0, physicalValue.anIn1Max || 100); if (returnValue < physicalValue.anIn1Min) returnValue = physicalValue.anIn1Min; if (returnValue > physicalValue.anIn1Max) returnValue = physicalValue.anIn1Max; } else if (valueKey === 'AN2') { returnValue = map(readingCurrent[valueKey] / multiplierValue, physicalValue.anIn2SigMin || 0, physicalValue.anIn2SigMax || 10, physicalValue.anIn2Min || 0, physicalValue.anIn2Max || 100); if (returnValue < physicalValue.anIn2Min) returnValue = physicalValue.anIn2Min; if (returnValue > physicalValue.anIn2Max) returnValue = physicalValue.anIn2Max; } else if (valueKey === 'R1F') { returnValue = map(readingCurrent[valueKey] / multiplierValue, physicalValue.r1FSigMin || 0, physicalValue.r1FSigMax || 10, physicalValue.r1FMin || 0, physicalValue.r1FMax || 100); if (returnValue < physicalValue.r1FMin) returnValue = physicalValue.r1FMin; if (returnValue > physicalValue.r1FMax) returnValue = physicalValue.r1FMax; } else if (valueKey === 'R2F') { returnValue = map(readingCurrent[valueKey] / multiplierValue, physicalValue.r2FSigMin || 0, physicalValue.r2FSigMax || 10, physicalValue.r2FMin || 0, physicalValue.r2FMax || 100); if (returnValue < physicalValue.r2FMin) returnValue = physicalValue.r2FMin; if (returnValue > physicalValue.r2FMax) returnValue = physicalValue.r2FMax; } else { returnValue = map(readingCurrent[valueKey] / multiplierValue, physicalValue.inSigMin || 0, physicalValue.inSigMax || 10, physicalValue.inMin || 0, physicalValue.inMax || 100); if (returnValue < physicalValue.inMin) returnValue = physicalValue.inMin; if (returnValue > physicalValue.inMax) returnValue = physicalValue.inMax; } break; case 'closure': returnValue = mAToBoolean(readingCurrent[valueKey]); break; case 'rpmToState': returnValue = rpmToState(readingCurrent[valueKey] / multiplierValue, physicalValue.offRpm, physicalValue.highRpm); break; case 'percentTo20V': returnValue = percentTo20V(readingCurrent[valueKey] / multiplierValue, precision, physicalValue.batteryExternalCalibrationResistor1 || 1800, physicalValue.batteryExternalCalibrationResistor2 || 10000, physicalValue.batteryExternalCalibrationVoltageReference || 3.3); break; case 'dewPoint': returnValue = dewPoint(readingCurrent['128'], readingCurrent[valueKey] / multiplierValue); returnValue = fromC(returnValue, context.tempConv, precisionValue); break; case 'moistureSensor': returnValue = moistureSensor(readingCurrent, physicalValue, multiplierValue, precisionValue, valueKey); break; case 'soilMoistureSensorAverage': returnValue = soilMoistureSensorAverage(readingCurrent, physicalValue, multiplierValue, precisionValue, valueKey) || ERROR; break; case 'soilSalinitySensorAverage': returnValue = soilSalinitySensorAverage(readingCurrent, physicalValue, multiplierValue, precisionValue, valueKey) || ERROR; break; case 'soilTemperatureSensorAverageC': returnValue = soilTemperatureSensorAverage(readingCurrent, physicalValue, multiplierValue, precisionValue, valueKey, 'c') || ERROR; break; case 'soilTemperatureSensorAverageF': returnValue = soilTemperatureSensorAverage(readingCurrent, physicalValue, multiplierValue, precisionValue, valueKey, 'f') || ERROR; break; case 'startMode': returnValue = readingCurrent[valueKey] ? 'AUTO' : 'MANUAL'; break; case 'cellularSignalToBars': returnValue = cellSignalToBars(cellSignalToRssi(readingCurrent[valueKey]), physicalValue.cellularStrengthType, cellSignalToQuality(readingCurrent[valueKey]), physicalValue.cellularQualityType, physicalValue.cellularAccessTechnologyDetail); break; case 'millisecondsPastExpectedConnection': returnValue = millisecondsPastExpectedConnection(readingCurrent.date, readingCurrent['135']); break; case 'rolling': returnValue = valueCalculator(formulaValueSecondary, readingCurrent[valueKey] / multiplierValue, context); returnValue += valueCalculator(formulaValueSecondary, readingLast[valueKey] / multiplierValue, context); returnValue /= 2; break; default: returnValue = valueCalculator(formula, readingCurrent[valueKey] / multiplierValue, context); } if (mapValues && _typeof(mapValues) === 'object' && isNumber(mapValues.inMin) && isNumber(mapValues.inMax) && isNumber(mapValues.outMin) && isNumber(mapValues.outMax)) { returnValue = map(returnValue, mapValues.inMin, mapValues.inMax, mapValues.outMin, mapValues.outMax); } if (isNumber(returnValue) && !(typeof returnValue === 'string' && returnValue.includes('/'))) { returnValue = round(returnValue, precisionValue); } return returnValue; }; /** * Pads a value with 0. * @param {int} value to be padded. * @param {int} size * @returns {string} padded with leading zeros up to size. */ var pad = function pad(value, size) { var s = String(value); while (s.length < (size || 2)) { s = "0".concat(s); } return s; }; /** * @param {int} hr * @param {int} min * @returns {string} 'hh:mm' */ var formatTime = function formatTime(hr, min) { return "".concat(pad(hr), ":").concat(pad(min)); }; var scheduleStartDecode = function scheduleStartDecode(value) { return value >> 16 >>> 0; }; var scheduleStopDecode = function scheduleStopDecode(value) { return (value & 0xFFFF) >>> 0; }; var scheduleEncode = function scheduleEncode(start, stop) { return start << 16 >>> 0 | (stop & 0xFFFF) >>> 0; }; /** * @param {int} value in minutes from start of week. * @returns event time as binary representation. */ var scheduleRing = function scheduleRing(value) { var LIMIT = 10080; var result = value; if (result >= LIMIT) { result -= LIMIT; } else if (result < 0) { result += LIMIT; } if (result < 0 || result >= LIMIT) { throw new Error("Input value invalid: ".concat(value)); } return result & 0xFFFF; }; /** * Join 2 scheduled events if they overlap. * @param {int} nStart - minutes from start of week * @param {int} nStop - minutes from start of week * @param {int} oStart - minutes from start of week * @param {int} oStop - minutes from start of week * @returns {Event} - undefined if no overlap */ var scheduleRingUnion = function scheduleRingUnion(_nStart, _nStop, _oStart, _oStop) { var MINUTES_MAXIMUM = 7 * 24 * 60; var isInvalid = function isInvalid(value) { return value < 0 || value > MINUTES_MAXIMUM; }; var oStart = _oStart; var oStop = _oStop; var nStart = _nStart; var nStop = _nStop; if (isInvalid(nStart)) throw new Error("Invalid nStart: ".concat(nStart)); if (isInvalid(nStop)) throw new Error("Invalid nStop: ".concat(nStop)); if (isInvalid(oStart)) throw new Error("Invalid oStart: ".concat(oStart)); if (isInvalid(oStop)) throw new Error("Invalid oStop: ".concat(oStop)); if (nStart > nStop) nStop += MINUTES_MAXIMUM; if (oStart > oStop) oStop += MINUTES_MAXIMUM; var shiftRelative = function shiftRelative(stop, value) { return stop - MINUTES_MAXIMUM > value ? value + MINUTES_MAXIMUM : value; }; oStart = shiftRelative(nStop, oStart); oStop = shiftRelative(nStop, oStop); nStart = shiftRelative(oStop, nStart); nStop = shiftRelative(oStop, nStop); var isBetween = function isBetween(value, low, high) { return value >= low && value <= high; }; var result; if (isBetween(nStart, oStart, oStop) || isBetween(oStart, nStart, nStop)) { result = { start: scheduleRing(Math.min(nStart, oStart)), stop: scheduleRing(Math.max(nStop, oStop)) }; } return result; }; /** * Insert a new scheduled event into an array of schedule Events. * @param {Array.} scheduleEvents * @param {int} dayStart * @param {int} hourStart * @param {int} minStart * @param {int} dayStop * @param {int} hourStop * @param {int} minStop * @param {int} utcDifferenceMinutes */ var insertTime = function insertTime(scheduleEvents, dayStart, hourStart, minStart, dayStop, hourStop, minStop, utcDifferenceMinutes) { if (!Array.isArray(scheduleEvents)) throw new Error('Invalid scheduleEvents array'); var isOutOfRange = function isOutOfRange(x, low, high) { return x < low || x > high; }; var isInvalid = function isInvalid(x, high) { return isOutOfRange(x, 0, high); }; if (isInvalid(dayStart, 6)) throw new Error("Invalid dayStart: ".concat(dayStart)); if (isInvalid(dayStop, 6)) throw new Error("Invalid dayStop: ".concat(dayStop)); if (isInvalid(hourStart, 23)) throw new Error("Invalid hourStart: ".concat(hourStart)); if (isInvalid(hourStop, 23)) throw new Error("Invalid hourStop: ".concat(hourStop)); if (isInvalid(minStart, 59)) throw new Error("Invalid minStart: ".concat(minStart)); if (isInvalid(minStop, 59)) throw new Error("Invalid minStop: ".concat(minStop)); if (isOutOfRange(utcDifferenceMinutes, -840, 720)) throw new Error("Invalid utcDifferenceMinutes: ".concat(utcDifferenceMinutes)); // create our start minutes value var start = dayStart * 24 * 60; start += hourStart * 60; start += minStart; // create our stop minutes value var stop = dayStop * 24 * 60; stop += hourStop * 60; stop += minStop; // adjust for UTC start += utcDifferenceMinutes; stop += utcDifferenceMinutes; // limit to between 0 and HIGH_LIMIT start = scheduleRing(start); stop = scheduleRing(stop); // create array for the new schedule var result = []; if (scheduleEvents.length < 1) { // no previous scheduleEvents, so nothing to de-dupe result.push(scheduleEncode(start, stop)); } else { // the rest of this is to de-dupe intervals var newStart = start; var newStop = stop; // loop through old schedule and figure out where to put new value scheduleEvents.map(function (schedEvent) { var oldStart = scheduleStartDecode(schedEvent); var oldStop = scheduleStopDecode(schedEvent); var intervalCombined = false; // check if the intervals overlap var ringUnion = scheduleRingUnion(newStart, newStop, oldStart, oldStop); if (ringUnion) { newStart = ringUnion.start; newStop = ringUnion.stop; intervalCombined = true; } if (!intervalCombined) { // if there was no overlap, insert our old values into the array oldStart = scheduleRing(oldStart); oldStop = scheduleRing(oldStop); result.push(scheduleEncode(oldStart, oldStop)); } return 1; }); // don't do this until the end or we will get dupe values newStart = scheduleRing(newStart); newStop = scheduleRing(newStop); result.push(scheduleEncode(newStart, newStop)); } // sort for consistency result.sort(function (a, b) { return a - b; }); return result; }; /** * Convert schedule Event to time object. * @param {Event} schedEvent * @param {int} offset * @param {int} key * @returns {Time} */ var decodeTime = function decodeTime(schedEvent, offset, _key) { var key = 0; if (_key) { key = _key; } var ONE_WEEK = 7 * 24 * 60; var start = scheduleRing(scheduleStartDecode(schedEvent) - offset); var stop = scheduleRing(scheduleStopDecode(schedEvent) - offset); var positiveStop = stop; if (start > stop) positiveStop = stop + ONE_WEEK; var DAY = function DAY(date) { return Math.floor(date / (24 * 60)); }; var HOUR = function HOUR(date) { return Math.floor(date / 60) - DAY(date) * 24; }; var MINUTE = function MINUTE(date) { return date % 60; }; var dayStart = DAY(start); var hrStart = HOUR(start); var minStart = MINUTE(start); var dayStop = DAY(stop); var hrStop = HOUR(stop); var minStop = MINUTE(stop); // put our basic calculated values in place var timesDecoded = { start: { day: dayStart, hr: hrStart, min: minStart, human: '' }, stop: { day: dayStop, hr: hrStop, min: minStop, human: '' }, duration: { hrs: Math.round((positiveStop - start) / 60), mins: positiveStop - start, size: positiveStop - start > 4 * 60 ? 1 : 0, cross: false, crossWeek: false }, human: '' }; if (Number(key) || Number(key) === 0) timesDecoded.key = Number(key); // determine if it crosses an end of day timesDecoded.duration.cross = dayStart !== dayStop && dayStart <= dayStop; timesDecoded.duration.crossWeek = dayStart > dayStop; // write out our human readable values var daysOfWeek = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat']; var HUMAN = function HUMAN(x) { return "".concat(daysOfWeek[x.day], " ").concat(x.hr > 12 ? x.hr - 12 : x.hr, ":").concat(pad(x.min)).concat(x.hr >= 12 ? ' PM' : ' AM'); }; var humanStart = HUMAN(timesDecoded.start); var humanStop = HUMAN(timesDecoded.stop); timesDecoded.start.human = humanStart; timesDecoded.stop.human = humanStop; timesDecoded.human = "Start: ".concat(humanStart, ", Stop: ").concat(humanStop, " (").concat(schedEvent, ")"); // calculate if a scheduled item lasts 7 days, as this item is wonky var sevenDay = dayStart === dayStop && hrStart > hrStop; // calculate number of days we are running for if (dayStart <= dayStop && !sevenDay) { timesDecoded.duration.days = dayStop - dayStart; } else { timesDecoded.duration.days = dayStop + 7 - dayStart; // cross is always true if start > stop or we have 7 day run timesDecoded.duration.cross = true; } return timesDecoded; }; /** * Insert a new scheduled event into an array of schedule Events. * @param {int} scheduleEvents * @param {int} dayStart * @param {int} hourStart * @param {int} minStart * @param {int} duration - minutes * @param {int} utcDifferenceMinutes - UTC offset */ var insertTimeDuration = function insertTimeDuration(scheduleEvents, dayStart, hourStart, minStart, duration, utcDifferenceMinutes) { // create our start minutes value var start = dayStart * 24 * 60; start += hourStart * 60; start += minStart; var stop = start + duration; // 0 for UTC offset, due to this doubling up on offset. var decoded = decodeTime(scheduleEncode(start, stop), 0); return insertTime(scheduleEvents, decoded.start.day, decoded.start.hr, decoded.start.min, decoded.stop.day, decoded.stop.hr, decoded.stop.min, utcDifferenceMinutes); }; /** * @param {Array.} schedule * @param {int} offset - UTC offset * @returns {Array.} */ var decodeScheduleUI = function decodeScheduleUI(schedule, _offset) { var offset = 0; if (_offset) { offset = _offset; } if (schedule && Array.isArray(schedule) && schedule.length) { var answers = []; for (var i = 0; i < schedule.length; i++) { var event = schedule[i]; var answer = decodeTime(event, offset, i); var durationDays = answer.duration && answer.duration.days; var dayStart = answer.start && answer.start.day; var hrStart = answer.start && answer.start.hr; var dayStop = answer.stop && answer.stop.day; if (dayStart <= dayStop && durationDays !== 7) { answers.push(answer); } else { // if a multi-day run, we need to split for our UI var answer2 = JSON.parse(JSON.stringify(answer)); var SATURDAY = 6; var SUNDAY = 0; answer.stop.day = SATURDAY; answer.duration.days = SATURDAY - dayStart; answer2.start.day = SUNDAY; answer2.duration.days = answer2.stop.day; if (dayStart === SATURDAY) { answer.duration.size = 24 - hrStart >= 4 ? 1 : 0; answer.duration.cross = false; } if (dayStop === SUNDAY) { answer2.duration.size = answer2.stop.hr >= 4 ? 1 : 0; answer2.duration.cross = false; } answers.push(answer, answer2); } } return answers; } return undefined; }; module.exports = { analogToCentibar: analogToCentibar, analogToDigital: analogToDigital, analogToDigitalInverse: analogToDigitalInverse, analogToVWC: analogToVWC, binLevel: binLevel, cToF: cToF, cellSignalToRssi: cellSignalToRssi, cellSignalToQuality: cellSignalToQuality, cellSignalToBars: cellSignalToBars, chartDimensions: chartDimensions, decodeScheduleUI: decodeScheduleUI, decodeTime: decodeTime, displayFormula: displayFormula, engineStateCalculator: engineStateCalculator, flowMeterState: flowMeterState, formatTime: formatTime, fourToTwenty: fourToTwenty, fromC: fromC, fromCMultiplier: fromCMultiplier, fToC: fToC, ftToM: ftToM, fuelLevel: fuelLevel, gallonsToAcreFeet: gallonsToAcreFeet, litersToUserPreference: litersToUserPreference, insertTime: insertTime, insertTimeDuration: insertTimeDuration, isNumber: isNumber, splitTemplate: splitTemplate, kilometersToMiles: kilometersToMiles, kPaToInchesMercury: kPaToInchesMercury, lastValveTime: lastValveTime, lastValveTimeToEpochMillis: lastValveTimeToEpochMillis, lineFit: lineFit, map: map, mAToBoolean: mAToBoolean, stateToBoolean: stateToBoolean, metersPerSecondToMilesPerHour: metersPerSecondToMilesPerHour, millimetersToInches: millimetersToInches, moistureSensor: moistureSensor, mToFt: mToFt, nextValveTime: nextValveTime, nextValveTimeToEpochMillis: nextValveTimeToEpochMillis, numberMap: numberMap, numberToBinary: numberToBinary, numberToBinaryFE: numberToBinaryFE, numberToBinaryOnOff: numberToBinaryOnOff, pad: pad, percentTo20V: percentTo20V, percentToCentibar: percentToCentibar, percentToDigital: percentToDigital, percentToDigitalInverse: percentToDigitalInverse, percentToVWC: percentToVWC, pumpOutput: pumpOutput, pumpState: pumpState, round: round, rpmOrchardRiteAutometer9117: rpmOrchardRiteAutometer9117, rpmToState: rpmToState, scheduleRing: scheduleRing, scheduleRingUnion: scheduleRingUnion, secondsToHHMMSS: secondsToHHMMSS, soilMoistureSensorAverage: soilMoistureSensorAverage, soilSalinitySensorAverage: soilSalinitySensorAverage, soilTemperatureSensorAverage: soilTemperatureSensorAverage, spaceCamel: spaceCamel, toBoolean: toBoolean, toC: toC, toValveTime: toValveTime, valveStatus: valveStatus, valveStatusString: valveStatusString, valveTimeToDate: valveTimeToDate, valveTimeToEpoch: valveTimeToEpoch, valveTimeToEpochMillis: valveTimeToEpochMillis, valveTimeToValveNumber: valveTimeToValveNumber, voltToCentibar: voltToCentibar, voltToVWC: voltToVWC, windDirection: windDirection, windMachineChangeStatus: windMachineChangeStatus, windMachineCommunicationStatus: windMachineCommunicationStatus, windMachineEngineState: windMachineEngineState, windMachineMPC20ShutdownStatus: windMachineMPC20ShutdownStatus, windMachineMPC20WarningStatus: windMachineMPC20WarningStatus }; /***/ }), /***/ "./node_modules/altrac-conversions/lib/index.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } // index.js var round = function round(n, d) { var decimalPlaces; switch (d) { case 0: decimalPlaces = 1; break; case 1: decimalPlaces = 10; break; case 2: decimalPlaces = 100; break; case 3: decimalPlaces = 1000; break; default: return n; } return Math.round(n * decimalPlaces) / decimalPlaces; }; var isNumber = function isNumber(n) { return !Number.isNaN(parseFloat(n)) && Number.isFinite(parseFloat(n)); }; var isNumberFormat = function isNumberFormat(n) { return !Number.isNaN(parseFloat(n)) && Number.isFinite(n); }; var splitTemplate = function split(input, physical, string) { if (!input) return null; if (typeof input !== 'string') return input; var output = input.match(/\{\{([a-zA-Z0-9. _]*\|[a-zA-Z0-9. _]*)\}\}/); if (!output) { return input; } var arr = output[1].split('|'); var returnValue; if (physical && _typeof(physical) === 'object' && Object.prototype.hasOwnProperty.call(physical, arr[0])) { returnValue = physical[arr[0]]; } else { var _arr2 = _slicedToArray(arr, 1); returnValue = _arr2[0]; } if (isNumber(returnValue) && !string) returnValue = Number(returnValue); return returnValue; }; var map = function map(value, x1, y1, x2, y2) { return (value - x1) * (y2 - x2) / (y1 - x1) + x2; }; var voltToVWC = function voltToVWC(v) { /* 0 to 1.1V VWC= 10*V-1 1.1V to 1.3V VWC= 25*V- 17.5 1.3V to 1.82V VWC= 48.08*V- 47.5 1.82V to 2.2V VWC= 26.32*V- 7.89 */ if (v < 0.1) { return 0; } if (v >= 0.1 && v < 1.1) { return 10 * v - 1; } if (v >= 1.1 && v < 1.3) { return 25 * v - 17.5; } if (v >= 1.3 && v < 1.82) { return 48.04 * v - 47.5; } if (v >= 1.82 && v <= 3) { // went to 3, since this is supposedly the max return 26.32 * v - 7.89; } return 'ERR'; }; var percentToVWC = function percentToVWC(p) { var v = p * 5; return voltToVWC(v); }; var analogToVWC = function analogToVWC(a) { var v = a / 1023 * 5; return voltToVWC(v); }; var percentToDigital = function percentToDigital(a) { if (a > 0.5) { return 1; } return 0; }; var analogToDigital = function analogToDigital(a) { if (a > 511) { return 1; } return 0; }; var percentToDigitalInverse = function percentToDigitalInverse(a) { return percentToDigital(a) === 1 ? 0 : 1; }; var analogToDigitalInverse = function analogToDigitalInverse(a) { return analogToDigital(a) === 1 ? 0 : 1; }; var voltToCentibar = function voltToCentibar(v) { var centibar = 'ERR'; if (v < 0) { centibar = 'VLO'; } else if (v >= 0 && v <= 3.1) { centibar = 1 / 0.0117155 * v; } else { centibar = 'VHI'; } return round(centibar, 0); }; var percentToCentibar = function percentToCentibar(p) { var v = p * 5; return voltToCentibar(v); }; var analogToCentibar = function analogToCentibar(a) { var v = a / 1023 * 5; return voltToCentibar(v); }; var metersPerSecondToMilesPerHour = function metersPerSecondToMilesPerHour(ms, precision) { var precisionValue = 0; if (precision && !Number.isNaN(precision)) { precisionValue = Number(precision); } return round(ms * 2.23694, precisionValue); }; var millimetersToInches = function millimetersToInches(mm, precision) { var precisionValue = 0; if (precision && !Number.isNaN(precision)) { precisionValue = Number(precision); } return round(mm * 0.0393701, precisionValue); }; var kilometersToMiles = function kilometersToMiles(km, precision) { var precisionValue = 0; if (precision && !Number.isNaN(precision)) { precisionValue = Number(precision); } return round(km * 0.621371, precisionValue); }; var kPaToInchesMercury = function kPaToInchesMercury(kpa, precision) { var precisionValue = 0; if (precision && !Number.isNaN(precision)) { precisionValue = Number(precision); } return round(kpa * 0.2953, precisionValue); }; var numberMap = function numberMap(value, inMin, inMax, outMin, outMax) { return (value - inMin) * (outMax - outMin) / (inMax - inMin) + outMin; }; var valveStatus = function valveStatus(status) { if (status === 0xFFFF) { return 0; } return status & 1 ? 1 : 0; }; var valveStatusString = function valveStatusString(status) { if (status === 0xFFFF) { return 'ERR'; } return valveStatus(status) ? 'ON' : 'OFF'; }; var cToF = function cToF(c) { return c * 1.8 + 32; }; var fToC = function fToC(f) { return (f - 32) / 1.8; }; var cellSignalToRssi = function cellSignalToRssi(signal) { return signal >>> 8; }; var cellSignalToQuality = function cellSignalToQuality(signal) { return (signal & 0xFF) >>> 0; }; var cellSignalToBars = function cellSignalToBars(signal, signalType, quality, qualityType, service) { var signalStrength = 0; var signalQuality = 0; // Strength of the signal if (service === 'LTE Cat-M1' || service === 'LTE' || service === 'LTE_OLD') { if (signalType === 'RSRP' && qualityType === 'RSRQ' || signal > 0 && quality > 0) { if (signal <= 90 && signal > 0) { signalStrength = 5; } else if (signal < 105) { signalStrength = 4; } else if (signal < 111) { signalStrength = 3; } else if (signal < 116) { signalStrength = 2; } else if (signal <= 119) { signalStrength = 1; } else if (signal >= 120) { signalStrength = 0; } if (quality <= 5 && quality > 0) { signalQuality = 5; } else if (quality <= 10) { signalQuality = 4; } else if (quality <= 15) { signalQuality = 3; } else if (quality < 17) { signalQuality = 2; } else if (quality <= 19) { signalQuality = 1; } else if (quality > 19) { signalQuality = 0; } else { signalQuality = -1; } } else { signalStrength = -1; signalQuality = -1; } } else if (service === 'UMTS' || signalType === 'RSCP' && qualityType === 'ECN0') { if (signal === 0) { signalStrength = 0; } else if (signal <= 70) { signalStrength = 5; } else if (signal <= 85) { signalStrength = 4; } else if (signal < 100) { signalStrength = 3; } else if (signal < 105) { signalStrength = 2; } else if (signal <= 110) { signalStrength = 1; } else if (signal >= 110) { signalStrength = 0; } if (quality <= 5 && quality > 0) { signalQuality = 5; } else if (quality <= 10) { signalQuality = 4; } else if (quality <= 15) { signalQuality = 3; } else if (quality < 20) { signalQuality = 2; } else { signalQuality = -1; } } else if (signalType === 'RXLEV' || quality === 0 && signal > 10) { // 2G if (signal <= 70) { signalStrength = 5; signalQuality = 5; } else if (signal <= 85) { signalStrength = 4; signalQuality = 4; } else if (signal < 100) { signalStrength = 3; signalQuality = 3; } else if (signal < 105) { signalStrength = 2; signalQuality = 2; } else if (signal <= 110) { signalStrength = 1; signalQuality = 1; } else if (signal >= 110) { signalStrength = 0; signalQuality = 0; } else if (signal === 0) { signalStrength = 0; signalQuality = 0; } } else if (quality > 0 && signal > 0) { // old 3G calculation if (signal <= 80) { signalStrength = 5; } else if (signal <= 90) { signalStrength = 4; } else if (signal < 100) { signalStrength = 3; } else if (signal < 105) { signalStrength = 2; } else if (signal <= 110) { signalStrength = 1; } else if (signal >= 110) { signalStrength = 0; } else if (signal === 0) { signalStrength = 0; } if (quality <= 5 && quality > 0) { signalQuality = 0; } else if (quality <= 10) { signalQuality = 1; } else if (quality <= 15) { signalQuality = 2; } else if (quality < 23) { signalQuality = 3; } else if (quality <= 30) { signalQuality = 4; } else if (quality < 100) { signalQuality = 5; } else { signalQuality = -1; } } else { signalStrength = -1; signalQuality = -1; } // Get average of the signal if Strength or Quality of the signal // drops into the red zone return the SignalTotal as 1 if no // connection return 0 var totalSignal = 0; if (signalStrength >= 1 && signalQuality >= 1) { totalSignal = Math.floor((signalStrength + signalQuality) / 2); } else if (signalStrength === 0 && signalQuality === 0) { totalSignal = 0; } else if (signalStrength === -1 || signalQuality === -1) { totalSignal = -1; } else { totalSignal = 1; } return totalSignal; }; var fromC = function fromC(c, tempConv, precision) { var returnValue = null; if (c <= 120 && c >= -50) { if (tempConv === 'f') { returnValue = round(cToF(c), precision); } else if (tempConv === 'c') { returnValue = round(c, precision); } } return returnValue; }; var fromCMultiplier = function fromCMultiplier(c, tempConv, precision) { return fromC(c / 100, tempConv, precision); }; var toC = function toC(v, tempConv, precision) { var returnValue = -99; if (tempConv === 'f') { returnValue = fToC(v); } else if (tempConv === 'c') { returnValue = v; } return round(returnValue, precision); }; var valveTimeToValveNumber = function valveTimeToValveNumber(valveTime) { return (Number(valveTime) >> 28 & 0x7) >>> 0; }; var valveTimeToEpoch = function valveTimeToEpoch(valveTime) { return (Number(valveTime) & 0xFFFFFFF) * 60; }; var valveTimeToEpochMillis = function valveTimeToEpochMillis(valveTime) { return (Number(valveTime) & 0xFFFFFFF) * 60 * 1000; }; var valveTimeToDate = function valveTimeToDate(valveTime) { return new Date(valveTimeToEpochMillis(valveTime)); }; var lastValveTime = function lastValveTime(valveTimeArr, valveNumber) { var valveNumberC = 1; if (valveNumber && valveNumber >= 0 && valveNumber <= 8) { valveNumberC = valveNumber; } var returnValue = [0, 0]; if (valveTimeArr) { for (var i = 0; i < valveTimeArr.length; i += 2) { if (valveTimeToValveNumber(valveTimeArr[i]) === valveNumberC && valveTimeToValveNumber(valveTimeArr[i + 1]) === valveNumberC && valveTimeToEpochMillis(valveTimeArr[i]) < new Date().getTime() && valveTimeToEpochMillis(valveTimeArr[i + 1]) < new Date().getTime()) { if (valveTimeToValveNumber(valveTimeArr[i]) === valveNumberC && valveTimeToValveNumber(valveTimeArr[i + 1]) === valveNumberC && (valveTimeArr[i] > returnValue[0] || returnValue[0] === 0)) { returnValue[0] = valveTimeArr[i]; returnValue[1] = valveTimeArr[i + 1]; } else {// do nothing } } else {// do nothing } } } return returnValue; }; var nextValveTime = function nextValveTime(valveTimeArr, valveNumber) { var valveNumberC = 1; if (valveNumber && valveNumber >= 0 && valveNumber <= 8) { valveNumberC = valveNumber; } var returnValue = [0, 0]; if (valveTimeArr) { for (var i = 0; i < valveTimeArr.length; i += 2) { if (valveTimeToEpochMillis(valveTimeArr[i]) < new Date().getTime() && valveTimeToEpochMillis(valveTimeArr[i + 1]) < new Date().getTime()) {// nothing to do here } else if (valveTimeToValveNumber(valveTimeArr[i]) === valveNumberC && valveTimeToValveNumber(valveTimeArr[i + 1]) === valveNumberC && (valveTimeArr[i] < returnValue[0] || returnValue[0] === 0)) { returnValue[0] = valveTimeArr[i]; returnValue[1] = valveTimeArr[i + 1]; } else {// do nothing } } } return returnValue; }; var nextValveTimeToEpochMillis = function nextValveTimeToEpochMillis(valveTimeArr, valveNumber) { var nextTimes = nextValveTime(valveTimeArr, valveNumber); var returnValue = [0, 0]; returnValue[0] = valveTimeToEpochMillis(nextTimes[0]); returnValue[1] = valveTimeToEpochMillis(nextTimes[1]); return returnValue; }; var lastValveTimeToEpochMillis = function lastValveTimeToEpochMillis(valveTimeArr, valveNumber) { var nextTimes = lastValveTime(valveTimeArr, valveNumber); var returnValue = [0, 0]; returnValue[0] = valveTimeToEpochMillis(nextTimes[0]); returnValue[1] = valveTimeToEpochMillis(nextTimes[1]); return returnValue; }; var toValveTime = function toValveTime(state, valve, epoch) { var statePrep = state << 31 >>> 0; var valvePrep = valve << 28 >>> 0; var epochPrep = epoch / 60; var returnVal = (statePrep | valvePrep | epochPrep) >>> 0; return returnVal; }; var secondsToHHMMSS = function secondsToHHMMSS(totalSeconds) { var hours = Math.floor(totalSeconds / 3600); var minutes = Math.floor((totalSeconds - hours * 3600) / 60); var seconds = totalSeconds - hours * 3600 - minutes * 60; var result = ''; // round seconds seconds = Math.round(seconds * 100) / 100; result += hours > 0 ? "".concat(hours, " hours, ") : ''; result += minutes > 0 ? "".concat(minutes, " minutes, ") : ''; result += seconds > 0 ? "".concat(seconds, " seconds") : ''; return result; }; var percentTo20V = function percentTo20V(p, precision, resistor1, resistor2, voltageReference) { var resistor1Temp = typeof resistor1 !== 'undefined' ? resistor1 : 1800; var resistor2Temp = typeof resistor2 !== 'undefined' ? resistor2 : 10000; var voltageReferenceTemp = typeof voltageReference !== 'undefined' ? voltageReference : 3.3; return round(p * (1 / (resistor1Temp / (resistor1Temp + resistor2Temp))) * voltageReferenceTemp, precision || 2); }; var fourToTwenty = function fourToTwenty(p, min, max, zero, precision) { var reference = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 3.34; var minNumber = 0; var maxNumber = 100; var precisionNumber = 0; if (!Number.isNaN(min)) { minNumber = Number(min); } if (!Number.isNaN(max)) { maxNumber = Number(max); } var zeroNumber = minNumber; if (!Number.isNaN(zero)) { zeroNumber = Number(zero); } if (!Number.isNaN(precision)) { precisionNumber = Number(precision); } var volt = p * reference; var mA = volt * 10; var mAP = (mA - 4) / 16; var returnValue = mAP * (maxNumber - minNumber) + minNumber; if (mA > 3.5 && returnValue < zeroNumber) { return 0; } if (returnValue < zeroNumber) { return 'OFF'; } if (returnValue > maxNumber) { return 'ERH'; } return round(returnValue, precisionNumber); }; var fuelLevel = function fuelLevel(percent, size, maxSize) { return percent * (1 / (size / maxSize)); }; var ftToM = function ftToM(ft) { return ft * 0.3048; }; var mToFt = function mToFt(m) { return m * 3.28084; }; var millisecondsPastExpectedConnection = function millisecondsPastExpectedConnection(lastConnection, sleepTime) { var currentTime = new Date().getTime(); var sleepInterval = sleepTime * 1000; if (!sleepTime || sleepTime === 0) { sleepInterval = 60 * 10 * 1000 + 20000; // checks in every ten minutes, max } var nextSeen = new Date(new Date(lastConnection).getTime() + sleepInterval).getTime(); if (nextSeen < currentTime) { return currentTime - nextSeen; } return 0; }; var spaceCamel = function spaceCamel(s) { return s.replace(/([A-Z])/g, ' $1').replace(/^./, function (str) { return str.toUpperCase(); }); }; var dewPoint = function dewPoint(t, rh) { var h = (Math.log10(rh) - 2) / 0.4343 + 17.62 * t / (243.12 + t); var dp = 243.12 * h / (17.62 - h); // this is the dew point in Celsius return dp; }; var pumpState = function pumpState(state) { var deviceStatus = ''; switch (state & 0xF) { case 1: deviceStatus = 'FWD'; break; case 2: deviceStatus = 'REV'; break; case 4: deviceStatus = 'BRK'; break; case 8: deviceStatus = 'STP'; break; default: deviceStatus = 'ERR'; } return deviceStatus; }; var flowMeterState = function flowMeterState(value) { if (value > 0) { return 'RUN'; } return 'STP'; }; var pulseDiff = function pulseDiff(readingCurrent, readingLast, currentTime, lastTime) { var diff = readingCurrent - readingLast; if (readingCurrent - readingLast < 0 && readingCurrent - readingLast >= -60000) { return 0; } if (readingCurrent - readingLast < -60000) { diff = readingCurrent - readingLast + 65535; } if (currentTime === lastTime) { return 0; } return diff; }; var pumpOutput = function pumpOutput(readingCurrent, readingLast, currentTime, lastTime, multiplierValue) { var diff = pulseDiff(readingCurrent, readingLast, currentTime, lastTime) / multiplierValue; var current = new Date(isNumberFormat(currentTime) ? currentTime * 1000 : currentTime).getTime(); var previous = new Date(isNumberFormat(lastTime) ? lastTime * 1000 : lastTime).getTime(); var diffMinutes = (current - previous) / 1000 / 60; var output = diff / diffMinutes; return Number.isNaN(output) ? 0 : output; }; var rpmToState = function rpmToState(rpm, off, high) { var returnValue = 'OFF'; var offTest = 150; if (off) { offTest = off; } var highTest = 350; if (high) { highTest = high; } var rpmTest = 0; if (rpm) { rpmTest = rpm; } if (rpmTest < offTest) { returnValue = 'OFF'; } else if (rpmTest >= offTest && rpmTest < highTest) { returnValue = 'LOW'; } else { returnValue = 'HIGH'; } return returnValue; }; var autoSwitchAnalog = function autoSwitchAnalog(value) { return value > 9000 ? 1 : 0; }; var autoSwitchMPC20 = function autoSwitchMPC20(value) { return ((value & 0xFF) >>> 0) - 10 === 1 ? 1 : 0; }; var powerGood = function powerGood(value) { return value & 0x4 ? 1 : 0; }; var engineStateCalculator = function engineStateCalculator(rpm, intention, timestamp, offRpm, highRpm) { var rpmTemp = !rpm ? 0 : rpm; var intentionTemp = !intention ? 0 : intention; var timestampTemp = !timestamp ? new Date().getTime() / 1000 : timestamp; var offRpmTemp = !offRpm ? 750 : offRpm; var highRpmTemp = !highRpm ? 1600 : highRpm; var returnValue = 0; var timeDiff = new Date().getTime() / 1000 - timestampTemp; if (intentionTemp) { if (rpmTemp < offRpmTemp) { if (timeDiff >= 120) { returnValue = 8; // STATE_FALSE_START } else { returnValue = 6; // STATE_CRANK_ON } } else if (rpmTemp >= offRpmTemp && rpmTemp <= highRpmTemp) { returnValue = 9; // STATE_WARMUP_DELAY } else { returnValue = 12; // STATE_RUNNING_LOADED } } else if (rpmTemp < offRpmTemp) { returnValue = 1; // STATE_ENGINE_STOPPED } else if (rpmTemp >= offRpmTemp && rpmTemp <= highRpmTemp) { returnValue = 9; // STATE_WARMUP_DELAY } else { returnValue = 13; // STATE_COOLDOWN_DELAY } return returnValue; }; var rpmOrchardRiteAutometer9117 = function rpmOrchardRiteAutometer9117(rpm) { var returnValue = Math.round((rpm / -170.1244909 + 8.572735138) * rpm); if (returnValue < 0) { return 0; } if (returnValue > 3000) { return 3000; } return returnValue; }; var lineFit = function lineFit(val, m, b, precision, max, min) { var maxValue = max || 4294967295; var minValue = min || 0; var returnValue = val * m + b; returnValue = round(returnValue, precision || 0); if (returnValue < minValue) { return minValue; } if (returnValue > maxValue) { return maxValue; } return returnValue; }; var binLevel = function binLevel(binLevelCurrent, binLevelLast, debounce, powered, numberOfBins) { var fullness = 0; if (!debounce) { fullness = binLevelCurrent; } else if (binLevelCurrent === binLevelLast) { fullness = binLevelCurrent; } else if (binLevelCurrent < binLevelLast) { fullness = binLevelCurrent; } else { fullness = binLevelLast; } var iterations = 4; var totalBins = 4; if (numberOfBins && numberOfBins > 0 && numberOfBins < 5) { iterations = numberOfBins; totalBins = numberOfBins; } var i = 1; if (powered) { i = 2; iterations += 1; } var numberFull = 0; for (i; i <= iterations; i += 1) { if ((fullness & Math.pow(2, i - 1)) === Math.pow(2, i - 1)) { numberFull += 1; } else { numberFull += 0; } } return "".concat(numberFull, "/").concat(totalBins); }; var windMachineChangeStatus = function windMachineChangeStatus(cs) { var returnValue = ''; switch (cs) { case 0: returnValue = 'No Change'; break; case 1: returnValue = 'A/S New'; break; case 2: returnValue = 'EP New'; break; case 254: returnValue = 'Error'; break; case 255: returnValue = 'No A/S'; break; default: returnValue = cs; } return returnValue; }; var windMachineCommunicationStatus = function windMachineCommunicationStatus(cs) { var returnValue = ''; switch (cs) { case -2: returnValue = 'Comm Error'; break; case -1: returnValue = 'Not Connected'; break; case 0: returnValue = 'No Attempt'; break; case 1: returnValue = 'Connected'; break; default: returnValue = cs; } return returnValue; }; var windMachineEngineState = function windMachineEngineState(cs) { var returnValue = ''; switch (cs) { case 0: returnValue = 'ECU Delay'; break; case 1: returnValue = 'Engine Stopped'; break; case 2: returnValue = 'Controller Standby'; break; case 3: returnValue = 'Prestart 1'; break; case 4: returnValue = 'Checksafe'; break; case 5: returnValue = 'Prestart 2'; break; case 6: returnValue = 'Crank on'; break; case 7: returnValue = 'Crank Rest'; break; case 8: returnValue = 'False Start'; break; case 9: returnValue = 'Warmup'; break; case 10: returnValue = 'Line Fill 1'; break; case 11: returnValue = 'Line Fill 2'; break; case 12: returnValue = 'Running'; break; case 13: returnValue = 'Cooldown'; break; case 14: returnValue = 'Stopping'; break; case 15: returnValue = 'Spindown'; break; case 16: returnValue = 'Wait To Start'; break; default: returnValue = cs; } return returnValue; }; var windMachineMPC20ShutdownStatus = function windMachineMPC20ShutdownStatus(sd) { var returnArray = []; if (sd & Math.pow(2, 0)) { returnArray.push('Overspeed SD'); } if (sd & Math.pow(2, 1)) { returnArray.push('Underspeed SD'); } if (sd & Math.pow(2, 2)) { returnArray.push('Overcrank SD'); } if (sd & Math.pow(2, 3)) { returnArray.push('Low Oil Pressure SD'); } if (sd & Math.pow(2, 4)) { returnArray.push('High Engine Temp SD'); } if (sd & Math.pow(2, 5)) { returnArray.push('Low Fuel SD'); } if (sd & Math.pow(2, 6)) { returnArray.push('Low Discharge Pressure SD'); } if (sd & Math.pow(2, 7)) { returnArray.push('High Discharge Pressure SD'); } if (sd & Math.pow(2, 8)) { returnArray.push('Speed Signal Lost SD'); } if (sd & Math.pow(2, 9)) { returnArray.push('Low Lube Level SD'); } if (sd & Math.pow(2, 10)) { returnArray.push('Fuel Leak SD'); } if (sd & Math.pow(2, 11)) { returnArray.push('Fuel Filter Restriction SD'); } if (sd & Math.pow(2, 12)) { returnArray.push('Air Damper Closed SD no'); } if (sd & Math.pow(2, 13)) { returnArray.push('Air Filter Restriction SD'); } if (sd & Math.pow(2, 14)) { returnArray.push('Oil Filter Restriction SD'); } if (sd & Math.pow(2, 15)) { returnArray.push('Remote Stop SD'); } if (sd & Math.pow(2, 16)) { returnArray.push('Coolant Level SD'); } if (sd & Math.pow(2, 17)) { returnArray.push('High Level SD'); } if (sd & Math.pow(2, 18)) { returnArray.push('Low Level SD'); } if (sd & Math.pow(2, 19)) { returnArray.push('High Flow SD'); } if (sd & Math.pow(2, 20)) { returnArray.push('Low Flow SD'); } if (sd & Math.pow(2, 21)) { returnArray.push('High Pump Oil Temp SD'); } if (sd & Math.pow(2, 22)) { returnArray.push('High Pump Housing Temp SD'); } if (sd & Math.pow(2, 23)) { returnArray.push('Water in Fuel SD'); } if (sd & Math.pow(2, 24)) { returnArray.push('Low Suction SD'); } if (sd & Math.pow(2, 25)) { returnArray.push('High Suction SD'); } if (sd & Math.pow(2, 26)) { returnArray.push('High Engine Oil Pressure SD'); } if (sd & Math.pow(2, 27)) { returnArray.push('High Engine Oil Temp SD'); } if (sd & Math.pow(2, 28)) { returnArray.push('Low Gear Box Pressure SD'); } if (sd & Math.pow(2, 29)) { returnArray.push('High Gear Box Pressure SD'); } if (sd & Math.pow(2, 30)) { returnArray.push('Battery Charger Fail SD'); } if (sd & Math.pow(2, 31)) { returnArray.push('Red Lamp Status'); } return returnArray; }; var windMachineMPC20WarningStatus = function windMachineMPC20WarningStatus(wd) { var returnArray = []; if (wd & Math.pow(2, 0)) { returnArray.push('Low Fuel Warn'); } if (wd & Math.pow(2, 1)) { returnArray.push('Fuel Leak Warn'); } if (wd & Math.pow(2, 2)) { returnArray.push('Fuel Filter Restriction Warn'); } if (wd & Math.pow(2, 3)) { returnArray.push('Low Lube Level W arn'); } if (wd & Math.pow(2, 4)) { returnArray.push('Coolant Level Warn'); } if (wd & Math.pow(2, 5)) { returnArray.push('Water in Fuel Warn'); } if (wd & Math.pow(2, 6)) { returnArray.push('No Flow Warn'); } if (wd & Math.pow(2, 7)) { returnArray.push('High Engine Oil Temp Warn'); } if (wd & Math.pow(2, 8)) { returnArray.push('Low Oil Pressure Warn'); } if (wd & Math.pow(2, 9)) { returnArray.push('High Engine Temp Warn'); } if (wd & Math.pow(2, 10)) { returnArray.push('High Discharge Pressure Warn'); } if (wd & Math.pow(2, 11)) { returnArray.push('Low Discharge Pressure Warn'); } if (wd & Math.pow(2, 12)) { returnArray.push('High Suction Warn'); } if (wd & Math.pow(2, 13)) { returnArray.push('Low Suction Warn'); } if (wd & Math.pow(2, 14)) { returnArray.push('High Level Warn'); } if (wd & Math.pow(2, 15)) { returnArray.push('Low Level Warn'); } if (wd & Math.pow(2, 16)) { returnArray.push('High Flow Warn'); } if (wd & Math.pow(2, 17)) { returnArray.push('Low Flow Warn'); } if (wd & Math.pow(2, 18)) { returnArray.push('High Pump Oil Temp Warn'); } if (wd & Math.pow(2, 19)) { returnArray.push('High Pump Housing Temp Warn'); } if (wd & Math.pow(2, 20)) { returnArray.push('Low Gear Box Pressure Warn'); } if (wd & Math.pow(2, 21)) { returnArray.push('High Gear Box Pressure Warn'); } if (wd & Math.pow(2, 22)) { returnArray.push('Air Damper Closed Warn'); } if (wd & Math.pow(2, 23)) { returnArray.push('Air Filter Restriction Warn'); } if (wd & Math.pow(2, 24)) { returnArray.push('Oil Filter Restriction Warn'); } if (wd & Math.pow(2, 25)) { returnArray.push('Low Engine Temp Warn'); } if (wd & Math.pow(2, 26)) { returnArray.push('High Engine Oil Pressure Warn'); } if (wd & Math.pow(2, 27)) { returnArray.push('Battery Charger Fail Warn'); } if (wd & Math.pow(2, 28)) { returnArray.push('Run To Destruct Warn'); } if (wd & Math.pow(2, 29)) { returnArray.push('Battery High Warn'); } if (wd & Math.pow(2, 30)) { returnArray.push('Battery Low Warn'); } if (wd & Math.pow(2, 31)) { returnArray.push('Amber Lamp Status'); } return returnArray; }; var chartDimensions = function chartDimensions(windowWidth) { var windowWidthTemp = windowWidth; var chartWidth = 288; var chartHeight = 288 - 30; if (windowWidthTemp >= 600) { chartWidth = 614; chartHeight = 470; } else if (windowWidthTemp >= 375) { chartWidth = 350; chartHeight = 320; } chartWidth -= 20; chartHeight -= 20; return { width: "".concat(chartWidth, "px"), height: "".concat(chartHeight, "px"), widthNumber: chartWidth, heightNumber: chartHeight }; }; var numberToBinary = function numberToBinary(value, bit) { return (value & Math.pow(2, bit)) >>> 0; }; var numberToBinaryFE = function numberToBinaryFE(value, bit) { return numberToBinary(value, bit) ? 'F' : 'E'; }; var numberToBinaryOnOff = function numberToBinaryOnOff(value, bit) { return numberToBinary(value, bit) ? 'ON' : 'OFF'; }; /** * @param {number} mA value > 0 * @returns true when value > 5 else false */ var mAToBoolean = function mAToBoolean(mA) { return isNumber(mA) && Number(mA) > 5; }; /** * @param {number} state value > 0 * @returns true when value > 5 else false */ var stateToBoolean = function stateToBoolean(state) { return isNumber(state) && Number(state) >= 9 && Number(state) <= 13; }; /** * @param {any} value - 1/0, true/false, 'string'/'', thing/undefined * @returns true when value is truthy. */ var toBoolean = function toBoolean(value) { if (!value) return false; // matches '', 0, false, undefined if (typeof value === 'boolean') return value; if (isNumber(value) && Number.isFinite(value)) return !!value; if (typeof value === 'string') return !!/^(true|t|on)$/i.test(value); return !!value; }; var gallonsToAcreFeet = function gallonsToAcreFeet(value, precision) { var returnValue = 0; if (!Number.isNaN(value) && Number(value) > 0) { returnValue = round(Number(value) / 325851, precision); } return returnValue; }; function litersToUserPreference(value, userPreference, unitType, precision) { var returnValue = 0; if (!Number.isNaN(value) && Number(value) > 0) { if (unitType === 'volume') { if (userPreference === 'liters') { returnValue = value; } else if (userPreference === 'gallons') { returnValue = round(Number(value) / 3.78541, precision); } else if (userPreference === 'acreInch') { returnValue = round(Number(value) / 102790.15313, precision); } else if (userPreference === 'cubicFeet') { returnValue = round(Number(value) / 28.316846592, precision); } else if (userPreference === 'hectareM') { returnValue = round(Number(value) / 10000000, precision); } else if (userPreference === 'cubicM') { returnValue = round(Number(value) / 1000, precision); } else { returnValue = round(Number(value) / 1233481.8553199936, precision); } } else if (unitType === 'flow') { if (userPreference === 'lpm') { returnValue = round(Number(value), precision); } else { returnValue = round(Number(value) / 3.78541, precision); } } } return returnValue; } /** * Generates the display value for a collection of moisture sensor readings. * @param {*} reading * @param {*} physical * @param {*} multiplier * @param {*} precision * @param {*} valueKey */ var moistureSensor = function moistureSensor(reading, physical, multiplier, precision, valueKey) { var total = 0; var denominator = 0; var keyList; if (valueKey && Array.isArray(valueKey) && valueKey.length) { keyList = valueKey; } else { keyList = []; for (var i = 1; i <= 16; i++) { keyList.push(i); } } keyList.forEach(function (key) { var rawValue = reading[key]; var rawDate = reading["".concat(key, "Date")] || new Date(); if (isNumber(rawValue) && Date.parse(rawDate) > new Date().getTime() - 86400000) { var value = Number(rawValue) / multiplier; if (value > 2 && value < 99) { total += value; denominator += 1; } } }); if (denominator === 0) return 'ERR'; var average = total / denominator; if (new Date().getTime() - Date.parse(reading['1Date']) > 21600000) { // 6 hours return 'NC'; } var moistureSensorSettings = physical.moistureSensorSettings || {}; var moistureCombined = moistureSensorSettings.moistureCombined || {}; var goalMax = moistureCombined.goalMax || 0; var goalMin = moistureCombined.goalMin || 0; if (isNumber(goalMax) && Number(goalMax) > 0 && isNumber(goalMin) && Number(goalMin) > 0 && Number(goalMax) > Number(goalMin)) { goalMax = Number(goalMax); goalMin = Number(goalMin); } else { return 'NOT\nSET'; } var returnValue = round((average - goalMin) / (goalMax - goalMin) * 100, precision); return returnValue; }; /** * Generates the average of a collection of moisture sensor readings. * @param {*} reading * @param {*} physical * @param {*} multiplier * @param {*} precision * @param {*} valueKey */ var soilMoistureSensorAverage = function soilMoistureSensorAverage(reading, physical, multiplier, precision, valueKey) { var total = 0; var denominator = 0; var keyList; if (valueKey && Array.isArray(valueKey)) { keyList = valueKey; } else { keyList = []; for (var i = 1; i <= 16; i++) { keyList.push(i); } } keyList.forEach(function (key) { var rawValue = reading[key]; if (isNumber(rawValue)) { var value = Number(rawValue) / multiplier; if (value > 10 && value < 99) { total += value; denominator += 1; } } }); if (denominator === 0) return undefined; var average = round(total / denominator); return average; }; /** * Generates the average of a collection of salinity sensor readings. * @param {*} reading * @param {*} physical * @param {*} multiplier * @param {*} precision * @param {*} valueKey */ var soilSalinitySensorAverage = function soilSalinitySensorAverage(reading, physical, multiplier, precision, valueKey) { var total = 0; var denominator = 0; var keyList; if (valueKey && Array.isArray(valueKey)) { keyList = valueKey; } else { keyList = []; for (var i = 1; i <= 16; i++) { keyList.push(i); } } keyList.forEach(function (key) { var rawValue = reading[key]; if (isNumber(rawValue)) { var value = Number(rawValue) / multiplier; if (value > 10 && value < 99) { total += value; denominator += 1; } } }); if (denominator === 0) return undefined; var average = round(total / denominator, precision); return average; }; /** * Generates the average of a collection of soil temperature readings. * @param {*} reading * @param {*} physical * @param {*} multiplier * @param {*} precision * @param {*} tempConv */ var soilTemperatureSensorAverage = function soilTemperatureSensorAverage(reading, physical, multiplier, precision, valueKey, tempConv) { var total = 0; var denominator = 0; var keyList; if (valueKey && Array.isArray(valueKey)) { keyList = valueKey; } else { keyList = []; for (var i = 1; i <= 16; i++) { keyList.push(i); } } keyList.forEach(function (key) { var rawValue = reading[key]; if (isNumber(rawValue)) { var value = Number(rawValue) / multiplier; if (value > 10 && value < 99) { total += value; denominator += 1; } } }); if (denominator === 0) return undefined; var average = total / denominator; var returnResult = round(tempConv === 'f' ? cToF(average) : average, precision); return returnResult; }; var windDirection = function windDirection(wd) { if (wd > 360 || wd < 0) { return 'ERR'; } var dir = 'ERR'; if (wd < 0 || wd > 360) { // eslint-disable-next-line no-console console.error('Enter a degree between 0 and 360 degrees.'); } else if (wd >= 0 && wd <= 11.25) { dir = 'N'; } else if (wd > 348.75 && wd <= 360) { dir = 'N'; } else if (wd > 11.25 && wd <= 33.75) { dir = 'NNE'; } else if (wd > 33.75 && wd <= 56.25) { dir = 'NE'; } else if (wd > 56.25 && wd <= 78.75) { dir = 'ENE'; } else if (wd > 78.75 && wd <= 101.25) { dir = 'E'; } else if (wd > 101.25 && wd <= 123.75) { dir = 'ESE'; } else if (wd > 123.75 && wd <= 146.25) { dir = 'SE'; } else if (wd > 146.25 && wd <= 168.75) { dir = 'SSE'; } else if (wd > 168.75 && wd <= 191.25) { dir = 'S'; } else if (wd > 191.25 && wd <= 213.75) { dir = 'SSW'; } else if (wd > 213.75 && wd <= 236.25) { dir = 'SW'; } else if (wd > 236.25 && wd <= 258.75) { dir = 'WSW'; } else if (wd > 258.75 && wd <= 281.25) { dir = 'W'; } else if (wd > 281.25 && wd <= 303.75) { dir = 'WNW'; } else if (wd > 303.75 && wd <= 326.25) { dir = 'NW'; } else if (wd > 326.25 && wd <= 348.75) { dir = 'NNW'; } return dir; }; function valueCalculator(formula, value, context, unitType, userPreference, precision) { var returnValue = value; switch (formula) { case 'valveStatus': returnValue = valveStatus(value); break; case 'valveStatusString': returnValue = valveStatusString(value); break; case 'fromC': case 'temperature': returnValue = fromC(value, context.tempConv, precision); break; case 'temperatureF': returnValue = fromC(value, 'f', precision); break; case 'temperatureC': returnValue = fromC(value, 'c', precision); break; case 'percentToCentibar': returnValue = percentToCentibar(value); break; case 'percentToVWC': returnValue = percentToVWC(value); break; case 'metersPerSecondToMilesPerHour': returnValue = metersPerSecondToMilesPerHour(value, precision); break; case 'windDirection': returnValue = windDirection(value); break; case 'mAToBoolean': returnValue = mAToBoolean(value); break; case 'stateToBoolean': returnValue = stateToBoolean(value); break; case 'toBoolean': returnValue = toBoolean(value); break; case 'millimetersToInches': returnValue = millimetersToInches(value, precision); break; case 'kilometersToMiles': returnValue = kilometersToMiles(value, precision); break; case 'kPaToInchesMercury': returnValue = kPaToInchesMercury(value, precision); break; case 'analogToCentibar': returnValue = analogToCentibar(value); break; case 'analogToVWC': returnValue = analogToVWC(value); break; case 'analogToDigitalInverseString': returnValue = analogToDigitalInverse(value) === 1 ? 'ON' : 'OFF'; break; case 'percentToDigitalInverseString': returnValue = percentToDigitalInverse(value) === 1 ? 'ON' : 'OFF'; break; case 'analogToDigitalInverse': returnValue = analogToDigitalInverse(value); break; case 'percentToDigitalInverse': returnValue = percentToDigitalInverse(value); break; case 'analogToDigitalString': returnValue = analogToDigital(value) === 1 ? 'ON' : 'OFF'; break; case 'percentToDigitalString': returnValue = percentToDigital(value) === 1 ? 'ON' : 'OFF'; break; case 'percentToDigitalStringFullEmpty': returnValue = percentToDigital(value) === 1 ? 'FULL' : 'EMP'; break; case 'lowPercentToDigital': returnValue = percentToDigital(value + 0.3); break; case 'lowPercentToDigitalString': returnValue = percentToDigital(value + 0.3) === 1 ? 'ON' : 'OFF'; break; case 'analogToDigital': returnValue = analogToDigital(value); break; case 'percentToDigital': returnValue = percentToDigital(value); break; case 'pumpState': returnValue = pumpState(value); break; case 'autoSwitchAnalog': returnValue = autoSwitchAnalog(value); break; case 'autoSwitchMPC20': returnValue = autoSwitchMPC20(value); break; case 'rpmOrchardRiteAutometer9117': returnValue = rpmOrchardRiteAutometer9117(value); break; case 'powerGood': returnValue = powerGood(value); break; case 'gallonsToAcreFeet': returnValue = gallonsToAcreFeet(value, precision); break; case 'litersToUserPreference': returnValue = litersToUserPreference(value, userPreference, unitType, precision); break; case 'flowMeterState': returnValue = flowMeterState(value); break; case 'cellSignalToRssi': returnValue = cellSignalToRssi(value); break; case 'cellSignalToQuality': returnValue = cellSignalToQuality(value); break; case 'numberToBinary0': returnValue = numberToBinary(value, 0); break; case 'numberToBinary1': returnValue = numberToBinary(value, 1); break; case 'numberToBinary2': returnValue = numberToBinary(value, 2); break; case 'numberToBinary3': returnValue = numberToBinary(value, 3); break; case 'numberToBinary4': returnValue = numberToBinary(value, 4); break; case 'numberToBinary5': returnValue = numberToBinary(value, 5); break; case 'numberToBinary6': returnValue = numberToBinary(value, 6); break; case 'numberToBinary7': returnValue = numberToBinary(value, 7); break; case 'numberToBinaryFE0': returnValue = numberToBinaryFE(value, 0); break; case 'numberToBinaryFE1': returnValue = numberToBinaryFE(value, 1); break; case 'numberToBinaryFE2': returnValue = numberToBinaryFE(value, 2); break; case 'numberToBinaryFE3': returnValue = numberToBinaryFE(value, 3); break; case 'numberToBinaryFE4': returnValue = numberToBinaryFE(value, 4); break; case 'numberToBinaryFE5': returnValue = numberToBinaryFE(value, 5); break; case 'numberToBinaryFE6': returnValue = numberToBinaryFE(value, 6); break; case 'numberToBinaryFE7': returnValue = numberToBinaryFE(value, 7); break; case 'numberToBinaryOnOff0': returnValue = numberToBinaryOnOff(value, 0); break; case 'numberToBinaryOnOff1': returnValue = numberToBinaryOnOff(value, 1); break; case 'numberToBinaryOnOff2': returnValue = numberToBinaryOnOff(value, 2); break; case 'numberToBinaryOnOff3': returnValue = numberToBinaryOnOff(value, 3); break; case 'numberToBinaryOnOff4': returnValue = numberToBinaryOnOff(value, 4); break; case 'numberToBinaryOnOff5': returnValue = numberToBinaryOnOff(value, 5); break; case 'numberToBinaryOnOff6': returnValue = numberToBinaryOnOff(value, 6); break; case 'numberToBinaryOnOff7': returnValue = numberToBinaryOnOff(value, 7); break; default: returnValue = round(value, precision); } return returnValue; } var displayFormula = function displayFormula(formula, multiplier, precision, context, _valueKey, readingCurrent, readingLast, physical, mapValues) { var ERROR = 'ERR'; var isInvalidReading = function isInvalidReading(x) { return x === 4294967295 || x === 65535 || x === -32768 || !isNumber(x); }; var returnValue; var valueKey = _valueKey; if (typeof _valueKey === 'string' && (_valueKey.startsWith('[') || _valueKey.startsWith('{'))) { valueKey = JSON.parse(_valueKey); } switch (_typeof(valueKey)) { case 'number': case 'string': returnValue = readingCurrent[valueKey]; if (isInvalidReading(returnValue)) return ERROR; break; case 'object': break; default: return ERROR; } var multiplierValue = 1; if (multiplier) { multiplierValue = multiplier; } var precisionValue = 0; if (precision) { precisionValue = precision; } var formulaValue = formula; var formulaValueSecondary = ''; if (formula && formula.substr(formula.length - 'Rolling'.length) === 'Rolling') { formulaValue = 'rolling'; formulaValueSecondary = formula.substr(0, formula.length - 'Rolling'.length); } var physicalValue = {}; if (physical && _typeof(physical) === 'object') { physicalValue = physical; } switch (formulaValue) { case 'difference': { var valueKey0 = valueKey[0]; var valueKey1 = valueKey[1]; var value0; var value1; if (_typeof(valueKey0) === 'object') { value0 = valueCalculator(valueKey0.formula, readingCurrent[valueKey0.valueKey] / (valueKey0.multiplier || 1), valueKey0.context || '', valueKey0.precision || 0); value1 = valueCalculator(valueKey1.formula, readingCurrent[valueKey1.valueKey] / (valueKey1.multiplier || 1), valueKey1.context || '', valueKey1.precision || 0); } else { value0 = valueCalculator(formula, readingCurrent[valueKey0] / multiplierValue, context, precisionValue); value1 = valueCalculator(formula, readingCurrent[valueKey1] / multiplierValue, context, precisionValue); } if (isNumber(value0) && isNumber(value1)) { returnValue = Math.abs(value0 - value1); } else { returnValue = 'ERR'; } } break; case 'toBoolean': returnValue = toBoolean(readingCurrent[valueKey] / multiplierValue); break; case 'mAToBoolean': returnValue = mAToBoolean(readingCurrent[valueKey] / multiplierValue); break; case 'stateToBoolean': returnValue = stateToBoolean(readingCurrent[valueKey] / multiplierValue); break; case 'percentToDigitalStringAND': returnValue = 'ON'; if (Array.isArray(valueKey)) { returnValue = valueKey.reduce(function (acc, key) { var output = percentToDigital(readingCurrent[key] / multiplierValue) === 1 ? 'ON' : 'OFF'; if (output === 'OFF') return output; return acc; }, 'OFF'); } else { returnValue = 'OFF'; } break; case 'percentToDigitalStringOR': returnValue = 'OFF'; if (Array.isArray(valueKey)) { returnValue = valueKey.reduce(function (acc, key) { var output = percentToDigital(readingCurrent[key] / multiplierValue) === 1 ? 'ON' : 'OFF'; if (output === 'ON') return output; return acc; }, 'OFF'); } else { returnValue = 'OFF'; } break; case 'binLevel': returnValue = binLevel(readingCurrent['131'], readingLast['131'], physicalValue.debounce, physicalValue.powered, physicalValue.bins); break; case 'pumpOutput': { var flowTime = 132; if (physicalValue.flowTimestampKey) { flowTime = physicalValue.flowTimestampKey; } returnValue = pumpOutput(readingCurrent[valueKey], readingLast[valueKey], readingCurrent[flowTime] || readingCurrent.date, readingLast[flowTime] || readingLast.date, multiplierValue); } break; case 'flowRate': { var _flowTime = 132; if (physicalValue.flowTimestampKey) { _flowTime = physicalValue.flowTimestampKey; } if (physicalValue.unitsPerPulse) { multiplierValue = 1 / Number(physicalValue.unitsPerPulse); } else if (physicalValue.pulseMultiplier) { multiplierValue = Number(physicalValue.pulseMultiplier); } returnValue = pumpOutput(readingCurrent[valueKey], readingLast[valueKey], readingCurrent[_flowTime] || readingCurrent.date, readingLast[_flowTime] || readingLast.date, multiplierValue); } break; case 'flowRateLiters': { var _flowTime2 = 132; if (physicalValue.flowTimestampKey) { _flowTime2 = physicalValue.flowTimestampKey; } if (physicalValue.unitsPerPulse) { multiplierValue = 1 / Number(physicalValue.unitsPerPulse); } else if (physicalValue.pulseMultiplier) { multiplierValue = Number(physicalValue.pulseMultiplier); } var flowUnit = 'gallons'; if (physicalValue.flowUnits) { flowUnit = physicalValue.flowUnits; } if (flowUnit === 'gallons') { multiplierValue /= 3.78541; } returnValue = pumpOutput(readingCurrent[valueKey], readingLast[valueKey], readingCurrent[_flowTime2] || readingCurrent.date, readingLast[_flowTime2] || readingLast.date, multiplierValue); } break; case 'flowCumulative': { var _flowTime3 = 132; if (physicalValue.flowTimestampKey) { _flowTime3 = physicalValue.flowTimestampKey; } if (physicalValue.unitsPerPulse) { multiplierValue = Number(physicalValue.unitsPerPulse); } else if (physicalValue.pulseMultiplier) { multiplierValue = 1 / Number(physicalValue.pulseMultiplier); } returnValue = pulseDiff(readingCurrent[valueKey], readingLast[valueKey], readingCurrent[_flowTime3] || readingCurrent.date, readingLast[_flowTime3] || readingLast.date); returnValue *= multiplierValue; } break; case 'flowCumulativeLiters': { var _flowTime4 = 132; if (physicalValue.flowTimestampKey) { _flowTime4 = physicalValue.flowTimestampKey; } if (physicalValue.unitsPerPulse) { multiplierValue = Number(physicalValue.unitsPerPulse); } else if (physicalValue.pulseMultiplier) { multiplierValue = 1 / Number(physicalValue.pulseMultiplier); } var _flowUnit = 'gallons'; if (physicalValue.flowUnits) { _flowUnit = physicalValue.flowUnits; } if (_flowUnit === 'gallons') { multiplierValue *= 3.78541; } returnValue = pulseDiff(readingCurrent[valueKey], readingLast[valueKey], readingCurrent[_flowTime4] || readingCurrent.date, readingLast[_flowTime4] || readingLast.date); returnValue *= multiplierValue; } break; case 'temperatureAutoDecimal': returnValue = fromC(readingCurrent[valueKey] / multiplierValue, context.tempConv); if (returnValue < 10 && returnValue > -10) { precisionValue = 1; } else { precisionValue = 0; } break; case 'fuelLevel': { var fuelTankSize = 5.0; if (physicalValue && physicalValue.fuelTankSize) { fuelTankSize = physicalValue.fuelTankSize; } var fuelSensorRange = 5.557; if (physicalValue && physicalValue.fuelSensorRange) { fuelSensorRange = physicalValue.fuelSensorRange; } // 0.25V is based on the Rochester R3D-LP + 5V from ISBD // 0.25V = 5% * 5V var fuelSensorMinV = 0.25; // based on the Rochester R3D-LP Gauge if (physicalValue && physicalValue.fuelSensorMinV) { fuelSensorMinV = physicalValue.fuelSensorMinV; } // 4.6V is based on the Rochester R3D-LP + 5V + Experience with Zirkle // Rochester says 80% of in voltage is max, so 5V * 80% = 4V // But @ Zirkle, some gauges show 4.6V, and look like they are working var fuelSensorMaxV = 4.6; // based on the Rochester R3D-LP Gauge if (physicalValue && physicalValue.fuelSensorMaxV) { fuelSensorMaxV = physicalValue.fuelSensorMaxV; } var fuelSensorVCal = 5.557; if (physicalValue && physicalValue.fuelSensorVCal) { fuelSensorVCal = physicalValue.fuelSensorVCal; } if (readingCurrent[valueKey] * fuelSensorVCal > fuelSensorMaxV) { returnValue = 'Error High'; } else if (readingCurrent[valueKey] * fuelSensorVCal < fuelSensorMinV) { returnValue = 'Not Connected'; } else { returnValue = round(fuelLevel(readingCurrent[valueKey] / multiplierValue, fuelTankSize, fuelSensorRange)); } } break; case 'fourToTwenty': returnValue = fourToTwenty(readingCurrent[valueKey] / multiplierValue, physicalValue.min || 0, physicalValue.max || 100, physicalValue.zero || 0, physicalValue.precision || 0); break; case 'fourToTwentySD1': returnValue = fourToTwenty(readingCurrent[valueKey] / multiplierValue, physicalValue.minSD1 || 0, physicalValue.maxSD1 || 100, physicalValue.zeroSD1 || 0, physicalValue.precisionSD1 || 0, 2.048); break; case 'fourToTwentySD2': returnValue = fourToTwenty(readingCurrent[valueKey] / multiplierValue, physicalValue.minSD2 || 0, physicalValue.maxSD2 || 100, physicalValue.zeroSD2 || 0, physicalValue.precisionSD2 || 0, 2.048); break; case 'current4To20': if (valueKey === 'AN1') { returnValue = map(readingCurrent[valueKey] / multiplierValue, physicalValue.anIn1SigMin || 4, physicalValue.anIn1SigMax || 20, physicalValue.anIn1Min || 0, physicalValue.anIn1Max || 100); if (returnValue < physicalValue.anIn1Min) returnValue = physicalValue.anIn1Min; if (returnValue > physicalValue.anIn1Max) returnValue = physicalValue.anIn1Max; } else if (valueKey === 'AN2') { returnValue = map(readingCurrent[valueKey] / multiplierValue, physicalValue.anIn2SigMin || 4, physicalValue.anIn2SigMax || 20, physicalValue.anIn2Min || 0, physicalValue.anIn2Max || 100); if (returnValue < physicalValue.anIn2Min) returnValue = physicalValue.anIn2Min; if (returnValue > physicalValue.anIn2Max) returnValue = physicalValue.anIn2Max; } else if (valueKey === 'R1F') { returnValue = map(readingCurrent[valueKey] / multiplierValue, physicalValue.r1FSigMin || 4, physicalValue.r1FSigMax || 20, physicalValue.r1FMin || 0, physicalValue.r1FMax || 100); if (returnValue < physicalValue.r1FMin) returnValue = physicalValue.r1FMin; if (returnValue > physicalValue.r1FMax) returnValue = physicalValue.r1FMax; } else if (valueKey === 'R2F') { returnValue = map(readingCurrent[valueKey] / multiplierValue, physicalValue.r2FSigMin || 4, physicalValue.r2FSigMax || 20, physicalValue.r2FMin || 0, physicalValue.r2FMax || 100); if (returnValue < physicalValue.r2FMin) returnValue = physicalValue.r2FMin; if (returnValue > physicalValue.r2FMax) returnValue = physicalValue.r2FMax; } break; case 'voltage0To10': if (valueKey === 'AN1') { returnValue = map(readingCurrent[valueKey] / multiplierValue, physicalValue.anIn1SigMin || 0, physicalValue.anIn1SigMax || 10, physicalValue.anIn1Min || 0, physicalValue.anIn1Max || 100); if (returnValue < physicalValue.anIn1Min) returnValue = physicalValue.anIn1Min; if (returnValue > physicalValue.anIn1Max) returnValue = physicalValue.anIn1Max; } else if (valueKey === 'AN2') { returnValue = map(readingCurrent[valueKey] / multiplierValue, physicalValue.anIn2SigMin || 0, physicalValue.anIn2SigMax || 10, physicalValue.anIn2Min || 0, physicalValue.anIn2Max || 100); if (returnValue < physicalValue.anIn2Min) returnValue = physicalValue.anIn2Min; if (returnValue > physicalValue.anIn2Max) returnValue = physicalValue.anIn2Max; } else if (valueKey === 'R1F') { returnValue = map(readingCurrent[valueKey] / multiplierValue, physicalValue.r1FSigMin || 0, physicalValue.r1FSigMax || 10, physicalValue.r1FMin || 0, physicalValue.r1FMax || 100); if (returnValue < physicalValue.r1FMin) returnValue = physicalValue.r1FMin; if (returnValue > physicalValue.r1FMax) returnValue = physicalValue.r1FMax; } else if (valueKey === 'R2F') { returnValue = map(readingCurrent[valueKey] / multiplierValue, physicalValue.r2FSigMin || 0, physicalValue.r2FSigMax || 10, physicalValue.r2FMin || 0, physicalValue.r2FMax || 100); if (returnValue < physicalValue.r2FMin) returnValue = physicalValue.r2FMin; if (returnValue > physicalValue.r2FMax) returnValue = physicalValue.r2FMax; } else { returnValue = map(readingCurrent[valueKey] / multiplierValue, physicalValue.inSigMin || 0, physicalValue.inSigMax || 10, physicalValue.inMin || 0, physicalValue.inMax || 100); if (returnValue < physicalValue.inMin) returnValue = physicalValue.inMin; if (returnValue > physicalValue.inMax) returnValue = physicalValue.inMax; } break; case 'closure': returnValue = mAToBoolean(readingCurrent[valueKey]); break; case 'rpmToState': returnValue = rpmToState(readingCurrent[valueKey] / multiplierValue, physicalValue.offRpm, physicalValue.highRpm); break; case 'percentTo20V': returnValue = percentTo20V(readingCurrent[valueKey] / multiplierValue, precision, physicalValue.batteryExternalCalibrationResistor1 || 1800, physicalValue.batteryExternalCalibrationResistor2 || 10000, physicalValue.batteryExternalCalibrationVoltageReference || 3.3); break; case 'dewPoint': returnValue = dewPoint(readingCurrent['128'], readingCurrent[valueKey] / multiplierValue); returnValue = fromC(returnValue, context.tempConv, precisionValue); break; case 'moistureSensor': returnValue = moistureSensor(readingCurrent, physicalValue, multiplierValue, precisionValue, valueKey); break; case 'soilMoistureSensorAverage': returnValue = soilMoistureSensorAverage(readingCurrent, physicalValue, multiplierValue, precisionValue, valueKey) || ERROR; break; case 'soilSalinitySensorAverage': returnValue = soilSalinitySensorAverage(readingCurrent, physicalValue, multiplierValue, precisionValue, valueKey) || ERROR; break; case 'soilTemperatureSensorAverageC': returnValue = soilTemperatureSensorAverage(readingCurrent, physicalValue, multiplierValue, precisionValue, valueKey, 'c') || ERROR; break; case 'soilTemperatureSensorAverageF': returnValue = soilTemperatureSensorAverage(readingCurrent, physicalValue, multiplierValue, precisionValue, valueKey, 'f') || ERROR; break; case 'startMode': returnValue = readingCurrent[valueKey] ? 'AUTO' : 'MANUAL'; break; case 'cellularSignalToBars': returnValue = cellSignalToBars(cellSignalToRssi(readingCurrent[valueKey]), physicalValue.cellularStrengthType, cellSignalToQuality(readingCurrent[valueKey]), physicalValue.cellularQualityType, physicalValue.cellularAccessTechnologyDetail); break; case 'millisecondsPastExpectedConnection': returnValue = millisecondsPastExpectedConnection(readingCurrent.date, readingCurrent['135']); break; case 'rolling': returnValue = valueCalculator(formulaValueSecondary, readingCurrent[valueKey] / multiplierValue, context); returnValue += valueCalculator(formulaValueSecondary, readingLast[valueKey] / multiplierValue, context); returnValue /= 2; break; default: returnValue = valueCalculator(formula, readingCurrent[valueKey] / multiplierValue, context); } if (mapValues && _typeof(mapValues) === 'object' && isNumber(mapValues.inMin) && isNumber(mapValues.inMax) && isNumber(mapValues.outMin) && isNumber(mapValues.outMax)) { returnValue = map(returnValue, mapValues.inMin, mapValues.inMax, mapValues.outMin, mapValues.outMax); } if (isNumber(returnValue) && !(typeof returnValue === 'string' && returnValue.includes('/'))) { returnValue = round(returnValue, precisionValue); } return returnValue; }; var pressureFourToTwenty = function pressureFourToTwenty(valueKey, value, physical) { var returnValue = 0; if (value >= 1000 || value < 0) { return 'ERR'; } if (valueKey === 'R1F') { returnValue = map(value, physical.r1FMin || 0, physical.r1FMax || 100, 4, 20); } else if (valueKey === 'R2F') { returnValue = map(value, physical.r2FMin || 0, physical.r2FMax || 100, 4, 20); } else if (valueKey === '142' || valueKey === '143') { returnValue = map(value, physical.r2FMin || 0, physical.r2FMax || 100, // 1953.125 is equal to 4mA for valve = (1953.125 / 10000) * 2.048 * 10 = 4 1953.125, // 9765.625 is equal to 20mA for valve = (9765.625 / 10000) * 2.048 * 10 = 20 9765.625); } else { return 'ERR'; } return returnValue; }; /** * Pads a value with 0. * @param {int} value to be padded. * @param {int} size * @returns {string} padded with leading zeros up to size. */ var pad = function pad(value, size) { var s = String(value); while (s.length < (size || 2)) { s = "0".concat(s); } return s; }; /** * @param {int} hr * @param {int} min * @returns {string} 'hh:mm' */ var formatTime = function formatTime(hr, min) { return "".concat(pad(hr), ":").concat(pad(min)); }; var scheduleStartDecode = function scheduleStartDecode(value) { return value >> 16 >>> 0; }; var scheduleStopDecode = function scheduleStopDecode(value) { return (value & 0xFFFF) >>> 0; }; var scheduleEncode = function scheduleEncode(start, stop) { return start << 16 >>> 0 | (stop & 0xFFFF) >>> 0; }; /** * @param {int} value in minutes from start of week. * @returns event time as binary representation. */ var scheduleRing = function scheduleRing(value) { var LIMIT = 10080; var result = value; if (result >= LIMIT) { result -= LIMIT; } else if (result < 0) { result += LIMIT; } if (result < 0 || result >= LIMIT) { throw new Error("Input value invalid: ".concat(value)); } return result & 0xFFFF; }; /** * Join 2 scheduled events if they overlap. * @param {int} nStart - minutes from start of week * @param {int} nStop - minutes from start of week * @param {int} oStart - minutes from start of week * @param {int} oStop - minutes from start of week * @returns {Event} - undefined if no overlap */ var scheduleRingUnion = function scheduleRingUnion(_nStart, _nStop, _oStart, _oStop) { var MINUTES_MAXIMUM = 7 * 24 * 60; var isInvalid = function isInvalid(value) { return value < 0 || value > MINUTES_MAXIMUM; }; var oStart = _oStart; var oStop = _oStop; var nStart = _nStart; var nStop = _nStop; if (isInvalid(nStart)) throw new Error("Invalid nStart: ".concat(nStart)); if (isInvalid(nStop)) throw new Error("Invalid nStop: ".concat(nStop)); if (isInvalid(oStart)) throw new Error("Invalid oStart: ".concat(oStart)); if (isInvalid(oStop)) throw new Error("Invalid oStop: ".concat(oStop)); if (nStart > nStop) nStop += MINUTES_MAXIMUM; if (oStart > oStop) oStop += MINUTES_MAXIMUM; var shiftRelative = function shiftRelative(stop, value) { return stop - MINUTES_MAXIMUM > value ? value + MINUTES_MAXIMUM : value; }; oStart = shiftRelative(nStop, oStart); oStop = shiftRelative(nStop, oStop); nStart = shiftRelative(oStop, nStart); nStop = shiftRelative(oStop, nStop); var isBetween = function isBetween(value, low, high) { return value >= low && value <= high; }; var result; if (isBetween(nStart, oStart, oStop) || isBetween(oStart, nStart, nStop)) { result = { start: scheduleRing(Math.min(nStart, oStart)), stop: scheduleRing(Math.max(nStop, oStop)) }; } return result; }; /** * Insert a new scheduled event into an array of schedule Events. * @param {Array.} scheduleEvents * @param {int} dayStart * @param {int} hourStart * @param {int} minStart * @param {int} dayStop * @param {int} hourStop * @param {int} minStop * @param {int} utcDifferenceMinutes */ var insertTime = function insertTime(scheduleEvents, dayStart, hourStart, minStart, dayStop, hourStop, minStop, utcDifferenceMinutes) { if (!Array.isArray(scheduleEvents)) throw new Error('Invalid scheduleEvents array'); var isOutOfRange = function isOutOfRange(x, low, high) { return x < low || x > high; }; var isInvalid = function isInvalid(x, high) { return isOutOfRange(x, 0, high); }; if (isInvalid(dayStart, 6)) throw new Error("Invalid dayStart: ".concat(dayStart)); if (isInvalid(dayStop, 6)) throw new Error("Invalid dayStop: ".concat(dayStop)); if (isInvalid(hourStart, 23)) throw new Error("Invalid hourStart: ".concat(hourStart)); if (isInvalid(hourStop, 23)) throw new Error("Invalid hourStop: ".concat(hourStop)); if (isInvalid(minStart, 59)) throw new Error("Invalid minStart: ".concat(minStart)); if (isInvalid(minStop, 59)) throw new Error("Invalid minStop: ".concat(minStop)); if (isOutOfRange(utcDifferenceMinutes, -840, 720)) throw new Error("Invalid utcDifferenceMinutes: ".concat(utcDifferenceMinutes)); // create our start minutes value var start = dayStart * 24 * 60; start += hourStart * 60; start += minStart; // create our stop minutes value var stop = dayStop * 24 * 60; stop += hourStop * 60; stop += minStop; // adjust for UTC start += utcDifferenceMinutes; stop += utcDifferenceMinutes; // limit to between 0 and HIGH_LIMIT start = scheduleRing(start); stop = scheduleRing(stop); // create array for the new schedule var result = []; if (scheduleEvents.length < 1) { // no previous scheduleEvents, so nothing to de-dupe result.push(scheduleEncode(start, stop)); } else { // the rest of this is to de-dupe intervals var newStart = start; var newStop = stop; // loop through old schedule and figure out where to put new value scheduleEvents.map(function (schedEvent) { var oldStart = scheduleStartDecode(schedEvent); var oldStop = scheduleStopDecode(schedEvent); var intervalCombined = false; // check if the intervals overlap var ringUnion = scheduleRingUnion(newStart, newStop, oldStart, oldStop); if (ringUnion) { newStart = ringUnion.start; newStop = ringUnion.stop; intervalCombined = true; } if (!intervalCombined) { // if there was no overlap, insert our old values into the array oldStart = scheduleRing(oldStart); oldStop = scheduleRing(oldStop); result.push(scheduleEncode(oldStart, oldStop)); } return 1; }); // don't do this until the end or we will get dupe values newStart = scheduleRing(newStart); newStop = scheduleRing(newStop); result.push(scheduleEncode(newStart, newStop)); } // sort for consistency result.sort(function (a, b) { return a - b; }); return result; }; /** * Convert schedule Event to time object. * @param {Event} schedEvent * @param {int} offset * @param {int} key * @returns {Time} */ var decodeTime = function decodeTime(schedEvent, offset, _key) { var key = 0; if (_key) { key = _key; } var ONE_WEEK = 7 * 24 * 60; var start = scheduleRing(scheduleStartDecode(schedEvent) - offset); var stop = scheduleRing(scheduleStopDecode(schedEvent) - offset); var positiveStop = stop; if (start > stop) positiveStop = stop + ONE_WEEK; var DAY = function DAY(date) { return Math.floor(date / (24 * 60)); }; var HOUR = function HOUR(date) { return Math.floor(date / 60) - DAY(date) * 24; }; var MINUTE = function MINUTE(date) { return date % 60; }; var dayStart = DAY(start); var hrStart = HOUR(start); var minStart = MINUTE(start); var dayStop = DAY(stop); var hrStop = HOUR(stop); var minStop = MINUTE(stop); // put our basic calculated values in place var timesDecoded = { start: { day: dayStart, hr: hrStart, min: minStart, human: '' }, stop: { day: dayStop, hr: hrStop, min: minStop, human: '' }, duration: { hrs: Math.round((positiveStop - start) / 60), mins: positiveStop - start, size: positiveStop - start > 4 * 60 ? 1 : 0, cross: false, crossWeek: false }, human: '' }; if (Number(key) || Number(key) === 0) timesDecoded.key = Number(key); // determine if it crosses an end of day timesDecoded.duration.cross = dayStart !== dayStop && dayStart <= dayStop; timesDecoded.duration.crossWeek = dayStart > dayStop; // write out our human readable values var daysOfWeek = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat']; var HUMAN = function HUMAN(x) { return "".concat(daysOfWeek[x.day], " ").concat(x.hr > 12 ? x.hr - 12 : x.hr, ":").concat(pad(x.min)).concat(x.hr >= 12 ? ' PM' : ' AM'); }; var humanStart = HUMAN(timesDecoded.start); var humanStop = HUMAN(timesDecoded.stop); timesDecoded.start.human = humanStart; timesDecoded.stop.human = humanStop; timesDecoded.human = "Start: ".concat(humanStart, ", Stop: ").concat(humanStop, " (").concat(schedEvent, ")"); // calculate if a scheduled item lasts 7 days, as this item is wonky var sevenDay = dayStart === dayStop && hrStart > hrStop; // calculate number of days we are running for if (dayStart <= dayStop && !sevenDay) { timesDecoded.duration.days = dayStop - dayStart; } else { timesDecoded.duration.days = dayStop + 7 - dayStart; // cross is always true if start > stop or we have 7 day run timesDecoded.duration.cross = true; } return timesDecoded; }; /** * Insert a new scheduled event into an array of schedule Events. * @param {int} scheduleEvents * @param {int} dayStart * @param {int} hourStart * @param {int} minStart * @param {int} duration - minutes * @param {int} utcDifferenceMinutes - UTC offset */ var insertTimeDuration = function insertTimeDuration(scheduleEvents, dayStart, hourStart, minStart, duration, utcDifferenceMinutes) { // create our start minutes value var start = dayStart * 24 * 60; start += hourStart * 60; start += minStart; var stop = start + duration; // 0 for UTC offset, due to this doubling up on offset. var decoded = decodeTime(scheduleEncode(start, stop), 0); return insertTime(scheduleEvents, decoded.start.day, decoded.start.hr, decoded.start.min, decoded.stop.day, decoded.stop.hr, decoded.stop.min, utcDifferenceMinutes); }; /** * @param {Array.} schedule * @param {int} offset - UTC offset * @returns {Array.} */ var decodeScheduleUI = function decodeScheduleUI(schedule, _offset) { var offset = 0; if (_offset) { offset = _offset; } if (schedule && Array.isArray(schedule) && schedule.length) { var answers = []; for (var i = 0; i < schedule.length; i++) { var event = schedule[i]; var answer = decodeTime(event, offset, i); var durationDays = answer.duration && answer.duration.days; var dayStart = answer.start && answer.start.day; var hrStart = answer.start && answer.start.hr; var dayStop = answer.stop && answer.stop.day; if (dayStart <= dayStop && durationDays !== 7) { answers.push(answer); } else { // if a multi-day run, we need to split for our UI var answer2 = JSON.parse(JSON.stringify(answer)); var SATURDAY = 6; var SUNDAY = 0; answer.stop.day = SATURDAY; answer.duration.days = SATURDAY - dayStart; answer2.start.day = SUNDAY; answer2.duration.days = answer2.stop.day; if (dayStart === SATURDAY) { answer.duration.size = 24 - hrStart >= 4 ? 1 : 0; answer.duration.cross = false; } if (dayStop === SUNDAY) { answer2.duration.size = answer2.stop.hr >= 4 ? 1 : 0; answer2.duration.cross = false; } answers.push(answer, answer2); } } return answers; } return undefined; }; module.exports = { analogToCentibar: analogToCentibar, analogToDigital: analogToDigital, analogToDigitalInverse: analogToDigitalInverse, analogToVWC: analogToVWC, binLevel: binLevel, cToF: cToF, cellSignalToRssi: cellSignalToRssi, cellSignalToQuality: cellSignalToQuality, cellSignalToBars: cellSignalToBars, chartDimensions: chartDimensions, decodeScheduleUI: decodeScheduleUI, decodeTime: decodeTime, displayFormula: displayFormula, pressureFourToTwenty: pressureFourToTwenty, engineStateCalculator: engineStateCalculator, flowMeterState: flowMeterState, formatTime: formatTime, fourToTwenty: fourToTwenty, fromC: fromC, fromCMultiplier: fromCMultiplier, fToC: fToC, ftToM: ftToM, fuelLevel: fuelLevel, gallonsToAcreFeet: gallonsToAcreFeet, litersToUserPreference: litersToUserPreference, insertTime: insertTime, insertTimeDuration: insertTimeDuration, isNumber: isNumber, splitTemplate: splitTemplate, kilometersToMiles: kilometersToMiles, kPaToInchesMercury: kPaToInchesMercury, lastValveTime: lastValveTime, lastValveTimeToEpochMillis: lastValveTimeToEpochMillis, lineFit: lineFit, map: map, mAToBoolean: mAToBoolean, stateToBoolean: stateToBoolean, metersPerSecondToMilesPerHour: metersPerSecondToMilesPerHour, millimetersToInches: millimetersToInches, moistureSensor: moistureSensor, mToFt: mToFt, nextValveTime: nextValveTime, nextValveTimeToEpochMillis: nextValveTimeToEpochMillis, numberMap: numberMap, numberToBinary: numberToBinary, numberToBinaryFE: numberToBinaryFE, numberToBinaryOnOff: numberToBinaryOnOff, pad: pad, percentTo20V: percentTo20V, percentToCentibar: percentToCentibar, percentToDigital: percentToDigital, percentToDigitalInverse: percentToDigitalInverse, percentToVWC: percentToVWC, pumpOutput: pumpOutput, pumpState: pumpState, round: round, rpmOrchardRiteAutometer9117: rpmOrchardRiteAutometer9117, rpmToState: rpmToState, scheduleRing: scheduleRing, scheduleRingUnion: scheduleRingUnion, secondsToHHMMSS: secondsToHHMMSS, soilMoistureSensorAverage: soilMoistureSensorAverage, soilSalinitySensorAverage: soilSalinitySensorAverage, soilTemperatureSensorAverage: soilTemperatureSensorAverage, spaceCamel: spaceCamel, toBoolean: toBoolean, toC: toC, toValveTime: toValveTime, valveStatus: valveStatus, valveStatusString: valveStatusString, valveTimeToDate: valveTimeToDate, valveTimeToEpoch: valveTimeToEpoch, valveTimeToEpochMillis: valveTimeToEpochMillis, valveTimeToValveNumber: valveTimeToValveNumber, voltToCentibar: voltToCentibar, voltToVWC: voltToVWC, windDirection: windDirection, windMachineChangeStatus: windMachineChangeStatus, windMachineCommunicationStatus: windMachineCommunicationStatus, windMachineEngineState: windMachineEngineState, windMachineMPC20ShutdownStatus: windMachineMPC20ShutdownStatus, windMachineMPC20WarningStatus: windMachineMPC20WarningStatus }; /***/ }), /***/ "./node_modules/bootstrap/dist/fonts/glyphicons-halflings-regular.eot": /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony default export */ __webpack_exports__["default"] = (__webpack_require__.p + "5be1347c682810f199c7f486f40c5974.eot"); /***/ }), /***/ "./node_modules/bootstrap/dist/fonts/glyphicons-halflings-regular.svg": /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony default export */ __webpack_exports__["default"] = (__webpack_require__.p + "b1f4b11e855ee1bdeeb9a7adadacba21.svg"); /***/ }), /***/ "./node_modules/bootstrap/dist/fonts/glyphicons-halflings-regular.ttf": /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony default export */ __webpack_exports__["default"] = (__webpack_require__.p + "4692b9ec53fd5972caa2f2372ae20d16.ttf"); /***/ }), /***/ "./node_modules/bootstrap/dist/fonts/glyphicons-halflings-regular.woff": /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony default export */ __webpack_exports__["default"] = (__webpack_require__.p + "82b1212e45a2bc35dd731913b27ad813.woff"); /***/ }), /***/ "./node_modules/bootstrap/dist/fonts/glyphicons-halflings-regular.woff2": /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony default export */ __webpack_exports__["default"] = (__webpack_require__.p + "be810be3a3e14c682a257d6eff341fe4.woff2"); /***/ }), /***/ "./node_modules/call-bind/callBound.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; var GetIntrinsic = __webpack_require__("./node_modules/get-intrinsic/index.js"); var callBind = __webpack_require__("./node_modules/call-bind/index.js"); var $indexOf = callBind(GetIntrinsic('String.prototype.indexOf')); module.exports = function callBoundIntrinsic(name, allowMissing) { var intrinsic = GetIntrinsic(name, !!allowMissing); if (typeof intrinsic === 'function' && $indexOf(name, '.prototype.') > -1) { return callBind(intrinsic); } return intrinsic; }; /***/ }), /***/ "./node_modules/call-bind/index.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; var bind = __webpack_require__("./node_modules/function-bind/index.js"); var GetIntrinsic = __webpack_require__("./node_modules/get-intrinsic/index.js"); var $apply = GetIntrinsic('%Function.prototype.apply%'); var $call = GetIntrinsic('%Function.prototype.call%'); var $reflectApply = GetIntrinsic('%Reflect.apply%', true) || bind.call($call, $apply); var $gOPD = GetIntrinsic('%Object.getOwnPropertyDescriptor%', true); var $defineProperty = GetIntrinsic('%Object.defineProperty%', true); var $max = GetIntrinsic('%Math.max%'); if ($defineProperty) { try { $defineProperty({}, 'a', { value: 1 }); } catch (e) { // IE 8 has a broken defineProperty $defineProperty = null; } } module.exports = function callBind(originalFunction) { var func = $reflectApply(bind, $call, arguments); if ($gOPD && $defineProperty) { var desc = $gOPD(func, 'length'); if (desc.configurable) { // original length, plus the receiver, minus any additional arguments (after the receiver) $defineProperty( func, 'length', { value: 1 + $max(0, originalFunction.length - (arguments.length - 1)) } ); } } return func; }; var applyBind = function applyBind() { return $reflectApply(bind, $apply, arguments); }; if ($defineProperty) { $defineProperty(module.exports, 'apply', { value: applyBind }); } else { module.exports.apply = applyBind; } /***/ }), /***/ "./node_modules/classnames/index.js": /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! Copyright (c) 2017 Jed Watson. Licensed under the MIT License (MIT), see http://jedwatson.github.io/classnames */ /* global define */ (function () { 'use strict'; var hasOwn = {}.hasOwnProperty; function classNames () { var classes = []; for (var i = 0; i < arguments.length; i++) { var arg = arguments[i]; if (!arg) continue; var argType = typeof arg; if (argType === 'string' || argType === 'number') { classes.push(arg); } else if (Array.isArray(arg) && arg.length) { var inner = classNames.apply(null, arg); if (inner) { classes.push(inner); } } else if (argType === 'object') { for (var key in arg) { if (hasOwn.call(arg, key) && arg[key]) { classes.push(key); } } } } return classes.join(' '); } if ( true && module.exports) { classNames.default = classNames; module.exports = classNames; } else if (true) { // register as 'classnames', consistent with npm package name !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function () { return classNames; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); } else {} }()); /***/ }), /***/ "./node_modules/create-react-class/factory.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * Copyright (c) 2013-present, Facebook, Inc. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * */ var _assign = __webpack_require__("./node_modules/object-assign/index.js"); var emptyObject = __webpack_require__("./node_modules/fbjs/lib/emptyObject.js"); var _invariant = __webpack_require__("./node_modules/fbjs/lib/invariant.js"); if (false) { var warning; } var MIXINS_KEY = 'mixins'; // Helper function to allow the creation of anonymous functions which do not // have .name set to the name of the variable being assigned to. function identity(fn) { return fn; } var ReactPropTypeLocationNames; if (false) {} else { ReactPropTypeLocationNames = {}; } function factory(ReactComponent, isValidElement, ReactNoopUpdateQueue) { /** * Policies that describe methods in `ReactClassInterface`. */ var injectedMixins = []; /** * Composite components are higher-level components that compose other composite * or host components. * * To create a new type of `ReactClass`, pass a specification of * your new class to `React.createClass`. The only requirement of your class * specification is that you implement a `render` method. * * var MyComponent = React.createClass({ * render: function() { * return
Hello World
; * } * }); * * The class specification supports a specific protocol of methods that have * special meaning (e.g. `render`). See `ReactClassInterface` for * more the comprehensive protocol. Any other properties and methods in the * class specification will be available on the prototype. * * @interface ReactClassInterface * @internal */ var ReactClassInterface = { /** * An array of Mixin objects to include when defining your component. * * @type {array} * @optional */ mixins: 'DEFINE_MANY', /** * An object containing properties and methods that should be defined on * the component's constructor instead of its prototype (static methods). * * @type {object} * @optional */ statics: 'DEFINE_MANY', /** * Definition of prop types for this component. * * @type {object} * @optional */ propTypes: 'DEFINE_MANY', /** * Definition of context types for this component. * * @type {object} * @optional */ contextTypes: 'DEFINE_MANY', /** * Definition of context types this component sets for its children. * * @type {object} * @optional */ childContextTypes: 'DEFINE_MANY', // ==== Definition methods ==== /** * Invoked when the component is mounted. Values in the mapping will be set on * `this.props` if that prop is not specified (i.e. using an `in` check). * * This method is invoked before `getInitialState` and therefore cannot rely * on `this.state` or use `this.setState`. * * @return {object} * @optional */ getDefaultProps: 'DEFINE_MANY_MERGED', /** * Invoked once before the component is mounted. The return value will be used * as the initial value of `this.state`. * * getInitialState: function() { * return { * isOn: false, * fooBaz: new BazFoo() * } * } * * @return {object} * @optional */ getInitialState: 'DEFINE_MANY_MERGED', /** * @return {object} * @optional */ getChildContext: 'DEFINE_MANY_MERGED', /** * Uses props from `this.props` and state from `this.state` to render the * structure of the component. * * No guarantees are made about when or how often this method is invoked, so * it must not have side effects. * * render: function() { * var name = this.props.name; * return
Hello, {name}!
; * } * * @return {ReactComponent} * @required */ render: 'DEFINE_ONCE', // ==== Delegate methods ==== /** * Invoked when the component is initially created and about to be mounted. * This may have side effects, but any external subscriptions or data created * by this method must be cleaned up in `componentWillUnmount`. * * @optional */ componentWillMount: 'DEFINE_MANY', /** * Invoked when the component has been mounted and has a DOM representation. * However, there is no guarantee that the DOM node is in the document. * * Use this as an opportunity to operate on the DOM when the component has * been mounted (initialized and rendered) for the first time. * * @param {DOMElement} rootNode DOM element representing the component. * @optional */ componentDidMount: 'DEFINE_MANY', /** * Invoked before the component receives new props. * * Use this as an opportunity to react to a prop transition by updating the * state using `this.setState`. Current props are accessed via `this.props`. * * componentWillReceiveProps: function(nextProps, nextContext) { * this.setState({ * likesIncreasing: nextProps.likeCount > this.props.likeCount * }); * } * * NOTE: There is no equivalent `componentWillReceiveState`. An incoming prop * transition may cause a state change, but the opposite is not true. If you * need it, you are probably looking for `componentWillUpdate`. * * @param {object} nextProps * @optional */ componentWillReceiveProps: 'DEFINE_MANY', /** * Invoked while deciding if the component should be updated as a result of * receiving new props, state and/or context. * * Use this as an opportunity to `return false` when you're certain that the * transition to the new props/state/context will not require a component * update. * * shouldComponentUpdate: function(nextProps, nextState, nextContext) { * return !equal(nextProps, this.props) || * !equal(nextState, this.state) || * !equal(nextContext, this.context); * } * * @param {object} nextProps * @param {?object} nextState * @param {?object} nextContext * @return {boolean} True if the component should update. * @optional */ shouldComponentUpdate: 'DEFINE_ONCE', /** * Invoked when the component is about to update due to a transition from * `this.props`, `this.state` and `this.context` to `nextProps`, `nextState` * and `nextContext`. * * Use this as an opportunity to perform preparation before an update occurs. * * NOTE: You **cannot** use `this.setState()` in this method. * * @param {object} nextProps * @param {?object} nextState * @param {?object} nextContext * @param {ReactReconcileTransaction} transaction * @optional */ componentWillUpdate: 'DEFINE_MANY', /** * Invoked when the component's DOM representation has been updated. * * Use this as an opportunity to operate on the DOM when the component has * been updated. * * @param {object} prevProps * @param {?object} prevState * @param {?object} prevContext * @param {DOMElement} rootNode DOM element representing the component. * @optional */ componentDidUpdate: 'DEFINE_MANY', /** * Invoked when the component is about to be removed from its parent and have * its DOM representation destroyed. * * Use this as an opportunity to deallocate any external resources. * * NOTE: There is no `componentDidUnmount` since your component will have been * destroyed by that point. * * @optional */ componentWillUnmount: 'DEFINE_MANY', /** * Replacement for (deprecated) `componentWillMount`. * * @optional */ UNSAFE_componentWillMount: 'DEFINE_MANY', /** * Replacement for (deprecated) `componentWillReceiveProps`. * * @optional */ UNSAFE_componentWillReceiveProps: 'DEFINE_MANY', /** * Replacement for (deprecated) `componentWillUpdate`. * * @optional */ UNSAFE_componentWillUpdate: 'DEFINE_MANY', // ==== Advanced methods ==== /** * Updates the component's currently mounted DOM representation. * * By default, this implements React's rendering and reconciliation algorithm. * Sophisticated clients may wish to override this. * * @param {ReactReconcileTransaction} transaction * @internal * @overridable */ updateComponent: 'OVERRIDE_BASE' }; /** * Similar to ReactClassInterface but for static methods. */ var ReactClassStaticInterface = { /** * This method is invoked after a component is instantiated and when it * receives new props. Return an object to update state in response to * prop changes. Return null to indicate no change to state. * * If an object is returned, its keys will be merged into the existing state. * * @return {object || null} * @optional */ getDerivedStateFromProps: 'DEFINE_MANY_MERGED' }; /** * Mapping from class specification keys to special processing functions. * * Although these are declared like instance properties in the specification * when defining classes using `React.createClass`, they are actually static * and are accessible on the constructor instead of the prototype. Despite * being static, they must be defined outside of the "statics" key under * which all other static methods are defined. */ var RESERVED_SPEC_KEYS = { displayName: function(Constructor, displayName) { Constructor.displayName = displayName; }, mixins: function(Constructor, mixins) { if (mixins) { for (var i = 0; i < mixins.length; i++) { mixSpecIntoComponent(Constructor, mixins[i]); } } }, childContextTypes: function(Constructor, childContextTypes) { if (false) {} Constructor.childContextTypes = _assign( {}, Constructor.childContextTypes, childContextTypes ); }, contextTypes: function(Constructor, contextTypes) { if (false) {} Constructor.contextTypes = _assign( {}, Constructor.contextTypes, contextTypes ); }, /** * Special case getDefaultProps which should move into statics but requires * automatic merging. */ getDefaultProps: function(Constructor, getDefaultProps) { if (Constructor.getDefaultProps) { Constructor.getDefaultProps = createMergedResultFunction( Constructor.getDefaultProps, getDefaultProps ); } else { Constructor.getDefaultProps = getDefaultProps; } }, propTypes: function(Constructor, propTypes) { if (false) {} Constructor.propTypes = _assign({}, Constructor.propTypes, propTypes); }, statics: function(Constructor, statics) { mixStaticSpecIntoComponent(Constructor, statics); }, autobind: function() {} }; function validateTypeDef(Constructor, typeDef, location) { for (var propName in typeDef) { if (typeDef.hasOwnProperty(propName)) { // use a warning instead of an _invariant so components // don't show up in prod but only in __DEV__ if (false) {} } } } function validateMethodOverride(isAlreadyDefined, name) { var specPolicy = ReactClassInterface.hasOwnProperty(name) ? ReactClassInterface[name] : null; // Disallow overriding of base class methods unless explicitly allowed. if (ReactClassMixin.hasOwnProperty(name)) { _invariant( specPolicy === 'OVERRIDE_BASE', 'ReactClassInterface: You are attempting to override ' + '`%s` from your class specification. Ensure that your method names ' + 'do not overlap with React methods.', name ); } // Disallow defining methods more than once unless explicitly allowed. if (isAlreadyDefined) { _invariant( specPolicy === 'DEFINE_MANY' || specPolicy === 'DEFINE_MANY_MERGED', 'ReactClassInterface: You are attempting to define ' + '`%s` on your component more than once. This conflict may be due ' + 'to a mixin.', name ); } } /** * Mixin helper which handles policy validation and reserved * specification keys when building React classes. */ function mixSpecIntoComponent(Constructor, spec) { if (!spec) { if (false) { var isMixinValid, typeofSpec; } return; } _invariant( typeof spec !== 'function', "ReactClass: You're attempting to " + 'use a component class or function as a mixin. Instead, just use a ' + 'regular object.' ); _invariant( !isValidElement(spec), "ReactClass: You're attempting to " + 'use a component as a mixin. Instead, just use a regular object.' ); var proto = Constructor.prototype; var autoBindPairs = proto.__reactAutoBindPairs; // By handling mixins before any other properties, we ensure the same // chaining order is applied to methods with DEFINE_MANY policy, whether // mixins are listed before or after these methods in the spec. if (spec.hasOwnProperty(MIXINS_KEY)) { RESERVED_SPEC_KEYS.mixins(Constructor, spec.mixins); } for (var name in spec) { if (!spec.hasOwnProperty(name)) { continue; } if (name === MIXINS_KEY) { // We have already handled mixins in a special case above. continue; } var property = spec[name]; var isAlreadyDefined = proto.hasOwnProperty(name); validateMethodOverride(isAlreadyDefined, name); if (RESERVED_SPEC_KEYS.hasOwnProperty(name)) { RESERVED_SPEC_KEYS[name](Constructor, property); } else { // Setup methods on prototype: // The following member methods should not be automatically bound: // 1. Expected ReactClass methods (in the "interface"). // 2. Overridden methods (that were mixed in). var isReactClassMethod = ReactClassInterface.hasOwnProperty(name); var isFunction = typeof property === 'function'; var shouldAutoBind = isFunction && !isReactClassMethod && !isAlreadyDefined && spec.autobind !== false; if (shouldAutoBind) { autoBindPairs.push(name, property); proto[name] = property; } else { if (isAlreadyDefined) { var specPolicy = ReactClassInterface[name]; // These cases should already be caught by validateMethodOverride. _invariant( isReactClassMethod && (specPolicy === 'DEFINE_MANY_MERGED' || specPolicy === 'DEFINE_MANY'), 'ReactClass: Unexpected spec policy %s for key %s ' + 'when mixing in component specs.', specPolicy, name ); // For methods which are defined more than once, call the existing // methods before calling the new property, merging if appropriate. if (specPolicy === 'DEFINE_MANY_MERGED') { proto[name] = createMergedResultFunction(proto[name], property); } else if (specPolicy === 'DEFINE_MANY') { proto[name] = createChainedFunction(proto[name], property); } } else { proto[name] = property; if (false) {} } } } } } function mixStaticSpecIntoComponent(Constructor, statics) { if (!statics) { return; } for (var name in statics) { var property = statics[name]; if (!statics.hasOwnProperty(name)) { continue; } var isReserved = name in RESERVED_SPEC_KEYS; _invariant( !isReserved, 'ReactClass: You are attempting to define a reserved ' + 'property, `%s`, that shouldn\'t be on the "statics" key. Define it ' + 'as an instance property instead; it will still be accessible on the ' + 'constructor.', name ); var isAlreadyDefined = name in Constructor; if (isAlreadyDefined) { var specPolicy = ReactClassStaticInterface.hasOwnProperty(name) ? ReactClassStaticInterface[name] : null; _invariant( specPolicy === 'DEFINE_MANY_MERGED', 'ReactClass: You are attempting to define ' + '`%s` on your component more than once. This conflict may be ' + 'due to a mixin.', name ); Constructor[name] = createMergedResultFunction(Constructor[name], property); return; } Constructor[name] = property; } } /** * Merge two objects, but throw if both contain the same key. * * @param {object} one The first object, which is mutated. * @param {object} two The second object * @return {object} one after it has been mutated to contain everything in two. */ function mergeIntoWithNoDuplicateKeys(one, two) { _invariant( one && two && typeof one === 'object' && typeof two === 'object', 'mergeIntoWithNoDuplicateKeys(): Cannot merge non-objects.' ); for (var key in two) { if (two.hasOwnProperty(key)) { _invariant( one[key] === undefined, 'mergeIntoWithNoDuplicateKeys(): ' + 'Tried to merge two objects with the same key: `%s`. This conflict ' + 'may be due to a mixin; in particular, this may be caused by two ' + 'getInitialState() or getDefaultProps() methods returning objects ' + 'with clashing keys.', key ); one[key] = two[key]; } } return one; } /** * Creates a function that invokes two functions and merges their return values. * * @param {function} one Function to invoke first. * @param {function} two Function to invoke second. * @return {function} Function that invokes the two argument functions. * @private */ function createMergedResultFunction(one, two) { return function mergedResult() { var a = one.apply(this, arguments); var b = two.apply(this, arguments); if (a == null) { return b; } else if (b == null) { return a; } var c = {}; mergeIntoWithNoDuplicateKeys(c, a); mergeIntoWithNoDuplicateKeys(c, b); return c; }; } /** * Creates a function that invokes two functions and ignores their return vales. * * @param {function} one Function to invoke first. * @param {function} two Function to invoke second. * @return {function} Function that invokes the two argument functions. * @private */ function createChainedFunction(one, two) { return function chainedFunction() { one.apply(this, arguments); two.apply(this, arguments); }; } /** * Binds a method to the component. * * @param {object} component Component whose method is going to be bound. * @param {function} method Method to be bound. * @return {function} The bound method. */ function bindAutoBindMethod(component, method) { var boundMethod = method.bind(component); if (false) { var _bind, componentName; } return boundMethod; } /** * Binds all auto-bound methods in a component. * * @param {object} component Component whose method is going to be bound. */ function bindAutoBindMethods(component) { var pairs = component.__reactAutoBindPairs; for (var i = 0; i < pairs.length; i += 2) { var autoBindKey = pairs[i]; var method = pairs[i + 1]; component[autoBindKey] = bindAutoBindMethod(component, method); } } var IsMountedPreMixin = { componentDidMount: function() { this.__isMounted = true; } }; var IsMountedPostMixin = { componentWillUnmount: function() { this.__isMounted = false; } }; /** * Add more to the ReactClass base class. These are all legacy features and * therefore not already part of the modern ReactComponent. */ var ReactClassMixin = { /** * TODO: This will be deprecated because state should always keep a consistent * type signature and the only use case for this, is to avoid that. */ replaceState: function(newState, callback) { this.updater.enqueueReplaceState(this, newState, callback); }, /** * Checks whether or not this composite component is mounted. * @return {boolean} True if mounted, false otherwise. * @protected * @final */ isMounted: function() { if (false) {} return !!this.__isMounted; } }; var ReactClassComponent = function() {}; _assign( ReactClassComponent.prototype, ReactComponent.prototype, ReactClassMixin ); /** * Creates a composite component class given a class specification. * See https://facebook.github.io/react/docs/top-level-api.html#react.createclass * * @param {object} spec Class specification (which must define `render`). * @return {function} Component constructor function. * @public */ function createClass(spec) { // To keep our warnings more understandable, we'll use a little hack here to // ensure that Constructor.name !== 'Constructor'. This makes sure we don't // unnecessarily identify a class without displayName as 'Constructor'. var Constructor = identity(function(props, context, updater) { // This constructor gets overridden by mocks. The argument is used // by mocks to assert on what gets mounted. if (false) {} // Wire up auto-binding if (this.__reactAutoBindPairs.length) { bindAutoBindMethods(this); } this.props = props; this.context = context; this.refs = emptyObject; this.updater = updater || ReactNoopUpdateQueue; this.state = null; // ReactClasses doesn't have constructors. Instead, they use the // getInitialState and componentWillMount methods for initialization. var initialState = this.getInitialState ? this.getInitialState() : null; if (false) {} _invariant( typeof initialState === 'object' && !Array.isArray(initialState), '%s.getInitialState(): must return an object or null', Constructor.displayName || 'ReactCompositeComponent' ); this.state = initialState; }); Constructor.prototype = new ReactClassComponent(); Constructor.prototype.constructor = Constructor; Constructor.prototype.__reactAutoBindPairs = []; injectedMixins.forEach(mixSpecIntoComponent.bind(null, Constructor)); mixSpecIntoComponent(Constructor, IsMountedPreMixin); mixSpecIntoComponent(Constructor, spec); mixSpecIntoComponent(Constructor, IsMountedPostMixin); // Initialize the defaultProps property after all mixins have been merged. if (Constructor.getDefaultProps) { Constructor.defaultProps = Constructor.getDefaultProps(); } if (false) {} _invariant( Constructor.prototype.render, 'createClass(...): Class specification must implement a `render` method.' ); if (false) {} // Reduce time spent doing lookups by setting these on the prototype. for (var methodName in ReactClassInterface) { if (!Constructor.prototype[methodName]) { Constructor.prototype[methodName] = null; } } return Constructor; } return createClass; } module.exports = factory; /***/ }), /***/ "./node_modules/create-react-class/index.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * Copyright (c) 2013-present, Facebook, Inc. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * */ var React = __webpack_require__("./node_modules/react/index.js"); var factory = __webpack_require__("./node_modules/create-react-class/factory.js"); if (typeof React === 'undefined') { throw Error( 'create-react-class could not find the React object. If you are using script tags, ' + 'make sure that React is being loaded before create-react-class.' ); } // Hack to grab NoopUpdateQueue from isomorphic React var ReactNoopUpdateQueue = new React.Component().updater; module.exports = factory( React.Component, React.isValidElement, ReactNoopUpdateQueue ); /***/ }), /***/ "./node_modules/css-loader/dist/cjs.js!./node_modules/ag-grid-community/styles/ag-grid.css": /***/ (function(module, exports, __webpack_require__) { // Imports var ___CSS_LOADER_API_IMPORT___ = __webpack_require__("./node_modules/css-loader/dist/runtime/api.js"); exports = ___CSS_LOADER_API_IMPORT___(false); // Module exports.push([module.i, ".ag-icon {\n font-family: var(--ag-icon-font-family);\n font-size: var(--ag-icon-size);\n line-height: var(--ag-icon-size);\n font-style: normal;\n font-weight: normal;\n font-variant: normal;\n text-transform: none;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\n\n.ag-icon-aggregation::before {\n content: var(--ag-icon-font-code-aggregation, \"\\f101\");\n}\n\n.ag-icon-arrows::before {\n content: var(--ag-icon-font-code-arrows, \"\\f102\");\n}\n\n.ag-icon-asc::before {\n content: var(--ag-icon-font-code-asc, \"\\f103\");\n}\n\n.ag-icon-cancel::before {\n content: var(--ag-icon-font-code-cancel, \"\\f104\");\n}\n\n.ag-icon-chart::before {\n content: var(--ag-icon-font-code-chart, \"\\f105\");\n}\n\n.ag-icon-checkbox-checked::before {\n content: var(--ag-icon-font-code-checkbox-checked, \"\\f106\");\n}\n\n.ag-icon-checkbox-indeterminate::before {\n content: var(--ag-icon-font-code-checkbox-indeterminate, \"\\f107\");\n}\n\n.ag-icon-checkbox-unchecked::before {\n content: var(--ag-icon-font-code-checkbox-unchecked, \"\\f108\");\n}\n\n.ag-icon-color-picker::before {\n content: var(--ag-icon-font-code-color-picker, \"\\f109\");\n}\n\n.ag-icon-columns::before {\n content: var(--ag-icon-font-code-columns, \"\\f10a\");\n}\n\n.ag-icon-contracted::before {\n content: var(--ag-icon-font-code-contracted, \"\\f10b\");\n}\n\n.ag-icon-copy::before {\n content: var(--ag-icon-font-code-copy, \"\\f10c\");\n}\n\n.ag-icon-cross::before {\n content: var(--ag-icon-font-code-cross, \"\\f10d\");\n}\n\n.ag-icon-csv::before {\n content: var(--ag-icon-font-code-csv, \"\\f10e\");\n}\n\n.ag-icon-cut::before {\n content: var(--ag-icon-font-code-cut, \"\\f10f\");\n}\n\n.ag-icon-desc::before {\n content: var(--ag-icon-font-code-desc, \"\\f110\");\n}\n\n.ag-icon-excel::before {\n content: var(--ag-icon-font-code-excel, \"\\f111\");\n}\n\n.ag-icon-expanded::before {\n content: var(--ag-icon-font-code-expanded, \"\\f112\");\n}\n\n.ag-icon-eye-slash::before {\n content: var(--ag-icon-font-code-eye-slash, \"\\f113\");\n}\n\n.ag-icon-eye::before {\n content: var(--ag-icon-font-code-eye, \"\\f114\");\n}\n\n.ag-icon-filter::before {\n content: var(--ag-icon-font-code-filter, \"\\f115\");\n}\n\n.ag-icon-first::before {\n content: var(--ag-icon-font-code-first, \"\\f116\");\n}\n\n.ag-icon-grip::before {\n content: var(--ag-icon-font-code-grip, \"\\f117\");\n}\n\n.ag-icon-group::before {\n content: var(--ag-icon-font-code-group, \"\\f118\");\n}\n\n.ag-icon-last::before {\n content: var(--ag-icon-font-code-last, \"\\f119\");\n}\n\n.ag-icon-left::before {\n content: var(--ag-icon-font-code-left, \"\\f11a\");\n}\n\n.ag-icon-linked::before {\n content: var(--ag-icon-font-code-linked, \"\\f11b\");\n}\n\n.ag-icon-loading::before {\n content: var(--ag-icon-font-code-loading, \"\\f11c\");\n}\n\n.ag-icon-maximize::before {\n content: var(--ag-icon-font-code-maximize, \"\\f11d\");\n}\n\n.ag-icon-menu::before {\n content: var(--ag-icon-font-code-menu, \"\\f11e\");\n}\n\n.ag-icon-minimize::before {\n content: var(--ag-icon-font-code-minimize, \"\\f11f\");\n}\n\n.ag-icon-next::before {\n content: var(--ag-icon-font-code-next, \"\\f120\");\n}\n\n.ag-icon-none::before {\n content: var(--ag-icon-font-code-none, \"\\f121\");\n}\n\n.ag-icon-not-allowed::before {\n content: var(--ag-icon-font-code-not-allowed, \"\\f122\");\n}\n\n.ag-icon-paste::before {\n content: var(--ag-icon-font-code-paste, \"\\f123\");\n}\n\n.ag-icon-pin::before {\n content: var(--ag-icon-font-code-pin, \"\\f124\");\n}\n\n.ag-icon-pivot::before {\n content: var(--ag-icon-font-code-pivot, \"\\f125\");\n}\n\n.ag-icon-previous::before {\n content: var(--ag-icon-font-code-previous, \"\\f126\");\n}\n\n.ag-icon-radio-button-off::before {\n content: var(--ag-icon-font-code-radio-button-off, \"\\f127\");\n}\n\n.ag-icon-radio-button-on::before {\n content: var(--ag-icon-font-code-radio-button-on, \"\\f128\");\n}\n\n.ag-icon-right::before {\n content: var(--ag-icon-font-code-right, \"\\f129\");\n}\n\n.ag-icon-save::before {\n content: var(--ag-icon-font-code-save, \"\\f12a\");\n}\n\n.ag-icon-small-down::before {\n content: var(--ag-icon-font-code-small-down, \"\\f12b\");\n}\n\n.ag-icon-small-left::before {\n content: var(--ag-icon-font-code-small-left, \"\\f12c\");\n}\n\n.ag-icon-small-right::before {\n content: var(--ag-icon-font-code-small-right, \"\\f12d\");\n}\n\n.ag-icon-small-up::before {\n content: var(--ag-icon-font-code-small-up, \"\\f12e\");\n}\n\n.ag-icon-tick::before {\n content: var(--ag-icon-font-code-tick, \"\\f12f\");\n}\n\n.ag-icon-tree-closed::before {\n content: var(--ag-icon-font-code-tree-closed, \"\\f130\");\n}\n\n.ag-icon-tree-indeterminate::before {\n content: var(--ag-icon-font-code-tree-indeterminate, \"\\f131\");\n}\n\n.ag-icon-tree-open::before {\n content: var(--ag-icon-font-code-tree-open, \"\\f132\");\n}\n\n.ag-icon-unlinked::before {\n content: var(--ag-icon-font-code-unlinked, \"\\f133\");\n}\n\n.ag-icon-row-drag::before {\n content: var(--ag-icon-font-code-grip);\n}\n\n.ag-left-arrow::before {\n content: var(--ag-icon-font-code-left);\n}\n\n.ag-right-arrow::before {\n content: var(--ag-icon-font-code-right);\n}\n\n[class*=ag-theme-] {\n --ag-foreground-color: #000;\n --ag-data-color: var(--ag-foreground-color);\n --ag-secondary-foreground-color: var(--ag-foreground-color);\n --ag-header-foreground-color: var(--ag-secondary-foreground-color);\n --ag-disabled-foreground-color: rgba(0, 0, 0, 0.5);\n --ag-background-color: #fff;\n --ag-header-background-color: transparent;\n --ag-tooltip-background-color: transparent;\n --ag-subheader-background-color: transparent;\n --ag-subheader-toolbar-background-color: transparent;\n --ag-control-panel-background-color: transparent;\n --ag-side-button-selected-background-color: var(--ag-control-panel-background-color);\n --ag-selected-row-background-color: #BBB;\n --ag-odd-row-background-color: var(--ag-background-color);\n --ag-modal-overlay-background-color: rgba(255, 255, 255, 0.66);\n --ag-row-hover-color: transparent;\n --ag-column-hover-color: transparent;\n --ag-range-selection-border-color: var(--ag-foreground-color);\n --ag-range-selection-border-style: solid;\n --ag-range-selection-background-color: rgba(0, 0, 0, 0.2);\n --ag-range-selection-background-color-2: var(--ag-range-selection-background-color);\n --ag-range-selection-background-color-3: var(--ag-range-selection-background-color);\n --ag-range-selection-background-color-4: var(--ag-range-selection-background-color);\n --ag-range-selection-highlight-color: var(--ag-range-selection-border-color);\n --ag-selected-tab-underline-color: var(--ag-range-selection-border-color);\n --ag-selected-tab-underline-width: 0;\n --ag-selected-tab-underline-transition-speed: 0s;\n --ag-range-selection-chart-category-background-color: rgba(0, 255, 132, 0.1);\n --ag-range-selection-chart-background-color: rgba(0, 88, 255, 0.1);\n --ag-header-cell-hover-background-color: transparent;\n --ag-header-cell-moving-background-color: var(--ag-background-color);\n --ag-value-change-value-highlight-background-color: rgba(22, 160, 133, 0.5);\n --ag-value-change-delta-up-color: #43a047;\n --ag-value-change-delta-down-color: #e53935;\n --ag-chip-background-color: transparent;\n --ag-borders: solid 1px;\n --ag-border-color: rgba(0, 0, 0, 0.25);\n --ag-borders-critical: var(--ag-borders);\n --ag-borders-secondary: var(--ag-borders);\n --ag-secondary-border-color: var(--ag-border-color);\n --ag-row-border-style: solid;\n --ag-row-border-color: var(--ag-secondary-border-color);\n --ag-row-border-width: 1px;\n --ag-cell-horizontal-border: solid transparent;\n --ag-borders-input: var(--ag-borders-secondary);\n --ag-input-border-color: var(--ag-secondary-border-color);\n --ag-borders-input-invalid: solid 2px;\n --ag-input-border-color-invalid: var(--ag-invalid-color);\n --ag-borders-side-button: var(--ag-borders);\n --ag-border-radius: 0px;\n --ag-row-border-color: var(--ag-secondary-border-color);\n --ag-header-column-separator-display: none;\n --ag-header-column-separator-height: 100%;\n --ag-header-column-separator-width: 1px;\n --ag-header-column-separator-color: var(--ag-secondary-border-color);\n --ag-header-column-resize-handle-display: none;\n --ag-header-column-resize-handle-height: 50%;\n --ag-header-column-resize-handle-width: 1px;\n --ag-header-column-resize-handle-color: var(--ag-secondary-border-color);\n --ag-invalid-color: red;\n --ag-input-disabled-border-color: var(--ag-input-border-color);\n --ag-input-disabled-background-color: transparent;\n --ag-checkbox-background-color: transparent;\n --ag-checkbox-border-radius: var(--ag-border-radius);\n --ag-checkbox-checked-color: var(--ag-foreground-color);\n --ag-checkbox-unchecked-color: var(--ag-foreground-color);\n --ag-checkbox-indeterminate-color: var(--ag-checkbox-unchecked-color);\n --ag-toggle-button-off-border-color: var(--ag-checkbox-unchecked-color);\n --ag-toggle-button-off-background-color: var(--ag-checkbox-unchecked-color);\n --ag-toggle-button-on-border-color: var(--ag-checkbox-checked-color);\n --ag-toggle-button-on-background-color: var(--ag-checkbox-checked-color);\n --ag-toggle-button-switch-background-color: var(--ag-background-color);\n --ag-toggle-button-switch-border-color: var(--ag-toggle-button-off-border-color);\n --ag-toggle-button-border-width: 1px;\n --ag-toggle-button-height: var(--ag-icon-size);\n --ag-toggle-button-width: calc(var(--ag-toggle-button-height) * 2);\n --ag-input-focus-box-shadow: none;\n --ag-input-focus-border-color: none;\n --ag-minichart-selected-chart-color: var(--ag-checkbox-checked-color);\n --ag-minichart-selected-page-color: var(--ag-checkbox-checked-color);\n --ag-grid-size: 4px;\n --ag-icon-size: 12px;\n --ag-widget-container-horizontal-padding: calc(var(--ag-grid-size) * 1.5);\n --ag-widget-container-vertical-padding: calc(var(--ag-grid-size) * 1.5);\n --ag-widget-horizontal-spacing: calc(var(--ag-grid-size) * 2);\n --ag-widget-vertical-spacing: var(--ag-grid-size);\n --ag-cell-horizontal-padding: calc(var(--ag-grid-size) * 3);\n --ag-cell-widget-spacing: var(--ag-cell-horizontal-padding);\n --ag-row-height: calc(var(--ag-grid-size) * 6 + 1px);\n --ag-header-height: var(--ag-row-height);\n --ag-list-item-height: calc(var(--ag-grid-size) * 5);\n --ag-column-select-indent-size: calc(var(--ag-grid-size) + var(--ag-icon-size));\n --ag-set-filter-indent-size: calc(var(--ag-grid-size) + var(--ag-icon-size));\n --ag-row-group-indent-size: calc(var(--ag-cell-widget-spacing) + var(--ag-icon-size));\n --ag-filter-tool-panel-group-indent: 16px;\n --ag-tab-min-width: 220px;\n --ag-menu-min-width: 181px;\n --ag-side-bar-panel-width: 200px;\n --ag-font-family: \"Helvetica Neue\", sans-serif;\n --ag-font-size: 14px;\n --ag-card-radius: var(--ag-border-radius);\n --ag-card-shadow: none;\n --ag-popup-shadow: 5px 5px 10px rgba(0, 0, 0, 0.3);\n}\n\n.ag-root-wrapper, .ag-sticky-top, .ag-dnd-ghost {\n background-color: var(--ag-background-color);\n}\n\n[class*=ag-theme-] {\n -webkit-font-smoothing: antialiased;\n font-family: var(--ag-font-family);\n font-size: var(--ag-font-size);\n line-height: normal;\n color: var(--ag-foreground-color);\n}\n\nag-grid, ag-grid-angular, ag-grid-ng2, ag-grid-polymer, ag-grid-aurelia {\n display: block;\n}\n\n.ag-hidden {\n display: none !important;\n}\n\n.ag-invisible {\n visibility: hidden !important;\n}\n\n.ag-no-transition {\n transition: none !important;\n}\n\n.ag-drag-handle {\n cursor: grab;\n}\n\n.ag-column-drop-wrapper {\n display: flex;\n}\n\n.ag-column-drop-horizontal-half-width {\n display: inline-block;\n width: 50% !important;\n}\n\n.ag-unselectable {\n -moz-user-select: none;\n -webkit-user-select: none;\n -ms-user-select: none;\n user-select: none;\n}\n\n.ag-selectable {\n -moz-user-select: text;\n -webkit-user-select: text;\n -ms-user-select: text;\n user-select: text;\n}\n\n.ag-tab {\n position: relative;\n}\n\n.ag-tab-guard {\n position: absolute;\n width: 0;\n height: 0;\n display: block;\n}\n\n.ag-select-agg-func-popup {\n position: absolute;\n}\n\n.ag-input-wrapper, .ag-picker-field-wrapper {\n display: flex;\n flex: 1 1 auto;\n align-items: center;\n line-height: normal;\n position: relative;\n}\n\n.ag-shake-left-to-right {\n animation-direction: alternate;\n animation-duration: 0.2s;\n animation-iteration-count: infinite;\n animation-name: ag-shake-left-to-right;\n}\n\n@keyframes ag-shake-left-to-right {\n from {\n padding-left: 6px;\n padding-right: 2px;\n }\n to {\n padding-left: 2px;\n padding-right: 6px;\n }\n}\n.ag-root-wrapper {\n cursor: default;\n position: relative;\n display: flex;\n flex-direction: column;\n overflow: hidden;\n}\n.ag-root-wrapper.ag-layout-normal {\n height: 100%;\n}\n\n.ag-watermark {\n position: absolute;\n bottom: 20px;\n right: 25px;\n opacity: 0.5;\n transition: opacity 1s ease-out 3s;\n}\n.ag-watermark::before {\n content: \"\";\n background-image: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+Cjxzdmcgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDIzNSA0MCIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB4bWw6c3BhY2U9InByZXNlcnZlIiB4bWxuczpzZXJpZj0iaHR0cDovL3d3dy5zZXJpZi5jb20vIiBzdHlsZT0iZmlsbC1ydWxlOmV2ZW5vZGQ7Y2xpcC1ydWxlOmV2ZW5vZGQ7c3Ryb2tlLWxpbmVqb2luOnJvdW5kO3N0cm9rZS1taXRlcmxpbWl0OjI7Ij4KICAgIDxnIHRyYW5zZm9ybT0ibWF0cml4KDAuNjM1NzIzLDAsMCwwLjYzNTcyMywtNDkyLjkyMSwtMzIzLjYwOCkiPgogICAgICAgIDxwYXRoIGQ9Ik0xMDk5LjQsNTQ5LjRMMTA5OS40LDUzNi45TDEwNzguMSw1MzYuOUwxMDY1LjYsNTQ5LjRMMTA5OS40LDU0OS40WiIgc3R5bGU9ImZpbGw6cmdiKDI0LDI5LDMxKTtmaWxsLXJ1bGU6bm9uemVybzsiLz4KICAgICAgICA8cGF0aCBkPSJNMTEyMy40LDUxOC40TDEwOTYuNyw1MTguNEwxMDg0LjEsNTMwLjlMMTEyMy40LDUzMC45TDExMjMuNCw1MTguNFoiIHN0eWxlPSJmaWxsOnJnYigyNCwyOSwzMSk7ZmlsbC1ydWxlOm5vbnplcm87Ii8+CiAgICAgICAgPHBhdGggZD0iTTEwNTMuMiw1NjEuOUwxMDU5LjYsNTU1LjVMMTA4MS4yLDU1NS41TDEwODEuMiw1NjhMMTA1My4yLDU2OEwxMDUzLjIsNTYxLjlaIiBzdHlsZT0iZmlsbDpyZ2IoMjQsMjksMzEpO2ZpbGwtcnVsZTpub256ZXJvOyIvPgogICAgICAgIDxwYXRoIGQ9Ik0xMDU3LjksNTQzLjNMMTA3MS43LDU0My4zTDEwODQuMyw1MzAuOEwxMDU3LjksNTMwLjhMMTA1Ny45LDU0My4zWiIgc3R5bGU9ImZpbGw6cmdiKDI0LDI5LDMxKTtmaWxsLXJ1bGU6bm9uemVybzsiLz4KICAgICAgICA8cGF0aCBkPSJNMTA0Mi44LDU2MS45TDEwNTMuMiw1NjEuOUwxMDY1LjYsNTQ5LjRMMTA0Mi44LDU0OS40TDEwNDIuOCw1NjEuOVoiIHN0eWxlPSJmaWxsOnJnYigyNCwyOSwzMSk7ZmlsbC1ydWxlOm5vbnplcm87Ii8+CiAgICAgICAgPHBhdGggZD0iTTEwOTYuNyw1MTguNEwxMDkwLjMsNTI0LjhMMTA0OS41LDUyNC44TDEwNDkuNSw1MTIuM0wxMDk2LjcsNTEyLjNMMTA5Ni43LDUxOC40WiIgc3R5bGU9ImZpbGw6cmdiKDI0LDI5LDMxKTtmaWxsLXJ1bGU6bm9uemVybzsiLz4KICAgICAgICA8cGF0aCBkPSJNODI4LjYsNTU5LjdMODA5LDU1OS43TDgwNS42LDU2OC4xTDc5Nyw1NjguMUw4MTUuMSw1MjUuN0w4MjIuNiw1MjUuN0w4NDAuNyw1NjguMUw4MzIsNTY4LjFMODI4LjYsNTU5LjdaTTgyNS45LDU1M0w4MTguOCw1MzUuN0w4MTEuNyw1NTNMODI1LjksNTUzWiIgc3R5bGU9ImZpbGw6cmdiKDI0LDI5LDMxKTtmaWxsLXJ1bGU6bm9uemVybzsiLz4KICAgICAgICA8cGF0aCBkPSJNOTYwLjEsNTQxLjNDOTYyLjYsNTM3LjYgOTY4LjksNTM3LjIgOTcxLjUsNTM3LjJMOTcxLjUsNTQ0LjRDOTY4LjMsNTQ0LjQgOTY1LjEsNTQ0LjUgOTYzLjIsNTQ1LjlDOTYxLjMsNTQ3LjMgOTYwLjMsNTQ5LjIgOTYwLjMsNTUxLjVMOTYwLjMsNTY4LjFMOTUyLjUsNTY4LjFMOTUyLjUsNTM3LjJMOTYwLDUzNy4yTDk2MC4xLDU0MS4zWiIgc3R5bGU9ImZpbGw6cmdiKDI0LDI5LDMxKTtmaWxsLXJ1bGU6bm9uemVybzsiLz4KICAgICAgICA8cmVjdCB4PSI5NzUuOCIgeT0iNTM3LjIiIHdpZHRoPSI3LjgiIGhlaWdodD0iMzAuOSIgc3R5bGU9ImZpbGw6cmdiKDI0LDI5LDMxKTsiLz4KICAgICAgICA8cmVjdCB4PSI5NzUuOCIgeT0iNTIzLjQiIHdpZHRoPSI3LjgiIGhlaWdodD0iOS4yIiBzdHlsZT0iZmlsbDpyZ2IoMjQsMjksMzEpOyIvPgogICAgICAgIDxwYXRoIGQ9Ik0xMDIyLjMsNTIzLjRMMTAyMi4zLDU2OC4xTDEwMTQuOCw1NjguMUwxMDE0LjYsNTYzLjRDMTAxMy41LDU2NSAxMDEyLjEsNTY2LjMgMTAxMC40LDU2Ny4zQzEwMDguNyw1NjguMiAxMDA2LjYsNTY4LjcgMTAwNC4yLDU2OC43QzEwMDIuMSw1NjguNyAxMDAwLjEsNTY4LjMgOTk4LjQsNTY3LjZDOTk2LjYsNTY2LjggOTk1LDU2NS44IDk5My43LDU2NC40Qzk5Mi40LDU2MyA5OTEuMyw1NjEuMyA5OTAuNiw1NTkuNEM5ODkuOCw1NTcuNSA5ODkuNSw1NTUuMyA5ODkuNSw1NTIuOUM5ODkuNSw1NTAuNSA5ODkuOSw1NDguMyA5OTAuNiw1NDYuM0M5OTEuNCw1NDQuMyA5OTIuNCw1NDIuNiA5OTMuNyw1NDEuMkM5OTUsNTM5LjggOTk2LjYsNTM4LjcgOTk4LjQsNTM3LjlDMTAwMC4yLDUzNy4xIDEwMDIuMSw1MzYuNyAxMDA0LjIsNTM2LjdDMTAwNi42LDUzNi43IDEwMDguNiw1MzcuMSAxMDEwLjMsNTM4QzEwMTIsNTM4LjkgMTAxMy40LDU0MC4xIDEwMTQuNSw1NDEuOEwxMDE0LjUsNTIzLjVMMTAyMi4zLDUyMy41TDEwMjIuMyw1MjMuNFpNMTAwNS45LDU2MkMxMDA4LjUsNTYyIDEwMTAuNSw1NjEuMSAxMDEyLjEsNTU5LjRDMTAxMy43LDU1Ny43IDEwMTQuNSw1NTUuNCAxMDE0LjUsNTUyLjZDMTAxNC41LDU0OS44IDEwMTMuNyw1NDcuNiAxMDEyLjEsNTQ1LjhDMTAxMC41LDU0NC4xIDEwMDguNSw1NDMuMiAxMDA1LjksNTQzLjJDMTAwMy40LDU0My4yIDEwMDEuMyw1NDQuMSA5OTkuOCw1NDUuOEM5OTguMiw1NDcuNSA5OTcuNCw1NDkuOCA5OTcuNCw1NTIuNkM5OTcuNCw1NTUuNCA5OTguMiw1NTcuNiA5OTkuOCw1NTkuM0MxMDAxLjQsNTYxLjEgMTAwMy40LDU2MiAxMDA1LjksNTYyIiBzdHlsZT0iZmlsbDpyZ2IoMjQsMjksMzEpO2ZpbGwtcnVsZTpub256ZXJvOyIvPgogICAgICAgIDxwYXRoIGQ9Ik04ODUuOCw1NDQuMkw4NjYuNSw1NDQuMkw4NjYuNSw1NTAuOUw4NzcuNSw1NTAuOUM4NzcuMiw1NTQuMyA4NzUuOSw1NTYuOSA4NzMuNyw1NTlDODcxLjUsNTYxIDg2OC43LDU2MiA4NjUuMSw1NjJDODYzLjEsNTYyIDg2MS4yLDU2MS42IDg1OS42LDU2MC45Qzg1Ny45LDU2MC4yIDg1Ni41LDU1OS4yIDg1NS4zLDU1Ny44Qzg1NC4xLDU1Ni41IDg1My4yLDU1NC45IDg1Mi41LDU1M0M4NTEuOCw1NTEuMSA4NTEuNSw1NDkuMSA4NTEuNSw1NDYuOEM4NTEuNSw1NDQuNSA4NTEuOCw1NDIuNSA4NTIuNSw1NDAuNkM4NTMuMSw1MzguNyA4NTQuMSw1MzcuMiA4NTUuMyw1MzUuOEM4NTYuNSw1MzQuNSA4NTcuOSw1MzMuNSA4NTkuNiw1MzIuN0M4NjEuMyw1MzIgODYzLjEsNTMxLjYgODY1LjIsNTMxLjZDODY5LjQsNTMxLjYgODcyLjYsNTMyLjYgODc0LjgsNTM0LjZMODgwLDUyOS40Qzg3Ni4xLDUyNi40IDg3MS4xLDUyNC44IDg2NS4yLDUyNC44Qzg2MS45LDUyNC44IDg1OC45LDUyNS4zIDg1Ni4yLDUyNi40Qzg1My41LDUyNy41IDg1MS4yLDUyOC45IDg0OS4zLDUzMC44Qzg0Ny40LDUzMi43IDg0NS45LDUzNSA4NDQuOSw1MzcuN0M4NDMuOSw1NDAuNCA4NDMuNCw1NDMuNCA4NDMuNCw1NDYuNkM4NDMuNCw1NDkuOCA4NDMuOSw1NTIuOCA4NDUsNTU1LjVDODQ2LjEsNTU4LjIgODQ3LjUsNTYwLjUgODQ5LjQsNTYyLjRDODUxLjMsNTY0LjMgODUzLjYsNTY1LjggODU2LjMsNTY2LjhDODU5LDU2Ny45IDg2Miw1NjguNCA4NjUuMiw1NjguNEM4NjguNCw1NjguNCA4NzEuMyw1NjcuOSA4NzMuOSw1NjYuOEM4NzYuNSw1NjUuNyA4NzguNyw1NjQuMyA4ODAuNSw1NjIuNEM4ODIuMyw1NjAuNSA4ODMuNyw1NTguMiA4ODQuNyw1NTUuNUM4ODUuNyw1NTIuOCA4ODYuMiw1NDkuOCA4ODYuMiw1NDYuNkw4ODYuMiw1NDUuM0M4ODUuOSw1NDUuMSA4ODUuOCw1NDQuNiA4ODUuOCw1NDQuMiIgc3R5bGU9ImZpbGw6cmdiKDI0LDI5LDMxKTtmaWxsLXJ1bGU6bm9uemVybzsiLz4KICAgICAgICA8cGF0aCBkPSJNOTQ2LjgsNTQ0LjJMOTI3LjUsNTQ0LjJMOTI3LjUsNTUwLjlMOTM4LjUsNTUwLjlDOTM4LjIsNTU0LjMgOTM2LjksNTU2LjkgOTM0LjcsNTU5QzkzMi41LDU2MSA5MjkuNyw1NjIgOTI2LjEsNTYyQzkyNC4xLDU2MiA5MjIuMiw1NjEuNiA5MjAuNiw1NjAuOUM5MTguOSw1NjAuMiA5MTcuNSw1NTkuMiA5MTYuMyw1NTcuOEM5MTUuMSw1NTYuNSA5MTQuMiw1NTQuOSA5MTMuNSw1NTNDOTEyLjgsNTUxLjEgOTEyLjUsNTQ5LjEgOTEyLjUsNTQ2LjhDOTEyLjUsNTQ0LjUgOTEyLjgsNTQyLjUgOTEzLjUsNTQwLjZDOTE0LjEsNTM4LjcgOTE1LjEsNTM3LjIgOTE2LjMsNTM1LjhDOTE3LjUsNTM0LjUgOTE4LjksNTMzLjUgOTIwLjYsNTMyLjdDOTIyLjMsNTMyIDkyNC4xLDUzMS42IDkyNi4yLDUzMS42QzkzMC40LDUzMS42IDkzMy42LDUzMi42IDkzNS44LDUzNC42TDk0MSw1MjkuNEM5MzcuMSw1MjYuNCA5MzIuMSw1MjQuOCA5MjYuMiw1MjQuOEM5MjIuOSw1MjQuOCA5MTkuOSw1MjUuMyA5MTcuMiw1MjYuNEM5MTQuNSw1MjcuNSA5MTIuMiw1MjguOSA5MTAuMyw1MzAuOEM5MDguNCw1MzIuNyA5MDYuOSw1MzUgOTA1LjksNTM3LjdDOTA0LjksNTQwLjQgOTA0LjQsNTQzLjQgOTA0LjQsNTQ2LjZDOTA0LjQsNTQ5LjggOTA0LjksNTUyLjggOTA2LDU1NS41QzkwNy4xLDU1OC4yIDkwOC41LDU2MC41IDkxMC40LDU2Mi40QzkxMi4zLDU2NC4zIDkxNC42LDU2NS44IDkxNy4zLDU2Ni44QzkyMCw1NjcuOSA5MjMsNTY4LjQgOTI2LjIsNTY4LjRDOTI5LjQsNTY4LjQgOTMyLjMsNTY3LjkgOTM0LjksNTY2LjhDOTM3LjUsNTY1LjcgOTM5LjcsNTY0LjMgOTQxLjUsNTYyLjRDOTQzLjMsNTYwLjUgOTQ0LjcsNTU4LjIgOTQ1LjcsNTU1LjVDOTQ2LjcsNTUyLjggOTQ3LjIsNTQ5LjggOTQ3LjIsNTQ2LjZMOTQ3LjIsNTQ1LjNDOTQ2LjksNTQ1LjEgOTQ2LjgsNTQ0LjYgOTQ2LjgsNTQ0LjIiIHN0eWxlPSJmaWxsOnJnYigyNCwyOSwzMSk7ZmlsbC1ydWxlOm5vbnplcm87Ii8+CiAgICA8L2c+Cjwvc3ZnPgo=);\n background-repeat: no-repeat;\n background-size: 170px 40px;\n display: block;\n height: 40px;\n width: 170px;\n opacity: 0.5;\n}\n\n.ag-watermark-text {\n opacity: 0.5;\n font-weight: bold;\n font-family: Impact, sans-serif;\n font-size: 19px;\n padding-left: 0.7rem;\n}\n\n.ag-root-wrapper-body {\n display: flex;\n flex-direction: row;\n}\n.ag-root-wrapper-body.ag-layout-normal {\n flex: 1 1 auto;\n height: 0;\n min-height: 0;\n}\n\n.ag-root {\n position: relative;\n display: flex;\n flex-direction: column;\n}\n.ag-root.ag-layout-normal, .ag-root.ag-layout-auto-height {\n overflow: hidden;\n flex: 1 1 auto;\n width: 0;\n}\n.ag-root.ag-layout-normal {\n height: 100%;\n}\n\n.ag-header-viewport,\n.ag-floating-top-viewport,\n.ag-body-viewport,\n.ag-center-cols-viewport,\n.ag-floating-bottom-viewport,\n.ag-body-horizontal-scroll-viewport,\n.ag-body-vertical-scroll-viewport,\n.ag-virtual-list-viewport,\n.ag-sticky-top-viewport {\n position: relative;\n height: 100%;\n min-width: 0px;\n overflow: hidden;\n flex: 1 1 auto;\n}\n\n.ag-body-viewport {\n display: flex;\n}\n.ag-body-viewport.ag-layout-normal {\n overflow-y: auto;\n -webkit-overflow-scrolling: touch;\n}\n\n.ag-center-cols-viewport {\n width: 100%;\n overflow-x: auto;\n}\n\n.ag-body-horizontal-scroll-viewport {\n overflow-x: scroll;\n}\n\n.ag-body-vertical-scroll-viewport {\n overflow-y: scroll;\n}\n\n.ag-virtual-list-viewport {\n overflow: auto;\n width: 100%;\n}\n\n.ag-header-container,\n.ag-floating-top-container,\n.ag-body-container,\n.ag-pinned-right-cols-container,\n.ag-center-cols-container,\n.ag-pinned-left-cols-container,\n.ag-floating-bottom-container,\n.ag-body-horizontal-scroll-container,\n.ag-body-vertical-scroll-container,\n.ag-full-width-container,\n.ag-floating-bottom-full-width-container,\n.ag-virtual-list-container,\n.ag-sticky-top-container {\n position: relative;\n}\n\n.ag-header-container,\n.ag-floating-top-container,\n.ag-floating-bottom-container,\n.ag-sticky-top-container {\n height: 100%;\n white-space: nowrap;\n}\n\n.ag-center-cols-container {\n display: block;\n}\n\n.ag-pinned-right-cols-container {\n display: block;\n}\n\n.ag-body-horizontal-scroll-container {\n height: 100%;\n}\n\n.ag-body-vertical-scroll-container {\n width: 100%;\n}\n\n.ag-full-width-container,\n.ag-floating-top-full-width-container,\n.ag-floating-bottom-full-width-container,\n.ag-sticky-top-full-width-container {\n position: absolute;\n top: 0px;\n left: 0px;\n pointer-events: none;\n}\n\n.ag-full-width-container {\n width: 100%;\n}\n\n.ag-floating-bottom-full-width-container, .ag-floating-top-full-width-container {\n display: inline-block;\n overflow: hidden;\n height: 100%;\n width: 100%;\n}\n\n.ag-virtual-list-container {\n overflow: hidden;\n}\n\n.ag-center-cols-clipper {\n flex: 1 1 auto;\n min-width: 0;\n overflow: hidden;\n min-height: 100%;\n transform: translate3d(0, 0, 0);\n}\n\n.ag-body {\n position: relative;\n display: flex;\n flex: 1 1 auto;\n flex-direction: row !important;\n min-height: 0;\n}\n\n.ag-body-clipper {\n overflow: hidden;\n min-width: 0px;\n flex: 1 1 auto;\n height: 100%;\n transform: translate3d(0, 0, 0);\n}\n\n.ag-body-horizontal-scroll,\n.ag-body-vertical-scroll {\n min-height: 0;\n min-width: 0;\n display: flex;\n position: relative;\n}\n.ag-body-horizontal-scroll.ag-scrollbar-invisible,\n.ag-body-vertical-scroll.ag-scrollbar-invisible {\n position: absolute;\n bottom: 0;\n}\n.ag-body-horizontal-scroll.ag-scrollbar-invisible.ag-apple-scrollbar,\n.ag-body-vertical-scroll.ag-scrollbar-invisible.ag-apple-scrollbar {\n opacity: 0;\n transition: opacity 400ms;\n visibility: hidden;\n}\n.ag-body-horizontal-scroll.ag-scrollbar-invisible.ag-apple-scrollbar.ag-scrollbar-scrolling, .ag-body-horizontal-scroll.ag-scrollbar-invisible.ag-apple-scrollbar.ag-scrollbar-active,\n.ag-body-vertical-scroll.ag-scrollbar-invisible.ag-apple-scrollbar.ag-scrollbar-scrolling,\n.ag-body-vertical-scroll.ag-scrollbar-invisible.ag-apple-scrollbar.ag-scrollbar-active {\n visibility: visible;\n opacity: 1;\n}\n\n.ag-body-horizontal-scroll {\n width: 100%;\n}\n.ag-body-horizontal-scroll.ag-scrollbar-invisible {\n left: 0;\n right: 0;\n}\n\n.ag-body-vertical-scroll {\n height: 100%;\n}\n.ag-body-vertical-scroll.ag-scrollbar-invisible {\n top: 0;\n z-index: 10;\n}\n.ag-ltr .ag-body-vertical-scroll.ag-scrollbar-invisible {\n right: 0;\n}\n.ag-rtl .ag-body-vertical-scroll.ag-scrollbar-invisible {\n left: 0;\n}\n\n.ag-force-vertical-scroll {\n overflow-y: scroll !important;\n}\n\n.ag-horizontal-left-spacer, .ag-horizontal-right-spacer {\n height: 100%;\n min-width: 0;\n overflow-x: scroll;\n}\n.ag-horizontal-left-spacer.ag-scroller-corner, .ag-horizontal-right-spacer.ag-scroller-corner {\n overflow-x: hidden;\n}\n\n.ag-header, .ag-pinned-left-header, .ag-pinned-right-header {\n display: inline-block;\n overflow: hidden;\n position: relative;\n}\n\n.ag-header-cell-sortable {\n cursor: pointer;\n}\n\n.ag-header {\n display: flex;\n width: 100%;\n white-space: nowrap;\n}\n\n.ag-pinned-left-header {\n height: 100%;\n}\n\n.ag-pinned-right-header {\n height: 100%;\n}\n\n.ag-header-row {\n position: absolute;\n overflow: hidden;\n}\n\n.ag-header.ag-header-allow-overflow .ag-header-row {\n overflow: visible;\n}\n\n.ag-header-cell {\n display: inline-flex;\n align-items: center;\n position: absolute;\n height: 100%;\n overflow: hidden;\n}\n\n.ag-header-cell.ag-header-active .ag-header-cell-menu-button {\n opacity: 1;\n}\n\n.ag-header-cell-menu-button:not(.ag-header-menu-always-show) {\n transition: opacity 0.2s;\n opacity: 0;\n}\n\n.ag-header-group-cell-label, .ag-header-cell-label {\n display: flex;\n flex: 1 1 auto;\n overflow: hidden;\n align-items: center;\n text-overflow: ellipsis;\n align-self: stretch;\n}\n\n.ag-header-cell-text {\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.ag-header-cell:not(.ag-header-cell-auto-height) .ag-header-cell-comp-wrapper {\n height: 100%;\n display: flex;\n align-items: center;\n}\n\n.ag-header-cell-comp-wrapper {\n width: 100%;\n overflow: hidden;\n}\n\n.ag-header-cell-wrap-text .ag-header-cell-comp-wrapper {\n white-space: normal;\n}\n\n.ag-right-aligned-header .ag-header-cell-label {\n flex-direction: row-reverse;\n}\n\n.ag-header-group-text {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.ag-header-cell-resize {\n position: absolute;\n z-index: 2;\n height: 100%;\n width: 8px;\n top: 0;\n cursor: ew-resize;\n}\n.ag-ltr .ag-header-cell-resize {\n right: -4px;\n}\n.ag-rtl .ag-header-cell-resize {\n left: -4px;\n}\n\n.ag-pinned-left-header .ag-header-cell-resize {\n right: -4px;\n}\n\n.ag-pinned-right-header .ag-header-cell-resize {\n left: -4px;\n}\n\n.ag-header-select-all {\n display: flex;\n}\n\n.ag-column-moving .ag-cell {\n transition: left 0.2s;\n}\n.ag-column-moving .ag-header-cell {\n transition: left 0.2s;\n}\n.ag-column-moving .ag-header-group-cell {\n transition: left 0.2s, width 0.2s;\n}\n\n.ag-column-panel {\n display: flex;\n flex-direction: column;\n overflow: hidden;\n flex: 1 1 auto;\n}\n\n.ag-column-select {\n position: relative;\n display: flex;\n flex-direction: column;\n overflow: hidden;\n flex: 3 1 0px;\n}\n\n.ag-column-select-header {\n position: relative;\n display: flex;\n flex: none;\n}\n\n.ag-column-select-header-icon {\n position: relative;\n}\n\n.ag-column-select-header-filter-wrapper {\n flex: 1 1 auto;\n}\n\n.ag-column-select-header-filter {\n width: 100%;\n}\n\n.ag-column-select-list {\n flex: 1 1 0px;\n overflow: hidden;\n}\n\n.ag-column-drop {\n position: relative;\n display: inline-flex;\n align-items: center;\n overflow: auto;\n width: 100%;\n}\n\n.ag-column-drop-list {\n display: flex;\n align-items: center;\n}\n\n.ag-column-drop-cell {\n position: relative;\n display: flex;\n align-items: center;\n}\n\n.ag-column-drop-cell-text {\n overflow: hidden;\n flex: 1 1 auto;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.ag-column-drop-vertical {\n display: flex;\n flex-direction: column;\n overflow: hidden;\n align-items: stretch;\n flex: 1 1 0px;\n}\n\n.ag-column-drop-vertical-title-bar {\n display: flex;\n align-items: center;\n flex: none;\n}\n\n.ag-column-drop-vertical-list {\n position: relative;\n align-items: stretch;\n flex-grow: 1;\n flex-direction: column;\n overflow-x: auto;\n}\n.ag-column-drop-vertical-list > * {\n flex: none;\n}\n\n.ag-column-drop-empty .ag-column-drop-vertical-list {\n overflow: hidden;\n}\n\n.ag-column-drop-vertical-empty-message {\n display: block;\n}\n\n.ag-column-drop.ag-column-drop-horizontal {\n white-space: nowrap;\n overflow: hidden;\n}\n\n.ag-column-drop-cell-button {\n cursor: pointer;\n}\n\n.ag-filter-toolpanel {\n flex: 1 1 0px;\n min-width: 0;\n}\n\n.ag-filter-toolpanel-header {\n position: relative;\n}\n\n.ag-filter-toolpanel-header, .ag-filter-toolpanel-search {\n display: flex;\n align-items: center;\n}\n.ag-filter-toolpanel-header > *, .ag-filter-toolpanel-search > * {\n display: flex;\n align-items: center;\n}\n\n.ag-filter-apply-panel {\n display: flex;\n justify-content: flex-end;\n overflow: hidden;\n}\n\n.ag-row-animation .ag-row {\n transition: transform 0.4s, top 0.4s, background-color 0.1s, opacity 0.2s;\n}\n\n.ag-row-animation .ag-row.ag-after-created {\n transition: transform 0.4s, top 0.4s, height 0.4s, background-color 0.1s, opacity 0.2s;\n}\n\n.ag-row-no-animation .ag-row {\n transition: background-color 0.1s;\n}\n\n.ag-row {\n white-space: nowrap;\n width: 100%;\n}\n\n.ag-row-loading {\n display: flex;\n align-items: center;\n}\n\n.ag-row-position-absolute {\n position: absolute;\n}\n\n.ag-row-position-relative {\n position: relative;\n}\n\n.ag-full-width-row {\n overflow: hidden;\n pointer-events: all;\n}\n\n.ag-row-inline-editing {\n z-index: 1;\n}\n\n.ag-row-dragging {\n z-index: 2;\n}\n\n.ag-stub-cell {\n display: flex;\n align-items: center;\n}\n\n.ag-cell {\n display: inline-block;\n position: absolute;\n white-space: nowrap;\n height: 100%;\n}\n\n.ag-cell-value {\n flex: 1 1 auto;\n}\n\n.ag-cell-value, .ag-group-value {\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.ag-cell-wrap-text {\n white-space: normal;\n word-break: break-all;\n}\n\n.ag-cell-wrapper {\n display: flex;\n align-items: center;\n}\n.ag-cell-wrapper.ag-row-group {\n align-items: flex-start;\n}\n\n.ag-sparkline-wrapper {\n position: absolute;\n height: 100%;\n width: 100%;\n left: 0;\n top: 0;\n}\n\n.ag-full-width-row .ag-cell-wrapper.ag-row-group {\n height: 100%;\n align-items: center;\n}\n\n.ag-cell-inline-editing {\n z-index: 1;\n}\n.ag-cell-inline-editing .ag-cell-wrapper,\n.ag-cell-inline-editing .ag-cell-edit-wrapper,\n.ag-cell-inline-editing .ag-cell-editor,\n.ag-cell-inline-editing .ag-cell-editor .ag-wrapper,\n.ag-cell-inline-editing .ag-cell-editor input {\n height: 100%;\n width: 100%;\n line-height: normal;\n}\n\n.ag-cell .ag-icon {\n display: inline-block;\n vertical-align: middle;\n}\n\n.ag-set-filter-item {\n display: flex;\n align-items: center;\n height: 100%;\n}\n\n.ag-set-filter-item-checkbox {\n display: flex;\n overflow: hidden;\n}\n\n.ag-set-filter-group-icons {\n display: block;\n}\n.ag-set-filter-group-icons > * {\n cursor: pointer;\n}\n\n.ag-filter-body-wrapper {\n display: flex;\n flex-direction: column;\n}\n\n.ag-filter-filter {\n flex: 1 1 0px;\n}\n\n.ag-filter-condition {\n display: flex;\n justify-content: center;\n}\n\n.ag-floating-filter-body {\n position: relative;\n display: flex;\n flex: 1 1 auto;\n height: 100%;\n}\n\n.ag-floating-filter-full-body {\n display: flex;\n flex: 1 1 auto;\n height: 100%;\n width: 100%;\n align-items: center;\n overflow: hidden;\n}\n\n.ag-floating-filter-full-body > div {\n flex: 1 1 auto;\n}\n\n.ag-floating-filter-input {\n align-items: center;\n display: flex;\n width: 100%;\n}\n.ag-floating-filter-input > * {\n flex: 1 1 auto;\n}\n\n.ag-floating-filter-button {\n display: flex;\n flex: none;\n}\n\n.ag-dnd-ghost {\n position: absolute;\n display: inline-flex;\n align-items: center;\n cursor: move;\n white-space: nowrap;\n z-index: 9999;\n}\n\n.ag-overlay {\n height: 100%;\n left: 0;\n pointer-events: none;\n position: absolute;\n top: 0;\n width: 100%;\n}\n\n.ag-overlay-panel {\n display: flex;\n height: 100%;\n width: 100%;\n}\n\n.ag-overlay-wrapper {\n display: flex;\n flex: none;\n width: 100%;\n height: 100%;\n align-items: center;\n justify-content: center;\n text-align: center;\n}\n\n.ag-overlay-loading-wrapper {\n pointer-events: all;\n}\n\n.ag-popup-child {\n z-index: 5;\n top: 0;\n}\n\n.ag-popup-editor {\n position: absolute;\n user-select: none;\n z-index: 1;\n}\n\n.ag-large-text-input {\n display: block;\n}\n\n.ag-virtual-list-item {\n position: absolute;\n width: 100%;\n}\n\n.ag-floating-top {\n overflow: hidden;\n white-space: nowrap;\n width: 100%;\n position: relative;\n display: flex;\n}\n\n.ag-pinned-left-floating-top {\n display: inline-block;\n overflow: hidden;\n position: relative;\n min-width: 0px;\n}\n\n.ag-pinned-right-floating-top {\n display: inline-block;\n overflow: hidden;\n position: relative;\n min-width: 0px;\n}\n\n.ag-floating-bottom {\n overflow: hidden;\n white-space: nowrap;\n width: 100%;\n position: relative;\n display: flex;\n}\n\n.ag-pinned-left-floating-bottom {\n display: inline-block;\n overflow: hidden;\n position: relative;\n min-width: 0px;\n}\n\n.ag-pinned-right-floating-bottom {\n display: inline-block;\n overflow: hidden;\n position: relative;\n min-width: 0px;\n}\n\n.ag-sticky-top {\n position: absolute;\n display: flex;\n width: 100%;\n}\n\n.ag-pinned-left-sticky-top,\n.ag-pinned-right-sticky-top {\n position: relative;\n height: 100%;\n overflow: hidden;\n}\n\n.ag-sticky-top-full-width-container {\n overflow: hidden;\n width: 100%;\n height: 100%;\n}\n\n.ag-dialog, .ag-panel {\n display: flex;\n flex-direction: column;\n position: relative;\n overflow: hidden;\n}\n\n.ag-panel-title-bar {\n display: flex;\n flex: none;\n align-items: center;\n cursor: default;\n}\n\n.ag-panel-title-bar-title {\n flex: 1 1 auto;\n}\n\n.ag-panel-title-bar-buttons {\n display: flex;\n}\n\n.ag-panel-title-bar-button {\n cursor: pointer;\n}\n\n.ag-panel-content-wrapper {\n display: flex;\n flex: 1 1 auto;\n position: relative;\n overflow: hidden;\n}\n\n.ag-dialog {\n position: absolute;\n}\n\n.ag-resizer {\n position: absolute;\n pointer-events: none;\n user-select: none;\n z-index: 1;\n}\n.ag-resizer.ag-resizer-topLeft {\n top: 0;\n left: 0;\n height: 5px;\n width: 5px;\n cursor: nwse-resize;\n}\n.ag-resizer.ag-resizer-top {\n top: 0;\n left: 5px;\n right: 5px;\n height: 5px;\n cursor: ns-resize;\n}\n.ag-resizer.ag-resizer-topRight {\n top: 0;\n right: 0;\n height: 5px;\n width: 5px;\n cursor: nesw-resize;\n}\n.ag-resizer.ag-resizer-right {\n top: 5px;\n right: 0;\n bottom: 5px;\n width: 5px;\n cursor: ew-resize;\n}\n.ag-resizer.ag-resizer-bottomRight {\n bottom: 0;\n right: 0;\n height: 5px;\n width: 5px;\n cursor: nwse-resize;\n}\n.ag-resizer.ag-resizer-bottom {\n bottom: 0;\n left: 5px;\n right: 5px;\n height: 5px;\n cursor: ns-resize;\n}\n.ag-resizer.ag-resizer-bottomLeft {\n bottom: 0;\n left: 0;\n height: 5px;\n width: 5px;\n cursor: nesw-resize;\n}\n.ag-resizer.ag-resizer-left {\n left: 0;\n top: 5px;\n bottom: 5px;\n width: 5px;\n cursor: ew-resize;\n}\n\n.ag-tooltip {\n position: absolute;\n pointer-events: none;\n z-index: 99999;\n}\n\n.ag-tooltip-custom {\n position: absolute;\n pointer-events: none;\n z-index: 99999;\n}\n\n.ag-value-slide-out {\n margin-right: 5px;\n opacity: 1;\n transition: opacity 3s, margin-right 3s;\n transition-timing-function: linear;\n}\n\n.ag-value-slide-out-end {\n margin-right: 10px;\n opacity: 0;\n}\n\n.ag-opacity-zero {\n opacity: 0 !important;\n}\n\n.ag-menu {\n max-height: 100%;\n overflow-y: auto;\n position: absolute;\n user-select: none;\n}\n\n.ag-menu-column-select-wrapper {\n height: 265px;\n overflow: auto;\n}\n.ag-menu-column-select-wrapper .ag-column-select {\n height: 100%;\n}\n\n.ag-menu-list {\n display: table;\n width: 100%;\n}\n\n.ag-menu-option, .ag-menu-separator {\n display: table-row;\n}\n\n.ag-menu-option-part, .ag-menu-separator-part {\n display: table-cell;\n vertical-align: middle;\n}\n\n.ag-menu-option-text {\n white-space: nowrap;\n}\n\n.ag-compact-menu-option {\n width: 100%;\n display: flex;\n flex-wrap: nowrap;\n}\n\n.ag-compact-menu-option-text {\n white-space: nowrap;\n flex: 1 1 auto;\n}\n\n.ag-rich-select {\n cursor: default;\n outline: none;\n}\n\n.ag-rich-select-value {\n display: flex;\n align-items: center;\n}\n\n.ag-rich-select-value-icon {\n flex: 1 1 auto;\n order: 1;\n}\n.ag-ltr .ag-rich-select-value-icon {\n text-align: right;\n}\n.ag-rtl .ag-rich-select-value-icon {\n text-align: left;\n}\n\n.ag-rich-select-list {\n position: relative;\n}\n\n.ag-rich-select-virtual-list-item {\n display: flex;\n}\n\n.ag-rich-select-row {\n display: flex;\n flex: 1 1 auto;\n align-items: center;\n white-space: nowrap;\n overflow: hidden;\n}\n\n.ag-paging-panel {\n align-items: center;\n display: flex;\n justify-content: flex-end;\n}\n\n.ag-paging-page-summary-panel {\n display: flex;\n align-items: center;\n}\n\n.ag-paging-button {\n position: relative;\n}\n\n.ag-disabled .ag-paging-page-summary-panel {\n pointer-events: none;\n}\n\n.ag-tool-panel-wrapper {\n display: flex;\n overflow-y: auto;\n overflow-x: hidden;\n cursor: default;\n user-select: none;\n}\n\n.ag-column-select-column,\n.ag-column-select-column-group,\n.ag-select-agg-func-item {\n position: relative;\n align-items: center;\n display: flex;\n flex-direction: row;\n flex-wrap: nowrap;\n text-overflow: ellipsis;\n white-space: nowrap;\n height: 100%;\n}\n.ag-column-select-column > *,\n.ag-column-select-column-group > *,\n.ag-select-agg-func-item > * {\n flex: none;\n}\n\n.ag-column-select-checkbox {\n display: flex;\n}\n\n.ag-tool-panel-horizontal-resize {\n cursor: ew-resize;\n height: 100%;\n position: absolute;\n top: 0;\n width: 5px;\n z-index: 1;\n}\n\n.ag-ltr .ag-side-bar-left .ag-tool-panel-horizontal-resize {\n right: -3px;\n}\n.ag-rtl .ag-side-bar-left .ag-tool-panel-horizontal-resize {\n left: -3px;\n}\n\n.ag-ltr .ag-side-bar-right .ag-tool-panel-horizontal-resize {\n left: -3px;\n}\n.ag-rtl .ag-side-bar-right .ag-tool-panel-horizontal-resize {\n right: -3px;\n}\n\n.ag-details-row {\n width: 100%;\n}\n\n.ag-details-row-fixed-height {\n height: 100%;\n}\n\n.ag-details-grid {\n width: 100%;\n}\n\n.ag-details-grid-fixed-height {\n height: 100%;\n}\n\n.ag-header-group-cell {\n display: flex;\n align-items: center;\n height: 100%;\n position: absolute;\n}\n\n.ag-header-group-cell-no-group.ag-header-span-height .ag-header-cell-resize {\n display: none;\n}\n\n.ag-cell-label-container {\n display: flex;\n justify-content: space-between;\n flex-direction: row-reverse;\n align-items: center;\n height: 100%;\n width: 100%;\n overflow: hidden;\n padding: 5px 0px;\n}\n\n.ag-right-aligned-header .ag-cell-label-container {\n flex-direction: row;\n}\n.ag-right-aligned-header .ag-header-cell-text {\n text-align: end;\n}\n\n.ag-side-bar {\n display: flex;\n flex-direction: row-reverse;\n}\n\n.ag-side-bar-left {\n order: -1;\n flex-direction: row;\n}\n\n.ag-side-button-button {\n position: relative;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n flex-wrap: nowrap;\n white-space: nowrap;\n outline: none;\n cursor: pointer;\n}\n\n.ag-side-button-label {\n writing-mode: vertical-lr;\n}\n\n.ag-status-bar {\n display: flex;\n justify-content: space-between;\n overflow: hidden;\n}\n\n.ag-status-panel {\n display: inline-flex;\n}\n\n.ag-status-name-value {\n white-space: nowrap;\n}\n\n.ag-status-bar-left {\n display: inline-flex;\n}\n\n.ag-status-bar-center {\n display: inline-flex;\n}\n\n.ag-status-bar-right {\n display: inline-flex;\n}\n\n.ag-icon {\n display: block;\n speak: none;\n}\n\n.ag-group {\n position: relative;\n width: 100%;\n}\n\n.ag-group-title-bar {\n display: flex;\n align-items: center;\n}\n\n.ag-group-title {\n display: block;\n flex: 1 1 auto;\n min-width: 0;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n}\n\n.ag-group-title-bar .ag-group-title {\n cursor: default;\n}\n\n.ag-group-toolbar {\n display: flex;\n align-items: center;\n}\n\n.ag-group-container {\n display: flex;\n}\n\n.ag-disabled .ag-group-container {\n pointer-events: none;\n}\n\n.ag-group-container-horizontal {\n flex-direction: row;\n flex-wrap: wrap;\n}\n\n.ag-group-container-vertical {\n flex-direction: column;\n}\n\n.ag-column-group-icons {\n display: block;\n}\n.ag-column-group-icons > * {\n cursor: pointer;\n}\n\n.ag-group-item-alignment-stretch .ag-group-item {\n align-items: stretch;\n}\n\n.ag-group-item-alignment-start .ag-group-item {\n align-items: flex-start;\n}\n\n.ag-group-item-alignment-end .ag-group-item {\n align-items: flex-end;\n}\n\n.ag-toggle-button-icon {\n transition: right 0.3s;\n position: absolute;\n top: -1px;\n}\n\n.ag-input-field, .ag-select {\n display: flex;\n flex-direction: row;\n align-items: center;\n}\n\n.ag-input-field-input {\n flex: 1 1 auto;\n}\n\n.ag-floating-filter-input .ag-input-field-input[type=date] {\n width: 1px;\n}\n\n.ag-range-field {\n display: flex;\n align-items: center;\n}\n\n.ag-angle-select {\n display: flex;\n align-items: center;\n}\n\n.ag-angle-select-wrapper {\n display: flex;\n}\n\n.ag-angle-select-parent-circle {\n display: block;\n position: relative;\n}\n\n.ag-angle-select-child-circle {\n position: absolute;\n}\n\n.ag-slider-wrapper {\n display: flex;\n}\n.ag-slider-wrapper .ag-input-field {\n flex: 1 1 auto;\n}\n\n.ag-picker-field-display {\n flex: 1 1 auto;\n}\n\n.ag-picker-field {\n display: flex;\n align-items: center;\n}\n\n.ag-picker-field-icon {\n display: flex;\n border: 0;\n padding: 0;\n margin: 0;\n cursor: pointer;\n}\n\n.ag-picker-field-wrapper {\n overflow: hidden;\n}\n\n.ag-label-align-right .ag-label {\n order: 1;\n}\n.ag-label-align-right > * {\n flex: none;\n}\n\n.ag-label-align-top {\n flex-direction: column;\n align-items: flex-start;\n}\n.ag-label-align-top > * {\n align-self: stretch;\n}\n\n.ag-label-ellipsis {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n flex: 1;\n}\n\n.ag-color-panel {\n width: 100%;\n display: flex;\n flex-direction: column;\n text-align: center;\n}\n\n.ag-spectrum-color {\n flex: 1 1 auto;\n position: relative;\n overflow: hidden;\n cursor: default;\n}\n\n.ag-spectrum-fill {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n}\n\n.ag-spectrum-val {\n cursor: pointer;\n}\n\n.ag-spectrum-dragger {\n position: absolute;\n pointer-events: none;\n cursor: pointer;\n}\n\n.ag-spectrum-hue {\n cursor: default;\n background: linear-gradient(to left, #ff0000 3%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%);\n}\n\n.ag-spectrum-alpha {\n cursor: default;\n}\n\n.ag-spectrum-hue-background {\n width: 100%;\n height: 100%;\n}\n\n.ag-spectrum-alpha-background {\n background-image: linear-gradient(to right, rgba(0, 0, 0, 0), rgb(0, 0, 0));\n width: 100%;\n height: 100%;\n}\n\n.ag-spectrum-tool {\n cursor: pointer;\n}\n\n.ag-spectrum-slider {\n position: absolute;\n pointer-events: none;\n}\n\n.ag-recent-colors {\n display: flex;\n}\n\n.ag-recent-color {\n cursor: pointer;\n}\n\n.ag-ltr .ag-column-select-indent-1 {\n padding-left: 20px;\n}\n.ag-rtl .ag-column-select-indent-1 {\n padding-right: 20px;\n}\n\n.ag-ltr .ag-set-filter-indent-1 {\n padding-left: 20px;\n}\n.ag-rtl .ag-set-filter-indent-1 {\n padding-right: 20px;\n}\n\n.ag-ltr .ag-row-group-indent-1 {\n padding-left: 20px;\n}\n.ag-rtl .ag-row-group-indent-1 {\n padding-right: 20px;\n}\n\n.ag-ltr .ag-column-select-indent-2 {\n padding-left: 40px;\n}\n.ag-rtl .ag-column-select-indent-2 {\n padding-right: 40px;\n}\n\n.ag-ltr .ag-set-filter-indent-2 {\n padding-left: 40px;\n}\n.ag-rtl .ag-set-filter-indent-2 {\n padding-right: 40px;\n}\n\n.ag-ltr .ag-row-group-indent-2 {\n padding-left: 40px;\n}\n.ag-rtl .ag-row-group-indent-2 {\n padding-right: 40px;\n}\n\n.ag-ltr .ag-column-select-indent-3 {\n padding-left: 60px;\n}\n.ag-rtl .ag-column-select-indent-3 {\n padding-right: 60px;\n}\n\n.ag-ltr .ag-set-filter-indent-3 {\n padding-left: 60px;\n}\n.ag-rtl .ag-set-filter-indent-3 {\n padding-right: 60px;\n}\n\n.ag-ltr .ag-row-group-indent-3 {\n padding-left: 60px;\n}\n.ag-rtl .ag-row-group-indent-3 {\n padding-right: 60px;\n}\n\n.ag-ltr .ag-column-select-indent-4 {\n padding-left: 80px;\n}\n.ag-rtl .ag-column-select-indent-4 {\n padding-right: 80px;\n}\n\n.ag-ltr .ag-set-filter-indent-4 {\n padding-left: 80px;\n}\n.ag-rtl .ag-set-filter-indent-4 {\n padding-right: 80px;\n}\n\n.ag-ltr .ag-row-group-indent-4 {\n padding-left: 80px;\n}\n.ag-rtl .ag-row-group-indent-4 {\n padding-right: 80px;\n}\n\n.ag-ltr .ag-column-select-indent-5 {\n padding-left: 100px;\n}\n.ag-rtl .ag-column-select-indent-5 {\n padding-right: 100px;\n}\n\n.ag-ltr .ag-set-filter-indent-5 {\n padding-left: 100px;\n}\n.ag-rtl .ag-set-filter-indent-5 {\n padding-right: 100px;\n}\n\n.ag-ltr .ag-row-group-indent-5 {\n padding-left: 100px;\n}\n.ag-rtl .ag-row-group-indent-5 {\n padding-right: 100px;\n}\n\n.ag-ltr .ag-column-select-indent-6 {\n padding-left: 120px;\n}\n.ag-rtl .ag-column-select-indent-6 {\n padding-right: 120px;\n}\n\n.ag-ltr .ag-set-filter-indent-6 {\n padding-left: 120px;\n}\n.ag-rtl .ag-set-filter-indent-6 {\n padding-right: 120px;\n}\n\n.ag-ltr .ag-row-group-indent-6 {\n padding-left: 120px;\n}\n.ag-rtl .ag-row-group-indent-6 {\n padding-right: 120px;\n}\n\n.ag-ltr .ag-column-select-indent-7 {\n padding-left: 140px;\n}\n.ag-rtl .ag-column-select-indent-7 {\n padding-right: 140px;\n}\n\n.ag-ltr .ag-set-filter-indent-7 {\n padding-left: 140px;\n}\n.ag-rtl .ag-set-filter-indent-7 {\n padding-right: 140px;\n}\n\n.ag-ltr .ag-row-group-indent-7 {\n padding-left: 140px;\n}\n.ag-rtl .ag-row-group-indent-7 {\n padding-right: 140px;\n}\n\n.ag-ltr .ag-column-select-indent-8 {\n padding-left: 160px;\n}\n.ag-rtl .ag-column-select-indent-8 {\n padding-right: 160px;\n}\n\n.ag-ltr .ag-set-filter-indent-8 {\n padding-left: 160px;\n}\n.ag-rtl .ag-set-filter-indent-8 {\n padding-right: 160px;\n}\n\n.ag-ltr .ag-row-group-indent-8 {\n padding-left: 160px;\n}\n.ag-rtl .ag-row-group-indent-8 {\n padding-right: 160px;\n}\n\n.ag-ltr .ag-column-select-indent-9 {\n padding-left: 180px;\n}\n.ag-rtl .ag-column-select-indent-9 {\n padding-right: 180px;\n}\n\n.ag-ltr .ag-set-filter-indent-9 {\n padding-left: 180px;\n}\n.ag-rtl .ag-set-filter-indent-9 {\n padding-right: 180px;\n}\n\n.ag-ltr .ag-row-group-indent-9 {\n padding-left: 180px;\n}\n.ag-rtl .ag-row-group-indent-9 {\n padding-right: 180px;\n}\n\n.ag-ltr {\n direction: ltr;\n}\n.ag-ltr .ag-body, .ag-ltr .ag-floating-top, .ag-ltr .ag-floating-bottom, .ag-ltr .ag-header, .ag-ltr .ag-body-viewport, .ag-ltr .ag-body-horizontal-scroll {\n flex-direction: row;\n}\n\n.ag-rtl {\n direction: rtl;\n}\n.ag-rtl .ag-body, .ag-rtl .ag-floating-top, .ag-rtl .ag-floating-bottom, .ag-rtl .ag-header, .ag-rtl .ag-body-viewport, .ag-rtl .ag-body-horizontal-scroll {\n flex-direction: row-reverse;\n}\n.ag-rtl .ag-icon-contracted,\n.ag-rtl .ag-icon-expanded,\n.ag-rtl .ag-icon-tree-closed {\n display: block;\n transform: rotate(180deg);\n}\n\n.ag-body .ag-body-viewport {\n -webkit-overflow-scrolling: touch;\n}\n\n.ag-layout-print.ag-body {\n display: block;\n height: unset;\n}\n.ag-layout-print.ag-body-clipper {\n height: unset;\n}\n.ag-layout-print.ag-root-wrapper {\n display: inline-flex;\n}\n.ag-layout-print .ag-center-cols-clipper {\n min-width: 100%;\n}\n.ag-layout-print .ag-body-vertical-scroll {\n display: none;\n}\n.ag-layout-print .ag-body-horizontal-scroll {\n display: none;\n}\n.ag-layout-print.ag-force-vertical-scroll {\n overflow-y: visible !important;\n}\n\n@media print {\n .ag-root-wrapper.ag-layout-print {\n display: table;\n }\n .ag-root-wrapper.ag-layout-print .ag-root-wrapper-body,\n .ag-root-wrapper.ag-layout-print .ag-root,\n .ag-root-wrapper.ag-layout-print .ag-body-viewport,\n .ag-root-wrapper.ag-layout-print .ag-center-cols-container,\n .ag-root-wrapper.ag-layout-print .ag-center-cols-viewport,\n .ag-root-wrapper.ag-layout-print .ag-center-cols-clipper,\n .ag-root-wrapper.ag-layout-print .ag-body-horizontal-scroll-viewport,\n .ag-root-wrapper.ag-layout-print .ag-virtual-list-viewport {\n height: auto !important;\n overflow: hidden !important;\n display: block !important;\n }\n .ag-root-wrapper.ag-layout-print .ag-row, .ag-root-wrapper.ag-layout-print .ag-cell {\n break-inside: avoid;\n }\n}\n[class^=ag-], [class^=ag-]:focus, [class^=ag-]:after, [class^=ag-]:before {\n box-sizing: border-box;\n outline: none;\n}\n\n[class^=ag-]::-ms-clear {\n display: none;\n}\n\n.ag-checkbox .ag-input-wrapper,\n.ag-radio-button .ag-input-wrapper {\n overflow: visible;\n}\n\n.ag-range-field .ag-input-wrapper {\n height: 100%;\n}\n\n.ag-toggle-button {\n flex: none;\n width: unset;\n min-width: unset;\n}\n\n.ag-ltr .ag-label-align-right .ag-label {\n margin-left: var(--ag-grid-size);\n}\n.ag-rtl .ag-label-align-right .ag-label {\n margin-right: var(--ag-grid-size);\n}\n\ninput[class^=ag-] {\n margin: 0;\n background-color: var(--ag-background-color);\n}\n\ntextarea[class^=ag-],\nselect[class^=ag-] {\n background-color: var(--ag-background-color);\n}\n\ninput[class^=ag-]:not([type]),\ninput[class^=ag-][type=text],\ninput[class^=ag-][type=number],\ninput[class^=ag-][type=tel],\ninput[class^=ag-][type=date],\ninput[class^=ag-][type=datetime-local],\ntextarea[class^=ag-] {\n font-size: inherit;\n line-height: inherit;\n color: inherit;\n border: var(--ag-borders-input) var(--ag-input-border-color);\n}\ninput[class^=ag-]:not([type]):disabled,\ninput[class^=ag-][type=text]:disabled,\ninput[class^=ag-][type=number]:disabled,\ninput[class^=ag-][type=tel]:disabled,\ninput[class^=ag-][type=date]:disabled,\ninput[class^=ag-][type=datetime-local]:disabled,\ntextarea[class^=ag-]:disabled {\n color: var(--ag-disabled-foreground-color);\n background-color: var(--ag-input-disabled-background-color);\n border-color: var(--ag-input-disabled-border-color);\n}\ninput[class^=ag-]:not([type]):focus,\ninput[class^=ag-][type=text]:focus,\ninput[class^=ag-][type=number]:focus,\ninput[class^=ag-][type=tel]:focus,\ninput[class^=ag-][type=date]:focus,\ninput[class^=ag-][type=datetime-local]:focus,\ntextarea[class^=ag-]:focus {\n outline: none;\n box-shadow: var(--ag-input-focus-box-shadow);\n border-color: var(--ag-input-focus-border-color);\n}\ninput[class^=ag-]:not([type]):invalid,\ninput[class^=ag-][type=text]:invalid,\ninput[class^=ag-][type=number]:invalid,\ninput[class^=ag-][type=tel]:invalid,\ninput[class^=ag-][type=date]:invalid,\ninput[class^=ag-][type=datetime-local]:invalid,\ntextarea[class^=ag-]:invalid {\n border: var(--ag-borders-input-invalid) var(--ag-input-border-color-invalid);\n}\n\ninput[class^=ag-][type=number] {\n -moz-appearance: textfield;\n}\ninput[class^=ag-][type=number]::-webkit-outer-spin-button, input[class^=ag-][type=number]::-webkit-inner-spin-button {\n -webkit-appearance: none;\n margin: 0;\n}\n\ninput[class^=ag-][type=range] {\n padding: 0;\n}\n\ninput[class^=ag-][type=button]:focus, button[class^=ag-]:focus {\n box-shadow: var(--ag-input-focus-box-shadow);\n}\n\n.ag-drag-handle {\n color: var(--ag-secondary-foreground-color);\n}\n\n.ag-list-item, .ag-virtual-list-item {\n height: var(--ag-list-item-height);\n}\n\n.ag-keyboard-focus .ag-virtual-list-item:focus {\n outline: none;\n}\n.ag-keyboard-focus .ag-virtual-list-item:focus::after {\n content: \"\";\n position: absolute;\n background-color: transparent;\n pointer-events: none;\n top: 4px;\n left: 4px;\n display: block;\n width: calc(100% - 8px);\n height: calc(100% - 8px);\n border: 1px solid;\n border-color: var(--ag-input-focus-border-color);\n}\n\n.ag-select-list {\n background-color: var(--ag-background-color);\n overflow-y: auto;\n overflow-x: hidden;\n}\n\n.ag-list-item {\n display: flex;\n align-items: center;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.ag-list-item.ag-active-item {\n background-color: var(--ag-row-hover-color);\n}\n\n.ag-select-list-item {\n padding-left: 4px;\n padding-right: 4px;\n cursor: default;\n -moz-user-select: none;\n -webkit-user-select: none;\n -ms-user-select: none;\n user-select: none;\n}\n.ag-select-list-item span {\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n}\n\n.ag-select .ag-picker-field-wrapper {\n background-color: var(--ag-background-color);\n min-height: var(--ag-list-item-height);\n cursor: default;\n}\n.ag-select.ag-disabled .ag-picker-field-wrapper:focus {\n box-shadow: none;\n}\n.ag-select:not(.ag-cell-editor, .ag-label-align-top) {\n height: var(--ag-list-item-height);\n}\n.ag-select .ag-picker-field-display {\n margin: 4px;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.ag-select .ag-picker-field-icon {\n display: flex;\n align-items: center;\n}\n.ag-select.ag-disabled {\n opacity: 0.5;\n}\n\n.ag-rich-select {\n background-color: var(--ag-control-panel-background-color);\n}\n\n.ag-rich-select-list {\n width: 100%;\n min-width: 200px;\n height: calc(var(--ag-row-height) * 6.5);\n}\n\n.ag-rich-select-value {\n height: var(--ag-row-height);\n border-bottom: var(--ag-borders-secondary) var(--ag-secondary-border-color);\n padding-top: 0;\n padding-bottom: 0;\n}\n.ag-ltr .ag-rich-select-value {\n padding-left: var(--ag-cell-horizontal-padding);\n}\n.ag-rtl .ag-rich-select-value {\n padding-right: var(--ag-cell-horizontal-padding);\n}\n.ag-ltr .ag-rich-select-value {\n padding-right: var(--ag-grid-size);\n}\n.ag-rtl .ag-rich-select-value {\n padding-left: var(--ag-grid-size);\n}\n\n.ag-rich-select-virtual-list-item {\n cursor: default;\n height: var(--ag-list-item-height);\n}\n.ag-keyboard-focus .ag-rich-select-virtual-list-item:focus::after {\n content: none;\n}\n.ag-rich-select-virtual-list-item:hover {\n background-color: var(--ag-row-hover-color);\n}\n\n.ag-ltr .ag-rich-select-row {\n padding-left: var(--ag-cell-horizontal-padding);\n}\n.ag-rtl .ag-rich-select-row {\n padding-right: var(--ag-cell-horizontal-padding);\n}\n\n.ag-rich-select-row-selected {\n background-color: var(--ag-selected-row-background-color);\n}\n\n.ag-row-drag,\n.ag-selection-checkbox,\n.ag-group-expanded,\n.ag-group-contracted {\n color: var(--ag-secondary-foreground-color);\n}\n.ag-ltr .ag-row-drag,\n.ag-ltr .ag-selection-checkbox,\n.ag-ltr .ag-group-expanded,\n.ag-ltr .ag-group-contracted {\n margin-right: var(--ag-cell-widget-spacing);\n}\n.ag-rtl .ag-row-drag,\n.ag-rtl .ag-selection-checkbox,\n.ag-rtl .ag-group-expanded,\n.ag-rtl .ag-group-contracted {\n margin-left: var(--ag-cell-widget-spacing);\n}\n\n.ag-cell-wrapper > *:not(.ag-cell-value):not(.ag-group-value) {\n --ag-internal-calculated-line-height: var(--ag-line-height, calc(var(--ag-row-height) - var(--ag-row-border-width)));\n --ag-internal-padded-row-height: calc(var(--ag-row-height) - var(--ag-row-border-width));\n height: min(var(--ag-internal-calculated-line-height), var(--ag-internal-padded-row-height));\n display: flex;\n align-items: center;\n flex: none;\n}\n\n.ag-group-expanded,\n.ag-group-contracted {\n cursor: pointer;\n}\n\n.ag-group-title-bar-icon {\n cursor: pointer;\n flex: none;\n color: var(--ag-secondary-foreground-color);\n}\n\n.ag-ltr .ag-group-child-count {\n margin-left: 2px;\n}\n.ag-rtl .ag-group-child-count {\n margin-right: 2px;\n}\n\n.ag-group-title-bar {\n background-color: var(--ag-subheader-background-color);\n padding: var(--ag-grid-size);\n}\n\n.ag-group-toolbar {\n padding: var(--ag-grid-size);\n background-color: var(--ag-subheader-toolbar-background-color);\n}\n\n.ag-disabled-group-title-bar, .ag-disabled-group-container {\n opacity: 0.5;\n}\n\n.group-item {\n margin: calc(var(--ag-grid-size) * 0.5) 0;\n}\n\n.ag-label {\n white-space: nowrap;\n}\n.ag-ltr .ag-label {\n margin-right: var(--ag-grid-size);\n}\n.ag-rtl .ag-label {\n margin-left: var(--ag-grid-size);\n}\n\n.ag-label-align-top .ag-label {\n margin-bottom: calc(var(--ag-grid-size) * 0.5);\n}\n\n.ag-angle-select[disabled] {\n color: var(--ag-disabled-foreground-color);\n pointer-events: none;\n}\n.ag-angle-select[disabled] .ag-angle-select-field {\n opacity: 0.4;\n}\n\n.ag-ltr .ag-slider-field,\n.ag-ltr .ag-angle-select-field {\n margin-right: calc(var(--ag-grid-size) * 2);\n}\n.ag-rtl .ag-slider-field,\n.ag-rtl .ag-angle-select-field {\n margin-left: calc(var(--ag-grid-size) * 2);\n}\n\n.ag-angle-select-parent-circle {\n width: 24px;\n height: 24px;\n border-radius: 12px;\n border: solid 1px;\n border-color: var(--ag-border-color);\n background-color: var(--ag-background-color);\n}\n\n.ag-angle-select-child-circle {\n top: 4px;\n left: 12px;\n width: 6px;\n height: 6px;\n margin-left: -3px;\n margin-top: -4px;\n border-radius: 3px;\n background-color: var(--ag-secondary-foreground-color);\n}\n\n.ag-picker-field-wrapper {\n border: 1px solid;\n border-color: var(--ag-border-color);\n border-radius: 5px;\n}\n.ag-picker-field-wrapper:focus {\n box-shadow: var(--ag-input-focus-box-shadow);\n}\n\n.ag-picker-field-button {\n background-color: var(--ag-background-color);\n color: var(--ag-secondary-foreground-color);\n}\n\n.ag-dialog.ag-color-dialog {\n border-radius: 5px;\n}\n\n.ag-color-picker .ag-picker-field-display {\n height: var(--ag-icon-size);\n}\n\n.ag-color-panel {\n padding: var(--ag-grid-size);\n}\n\n.ag-spectrum-color {\n background-color: rgb(255, 0, 0);\n border-radius: 2px;\n}\n\n.ag-spectrum-tools {\n padding: 10px;\n}\n\n.ag-spectrum-sat {\n background-image: linear-gradient(to right, white, rgba(204, 154, 129, 0));\n}\n\n.ag-spectrum-val {\n background-image: linear-gradient(to top, black, rgba(204, 154, 129, 0));\n}\n\n.ag-spectrum-dragger {\n border-radius: 12px;\n height: 12px;\n width: 12px;\n border: 1px solid white;\n background: black;\n box-shadow: 0 0 2px 0px rgba(0, 0, 0, 0.24);\n}\n\n.ag-spectrum-hue-background {\n border-radius: 2px;\n}\n\n.ag-spectrum-alpha-background {\n border-radius: 2px;\n}\n\n.ag-spectrum-tool {\n margin-bottom: 10px;\n height: 11px;\n border-radius: 2px;\n}\n\n.ag-spectrum-slider {\n margin-top: -12px;\n width: 13px;\n height: 13px;\n border-radius: 13px;\n background-color: rgb(248, 248, 248);\n box-shadow: 0 1px 4px 0 rgba(0, 0, 0, 0.37);\n}\n\n.ag-recent-color {\n margin: 0 3px;\n}\n.ag-recent-color:first-child {\n margin-left: 0;\n}\n.ag-recent-color:last-child {\n margin-right: 0;\n}\n\n.ag-dnd-ghost {\n border: var(--ag-borders) var(--ag-border-color);\n background: var(--ag-background-color);\n border-radius: var(--ag-card-radius);\n box-shadow: var(--ag-card-shadow);\n padding: var(--ag-grid-size);\n overflow: hidden;\n text-overflow: ellipsis;\n border: var(--ag-borders-secondary) var(--ag-secondary-border-color);\n color: var(--ag-secondary-foreground-color);\n height: var(--ag-header-height) !important;\n line-height: var(--ag-header-height);\n margin: 0;\n padding: 0 calc(var(--ag-grid-size) * 2);\n transform: translateY(calc(var(--ag-grid-size) * 2));\n}\n\n.ag-dnd-ghost-icon {\n margin-right: var(--ag-grid-size);\n color: var(--ag-foreground-color);\n}\n\n.ag-popup-child:not(.ag-tooltip-custom) {\n box-shadow: var(--ag-popup-shadow);\n}\n\n.ag-dragging-range-handle .ag-dialog,\n.ag-dragging-fill-handle .ag-dialog {\n opacity: 0.7;\n pointer-events: none;\n}\n\n.ag-dialog {\n border-radius: var(--ag-border-radius);\n border: var(--ag-borders) var(--ag-border-color);\n}\n\n.ag-panel {\n background-color: var(--ag-background-color);\n}\n\n.ag-panel-title-bar {\n background-color: var(--ag-header-background-color);\n color: var(--ag-header-foreground-color);\n height: var(--ag-header-height);\n padding: var(--ag-grid-size) var(--ag-cell-horizontal-padding);\n border-bottom: var(--ag-borders) var(--ag-border-color);\n}\n\n.ag-ltr .ag-panel-title-bar-button {\n margin-left: var(--ag-grid-size);\n}\n.ag-rtl .ag-panel-title-bar-button {\n margin-right: var(--ag-grid-size);\n}\n\n.ag-tooltip {\n background-color: var(--ag-tooltip-background-color);\n color: var(--ag-foreground-color);\n padding: var(--ag-grid-size);\n border: var(--ag-borders) var(--ag-border-color);\n border-radius: var(--ag-card-radius);\n transition: opacity 1s;\n white-space: normal;\n}\n.ag-tooltip.ag-tooltip-hiding {\n opacity: 0;\n}\n\n.ag-tooltip-custom {\n transition: opacity 1s;\n}\n.ag-tooltip-custom.ag-tooltip-hiding {\n opacity: 0;\n}\n\n.ag-ltr .ag-column-select-indent-1 {\n padding-left: calc(1 * var(--ag-column-select-indent-size));\n}\n.ag-rtl .ag-column-select-indent-1 {\n padding-right: calc(1 * var(--ag-column-select-indent-size));\n}\n\n.ag-ltr .ag-column-select-indent-2 {\n padding-left: calc(2 * var(--ag-column-select-indent-size));\n}\n.ag-rtl .ag-column-select-indent-2 {\n padding-right: calc(2 * var(--ag-column-select-indent-size));\n}\n\n.ag-ltr .ag-column-select-indent-3 {\n padding-left: calc(3 * var(--ag-column-select-indent-size));\n}\n.ag-rtl .ag-column-select-indent-3 {\n padding-right: calc(3 * var(--ag-column-select-indent-size));\n}\n\n.ag-ltr .ag-column-select-indent-4 {\n padding-left: calc(4 * var(--ag-column-select-indent-size));\n}\n.ag-rtl .ag-column-select-indent-4 {\n padding-right: calc(4 * var(--ag-column-select-indent-size));\n}\n\n.ag-ltr .ag-column-select-indent-5 {\n padding-left: calc(5 * var(--ag-column-select-indent-size));\n}\n.ag-rtl .ag-column-select-indent-5 {\n padding-right: calc(5 * var(--ag-column-select-indent-size));\n}\n\n.ag-ltr .ag-column-select-indent-6 {\n padding-left: calc(6 * var(--ag-column-select-indent-size));\n}\n.ag-rtl .ag-column-select-indent-6 {\n padding-right: calc(6 * var(--ag-column-select-indent-size));\n}\n\n.ag-ltr .ag-column-select-indent-7 {\n padding-left: calc(7 * var(--ag-column-select-indent-size));\n}\n.ag-rtl .ag-column-select-indent-7 {\n padding-right: calc(7 * var(--ag-column-select-indent-size));\n}\n\n.ag-ltr .ag-column-select-indent-8 {\n padding-left: calc(8 * var(--ag-column-select-indent-size));\n}\n.ag-rtl .ag-column-select-indent-8 {\n padding-right: calc(8 * var(--ag-column-select-indent-size));\n}\n\n.ag-ltr .ag-column-select-indent-9 {\n padding-left: calc(9 * var(--ag-column-select-indent-size));\n}\n.ag-rtl .ag-column-select-indent-9 {\n padding-right: calc(9 * var(--ag-column-select-indent-size));\n}\n\n.ag-column-select-header-icon {\n cursor: pointer;\n}\n\n.ag-keyboard-focus .ag-column-select-header-icon:focus {\n outline: none;\n}\n.ag-keyboard-focus .ag-column-select-header-icon:focus::after {\n content: \"\";\n position: absolute;\n background-color: transparent;\n pointer-events: none;\n top: 0px;\n left: 0px;\n display: block;\n width: calc(100% - 0px);\n height: calc(100% - 0px);\n border: 1px solid;\n border-color: var(--ag-input-focus-border-color);\n}\n\n.ag-ltr .ag-column-group-icons:not(:last-child),\n.ag-ltr .ag-column-select-header-icon:not(:last-child),\n.ag-ltr .ag-column-select-header-checkbox:not(:last-child),\n.ag-ltr .ag-column-select-header-filter-wrapper:not(:last-child),\n.ag-ltr .ag-column-select-checkbox:not(:last-child),\n.ag-ltr .ag-column-select-column-drag-handle:not(:last-child),\n.ag-ltr .ag-column-select-column-group-drag-handle:not(:last-child),\n.ag-ltr .ag-column-select-column-label:not(:last-child) {\n margin-right: var(--ag-widget-horizontal-spacing);\n}\n.ag-rtl .ag-column-group-icons:not(:last-child),\n.ag-rtl .ag-column-select-header-icon:not(:last-child),\n.ag-rtl .ag-column-select-header-checkbox:not(:last-child),\n.ag-rtl .ag-column-select-header-filter-wrapper:not(:last-child),\n.ag-rtl .ag-column-select-checkbox:not(:last-child),\n.ag-rtl .ag-column-select-column-drag-handle:not(:last-child),\n.ag-rtl .ag-column-select-column-group-drag-handle:not(:last-child),\n.ag-rtl .ag-column-select-column-label:not(:last-child) {\n margin-left: var(--ag-widget-horizontal-spacing);\n}\n\n.ag-keyboard-focus .ag-column-select-virtual-list-item:focus {\n outline: none;\n}\n.ag-keyboard-focus .ag-column-select-virtual-list-item:focus::after {\n content: \"\";\n position: absolute;\n background-color: transparent;\n pointer-events: none;\n top: 1px;\n left: 1px;\n display: block;\n width: calc(100% - 2px);\n height: calc(100% - 2px);\n border: 1px solid;\n border-color: var(--ag-input-focus-border-color);\n}\n\n.ag-column-select-column-group:not(:last-child),\n.ag-column-select-column:not(:last-child) {\n margin-bottom: var(--ag-widget-vertical-spacing);\n}\n\n.ag-column-select-column-readonly,\n.ag-column-select-column-group-readonly {\n color: var(--ag-disabled-foreground-color);\n pointer-events: none;\n}\n\n.ag-ltr .ag-column-select-add-group-indent {\n margin-left: calc(var(--ag-icon-size) + var(--ag-grid-size) * 2);\n}\n.ag-rtl .ag-column-select-add-group-indent {\n margin-right: calc(var(--ag-icon-size) + var(--ag-grid-size) * 2);\n}\n\n.ag-column-select-virtual-list-viewport {\n padding: calc(var(--ag-widget-container-vertical-padding) * 0.5) 0px;\n}\n\n.ag-column-select-virtual-list-item {\n padding: 0 var(--ag-widget-container-horizontal-padding);\n}\n\n.ag-rtl {\n text-align: right;\n}\n\n.ag-root-wrapper {\n border: var(--ag-borders) var(--ag-border-color);\n}\n\n.ag-ltr .ag-row > .ag-cell-wrapper.ag-row-group-indent-1 {\n padding-left: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 1);\n}\n.ag-rtl .ag-row > .ag-cell-wrapper.ag-row-group-indent-1 {\n padding-right: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 1);\n}\n\n.ag-ltr .ag-row-group-indent-1 {\n padding-left: calc(1 * var(--ag-row-group-indent-size));\n}\n.ag-rtl .ag-row-group-indent-1 {\n padding-right: calc(1 * var(--ag-row-group-indent-size));\n}\n\n.ag-ltr .ag-row-level-1 .ag-pivot-leaf-group {\n margin-left: var(--ag-row-group-indent-size);\n}\n.ag-rtl .ag-row-level-1 .ag-pivot-leaf-group {\n margin-right: var(--ag-row-group-indent-size);\n}\n\n.ag-ltr .ag-row > .ag-cell-wrapper.ag-row-group-indent-2 {\n padding-left: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 2);\n}\n.ag-rtl .ag-row > .ag-cell-wrapper.ag-row-group-indent-2 {\n padding-right: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 2);\n}\n\n.ag-ltr .ag-row-group-indent-2 {\n padding-left: calc(2 * var(--ag-row-group-indent-size));\n}\n.ag-rtl .ag-row-group-indent-2 {\n padding-right: calc(2 * var(--ag-row-group-indent-size));\n}\n\n.ag-ltr .ag-row-level-2 .ag-pivot-leaf-group {\n margin-left: var(--ag-row-group-indent-size);\n}\n.ag-rtl .ag-row-level-2 .ag-pivot-leaf-group {\n margin-right: var(--ag-row-group-indent-size);\n}\n\n.ag-ltr .ag-row > .ag-cell-wrapper.ag-row-group-indent-3 {\n padding-left: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 3);\n}\n.ag-rtl .ag-row > .ag-cell-wrapper.ag-row-group-indent-3 {\n padding-right: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 3);\n}\n\n.ag-ltr .ag-row-group-indent-3 {\n padding-left: calc(3 * var(--ag-row-group-indent-size));\n}\n.ag-rtl .ag-row-group-indent-3 {\n padding-right: calc(3 * var(--ag-row-group-indent-size));\n}\n\n.ag-ltr .ag-row-level-3 .ag-pivot-leaf-group {\n margin-left: var(--ag-row-group-indent-size);\n}\n.ag-rtl .ag-row-level-3 .ag-pivot-leaf-group {\n margin-right: var(--ag-row-group-indent-size);\n}\n\n.ag-ltr .ag-row > .ag-cell-wrapper.ag-row-group-indent-4 {\n padding-left: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 4);\n}\n.ag-rtl .ag-row > .ag-cell-wrapper.ag-row-group-indent-4 {\n padding-right: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 4);\n}\n\n.ag-ltr .ag-row-group-indent-4 {\n padding-left: calc(4 * var(--ag-row-group-indent-size));\n}\n.ag-rtl .ag-row-group-indent-4 {\n padding-right: calc(4 * var(--ag-row-group-indent-size));\n}\n\n.ag-ltr .ag-row-level-4 .ag-pivot-leaf-group {\n margin-left: var(--ag-row-group-indent-size);\n}\n.ag-rtl .ag-row-level-4 .ag-pivot-leaf-group {\n margin-right: var(--ag-row-group-indent-size);\n}\n\n.ag-ltr .ag-row > .ag-cell-wrapper.ag-row-group-indent-5 {\n padding-left: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 5);\n}\n.ag-rtl .ag-row > .ag-cell-wrapper.ag-row-group-indent-5 {\n padding-right: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 5);\n}\n\n.ag-ltr .ag-row-group-indent-5 {\n padding-left: calc(5 * var(--ag-row-group-indent-size));\n}\n.ag-rtl .ag-row-group-indent-5 {\n padding-right: calc(5 * var(--ag-row-group-indent-size));\n}\n\n.ag-ltr .ag-row-level-5 .ag-pivot-leaf-group {\n margin-left: var(--ag-row-group-indent-size);\n}\n.ag-rtl .ag-row-level-5 .ag-pivot-leaf-group {\n margin-right: var(--ag-row-group-indent-size);\n}\n\n.ag-ltr .ag-row > .ag-cell-wrapper.ag-row-group-indent-6 {\n padding-left: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 6);\n}\n.ag-rtl .ag-row > .ag-cell-wrapper.ag-row-group-indent-6 {\n padding-right: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 6);\n}\n\n.ag-ltr .ag-row-group-indent-6 {\n padding-left: calc(6 * var(--ag-row-group-indent-size));\n}\n.ag-rtl .ag-row-group-indent-6 {\n padding-right: calc(6 * var(--ag-row-group-indent-size));\n}\n\n.ag-ltr .ag-row-level-6 .ag-pivot-leaf-group {\n margin-left: var(--ag-row-group-indent-size);\n}\n.ag-rtl .ag-row-level-6 .ag-pivot-leaf-group {\n margin-right: var(--ag-row-group-indent-size);\n}\n\n.ag-ltr .ag-row > .ag-cell-wrapper.ag-row-group-indent-7 {\n padding-left: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 7);\n}\n.ag-rtl .ag-row > .ag-cell-wrapper.ag-row-group-indent-7 {\n padding-right: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 7);\n}\n\n.ag-ltr .ag-row-group-indent-7 {\n padding-left: calc(7 * var(--ag-row-group-indent-size));\n}\n.ag-rtl .ag-row-group-indent-7 {\n padding-right: calc(7 * var(--ag-row-group-indent-size));\n}\n\n.ag-ltr .ag-row-level-7 .ag-pivot-leaf-group {\n margin-left: var(--ag-row-group-indent-size);\n}\n.ag-rtl .ag-row-level-7 .ag-pivot-leaf-group {\n margin-right: var(--ag-row-group-indent-size);\n}\n\n.ag-ltr .ag-row > .ag-cell-wrapper.ag-row-group-indent-8 {\n padding-left: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 8);\n}\n.ag-rtl .ag-row > .ag-cell-wrapper.ag-row-group-indent-8 {\n padding-right: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 8);\n}\n\n.ag-ltr .ag-row-group-indent-8 {\n padding-left: calc(8 * var(--ag-row-group-indent-size));\n}\n.ag-rtl .ag-row-group-indent-8 {\n padding-right: calc(8 * var(--ag-row-group-indent-size));\n}\n\n.ag-ltr .ag-row-level-8 .ag-pivot-leaf-group {\n margin-left: var(--ag-row-group-indent-size);\n}\n.ag-rtl .ag-row-level-8 .ag-pivot-leaf-group {\n margin-right: var(--ag-row-group-indent-size);\n}\n\n.ag-ltr .ag-row > .ag-cell-wrapper.ag-row-group-indent-9 {\n padding-left: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 9);\n}\n.ag-rtl .ag-row > .ag-cell-wrapper.ag-row-group-indent-9 {\n padding-right: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 9);\n}\n\n.ag-ltr .ag-row-group-indent-9 {\n padding-left: calc(9 * var(--ag-row-group-indent-size));\n}\n.ag-rtl .ag-row-group-indent-9 {\n padding-right: calc(9 * var(--ag-row-group-indent-size));\n}\n\n.ag-ltr .ag-row-level-9 .ag-pivot-leaf-group {\n margin-left: var(--ag-row-group-indent-size);\n}\n.ag-rtl .ag-row-level-9 .ag-pivot-leaf-group {\n margin-right: var(--ag-row-group-indent-size);\n}\n\n.ag-ltr .ag-row > .ag-cell-wrapper.ag-row-group-indent-10 {\n padding-left: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 10);\n}\n.ag-rtl .ag-row > .ag-cell-wrapper.ag-row-group-indent-10 {\n padding-right: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 10);\n}\n\n.ag-ltr .ag-row-group-indent-10 {\n padding-left: calc(10 * var(--ag-row-group-indent-size));\n}\n.ag-rtl .ag-row-group-indent-10 {\n padding-right: calc(10 * var(--ag-row-group-indent-size));\n}\n\n.ag-ltr .ag-row-level-10 .ag-pivot-leaf-group {\n margin-left: var(--ag-row-group-indent-size);\n}\n.ag-rtl .ag-row-level-10 .ag-pivot-leaf-group {\n margin-right: var(--ag-row-group-indent-size);\n}\n\n.ag-ltr .ag-row > .ag-cell-wrapper.ag-row-group-indent-11 {\n padding-left: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 11);\n}\n.ag-rtl .ag-row > .ag-cell-wrapper.ag-row-group-indent-11 {\n padding-right: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 11);\n}\n\n.ag-ltr .ag-row-group-indent-11 {\n padding-left: calc(11 * var(--ag-row-group-indent-size));\n}\n.ag-rtl .ag-row-group-indent-11 {\n padding-right: calc(11 * var(--ag-row-group-indent-size));\n}\n\n.ag-ltr .ag-row-level-11 .ag-pivot-leaf-group {\n margin-left: var(--ag-row-group-indent-size);\n}\n.ag-rtl .ag-row-level-11 .ag-pivot-leaf-group {\n margin-right: var(--ag-row-group-indent-size);\n}\n\n.ag-ltr .ag-row > .ag-cell-wrapper.ag-row-group-indent-12 {\n padding-left: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 12);\n}\n.ag-rtl .ag-row > .ag-cell-wrapper.ag-row-group-indent-12 {\n padding-right: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 12);\n}\n\n.ag-ltr .ag-row-group-indent-12 {\n padding-left: calc(12 * var(--ag-row-group-indent-size));\n}\n.ag-rtl .ag-row-group-indent-12 {\n padding-right: calc(12 * var(--ag-row-group-indent-size));\n}\n\n.ag-ltr .ag-row-level-12 .ag-pivot-leaf-group {\n margin-left: var(--ag-row-group-indent-size);\n}\n.ag-rtl .ag-row-level-12 .ag-pivot-leaf-group {\n margin-right: var(--ag-row-group-indent-size);\n}\n\n.ag-ltr .ag-row > .ag-cell-wrapper.ag-row-group-indent-13 {\n padding-left: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 13);\n}\n.ag-rtl .ag-row > .ag-cell-wrapper.ag-row-group-indent-13 {\n padding-right: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 13);\n}\n\n.ag-ltr .ag-row-group-indent-13 {\n padding-left: calc(13 * var(--ag-row-group-indent-size));\n}\n.ag-rtl .ag-row-group-indent-13 {\n padding-right: calc(13 * var(--ag-row-group-indent-size));\n}\n\n.ag-ltr .ag-row-level-13 .ag-pivot-leaf-group {\n margin-left: var(--ag-row-group-indent-size);\n}\n.ag-rtl .ag-row-level-13 .ag-pivot-leaf-group {\n margin-right: var(--ag-row-group-indent-size);\n}\n\n.ag-ltr .ag-row > .ag-cell-wrapper.ag-row-group-indent-14 {\n padding-left: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 14);\n}\n.ag-rtl .ag-row > .ag-cell-wrapper.ag-row-group-indent-14 {\n padding-right: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 14);\n}\n\n.ag-ltr .ag-row-group-indent-14 {\n padding-left: calc(14 * var(--ag-row-group-indent-size));\n}\n.ag-rtl .ag-row-group-indent-14 {\n padding-right: calc(14 * var(--ag-row-group-indent-size));\n}\n\n.ag-ltr .ag-row-level-14 .ag-pivot-leaf-group {\n margin-left: var(--ag-row-group-indent-size);\n}\n.ag-rtl .ag-row-level-14 .ag-pivot-leaf-group {\n margin-right: var(--ag-row-group-indent-size);\n}\n\n.ag-ltr .ag-row > .ag-cell-wrapper.ag-row-group-indent-15 {\n padding-left: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 15);\n}\n.ag-rtl .ag-row > .ag-cell-wrapper.ag-row-group-indent-15 {\n padding-right: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 15);\n}\n\n.ag-ltr .ag-row-group-indent-15 {\n padding-left: calc(15 * var(--ag-row-group-indent-size));\n}\n.ag-rtl .ag-row-group-indent-15 {\n padding-right: calc(15 * var(--ag-row-group-indent-size));\n}\n\n.ag-ltr .ag-row-level-15 .ag-pivot-leaf-group {\n margin-left: var(--ag-row-group-indent-size);\n}\n.ag-rtl .ag-row-level-15 .ag-pivot-leaf-group {\n margin-right: var(--ag-row-group-indent-size);\n}\n\n.ag-ltr .ag-row > .ag-cell-wrapper.ag-row-group-indent-16 {\n padding-left: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 16);\n}\n.ag-rtl .ag-row > .ag-cell-wrapper.ag-row-group-indent-16 {\n padding-right: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 16);\n}\n\n.ag-ltr .ag-row-group-indent-16 {\n padding-left: calc(16 * var(--ag-row-group-indent-size));\n}\n.ag-rtl .ag-row-group-indent-16 {\n padding-right: calc(16 * var(--ag-row-group-indent-size));\n}\n\n.ag-ltr .ag-row-level-16 .ag-pivot-leaf-group {\n margin-left: var(--ag-row-group-indent-size);\n}\n.ag-rtl .ag-row-level-16 .ag-pivot-leaf-group {\n margin-right: var(--ag-row-group-indent-size);\n}\n\n.ag-ltr .ag-row > .ag-cell-wrapper.ag-row-group-indent-17 {\n padding-left: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 17);\n}\n.ag-rtl .ag-row > .ag-cell-wrapper.ag-row-group-indent-17 {\n padding-right: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 17);\n}\n\n.ag-ltr .ag-row-group-indent-17 {\n padding-left: calc(17 * var(--ag-row-group-indent-size));\n}\n.ag-rtl .ag-row-group-indent-17 {\n padding-right: calc(17 * var(--ag-row-group-indent-size));\n}\n\n.ag-ltr .ag-row-level-17 .ag-pivot-leaf-group {\n margin-left: var(--ag-row-group-indent-size);\n}\n.ag-rtl .ag-row-level-17 .ag-pivot-leaf-group {\n margin-right: var(--ag-row-group-indent-size);\n}\n\n.ag-ltr .ag-row > .ag-cell-wrapper.ag-row-group-indent-18 {\n padding-left: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 18);\n}\n.ag-rtl .ag-row > .ag-cell-wrapper.ag-row-group-indent-18 {\n padding-right: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 18);\n}\n\n.ag-ltr .ag-row-group-indent-18 {\n padding-left: calc(18 * var(--ag-row-group-indent-size));\n}\n.ag-rtl .ag-row-group-indent-18 {\n padding-right: calc(18 * var(--ag-row-group-indent-size));\n}\n\n.ag-ltr .ag-row-level-18 .ag-pivot-leaf-group {\n margin-left: var(--ag-row-group-indent-size);\n}\n.ag-rtl .ag-row-level-18 .ag-pivot-leaf-group {\n margin-right: var(--ag-row-group-indent-size);\n}\n\n.ag-ltr .ag-row > .ag-cell-wrapper.ag-row-group-indent-19 {\n padding-left: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 19);\n}\n.ag-rtl .ag-row > .ag-cell-wrapper.ag-row-group-indent-19 {\n padding-right: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 19);\n}\n\n.ag-ltr .ag-row-group-indent-19 {\n padding-left: calc(19 * var(--ag-row-group-indent-size));\n}\n.ag-rtl .ag-row-group-indent-19 {\n padding-right: calc(19 * var(--ag-row-group-indent-size));\n}\n\n.ag-ltr .ag-row-level-19 .ag-pivot-leaf-group {\n margin-left: var(--ag-row-group-indent-size);\n}\n.ag-rtl .ag-row-level-19 .ag-pivot-leaf-group {\n margin-right: var(--ag-row-group-indent-size);\n}\n\n.ag-ltr .ag-row > .ag-cell-wrapper.ag-row-group-indent-20 {\n padding-left: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 20);\n}\n.ag-rtl .ag-row > .ag-cell-wrapper.ag-row-group-indent-20 {\n padding-right: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 20);\n}\n\n.ag-ltr .ag-row-group-indent-20 {\n padding-left: calc(20 * var(--ag-row-group-indent-size));\n}\n.ag-rtl .ag-row-group-indent-20 {\n padding-right: calc(20 * var(--ag-row-group-indent-size));\n}\n\n.ag-ltr .ag-row-level-20 .ag-pivot-leaf-group {\n margin-left: var(--ag-row-group-indent-size);\n}\n.ag-rtl .ag-row-level-20 .ag-pivot-leaf-group {\n margin-right: var(--ag-row-group-indent-size);\n}\n\n.ag-ltr .ag-row > .ag-cell-wrapper.ag-row-group-indent-21 {\n padding-left: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 21);\n}\n.ag-rtl .ag-row > .ag-cell-wrapper.ag-row-group-indent-21 {\n padding-right: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 21);\n}\n\n.ag-ltr .ag-row-group-indent-21 {\n padding-left: calc(21 * var(--ag-row-group-indent-size));\n}\n.ag-rtl .ag-row-group-indent-21 {\n padding-right: calc(21 * var(--ag-row-group-indent-size));\n}\n\n.ag-ltr .ag-row-level-21 .ag-pivot-leaf-group {\n margin-left: var(--ag-row-group-indent-size);\n}\n.ag-rtl .ag-row-level-21 .ag-pivot-leaf-group {\n margin-right: var(--ag-row-group-indent-size);\n}\n\n.ag-ltr .ag-row > .ag-cell-wrapper.ag-row-group-indent-22 {\n padding-left: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 22);\n}\n.ag-rtl .ag-row > .ag-cell-wrapper.ag-row-group-indent-22 {\n padding-right: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 22);\n}\n\n.ag-ltr .ag-row-group-indent-22 {\n padding-left: calc(22 * var(--ag-row-group-indent-size));\n}\n.ag-rtl .ag-row-group-indent-22 {\n padding-right: calc(22 * var(--ag-row-group-indent-size));\n}\n\n.ag-ltr .ag-row-level-22 .ag-pivot-leaf-group {\n margin-left: var(--ag-row-group-indent-size);\n}\n.ag-rtl .ag-row-level-22 .ag-pivot-leaf-group {\n margin-right: var(--ag-row-group-indent-size);\n}\n\n.ag-ltr .ag-row > .ag-cell-wrapper.ag-row-group-indent-23 {\n padding-left: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 23);\n}\n.ag-rtl .ag-row > .ag-cell-wrapper.ag-row-group-indent-23 {\n padding-right: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 23);\n}\n\n.ag-ltr .ag-row-group-indent-23 {\n padding-left: calc(23 * var(--ag-row-group-indent-size));\n}\n.ag-rtl .ag-row-group-indent-23 {\n padding-right: calc(23 * var(--ag-row-group-indent-size));\n}\n\n.ag-ltr .ag-row-level-23 .ag-pivot-leaf-group {\n margin-left: var(--ag-row-group-indent-size);\n}\n.ag-rtl .ag-row-level-23 .ag-pivot-leaf-group {\n margin-right: var(--ag-row-group-indent-size);\n}\n\n.ag-ltr .ag-row > .ag-cell-wrapper.ag-row-group-indent-24 {\n padding-left: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 24);\n}\n.ag-rtl .ag-row > .ag-cell-wrapper.ag-row-group-indent-24 {\n padding-right: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 24);\n}\n\n.ag-ltr .ag-row-group-indent-24 {\n padding-left: calc(24 * var(--ag-row-group-indent-size));\n}\n.ag-rtl .ag-row-group-indent-24 {\n padding-right: calc(24 * var(--ag-row-group-indent-size));\n}\n\n.ag-ltr .ag-row-level-24 .ag-pivot-leaf-group {\n margin-left: var(--ag-row-group-indent-size);\n}\n.ag-rtl .ag-row-level-24 .ag-pivot-leaf-group {\n margin-right: var(--ag-row-group-indent-size);\n}\n\n.ag-ltr .ag-row > .ag-cell-wrapper.ag-row-group-indent-25 {\n padding-left: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 25);\n}\n.ag-rtl .ag-row > .ag-cell-wrapper.ag-row-group-indent-25 {\n padding-right: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 25);\n}\n\n.ag-ltr .ag-row-group-indent-25 {\n padding-left: calc(25 * var(--ag-row-group-indent-size));\n}\n.ag-rtl .ag-row-group-indent-25 {\n padding-right: calc(25 * var(--ag-row-group-indent-size));\n}\n\n.ag-ltr .ag-row-level-25 .ag-pivot-leaf-group {\n margin-left: var(--ag-row-group-indent-size);\n}\n.ag-rtl .ag-row-level-25 .ag-pivot-leaf-group {\n margin-right: var(--ag-row-group-indent-size);\n}\n\n.ag-ltr .ag-row > .ag-cell-wrapper.ag-row-group-indent-26 {\n padding-left: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 26);\n}\n.ag-rtl .ag-row > .ag-cell-wrapper.ag-row-group-indent-26 {\n padding-right: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 26);\n}\n\n.ag-ltr .ag-row-group-indent-26 {\n padding-left: calc(26 * var(--ag-row-group-indent-size));\n}\n.ag-rtl .ag-row-group-indent-26 {\n padding-right: calc(26 * var(--ag-row-group-indent-size));\n}\n\n.ag-ltr .ag-row-level-26 .ag-pivot-leaf-group {\n margin-left: var(--ag-row-group-indent-size);\n}\n.ag-rtl .ag-row-level-26 .ag-pivot-leaf-group {\n margin-right: var(--ag-row-group-indent-size);\n}\n\n.ag-ltr .ag-row > .ag-cell-wrapper.ag-row-group-indent-27 {\n padding-left: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 27);\n}\n.ag-rtl .ag-row > .ag-cell-wrapper.ag-row-group-indent-27 {\n padding-right: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 27);\n}\n\n.ag-ltr .ag-row-group-indent-27 {\n padding-left: calc(27 * var(--ag-row-group-indent-size));\n}\n.ag-rtl .ag-row-group-indent-27 {\n padding-right: calc(27 * var(--ag-row-group-indent-size));\n}\n\n.ag-ltr .ag-row-level-27 .ag-pivot-leaf-group {\n margin-left: var(--ag-row-group-indent-size);\n}\n.ag-rtl .ag-row-level-27 .ag-pivot-leaf-group {\n margin-right: var(--ag-row-group-indent-size);\n}\n\n.ag-ltr .ag-row > .ag-cell-wrapper.ag-row-group-indent-28 {\n padding-left: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 28);\n}\n.ag-rtl .ag-row > .ag-cell-wrapper.ag-row-group-indent-28 {\n padding-right: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 28);\n}\n\n.ag-ltr .ag-row-group-indent-28 {\n padding-left: calc(28 * var(--ag-row-group-indent-size));\n}\n.ag-rtl .ag-row-group-indent-28 {\n padding-right: calc(28 * var(--ag-row-group-indent-size));\n}\n\n.ag-ltr .ag-row-level-28 .ag-pivot-leaf-group {\n margin-left: var(--ag-row-group-indent-size);\n}\n.ag-rtl .ag-row-level-28 .ag-pivot-leaf-group {\n margin-right: var(--ag-row-group-indent-size);\n}\n\n.ag-ltr .ag-row > .ag-cell-wrapper.ag-row-group-indent-29 {\n padding-left: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 29);\n}\n.ag-rtl .ag-row > .ag-cell-wrapper.ag-row-group-indent-29 {\n padding-right: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 29);\n}\n\n.ag-ltr .ag-row-group-indent-29 {\n padding-left: calc(29 * var(--ag-row-group-indent-size));\n}\n.ag-rtl .ag-row-group-indent-29 {\n padding-right: calc(29 * var(--ag-row-group-indent-size));\n}\n\n.ag-ltr .ag-row-level-29 .ag-pivot-leaf-group {\n margin-left: var(--ag-row-group-indent-size);\n}\n.ag-rtl .ag-row-level-29 .ag-pivot-leaf-group {\n margin-right: var(--ag-row-group-indent-size);\n}\n\n.ag-ltr .ag-row > .ag-cell-wrapper.ag-row-group-indent-30 {\n padding-left: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 30);\n}\n.ag-rtl .ag-row > .ag-cell-wrapper.ag-row-group-indent-30 {\n padding-right: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 30);\n}\n\n.ag-ltr .ag-row-group-indent-30 {\n padding-left: calc(30 * var(--ag-row-group-indent-size));\n}\n.ag-rtl .ag-row-group-indent-30 {\n padding-right: calc(30 * var(--ag-row-group-indent-size));\n}\n\n.ag-ltr .ag-row-level-30 .ag-pivot-leaf-group {\n margin-left: var(--ag-row-group-indent-size);\n}\n.ag-rtl .ag-row-level-30 .ag-pivot-leaf-group {\n margin-right: var(--ag-row-group-indent-size);\n}\n\n.ag-ltr .ag-row > .ag-cell-wrapper.ag-row-group-indent-31 {\n padding-left: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 31);\n}\n.ag-rtl .ag-row > .ag-cell-wrapper.ag-row-group-indent-31 {\n padding-right: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 31);\n}\n\n.ag-ltr .ag-row-group-indent-31 {\n padding-left: calc(31 * var(--ag-row-group-indent-size));\n}\n.ag-rtl .ag-row-group-indent-31 {\n padding-right: calc(31 * var(--ag-row-group-indent-size));\n}\n\n.ag-ltr .ag-row-level-31 .ag-pivot-leaf-group {\n margin-left: var(--ag-row-group-indent-size);\n}\n.ag-rtl .ag-row-level-31 .ag-pivot-leaf-group {\n margin-right: var(--ag-row-group-indent-size);\n}\n\n.ag-ltr .ag-row > .ag-cell-wrapper.ag-row-group-indent-32 {\n padding-left: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 32);\n}\n.ag-rtl .ag-row > .ag-cell-wrapper.ag-row-group-indent-32 {\n padding-right: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 32);\n}\n\n.ag-ltr .ag-row-group-indent-32 {\n padding-left: calc(32 * var(--ag-row-group-indent-size));\n}\n.ag-rtl .ag-row-group-indent-32 {\n padding-right: calc(32 * var(--ag-row-group-indent-size));\n}\n\n.ag-ltr .ag-row-level-32 .ag-pivot-leaf-group {\n margin-left: var(--ag-row-group-indent-size);\n}\n.ag-rtl .ag-row-level-32 .ag-pivot-leaf-group {\n margin-right: var(--ag-row-group-indent-size);\n}\n\n.ag-ltr .ag-row > .ag-cell-wrapper.ag-row-group-indent-33 {\n padding-left: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 33);\n}\n.ag-rtl .ag-row > .ag-cell-wrapper.ag-row-group-indent-33 {\n padding-right: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 33);\n}\n\n.ag-ltr .ag-row-group-indent-33 {\n padding-left: calc(33 * var(--ag-row-group-indent-size));\n}\n.ag-rtl .ag-row-group-indent-33 {\n padding-right: calc(33 * var(--ag-row-group-indent-size));\n}\n\n.ag-ltr .ag-row-level-33 .ag-pivot-leaf-group {\n margin-left: var(--ag-row-group-indent-size);\n}\n.ag-rtl .ag-row-level-33 .ag-pivot-leaf-group {\n margin-right: var(--ag-row-group-indent-size);\n}\n\n.ag-ltr .ag-row > .ag-cell-wrapper.ag-row-group-indent-34 {\n padding-left: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 34);\n}\n.ag-rtl .ag-row > .ag-cell-wrapper.ag-row-group-indent-34 {\n padding-right: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 34);\n}\n\n.ag-ltr .ag-row-group-indent-34 {\n padding-left: calc(34 * var(--ag-row-group-indent-size));\n}\n.ag-rtl .ag-row-group-indent-34 {\n padding-right: calc(34 * var(--ag-row-group-indent-size));\n}\n\n.ag-ltr .ag-row-level-34 .ag-pivot-leaf-group {\n margin-left: var(--ag-row-group-indent-size);\n}\n.ag-rtl .ag-row-level-34 .ag-pivot-leaf-group {\n margin-right: var(--ag-row-group-indent-size);\n}\n\n.ag-ltr .ag-row > .ag-cell-wrapper.ag-row-group-indent-35 {\n padding-left: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 35);\n}\n.ag-rtl .ag-row > .ag-cell-wrapper.ag-row-group-indent-35 {\n padding-right: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 35);\n}\n\n.ag-ltr .ag-row-group-indent-35 {\n padding-left: calc(35 * var(--ag-row-group-indent-size));\n}\n.ag-rtl .ag-row-group-indent-35 {\n padding-right: calc(35 * var(--ag-row-group-indent-size));\n}\n\n.ag-ltr .ag-row-level-35 .ag-pivot-leaf-group {\n margin-left: var(--ag-row-group-indent-size);\n}\n.ag-rtl .ag-row-level-35 .ag-pivot-leaf-group {\n margin-right: var(--ag-row-group-indent-size);\n}\n\n.ag-ltr .ag-row > .ag-cell-wrapper.ag-row-group-indent-36 {\n padding-left: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 36);\n}\n.ag-rtl .ag-row > .ag-cell-wrapper.ag-row-group-indent-36 {\n padding-right: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 36);\n}\n\n.ag-ltr .ag-row-group-indent-36 {\n padding-left: calc(36 * var(--ag-row-group-indent-size));\n}\n.ag-rtl .ag-row-group-indent-36 {\n padding-right: calc(36 * var(--ag-row-group-indent-size));\n}\n\n.ag-ltr .ag-row-level-36 .ag-pivot-leaf-group {\n margin-left: var(--ag-row-group-indent-size);\n}\n.ag-rtl .ag-row-level-36 .ag-pivot-leaf-group {\n margin-right: var(--ag-row-group-indent-size);\n}\n\n.ag-ltr .ag-row > .ag-cell-wrapper.ag-row-group-indent-37 {\n padding-left: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 37);\n}\n.ag-rtl .ag-row > .ag-cell-wrapper.ag-row-group-indent-37 {\n padding-right: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 37);\n}\n\n.ag-ltr .ag-row-group-indent-37 {\n padding-left: calc(37 * var(--ag-row-group-indent-size));\n}\n.ag-rtl .ag-row-group-indent-37 {\n padding-right: calc(37 * var(--ag-row-group-indent-size));\n}\n\n.ag-ltr .ag-row-level-37 .ag-pivot-leaf-group {\n margin-left: var(--ag-row-group-indent-size);\n}\n.ag-rtl .ag-row-level-37 .ag-pivot-leaf-group {\n margin-right: var(--ag-row-group-indent-size);\n}\n\n.ag-ltr .ag-row > .ag-cell-wrapper.ag-row-group-indent-38 {\n padding-left: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 38);\n}\n.ag-rtl .ag-row > .ag-cell-wrapper.ag-row-group-indent-38 {\n padding-right: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 38);\n}\n\n.ag-ltr .ag-row-group-indent-38 {\n padding-left: calc(38 * var(--ag-row-group-indent-size));\n}\n.ag-rtl .ag-row-group-indent-38 {\n padding-right: calc(38 * var(--ag-row-group-indent-size));\n}\n\n.ag-ltr .ag-row-level-38 .ag-pivot-leaf-group {\n margin-left: var(--ag-row-group-indent-size);\n}\n.ag-rtl .ag-row-level-38 .ag-pivot-leaf-group {\n margin-right: var(--ag-row-group-indent-size);\n}\n\n.ag-ltr .ag-row > .ag-cell-wrapper.ag-row-group-indent-39 {\n padding-left: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 39);\n}\n.ag-rtl .ag-row > .ag-cell-wrapper.ag-row-group-indent-39 {\n padding-right: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 39);\n}\n\n.ag-ltr .ag-row-group-indent-39 {\n padding-left: calc(39 * var(--ag-row-group-indent-size));\n}\n.ag-rtl .ag-row-group-indent-39 {\n padding-right: calc(39 * var(--ag-row-group-indent-size));\n}\n\n.ag-ltr .ag-row-level-39 .ag-pivot-leaf-group {\n margin-left: var(--ag-row-group-indent-size);\n}\n.ag-rtl .ag-row-level-39 .ag-pivot-leaf-group {\n margin-right: var(--ag-row-group-indent-size);\n}\n\n.ag-ltr .ag-row > .ag-cell-wrapper.ag-row-group-indent-40 {\n padding-left: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 40);\n}\n.ag-rtl .ag-row > .ag-cell-wrapper.ag-row-group-indent-40 {\n padding-right: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 40);\n}\n\n.ag-ltr .ag-row-group-indent-40 {\n padding-left: calc(40 * var(--ag-row-group-indent-size));\n}\n.ag-rtl .ag-row-group-indent-40 {\n padding-right: calc(40 * var(--ag-row-group-indent-size));\n}\n\n.ag-ltr .ag-row-level-40 .ag-pivot-leaf-group {\n margin-left: var(--ag-row-group-indent-size);\n}\n.ag-rtl .ag-row-level-40 .ag-pivot-leaf-group {\n margin-right: var(--ag-row-group-indent-size);\n}\n\n.ag-ltr .ag-row > .ag-cell-wrapper.ag-row-group-indent-41 {\n padding-left: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 41);\n}\n.ag-rtl .ag-row > .ag-cell-wrapper.ag-row-group-indent-41 {\n padding-right: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 41);\n}\n\n.ag-ltr .ag-row-group-indent-41 {\n padding-left: calc(41 * var(--ag-row-group-indent-size));\n}\n.ag-rtl .ag-row-group-indent-41 {\n padding-right: calc(41 * var(--ag-row-group-indent-size));\n}\n\n.ag-ltr .ag-row-level-41 .ag-pivot-leaf-group {\n margin-left: var(--ag-row-group-indent-size);\n}\n.ag-rtl .ag-row-level-41 .ag-pivot-leaf-group {\n margin-right: var(--ag-row-group-indent-size);\n}\n\n.ag-ltr .ag-row > .ag-cell-wrapper.ag-row-group-indent-42 {\n padding-left: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 42);\n}\n.ag-rtl .ag-row > .ag-cell-wrapper.ag-row-group-indent-42 {\n padding-right: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 42);\n}\n\n.ag-ltr .ag-row-group-indent-42 {\n padding-left: calc(42 * var(--ag-row-group-indent-size));\n}\n.ag-rtl .ag-row-group-indent-42 {\n padding-right: calc(42 * var(--ag-row-group-indent-size));\n}\n\n.ag-ltr .ag-row-level-42 .ag-pivot-leaf-group {\n margin-left: var(--ag-row-group-indent-size);\n}\n.ag-rtl .ag-row-level-42 .ag-pivot-leaf-group {\n margin-right: var(--ag-row-group-indent-size);\n}\n\n.ag-ltr .ag-row > .ag-cell-wrapper.ag-row-group-indent-43 {\n padding-left: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 43);\n}\n.ag-rtl .ag-row > .ag-cell-wrapper.ag-row-group-indent-43 {\n padding-right: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 43);\n}\n\n.ag-ltr .ag-row-group-indent-43 {\n padding-left: calc(43 * var(--ag-row-group-indent-size));\n}\n.ag-rtl .ag-row-group-indent-43 {\n padding-right: calc(43 * var(--ag-row-group-indent-size));\n}\n\n.ag-ltr .ag-row-level-43 .ag-pivot-leaf-group {\n margin-left: var(--ag-row-group-indent-size);\n}\n.ag-rtl .ag-row-level-43 .ag-pivot-leaf-group {\n margin-right: var(--ag-row-group-indent-size);\n}\n\n.ag-ltr .ag-row > .ag-cell-wrapper.ag-row-group-indent-44 {\n padding-left: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 44);\n}\n.ag-rtl .ag-row > .ag-cell-wrapper.ag-row-group-indent-44 {\n padding-right: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 44);\n}\n\n.ag-ltr .ag-row-group-indent-44 {\n padding-left: calc(44 * var(--ag-row-group-indent-size));\n}\n.ag-rtl .ag-row-group-indent-44 {\n padding-right: calc(44 * var(--ag-row-group-indent-size));\n}\n\n.ag-ltr .ag-row-level-44 .ag-pivot-leaf-group {\n margin-left: var(--ag-row-group-indent-size);\n}\n.ag-rtl .ag-row-level-44 .ag-pivot-leaf-group {\n margin-right: var(--ag-row-group-indent-size);\n}\n\n.ag-ltr .ag-row > .ag-cell-wrapper.ag-row-group-indent-45 {\n padding-left: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 45);\n}\n.ag-rtl .ag-row > .ag-cell-wrapper.ag-row-group-indent-45 {\n padding-right: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 45);\n}\n\n.ag-ltr .ag-row-group-indent-45 {\n padding-left: calc(45 * var(--ag-row-group-indent-size));\n}\n.ag-rtl .ag-row-group-indent-45 {\n padding-right: calc(45 * var(--ag-row-group-indent-size));\n}\n\n.ag-ltr .ag-row-level-45 .ag-pivot-leaf-group {\n margin-left: var(--ag-row-group-indent-size);\n}\n.ag-rtl .ag-row-level-45 .ag-pivot-leaf-group {\n margin-right: var(--ag-row-group-indent-size);\n}\n\n.ag-ltr .ag-row > .ag-cell-wrapper.ag-row-group-indent-46 {\n padding-left: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 46);\n}\n.ag-rtl .ag-row > .ag-cell-wrapper.ag-row-group-indent-46 {\n padding-right: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 46);\n}\n\n.ag-ltr .ag-row-group-indent-46 {\n padding-left: calc(46 * var(--ag-row-group-indent-size));\n}\n.ag-rtl .ag-row-group-indent-46 {\n padding-right: calc(46 * var(--ag-row-group-indent-size));\n}\n\n.ag-ltr .ag-row-level-46 .ag-pivot-leaf-group {\n margin-left: var(--ag-row-group-indent-size);\n}\n.ag-rtl .ag-row-level-46 .ag-pivot-leaf-group {\n margin-right: var(--ag-row-group-indent-size);\n}\n\n.ag-ltr .ag-row > .ag-cell-wrapper.ag-row-group-indent-47 {\n padding-left: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 47);\n}\n.ag-rtl .ag-row > .ag-cell-wrapper.ag-row-group-indent-47 {\n padding-right: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 47);\n}\n\n.ag-ltr .ag-row-group-indent-47 {\n padding-left: calc(47 * var(--ag-row-group-indent-size));\n}\n.ag-rtl .ag-row-group-indent-47 {\n padding-right: calc(47 * var(--ag-row-group-indent-size));\n}\n\n.ag-ltr .ag-row-level-47 .ag-pivot-leaf-group {\n margin-left: var(--ag-row-group-indent-size);\n}\n.ag-rtl .ag-row-level-47 .ag-pivot-leaf-group {\n margin-right: var(--ag-row-group-indent-size);\n}\n\n.ag-ltr .ag-row > .ag-cell-wrapper.ag-row-group-indent-48 {\n padding-left: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 48);\n}\n.ag-rtl .ag-row > .ag-cell-wrapper.ag-row-group-indent-48 {\n padding-right: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 48);\n}\n\n.ag-ltr .ag-row-group-indent-48 {\n padding-left: calc(48 * var(--ag-row-group-indent-size));\n}\n.ag-rtl .ag-row-group-indent-48 {\n padding-right: calc(48 * var(--ag-row-group-indent-size));\n}\n\n.ag-ltr .ag-row-level-48 .ag-pivot-leaf-group {\n margin-left: var(--ag-row-group-indent-size);\n}\n.ag-rtl .ag-row-level-48 .ag-pivot-leaf-group {\n margin-right: var(--ag-row-group-indent-size);\n}\n\n.ag-ltr .ag-row > .ag-cell-wrapper.ag-row-group-indent-49 {\n padding-left: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 49);\n}\n.ag-rtl .ag-row > .ag-cell-wrapper.ag-row-group-indent-49 {\n padding-right: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 49);\n}\n\n.ag-ltr .ag-row-group-indent-49 {\n padding-left: calc(49 * var(--ag-row-group-indent-size));\n}\n.ag-rtl .ag-row-group-indent-49 {\n padding-right: calc(49 * var(--ag-row-group-indent-size));\n}\n\n.ag-ltr .ag-row-level-49 .ag-pivot-leaf-group {\n margin-left: var(--ag-row-group-indent-size);\n}\n.ag-rtl .ag-row-level-49 .ag-pivot-leaf-group {\n margin-right: var(--ag-row-group-indent-size);\n}\n\n.ag-ltr .ag-row > .ag-cell-wrapper.ag-row-group-indent-50 {\n padding-left: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 50);\n}\n.ag-rtl .ag-row > .ag-cell-wrapper.ag-row-group-indent-50 {\n padding-right: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 50);\n}\n\n.ag-ltr .ag-row-group-indent-50 {\n padding-left: calc(50 * var(--ag-row-group-indent-size));\n}\n.ag-rtl .ag-row-group-indent-50 {\n padding-right: calc(50 * var(--ag-row-group-indent-size));\n}\n\n.ag-ltr .ag-row-level-50 .ag-pivot-leaf-group {\n margin-left: var(--ag-row-group-indent-size);\n}\n.ag-rtl .ag-row-level-50 .ag-pivot-leaf-group {\n margin-right: var(--ag-row-group-indent-size);\n}\n\n.ag-ltr .ag-row > .ag-cell-wrapper.ag-row-group-indent-51 {\n padding-left: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 51);\n}\n.ag-rtl .ag-row > .ag-cell-wrapper.ag-row-group-indent-51 {\n padding-right: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 51);\n}\n\n.ag-ltr .ag-row-group-indent-51 {\n padding-left: calc(51 * var(--ag-row-group-indent-size));\n}\n.ag-rtl .ag-row-group-indent-51 {\n padding-right: calc(51 * var(--ag-row-group-indent-size));\n}\n\n.ag-ltr .ag-row-level-51 .ag-pivot-leaf-group {\n margin-left: var(--ag-row-group-indent-size);\n}\n.ag-rtl .ag-row-level-51 .ag-pivot-leaf-group {\n margin-right: var(--ag-row-group-indent-size);\n}\n\n.ag-ltr .ag-row > .ag-cell-wrapper.ag-row-group-indent-52 {\n padding-left: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 52);\n}\n.ag-rtl .ag-row > .ag-cell-wrapper.ag-row-group-indent-52 {\n padding-right: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 52);\n}\n\n.ag-ltr .ag-row-group-indent-52 {\n padding-left: calc(52 * var(--ag-row-group-indent-size));\n}\n.ag-rtl .ag-row-group-indent-52 {\n padding-right: calc(52 * var(--ag-row-group-indent-size));\n}\n\n.ag-ltr .ag-row-level-52 .ag-pivot-leaf-group {\n margin-left: var(--ag-row-group-indent-size);\n}\n.ag-rtl .ag-row-level-52 .ag-pivot-leaf-group {\n margin-right: var(--ag-row-group-indent-size);\n}\n\n.ag-ltr .ag-row > .ag-cell-wrapper.ag-row-group-indent-53 {\n padding-left: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 53);\n}\n.ag-rtl .ag-row > .ag-cell-wrapper.ag-row-group-indent-53 {\n padding-right: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 53);\n}\n\n.ag-ltr .ag-row-group-indent-53 {\n padding-left: calc(53 * var(--ag-row-group-indent-size));\n}\n.ag-rtl .ag-row-group-indent-53 {\n padding-right: calc(53 * var(--ag-row-group-indent-size));\n}\n\n.ag-ltr .ag-row-level-53 .ag-pivot-leaf-group {\n margin-left: var(--ag-row-group-indent-size);\n}\n.ag-rtl .ag-row-level-53 .ag-pivot-leaf-group {\n margin-right: var(--ag-row-group-indent-size);\n}\n\n.ag-ltr .ag-row > .ag-cell-wrapper.ag-row-group-indent-54 {\n padding-left: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 54);\n}\n.ag-rtl .ag-row > .ag-cell-wrapper.ag-row-group-indent-54 {\n padding-right: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 54);\n}\n\n.ag-ltr .ag-row-group-indent-54 {\n padding-left: calc(54 * var(--ag-row-group-indent-size));\n}\n.ag-rtl .ag-row-group-indent-54 {\n padding-right: calc(54 * var(--ag-row-group-indent-size));\n}\n\n.ag-ltr .ag-row-level-54 .ag-pivot-leaf-group {\n margin-left: var(--ag-row-group-indent-size);\n}\n.ag-rtl .ag-row-level-54 .ag-pivot-leaf-group {\n margin-right: var(--ag-row-group-indent-size);\n}\n\n.ag-ltr .ag-row > .ag-cell-wrapper.ag-row-group-indent-55 {\n padding-left: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 55);\n}\n.ag-rtl .ag-row > .ag-cell-wrapper.ag-row-group-indent-55 {\n padding-right: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 55);\n}\n\n.ag-ltr .ag-row-group-indent-55 {\n padding-left: calc(55 * var(--ag-row-group-indent-size));\n}\n.ag-rtl .ag-row-group-indent-55 {\n padding-right: calc(55 * var(--ag-row-group-indent-size));\n}\n\n.ag-ltr .ag-row-level-55 .ag-pivot-leaf-group {\n margin-left: var(--ag-row-group-indent-size);\n}\n.ag-rtl .ag-row-level-55 .ag-pivot-leaf-group {\n margin-right: var(--ag-row-group-indent-size);\n}\n\n.ag-ltr .ag-row > .ag-cell-wrapper.ag-row-group-indent-56 {\n padding-left: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 56);\n}\n.ag-rtl .ag-row > .ag-cell-wrapper.ag-row-group-indent-56 {\n padding-right: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 56);\n}\n\n.ag-ltr .ag-row-group-indent-56 {\n padding-left: calc(56 * var(--ag-row-group-indent-size));\n}\n.ag-rtl .ag-row-group-indent-56 {\n padding-right: calc(56 * var(--ag-row-group-indent-size));\n}\n\n.ag-ltr .ag-row-level-56 .ag-pivot-leaf-group {\n margin-left: var(--ag-row-group-indent-size);\n}\n.ag-rtl .ag-row-level-56 .ag-pivot-leaf-group {\n margin-right: var(--ag-row-group-indent-size);\n}\n\n.ag-ltr .ag-row > .ag-cell-wrapper.ag-row-group-indent-57 {\n padding-left: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 57);\n}\n.ag-rtl .ag-row > .ag-cell-wrapper.ag-row-group-indent-57 {\n padding-right: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 57);\n}\n\n.ag-ltr .ag-row-group-indent-57 {\n padding-left: calc(57 * var(--ag-row-group-indent-size));\n}\n.ag-rtl .ag-row-group-indent-57 {\n padding-right: calc(57 * var(--ag-row-group-indent-size));\n}\n\n.ag-ltr .ag-row-level-57 .ag-pivot-leaf-group {\n margin-left: var(--ag-row-group-indent-size);\n}\n.ag-rtl .ag-row-level-57 .ag-pivot-leaf-group {\n margin-right: var(--ag-row-group-indent-size);\n}\n\n.ag-ltr .ag-row > .ag-cell-wrapper.ag-row-group-indent-58 {\n padding-left: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 58);\n}\n.ag-rtl .ag-row > .ag-cell-wrapper.ag-row-group-indent-58 {\n padding-right: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 58);\n}\n\n.ag-ltr .ag-row-group-indent-58 {\n padding-left: calc(58 * var(--ag-row-group-indent-size));\n}\n.ag-rtl .ag-row-group-indent-58 {\n padding-right: calc(58 * var(--ag-row-group-indent-size));\n}\n\n.ag-ltr .ag-row-level-58 .ag-pivot-leaf-group {\n margin-left: var(--ag-row-group-indent-size);\n}\n.ag-rtl .ag-row-level-58 .ag-pivot-leaf-group {\n margin-right: var(--ag-row-group-indent-size);\n}\n\n.ag-ltr .ag-row > .ag-cell-wrapper.ag-row-group-indent-59 {\n padding-left: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 59);\n}\n.ag-rtl .ag-row > .ag-cell-wrapper.ag-row-group-indent-59 {\n padding-right: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 59);\n}\n\n.ag-ltr .ag-row-group-indent-59 {\n padding-left: calc(59 * var(--ag-row-group-indent-size));\n}\n.ag-rtl .ag-row-group-indent-59 {\n padding-right: calc(59 * var(--ag-row-group-indent-size));\n}\n\n.ag-ltr .ag-row-level-59 .ag-pivot-leaf-group {\n margin-left: var(--ag-row-group-indent-size);\n}\n.ag-rtl .ag-row-level-59 .ag-pivot-leaf-group {\n margin-right: var(--ag-row-group-indent-size);\n}\n\n.ag-ltr .ag-row > .ag-cell-wrapper.ag-row-group-indent-60 {\n padding-left: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 60);\n}\n.ag-rtl .ag-row > .ag-cell-wrapper.ag-row-group-indent-60 {\n padding-right: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 60);\n}\n\n.ag-ltr .ag-row-group-indent-60 {\n padding-left: calc(60 * var(--ag-row-group-indent-size));\n}\n.ag-rtl .ag-row-group-indent-60 {\n padding-right: calc(60 * var(--ag-row-group-indent-size));\n}\n\n.ag-ltr .ag-row-level-60 .ag-pivot-leaf-group {\n margin-left: var(--ag-row-group-indent-size);\n}\n.ag-rtl .ag-row-level-60 .ag-pivot-leaf-group {\n margin-right: var(--ag-row-group-indent-size);\n}\n\n.ag-ltr .ag-row > .ag-cell-wrapper.ag-row-group-indent-61 {\n padding-left: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 61);\n}\n.ag-rtl .ag-row > .ag-cell-wrapper.ag-row-group-indent-61 {\n padding-right: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 61);\n}\n\n.ag-ltr .ag-row-group-indent-61 {\n padding-left: calc(61 * var(--ag-row-group-indent-size));\n}\n.ag-rtl .ag-row-group-indent-61 {\n padding-right: calc(61 * var(--ag-row-group-indent-size));\n}\n\n.ag-ltr .ag-row-level-61 .ag-pivot-leaf-group {\n margin-left: var(--ag-row-group-indent-size);\n}\n.ag-rtl .ag-row-level-61 .ag-pivot-leaf-group {\n margin-right: var(--ag-row-group-indent-size);\n}\n\n.ag-ltr .ag-row > .ag-cell-wrapper.ag-row-group-indent-62 {\n padding-left: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 62);\n}\n.ag-rtl .ag-row > .ag-cell-wrapper.ag-row-group-indent-62 {\n padding-right: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 62);\n}\n\n.ag-ltr .ag-row-group-indent-62 {\n padding-left: calc(62 * var(--ag-row-group-indent-size));\n}\n.ag-rtl .ag-row-group-indent-62 {\n padding-right: calc(62 * var(--ag-row-group-indent-size));\n}\n\n.ag-ltr .ag-row-level-62 .ag-pivot-leaf-group {\n margin-left: var(--ag-row-group-indent-size);\n}\n.ag-rtl .ag-row-level-62 .ag-pivot-leaf-group {\n margin-right: var(--ag-row-group-indent-size);\n}\n\n.ag-ltr .ag-row > .ag-cell-wrapper.ag-row-group-indent-63 {\n padding-left: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 63);\n}\n.ag-rtl .ag-row > .ag-cell-wrapper.ag-row-group-indent-63 {\n padding-right: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 63);\n}\n\n.ag-ltr .ag-row-group-indent-63 {\n padding-left: calc(63 * var(--ag-row-group-indent-size));\n}\n.ag-rtl .ag-row-group-indent-63 {\n padding-right: calc(63 * var(--ag-row-group-indent-size));\n}\n\n.ag-ltr .ag-row-level-63 .ag-pivot-leaf-group {\n margin-left: var(--ag-row-group-indent-size);\n}\n.ag-rtl .ag-row-level-63 .ag-pivot-leaf-group {\n margin-right: var(--ag-row-group-indent-size);\n}\n\n.ag-ltr .ag-row > .ag-cell-wrapper.ag-row-group-indent-64 {\n padding-left: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 64);\n}\n.ag-rtl .ag-row > .ag-cell-wrapper.ag-row-group-indent-64 {\n padding-right: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 64);\n}\n\n.ag-ltr .ag-row-group-indent-64 {\n padding-left: calc(64 * var(--ag-row-group-indent-size));\n}\n.ag-rtl .ag-row-group-indent-64 {\n padding-right: calc(64 * var(--ag-row-group-indent-size));\n}\n\n.ag-ltr .ag-row-level-64 .ag-pivot-leaf-group {\n margin-left: var(--ag-row-group-indent-size);\n}\n.ag-rtl .ag-row-level-64 .ag-pivot-leaf-group {\n margin-right: var(--ag-row-group-indent-size);\n}\n\n.ag-ltr .ag-row > .ag-cell-wrapper.ag-row-group-indent-65 {\n padding-left: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 65);\n}\n.ag-rtl .ag-row > .ag-cell-wrapper.ag-row-group-indent-65 {\n padding-right: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 65);\n}\n\n.ag-ltr .ag-row-group-indent-65 {\n padding-left: calc(65 * var(--ag-row-group-indent-size));\n}\n.ag-rtl .ag-row-group-indent-65 {\n padding-right: calc(65 * var(--ag-row-group-indent-size));\n}\n\n.ag-ltr .ag-row-level-65 .ag-pivot-leaf-group {\n margin-left: var(--ag-row-group-indent-size);\n}\n.ag-rtl .ag-row-level-65 .ag-pivot-leaf-group {\n margin-right: var(--ag-row-group-indent-size);\n}\n\n.ag-ltr .ag-row > .ag-cell-wrapper.ag-row-group-indent-66 {\n padding-left: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 66);\n}\n.ag-rtl .ag-row > .ag-cell-wrapper.ag-row-group-indent-66 {\n padding-right: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 66);\n}\n\n.ag-ltr .ag-row-group-indent-66 {\n padding-left: calc(66 * var(--ag-row-group-indent-size));\n}\n.ag-rtl .ag-row-group-indent-66 {\n padding-right: calc(66 * var(--ag-row-group-indent-size));\n}\n\n.ag-ltr .ag-row-level-66 .ag-pivot-leaf-group {\n margin-left: var(--ag-row-group-indent-size);\n}\n.ag-rtl .ag-row-level-66 .ag-pivot-leaf-group {\n margin-right: var(--ag-row-group-indent-size);\n}\n\n.ag-ltr .ag-row > .ag-cell-wrapper.ag-row-group-indent-67 {\n padding-left: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 67);\n}\n.ag-rtl .ag-row > .ag-cell-wrapper.ag-row-group-indent-67 {\n padding-right: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 67);\n}\n\n.ag-ltr .ag-row-group-indent-67 {\n padding-left: calc(67 * var(--ag-row-group-indent-size));\n}\n.ag-rtl .ag-row-group-indent-67 {\n padding-right: calc(67 * var(--ag-row-group-indent-size));\n}\n\n.ag-ltr .ag-row-level-67 .ag-pivot-leaf-group {\n margin-left: var(--ag-row-group-indent-size);\n}\n.ag-rtl .ag-row-level-67 .ag-pivot-leaf-group {\n margin-right: var(--ag-row-group-indent-size);\n}\n\n.ag-ltr .ag-row > .ag-cell-wrapper.ag-row-group-indent-68 {\n padding-left: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 68);\n}\n.ag-rtl .ag-row > .ag-cell-wrapper.ag-row-group-indent-68 {\n padding-right: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 68);\n}\n\n.ag-ltr .ag-row-group-indent-68 {\n padding-left: calc(68 * var(--ag-row-group-indent-size));\n}\n.ag-rtl .ag-row-group-indent-68 {\n padding-right: calc(68 * var(--ag-row-group-indent-size));\n}\n\n.ag-ltr .ag-row-level-68 .ag-pivot-leaf-group {\n margin-left: var(--ag-row-group-indent-size);\n}\n.ag-rtl .ag-row-level-68 .ag-pivot-leaf-group {\n margin-right: var(--ag-row-group-indent-size);\n}\n\n.ag-ltr .ag-row > .ag-cell-wrapper.ag-row-group-indent-69 {\n padding-left: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 69);\n}\n.ag-rtl .ag-row > .ag-cell-wrapper.ag-row-group-indent-69 {\n padding-right: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 69);\n}\n\n.ag-ltr .ag-row-group-indent-69 {\n padding-left: calc(69 * var(--ag-row-group-indent-size));\n}\n.ag-rtl .ag-row-group-indent-69 {\n padding-right: calc(69 * var(--ag-row-group-indent-size));\n}\n\n.ag-ltr .ag-row-level-69 .ag-pivot-leaf-group {\n margin-left: var(--ag-row-group-indent-size);\n}\n.ag-rtl .ag-row-level-69 .ag-pivot-leaf-group {\n margin-right: var(--ag-row-group-indent-size);\n}\n\n.ag-ltr .ag-row > .ag-cell-wrapper.ag-row-group-indent-70 {\n padding-left: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 70);\n}\n.ag-rtl .ag-row > .ag-cell-wrapper.ag-row-group-indent-70 {\n padding-right: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 70);\n}\n\n.ag-ltr .ag-row-group-indent-70 {\n padding-left: calc(70 * var(--ag-row-group-indent-size));\n}\n.ag-rtl .ag-row-group-indent-70 {\n padding-right: calc(70 * var(--ag-row-group-indent-size));\n}\n\n.ag-ltr .ag-row-level-70 .ag-pivot-leaf-group {\n margin-left: var(--ag-row-group-indent-size);\n}\n.ag-rtl .ag-row-level-70 .ag-pivot-leaf-group {\n margin-right: var(--ag-row-group-indent-size);\n}\n\n.ag-ltr .ag-row > .ag-cell-wrapper.ag-row-group-indent-71 {\n padding-left: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 71);\n}\n.ag-rtl .ag-row > .ag-cell-wrapper.ag-row-group-indent-71 {\n padding-right: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 71);\n}\n\n.ag-ltr .ag-row-group-indent-71 {\n padding-left: calc(71 * var(--ag-row-group-indent-size));\n}\n.ag-rtl .ag-row-group-indent-71 {\n padding-right: calc(71 * var(--ag-row-group-indent-size));\n}\n\n.ag-ltr .ag-row-level-71 .ag-pivot-leaf-group {\n margin-left: var(--ag-row-group-indent-size);\n}\n.ag-rtl .ag-row-level-71 .ag-pivot-leaf-group {\n margin-right: var(--ag-row-group-indent-size);\n}\n\n.ag-ltr .ag-row > .ag-cell-wrapper.ag-row-group-indent-72 {\n padding-left: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 72);\n}\n.ag-rtl .ag-row > .ag-cell-wrapper.ag-row-group-indent-72 {\n padding-right: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 72);\n}\n\n.ag-ltr .ag-row-group-indent-72 {\n padding-left: calc(72 * var(--ag-row-group-indent-size));\n}\n.ag-rtl .ag-row-group-indent-72 {\n padding-right: calc(72 * var(--ag-row-group-indent-size));\n}\n\n.ag-ltr .ag-row-level-72 .ag-pivot-leaf-group {\n margin-left: var(--ag-row-group-indent-size);\n}\n.ag-rtl .ag-row-level-72 .ag-pivot-leaf-group {\n margin-right: var(--ag-row-group-indent-size);\n}\n\n.ag-ltr .ag-row > .ag-cell-wrapper.ag-row-group-indent-73 {\n padding-left: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 73);\n}\n.ag-rtl .ag-row > .ag-cell-wrapper.ag-row-group-indent-73 {\n padding-right: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 73);\n}\n\n.ag-ltr .ag-row-group-indent-73 {\n padding-left: calc(73 * var(--ag-row-group-indent-size));\n}\n.ag-rtl .ag-row-group-indent-73 {\n padding-right: calc(73 * var(--ag-row-group-indent-size));\n}\n\n.ag-ltr .ag-row-level-73 .ag-pivot-leaf-group {\n margin-left: var(--ag-row-group-indent-size);\n}\n.ag-rtl .ag-row-level-73 .ag-pivot-leaf-group {\n margin-right: var(--ag-row-group-indent-size);\n}\n\n.ag-ltr .ag-row > .ag-cell-wrapper.ag-row-group-indent-74 {\n padding-left: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 74);\n}\n.ag-rtl .ag-row > .ag-cell-wrapper.ag-row-group-indent-74 {\n padding-right: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 74);\n}\n\n.ag-ltr .ag-row-group-indent-74 {\n padding-left: calc(74 * var(--ag-row-group-indent-size));\n}\n.ag-rtl .ag-row-group-indent-74 {\n padding-right: calc(74 * var(--ag-row-group-indent-size));\n}\n\n.ag-ltr .ag-row-level-74 .ag-pivot-leaf-group {\n margin-left: var(--ag-row-group-indent-size);\n}\n.ag-rtl .ag-row-level-74 .ag-pivot-leaf-group {\n margin-right: var(--ag-row-group-indent-size);\n}\n\n.ag-ltr .ag-row > .ag-cell-wrapper.ag-row-group-indent-75 {\n padding-left: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 75);\n}\n.ag-rtl .ag-row > .ag-cell-wrapper.ag-row-group-indent-75 {\n padding-right: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 75);\n}\n\n.ag-ltr .ag-row-group-indent-75 {\n padding-left: calc(75 * var(--ag-row-group-indent-size));\n}\n.ag-rtl .ag-row-group-indent-75 {\n padding-right: calc(75 * var(--ag-row-group-indent-size));\n}\n\n.ag-ltr .ag-row-level-75 .ag-pivot-leaf-group {\n margin-left: var(--ag-row-group-indent-size);\n}\n.ag-rtl .ag-row-level-75 .ag-pivot-leaf-group {\n margin-right: var(--ag-row-group-indent-size);\n}\n\n.ag-ltr .ag-row > .ag-cell-wrapper.ag-row-group-indent-76 {\n padding-left: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 76);\n}\n.ag-rtl .ag-row > .ag-cell-wrapper.ag-row-group-indent-76 {\n padding-right: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 76);\n}\n\n.ag-ltr .ag-row-group-indent-76 {\n padding-left: calc(76 * var(--ag-row-group-indent-size));\n}\n.ag-rtl .ag-row-group-indent-76 {\n padding-right: calc(76 * var(--ag-row-group-indent-size));\n}\n\n.ag-ltr .ag-row-level-76 .ag-pivot-leaf-group {\n margin-left: var(--ag-row-group-indent-size);\n}\n.ag-rtl .ag-row-level-76 .ag-pivot-leaf-group {\n margin-right: var(--ag-row-group-indent-size);\n}\n\n.ag-ltr .ag-row > .ag-cell-wrapper.ag-row-group-indent-77 {\n padding-left: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 77);\n}\n.ag-rtl .ag-row > .ag-cell-wrapper.ag-row-group-indent-77 {\n padding-right: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 77);\n}\n\n.ag-ltr .ag-row-group-indent-77 {\n padding-left: calc(77 * var(--ag-row-group-indent-size));\n}\n.ag-rtl .ag-row-group-indent-77 {\n padding-right: calc(77 * var(--ag-row-group-indent-size));\n}\n\n.ag-ltr .ag-row-level-77 .ag-pivot-leaf-group {\n margin-left: var(--ag-row-group-indent-size);\n}\n.ag-rtl .ag-row-level-77 .ag-pivot-leaf-group {\n margin-right: var(--ag-row-group-indent-size);\n}\n\n.ag-ltr .ag-row > .ag-cell-wrapper.ag-row-group-indent-78 {\n padding-left: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 78);\n}\n.ag-rtl .ag-row > .ag-cell-wrapper.ag-row-group-indent-78 {\n padding-right: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 78);\n}\n\n.ag-ltr .ag-row-group-indent-78 {\n padding-left: calc(78 * var(--ag-row-group-indent-size));\n}\n.ag-rtl .ag-row-group-indent-78 {\n padding-right: calc(78 * var(--ag-row-group-indent-size));\n}\n\n.ag-ltr .ag-row-level-78 .ag-pivot-leaf-group {\n margin-left: var(--ag-row-group-indent-size);\n}\n.ag-rtl .ag-row-level-78 .ag-pivot-leaf-group {\n margin-right: var(--ag-row-group-indent-size);\n}\n\n.ag-ltr .ag-row > .ag-cell-wrapper.ag-row-group-indent-79 {\n padding-left: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 79);\n}\n.ag-rtl .ag-row > .ag-cell-wrapper.ag-row-group-indent-79 {\n padding-right: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 79);\n}\n\n.ag-ltr .ag-row-group-indent-79 {\n padding-left: calc(79 * var(--ag-row-group-indent-size));\n}\n.ag-rtl .ag-row-group-indent-79 {\n padding-right: calc(79 * var(--ag-row-group-indent-size));\n}\n\n.ag-ltr .ag-row-level-79 .ag-pivot-leaf-group {\n margin-left: var(--ag-row-group-indent-size);\n}\n.ag-rtl .ag-row-level-79 .ag-pivot-leaf-group {\n margin-right: var(--ag-row-group-indent-size);\n}\n\n.ag-ltr .ag-row > .ag-cell-wrapper.ag-row-group-indent-80 {\n padding-left: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 80);\n}\n.ag-rtl .ag-row > .ag-cell-wrapper.ag-row-group-indent-80 {\n padding-right: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 80);\n}\n\n.ag-ltr .ag-row-group-indent-80 {\n padding-left: calc(80 * var(--ag-row-group-indent-size));\n}\n.ag-rtl .ag-row-group-indent-80 {\n padding-right: calc(80 * var(--ag-row-group-indent-size));\n}\n\n.ag-ltr .ag-row-level-80 .ag-pivot-leaf-group {\n margin-left: var(--ag-row-group-indent-size);\n}\n.ag-rtl .ag-row-level-80 .ag-pivot-leaf-group {\n margin-right: var(--ag-row-group-indent-size);\n}\n\n.ag-ltr .ag-row > .ag-cell-wrapper.ag-row-group-indent-81 {\n padding-left: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 81);\n}\n.ag-rtl .ag-row > .ag-cell-wrapper.ag-row-group-indent-81 {\n padding-right: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 81);\n}\n\n.ag-ltr .ag-row-group-indent-81 {\n padding-left: calc(81 * var(--ag-row-group-indent-size));\n}\n.ag-rtl .ag-row-group-indent-81 {\n padding-right: calc(81 * var(--ag-row-group-indent-size));\n}\n\n.ag-ltr .ag-row-level-81 .ag-pivot-leaf-group {\n margin-left: var(--ag-row-group-indent-size);\n}\n.ag-rtl .ag-row-level-81 .ag-pivot-leaf-group {\n margin-right: var(--ag-row-group-indent-size);\n}\n\n.ag-ltr .ag-row > .ag-cell-wrapper.ag-row-group-indent-82 {\n padding-left: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 82);\n}\n.ag-rtl .ag-row > .ag-cell-wrapper.ag-row-group-indent-82 {\n padding-right: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 82);\n}\n\n.ag-ltr .ag-row-group-indent-82 {\n padding-left: calc(82 * var(--ag-row-group-indent-size));\n}\n.ag-rtl .ag-row-group-indent-82 {\n padding-right: calc(82 * var(--ag-row-group-indent-size));\n}\n\n.ag-ltr .ag-row-level-82 .ag-pivot-leaf-group {\n margin-left: var(--ag-row-group-indent-size);\n}\n.ag-rtl .ag-row-level-82 .ag-pivot-leaf-group {\n margin-right: var(--ag-row-group-indent-size);\n}\n\n.ag-ltr .ag-row > .ag-cell-wrapper.ag-row-group-indent-83 {\n padding-left: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 83);\n}\n.ag-rtl .ag-row > .ag-cell-wrapper.ag-row-group-indent-83 {\n padding-right: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 83);\n}\n\n.ag-ltr .ag-row-group-indent-83 {\n padding-left: calc(83 * var(--ag-row-group-indent-size));\n}\n.ag-rtl .ag-row-group-indent-83 {\n padding-right: calc(83 * var(--ag-row-group-indent-size));\n}\n\n.ag-ltr .ag-row-level-83 .ag-pivot-leaf-group {\n margin-left: var(--ag-row-group-indent-size);\n}\n.ag-rtl .ag-row-level-83 .ag-pivot-leaf-group {\n margin-right: var(--ag-row-group-indent-size);\n}\n\n.ag-ltr .ag-row > .ag-cell-wrapper.ag-row-group-indent-84 {\n padding-left: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 84);\n}\n.ag-rtl .ag-row > .ag-cell-wrapper.ag-row-group-indent-84 {\n padding-right: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 84);\n}\n\n.ag-ltr .ag-row-group-indent-84 {\n padding-left: calc(84 * var(--ag-row-group-indent-size));\n}\n.ag-rtl .ag-row-group-indent-84 {\n padding-right: calc(84 * var(--ag-row-group-indent-size));\n}\n\n.ag-ltr .ag-row-level-84 .ag-pivot-leaf-group {\n margin-left: var(--ag-row-group-indent-size);\n}\n.ag-rtl .ag-row-level-84 .ag-pivot-leaf-group {\n margin-right: var(--ag-row-group-indent-size);\n}\n\n.ag-ltr .ag-row > .ag-cell-wrapper.ag-row-group-indent-85 {\n padding-left: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 85);\n}\n.ag-rtl .ag-row > .ag-cell-wrapper.ag-row-group-indent-85 {\n padding-right: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 85);\n}\n\n.ag-ltr .ag-row-group-indent-85 {\n padding-left: calc(85 * var(--ag-row-group-indent-size));\n}\n.ag-rtl .ag-row-group-indent-85 {\n padding-right: calc(85 * var(--ag-row-group-indent-size));\n}\n\n.ag-ltr .ag-row-level-85 .ag-pivot-leaf-group {\n margin-left: var(--ag-row-group-indent-size);\n}\n.ag-rtl .ag-row-level-85 .ag-pivot-leaf-group {\n margin-right: var(--ag-row-group-indent-size);\n}\n\n.ag-ltr .ag-row > .ag-cell-wrapper.ag-row-group-indent-86 {\n padding-left: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 86);\n}\n.ag-rtl .ag-row > .ag-cell-wrapper.ag-row-group-indent-86 {\n padding-right: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 86);\n}\n\n.ag-ltr .ag-row-group-indent-86 {\n padding-left: calc(86 * var(--ag-row-group-indent-size));\n}\n.ag-rtl .ag-row-group-indent-86 {\n padding-right: calc(86 * var(--ag-row-group-indent-size));\n}\n\n.ag-ltr .ag-row-level-86 .ag-pivot-leaf-group {\n margin-left: var(--ag-row-group-indent-size);\n}\n.ag-rtl .ag-row-level-86 .ag-pivot-leaf-group {\n margin-right: var(--ag-row-group-indent-size);\n}\n\n.ag-ltr .ag-row > .ag-cell-wrapper.ag-row-group-indent-87 {\n padding-left: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 87);\n}\n.ag-rtl .ag-row > .ag-cell-wrapper.ag-row-group-indent-87 {\n padding-right: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 87);\n}\n\n.ag-ltr .ag-row-group-indent-87 {\n padding-left: calc(87 * var(--ag-row-group-indent-size));\n}\n.ag-rtl .ag-row-group-indent-87 {\n padding-right: calc(87 * var(--ag-row-group-indent-size));\n}\n\n.ag-ltr .ag-row-level-87 .ag-pivot-leaf-group {\n margin-left: var(--ag-row-group-indent-size);\n}\n.ag-rtl .ag-row-level-87 .ag-pivot-leaf-group {\n margin-right: var(--ag-row-group-indent-size);\n}\n\n.ag-ltr .ag-row > .ag-cell-wrapper.ag-row-group-indent-88 {\n padding-left: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 88);\n}\n.ag-rtl .ag-row > .ag-cell-wrapper.ag-row-group-indent-88 {\n padding-right: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 88);\n}\n\n.ag-ltr .ag-row-group-indent-88 {\n padding-left: calc(88 * var(--ag-row-group-indent-size));\n}\n.ag-rtl .ag-row-group-indent-88 {\n padding-right: calc(88 * var(--ag-row-group-indent-size));\n}\n\n.ag-ltr .ag-row-level-88 .ag-pivot-leaf-group {\n margin-left: var(--ag-row-group-indent-size);\n}\n.ag-rtl .ag-row-level-88 .ag-pivot-leaf-group {\n margin-right: var(--ag-row-group-indent-size);\n}\n\n.ag-ltr .ag-row > .ag-cell-wrapper.ag-row-group-indent-89 {\n padding-left: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 89);\n}\n.ag-rtl .ag-row > .ag-cell-wrapper.ag-row-group-indent-89 {\n padding-right: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 89);\n}\n\n.ag-ltr .ag-row-group-indent-89 {\n padding-left: calc(89 * var(--ag-row-group-indent-size));\n}\n.ag-rtl .ag-row-group-indent-89 {\n padding-right: calc(89 * var(--ag-row-group-indent-size));\n}\n\n.ag-ltr .ag-row-level-89 .ag-pivot-leaf-group {\n margin-left: var(--ag-row-group-indent-size);\n}\n.ag-rtl .ag-row-level-89 .ag-pivot-leaf-group {\n margin-right: var(--ag-row-group-indent-size);\n}\n\n.ag-ltr .ag-row > .ag-cell-wrapper.ag-row-group-indent-90 {\n padding-left: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 90);\n}\n.ag-rtl .ag-row > .ag-cell-wrapper.ag-row-group-indent-90 {\n padding-right: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 90);\n}\n\n.ag-ltr .ag-row-group-indent-90 {\n padding-left: calc(90 * var(--ag-row-group-indent-size));\n}\n.ag-rtl .ag-row-group-indent-90 {\n padding-right: calc(90 * var(--ag-row-group-indent-size));\n}\n\n.ag-ltr .ag-row-level-90 .ag-pivot-leaf-group {\n margin-left: var(--ag-row-group-indent-size);\n}\n.ag-rtl .ag-row-level-90 .ag-pivot-leaf-group {\n margin-right: var(--ag-row-group-indent-size);\n}\n\n.ag-ltr .ag-row > .ag-cell-wrapper.ag-row-group-indent-91 {\n padding-left: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 91);\n}\n.ag-rtl .ag-row > .ag-cell-wrapper.ag-row-group-indent-91 {\n padding-right: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 91);\n}\n\n.ag-ltr .ag-row-group-indent-91 {\n padding-left: calc(91 * var(--ag-row-group-indent-size));\n}\n.ag-rtl .ag-row-group-indent-91 {\n padding-right: calc(91 * var(--ag-row-group-indent-size));\n}\n\n.ag-ltr .ag-row-level-91 .ag-pivot-leaf-group {\n margin-left: var(--ag-row-group-indent-size);\n}\n.ag-rtl .ag-row-level-91 .ag-pivot-leaf-group {\n margin-right: var(--ag-row-group-indent-size);\n}\n\n.ag-ltr .ag-row > .ag-cell-wrapper.ag-row-group-indent-92 {\n padding-left: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 92);\n}\n.ag-rtl .ag-row > .ag-cell-wrapper.ag-row-group-indent-92 {\n padding-right: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 92);\n}\n\n.ag-ltr .ag-row-group-indent-92 {\n padding-left: calc(92 * var(--ag-row-group-indent-size));\n}\n.ag-rtl .ag-row-group-indent-92 {\n padding-right: calc(92 * var(--ag-row-group-indent-size));\n}\n\n.ag-ltr .ag-row-level-92 .ag-pivot-leaf-group {\n margin-left: var(--ag-row-group-indent-size);\n}\n.ag-rtl .ag-row-level-92 .ag-pivot-leaf-group {\n margin-right: var(--ag-row-group-indent-size);\n}\n\n.ag-ltr .ag-row > .ag-cell-wrapper.ag-row-group-indent-93 {\n padding-left: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 93);\n}\n.ag-rtl .ag-row > .ag-cell-wrapper.ag-row-group-indent-93 {\n padding-right: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 93);\n}\n\n.ag-ltr .ag-row-group-indent-93 {\n padding-left: calc(93 * var(--ag-row-group-indent-size));\n}\n.ag-rtl .ag-row-group-indent-93 {\n padding-right: calc(93 * var(--ag-row-group-indent-size));\n}\n\n.ag-ltr .ag-row-level-93 .ag-pivot-leaf-group {\n margin-left: var(--ag-row-group-indent-size);\n}\n.ag-rtl .ag-row-level-93 .ag-pivot-leaf-group {\n margin-right: var(--ag-row-group-indent-size);\n}\n\n.ag-ltr .ag-row > .ag-cell-wrapper.ag-row-group-indent-94 {\n padding-left: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 94);\n}\n.ag-rtl .ag-row > .ag-cell-wrapper.ag-row-group-indent-94 {\n padding-right: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 94);\n}\n\n.ag-ltr .ag-row-group-indent-94 {\n padding-left: calc(94 * var(--ag-row-group-indent-size));\n}\n.ag-rtl .ag-row-group-indent-94 {\n padding-right: calc(94 * var(--ag-row-group-indent-size));\n}\n\n.ag-ltr .ag-row-level-94 .ag-pivot-leaf-group {\n margin-left: var(--ag-row-group-indent-size);\n}\n.ag-rtl .ag-row-level-94 .ag-pivot-leaf-group {\n margin-right: var(--ag-row-group-indent-size);\n}\n\n.ag-ltr .ag-row > .ag-cell-wrapper.ag-row-group-indent-95 {\n padding-left: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 95);\n}\n.ag-rtl .ag-row > .ag-cell-wrapper.ag-row-group-indent-95 {\n padding-right: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 95);\n}\n\n.ag-ltr .ag-row-group-indent-95 {\n padding-left: calc(95 * var(--ag-row-group-indent-size));\n}\n.ag-rtl .ag-row-group-indent-95 {\n padding-right: calc(95 * var(--ag-row-group-indent-size));\n}\n\n.ag-ltr .ag-row-level-95 .ag-pivot-leaf-group {\n margin-left: var(--ag-row-group-indent-size);\n}\n.ag-rtl .ag-row-level-95 .ag-pivot-leaf-group {\n margin-right: var(--ag-row-group-indent-size);\n}\n\n.ag-ltr .ag-row > .ag-cell-wrapper.ag-row-group-indent-96 {\n padding-left: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 96);\n}\n.ag-rtl .ag-row > .ag-cell-wrapper.ag-row-group-indent-96 {\n padding-right: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 96);\n}\n\n.ag-ltr .ag-row-group-indent-96 {\n padding-left: calc(96 * var(--ag-row-group-indent-size));\n}\n.ag-rtl .ag-row-group-indent-96 {\n padding-right: calc(96 * var(--ag-row-group-indent-size));\n}\n\n.ag-ltr .ag-row-level-96 .ag-pivot-leaf-group {\n margin-left: var(--ag-row-group-indent-size);\n}\n.ag-rtl .ag-row-level-96 .ag-pivot-leaf-group {\n margin-right: var(--ag-row-group-indent-size);\n}\n\n.ag-ltr .ag-row > .ag-cell-wrapper.ag-row-group-indent-97 {\n padding-left: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 97);\n}\n.ag-rtl .ag-row > .ag-cell-wrapper.ag-row-group-indent-97 {\n padding-right: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 97);\n}\n\n.ag-ltr .ag-row-group-indent-97 {\n padding-left: calc(97 * var(--ag-row-group-indent-size));\n}\n.ag-rtl .ag-row-group-indent-97 {\n padding-right: calc(97 * var(--ag-row-group-indent-size));\n}\n\n.ag-ltr .ag-row-level-97 .ag-pivot-leaf-group {\n margin-left: var(--ag-row-group-indent-size);\n}\n.ag-rtl .ag-row-level-97 .ag-pivot-leaf-group {\n margin-right: var(--ag-row-group-indent-size);\n}\n\n.ag-ltr .ag-row > .ag-cell-wrapper.ag-row-group-indent-98 {\n padding-left: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 98);\n}\n.ag-rtl .ag-row > .ag-cell-wrapper.ag-row-group-indent-98 {\n padding-right: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 98);\n}\n\n.ag-ltr .ag-row-group-indent-98 {\n padding-left: calc(98 * var(--ag-row-group-indent-size));\n}\n.ag-rtl .ag-row-group-indent-98 {\n padding-right: calc(98 * var(--ag-row-group-indent-size));\n}\n\n.ag-ltr .ag-row-level-98 .ag-pivot-leaf-group {\n margin-left: var(--ag-row-group-indent-size);\n}\n.ag-rtl .ag-row-level-98 .ag-pivot-leaf-group {\n margin-right: var(--ag-row-group-indent-size);\n}\n\n.ag-ltr .ag-row > .ag-cell-wrapper.ag-row-group-indent-99 {\n padding-left: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 99);\n}\n.ag-rtl .ag-row > .ag-cell-wrapper.ag-row-group-indent-99 {\n padding-right: calc(var(--ag-cell-horizontal-padding) + var(--ag-row-group-indent-size) * 99);\n}\n\n.ag-ltr .ag-row-group-indent-99 {\n padding-left: calc(99 * var(--ag-row-group-indent-size));\n}\n.ag-rtl .ag-row-group-indent-99 {\n padding-right: calc(99 * var(--ag-row-group-indent-size));\n}\n\n.ag-ltr .ag-row-level-99 .ag-pivot-leaf-group {\n margin-left: var(--ag-row-group-indent-size);\n}\n.ag-rtl .ag-row-level-99 .ag-pivot-leaf-group {\n margin-right: var(--ag-row-group-indent-size);\n}\n\n.ag-ltr .ag-row-group-leaf-indent {\n margin-left: var(--ag-row-group-indent-size);\n}\n.ag-rtl .ag-row-group-leaf-indent {\n margin-right: var(--ag-row-group-indent-size);\n}\n\n.ag-value-change-delta {\n padding-right: 2px;\n}\n\n.ag-value-change-delta-up {\n color: var(--ag-value-change-delta-up-color);\n}\n\n.ag-value-change-delta-down {\n color: var(--ag-value-change-delta-down-color);\n}\n\n.ag-value-change-value {\n background-color: transparent;\n border-radius: 1px;\n padding-left: 1px;\n padding-right: 1px;\n transition: background-color 1s;\n}\n\n.ag-value-change-value-highlight {\n background-color: var(--ag-value-change-value-highlight-background-color);\n transition: background-color 0.1s;\n}\n\n.ag-cell-data-changed {\n background-color: var(--ag-value-change-value-highlight-background-color) !important;\n}\n\n.ag-cell-data-changed-animation {\n background-color: transparent;\n}\n\n.ag-cell-highlight {\n background-color: var(--ag-range-selection-highlight-color) !important;\n}\n\n.ag-row {\n height: var(--ag-row-height);\n background-color: var(--ag-background-color);\n color: var(--ag-data-color);\n border-bottom: var(--ag-row-border-style) var(--ag-row-border-color) var(--ag-row-border-width);\n}\n\n.ag-row-highlight-above::after, .ag-row-highlight-below::after {\n content: \"\";\n position: absolute;\n width: calc(100% - 1px);\n height: 1px;\n background-color: var(--ag-range-selection-border-color);\n left: 1px;\n}\n\n.ag-row-highlight-above::after {\n top: -1px;\n}\n\n.ag-row-highlight-above.ag-row-first::after {\n top: 0;\n}\n\n.ag-row-highlight-below::after {\n bottom: 0px;\n}\n\n.ag-row-odd {\n background-color: var(--ag-odd-row-background-color);\n}\n\n.ag-body-horizontal-scroll:not(.ag-scrollbar-invisible) .ag-horizontal-left-spacer:not(.ag-scroller-corner) {\n border-right: var(--ag-borders-critical) var(--ag-border-color);\n}\n.ag-body-horizontal-scroll:not(.ag-scrollbar-invisible) .ag-horizontal-right-spacer:not(.ag-scroller-corner) {\n border-left: var(--ag-borders-critical) var(--ag-border-color);\n}\n\n.ag-row-selected::before {\n content: \"\";\n background-color: var(--ag-selected-row-background-color);\n display: block;\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n}\n\n.ag-row-hover:not(.ag-full-width-row)::before,\n.ag-row-hover.ag-full-width-row.ag-row-group::before {\n content: \"\";\n background-color: var(--ag-row-hover-color);\n display: block;\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n pointer-events: none;\n}\n\n.ag-row-hover.ag-full-width-row.ag-row-group > * {\n position: relative;\n}\n\n.ag-row-hover.ag-row-selected::before {\n background-color: var(--ag-row-hover-color);\n background-image: linear-gradient(var(--ag-selected-row-background-color), var(--ag-selected-row-background-color));\n}\n\n.ag-column-hover {\n background-color: var(--ag-column-hover-color);\n}\n\n.ag-ltr .ag-right-aligned-cell {\n text-align: right;\n}\n.ag-rtl .ag-right-aligned-cell {\n text-align: left;\n}\n\n.ag-ltr .ag-right-aligned-cell .ag-cell-value,\n.ag-ltr .ag-right-aligned-cell .ag-group-value {\n margin-left: auto;\n}\n.ag-rtl .ag-right-aligned-cell .ag-cell-value,\n.ag-rtl .ag-right-aligned-cell .ag-group-value {\n margin-right: auto;\n}\n\n.ag-cell, .ag-full-width-row .ag-cell-wrapper.ag-row-group {\n --ag-internal-calculated-line-height: var(--ag-line-height, calc(var(--ag-row-height) - var(--ag-row-border-width)));\n --ag-internal-padded-row-height: calc(var(--ag-row-height) - var(--ag-row-border-width));\n border: 1px solid transparent;\n line-height: min(var(--ag-internal-calculated-line-height), var(--ag-internal-padded-row-height));\n padding-left: calc(var(--ag-cell-horizontal-padding) - 1px);\n padding-right: calc(var(--ag-cell-horizontal-padding) - 1px);\n -webkit-font-smoothing: subpixel-antialiased;\n}\n\n.ag-row > .ag-cell-wrapper {\n padding-left: calc(var(--ag-cell-horizontal-padding) - 1px);\n padding-right: calc(var(--ag-cell-horizontal-padding) - 1px);\n}\n\n.ag-row-dragging {\n cursor: move;\n opacity: 0.5;\n}\n\n.ag-cell-inline-editing {\n border: var(--ag-borders) var(--ag-border-color);\n background: var(--ag-background-color);\n border-radius: var(--ag-card-radius);\n box-shadow: var(--ag-card-shadow);\n padding: var(--ag-grid-size);\n padding: 0;\n background-color: var(--ag-control-panel-background-color);\n}\n\n.ag-popup-editor {\n border: var(--ag-borders) var(--ag-border-color);\n background: var(--ag-background-color);\n border-radius: var(--ag-card-radius);\n box-shadow: var(--ag-card-shadow);\n padding: var(--ag-grid-size);\n background-color: var(--ag-control-panel-background-color);\n padding: 0;\n}\n\n.ag-large-text-input {\n height: auto;\n padding: var(--ag-cell-horizontal-padding);\n}\n\n.ag-rtl .ag-large-text-input textarea {\n resize: none;\n}\n\n.ag-details-row {\n padding: calc(var(--ag-grid-size) * 5);\n background-color: var(--ag-background-color);\n}\n\n.ag-layout-auto-height .ag-center-cols-clipper, .ag-layout-auto-height .ag-center-cols-container, .ag-layout-print .ag-center-cols-clipper, .ag-layout-print .ag-center-cols-container {\n min-height: 50px;\n}\n\n.ag-overlay-loading-wrapper {\n background-color: var(--ag-modal-overlay-background-color);\n}\n\n.ag-overlay-loading-center {\n border: var(--ag-borders) var(--ag-border-color);\n background: var(--ag-background-color);\n border-radius: var(--ag-card-radius);\n box-shadow: var(--ag-card-shadow);\n padding: var(--ag-grid-size);\n}\n\n.ag-overlay-no-rows-wrapper.ag-layout-auto-height {\n padding-top: 30px;\n}\n\n.ag-loading {\n display: flex;\n height: 100%;\n align-items: center;\n}\n.ag-ltr .ag-loading {\n padding-left: var(--ag-cell-horizontal-padding);\n}\n.ag-rtl .ag-loading {\n padding-right: var(--ag-cell-horizontal-padding);\n}\n\n.ag-ltr .ag-loading-icon {\n padding-right: var(--ag-cell-widget-spacing);\n}\n.ag-rtl .ag-loading-icon {\n padding-left: var(--ag-cell-widget-spacing);\n}\n\n.ag-icon-loading {\n animation-name: spin;\n animation-duration: 1000ms;\n animation-iteration-count: infinite;\n animation-timing-function: linear;\n}\n\n@keyframes spin {\n from {\n transform: rotate(0deg);\n }\n to {\n transform: rotate(360deg);\n }\n}\n.ag-floating-top {\n border-bottom: var(--ag-borders-critical) var(--ag-border-color);\n}\n\n.ag-floating-bottom {\n border-top: var(--ag-borders-critical) var(--ag-border-color);\n}\n\n.ag-ltr .ag-cell {\n border-right: var(--ag-cell-horizontal-border);\n}\n.ag-rtl .ag-cell {\n border-left: var(--ag-cell-horizontal-border);\n}\n.ag-ltr .ag-cell {\n border-right-width: 1px;\n}\n.ag-rtl .ag-cell {\n border-left-width: 1px;\n}\n\n.ag-cell.ag-cell-first-right-pinned:not(.ag-cell-range-left):not(.ag-cell-range-single-cell) {\n border-left: var(--ag-borders-critical) var(--ag-border-color);\n}\n\n.ag-cell.ag-cell-last-left-pinned:not(.ag-cell-range-right):not(.ag-cell-range-single-cell) {\n border-right: var(--ag-borders-critical) var(--ag-border-color);\n}\n\n.ag-cell-range-selected:not(.ag-cell-focus),\n.ag-body-viewport:not(.ag-has-focus) .ag-cell-range-single-cell:not(.ag-cell-inline-editing) {\n background-color: var(--ag-range-selection-background-color);\n}\n.ag-cell-range-selected:not(.ag-cell-focus).ag-cell-range-chart,\n.ag-body-viewport:not(.ag-has-focus) .ag-cell-range-single-cell:not(.ag-cell-inline-editing).ag-cell-range-chart {\n background-color: var(--ag-range-selection-chart-background-color) !important;\n}\n.ag-cell-range-selected:not(.ag-cell-focus).ag-cell-range-chart.ag-cell-range-chart-category,\n.ag-body-viewport:not(.ag-has-focus) .ag-cell-range-single-cell:not(.ag-cell-inline-editing).ag-cell-range-chart.ag-cell-range-chart-category {\n background-color: var(--ag-range-selection-chart-category-background-color) !important;\n}\n\n.ag-cell-range-selected-1:not(.ag-cell-focus),\n.ag-root:not(.ag-context-menu-open) .ag-body-viewport:not(.ag-has-focus) .ag-cell-range-selected-1:not(.ag-cell-inline-editing) {\n background-color: var(--ag-range-selection-background-color);\n}\n\n.ag-cell-range-selected-2:not(.ag-cell-focus),\n.ag-body-viewport:not(.ag-has-focus) .ag-cell-range-selected-2 {\n background-color: var(--ag-range-selection-background-color-2);\n}\n\n.ag-cell-range-selected-3:not(.ag-cell-focus),\n.ag-body-viewport:not(.ag-has-focus) .ag-cell-range-selected-3 {\n background-color: var(--ag-range-selection-background-color-3);\n}\n\n.ag-cell-range-selected-4:not(.ag-cell-focus),\n.ag-body-viewport:not(.ag-has-focus) .ag-cell-range-selected-4 {\n background-color: var(--ag-range-selection-background-color-4);\n}\n\n.ag-cell.ag-cell-range-selected:not(.ag-cell-range-single-cell).ag-cell-range-top {\n border-top-color: var(--ag-range-selection-border-color);\n border-top-style: var(--ag-range-selection-border-style);\n}\n.ag-cell.ag-cell-range-selected:not(.ag-cell-range-single-cell).ag-cell-range-right {\n border-right-color: var(--ag-range-selection-border-color);\n border-right-style: var(--ag-range-selection-border-style);\n}\n.ag-cell.ag-cell-range-selected:not(.ag-cell-range-single-cell).ag-cell-range-bottom {\n border-bottom-color: var(--ag-range-selection-border-color);\n border-bottom-style: var(--ag-range-selection-border-style);\n}\n.ag-cell.ag-cell-range-selected:not(.ag-cell-range-single-cell).ag-cell-range-left {\n border-left-color: var(--ag-range-selection-border-color);\n border-left-style: var(--ag-range-selection-border-style);\n}\n\n.ag-ltr .ag-cell-focus:not(.ag-cell-range-selected):focus-within,\n.ag-ltr .ag-context-menu-open .ag-cell-focus:not(.ag-cell-range-selected),\n.ag-ltr .ag-full-width-row.ag-row-focus:focus .ag-cell-wrapper.ag-row-group,\n.ag-ltr .ag-cell-range-single-cell,\n.ag-ltr .ag-cell-range-single-cell.ag-cell-range-handle, .ag-rtl .ag-cell-focus:not(.ag-cell-range-selected):focus-within,\n.ag-rtl .ag-context-menu-open .ag-cell-focus:not(.ag-cell-range-selected),\n.ag-rtl .ag-full-width-row.ag-row-focus:focus .ag-cell-wrapper.ag-row-group,\n.ag-rtl .ag-cell-range-single-cell,\n.ag-rtl .ag-cell-range-single-cell.ag-cell-range-handle {\n border: 1px solid;\n border-color: var(--ag-range-selection-border-color);\n border-style: var(--ag-range-selection-border-style);\n outline: initial;\n}\n\n.ag-cell.ag-selection-fill-top,\n.ag-cell.ag-selection-fill-top.ag-cell-range-selected {\n border-top: 1px dashed;\n border-top-color: var(--ag-range-selection-border-color);\n}\n\n.ag-ltr .ag-cell.ag-selection-fill-right,\n.ag-ltr .ag-cell.ag-selection-fill-right.ag-cell-range-selected {\n border-right: 1px dashed var(--ag-range-selection-border-color) !important;\n}\n.ag-rtl .ag-cell.ag-selection-fill-right,\n.ag-rtl .ag-cell.ag-selection-fill-right.ag-cell-range-selected {\n border-left: 1px dashed var(--ag-range-selection-border-color) !important;\n}\n\n.ag-cell.ag-selection-fill-bottom,\n.ag-cell.ag-selection-fill-bottom.ag-cell-range-selected {\n border-bottom: 1px dashed;\n border-bottom-color: var(--ag-range-selection-border-color);\n}\n\n.ag-ltr .ag-cell.ag-selection-fill-left,\n.ag-ltr .ag-cell.ag-selection-fill-left.ag-cell-range-selected {\n border-left: 1px dashed var(--ag-range-selection-border-color) !important;\n}\n.ag-rtl .ag-cell.ag-selection-fill-left,\n.ag-rtl .ag-cell.ag-selection-fill-left.ag-cell-range-selected {\n border-right: 1px dashed var(--ag-range-selection-border-color) !important;\n}\n\n.ag-fill-handle, .ag-range-handle {\n position: absolute;\n width: 6px;\n height: 6px;\n bottom: -1px;\n background-color: var(--ag-range-selection-border-color);\n}\n.ag-ltr .ag-fill-handle, .ag-ltr .ag-range-handle {\n right: -1px;\n}\n.ag-rtl .ag-fill-handle, .ag-rtl .ag-range-handle {\n left: -1px;\n}\n\n.ag-fill-handle {\n cursor: cell;\n}\n\n.ag-range-handle {\n cursor: nwse-resize;\n}\n\n.ag-cell-inline-editing {\n border-color: var(--ag-input-focus-border-color) !important;\n}\n\n.ag-menu {\n border: var(--ag-borders) var(--ag-border-color);\n background: var(--ag-background-color);\n border-radius: var(--ag-card-radius);\n box-shadow: var(--ag-card-shadow);\n padding: var(--ag-grid-size);\n padding: 0;\n}\n\n.ag-menu-list {\n cursor: default;\n padding: var(--ag-grid-size) 0;\n}\n\n.ag-menu-separator {\n height: calc(var(--ag-grid-size) * 2 + 1px);\n}\n\n.ag-menu-separator-part::after {\n content: \"\";\n display: block;\n border-top: var(--ag-borders-critical) var(--ag-border-color);\n}\n\n.ag-menu-option-active, .ag-compact-menu-option-active {\n background-color: var(--ag-row-hover-color);\n}\n\n.ag-menu-option-part, .ag-compact-menu-option-part {\n line-height: var(--ag-icon-size);\n padding: calc(var(--ag-grid-size) + 2px) 0;\n}\n\n.ag-menu-option-disabled, .ag-compact-menu-option-disabled {\n opacity: 0.5;\n}\n\n.ag-menu-option-icon, .ag-compact-menu-option-icon {\n width: var(--ag-icon-size);\n}\n.ag-ltr .ag-menu-option-icon, .ag-ltr .ag-compact-menu-option-icon {\n padding-left: calc(var(--ag-grid-size) * 2);\n}\n.ag-rtl .ag-menu-option-icon, .ag-rtl .ag-compact-menu-option-icon {\n padding-right: calc(var(--ag-grid-size) * 2);\n}\n\n.ag-menu-option-text, .ag-compact-menu-option-text {\n padding-left: calc(var(--ag-grid-size) * 2);\n padding-right: calc(var(--ag-grid-size) * 2);\n}\n\n.ag-ltr .ag-menu-option-shortcut, .ag-ltr .ag-compact-menu-option-shortcut {\n padding-right: var(--ag-grid-size);\n}\n.ag-rtl .ag-menu-option-shortcut, .ag-rtl .ag-compact-menu-option-shortcut {\n padding-left: var(--ag-grid-size);\n}\n\n.ag-menu-option-popup-pointer, .ag-compact-menu-option-popup-pointer {\n padding-right: var(--ag-grid-size);\n}\n\n.ag-tabs {\n min-width: var(--ag-tab-min-width);\n}\n\n.ag-tabs-header {\n width: 100%;\n display: flex;\n}\n\n.ag-tab {\n border-bottom: var(--ag-selected-tab-underline-width) solid transparent;\n transition: border-bottom var(--ag-selected-tab-underline-transition-speed);\n display: flex;\n flex: none;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n}\n\n.ag-keyboard-focus .ag-tab:focus {\n outline: none;\n}\n.ag-keyboard-focus .ag-tab:focus::after {\n content: \"\";\n position: absolute;\n background-color: transparent;\n pointer-events: none;\n top: 4px;\n left: 4px;\n display: block;\n width: calc(100% - 8px);\n height: calc(100% - 8px);\n border: 1px solid;\n border-color: var(--ag-input-focus-border-color);\n}\n\n.ag-tab-selected {\n border-bottom-color: var(--ag-selected-tab-underline-color);\n}\n\n.ag-menu-header {\n color: var(--ag-secondary-foreground-color);\n}\n\n.ag-filter-separator {\n border-top: var(--ag-borders-critical) var(--ag-border-color);\n}\n\n.ag-filter-select .ag-picker-field-wrapper {\n width: 0;\n}\n\n.ag-filter-condition-operator {\n height: 17px;\n}\n\n.ag-ltr .ag-filter-condition-operator-or {\n margin-left: calc(var(--ag-grid-size) * 2);\n}\n.ag-rtl .ag-filter-condition-operator-or {\n margin-right: calc(var(--ag-grid-size) * 2);\n}\n\n.ag-set-filter-select-all {\n padding-top: var(--ag-widget-container-vertical-padding);\n}\n\n.ag-set-filter-list, .ag-filter-no-matches {\n height: calc(var(--ag-list-item-height) * 6);\n}\n\n.ag-set-filter-tree-list {\n height: calc(var(--ag-list-item-height) * 10);\n}\n\n.ag-set-filter-filter {\n margin-top: var(--ag-widget-container-vertical-padding);\n margin-left: var(--ag-widget-container-horizontal-padding);\n margin-right: var(--ag-widget-container-horizontal-padding);\n}\n\n.ag-filter-to {\n margin-top: var(--ag-widget-vertical-spacing);\n}\n\n.ag-mini-filter {\n margin: var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding);\n}\n\n.ag-set-filter-item {\n margin: 0px var(--ag-widget-container-horizontal-padding);\n}\n\n.ag-ltr .ag-set-filter-add-group-indent {\n margin-left: calc(var(--ag-widget-container-horizontal-padding) + var(--ag-icon-size) + var(--ag-grid-size) * 2);\n}\n.ag-rtl .ag-set-filter-add-group-indent {\n margin-right: calc(var(--ag-widget-container-horizontal-padding) + var(--ag-icon-size) + var(--ag-grid-size) * 2);\n}\n\n.ag-ltr .ag-set-filter-indent-1 {\n padding-left: calc(1 * var(--ag-set-filter-indent-size));\n}\n.ag-rtl .ag-set-filter-indent-1 {\n padding-right: calc(1 * var(--ag-set-filter-indent-size));\n}\n\n.ag-ltr .ag-set-filter-indent-2 {\n padding-left: calc(2 * var(--ag-set-filter-indent-size));\n}\n.ag-rtl .ag-set-filter-indent-2 {\n padding-right: calc(2 * var(--ag-set-filter-indent-size));\n}\n\n.ag-ltr .ag-set-filter-indent-3 {\n padding-left: calc(3 * var(--ag-set-filter-indent-size));\n}\n.ag-rtl .ag-set-filter-indent-3 {\n padding-right: calc(3 * var(--ag-set-filter-indent-size));\n}\n\n.ag-ltr .ag-set-filter-indent-4 {\n padding-left: calc(4 * var(--ag-set-filter-indent-size));\n}\n.ag-rtl .ag-set-filter-indent-4 {\n padding-right: calc(4 * var(--ag-set-filter-indent-size));\n}\n\n.ag-ltr .ag-set-filter-indent-5 {\n padding-left: calc(5 * var(--ag-set-filter-indent-size));\n}\n.ag-rtl .ag-set-filter-indent-5 {\n padding-right: calc(5 * var(--ag-set-filter-indent-size));\n}\n\n.ag-ltr .ag-set-filter-indent-6 {\n padding-left: calc(6 * var(--ag-set-filter-indent-size));\n}\n.ag-rtl .ag-set-filter-indent-6 {\n padding-right: calc(6 * var(--ag-set-filter-indent-size));\n}\n\n.ag-ltr .ag-set-filter-indent-7 {\n padding-left: calc(7 * var(--ag-set-filter-indent-size));\n}\n.ag-rtl .ag-set-filter-indent-7 {\n padding-right: calc(7 * var(--ag-set-filter-indent-size));\n}\n\n.ag-ltr .ag-set-filter-indent-8 {\n padding-left: calc(8 * var(--ag-set-filter-indent-size));\n}\n.ag-rtl .ag-set-filter-indent-8 {\n padding-right: calc(8 * var(--ag-set-filter-indent-size));\n}\n\n.ag-ltr .ag-set-filter-indent-9 {\n padding-left: calc(9 * var(--ag-set-filter-indent-size));\n}\n.ag-rtl .ag-set-filter-indent-9 {\n padding-right: calc(9 * var(--ag-set-filter-indent-size));\n}\n\n.ag-ltr .ag-set-filter-group-icons {\n margin-right: var(--ag-widget-container-horizontal-padding);\n}\n.ag-rtl .ag-set-filter-group-icons {\n margin-left: var(--ag-widget-container-horizontal-padding);\n}\n\n.ag-filter-apply-panel {\n padding: var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding);\n border-top: var(--ag-borders-secondary) var(--ag-secondary-border-color);\n}\n\n.ag-filter-apply-panel-button {\n line-height: 1.5;\n}\n.ag-ltr .ag-filter-apply-panel-button {\n margin-left: calc(var(--ag-grid-size) * 2);\n}\n.ag-rtl .ag-filter-apply-panel-button {\n margin-right: calc(var(--ag-grid-size) * 2);\n}\n\n.ag-simple-filter-body-wrapper {\n padding: var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding);\n padding-bottom: calc(var(--ag-widget-container-vertical-padding) - var(--ag-widget-vertical-spacing));\n overflow-y: auto;\n min-height: calc(var(--ag-list-item-height) + var(--ag-widget-container-vertical-padding) + var(--ag-widget-vertical-spacing));\n}\n.ag-simple-filter-body-wrapper > * {\n margin-bottom: var(--ag-widget-vertical-spacing);\n}\n.ag-simple-filter-body-wrapper .ag-resizer-wrapper {\n margin: 0;\n}\n\n.ag-menu:not(.ag-tabs) .ag-filter .ag-simple-filter-body-wrapper,\n.ag-menu:not(.ag-tabs) .ag-filter > *:not(.ag-filter-wrapper) {\n min-width: calc(var(--ag-menu-min-width) - 2px);\n}\n\n.ag-filter-no-matches {\n padding: var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding);\n}\n\n.ag-multi-filter-menu-item {\n margin: var(--ag-grid-size) 0;\n}\n\n.ag-multi-filter-group-title-bar {\n padding: calc(var(--ag-grid-size) * 2) var(--ag-grid-size);\n background-color: transparent;\n}\n\n.ag-group-filter-field-select-wrapper {\n padding: var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding);\n padding-bottom: calc(var(--ag-widget-container-vertical-padding) - var(--ag-widget-vertical-spacing));\n}\n.ag-group-filter-field-select-wrapper > * {\n margin-bottom: var(--ag-widget-vertical-spacing);\n}\n\n.ag-keyboard-focus .ag-multi-filter-group-title-bar:focus {\n outline: none;\n}\n.ag-keyboard-focus .ag-multi-filter-group-title-bar:focus::after {\n content: \"\";\n position: absolute;\n background-color: transparent;\n pointer-events: none;\n top: 4px;\n left: 4px;\n display: block;\n width: calc(100% - 8px);\n height: calc(100% - 8px);\n border: 1px solid;\n border-color: var(--ag-input-focus-border-color);\n}\n\n.ag-side-bar {\n position: relative;\n}\n\n.ag-tool-panel-wrapper {\n width: var(--ag-side-bar-panel-width);\n background-color: var(--ag-control-panel-background-color);\n}\n\n.ag-side-buttons {\n padding-top: calc(var(--ag-grid-size) * 4);\n width: calc(var(--ag-icon-size) + 4px);\n position: relative;\n color: var(--ag-foreground-color);\n overflow: hidden;\n}\n\nbutton.ag-side-button-button {\n color: inherit;\n font-family: inherit;\n font-size: inherit;\n font-weight: inherit;\n line-height: inherit;\n background: transparent;\n padding: calc(var(--ag-grid-size) * 2) 0 calc(var(--ag-grid-size) * 2) 0;\n width: 100%;\n margin: 0;\n min-height: calc(var(--ag-grid-size) * 18);\n background-position-y: center;\n background-position-x: center;\n background-repeat: no-repeat;\n border: none;\n border-top: var(--ag-borders-side-button) var(--ag-border-color);\n border-bottom: var(--ag-borders-side-button) var(--ag-border-color);\n}\nbutton.ag-side-button-button:focus {\n box-shadow: none;\n}\n\n.ag-keyboard-focus .ag-side-button-button:focus {\n outline: none;\n}\n.ag-keyboard-focus .ag-side-button-button:focus::after {\n content: \"\";\n position: absolute;\n background-color: transparent;\n pointer-events: none;\n top: 4px;\n left: 4px;\n display: block;\n width: calc(100% - 8px);\n height: calc(100% - 8px);\n border: 1px solid;\n border-color: var(--ag-input-focus-border-color);\n}\n\n.ag-selected button.ag-side-button-button {\n background-color: var(--ag-side-button-selected-background-color);\n}\n\n.ag-side-button-icon-wrapper {\n margin-bottom: 3px;\n}\n\n.ag-ltr .ag-side-bar-left,\n.ag-rtl .ag-side-bar-right {\n border-right: var(--ag-borders) var(--ag-border-color);\n}\n.ag-ltr .ag-side-bar-left .ag-tool-panel-wrapper,\n.ag-rtl .ag-side-bar-right .ag-tool-panel-wrapper {\n border-left: var(--ag-borders) var(--ag-border-color);\n}\n.ag-ltr .ag-side-bar-left .ag-side-button-button,\n.ag-rtl .ag-side-bar-right .ag-side-button-button {\n border-right: var(--ag-selected-tab-underline-width) solid transparent;\n transition: border-right var(--ag-selected-tab-underline-transition-speed);\n}\n.ag-ltr .ag-side-bar-left .ag-selected .ag-side-button-button,\n.ag-rtl .ag-side-bar-right .ag-selected .ag-side-button-button {\n border-right-color: var(--ag-selected-tab-underline-color);\n}\n\n.ag-rtl .ag-side-bar-left,\n.ag-ltr .ag-side-bar-right {\n border-left: var(--ag-borders) var(--ag-border-color);\n}\n.ag-rtl .ag-side-bar-left .ag-tool-panel-wrapper,\n.ag-ltr .ag-side-bar-right .ag-tool-panel-wrapper {\n border-right: var(--ag-borders) var(--ag-border-color);\n}\n.ag-rtl .ag-side-bar-left .ag-side-button-button,\n.ag-ltr .ag-side-bar-right .ag-side-button-button {\n border-left: var(--ag-selected-tab-underline-width) solid transparent;\n transition: border-left var(--ag-selected-tab-underline-transition-speed);\n}\n.ag-rtl .ag-side-bar-left .ag-selected .ag-side-button-button,\n.ag-ltr .ag-side-bar-right .ag-selected .ag-side-button-button {\n border-left-color: var(--ag-selected-tab-underline-color);\n}\n\n.ag-filter-toolpanel-header {\n height: calc(var(--ag-grid-size) * 6);\n}\n\n.ag-ltr .ag-filter-toolpanel-header,\n.ag-ltr .ag-filter-toolpanel-search {\n padding-left: var(--ag-grid-size);\n}\n.ag-rtl .ag-filter-toolpanel-header,\n.ag-rtl .ag-filter-toolpanel-search {\n padding-right: var(--ag-grid-size);\n}\n\n.ag-keyboard-focus .ag-filter-toolpanel-header:focus {\n outline: none;\n}\n.ag-keyboard-focus .ag-filter-toolpanel-header:focus::after {\n content: \"\";\n position: absolute;\n background-color: transparent;\n pointer-events: none;\n top: 4px;\n left: 4px;\n display: block;\n width: calc(100% - 8px);\n height: calc(100% - 8px);\n border: 1px solid;\n border-color: var(--ag-input-focus-border-color);\n}\n\n.ag-filter-toolpanel-group.ag-has-filter > .ag-group-title-bar .ag-group-title::after {\n font-family: var(--ag-icon-font-family);\n font-size: var(--ag-icon-size);\n line-height: var(--ag-icon-size);\n font-style: normal;\n font-weight: normal;\n font-variant: normal;\n text-transform: none;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n content: var(--ag-icon-font-code-filter, \"\\f115\");\n position: absolute;\n}\n.ag-ltr .ag-filter-toolpanel-group.ag-has-filter > .ag-group-title-bar .ag-group-title::after {\n padding-left: var(--ag-grid-size);\n}\n.ag-rtl .ag-filter-toolpanel-group.ag-has-filter > .ag-group-title-bar .ag-group-title::after {\n padding-right: var(--ag-grid-size);\n}\n\n.ag-filter-toolpanel-group-level-0-header {\n height: calc(var(--ag-grid-size) * 8);\n}\n\n.ag-filter-toolpanel-group-item {\n margin-top: calc(var(--ag-grid-size) * 0.5);\n margin-bottom: calc(var(--ag-grid-size) * 0.5);\n}\n\n.ag-filter-toolpanel-search {\n height: var(--ag-header-height);\n}\n\n.ag-filter-toolpanel-search-input {\n flex-grow: 1;\n height: calc(var(--ag-grid-size) * 4);\n}\n.ag-ltr .ag-filter-toolpanel-search-input {\n margin-right: var(--ag-grid-size);\n}\n.ag-rtl .ag-filter-toolpanel-search-input {\n margin-left: var(--ag-grid-size);\n}\n\n.ag-filter-toolpanel-group-level-0 {\n border-top: var(--ag-borders-secondary) var(--ag-secondary-border-color);\n}\n\n.ag-ltr .ag-filter-toolpanel-expand,\n.ag-ltr .ag-filter-toolpanel-group-title-bar-icon {\n margin-right: var(--ag-grid-size);\n}\n.ag-rtl .ag-filter-toolpanel-expand,\n.ag-rtl .ag-filter-toolpanel-group-title-bar-icon {\n margin-left: var(--ag-grid-size);\n}\n\n.ag-filter-toolpanel-group-level-1 .ag-filter-toolpanel-group-level-1-header.ag-filter-toolpanel-group-title-bar {\n background-color: transparent;\n}\n.ag-ltr .ag-filter-toolpanel-group-level-1 .ag-filter-toolpanel-group-level-2-header {\n padding-left: calc(var(--ag-filter-tool-panel-group-indent) * 1 + var(--ag-grid-size));\n}\n.ag-rtl .ag-filter-toolpanel-group-level-1 .ag-filter-toolpanel-group-level-2-header {\n padding-right: calc(var(--ag-filter-tool-panel-group-indent) * 1 + var(--ag-grid-size));\n}\n\n.ag-filter-toolpanel-group-level-2 .ag-filter-toolpanel-group-level-2-header.ag-filter-toolpanel-group-title-bar {\n background-color: transparent;\n}\n.ag-ltr .ag-filter-toolpanel-group-level-2 .ag-filter-toolpanel-group-level-3-header {\n padding-left: calc(var(--ag-filter-tool-panel-group-indent) * 2 + var(--ag-grid-size));\n}\n.ag-rtl .ag-filter-toolpanel-group-level-2 .ag-filter-toolpanel-group-level-3-header {\n padding-right: calc(var(--ag-filter-tool-panel-group-indent) * 2 + var(--ag-grid-size));\n}\n\n.ag-filter-toolpanel-group-level-3 .ag-filter-toolpanel-group-level-3-header.ag-filter-toolpanel-group-title-bar {\n background-color: transparent;\n}\n.ag-ltr .ag-filter-toolpanel-group-level-3 .ag-filter-toolpanel-group-level-4-header {\n padding-left: calc(var(--ag-filter-tool-panel-group-indent) * 3 + var(--ag-grid-size));\n}\n.ag-rtl .ag-filter-toolpanel-group-level-3 .ag-filter-toolpanel-group-level-4-header {\n padding-right: calc(var(--ag-filter-tool-panel-group-indent) * 3 + var(--ag-grid-size));\n}\n\n.ag-filter-toolpanel-group-level-4 .ag-filter-toolpanel-group-level-4-header.ag-filter-toolpanel-group-title-bar {\n background-color: transparent;\n}\n.ag-ltr .ag-filter-toolpanel-group-level-4 .ag-filter-toolpanel-group-level-5-header {\n padding-left: calc(var(--ag-filter-tool-panel-group-indent) * 4 + var(--ag-grid-size));\n}\n.ag-rtl .ag-filter-toolpanel-group-level-4 .ag-filter-toolpanel-group-level-5-header {\n padding-right: calc(var(--ag-filter-tool-panel-group-indent) * 4 + var(--ag-grid-size));\n}\n\n.ag-filter-toolpanel-group-level-5 .ag-filter-toolpanel-group-level-5-header.ag-filter-toolpanel-group-title-bar {\n background-color: transparent;\n}\n.ag-ltr .ag-filter-toolpanel-group-level-5 .ag-filter-toolpanel-group-level-6-header {\n padding-left: calc(var(--ag-filter-tool-panel-group-indent) * 5 + var(--ag-grid-size));\n}\n.ag-rtl .ag-filter-toolpanel-group-level-5 .ag-filter-toolpanel-group-level-6-header {\n padding-right: calc(var(--ag-filter-tool-panel-group-indent) * 5 + var(--ag-grid-size));\n}\n\n.ag-filter-toolpanel-group-level-6 .ag-filter-toolpanel-group-level-6-header.ag-filter-toolpanel-group-title-bar {\n background-color: transparent;\n}\n.ag-ltr .ag-filter-toolpanel-group-level-6 .ag-filter-toolpanel-group-level-7-header {\n padding-left: calc(var(--ag-filter-tool-panel-group-indent) * 6 + var(--ag-grid-size));\n}\n.ag-rtl .ag-filter-toolpanel-group-level-6 .ag-filter-toolpanel-group-level-7-header {\n padding-right: calc(var(--ag-filter-tool-panel-group-indent) * 6 + var(--ag-grid-size));\n}\n\n.ag-filter-toolpanel-group-level-7 .ag-filter-toolpanel-group-level-7-header.ag-filter-toolpanel-group-title-bar {\n background-color: transparent;\n}\n.ag-ltr .ag-filter-toolpanel-group-level-7 .ag-filter-toolpanel-group-level-8-header {\n padding-left: calc(var(--ag-filter-tool-panel-group-indent) * 7 + var(--ag-grid-size));\n}\n.ag-rtl .ag-filter-toolpanel-group-level-7 .ag-filter-toolpanel-group-level-8-header {\n padding-right: calc(var(--ag-filter-tool-panel-group-indent) * 7 + var(--ag-grid-size));\n}\n\n.ag-filter-toolpanel-group-level-8 .ag-filter-toolpanel-group-level-8-header.ag-filter-toolpanel-group-title-bar {\n background-color: transparent;\n}\n.ag-ltr .ag-filter-toolpanel-group-level-8 .ag-filter-toolpanel-group-level-9-header {\n padding-left: calc(var(--ag-filter-tool-panel-group-indent) * 8 + var(--ag-grid-size));\n}\n.ag-rtl .ag-filter-toolpanel-group-level-8 .ag-filter-toolpanel-group-level-9-header {\n padding-right: calc(var(--ag-filter-tool-panel-group-indent) * 8 + var(--ag-grid-size));\n}\n\n.ag-filter-toolpanel-group-level-9 .ag-filter-toolpanel-group-level-9-header.ag-filter-toolpanel-group-title-bar {\n background-color: transparent;\n}\n.ag-ltr .ag-filter-toolpanel-group-level-9 .ag-filter-toolpanel-group-level-10-header {\n padding-left: calc(var(--ag-filter-tool-panel-group-indent) * 9 + var(--ag-grid-size));\n}\n.ag-rtl .ag-filter-toolpanel-group-level-9 .ag-filter-toolpanel-group-level-10-header {\n padding-right: calc(var(--ag-filter-tool-panel-group-indent) * 9 + var(--ag-grid-size));\n}\n\n.ag-filter-toolpanel-group-level-10 .ag-filter-toolpanel-group-level-10-header.ag-filter-toolpanel-group-title-bar {\n background-color: transparent;\n}\n.ag-ltr .ag-filter-toolpanel-group-level-10 .ag-filter-toolpanel-group-level-11-header {\n padding-left: calc(var(--ag-filter-tool-panel-group-indent) * 10 + var(--ag-grid-size));\n}\n.ag-rtl .ag-filter-toolpanel-group-level-10 .ag-filter-toolpanel-group-level-11-header {\n padding-right: calc(var(--ag-filter-tool-panel-group-indent) * 10 + var(--ag-grid-size));\n}\n\n.ag-filter-toolpanel-instance-header.ag-filter-toolpanel-group-level-1-header {\n padding-left: var(--ag-grid-size);\n}\n\n.ag-filter-toolpanel-instance-filter {\n border-bottom: var(--ag-borders) var(--ag-border-color);\n border-top: var(--ag-borders) var(--ag-border-color);\n margin-top: var(--ag-grid-size);\n}\n\n.ag-ltr .ag-filter-toolpanel-instance-header-icon {\n margin-left: var(--ag-grid-size);\n}\n.ag-rtl .ag-filter-toolpanel-instance-header-icon {\n margin-right: var(--ag-grid-size);\n}\n\n.ag-set-filter-group-icons {\n color: var(--ag-secondary-foreground-color);\n}\n\n.ag-pivot-mode-panel {\n min-height: var(--ag-header-height);\n height: var(--ag-header-height);\n display: flex;\n}\n\n.ag-pivot-mode-select {\n display: flex;\n align-items: center;\n}\n.ag-ltr .ag-pivot-mode-select {\n margin-left: var(--ag-widget-container-horizontal-padding);\n}\n.ag-rtl .ag-pivot-mode-select {\n margin-right: var(--ag-widget-container-horizontal-padding);\n}\n\n.ag-keyboard-focus .ag-column-select-header:focus {\n outline: none;\n}\n.ag-keyboard-focus .ag-column-select-header:focus::after {\n content: \"\";\n position: absolute;\n background-color: transparent;\n pointer-events: none;\n top: 4px;\n left: 4px;\n display: block;\n width: calc(100% - 8px);\n height: calc(100% - 8px);\n border: 1px solid;\n border-color: var(--ag-input-focus-border-color);\n}\n\n.ag-column-select-header {\n height: var(--ag-header-height);\n align-items: center;\n padding: 0 var(--ag-widget-container-horizontal-padding);\n border-bottom: var(--ag-borders-secondary) var(--ag-secondary-border-color);\n}\n\n.ag-column-panel-column-select {\n border-bottom: var(--ag-borders-secondary) var(--ag-secondary-border-color);\n border-top: var(--ag-borders-secondary) var(--ag-secondary-border-color);\n}\n\n.ag-column-group-icons,\n.ag-column-select-header-icon {\n color: var(--ag-secondary-foreground-color);\n}\n\n.ag-column-select-list .ag-list-item-hovered::after {\n content: \"\";\n position: absolute;\n left: 0;\n right: 0;\n height: 1px;\n background-color: var(--ag-range-selection-border-color);\n}\n.ag-column-select-list .ag-item-highlight-top::after {\n top: 0;\n}\n.ag-column-select-list .ag-item-highlight-bottom::after {\n bottom: 0;\n}\n\n.ag-header {\n background-color: var(--ag-header-background-color);\n border-bottom: var(--ag-borders-critical) var(--ag-border-color);\n}\n\n.ag-header-row {\n color: var(--ag-header-foreground-color);\n height: var(--ag-header-height);\n}\n\n.ag-pinned-right-header {\n border-left: var(--ag-borders-critical) var(--ag-border-color);\n}\n\n.ag-pinned-left-header {\n border-right: var(--ag-borders-critical) var(--ag-border-color);\n}\n\n.ag-ltr .ag-header-cell:not(.ag-right-aligned-header) .ag-header-label-icon {\n margin-left: var(--ag-grid-size);\n}\n.ag-rtl .ag-header-cell:not(.ag-right-aligned-header) .ag-header-label-icon {\n margin-right: var(--ag-grid-size);\n}\n\n.ag-ltr .ag-header-cell.ag-right-aligned-header .ag-header-label-icon {\n margin-right: var(--ag-grid-size);\n}\n.ag-rtl .ag-header-cell.ag-right-aligned-header .ag-header-label-icon {\n margin-left: var(--ag-grid-size);\n}\n\n.ag-header-cell,\n.ag-header-group-cell {\n padding-left: var(--ag-cell-horizontal-padding);\n padding-right: var(--ag-cell-horizontal-padding);\n}\n.ag-header-cell.ag-header-cell-moving,\n.ag-header-group-cell.ag-header-cell-moving {\n background-color: var(--ag-header-cell-moving-background-color);\n}\n\n.ag-header-cell.ag-header-span-height::after,\n.ag-header-cell.ag-header-span-height .ag-header-cell-resize::after {\n height: calc(100% - var(--ag-grid-size) * 4);\n top: calc(var(--ag-grid-size) * 2);\n}\n\n.ag-keyboard-focus .ag-header-cell:focus {\n outline: none;\n}\n.ag-keyboard-focus .ag-header-cell:focus::after {\n content: \"\";\n position: absolute;\n background-color: transparent;\n pointer-events: none;\n top: 4px;\n left: 4px;\n display: block;\n width: calc(100% - 8px);\n height: calc(100% - 8px);\n border: 1px solid;\n border-color: var(--ag-input-focus-border-color);\n}\n.ag-keyboard-focus .ag-header-group-cell:focus {\n outline: none;\n}\n.ag-keyboard-focus .ag-header-group-cell:focus::after {\n content: \"\";\n position: absolute;\n background-color: transparent;\n pointer-events: none;\n top: 4px;\n left: 4px;\n display: block;\n width: calc(100% - 8px);\n height: calc(100% - 8px);\n border: 1px solid;\n border-color: var(--ag-input-focus-border-color);\n}\n\n.ag-header-icon {\n color: var(--ag-secondary-foreground-color);\n}\n\n.ag-header-expand-icon {\n cursor: pointer;\n}\n.ag-ltr .ag-header-expand-icon {\n padding-left: 4px;\n}\n.ag-rtl .ag-header-expand-icon {\n padding-right: 4px;\n}\n\n.ag-header-row:not(:first-child) .ag-header-cell:not(.ag-header-span-height.ag-header-span-total),\n.ag-header-row:not(:first-child) .ag-header-group-cell.ag-header-group-cell-with-group {\n border-top: var(--ag-borders-critical) var(--ag-border-color);\n}\n\n.ag-header-group-cell:not(.ag-column-resizing) + .ag-header-group-cell:not(.ag-column-hover):not(.ag-header-cell-moving):hover, .ag-header-group-cell:not(.ag-column-resizing) + .ag-header-group-cell:not(.ag-column-hover).ag-column-resizing,\n.ag-header-cell:not(.ag-column-resizing) + .ag-header-cell:not(.ag-column-hover):not(.ag-header-cell-moving):hover,\n.ag-header-cell:not(.ag-column-resizing) + .ag-header-cell:not(.ag-column-hover).ag-column-resizing,\n.ag-header-group-cell:first-of-type:not(.ag-header-cell-moving):hover,\n.ag-header-group-cell:first-of-type.ag-column-resizing,\n.ag-header-cell:not(.ag-column-hover):first-of-type:not(.ag-header-cell-moving):hover,\n.ag-header-cell:not(.ag-column-hover):first-of-type.ag-column-resizing {\n background-color: var(--ag-header-cell-hover-background-color);\n}\n\n.ag-header-cell::after,\n.ag-header-group-cell::after {\n content: \"\";\n position: absolute;\n z-index: 1;\n display: var(--ag-header-column-separator-display);\n width: var(--ag-header-column-separator-width);\n height: var(--ag-header-column-separator-height);\n top: calc(50% - var(--ag-header-column-separator-height) * 0.5);\n background-color: var(--ag-header-column-separator-color);\n}\n.ag-ltr .ag-header-cell::after,\n.ag-ltr .ag-header-group-cell::after {\n right: 0;\n}\n.ag-rtl .ag-header-cell::after,\n.ag-rtl .ag-header-group-cell::after {\n left: 0;\n}\n\n.ag-header-cell-resize {\n display: flex;\n align-items: center;\n}\n\n.ag-header-cell-resize::after {\n content: \"\";\n position: absolute;\n z-index: 1;\n display: var(--ag-header-column-resize-handle-display);\n width: var(--ag-header-column-resize-handle-width);\n height: var(--ag-header-column-resize-handle-height);\n top: calc(50% - var(--ag-header-column-resize-handle-height) * 0.5);\n background-color: var(--ag-header-column-resize-handle-color);\n}\n\n.ag-header-cell.ag-header-span-height::after,\n.ag-header-cell.ag-header-span-height .ag-header-cell-resize::after {\n height: calc(100% - var(--ag-grid-size) * 4);\n top: calc(var(--ag-grid-size) * 2);\n}\n\n.ag-ltr .ag-header-viewport .ag-header-cell-resize::after {\n left: calc(50% - var(--ag-header-column-resize-handle-width));\n}\n.ag-rtl .ag-header-viewport .ag-header-cell-resize::after {\n right: calc(50% - var(--ag-header-column-resize-handle-width));\n}\n\n.ag-pinned-left-header .ag-header-cell-resize::after {\n left: calc(50% - var(--ag-header-column-resize-handle-width));\n}\n\n.ag-pinned-right-header .ag-header-cell-resize::after {\n left: 50%;\n}\n\n.ag-ltr .ag-header-select-all {\n margin-right: var(--ag-cell-horizontal-padding);\n}\n.ag-rtl .ag-header-select-all {\n margin-left: var(--ag-cell-horizontal-padding);\n}\n\n.ag-ltr .ag-floating-filter-button {\n margin-left: calc(var(--ag-grid-size) * 3);\n}\n.ag-rtl .ag-floating-filter-button {\n margin-right: calc(var(--ag-grid-size) * 3);\n}\n\n.ag-floating-filter-button-button {\n color: inherit;\n font-family: inherit;\n font-size: inherit;\n font-weight: inherit;\n line-height: inherit;\n appearance: none;\n background: transparent;\n border: none;\n height: var(--ag-icon-size);\n padding: 0;\n width: var(--ag-icon-size);\n}\n\n.ag-filter-loading {\n background-color: var(--ag-control-panel-background-color);\n height: 100%;\n padding: var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding);\n position: absolute;\n width: 100%;\n z-index: 1;\n}\n\n.ag-paging-panel {\n border-top: 1px solid;\n border-top-color: var(--ag-border-color);\n color: var(--ag-secondary-foreground-color);\n height: var(--ag-header-height);\n}\n.ag-paging-panel > * {\n margin: 0 var(--ag-cell-horizontal-padding);\n}\n\n.ag-paging-button {\n cursor: pointer;\n}\n\n.ag-paging-button.ag-disabled {\n cursor: default;\n color: var(--ag-disabled-foreground-color);\n}\n\n.ag-keyboard-focus .ag-paging-button:focus {\n outline: none;\n}\n.ag-keyboard-focus .ag-paging-button:focus::after {\n content: \"\";\n position: absolute;\n background-color: transparent;\n pointer-events: none;\n top: 0px;\n left: 0px;\n display: block;\n width: calc(100% - 0px);\n height: calc(100% - 0px);\n border: 1px solid;\n border-color: var(--ag-input-focus-border-color);\n}\n\n.ag-paging-button, .ag-paging-description {\n margin: 0 var(--ag-grid-size);\n}\n\n.ag-status-bar {\n border-top: var(--ag-borders) var(--ag-border-color);\n color: var(--ag-disabled-foreground-color);\n padding-right: calc(var(--ag-grid-size) * 4);\n padding-left: calc(var(--ag-grid-size) * 4);\n line-height: 1.5;\n}\n\n.ag-status-name-value-value {\n color: var(--ag-foreground-color);\n}\n\n.ag-status-bar-center {\n text-align: center;\n}\n\n.ag-status-name-value {\n margin-left: var(--ag-grid-size);\n margin-right: var(--ag-grid-size);\n padding-top: calc(var(--ag-grid-size) * 2);\n padding-bottom: calc(var(--ag-grid-size) * 2);\n}\n\n.ag-column-drop-cell {\n background: var(--ag-chip-background-color);\n border-radius: calc(var(--ag-grid-size) * 4);\n height: calc(var(--ag-grid-size) * 4);\n padding: 0 calc(var(--ag-grid-size) * 0.5);\n border: 1px solid transparent;\n}\n\n.ag-keyboard-focus .ag-column-drop-cell:focus {\n outline: none;\n}\n.ag-keyboard-focus .ag-column-drop-cell:focus::after {\n content: \"\";\n position: absolute;\n background-color: transparent;\n pointer-events: none;\n top: 2px;\n left: 2px;\n display: block;\n width: calc(100% - 4px);\n height: calc(100% - 4px);\n border: 1px solid;\n border-color: var(--ag-input-focus-border-color);\n}\n\n.ag-column-drop-cell-text {\n margin: 0 var(--ag-grid-size);\n}\n\n.ag-column-drop-cell-button {\n min-width: calc(var(--ag-grid-size) * 4);\n margin: 0 calc(var(--ag-grid-size) * 0.5);\n color: var(--ag-secondary-foreground-color);\n}\n\n.ag-column-drop-cell-drag-handle {\n margin-left: calc(var(--ag-grid-size) * 2);\n}\n\n.ag-column-drop-cell-ghost {\n opacity: 0.5;\n}\n\n.ag-column-drop-horizontal {\n background-color: var(--ag-control-panel-background-color);\n color: var(--ag-secondary-foreground-color);\n height: var(--ag-row-height);\n border-bottom: var(--ag-borders) var(--ag-border-color);\n}\n.ag-ltr .ag-column-drop-horizontal {\n padding-left: var(--ag-cell-horizontal-padding);\n}\n.ag-rtl .ag-column-drop-horizontal {\n padding-right: var(--ag-cell-horizontal-padding);\n}\n\n.ag-ltr .ag-column-drop-horizontal-half-width:not(:last-child) {\n border-right: var(--ag-borders) var(--ag-border-color);\n}\n.ag-rtl .ag-column-drop-horizontal-half-width:not(:last-child) {\n border-left: var(--ag-borders) var(--ag-border-color);\n}\n\n.ag-column-drop-horizontal-cell-separator {\n margin: 0 var(--ag-grid-size);\n color: var(--ag-secondary-foreground-color);\n}\n\n.ag-column-drop-horizontal-empty-message {\n color: var(--ag-disabled-foreground-color);\n}\n\n.ag-ltr .ag-column-drop-horizontal-icon {\n margin-right: var(--ag-cell-horizontal-padding);\n}\n.ag-rtl .ag-column-drop-horizontal-icon {\n margin-left: var(--ag-cell-horizontal-padding);\n}\n\n.ag-column-drop-vertical-list {\n padding-bottom: var(--ag-grid-size);\n padding-right: var(--ag-grid-size);\n padding-left: var(--ag-grid-size);\n}\n\n.ag-column-drop-vertical-cell {\n margin-top: var(--ag-grid-size);\n}\n\n.ag-column-drop-vertical {\n min-height: 50px;\n border-bottom: var(--ag-borders-secondary) var(--ag-secondary-border-color);\n}\n.ag-column-drop-vertical.ag-last-column-drop {\n border-bottom: none;\n}\n\n.ag-column-drop-vertical-icon {\n margin-left: var(--ag-grid-size);\n margin-right: var(--ag-grid-size);\n}\n\n.ag-column-drop-vertical-empty-message {\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n overflow: hidden;\n color: var(--ag-disabled-foreground-color);\n margin-top: var(--ag-grid-size);\n}\n\n.ag-select-agg-func-popup {\n border: var(--ag-borders) var(--ag-border-color);\n background: var(--ag-background-color);\n border-radius: var(--ag-card-radius);\n box-shadow: var(--ag-card-shadow);\n padding: var(--ag-grid-size);\n background: var(--ag-background-color);\n height: calc(var(--ag-grid-size) * 5 * 3.5);\n padding: 0;\n}\n\n.ag-select-agg-func-virtual-list-item {\n cursor: default;\n padding-left: calc(var(--ag-grid-size) * 2);\n}\n.ag-select-agg-func-virtual-list-item:hover {\n background-color: var(--ag-selected-row-background-color);\n}\n\n.ag-keyboard-focus .ag-select-agg-func-virtual-list-item:focus {\n outline: none;\n}\n.ag-keyboard-focus .ag-select-agg-func-virtual-list-item:focus::after {\n content: \"\";\n position: absolute;\n background-color: transparent;\n pointer-events: none;\n top: 1px;\n left: 1px;\n display: block;\n width: calc(100% - 2px);\n height: calc(100% - 2px);\n border: 1px solid;\n border-color: var(--ag-input-focus-border-color);\n}\n\n.ag-sort-indicator-container {\n display: flex;\n}\n\n.ag-ltr .ag-sort-indicator-icon {\n padding-left: var(--ag-grid-size);\n}\n.ag-rtl .ag-sort-indicator-icon {\n padding-right: var(--ag-grid-size);\n}\n\n.ag-chart {\n position: relative;\n display: flex;\n overflow: hidden;\n width: 100%;\n height: 100%;\n}\n\n.ag-chart-components-wrapper {\n position: relative;\n display: flex;\n flex: 1 1 auto;\n overflow: hidden;\n}\n\n.ag-chart-title-edit {\n position: absolute;\n display: none;\n top: 0;\n left: 0;\n text-align: center;\n}\n\n.ag-chart-title-edit.currently-editing {\n display: inline-block;\n}\n\n.ag-chart-canvas-wrapper {\n position: relative;\n flex: 1 1 auto;\n overflow: hidden;\n}\n\n.ag-charts-canvas {\n display: block;\n}\n\n.ag-chart-menu {\n position: absolute;\n top: 10px;\n width: 24px;\n overflow: hidden;\n display: flex;\n flex-direction: column;\n}\n.ag-ltr .ag-chart-menu {\n right: 20px;\n}\n.ag-rtl .ag-chart-menu {\n left: 20px;\n}\n\n.ag-chart-docked-container {\n position: relative;\n width: 0;\n min-width: 0;\n transition: min-width 0.4s;\n}\n\n.ag-chart-menu-hidden ~ .ag-chart-docked-container {\n max-width: 0;\n overflow: hidden;\n}\n\n.ag-chart-tabbed-menu {\n width: 100%;\n height: 100%;\n display: flex;\n flex-direction: column;\n overflow: hidden;\n}\n\n.ag-chart-tabbed-menu-header {\n flex: none;\n user-select: none;\n cursor: default;\n}\n\n.ag-chart-tabbed-menu-body {\n display: flex;\n flex: 1 1 auto;\n align-items: stretch;\n overflow: hidden;\n}\n\n.ag-chart-tab {\n width: 100%;\n overflow: hidden;\n overflow-y: auto;\n}\n\n.ag-chart-settings {\n overflow-x: hidden;\n}\n\n.ag-chart-settings-wrapper {\n position: relative;\n flex-direction: column;\n width: 100%;\n height: 100%;\n display: flex;\n overflow: hidden;\n}\n\n.ag-chart-settings-nav-bar {\n display: flex;\n align-items: center;\n width: 100%;\n height: 30px;\n padding: 0 10px;\n user-select: none;\n}\n\n.ag-chart-settings-card-selector {\n display: flex;\n align-items: center;\n justify-content: space-around;\n flex: 1 1 auto;\n height: 100%;\n padding: 0 10px;\n}\n\n.ag-chart-settings-card-item {\n cursor: pointer;\n width: 10px;\n height: 10px;\n background-color: #000;\n position: relative;\n}\n.ag-chart-settings-card-item.ag-not-selected {\n opacity: 0.2;\n}\n.ag-chart-settings-card-item::before {\n content: \" \";\n display: block;\n position: absolute;\n background-color: transparent;\n left: 50%;\n top: 50%;\n margin-left: -10px;\n margin-top: -10px;\n width: 20px;\n height: 20px;\n}\n\n.ag-chart-settings-prev,\n.ag-chart-settings-next {\n position: relative;\n flex: none;\n}\n\n.ag-chart-settings-prev-button,\n.ag-chart-settings-next-button {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n cursor: pointer;\n opacity: 0;\n}\n\n.ag-chart-settings-mini-charts-container {\n position: relative;\n flex: 1 1 auto;\n overflow-x: hidden;\n overflow-y: auto;\n}\n\n.ag-chart-settings-mini-wrapper {\n position: absolute;\n top: 0;\n left: 0;\n display: flex;\n flex-direction: column;\n width: 100%;\n min-height: 100%;\n overflow: hidden;\n}\n.ag-chart-settings-mini-wrapper.ag-animating {\n transition: left 0.3s;\n transition-timing-function: ease-in-out;\n}\n\n.ag-chart-mini-thumbnail {\n cursor: pointer;\n}\n\n.ag-chart-mini-thumbnail-canvas {\n display: block;\n}\n\n.ag-chart-data-wrapper,\n.ag-chart-format-wrapper {\n display: flex;\n flex-direction: column;\n position: relative;\n user-select: none;\n}\n\n.ag-chart-data-wrapper {\n height: 100%;\n overflow-y: auto;\n}\n\n.ag-chart-data-section,\n.ag-chart-format-section {\n display: flex;\n margin: 0;\n}\n\n.ag-chart-empty-text {\n display: flex;\n top: 0;\n width: 100%;\n height: 100%;\n align-items: center;\n justify-content: center;\n}\n\n.ag-chart .ag-chart-menu {\n display: none;\n}\n\n.ag-chart-menu-hidden:hover .ag-chart-menu {\n display: block;\n}\n\n.ag-chart .ag-chart-tool-panel-button-enable .ag-chart-menu {\n display: flex;\n flex-direction: row;\n overflow: auto;\n top: 5px;\n gap: calc(var(--ag-grid-size) * 3 - 8px);\n width: auto;\n}\n.ag-ltr .ag-chart .ag-chart-tool-panel-button-enable .ag-chart-menu {\n right: calc(var(--ag-cell-horizontal-padding) + var(--ag-grid-size) - 4px);\n justify-content: right;\n}\n.ag-rtl .ag-chart .ag-chart-tool-panel-button-enable .ag-chart-menu {\n left: calc(var(--ag-cell-horizontal-padding) + var(--ag-grid-size) - 4px);\n justify-content: left;\n}\n\n.ag-chart-menu-close {\n display: none;\n}\n\n.ag-chart-tool-panel-button-enable .ag-chart-menu-close {\n position: absolute;\n top: 50%;\n transition: transform 0.33s ease-in-out;\n padding: 0;\n display: block;\n cursor: pointer;\n border: none;\n}\n.ag-ltr .ag-chart-tool-panel-button-enable .ag-chart-menu-close {\n right: 0px;\n}\n.ag-rtl .ag-chart-tool-panel-button-enable .ag-chart-menu-close {\n left: 0px;\n}\n.ag-chart-tool-panel-button-enable .ag-chart-menu-close .ag-icon {\n padding: 14px 5px 14px 2px;\n}\n.ag-chart-tool-panel-button-enable .ag-chart-menu-close:before {\n content: \"\";\n position: absolute;\n top: -40px;\n bottom: -40px;\n}\n.ag-ltr .ag-chart-tool-panel-button-enable .ag-chart-menu-close:before {\n right: 0px;\n}\n.ag-rtl .ag-chart-tool-panel-button-enable .ag-chart-menu-close:before {\n left: 0px;\n}\n.ag-ltr .ag-chart-tool-panel-button-enable .ag-chart-menu-close:before {\n left: -10px;\n}\n.ag-rtl .ag-chart-tool-panel-button-enable .ag-chart-menu-close:before {\n right: -10px;\n}\n.ag-chart-tool-panel-button-enable .ag-icon-menu {\n display: none;\n}\n\n.ag-ltr .ag-chart-tool-panel-button-enable .ag-chart-menu-close {\n transform: translate(3px, -50%);\n}\n.ag-ltr .ag-chart-tool-panel-button-enable .ag-chart-menu-close:hover {\n transform: translate(0, -50%);\n}\n.ag-ltr .ag-chart-menu-visible .ag-chart-tool-panel-button-enable .ag-chart-menu-close:hover {\n transform: translate(5px, -50%);\n}\n\n.ag-rtl .ag-chart-tool-panel-button-enable .ag-chart-menu-close {\n transform: translate(-3px, -50%);\n}\n.ag-rtl .ag-chart-tool-panel-button-enable .ag-chart-menu-close:hover {\n transform: translate(0, -50%);\n}\n.ag-rtl .ag-chart-menu-visible .ag-chart-tool-panel-button-enable .ag-chart-menu-close:hover {\n transform: translate(-5px, -50%);\n}\n\n.ag-charts-font-size-color {\n display: flex;\n align-self: stretch;\n justify-content: space-between;\n}\n\n.ag-charts-data-group-item {\n position: relative;\n}\n\n.ag-chart-menu {\n border-radius: var(--ag-card-radius);\n background: var(--ag-background-color);\n}\n\n.ag-chart-menu-icon {\n opacity: 0.5;\n line-height: 24px;\n font-size: 24px;\n width: 24px;\n height: 24px;\n margin: 2px 0;\n cursor: pointer;\n border-radius: var(--ag-card-radius);\n color: var(--ag-secondary-foreground-color);\n}\n.ag-chart-menu-icon:hover {\n opacity: 1;\n}\n\n.ag-chart-mini-thumbnail {\n border: 1px solid var(--ag-secondary-border-color);\n border-radius: 5px;\n margin: 5px;\n}\n.ag-chart-mini-thumbnail:nth-last-child(3), .ag-chart-mini-thumbnail:nth-last-child(3) ~ .ag-chart-mini-thumbnail {\n margin-left: auto;\n margin-right: auto;\n}\n.ag-ltr .ag-chart-mini-thumbnail:first-child {\n margin-left: 0;\n}\n.ag-rtl .ag-chart-mini-thumbnail:first-child {\n margin-right: 0;\n}\n.ag-ltr .ag-chart-mini-thumbnail:last-child {\n margin-right: 0;\n}\n.ag-rtl .ag-chart-mini-thumbnail:last-child {\n margin-left: 0;\n}\n.ag-chart-mini-thumbnail.ag-selected {\n border-color: var(--ag-minichart-selected-chart-color);\n}\n\n.ag-chart-settings-card-item {\n background: var(--ag-foreground-color);\n width: 8px;\n height: 8px;\n border-radius: 4px;\n}\n.ag-chart-settings-card-item.ag-selected {\n background-color: var(--ag-minichart-selected-page-color);\n}\n\n.ag-chart-data-column-drag-handle {\n margin-left: var(--ag-grid-size);\n}\n\n.ag-charts-settings-group-title-bar,\n.ag-charts-data-group-title-bar,\n.ag-charts-format-top-level-group-title-bar {\n border-top: var(--ag-borders-secondary) var(--ag-secondary-border-color);\n}\n\n.ag-charts-settings-group-container {\n padding: var(--ag-grid-size);\n}\n\n.ag-charts-data-group-container {\n padding: calc(var(--ag-widget-container-vertical-padding) * 0.5) var(--ag-widget-container-horizontal-padding);\n}\n.ag-charts-data-group-container .ag-charts-data-group-item:not(.ag-charts-format-sub-level-group) {\n height: var(--ag-list-item-height);\n}\n.ag-charts-data-group-container .ag-list-item-hovered::after {\n content: \"\";\n position: absolute;\n left: 0;\n right: 0;\n height: 1px;\n background-color: var(--ag-range-selection-border-color);\n}\n.ag-charts-data-group-container .ag-item-highlight-top::after {\n top: 0;\n}\n.ag-charts-data-group-container .ag-item-highlight-bottom::after {\n bottom: 0;\n}\n\n.ag-charts-format-top-level-group-container {\n margin-left: calc(var(--ag-grid-size) * 2);\n padding: var(--ag-grid-size);\n}\n\n.ag-charts-format-top-level-group-item {\n margin: var(--ag-grid-size) 0;\n}\n\n.ag-charts-format-sub-level-group-container {\n padding: var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding);\n padding-bottom: calc(var(--ag-widget-container-vertical-padding) - var(--ag-widget-vertical-spacing));\n}\n.ag-charts-format-sub-level-group-container > * {\n margin-bottom: var(--ag-widget-vertical-spacing);\n}\n\n.ag-charts-group-container.ag-group-container-horizontal {\n padding: var(--ag-grid-size);\n}\n\n.ag-chart-data-section,\n.ag-chart-format-section {\n display: flex;\n margin: 0;\n}\n\n.ag-chart-menu-panel {\n background-color: var(--ag-control-panel-background-color);\n}\n.ag-ltr .ag-chart-menu-panel {\n border-left: solid 1px var(--ag-border-color);\n}\n.ag-rtl .ag-chart-menu-panel {\n border-right: solid 1px var(--ag-border-color);\n}\n\n.ag-date-time-list-page-title-bar {\n display: flex;\n}\n\n.ag-date-time-list-page-title {\n flex-grow: 1;\n text-align: center;\n}\n\n.ag-date-time-list-page-column-labels-row,\n.ag-date-time-list-page-entries-row {\n display: flex;\n}\n\n.ag-date-time-list-page-column-label,\n.ag-date-time-list-page-entry {\n flex-basis: 0;\n flex-grow: 1;\n}\n\n.ag-date-time-list-page-entry {\n cursor: pointer;\n text-align: center;\n}\n\n.ag-date-time-list-page-column-label {\n text-align: center;\n}\n\n.ag-input-field-input {\n width: 100%;\n min-width: 0;\n}\n\n.ag-checkbox-input-wrapper {\n font-family: var(--ag-icon-font-family);\n font-size: var(--ag-icon-size);\n line-height: var(--ag-icon-size);\n font-style: normal;\n font-weight: normal;\n font-variant: normal;\n text-transform: none;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n width: var(--ag-icon-size);\n height: var(--ag-icon-size);\n background-color: var(--ag-checkbox-background-color);\n border-radius: var(--ag-checkbox-border-radius);\n display: inline-block;\n vertical-align: middle;\n flex: none;\n}\n.ag-checkbox-input-wrapper input, .ag-checkbox-input-wrapper input {\n -webkit-appearance: none;\n opacity: 0;\n width: 100%;\n height: 100%;\n}\n.ag-checkbox-input-wrapper:focus-within, .ag-checkbox-input-wrapper:active {\n outline: none;\n box-shadow: var(--ag-input-focus-box-shadow);\n}\n.ag-checkbox-input-wrapper.ag-disabled {\n opacity: 0.5;\n}\n.ag-checkbox-input-wrapper::after {\n content: var(--ag-icon-font-code-checkbox-unchecked, \"\\f108\");\n color: var(--ag-checkbox-unchecked-color);\n position: absolute;\n top: 0;\n left: 0;\n pointer-events: none;\n}\n.ag-checkbox-input-wrapper.ag-checked::after {\n content: var(--ag-icon-font-code-checkbox-checked, \"\\f106\");\n color: var(--ag-checkbox-checked-color);\n position: absolute;\n top: 0;\n left: 0;\n pointer-events: none;\n}\n.ag-checkbox-input-wrapper.ag-indeterminate::after {\n content: var(--ag-icon-font-code-checkbox-indeterminate, \"\\f107\");\n color: var(--ag-checkbox-indeterminate-color);\n position: absolute;\n top: 0;\n left: 0;\n pointer-events: none;\n}\n\n.ag-toggle-button-input-wrapper {\n box-sizing: border-box;\n width: var(--ag-toggle-button-width);\n height: var(--ag-toggle-button-height);\n background-color: var(--ag-toggle-button-off-background-color);\n border-radius: calc(var(--ag-toggle-button-height) * 0.5);\n position: relative;\n flex: none;\n border: var(--ag-toggle-button-border-width) solid;\n border-color: var(--ag-toggle-button-off-border-color);\n}\n.ag-toggle-button-input-wrapper input {\n opacity: 0;\n height: 100%;\n width: 100%;\n}\n.ag-toggle-button-input-wrapper:focus-within {\n outline: none;\n box-shadow: var(--ag-input-focus-box-shadow);\n}\n.ag-toggle-button-input-wrapper.ag-disabled {\n opacity: 0.5;\n}\n.ag-toggle-button-input-wrapper.ag-checked {\n background-color: var(--ag-toggle-button-on-background-color);\n border-color: var(--ag-toggle-button-on-border-color);\n}\n.ag-toggle-button-input-wrapper::before {\n content: \" \";\n position: absolute;\n top: calc(0px - var(--ag-toggle-button-border-width));\n left: calc(0px - var(--ag-toggle-button-border-width));\n display: block;\n box-sizing: border-box;\n height: var(--ag-toggle-button-height);\n width: var(--ag-toggle-button-height);\n background-color: var(--ag-toggle-button-switch-background-color);\n border-radius: 100%;\n transition: left 100ms;\n border: var(--ag-toggle-button-border-width) solid;\n border-color: var(--ag-toggle-button-switch-border-color);\n}\n.ag-toggle-button-input-wrapper.ag-checked::before {\n left: calc(100% - var(--ag-toggle-button-height));\n border-color: var(--ag-toggle-button-on-border-color);\n}\n\n.ag-radio-button-input-wrapper {\n font-family: var(--ag-icon-font-family);\n font-size: var(--ag-icon-size);\n line-height: var(--ag-icon-size);\n font-style: normal;\n font-weight: normal;\n font-variant: normal;\n text-transform: none;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n width: var(--ag-icon-size);\n height: var(--ag-icon-size);\n background-color: var(--ag-checkbox-background-color);\n border-radius: var(--ag-checkbox-border-radius);\n display: inline-block;\n vertical-align: middle;\n flex: none;\n border-radius: var(--ag-icon-size);\n}\n.ag-radio-button-input-wrapper input, .ag-radio-button-input-wrapper input {\n -webkit-appearance: none;\n opacity: 0;\n width: 100%;\n height: 100%;\n}\n.ag-radio-button-input-wrapper:focus-within, .ag-radio-button-input-wrapper:active {\n outline: none;\n box-shadow: var(--ag-input-focus-box-shadow);\n}\n.ag-radio-button-input-wrapper.ag-disabled {\n opacity: 0.5;\n}\n.ag-radio-button-input-wrapper::after {\n content: var(--ag-icon-font-code-radio-button-off, \"\\f127\");\n color: var(--ag-checkbox-unchecked-color);\n position: absolute;\n top: 0;\n left: 0;\n pointer-events: none;\n}\n.ag-radio-button-input-wrapper.ag-checked::after {\n content: var(--ag-icon-font-code-radio-button-on, \"\\f128\");\n color: var(--ag-checkbox-checked-color);\n position: absolute;\n top: 0;\n left: 0;\n pointer-events: none;\n}\n\ninput[class^=ag-][type=range] {\n -webkit-appearance: none;\n width: 100%;\n height: 100%;\n background: none;\n overflow: visible;\n}\ninput[class^=ag-][type=range]::-webkit-slider-runnable-track {\n margin: 0;\n padding: 0;\n width: 100%;\n height: 3px;\n background-color: var(--ag-border-color);\n border-radius: var(--ag-border-radius);\n border-radius: var(--ag-checkbox-border-radius);\n}\ninput[class^=ag-][type=range]::-moz-range-track {\n margin: 0;\n padding: 0;\n width: 100%;\n height: 3px;\n background-color: var(--ag-border-color);\n border-radius: var(--ag-border-radius);\n border-radius: var(--ag-checkbox-border-radius);\n}\ninput[class^=ag-][type=range]::-ms-track {\n margin: 0;\n padding: 0;\n width: 100%;\n height: 3px;\n background-color: var(--ag-border-color);\n border-radius: var(--ag-border-radius);\n border-radius: var(--ag-checkbox-border-radius);\n color: transparent;\n width: calc(100% - 2px);\n}\ninput[class^=ag-][type=range]::-webkit-slider-thumb {\n margin: 0;\n padding: 0;\n -webkit-appearance: none;\n width: var(--ag-icon-size);\n height: var(--ag-icon-size);\n background-color: var(--ag-background-color);\n border: 1px solid;\n border-color: var(--ag-checkbox-unchecked-color);\n border-radius: var(--ag-icon-size);\n transform: translateY(calc(var(--ag-icon-size) * -0.5 + 1.5px));\n}\ninput[class^=ag-][type=range]::-ms-thumb {\n margin: 0;\n padding: 0;\n -webkit-appearance: none;\n width: var(--ag-icon-size);\n height: var(--ag-icon-size);\n background-color: var(--ag-background-color);\n border: 1px solid;\n border-color: var(--ag-checkbox-unchecked-color);\n border-radius: var(--ag-icon-size);\n}\ninput[class^=ag-][type=range]::-moz-ag-range-thumb {\n margin: 0;\n padding: 0;\n -webkit-appearance: none;\n width: var(--ag-icon-size);\n height: var(--ag-icon-size);\n background-color: var(--ag-background-color);\n border: 1px solid;\n border-color: var(--ag-checkbox-unchecked-color);\n border-radius: var(--ag-icon-size);\n}\ninput[class^=ag-][type=range]:focus {\n outline: none;\n}\ninput[class^=ag-][type=range]:focus::-webkit-slider-thumb {\n box-shadow: var(--ag-input-focus-box-shadow);\n border-color: var(--ag-checkbox-checked-color);\n}\ninput[class^=ag-][type=range]:focus::-ms-thumb {\n box-shadow: var(--ag-input-focus-box-shadow);\n border-color: var(--ag-checkbox-checked-color);\n}\ninput[class^=ag-][type=range]:focus::-moz-ag-range-thumb {\n box-shadow: var(--ag-input-focus-box-shadow);\n border-color: var(--ag-checkbox-checked-color);\n}\ninput[class^=ag-][type=range]:active::-webkit-slider-runnable-track {\n background-color: var(--ag-input-focus-border-color);\n}\ninput[class^=ag-][type=range]:active::-moz-ag-range-track {\n background-color: var(--ag-input-focus-border-color);\n}\ninput[class^=ag-][type=range]:active::-ms-track {\n background-color: var(--ag-input-focus-border-color);\n}\ninput[class^=ag-][type=range]:disabled {\n opacity: 0.5;\n}\n", ""]); // Exports module.exports = exports; /***/ }), /***/ "./node_modules/css-loader/dist/cjs.js!./node_modules/ag-grid-community/styles/ag-theme-alpine.css": /***/ (function(module, exports, __webpack_require__) { // Imports var ___CSS_LOADER_API_IMPORT___ = __webpack_require__("./node_modules/css-loader/dist/runtime/api.js"); exports = ___CSS_LOADER_API_IMPORT___(false); // Module exports.push([module.i, "@font-face {\n font-family: \"agGridAlpine\";\n src: url(data:font/woff2;charset=utf-8;base64,d09GMgABAAAAABIkAAsAAAAAJkAAABHTAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHIkABmAAiyoKp0ygSgE2AiQDgjALgRoABCAFhEYHhRwbXyFFIbBxAJDYv7AiqieV7P96QZO4Gu9qEMLAgorXqyjcVJKxQxvbtQieEq6u3unbTP3JwOa8v9MeN5Q8Caix/+09wyXRVJ6IfU2IWoiiiWgSIp5JhMSQaX44l/dN+kSUcPER5OzkhHT7gd9m7/PN/wkLMCowCmy8M+qHlXA73abzZiEb3DVcFEavrFyzTvMyXLeieOl4CQlIYbBNxUopM8Nip4zZ0vd82bEQmAQkTsiVYMv9DdPoIJ9DCT5BRcD/P/dqmWTV4A1khZ6f04HXNve+mwJnKdEvp5wBsgWC/5ues98OENRmp4Dl3IQnoXcm1Jydm/+MzfZ0da0rjEJkDPufQ66CYNqwBz9fhdkubhpvRgCmW3MZ9WZ/0uxT+y+dsRzmrRhA3DGcOn50v6mbLFgQE4TvcWyxpK4fl3wNVrgUXkcWRp2jpdEz0efRd9H/kLC2pYAY6p8bw1GEICmaIYgthlYsNmTaHE5dVpnJdT5rWQJjpIs2p6m7ldKIo45RDyqaUsSD6yDj7q/uKinhvdMmTBLlEbCopjVbTsRV0kGei7DXN54VtteylXaUdDSPaa+Ac+UhaYEJNa52HUV2kA3cQVq+tcAxp7Qg6+K2mETrApdi6y3eLMI7dcZFkraCSQ6fzNip7qiKcLCVq+hvOa+AcXspHXiIvvxUcX3a1wHrxZzkxYFOPnjf2Xg8Ude1oja/f90i7i5lKbx40E0ta2DETVJc1dUZ9731xTff/fQfAlOFFHn4ADa/ImNPzMrDspK+zTTH3fmko4S0xESEddPEKWoamIMWga2TmJgoWgsM4TRYdzRdSNbprCHLhgWnnE8zmBjTQzBCwjSHsNniQK3NttnmW3czBzI2JyyqamyrrpUbo0ujalAu3kWxjDzTJqyQU1wXgKVTps2ZdOequYYwYi9NleshqbVeXtI50VQwtbP69rfCNLch55ioujFqKGxo4mYj7c/yesxOmNzAPsTNyMw+pNzaEJRX6LjuTpooygim0BCQROxcCPpaO1xHDSO5mK5Y5GG4Lw4iNyIfcJu9+/DD5sAAEWaUd0mjRxqHfLH+F0FXsSNWFX9FGg/mYsDpOQqsA2IgMl1cHmJQWLcOEuU9GOwfM4UZsIU/59z49b95g/V+nXThF1LJnhHE/dZ1QxxYnrlTMF9xt6IhJF+RyJoCJwPOOJecvbaewIBgpuDiQsMiomLiEpJS0jKyctRai0rKKvhFWFPX0NTS1tHV0zcwNDI2MTUzt7C00ra2sQUhwRvONbatFefI79QbbmnxpFVf//15cb7l9tcep/1MQPQxGvpYv1cOfT/YVuAAq+AgKwCHWB2HWRI4wro4yrYBx1gJOM7SwElWxilWBE6zBs6wLHCWZYBzrIULbDtwkeWBSywFXGZNXGEdXGU54Bqr4jpr48bAHr+AvkSAEAVCDAhxICSAkARCChBSgZAGhHQgZAAhEwhZQMgGQg4QcoGQB4R8IBQAoRAIRUAoBkIJEEqBUAaEciBUAKESCFVAqAZCDRBqgVAHhHogNAChEQhNQGgGQgsQWoHQBoR2IHQAoRMIXUDoBkIP1K7TC/SmDwj9AEiyyBPxCDeJ32Jq/L5SuCTQgA+9YgrDr0OwVUVexYVeyFNcwF0FuoE0V1IcHYu52gT+0kXBK4nr6el0CcZlMiPM9IKDQY100KueobGOYYxqXmE2bizVAIvs3nqFKcc2YSnyk3Q66OkY8nTCVJah4UHTi65clskzVJytzLmz0OWG+nq6ehZcVgN2CUBdufG7YapTyZhAEsBCmDTFKiHIKIpeKyIJIV1OElQuSUcvo0RIF3kpyKIZOErmSCplKmKxYhTkUoyaXolRUsvfwaJMisimqRySziJkuA5G4YBJcQYmM1KdmYYUM2dxY/X5OURfOXuuSUKTUvLpEAvZCEemZ6S/uQf1kkyysiqfJsnvzYbNx8FV9QKi9O3ylLF1OaUYAy/Yp+PoaciqKjvhIGOqrgDDdVlkUKq4irNkPegq57Eipi6rWqrHMyGppKQSWtZGLfNK70FU8OU882IMadJnkR3cThwvKld0DA9jqsHRrq4+RLltSour902A71VtvK5RTDUNekfUY1bt7WoNqRjfi6lc227klPfOTg2uHkOUXYO8wdFJ5dTYMHeMdJ7lvq1LNQw0Gq7LDq7m3YIm6XY+omzVKGDi++/FrjYexeNdwt5ZLWnrH9vFXdPkSZeWFIuLquVlRBlPESMzkDpP5coKrg4uU+0dV0zsU2unlJP7a1RXiPGinJeSBe19ozvNZNkEOtaEyqyS9jSDpjpmVw7h6hELkuYPSG6xBbgTpKbTru2qQR7Vtr63Y6pRRLleIs0iyOpsEbnSrrMmuWbTi1HRUdmL2OLyMsXjz62Qexf9l2YprqazKVG6XCaisrR9qPEmV+jlrFDVq1cCY3GRkEovXwl+GbHYL4PilZUK5dJH8W1lBBAohXBqSMhB6HqKziZICc7AaAzByf2crEsnlgETqQA2kueLAAWoywPhAIuVlpBEliUohuuZSWdXVuVQrALl8ct4Rd4KNSy9dAwh50x3FRjg6otHl45cwKC2tRbjYChuC/a1mVROBRNh1eyBjmFtHkr5EgPF4fqz4DIWA0NuMjCZ0evIPq2gIKUKZLbn3UsbKSKaJkmCEpH0DMysVEbyRHQf/XxVHlquUi0LpQeXQFFpDBnWd0l1wRqbBwGcc2OqRxTDqlHl2Bq2Lg4sBJdS/Hb/VZgS70mk+/zGIof4Ve7j7ntDCK7GYov3eJgzRQirt5t1cC2IU4IT7lX8MbtuR0uaq8E1/CErSrZracnmx9yexUXBH+W7l5dtfyroX1kJ/buMrbNE71mwW6lRcHuvBrsgUrPXE+QZryHAuK83Dzja7GToaa8xu3UKBxyhFu1xhFaprlgTOIJXAG7bNx9Svh0TAE6fwgBvnA5l8HzFV3wlrzKbVDSoS1RTo/aeqieNT83co86TR95gAusmS1J/b6/lALsa18FKLKl5ZVWFVFIgvSxS8j0JXcLNbCTmGDUaxEjQuyjIOr+CrPdPYCS+gTyzCFdPP+XcZTcSyJ0tp8H3b5+HomdemfChsI0ZbXD9VUCKUO2xrGivk03b1tZH07k08kT6JVFe0Z5h8EHX6uoL4sX/q6Op8AJ28Zq60rDikJDisNK/WtobLw4pDfsrJ33yOzXfF3QiVRNeBVhVsOSBcu0z+XN5Q4O8UQ6h361itj7ztmfxvI8t3h8HJ4zLTUs7fWrHjrR0setzL+9ab356MzZX5T+wXugerh8dGOgqL2cwoqNO17WdPnV6Knp8/IvrpIUjJIKjBXHjCwi88rwuqG5XazcytQ0Hn8Ya4Nf7hM3Y0F+fnSN4oYceOoGjmBA/bM0+7whOYkdwZCWOYicot13nxefhQXBuXlxcXsorGUos0XKdE4TM/y+t2rhemTCDuEndAtwkbiH7/2vip3NXrP5uaPoMWTRwjzH6CVk/sMz80mbezEga8Lw/get4YiNqyo90NTHsYzVHvRfE4c8F2u+vsqdpi03s3mm2hTmXZ8M+99AE/4Ld8k7tDaYxZcIe4D8K2Qq+Zn/xTFp1Grn9rDUR6X/amrAM84fjeLztp0x6Ir/w3O+hNfcEbjPekIrpmgsWzNe1c/YWmQde9DXA+k3qYIIZvOlQyErOpYXYGI8gMiCQlHQMGSg5fgAZJIwpayqqdyuwD8prEtdABgS52gykWJ7tCe4+G7yvO7hnH4q4NWY0prsWXWnk288F2nai4hAIjB+a0FQZmac3fzq36e13v6h5myfiGDs+icwT5fVdJU4YcPyYxqlpNTlNh743+cLczDyY3kQ1B3+ia8Cx55hArTZ0ZoXdfv5eHv62C1qxmHQvobrj61usMzw8Q+ILj13UVhUGVlPQnVDfbJUREZ6SVllqcCE+O8AiprRcEZKclew00hfslezhkeQVjOmXNAblxB7FRJBYnBbhlG8eUyZR8wWg5uIt/aQ732hfdUVpuUWM+pgR/1hl1Ld0x080OZ+HdbKVVUb4x92e2qSWdhoZGhAy2+aSnv3a3FUjmsoS/jS73ur58Sd4LDh8qHB0MJZzD4iHBNj02HKhtlUkF+1vDRcVKMwPI1quwUudMEwYqhUFilp3yUXyWSqUP2sNrJMNojBR67Mk7CothruzDWLjsqXAxPbF6urI5MHIc+kVtj5wspx1GswYDC8JDS3e0NKG8FRPTrOWTiMe6UR6w45FMSR6VgkvqXMDlqmC1E9dHj+WJHoeEknyogSpgrmUzML6dNb1kJKMoCuVvMMuYWNj7q8IEhuLIL/qL5g+IvJ+8fQLBF4NrxPWyetE+/WFdSDc5S4fMr18lgX4OT6jr7yhR8JC4R+bu6HaE3leH0VT5dXtSg8OFHineqWkeKV6F4RLnbbMz1s6SVNNkRZe1hsEfFA9ufgq89WJKUdw7N5TMrMkGX/i9IkjXnzBreRuQj4gJyBT/s03BpYR6erTXavvlpd+PRwltP3BxiZl119JSdJKXR1z54iMU+9qNH//rf3nS7+vZuWPuruLNphgFhYbK3j69cbfa+q/w/9Y5t9bWIAA05HaBA+PBH3UujT9kP5QG8wCzd/D5hfhobd1bxk4BJkY3HpywZhjEuRwV7aP3aEliBxC+2mtu0dSomfde59qk/eI0HbeFfC+XTIMsUnSb93UchDe0pFvFj4VpGzUgeIWkeiArLUFUe7bhjEd/nXr5kOtteJNm2Hi3ugrqjHy6tXoul+VFLrmuqhULrmuhRda2ukq1X3Vha4XOO71Kj5cWxiSJxDkhRT+lFJuPE9QGPJTris8uJWwIS5uw6chRdqn4V8X/6yZcrv42JGXsqSZUAz/rF493qxzp0XTYbeEgUL4p4udVqXgMYeeEtiQ+k/WP6mc81tj+eRJXFxEuK1tbCxoY+uK6+DehFlmdIWSVAjHj88iBzwkoetChLAsKtxmvsR9R2FOjoG4WqloF78TEz7fbsdhJe4BSdoRG4qLkpMHB4P27oPWzW/evN78B3jNGLdRnzcvKgS9NQQAABqnMk0jSSTYabMJrYTmkyqPplkCqkAPa1/HKABvXqLr0JvOcv3oz7rGQ4qKrtaZzPRqxD8ht3UfTJSX0rUMxkm37g16DV2FNloTqmhXqNAnVVf4FzUaUg5a02WzFZVBm6wJZFOaMFPRasShjG5pLYCiLJlXie5ATZvW4x19sim9+l+py4OFtD12JZyoRwY4ugqA5Bv+fUjhjE9/oQEwflXQYVi0KpjY78hJv0woYmXN2R96//v7AiGM+n53VSkGzJ0P4PfzQiM45QhEgscGA/Q3HICGuil8dQLtmC7g4AV6vMAQwNZ6HE6NgymsBRQQHUNAwBwULmMAGzoAReAg6CDwENMFHiyDHgJvFmBA/W8g46vh4Irkd0b4kuheUomE3xiGZCU7Qfwm/1FqZDKPGzYVXd0XEopVdKZbTB3Dk6o3XjibT6ZxSSmxKcI/CNr2quX5fuMR95pb4LxhBV9E5LxIioigb7jZfYPEEonJcoz/cA0V7xsjxqPWg6Tvl8KUJkBhdYzOcrRXo+CJ+oZn9i7Bcig+tSqSkHzge1H4rh8IXLPVK4jyf6dUM/OyZgu0cNsVjGqSXt/9sAUKBg4BCQXqTwSAL/Dq1/P/n5OUyebyhWKpXKnW6o1mq93p9vqD4Wg8mc7mi+VqvdkSyriQSlu243p+pVqrN5qtdqfb6w/kWsexg2CwGpn27AhPddse2IMgwLQLlxW9WK0Rfjuem6AY3V3mDJEcKkqOZBWvinIGkrKfQCeWpsREqOzfwyFTPYImFQuKbge6LLswXOs2nHEbXt1xWWEXv7q1g5VRrHaP7hB/bGqytd8OS/d8pRq13d1Vqu6EiWX3LOWh7JRqyppe91JRw2e5n9q6SOEgxxxzXHEnJw2PiKJzpZx1h5rwmFobmxJP6HaLhnPE7VK0W2pkPSiDY+ShXsiF3g433aDK1LD355neaFcq9LpTY8Sjej80NI4nipQ20THUKnRwJ3cYdGQ2cqWCSKQ4zLblgnQwPEN5LptWIJCKGJlUIOn96swaJxsUi5G3rg0A);\n font-weight: normal;\n font-style: normal;\n}\n.ag-theme-alpine, .ag-theme-alpine-dark {\n --ag-alpine-active-color: #2196f3;\n --ag-selected-row-background-color: rgba(33, 150, 243, 0.3);\n --ag-row-hover-color: rgba(33, 150, 243, 0.1);\n --ag-column-hover-color: rgba(33, 150, 243, 0.1);\n --ag-input-focus-border-color: rgba(33, 150, 243, 0.4);\n --ag-range-selection-background-color: rgba(33, 150, 243, 0.2);\n --ag-range-selection-background-color-2: rgba(33, 150, 243, 0.36);\n --ag-range-selection-background-color-3: rgba(33, 150, 243, 0.49);\n --ag-range-selection-background-color-4: rgba(33, 150, 243, 0.59);\n --ag-background-color: #fff;\n --ag-foreground-color: #181d1f;\n --ag-border-color: #babfc7;\n --ag-secondary-border-color: #dde2eb;\n --ag-header-background-color: #f8f8f8;\n --ag-tooltip-background-color: #f8f8f8;\n --ag-odd-row-background-color: #fcfcfc;\n --ag-control-panel-background-color: #f8f8f8;\n --ag-subheader-background-color: #fff;\n --ag-invalid-color: #e02525;\n --ag-checkbox-unchecked-color: #999;\n --ag-checkbox-background-color: var(--ag-background-color);\n --ag-checkbox-checked-color: var(--ag-alpine-active-color);\n --ag-range-selection-border-color: var(--ag-alpine-active-color);\n --ag-secondary-foreground-color: var(--ag-foreground-color);\n --ag-input-border-color: var(--ag-border-color);\n --ag-input-border-color-invalid: var(--ag-invalid-color);\n --ag-input-focus-box-shadow: 0 0 2px 0.1rem var(--ag-input-focus-border-color);\n --ag-disabled-foreground-color: rgba(24, 29, 31, 0.5);\n --ag-chip-background-color: rgba(24, 29, 31, 0.07);\n --ag-input-disabled-border-color: rgba(186, 191, 199, 0.3);\n --ag-input-disabled-background-color: rgba(186, 191, 199, 0.15);\n --ag-borders: solid 1px;\n --ag-border-radius: 3px;\n --ag-borders-side-button: none;\n --ag-side-button-selected-background-color: transparent;\n --ag-header-column-resize-handle-display: block;\n --ag-header-column-resize-handle-width: 2px;\n --ag-header-column-resize-handle-height: 30%;\n --ag-grid-size: 6px;\n --ag-icon-size: 16px;\n --ag-row-height: calc(var(--ag-grid-size) * 7);\n --ag-header-height: calc(var(--ag-grid-size) * 8);\n --ag-list-item-height: calc(var(--ag-grid-size) * 4);\n --ag-column-select-indent-size: var(--ag-icon-size);\n --ag-set-filter-indent-size: var(--ag-icon-size);\n --ag-cell-horizontal-padding: calc(var(--ag-grid-size) * 3);\n --ag-cell-widget-spacing: calc(var(--ag-grid-size) * 2);\n --ag-widget-container-vertical-padding: calc(var(--ag-grid-size) * 2);\n --ag-widget-container-horizontal-padding: calc(var(--ag-grid-size) * 2);\n --ag-widget-vertical-spacing: calc(var(--ag-grid-size) * 1.5);\n --ag-toggle-button-height: 18px;\n --ag-toggle-button-width: 28px;\n --ag-font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Oxygen-Sans, Ubuntu, Cantarell, \"Helvetica Neue\", sans-serif;\n --ag-font-size: 13px;\n --ag-icon-font-family: agGridAlpine;\n --ag-selected-tab-underline-color: var(--ag-alpine-active-color);\n --ag-selected-tab-underline-width: 2px;\n --ag-selected-tab-underline-transition-speed: 0.3s;\n --ag-tab-min-width: 240px;\n --ag-card-shadow: 0 1px 4px 1px rgba(186, 191, 199, 0.4);\n --ag-popup-shadow: var(--ag-card-shadow);\n --ag-side-bar-panel-width: 250px;\n}\n\n.ag-theme-alpine-dark {\n --ag-background-color: #181d1f;\n --ag-foreground-color: #fff;\n --ag-border-color: #68686e;\n --ag-secondary-border-color: rgba(88, 86, 82, 0.5);\n --ag-modal-overlay-background-color: rgba(24, 29, 31, 0.66);\n --ag-header-background-color: #222628;\n --ag-tooltip-background-color: #222628;\n --ag-odd-row-background-color: #222628;\n --ag-control-panel-background-color: #222628;\n --ag-subheader-background-color: #000;\n --ag-input-disabled-background-color: #282c2f;\n --ag-input-focus-box-shadow:\n 0 0 2px 0.5px rgba(255, 255, 255, 0.5),\n 0 0 4px 3px var(--ag-input-focus-border-color);\n --ag-card-shadow: 0 1px 20px 1px black;\n --ag-disabled-foreground-color: rgba(255, 255, 255, 0.5);\n --ag-chip-background-color: rgba(255, 255, 255, 0.07);\n --ag-input-disabled-border-color: rgba(104, 104, 110, 0.3);\n --ag-input-disabled-background-color: rgba(104, 104, 110, 0.07);\n}\n\n.ag-theme-alpine .ag-filter-toolpanel-header,\n.ag-theme-alpine .ag-filter-toolpanel-search,\n.ag-theme-alpine .ag-status-bar,\n.ag-theme-alpine .ag-header-row,\n.ag-theme-alpine .ag-panel-title-bar-title,\n.ag-theme-alpine .ag-multi-filter-group-title-bar, .ag-theme-alpine-dark .ag-filter-toolpanel-header,\n.ag-theme-alpine-dark .ag-filter-toolpanel-search,\n.ag-theme-alpine-dark .ag-status-bar,\n.ag-theme-alpine-dark .ag-header-row,\n.ag-theme-alpine-dark .ag-panel-title-bar-title,\n.ag-theme-alpine-dark .ag-multi-filter-group-title-bar {\n font-weight: 700;\n color: var(--ag-header-foreground-color);\n}\n.ag-theme-alpine .ag-row, .ag-theme-alpine-dark .ag-row {\n font-size: calc(var(--ag-font-size) + 1px);\n}\n.ag-theme-alpine input[class^=ag-]:not([type]),\n.ag-theme-alpine input[class^=ag-][type=text],\n.ag-theme-alpine input[class^=ag-][type=number],\n.ag-theme-alpine input[class^=ag-][type=tel],\n.ag-theme-alpine input[class^=ag-][type=date],\n.ag-theme-alpine input[class^=ag-][type=datetime-local],\n.ag-theme-alpine textarea[class^=ag-], .ag-theme-alpine-dark input[class^=ag-]:not([type]),\n.ag-theme-alpine-dark input[class^=ag-][type=text],\n.ag-theme-alpine-dark input[class^=ag-][type=number],\n.ag-theme-alpine-dark input[class^=ag-][type=tel],\n.ag-theme-alpine-dark input[class^=ag-][type=date],\n.ag-theme-alpine-dark input[class^=ag-][type=datetime-local],\n.ag-theme-alpine-dark textarea[class^=ag-] {\n min-height: calc(var(--ag-grid-size) * 4);\n border-radius: var(--ag-border-radius);\n}\n.ag-theme-alpine .ag-ltr input[class^=ag-]:not([type]), .ag-theme-alpine .ag-ltr input[class^=ag-][type=text], .ag-theme-alpine .ag-ltr input[class^=ag-][type=number], .ag-theme-alpine .ag-ltr input[class^=ag-][type=tel], .ag-theme-alpine .ag-ltr input[class^=ag-][type=date], .ag-theme-alpine .ag-ltr input[class^=ag-][type=datetime-local], .ag-theme-alpine .ag-ltr textarea[class^=ag-], .ag-theme-alpine-dark .ag-ltr input[class^=ag-]:not([type]), .ag-theme-alpine-dark .ag-ltr input[class^=ag-][type=text], .ag-theme-alpine-dark .ag-ltr input[class^=ag-][type=number], .ag-theme-alpine-dark .ag-ltr input[class^=ag-][type=tel], .ag-theme-alpine-dark .ag-ltr input[class^=ag-][type=date], .ag-theme-alpine-dark .ag-ltr input[class^=ag-][type=datetime-local], .ag-theme-alpine-dark .ag-ltr textarea[class^=ag-] {\n padding-left: var(--ag-grid-size);\n}\n\n.ag-theme-alpine .ag-rtl input[class^=ag-]:not([type]), .ag-theme-alpine .ag-rtl input[class^=ag-][type=text], .ag-theme-alpine .ag-rtl input[class^=ag-][type=number], .ag-theme-alpine .ag-rtl input[class^=ag-][type=tel], .ag-theme-alpine .ag-rtl input[class^=ag-][type=date], .ag-theme-alpine .ag-rtl input[class^=ag-][type=datetime-local], .ag-theme-alpine .ag-rtl textarea[class^=ag-], .ag-theme-alpine-dark .ag-rtl input[class^=ag-]:not([type]), .ag-theme-alpine-dark .ag-rtl input[class^=ag-][type=text], .ag-theme-alpine-dark .ag-rtl input[class^=ag-][type=number], .ag-theme-alpine-dark .ag-rtl input[class^=ag-][type=tel], .ag-theme-alpine-dark .ag-rtl input[class^=ag-][type=date], .ag-theme-alpine-dark .ag-rtl input[class^=ag-][type=datetime-local], .ag-theme-alpine-dark .ag-rtl textarea[class^=ag-] {\n padding-right: var(--ag-grid-size);\n}\n\n.ag-theme-alpine .ag-tab, .ag-theme-alpine-dark .ag-tab {\n padding: calc(var(--ag-grid-size) * 1.5);\n transition: color 0.4s;\n flex: 1 1 auto;\n}\n.ag-theme-alpine .ag-tab-selected, .ag-theme-alpine-dark .ag-tab-selected {\n color: var(--ag-alpine-active-color);\n}\n.ag-theme-alpine .ag-menu, .ag-theme-alpine-dark .ag-menu {\n background-color: var(--ag-control-panel-background-color);\n}\n.ag-theme-alpine .ag-menu-header, .ag-theme-alpine-dark .ag-menu-header {\n background-color: var(--ag-control-panel-background-color);\n padding-top: 1px;\n}\n.ag-theme-alpine .ag-tabs-header, .ag-theme-alpine-dark .ag-tabs-header {\n border-bottom: var(--ag-borders) var(--ag-border-color);\n}\n.ag-theme-alpine .ag-charts-settings-group-title-bar,\n.ag-theme-alpine .ag-charts-data-group-title-bar,\n.ag-theme-alpine .ag-charts-format-top-level-group-title-bar, .ag-theme-alpine-dark .ag-charts-settings-group-title-bar,\n.ag-theme-alpine-dark .ag-charts-data-group-title-bar,\n.ag-theme-alpine-dark .ag-charts-format-top-level-group-title-bar {\n padding: var(--ag-grid-size) calc(var(--ag-grid-size) * 2);\n line-height: calc(var(--ag-icon-size) + var(--ag-grid-size) - 2px);\n}\n.ag-theme-alpine .ag-chart-mini-thumbnail, .ag-theme-alpine-dark .ag-chart-mini-thumbnail {\n background-color: var(--ag-background-color);\n}\n.ag-theme-alpine .ag-chart-settings-nav-bar, .ag-theme-alpine-dark .ag-chart-settings-nav-bar {\n border-top: var(--ag-borders-secondary) var(--ag-secondary-border-color);\n}\n.ag-theme-alpine .ag-ltr .ag-group-title-bar-icon, .ag-theme-alpine-dark .ag-ltr .ag-group-title-bar-icon {\n margin-right: var(--ag-grid-size);\n}\n\n.ag-theme-alpine .ag-rtl .ag-group-title-bar-icon, .ag-theme-alpine-dark .ag-rtl .ag-group-title-bar-icon {\n margin-left: var(--ag-grid-size);\n}\n\n.ag-theme-alpine .ag-charts-format-top-level-group-toolbar, .ag-theme-alpine-dark .ag-charts-format-top-level-group-toolbar {\n margin-top: var(--ag-grid-size);\n}\n.ag-theme-alpine .ag-ltr .ag-charts-format-top-level-group-toolbar, .ag-theme-alpine-dark .ag-ltr .ag-charts-format-top-level-group-toolbar {\n padding-left: calc(var(--ag-icon-size) * 0.5 + var(--ag-grid-size) * 2);\n}\n\n.ag-theme-alpine .ag-rtl .ag-charts-format-top-level-group-toolbar, .ag-theme-alpine-dark .ag-rtl .ag-charts-format-top-level-group-toolbar {\n padding-right: calc(var(--ag-icon-size) * 0.5 + var(--ag-grid-size) * 2);\n}\n\n.ag-theme-alpine .ag-charts-format-sub-level-group, .ag-theme-alpine-dark .ag-charts-format-sub-level-group {\n border-left: dashed 1px;\n border-left-color: var(--ag-border-color);\n padding-left: var(--ag-grid-size);\n margin-bottom: calc(var(--ag-grid-size) * 2);\n}\n.ag-theme-alpine .ag-charts-format-sub-level-group-title-bar, .ag-theme-alpine-dark .ag-charts-format-sub-level-group-title-bar {\n padding-top: 0;\n padding-bottom: 0;\n background: none;\n font-weight: 700;\n}\n.ag-theme-alpine .ag-charts-format-sub-level-group-container, .ag-theme-alpine-dark .ag-charts-format-sub-level-group-container {\n padding-bottom: 0;\n}\n.ag-theme-alpine .ag-charts-format-sub-level-group-item:last-child, .ag-theme-alpine-dark .ag-charts-format-sub-level-group-item:last-child {\n margin-bottom: 0;\n}\n.ag-theme-alpine.ag-dnd-ghost, .ag-theme-alpine-dark.ag-dnd-ghost {\n font-size: calc(var(--ag-font-size) - 1px);\n font-weight: 700;\n}\n.ag-theme-alpine .ag-side-buttons, .ag-theme-alpine-dark .ag-side-buttons {\n width: calc(var(--ag-grid-size) * 5);\n}\n.ag-theme-alpine .ag-standard-button, .ag-theme-alpine-dark .ag-standard-button {\n appearance: none;\n -webkit-appearance: none;\n border-radius: var(--ag-border-radius);\n border: 1px solid;\n border-color: var(--ag-alpine-active-color);\n color: var(--ag-alpine-active-color);\n background-color: var(--ag-background-color);\n font-weight: 600;\n padding: var(--ag-grid-size) calc(var(--ag-grid-size) * 2);\n}\n.ag-theme-alpine .ag-standard-button:hover, .ag-theme-alpine-dark .ag-standard-button:hover {\n border-color: var(--ag-alpine-active-color);\n background-color: var(--ag-row-hover-color);\n}\n.ag-theme-alpine .ag-standard-button:active, .ag-theme-alpine-dark .ag-standard-button:active {\n border-color: var(--ag-alpine-active-color);\n background-color: var(--ag-alpine-active-color);\n color: var(--ag-background-color);\n}\n.ag-theme-alpine .ag-standard-button:disabled, .ag-theme-alpine-dark .ag-standard-button:disabled {\n color: var(--ag-disabled-foreground-color);\n background-color: var(--ag-input-disabled-background-color);\n border-color: var(--ag-input-disabled-border-color);\n}\n.ag-theme-alpine .ag-column-drop-vertical, .ag-theme-alpine-dark .ag-column-drop-vertical {\n min-height: 75px;\n}\n.ag-theme-alpine .ag-column-drop-vertical-title-bar, .ag-theme-alpine-dark .ag-column-drop-vertical-title-bar {\n padding: calc(var(--ag-grid-size) * 2);\n padding-bottom: 0px;\n}\n.ag-theme-alpine .ag-column-drop-vertical-empty-message, .ag-theme-alpine-dark .ag-column-drop-vertical-empty-message {\n display: flex;\n align-items: center;\n border: dashed 1px;\n border-color: var(--ag-border-color);\n margin: calc(var(--ag-grid-size) * 2);\n padding: calc(var(--ag-grid-size) * 2);\n}\n.ag-theme-alpine .ag-column-drop-empty-message, .ag-theme-alpine-dark .ag-column-drop-empty-message {\n color: var(--ag-foreground-color);\n opacity: 0.75;\n}\n.ag-theme-alpine .ag-status-bar, .ag-theme-alpine-dark .ag-status-bar {\n font-weight: normal;\n}\n.ag-theme-alpine .ag-status-name-value-value, .ag-theme-alpine-dark .ag-status-name-value-value {\n font-weight: 700;\n}\n.ag-theme-alpine .ag-paging-number, .ag-theme-alpine .ag-paging-row-summary-panel-number, .ag-theme-alpine-dark .ag-paging-number, .ag-theme-alpine-dark .ag-paging-row-summary-panel-number {\n font-weight: 700;\n}\n.ag-theme-alpine .ag-column-drop-cell-button, .ag-theme-alpine-dark .ag-column-drop-cell-button {\n opacity: 0.5;\n}\n.ag-theme-alpine .ag-column-drop-cell-button:hover, .ag-theme-alpine-dark .ag-column-drop-cell-button:hover {\n opacity: 0.75;\n}\n.ag-theme-alpine .ag-header-cell-menu-button:hover,\n.ag-theme-alpine .ag-side-button-button:hover,\n.ag-theme-alpine .ag-tab:hover,\n.ag-theme-alpine .ag-panel-title-bar-button:hover,\n.ag-theme-alpine .ag-header-expand-icon:hover,\n.ag-theme-alpine .ag-column-group-icons:hover,\n.ag-theme-alpine .ag-set-filter-group-icons:hover,\n.ag-theme-alpine .ag-group-expanded .ag-icon:hover,\n.ag-theme-alpine .ag-group-contracted .ag-icon:hover,\n.ag-theme-alpine .ag-chart-settings-prev:hover,\n.ag-theme-alpine .ag-chart-settings-next:hover,\n.ag-theme-alpine .ag-group-title-bar-icon:hover,\n.ag-theme-alpine .ag-column-select-header-icon:hover,\n.ag-theme-alpine .ag-floating-filter-button-button:hover,\n.ag-theme-alpine .ag-filter-toolpanel-expand:hover,\n.ag-theme-alpine .ag-chart-menu-icon:hover,\n.ag-theme-alpine .ag-chart-menu-close:hover, .ag-theme-alpine-dark .ag-header-cell-menu-button:hover,\n.ag-theme-alpine-dark .ag-side-button-button:hover,\n.ag-theme-alpine-dark .ag-tab:hover,\n.ag-theme-alpine-dark .ag-panel-title-bar-button:hover,\n.ag-theme-alpine-dark .ag-header-expand-icon:hover,\n.ag-theme-alpine-dark .ag-column-group-icons:hover,\n.ag-theme-alpine-dark .ag-set-filter-group-icons:hover,\n.ag-theme-alpine-dark .ag-group-expanded .ag-icon:hover,\n.ag-theme-alpine-dark .ag-group-contracted .ag-icon:hover,\n.ag-theme-alpine-dark .ag-chart-settings-prev:hover,\n.ag-theme-alpine-dark .ag-chart-settings-next:hover,\n.ag-theme-alpine-dark .ag-group-title-bar-icon:hover,\n.ag-theme-alpine-dark .ag-column-select-header-icon:hover,\n.ag-theme-alpine-dark .ag-floating-filter-button-button:hover,\n.ag-theme-alpine-dark .ag-filter-toolpanel-expand:hover,\n.ag-theme-alpine-dark .ag-chart-menu-icon:hover,\n.ag-theme-alpine-dark .ag-chart-menu-close:hover {\n color: var(--ag-alpine-active-color);\n}\n.ag-theme-alpine .ag-chart-menu-close, .ag-theme-alpine-dark .ag-chart-menu-close {\n background: var(--ag-background-color);\n}\n.ag-theme-alpine .ag-chart-menu-close:hover .ag-icon, .ag-theme-alpine-dark .ag-chart-menu-close:hover .ag-icon {\n border-color: var(--ag-alpine-active-color);\n}\n.ag-theme-alpine .ag-chart-menu-close .ag-icon, .ag-theme-alpine-dark .ag-chart-menu-close .ag-icon {\n background: var(--ag-header-background-color);\n border: 1px solid var(--ag-border-color);\n border-right: none;\n}\n.ag-theme-alpine .ag-chart-settings-card-item.ag-not-selected:hover, .ag-theme-alpine-dark .ag-chart-settings-card-item.ag-not-selected:hover {\n opacity: 0.35;\n}\n.ag-theme-alpine .ag-ltr .ag-panel-title-bar-button, .ag-theme-alpine-dark .ag-ltr .ag-panel-title-bar-button {\n margin-left: calc(var(--ag-grid-size) * 2);\n margin-right: var(--ag-grid-size);\n}\n\n.ag-theme-alpine .ag-rtl .ag-panel-title-bar-button, .ag-theme-alpine-dark .ag-rtl .ag-panel-title-bar-button {\n margin-right: calc(var(--ag-grid-size) * 2);\n margin-left: var(--ag-grid-size);\n}\n\n.ag-theme-alpine .ag-ltr .ag-filter-toolpanel-group-container, .ag-theme-alpine-dark .ag-ltr .ag-filter-toolpanel-group-container {\n padding-left: var(--ag-grid-size);\n}\n\n.ag-theme-alpine .ag-rtl .ag-filter-toolpanel-group-container, .ag-theme-alpine-dark .ag-rtl .ag-filter-toolpanel-group-container {\n padding-right: var(--ag-grid-size);\n}\n\n.ag-theme-alpine .ag-filter-toolpanel-instance-filter, .ag-theme-alpine-dark .ag-filter-toolpanel-instance-filter {\n border: none;\n background-color: var(--ag-control-panel-background-color);\n}\n.ag-theme-alpine .ag-ltr .ag-filter-toolpanel-instance-filter, .ag-theme-alpine-dark .ag-ltr .ag-filter-toolpanel-instance-filter {\n border-left: dashed 1px;\n border-left-color: var(--ag-border-color);\n margin-left: calc(var(--ag-icon-size) * 0.5);\n}\n\n.ag-theme-alpine .ag-rtl .ag-filter-toolpanel-instance-filter, .ag-theme-alpine-dark .ag-rtl .ag-filter-toolpanel-instance-filter {\n border-right: dashed 1px;\n border-right-color: var(--ag-border-color);\n margin-right: calc(var(--ag-icon-size) * 0.5);\n}\n\n.ag-theme-alpine .ag-set-filter-list, .ag-theme-alpine-dark .ag-set-filter-list {\n padding-top: calc(var(--ag-grid-size) * 0.5);\n padding-bottom: calc(var(--ag-grid-size) * 0.5);\n}\n.ag-theme-alpine .ag-layout-auto-height .ag-center-cols-clipper, .ag-theme-alpine .ag-layout-auto-height .ag-center-cols-container, .ag-theme-alpine .ag-layout-print .ag-center-cols-clipper, .ag-theme-alpine .ag-layout-print .ag-center-cols-container, .ag-theme-alpine-dark .ag-layout-auto-height .ag-center-cols-clipper, .ag-theme-alpine-dark .ag-layout-auto-height .ag-center-cols-container, .ag-theme-alpine-dark .ag-layout-print .ag-center-cols-clipper, .ag-theme-alpine-dark .ag-layout-print .ag-center-cols-container {\n min-height: 150px;\n}\n.ag-theme-alpine .ag-overlay-no-rows-wrapper.ag-layout-auto-height, .ag-theme-alpine-dark .ag-overlay-no-rows-wrapper.ag-layout-auto-height {\n padding-top: 60px;\n}\n.ag-theme-alpine .ag-date-time-list-page-entry-is-current, .ag-theme-alpine-dark .ag-date-time-list-page-entry-is-current {\n background-color: var(--ag-alpine-active-color);\n}\n\n.ag-theme-alpine-dark {\n color-scheme: dark;\n}\n", ""]); // Exports module.exports = exports; /***/ }), /***/ "./node_modules/css-loader/dist/cjs.js!./node_modules/bootstrap/dist/css/bootstrap.min.css": /***/ (function(module, exports, __webpack_require__) { // Imports var ___CSS_LOADER_API_IMPORT___ = __webpack_require__("./node_modules/css-loader/dist/runtime/api.js"); var ___CSS_LOADER_GET_URL_IMPORT___ = __webpack_require__("./node_modules/css-loader/dist/runtime/getUrl.js"); var ___CSS_LOADER_URL_IMPORT_0___ = __webpack_require__("./node_modules/bootstrap/dist/fonts/glyphicons-halflings-regular.eot"); var ___CSS_LOADER_URL_IMPORT_1___ = __webpack_require__("./node_modules/bootstrap/dist/fonts/glyphicons-halflings-regular.woff2"); var ___CSS_LOADER_URL_IMPORT_2___ = __webpack_require__("./node_modules/bootstrap/dist/fonts/glyphicons-halflings-regular.woff"); var ___CSS_LOADER_URL_IMPORT_3___ = __webpack_require__("./node_modules/bootstrap/dist/fonts/glyphicons-halflings-regular.ttf"); var ___CSS_LOADER_URL_IMPORT_4___ = __webpack_require__("./node_modules/bootstrap/dist/fonts/glyphicons-halflings-regular.svg"); exports = ___CSS_LOADER_API_IMPORT___(false); var ___CSS_LOADER_URL_REPLACEMENT_0___ = ___CSS_LOADER_GET_URL_IMPORT___(___CSS_LOADER_URL_IMPORT_0___); var ___CSS_LOADER_URL_REPLACEMENT_1___ = ___CSS_LOADER_GET_URL_IMPORT___(___CSS_LOADER_URL_IMPORT_0___, { hash: "?#iefix" }); var ___CSS_LOADER_URL_REPLACEMENT_2___ = ___CSS_LOADER_GET_URL_IMPORT___(___CSS_LOADER_URL_IMPORT_1___); var ___CSS_LOADER_URL_REPLACEMENT_3___ = ___CSS_LOADER_GET_URL_IMPORT___(___CSS_LOADER_URL_IMPORT_2___); var ___CSS_LOADER_URL_REPLACEMENT_4___ = ___CSS_LOADER_GET_URL_IMPORT___(___CSS_LOADER_URL_IMPORT_3___); var ___CSS_LOADER_URL_REPLACEMENT_5___ = ___CSS_LOADER_GET_URL_IMPORT___(___CSS_LOADER_URL_IMPORT_4___, { hash: "#glyphicons_halflingsregular" }); // Module exports.push([module.i, "/*!\n * Bootstrap v3.4.1 (https://getbootstrap.com/)\n * Copyright 2011-2019 Twitter, Inc.\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n *//*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background-color:transparent}a:active,a:hover{outline:0}abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;-moz-text-decoration:underline dotted;text-decoration:underline dotted}b,strong{font-weight:700}dfn{font-style:italic}h1{font-size:2em;margin:.67em 0}mark{background:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;height:0}pre{overflow:auto}code,kbd,pre,samp{font-family:monospace,monospace;font-size:1em}button,input,optgroup,select,textarea{color:inherit;font:inherit;margin:0}button{overflow:visible}button,select{text-transform:none}button,html input[type=button],input[type=reset],input[type=submit]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}input{line-height:normal}input[type=checkbox],input[type=radio]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;padding:0}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{height:auto}input[type=search]{-webkit-appearance:textfield;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}fieldset{border:1px solid silver;margin:0 2px;padding:.35em .625em .75em}legend{border:0;padding:0}textarea{overflow:auto}optgroup{font-weight:700}table{border-collapse:collapse;border-spacing:0}td,th{padding:0}/*! Source: https://github.com/h5bp/html5-boilerplate/blob/master/src/css/main.css */@media print{*,:after,:before{color:#000!important;text-shadow:none!important;background:0 0!important;-webkit-box-shadow:none!important;box-shadow:none!important}a,a:visited{text-decoration:underline}a[href]:after{content:\" (\" attr(href) \")\"}abbr[title]:after{content:\" (\" attr(title) \")\"}a[href^=\"#\"]:after,a[href^=\"javascript:\"]:after{content:\"\"}blockquote,pre{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}img,tr{page-break-inside:avoid}img{max-width:100%!important}h2,h3,p{orphans:3;widows:3}h2,h3{page-break-after:avoid}.navbar{display:none}.btn>.caret,.dropup>.btn>.caret{border-top-color:#000!important}.label{border:1px solid #000}.table{border-collapse:collapse!important}.table td,.table th{background-color:#fff!important}.table-bordered td,.table-bordered th{border:1px solid #ddd!important}}@font-face{font-family:\"Glyphicons Halflings\";src:url(" + ___CSS_LOADER_URL_REPLACEMENT_0___ + ");src:url(" + ___CSS_LOADER_URL_REPLACEMENT_1___ + ") format(\"embedded-opentype\"),url(" + ___CSS_LOADER_URL_REPLACEMENT_2___ + ") format(\"woff2\"),url(" + ___CSS_LOADER_URL_REPLACEMENT_3___ + ") format(\"woff\"),url(" + ___CSS_LOADER_URL_REPLACEMENT_4___ + ") format(\"truetype\"),url(" + ___CSS_LOADER_URL_REPLACEMENT_5___ + ") format(\"svg\")}.glyphicon{position:relative;top:1px;display:inline-block;font-family:\"Glyphicons Halflings\";font-style:normal;font-weight:400;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.glyphicon-asterisk:before{content:\"\\002a\"}.glyphicon-plus:before{content:\"\\002b\"}.glyphicon-eur:before,.glyphicon-euro:before{content:\"\\20ac\"}.glyphicon-minus:before{content:\"\\2212\"}.glyphicon-cloud:before{content:\"\\2601\"}.glyphicon-envelope:before{content:\"\\2709\"}.glyphicon-pencil:before{content:\"\\270f\"}.glyphicon-glass:before{content:\"\\e001\"}.glyphicon-music:before{content:\"\\e002\"}.glyphicon-search:before{content:\"\\e003\"}.glyphicon-heart:before{content:\"\\e005\"}.glyphicon-star:before{content:\"\\e006\"}.glyphicon-star-empty:before{content:\"\\e007\"}.glyphicon-user:before{content:\"\\e008\"}.glyphicon-film:before{content:\"\\e009\"}.glyphicon-th-large:before{content:\"\\e010\"}.glyphicon-th:before{content:\"\\e011\"}.glyphicon-th-list:before{content:\"\\e012\"}.glyphicon-ok:before{content:\"\\e013\"}.glyphicon-remove:before{content:\"\\e014\"}.glyphicon-zoom-in:before{content:\"\\e015\"}.glyphicon-zoom-out:before{content:\"\\e016\"}.glyphicon-off:before{content:\"\\e017\"}.glyphicon-signal:before{content:\"\\e018\"}.glyphicon-cog:before{content:\"\\e019\"}.glyphicon-trash:before{content:\"\\e020\"}.glyphicon-home:before{content:\"\\e021\"}.glyphicon-file:before{content:\"\\e022\"}.glyphicon-time:before{content:\"\\e023\"}.glyphicon-road:before{content:\"\\e024\"}.glyphicon-download-alt:before{content:\"\\e025\"}.glyphicon-download:before{content:\"\\e026\"}.glyphicon-upload:before{content:\"\\e027\"}.glyphicon-inbox:before{content:\"\\e028\"}.glyphicon-play-circle:before{content:\"\\e029\"}.glyphicon-repeat:before{content:\"\\e030\"}.glyphicon-refresh:before{content:\"\\e031\"}.glyphicon-list-alt:before{content:\"\\e032\"}.glyphicon-lock:before{content:\"\\e033\"}.glyphicon-flag:before{content:\"\\e034\"}.glyphicon-headphones:before{content:\"\\e035\"}.glyphicon-volume-off:before{content:\"\\e036\"}.glyphicon-volume-down:before{content:\"\\e037\"}.glyphicon-volume-up:before{content:\"\\e038\"}.glyphicon-qrcode:before{content:\"\\e039\"}.glyphicon-barcode:before{content:\"\\e040\"}.glyphicon-tag:before{content:\"\\e041\"}.glyphicon-tags:before{content:\"\\e042\"}.glyphicon-book:before{content:\"\\e043\"}.glyphicon-bookmark:before{content:\"\\e044\"}.glyphicon-print:before{content:\"\\e045\"}.glyphicon-camera:before{content:\"\\e046\"}.glyphicon-font:before{content:\"\\e047\"}.glyphicon-bold:before{content:\"\\e048\"}.glyphicon-italic:before{content:\"\\e049\"}.glyphicon-text-height:before{content:\"\\e050\"}.glyphicon-text-width:before{content:\"\\e051\"}.glyphicon-align-left:before{content:\"\\e052\"}.glyphicon-align-center:before{content:\"\\e053\"}.glyphicon-align-right:before{content:\"\\e054\"}.glyphicon-align-justify:before{content:\"\\e055\"}.glyphicon-list:before{content:\"\\e056\"}.glyphicon-indent-left:before{content:\"\\e057\"}.glyphicon-indent-right:before{content:\"\\e058\"}.glyphicon-facetime-video:before{content:\"\\e059\"}.glyphicon-picture:before{content:\"\\e060\"}.glyphicon-map-marker:before{content:\"\\e062\"}.glyphicon-adjust:before{content:\"\\e063\"}.glyphicon-tint:before{content:\"\\e064\"}.glyphicon-edit:before{content:\"\\e065\"}.glyphicon-share:before{content:\"\\e066\"}.glyphicon-check:before{content:\"\\e067\"}.glyphicon-move:before{content:\"\\e068\"}.glyphicon-step-backward:before{content:\"\\e069\"}.glyphicon-fast-backward:before{content:\"\\e070\"}.glyphicon-backward:before{content:\"\\e071\"}.glyphicon-play:before{content:\"\\e072\"}.glyphicon-pause:before{content:\"\\e073\"}.glyphicon-stop:before{content:\"\\e074\"}.glyphicon-forward:before{content:\"\\e075\"}.glyphicon-fast-forward:before{content:\"\\e076\"}.glyphicon-step-forward:before{content:\"\\e077\"}.glyphicon-eject:before{content:\"\\e078\"}.glyphicon-chevron-left:before{content:\"\\e079\"}.glyphicon-chevron-right:before{content:\"\\e080\"}.glyphicon-plus-sign:before{content:\"\\e081\"}.glyphicon-minus-sign:before{content:\"\\e082\"}.glyphicon-remove-sign:before{content:\"\\e083\"}.glyphicon-ok-sign:before{content:\"\\e084\"}.glyphicon-question-sign:before{content:\"\\e085\"}.glyphicon-info-sign:before{content:\"\\e086\"}.glyphicon-screenshot:before{content:\"\\e087\"}.glyphicon-remove-circle:before{content:\"\\e088\"}.glyphicon-ok-circle:before{content:\"\\e089\"}.glyphicon-ban-circle:before{content:\"\\e090\"}.glyphicon-arrow-left:before{content:\"\\e091\"}.glyphicon-arrow-right:before{content:\"\\e092\"}.glyphicon-arrow-up:before{content:\"\\e093\"}.glyphicon-arrow-down:before{content:\"\\e094\"}.glyphicon-share-alt:before{content:\"\\e095\"}.glyphicon-resize-full:before{content:\"\\e096\"}.glyphicon-resize-small:before{content:\"\\e097\"}.glyphicon-exclamation-sign:before{content:\"\\e101\"}.glyphicon-gift:before{content:\"\\e102\"}.glyphicon-leaf:before{content:\"\\e103\"}.glyphicon-fire:before{content:\"\\e104\"}.glyphicon-eye-open:before{content:\"\\e105\"}.glyphicon-eye-close:before{content:\"\\e106\"}.glyphicon-warning-sign:before{content:\"\\e107\"}.glyphicon-plane:before{content:\"\\e108\"}.glyphicon-calendar:before{content:\"\\e109\"}.glyphicon-random:before{content:\"\\e110\"}.glyphicon-comment:before{content:\"\\e111\"}.glyphicon-magnet:before{content:\"\\e112\"}.glyphicon-chevron-up:before{content:\"\\e113\"}.glyphicon-chevron-down:before{content:\"\\e114\"}.glyphicon-retweet:before{content:\"\\e115\"}.glyphicon-shopping-cart:before{content:\"\\e116\"}.glyphicon-folder-close:before{content:\"\\e117\"}.glyphicon-folder-open:before{content:\"\\e118\"}.glyphicon-resize-vertical:before{content:\"\\e119\"}.glyphicon-resize-horizontal:before{content:\"\\e120\"}.glyphicon-hdd:before{content:\"\\e121\"}.glyphicon-bullhorn:before{content:\"\\e122\"}.glyphicon-bell:before{content:\"\\e123\"}.glyphicon-certificate:before{content:\"\\e124\"}.glyphicon-thumbs-up:before{content:\"\\e125\"}.glyphicon-thumbs-down:before{content:\"\\e126\"}.glyphicon-hand-right:before{content:\"\\e127\"}.glyphicon-hand-left:before{content:\"\\e128\"}.glyphicon-hand-up:before{content:\"\\e129\"}.glyphicon-hand-down:before{content:\"\\e130\"}.glyphicon-circle-arrow-right:before{content:\"\\e131\"}.glyphicon-circle-arrow-left:before{content:\"\\e132\"}.glyphicon-circle-arrow-up:before{content:\"\\e133\"}.glyphicon-circle-arrow-down:before{content:\"\\e134\"}.glyphicon-globe:before{content:\"\\e135\"}.glyphicon-wrench:before{content:\"\\e136\"}.glyphicon-tasks:before{content:\"\\e137\"}.glyphicon-filter:before{content:\"\\e138\"}.glyphicon-briefcase:before{content:\"\\e139\"}.glyphicon-fullscreen:before{content:\"\\e140\"}.glyphicon-dashboard:before{content:\"\\e141\"}.glyphicon-paperclip:before{content:\"\\e142\"}.glyphicon-heart-empty:before{content:\"\\e143\"}.glyphicon-link:before{content:\"\\e144\"}.glyphicon-phone:before{content:\"\\e145\"}.glyphicon-pushpin:before{content:\"\\e146\"}.glyphicon-usd:before{content:\"\\e148\"}.glyphicon-gbp:before{content:\"\\e149\"}.glyphicon-sort:before{content:\"\\e150\"}.glyphicon-sort-by-alphabet:before{content:\"\\e151\"}.glyphicon-sort-by-alphabet-alt:before{content:\"\\e152\"}.glyphicon-sort-by-order:before{content:\"\\e153\"}.glyphicon-sort-by-order-alt:before{content:\"\\e154\"}.glyphicon-sort-by-attributes:before{content:\"\\e155\"}.glyphicon-sort-by-attributes-alt:before{content:\"\\e156\"}.glyphicon-unchecked:before{content:\"\\e157\"}.glyphicon-expand:before{content:\"\\e158\"}.glyphicon-collapse-down:before{content:\"\\e159\"}.glyphicon-collapse-up:before{content:\"\\e160\"}.glyphicon-log-in:before{content:\"\\e161\"}.glyphicon-flash:before{content:\"\\e162\"}.glyphicon-log-out:before{content:\"\\e163\"}.glyphicon-new-window:before{content:\"\\e164\"}.glyphicon-record:before{content:\"\\e165\"}.glyphicon-save:before{content:\"\\e166\"}.glyphicon-open:before{content:\"\\e167\"}.glyphicon-saved:before{content:\"\\e168\"}.glyphicon-import:before{content:\"\\e169\"}.glyphicon-export:before{content:\"\\e170\"}.glyphicon-send:before{content:\"\\e171\"}.glyphicon-floppy-disk:before{content:\"\\e172\"}.glyphicon-floppy-saved:before{content:\"\\e173\"}.glyphicon-floppy-remove:before{content:\"\\e174\"}.glyphicon-floppy-save:before{content:\"\\e175\"}.glyphicon-floppy-open:before{content:\"\\e176\"}.glyphicon-credit-card:before{content:\"\\e177\"}.glyphicon-transfer:before{content:\"\\e178\"}.glyphicon-cutlery:before{content:\"\\e179\"}.glyphicon-header:before{content:\"\\e180\"}.glyphicon-compressed:before{content:\"\\e181\"}.glyphicon-earphone:before{content:\"\\e182\"}.glyphicon-phone-alt:before{content:\"\\e183\"}.glyphicon-tower:before{content:\"\\e184\"}.glyphicon-stats:before{content:\"\\e185\"}.glyphicon-sd-video:before{content:\"\\e186\"}.glyphicon-hd-video:before{content:\"\\e187\"}.glyphicon-subtitles:before{content:\"\\e188\"}.glyphicon-sound-stereo:before{content:\"\\e189\"}.glyphicon-sound-dolby:before{content:\"\\e190\"}.glyphicon-sound-5-1:before{content:\"\\e191\"}.glyphicon-sound-6-1:before{content:\"\\e192\"}.glyphicon-sound-7-1:before{content:\"\\e193\"}.glyphicon-copyright-mark:before{content:\"\\e194\"}.glyphicon-registration-mark:before{content:\"\\e195\"}.glyphicon-cloud-download:before{content:\"\\e197\"}.glyphicon-cloud-upload:before{content:\"\\e198\"}.glyphicon-tree-conifer:before{content:\"\\e199\"}.glyphicon-tree-deciduous:before{content:\"\\e200\"}.glyphicon-cd:before{content:\"\\e201\"}.glyphicon-save-file:before{content:\"\\e202\"}.glyphicon-open-file:before{content:\"\\e203\"}.glyphicon-level-up:before{content:\"\\e204\"}.glyphicon-copy:before{content:\"\\e205\"}.glyphicon-paste:before{content:\"\\e206\"}.glyphicon-alert:before{content:\"\\e209\"}.glyphicon-equalizer:before{content:\"\\e210\"}.glyphicon-king:before{content:\"\\e211\"}.glyphicon-queen:before{content:\"\\e212\"}.glyphicon-pawn:before{content:\"\\e213\"}.glyphicon-bishop:before{content:\"\\e214\"}.glyphicon-knight:before{content:\"\\e215\"}.glyphicon-baby-formula:before{content:\"\\e216\"}.glyphicon-tent:before{content:\"\\26fa\"}.glyphicon-blackboard:before{content:\"\\e218\"}.glyphicon-bed:before{content:\"\\e219\"}.glyphicon-apple:before{content:\"\\f8ff\"}.glyphicon-erase:before{content:\"\\e221\"}.glyphicon-hourglass:before{content:\"\\231b\"}.glyphicon-lamp:before{content:\"\\e223\"}.glyphicon-duplicate:before{content:\"\\e224\"}.glyphicon-piggy-bank:before{content:\"\\e225\"}.glyphicon-scissors:before{content:\"\\e226\"}.glyphicon-bitcoin:before{content:\"\\e227\"}.glyphicon-btc:before{content:\"\\e227\"}.glyphicon-xbt:before{content:\"\\e227\"}.glyphicon-yen:before{content:\"\\00a5\"}.glyphicon-jpy:before{content:\"\\00a5\"}.glyphicon-ruble:before{content:\"\\20bd\"}.glyphicon-rub:before{content:\"\\20bd\"}.glyphicon-scale:before{content:\"\\e230\"}.glyphicon-ice-lolly:before{content:\"\\e231\"}.glyphicon-ice-lolly-tasted:before{content:\"\\e232\"}.glyphicon-education:before{content:\"\\e233\"}.glyphicon-option-horizontal:before{content:\"\\e234\"}.glyphicon-option-vertical:before{content:\"\\e235\"}.glyphicon-menu-hamburger:before{content:\"\\e236\"}.glyphicon-modal-window:before{content:\"\\e237\"}.glyphicon-oil:before{content:\"\\e238\"}.glyphicon-grain:before{content:\"\\e239\"}.glyphicon-sunglasses:before{content:\"\\e240\"}.glyphicon-text-size:before{content:\"\\e241\"}.glyphicon-text-color:before{content:\"\\e242\"}.glyphicon-text-background:before{content:\"\\e243\"}.glyphicon-object-align-top:before{content:\"\\e244\"}.glyphicon-object-align-bottom:before{content:\"\\e245\"}.glyphicon-object-align-horizontal:before{content:\"\\e246\"}.glyphicon-object-align-left:before{content:\"\\e247\"}.glyphicon-object-align-vertical:before{content:\"\\e248\"}.glyphicon-object-align-right:before{content:\"\\e249\"}.glyphicon-triangle-right:before{content:\"\\e250\"}.glyphicon-triangle-left:before{content:\"\\e251\"}.glyphicon-triangle-bottom:before{content:\"\\e252\"}.glyphicon-triangle-top:before{content:\"\\e253\"}.glyphicon-console:before{content:\"\\e254\"}.glyphicon-superscript:before{content:\"\\e255\"}.glyphicon-subscript:before{content:\"\\e256\"}.glyphicon-menu-left:before{content:\"\\e257\"}.glyphicon-menu-right:before{content:\"\\e258\"}.glyphicon-menu-down:before{content:\"\\e259\"}.glyphicon-menu-up:before{content:\"\\e260\"}*{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}:after,:before{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}html{font-size:10px;-webkit-tap-highlight-color:rgba(0,0,0,0)}body{font-family:\"Helvetica Neue\",Helvetica,Arial,sans-serif;font-size:14px;line-height:1.42857143;color:#333;background-color:#fff}button,input,select,textarea{font-family:inherit;font-size:inherit;line-height:inherit}a{color:#337ab7;text-decoration:none}a:focus,a:hover{color:#23527c;text-decoration:underline}a:focus{outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}figure{margin:0}img{vertical-align:middle}.carousel-inner>.item>a>img,.carousel-inner>.item>img,.img-responsive,.thumbnail a>img,.thumbnail>img{display:block;max-width:100%;height:auto}.img-rounded{border-radius:6px}.img-thumbnail{padding:4px;line-height:1.42857143;background-color:#fff;border:1px solid #ddd;border-radius:4px;-webkit-transition:all .2s ease-in-out;-o-transition:all .2s ease-in-out;transition:all .2s ease-in-out;display:inline-block;max-width:100%;height:auto}.img-circle{border-radius:50%}hr{margin-top:20px;margin-bottom:20px;border:0;border-top:1px solid #eee}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}.sr-only-focusable:active,.sr-only-focusable:focus{position:static;width:auto;height:auto;margin:0;overflow:visible;clip:auto}[role=button]{cursor:pointer}.h1,.h2,.h3,.h4,.h5,.h6,h1,h2,h3,h4,h5,h6{font-family:inherit;font-weight:500;line-height:1.1;color:inherit}.h1 .small,.h1 small,.h2 .small,.h2 small,.h3 .small,.h3 small,.h4 .small,.h4 small,.h5 .small,.h5 small,.h6 .small,.h6 small,h1 .small,h1 small,h2 .small,h2 small,h3 .small,h3 small,h4 .small,h4 small,h5 .small,h5 small,h6 .small,h6 small{font-weight:400;line-height:1;color:#777}.h1,.h2,.h3,h1,h2,h3{margin-top:20px;margin-bottom:10px}.h1 .small,.h1 small,.h2 .small,.h2 small,.h3 .small,.h3 small,h1 .small,h1 small,h2 .small,h2 small,h3 .small,h3 small{font-size:65%}.h4,.h5,.h6,h4,h5,h6{margin-top:10px;margin-bottom:10px}.h4 .small,.h4 small,.h5 .small,.h5 small,.h6 .small,.h6 small,h4 .small,h4 small,h5 .small,h5 small,h6 .small,h6 small{font-size:75%}.h1,h1{font-size:36px}.h2,h2{font-size:30px}.h3,h3{font-size:24px}.h4,h4{font-size:18px}.h5,h5{font-size:14px}.h6,h6{font-size:12px}p{margin:0 0 10px}.lead{margin-bottom:20px;font-size:16px;font-weight:300;line-height:1.4}@media (min-width:768px){.lead{font-size:21px}}.small,small{font-size:85%}.mark,mark{padding:.2em;background-color:#fcf8e3}.text-left{text-align:left}.text-right{text-align:right}.text-center{text-align:center}.text-justify{text-align:justify}.text-nowrap{white-space:nowrap}.text-lowercase{text-transform:lowercase}.text-uppercase{text-transform:uppercase}.text-capitalize{text-transform:capitalize}.text-muted{color:#777}.text-primary{color:#337ab7}a.text-primary:focus,a.text-primary:hover{color:#286090}.text-success{color:#3c763d}a.text-success:focus,a.text-success:hover{color:#2b542c}.text-info{color:#31708f}a.text-info:focus,a.text-info:hover{color:#245269}.text-warning{color:#8a6d3b}a.text-warning:focus,a.text-warning:hover{color:#66512c}.text-danger{color:#a94442}a.text-danger:focus,a.text-danger:hover{color:#843534}.bg-primary{color:#fff;background-color:#337ab7}a.bg-primary:focus,a.bg-primary:hover{background-color:#286090}.bg-success{background-color:#dff0d8}a.bg-success:focus,a.bg-success:hover{background-color:#c1e2b3}.bg-info{background-color:#d9edf7}a.bg-info:focus,a.bg-info:hover{background-color:#afd9ee}.bg-warning{background-color:#fcf8e3}a.bg-warning:focus,a.bg-warning:hover{background-color:#f7ecb5}.bg-danger{background-color:#f2dede}a.bg-danger:focus,a.bg-danger:hover{background-color:#e4b9b9}.page-header{padding-bottom:9px;margin:40px 0 20px;border-bottom:1px solid #eee}ol,ul{margin-top:0;margin-bottom:10px}ol ol,ol ul,ul ol,ul ul{margin-bottom:0}.list-unstyled{padding-left:0;list-style:none}.list-inline{padding-left:0;list-style:none;margin-left:-5px}.list-inline>li{display:inline-block;padding-right:5px;padding-left:5px}dl{margin-top:0;margin-bottom:20px}dd,dt{line-height:1.42857143}dt{font-weight:700}dd{margin-left:0}@media (min-width:768px){.dl-horizontal dt{float:left;width:160px;clear:left;text-align:right;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dl-horizontal dd{margin-left:180px}}abbr[data-original-title],abbr[title]{cursor:help}.initialism{font-size:90%;text-transform:uppercase}blockquote{padding:10px 20px;margin:0 0 20px;font-size:17.5px;border-left:5px solid #eee}blockquote ol:last-child,blockquote p:last-child,blockquote ul:last-child{margin-bottom:0}blockquote .small,blockquote footer,blockquote small{display:block;font-size:80%;line-height:1.42857143;color:#777}blockquote .small:before,blockquote footer:before,blockquote small:before{content:\"\\2014 \\00A0\"}.blockquote-reverse,blockquote.pull-right{padding-right:15px;padding-left:0;text-align:right;border-right:5px solid #eee;border-left:0}.blockquote-reverse .small:before,.blockquote-reverse footer:before,.blockquote-reverse small:before,blockquote.pull-right .small:before,blockquote.pull-right footer:before,blockquote.pull-right small:before{content:\"\"}.blockquote-reverse .small:after,.blockquote-reverse footer:after,.blockquote-reverse small:after,blockquote.pull-right .small:after,blockquote.pull-right footer:after,blockquote.pull-right small:after{content:\"\\00A0 \\2014\"}address{margin-bottom:20px;font-style:normal;line-height:1.42857143}code,kbd,pre,samp{font-family:Menlo,Monaco,Consolas,\"Courier New\",monospace}code{padding:2px 4px;font-size:90%;color:#c7254e;background-color:#f9f2f4;border-radius:4px}kbd{padding:2px 4px;font-size:90%;color:#fff;background-color:#333;border-radius:3px;-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,.25);box-shadow:inset 0 -1px 0 rgba(0,0,0,.25)}kbd kbd{padding:0;font-size:100%;font-weight:700;-webkit-box-shadow:none;box-shadow:none}pre{display:block;padding:9.5px;margin:0 0 10px;font-size:13px;line-height:1.42857143;color:#333;word-break:break-all;word-wrap:break-word;background-color:#f5f5f5;border:1px solid #ccc;border-radius:4px}pre code{padding:0;font-size:inherit;color:inherit;white-space:pre-wrap;background-color:transparent;border-radius:0}.pre-scrollable{max-height:340px;overflow-y:scroll}.container{padding-right:15px;padding-left:15px;margin-right:auto;margin-left:auto}@media (min-width:768px){.container{width:750px}}@media (min-width:992px){.container{width:970px}}@media (min-width:1200px){.container{width:1170px}}.container-fluid{padding-right:15px;padding-left:15px;margin-right:auto;margin-left:auto}.row{margin-right:-15px;margin-left:-15px}.row-no-gutters{margin-right:0;margin-left:0}.row-no-gutters [class*=col-]{padding-right:0;padding-left:0}.col-lg-1,.col-lg-10,.col-lg-11,.col-lg-12,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9,.col-md-1,.col-md-10,.col-md-11,.col-md-12,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9,.col-sm-1,.col-sm-10,.col-sm-11,.col-sm-12,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9,.col-xs-1,.col-xs-10,.col-xs-11,.col-xs-12,.col-xs-2,.col-xs-3,.col-xs-4,.col-xs-5,.col-xs-6,.col-xs-7,.col-xs-8,.col-xs-9{position:relative;min-height:1px;padding-right:15px;padding-left:15px}.col-xs-1,.col-xs-10,.col-xs-11,.col-xs-12,.col-xs-2,.col-xs-3,.col-xs-4,.col-xs-5,.col-xs-6,.col-xs-7,.col-xs-8,.col-xs-9{float:left}.col-xs-12{width:100%}.col-xs-11{width:91.66666667%}.col-xs-10{width:83.33333333%}.col-xs-9{width:75%}.col-xs-8{width:66.66666667%}.col-xs-7{width:58.33333333%}.col-xs-6{width:50%}.col-xs-5{width:41.66666667%}.col-xs-4{width:33.33333333%}.col-xs-3{width:25%}.col-xs-2{width:16.66666667%}.col-xs-1{width:8.33333333%}.col-xs-pull-12{right:100%}.col-xs-pull-11{right:91.66666667%}.col-xs-pull-10{right:83.33333333%}.col-xs-pull-9{right:75%}.col-xs-pull-8{right:66.66666667%}.col-xs-pull-7{right:58.33333333%}.col-xs-pull-6{right:50%}.col-xs-pull-5{right:41.66666667%}.col-xs-pull-4{right:33.33333333%}.col-xs-pull-3{right:25%}.col-xs-pull-2{right:16.66666667%}.col-xs-pull-1{right:8.33333333%}.col-xs-pull-0{right:auto}.col-xs-push-12{left:100%}.col-xs-push-11{left:91.66666667%}.col-xs-push-10{left:83.33333333%}.col-xs-push-9{left:75%}.col-xs-push-8{left:66.66666667%}.col-xs-push-7{left:58.33333333%}.col-xs-push-6{left:50%}.col-xs-push-5{left:41.66666667%}.col-xs-push-4{left:33.33333333%}.col-xs-push-3{left:25%}.col-xs-push-2{left:16.66666667%}.col-xs-push-1{left:8.33333333%}.col-xs-push-0{left:auto}.col-xs-offset-12{margin-left:100%}.col-xs-offset-11{margin-left:91.66666667%}.col-xs-offset-10{margin-left:83.33333333%}.col-xs-offset-9{margin-left:75%}.col-xs-offset-8{margin-left:66.66666667%}.col-xs-offset-7{margin-left:58.33333333%}.col-xs-offset-6{margin-left:50%}.col-xs-offset-5{margin-left:41.66666667%}.col-xs-offset-4{margin-left:33.33333333%}.col-xs-offset-3{margin-left:25%}.col-xs-offset-2{margin-left:16.66666667%}.col-xs-offset-1{margin-left:8.33333333%}.col-xs-offset-0{margin-left:0}@media (min-width:768px){.col-sm-1,.col-sm-10,.col-sm-11,.col-sm-12,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9{float:left}.col-sm-12{width:100%}.col-sm-11{width:91.66666667%}.col-sm-10{width:83.33333333%}.col-sm-9{width:75%}.col-sm-8{width:66.66666667%}.col-sm-7{width:58.33333333%}.col-sm-6{width:50%}.col-sm-5{width:41.66666667%}.col-sm-4{width:33.33333333%}.col-sm-3{width:25%}.col-sm-2{width:16.66666667%}.col-sm-1{width:8.33333333%}.col-sm-pull-12{right:100%}.col-sm-pull-11{right:91.66666667%}.col-sm-pull-10{right:83.33333333%}.col-sm-pull-9{right:75%}.col-sm-pull-8{right:66.66666667%}.col-sm-pull-7{right:58.33333333%}.col-sm-pull-6{right:50%}.col-sm-pull-5{right:41.66666667%}.col-sm-pull-4{right:33.33333333%}.col-sm-pull-3{right:25%}.col-sm-pull-2{right:16.66666667%}.col-sm-pull-1{right:8.33333333%}.col-sm-pull-0{right:auto}.col-sm-push-12{left:100%}.col-sm-push-11{left:91.66666667%}.col-sm-push-10{left:83.33333333%}.col-sm-push-9{left:75%}.col-sm-push-8{left:66.66666667%}.col-sm-push-7{left:58.33333333%}.col-sm-push-6{left:50%}.col-sm-push-5{left:41.66666667%}.col-sm-push-4{left:33.33333333%}.col-sm-push-3{left:25%}.col-sm-push-2{left:16.66666667%}.col-sm-push-1{left:8.33333333%}.col-sm-push-0{left:auto}.col-sm-offset-12{margin-left:100%}.col-sm-offset-11{margin-left:91.66666667%}.col-sm-offset-10{margin-left:83.33333333%}.col-sm-offset-9{margin-left:75%}.col-sm-offset-8{margin-left:66.66666667%}.col-sm-offset-7{margin-left:58.33333333%}.col-sm-offset-6{margin-left:50%}.col-sm-offset-5{margin-left:41.66666667%}.col-sm-offset-4{margin-left:33.33333333%}.col-sm-offset-3{margin-left:25%}.col-sm-offset-2{margin-left:16.66666667%}.col-sm-offset-1{margin-left:8.33333333%}.col-sm-offset-0{margin-left:0}}@media (min-width:992px){.col-md-1,.col-md-10,.col-md-11,.col-md-12,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9{float:left}.col-md-12{width:100%}.col-md-11{width:91.66666667%}.col-md-10{width:83.33333333%}.col-md-9{width:75%}.col-md-8{width:66.66666667%}.col-md-7{width:58.33333333%}.col-md-6{width:50%}.col-md-5{width:41.66666667%}.col-md-4{width:33.33333333%}.col-md-3{width:25%}.col-md-2{width:16.66666667%}.col-md-1{width:8.33333333%}.col-md-pull-12{right:100%}.col-md-pull-11{right:91.66666667%}.col-md-pull-10{right:83.33333333%}.col-md-pull-9{right:75%}.col-md-pull-8{right:66.66666667%}.col-md-pull-7{right:58.33333333%}.col-md-pull-6{right:50%}.col-md-pull-5{right:41.66666667%}.col-md-pull-4{right:33.33333333%}.col-md-pull-3{right:25%}.col-md-pull-2{right:16.66666667%}.col-md-pull-1{right:8.33333333%}.col-md-pull-0{right:auto}.col-md-push-12{left:100%}.col-md-push-11{left:91.66666667%}.col-md-push-10{left:83.33333333%}.col-md-push-9{left:75%}.col-md-push-8{left:66.66666667%}.col-md-push-7{left:58.33333333%}.col-md-push-6{left:50%}.col-md-push-5{left:41.66666667%}.col-md-push-4{left:33.33333333%}.col-md-push-3{left:25%}.col-md-push-2{left:16.66666667%}.col-md-push-1{left:8.33333333%}.col-md-push-0{left:auto}.col-md-offset-12{margin-left:100%}.col-md-offset-11{margin-left:91.66666667%}.col-md-offset-10{margin-left:83.33333333%}.col-md-offset-9{margin-left:75%}.col-md-offset-8{margin-left:66.66666667%}.col-md-offset-7{margin-left:58.33333333%}.col-md-offset-6{margin-left:50%}.col-md-offset-5{margin-left:41.66666667%}.col-md-offset-4{margin-left:33.33333333%}.col-md-offset-3{margin-left:25%}.col-md-offset-2{margin-left:16.66666667%}.col-md-offset-1{margin-left:8.33333333%}.col-md-offset-0{margin-left:0}}@media (min-width:1200px){.col-lg-1,.col-lg-10,.col-lg-11,.col-lg-12,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9{float:left}.col-lg-12{width:100%}.col-lg-11{width:91.66666667%}.col-lg-10{width:83.33333333%}.col-lg-9{width:75%}.col-lg-8{width:66.66666667%}.col-lg-7{width:58.33333333%}.col-lg-6{width:50%}.col-lg-5{width:41.66666667%}.col-lg-4{width:33.33333333%}.col-lg-3{width:25%}.col-lg-2{width:16.66666667%}.col-lg-1{width:8.33333333%}.col-lg-pull-12{right:100%}.col-lg-pull-11{right:91.66666667%}.col-lg-pull-10{right:83.33333333%}.col-lg-pull-9{right:75%}.col-lg-pull-8{right:66.66666667%}.col-lg-pull-7{right:58.33333333%}.col-lg-pull-6{right:50%}.col-lg-pull-5{right:41.66666667%}.col-lg-pull-4{right:33.33333333%}.col-lg-pull-3{right:25%}.col-lg-pull-2{right:16.66666667%}.col-lg-pull-1{right:8.33333333%}.col-lg-pull-0{right:auto}.col-lg-push-12{left:100%}.col-lg-push-11{left:91.66666667%}.col-lg-push-10{left:83.33333333%}.col-lg-push-9{left:75%}.col-lg-push-8{left:66.66666667%}.col-lg-push-7{left:58.33333333%}.col-lg-push-6{left:50%}.col-lg-push-5{left:41.66666667%}.col-lg-push-4{left:33.33333333%}.col-lg-push-3{left:25%}.col-lg-push-2{left:16.66666667%}.col-lg-push-1{left:8.33333333%}.col-lg-push-0{left:auto}.col-lg-offset-12{margin-left:100%}.col-lg-offset-11{margin-left:91.66666667%}.col-lg-offset-10{margin-left:83.33333333%}.col-lg-offset-9{margin-left:75%}.col-lg-offset-8{margin-left:66.66666667%}.col-lg-offset-7{margin-left:58.33333333%}.col-lg-offset-6{margin-left:50%}.col-lg-offset-5{margin-left:41.66666667%}.col-lg-offset-4{margin-left:33.33333333%}.col-lg-offset-3{margin-left:25%}.col-lg-offset-2{margin-left:16.66666667%}.col-lg-offset-1{margin-left:8.33333333%}.col-lg-offset-0{margin-left:0}}table{background-color:transparent}table col[class*=col-]{position:static;display:table-column;float:none}table td[class*=col-],table th[class*=col-]{position:static;display:table-cell;float:none}caption{padding-top:8px;padding-bottom:8px;color:#777;text-align:left}th{text-align:left}.table{width:100%;max-width:100%;margin-bottom:20px}.table>tbody>tr>td,.table>tbody>tr>th,.table>tfoot>tr>td,.table>tfoot>tr>th,.table>thead>tr>td,.table>thead>tr>th{padding:8px;line-height:1.42857143;vertical-align:top;border-top:1px solid #ddd}.table>thead>tr>th{vertical-align:bottom;border-bottom:2px solid #ddd}.table>caption+thead>tr:first-child>td,.table>caption+thead>tr:first-child>th,.table>colgroup+thead>tr:first-child>td,.table>colgroup+thead>tr:first-child>th,.table>thead:first-child>tr:first-child>td,.table>thead:first-child>tr:first-child>th{border-top:0}.table>tbody+tbody{border-top:2px solid #ddd}.table .table{background-color:#fff}.table-condensed>tbody>tr>td,.table-condensed>tbody>tr>th,.table-condensed>tfoot>tr>td,.table-condensed>tfoot>tr>th,.table-condensed>thead>tr>td,.table-condensed>thead>tr>th{padding:5px}.table-bordered{border:1px solid #ddd}.table-bordered>tbody>tr>td,.table-bordered>tbody>tr>th,.table-bordered>tfoot>tr>td,.table-bordered>tfoot>tr>th,.table-bordered>thead>tr>td,.table-bordered>thead>tr>th{border:1px solid #ddd}.table-bordered>thead>tr>td,.table-bordered>thead>tr>th{border-bottom-width:2px}.table-striped>tbody>tr:nth-of-type(odd){background-color:#f9f9f9}.table-hover>tbody>tr:hover{background-color:#f5f5f5}.table>tbody>tr.active>td,.table>tbody>tr.active>th,.table>tbody>tr>td.active,.table>tbody>tr>th.active,.table>tfoot>tr.active>td,.table>tfoot>tr.active>th,.table>tfoot>tr>td.active,.table>tfoot>tr>th.active,.table>thead>tr.active>td,.table>thead>tr.active>th,.table>thead>tr>td.active,.table>thead>tr>th.active{background-color:#f5f5f5}.table-hover>tbody>tr.active:hover>td,.table-hover>tbody>tr.active:hover>th,.table-hover>tbody>tr:hover>.active,.table-hover>tbody>tr>td.active:hover,.table-hover>tbody>tr>th.active:hover{background-color:#e8e8e8}.table>tbody>tr.success>td,.table>tbody>tr.success>th,.table>tbody>tr>td.success,.table>tbody>tr>th.success,.table>tfoot>tr.success>td,.table>tfoot>tr.success>th,.table>tfoot>tr>td.success,.table>tfoot>tr>th.success,.table>thead>tr.success>td,.table>thead>tr.success>th,.table>thead>tr>td.success,.table>thead>tr>th.success{background-color:#dff0d8}.table-hover>tbody>tr.success:hover>td,.table-hover>tbody>tr.success:hover>th,.table-hover>tbody>tr:hover>.success,.table-hover>tbody>tr>td.success:hover,.table-hover>tbody>tr>th.success:hover{background-color:#d0e9c6}.table>tbody>tr.info>td,.table>tbody>tr.info>th,.table>tbody>tr>td.info,.table>tbody>tr>th.info,.table>tfoot>tr.info>td,.table>tfoot>tr.info>th,.table>tfoot>tr>td.info,.table>tfoot>tr>th.info,.table>thead>tr.info>td,.table>thead>tr.info>th,.table>thead>tr>td.info,.table>thead>tr>th.info{background-color:#d9edf7}.table-hover>tbody>tr.info:hover>td,.table-hover>tbody>tr.info:hover>th,.table-hover>tbody>tr:hover>.info,.table-hover>tbody>tr>td.info:hover,.table-hover>tbody>tr>th.info:hover{background-color:#c4e3f3}.table>tbody>tr.warning>td,.table>tbody>tr.warning>th,.table>tbody>tr>td.warning,.table>tbody>tr>th.warning,.table>tfoot>tr.warning>td,.table>tfoot>tr.warning>th,.table>tfoot>tr>td.warning,.table>tfoot>tr>th.warning,.table>thead>tr.warning>td,.table>thead>tr.warning>th,.table>thead>tr>td.warning,.table>thead>tr>th.warning{background-color:#fcf8e3}.table-hover>tbody>tr.warning:hover>td,.table-hover>tbody>tr.warning:hover>th,.table-hover>tbody>tr:hover>.warning,.table-hover>tbody>tr>td.warning:hover,.table-hover>tbody>tr>th.warning:hover{background-color:#faf2cc}.table>tbody>tr.danger>td,.table>tbody>tr.danger>th,.table>tbody>tr>td.danger,.table>tbody>tr>th.danger,.table>tfoot>tr.danger>td,.table>tfoot>tr.danger>th,.table>tfoot>tr>td.danger,.table>tfoot>tr>th.danger,.table>thead>tr.danger>td,.table>thead>tr.danger>th,.table>thead>tr>td.danger,.table>thead>tr>th.danger{background-color:#f2dede}.table-hover>tbody>tr.danger:hover>td,.table-hover>tbody>tr.danger:hover>th,.table-hover>tbody>tr:hover>.danger,.table-hover>tbody>tr>td.danger:hover,.table-hover>tbody>tr>th.danger:hover{background-color:#ebcccc}.table-responsive{min-height:.01%;overflow-x:auto}@media screen and (max-width:767px){.table-responsive{width:100%;margin-bottom:15px;overflow-y:hidden;-ms-overflow-style:-ms-autohiding-scrollbar;border:1px solid #ddd}.table-responsive>.table{margin-bottom:0}.table-responsive>.table>tbody>tr>td,.table-responsive>.table>tbody>tr>th,.table-responsive>.table>tfoot>tr>td,.table-responsive>.table>tfoot>tr>th,.table-responsive>.table>thead>tr>td,.table-responsive>.table>thead>tr>th{white-space:nowrap}.table-responsive>.table-bordered{border:0}.table-responsive>.table-bordered>tbody>tr>td:first-child,.table-responsive>.table-bordered>tbody>tr>th:first-child,.table-responsive>.table-bordered>tfoot>tr>td:first-child,.table-responsive>.table-bordered>tfoot>tr>th:first-child,.table-responsive>.table-bordered>thead>tr>td:first-child,.table-responsive>.table-bordered>thead>tr>th:first-child{border-left:0}.table-responsive>.table-bordered>tbody>tr>td:last-child,.table-responsive>.table-bordered>tbody>tr>th:last-child,.table-responsive>.table-bordered>tfoot>tr>td:last-child,.table-responsive>.table-bordered>tfoot>tr>th:last-child,.table-responsive>.table-bordered>thead>tr>td:last-child,.table-responsive>.table-bordered>thead>tr>th:last-child{border-right:0}.table-responsive>.table-bordered>tbody>tr:last-child>td,.table-responsive>.table-bordered>tbody>tr:last-child>th,.table-responsive>.table-bordered>tfoot>tr:last-child>td,.table-responsive>.table-bordered>tfoot>tr:last-child>th{border-bottom:0}}fieldset{min-width:0;padding:0;margin:0;border:0}legend{display:block;width:100%;padding:0;margin-bottom:20px;font-size:21px;line-height:inherit;color:#333;border:0;border-bottom:1px solid #e5e5e5}label{display:inline-block;max-width:100%;margin-bottom:5px;font-weight:700}input[type=search]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;-webkit-appearance:none;-moz-appearance:none;appearance:none}input[type=checkbox],input[type=radio]{margin:4px 0 0;margin-top:1px\\9;line-height:normal}fieldset[disabled] input[type=checkbox],fieldset[disabled] input[type=radio],input[type=checkbox].disabled,input[type=checkbox][disabled],input[type=radio].disabled,input[type=radio][disabled]{cursor:not-allowed}input[type=file]{display:block}input[type=range]{display:block;width:100%}select[multiple],select[size]{height:auto}input[type=checkbox]:focus,input[type=file]:focus,input[type=radio]:focus{outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}output{display:block;padding-top:7px;font-size:14px;line-height:1.42857143;color:#555}.form-control{display:block;width:100%;height:34px;padding:6px 12px;font-size:14px;line-height:1.42857143;color:#555;background-color:#fff;background-image:none;border:1px solid #ccc;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075);-webkit-transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s;-o-transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s;-webkit-transition:border-color ease-in-out .15s,-webkit-box-shadow ease-in-out .15s;transition:border-color ease-in-out .15s,-webkit-box-shadow ease-in-out .15s;transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s;transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s,-webkit-box-shadow ease-in-out .15s}.form-control:focus{border-color:#66afe9;outline:0;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6);box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6)}.form-control::-moz-placeholder{color:#999;opacity:1}.form-control:-ms-input-placeholder{color:#999}.form-control::-webkit-input-placeholder{color:#999}.form-control::-ms-expand{background-color:transparent;border:0}.form-control[disabled],.form-control[readonly],fieldset[disabled] .form-control{background-color:#eee;opacity:1}.form-control[disabled],fieldset[disabled] .form-control{cursor:not-allowed}textarea.form-control{height:auto}@media screen and (-webkit-min-device-pixel-ratio:0){input[type=date].form-control,input[type=datetime-local].form-control,input[type=month].form-control,input[type=time].form-control{line-height:34px}.input-group-sm input[type=date],.input-group-sm input[type=datetime-local],.input-group-sm input[type=month],.input-group-sm input[type=time],input[type=date].input-sm,input[type=datetime-local].input-sm,input[type=month].input-sm,input[type=time].input-sm{line-height:30px}.input-group-lg input[type=date],.input-group-lg input[type=datetime-local],.input-group-lg input[type=month],.input-group-lg input[type=time],input[type=date].input-lg,input[type=datetime-local].input-lg,input[type=month].input-lg,input[type=time].input-lg{line-height:46px}}.form-group{margin-bottom:15px}.checkbox,.radio{position:relative;display:block;margin-top:10px;margin-bottom:10px}.checkbox.disabled label,.radio.disabled label,fieldset[disabled] .checkbox label,fieldset[disabled] .radio label{cursor:not-allowed}.checkbox label,.radio label{min-height:20px;padding-left:20px;margin-bottom:0;font-weight:400;cursor:pointer}.checkbox input[type=checkbox],.checkbox-inline input[type=checkbox],.radio input[type=radio],.radio-inline input[type=radio]{position:absolute;margin-top:4px\\9;margin-left:-20px}.checkbox+.checkbox,.radio+.radio{margin-top:-5px}.checkbox-inline,.radio-inline{position:relative;display:inline-block;padding-left:20px;margin-bottom:0;font-weight:400;vertical-align:middle;cursor:pointer}.checkbox-inline.disabled,.radio-inline.disabled,fieldset[disabled] .checkbox-inline,fieldset[disabled] .radio-inline{cursor:not-allowed}.checkbox-inline+.checkbox-inline,.radio-inline+.radio-inline{margin-top:0;margin-left:10px}.form-control-static{min-height:34px;padding-top:7px;padding-bottom:7px;margin-bottom:0}.form-control-static.input-lg,.form-control-static.input-sm{padding-right:0;padding-left:0}.input-sm{height:30px;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}select.input-sm{height:30px;line-height:30px}select[multiple].input-sm,textarea.input-sm{height:auto}.form-group-sm .form-control{height:30px;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}.form-group-sm select.form-control{height:30px;line-height:30px}.form-group-sm select[multiple].form-control,.form-group-sm textarea.form-control{height:auto}.form-group-sm .form-control-static{height:30px;min-height:32px;padding:6px 10px;font-size:12px;line-height:1.5}.input-lg{height:46px;padding:10px 16px;font-size:18px;line-height:1.3333333;border-radius:6px}select.input-lg{height:46px;line-height:46px}select[multiple].input-lg,textarea.input-lg{height:auto}.form-group-lg .form-control{height:46px;padding:10px 16px;font-size:18px;line-height:1.3333333;border-radius:6px}.form-group-lg select.form-control{height:46px;line-height:46px}.form-group-lg select[multiple].form-control,.form-group-lg textarea.form-control{height:auto}.form-group-lg .form-control-static{height:46px;min-height:38px;padding:11px 16px;font-size:18px;line-height:1.3333333}.has-feedback{position:relative}.has-feedback .form-control{padding-right:42.5px}.form-control-feedback{position:absolute;top:0;right:0;z-index:2;display:block;width:34px;height:34px;line-height:34px;text-align:center;pointer-events:none}.form-group-lg .form-control+.form-control-feedback,.input-group-lg+.form-control-feedback,.input-lg+.form-control-feedback{width:46px;height:46px;line-height:46px}.form-group-sm .form-control+.form-control-feedback,.input-group-sm+.form-control-feedback,.input-sm+.form-control-feedback{width:30px;height:30px;line-height:30px}.has-success .checkbox,.has-success .checkbox-inline,.has-success .control-label,.has-success .help-block,.has-success .radio,.has-success .radio-inline,.has-success.checkbox label,.has-success.checkbox-inline label,.has-success.radio label,.has-success.radio-inline label{color:#3c763d}.has-success .form-control{border-color:#3c763d;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.has-success .form-control:focus{border-color:#2b542c;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #67b168;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #67b168}.has-success .input-group-addon{color:#3c763d;background-color:#dff0d8;border-color:#3c763d}.has-success .form-control-feedback{color:#3c763d}.has-warning .checkbox,.has-warning .checkbox-inline,.has-warning .control-label,.has-warning .help-block,.has-warning .radio,.has-warning .radio-inline,.has-warning.checkbox label,.has-warning.checkbox-inline label,.has-warning.radio label,.has-warning.radio-inline label{color:#8a6d3b}.has-warning .form-control{border-color:#8a6d3b;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.has-warning .form-control:focus{border-color:#66512c;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #c0a16b;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #c0a16b}.has-warning .input-group-addon{color:#8a6d3b;background-color:#fcf8e3;border-color:#8a6d3b}.has-warning .form-control-feedback{color:#8a6d3b}.has-error .checkbox,.has-error .checkbox-inline,.has-error .control-label,.has-error .help-block,.has-error .radio,.has-error .radio-inline,.has-error.checkbox label,.has-error.checkbox-inline label,.has-error.radio label,.has-error.radio-inline label{color:#a94442}.has-error .form-control{border-color:#a94442;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.has-error .form-control:focus{border-color:#843534;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #ce8483;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #ce8483}.has-error .input-group-addon{color:#a94442;background-color:#f2dede;border-color:#a94442}.has-error .form-control-feedback{color:#a94442}.has-feedback label~.form-control-feedback{top:25px}.has-feedback label.sr-only~.form-control-feedback{top:0}.help-block{display:block;margin-top:5px;margin-bottom:10px;color:#737373}@media (min-width:768px){.form-inline .form-group{display:inline-block;margin-bottom:0;vertical-align:middle}.form-inline .form-control{display:inline-block;width:auto;vertical-align:middle}.form-inline .form-control-static{display:inline-block}.form-inline .input-group{display:inline-table;vertical-align:middle}.form-inline .input-group .form-control,.form-inline .input-group .input-group-addon,.form-inline .input-group .input-group-btn{width:auto}.form-inline .input-group>.form-control{width:100%}.form-inline .control-label{margin-bottom:0;vertical-align:middle}.form-inline .checkbox,.form-inline .radio{display:inline-block;margin-top:0;margin-bottom:0;vertical-align:middle}.form-inline .checkbox label,.form-inline .radio label{padding-left:0}.form-inline .checkbox input[type=checkbox],.form-inline .radio input[type=radio]{position:relative;margin-left:0}.form-inline .has-feedback .form-control-feedback{top:0}}.form-horizontal .checkbox,.form-horizontal .checkbox-inline,.form-horizontal .radio,.form-horizontal .radio-inline{padding-top:7px;margin-top:0;margin-bottom:0}.form-horizontal .checkbox,.form-horizontal .radio{min-height:27px}.form-horizontal .form-group{margin-right:-15px;margin-left:-15px}@media (min-width:768px){.form-horizontal .control-label{padding-top:7px;margin-bottom:0;text-align:right}}.form-horizontal .has-feedback .form-control-feedback{right:15px}@media (min-width:768px){.form-horizontal .form-group-lg .control-label{padding-top:11px;font-size:18px}}@media (min-width:768px){.form-horizontal .form-group-sm .control-label{padding-top:6px;font-size:12px}}.btn{display:inline-block;margin-bottom:0;font-weight:400;text-align:center;white-space:nowrap;vertical-align:middle;-ms-touch-action:manipulation;touch-action:manipulation;cursor:pointer;background-image:none;border:1px solid transparent;padding:6px 12px;font-size:14px;line-height:1.42857143;border-radius:4px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.btn.active.focus,.btn.active:focus,.btn.focus,.btn:active.focus,.btn:active:focus,.btn:focus{outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}.btn.focus,.btn:focus,.btn:hover{color:#333;text-decoration:none}.btn.active,.btn:active{background-image:none;outline:0;-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,.125);box-shadow:inset 0 3px 5px rgba(0,0,0,.125)}.btn.disabled,.btn[disabled],fieldset[disabled] .btn{cursor:not-allowed;filter:alpha(opacity=65);opacity:.65;-webkit-box-shadow:none;box-shadow:none}a.btn.disabled,fieldset[disabled] a.btn{pointer-events:none}.btn-default{color:#333;background-color:#fff;border-color:#ccc}.btn-default.focus,.btn-default:focus{color:#333;background-color:#e6e6e6;border-color:#8c8c8c}.btn-default:hover{color:#333;background-color:#e6e6e6;border-color:#adadad}.btn-default.active,.btn-default:active,.open>.dropdown-toggle.btn-default{color:#333;background-color:#e6e6e6;background-image:none;border-color:#adadad}.btn-default.active.focus,.btn-default.active:focus,.btn-default.active:hover,.btn-default:active.focus,.btn-default:active:focus,.btn-default:active:hover,.open>.dropdown-toggle.btn-default.focus,.open>.dropdown-toggle.btn-default:focus,.open>.dropdown-toggle.btn-default:hover{color:#333;background-color:#d4d4d4;border-color:#8c8c8c}.btn-default.disabled.focus,.btn-default.disabled:focus,.btn-default.disabled:hover,.btn-default[disabled].focus,.btn-default[disabled]:focus,.btn-default[disabled]:hover,fieldset[disabled] .btn-default.focus,fieldset[disabled] .btn-default:focus,fieldset[disabled] .btn-default:hover{background-color:#fff;border-color:#ccc}.btn-default .badge{color:#fff;background-color:#333}.btn-primary{color:#fff;background-color:#337ab7;border-color:#2e6da4}.btn-primary.focus,.btn-primary:focus{color:#fff;background-color:#286090;border-color:#122b40}.btn-primary:hover{color:#fff;background-color:#286090;border-color:#204d74}.btn-primary.active,.btn-primary:active,.open>.dropdown-toggle.btn-primary{color:#fff;background-color:#286090;background-image:none;border-color:#204d74}.btn-primary.active.focus,.btn-primary.active:focus,.btn-primary.active:hover,.btn-primary:active.focus,.btn-primary:active:focus,.btn-primary:active:hover,.open>.dropdown-toggle.btn-primary.focus,.open>.dropdown-toggle.btn-primary:focus,.open>.dropdown-toggle.btn-primary:hover{color:#fff;background-color:#204d74;border-color:#122b40}.btn-primary.disabled.focus,.btn-primary.disabled:focus,.btn-primary.disabled:hover,.btn-primary[disabled].focus,.btn-primary[disabled]:focus,.btn-primary[disabled]:hover,fieldset[disabled] .btn-primary.focus,fieldset[disabled] .btn-primary:focus,fieldset[disabled] .btn-primary:hover{background-color:#337ab7;border-color:#2e6da4}.btn-primary .badge{color:#337ab7;background-color:#fff}.btn-success{color:#fff;background-color:#5cb85c;border-color:#4cae4c}.btn-success.focus,.btn-success:focus{color:#fff;background-color:#449d44;border-color:#255625}.btn-success:hover{color:#fff;background-color:#449d44;border-color:#398439}.btn-success.active,.btn-success:active,.open>.dropdown-toggle.btn-success{color:#fff;background-color:#449d44;background-image:none;border-color:#398439}.btn-success.active.focus,.btn-success.active:focus,.btn-success.active:hover,.btn-success:active.focus,.btn-success:active:focus,.btn-success:active:hover,.open>.dropdown-toggle.btn-success.focus,.open>.dropdown-toggle.btn-success:focus,.open>.dropdown-toggle.btn-success:hover{color:#fff;background-color:#398439;border-color:#255625}.btn-success.disabled.focus,.btn-success.disabled:focus,.btn-success.disabled:hover,.btn-success[disabled].focus,.btn-success[disabled]:focus,.btn-success[disabled]:hover,fieldset[disabled] .btn-success.focus,fieldset[disabled] .btn-success:focus,fieldset[disabled] .btn-success:hover{background-color:#5cb85c;border-color:#4cae4c}.btn-success .badge{color:#5cb85c;background-color:#fff}.btn-info{color:#fff;background-color:#5bc0de;border-color:#46b8da}.btn-info.focus,.btn-info:focus{color:#fff;background-color:#31b0d5;border-color:#1b6d85}.btn-info:hover{color:#fff;background-color:#31b0d5;border-color:#269abc}.btn-info.active,.btn-info:active,.open>.dropdown-toggle.btn-info{color:#fff;background-color:#31b0d5;background-image:none;border-color:#269abc}.btn-info.active.focus,.btn-info.active:focus,.btn-info.active:hover,.btn-info:active.focus,.btn-info:active:focus,.btn-info:active:hover,.open>.dropdown-toggle.btn-info.focus,.open>.dropdown-toggle.btn-info:focus,.open>.dropdown-toggle.btn-info:hover{color:#fff;background-color:#269abc;border-color:#1b6d85}.btn-info.disabled.focus,.btn-info.disabled:focus,.btn-info.disabled:hover,.btn-info[disabled].focus,.btn-info[disabled]:focus,.btn-info[disabled]:hover,fieldset[disabled] .btn-info.focus,fieldset[disabled] .btn-info:focus,fieldset[disabled] .btn-info:hover{background-color:#5bc0de;border-color:#46b8da}.btn-info .badge{color:#5bc0de;background-color:#fff}.btn-warning{color:#fff;background-color:#f0ad4e;border-color:#eea236}.btn-warning.focus,.btn-warning:focus{color:#fff;background-color:#ec971f;border-color:#985f0d}.btn-warning:hover{color:#fff;background-color:#ec971f;border-color:#d58512}.btn-warning.active,.btn-warning:active,.open>.dropdown-toggle.btn-warning{color:#fff;background-color:#ec971f;background-image:none;border-color:#d58512}.btn-warning.active.focus,.btn-warning.active:focus,.btn-warning.active:hover,.btn-warning:active.focus,.btn-warning:active:focus,.btn-warning:active:hover,.open>.dropdown-toggle.btn-warning.focus,.open>.dropdown-toggle.btn-warning:focus,.open>.dropdown-toggle.btn-warning:hover{color:#fff;background-color:#d58512;border-color:#985f0d}.btn-warning.disabled.focus,.btn-warning.disabled:focus,.btn-warning.disabled:hover,.btn-warning[disabled].focus,.btn-warning[disabled]:focus,.btn-warning[disabled]:hover,fieldset[disabled] .btn-warning.focus,fieldset[disabled] .btn-warning:focus,fieldset[disabled] .btn-warning:hover{background-color:#f0ad4e;border-color:#eea236}.btn-warning .badge{color:#f0ad4e;background-color:#fff}.btn-danger{color:#fff;background-color:#d9534f;border-color:#d43f3a}.btn-danger.focus,.btn-danger:focus{color:#fff;background-color:#c9302c;border-color:#761c19}.btn-danger:hover{color:#fff;background-color:#c9302c;border-color:#ac2925}.btn-danger.active,.btn-danger:active,.open>.dropdown-toggle.btn-danger{color:#fff;background-color:#c9302c;background-image:none;border-color:#ac2925}.btn-danger.active.focus,.btn-danger.active:focus,.btn-danger.active:hover,.btn-danger:active.focus,.btn-danger:active:focus,.btn-danger:active:hover,.open>.dropdown-toggle.btn-danger.focus,.open>.dropdown-toggle.btn-danger:focus,.open>.dropdown-toggle.btn-danger:hover{color:#fff;background-color:#ac2925;border-color:#761c19}.btn-danger.disabled.focus,.btn-danger.disabled:focus,.btn-danger.disabled:hover,.btn-danger[disabled].focus,.btn-danger[disabled]:focus,.btn-danger[disabled]:hover,fieldset[disabled] .btn-danger.focus,fieldset[disabled] .btn-danger:focus,fieldset[disabled] .btn-danger:hover{background-color:#d9534f;border-color:#d43f3a}.btn-danger .badge{color:#d9534f;background-color:#fff}.btn-link{font-weight:400;color:#337ab7;border-radius:0}.btn-link,.btn-link.active,.btn-link:active,.btn-link[disabled],fieldset[disabled] .btn-link{background-color:transparent;-webkit-box-shadow:none;box-shadow:none}.btn-link,.btn-link:active,.btn-link:focus,.btn-link:hover{border-color:transparent}.btn-link:focus,.btn-link:hover{color:#23527c;text-decoration:underline;background-color:transparent}.btn-link[disabled]:focus,.btn-link[disabled]:hover,fieldset[disabled] .btn-link:focus,fieldset[disabled] .btn-link:hover{color:#777;text-decoration:none}.btn-group-lg>.btn,.btn-lg{padding:10px 16px;font-size:18px;line-height:1.3333333;border-radius:6px}.btn-group-sm>.btn,.btn-sm{padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}.btn-group-xs>.btn,.btn-xs{padding:1px 5px;font-size:12px;line-height:1.5;border-radius:3px}.btn-block{display:block;width:100%}.btn-block+.btn-block{margin-top:5px}input[type=button].btn-block,input[type=reset].btn-block,input[type=submit].btn-block{width:100%}.fade{opacity:0;-webkit-transition:opacity .15s linear;-o-transition:opacity .15s linear;transition:opacity .15s linear}.fade.in{opacity:1}.collapse{display:none}.collapse.in{display:block}tr.collapse.in{display:table-row}tbody.collapse.in{display:table-row-group}.collapsing{position:relative;height:0;overflow:hidden;-webkit-transition-property:height,visibility;-o-transition-property:height,visibility;transition-property:height,visibility;-webkit-transition-duration:.35s;-o-transition-duration:.35s;transition-duration:.35s;-webkit-transition-timing-function:ease;-o-transition-timing-function:ease;transition-timing-function:ease}.caret{display:inline-block;width:0;height:0;margin-left:2px;vertical-align:middle;border-top:4px dashed;border-top:4px solid\\9;border-right:4px solid transparent;border-left:4px solid transparent}.dropdown,.dropup{position:relative}.dropdown-toggle:focus{outline:0}.dropdown-menu{position:absolute;top:100%;left:0;z-index:1000;display:none;float:left;min-width:160px;padding:5px 0;margin:2px 0 0;font-size:14px;text-align:left;list-style:none;background-color:#fff;background-clip:padding-box;border:1px solid #ccc;border:1px solid rgba(0,0,0,.15);border-radius:4px;-webkit-box-shadow:0 6px 12px rgba(0,0,0,.175);box-shadow:0 6px 12px rgba(0,0,0,.175)}.dropdown-menu.pull-right{right:0;left:auto}.dropdown-menu .divider{height:1px;margin:9px 0;overflow:hidden;background-color:#e5e5e5}.dropdown-menu>li>a{display:block;padding:3px 20px;clear:both;font-weight:400;line-height:1.42857143;color:#333;white-space:nowrap}.dropdown-menu>li>a:focus,.dropdown-menu>li>a:hover{color:#262626;text-decoration:none;background-color:#f5f5f5}.dropdown-menu>.active>a,.dropdown-menu>.active>a:focus,.dropdown-menu>.active>a:hover{color:#fff;text-decoration:none;background-color:#337ab7;outline:0}.dropdown-menu>.disabled>a,.dropdown-menu>.disabled>a:focus,.dropdown-menu>.disabled>a:hover{color:#777}.dropdown-menu>.disabled>a:focus,.dropdown-menu>.disabled>a:hover{text-decoration:none;cursor:not-allowed;background-color:transparent;background-image:none;filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.open>.dropdown-menu{display:block}.open>a{outline:0}.dropdown-menu-right{right:0;left:auto}.dropdown-menu-left{right:auto;left:0}.dropdown-header{display:block;padding:3px 20px;font-size:12px;line-height:1.42857143;color:#777;white-space:nowrap}.dropdown-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:990}.pull-right>.dropdown-menu{right:0;left:auto}.dropup .caret,.navbar-fixed-bottom .dropdown .caret{content:\"\";border-top:0;border-bottom:4px dashed;border-bottom:4px solid\\9}.dropup .dropdown-menu,.navbar-fixed-bottom .dropdown .dropdown-menu{top:auto;bottom:100%;margin-bottom:2px}@media (min-width:768px){.navbar-right .dropdown-menu{right:0;left:auto}.navbar-right .dropdown-menu-left{right:auto;left:0}}.btn-group,.btn-group-vertical{position:relative;display:inline-block;vertical-align:middle}.btn-group-vertical>.btn,.btn-group>.btn{position:relative;float:left}.btn-group-vertical>.btn.active,.btn-group-vertical>.btn:active,.btn-group-vertical>.btn:focus,.btn-group-vertical>.btn:hover,.btn-group>.btn.active,.btn-group>.btn:active,.btn-group>.btn:focus,.btn-group>.btn:hover{z-index:2}.btn-group .btn+.btn,.btn-group .btn+.btn-group,.btn-group .btn-group+.btn,.btn-group .btn-group+.btn-group{margin-left:-1px}.btn-toolbar{margin-left:-5px}.btn-toolbar .btn,.btn-toolbar .btn-group,.btn-toolbar .input-group{float:left}.btn-toolbar>.btn,.btn-toolbar>.btn-group,.btn-toolbar>.input-group{margin-left:5px}.btn-group>.btn:not(:first-child):not(:last-child):not(.dropdown-toggle){border-radius:0}.btn-group>.btn:first-child{margin-left:0}.btn-group>.btn:first-child:not(:last-child):not(.dropdown-toggle){border-top-right-radius:0;border-bottom-right-radius:0}.btn-group>.btn:last-child:not(:first-child),.btn-group>.dropdown-toggle:not(:first-child){border-top-left-radius:0;border-bottom-left-radius:0}.btn-group>.btn-group{float:left}.btn-group>.btn-group:not(:first-child):not(:last-child)>.btn{border-radius:0}.btn-group>.btn-group:first-child:not(:last-child)>.btn:last-child,.btn-group>.btn-group:first-child:not(:last-child)>.dropdown-toggle{border-top-right-radius:0;border-bottom-right-radius:0}.btn-group>.btn-group:last-child:not(:first-child)>.btn:first-child{border-top-left-radius:0;border-bottom-left-radius:0}.btn-group .dropdown-toggle:active,.btn-group.open .dropdown-toggle{outline:0}.btn-group>.btn+.dropdown-toggle{padding-right:8px;padding-left:8px}.btn-group>.btn-lg+.dropdown-toggle{padding-right:12px;padding-left:12px}.btn-group.open .dropdown-toggle{-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,.125);box-shadow:inset 0 3px 5px rgba(0,0,0,.125)}.btn-group.open .dropdown-toggle.btn-link{-webkit-box-shadow:none;box-shadow:none}.btn .caret{margin-left:0}.btn-lg .caret{border-width:5px 5px 0;border-bottom-width:0}.dropup .btn-lg .caret{border-width:0 5px 5px}.btn-group-vertical>.btn,.btn-group-vertical>.btn-group,.btn-group-vertical>.btn-group>.btn{display:block;float:none;width:100%;max-width:100%}.btn-group-vertical>.btn-group>.btn{float:none}.btn-group-vertical>.btn+.btn,.btn-group-vertical>.btn+.btn-group,.btn-group-vertical>.btn-group+.btn,.btn-group-vertical>.btn-group+.btn-group{margin-top:-1px;margin-left:0}.btn-group-vertical>.btn:not(:first-child):not(:last-child){border-radius:0}.btn-group-vertical>.btn:first-child:not(:last-child){border-top-left-radius:4px;border-top-right-radius:4px;border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn:last-child:not(:first-child){border-top-left-radius:0;border-top-right-radius:0;border-bottom-right-radius:4px;border-bottom-left-radius:4px}.btn-group-vertical>.btn-group:not(:first-child):not(:last-child)>.btn{border-radius:0}.btn-group-vertical>.btn-group:first-child:not(:last-child)>.btn:last-child,.btn-group-vertical>.btn-group:first-child:not(:last-child)>.dropdown-toggle{border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn-group:last-child:not(:first-child)>.btn:first-child{border-top-left-radius:0;border-top-right-radius:0}.btn-group-justified{display:table;width:100%;table-layout:fixed;border-collapse:separate}.btn-group-justified>.btn,.btn-group-justified>.btn-group{display:table-cell;float:none;width:1%}.btn-group-justified>.btn-group .btn{width:100%}.btn-group-justified>.btn-group .dropdown-menu{left:auto}[data-toggle=buttons]>.btn input[type=checkbox],[data-toggle=buttons]>.btn input[type=radio],[data-toggle=buttons]>.btn-group>.btn input[type=checkbox],[data-toggle=buttons]>.btn-group>.btn input[type=radio]{position:absolute;clip:rect(0,0,0,0);pointer-events:none}.input-group{position:relative;display:table;border-collapse:separate}.input-group[class*=col-]{float:none;padding-right:0;padding-left:0}.input-group .form-control{position:relative;z-index:2;float:left;width:100%;margin-bottom:0}.input-group .form-control:focus{z-index:3}.input-group-lg>.form-control,.input-group-lg>.input-group-addon,.input-group-lg>.input-group-btn>.btn{height:46px;padding:10px 16px;font-size:18px;line-height:1.3333333;border-radius:6px}select.input-group-lg>.form-control,select.input-group-lg>.input-group-addon,select.input-group-lg>.input-group-btn>.btn{height:46px;line-height:46px}select[multiple].input-group-lg>.form-control,select[multiple].input-group-lg>.input-group-addon,select[multiple].input-group-lg>.input-group-btn>.btn,textarea.input-group-lg>.form-control,textarea.input-group-lg>.input-group-addon,textarea.input-group-lg>.input-group-btn>.btn{height:auto}.input-group-sm>.form-control,.input-group-sm>.input-group-addon,.input-group-sm>.input-group-btn>.btn{height:30px;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}select.input-group-sm>.form-control,select.input-group-sm>.input-group-addon,select.input-group-sm>.input-group-btn>.btn{height:30px;line-height:30px}select[multiple].input-group-sm>.form-control,select[multiple].input-group-sm>.input-group-addon,select[multiple].input-group-sm>.input-group-btn>.btn,textarea.input-group-sm>.form-control,textarea.input-group-sm>.input-group-addon,textarea.input-group-sm>.input-group-btn>.btn{height:auto}.input-group .form-control,.input-group-addon,.input-group-btn{display:table-cell}.input-group .form-control:not(:first-child):not(:last-child),.input-group-addon:not(:first-child):not(:last-child),.input-group-btn:not(:first-child):not(:last-child){border-radius:0}.input-group-addon,.input-group-btn{width:1%;white-space:nowrap;vertical-align:middle}.input-group-addon{padding:6px 12px;font-size:14px;font-weight:400;line-height:1;color:#555;text-align:center;background-color:#eee;border:1px solid #ccc;border-radius:4px}.input-group-addon.input-sm{padding:5px 10px;font-size:12px;border-radius:3px}.input-group-addon.input-lg{padding:10px 16px;font-size:18px;border-radius:6px}.input-group-addon input[type=checkbox],.input-group-addon input[type=radio]{margin-top:0}.input-group .form-control:first-child,.input-group-addon:first-child,.input-group-btn:first-child>.btn,.input-group-btn:first-child>.btn-group>.btn,.input-group-btn:first-child>.dropdown-toggle,.input-group-btn:last-child>.btn-group:not(:last-child)>.btn,.input-group-btn:last-child>.btn:not(:last-child):not(.dropdown-toggle){border-top-right-radius:0;border-bottom-right-radius:0}.input-group-addon:first-child{border-right:0}.input-group .form-control:last-child,.input-group-addon:last-child,.input-group-btn:first-child>.btn-group:not(:first-child)>.btn,.input-group-btn:first-child>.btn:not(:first-child),.input-group-btn:last-child>.btn,.input-group-btn:last-child>.btn-group>.btn,.input-group-btn:last-child>.dropdown-toggle{border-top-left-radius:0;border-bottom-left-radius:0}.input-group-addon:last-child{border-left:0}.input-group-btn{position:relative;font-size:0;white-space:nowrap}.input-group-btn>.btn{position:relative}.input-group-btn>.btn+.btn{margin-left:-1px}.input-group-btn>.btn:active,.input-group-btn>.btn:focus,.input-group-btn>.btn:hover{z-index:2}.input-group-btn:first-child>.btn,.input-group-btn:first-child>.btn-group{margin-right:-1px}.input-group-btn:last-child>.btn,.input-group-btn:last-child>.btn-group{z-index:2;margin-left:-1px}.nav{padding-left:0;margin-bottom:0;list-style:none}.nav>li{position:relative;display:block}.nav>li>a{position:relative;display:block;padding:10px 15px}.nav>li>a:focus,.nav>li>a:hover{text-decoration:none;background-color:#eee}.nav>li.disabled>a{color:#777}.nav>li.disabled>a:focus,.nav>li.disabled>a:hover{color:#777;text-decoration:none;cursor:not-allowed;background-color:transparent}.nav .open>a,.nav .open>a:focus,.nav .open>a:hover{background-color:#eee;border-color:#337ab7}.nav .nav-divider{height:1px;margin:9px 0;overflow:hidden;background-color:#e5e5e5}.nav>li>a>img{max-width:none}.nav-tabs{border-bottom:1px solid #ddd}.nav-tabs>li{float:left;margin-bottom:-1px}.nav-tabs>li>a{margin-right:2px;line-height:1.42857143;border:1px solid transparent;border-radius:4px 4px 0 0}.nav-tabs>li>a:hover{border-color:#eee #eee #ddd}.nav-tabs>li.active>a,.nav-tabs>li.active>a:focus,.nav-tabs>li.active>a:hover{color:#555;cursor:default;background-color:#fff;border:1px solid #ddd;border-bottom-color:transparent}.nav-tabs.nav-justified{width:100%;border-bottom:0}.nav-tabs.nav-justified>li{float:none}.nav-tabs.nav-justified>li>a{margin-bottom:5px;text-align:center}.nav-tabs.nav-justified>.dropdown .dropdown-menu{top:auto;left:auto}@media (min-width:768px){.nav-tabs.nav-justified>li{display:table-cell;width:1%}.nav-tabs.nav-justified>li>a{margin-bottom:0}}.nav-tabs.nav-justified>li>a{margin-right:0;border-radius:4px}.nav-tabs.nav-justified>.active>a,.nav-tabs.nav-justified>.active>a:focus,.nav-tabs.nav-justified>.active>a:hover{border:1px solid #ddd}@media (min-width:768px){.nav-tabs.nav-justified>li>a{border-bottom:1px solid #ddd;border-radius:4px 4px 0 0}.nav-tabs.nav-justified>.active>a,.nav-tabs.nav-justified>.active>a:focus,.nav-tabs.nav-justified>.active>a:hover{border-bottom-color:#fff}}.nav-pills>li{float:left}.nav-pills>li>a{border-radius:4px}.nav-pills>li+li{margin-left:2px}.nav-pills>li.active>a,.nav-pills>li.active>a:focus,.nav-pills>li.active>a:hover{color:#fff;background-color:#337ab7}.nav-stacked>li{float:none}.nav-stacked>li+li{margin-top:2px;margin-left:0}.nav-justified{width:100%}.nav-justified>li{float:none}.nav-justified>li>a{margin-bottom:5px;text-align:center}.nav-justified>.dropdown .dropdown-menu{top:auto;left:auto}@media (min-width:768px){.nav-justified>li{display:table-cell;width:1%}.nav-justified>li>a{margin-bottom:0}}.nav-tabs-justified{border-bottom:0}.nav-tabs-justified>li>a{margin-right:0;border-radius:4px}.nav-tabs-justified>.active>a,.nav-tabs-justified>.active>a:focus,.nav-tabs-justified>.active>a:hover{border:1px solid #ddd}@media (min-width:768px){.nav-tabs-justified>li>a{border-bottom:1px solid #ddd;border-radius:4px 4px 0 0}.nav-tabs-justified>.active>a,.nav-tabs-justified>.active>a:focus,.nav-tabs-justified>.active>a:hover{border-bottom-color:#fff}}.tab-content>.tab-pane{display:none}.tab-content>.active{display:block}.nav-tabs .dropdown-menu{margin-top:-1px;border-top-left-radius:0;border-top-right-radius:0}.navbar{position:relative;min-height:50px;margin-bottom:20px;border:1px solid transparent}@media (min-width:768px){.navbar{border-radius:4px}}@media (min-width:768px){.navbar-header{float:left}}.navbar-collapse{padding-right:15px;padding-left:15px;overflow-x:visible;border-top:1px solid transparent;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.1);box-shadow:inset 0 1px 0 rgba(255,255,255,.1);-webkit-overflow-scrolling:touch}.navbar-collapse.in{overflow-y:auto}@media (min-width:768px){.navbar-collapse{width:auto;border-top:0;-webkit-box-shadow:none;box-shadow:none}.navbar-collapse.collapse{display:block!important;height:auto!important;padding-bottom:0;overflow:visible!important}.navbar-collapse.in{overflow-y:visible}.navbar-fixed-bottom .navbar-collapse,.navbar-fixed-top .navbar-collapse,.navbar-static-top .navbar-collapse{padding-right:0;padding-left:0}}.navbar-fixed-bottom,.navbar-fixed-top{position:fixed;right:0;left:0;z-index:1030}.navbar-fixed-bottom .navbar-collapse,.navbar-fixed-top .navbar-collapse{max-height:340px}@media (max-device-width:480px) and (orientation:landscape){.navbar-fixed-bottom .navbar-collapse,.navbar-fixed-top .navbar-collapse{max-height:200px}}@media (min-width:768px){.navbar-fixed-bottom,.navbar-fixed-top{border-radius:0}}.navbar-fixed-top{top:0;border-width:0 0 1px}.navbar-fixed-bottom{bottom:0;margin-bottom:0;border-width:1px 0 0}.container-fluid>.navbar-collapse,.container-fluid>.navbar-header,.container>.navbar-collapse,.container>.navbar-header{margin-right:-15px;margin-left:-15px}@media (min-width:768px){.container-fluid>.navbar-collapse,.container-fluid>.navbar-header,.container>.navbar-collapse,.container>.navbar-header{margin-right:0;margin-left:0}}.navbar-static-top{z-index:1000;border-width:0 0 1px}@media (min-width:768px){.navbar-static-top{border-radius:0}}.navbar-brand{float:left;height:50px;padding:15px 15px;font-size:18px;line-height:20px}.navbar-brand:focus,.navbar-brand:hover{text-decoration:none}.navbar-brand>img{display:block}@media (min-width:768px){.navbar>.container .navbar-brand,.navbar>.container-fluid .navbar-brand{margin-left:-15px}}.navbar-toggle{position:relative;float:right;padding:9px 10px;margin-right:15px;margin-top:8px;margin-bottom:8px;background-color:transparent;background-image:none;border:1px solid transparent;border-radius:4px}.navbar-toggle:focus{outline:0}.navbar-toggle .icon-bar{display:block;width:22px;height:2px;border-radius:1px}.navbar-toggle .icon-bar+.icon-bar{margin-top:4px}@media (min-width:768px){.navbar-toggle{display:none}}.navbar-nav{margin:7.5px -15px}.navbar-nav>li>a{padding-top:10px;padding-bottom:10px;line-height:20px}@media (max-width:767px){.navbar-nav .open .dropdown-menu{position:static;float:none;width:auto;margin-top:0;background-color:transparent;border:0;-webkit-box-shadow:none;box-shadow:none}.navbar-nav .open .dropdown-menu .dropdown-header,.navbar-nav .open .dropdown-menu>li>a{padding:5px 15px 5px 25px}.navbar-nav .open .dropdown-menu>li>a{line-height:20px}.navbar-nav .open .dropdown-menu>li>a:focus,.navbar-nav .open .dropdown-menu>li>a:hover{background-image:none}}@media (min-width:768px){.navbar-nav{float:left;margin:0}.navbar-nav>li{float:left}.navbar-nav>li>a{padding-top:15px;padding-bottom:15px}}.navbar-form{padding:10px 15px;margin-right:-15px;margin-left:-15px;border-top:1px solid transparent;border-bottom:1px solid transparent;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.1),0 1px 0 rgba(255,255,255,.1);box-shadow:inset 0 1px 0 rgba(255,255,255,.1),0 1px 0 rgba(255,255,255,.1);margin-top:8px;margin-bottom:8px}@media (min-width:768px){.navbar-form .form-group{display:inline-block;margin-bottom:0;vertical-align:middle}.navbar-form .form-control{display:inline-block;width:auto;vertical-align:middle}.navbar-form .form-control-static{display:inline-block}.navbar-form .input-group{display:inline-table;vertical-align:middle}.navbar-form .input-group .form-control,.navbar-form .input-group .input-group-addon,.navbar-form .input-group .input-group-btn{width:auto}.navbar-form .input-group>.form-control{width:100%}.navbar-form .control-label{margin-bottom:0;vertical-align:middle}.navbar-form .checkbox,.navbar-form .radio{display:inline-block;margin-top:0;margin-bottom:0;vertical-align:middle}.navbar-form .checkbox label,.navbar-form .radio label{padding-left:0}.navbar-form .checkbox input[type=checkbox],.navbar-form .radio input[type=radio]{position:relative;margin-left:0}.navbar-form .has-feedback .form-control-feedback{top:0}}@media (max-width:767px){.navbar-form .form-group{margin-bottom:5px}.navbar-form .form-group:last-child{margin-bottom:0}}@media (min-width:768px){.navbar-form{width:auto;padding-top:0;padding-bottom:0;margin-right:0;margin-left:0;border:0;-webkit-box-shadow:none;box-shadow:none}}.navbar-nav>li>.dropdown-menu{margin-top:0;border-top-left-radius:0;border-top-right-radius:0}.navbar-fixed-bottom .navbar-nav>li>.dropdown-menu{margin-bottom:0;border-top-left-radius:4px;border-top-right-radius:4px;border-bottom-right-radius:0;border-bottom-left-radius:0}.navbar-btn{margin-top:8px;margin-bottom:8px}.navbar-btn.btn-sm{margin-top:10px;margin-bottom:10px}.navbar-btn.btn-xs{margin-top:14px;margin-bottom:14px}.navbar-text{margin-top:15px;margin-bottom:15px}@media (min-width:768px){.navbar-text{float:left;margin-right:15px;margin-left:15px}}@media (min-width:768px){.navbar-left{float:left!important}.navbar-right{float:right!important;margin-right:-15px}.navbar-right~.navbar-right{margin-right:0}}.navbar-default{background-color:#f8f8f8;border-color:#e7e7e7}.navbar-default .navbar-brand{color:#777}.navbar-default .navbar-brand:focus,.navbar-default .navbar-brand:hover{color:#5e5e5e;background-color:transparent}.navbar-default .navbar-text{color:#777}.navbar-default .navbar-nav>li>a{color:#777}.navbar-default .navbar-nav>li>a:focus,.navbar-default .navbar-nav>li>a:hover{color:#333;background-color:transparent}.navbar-default .navbar-nav>.active>a,.navbar-default .navbar-nav>.active>a:focus,.navbar-default .navbar-nav>.active>a:hover{color:#555;background-color:#e7e7e7}.navbar-default .navbar-nav>.disabled>a,.navbar-default .navbar-nav>.disabled>a:focus,.navbar-default .navbar-nav>.disabled>a:hover{color:#ccc;background-color:transparent}.navbar-default .navbar-nav>.open>a,.navbar-default .navbar-nav>.open>a:focus,.navbar-default .navbar-nav>.open>a:hover{color:#555;background-color:#e7e7e7}@media (max-width:767px){.navbar-default .navbar-nav .open .dropdown-menu>li>a{color:#777}.navbar-default .navbar-nav .open .dropdown-menu>li>a:focus,.navbar-default .navbar-nav .open .dropdown-menu>li>a:hover{color:#333;background-color:transparent}.navbar-default .navbar-nav .open .dropdown-menu>.active>a,.navbar-default .navbar-nav .open .dropdown-menu>.active>a:focus,.navbar-default .navbar-nav .open .dropdown-menu>.active>a:hover{color:#555;background-color:#e7e7e7}.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a,.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a:focus,.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a:hover{color:#ccc;background-color:transparent}}.navbar-default .navbar-toggle{border-color:#ddd}.navbar-default .navbar-toggle:focus,.navbar-default .navbar-toggle:hover{background-color:#ddd}.navbar-default .navbar-toggle .icon-bar{background-color:#888}.navbar-default .navbar-collapse,.navbar-default .navbar-form{border-color:#e7e7e7}.navbar-default .navbar-link{color:#777}.navbar-default .navbar-link:hover{color:#333}.navbar-default .btn-link{color:#777}.navbar-default .btn-link:focus,.navbar-default .btn-link:hover{color:#333}.navbar-default .btn-link[disabled]:focus,.navbar-default .btn-link[disabled]:hover,fieldset[disabled] .navbar-default .btn-link:focus,fieldset[disabled] .navbar-default .btn-link:hover{color:#ccc}.navbar-inverse{background-color:#222;border-color:#080808}.navbar-inverse .navbar-brand{color:#9d9d9d}.navbar-inverse .navbar-brand:focus,.navbar-inverse .navbar-brand:hover{color:#fff;background-color:transparent}.navbar-inverse .navbar-text{color:#9d9d9d}.navbar-inverse .navbar-nav>li>a{color:#9d9d9d}.navbar-inverse .navbar-nav>li>a:focus,.navbar-inverse .navbar-nav>li>a:hover{color:#fff;background-color:transparent}.navbar-inverse .navbar-nav>.active>a,.navbar-inverse .navbar-nav>.active>a:focus,.navbar-inverse .navbar-nav>.active>a:hover{color:#fff;background-color:#080808}.navbar-inverse .navbar-nav>.disabled>a,.navbar-inverse .navbar-nav>.disabled>a:focus,.navbar-inverse .navbar-nav>.disabled>a:hover{color:#444;background-color:transparent}.navbar-inverse .navbar-nav>.open>a,.navbar-inverse .navbar-nav>.open>a:focus,.navbar-inverse .navbar-nav>.open>a:hover{color:#fff;background-color:#080808}@media (max-width:767px){.navbar-inverse .navbar-nav .open .dropdown-menu>.dropdown-header{border-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu .divider{background-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu>li>a{color:#9d9d9d}.navbar-inverse .navbar-nav .open .dropdown-menu>li>a:focus,.navbar-inverse .navbar-nav .open .dropdown-menu>li>a:hover{color:#fff;background-color:transparent}.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a,.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a:focus,.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a:hover{color:#fff;background-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a,.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a:focus,.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a:hover{color:#444;background-color:transparent}}.navbar-inverse .navbar-toggle{border-color:#333}.navbar-inverse .navbar-toggle:focus,.navbar-inverse .navbar-toggle:hover{background-color:#333}.navbar-inverse .navbar-toggle .icon-bar{background-color:#fff}.navbar-inverse .navbar-collapse,.navbar-inverse .navbar-form{border-color:#101010}.navbar-inverse .navbar-link{color:#9d9d9d}.navbar-inverse .navbar-link:hover{color:#fff}.navbar-inverse .btn-link{color:#9d9d9d}.navbar-inverse .btn-link:focus,.navbar-inverse .btn-link:hover{color:#fff}.navbar-inverse .btn-link[disabled]:focus,.navbar-inverse .btn-link[disabled]:hover,fieldset[disabled] .navbar-inverse .btn-link:focus,fieldset[disabled] .navbar-inverse .btn-link:hover{color:#444}.breadcrumb{padding:8px 15px;margin-bottom:20px;list-style:none;background-color:#f5f5f5;border-radius:4px}.breadcrumb>li{display:inline-block}.breadcrumb>li+li:before{padding:0 5px;color:#ccc;content:\"/\\00a0\"}.breadcrumb>.active{color:#777}.pagination{display:inline-block;padding-left:0;margin:20px 0;border-radius:4px}.pagination>li{display:inline}.pagination>li>a,.pagination>li>span{position:relative;float:left;padding:6px 12px;margin-left:-1px;line-height:1.42857143;color:#337ab7;text-decoration:none;background-color:#fff;border:1px solid #ddd}.pagination>li>a:focus,.pagination>li>a:hover,.pagination>li>span:focus,.pagination>li>span:hover{z-index:2;color:#23527c;background-color:#eee;border-color:#ddd}.pagination>li:first-child>a,.pagination>li:first-child>span{margin-left:0;border-top-left-radius:4px;border-bottom-left-radius:4px}.pagination>li:last-child>a,.pagination>li:last-child>span{border-top-right-radius:4px;border-bottom-right-radius:4px}.pagination>.active>a,.pagination>.active>a:focus,.pagination>.active>a:hover,.pagination>.active>span,.pagination>.active>span:focus,.pagination>.active>span:hover{z-index:3;color:#fff;cursor:default;background-color:#337ab7;border-color:#337ab7}.pagination>.disabled>a,.pagination>.disabled>a:focus,.pagination>.disabled>a:hover,.pagination>.disabled>span,.pagination>.disabled>span:focus,.pagination>.disabled>span:hover{color:#777;cursor:not-allowed;background-color:#fff;border-color:#ddd}.pagination-lg>li>a,.pagination-lg>li>span{padding:10px 16px;font-size:18px;line-height:1.3333333}.pagination-lg>li:first-child>a,.pagination-lg>li:first-child>span{border-top-left-radius:6px;border-bottom-left-radius:6px}.pagination-lg>li:last-child>a,.pagination-lg>li:last-child>span{border-top-right-radius:6px;border-bottom-right-radius:6px}.pagination-sm>li>a,.pagination-sm>li>span{padding:5px 10px;font-size:12px;line-height:1.5}.pagination-sm>li:first-child>a,.pagination-sm>li:first-child>span{border-top-left-radius:3px;border-bottom-left-radius:3px}.pagination-sm>li:last-child>a,.pagination-sm>li:last-child>span{border-top-right-radius:3px;border-bottom-right-radius:3px}.pager{padding-left:0;margin:20px 0;text-align:center;list-style:none}.pager li{display:inline}.pager li>a,.pager li>span{display:inline-block;padding:5px 14px;background-color:#fff;border:1px solid #ddd;border-radius:15px}.pager li>a:focus,.pager li>a:hover{text-decoration:none;background-color:#eee}.pager .next>a,.pager .next>span{float:right}.pager .previous>a,.pager .previous>span{float:left}.pager .disabled>a,.pager .disabled>a:focus,.pager .disabled>a:hover,.pager .disabled>span{color:#777;cursor:not-allowed;background-color:#fff}.label{display:inline;padding:.2em .6em .3em;font-size:75%;font-weight:700;line-height:1;color:#fff;text-align:center;white-space:nowrap;vertical-align:baseline;border-radius:.25em}a.label:focus,a.label:hover{color:#fff;text-decoration:none;cursor:pointer}.label:empty{display:none}.btn .label{position:relative;top:-1px}.label-default{background-color:#777}.label-default[href]:focus,.label-default[href]:hover{background-color:#5e5e5e}.label-primary{background-color:#337ab7}.label-primary[href]:focus,.label-primary[href]:hover{background-color:#286090}.label-success{background-color:#5cb85c}.label-success[href]:focus,.label-success[href]:hover{background-color:#449d44}.label-info{background-color:#5bc0de}.label-info[href]:focus,.label-info[href]:hover{background-color:#31b0d5}.label-warning{background-color:#f0ad4e}.label-warning[href]:focus,.label-warning[href]:hover{background-color:#ec971f}.label-danger{background-color:#d9534f}.label-danger[href]:focus,.label-danger[href]:hover{background-color:#c9302c}.badge{display:inline-block;min-width:10px;padding:3px 7px;font-size:12px;font-weight:700;line-height:1;color:#fff;text-align:center;white-space:nowrap;vertical-align:middle;background-color:#777;border-radius:10px}.badge:empty{display:none}.btn .badge{position:relative;top:-1px}.btn-group-xs>.btn .badge,.btn-xs .badge{top:0;padding:1px 5px}a.badge:focus,a.badge:hover{color:#fff;text-decoration:none;cursor:pointer}.list-group-item.active>.badge,.nav-pills>.active>a>.badge{color:#337ab7;background-color:#fff}.list-group-item>.badge{float:right}.list-group-item>.badge+.badge{margin-right:5px}.nav-pills>li>a>.badge{margin-left:3px}.jumbotron{padding-top:30px;padding-bottom:30px;margin-bottom:30px;color:inherit;background-color:#eee}.jumbotron .h1,.jumbotron h1{color:inherit}.jumbotron p{margin-bottom:15px;font-size:21px;font-weight:200}.jumbotron>hr{border-top-color:#d5d5d5}.container .jumbotron,.container-fluid .jumbotron{padding-right:15px;padding-left:15px;border-radius:6px}.jumbotron .container{max-width:100%}@media screen and (min-width:768px){.jumbotron{padding-top:48px;padding-bottom:48px}.container .jumbotron,.container-fluid .jumbotron{padding-right:60px;padding-left:60px}.jumbotron .h1,.jumbotron h1{font-size:63px}}.thumbnail{display:block;padding:4px;margin-bottom:20px;line-height:1.42857143;background-color:#fff;border:1px solid #ddd;border-radius:4px;-webkit-transition:border .2s ease-in-out;-o-transition:border .2s ease-in-out;transition:border .2s ease-in-out}.thumbnail a>img,.thumbnail>img{margin-right:auto;margin-left:auto}a.thumbnail.active,a.thumbnail:focus,a.thumbnail:hover{border-color:#337ab7}.thumbnail .caption{padding:9px;color:#333}.alert{padding:15px;margin-bottom:20px;border:1px solid transparent;border-radius:4px}.alert h4{margin-top:0;color:inherit}.alert .alert-link{font-weight:700}.alert>p,.alert>ul{margin-bottom:0}.alert>p+p{margin-top:5px}.alert-dismissable,.alert-dismissible{padding-right:35px}.alert-dismissable .close,.alert-dismissible .close{position:relative;top:-2px;right:-21px;color:inherit}.alert-success{color:#3c763d;background-color:#dff0d8;border-color:#d6e9c6}.alert-success hr{border-top-color:#c9e2b3}.alert-success .alert-link{color:#2b542c}.alert-info{color:#31708f;background-color:#d9edf7;border-color:#bce8f1}.alert-info hr{border-top-color:#a6e1ec}.alert-info .alert-link{color:#245269}.alert-warning{color:#8a6d3b;background-color:#fcf8e3;border-color:#faebcc}.alert-warning hr{border-top-color:#f7e1b5}.alert-warning .alert-link{color:#66512c}.alert-danger{color:#a94442;background-color:#f2dede;border-color:#ebccd1}.alert-danger hr{border-top-color:#e4b9c0}.alert-danger .alert-link{color:#843534}@-webkit-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@-o-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}.progress{height:20px;margin-bottom:20px;overflow:hidden;background-color:#f5f5f5;border-radius:4px;-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,.1);box-shadow:inset 0 1px 2px rgba(0,0,0,.1)}.progress-bar{float:left;width:0%;height:100%;font-size:12px;line-height:20px;color:#fff;text-align:center;background-color:#337ab7;-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,.15);box-shadow:inset 0 -1px 0 rgba(0,0,0,.15);-webkit-transition:width .6s ease;-o-transition:width .6s ease;transition:width .6s ease}.progress-bar-striped,.progress-striped .progress-bar{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);-webkit-background-size:40px 40px;background-size:40px 40px}.progress-bar.active,.progress.active .progress-bar{-webkit-animation:progress-bar-stripes 2s linear infinite;-o-animation:progress-bar-stripes 2s linear infinite;animation:progress-bar-stripes 2s linear infinite}.progress-bar-success{background-color:#5cb85c}.progress-striped .progress-bar-success{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.progress-bar-info{background-color:#5bc0de}.progress-striped .progress-bar-info{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.progress-bar-warning{background-color:#f0ad4e}.progress-striped .progress-bar-warning{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.progress-bar-danger{background-color:#d9534f}.progress-striped .progress-bar-danger{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.media{margin-top:15px}.media:first-child{margin-top:0}.media,.media-body{overflow:hidden;zoom:1}.media-body{width:10000px}.media-object{display:block}.media-object.img-thumbnail{max-width:none}.media-right,.media>.pull-right{padding-left:10px}.media-left,.media>.pull-left{padding-right:10px}.media-body,.media-left,.media-right{display:table-cell;vertical-align:top}.media-middle{vertical-align:middle}.media-bottom{vertical-align:bottom}.media-heading{margin-top:0;margin-bottom:5px}.media-list{padding-left:0;list-style:none}.list-group{padding-left:0;margin-bottom:20px}.list-group-item{position:relative;display:block;padding:10px 15px;margin-bottom:-1px;background-color:#fff;border:1px solid #ddd}.list-group-item:first-child{border-top-left-radius:4px;border-top-right-radius:4px}.list-group-item:last-child{margin-bottom:0;border-bottom-right-radius:4px;border-bottom-left-radius:4px}.list-group-item.disabled,.list-group-item.disabled:focus,.list-group-item.disabled:hover{color:#777;cursor:not-allowed;background-color:#eee}.list-group-item.disabled .list-group-item-heading,.list-group-item.disabled:focus .list-group-item-heading,.list-group-item.disabled:hover .list-group-item-heading{color:inherit}.list-group-item.disabled .list-group-item-text,.list-group-item.disabled:focus .list-group-item-text,.list-group-item.disabled:hover .list-group-item-text{color:#777}.list-group-item.active,.list-group-item.active:focus,.list-group-item.active:hover{z-index:2;color:#fff;background-color:#337ab7;border-color:#337ab7}.list-group-item.active .list-group-item-heading,.list-group-item.active .list-group-item-heading>.small,.list-group-item.active .list-group-item-heading>small,.list-group-item.active:focus .list-group-item-heading,.list-group-item.active:focus .list-group-item-heading>.small,.list-group-item.active:focus .list-group-item-heading>small,.list-group-item.active:hover .list-group-item-heading,.list-group-item.active:hover .list-group-item-heading>.small,.list-group-item.active:hover .list-group-item-heading>small{color:inherit}.list-group-item.active .list-group-item-text,.list-group-item.active:focus .list-group-item-text,.list-group-item.active:hover .list-group-item-text{color:#c7ddef}a.list-group-item,button.list-group-item{color:#555}a.list-group-item .list-group-item-heading,button.list-group-item .list-group-item-heading{color:#333}a.list-group-item:focus,a.list-group-item:hover,button.list-group-item:focus,button.list-group-item:hover{color:#555;text-decoration:none;background-color:#f5f5f5}button.list-group-item{width:100%;text-align:left}.list-group-item-success{color:#3c763d;background-color:#dff0d8}a.list-group-item-success,button.list-group-item-success{color:#3c763d}a.list-group-item-success .list-group-item-heading,button.list-group-item-success .list-group-item-heading{color:inherit}a.list-group-item-success:focus,a.list-group-item-success:hover,button.list-group-item-success:focus,button.list-group-item-success:hover{color:#3c763d;background-color:#d0e9c6}a.list-group-item-success.active,a.list-group-item-success.active:focus,a.list-group-item-success.active:hover,button.list-group-item-success.active,button.list-group-item-success.active:focus,button.list-group-item-success.active:hover{color:#fff;background-color:#3c763d;border-color:#3c763d}.list-group-item-info{color:#31708f;background-color:#d9edf7}a.list-group-item-info,button.list-group-item-info{color:#31708f}a.list-group-item-info .list-group-item-heading,button.list-group-item-info .list-group-item-heading{color:inherit}a.list-group-item-info:focus,a.list-group-item-info:hover,button.list-group-item-info:focus,button.list-group-item-info:hover{color:#31708f;background-color:#c4e3f3}a.list-group-item-info.active,a.list-group-item-info.active:focus,a.list-group-item-info.active:hover,button.list-group-item-info.active,button.list-group-item-info.active:focus,button.list-group-item-info.active:hover{color:#fff;background-color:#31708f;border-color:#31708f}.list-group-item-warning{color:#8a6d3b;background-color:#fcf8e3}a.list-group-item-warning,button.list-group-item-warning{color:#8a6d3b}a.list-group-item-warning .list-group-item-heading,button.list-group-item-warning .list-group-item-heading{color:inherit}a.list-group-item-warning:focus,a.list-group-item-warning:hover,button.list-group-item-warning:focus,button.list-group-item-warning:hover{color:#8a6d3b;background-color:#faf2cc}a.list-group-item-warning.active,a.list-group-item-warning.active:focus,a.list-group-item-warning.active:hover,button.list-group-item-warning.active,button.list-group-item-warning.active:focus,button.list-group-item-warning.active:hover{color:#fff;background-color:#8a6d3b;border-color:#8a6d3b}.list-group-item-danger{color:#a94442;background-color:#f2dede}a.list-group-item-danger,button.list-group-item-danger{color:#a94442}a.list-group-item-danger .list-group-item-heading,button.list-group-item-danger .list-group-item-heading{color:inherit}a.list-group-item-danger:focus,a.list-group-item-danger:hover,button.list-group-item-danger:focus,button.list-group-item-danger:hover{color:#a94442;background-color:#ebcccc}a.list-group-item-danger.active,a.list-group-item-danger.active:focus,a.list-group-item-danger.active:hover,button.list-group-item-danger.active,button.list-group-item-danger.active:focus,button.list-group-item-danger.active:hover{color:#fff;background-color:#a94442;border-color:#a94442}.list-group-item-heading{margin-top:0;margin-bottom:5px}.list-group-item-text{margin-bottom:0;line-height:1.3}.panel{margin-bottom:20px;background-color:#fff;border:1px solid transparent;border-radius:4px;-webkit-box-shadow:0 1px 1px rgba(0,0,0,.05);box-shadow:0 1px 1px rgba(0,0,0,.05)}.panel-body{padding:15px}.panel-heading{padding:10px 15px;border-bottom:1px solid transparent;border-top-left-radius:3px;border-top-right-radius:3px}.panel-heading>.dropdown .dropdown-toggle{color:inherit}.panel-title{margin-top:0;margin-bottom:0;font-size:16px;color:inherit}.panel-title>.small,.panel-title>.small>a,.panel-title>a,.panel-title>small,.panel-title>small>a{color:inherit}.panel-footer{padding:10px 15px;background-color:#f5f5f5;border-top:1px solid #ddd;border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.list-group,.panel>.panel-collapse>.list-group{margin-bottom:0}.panel>.list-group .list-group-item,.panel>.panel-collapse>.list-group .list-group-item{border-width:1px 0;border-radius:0}.panel>.list-group:first-child .list-group-item:first-child,.panel>.panel-collapse>.list-group:first-child .list-group-item:first-child{border-top:0;border-top-left-radius:3px;border-top-right-radius:3px}.panel>.list-group:last-child .list-group-item:last-child,.panel>.panel-collapse>.list-group:last-child .list-group-item:last-child{border-bottom:0;border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.panel-heading+.panel-collapse>.list-group .list-group-item:first-child{border-top-left-radius:0;border-top-right-radius:0}.panel-heading+.list-group .list-group-item:first-child{border-top-width:0}.list-group+.panel-footer{border-top-width:0}.panel>.panel-collapse>.table,.panel>.table,.panel>.table-responsive>.table{margin-bottom:0}.panel>.panel-collapse>.table caption,.panel>.table caption,.panel>.table-responsive>.table caption{padding-right:15px;padding-left:15px}.panel>.table-responsive:first-child>.table:first-child,.panel>.table:first-child{border-top-left-radius:3px;border-top-right-radius:3px}.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child,.panel>.table:first-child>thead:first-child>tr:first-child{border-top-left-radius:3px;border-top-right-radius:3px}.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child td:first-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child th:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child td:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child th:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child td:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child th:first-child,.panel>.table:first-child>thead:first-child>tr:first-child td:first-child,.panel>.table:first-child>thead:first-child>tr:first-child th:first-child{border-top-left-radius:3px}.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child td:last-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child th:last-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child td:last-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child th:last-child,.panel>.table:first-child>tbody:first-child>tr:first-child td:last-child,.panel>.table:first-child>tbody:first-child>tr:first-child th:last-child,.panel>.table:first-child>thead:first-child>tr:first-child td:last-child,.panel>.table:first-child>thead:first-child>tr:first-child th:last-child{border-top-right-radius:3px}.panel>.table-responsive:last-child>.table:last-child,.panel>.table:last-child{border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child,.panel>.table:last-child>tbody:last-child>tr:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child{border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child td:first-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child th:first-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child td:first-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child th:first-child,.panel>.table:last-child>tbody:last-child>tr:last-child td:first-child,.panel>.table:last-child>tbody:last-child>tr:last-child th:first-child,.panel>.table:last-child>tfoot:last-child>tr:last-child td:first-child,.panel>.table:last-child>tfoot:last-child>tr:last-child th:first-child{border-bottom-left-radius:3px}.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child td:last-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child th:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child td:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child th:last-child,.panel>.table:last-child>tbody:last-child>tr:last-child td:last-child,.panel>.table:last-child>tbody:last-child>tr:last-child th:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child td:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child th:last-child{border-bottom-right-radius:3px}.panel>.panel-body+.table,.panel>.panel-body+.table-responsive,.panel>.table+.panel-body,.panel>.table-responsive+.panel-body{border-top:1px solid #ddd}.panel>.table>tbody:first-child>tr:first-child td,.panel>.table>tbody:first-child>tr:first-child th{border-top:0}.panel>.table-bordered,.panel>.table-responsive>.table-bordered{border:0}.panel>.table-bordered>tbody>tr>td:first-child,.panel>.table-bordered>tbody>tr>th:first-child,.panel>.table-bordered>tfoot>tr>td:first-child,.panel>.table-bordered>tfoot>tr>th:first-child,.panel>.table-bordered>thead>tr>td:first-child,.panel>.table-bordered>thead>tr>th:first-child,.panel>.table-responsive>.table-bordered>tbody>tr>td:first-child,.panel>.table-responsive>.table-bordered>tbody>tr>th:first-child,.panel>.table-responsive>.table-bordered>tfoot>tr>td:first-child,.panel>.table-responsive>.table-bordered>tfoot>tr>th:first-child,.panel>.table-responsive>.table-bordered>thead>tr>td:first-child,.panel>.table-responsive>.table-bordered>thead>tr>th:first-child{border-left:0}.panel>.table-bordered>tbody>tr>td:last-child,.panel>.table-bordered>tbody>tr>th:last-child,.panel>.table-bordered>tfoot>tr>td:last-child,.panel>.table-bordered>tfoot>tr>th:last-child,.panel>.table-bordered>thead>tr>td:last-child,.panel>.table-bordered>thead>tr>th:last-child,.panel>.table-responsive>.table-bordered>tbody>tr>td:last-child,.panel>.table-responsive>.table-bordered>tbody>tr>th:last-child,.panel>.table-responsive>.table-bordered>tfoot>tr>td:last-child,.panel>.table-responsive>.table-bordered>tfoot>tr>th:last-child,.panel>.table-responsive>.table-bordered>thead>tr>td:last-child,.panel>.table-responsive>.table-bordered>thead>tr>th:last-child{border-right:0}.panel>.table-bordered>tbody>tr:first-child>td,.panel>.table-bordered>tbody>tr:first-child>th,.panel>.table-bordered>thead>tr:first-child>td,.panel>.table-bordered>thead>tr:first-child>th,.panel>.table-responsive>.table-bordered>tbody>tr:first-child>td,.panel>.table-responsive>.table-bordered>tbody>tr:first-child>th,.panel>.table-responsive>.table-bordered>thead>tr:first-child>td,.panel>.table-responsive>.table-bordered>thead>tr:first-child>th{border-bottom:0}.panel>.table-bordered>tbody>tr:last-child>td,.panel>.table-bordered>tbody>tr:last-child>th,.panel>.table-bordered>tfoot>tr:last-child>td,.panel>.table-bordered>tfoot>tr:last-child>th,.panel>.table-responsive>.table-bordered>tbody>tr:last-child>td,.panel>.table-responsive>.table-bordered>tbody>tr:last-child>th,.panel>.table-responsive>.table-bordered>tfoot>tr:last-child>td,.panel>.table-responsive>.table-bordered>tfoot>tr:last-child>th{border-bottom:0}.panel>.table-responsive{margin-bottom:0;border:0}.panel-group{margin-bottom:20px}.panel-group .panel{margin-bottom:0;border-radius:4px}.panel-group .panel+.panel{margin-top:5px}.panel-group .panel-heading{border-bottom:0}.panel-group .panel-heading+.panel-collapse>.list-group,.panel-group .panel-heading+.panel-collapse>.panel-body{border-top:1px solid #ddd}.panel-group .panel-footer{border-top:0}.panel-group .panel-footer+.panel-collapse .panel-body{border-bottom:1px solid #ddd}.panel-default{border-color:#ddd}.panel-default>.panel-heading{color:#333;background-color:#f5f5f5;border-color:#ddd}.panel-default>.panel-heading+.panel-collapse>.panel-body{border-top-color:#ddd}.panel-default>.panel-heading .badge{color:#f5f5f5;background-color:#333}.panel-default>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#ddd}.panel-primary{border-color:#337ab7}.panel-primary>.panel-heading{color:#fff;background-color:#337ab7;border-color:#337ab7}.panel-primary>.panel-heading+.panel-collapse>.panel-body{border-top-color:#337ab7}.panel-primary>.panel-heading .badge{color:#337ab7;background-color:#fff}.panel-primary>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#337ab7}.panel-success{border-color:#d6e9c6}.panel-success>.panel-heading{color:#3c763d;background-color:#dff0d8;border-color:#d6e9c6}.panel-success>.panel-heading+.panel-collapse>.panel-body{border-top-color:#d6e9c6}.panel-success>.panel-heading .badge{color:#dff0d8;background-color:#3c763d}.panel-success>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#d6e9c6}.panel-info{border-color:#bce8f1}.panel-info>.panel-heading{color:#31708f;background-color:#d9edf7;border-color:#bce8f1}.panel-info>.panel-heading+.panel-collapse>.panel-body{border-top-color:#bce8f1}.panel-info>.panel-heading .badge{color:#d9edf7;background-color:#31708f}.panel-info>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#bce8f1}.panel-warning{border-color:#faebcc}.panel-warning>.panel-heading{color:#8a6d3b;background-color:#fcf8e3;border-color:#faebcc}.panel-warning>.panel-heading+.panel-collapse>.panel-body{border-top-color:#faebcc}.panel-warning>.panel-heading .badge{color:#fcf8e3;background-color:#8a6d3b}.panel-warning>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#faebcc}.panel-danger{border-color:#ebccd1}.panel-danger>.panel-heading{color:#a94442;background-color:#f2dede;border-color:#ebccd1}.panel-danger>.panel-heading+.panel-collapse>.panel-body{border-top-color:#ebccd1}.panel-danger>.panel-heading .badge{color:#f2dede;background-color:#a94442}.panel-danger>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#ebccd1}.embed-responsive{position:relative;display:block;height:0;padding:0;overflow:hidden}.embed-responsive .embed-responsive-item,.embed-responsive embed,.embed-responsive iframe,.embed-responsive object,.embed-responsive video{position:absolute;top:0;bottom:0;left:0;width:100%;height:100%;border:0}.embed-responsive-16by9{padding-bottom:56.25%}.embed-responsive-4by3{padding-bottom:75%}.well{min-height:20px;padding:19px;margin-bottom:20px;background-color:#f5f5f5;border:1px solid #e3e3e3;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.05);box-shadow:inset 0 1px 1px rgba(0,0,0,.05)}.well blockquote{border-color:#ddd;border-color:rgba(0,0,0,.15)}.well-lg{padding:24px;border-radius:6px}.well-sm{padding:9px;border-radius:3px}.close{float:right;font-size:21px;font-weight:700;line-height:1;color:#000;text-shadow:0 1px 0 #fff;filter:alpha(opacity=20);opacity:.2}.close:focus,.close:hover{color:#000;text-decoration:none;cursor:pointer;filter:alpha(opacity=50);opacity:.5}button.close{padding:0;cursor:pointer;background:0 0;border:0;-webkit-appearance:none;-moz-appearance:none;appearance:none}.modal-open{overflow:hidden}.modal{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1050;display:none;overflow:hidden;-webkit-overflow-scrolling:touch;outline:0}.modal.fade .modal-dialog{-webkit-transform:translate(0,-25%);-ms-transform:translate(0,-25%);-o-transform:translate(0,-25%);transform:translate(0,-25%);-webkit-transition:-webkit-transform .3s ease-out;-o-transition:-o-transform .3s ease-out;transition:-webkit-transform .3s ease-out;transition:transform .3s ease-out;transition:transform .3s ease-out,-webkit-transform .3s ease-out,-o-transform .3s ease-out}.modal.in .modal-dialog{-webkit-transform:translate(0,0);-ms-transform:translate(0,0);-o-transform:translate(0,0);transform:translate(0,0)}.modal-open .modal{overflow-x:hidden;overflow-y:auto}.modal-dialog{position:relative;width:auto;margin:10px}.modal-content{position:relative;background-color:#fff;background-clip:padding-box;border:1px solid #999;border:1px solid rgba(0,0,0,.2);border-radius:6px;-webkit-box-shadow:0 3px 9px rgba(0,0,0,.5);box-shadow:0 3px 9px rgba(0,0,0,.5);outline:0}.modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1040;background-color:#000}.modal-backdrop.fade{filter:alpha(opacity=0);opacity:0}.modal-backdrop.in{filter:alpha(opacity=50);opacity:.5}.modal-header{padding:15px;border-bottom:1px solid #e5e5e5}.modal-header .close{margin-top:-2px}.modal-title{margin:0;line-height:1.42857143}.modal-body{position:relative;padding:15px}.modal-footer{padding:15px;text-align:right;border-top:1px solid #e5e5e5}.modal-footer .btn+.btn{margin-bottom:0;margin-left:5px}.modal-footer .btn-group .btn+.btn{margin-left:-1px}.modal-footer .btn-block+.btn-block{margin-left:0}.modal-scrollbar-measure{position:absolute;top:-9999px;width:50px;height:50px;overflow:scroll}@media (min-width:768px){.modal-dialog{width:600px;margin:30px auto}.modal-content{-webkit-box-shadow:0 5px 15px rgba(0,0,0,.5);box-shadow:0 5px 15px rgba(0,0,0,.5)}.modal-sm{width:300px}}@media (min-width:992px){.modal-lg{width:900px}}.tooltip{position:absolute;z-index:1070;display:block;font-family:\"Helvetica Neue\",Helvetica,Arial,sans-serif;font-style:normal;font-weight:400;line-height:1.42857143;line-break:auto;text-align:left;text-align:start;text-decoration:none;text-shadow:none;text-transform:none;letter-spacing:normal;word-break:normal;word-spacing:normal;word-wrap:normal;white-space:normal;font-size:12px;filter:alpha(opacity=0);opacity:0}.tooltip.in{filter:alpha(opacity=90);opacity:.9}.tooltip.top{padding:5px 0;margin-top:-3px}.tooltip.right{padding:0 5px;margin-left:3px}.tooltip.bottom{padding:5px 0;margin-top:3px}.tooltip.left{padding:0 5px;margin-left:-3px}.tooltip.top .tooltip-arrow{bottom:0;left:50%;margin-left:-5px;border-width:5px 5px 0;border-top-color:#000}.tooltip.top-left .tooltip-arrow{right:5px;bottom:0;margin-bottom:-5px;border-width:5px 5px 0;border-top-color:#000}.tooltip.top-right .tooltip-arrow{bottom:0;left:5px;margin-bottom:-5px;border-width:5px 5px 0;border-top-color:#000}.tooltip.right .tooltip-arrow{top:50%;left:0;margin-top:-5px;border-width:5px 5px 5px 0;border-right-color:#000}.tooltip.left .tooltip-arrow{top:50%;right:0;margin-top:-5px;border-width:5px 0 5px 5px;border-left-color:#000}.tooltip.bottom .tooltip-arrow{top:0;left:50%;margin-left:-5px;border-width:0 5px 5px;border-bottom-color:#000}.tooltip.bottom-left .tooltip-arrow{top:0;right:5px;margin-top:-5px;border-width:0 5px 5px;border-bottom-color:#000}.tooltip.bottom-right .tooltip-arrow{top:0;left:5px;margin-top:-5px;border-width:0 5px 5px;border-bottom-color:#000}.tooltip-inner{max-width:200px;padding:3px 8px;color:#fff;text-align:center;background-color:#000;border-radius:4px}.tooltip-arrow{position:absolute;width:0;height:0;border-color:transparent;border-style:solid}.popover{position:absolute;top:0;left:0;z-index:1060;display:none;max-width:276px;padding:1px;font-family:\"Helvetica Neue\",Helvetica,Arial,sans-serif;font-style:normal;font-weight:400;line-height:1.42857143;line-break:auto;text-align:left;text-align:start;text-decoration:none;text-shadow:none;text-transform:none;letter-spacing:normal;word-break:normal;word-spacing:normal;word-wrap:normal;white-space:normal;font-size:14px;background-color:#fff;background-clip:padding-box;border:1px solid #ccc;border:1px solid rgba(0,0,0,.2);border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0,0,0,.2);box-shadow:0 5px 10px rgba(0,0,0,.2)}.popover.top{margin-top:-10px}.popover.right{margin-left:10px}.popover.bottom{margin-top:10px}.popover.left{margin-left:-10px}.popover>.arrow{border-width:11px}.popover>.arrow,.popover>.arrow:after{position:absolute;display:block;width:0;height:0;border-color:transparent;border-style:solid}.popover>.arrow:after{content:\"\";border-width:10px}.popover.top>.arrow{bottom:-11px;left:50%;margin-left:-11px;border-top-color:#999;border-top-color:rgba(0,0,0,.25);border-bottom-width:0}.popover.top>.arrow:after{bottom:1px;margin-left:-10px;content:\" \";border-top-color:#fff;border-bottom-width:0}.popover.right>.arrow{top:50%;left:-11px;margin-top:-11px;border-right-color:#999;border-right-color:rgba(0,0,0,.25);border-left-width:0}.popover.right>.arrow:after{bottom:-10px;left:1px;content:\" \";border-right-color:#fff;border-left-width:0}.popover.bottom>.arrow{top:-11px;left:50%;margin-left:-11px;border-top-width:0;border-bottom-color:#999;border-bottom-color:rgba(0,0,0,.25)}.popover.bottom>.arrow:after{top:1px;margin-left:-10px;content:\" \";border-top-width:0;border-bottom-color:#fff}.popover.left>.arrow{top:50%;right:-11px;margin-top:-11px;border-right-width:0;border-left-color:#999;border-left-color:rgba(0,0,0,.25)}.popover.left>.arrow:after{right:1px;bottom:-10px;content:\" \";border-right-width:0;border-left-color:#fff}.popover-title{padding:8px 14px;margin:0;font-size:14px;background-color:#f7f7f7;border-bottom:1px solid #ebebeb;border-radius:5px 5px 0 0}.popover-content{padding:9px 14px}.carousel{position:relative}.carousel-inner{position:relative;width:100%;overflow:hidden}.carousel-inner>.item{position:relative;display:none;-webkit-transition:.6s ease-in-out left;-o-transition:.6s ease-in-out left;transition:.6s ease-in-out left}.carousel-inner>.item>a>img,.carousel-inner>.item>img{line-height:1}@media all and (transform-3d),(-webkit-transform-3d){.carousel-inner>.item{-webkit-transition:-webkit-transform .6s ease-in-out;-o-transition:-o-transform .6s ease-in-out;transition:-webkit-transform .6s ease-in-out;transition:transform .6s ease-in-out;transition:transform .6s ease-in-out,-webkit-transform .6s ease-in-out,-o-transform .6s ease-in-out;-webkit-backface-visibility:hidden;backface-visibility:hidden;-webkit-perspective:1000px;perspective:1000px}.carousel-inner>.item.active.right,.carousel-inner>.item.next{-webkit-transform:translate3d(100%,0,0);transform:translate3d(100%,0,0);left:0}.carousel-inner>.item.active.left,.carousel-inner>.item.prev{-webkit-transform:translate3d(-100%,0,0);transform:translate3d(-100%,0,0);left:0}.carousel-inner>.item.active,.carousel-inner>.item.next.left,.carousel-inner>.item.prev.right{-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0);left:0}}.carousel-inner>.active,.carousel-inner>.next,.carousel-inner>.prev{display:block}.carousel-inner>.active{left:0}.carousel-inner>.next,.carousel-inner>.prev{position:absolute;top:0;width:100%}.carousel-inner>.next{left:100%}.carousel-inner>.prev{left:-100%}.carousel-inner>.next.left,.carousel-inner>.prev.right{left:0}.carousel-inner>.active.left{left:-100%}.carousel-inner>.active.right{left:100%}.carousel-control{position:absolute;top:0;bottom:0;left:0;width:15%;font-size:20px;color:#fff;text-align:center;text-shadow:0 1px 2px rgba(0,0,0,.6);background-color:rgba(0,0,0,0);filter:alpha(opacity=50);opacity:.5}.carousel-control.left{background-image:-webkit-linear-gradient(left,rgba(0,0,0,.5) 0,rgba(0,0,0,.0001) 100%);background-image:-o-linear-gradient(left,rgba(0,0,0,.5) 0,rgba(0,0,0,.0001) 100%);background-image:-webkit-gradient(linear,left top,right top,from(rgba(0,0,0,.5)),to(rgba(0,0,0,.0001)));background-image:linear-gradient(to right,rgba(0,0,0,.5) 0,rgba(0,0,0,.0001) 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#80000000', endColorstr='#00000000', GradientType=1);background-repeat:repeat-x}.carousel-control.right{right:0;left:auto;background-image:-webkit-linear-gradient(left,rgba(0,0,0,.0001) 0,rgba(0,0,0,.5) 100%);background-image:-o-linear-gradient(left,rgba(0,0,0,.0001) 0,rgba(0,0,0,.5) 100%);background-image:-webkit-gradient(linear,left top,right top,from(rgba(0,0,0,.0001)),to(rgba(0,0,0,.5)));background-image:linear-gradient(to right,rgba(0,0,0,.0001) 0,rgba(0,0,0,.5) 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#00000000', endColorstr='#80000000', GradientType=1);background-repeat:repeat-x}.carousel-control:focus,.carousel-control:hover{color:#fff;text-decoration:none;outline:0;filter:alpha(opacity=90);opacity:.9}.carousel-control .glyphicon-chevron-left,.carousel-control .glyphicon-chevron-right,.carousel-control .icon-next,.carousel-control .icon-prev{position:absolute;top:50%;z-index:5;display:inline-block;margin-top:-10px}.carousel-control .glyphicon-chevron-left,.carousel-control .icon-prev{left:50%;margin-left:-10px}.carousel-control .glyphicon-chevron-right,.carousel-control .icon-next{right:50%;margin-right:-10px}.carousel-control .icon-next,.carousel-control .icon-prev{width:20px;height:20px;font-family:serif;line-height:1}.carousel-control .icon-prev:before{content:\"\\2039\"}.carousel-control .icon-next:before{content:\"\\203a\"}.carousel-indicators{position:absolute;bottom:10px;left:50%;z-index:15;width:60%;padding-left:0;margin-left:-30%;text-align:center;list-style:none}.carousel-indicators li{display:inline-block;width:10px;height:10px;margin:1px;text-indent:-999px;cursor:pointer;background-color:#000\\9;background-color:rgba(0,0,0,0);border:1px solid #fff;border-radius:10px}.carousel-indicators .active{width:12px;height:12px;margin:0;background-color:#fff}.carousel-caption{position:absolute;right:15%;bottom:20px;left:15%;z-index:10;padding-top:20px;padding-bottom:20px;color:#fff;text-align:center;text-shadow:0 1px 2px rgba(0,0,0,.6)}.carousel-caption .btn{text-shadow:none}@media screen and (min-width:768px){.carousel-control .glyphicon-chevron-left,.carousel-control .glyphicon-chevron-right,.carousel-control .icon-next,.carousel-control .icon-prev{width:30px;height:30px;margin-top:-10px;font-size:30px}.carousel-control .glyphicon-chevron-left,.carousel-control .icon-prev{margin-left:-10px}.carousel-control .glyphicon-chevron-right,.carousel-control .icon-next{margin-right:-10px}.carousel-caption{right:20%;left:20%;padding-bottom:30px}.carousel-indicators{bottom:20px}}.btn-group-vertical>.btn-group:after,.btn-group-vertical>.btn-group:before,.btn-toolbar:after,.btn-toolbar:before,.clearfix:after,.clearfix:before,.container-fluid:after,.container-fluid:before,.container:after,.container:before,.dl-horizontal dd:after,.dl-horizontal dd:before,.form-horizontal .form-group:after,.form-horizontal .form-group:before,.modal-footer:after,.modal-footer:before,.modal-header:after,.modal-header:before,.nav:after,.nav:before,.navbar-collapse:after,.navbar-collapse:before,.navbar-header:after,.navbar-header:before,.navbar:after,.navbar:before,.pager:after,.pager:before,.panel-body:after,.panel-body:before,.row:after,.row:before{display:table;content:\" \"}.btn-group-vertical>.btn-group:after,.btn-toolbar:after,.clearfix:after,.container-fluid:after,.container:after,.dl-horizontal dd:after,.form-horizontal .form-group:after,.modal-footer:after,.modal-header:after,.nav:after,.navbar-collapse:after,.navbar-header:after,.navbar:after,.pager:after,.panel-body:after,.row:after{clear:both}.center-block{display:block;margin-right:auto;margin-left:auto}.pull-right{float:right!important}.pull-left{float:left!important}.hide{display:none!important}.show{display:block!important}.invisible{visibility:hidden}.text-hide{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.hidden{display:none!important}.affix{position:fixed}@-ms-viewport{width:device-width}.visible-lg,.visible-md,.visible-sm,.visible-xs{display:none!important}.visible-lg-block,.visible-lg-inline,.visible-lg-inline-block,.visible-md-block,.visible-md-inline,.visible-md-inline-block,.visible-sm-block,.visible-sm-inline,.visible-sm-inline-block,.visible-xs-block,.visible-xs-inline,.visible-xs-inline-block{display:none!important}@media (max-width:767px){.visible-xs{display:block!important}table.visible-xs{display:table!important}tr.visible-xs{display:table-row!important}td.visible-xs,th.visible-xs{display:table-cell!important}}@media (max-width:767px){.visible-xs-block{display:block!important}}@media (max-width:767px){.visible-xs-inline{display:inline!important}}@media (max-width:767px){.visible-xs-inline-block{display:inline-block!important}}@media (min-width:768px) and (max-width:991px){.visible-sm{display:block!important}table.visible-sm{display:table!important}tr.visible-sm{display:table-row!important}td.visible-sm,th.visible-sm{display:table-cell!important}}@media (min-width:768px) and (max-width:991px){.visible-sm-block{display:block!important}}@media (min-width:768px) and (max-width:991px){.visible-sm-inline{display:inline!important}}@media (min-width:768px) and (max-width:991px){.visible-sm-inline-block{display:inline-block!important}}@media (min-width:992px) and (max-width:1199px){.visible-md{display:block!important}table.visible-md{display:table!important}tr.visible-md{display:table-row!important}td.visible-md,th.visible-md{display:table-cell!important}}@media (min-width:992px) and (max-width:1199px){.visible-md-block{display:block!important}}@media (min-width:992px) and (max-width:1199px){.visible-md-inline{display:inline!important}}@media (min-width:992px) and (max-width:1199px){.visible-md-inline-block{display:inline-block!important}}@media (min-width:1200px){.visible-lg{display:block!important}table.visible-lg{display:table!important}tr.visible-lg{display:table-row!important}td.visible-lg,th.visible-lg{display:table-cell!important}}@media (min-width:1200px){.visible-lg-block{display:block!important}}@media (min-width:1200px){.visible-lg-inline{display:inline!important}}@media (min-width:1200px){.visible-lg-inline-block{display:inline-block!important}}@media (max-width:767px){.hidden-xs{display:none!important}}@media (min-width:768px) and (max-width:991px){.hidden-sm{display:none!important}}@media (min-width:992px) and (max-width:1199px){.hidden-md{display:none!important}}@media (min-width:1200px){.hidden-lg{display:none!important}}.visible-print{display:none!important}@media print{.visible-print{display:block!important}table.visible-print{display:table!important}tr.visible-print{display:table-row!important}td.visible-print,th.visible-print{display:table-cell!important}}.visible-print-block{display:none!important}@media print{.visible-print-block{display:block!important}}.visible-print-inline{display:none!important}@media print{.visible-print-inline{display:inline!important}}.visible-print-inline-block{display:none!important}@media print{.visible-print-inline-block{display:inline-block!important}}@media print{.hidden-print{display:none!important}}", ""]); // Exports module.exports = exports; /***/ }), /***/ "./node_modules/css-loader/dist/cjs.js!./node_modules/loaders.css/loaders.css": /***/ (function(module, exports, __webpack_require__) { // Imports var ___CSS_LOADER_API_IMPORT___ = __webpack_require__("./node_modules/css-loader/dist/runtime/api.js"); exports = ___CSS_LOADER_API_IMPORT___(false); // Module exports.push([module.i, "/**\n *\n * All animations must live in their own file\n * in the animations directory and be included\n * here.\n *\n */\n/**\n * Styles shared by multiple animations\n */\n/**\n * Dots\n */\n@-webkit-keyframes scale {\n 0% {\n -webkit-transform: scale(1);\n transform: scale(1);\n opacity: 1; }\n 45% {\n -webkit-transform: scale(0.1);\n transform: scale(0.1);\n opacity: 0.7; }\n 80% {\n -webkit-transform: scale(1);\n transform: scale(1);\n opacity: 1; } }\n@keyframes scale {\n 0% {\n -webkit-transform: scale(1);\n transform: scale(1);\n opacity: 1; }\n 45% {\n -webkit-transform: scale(0.1);\n transform: scale(0.1);\n opacity: 0.7; }\n 80% {\n -webkit-transform: scale(1);\n transform: scale(1);\n opacity: 1; } }\n\n.ball-pulse > div:nth-child(0) {\n -webkit-animation: scale 0.75s -0.36s infinite cubic-bezier(0.2, 0.68, 0.18, 1.08);\n animation: scale 0.75s -0.36s infinite cubic-bezier(0.2, 0.68, 0.18, 1.08); }\n\n.ball-pulse > div:nth-child(1) {\n -webkit-animation: scale 0.75s -0.24s infinite cubic-bezier(0.2, 0.68, 0.18, 1.08);\n animation: scale 0.75s -0.24s infinite cubic-bezier(0.2, 0.68, 0.18, 1.08); }\n\n.ball-pulse > div:nth-child(2) {\n -webkit-animation: scale 0.75s -0.12s infinite cubic-bezier(0.2, 0.68, 0.18, 1.08);\n animation: scale 0.75s -0.12s infinite cubic-bezier(0.2, 0.68, 0.18, 1.08); }\n\n.ball-pulse > div:nth-child(3) {\n -webkit-animation: scale 0.75s 0s infinite cubic-bezier(0.2, 0.68, 0.18, 1.08);\n animation: scale 0.75s 0s infinite cubic-bezier(0.2, 0.68, 0.18, 1.08); }\n\n.ball-pulse > div {\n background-color: #fff;\n width: 15px;\n height: 15px;\n border-radius: 100%;\n margin: 2px;\n -webkit-animation-fill-mode: both;\n animation-fill-mode: both;\n display: inline-block; }\n\n@-webkit-keyframes ball-pulse-sync {\n 33% {\n -webkit-transform: translateY(10px);\n transform: translateY(10px); }\n 66% {\n -webkit-transform: translateY(-10px);\n transform: translateY(-10px); }\n 100% {\n -webkit-transform: translateY(0);\n transform: translateY(0); } }\n\n@keyframes ball-pulse-sync {\n 33% {\n -webkit-transform: translateY(10px);\n transform: translateY(10px); }\n 66% {\n -webkit-transform: translateY(-10px);\n transform: translateY(-10px); }\n 100% {\n -webkit-transform: translateY(0);\n transform: translateY(0); } }\n\n.ball-pulse-sync > div:nth-child(0) {\n -webkit-animation: ball-pulse-sync 0.6s -0.21s infinite ease-in-out;\n animation: ball-pulse-sync 0.6s -0.21s infinite ease-in-out; }\n\n.ball-pulse-sync > div:nth-child(1) {\n -webkit-animation: ball-pulse-sync 0.6s -0.14s infinite ease-in-out;\n animation: ball-pulse-sync 0.6s -0.14s infinite ease-in-out; }\n\n.ball-pulse-sync > div:nth-child(2) {\n -webkit-animation: ball-pulse-sync 0.6s -0.07s infinite ease-in-out;\n animation: ball-pulse-sync 0.6s -0.07s infinite ease-in-out; }\n\n.ball-pulse-sync > div:nth-child(3) {\n -webkit-animation: ball-pulse-sync 0.6s 0s infinite ease-in-out;\n animation: ball-pulse-sync 0.6s 0s infinite ease-in-out; }\n\n.ball-pulse-sync > div {\n background-color: #fff;\n width: 15px;\n height: 15px;\n border-radius: 100%;\n margin: 2px;\n -webkit-animation-fill-mode: both;\n animation-fill-mode: both;\n display: inline-block; }\n\n@-webkit-keyframes ball-scale {\n 0% {\n -webkit-transform: scale(0);\n transform: scale(0); }\n 100% {\n -webkit-transform: scale(1);\n transform: scale(1);\n opacity: 0; } }\n\n@keyframes ball-scale {\n 0% {\n -webkit-transform: scale(0);\n transform: scale(0); }\n 100% {\n -webkit-transform: scale(1);\n transform: scale(1);\n opacity: 0; } }\n\n.ball-scale > div {\n background-color: #fff;\n width: 15px;\n height: 15px;\n border-radius: 100%;\n margin: 2px;\n -webkit-animation-fill-mode: both;\n animation-fill-mode: both;\n display: inline-block;\n height: 60px;\n width: 60px;\n -webkit-animation: ball-scale 1s 0s ease-in-out infinite;\n animation: ball-scale 1s 0s ease-in-out infinite; }\n\n@keyframes ball-scale {\n 0% {\n -webkit-transform: scale(0);\n transform: scale(0); }\n 100% {\n -webkit-transform: scale(1);\n transform: scale(1);\n opacity: 0; } }\n\n.ball-scale > div {\n background-color: #fff;\n width: 15px;\n height: 15px;\n border-radius: 100%;\n margin: 2px;\n -webkit-animation-fill-mode: both;\n animation-fill-mode: both;\n display: inline-block;\n height: 60px;\n width: 60px;\n -webkit-animation: ball-scale 1s 0s ease-in-out infinite;\n animation: ball-scale 1s 0s ease-in-out infinite; }\n\n.ball-scale-random {\n width: 37px;\n height: 40px; }\n .ball-scale-random > div {\n background-color: #fff;\n width: 15px;\n height: 15px;\n border-radius: 100%;\n margin: 2px;\n -webkit-animation-fill-mode: both;\n animation-fill-mode: both;\n position: absolute;\n display: inline-block;\n height: 30px;\n width: 30px;\n -webkit-animation: ball-scale 1s 0s ease-in-out infinite;\n animation: ball-scale 1s 0s ease-in-out infinite; }\n .ball-scale-random > div:nth-child(1) {\n margin-left: -7px;\n -webkit-animation: ball-scale 1s 0.2s ease-in-out infinite;\n animation: ball-scale 1s 0.2s ease-in-out infinite; }\n .ball-scale-random > div:nth-child(3) {\n margin-left: -2px;\n margin-top: 9px;\n -webkit-animation: ball-scale 1s 0.5s ease-in-out infinite;\n animation: ball-scale 1s 0.5s ease-in-out infinite; }\n\n@-webkit-keyframes rotate {\n 0% {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg); }\n 50% {\n -webkit-transform: rotate(180deg);\n transform: rotate(180deg); }\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg); } }\n\n@keyframes rotate {\n 0% {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg); }\n 50% {\n -webkit-transform: rotate(180deg);\n transform: rotate(180deg); }\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg); } }\n\n.ball-rotate {\n position: relative; }\n .ball-rotate > div {\n background-color: #fff;\n width: 15px;\n height: 15px;\n border-radius: 100%;\n margin: 2px;\n -webkit-animation-fill-mode: both;\n animation-fill-mode: both;\n position: relative; }\n .ball-rotate > div:first-child {\n -webkit-animation: rotate 1s 0s cubic-bezier(0.7, -0.13, 0.22, 0.86) infinite;\n animation: rotate 1s 0s cubic-bezier(0.7, -0.13, 0.22, 0.86) infinite; }\n .ball-rotate > div:before, .ball-rotate > div:after {\n background-color: #fff;\n width: 15px;\n height: 15px;\n border-radius: 100%;\n margin: 2px;\n content: \"\";\n position: absolute;\n opacity: 0.8; }\n .ball-rotate > div:before {\n top: 0px;\n left: -28px; }\n .ball-rotate > div:after {\n top: 0px;\n left: 25px; }\n\n@keyframes rotate {\n 0% {\n -webkit-transform: rotate(0deg) scale(1);\n transform: rotate(0deg) scale(1); }\n 50% {\n -webkit-transform: rotate(180deg) scale(0.6);\n transform: rotate(180deg) scale(0.6); }\n 100% {\n -webkit-transform: rotate(360deg) scale(1);\n transform: rotate(360deg) scale(1); } }\n\n.ball-clip-rotate > div {\n background-color: #fff;\n width: 15px;\n height: 15px;\n border-radius: 100%;\n margin: 2px;\n -webkit-animation-fill-mode: both;\n animation-fill-mode: both;\n border: 2px solid #fff;\n border-bottom-color: transparent;\n height: 25px;\n width: 25px;\n background: transparent !important;\n display: inline-block;\n -webkit-animation: rotate 0.75s 0s linear infinite;\n animation: rotate 0.75s 0s linear infinite; }\n\n@keyframes rotate {\n 0% {\n -webkit-transform: rotate(0deg) scale(1);\n transform: rotate(0deg) scale(1); }\n 50% {\n -webkit-transform: rotate(180deg) scale(0.6);\n transform: rotate(180deg) scale(0.6); }\n 100% {\n -webkit-transform: rotate(360deg) scale(1);\n transform: rotate(360deg) scale(1); } }\n\n@keyframes scale {\n 30% {\n -webkit-transform: scale(0.3);\n transform: scale(0.3); }\n 100% {\n -webkit-transform: scale(1);\n transform: scale(1); } }\n\n.ball-clip-rotate-pulse {\n position: relative;\n -webkit-transform: translateY(-15px);\n -ms-transform: translateY(-15px);\n transform: translateY(-15px); }\n .ball-clip-rotate-pulse > div {\n -webkit-animation-fill-mode: both;\n animation-fill-mode: both;\n position: absolute;\n top: 0px;\n left: 0px;\n border-radius: 100%; }\n .ball-clip-rotate-pulse > div:first-child {\n background: #fff;\n height: 16px;\n width: 16px;\n top: 7px;\n left: -7px;\n -webkit-animation: scale 1s 0s cubic-bezier(0.09, 0.57, 0.49, 0.9) infinite;\n animation: scale 1s 0s cubic-bezier(0.09, 0.57, 0.49, 0.9) infinite; }\n .ball-clip-rotate-pulse > div:last-child {\n position: absolute;\n border: 2px solid #fff;\n width: 30px;\n height: 30px;\n left: -16px;\n top: -2px;\n background: transparent;\n border: 2px solid;\n border-color: #fff transparent #fff transparent;\n -webkit-animation: rotate 1s 0s cubic-bezier(0.09, 0.57, 0.49, 0.9) infinite;\n animation: rotate 1s 0s cubic-bezier(0.09, 0.57, 0.49, 0.9) infinite;\n -webkit-animation-duration: 1s;\n animation-duration: 1s; }\n\n@keyframes rotate {\n 0% {\n -webkit-transform: rotate(0deg) scale(1);\n transform: rotate(0deg) scale(1); }\n 50% {\n -webkit-transform: rotate(180deg) scale(0.6);\n transform: rotate(180deg) scale(0.6); }\n 100% {\n -webkit-transform: rotate(360deg) scale(1);\n transform: rotate(360deg) scale(1); } }\n\n.ball-clip-rotate-multiple {\n position: relative; }\n .ball-clip-rotate-multiple > div {\n -webkit-animation-fill-mode: both;\n animation-fill-mode: both;\n position: absolute;\n left: -20px;\n top: -20px;\n border: 2px solid #fff;\n border-bottom-color: transparent;\n border-top-color: transparent;\n border-radius: 100%;\n height: 35px;\n width: 35px;\n -webkit-animation: rotate 1s 0s ease-in-out infinite;\n animation: rotate 1s 0s ease-in-out infinite; }\n .ball-clip-rotate-multiple > div:last-child {\n display: inline-block;\n top: -10px;\n left: -10px;\n width: 15px;\n height: 15px;\n -webkit-animation-duration: 0.5s;\n animation-duration: 0.5s;\n border-color: #fff transparent #fff transparent;\n -webkit-animation-direction: reverse;\n animation-direction: reverse; }\n\n@-webkit-keyframes ball-scale-ripple {\n 0% {\n -webkit-transform: scale(0.1);\n transform: scale(0.1);\n opacity: 1; }\n 70% {\n -webkit-transform: scale(1);\n transform: scale(1);\n opacity: 0.7; }\n 100% {\n opacity: 0.0; } }\n\n@keyframes ball-scale-ripple {\n 0% {\n -webkit-transform: scale(0.1);\n transform: scale(0.1);\n opacity: 1; }\n 70% {\n -webkit-transform: scale(1);\n transform: scale(1);\n opacity: 0.7; }\n 100% {\n opacity: 0.0; } }\n\n.ball-scale-ripple > div {\n -webkit-animation-fill-mode: both;\n animation-fill-mode: both;\n height: 50px;\n width: 50px;\n border-radius: 100%;\n border: 2px solid #fff;\n -webkit-animation: ball-scale-ripple 1s 0s infinite cubic-bezier(0.21, 0.53, 0.56, 0.8);\n animation: ball-scale-ripple 1s 0s infinite cubic-bezier(0.21, 0.53, 0.56, 0.8); }\n\n@-webkit-keyframes ball-scale-ripple-multiple {\n 0% {\n -webkit-transform: scale(0.1);\n transform: scale(0.1);\n opacity: 1; }\n 70% {\n -webkit-transform: scale(1);\n transform: scale(1);\n opacity: 0.7; }\n 100% {\n opacity: 0.0; } }\n\n@keyframes ball-scale-ripple-multiple {\n 0% {\n -webkit-transform: scale(0.1);\n transform: scale(0.1);\n opacity: 1; }\n 70% {\n -webkit-transform: scale(1);\n transform: scale(1);\n opacity: 0.7; }\n 100% {\n opacity: 0.0; } }\n\n.ball-scale-ripple-multiple {\n position: relative;\n -webkit-transform: translateY(-25px);\n -ms-transform: translateY(-25px);\n transform: translateY(-25px); }\n .ball-scale-ripple-multiple > div:nth-child(0) {\n -webkit-animation-delay: -0.8s;\n animation-delay: -0.8s; }\n .ball-scale-ripple-multiple > div:nth-child(1) {\n -webkit-animation-delay: -0.6s;\n animation-delay: -0.6s; }\n .ball-scale-ripple-multiple > div:nth-child(2) {\n -webkit-animation-delay: -0.4s;\n animation-delay: -0.4s; }\n .ball-scale-ripple-multiple > div:nth-child(3) {\n -webkit-animation-delay: -0.2s;\n animation-delay: -0.2s; }\n .ball-scale-ripple-multiple > div {\n -webkit-animation-fill-mode: both;\n animation-fill-mode: both;\n position: absolute;\n top: -2px;\n left: -26px;\n width: 50px;\n height: 50px;\n border-radius: 100%;\n border: 2px solid #fff;\n -webkit-animation: ball-scale-ripple-multiple 1.25s 0s infinite cubic-bezier(0.21, 0.53, 0.56, 0.8);\n animation: ball-scale-ripple-multiple 1.25s 0s infinite cubic-bezier(0.21, 0.53, 0.56, 0.8); }\n\n@-webkit-keyframes ball-beat {\n 50% {\n opacity: 0.2;\n -webkit-transform: scale(0.75);\n transform: scale(0.75); }\n 100% {\n opacity: 1;\n -webkit-transform: scale(1);\n transform: scale(1); } }\n\n@keyframes ball-beat {\n 50% {\n opacity: 0.2;\n -webkit-transform: scale(0.75);\n transform: scale(0.75); }\n 100% {\n opacity: 1;\n -webkit-transform: scale(1);\n transform: scale(1); } }\n\n.ball-beat > div {\n background-color: #fff;\n width: 15px;\n height: 15px;\n border-radius: 100%;\n margin: 2px;\n -webkit-animation-fill-mode: both;\n animation-fill-mode: both;\n display: inline-block;\n -webkit-animation: ball-beat 0.7s 0s infinite linear;\n animation: ball-beat 0.7s 0s infinite linear; }\n .ball-beat > div:nth-child(2n-1) {\n -webkit-animation-delay: -0.35s !important;\n animation-delay: -0.35s !important; }\n\n@-webkit-keyframes ball-scale-multiple {\n 0% {\n -webkit-transform: scale(0);\n transform: scale(0);\n opacity: 0; }\n 5% {\n opacity: 1; }\n 100% {\n -webkit-transform: scale(1);\n transform: scale(1);\n opacity: 0; } }\n\n@keyframes ball-scale-multiple {\n 0% {\n -webkit-transform: scale(0);\n transform: scale(0);\n opacity: 0; }\n 5% {\n opacity: 1; }\n 100% {\n -webkit-transform: scale(1);\n transform: scale(1);\n opacity: 0; } }\n\n.ball-scale-multiple {\n position: relative;\n -webkit-transform: translateY(-30px);\n -ms-transform: translateY(-30px);\n transform: translateY(-30px); }\n .ball-scale-multiple > div:nth-child(2) {\n -webkit-animation-delay: -0.4s;\n animation-delay: -0.4s; }\n .ball-scale-multiple > div:nth-child(3) {\n -webkit-animation-delay: -0.2s;\n animation-delay: -0.2s; }\n .ball-scale-multiple > div {\n background-color: #fff;\n width: 15px;\n height: 15px;\n border-radius: 100%;\n margin: 2px;\n -webkit-animation-fill-mode: both;\n animation-fill-mode: both;\n position: absolute;\n left: -30px;\n top: 0px;\n opacity: 0;\n margin: 0;\n width: 60px;\n height: 60px;\n -webkit-animation: ball-scale-multiple 1s 0s linear infinite;\n animation: ball-scale-multiple 1s 0s linear infinite; }\n\n@-webkit-keyframes ball-triangle-path-1 {\n 33% {\n -webkit-transform: translate(25px, -50px);\n transform: translate(25px, -50px); }\n 66% {\n -webkit-transform: translate(50px, 0px);\n transform: translate(50px, 0px); }\n 100% {\n -webkit-transform: translate(0px, 0px);\n transform: translate(0px, 0px); } }\n\n@keyframes ball-triangle-path-1 {\n 33% {\n -webkit-transform: translate(25px, -50px);\n transform: translate(25px, -50px); }\n 66% {\n -webkit-transform: translate(50px, 0px);\n transform: translate(50px, 0px); }\n 100% {\n -webkit-transform: translate(0px, 0px);\n transform: translate(0px, 0px); } }\n\n@-webkit-keyframes ball-triangle-path-2 {\n 33% {\n -webkit-transform: translate(25px, 50px);\n transform: translate(25px, 50px); }\n 66% {\n -webkit-transform: translate(-25px, 50px);\n transform: translate(-25px, 50px); }\n 100% {\n -webkit-transform: translate(0px, 0px);\n transform: translate(0px, 0px); } }\n\n@keyframes ball-triangle-path-2 {\n 33% {\n -webkit-transform: translate(25px, 50px);\n transform: translate(25px, 50px); }\n 66% {\n -webkit-transform: translate(-25px, 50px);\n transform: translate(-25px, 50px); }\n 100% {\n -webkit-transform: translate(0px, 0px);\n transform: translate(0px, 0px); } }\n\n@-webkit-keyframes ball-triangle-path-3 {\n 33% {\n -webkit-transform: translate(-50px, 0px);\n transform: translate(-50px, 0px); }\n 66% {\n -webkit-transform: translate(-25px, -50px);\n transform: translate(-25px, -50px); }\n 100% {\n -webkit-transform: translate(0px, 0px);\n transform: translate(0px, 0px); } }\n\n@keyframes ball-triangle-path-3 {\n 33% {\n -webkit-transform: translate(-50px, 0px);\n transform: translate(-50px, 0px); }\n 66% {\n -webkit-transform: translate(-25px, -50px);\n transform: translate(-25px, -50px); }\n 100% {\n -webkit-transform: translate(0px, 0px);\n transform: translate(0px, 0px); } }\n\n.ball-triangle-path {\n position: relative;\n -webkit-transform: translate(-29.994px, -37.50938px);\n -ms-transform: translate(-29.994px, -37.50938px);\n transform: translate(-29.994px, -37.50938px); }\n .ball-triangle-path > div:nth-child(1) {\n -webkit-animation-name: ball-triangle-path-1;\n animation-name: ball-triangle-path-1;\n -webkit-animation-delay: 0;\n animation-delay: 0;\n -webkit-animation-duration: 2s;\n animation-duration: 2s;\n -webkit-animation-timing-function: ease-in-out;\n animation-timing-function: ease-in-out;\n -webkit-animation-iteration-count: infinite;\n animation-iteration-count: infinite; }\n .ball-triangle-path > div:nth-child(2) {\n -webkit-animation-name: ball-triangle-path-2;\n animation-name: ball-triangle-path-2;\n -webkit-animation-delay: 0;\n animation-delay: 0;\n -webkit-animation-duration: 2s;\n animation-duration: 2s;\n -webkit-animation-timing-function: ease-in-out;\n animation-timing-function: ease-in-out;\n -webkit-animation-iteration-count: infinite;\n animation-iteration-count: infinite; }\n .ball-triangle-path > div:nth-child(3) {\n -webkit-animation-name: ball-triangle-path-3;\n animation-name: ball-triangle-path-3;\n -webkit-animation-delay: 0;\n animation-delay: 0;\n -webkit-animation-duration: 2s;\n animation-duration: 2s;\n -webkit-animation-timing-function: ease-in-out;\n animation-timing-function: ease-in-out;\n -webkit-animation-iteration-count: infinite;\n animation-iteration-count: infinite; }\n .ball-triangle-path > div {\n -webkit-animation-fill-mode: both;\n animation-fill-mode: both;\n position: absolute;\n width: 10px;\n height: 10px;\n border-radius: 100%;\n border: 1px solid #fff; }\n .ball-triangle-path > div:nth-of-type(1) {\n top: 50px; }\n .ball-triangle-path > div:nth-of-type(2) {\n left: 25px; }\n .ball-triangle-path > div:nth-of-type(3) {\n top: 50px;\n left: 50px; }\n\n@-webkit-keyframes ball-pulse-rise-even {\n 0% {\n -webkit-transform: scale(1.1);\n transform: scale(1.1); }\n 25% {\n -webkit-transform: translateY(-30px);\n transform: translateY(-30px); }\n 50% {\n -webkit-transform: scale(0.4);\n transform: scale(0.4); }\n 75% {\n -webkit-transform: translateY(30px);\n transform: translateY(30px); }\n 100% {\n -webkit-transform: translateY(0);\n transform: translateY(0);\n -webkit-transform: scale(1);\n transform: scale(1); } }\n\n@keyframes ball-pulse-rise-even {\n 0% {\n -webkit-transform: scale(1.1);\n transform: scale(1.1); }\n 25% {\n -webkit-transform: translateY(-30px);\n transform: translateY(-30px); }\n 50% {\n -webkit-transform: scale(0.4);\n transform: scale(0.4); }\n 75% {\n -webkit-transform: translateY(30px);\n transform: translateY(30px); }\n 100% {\n -webkit-transform: translateY(0);\n transform: translateY(0);\n -webkit-transform: scale(1);\n transform: scale(1); } }\n\n@-webkit-keyframes ball-pulse-rise-odd {\n 0% {\n -webkit-transform: scale(0.4);\n transform: scale(0.4); }\n 25% {\n -webkit-transform: translateY(30px);\n transform: translateY(30px); }\n 50% {\n -webkit-transform: scale(1.1);\n transform: scale(1.1); }\n 75% {\n -webkit-transform: translateY(-30px);\n transform: translateY(-30px); }\n 100% {\n -webkit-transform: translateY(0);\n transform: translateY(0);\n -webkit-transform: scale(0.75);\n transform: scale(0.75); } }\n\n@keyframes ball-pulse-rise-odd {\n 0% {\n -webkit-transform: scale(0.4);\n transform: scale(0.4); }\n 25% {\n -webkit-transform: translateY(30px);\n transform: translateY(30px); }\n 50% {\n -webkit-transform: scale(1.1);\n transform: scale(1.1); }\n 75% {\n -webkit-transform: translateY(-30px);\n transform: translateY(-30px); }\n 100% {\n -webkit-transform: translateY(0);\n transform: translateY(0);\n -webkit-transform: scale(0.75);\n transform: scale(0.75); } }\n\n.ball-pulse-rise > div {\n background-color: #fff;\n width: 15px;\n height: 15px;\n border-radius: 100%;\n margin: 2px;\n -webkit-animation-fill-mode: both;\n animation-fill-mode: both;\n display: inline-block;\n -webkit-animation-duration: 1s;\n animation-duration: 1s;\n -webkit-animation-timing-function: cubic-bezier(0.15, 0.46, 0.9, 0.6);\n animation-timing-function: cubic-bezier(0.15, 0.46, 0.9, 0.6);\n -webkit-animation-iteration-count: infinite;\n animation-iteration-count: infinite;\n -webkit-animation-delay: 0;\n animation-delay: 0; }\n .ball-pulse-rise > div:nth-child(2n) {\n -webkit-animation-name: ball-pulse-rise-even;\n animation-name: ball-pulse-rise-even; }\n .ball-pulse-rise > div:nth-child(2n-1) {\n -webkit-animation-name: ball-pulse-rise-odd;\n animation-name: ball-pulse-rise-odd; }\n\n@-webkit-keyframes ball-grid-beat {\n 50% {\n opacity: 0.7; }\n 100% {\n opacity: 1; } }\n\n@keyframes ball-grid-beat {\n 50% {\n opacity: 0.7; }\n 100% {\n opacity: 1; } }\n\n.ball-grid-beat {\n width: 57px; }\n .ball-grid-beat > div:nth-child(1) {\n -webkit-animation-delay: 0.44s;\n animation-delay: 0.44s;\n -webkit-animation-duration: 1.27s;\n animation-duration: 1.27s; }\n .ball-grid-beat > div:nth-child(2) {\n -webkit-animation-delay: 0.2s;\n animation-delay: 0.2s;\n -webkit-animation-duration: 1.52s;\n animation-duration: 1.52s; }\n .ball-grid-beat > div:nth-child(3) {\n -webkit-animation-delay: 0.14s;\n animation-delay: 0.14s;\n -webkit-animation-duration: 0.61s;\n animation-duration: 0.61s; }\n .ball-grid-beat > div:nth-child(4) {\n -webkit-animation-delay: 0.15s;\n animation-delay: 0.15s;\n -webkit-animation-duration: 0.82s;\n animation-duration: 0.82s; }\n .ball-grid-beat > div:nth-child(5) {\n -webkit-animation-delay: -0.01s;\n animation-delay: -0.01s;\n -webkit-animation-duration: 1.24s;\n animation-duration: 1.24s; }\n .ball-grid-beat > div:nth-child(6) {\n -webkit-animation-delay: -0.07s;\n animation-delay: -0.07s;\n -webkit-animation-duration: 1.35s;\n animation-duration: 1.35s; }\n .ball-grid-beat > div:nth-child(7) {\n -webkit-animation-delay: 0.29s;\n animation-delay: 0.29s;\n -webkit-animation-duration: 1.44s;\n animation-duration: 1.44s; }\n .ball-grid-beat > div:nth-child(8) {\n -webkit-animation-delay: 0.63s;\n animation-delay: 0.63s;\n -webkit-animation-duration: 1.19s;\n animation-duration: 1.19s; }\n .ball-grid-beat > div:nth-child(9) {\n -webkit-animation-delay: -0.18s;\n animation-delay: -0.18s;\n -webkit-animation-duration: 1.48s;\n animation-duration: 1.48s; }\n .ball-grid-beat > div {\n background-color: #fff;\n width: 15px;\n height: 15px;\n border-radius: 100%;\n margin: 2px;\n -webkit-animation-fill-mode: both;\n animation-fill-mode: both;\n display: inline-block;\n float: left;\n -webkit-animation-name: ball-grid-beat;\n animation-name: ball-grid-beat;\n -webkit-animation-iteration-count: infinite;\n animation-iteration-count: infinite;\n -webkit-animation-delay: 0;\n animation-delay: 0; }\n\n@-webkit-keyframes ball-grid-pulse {\n 0% {\n -webkit-transform: scale(1);\n transform: scale(1); }\n 50% {\n -webkit-transform: scale(0.5);\n transform: scale(0.5);\n opacity: 0.7; }\n 100% {\n -webkit-transform: scale(1);\n transform: scale(1);\n opacity: 1; } }\n\n@keyframes ball-grid-pulse {\n 0% {\n -webkit-transform: scale(1);\n transform: scale(1); }\n 50% {\n -webkit-transform: scale(0.5);\n transform: scale(0.5);\n opacity: 0.7; }\n 100% {\n -webkit-transform: scale(1);\n transform: scale(1);\n opacity: 1; } }\n\n.ball-grid-pulse {\n width: 57px; }\n .ball-grid-pulse > div:nth-child(1) {\n -webkit-animation-delay: 0.58s;\n animation-delay: 0.58s;\n -webkit-animation-duration: 0.9s;\n animation-duration: 0.9s; }\n .ball-grid-pulse > div:nth-child(2) {\n -webkit-animation-delay: 0.01s;\n animation-delay: 0.01s;\n -webkit-animation-duration: 0.94s;\n animation-duration: 0.94s; }\n .ball-grid-pulse > div:nth-child(3) {\n -webkit-animation-delay: 0.25s;\n animation-delay: 0.25s;\n -webkit-animation-duration: 1.43s;\n animation-duration: 1.43s; }\n .ball-grid-pulse > div:nth-child(4) {\n -webkit-animation-delay: -0.03s;\n animation-delay: -0.03s;\n -webkit-animation-duration: 0.74s;\n animation-duration: 0.74s; }\n .ball-grid-pulse > div:nth-child(5) {\n -webkit-animation-delay: 0.21s;\n animation-delay: 0.21s;\n -webkit-animation-duration: 0.68s;\n animation-duration: 0.68s; }\n .ball-grid-pulse > div:nth-child(6) {\n -webkit-animation-delay: 0.25s;\n animation-delay: 0.25s;\n -webkit-animation-duration: 1.17s;\n animation-duration: 1.17s; }\n .ball-grid-pulse > div:nth-child(7) {\n -webkit-animation-delay: 0.46s;\n animation-delay: 0.46s;\n -webkit-animation-duration: 1.41s;\n animation-duration: 1.41s; }\n .ball-grid-pulse > div:nth-child(8) {\n -webkit-animation-delay: 0.02s;\n animation-delay: 0.02s;\n -webkit-animation-duration: 1.56s;\n animation-duration: 1.56s; }\n .ball-grid-pulse > div:nth-child(9) {\n -webkit-animation-delay: 0.13s;\n animation-delay: 0.13s;\n -webkit-animation-duration: 0.78s;\n animation-duration: 0.78s; }\n .ball-grid-pulse > div {\n background-color: #fff;\n width: 15px;\n height: 15px;\n border-radius: 100%;\n margin: 2px;\n -webkit-animation-fill-mode: both;\n animation-fill-mode: both;\n display: inline-block;\n float: left;\n -webkit-animation-name: ball-grid-pulse;\n animation-name: ball-grid-pulse;\n -webkit-animation-iteration-count: infinite;\n animation-iteration-count: infinite;\n -webkit-animation-delay: 0;\n animation-delay: 0; }\n\n@-webkit-keyframes ball-spin-fade-loader {\n 50% {\n opacity: 0.3;\n -webkit-transform: scale(0.4);\n transform: scale(0.4); }\n 100% {\n opacity: 1;\n -webkit-transform: scale(1);\n transform: scale(1); } }\n\n@keyframes ball-spin-fade-loader {\n 50% {\n opacity: 0.3;\n -webkit-transform: scale(0.4);\n transform: scale(0.4); }\n 100% {\n opacity: 1;\n -webkit-transform: scale(1);\n transform: scale(1); } }\n\n.ball-spin-fade-loader {\n position: relative;\n top: -10px;\n left: -10px; }\n .ball-spin-fade-loader > div:nth-child(1) {\n top: 25px;\n left: 0;\n -webkit-animation: ball-spin-fade-loader 1s -0.96s infinite linear;\n animation: ball-spin-fade-loader 1s -0.96s infinite linear; }\n .ball-spin-fade-loader > div:nth-child(2) {\n top: 17.04545px;\n left: 17.04545px;\n -webkit-animation: ball-spin-fade-loader 1s -0.84s infinite linear;\n animation: ball-spin-fade-loader 1s -0.84s infinite linear; }\n .ball-spin-fade-loader > div:nth-child(3) {\n top: 0;\n left: 25px;\n -webkit-animation: ball-spin-fade-loader 1s -0.72s infinite linear;\n animation: ball-spin-fade-loader 1s -0.72s infinite linear; }\n .ball-spin-fade-loader > div:nth-child(4) {\n top: -17.04545px;\n left: 17.04545px;\n -webkit-animation: ball-spin-fade-loader 1s -0.6s infinite linear;\n animation: ball-spin-fade-loader 1s -0.6s infinite linear; }\n .ball-spin-fade-loader > div:nth-child(5) {\n top: -25px;\n left: 0;\n -webkit-animation: ball-spin-fade-loader 1s -0.48s infinite linear;\n animation: ball-spin-fade-loader 1s -0.48s infinite linear; }\n .ball-spin-fade-loader > div:nth-child(6) {\n top: -17.04545px;\n left: -17.04545px;\n -webkit-animation: ball-spin-fade-loader 1s -0.36s infinite linear;\n animation: ball-spin-fade-loader 1s -0.36s infinite linear; }\n .ball-spin-fade-loader > div:nth-child(7) {\n top: 0;\n left: -25px;\n -webkit-animation: ball-spin-fade-loader 1s -0.24s infinite linear;\n animation: ball-spin-fade-loader 1s -0.24s infinite linear; }\n .ball-spin-fade-loader > div:nth-child(8) {\n top: 17.04545px;\n left: -17.04545px;\n -webkit-animation: ball-spin-fade-loader 1s -0.12s infinite linear;\n animation: ball-spin-fade-loader 1s -0.12s infinite linear; }\n .ball-spin-fade-loader > div {\n background-color: #fff;\n width: 15px;\n height: 15px;\n border-radius: 100%;\n margin: 2px;\n -webkit-animation-fill-mode: both;\n animation-fill-mode: both;\n position: absolute; }\n\n@-webkit-keyframes ball-spin-loader {\n 75% {\n opacity: 0.2; }\n 100% {\n opacity: 1; } }\n\n@keyframes ball-spin-loader {\n 75% {\n opacity: 0.2; }\n 100% {\n opacity: 1; } }\n\n.ball-spin-loader {\n position: relative; }\n .ball-spin-loader > span:nth-child(1) {\n top: 45px;\n left: 0;\n -webkit-animation: ball-spin-loader 2s 0.9s infinite linear;\n animation: ball-spin-loader 2s 0.9s infinite linear; }\n .ball-spin-loader > span:nth-child(2) {\n top: 30.68182px;\n left: 30.68182px;\n -webkit-animation: ball-spin-loader 2s 1.8s infinite linear;\n animation: ball-spin-loader 2s 1.8s infinite linear; }\n .ball-spin-loader > span:nth-child(3) {\n top: 0;\n left: 45px;\n -webkit-animation: ball-spin-loader 2s 2.7s infinite linear;\n animation: ball-spin-loader 2s 2.7s infinite linear; }\n .ball-spin-loader > span:nth-child(4) {\n top: -30.68182px;\n left: 30.68182px;\n -webkit-animation: ball-spin-loader 2s 3.6s infinite linear;\n animation: ball-spin-loader 2s 3.6s infinite linear; }\n .ball-spin-loader > span:nth-child(5) {\n top: -45px;\n left: 0;\n -webkit-animation: ball-spin-loader 2s 4.5s infinite linear;\n animation: ball-spin-loader 2s 4.5s infinite linear; }\n .ball-spin-loader > span:nth-child(6) {\n top: -30.68182px;\n left: -30.68182px;\n -webkit-animation: ball-spin-loader 2s 5.4s infinite linear;\n animation: ball-spin-loader 2s 5.4s infinite linear; }\n .ball-spin-loader > span:nth-child(7) {\n top: 0;\n left: -45px;\n -webkit-animation: ball-spin-loader 2s 6.3s infinite linear;\n animation: ball-spin-loader 2s 6.3s infinite linear; }\n .ball-spin-loader > span:nth-child(8) {\n top: 30.68182px;\n left: -30.68182px;\n -webkit-animation: ball-spin-loader 2s 7.2s infinite linear;\n animation: ball-spin-loader 2s 7.2s infinite linear; }\n .ball-spin-loader > div {\n -webkit-animation-fill-mode: both;\n animation-fill-mode: both;\n position: absolute;\n width: 15px;\n height: 15px;\n border-radius: 100%;\n background: green; }\n\n@-webkit-keyframes ball-zig {\n 33% {\n -webkit-transform: translate(-15px, -30px);\n transform: translate(-15px, -30px); }\n 66% {\n -webkit-transform: translate(15px, -30px);\n transform: translate(15px, -30px); }\n 100% {\n -webkit-transform: translate(0, 0);\n transform: translate(0, 0); } }\n\n@keyframes ball-zig {\n 33% {\n -webkit-transform: translate(-15px, -30px);\n transform: translate(-15px, -30px); }\n 66% {\n -webkit-transform: translate(15px, -30px);\n transform: translate(15px, -30px); }\n 100% {\n -webkit-transform: translate(0, 0);\n transform: translate(0, 0); } }\n\n@-webkit-keyframes ball-zag {\n 33% {\n -webkit-transform: translate(15px, 30px);\n transform: translate(15px, 30px); }\n 66% {\n -webkit-transform: translate(-15px, 30px);\n transform: translate(-15px, 30px); }\n 100% {\n -webkit-transform: translate(0, 0);\n transform: translate(0, 0); } }\n\n@keyframes ball-zag {\n 33% {\n -webkit-transform: translate(15px, 30px);\n transform: translate(15px, 30px); }\n 66% {\n -webkit-transform: translate(-15px, 30px);\n transform: translate(-15px, 30px); }\n 100% {\n -webkit-transform: translate(0, 0);\n transform: translate(0, 0); } }\n\n.ball-zig-zag {\n position: relative;\n -webkit-transform: translate(-15px, -15px);\n -ms-transform: translate(-15px, -15px);\n transform: translate(-15px, -15px); }\n .ball-zig-zag > div {\n background-color: #fff;\n width: 15px;\n height: 15px;\n border-radius: 100%;\n margin: 2px;\n -webkit-animation-fill-mode: both;\n animation-fill-mode: both;\n position: absolute;\n margin-left: 15px;\n top: 4px;\n left: -7px; }\n .ball-zig-zag > div:first-child {\n -webkit-animation: ball-zig 0.7s 0s infinite linear;\n animation: ball-zig 0.7s 0s infinite linear; }\n .ball-zig-zag > div:last-child {\n -webkit-animation: ball-zag 0.7s 0s infinite linear;\n animation: ball-zag 0.7s 0s infinite linear; }\n\n@-webkit-keyframes ball-zig-deflect {\n 17% {\n -webkit-transform: translate(-15px, -30px);\n transform: translate(-15px, -30px); }\n 34% {\n -webkit-transform: translate(15px, -30px);\n transform: translate(15px, -30px); }\n 50% {\n -webkit-transform: translate(0, 0);\n transform: translate(0, 0); }\n 67% {\n -webkit-transform: translate(15px, -30px);\n transform: translate(15px, -30px); }\n 84% {\n -webkit-transform: translate(-15px, -30px);\n transform: translate(-15px, -30px); }\n 100% {\n -webkit-transform: translate(0, 0);\n transform: translate(0, 0); } }\n\n@keyframes ball-zig-deflect {\n 17% {\n -webkit-transform: translate(-15px, -30px);\n transform: translate(-15px, -30px); }\n 34% {\n -webkit-transform: translate(15px, -30px);\n transform: translate(15px, -30px); }\n 50% {\n -webkit-transform: translate(0, 0);\n transform: translate(0, 0); }\n 67% {\n -webkit-transform: translate(15px, -30px);\n transform: translate(15px, -30px); }\n 84% {\n -webkit-transform: translate(-15px, -30px);\n transform: translate(-15px, -30px); }\n 100% {\n -webkit-transform: translate(0, 0);\n transform: translate(0, 0); } }\n\n@-webkit-keyframes ball-zag-deflect {\n 17% {\n -webkit-transform: translate(15px, 30px);\n transform: translate(15px, 30px); }\n 34% {\n -webkit-transform: translate(-15px, 30px);\n transform: translate(-15px, 30px); }\n 50% {\n -webkit-transform: translate(0, 0);\n transform: translate(0, 0); }\n 67% {\n -webkit-transform: translate(-15px, 30px);\n transform: translate(-15px, 30px); }\n 84% {\n -webkit-transform: translate(15px, 30px);\n transform: translate(15px, 30px); }\n 100% {\n -webkit-transform: translate(0, 0);\n transform: translate(0, 0); } }\n\n@keyframes ball-zag-deflect {\n 17% {\n -webkit-transform: translate(15px, 30px);\n transform: translate(15px, 30px); }\n 34% {\n -webkit-transform: translate(-15px, 30px);\n transform: translate(-15px, 30px); }\n 50% {\n -webkit-transform: translate(0, 0);\n transform: translate(0, 0); }\n 67% {\n -webkit-transform: translate(-15px, 30px);\n transform: translate(-15px, 30px); }\n 84% {\n -webkit-transform: translate(15px, 30px);\n transform: translate(15px, 30px); }\n 100% {\n -webkit-transform: translate(0, 0);\n transform: translate(0, 0); } }\n\n.ball-zig-zag-deflect {\n position: relative;\n -webkit-transform: translate(-15px, -15px);\n -ms-transform: translate(-15px, -15px);\n transform: translate(-15px, -15px); }\n .ball-zig-zag-deflect > div {\n background-color: #fff;\n width: 15px;\n height: 15px;\n border-radius: 100%;\n margin: 2px;\n -webkit-animation-fill-mode: both;\n animation-fill-mode: both;\n position: absolute;\n margin-left: 15px;\n top: 4px;\n left: -7px; }\n .ball-zig-zag-deflect > div:first-child {\n -webkit-animation: ball-zig-deflect 1.5s 0s infinite linear;\n animation: ball-zig-deflect 1.5s 0s infinite linear; }\n .ball-zig-zag-deflect > div:last-child {\n -webkit-animation: ball-zag-deflect 1.5s 0s infinite linear;\n animation: ball-zag-deflect 1.5s 0s infinite linear; }\n\n/**\n * Lines\n */\n@-webkit-keyframes line-scale {\n 0% {\n -webkit-transform: scaley(1);\n transform: scaley(1); }\n 50% {\n -webkit-transform: scaley(0.4);\n transform: scaley(0.4); }\n 100% {\n -webkit-transform: scaley(1);\n transform: scaley(1); } }\n@keyframes line-scale {\n 0% {\n -webkit-transform: scaley(1);\n transform: scaley(1); }\n 50% {\n -webkit-transform: scaley(0.4);\n transform: scaley(0.4); }\n 100% {\n -webkit-transform: scaley(1);\n transform: scaley(1); } }\n\n.line-scale > div:nth-child(1) {\n -webkit-animation: line-scale 1s -0.4s infinite cubic-bezier(0.2, 0.68, 0.18, 1.08);\n animation: line-scale 1s -0.4s infinite cubic-bezier(0.2, 0.68, 0.18, 1.08); }\n\n.line-scale > div:nth-child(2) {\n -webkit-animation: line-scale 1s -0.3s infinite cubic-bezier(0.2, 0.68, 0.18, 1.08);\n animation: line-scale 1s -0.3s infinite cubic-bezier(0.2, 0.68, 0.18, 1.08); }\n\n.line-scale > div:nth-child(3) {\n -webkit-animation: line-scale 1s -0.2s infinite cubic-bezier(0.2, 0.68, 0.18, 1.08);\n animation: line-scale 1s -0.2s infinite cubic-bezier(0.2, 0.68, 0.18, 1.08); }\n\n.line-scale > div:nth-child(4) {\n -webkit-animation: line-scale 1s -0.1s infinite cubic-bezier(0.2, 0.68, 0.18, 1.08);\n animation: line-scale 1s -0.1s infinite cubic-bezier(0.2, 0.68, 0.18, 1.08); }\n\n.line-scale > div:nth-child(5) {\n -webkit-animation: line-scale 1s 0s infinite cubic-bezier(0.2, 0.68, 0.18, 1.08);\n animation: line-scale 1s 0s infinite cubic-bezier(0.2, 0.68, 0.18, 1.08); }\n\n.line-scale > div {\n background-color: #fff;\n width: 4px;\n height: 35px;\n border-radius: 2px;\n margin: 2px;\n -webkit-animation-fill-mode: both;\n animation-fill-mode: both;\n display: inline-block; }\n\n@-webkit-keyframes line-scale-party {\n 0% {\n -webkit-transform: scale(1);\n transform: scale(1); }\n 50% {\n -webkit-transform: scale(0.5);\n transform: scale(0.5); }\n 100% {\n -webkit-transform: scale(1);\n transform: scale(1); } }\n\n@keyframes line-scale-party {\n 0% {\n -webkit-transform: scale(1);\n transform: scale(1); }\n 50% {\n -webkit-transform: scale(0.5);\n transform: scale(0.5); }\n 100% {\n -webkit-transform: scale(1);\n transform: scale(1); } }\n\n.line-scale-party > div:nth-child(1) {\n -webkit-animation-delay: -0.09s;\n animation-delay: -0.09s;\n -webkit-animation-duration: 0.83s;\n animation-duration: 0.83s; }\n\n.line-scale-party > div:nth-child(2) {\n -webkit-animation-delay: 0.33s;\n animation-delay: 0.33s;\n -webkit-animation-duration: 0.64s;\n animation-duration: 0.64s; }\n\n.line-scale-party > div:nth-child(3) {\n -webkit-animation-delay: 0.32s;\n animation-delay: 0.32s;\n -webkit-animation-duration: 0.39s;\n animation-duration: 0.39s; }\n\n.line-scale-party > div:nth-child(4) {\n -webkit-animation-delay: 0.47s;\n animation-delay: 0.47s;\n -webkit-animation-duration: 0.52s;\n animation-duration: 0.52s; }\n\n.line-scale-party > div {\n background-color: #fff;\n width: 4px;\n height: 35px;\n border-radius: 2px;\n margin: 2px;\n -webkit-animation-fill-mode: both;\n animation-fill-mode: both;\n display: inline-block;\n -webkit-animation-name: line-scale-party;\n animation-name: line-scale-party;\n -webkit-animation-iteration-count: infinite;\n animation-iteration-count: infinite;\n -webkit-animation-delay: 0;\n animation-delay: 0; }\n\n@-webkit-keyframes line-scale-pulse-out {\n 0% {\n -webkit-transform: scaley(1);\n transform: scaley(1); }\n 50% {\n -webkit-transform: scaley(0.4);\n transform: scaley(0.4); }\n 100% {\n -webkit-transform: scaley(1);\n transform: scaley(1); } }\n\n@keyframes line-scale-pulse-out {\n 0% {\n -webkit-transform: scaley(1);\n transform: scaley(1); }\n 50% {\n -webkit-transform: scaley(0.4);\n transform: scaley(0.4); }\n 100% {\n -webkit-transform: scaley(1);\n transform: scaley(1); } }\n\n.line-scale-pulse-out > div {\n background-color: #fff;\n width: 4px;\n height: 35px;\n border-radius: 2px;\n margin: 2px;\n -webkit-animation-fill-mode: both;\n animation-fill-mode: both;\n display: inline-block;\n -webkit-animation: line-scale-pulse-out 0.9s -0.6s infinite cubic-bezier(0.85, 0.25, 0.37, 0.85);\n animation: line-scale-pulse-out 0.9s -0.6s infinite cubic-bezier(0.85, 0.25, 0.37, 0.85); }\n .line-scale-pulse-out > div:nth-child(2), .line-scale-pulse-out > div:nth-child(4) {\n -webkit-animation-delay: -0.4s !important;\n animation-delay: -0.4s !important; }\n .line-scale-pulse-out > div:nth-child(1), .line-scale-pulse-out > div:nth-child(5) {\n -webkit-animation-delay: -0.2s !important;\n animation-delay: -0.2s !important; }\n\n@-webkit-keyframes line-scale-pulse-out-rapid {\n 0% {\n -webkit-transform: scaley(1);\n transform: scaley(1); }\n 80% {\n -webkit-transform: scaley(0.3);\n transform: scaley(0.3); }\n 90% {\n -webkit-transform: scaley(1);\n transform: scaley(1); } }\n\n@keyframes line-scale-pulse-out-rapid {\n 0% {\n -webkit-transform: scaley(1);\n transform: scaley(1); }\n 80% {\n -webkit-transform: scaley(0.3);\n transform: scaley(0.3); }\n 90% {\n -webkit-transform: scaley(1);\n transform: scaley(1); } }\n\n.line-scale-pulse-out-rapid > div {\n background-color: #fff;\n width: 4px;\n height: 35px;\n border-radius: 2px;\n margin: 2px;\n -webkit-animation-fill-mode: both;\n animation-fill-mode: both;\n display: inline-block;\n -webkit-animation: line-scale-pulse-out-rapid 0.9s -0.5s infinite cubic-bezier(0.11, 0.49, 0.38, 0.78);\n animation: line-scale-pulse-out-rapid 0.9s -0.5s infinite cubic-bezier(0.11, 0.49, 0.38, 0.78); }\n .line-scale-pulse-out-rapid > div:nth-child(2), .line-scale-pulse-out-rapid > div:nth-child(4) {\n -webkit-animation-delay: -0.25s !important;\n animation-delay: -0.25s !important; }\n .line-scale-pulse-out-rapid > div:nth-child(1), .line-scale-pulse-out-rapid > div:nth-child(5) {\n -webkit-animation-delay: 0s !important;\n animation-delay: 0s !important; }\n\n@-webkit-keyframes line-spin-fade-loader {\n 50% {\n opacity: 0.3; }\n 100% {\n opacity: 1; } }\n\n@keyframes line-spin-fade-loader {\n 50% {\n opacity: 0.3; }\n 100% {\n opacity: 1; } }\n\n.line-spin-fade-loader {\n position: relative;\n top: -10px;\n left: -4px; }\n .line-spin-fade-loader > div:nth-child(1) {\n top: 20px;\n left: 0;\n -webkit-animation: line-spin-fade-loader 1.2s -0.84s infinite ease-in-out;\n animation: line-spin-fade-loader 1.2s -0.84s infinite ease-in-out; }\n .line-spin-fade-loader > div:nth-child(2) {\n top: 13.63636px;\n left: 13.63636px;\n -webkit-transform: rotate(-45deg);\n -ms-transform: rotate(-45deg);\n transform: rotate(-45deg);\n -webkit-animation: line-spin-fade-loader 1.2s -0.72s infinite ease-in-out;\n animation: line-spin-fade-loader 1.2s -0.72s infinite ease-in-out; }\n .line-spin-fade-loader > div:nth-child(3) {\n top: 0;\n left: 20px;\n -webkit-transform: rotate(90deg);\n -ms-transform: rotate(90deg);\n transform: rotate(90deg);\n -webkit-animation: line-spin-fade-loader 1.2s -0.6s infinite ease-in-out;\n animation: line-spin-fade-loader 1.2s -0.6s infinite ease-in-out; }\n .line-spin-fade-loader > div:nth-child(4) {\n top: -13.63636px;\n left: 13.63636px;\n -webkit-transform: rotate(45deg);\n -ms-transform: rotate(45deg);\n transform: rotate(45deg);\n -webkit-animation: line-spin-fade-loader 1.2s -0.48s infinite ease-in-out;\n animation: line-spin-fade-loader 1.2s -0.48s infinite ease-in-out; }\n .line-spin-fade-loader > div:nth-child(5) {\n top: -20px;\n left: 0;\n -webkit-animation: line-spin-fade-loader 1.2s -0.36s infinite ease-in-out;\n animation: line-spin-fade-loader 1.2s -0.36s infinite ease-in-out; }\n .line-spin-fade-loader > div:nth-child(6) {\n top: -13.63636px;\n left: -13.63636px;\n -webkit-transform: rotate(-45deg);\n -ms-transform: rotate(-45deg);\n transform: rotate(-45deg);\n -webkit-animation: line-spin-fade-loader 1.2s -0.24s infinite ease-in-out;\n animation: line-spin-fade-loader 1.2s -0.24s infinite ease-in-out; }\n .line-spin-fade-loader > div:nth-child(7) {\n top: 0;\n left: -20px;\n -webkit-transform: rotate(90deg);\n -ms-transform: rotate(90deg);\n transform: rotate(90deg);\n -webkit-animation: line-spin-fade-loader 1.2s -0.12s infinite ease-in-out;\n animation: line-spin-fade-loader 1.2s -0.12s infinite ease-in-out; }\n .line-spin-fade-loader > div:nth-child(8) {\n top: 13.63636px;\n left: -13.63636px;\n -webkit-transform: rotate(45deg);\n -ms-transform: rotate(45deg);\n transform: rotate(45deg);\n -webkit-animation: line-spin-fade-loader 1.2s 0s infinite ease-in-out;\n animation: line-spin-fade-loader 1.2s 0s infinite ease-in-out; }\n .line-spin-fade-loader > div {\n background-color: #fff;\n width: 4px;\n height: 35px;\n border-radius: 2px;\n margin: 2px;\n -webkit-animation-fill-mode: both;\n animation-fill-mode: both;\n position: absolute;\n width: 5px;\n height: 15px; }\n\n/**\n * Misc\n */\n@-webkit-keyframes triangle-skew-spin {\n 25% {\n -webkit-transform: perspective(100px) rotateX(180deg) rotateY(0);\n transform: perspective(100px) rotateX(180deg) rotateY(0); }\n 50% {\n -webkit-transform: perspective(100px) rotateX(180deg) rotateY(180deg);\n transform: perspective(100px) rotateX(180deg) rotateY(180deg); }\n 75% {\n -webkit-transform: perspective(100px) rotateX(0) rotateY(180deg);\n transform: perspective(100px) rotateX(0) rotateY(180deg); }\n 100% {\n -webkit-transform: perspective(100px) rotateX(0) rotateY(0);\n transform: perspective(100px) rotateX(0) rotateY(0); } }\n@keyframes triangle-skew-spin {\n 25% {\n -webkit-transform: perspective(100px) rotateX(180deg) rotateY(0);\n transform: perspective(100px) rotateX(180deg) rotateY(0); }\n 50% {\n -webkit-transform: perspective(100px) rotateX(180deg) rotateY(180deg);\n transform: perspective(100px) rotateX(180deg) rotateY(180deg); }\n 75% {\n -webkit-transform: perspective(100px) rotateX(0) rotateY(180deg);\n transform: perspective(100px) rotateX(0) rotateY(180deg); }\n 100% {\n -webkit-transform: perspective(100px) rotateX(0) rotateY(0);\n transform: perspective(100px) rotateX(0) rotateY(0); } }\n\n.triangle-skew-spin > div {\n -webkit-animation-fill-mode: both;\n animation-fill-mode: both;\n width: 0;\n height: 0;\n border-left: 20px solid transparent;\n border-right: 20px solid transparent;\n border-bottom: 20px solid #fff;\n -webkit-animation: triangle-skew-spin 3s 0s cubic-bezier(0.09, 0.57, 0.49, 0.9) infinite;\n animation: triangle-skew-spin 3s 0s cubic-bezier(0.09, 0.57, 0.49, 0.9) infinite; }\n\n@-webkit-keyframes square-spin {\n 25% {\n -webkit-transform: perspective(100px) rotateX(180deg) rotateY(0);\n transform: perspective(100px) rotateX(180deg) rotateY(0); }\n 50% {\n -webkit-transform: perspective(100px) rotateX(180deg) rotateY(180deg);\n transform: perspective(100px) rotateX(180deg) rotateY(180deg); }\n 75% {\n -webkit-transform: perspective(100px) rotateX(0) rotateY(180deg);\n transform: perspective(100px) rotateX(0) rotateY(180deg); }\n 100% {\n -webkit-transform: perspective(100px) rotateX(0) rotateY(0);\n transform: perspective(100px) rotateX(0) rotateY(0); } }\n\n@keyframes square-spin {\n 25% {\n -webkit-transform: perspective(100px) rotateX(180deg) rotateY(0);\n transform: perspective(100px) rotateX(180deg) rotateY(0); }\n 50% {\n -webkit-transform: perspective(100px) rotateX(180deg) rotateY(180deg);\n transform: perspective(100px) rotateX(180deg) rotateY(180deg); }\n 75% {\n -webkit-transform: perspective(100px) rotateX(0) rotateY(180deg);\n transform: perspective(100px) rotateX(0) rotateY(180deg); }\n 100% {\n -webkit-transform: perspective(100px) rotateX(0) rotateY(0);\n transform: perspective(100px) rotateX(0) rotateY(0); } }\n\n.square-spin > div {\n -webkit-animation-fill-mode: both;\n animation-fill-mode: both;\n width: 50px;\n height: 50px;\n background: #fff;\n border: 1px solid red;\n -webkit-animation: square-spin 3s 0s cubic-bezier(0.09, 0.57, 0.49, 0.9) infinite;\n animation: square-spin 3s 0s cubic-bezier(0.09, 0.57, 0.49, 0.9) infinite; }\n\n@-webkit-keyframes rotate_pacman_half_up {\n 0% {\n -webkit-transform: rotate(270deg);\n transform: rotate(270deg); }\n 50% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg); }\n 100% {\n -webkit-transform: rotate(270deg);\n transform: rotate(270deg); } }\n\n@keyframes rotate_pacman_half_up {\n 0% {\n -webkit-transform: rotate(270deg);\n transform: rotate(270deg); }\n 50% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg); }\n 100% {\n -webkit-transform: rotate(270deg);\n transform: rotate(270deg); } }\n\n@-webkit-keyframes rotate_pacman_half_down {\n 0% {\n -webkit-transform: rotate(90deg);\n transform: rotate(90deg); }\n 50% {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg); }\n 100% {\n -webkit-transform: rotate(90deg);\n transform: rotate(90deg); } }\n\n@keyframes rotate_pacman_half_down {\n 0% {\n -webkit-transform: rotate(90deg);\n transform: rotate(90deg); }\n 50% {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg); }\n 100% {\n -webkit-transform: rotate(90deg);\n transform: rotate(90deg); } }\n\n@-webkit-keyframes pacman-balls {\n 75% {\n opacity: 0.7; }\n 100% {\n -webkit-transform: translate(-100px, -6.25px);\n transform: translate(-100px, -6.25px); } }\n\n@keyframes pacman-balls {\n 75% {\n opacity: 0.7; }\n 100% {\n -webkit-transform: translate(-100px, -6.25px);\n transform: translate(-100px, -6.25px); } }\n\n.pacman {\n position: relative; }\n .pacman > div:nth-child(2) {\n -webkit-animation: pacman-balls 1s -0.99s infinite linear;\n animation: pacman-balls 1s -0.99s infinite linear; }\n .pacman > div:nth-child(3) {\n -webkit-animation: pacman-balls 1s -0.66s infinite linear;\n animation: pacman-balls 1s -0.66s infinite linear; }\n .pacman > div:nth-child(4) {\n -webkit-animation: pacman-balls 1s -0.33s infinite linear;\n animation: pacman-balls 1s -0.33s infinite linear; }\n .pacman > div:nth-child(5) {\n -webkit-animation: pacman-balls 1s 0s infinite linear;\n animation: pacman-balls 1s 0s infinite linear; }\n .pacman > div:first-of-type {\n width: 0px;\n height: 0px;\n border-right: 25px solid transparent;\n border-top: 25px solid #fff;\n border-left: 25px solid #fff;\n border-bottom: 25px solid #fff;\n border-radius: 25px;\n -webkit-animation: rotate_pacman_half_up 0.5s 0s infinite;\n animation: rotate_pacman_half_up 0.5s 0s infinite;\n position: relative;\n left: -30px; }\n .pacman > div:nth-child(2) {\n width: 0px;\n height: 0px;\n border-right: 25px solid transparent;\n border-top: 25px solid #fff;\n border-left: 25px solid #fff;\n border-bottom: 25px solid #fff;\n border-radius: 25px;\n -webkit-animation: rotate_pacman_half_down 0.5s 0s infinite;\n animation: rotate_pacman_half_down 0.5s 0s infinite;\n margin-top: -50px;\n position: relative;\n left: -30px; }\n .pacman > div:nth-child(3),\n .pacman > div:nth-child(4),\n .pacman > div:nth-child(5),\n .pacman > div:nth-child(6) {\n background-color: #fff;\n width: 15px;\n height: 15px;\n border-radius: 100%;\n margin: 2px;\n width: 10px;\n height: 10px;\n position: absolute;\n -webkit-transform: translate(0, -6.25px);\n -ms-transform: translate(0, -6.25px);\n transform: translate(0, -6.25px);\n top: 25px;\n left: 70px; }\n\n@-webkit-keyframes cube-transition {\n 25% {\n -webkit-transform: translateX(50px) scale(0.5) rotate(-90deg);\n transform: translateX(50px) scale(0.5) rotate(-90deg); }\n 50% {\n -webkit-transform: translate(50px, 50px) rotate(-180deg);\n transform: translate(50px, 50px) rotate(-180deg); }\n 75% {\n -webkit-transform: translateY(50px) scale(0.5) rotate(-270deg);\n transform: translateY(50px) scale(0.5) rotate(-270deg); }\n 100% {\n -webkit-transform: rotate(-360deg);\n transform: rotate(-360deg); } }\n\n@keyframes cube-transition {\n 25% {\n -webkit-transform: translateX(50px) scale(0.5) rotate(-90deg);\n transform: translateX(50px) scale(0.5) rotate(-90deg); }\n 50% {\n -webkit-transform: translate(50px, 50px) rotate(-180deg);\n transform: translate(50px, 50px) rotate(-180deg); }\n 75% {\n -webkit-transform: translateY(50px) scale(0.5) rotate(-270deg);\n transform: translateY(50px) scale(0.5) rotate(-270deg); }\n 100% {\n -webkit-transform: rotate(-360deg);\n transform: rotate(-360deg); } }\n\n.cube-transition {\n position: relative;\n -webkit-transform: translate(-25px, -25px);\n -ms-transform: translate(-25px, -25px);\n transform: translate(-25px, -25px); }\n .cube-transition > div {\n -webkit-animation-fill-mode: both;\n animation-fill-mode: both;\n width: 10px;\n height: 10px;\n position: absolute;\n top: -5px;\n left: -5px;\n background-color: #fff;\n -webkit-animation: cube-transition 1.6s 0s infinite ease-in-out;\n animation: cube-transition 1.6s 0s infinite ease-in-out; }\n .cube-transition > div:last-child {\n -webkit-animation-delay: -0.8s;\n animation-delay: -0.8s; }\n\n@-webkit-keyframes spin-rotate {\n 0% {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg); }\n 50% {\n -webkit-transform: rotate(180deg);\n transform: rotate(180deg); }\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg); } }\n\n@keyframes spin-rotate {\n 0% {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg); }\n 50% {\n -webkit-transform: rotate(180deg);\n transform: rotate(180deg); }\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg); } }\n\n.semi-circle-spin {\n position: relative;\n width: 35px;\n height: 35px;\n overflow: hidden; }\n .semi-circle-spin > div {\n position: absolute;\n border-width: 0px;\n border-radius: 100%;\n -webkit-animation: spin-rotate 0.6s 0s infinite linear;\n animation: spin-rotate 0.6s 0s infinite linear;\n background-image: -webkit-linear-gradient(transparent 0%, transparent 70%, #fff 30%, #fff 100%);\n background-image: linear-gradient(transparent 0%, transparent 70%, #fff 30%, #fff 100%);\n width: 100%;\n height: 100%; }\n\n@-webkit-keyframes bar-progress {\n 0% {\n -webkit-transform: scaleY(20%);\n transform: scaleY(20%);\n opacity: 1; }\n 25% {\n -webkit-transform: translateX(6%) scaleY(10%);\n transform: translateX(6%) scaleY(10%);\n opacity: 0.7; }\n 50% {\n -webkit-transform: translateX(20%) scaleY(20%);\n transform: translateX(20%) scaleY(20%);\n opacity: 1; }\n 75% {\n -webkit-transform: translateX(6%) scaleY(10%);\n transform: translateX(6%) scaleY(10%);\n opacity: 0.7; }\n 100% {\n -webkit-transform: scaleY(20%);\n transform: scaleY(20%);\n opacity: 1; } }\n\n@keyframes bar-progress {\n 0% {\n -webkit-transform: scaleY(20%);\n transform: scaleY(20%);\n opacity: 1; }\n 25% {\n -webkit-transform: translateX(6%) scaleY(10%);\n transform: translateX(6%) scaleY(10%);\n opacity: 0.7; }\n 50% {\n -webkit-transform: translateX(20%) scaleY(20%);\n transform: translateX(20%) scaleY(20%);\n opacity: 1; }\n 75% {\n -webkit-transform: translateX(6%) scaleY(10%);\n transform: translateX(6%) scaleY(10%);\n opacity: 0.7; }\n 100% {\n -webkit-transform: scaleY(20%);\n transform: scaleY(20%);\n opacity: 1; } }\n\n.bar-progress {\n width: 30%;\n height: 12px; }\n .bar-progress > div {\n position: relative;\n width: 20%;\n height: 12px;\n border-radius: 10px;\n background-color: #fff;\n -webkit-animation: bar-progress 3s cubic-bezier(0.57, 0.1, 0.44, 0.93) infinite;\n animation: bar-progress 3s cubic-bezier(0.57, 0.1, 0.44, 0.93) infinite;\n opacity: 1; }\n\n@-webkit-keyframes bar-swing {\n 0% {\n left: 0; }\n 50% {\n left: 70%; }\n 100% {\n left: 0; } }\n\n@keyframes bar-swing {\n 0% {\n left: 0; }\n 50% {\n left: 70%; }\n 100% {\n left: 0; } }\n\n.bar-swing {\n width: 30%;\n height: 8px; }\n .bar-swing > div {\n position: relative;\n width: 30%;\n height: 8px;\n border-radius: 10px;\n background-color: #fff;\n -webkit-animation: bar-swing 1.5s infinite;\n animation: bar-swing 1.5s infinite; }\n\n@-webkit-keyframes bar-swing-container {\n 0% {\n left: 0;\n -webkit-transform: translateX(0);\n transform: translateX(0); }\n 50% {\n left: 70%;\n -webkit-transform: translateX(-4px);\n transform: translateX(-4px); }\n 100% {\n left: 0;\n -webkit-transform: translateX(0);\n transform: translateX(0); } }\n\n@keyframes bar-swing-container {\n 0% {\n left: 0;\n -webkit-transform: translateX(0);\n transform: translateX(0); }\n 50% {\n left: 70%;\n -webkit-transform: translateX(-4px);\n transform: translateX(-4px); }\n 100% {\n left: 0;\n -webkit-transform: translateX(0);\n transform: translateX(0); } }\n\n.bar-swing-container {\n width: 20%;\n height: 8px;\n position: relative; }\n .bar-swing-container div:nth-child(1) {\n position: absolute;\n width: 100%;\n background-color: rgba(255, 255, 255, 0.2);\n height: 12px;\n border-radius: 10px; }\n .bar-swing-container div:nth-child(2) {\n position: absolute;\n width: 30%;\n height: 8px;\n border-radius: 10px;\n background-color: #fff;\n -webkit-animation: bar-swing-container 2s cubic-bezier(0.91, 0.35, 0.12, 0.6) infinite;\n animation: bar-swing-container 2s cubic-bezier(0.91, 0.35, 0.12, 0.6) infinite;\n margin: 2px 2px 0; }\n", ""]); // Exports module.exports = exports; /***/ }), /***/ "./node_modules/css-loader/dist/cjs.js!./node_modules/react-spinkit/css/base.css": /***/ (function(module, exports, __webpack_require__) { // Imports var ___CSS_LOADER_API_IMPORT___ = __webpack_require__("./node_modules/css-loader/dist/runtime/api.js"); exports = ___CSS_LOADER_API_IMPORT___(false); // Module exports.push([module.i, ".sk-spinner {\n color: #333;\n}\n\n.sk-spinner > div {\n background-color: currentColor;\n}\n", ""]); // Exports module.exports = exports; /***/ }), /***/ "./node_modules/css-loader/dist/cjs.js!./node_modules/react-spinkit/css/chasing-dots.css": /***/ (function(module, exports, __webpack_require__) { // Imports var ___CSS_LOADER_API_IMPORT___ = __webpack_require__("./node_modules/css-loader/dist/runtime/api.js"); exports = ___CSS_LOADER_API_IMPORT___(false); // Module exports.push([module.i, ".sk-chasing-dots {\n width: 27px;\n height: 27px;\n position: relative;\n\n -webkit-animation: sk-rotate 2.0s infinite linear;\n animation: sk-rotate 2.0s infinite linear;\n}\n\n.sk-chasing-dots > div {\n width: 60%;\n height: 60%;\n display: inline-block;\n position: absolute;\n top: 0;\n background-color: currentColor;\n border-radius: 100%;\n\n -webkit-animation: sk-bounce 2.0s infinite ease-in-out;\n animation: sk-bounce 2.0s infinite ease-in-out;\n}\n\n.sk-chasing-dots > div:last-child {\n top: auto;\n bottom: 0;\n\n -webkit-animation-delay: -1.0s;\n animation-delay: -1.0s;\n}\n\n@-webkit-keyframes sk-rotate { 100% { -webkit-transform: rotate(360deg) }}\n@keyframes sk-rotate {\n 100% {\n transform: rotate(360deg);\n -webkit-transform: rotate(360deg);\n }\n}\n\n@-webkit-keyframes sk-bounce {\n 0%, 100% { -webkit-transform: scale(0.0) }\n 50% { -webkit-transform: scale(1.0) }\n}\n\n@keyframes sk-bounce {\n 0%, 100% {\n transform: scale(0.0);\n -webkit-transform: scale(0.0);\n } 50% {\n transform: scale(1.0);\n -webkit-transform: scale(1.0);\n }\n}\n", ""]); // Exports module.exports = exports; /***/ }), /***/ "./node_modules/css-loader/dist/cjs.js!./node_modules/react-spinkit/css/circle.css": /***/ (function(module, exports, __webpack_require__) { // Imports var ___CSS_LOADER_API_IMPORT___ = __webpack_require__("./node_modules/css-loader/dist/runtime/api.js"); exports = ___CSS_LOADER_API_IMPORT___(false); // Module exports.push([module.i, ".sk-circle {\n width: 22px;\n height: 22px;\n position: relative;\n}\n\n.sk-circle > div {\n background-color: initial;\n width: 100%;\n height: 100%;\n position: absolute;\n left: 0;\n top: 0;\n}\n\n.sk-circle > div::before {\n content: '';\n display: block;\n margin: 0 auto;\n width: 20%;\n height: 20%;\n background-color: currentColor;\n border-radius: 100%;\n\n -webkit-animation: sk-bouncedelay 1.2s infinite ease-in-out;\n animation: sk-bouncedelay 1.2s infinite ease-in-out;\n /* Prevent first frame from flickering when animation starts */\n -webkit-animation-fill-mode: both;\n animation-fill-mode: both;\n}\n\n.sk-circle > div:nth-child(2) { -webkit-transform: rotate(30deg); transform: rotate(30deg) }\n.sk-circle > div:nth-child(3) { -webkit-transform: rotate(60deg); transform: rotate(60deg) }\n.sk-circle > div:nth-child(4) { -webkit-transform: rotate(90deg); transform: rotate(90deg) }\n.sk-circle > div:nth-child(5) { -webkit-transform: rotate(120deg); transform: rotate(120deg) }\n.sk-circle > div:nth-child(6) { -webkit-transform: rotate(150deg); transform: rotate(150deg) }\n.sk-circle > div:nth-child(7) { -webkit-transform: rotate(180deg); transform: rotate(180deg) }\n.sk-circle > div:nth-child(8) { -webkit-transform: rotate(210deg); transform: rotate(210deg) }\n.sk-circle > div:nth-child(9) { -webkit-transform: rotate(240deg); transform: rotate(240deg) }\n.sk-circle > div:nth-child(10) { -webkit-transform: rotate(270deg); transform: rotate(270deg) }\n.sk-circle > div:nth-child(11) { -webkit-transform: rotate(300deg); transform: rotate(300deg) }\n.sk-circle > div:nth-child(12) { -webkit-transform: rotate(330deg); transform: rotate(330deg) }\n\n.sk-circle > div:nth-child(2)::before { -webkit-animation-delay: -1.1s; animation-delay: -1.1s }\n.sk-circle > div:nth-child(3)::before { -webkit-animation-delay: -1.0s; animation-delay: -1.0s }\n.sk-circle > div:nth-child(4)::before { -webkit-animation-delay: -0.9s; animation-delay: -0.9s }\n.sk-circle > div:nth-child(5)::before { -webkit-animation-delay: -0.8s; animation-delay: -0.8s }\n.sk-circle > div:nth-child(6)::before { -webkit-animation-delay: -0.7s; animation-delay: -0.7s }\n.sk-circle > div:nth-child(7)::before { -webkit-animation-delay: -0.6s; animation-delay: -0.6s }\n.sk-circle > div:nth-child(8)::before { -webkit-animation-delay: -0.5s; animation-delay: -0.5s }\n.sk-circle > div:nth-child(9)::before { -webkit-animation-delay: -0.4s; animation-delay: -0.4s }\n.sk-circle > div:nth-child(10)::before { -webkit-animation-delay: -0.3s; animation-delay: -0.3s }\n.sk-circle > div:nth-child(11)::before { -webkit-animation-delay: -0.2s; animation-delay: -0.2s }\n.sk-circle > div:nth-child(12)::before { -webkit-animation-delay: -0.1s; animation-delay: -0.1s }\n\n@-webkit-keyframes sk-bouncedelay {\n 0%, 80%, 100% { -webkit-transform: scale(0.0) }\n 40% { -webkit-transform: scale(1.0) }\n}\n\n@keyframes sk-bouncedelay {\n 0%, 80%, 100% {\n -webkit-transform: scale(0.0);\n transform: scale(0.0);\n } 40% {\n -webkit-transform: scale(1.0);\n transform: scale(1.0);\n }\n}\n", ""]); // Exports module.exports = exports; /***/ }), /***/ "./node_modules/css-loader/dist/cjs.js!./node_modules/react-spinkit/css/cube-grid.css": /***/ (function(module, exports, __webpack_require__) { // Imports var ___CSS_LOADER_API_IMPORT___ = __webpack_require__("./node_modules/css-loader/dist/runtime/api.js"); exports = ___CSS_LOADER_API_IMPORT___(false); // Module exports.push([module.i, ".sk-cube-grid {\n width: 27px;\n height: 27px;\n}\n\n.sk-cube-grid > div {\n width: 33%;\n height: 33%;\n background-color: currentColor;\n float: left;\n\n -webkit-animation: sk-scaleDelay 1.3s infinite ease-in-out;\n animation: sk-scaleDelay 1.3s infinite ease-in-out;\n}\n\n/*\n * Spinner positions\n * 1 2 3\n * 4 5 6\n * 7 8 9\n */\n\n.sk-cube-grid > div:nth-child(1) { -webkit-animation-delay: 0.2s; animation-delay: 0.2s }\n.sk-cube-grid > div:nth-child(2) { -webkit-animation-delay: 0.3s; animation-delay: 0.3s }\n.sk-cube-grid > div:nth-child(3) { -webkit-animation-delay: 0.4s; animation-delay: 0.4s }\n.sk-cube-grid > div:nth-child(4) { -webkit-animation-delay: 0.1s; animation-delay: 0.1s }\n.sk-cube-grid > div:nth-child(5) { -webkit-animation-delay: 0.2s; animation-delay: 0.2s }\n.sk-cube-grid > div:nth-child(6) { -webkit-animation-delay: 0.3s; animation-delay: 0.3s }\n.sk-cube-grid > div:nth-child(7) { -webkit-animation-delay: 0.0s; animation-delay: 0.0s }\n.sk-cube-grid > div:nth-child(8) { -webkit-animation-delay: 0.1s; animation-delay: 0.1s }\n.sk-cube-grid > div:nth-child(9) { -webkit-animation-delay: 0.2s; animation-delay: 0.2s }\n\n@-webkit-keyframes sk-scaleDelay {\n 0%, 70%, 100% { -webkit-transform:scale3D(1.0, 1.0, 1.0) }\n 35% { -webkit-transform:scale3D(0.0, 0.0, 1.0) }\n}\n\n@keyframes sk-scaleDelay {\n 0%, 70%, 100% { -webkit-transform:scale3D(1.0, 1.0, 1.0); transform:scale3D(1.0, 1.0, 1.0) }\n 35% { -webkit-transform:scale3D(1.0, 1.0, 1.0); transform:scale3D(0.0, 0.0, 1.0) }\n}\n", ""]); // Exports module.exports = exports; /***/ }), /***/ "./node_modules/css-loader/dist/cjs.js!./node_modules/react-spinkit/css/double-bounce.css": /***/ (function(module, exports, __webpack_require__) { // Imports var ___CSS_LOADER_API_IMPORT___ = __webpack_require__("./node_modules/css-loader/dist/runtime/api.js"); exports = ___CSS_LOADER_API_IMPORT___(false); // Module exports.push([module.i, ".sk-double-bounce {\n width: 27px;\n height: 27px;\n position: relative;\n}\n\n.sk-double-bounce > div {\n width: 100%;\n height: 100%;\n border-radius: 50%;\n background-color: currentColor;\n opacity: 0.6;\n position: absolute;\n top: 0;\n left: 0;\n\n -webkit-animation: sk-bounce 2.0s infinite ease-in-out;\n animation: sk-bounce 2.0s infinite ease-in-out;\n}\n\n.sk-double-bounce > div:last-child {\n -webkit-animation-delay: -1.0s;\n animation-delay: -1.0s;\n}\n\n@-webkit-keyframes sk-bounce {\n 0%, 100% { -webkit-transform: scale(0.0) }\n 50% { -webkit-transform: scale(1.0) }\n}\n\n@keyframes sk-bounce {\n 0%, 100% {\n transform: scale(0.0);\n -webkit-transform: scale(0.0);\n } 50% {\n transform: scale(1.0);\n -webkit-transform: scale(1.0);\n }\n}\n", ""]); // Exports module.exports = exports; /***/ }), /***/ "./node_modules/css-loader/dist/cjs.js!./node_modules/react-spinkit/css/fade-in.css": /***/ (function(module, exports, __webpack_require__) { // Imports var ___CSS_LOADER_API_IMPORT___ = __webpack_require__("./node_modules/css-loader/dist/runtime/api.js"); exports = ___CSS_LOADER_API_IMPORT___(false); // Module exports.push([module.i, "@-webkit-keyframes sk-fade-in {\n 0% {\n opacity: 0;\n }\n 50% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n}\n\n@-moz-keyframes sk-fade-in {\n 0% {\n opacity: 0;\n }\n 50% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n}\n\n@-ms-keyframes sk-fade-in {\n 0% {\n opacity: 0;\n }\n 50% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n}\n\n@keyframes sk-fade-in {\n 0% {\n opacity: 0;\n }\n 50% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n}\n\n.sk-fade-in {\n -webkit-animation: sk-fade-in 2s;\n -moz-animation: sk-fade-in 2s;\n -o-animation: sk-fade-in 2s;\n -ms-animation: sk-fade-in 2s;\n animation: sk-fade-in 2s;\n}\n\n.sk-fade-in-half-second {\n -webkit-animation: sk-fade-in 1s;\n -moz-animation: sk-fade-in 1s;\n -o-animation: sk-fade-in 1s;\n -ms-animation: sk-fade-in 1s;\n animation: sk-fade-in 1s;\n}\n\n.sk-fade-in-quarter-second {\n -webkit-animation: sk-fade-in 0.5s;\n -moz-animation: sk-fade-in 0.5s;\n -o-animation: sk-fade-in 0.5s;\n -ms-animation: sk-fade-in 0.5s;\n animation: sk-fade-in 0.5s;\n}\n", ""]); // Exports module.exports = exports; /***/ }), /***/ "./node_modules/css-loader/dist/cjs.js!./node_modules/react-spinkit/css/folding-cube.css": /***/ (function(module, exports, __webpack_require__) { // Imports var ___CSS_LOADER_API_IMPORT___ = __webpack_require__("./node_modules/css-loader/dist/runtime/api.js"); exports = ___CSS_LOADER_API_IMPORT___(false); // Module exports.push([module.i, ".sk-folding-cube {\n width: 27px;\n height: 27px;\n position: relative;\n\n -webkit-transform: rotateZ(45deg);\n transform: rotateZ(45deg);\n}\n\n.sk-folding-cube > div {\n background-color: initial;\n float: left;\n width: 50%;\n height: 50%;\n position: relative;\n\n -webkit-transform: scale(1.1);\n -ms-transform: scale(1.1);\n transform: scale(1.1);\n}\n.sk-folding-cube > div::before {\n content: '';\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background-color: currentColor;\n\n -webkit-animation: sk-foldCubeAngle 2.4s infinite linear both;\n animation: sk-foldCubeAngle 2.4s infinite linear both;\n -webkit-transform-origin: 100% 100%;\n -ms-transform-origin: 100% 100%;\n transform-origin: 100% 100%;\n}\n.sk-folding-cube > div:nth-child(2) {\n -webkit-transform: scale(1.1) rotateZ(90deg);\n transform: scale(1.1) rotateZ(90deg);\n}\n.sk-folding-cube > div:nth-child(4) {\n -webkit-transform: scale(1.1) rotateZ(180deg);\n transform: scale(1.1) rotateZ(180deg);\n}\n.sk-folding-cube > div:nth-child(3) {\n -webkit-transform: scale(1.1) rotateZ(270deg);\n transform: scale(1.1) rotateZ(270deg);\n}\n.sk-folding-cube > div:nth-child(2)::before {\n -webkit-animation-delay: 0.3s;\n animation-delay: 0.3s;\n}\n.sk-folding-cube > div:nth-child(4)::before {\n -webkit-animation-delay: 0.6s;\n animation-delay: 0.6s;\n}\n.sk-folding-cube > div:nth-child(3)::before {\n -webkit-animation-delay: 0.9s;\n animation-delay: 0.9s;\n}\n@-webkit-keyframes sk-foldCubeAngle {\n 0%, 10% {\n -webkit-transform: perspective(140px) rotateX(-180deg);\n transform: perspective(140px) rotateX(-180deg);\n opacity: 0;\n } 25%, 75% {\n -webkit-transform: perspective(140px) rotateX(0deg);\n transform: perspective(140px) rotateX(0deg);\n opacity: 1;\n } 90%, 100% {\n -webkit-transform: perspective(140px) rotateY(180deg);\n transform: perspective(140px) rotateY(180deg);\n opacity: 0;\n }\n}\n\n@keyframes sk-foldCubeAngle {\n 0%, 10% {\n -webkit-transform: perspective(140px) rotateX(-180deg);\n transform: perspective(140px) rotateX(-180deg);\n opacity: 0;\n } 25%, 75% {\n -webkit-transform: perspective(140px) rotateX(0deg);\n transform: perspective(140px) rotateX(0deg);\n opacity: 1;\n } 90%, 100% {\n -webkit-transform: perspective(140px) rotateY(180deg);\n transform: perspective(140px) rotateY(180deg);\n opacity: 0;\n }\n}\n", ""]); // Exports module.exports = exports; /***/ }), /***/ "./node_modules/css-loader/dist/cjs.js!./node_modules/react-spinkit/css/loaders-css.css": /***/ (function(module, exports, __webpack_require__) { // Imports var ___CSS_LOADER_API_IMPORT___ = __webpack_require__("./node_modules/css-loader/dist/runtime/api.js"); exports = ___CSS_LOADER_API_IMPORT___(false); // Module exports.push([module.i, ".ball-triangle-path > div,\n.ball-scale-ripple-multiple > div,\n.ball-scale-ripple > div {\n background-color: initial;\n border-color: currentColor;\n}\n\n.ball-clip-rotate > div {\n background-color: initial;\n border-top-color: currentColor;\n border-right-color: currentColor;\n border-left-color: currentColor;\n}\n\n.ball-clip-rotate-pulse > div:first-child {\n background-color: currentColor;\n}\n.ball-clip-rotate-pulse > div:last-child {\n background-color: initial;\n border-top-color: currentColor;\n border-bottom-color: currentColor;\n}\n\n.ball-clip-rotate-multiple > div:first-child {\n background-color: initial;\n border-right-color: currentColor;\n border-left-color: currentColor;\n}\n.ball-clip-rotate-multiple > div:last-child {\n background-color: initial;\n border-top-color: currentColor;\n border-bottom-color: currentColor;\n}\n\n.triangle-skew-spin > div {\n background-color: initial;\n border-bottom-color: currentColor;\n}\n\n.pacman > div:nth-child(1),\n.pacman > div:nth-child(2) {\n background-color: initial;\n border-top-color: currentColor;\n border-left-color: currentColor;\n border-bottom-color: currentColor;\n}\n\n.pacman > div:nth-child(3),\n.pacman > div:nth-child(4),\n.pacman > div:nth-child(5) {\n background-color: currentColor;\n}\n", ""]); // Exports module.exports = exports; /***/ }), /***/ "./node_modules/css-loader/dist/cjs.js!./node_modules/react-spinkit/css/pulse.css": /***/ (function(module, exports, __webpack_require__) { // Imports var ___CSS_LOADER_API_IMPORT___ = __webpack_require__("./node_modules/css-loader/dist/runtime/api.js"); exports = ___CSS_LOADER_API_IMPORT___(false); // Module exports.push([module.i, ".sk-pulse > div {\n width: 27px;\n height: 27px;\n background-color: currentColor;\n border-radius: 100%;\n\n -webkit-animation: sk-scaleout 1.0s infinite ease-in-out;\n animation: sk-scaleout 1.0s infinite ease-in-out;\n}\n\n@-webkit-keyframes sk-scaleout {\n 0% { -webkit-transform: scale(0.0) }\n 100% {\n -webkit-transform: scale(1.0);\n opacity: 0;\n }\n}\n\n@keyframes sk-scaleout {\n 0% {\n transform: scale(0.0);\n -webkit-transform: scale(0.0);\n } 100% {\n transform: scale(1.0);\n -webkit-transform: scale(1.0);\n opacity: 0;\n }\n}\n", ""]); // Exports module.exports = exports; /***/ }), /***/ "./node_modules/css-loader/dist/cjs.js!./node_modules/react-spinkit/css/rotating-plane.css": /***/ (function(module, exports, __webpack_require__) { // Imports var ___CSS_LOADER_API_IMPORT___ = __webpack_require__("./node_modules/css-loader/dist/runtime/api.js"); exports = ___CSS_LOADER_API_IMPORT___(false); // Module exports.push([module.i, ".sk-rotating-plane > div {\n width: 27px;\n height: 27px;\n background-color: currentColor;\n\n -webkit-animation: sk-rotateplane 1.2s infinite ease-in-out;\n animation: sk-rotateplane 1.2s infinite ease-in-out;\n}\n\n@-webkit-keyframes sk-rotateplane {\n 0% { -webkit-transform: perspective(120px) }\n 50% { -webkit-transform: perspective(120px) rotateY(180deg) }\n 100% { -webkit-transform: perspective(120px) rotateY(180deg) rotateX(180deg) }\n}\n\n@keyframes sk-rotateplane {\n 0% {\n transform: perspective(120px) rotateX(0deg) rotateY(0deg);\n -webkit-transform: perspective(120px) rotateX(0deg) rotateY(0deg);\n } 50% {\n transform: perspective(120px) rotateX(-180.1deg) rotateY(0deg);\n -webkit-transform: perspective(120px) rotateX(-180.1deg) rotateY(0deg);\n } 100% {\n transform: perspective(120px) rotateX(-180deg) rotateY(-179.9deg);\n -webkit-transform: perspective(120px) rotateX(-180deg) rotateY(-179.9deg);\n }\n}\n", ""]); // Exports module.exports = exports; /***/ }), /***/ "./node_modules/css-loader/dist/cjs.js!./node_modules/react-spinkit/css/three-bounce.css": /***/ (function(module, exports, __webpack_require__) { // Imports var ___CSS_LOADER_API_IMPORT___ = __webpack_require__("./node_modules/css-loader/dist/runtime/api.js"); exports = ___CSS_LOADER_API_IMPORT___(false); // Module exports.push([module.i, ".sk-three-bounce {\n height: 18px;\n}\n\n.sk-three-bounce > div {\n width: 18px;\n height: 18px;\n background-color: currentColor;\n border-radius: 100%;\n display: inline-block;\n\n -webkit-animation: sk-bouncedelay 1.4s infinite ease-in-out;\n animation: sk-bouncedelay 1.4s infinite ease-in-out;\n /* Prevent first frame from flickering when animation starts */\n -webkit-animation-fill-mode: both;\n animation-fill-mode: both;\n}\n\n.sk-three-bounce > div:first-child {\n -webkit-animation-delay: -0.32s;\n animation-delay: -0.32s;\n}\n\n.sk-three-bounce > div:nth-child(2) {\n -webkit-animation-delay: -0.16s;\n animation-delay: -0.16s;\n}\n\n@-webkit-keyframes sk-bouncedelay {\n 0%, 80%, 100% { -webkit-transform: scale(0.0) }\n 40% { -webkit-transform: scale(1.0) }\n}\n\n@keyframes sk-bouncedelay {\n 0%, 80%, 100% {\n transform: scale(0.0);\n -webkit-transform: scale(0.0);\n } 40% {\n transform: scale(1.0);\n -webkit-transform: scale(1.0);\n }\n}\n", ""]); // Exports module.exports = exports; /***/ }), /***/ "./node_modules/css-loader/dist/cjs.js!./node_modules/react-spinkit/css/wandering-cubes.css": /***/ (function(module, exports, __webpack_require__) { // Imports var ___CSS_LOADER_API_IMPORT___ = __webpack_require__("./node_modules/css-loader/dist/runtime/api.js"); exports = ___CSS_LOADER_API_IMPORT___(false); // Module exports.push([module.i, ".sk-wandering-cubes {\n width: 52px;\n height: 52px;\n position: relative;\n}\n\n.sk-wandering-cubes > div {\n background-color: currentColor;\n width: 10px;\n height: 10px;\n position: absolute;\n top: 0;\n left: 0;\n\n -webkit-animation: sk-cubemove 1.8s infinite ease-in-out;\n animation: sk-cubemove 1.8s infinite ease-in-out;\n}\n\n.sk-wandering-cubes > div:last-child {\n -webkit-animation-delay: -0.9s;\n animation-delay: -0.9s;\n}\n\n@-webkit-keyframes sk-cubemove {\n 25% { -webkit-transform: translateX(42px) rotate(-90deg) scale(0.5) }\n 50% { -webkit-transform: translateX(42px) translateY(42px) rotate(-180deg) }\n 75% { -webkit-transform: translateX(0px) translateY(42px) rotate(-270deg) scale(0.5) }\n 100% { -webkit-transform: rotate(-360deg) }\n}\n\n@keyframes sk-cubemove {\n 25% {\n transform: translateX(42px) rotate(-90deg) scale(0.5);\n -webkit-transform: translateX(42px) rotate(-90deg) scale(0.5);\n } 50% {\n /* Hack to make FF rotate in the right direction */\n transform: translateX(42px) translateY(42px) rotate(-179deg);\n -webkit-transform: translateX(42px) translateY(42px) rotate(-179deg);\n } 50.1% {\n transform: translateX(42px) translateY(42px) rotate(-180deg);\n -webkit-transform: translateX(42px) translateY(42px) rotate(-180deg);\n } 75% {\n transform: translateX(0px) translateY(42px) rotate(-270deg) scale(0.5);\n -webkit-transform: translateX(0px) translateY(42px) rotate(-270deg) scale(0.5);\n } 100% {\n transform: rotate(-360deg);\n -webkit-transform: rotate(-360deg);\n }\n}\n", ""]); // Exports module.exports = exports; /***/ }), /***/ "./node_modules/css-loader/dist/cjs.js!./node_modules/react-spinkit/css/wave.css": /***/ (function(module, exports, __webpack_require__) { // Imports var ___CSS_LOADER_API_IMPORT___ = __webpack_require__("./node_modules/css-loader/dist/runtime/api.js"); exports = ___CSS_LOADER_API_IMPORT___(false); // Module exports.push([module.i, ".sk-wave {\n width: 30px;\n height: 27px;\n}\n\n.sk-wave > div {\n background-color: currentColor;\n height: 100%;\n width: 6px;\n display: inline-block;\n\n -webkit-animation: sk-stretchdelay 1.2s infinite ease-in-out;\n animation: sk-stretchdelay 1.2s infinite ease-in-out;\n}\n\n.sk-wave > div:nth-child(2) {\n -webkit-animation-delay: -1.1s;\n animation-delay: -1.1s;\n}\n\n.sk-wave > div:nth-child(3) {\n -webkit-animation-delay: -1.0s;\n animation-delay: -1.0s;\n}\n\n.sk-wave > div:nth-child(4) {\n -webkit-animation-delay: -0.9s;\n animation-delay: -0.9s;\n}\n\n.sk-wave > div:nth-child(5) {\n -webkit-animation-delay: -0.8s;\n animation-delay: -0.8s;\n}\n\n@-webkit-keyframes sk-stretchdelay {\n 0%, 40%, 100% { -webkit-transform: scaleY(0.4) }\n 20% { -webkit-transform: scaleY(1.0) }\n}\n\n@keyframes sk-stretchdelay {\n 0%, 40%, 100% {\n transform: scaleY(0.4);\n -webkit-transform: scaleY(0.4);\n } 20% {\n transform: scaleY(1.0);\n -webkit-transform: scaleY(1.0);\n }\n}\n", ""]); // Exports module.exports = exports; /***/ }), /***/ "./node_modules/css-loader/dist/cjs.js!./node_modules/react-spinkit/css/wordpress.css": /***/ (function(module, exports, __webpack_require__) { // Imports var ___CSS_LOADER_API_IMPORT___ = __webpack_require__("./node_modules/css-loader/dist/runtime/api.js"); exports = ___CSS_LOADER_API_IMPORT___(false); // Module exports.push([module.i, ".sk-wordpress > div {\n width: 27px;\n height: 27px;\n background-color: currentColor;\n display: inline-block;\n border-radius: 27px;\n position: relative;\n\n -webkit-animation: sk-inner-circle 1s linear infinite;\n animation: sk-inner-circle 1s linear infinite;\n}\n\n.sk-wordpress > div::after {\n content: '';\n display: block;\n background-color: #fff;\n width: 8px;\n height: 8px;\n position: absolute;\n border-radius: 8px;\n top: 5px;\n left: 5px;\n}\n\n@-webkit-keyframes sk-inner-circle {\n 0% { -webkit-transform: rotate(0); }\n 100% { -webkit-transform: rotate(360deg); }\n}\n\n@keyframes sk-inner-circle {\n 0% { transform: rotate(0); -webkit-transform:rotate(0); }\n 100% { transform: rotate(360deg); -webkit-transform:rotate(360deg); }\n}\n", ""]); // Exports module.exports = exports; /***/ }), /***/ "./node_modules/css-loader/dist/runtime/api.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ // css base code, injected by the css-loader // eslint-disable-next-line func-names module.exports = function (useSourceMap) { var list = []; // return the list of modules as css string list.toString = function toString() { return this.map(function (item) { var content = cssWithMappingToString(item, useSourceMap); if (item[2]) { return "@media ".concat(item[2], " {").concat(content, "}"); } return content; }).join(''); }; // import a list of modules into the list // eslint-disable-next-line func-names list.i = function (modules, mediaQuery, dedupe) { if (typeof modules === 'string') { // eslint-disable-next-line no-param-reassign modules = [[null, modules, '']]; } var alreadyImportedModules = {}; if (dedupe) { for (var i = 0; i < this.length; i++) { // eslint-disable-next-line prefer-destructuring var id = this[i][0]; if (id != null) { alreadyImportedModules[id] = true; } } } for (var _i = 0; _i < modules.length; _i++) { var item = [].concat(modules[_i]); if (dedupe && alreadyImportedModules[item[0]]) { // eslint-disable-next-line no-continue continue; } if (mediaQuery) { if (!item[2]) { item[2] = mediaQuery; } else { item[2] = "".concat(mediaQuery, " and ").concat(item[2]); } } list.push(item); } }; return list; }; function cssWithMappingToString(item, useSourceMap) { var content = item[1] || ''; // eslint-disable-next-line prefer-destructuring var cssMapping = item[3]; if (!cssMapping) { return content; } if (useSourceMap && typeof btoa === 'function') { var sourceMapping = toComment(cssMapping); var sourceURLs = cssMapping.sources.map(function (source) { return "/*# sourceURL=".concat(cssMapping.sourceRoot || '').concat(source, " */"); }); return [content].concat(sourceURLs).concat([sourceMapping]).join('\n'); } return [content].join('\n'); } // Adapted from convert-source-map (MIT) function toComment(sourceMap) { // eslint-disable-next-line no-undef var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))); var data = "sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(base64); return "/*# ".concat(data, " */"); } /***/ }), /***/ "./node_modules/css-loader/dist/runtime/getUrl.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; module.exports = function (url, options) { if (!options) { // eslint-disable-next-line no-param-reassign options = {}; } // eslint-disable-next-line no-underscore-dangle, no-param-reassign url = url && url.__esModule ? url.default : url; if (typeof url !== 'string') { return url; } // If url is already wrapped in quotes, remove them if (/^['"].*['"]$/.test(url)) { // eslint-disable-next-line no-param-reassign url = url.slice(1, -1); } if (options.hash) { // eslint-disable-next-line no-param-reassign url += options.hash; } // Should url be wrapped? // See https://drafts.csswg.org/css-values-3/#urls if (/["'() \t\n]/.test(url) || options.needQuotes) { return "\"".concat(url.replace(/"/g, '\\"').replace(/\n/g, '\\n'), "\""); } return url; }; /***/ }), /***/ "./node_modules/deep-equal/index.js": /***/ (function(module, exports, __webpack_require__) { var objectKeys = __webpack_require__("./node_modules/object-keys/index.js"); var isArguments = __webpack_require__("./node_modules/is-arguments/index.js"); var is = __webpack_require__("./node_modules/object-is/index.js"); var isRegex = __webpack_require__("./node_modules/is-regex/index.js"); var flags = __webpack_require__("./node_modules/regexp.prototype.flags/index.js"); var isDate = __webpack_require__("./node_modules/is-date-object/index.js"); var getTime = Date.prototype.getTime; function deepEqual(actual, expected, options) { var opts = options || {}; // 7.1. All identical values are equivalent, as determined by ===. if (opts.strict ? is(actual, expected) : actual === expected) { return true; } // 7.3. Other pairs that do not both pass typeof value == 'object', equivalence is determined by ==. if (!actual || !expected || (typeof actual !== 'object' && typeof expected !== 'object')) { return opts.strict ? is(actual, expected) : actual == expected; } /* * 7.4. For all other Object pairs, including Array objects, equivalence is * determined by having the same number of owned properties (as verified * with Object.prototype.hasOwnProperty.call), the same set of keys * (although not necessarily the same order), equivalent values for every * corresponding key, and an identical 'prototype' property. Note: this * accounts for both named and indexed properties on Arrays. */ // eslint-disable-next-line no-use-before-define return objEquiv(actual, expected, opts); } function isUndefinedOrNull(value) { return value === null || value === undefined; } function isBuffer(x) { if (!x || typeof x !== 'object' || typeof x.length !== 'number') { return false; } if (typeof x.copy !== 'function' || typeof x.slice !== 'function') { return false; } if (x.length > 0 && typeof x[0] !== 'number') { return false; } return true; } function objEquiv(a, b, opts) { /* eslint max-statements: [2, 50] */ var i, key; if (typeof a !== typeof b) { return false; } if (isUndefinedOrNull(a) || isUndefinedOrNull(b)) { return false; } // an identical 'prototype' property. if (a.prototype !== b.prototype) { return false; } if (isArguments(a) !== isArguments(b)) { return false; } var aIsRegex = isRegex(a); var bIsRegex = isRegex(b); if (aIsRegex !== bIsRegex) { return false; } if (aIsRegex || bIsRegex) { return a.source === b.source && flags(a) === flags(b); } if (isDate(a) && isDate(b)) { return getTime.call(a) === getTime.call(b); } var aIsBuffer = isBuffer(a); var bIsBuffer = isBuffer(b); if (aIsBuffer !== bIsBuffer) { return false; } if (aIsBuffer || bIsBuffer) { // && would work too, because both are true or both false here if (a.length !== b.length) { return false; } for (i = 0; i < a.length; i++) { if (a[i] !== b[i]) { return false; } } return true; } if (typeof a !== typeof b) { return false; } try { var ka = objectKeys(a); var kb = objectKeys(b); } catch (e) { // happens when one is a string literal and the other isn't return false; } // having the same number of owned properties (keys incorporates hasOwnProperty) if (ka.length !== kb.length) { return false; } // the same set of keys (although not necessarily the same order), ka.sort(); kb.sort(); // ~~~cheap key test for (i = ka.length - 1; i >= 0; i--) { if (ka[i] != kb[i]) { return false; } } // equivalent values for every corresponding key, and ~~~possibly expensive deep test for (i = ka.length - 1; i >= 0; i--) { key = ka[i]; if (!deepEqual(a[key], b[key], opts)) { return false; } } return true; } module.exports = deepEqual; /***/ }), /***/ "./node_modules/define-properties/index.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; var keys = __webpack_require__("./node_modules/object-keys/index.js"); var hasSymbols = typeof Symbol === 'function' && typeof Symbol('foo') === 'symbol'; var toStr = Object.prototype.toString; var concat = Array.prototype.concat; var origDefineProperty = Object.defineProperty; var isFunction = function (fn) { return typeof fn === 'function' && toStr.call(fn) === '[object Function]'; }; var hasPropertyDescriptors = __webpack_require__("./node_modules/has-property-descriptors/index.js")(); var supportsDescriptors = origDefineProperty && hasPropertyDescriptors; var defineProperty = function (object, name, value, predicate) { if (name in object && (!isFunction(predicate) || !predicate())) { return; } if (supportsDescriptors) { origDefineProperty(object, name, { configurable: true, enumerable: false, value: value, writable: true }); } else { object[name] = value; // eslint-disable-line no-param-reassign } }; var defineProperties = function (object, map) { var predicates = arguments.length > 2 ? arguments[2] : {}; var props = keys(map); if (hasSymbols) { props = concat.call(props, Object.getOwnPropertySymbols(map)); } for (var i = 0; i < props.length; i += 1) { defineProperty(object, props[i], map[props[i]], predicates[props[i]]); } }; defineProperties.supportsDescriptors = !!supportsDescriptors; module.exports = defineProperties; /***/ }), /***/ "./node_modules/detect-browser/index.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; /* WEBPACK VAR INJECTION */(function(process) { var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) { if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { if (ar || !(i in from)) { if (!ar) ar = Array.prototype.slice.call(from, 0, i); ar[i] = from[i]; } } return to.concat(ar || Array.prototype.slice.call(from)); }; Object.defineProperty(exports, "__esModule", { value: true }); exports.getNodeVersion = exports.detectOS = exports.parseUserAgent = exports.browserName = exports.detect = exports.ReactNativeInfo = exports.BotInfo = exports.SearchBotDeviceInfo = exports.NodeInfo = exports.BrowserInfo = void 0; var BrowserInfo = /** @class */ (function () { function BrowserInfo(name, version, os) { this.name = name; this.version = version; this.os = os; this.type = 'browser'; } return BrowserInfo; }()); exports.BrowserInfo = BrowserInfo; var NodeInfo = /** @class */ (function () { function NodeInfo(version) { this.version = version; this.type = 'node'; this.name = 'node'; this.os = process.platform; } return NodeInfo; }()); exports.NodeInfo = NodeInfo; var SearchBotDeviceInfo = /** @class */ (function () { function SearchBotDeviceInfo(name, version, os, bot) { this.name = name; this.version = version; this.os = os; this.bot = bot; this.type = 'bot-device'; } return SearchBotDeviceInfo; }()); exports.SearchBotDeviceInfo = SearchBotDeviceInfo; var BotInfo = /** @class */ (function () { function BotInfo() { this.type = 'bot'; this.bot = true; // NOTE: deprecated test name instead this.name = 'bot'; this.version = null; this.os = null; } return BotInfo; }()); exports.BotInfo = BotInfo; var ReactNativeInfo = /** @class */ (function () { function ReactNativeInfo() { this.type = 'react-native'; this.name = 'react-native'; this.version = null; this.os = null; } return ReactNativeInfo; }()); exports.ReactNativeInfo = ReactNativeInfo; // tslint:disable-next-line:max-line-length var SEARCHBOX_UA_REGEX = /alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/; var SEARCHBOT_OS_REGEX = /(nuhk|curl|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/; var REQUIRED_VERSION_PARTS = 3; var userAgentRules = [ ['aol', /AOLShield\/([0-9\._]+)/], ['edge', /Edge\/([0-9\._]+)/], ['edge-ios', /EdgiOS\/([0-9\._]+)/], ['yandexbrowser', /YaBrowser\/([0-9\._]+)/], ['kakaotalk', /KAKAOTALK\s([0-9\.]+)/], ['samsung', /SamsungBrowser\/([0-9\.]+)/], ['silk', /\bSilk\/([0-9._-]+)\b/], ['miui', /MiuiBrowser\/([0-9\.]+)$/], ['beaker', /BeakerBrowser\/([0-9\.]+)/], ['edge-chromium', /EdgA?\/([0-9\.]+)/], [ 'chromium-webview', /(?!Chrom.*OPR)wv\).*Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/, ], ['chrome', /(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/], ['phantomjs', /PhantomJS\/([0-9\.]+)(:?\s|$)/], ['crios', /CriOS\/([0-9\.]+)(:?\s|$)/], ['firefox', /Firefox\/([0-9\.]+)(?:\s|$)/], ['fxios', /FxiOS\/([0-9\.]+)/], ['opera-mini', /Opera Mini.*Version\/([0-9\.]+)/], ['opera', /Opera\/([0-9\.]+)(?:\s|$)/], ['opera', /OPR\/([0-9\.]+)(:?\s|$)/], ['pie', /^Microsoft Pocket Internet Explorer\/(\d+\.\d+)$/], ['pie', /^Mozilla\/\d\.\d+\s\(compatible;\s(?:MSP?IE|MSInternet Explorer) (\d+\.\d+);.*Windows CE.*\)$/], ['netfront', /^Mozilla\/\d\.\d+.*NetFront\/(\d.\d)/], ['ie', /Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/], ['ie', /MSIE\s([0-9\.]+);.*Trident\/[4-7].0/], ['ie', /MSIE\s(7\.0)/], ['bb10', /BB10;\sTouch.*Version\/([0-9\.]+)/], ['android', /Android\s([0-9\.]+)/], ['ios', /Version\/([0-9\._]+).*Mobile.*Safari.*/], ['safari', /Version\/([0-9\._]+).*Safari/], ['facebook', /FB[AS]V\/([0-9\.]+)/], ['instagram', /Instagram\s([0-9\.]+)/], ['ios-webview', /AppleWebKit\/([0-9\.]+).*Mobile/], ['ios-webview', /AppleWebKit\/([0-9\.]+).*Gecko\)$/], ['curl', /^curl\/([0-9\.]+)$/], ['searchbot', SEARCHBOX_UA_REGEX], ]; var operatingSystemRules = [ ['iOS', /iP(hone|od|ad)/], ['Android OS', /Android/], ['BlackBerry OS', /BlackBerry|BB10/], ['Windows Mobile', /IEMobile/], ['Amazon OS', /Kindle/], ['Windows 3.11', /Win16/], ['Windows 95', /(Windows 95)|(Win95)|(Windows_95)/], ['Windows 98', /(Windows 98)|(Win98)/], ['Windows 2000', /(Windows NT 5.0)|(Windows 2000)/], ['Windows XP', /(Windows NT 5.1)|(Windows XP)/], ['Windows Server 2003', /(Windows NT 5.2)/], ['Windows Vista', /(Windows NT 6.0)/], ['Windows 7', /(Windows NT 6.1)/], ['Windows 8', /(Windows NT 6.2)/], ['Windows 8.1', /(Windows NT 6.3)/], ['Windows 10', /(Windows NT 10.0)/], ['Windows ME', /Windows ME/], ['Windows CE', /Windows CE|WinCE|Microsoft Pocket Internet Explorer/], ['Open BSD', /OpenBSD/], ['Sun OS', /SunOS/], ['Chrome OS', /CrOS/], ['Linux', /(Linux)|(X11)/], ['Mac OS', /(Mac_PowerPC)|(Macintosh)/], ['QNX', /QNX/], ['BeOS', /BeOS/], ['OS/2', /OS\/2/], ]; function detect(userAgent) { if (!!userAgent) { return parseUserAgent(userAgent); } if (typeof document === 'undefined' && typeof navigator !== 'undefined' && navigator.product === 'ReactNative') { return new ReactNativeInfo(); } if (typeof navigator !== 'undefined') { return parseUserAgent(navigator.userAgent); } return getNodeVersion(); } exports.detect = detect; function matchUserAgent(ua) { // opted for using reduce here rather than Array#first with a regex.test call // this is primarily because using the reduce we only perform the regex // execution once rather than once for the test and for the exec again below // probably something that needs to be benchmarked though return (ua !== '' && userAgentRules.reduce(function (matched, _a) { var browser = _a[0], regex = _a[1]; if (matched) { return matched; } var uaMatch = regex.exec(ua); return !!uaMatch && [browser, uaMatch]; }, false)); } function browserName(ua) { var data = matchUserAgent(ua); return data ? data[0] : null; } exports.browserName = browserName; function parseUserAgent(ua) { var matchedRule = matchUserAgent(ua); if (!matchedRule) { return null; } var name = matchedRule[0], match = matchedRule[1]; if (name === 'searchbot') { return new BotInfo(); } // Do not use RegExp for split operation as some browser do not support it (See: http://blog.stevenlevithan.com/archives/cross-browser-split) var versionParts = match[1] && match[1].split('.').join('_').split('_').slice(0, 3); if (versionParts) { if (versionParts.length < REQUIRED_VERSION_PARTS) { versionParts = __spreadArray(__spreadArray([], versionParts, true), createVersionParts(REQUIRED_VERSION_PARTS - versionParts.length), true); } } else { versionParts = []; } var version = versionParts.join('.'); var os = detectOS(ua); var searchBotMatch = SEARCHBOT_OS_REGEX.exec(ua); if (searchBotMatch && searchBotMatch[1]) { return new SearchBotDeviceInfo(name, version, os, searchBotMatch[1]); } return new BrowserInfo(name, version, os); } exports.parseUserAgent = parseUserAgent; function detectOS(ua) { for (var ii = 0, count = operatingSystemRules.length; ii < count; ii++) { var _a = operatingSystemRules[ii], os = _a[0], regex = _a[1]; var match = regex.exec(ua); if (match) { return os; } } return null; } exports.detectOS = detectOS; function getNodeVersion() { var isNode = typeof process !== 'undefined' && process.version; return isNode ? new NodeInfo(process.version.slice(1)) : null; } exports.getNodeVersion = getNodeVersion; function createVersionParts(count) { var output = []; for (var ii = 0; ii < count; ii++) { output.push('0'); } return output; } /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("./node_modules/process/browser.js"))) /***/ }), /***/ "./node_modules/events/events.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to permit // persons to whom the Software is furnished to do so, subject to the // following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. var R = typeof Reflect === 'object' ? Reflect : null var ReflectApply = R && typeof R.apply === 'function' ? R.apply : function ReflectApply(target, receiver, args) { return Function.prototype.apply.call(target, receiver, args); } var ReflectOwnKeys if (R && typeof R.ownKeys === 'function') { ReflectOwnKeys = R.ownKeys } else if (Object.getOwnPropertySymbols) { ReflectOwnKeys = function ReflectOwnKeys(target) { return Object.getOwnPropertyNames(target) .concat(Object.getOwnPropertySymbols(target)); }; } else { ReflectOwnKeys = function ReflectOwnKeys(target) { return Object.getOwnPropertyNames(target); }; } function ProcessEmitWarning(warning) { if (console && console.warn) console.warn(warning); } var NumberIsNaN = Number.isNaN || function NumberIsNaN(value) { return value !== value; } function EventEmitter() { EventEmitter.init.call(this); } module.exports = EventEmitter; module.exports.once = once; // Backwards-compat with node 0.10.x EventEmitter.EventEmitter = EventEmitter; EventEmitter.prototype._events = undefined; EventEmitter.prototype._eventsCount = 0; EventEmitter.prototype._maxListeners = undefined; // By default EventEmitters will print a warning if more than 10 listeners are // added to it. This is a useful default which helps finding memory leaks. var defaultMaxListeners = 10; function checkListener(listener) { if (typeof listener !== 'function') { throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof listener); } } Object.defineProperty(EventEmitter, 'defaultMaxListeners', { enumerable: true, get: function() { return defaultMaxListeners; }, set: function(arg) { if (typeof arg !== 'number' || arg < 0 || NumberIsNaN(arg)) { throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received ' + arg + '.'); } defaultMaxListeners = arg; } }); EventEmitter.init = function() { if (this._events === undefined || this._events === Object.getPrototypeOf(this)._events) { this._events = Object.create(null); this._eventsCount = 0; } this._maxListeners = this._maxListeners || undefined; }; // Obviously not all Emitters should be limited to 10. This function allows // that to be increased. Set to zero for unlimited. EventEmitter.prototype.setMaxListeners = function setMaxListeners(n) { if (typeof n !== 'number' || n < 0 || NumberIsNaN(n)) { throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received ' + n + '.'); } this._maxListeners = n; return this; }; function _getMaxListeners(that) { if (that._maxListeners === undefined) return EventEmitter.defaultMaxListeners; return that._maxListeners; } EventEmitter.prototype.getMaxListeners = function getMaxListeners() { return _getMaxListeners(this); }; EventEmitter.prototype.emit = function emit(type) { var args = []; for (var i = 1; i < arguments.length; i++) args.push(arguments[i]); var doError = (type === 'error'); var events = this._events; if (events !== undefined) doError = (doError && events.error === undefined); else if (!doError) return false; // If there is no 'error' event listener then throw. if (doError) { var er; if (args.length > 0) er = args[0]; if (er instanceof Error) { // Note: The comments on the `throw` lines are intentional, they show // up in Node's output if this results in an unhandled exception. throw er; // Unhandled 'error' event } // At least give some kind of context to the user var err = new Error('Unhandled error.' + (er ? ' (' + er.message + ')' : '')); err.context = er; throw err; // Unhandled 'error' event } var handler = events[type]; if (handler === undefined) return false; if (typeof handler === 'function') { ReflectApply(handler, this, args); } else { var len = handler.length; var listeners = arrayClone(handler, len); for (var i = 0; i < len; ++i) ReflectApply(listeners[i], this, args); } return true; }; function _addListener(target, type, listener, prepend) { var m; var events; var existing; checkListener(listener); events = target._events; if (events === undefined) { events = target._events = Object.create(null); target._eventsCount = 0; } else { // To avoid recursion in the case that type === "newListener"! Before // adding it to the listeners, first emit "newListener". if (events.newListener !== undefined) { target.emit('newListener', type, listener.listener ? listener.listener : listener); // Re-assign `events` because a newListener handler could have caused the // this._events to be assigned to a new object events = target._events; } existing = events[type]; } if (existing === undefined) { // Optimize the case of one listener. Don't need the extra array object. existing = events[type] = listener; ++target._eventsCount; } else { if (typeof existing === 'function') { // Adding the second element, need to change to array. existing = events[type] = prepend ? [listener, existing] : [existing, listener]; // If we've already got an array, just append. } else if (prepend) { existing.unshift(listener); } else { existing.push(listener); } // Check for listener leak m = _getMaxListeners(target); if (m > 0 && existing.length > m && !existing.warned) { existing.warned = true; // No error code for this since it is a Warning // eslint-disable-next-line no-restricted-syntax var w = new Error('Possible EventEmitter memory leak detected. ' + existing.length + ' ' + String(type) + ' listeners ' + 'added. Use emitter.setMaxListeners() to ' + 'increase limit'); w.name = 'MaxListenersExceededWarning'; w.emitter = target; w.type = type; w.count = existing.length; ProcessEmitWarning(w); } } return target; } EventEmitter.prototype.addListener = function addListener(type, listener) { return _addListener(this, type, listener, false); }; EventEmitter.prototype.on = EventEmitter.prototype.addListener; EventEmitter.prototype.prependListener = function prependListener(type, listener) { return _addListener(this, type, listener, true); }; function onceWrapper() { if (!this.fired) { this.target.removeListener(this.type, this.wrapFn); this.fired = true; if (arguments.length === 0) return this.listener.call(this.target); return this.listener.apply(this.target, arguments); } } function _onceWrap(target, type, listener) { var state = { fired: false, wrapFn: undefined, target: target, type: type, listener: listener }; var wrapped = onceWrapper.bind(state); wrapped.listener = listener; state.wrapFn = wrapped; return wrapped; } EventEmitter.prototype.once = function once(type, listener) { checkListener(listener); this.on(type, _onceWrap(this, type, listener)); return this; }; EventEmitter.prototype.prependOnceListener = function prependOnceListener(type, listener) { checkListener(listener); this.prependListener(type, _onceWrap(this, type, listener)); return this; }; // Emits a 'removeListener' event if and only if the listener was removed. EventEmitter.prototype.removeListener = function removeListener(type, listener) { var list, events, position, i, originalListener; checkListener(listener); events = this._events; if (events === undefined) return this; list = events[type]; if (list === undefined) return this; if (list === listener || list.listener === listener) { if (--this._eventsCount === 0) this._events = Object.create(null); else { delete events[type]; if (events.removeListener) this.emit('removeListener', type, list.listener || listener); } } else if (typeof list !== 'function') { position = -1; for (i = list.length - 1; i >= 0; i--) { if (list[i] === listener || list[i].listener === listener) { originalListener = list[i].listener; position = i; break; } } if (position < 0) return this; if (position === 0) list.shift(); else { spliceOne(list, position); } if (list.length === 1) events[type] = list[0]; if (events.removeListener !== undefined) this.emit('removeListener', type, originalListener || listener); } return this; }; EventEmitter.prototype.off = EventEmitter.prototype.removeListener; EventEmitter.prototype.removeAllListeners = function removeAllListeners(type) { var listeners, events, i; events = this._events; if (events === undefined) return this; // not listening for removeListener, no need to emit if (events.removeListener === undefined) { if (arguments.length === 0) { this._events = Object.create(null); this._eventsCount = 0; } else if (events[type] !== undefined) { if (--this._eventsCount === 0) this._events = Object.create(null); else delete events[type]; } return this; } // emit removeListener for all listeners on all events if (arguments.length === 0) { var keys = Object.keys(events); var key; for (i = 0; i < keys.length; ++i) { key = keys[i]; if (key === 'removeListener') continue; this.removeAllListeners(key); } this.removeAllListeners('removeListener'); this._events = Object.create(null); this._eventsCount = 0; return this; } listeners = events[type]; if (typeof listeners === 'function') { this.removeListener(type, listeners); } else if (listeners !== undefined) { // LIFO order for (i = listeners.length - 1; i >= 0; i--) { this.removeListener(type, listeners[i]); } } return this; }; function _listeners(target, type, unwrap) { var events = target._events; if (events === undefined) return []; var evlistener = events[type]; if (evlistener === undefined) return []; if (typeof evlistener === 'function') return unwrap ? [evlistener.listener || evlistener] : [evlistener]; return unwrap ? unwrapListeners(evlistener) : arrayClone(evlistener, evlistener.length); } EventEmitter.prototype.listeners = function listeners(type) { return _listeners(this, type, true); }; EventEmitter.prototype.rawListeners = function rawListeners(type) { return _listeners(this, type, false); }; EventEmitter.listenerCount = function(emitter, type) { if (typeof emitter.listenerCount === 'function') { return emitter.listenerCount(type); } else { return listenerCount.call(emitter, type); } }; EventEmitter.prototype.listenerCount = listenerCount; function listenerCount(type) { var events = this._events; if (events !== undefined) { var evlistener = events[type]; if (typeof evlistener === 'function') { return 1; } else if (evlistener !== undefined) { return evlistener.length; } } return 0; } EventEmitter.prototype.eventNames = function eventNames() { return this._eventsCount > 0 ? ReflectOwnKeys(this._events) : []; }; function arrayClone(arr, n) { var copy = new Array(n); for (var i = 0; i < n; ++i) copy[i] = arr[i]; return copy; } function spliceOne(list, index) { for (; index + 1 < list.length; index++) list[index] = list[index + 1]; list.pop(); } function unwrapListeners(arr) { var ret = new Array(arr.length); for (var i = 0; i < ret.length; ++i) { ret[i] = arr[i].listener || arr[i]; } return ret; } function once(emitter, name) { return new Promise(function (resolve, reject) { function errorListener(err) { emitter.removeListener(name, resolver); reject(err); } function resolver() { if (typeof emitter.removeListener === 'function') { emitter.removeListener('error', errorListener); } resolve([].slice.call(arguments)); }; eventTargetAgnosticAddListener(emitter, name, resolver, { once: true }); if (name !== 'error') { addErrorHandlerIfEventEmitter(emitter, errorListener, { once: true }); } }); } function addErrorHandlerIfEventEmitter(emitter, handler, flags) { if (typeof emitter.on === 'function') { eventTargetAgnosticAddListener(emitter, 'error', handler, flags); } } function eventTargetAgnosticAddListener(emitter, name, listener, flags) { if (typeof emitter.on === 'function') { if (flags.once) { emitter.once(name, listener); } else { emitter.on(name, listener); } } else if (typeof emitter.addEventListener === 'function') { // EventTarget does not have `error` event semantics like Node // EventEmitters, we do not listen for `error` events here. emitter.addEventListener(name, function wrapListener(arg) { // IE does not have builtin `{ once: true }` support so we // have to do it manually. if (flags.once) { emitter.removeEventListener(name, wrapListener); } listener(arg); }); } else { throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type ' + typeof emitter); } } /***/ }), /***/ "./node_modules/exenv/index.js": /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__;/*! Copyright (c) 2015 Jed Watson. Based on code that is Copyright 2013-2015, Facebook, Inc. All rights reserved. */ /* global define */ (function () { 'use strict'; var canUseDOM = !!( typeof window !== 'undefined' && window.document && window.document.createElement ); var ExecutionEnvironment = { canUseDOM: canUseDOM, canUseWorkers: typeof Worker !== 'undefined', canUseEventListeners: canUseDOM && !!(window.addEventListener || window.attachEvent), canUseViewport: canUseDOM && !!window.screen }; if (true) { !(__WEBPACK_AMD_DEFINE_RESULT__ = (function () { return ExecutionEnvironment; }).call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); } else {} }()); /***/ }), /***/ "./node_modules/exports-loader/index.js?self.fetch!./node_modules/whatwg-fetch/dist/fetch.umd.js": /***/ (function(module, exports, __webpack_require__) { (function (global, factory) { true ? factory(exports) : undefined; }(this, (function (exports) { 'use strict'; var global = (typeof globalThis !== 'undefined' && globalThis) || (typeof self !== 'undefined' && self) || (typeof global !== 'undefined' && global); var support = { searchParams: 'URLSearchParams' in global, iterable: 'Symbol' in global && 'iterator' in Symbol, blob: 'FileReader' in global && 'Blob' in global && (function() { try { new Blob(); return true } catch (e) { return false } })(), formData: 'FormData' in global, arrayBuffer: 'ArrayBuffer' in global }; function isDataView(obj) { return obj && DataView.prototype.isPrototypeOf(obj) } if (support.arrayBuffer) { var viewClasses = [ '[object Int8Array]', '[object Uint8Array]', '[object Uint8ClampedArray]', '[object Int16Array]', '[object Uint16Array]', '[object Int32Array]', '[object Uint32Array]', '[object Float32Array]', '[object Float64Array]' ]; var isArrayBufferView = ArrayBuffer.isView || function(obj) { return obj && viewClasses.indexOf(Object.prototype.toString.call(obj)) > -1 }; } function normalizeName(name) { if (typeof name !== 'string') { name = String(name); } if (/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(name) || name === '') { throw new TypeError('Invalid character in header field name: "' + name + '"') } return name.toLowerCase() } function normalizeValue(value) { if (typeof value !== 'string') { value = String(value); } return value } // Build a destructive iterator for the value list function iteratorFor(items) { var iterator = { next: function() { var value = items.shift(); return {done: value === undefined, value: value} } }; if (support.iterable) { iterator[Symbol.iterator] = function() { return iterator }; } return iterator } function Headers(headers) { this.map = {}; if (headers instanceof Headers) { headers.forEach(function(value, name) { this.append(name, value); }, this); } else if (Array.isArray(headers)) { headers.forEach(function(header) { this.append(header[0], header[1]); }, this); } else if (headers) { Object.getOwnPropertyNames(headers).forEach(function(name) { this.append(name, headers[name]); }, this); } } Headers.prototype.append = function(name, value) { name = normalizeName(name); value = normalizeValue(value); var oldValue = this.map[name]; this.map[name] = oldValue ? oldValue + ', ' + value : value; }; Headers.prototype['delete'] = function(name) { delete this.map[normalizeName(name)]; }; Headers.prototype.get = function(name) { name = normalizeName(name); return this.has(name) ? this.map[name] : null }; Headers.prototype.has = function(name) { return this.map.hasOwnProperty(normalizeName(name)) }; Headers.prototype.set = function(name, value) { this.map[normalizeName(name)] = normalizeValue(value); }; Headers.prototype.forEach = function(callback, thisArg) { for (var name in this.map) { if (this.map.hasOwnProperty(name)) { callback.call(thisArg, this.map[name], name, this); } } }; Headers.prototype.keys = function() { var items = []; this.forEach(function(value, name) { items.push(name); }); return iteratorFor(items) }; Headers.prototype.values = function() { var items = []; this.forEach(function(value) { items.push(value); }); return iteratorFor(items) }; Headers.prototype.entries = function() { var items = []; this.forEach(function(value, name) { items.push([name, value]); }); return iteratorFor(items) }; if (support.iterable) { Headers.prototype[Symbol.iterator] = Headers.prototype.entries; } function consumed(body) { if (body.bodyUsed) { return Promise.reject(new TypeError('Already read')) } body.bodyUsed = true; } function fileReaderReady(reader) { return new Promise(function(resolve, reject) { reader.onload = function() { resolve(reader.result); }; reader.onerror = function() { reject(reader.error); }; }) } function readBlobAsArrayBuffer(blob) { var reader = new FileReader(); var promise = fileReaderReady(reader); reader.readAsArrayBuffer(blob); return promise } function readBlobAsText(blob) { var reader = new FileReader(); var promise = fileReaderReady(reader); reader.readAsText(blob); return promise } function readArrayBufferAsText(buf) { var view = new Uint8Array(buf); var chars = new Array(view.length); for (var i = 0; i < view.length; i++) { chars[i] = String.fromCharCode(view[i]); } return chars.join('') } function bufferClone(buf) { if (buf.slice) { return buf.slice(0) } else { var view = new Uint8Array(buf.byteLength); view.set(new Uint8Array(buf)); return view.buffer } } function Body() { this.bodyUsed = false; this._initBody = function(body) { /* fetch-mock wraps the Response object in an ES6 Proxy to provide useful test harness features such as flush. However, on ES5 browsers without fetch or Proxy support pollyfills must be used; the proxy-pollyfill is unable to proxy an attribute unless it exists on the object before the Proxy is created. This change ensures Response.bodyUsed exists on the instance, while maintaining the semantic of setting Request.bodyUsed in the constructor before _initBody is called. */ this.bodyUsed = this.bodyUsed; this._bodyInit = body; if (!body) { this._bodyText = ''; } else if (typeof body === 'string') { this._bodyText = body; } else if (support.blob && Blob.prototype.isPrototypeOf(body)) { this._bodyBlob = body; } else if (support.formData && FormData.prototype.isPrototypeOf(body)) { this._bodyFormData = body; } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) { this._bodyText = body.toString(); } else if (support.arrayBuffer && support.blob && isDataView(body)) { this._bodyArrayBuffer = bufferClone(body.buffer); // IE 10-11 can't handle a DataView body. this._bodyInit = new Blob([this._bodyArrayBuffer]); } else if (support.arrayBuffer && (ArrayBuffer.prototype.isPrototypeOf(body) || isArrayBufferView(body))) { this._bodyArrayBuffer = bufferClone(body); } else { this._bodyText = body = Object.prototype.toString.call(body); } if (!this.headers.get('content-type')) { if (typeof body === 'string') { this.headers.set('content-type', 'text/plain;charset=UTF-8'); } else if (this._bodyBlob && this._bodyBlob.type) { this.headers.set('content-type', this._bodyBlob.type); } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) { this.headers.set('content-type', 'application/x-www-form-urlencoded;charset=UTF-8'); } } }; if (support.blob) { this.blob = function() { var rejected = consumed(this); if (rejected) { return rejected } if (this._bodyBlob) { return Promise.resolve(this._bodyBlob) } else if (this._bodyArrayBuffer) { return Promise.resolve(new Blob([this._bodyArrayBuffer])) } else if (this._bodyFormData) { throw new Error('could not read FormData body as blob') } else { return Promise.resolve(new Blob([this._bodyText])) } }; this.arrayBuffer = function() { if (this._bodyArrayBuffer) { var isConsumed = consumed(this); if (isConsumed) { return isConsumed } if (ArrayBuffer.isView(this._bodyArrayBuffer)) { return Promise.resolve( this._bodyArrayBuffer.buffer.slice( this._bodyArrayBuffer.byteOffset, this._bodyArrayBuffer.byteOffset + this._bodyArrayBuffer.byteLength ) ) } else { return Promise.resolve(this._bodyArrayBuffer) } } else { return this.blob().then(readBlobAsArrayBuffer) } }; } this.text = function() { var rejected = consumed(this); if (rejected) { return rejected } if (this._bodyBlob) { return readBlobAsText(this._bodyBlob) } else if (this._bodyArrayBuffer) { return Promise.resolve(readArrayBufferAsText(this._bodyArrayBuffer)) } else if (this._bodyFormData) { throw new Error('could not read FormData body as text') } else { return Promise.resolve(this._bodyText) } }; if (support.formData) { this.formData = function() { return this.text().then(decode) }; } this.json = function() { return this.text().then(JSON.parse) }; return this } // HTTP methods whose capitalization should be normalized var methods = ['DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT']; function normalizeMethod(method) { var upcased = method.toUpperCase(); return methods.indexOf(upcased) > -1 ? upcased : method } function Request(input, options) { if (!(this instanceof Request)) { throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.') } options = options || {}; var body = options.body; if (input instanceof Request) { if (input.bodyUsed) { throw new TypeError('Already read') } this.url = input.url; this.credentials = input.credentials; if (!options.headers) { this.headers = new Headers(input.headers); } this.method = input.method; this.mode = input.mode; this.signal = input.signal; if (!body && input._bodyInit != null) { body = input._bodyInit; input.bodyUsed = true; } } else { this.url = String(input); } this.credentials = options.credentials || this.credentials || 'same-origin'; if (options.headers || !this.headers) { this.headers = new Headers(options.headers); } this.method = normalizeMethod(options.method || this.method || 'GET'); this.mode = options.mode || this.mode || null; this.signal = options.signal || this.signal; this.referrer = null; if ((this.method === 'GET' || this.method === 'HEAD') && body) { throw new TypeError('Body not allowed for GET or HEAD requests') } this._initBody(body); if (this.method === 'GET' || this.method === 'HEAD') { if (options.cache === 'no-store' || options.cache === 'no-cache') { // Search for a '_' parameter in the query string var reParamSearch = /([?&])_=[^&]*/; if (reParamSearch.test(this.url)) { // If it already exists then set the value with the current time this.url = this.url.replace(reParamSearch, '$1_=' + new Date().getTime()); } else { // Otherwise add a new '_' parameter to the end with the current time var reQueryString = /\?/; this.url += (reQueryString.test(this.url) ? '&' : '?') + '_=' + new Date().getTime(); } } } } Request.prototype.clone = function() { return new Request(this, {body: this._bodyInit}) }; function decode(body) { var form = new FormData(); body .trim() .split('&') .forEach(function(bytes) { if (bytes) { var split = bytes.split('='); var name = split.shift().replace(/\+/g, ' '); var value = split.join('=').replace(/\+/g, ' '); form.append(decodeURIComponent(name), decodeURIComponent(value)); } }); return form } function parseHeaders(rawHeaders) { var headers = new Headers(); // Replace instances of \r\n and \n followed by at least one space or horizontal tab with a space // https://tools.ietf.org/html/rfc7230#section-3.2 var preProcessedHeaders = rawHeaders.replace(/\r?\n[\t ]+/g, ' '); // Avoiding split via regex to work around a common IE11 bug with the core-js 3.6.0 regex polyfill // https://github.com/github/fetch/issues/748 // https://github.com/zloirock/core-js/issues/751 preProcessedHeaders .split('\r') .map(function(header) { return header.indexOf('\n') === 0 ? header.substr(1, header.length) : header }) .forEach(function(line) { var parts = line.split(':'); var key = parts.shift().trim(); if (key) { var value = parts.join(':').trim(); headers.append(key, value); } }); return headers } Body.call(Request.prototype); function Response(bodyInit, options) { if (!(this instanceof Response)) { throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.') } if (!options) { options = {}; } this.type = 'default'; this.status = options.status === undefined ? 200 : options.status; this.ok = this.status >= 200 && this.status < 300; this.statusText = options.statusText === undefined ? '' : '' + options.statusText; this.headers = new Headers(options.headers); this.url = options.url || ''; this._initBody(bodyInit); } Body.call(Response.prototype); Response.prototype.clone = function() { return new Response(this._bodyInit, { status: this.status, statusText: this.statusText, headers: new Headers(this.headers), url: this.url }) }; Response.error = function() { var response = new Response(null, {status: 0, statusText: ''}); response.type = 'error'; return response }; var redirectStatuses = [301, 302, 303, 307, 308]; Response.redirect = function(url, status) { if (redirectStatuses.indexOf(status) === -1) { throw new RangeError('Invalid status code') } return new Response(null, {status: status, headers: {location: url}}) }; exports.DOMException = global.DOMException; try { new exports.DOMException(); } catch (err) { exports.DOMException = function(message, name) { this.message = message; this.name = name; var error = Error(message); this.stack = error.stack; }; exports.DOMException.prototype = Object.create(Error.prototype); exports.DOMException.prototype.constructor = exports.DOMException; } function fetch(input, init) { return new Promise(function(resolve, reject) { var request = new Request(input, init); if (request.signal && request.signal.aborted) { return reject(new exports.DOMException('Aborted', 'AbortError')) } var xhr = new XMLHttpRequest(); function abortXhr() { xhr.abort(); } xhr.onload = function() { var options = { status: xhr.status, statusText: xhr.statusText, headers: parseHeaders(xhr.getAllResponseHeaders() || '') }; options.url = 'responseURL' in xhr ? xhr.responseURL : options.headers.get('X-Request-URL'); var body = 'response' in xhr ? xhr.response : xhr.responseText; setTimeout(function() { resolve(new Response(body, options)); }, 0); }; xhr.onerror = function() { setTimeout(function() { reject(new TypeError('Network request failed')); }, 0); }; xhr.ontimeout = function() { setTimeout(function() { reject(new TypeError('Network request failed')); }, 0); }; xhr.onabort = function() { setTimeout(function() { reject(new exports.DOMException('Aborted', 'AbortError')); }, 0); }; function fixUrl(url) { try { return url === '' && global.location.href ? global.location.href : url } catch (e) { return url } } xhr.open(request.method, fixUrl(request.url), true); if (request.credentials === 'include') { xhr.withCredentials = true; } else if (request.credentials === 'omit') { xhr.withCredentials = false; } if ('responseType' in xhr) { if (support.blob) { xhr.responseType = 'blob'; } else if ( support.arrayBuffer && request.headers.get('Content-Type') && request.headers.get('Content-Type').indexOf('application/octet-stream') !== -1 ) { xhr.responseType = 'arraybuffer'; } } if (init && typeof init.headers === 'object' && !(init.headers instanceof Headers)) { Object.getOwnPropertyNames(init.headers).forEach(function(name) { xhr.setRequestHeader(name, normalizeValue(init.headers[name])); }); } else { request.headers.forEach(function(value, name) { xhr.setRequestHeader(name, value); }); } if (request.signal) { request.signal.addEventListener('abort', abortXhr); xhr.onreadystatechange = function() { // DONE (success or failure) if (xhr.readyState === 4) { request.signal.removeEventListener('abort', abortXhr); } }; } xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit); }) } fetch.polyfill = true; if (!global.fetch) { global.fetch = fetch; global.Headers = Headers; global.Request = Request; global.Response = Response; } exports.Headers = Headers; exports.Request = Request; exports.Response = Response; exports.fetch = fetch; Object.defineProperty(exports, '__esModule', { value: true }); }))); /*** EXPORTS FROM exports-loader ***/ module.exports = self.fetch; /***/ }), /***/ "./node_modules/fbjs/lib/emptyObject.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * Copyright (c) 2013-present, Facebook, Inc. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * */ var emptyObject = {}; if (false) {} module.exports = emptyObject; /***/ }), /***/ "./node_modules/fbjs/lib/invariant.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * Copyright (c) 2013-present, Facebook, Inc. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * */ /** * Use invariant() to assert state which your program assumes to be true. * * Provide sprintf-style format (only %s is supported) and arguments * to provide information about what broke and what you were * expecting. * * The invariant message will be stripped in production, but the invariant * will remain to ensure logic does not differ in production. */ var validateFormat = function validateFormat(format) {}; if (false) {} function invariant(condition, format, a, b, c, d, e, f) { validateFormat(format); if (!condition) { var error; if (format === undefined) { error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.'); } else { var args = [a, b, c, d, e, f]; var argIndex = 0; error = new Error(format.replace(/%s/g, function () { return args[argIndex++]; })); error.name = 'Invariant Violation'; } error.framesToPop = 1; // we don't care about invariant's own frame throw error; } } module.exports = invariant; /***/ }), /***/ "./node_modules/flux/index.js": /***/ (function(module, exports, __webpack_require__) { /** * Copyright (c) 2014-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. */ module.exports.Dispatcher = __webpack_require__("./node_modules/flux/lib/Dispatcher.js"); /***/ }), /***/ "./node_modules/flux/lib/Dispatcher.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * Copyright (c) 2014-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule Dispatcher * * @preventMunge */ exports.__esModule = true; function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } var invariant = __webpack_require__("./node_modules/fbjs/lib/invariant.js"); var _prefix = 'ID_'; /** * Dispatcher is used to broadcast payloads to registered callbacks. This is * different from generic pub-sub systems in two ways: * * 1) Callbacks are not subscribed to particular events. Every payload is * dispatched to every registered callback. * 2) Callbacks can be deferred in whole or part until other callbacks have * been executed. * * For example, consider this hypothetical flight destination form, which * selects a default city when a country is selected: * * var flightDispatcher = new Dispatcher(); * * // Keeps track of which country is selected * var CountryStore = {country: null}; * * // Keeps track of which city is selected * var CityStore = {city: null}; * * // Keeps track of the base flight price of the selected city * var FlightPriceStore = {price: null} * * When a user changes the selected city, we dispatch the payload: * * flightDispatcher.dispatch({ * actionType: 'city-update', * selectedCity: 'paris' * }); * * This payload is digested by `CityStore`: * * flightDispatcher.register(function(payload) { * if (payload.actionType === 'city-update') { * CityStore.city = payload.selectedCity; * } * }); * * When the user selects a country, we dispatch the payload: * * flightDispatcher.dispatch({ * actionType: 'country-update', * selectedCountry: 'australia' * }); * * This payload is digested by both stores: * * CountryStore.dispatchToken = flightDispatcher.register(function(payload) { * if (payload.actionType === 'country-update') { * CountryStore.country = payload.selectedCountry; * } * }); * * When the callback to update `CountryStore` is registered, we save a reference * to the returned token. Using this token with `waitFor()`, we can guarantee * that `CountryStore` is updated before the callback that updates `CityStore` * needs to query its data. * * CityStore.dispatchToken = flightDispatcher.register(function(payload) { * if (payload.actionType === 'country-update') { * // `CountryStore.country` may not be updated. * flightDispatcher.waitFor([CountryStore.dispatchToken]); * // `CountryStore.country` is now guaranteed to be updated. * * // Select the default city for the new country * CityStore.city = getDefaultCityForCountry(CountryStore.country); * } * }); * * The usage of `waitFor()` can be chained, for example: * * FlightPriceStore.dispatchToken = * flightDispatcher.register(function(payload) { * switch (payload.actionType) { * case 'country-update': * case 'city-update': * flightDispatcher.waitFor([CityStore.dispatchToken]); * FlightPriceStore.price = * getFlightPriceStore(CountryStore.country, CityStore.city); * break; * } * }); * * The `country-update` payload will be guaranteed to invoke the stores' * registered callbacks in order: `CountryStore`, `CityStore`, then * `FlightPriceStore`. */ var Dispatcher = (function () { function Dispatcher() { _classCallCheck(this, Dispatcher); this._callbacks = {}; this._isDispatching = false; this._isHandled = {}; this._isPending = {}; this._lastID = 1; } /** * Registers a callback to be invoked with every dispatched payload. Returns * a token that can be used with `waitFor()`. */ Dispatcher.prototype.register = function register(callback) { var id = _prefix + this._lastID++; this._callbacks[id] = callback; return id; }; /** * Removes a callback based on its token. */ Dispatcher.prototype.unregister = function unregister(id) { !this._callbacks[id] ? false ? undefined : invariant(false) : undefined; delete this._callbacks[id]; }; /** * Waits for the callbacks specified to be invoked before continuing execution * of the current callback. This method should only be used by a callback in * response to a dispatched payload. */ Dispatcher.prototype.waitFor = function waitFor(ids) { !this._isDispatching ? false ? undefined : invariant(false) : undefined; for (var ii = 0; ii < ids.length; ii++) { var id = ids[ii]; if (this._isPending[id]) { !this._isHandled[id] ? false ? undefined : invariant(false) : undefined; continue; } !this._callbacks[id] ? false ? undefined : invariant(false) : undefined; this._invokeCallback(id); } }; /** * Dispatches a payload to all registered callbacks. */ Dispatcher.prototype.dispatch = function dispatch(payload) { !!this._isDispatching ? false ? undefined : invariant(false) : undefined; this._startDispatching(payload); try { for (var id in this._callbacks) { if (this._isPending[id]) { continue; } this._invokeCallback(id); } } finally { this._stopDispatching(); } }; /** * Is this Dispatcher currently dispatching. */ Dispatcher.prototype.isDispatching = function isDispatching() { return this._isDispatching; }; /** * Call the callback stored with the given id. Also do some internal * bookkeeping. * * @internal */ Dispatcher.prototype._invokeCallback = function _invokeCallback(id) { this._isPending[id] = true; this._callbacks[id](this._pendingPayload); this._isHandled[id] = true; }; /** * Set up bookkeeping needed when dispatching. * * @internal */ Dispatcher.prototype._startDispatching = function _startDispatching(payload) { for (var id in this._callbacks) { this._isPending[id] = false; this._isHandled[id] = false; } this._pendingPayload = payload; this._isDispatching = true; }; /** * Clear bookkeeping used for dispatching. * * @internal */ Dispatcher.prototype._stopDispatching = function _stopDispatching() { delete this._pendingPayload; this._isDispatching = false; }; return Dispatcher; })(); module.exports = Dispatcher; /***/ }), /***/ "./node_modules/format-message-formats/index.js": /***/ (function(module, exports) { // @flow var LONG = 'long' var SHORT = 'short' var NARROW = 'narrow' var NUMERIC = 'numeric' var TWODIGIT = '2-digit' /** * formatting information **/ module.exports = { number: { decimal: { style: 'decimal' }, integer: { style: 'decimal', maximumFractionDigits: 0 }, currency: { style: 'currency', currency: 'USD' }, percent: { style: 'percent' }, default: { style: 'decimal' } }, date: { short: { month: NUMERIC, day: NUMERIC, year: TWODIGIT }, medium: { month: SHORT, day: NUMERIC, year: NUMERIC }, long: { month: LONG, day: NUMERIC, year: NUMERIC }, full: { month: LONG, day: NUMERIC, year: NUMERIC, weekday: LONG }, default: { month: SHORT, day: NUMERIC, year: NUMERIC } }, time: { short: { hour: NUMERIC, minute: NUMERIC }, medium: { hour: NUMERIC, minute: NUMERIC, second: NUMERIC }, long: { hour: NUMERIC, minute: NUMERIC, second: NUMERIC, timeZoneName: SHORT }, full: { hour: NUMERIC, minute: NUMERIC, second: NUMERIC, timeZoneName: SHORT }, default: { hour: NUMERIC, minute: NUMERIC, second: NUMERIC } }, duration: { default: { hours: { minimumIntegerDigits: 1, maximumFractionDigits: 0 }, minutes: { minimumIntegerDigits: 2, maximumFractionDigits: 0 }, seconds: { minimumIntegerDigits: 2, maximumFractionDigits: 3 } } }, parseNumberPattern: function (pattern/*: ?string */) { if (!pattern) return var options = {} var currency = pattern.match(/\b[A-Z]{3}\b/i) var syms = pattern.replace(/[^¤]/g, '').length if (!syms && currency) syms = 1 if (syms) { options.style = 'currency' options.currencyDisplay = syms === 1 ? 'symbol' : syms === 2 ? 'code' : 'name' options.currency = currency ? currency[0].toUpperCase() : 'USD' } else if (pattern.indexOf('%') >= 0) { options.style = 'percent' } if (!/[@#0]/.test(pattern)) return options.style ? options : undefined options.useGrouping = pattern.indexOf(',') >= 0 if (/E\+?[@#0]+/i.test(pattern) || pattern.indexOf('@') >= 0) { var size = pattern.replace(/E\+?[@#0]+|[^@#0]/gi, '') options.minimumSignificantDigits = Math.min(Math.max(size.replace(/[^@0]/g, '').length, 1), 21) options.maximumSignificantDigits = Math.min(Math.max(size.length, 1), 21) } else { var parts = pattern.replace(/[^#0.]/g, '').split('.') var integer = parts[0] var n = integer.length - 1 while (integer[n] === '0') --n options.minimumIntegerDigits = Math.min(Math.max(integer.length - 1 - n, 1), 21) var fraction = parts[1] || '' n = 0 while (fraction[n] === '0') ++n options.minimumFractionDigits = Math.min(Math.max(n, 0), 20) while (fraction[n] === '#') ++n options.maximumFractionDigits = Math.min(Math.max(n, 0), 20) } return options }, parseDatePattern: function (pattern/*: ?string */) { if (!pattern) return var options = {} for (var i = 0; i < pattern.length;) { var current = pattern[i] var n = 1 while (pattern[++i] === current) ++n switch (current) { case 'G': options.era = n === 5 ? NARROW : n === 4 ? LONG : SHORT break case 'y': case 'Y': options.year = n === 2 ? TWODIGIT : NUMERIC break case 'M': case 'L': n = Math.min(Math.max(n - 1, 0), 4) options.month = [NUMERIC, TWODIGIT, SHORT, LONG, NARROW][n] break case 'E': case 'e': case 'c': options.weekday = n === 5 ? NARROW : n === 4 ? LONG : SHORT break case 'd': case 'D': options.day = n === 2 ? TWODIGIT : NUMERIC break case 'h': case 'K': options.hour12 = true options.hour = n === 2 ? TWODIGIT : NUMERIC break case 'H': case 'k': options.hour12 = false options.hour = n === 2 ? TWODIGIT : NUMERIC break case 'm': options.minute = n === 2 ? TWODIGIT : NUMERIC break case 's': case 'S': options.second = n === 2 ? TWODIGIT : NUMERIC break case 'z': case 'Z': case 'v': case 'V': options.timeZoneName = n === 1 ? SHORT : LONG break } } return Object.keys(options).length ? options : undefined } } /***/ }), /***/ "./node_modules/format-message-interpret/index.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; // @flow var formats = __webpack_require__("./node_modules/format-message-formats/index.js") var lookupClosestLocale = __webpack_require__("./node_modules/lookup-closest-locale/index.js") var plurals = __webpack_require__("./node_modules/format-message-interpret/plurals.js") /*:: import type { AST, SubMessages } from '../format-message-parse' type Locale = string type Locales = Locale | Locale[] type Placeholder = any[] // https://github.com/facebook/flow/issues/4050 export type Type = (Placeholder, Locales) => (any, ?Object) => any export type Types = { [string]: Type } */ exports = module.exports = function interpret ( ast/*: AST */, locale/*:: ?: Locales */, types/*:: ?: Types */ )/*: (args?: Object) => string */ { return interpretAST(ast, null, locale || 'en', types || {}, true) } exports.toParts = function toParts ( ast/*: AST */, locale/*:: ?: Locales */, types/*:: ?: Types */ )/*: (args?: Object) => any[] */ { return interpretAST(ast, null, locale || 'en', types || {}, false) } function interpretAST ( elements/*: any[] */, parent/*: ?Placeholder */, locale/*: Locales */, types/*: Types */, join/*: boolean */ )/*: Function */ { var parts = elements.map(function (element) { return interpretElement(element, parent, locale, types, join) }) if (!join) { return function format (args) { return parts.reduce(function (parts, part) { return parts.concat(part(args)) }, []) } } if (parts.length === 1) return parts[0] return function format (args) { var message = '' for (var e = 0; e < parts.length; ++e) { message += parts[e](args) } return message } } function interpretElement ( element/*: Placeholder */, parent/*: ?Placeholder */, locale/*: Locales */, types/*: Types */, join/*: boolean */ )/*: Function */ { if (typeof element === 'string') { var value/*: string */ = element return function format () { return value } } var id = element[0] var type = element[1] if (parent && element[0] === '#') { id = parent[0] var offset = parent[2] var formatter = (types.number || defaults.number)([id, 'number'], locale) return function format (args) { return formatter(getArg(id, args) - offset, args) } } // pre-process children var children if (type === 'plural' || type === 'selectordinal') { children = {} Object.keys(element[3]).forEach(function (key) { children[key] = interpretAST(element[3][key], element, locale, types, join) }) element = [element[0], element[1], element[2], children] } else if (element[2] && typeof element[2] === 'object') { children = {} Object.keys(element[2]).forEach(function (key) { children[key] = interpretAST(element[2][key], element, locale, types, join) }) element = [element[0], element[1], children] } var getFrmt = type && (types[type] || defaults[type]) if (getFrmt) { var frmt = getFrmt(element, locale) return function format (args) { return frmt(getArg(id, args), args) } } return join ? function format (args) { return String(getArg(id, args)) } : function format (args) { return getArg(id, args) } } function getArg (id/*: string */, args/*: ?Object */)/*: any */ { if (args && (id in args)) return args[id] var parts = id.split('.') var a = args for (var i = 0, ii = parts.length; a && i < ii; ++i) { a = a[parts[i]] } return a } function interpretNumber (element/*: Placeholder */, locales/*: Locales */) { var style = element[2] var options = formats.number[style] || formats.parseNumberPattern(style) || formats.number.default return new Intl.NumberFormat(locales, options).format } function interpretDuration (element/*: Placeholder */, locales/*: Locales */) { var style = element[2] var options = formats.duration[style] || formats.duration.default var fs = new Intl.NumberFormat(locales, options.seconds).format var fm = new Intl.NumberFormat(locales, options.minutes).format var fh = new Intl.NumberFormat(locales, options.hours).format var sep = /^fi$|^fi-|^da/.test(String(locales)) ? '.' : ':' return function (s, args) { s = +s if (!isFinite(s)) return fs(s) var h = ~~(s / 60 / 60) // ~~ acts much like Math.trunc var m = ~~(s / 60 % 60) var dur = (h ? (fh(Math.abs(h)) + sep) : '') + fm(Math.abs(m)) + sep + fs(Math.abs(s % 60)) return s < 0 ? fh(-1).replace(fh(1), dur) : dur } } function interpretDateTime (element/*: Placeholder */, locales/*: Locales */) { var type = element[1] var style = element[2] var options = formats[type][style] || formats.parseDatePattern(style) || formats[type].default return new Intl.DateTimeFormat(locales, options).format } function interpretPlural (element/*: Placeholder */, locales/*: Locales */) { var type = element[1] var pluralType = type === 'selectordinal' ? 'ordinal' : 'cardinal' var offset = element[2] var children = element[3] var pluralRules if (Intl.PluralRules && Intl.PluralRules.supportedLocalesOf(locales).length > 0) { pluralRules = new Intl.PluralRules(locales, { type: pluralType }) } else { var locale = lookupClosestLocale(locales, plurals) var select = (locale && plurals[locale][pluralType]) || returnOther pluralRules = { select: select } } return function (value, args) { var clause = children['=' + +value] || children[pluralRules.select(value - offset)] || children.other return clause(args) } } function returnOther (/*:: n:number */) { return 'other' } function interpretSelect (element/*: Placeholder */, locales/*: Locales */) { var children = element[2] return function (value, args) { var clause = children[value] || children.other return clause(args) } } var defaults/*: Types */ = { number: interpretNumber, ordinal: interpretNumber, // TODO: support rbnf spellout: interpretNumber, // TODO: support rbnf duration: interpretDuration, date: interpretDateTime, time: interpretDateTime, plural: interpretPlural, selectordinal: interpretPlural, select: interpretSelect } exports.types = defaults /***/ }), /***/ "./node_modules/format-message-interpret/plurals.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; // @flow /*:: export type Rule = 'zero' | 'one' | 'two' | 'few' | 'many' | 'other' */ var zero = 'zero', one = 'one', two = 'two', few = 'few', many = 'many', other = 'other' var f = [ function (s/*: string | number */)/*: Rule */ { var n = +s return n === 1 ? one : other }, function (s/*: string | number */)/*: Rule */ { var n = +s return 0 <= n && n <= 1 ? one : other }, function (s/*: string | number */)/*: Rule */ { var i = Math.floor(Math.abs(+s)) var n = +s return i === 0 || n === 1 ? one : other }, function (s/*: string | number */)/*: Rule */ { var n = +s return n === 0 ? zero : n === 1 ? one : n === 2 ? two : 3 <= n % 100 && n % 100 <= 10 ? few : 11 <= n % 100 && n % 100 <= 99 ? many : other }, function (s/*: string | number */)/*: Rule */ { var i = Math.floor(Math.abs(+s)) var v = (s + '.').split('.')[1].length return i === 1 && v === 0 ? one : other }, function (s/*: string | number */)/*: Rule */ { var n = +s return n % 10 === 1 && n % 100 !== 11 ? one : (2 <= n % 10 && n % 10 <= 4) && (n % 100 < 12 || 14 < n % 100) ? few : n % 10 === 0 || (5 <= n % 10 && n % 10 <= 9) || (11 <= n % 100 && n % 100 <= 14) ? many : other }, function (s/*: string | number */)/*: Rule */ { var n = +s return n % 10 === 1 && (n % 100 !== 11 && n % 100 !== 71 && n % 100 !== 91) ? one : n % 10 === 2 && (n % 100 !== 12 && n % 100 !== 72 && n % 100 !== 92) ? two : ((3 <= n % 10 && n % 10 <= 4) || n % 10 === 9) && ((n % 100 < 10 || 19 < n % 100) && (n % 100 < 70 || 79 < n % 100) && (n % 100 < 90 || 99 < n % 100)) ? few : n !== 0 && n % 1000000 === 0 ? many : other }, function (s/*: string | number */)/*: Rule */ { var i = Math.floor(Math.abs(+s)) var v = (s + '.').split('.')[1].length var f = +(s + '.').split('.')[1] return v === 0 && i % 10 === 1 && i % 100 !== 11 || f % 10 === 1 && f % 100 !== 11 ? one : v === 0 && (2 <= i % 10 && i % 10 <= 4) && (i % 100 < 12 || 14 < i % 100) || (2 <= f % 10 && f % 10 <= 4) && (f % 100 < 12 || 14 < f % 100) ? few : other }, function (s/*: string | number */)/*: Rule */ { var i = Math.floor(Math.abs(+s)) var v = (s + '.').split('.')[1].length return i === 1 && v === 0 ? one : (2 <= i && i <= 4) && v === 0 ? few : v !== 0 ? many : other }, function (s/*: string | number */)/*: Rule */ { var n = +s return n === 0 ? zero : n === 1 ? one : n === 2 ? two : n === 3 ? few : n === 6 ? many : other }, function (s/*: string | number */)/*: Rule */ { var i = Math.floor(Math.abs(+s)) var t = +('' + s).replace(/^[^.]*.?|0+$/g, '') var n = +s return n === 1 || t !== 0 && (i === 0 || i === 1) ? one : other }, function (s/*: string | number */)/*: Rule */ { var i = Math.floor(Math.abs(+s)) var v = (s + '.').split('.')[1].length var f = +(s + '.').split('.')[1] return v === 0 && i % 100 === 1 || f % 100 === 1 ? one : v === 0 && i % 100 === 2 || f % 100 === 2 ? two : v === 0 && (3 <= i % 100 && i % 100 <= 4) || (3 <= f % 100 && f % 100 <= 4) ? few : other }, function (s/*: string | number */)/*: Rule */ { var i = Math.floor(Math.abs(+s)) return i === 0 || i === 1 ? one : other }, function (s/*: string | number */)/*: Rule */ { var i = Math.floor(Math.abs(+s)) var v = (s + '.').split('.')[1].length var f = +(s + '.').split('.')[1] return v === 0 && (i === 1 || i === 2 || i === 3) || v === 0 && (i % 10 !== 4 && i % 10 !== 6 && i % 10 !== 9) || v !== 0 && (f % 10 !== 4 && f % 10 !== 6 && f % 10 !== 9) ? one : other }, function (s/*: string | number */)/*: Rule */ { var n = +s return n === 1 ? one : n === 2 ? two : 3 <= n && n <= 6 ? few : 7 <= n && n <= 10 ? many : other }, function (s/*: string | number */)/*: Rule */ { var n = +s return n === 1 || n === 11 ? one : n === 2 || n === 12 ? two : ((3 <= n && n <= 10) || (13 <= n && n <= 19)) ? few : other }, function (s/*: string | number */)/*: Rule */ { var i = Math.floor(Math.abs(+s)) var v = (s + '.').split('.')[1].length return v === 0 && i % 10 === 1 ? one : v === 0 && i % 10 === 2 ? two : v === 0 && (i % 100 === 0 || i % 100 === 20 || i % 100 === 40 || i % 100 === 60 || i % 100 === 80) ? few : v !== 0 ? many : other }, function (s/*: string | number */)/*: Rule */ { var i = Math.floor(Math.abs(+s)) var v = (s + '.').split('.')[1].length var n = +s return i === 1 && v === 0 ? one : i === 2 && v === 0 ? two : v === 0 && (n < 0 || 10 < n) && n % 10 === 0 ? many : other }, function (s/*: string | number */)/*: Rule */ { var i = Math.floor(Math.abs(+s)) var t = +('' + s).replace(/^[^.]*.?|0+$/g, '') return t === 0 && i % 10 === 1 && i % 100 !== 11 || t !== 0 ? one : other }, function (s/*: string | number */)/*: Rule */ { var n = +s return n === 1 ? one : n === 2 ? two : other }, function (s/*: string | number */)/*: Rule */ { var n = +s return n === 0 ? zero : n === 1 ? one : other }, function (s/*: string | number */)/*: Rule */ { var i = Math.floor(Math.abs(+s)) var n = +s return n === 0 ? zero : (i === 0 || i === 1) && n !== 0 ? one : other }, function (s/*: string | number */)/*: Rule */ { var f = +(s + '.').split('.')[1] var n = +s return n % 10 === 1 && (n % 100 < 11 || 19 < n % 100) ? one : (2 <= n % 10 && n % 10 <= 9) && (n % 100 < 11 || 19 < n % 100) ? few : f !== 0 ? many : other }, function (s/*: string | number */)/*: Rule */ { var v = (s + '.').split('.')[1].length var f = +(s + '.').split('.')[1] var n = +s return n % 10 === 0 || (11 <= n % 100 && n % 100 <= 19) || v === 2 && (11 <= f % 100 && f % 100 <= 19) ? zero : n % 10 === 1 && n % 100 !== 11 || v === 2 && f % 10 === 1 && f % 100 !== 11 || v !== 2 && f % 10 === 1 ? one : other }, function (s/*: string | number */)/*: Rule */ { var i = Math.floor(Math.abs(+s)) var v = (s + '.').split('.')[1].length var f = +(s + '.').split('.')[1] return v === 0 && i % 10 === 1 && i % 100 !== 11 || f % 10 === 1 && f % 100 !== 11 ? one : other }, function (s/*: string | number */)/*: Rule */ { var i = Math.floor(Math.abs(+s)) var v = (s + '.').split('.')[1].length var n = +s return i === 1 && v === 0 ? one : v !== 0 || n === 0 || n !== 1 && (1 <= n % 100 && n % 100 <= 19) ? few : other }, function (s/*: string | number */)/*: Rule */ { var n = +s return n === 1 ? one : n === 0 || (2 <= n % 100 && n % 100 <= 10) ? few : 11 <= n % 100 && n % 100 <= 19 ? many : other }, function (s/*: string | number */)/*: Rule */ { var i = Math.floor(Math.abs(+s)) var v = (s + '.').split('.')[1].length return i === 1 && v === 0 ? one : v === 0 && (2 <= i % 10 && i % 10 <= 4) && (i % 100 < 12 || 14 < i % 100) ? few : v === 0 && i !== 1 && (0 <= i % 10 && i % 10 <= 1) || v === 0 && (5 <= i % 10 && i % 10 <= 9) || v === 0 && (12 <= i % 100 && i % 100 <= 14) ? many : other }, function (s/*: string | number */)/*: Rule */ { var i = Math.floor(Math.abs(+s)) return 0 <= i && i <= 1 ? one : other }, function (s/*: string | number */)/*: Rule */ { var i = Math.floor(Math.abs(+s)) var v = (s + '.').split('.')[1].length return v === 0 && i % 10 === 1 && i % 100 !== 11 ? one : v === 0 && (2 <= i % 10 && i % 10 <= 4) && (i % 100 < 12 || 14 < i % 100) ? few : v === 0 && i % 10 === 0 || v === 0 && (5 <= i % 10 && i % 10 <= 9) || v === 0 && (11 <= i % 100 && i % 100 <= 14) ? many : other }, function (s/*: string | number */)/*: Rule */ { var i = Math.floor(Math.abs(+s)) var n = +s return i === 0 || n === 1 ? one : 2 <= n && n <= 10 ? few : other }, function (s/*: string | number */)/*: Rule */ { var i = Math.floor(Math.abs(+s)) var f = +(s + '.').split('.')[1] var n = +s return (n === 0 || n === 1) || i === 0 && f === 1 ? one : other }, function (s/*: string | number */)/*: Rule */ { var i = Math.floor(Math.abs(+s)) var v = (s + '.').split('.')[1].length return v === 0 && i % 100 === 1 ? one : v === 0 && i % 100 === 2 ? two : v === 0 && (3 <= i % 100 && i % 100 <= 4) || v !== 0 ? few : other }, function (s/*: string | number */)/*: Rule */ { var n = +s return (0 <= n && n <= 1) || (11 <= n && n <= 99) ? one : other }, function (s/*: string | number */)/*: Rule */ { var n = +s return n === 1 || n === 5 || n === 7 || n === 8 || n === 9 || n === 10 ? one : n === 2 || n === 3 ? two : n === 4 ? few : n === 6 ? many : other }, function (s/*: string | number */)/*: Rule */ { var i = Math.floor(Math.abs(+s)) return (i % 10 === 1 || i % 10 === 2 || i % 10 === 5 || i % 10 === 7 || i % 10 === 8) || (i % 100 === 20 || i % 100 === 50 || i % 100 === 70 || i % 100 === 80) ? one : (i % 10 === 3 || i % 10 === 4) || (i % 1000 === 100 || i % 1000 === 200 || i % 1000 === 300 || i % 1000 === 400 || i % 1000 === 500 || i % 1000 === 600 || i % 1000 === 700 || i % 1000 === 800 || i % 1000 === 900) ? few : i === 0 || i % 10 === 6 || (i % 100 === 40 || i % 100 === 60 || i % 100 === 90) ? many : other }, function (s/*: string | number */)/*: Rule */ { var n = +s return (n % 10 === 2 || n % 10 === 3) && (n % 100 !== 12 && n % 100 !== 13) ? few : other }, function (s/*: string | number */)/*: Rule */ { var n = +s return n === 1 || n === 3 ? one : n === 2 ? two : n === 4 ? few : other }, function (s/*: string | number */)/*: Rule */ { var n = +s return n === 0 || n === 7 || n === 8 || n === 9 ? zero : n === 1 ? one : n === 2 ? two : n === 3 || n === 4 ? few : n === 5 || n === 6 ? many : other }, function (s/*: string | number */)/*: Rule */ { var n = +s return n % 10 === 1 && n % 100 !== 11 ? one : n % 10 === 2 && n % 100 !== 12 ? two : n % 10 === 3 && n % 100 !== 13 ? few : other }, function (s/*: string | number */)/*: Rule */ { var n = +s return n === 1 || n === 11 ? one : n === 2 || n === 12 ? two : n === 3 || n === 13 ? few : other }, function (s/*: string | number */)/*: Rule */ { var n = +s return n === 1 ? one : n === 2 || n === 3 ? two : n === 4 ? few : n === 6 ? many : other }, function (s/*: string | number */)/*: Rule */ { var n = +s return n === 1 || n === 5 ? one : other }, function (s/*: string | number */)/*: Rule */ { var n = +s return n === 11 || n === 8 || n === 80 || n === 800 ? many : other }, function (s/*: string | number */)/*: Rule */ { var i = Math.floor(Math.abs(+s)) return i === 1 ? one : i === 0 || ((2 <= i % 100 && i % 100 <= 20) || i % 100 === 40 || i % 100 === 60 || i % 100 === 80) ? many : other }, function (s/*: string | number */)/*: Rule */ { var n = +s return n % 10 === 6 || n % 10 === 9 || n % 10 === 0 && n !== 0 ? many : other }, function (s/*: string | number */)/*: Rule */ { var i = Math.floor(Math.abs(+s)) return i % 10 === 1 && i % 100 !== 11 ? one : i % 10 === 2 && i % 100 !== 12 ? two : (i % 10 === 7 || i % 10 === 8) && (i % 100 !== 17 && i % 100 !== 18) ? many : other }, function (s/*: string | number */)/*: Rule */ { var n = +s return n === 1 ? one : n === 2 || n === 3 ? two : n === 4 ? few : other }, function (s/*: string | number */)/*: Rule */ { var n = +s return 1 <= n && n <= 4 ? one : other }, function (s/*: string | number */)/*: Rule */ { var n = +s return (n === 1 || n === 5 || (7 <= n && n <= 9)) ? one : n === 2 || n === 3 ? two : n === 4 ? few : n === 6 ? many : other }, function (s/*: string | number */)/*: Rule */ { var n = +s return n === 1 ? one : n % 10 === 4 && n % 100 !== 14 ? many : other }, function (s/*: string | number */)/*: Rule */ { var n = +s return (n % 10 === 1 || n % 10 === 2) && (n % 100 !== 11 && n % 100 !== 12) ? one : other }, function (s/*: string | number */)/*: Rule */ { var n = +s return (n % 10 === 6 || n % 10 === 9) || n === 10 ? few : other }, function (s/*: string | number */)/*: Rule */ { var n = +s return n % 10 === 3 && n % 100 !== 13 ? few : other } ] module.exports = { af: { cardinal: f[0] }, ak: { cardinal: f[1] }, am: { cardinal: f[2] }, ar: { cardinal: f[3] }, ars: { cardinal: f[3] }, as: { cardinal: f[2], ordinal: f[34] }, asa: { cardinal: f[0] }, ast: { cardinal: f[4] }, az: { cardinal: f[0], ordinal: f[35] }, be: { cardinal: f[5], ordinal: f[36] }, bem: { cardinal: f[0] }, bez: { cardinal: f[0] }, bg: { cardinal: f[0] }, bh: { cardinal: f[1] }, bn: { cardinal: f[2], ordinal: f[34] }, br: { cardinal: f[6] }, brx: { cardinal: f[0] }, bs: { cardinal: f[7] }, ca: { cardinal: f[4], ordinal: f[37] }, ce: { cardinal: f[0] }, cgg: { cardinal: f[0] }, chr: { cardinal: f[0] }, ckb: { cardinal: f[0] }, cs: { cardinal: f[8] }, cy: { cardinal: f[9], ordinal: f[38] }, da: { cardinal: f[10] }, de: { cardinal: f[4] }, dsb: { cardinal: f[11] }, dv: { cardinal: f[0] }, ee: { cardinal: f[0] }, el: { cardinal: f[0] }, en: { cardinal: f[4], ordinal: f[39] }, eo: { cardinal: f[0] }, es: { cardinal: f[0] }, et: { cardinal: f[4] }, eu: { cardinal: f[0] }, fa: { cardinal: f[2] }, ff: { cardinal: f[12] }, fi: { cardinal: f[4] }, fil: { cardinal: f[13], ordinal: f[0] }, fo: { cardinal: f[0] }, fr: { cardinal: f[12], ordinal: f[0] }, fur: { cardinal: f[0] }, fy: { cardinal: f[4] }, ga: { cardinal: f[14], ordinal: f[0] }, gd: { cardinal: f[15], ordinal: f[40] }, gl: { cardinal: f[4] }, gsw: { cardinal: f[0] }, gu: { cardinal: f[2], ordinal: f[41] }, guw: { cardinal: f[1] }, gv: { cardinal: f[16] }, ha: { cardinal: f[0] }, haw: { cardinal: f[0] }, he: { cardinal: f[17] }, hi: { cardinal: f[2], ordinal: f[41] }, hr: { cardinal: f[7] }, hsb: { cardinal: f[11] }, hu: { cardinal: f[0], ordinal: f[42] }, hy: { cardinal: f[12], ordinal: f[0] }, ia: { cardinal: f[4] }, io: { cardinal: f[4] }, is: { cardinal: f[18] }, it: { cardinal: f[4], ordinal: f[43] }, iu: { cardinal: f[19] }, iw: { cardinal: f[17] }, jgo: { cardinal: f[0] }, ji: { cardinal: f[4] }, jmc: { cardinal: f[0] }, ka: { cardinal: f[0], ordinal: f[44] }, kab: { cardinal: f[12] }, kaj: { cardinal: f[0] }, kcg: { cardinal: f[0] }, kk: { cardinal: f[0], ordinal: f[45] }, kkj: { cardinal: f[0] }, kl: { cardinal: f[0] }, kn: { cardinal: f[2] }, ks: { cardinal: f[0] }, ksb: { cardinal: f[0] }, ksh: { cardinal: f[20] }, ku: { cardinal: f[0] }, kw: { cardinal: f[19] }, ky: { cardinal: f[0] }, lag: { cardinal: f[21] }, lb: { cardinal: f[0] }, lg: { cardinal: f[0] }, ln: { cardinal: f[1] }, lt: { cardinal: f[22] }, lv: { cardinal: f[23] }, mas: { cardinal: f[0] }, mg: { cardinal: f[1] }, mgo: { cardinal: f[0] }, mk: { cardinal: f[24], ordinal: f[46] }, ml: { cardinal: f[0] }, mn: { cardinal: f[0] }, mo: { cardinal: f[25], ordinal: f[0] }, mr: { cardinal: f[2], ordinal: f[47] }, mt: { cardinal: f[26] }, nah: { cardinal: f[0] }, naq: { cardinal: f[19] }, nb: { cardinal: f[0] }, nd: { cardinal: f[0] }, ne: { cardinal: f[0], ordinal: f[48] }, nl: { cardinal: f[4] }, nn: { cardinal: f[0] }, nnh: { cardinal: f[0] }, no: { cardinal: f[0] }, nr: { cardinal: f[0] }, nso: { cardinal: f[1] }, ny: { cardinal: f[0] }, nyn: { cardinal: f[0] }, om: { cardinal: f[0] }, or: { cardinal: f[0], ordinal: f[49] }, os: { cardinal: f[0] }, pa: { cardinal: f[1] }, pap: { cardinal: f[0] }, pl: { cardinal: f[27] }, prg: { cardinal: f[23] }, ps: { cardinal: f[0] }, pt: { cardinal: f[28] }, 'pt-PT': { cardinal: f[4] }, rm: { cardinal: f[0] }, ro: { cardinal: f[25], ordinal: f[0] }, rof: { cardinal: f[0] }, ru: { cardinal: f[29] }, rwk: { cardinal: f[0] }, saq: { cardinal: f[0] }, sc: { cardinal: f[4], ordinal: f[43] }, scn: { cardinal: f[4], ordinal: f[43] }, sd: { cardinal: f[0] }, sdh: { cardinal: f[0] }, se: { cardinal: f[19] }, seh: { cardinal: f[0] }, sh: { cardinal: f[7] }, shi: { cardinal: f[30] }, si: { cardinal: f[31] }, sk: { cardinal: f[8] }, sl: { cardinal: f[32] }, sma: { cardinal: f[19] }, smi: { cardinal: f[19] }, smj: { cardinal: f[19] }, smn: { cardinal: f[19] }, sms: { cardinal: f[19] }, sn: { cardinal: f[0] }, so: { cardinal: f[0] }, sq: { cardinal: f[0], ordinal: f[50] }, sr: { cardinal: f[7] }, ss: { cardinal: f[0] }, ssy: { cardinal: f[0] }, st: { cardinal: f[0] }, sv: { cardinal: f[4], ordinal: f[51] }, sw: { cardinal: f[4] }, syr: { cardinal: f[0] }, ta: { cardinal: f[0] }, te: { cardinal: f[0] }, teo: { cardinal: f[0] }, ti: { cardinal: f[1] }, tig: { cardinal: f[0] }, tk: { cardinal: f[0], ordinal: f[52] }, tl: { cardinal: f[13], ordinal: f[0] }, tn: { cardinal: f[0] }, tr: { cardinal: f[0] }, ts: { cardinal: f[0] }, tzm: { cardinal: f[33] }, ug: { cardinal: f[0] }, uk: { cardinal: f[29], ordinal: f[53] }, ur: { cardinal: f[4] }, uz: { cardinal: f[0] }, ve: { cardinal: f[0] }, vo: { cardinal: f[0] }, vun: { cardinal: f[0] }, wa: { cardinal: f[1] }, wae: { cardinal: f[0] }, xh: { cardinal: f[0] }, xog: { cardinal: f[0] }, yi: { cardinal: f[4] }, zu: { cardinal: f[2] }, lo: { ordinal: f[0] }, ms: { ordinal: f[0] }, vi: { ordinal: f[0] } } /***/ }), /***/ "./node_modules/format-message-parse/index.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; // @flow /*:: export type AST = Element[] export type Element = string | Placeholder export type Placeholder = Plural | Styled | Typed | Simple export type Plural = [ string, 'plural' | 'selectordinal', number, SubMessages ] export type Styled = [ string, string, string | SubMessages ] export type Typed = [ string, string ] export type Simple = [ string ] export type SubMessages = { [string]: AST } export type Token = [ TokenType, string ] export type TokenType = 'text' | 'space' | 'id' | 'type' | 'style' | 'offset' | 'number' | 'selector' | 'syntax' type Context = {| pattern: string, index: number, tagsType: ?string, tokens: ?Token[] |} */ var ARG_OPN = '{' var ARG_CLS = '}' var ARG_SEP = ',' var NUM_ARG = '#' var TAG_OPN = '<' var TAG_CLS = '>' var TAG_END = '' var ESC = '\'' var OFFSET = 'offset:' var simpleTypes = [ 'number', 'date', 'time', 'ordinal', 'duration', 'spellout' ] var submTypes = [ 'plural', 'select', 'selectordinal' ] /** * parse * * Turns this: * `You have { numBananas, plural, * =0 {no bananas} * one {a banana} * other {# bananas} * } for sale` * * into this: * [ "You have ", [ "numBananas", "plural", 0, { * "=0": [ "no bananas" ], * "one": [ "a banana" ], * "other": [ [ '#' ], " bananas" ] * } ], " for sale." ] * * tokens: * [ * [ "text", "You have " ], * [ "syntax", "{" ], * [ "space", " " ], * [ "id", "numBananas" ], * [ "syntax", ", " ], * [ "space", " " ], * [ "type", "plural" ], * [ "syntax", "," ], * [ "space", "\n " ], * [ "selector", "=0" ], * [ "space", " " ], * [ "syntax", "{" ], * [ "text", "no bananas" ], * [ "syntax", "}" ], * [ "space", "\n " ], * [ "selector", "one" ], * [ "space", " " ], * [ "syntax", "{" ], * [ "text", "a banana" ], * [ "syntax", "}" ], * [ "space", "\n " ], * [ "selector", "other" ], * [ "space", " " ], * [ "syntax", "{" ], * [ "syntax", "#" ], * [ "text", " bananas" ], * [ "syntax", "}" ], * [ "space", "\n" ], * [ "syntax", "}" ], * [ "text", " for sale." ] * ] **/ exports = module.exports = function parse ( pattern/*: string */, options/*:: ?: { tagsType?: string, tokens?: Token[] } */ )/*: AST */ { return parseAST({ pattern: String(pattern), index: 0, tagsType: (options && options.tagsType) || null, tokens: (options && options.tokens) || null }, '') } function parseAST (current/*: Context */, parentType/*: string */)/*: AST */ { var pattern = current.pattern var length = pattern.length var elements/*: AST */ = [] var start = current.index var text = parseText(current, parentType) if (text) elements.push(text) if (text && current.tokens) current.tokens.push(['text', pattern.slice(start, current.index)]) while (current.index < length) { if (pattern[current.index] === ARG_CLS) { if (!parentType) throw expected(current) break } if (parentType && current.tagsType && pattern.slice(current.index, current.index + TAG_END.length) === TAG_END) break elements.push(parsePlaceholder(current)) start = current.index text = parseText(current, parentType) if (text) elements.push(text) if (text && current.tokens) current.tokens.push(['text', pattern.slice(start, current.index)]) } return elements } function parseText (current/*: Context */, parentType/*: string */)/*: string */ { var pattern = current.pattern var length = pattern.length var isHashSpecial = (parentType === 'plural' || parentType === 'selectordinal') var isAngleSpecial = !!current.tagsType var isArgStyle = (parentType === '{style}') var text = '' while (current.index < length) { var char = pattern[current.index] if ( char === ARG_OPN || char === ARG_CLS || (isHashSpecial && char === NUM_ARG) || (isAngleSpecial && char === TAG_OPN) || (isArgStyle && isWhitespace(char.charCodeAt(0))) ) { break } else if (char === ESC) { char = pattern[++current.index] if (char === ESC) { // double is always 1 ' text += char ++current.index } else if ( // only when necessary char === ARG_OPN || char === ARG_CLS || (isHashSpecial && char === NUM_ARG) || (isAngleSpecial && char === TAG_OPN) || isArgStyle ) { text += char while (++current.index < length) { char = pattern[current.index] if (char === ESC && pattern[current.index + 1] === ESC) { // double is always 1 ' text += ESC ++current.index } else if (char === ESC) { // end of quoted ++current.index break } else { text += char } } } else { // lone ' is just a ' text += ESC // already incremented } } else { text += char ++current.index } } return text } function isWhitespace (code/*: number */)/*: boolean */ { return ( (code >= 0x09 && code <= 0x0D) || code === 0x20 || code === 0x85 || code === 0xA0 || code === 0x180E || (code >= 0x2000 && code <= 0x200D) || code === 0x2028 || code === 0x2029 || code === 0x202F || code === 0x205F || code === 0x2060 || code === 0x3000 || code === 0xFEFF ) } function skipWhitespace (current/*: Context */)/*: void */ { var pattern = current.pattern var length = pattern.length var start = current.index while (current.index < length && isWhitespace(pattern.charCodeAt(current.index))) { ++current.index } if (start < current.index && current.tokens) { current.tokens.push(['space', current.pattern.slice(start, current.index)]) } } function parsePlaceholder (current/*: Context */)/*: Placeholder */ { var pattern = current.pattern if (pattern[current.index] === NUM_ARG) { if (current.tokens) current.tokens.push(['syntax', NUM_ARG]) ++current.index // move passed # return [NUM_ARG] } var tag = parseTag(current) if (tag) return tag /* istanbul ignore if should be unreachable if parseAST and parseText are right */ if (pattern[current.index] !== ARG_OPN) throw expected(current, ARG_OPN) if (current.tokens) current.tokens.push(['syntax', ARG_OPN]) ++current.index // move passed { skipWhitespace(current) var id = parseId(current) if (!id) throw expected(current, 'placeholder id') if (current.tokens) current.tokens.push(['id', id]) skipWhitespace(current) var char = pattern[current.index] if (char === ARG_CLS) { // end placeholder if (current.tokens) current.tokens.push(['syntax', ARG_CLS]) ++current.index // move passed } return [id] } if (char !== ARG_SEP) throw expected(current, ARG_SEP + ' or ' + ARG_CLS) if (current.tokens) current.tokens.push(['syntax', ARG_SEP]) ++current.index // move passed , skipWhitespace(current) var type = parseId(current) if (!type) throw expected(current, 'placeholder type') if (current.tokens) current.tokens.push(['type', type]) skipWhitespace(current) char = pattern[current.index] if (char === ARG_CLS) { // end placeholder if (current.tokens) current.tokens.push(['syntax', ARG_CLS]) if (type === 'plural' || type === 'selectordinal' || type === 'select') { throw expected(current, type + ' sub-messages') } ++current.index // move passed } return [id, type] } if (char !== ARG_SEP) throw expected(current, ARG_SEP + ' or ' + ARG_CLS) if (current.tokens) current.tokens.push(['syntax', ARG_SEP]) ++current.index // move passed , skipWhitespace(current) var arg if (type === 'plural' || type === 'selectordinal') { var offset = parsePluralOffset(current) skipWhitespace(current) arg = [id, type, offset, parseSubMessages(current, type)] } else if (type === 'select') { arg = [id, type, parseSubMessages(current, type)] } else if (simpleTypes.indexOf(type) >= 0) { arg = [id, type, parseSimpleFormat(current)] } else { // custom placeholder type var index = current.index var format/*: string | SubMessages */ = parseSimpleFormat(current) skipWhitespace(current) if (pattern[current.index] === ARG_OPN) { current.index = index // rewind, since should have been submessages format = parseSubMessages(current, type) } arg = [id, type, format] } skipWhitespace(current) if (pattern[current.index] !== ARG_CLS) throw expected(current, ARG_CLS) if (current.tokens) current.tokens.push(['syntax', ARG_CLS]) ++current.index // move passed } return arg } function parseTag (current/*: Context */)/*: ?Placeholder */ { var tagsType = current.tagsType if (!tagsType || current.pattern[current.index] !== TAG_OPN) return if (current.pattern.slice(current.index, current.index + TAG_END.length) === TAG_END) { throw expected(current, null, 'closing tag without matching opening tag') } if (current.tokens) current.tokens.push(['syntax', TAG_OPN]) ++current.index // move passed < var id = parseId(current, true) if (!id) throw expected(current, 'placeholder id') if (current.tokens) current.tokens.push(['id', id]) skipWhitespace(current) if (current.pattern.slice(current.index, current.index + TAG_SELF_CLS.length) === TAG_SELF_CLS) { if (current.tokens) current.tokens.push(['syntax', TAG_SELF_CLS]) current.index += TAG_SELF_CLS.length return [id, tagsType] } if (current.pattern[current.index] !== TAG_CLS) throw expected(current, TAG_CLS) if (current.tokens) current.tokens.push(['syntax', TAG_CLS]) ++current.index // move passed > var children = parseAST(current, tagsType) var end = current.index if (current.pattern.slice(current.index, current.index + TAG_END.length) !== TAG_END) throw expected(current, TAG_END + id + TAG_CLS) if (current.tokens) current.tokens.push(['syntax', TAG_END]) current.index += TAG_END.length var closeId = parseId(current, true) if (closeId && current.tokens) current.tokens.push(['id', closeId]) if (id !== closeId) { current.index = end // rewind for better error message throw expected(current, TAG_END + id + TAG_CLS, TAG_END + closeId + TAG_CLS) } skipWhitespace(current) if (current.pattern[current.index] !== TAG_CLS) throw expected(current, TAG_CLS) if (current.tokens) current.tokens.push(['syntax', TAG_CLS]) ++current.index // move passed > return [id, tagsType, { children: children }] } function parseId (current/*: Context */, isTag/*:: ?: boolean */)/*: string */ { var pattern = current.pattern var length = pattern.length var id = '' while (current.index < length) { var char = pattern[current.index] if ( char === ARG_OPN || char === ARG_CLS || char === ARG_SEP || char === NUM_ARG || char === ESC || isWhitespace(char.charCodeAt(0)) || (isTag && (char === TAG_OPN || char === TAG_CLS || char === '/')) ) break id += char ++current.index } return id } function parseSimpleFormat (current/*: Context */)/*: string */ { var start = current.index var style = parseText(current, '{style}') if (!style) throw expected(current, 'placeholder style name') if (current.tokens) current.tokens.push(['style', current.pattern.slice(start, current.index)]) return style } function parsePluralOffset (current/*: Context */)/*: number */ { var pattern = current.pattern var length = pattern.length var offset = 0 if (pattern.slice(current.index, current.index + OFFSET.length) === OFFSET) { if (current.tokens) current.tokens.push(['offset', 'offset'], ['syntax', ':']) current.index += OFFSET.length // move passed offset: skipWhitespace(current) var start = current.index while (current.index < length && isDigit(pattern.charCodeAt(current.index))) { ++current.index } if (start === current.index) throw expected(current, 'offset number') if (current.tokens) current.tokens.push(['number', pattern.slice(start, current.index)]) offset = +pattern.slice(start, current.index) } return offset } function isDigit (code/*: number */)/*: boolean */ { return (code >= 0x30 && code <= 0x39) } function parseSubMessages (current/*: Context */, parentType/*: string */)/*: SubMessages */ { var pattern = current.pattern var length = pattern.length var options/*: SubMessages */ = {} while (current.index < length && pattern[current.index] !== ARG_CLS) { var selector = parseId(current) if (!selector) throw expected(current, 'sub-message selector') if (current.tokens) current.tokens.push(['selector', selector]) skipWhitespace(current) options[selector] = parseSubMessage(current, parentType) skipWhitespace(current) } if (!options.other && submTypes.indexOf(parentType) >= 0) { throw expected(current, null, null, '"other" sub-message must be specified in ' + parentType) } return options } function parseSubMessage (current/*: Context */, parentType/*: string */)/*: AST */ { if (current.pattern[current.index] !== ARG_OPN) throw expected(current, ARG_OPN + ' to start sub-message') if (current.tokens) current.tokens.push(['syntax', ARG_OPN]) ++current.index // move passed { var message = parseAST(current, parentType) if (current.pattern[current.index] !== ARG_CLS) throw expected(current, ARG_CLS + ' to end sub-message') if (current.tokens) current.tokens.push(['syntax', ARG_CLS]) ++current.index // move passed } return message } function expected (current/*: Context */, expected/*:: ?: ?string */, found/*:: ?: ?string */, message/*:: ?: string */) { var pattern = current.pattern var lines = pattern.slice(0, current.index).split(/\r?\n/) var offset = current.index var line = lines.length var column = lines.slice(-1)[0].length found = found || ( (current.index >= pattern.length) ? 'end of message pattern' : (parseId(current) || pattern[current.index]) ) if (!message) message = errorMessage(expected, found) message += ' in ' + pattern.replace(/\r?\n/g, '\n') return new SyntaxError(message, expected, found, offset, line, column) } function errorMessage (expected/*: ?string */, found/* string */) { if (!expected) return 'Unexpected ' + found + ' found' return 'Expected ' + expected + ' but found ' + found } /** * SyntaxError * Holds information about bad syntax found in a message pattern **/ function SyntaxError (message/*: string */, expected/*: ?string */, found/*: ?string */, offset/*: number */, line/*: number */, column/*: number */) { Error.call(this, message) this.name = 'SyntaxError' this.message = message this.expected = expected this.found = found this.offset = offset this.line = line this.column = column } SyntaxError.prototype = Object.create(Error.prototype) exports.SyntaxError = SyntaxError /***/ }), /***/ "./node_modules/format-message/index.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; // @flow var parse = __webpack_require__("./node_modules/format-message-parse/index.js") var interpret = __webpack_require__("./node_modules/format-message-interpret/index.js") var plurals = __webpack_require__("./node_modules/format-message-interpret/plurals.js") var lookupClosestLocale = __webpack_require__("./node_modules/lookup-closest-locale/index.js") var origFormats = __webpack_require__("./node_modules/format-message-formats/index.js") /*:: import type { Types } from 'format-message-interpret' type Locale = string type Locales = Locale | Locale[] type Message = string | {| id?: string, default: string, description?: string |} type Translations = { [string]: ?{ [string]: string | Translation } } type Translation = { message: string, format?: (args?: Object) => string, toParts?: (args?: Object) => any[], } type Replacement = ?string | (string, string, locales?: Locales) => ?string type GenerateId = (string) => string type MissingTranslation = 'ignore' | 'warning' | 'error' type FormatObject = { [string]: * } type Options = { locale?: Locales, translations?: ?Translations, generateId?: GenerateId, missingReplacement?: Replacement, missingTranslation?: MissingTranslation, formats?: { number?: FormatObject, date?: FormatObject, time?: FormatObject }, types?: Types } type Setup = {| locale: Locales, translations: Translations, generateId: GenerateId, missingReplacement: Replacement, missingTranslation: MissingTranslation, formats: { number: FormatObject, date: FormatObject, time: FormatObject }, types: Types |} type FormatMessage = { (msg: Message, args?: Object, locales?: Locales): string, rich (msg: Message, args?: Object, locales?: Locales): any[], setup (opt?: Options): Setup, number (value: number, style?: string, locales?: Locales): string, date (value: number | Date, style?: string, locales?: Locales): string, time (value: number | Date, style?: string, locales?: Locales): string, select (value: any, options: Object): any, custom (placeholder: any[], locales: Locales, value: any, args: Object): any, plural (value: number, offset: any, options: any, locale: any): any, selectordinal (value: number, offset: any, options: any, locale: any): any, namespace (): FormatMessage } */ function assign/*:: */ (target/*: T */, source/*: Object */) { Object.keys(source).forEach(function (key) { target[key] = source[key] }) return target } function namespace ()/*: FormatMessage */ { var formats = assign({}, origFormats) var currentLocales/*: Locales */ = 'en' var translations/*: Translations */ = {} var generateId/*: GenerateId */ = function (pattern) { return pattern } var missingReplacement/*: Replacement */ = null var missingTranslation/*: MissingTranslation */ = 'warning' var types/*: Types */ = {} function formatMessage (msg/*: Message */, args/*:: ?: Object */, locales/*:: ?: Locales */) { var pattern = typeof msg === 'string' ? msg : msg.default var id = (typeof msg === 'object' && msg.id) || generateId(pattern) var translated = translate(pattern, id, locales || currentLocales) var format = translated.format || ( translated.format = interpret(parse(translated.message), locales || currentLocales, types) ) return format(args) } formatMessage.rich = function rich (msg/*: Message */, args/*:: ?: Object */, locales/*:: ?: Locales */) { var pattern = typeof msg === 'string' ? msg : msg.default var id = (typeof msg === 'object' && msg.id) || generateId(pattern) var translated = translate(pattern, id, locales || currentLocales) var format = translated.toParts || ( translated.toParts = interpret.toParts(parse(translated.message, { tagsType: tagsType }), locales || currentLocales, types) ) return format(args) } var tagsType = '<>' function richType (node/*: any[] */, locales/*: Locales */) { var style = node[2] return function (fn, args) { var props = typeof style === 'object' ? mapObject(style, args) : style return typeof fn === 'function' ? fn(props) : fn } } types[tagsType] = richType function mapObject (object/* { [string]: (args?: Object) => any } */, args/*: ?Object */) { return Object.keys(object).reduce(function (mapped, key) { mapped[key] = object[key](args) return mapped }, {}) } function translate (pattern/*: string */, id/*: string */, locales/*: Locales */)/*: Translation */ { var locale = lookupClosestLocale(locales, translations) || 'en' var messages = translations[locale] || (translations[locale] = {}) var translated = messages[id] if (typeof translated === 'string') { translated = messages[id] = { message: translated } } if (!translated) { var message = 'Translation for "' + id + '" in "' + locale + '" is missing' if (missingTranslation === 'warning') { /* istanbul ignore else */ if (typeof console !== 'undefined') console.warn(message) } else if (missingTranslation !== 'ignore') { // 'error' throw new Error(message) } var replacement = typeof missingReplacement === 'function' ? missingReplacement(pattern, id, locale) || pattern : missingReplacement || pattern translated = messages[id] = { message: replacement } } return translated } formatMessage.setup = function setup (opt/*:: ?: Options */) { opt = opt || {} if (opt.locale) currentLocales = opt.locale if ('translations' in opt) translations = opt.translations || {} if (opt.generateId) generateId = opt.generateId if ('missingReplacement' in opt) missingReplacement = opt.missingReplacement if (opt.missingTranslation) missingTranslation = opt.missingTranslation if (opt.formats) { if (opt.formats.number) assign(formats.number, opt.formats.number) if (opt.formats.date) assign(formats.date, opt.formats.date) if (opt.formats.time) assign(formats.time, opt.formats.time) } if (opt.types) { types = opt.types types[tagsType] = richType } return { locale: currentLocales, translations: translations, generateId: generateId, missingReplacement: missingReplacement, missingTranslation: missingTranslation, formats: formats, types: types } } formatMessage.number = function (value/*: number */, style/*:: ?: string */, locales/*:: ?: Locales */) { var options = (style && formats.number[style]) || formats.parseNumberPattern(style) || formats.number.default return new Intl.NumberFormat(locales || currentLocales, options).format(value) } formatMessage.date = function (value/*:: ?: number | Date */, style/*:: ?: string */, locales/*:: ?: Locales */) { var options = (style && formats.date[style]) || formats.parseDatePattern(style) || formats.date.default return new Intl.DateTimeFormat(locales || currentLocales, options).format(value) } formatMessage.time = function (value/*:: ?: number | Date */, style/*:: ?: string */, locales/*:: ?: Locales */) { var options = (style && formats.time[style]) || formats.parseDatePattern(style) || formats.time.default return new Intl.DateTimeFormat(locales || currentLocales, options).format(value) } formatMessage.select = function (value/*: any */, options/*: Object */) { return options[value] || options.other } formatMessage.custom = function (placeholder/*: any[] */, locales/*: Locales */, value/*: any */, args/*: Object */) { if (!(placeholder[1] in types)) return value return types[placeholder[1]](placeholder, locales)(value, args) } formatMessage.plural = plural.bind(null, 'cardinal') formatMessage.selectordinal = plural.bind(null, 'ordinal') function plural ( pluralType/*: 'cardinal' | 'ordinal' */, value/*: number */, offset/*: any */, options/*: any */, locale/*: any */ ) { if (typeof offset === 'object' && typeof options !== 'object') { // offset is optional locale = options options = offset offset = 0 } var closest = lookupClosestLocale(locale || currentLocales, plurals) var plural = (closest && plurals[closest][pluralType]) || returnOther return options['=' + +value] || options[plural(value - offset)] || options.other } function returnOther (/*:: n:number */) { return 'other' } formatMessage.namespace = namespace return formatMessage } module.exports = exports = namespace() /***/ }), /***/ "./node_modules/function-bind/implementation.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; /* eslint no-invalid-this: 1 */ var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible '; var slice = Array.prototype.slice; var toStr = Object.prototype.toString; var funcType = '[object Function]'; module.exports = function bind(that) { var target = this; if (typeof target !== 'function' || toStr.call(target) !== funcType) { throw new TypeError(ERROR_MESSAGE + target); } var args = slice.call(arguments, 1); var bound; var binder = function () { if (this instanceof bound) { var result = target.apply( this, args.concat(slice.call(arguments)) ); if (Object(result) === result) { return result; } return this; } else { return target.apply( that, args.concat(slice.call(arguments)) ); } }; var boundLength = Math.max(0, target.length - args.length); var boundArgs = []; for (var i = 0; i < boundLength; i++) { boundArgs.push('$' + i); } bound = Function('binder', 'return function (' + boundArgs.join(',') + '){ return binder.apply(this,arguments); }')(binder); if (target.prototype) { var Empty = function Empty() {}; Empty.prototype = target.prototype; bound.prototype = new Empty(); Empty.prototype = null; } return bound; }; /***/ }), /***/ "./node_modules/function-bind/index.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; var implementation = __webpack_require__("./node_modules/function-bind/implementation.js"); module.exports = Function.prototype.bind || implementation; /***/ }), /***/ "./node_modules/functions-have-names/index.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; var functionsHaveNames = function functionsHaveNames() { return typeof function f() {}.name === 'string'; }; var gOPD = Object.getOwnPropertyDescriptor; if (gOPD) { try { gOPD([], 'length'); } catch (e) { // IE 8 has a broken gOPD gOPD = null; } } functionsHaveNames.functionsHaveConfigurableNames = function functionsHaveConfigurableNames() { if (!functionsHaveNames() || !gOPD) { return false; } var desc = gOPD(function () {}, 'name'); return !!desc && !!desc.configurable; }; var $bind = Function.prototype.bind; functionsHaveNames.boundFunctionsHaveNames = function boundFunctionsHaveNames() { return functionsHaveNames() && typeof $bind === 'function' && function f() {}.bind().name !== ''; }; module.exports = functionsHaveNames; /***/ }), /***/ "./node_modules/get-intrinsic/index.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; var undefined; var $SyntaxError = SyntaxError; var $Function = Function; var $TypeError = TypeError; // eslint-disable-next-line consistent-return var getEvalledConstructor = function (expressionSyntax) { try { return $Function('"use strict"; return (' + expressionSyntax + ').constructor;')(); } catch (e) {} }; var $gOPD = Object.getOwnPropertyDescriptor; if ($gOPD) { try { $gOPD({}, ''); } catch (e) { $gOPD = null; // this is IE 8, which has a broken gOPD } } var throwTypeError = function () { throw new $TypeError(); }; var ThrowTypeError = $gOPD ? (function () { try { // eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties arguments.callee; // IE 8 does not throw here return throwTypeError; } catch (calleeThrows) { try { // IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '') return $gOPD(arguments, 'callee').get; } catch (gOPDthrows) { return throwTypeError; } } }()) : throwTypeError; var hasSymbols = __webpack_require__("./node_modules/has-symbols/index.js")(); var getProto = Object.getPrototypeOf || function (x) { return x.__proto__; }; // eslint-disable-line no-proto var needsEval = {}; var TypedArray = typeof Uint8Array === 'undefined' ? undefined : getProto(Uint8Array); var INTRINSICS = { '%AggregateError%': typeof AggregateError === 'undefined' ? undefined : AggregateError, '%Array%': Array, '%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer, '%ArrayIteratorPrototype%': hasSymbols ? getProto([][Symbol.iterator]()) : undefined, '%AsyncFromSyncIteratorPrototype%': undefined, '%AsyncFunction%': needsEval, '%AsyncGenerator%': needsEval, '%AsyncGeneratorFunction%': needsEval, '%AsyncIteratorPrototype%': needsEval, '%Atomics%': typeof Atomics === 'undefined' ? undefined : Atomics, '%BigInt%': typeof BigInt === 'undefined' ? undefined : BigInt, '%Boolean%': Boolean, '%DataView%': typeof DataView === 'undefined' ? undefined : DataView, '%Date%': Date, '%decodeURI%': decodeURI, '%decodeURIComponent%': decodeURIComponent, '%encodeURI%': encodeURI, '%encodeURIComponent%': encodeURIComponent, '%Error%': Error, '%eval%': eval, // eslint-disable-line no-eval '%EvalError%': EvalError, '%Float32Array%': typeof Float32Array === 'undefined' ? undefined : Float32Array, '%Float64Array%': typeof Float64Array === 'undefined' ? undefined : Float64Array, '%FinalizationRegistry%': typeof FinalizationRegistry === 'undefined' ? undefined : FinalizationRegistry, '%Function%': $Function, '%GeneratorFunction%': needsEval, '%Int8Array%': typeof Int8Array === 'undefined' ? undefined : Int8Array, '%Int16Array%': typeof Int16Array === 'undefined' ? undefined : Int16Array, '%Int32Array%': typeof Int32Array === 'undefined' ? undefined : Int32Array, '%isFinite%': isFinite, '%isNaN%': isNaN, '%IteratorPrototype%': hasSymbols ? getProto(getProto([][Symbol.iterator]())) : undefined, '%JSON%': typeof JSON === 'object' ? JSON : undefined, '%Map%': typeof Map === 'undefined' ? undefined : Map, '%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols ? undefined : getProto(new Map()[Symbol.iterator]()), '%Math%': Math, '%Number%': Number, '%Object%': Object, '%parseFloat%': parseFloat, '%parseInt%': parseInt, '%Promise%': typeof Promise === 'undefined' ? undefined : Promise, '%Proxy%': typeof Proxy === 'undefined' ? undefined : Proxy, '%RangeError%': RangeError, '%ReferenceError%': ReferenceError, '%Reflect%': typeof Reflect === 'undefined' ? undefined : Reflect, '%RegExp%': RegExp, '%Set%': typeof Set === 'undefined' ? undefined : Set, '%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols ? undefined : getProto(new Set()[Symbol.iterator]()), '%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer, '%String%': String, '%StringIteratorPrototype%': hasSymbols ? getProto(''[Symbol.iterator]()) : undefined, '%Symbol%': hasSymbols ? Symbol : undefined, '%SyntaxError%': $SyntaxError, '%ThrowTypeError%': ThrowTypeError, '%TypedArray%': TypedArray, '%TypeError%': $TypeError, '%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array, '%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray, '%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array, '%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array, '%URIError%': URIError, '%WeakMap%': typeof WeakMap === 'undefined' ? undefined : WeakMap, '%WeakRef%': typeof WeakRef === 'undefined' ? undefined : WeakRef, '%WeakSet%': typeof WeakSet === 'undefined' ? undefined : WeakSet }; var doEval = function doEval(name) { var value; if (name === '%AsyncFunction%') { value = getEvalledConstructor('async function () {}'); } else if (name === '%GeneratorFunction%') { value = getEvalledConstructor('function* () {}'); } else if (name === '%AsyncGeneratorFunction%') { value = getEvalledConstructor('async function* () {}'); } else if (name === '%AsyncGenerator%') { var fn = doEval('%AsyncGeneratorFunction%'); if (fn) { value = fn.prototype; } } else if (name === '%AsyncIteratorPrototype%') { var gen = doEval('%AsyncGenerator%'); if (gen) { value = getProto(gen.prototype); } } INTRINSICS[name] = value; return value; }; var LEGACY_ALIASES = { '%ArrayBufferPrototype%': ['ArrayBuffer', 'prototype'], '%ArrayPrototype%': ['Array', 'prototype'], '%ArrayProto_entries%': ['Array', 'prototype', 'entries'], '%ArrayProto_forEach%': ['Array', 'prototype', 'forEach'], '%ArrayProto_keys%': ['Array', 'prototype', 'keys'], '%ArrayProto_values%': ['Array', 'prototype', 'values'], '%AsyncFunctionPrototype%': ['AsyncFunction', 'prototype'], '%AsyncGenerator%': ['AsyncGeneratorFunction', 'prototype'], '%AsyncGeneratorPrototype%': ['AsyncGeneratorFunction', 'prototype', 'prototype'], '%BooleanPrototype%': ['Boolean', 'prototype'], '%DataViewPrototype%': ['DataView', 'prototype'], '%DatePrototype%': ['Date', 'prototype'], '%ErrorPrototype%': ['Error', 'prototype'], '%EvalErrorPrototype%': ['EvalError', 'prototype'], '%Float32ArrayPrototype%': ['Float32Array', 'prototype'], '%Float64ArrayPrototype%': ['Float64Array', 'prototype'], '%FunctionPrototype%': ['Function', 'prototype'], '%Generator%': ['GeneratorFunction', 'prototype'], '%GeneratorPrototype%': ['GeneratorFunction', 'prototype', 'prototype'], '%Int8ArrayPrototype%': ['Int8Array', 'prototype'], '%Int16ArrayPrototype%': ['Int16Array', 'prototype'], '%Int32ArrayPrototype%': ['Int32Array', 'prototype'], '%JSONParse%': ['JSON', 'parse'], '%JSONStringify%': ['JSON', 'stringify'], '%MapPrototype%': ['Map', 'prototype'], '%NumberPrototype%': ['Number', 'prototype'], '%ObjectPrototype%': ['Object', 'prototype'], '%ObjProto_toString%': ['Object', 'prototype', 'toString'], '%ObjProto_valueOf%': ['Object', 'prototype', 'valueOf'], '%PromisePrototype%': ['Promise', 'prototype'], '%PromiseProto_then%': ['Promise', 'prototype', 'then'], '%Promise_all%': ['Promise', 'all'], '%Promise_reject%': ['Promise', 'reject'], '%Promise_resolve%': ['Promise', 'resolve'], '%RangeErrorPrototype%': ['RangeError', 'prototype'], '%ReferenceErrorPrototype%': ['ReferenceError', 'prototype'], '%RegExpPrototype%': ['RegExp', 'prototype'], '%SetPrototype%': ['Set', 'prototype'], '%SharedArrayBufferPrototype%': ['SharedArrayBuffer', 'prototype'], '%StringPrototype%': ['String', 'prototype'], '%SymbolPrototype%': ['Symbol', 'prototype'], '%SyntaxErrorPrototype%': ['SyntaxError', 'prototype'], '%TypedArrayPrototype%': ['TypedArray', 'prototype'], '%TypeErrorPrototype%': ['TypeError', 'prototype'], '%Uint8ArrayPrototype%': ['Uint8Array', 'prototype'], '%Uint8ClampedArrayPrototype%': ['Uint8ClampedArray', 'prototype'], '%Uint16ArrayPrototype%': ['Uint16Array', 'prototype'], '%Uint32ArrayPrototype%': ['Uint32Array', 'prototype'], '%URIErrorPrototype%': ['URIError', 'prototype'], '%WeakMapPrototype%': ['WeakMap', 'prototype'], '%WeakSetPrototype%': ['WeakSet', 'prototype'] }; var bind = __webpack_require__("./node_modules/function-bind/index.js"); var hasOwn = __webpack_require__("./node_modules/has/src/index.js"); var $concat = bind.call(Function.call, Array.prototype.concat); var $spliceApply = bind.call(Function.apply, Array.prototype.splice); var $replace = bind.call(Function.call, String.prototype.replace); var $strSlice = bind.call(Function.call, String.prototype.slice); var $exec = bind.call(Function.call, RegExp.prototype.exec); /* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */ var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g; var reEscapeChar = /\\(\\)?/g; /** Used to match backslashes in property paths. */ var stringToPath = function stringToPath(string) { var first = $strSlice(string, 0, 1); var last = $strSlice(string, -1); if (first === '%' && last !== '%') { throw new $SyntaxError('invalid intrinsic syntax, expected closing `%`'); } else if (last === '%' && first !== '%') { throw new $SyntaxError('invalid intrinsic syntax, expected opening `%`'); } var result = []; $replace(string, rePropName, function (match, number, quote, subString) { result[result.length] = quote ? $replace(subString, reEscapeChar, '$1') : number || match; }); return result; }; /* end adaptation */ var getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) { var intrinsicName = name; var alias; if (hasOwn(LEGACY_ALIASES, intrinsicName)) { alias = LEGACY_ALIASES[intrinsicName]; intrinsicName = '%' + alias[0] + '%'; } if (hasOwn(INTRINSICS, intrinsicName)) { var value = INTRINSICS[intrinsicName]; if (value === needsEval) { value = doEval(intrinsicName); } if (typeof value === 'undefined' && !allowMissing) { throw new $TypeError('intrinsic ' + name + ' exists, but is not available. Please file an issue!'); } return { alias: alias, name: intrinsicName, value: value }; } throw new $SyntaxError('intrinsic ' + name + ' does not exist!'); }; module.exports = function GetIntrinsic(name, allowMissing) { if (typeof name !== 'string' || name.length === 0) { throw new $TypeError('intrinsic name must be a non-empty string'); } if (arguments.length > 1 && typeof allowMissing !== 'boolean') { throw new $TypeError('"allowMissing" argument must be a boolean'); } if ($exec(/^%?[^%]*%?$/, name) === null) { throw new $SyntaxError('`%` may not be present anywhere but at the beginning and end of the intrinsic name'); } var parts = stringToPath(name); var intrinsicBaseName = parts.length > 0 ? parts[0] : ''; var intrinsic = getBaseIntrinsic('%' + intrinsicBaseName + '%', allowMissing); var intrinsicRealName = intrinsic.name; var value = intrinsic.value; var skipFurtherCaching = false; var alias = intrinsic.alias; if (alias) { intrinsicBaseName = alias[0]; $spliceApply(parts, $concat([0, 1], alias)); } for (var i = 1, isOwn = true; i < parts.length; i += 1) { var part = parts[i]; var first = $strSlice(part, 0, 1); var last = $strSlice(part, -1); if ( ( (first === '"' || first === "'" || first === '`') || (last === '"' || last === "'" || last === '`') ) && first !== last ) { throw new $SyntaxError('property names with quotes must have matching quotes'); } if (part === 'constructor' || !isOwn) { skipFurtherCaching = true; } intrinsicBaseName += '.' + part; intrinsicRealName = '%' + intrinsicBaseName + '%'; if (hasOwn(INTRINSICS, intrinsicRealName)) { value = INTRINSICS[intrinsicRealName]; } else if (value != null) { if (!(part in value)) { if (!allowMissing) { throw new $TypeError('base intrinsic for ' + name + ' exists, but the property is not available.'); } return void undefined; } if ($gOPD && (i + 1) >= parts.length) { var desc = $gOPD(value, part); isOwn = !!desc; // By convention, when a data property is converted to an accessor // property to emulate a data property that does not suffer from // the override mistake, that accessor's getter is marked with // an `originalValue` property. Here, when we detect this, we // uphold the illusion by pretending to see that original data // property, i.e., returning the value rather than the getter // itself. if (isOwn && 'get' in desc && !('originalValue' in desc.get)) { value = desc.get; } else { value = value[part]; } } else { isOwn = hasOwn(value, part); value = value[part]; } if (isOwn && !skipFurtherCaching) { INTRINSICS[intrinsicRealName] = value; } } } return value; }; /***/ }), /***/ "./node_modules/has-property-descriptors/index.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; var GetIntrinsic = __webpack_require__("./node_modules/get-intrinsic/index.js"); var $defineProperty = GetIntrinsic('%Object.defineProperty%', true); var hasPropertyDescriptors = function hasPropertyDescriptors() { if ($defineProperty) { try { $defineProperty({}, 'a', { value: 1 }); return true; } catch (e) { // IE 8 has a broken defineProperty return false; } } return false; }; hasPropertyDescriptors.hasArrayLengthDefineBug = function hasArrayLengthDefineBug() { // node v0.6 has a bug where array lengths can be Set but not Defined if (!hasPropertyDescriptors()) { return null; } try { return $defineProperty([], 'length', { value: 1 }).length !== 1; } catch (e) { // In Firefox 4-22, defining length on an array throws an exception. return true; } }; module.exports = hasPropertyDescriptors; /***/ }), /***/ "./node_modules/has-symbols/index.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; var origSymbol = typeof Symbol !== 'undefined' && Symbol; var hasSymbolSham = __webpack_require__("./node_modules/has-symbols/shams.js"); module.exports = function hasNativeSymbols() { if (typeof origSymbol !== 'function') { return false; } if (typeof Symbol !== 'function') { return false; } if (typeof origSymbol('foo') !== 'symbol') { return false; } if (typeof Symbol('bar') !== 'symbol') { return false; } return hasSymbolSham(); }; /***/ }), /***/ "./node_modules/has-symbols/shams.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; /* eslint complexity: [2, 18], max-statements: [2, 33] */ module.exports = function hasSymbols() { if (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; } if (typeof Symbol.iterator === 'symbol') { return true; } var obj = {}; var sym = Symbol('test'); var symObj = Object(sym); if (typeof sym === 'string') { return false; } if (Object.prototype.toString.call(sym) !== '[object Symbol]') { return false; } if (Object.prototype.toString.call(symObj) !== '[object Symbol]') { return false; } // temp disabled per https://github.com/ljharb/object.assign/issues/17 // if (sym instanceof Symbol) { return false; } // temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4 // if (!(symObj instanceof Symbol)) { return false; } // if (typeof Symbol.prototype.toString !== 'function') { return false; } // if (String(sym) !== Symbol.prototype.toString.call(sym)) { return false; } var symVal = 42; obj[sym] = symVal; for (sym in obj) { return false; } // eslint-disable-line no-restricted-syntax, no-unreachable-loop if (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; } if (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; } var syms = Object.getOwnPropertySymbols(obj); if (syms.length !== 1 || syms[0] !== sym) { return false; } if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { return false; } if (typeof Object.getOwnPropertyDescriptor === 'function') { var descriptor = Object.getOwnPropertyDescriptor(obj, sym); if (descriptor.value !== symVal || descriptor.enumerable !== true) { return false; } } return true; }; /***/ }), /***/ "./node_modules/has-tostringtag/shams.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; var hasSymbols = __webpack_require__("./node_modules/has-symbols/shams.js"); module.exports = function hasToStringTagShams() { return hasSymbols() && !!Symbol.toStringTag; }; /***/ }), /***/ "./node_modules/has/src/index.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; var bind = __webpack_require__("./node_modules/function-bind/index.js"); module.exports = bind.call(Function.call, Object.prototype.hasOwnProperty); /***/ }), /***/ "./node_modules/highcharts-react-official/dist/highcharts-react.min.js": /***/ (function(module, exports, __webpack_require__) { !function(e,t){ true?module.exports=t(__webpack_require__("./node_modules/react/index.js")):undefined}("undefined"!=typeof self?self:this,function(e){return function(e){function t(n){if(r[n])return r[n].exports;var o=r[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var r={};return t.m=e,t.c=r,t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=0)}([function(e,t,r){"use strict";function n(){return n=Object.assign||function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);rparseInt(m.split("Firefox/")[1],10);return{product:"Highcharts",version:"8.2.2",deg2rad:2*Math.PI/360,doc:h,hasBidiBug:C,hasTouch:!!f.TouchEvent,isMS:F,isWebKit:-1!==m.indexOf("AppleWebKit"),isFirefox:L,isChrome:K,isSafari:!K&&-1!==m.indexOf("Safari"),isTouchDevice:/(Mobile|Android|Windows Phone)/.test(m), SVG_NS:"http://www.w3.org/2000/svg",chartCount:0,seriesTypes:{},symbolSizes:{},svg:z,win:f,marginNames:["plotTop","marginRight","marginBottom","plotLeft"],noop:function(){},charts:[],dateFormats:{}}});N(m,"Core/Utilities.js",[m["Core/Globals.js"]],function(f){function h(b,k,t,a){var u=k?"Highcharts error":"Highcharts warning";32===b&&(b=u+": Deprecated member");var c=l(b),H=c?u+" #"+b+": www.highcharts.com/errors/"+b+"/":b.toString();u=function(){if(k)throw Error(H);e.console&&-1===h.messages.indexOf(H)&& console.log(H)};if("undefined"!==typeof a){var d="";c&&(H+="?");S(a,function(b,k){d+="\n - "+k+": "+b;c&&(H+=encodeURI(k)+"="+encodeURI(b))});H+=d}t?ca(t,"displayError",{code:b,message:H,params:a},u):u();h.messages.push(H)}function m(){var b,k=arguments,t={},a=function(b,k){"object"!==typeof b&&(b={});S(k,function(t,u){!z(t,!0)||n(t)||D(t)?b[u]=k[u]:b[u]=a(b[u]||{},t)});return b};!0===k[0]&&(t=k[1],k=Array.prototype.slice.call(k,2));var u=k.length;for(b=0;bb&&-Infinity=a&&(k=[1/a])));for(u=0;u=b||!H&&d<=(k[u]+(k[u+1]||k[u]))/2);u++);return c=t(c*a,-Math.round(Math.log(.001)/Math.LN10))},O=f.stableSort=function(b,k){var t=b.length,a,u;for(u=0;ut&&(t=b[k]);return t},b=f.destroyObjectProperties=function(b,k){S(b,function(t,a){t&&t!==k&&t.destroy&&t.destroy();delete b[a]})},k=f.discardElement=function(b){var k=f.garbageBin;k||(k=q("div"));b&&k.appendChild(b);k.innerHTML=""},t=f.correctFloat=function(b,k){return parseFloat(b.toPrecision(k||14))},H=f.timeUnits={millisecond:1,second:1E3,minute:6E4,hour:36E5,day:864E5,week:6048E5,month:24192E5,year:314496E5},R= f.numberFormat=function(b,k,t,a){b=+b||0;k=+k;var u=f.defaultOptions.lang,H=(b.toString().split(".")[1]||"").split("e")[0].length,c=b.toString().split("e");if(-1===k)k=Math.min(H,20);else if(!l(k))k=2;else if(k&&c[1]&&0>c[1]){var d=k+ +c[1];0<=d?(c[0]=(+c[0]).toExponential(d).split("e")[0],k=d):(c[0]=c[0].split(".")[0]||0,b=20>k?(c[0]*Math.pow(10,c[1])).toFixed(k):0,c[1]=0)}var g=(Math.abs(c[1]?c[0]:b)+Math.pow(10,-Math.max(k,H)-1)).toFixed(k);H=String(I(g));d=3b?"-":"")+(d?H.substr(0,d)+a:"");b+=H.substr(d).replace(/(\d{3})(?=\d)/g,"$1"+a);k&&(b+=t+g.slice(-k));c[1]&&0!==+b&&(b+="e"+c[1]);return b};Math.easeInOutSine=function(b){return-.5*(Math.cos(Math.PI*b)-1)};var U=f.getStyle=function(b,k,t){if("width"===k)return k=Math.min(b.offsetWidth,b.scrollWidth),t=b.getBoundingClientRect&&b.getBoundingClientRect().width,t=k-1&&(k=Math.floor(t)),Math.max(0,k-f.getStyle(b,"padding-left")-f.getStyle(b,"padding-right"));if("height"=== k)return Math.max(0,Math.min(b.offsetHeight,b.scrollHeight)-f.getStyle(b,"padding-top")-f.getStyle(b,"padding-bottom"));e.getComputedStyle||h(27,!0);if(b=e.getComputedStyle(b,void 0))b=b.getPropertyValue(k),L(t,"opacity"!==k)&&(b=I(b));return b},Z=f.inArray=function(b,k,t){h(32,!1,void 0,{"Highcharts.inArray":"use Array.indexOf"});return k.indexOf(b,t)},aa=f.find=Array.prototype.find?function(b,k){return b.find(k)}:function(b,k){var t,a=b.length;for(t=0;tk?b>16,(f&65280)>>8,f&255,1]:4===e&&(C=[(f&3840)>>4|(f&3840)>>8,(f&240)>>4|f&240,(f&15)<<4|f&15,1])}if(!C)for(y=this.parsers.length;y--&&!C;){var I= this.parsers[y];(e=I.regex.exec(f))&&(C=I.parse(e))}}this.rgba=C||[]};h.prototype.get=function(f){var h=this.input,y=this.rgba;if("undefined"!==typeof this.stops){var e=z(h);e.stops=[].concat(e.stops);this.stops.forEach(function(I,v){e.stops[v]=[e.stops[v][0],I.get(f)]})}else e=y&&m(y[0])?"rgb"===f||!f&&1===y[3]?"rgb("+y[0]+","+y[1]+","+y[2]+")":"a"===f?y[3]:"rgba("+y.join(",")+")":h;return e};h.prototype.brighten=function(f){var h,y=this.rgba;if(this.stops)this.stops.forEach(function(e){e.brighten(f)}); else if(m(f)&&0!==f)for(h=0;3>h;h++)y[h]+=F(255*f),0>y[h]&&(y[h]=0),255e)for(var I=0;I=v+this.startTime){this.now=this.end;this.pos=1;this.update();var D=x[this.prop]=!0;F(x,function(n){!0!==n&&(D=!1)});D&&I&&I.call(e);f=!1}else this.pos=y.easing((h-this.startTime)/v),this.now=this.start+(this.end-this.start)*this.pos,this.update(),f=!0;return f};h.prototype.initPath=function(f,h,y){function e(r,d){for(;r.lengthk.width)k={width:0,height:0}}else k=this.htmlGetBBox();t.isSVG&&(a=k.width,t=k.height,A&&(k.height=t={"11px,17":14,"13px,20":16}[d&&d.fontSize+","+Math.round(t)]||t),b&&(d=b*C,k.width=Math.abs(t*Math.sin(d))+Math.abs(a*Math.cos(d)),k.height=Math.abs(t*Math.cos(d))+ Math.abs(a*Math.sin(d))));if(n&&0]*>/g,"").replace(/</g, "<").replace(/>/g,">")))};E.prototype.toFront=function(){var a=this.element;a.parentNode.appendChild(a);return this};E.prototype.translate=function(a,b){return this.attr({translateX:a,translateY:b})};E.prototype.updateShadows=function(a,b,k){var t=this.shadows;if(t)for(var c=t.length;c--;)k.call(t[c],"height"===a?Math.max(b-(t[c].cutHeight||0),0):"d"===a?this.d:b,a,t[c])};E.prototype.updateTransform=function(){var a=this.translateX||0,b=this.translateY||0,k=this.scaleX,t=this.scaleY,c=this.inverted, d=this.rotation,g=this.matrix,p=this.element;c&&(a+=this.width,b+=this.height);a=["translate("+a+","+b+")"];r(g)&&a.push("matrix("+g.join(",")+")");c?a.push("rotate(90) scale(-1,1)"):d&&a.push("rotate("+d+" "+M(this.rotationOriginX,p.getAttribute("x"),0)+" "+M(this.rotationOriginY,p.getAttribute("y")||0)+")");(r(k)||r(t))&&a.push("scale("+M(k,1)+" "+M(t,1)+")");a.length&&p.setAttribute("transform",a.join(" "))};E.prototype.visibilitySetter=function(a,b,k){"inherit"===a?k.removeAttribute(b):this[b]!== a&&k.setAttribute(b,a);this[b]=a};E.prototype.xGetter=function(a){"circle"===this.element.nodeName&&("x"===a?a="cx":"y"===a&&(a="cy"));return this._defaultGetter(a)};E.prototype.zIndexSetter=function(a,b){var k=this.renderer,t=this.parentGroup,c=(t||k).element||k.box,d=this.element,g=!1;k=c===k.box;var p=this.added;var q;r(a)?(d.setAttribute("data-z-index",a),a=+a,this[b]===a&&(p=!1)):r(this[b])&&d.removeAttribute("data-z-index");this[b]=a;if(p){(a=this.zIndex)&&t&&(t.handleZ=!0);b=c.childNodes;for(q= b.length-1;0<=q&&!g;q--){t=b[q];p=t.getAttribute("data-z-index");var u=!r(p);if(t!==d)if(0>a&&u&&!k&&!q)c.insertBefore(d,b[q]),g=!0;else if(T(p)<=a||u&&(!r(a)||0<=a))c.insertBefore(d,b[q+1]||null),g=!0}g||(c.insertBefore(d,b[k?3:0]||null),g=!0)}return g};return E}();f.prototype["stroke-widthSetter"]=f.prototype.strokeSetter;f.prototype.yGetter=f.prototype.xGetter;f.prototype.matrixSetter=f.prototype.rotationOriginXSetter=f.prototype.rotationOriginYSetter=f.prototype.rotationSetter=f.prototype.scaleXSetter= f.prototype.scaleYSetter=f.prototype.translateXSetter=f.prototype.translateYSetter=f.prototype.verticalAlignSetter=function(a,c){this[c]=a;this.doTransform=!0};m.SVGElement=f;return m.SVGElement});N(m,"Core/Renderer/SVG/SVGLabel.js",[m["Core/Renderer/SVG/SVGElement.js"],m["Core/Utilities.js"]],function(f,h){var m=this&&this.__extends||function(){var f=function(e,I){f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(v,e){v.__proto__=e}||function(v,e){for(var f in e)e.hasOwnProperty(f)&& (v[f]=e[f])};return f(e,I)};return function(e,I){function v(){this.constructor=e}f(e,I);e.prototype=null===I?Object.create(I):(v.prototype=I.prototype,new v)}}(),z=h.defined,F=h.extend,L=h.isNumber,K=h.merge,C=h.removeEvent;return function(h){function e(f,v,x,D,n,l,J,w,r,d){var g=h.call(this)||this;g.init(f,"g");g.textStr=v;g.x=x;g.y=D;g.anchorX=l;g.anchorY=J;g.baseline=r;g.className=d;"button"!==d&&g.addClass("highcharts-label");d&&g.addClass("highcharts-"+d);g.text=f.text("",0,0,w).attr({zIndex:1}); if("string"===typeof n){var c=/^url\((.*?)\)$/.test(n);if(g.renderer.symbols[n]||c)g.symbolKey=n}g.bBox=e.emptyBBox;g.padding=3;g.paddingLeft=0;g.baselineOffset=0;g.needsBox=f.styledMode||c;g.deferredAttr={};g.alignFactor=0;return g}m(e,h);e.prototype.alignSetter=function(e){e={left:0,center:.5,right:1}[e];e!==this.alignFactor&&(this.alignFactor=e,this.bBox&&L(this.xSetting)&&this.attr({x:this.xSetting}))};e.prototype.anchorXSetter=function(e,v){this.anchorX=e;this.boxAttr(v,Math.round(e)-this.getCrispAdjust()- this.xSetting)};e.prototype.anchorYSetter=function(e,v){this.anchorY=e;this.boxAttr(v,e-this.ySetting)};e.prototype.boxAttr=function(e,v){this.box?this.box.attr(e,v):this.deferredAttr[e]=v};e.prototype.css=function(h){if(h){var v={};h=K(h);e.textProps.forEach(function(e){"undefined"!==typeof h[e]&&(v[e]=h[e],delete h[e])});this.text.css(v);var I="fontSize"in v||"fontWeight"in v;if("width"in v||I)this.updateBoxSize(),I&&this.updateTextPadding()}return f.prototype.css.call(this,h)};e.prototype.destroy= function(){C(this.element,"mouseenter");C(this.element,"mouseleave");this.text&&this.text.destroy();this.box&&(this.box=this.box.destroy());f.prototype.destroy.call(this)};e.prototype.fillSetter=function(e,v){e&&(this.needsBox=!0);this.fill=e;this.boxAttr(v,e)};e.prototype.getBBox=function(){var e=this.bBox,v=this.padding;return{width:e.width+2*v,height:e.height+2*v,x:e.x-v,y:e.y-v}};e.prototype.getCrispAdjust=function(){return this.renderer.styledMode&&this.box?this.box.strokeWidth()%2/2:(this["stroke-width"]? parseInt(this["stroke-width"],10):0)%2/2};e.prototype.heightSetter=function(e){this.heightSetting=e};e.prototype.on=function(e,v){var h=this,D=h.text,n=D&&"SPAN"===D.element.tagName?D:void 0;if(n){var l=function(l){("mouseenter"===e||"mouseleave"===e)&&l.relatedTarget instanceof Element&&(h.element.contains(l.relatedTarget)||n.element.contains(l.relatedTarget))||v.call(h.element,l)};n.on(e,l)}f.prototype.on.call(h,e,l||v);return h};e.prototype.onAdd=function(){var e=this.textStr;this.text.add(this); this.attr({text:z(e)?e:"",x:this.x,y:this.y});this.box&&z(this.anchorX)&&this.attr({anchorX:this.anchorX,anchorY:this.anchorY})};e.prototype.paddingSetter=function(e){z(e)&&e!==this.padding&&(this.padding=e,this.updateTextPadding())};e.prototype.paddingLeftSetter=function(e){z(e)&&e!==this.paddingLeft&&(this.paddingLeft=e,this.updateTextPadding())};e.prototype.rSetter=function(e,v){this.boxAttr(v,e)};e.prototype.shadow=function(e){e&&!this.renderer.styledMode&&(this.updateBoxSize(),this.box&&this.box.shadow(e)); return this};e.prototype.strokeSetter=function(e,v){this.stroke=e;this.boxAttr(v,e)};e.prototype["stroke-widthSetter"]=function(e,v){e&&(this.needsBox=!0);this["stroke-width"]=e;this.boxAttr(v,e)};e.prototype["text-alignSetter"]=function(e){this.textAlign=e};e.prototype.textSetter=function(e){"undefined"!==typeof e&&this.text.attr({text:e});this.updateBoxSize();this.updateTextPadding()};e.prototype.updateBoxSize=function(){var f=this.text.element.style,v={},h=this.padding,D=this.paddingLeft,n=L(this.widthSetting)&& L(this.heightSetting)&&!this.textAlign||!z(this.text.textStr)?e.emptyBBox:this.text.getBBox();this.width=(this.widthSetting||n.width||0)+2*h+D;this.height=(this.heightSetting||n.height||0)+2*h;this.baselineOffset=h+Math.min(this.renderer.fontMetrics(f&&f.fontSize,this.text).b,n.height||Infinity);this.needsBox&&(this.box||(f=this.box=this.symbolKey?this.renderer.symbol(this.symbolKey):this.renderer.rect(),f.addClass(("button"===this.className?"":"highcharts-label-box")+(this.className?" highcharts-"+ this.className+"-box":"")),f.add(this),f=this.getCrispAdjust(),v.x=f,v.y=(this.baseline?-this.baselineOffset:0)+f),v.width=Math.round(this.width),v.height=Math.round(this.height),this.box.attr(F(v,this.deferredAttr)),this.deferredAttr={});this.bBox=n};e.prototype.updateTextPadding=function(){var e=this.text,f=this.baseline?0:this.baselineOffset,h=this.paddingLeft+this.padding;z(this.widthSetting)&&this.bBox&&("center"===this.textAlign||"right"===this.textAlign)&&(h+={center:.5,right:1}[this.textAlign]* (this.widthSetting-this.bBox.width));if(h!==e.x||f!==e.y)e.attr("x",h),e.hasBoxWidthChanged&&(this.bBox=e.getBBox(!0),this.updateBoxSize()),"undefined"!==typeof f&&e.attr("y",f);e.x=h;e.y=f};e.prototype.widthSetter=function(e){this.widthSetting=L(e)?e:void 0};e.prototype.xSetter=function(e){this.x=e;this.alignFactor&&(e-=this.alignFactor*((this.widthSetting||this.bBox.width)+2*this.padding),this["forceAnimate:x"]=!0);this.xSetting=Math.round(e);this.attr("translateX",this.xSetting)};e.prototype.ySetter= function(e){this.ySetting=this.y=Math.round(e);this.attr("translateY",this.ySetting)};e.emptyBBox={width:0,height:0,x:0,y:0};e.textProps="color cursor direction fontFamily fontSize fontStyle fontWeight lineHeight textAlign textDecoration textOutline textOverflow width".split(" ");return e}(f)});N(m,"Core/Renderer/SVG/SVGRenderer.js",[m["Core/Color/Color.js"],m["Core/Globals.js"],m["Core/Renderer/SVG/SVGElement.js"],m["Core/Renderer/SVG/SVGLabel.js"],m["Core/Utilities.js"]],function(f,h,m,z,F){var P= F.addEvent,K=F.attr,C=F.createElement,y=F.css,e=F.defined,I=F.destroyObjectProperties,v=F.extend,x=F.isArray,D=F.isNumber,n=F.isObject,l=F.isString,J=F.merge,w=F.objectEach,r=F.pick,d=F.pInt,g=F.splat,c=F.uniqueKey,a=h.charts,q=h.deg2rad,p=h.doc,B=h.isFirefox,A=h.isMS,G=h.isWebKit;F=h.noop;var M=h.svg,T=h.SVG_NS,Q=h.symbolSizes,O=h.win,E=function(){function u(b,k,a,c,d,g,p){this.width=this.url=this.style=this.isSVG=this.imgCount=this.height=this.gradients=this.globalAnimation=this.defs=this.chartIndex= this.cacheKeys=this.cache=this.boxWrapper=this.box=this.alignedObjects=void 0;this.init(b,k,a,c,d,g,p)}u.prototype.init=function(b,k,a,c,d,g,q){var t=this.createElement("svg").attr({version:"1.1","class":"highcharts-root"});q||t.css(this.getStyle(c));c=t.element;b.appendChild(c);K(b,"dir","ltr");-1===b.innerHTML.indexOf("xmlns")&&K(c,"xmlns",this.SVG_NS);this.isSVG=!0;this.box=c;this.boxWrapper=t;this.alignedObjects=[];this.url=(B||G)&&p.getElementsByTagName("base").length?O.location.href.split("#")[0].replace(/<[^>]*>/g, "").replace(/([\('\)])/g,"\\$1").replace(/ /g,"%20"):"";this.createElement("desc").add().element.appendChild(p.createTextNode("Created with Highcharts 8.2.2"));this.defs=this.createElement("defs").add();this.allowHTML=g;this.forExport=d;this.styledMode=q;this.gradients={};this.cache={};this.cacheKeys=[];this.imgCount=0;this.setSize(k,a,!1);var H;B&&b.getBoundingClientRect&&(k=function(){y(b,{left:0,top:0});H=b.getBoundingClientRect();y(b,{left:Math.ceil(H.left)-H.left+"px",top:Math.ceil(H.top)-H.top+ "px"})},k(),this.unSubPixelFix=P(O,"resize",k))};u.prototype.definition=function(b){function k(b,t){var c;g(b).forEach(function(b){var d=a.createElement(b.tagName),g={};w(b,function(b,k){"tagName"!==k&&"children"!==k&&"textContent"!==k&&(g[k]=b)});d.attr(g);d.add(t||a.defs);b.textContent&&d.element.appendChild(p.createTextNode(b.textContent));k(b.children||[],d);c=d});return c}var a=this;return k(b)};u.prototype.getStyle=function(b){return this.style=v({fontFamily:'"Lucida Grande", "Lucida Sans Unicode", Arial, Helvetica, sans-serif', fontSize:"12px"},b)};u.prototype.setStyle=function(b){this.boxWrapper.css(this.getStyle(b))};u.prototype.isHidden=function(){return!this.boxWrapper.getBBox().width};u.prototype.destroy=function(){var b=this.defs;this.box=null;this.boxWrapper=this.boxWrapper.destroy();I(this.gradients||{});this.gradients=null;b&&(this.defs=b.destroy());this.unSubPixelFix&&this.unSubPixelFix();return this.alignedObjects=null};u.prototype.createElement=function(b){var k=new this.Element;k.init(this,b);return k};u.prototype.getRadialAttr= function(b,k){return{cx:b[0]-b[2]/2+k.cx*b[2],cy:b[1]-b[2]/2+k.cy*b[2],r:k.r*b[2]}};u.prototype.truncate=function(b,k,a,c,d,g,q){var t=this,H=b.rotation,R,u=c?1:0,A=(a||c).length,r=A,B=[],n=function(b){k.firstChild&&k.removeChild(k.firstChild);b&&k.appendChild(p.createTextNode(b))},l=function(g,p){p=p||g;if("undefined"===typeof B[p])if(k.getSubStringLength)try{B[p]=d+k.getSubStringLength(0,c?p+1:p)}catch(ja){""}else t.getSpanWidth&&(n(q(a||c,g)),B[p]=d+t.getSpanWidth(b,k));return B[p]},e;b.rotation= 0;var w=l(k.textContent.length);if(e=d+w>g){for(;u<=A;)r=Math.ceil((u+A)/2),c&&(R=q(c,r)),w=l(r,R&&R.length-1),u===A?u=A+1:w>g?A=r-1:u=r;0===A?n(""):a&&A===a.length-1||n(R||q(a||c,r))}c&&c.splice(0,r);b.actualWidth=w;b.rotation=H;return e};u.prototype.buildText=function(b){var k=b.element,a=this,c=a.forExport,g=r(b.textStr,"").toString(),q=-1!==g.indexOf("<"),u=k.childNodes,A,B=K(k,"x"),n=b.styles,e=b.textWidth,G=n&&n.lineHeight,f=n&&n.textOutline,V=n&&"ellipsis"===n.textOverflow,E=n&&"nowrap"=== n.whiteSpace,h=n&&n.fontSize,v,D=u.length;n=e&&!b.added&&this.box;var O=function(b){var t;a.styledMode||(t=/(px|em)$/.test(b&&b.style.fontSize)?b.style.fontSize:h||a.style.fontSize||12);return G?d(G):a.fontMetrics(t,b.getAttribute("style")?b:k).h},J=function(b,k){w(a.escapes,function(a,t){k&&-1!==k.indexOf(a)||(b=b.toString().replace(new RegExp(a,"g"),t))});return b},x=function(b,k){var a=b.indexOf("<");b=b.substring(a,b.indexOf(">")-a);a=b.indexOf(k+"=");if(-1!==a&&(a=a+k.length+1,k=b.charAt(a), '"'===k||"'"===k))return b=b.substring(a+1),b.substring(0,b.indexOf(k))},I=//g;var m=[g,V,E,G,f,h,e].join();if(m!==b.textCache){for(b.textCache=m;D--;)k.removeChild(u[D]);q||f||V||e||-1!==g.indexOf(" ")&&(!E||I.test(g))?(n&&n.appendChild(k),q?(g=a.styledMode?g.replace(/<(b|strong)>/g,'').replace(/<(i|em)>/g,''):g.replace(/<(b|strong)>/g,'').replace(/<(i|em)>/g,''), g=g.replace(//g,"").split(I)):g=[g],g=g.filter(function(b){return""!==b}),g.forEach(function(t,d){var g=0,H=0;t=t.replace(/^\s+|\s+$/g,"").replace(//g,"|||");var q=t.split("|||");q.forEach(function(t){if(""!==t||1===q.length){var R={},u=p.createElementNS(a.SVG_NS,"tspan"),n,r;(n=x(t,"class"))&&K(u,"class",n);if(n=x(t,"style"))n=n.replace(/(;| |^)color([ :])/,"$1fill$2"),K(u,"style",n);if((r=x(t,"href"))&& !c&&-1===r.split(":")[0].toLowerCase().indexOf("javascript")){var l=p.createElementNS(a.SVG_NS,"a");K(l,"href",r);K(u,"class","highcharts-anchor");l.appendChild(u);a.styledMode||y(u,{cursor:"pointer"})}t=J(t.replace(/<[a-zA-Z\/](.|\n)*?>/g,"")||" ");if(" "!==t){u.appendChild(p.createTextNode(t));g?R.dx=0:d&&null!==B&&(R.x=B);K(u,R);k.appendChild(l||u);!g&&v&&(!M&&c&&y(u,{display:"block"}),K(u,"dy",O(u)));if(e){var w=t.replace(/([^\^])-/g,"$1- ").split(" ");R=!E&&(1b?b+3:Math.round(1.2*b);return{h:k,b:Math.round(.8*k),f:b}};u.prototype.rotCorr=function(b,k,a){var t=b;k&&a&&(t=Math.max(t*Math.cos(k*q),4)); return{x:-b/3*Math.sin(k*q),y:t}};u.prototype.pathToSegments=function(b){for(var k=[],a=[],c={A:8,C:7,H:2,L:3,M:3,Q:5,S:5,T:3,V:2},d=0;d":">","'":"'",'"':"""};E.prototype.symbols={circle:function(a,b,k,t){return this.arc(a+k/2,b+t/2,k/2,t/2,{start:.5*Math.PI,end:2.5*Math.PI,open:!1})},square:function(a,b,k,t){return[["M",a,b],["L",a+k,b],["L",a+k,b+t],["L",a,b+t],["Z"]]},triangle:function(a,b,k,t){return[["M",a+k/2,b],["L",a+k,b+t],["L",a,b+t],["Z"]]},"triangle-down":function(a,b,k,t){return[["M",a,b],["L",a+k,b],["L",a+k/2,b+t],["Z"]]},diamond:function(a, b,k,t){return[["M",a+k/2,b],["L",a+k,b+t/2],["L",a+k/2,b+t],["L",a,b+t/2],["Z"]]},arc:function(a,b,k,t,c){var d=[];if(c){var g=c.start||0,p=c.end||0,q=c.r||k;k=c.r||t||k;var H=.001>Math.abs(p-g-2*Math.PI);p-=.001;t=c.innerR;H=r(c.open,H);var u=Math.cos(g),B=Math.sin(g),n=Math.cos(p),A=Math.sin(p);g=r(c.longArc,.001>p-g-Math.PI?0:1);d.push(["M",a+q*u,b+k*B],["A",q,k,0,g,r(c.clockwise,1),a+q*n,b+k*A]);e(t)&&d.push(H?["M",a+t*n,b+t*A]:["L",a+t*n,b+t*A],["A",t,t,0,g,e(c.clockwise)?1-c.clockwise:0,a+t* u,b+t*B]);H||d.push(["Z"])}return d},callout:function(a,b,k,t,c){var d=Math.min(c&&c.r||0,k,t),g=d+6,p=c&&c.anchorX||0;c=c&&c.anchorY||0;var q=[["M",a+d,b],["L",a+k-d,b],["C",a+k,b,a+k,b,a+k,b+d],["L",a+k,b+t-d],["C",a+k,b+t,a+k,b+t,a+k-d,b+t],["L",a+d,b+t],["C",a,b+t,a,b+t,a,b+t-d],["L",a,b+d],["C",a,b,a,b,a+d,b]];p&&p>k?c>b+g&&cp?c>b+g&&ct&&p>a+g&&pc&&p>a+g&&pthis.oldTextWidth)&&((c=this.textPxLength)||(z(f,{width:"",whiteSpace:r||"nowrap"}),c=f.offsetWidth),c=c>d);c&&(/[ \-]/.test(f.textContent||f.innerText)||"ellipsis"===f.style.textOverflow)?(z(f,{width:d+"px",display:"block",whiteSpace:r||"normal"}),this.oldTextWidth=d,this.hasBoxWidthChanged=!0):this.hasBoxWidthChanged=!1;g!==this.cTT&&(r=e.fontMetrics(f.style.fontSize,f).b,!F(w)||w===(this.oldRotation|| 0)&&l===this.oldAlign||this.setSpanRotation(w,J,r),this.getSpanCorrection(!F(w)&&this.textPxLength||f.offsetWidth,r,J,w,l));z(f,{left:D+(this.xCorr||0)+"px",top:n+(this.yCorr||0)+"px"});this.cTT=g;this.oldRotation=w;this.oldAlign=l}}else this.alignOnAdd=!0},setSpanRotation:function(e,f,h){var v={},D=this.renderer.getTransformKey();v[D]=v.transform="rotate("+e+"deg)";v[D+(y?"Origin":"-origin")]=v.transformOrigin=100*f+"% "+h+"px";z(this.element,v)},getSpanCorrection:function(e,f,h){this.xCorr=-e*h; this.yCorr=-f}});return h});N(m,"Core/Renderer/HTML/HTMLRenderer.js",[m["Core/Globals.js"],m["Core/Renderer/SVG/SVGElement.js"],m["Core/Renderer/SVG/SVGRenderer.js"],m["Core/Utilities.js"]],function(f,h,m,z){var F=f.isFirefox,P=f.isMS,K=f.isWebKit,C=f.win,y=z.attr,e=z.createElement,I=z.extend,v=z.pick;I(m.prototype,{getTransformKey:function(){return P&&!/Edge/.test(C.navigator.userAgent)?"-ms-transform":K?"-webkit-transform":F?"MozTransform":C.opera?"-o-transform":""},html:function(f,D,n){var l=this.createElement("span"), J=l.element,w=l.renderer,r=w.isSVG,d=function(d,c){["opacity","visibility"].forEach(function(a){d[a+"Setter"]=function(g,p,B){var q=d.div?d.div.style:c;h.prototype[a+"Setter"].call(this,g,p,B);q&&(q[p]=g)}});d.addedSetters=!0};l.textSetter=function(d){d!==J.innerHTML&&(delete this.bBox,delete this.oldTextWidth);this.textStr=d;J.innerHTML=v(d,"");l.doTransform=!0};r&&d(l,l.element.style);l.xSetter=l.ySetter=l.alignSetter=l.rotationSetter=function(d,c){"align"===c?l.alignValue=l.textAlign=d:l[c]=d; l.doTransform=!0};l.afterSetters=function(){this.doTransform&&(this.htmlUpdateTransform(),this.doTransform=!1)};l.attr({text:f,x:Math.round(D),y:Math.round(n)}).css({position:"absolute"});w.styledMode||l.css({fontFamily:this.style.fontFamily,fontSize:this.style.fontSize});J.style.whiteSpace="nowrap";l.css=l.htmlCss;r&&(l.add=function(g){var c=w.box.parentNode,a=[];if(this.parentGroup=g){var q=g.div;if(!q){for(;g;)a.push(g),g=g.parentGroup;a.reverse().forEach(function(g){function p(a,c){g[c]=a;"translateX"=== c?r.left=a+"px":r.top=a+"px";g.doTransform=!0}var n=y(g.element,"class");q=g.div=g.div||e("div",n?{className:n}:void 0,{position:"absolute",left:(g.translateX||0)+"px",top:(g.translateY||0)+"px",display:g.display,opacity:g.opacity,pointerEvents:g.styles&&g.styles.pointerEvents},q||c);var r=q.style;I(g,{classSetter:function(a){return function(c){this.element.setAttribute("class",c);a.className=c}}(q),on:function(){a[0].div&&l.on.apply({element:a[0].div},arguments);return g},translateXSetter:p,translateYSetter:p}); g.addedSetters||d(g)})}}else q=c;q.appendChild(J);l.added=!0;l.alignOnAdd&&l.htmlUpdateTransform();return l});return l}});return m});N(m,"Core/Axis/Tick.js",[m["Core/Globals.js"],m["Core/Utilities.js"]],function(f,h){var m=h.clamp,z=h.correctFloat,F=h.defined,L=h.destroyObjectProperties,K=h.extend,C=h.fireEvent,y=h.isNumber,e=h.merge,I=h.objectEach,v=h.pick,x=f.deg2rad;h=function(){function f(n,l,e,w,r){this.isNewLabel=this.isNew=!0;this.axis=n;this.pos=l;this.type=e||"";this.parameters=r||{};this.tickmarkOffset= this.parameters.tickmarkOffset;this.options=this.parameters.options;C(this,"init");e||w||this.addLabel()}f.prototype.addLabel=function(){var n=this,l=n.axis,e=l.options,w=l.chart,r=l.categories,d=l.logarithmic,g=l.names,c=n.pos,a=v(n.options&&n.options.labels,e.labels),q=l.tickPositions,p=c===q[0],B=c===q[q.length-1];g=this.parameters.category||(r?v(r[c],g[c],c):c);var A=n.label;r=(!a.step||1===a.step)&&1===l.tickInterval;q=q.info;var f,h;if(l.dateTime&&q){var D=w.time.resolveDTLFormat(e.dateTimeLabelFormats[!e.grid&& q.higherRanks[c]||q.unitName]);var x=D.main}n.isFirst=p;n.isLast=B;n.formatCtx={axis:l,chart:w,isFirst:p,isLast:B,dateTimeLabelFormat:x,tickPositionInfo:q,value:d?z(d.lin2log(g)):g,pos:c};e=l.labelFormatter.call(n.formatCtx,this.formatCtx);if(h=D&&D.list)n.shortenLabel=function(){for(f=0;fa&&w-q*pd&&(h=Math.round((r-w)/Math.cos(a*x)));else if(r=w+(1-q)*p,w-q*pd&&(A=d-n.x+A*q,G=-1),A=Math.min(B,A),AA||e.autoRotation&&(c.styles||{}).width)h=A;h&&(this.shortenLabel?this.shortenLabel():(D.width=Math.floor(h)+"px",(f.style||{}).textOverflow||(D.textOverflow= "ellipsis"),c.css(D)))};f.prototype.moveLabel=function(n,e){var l=this,w=l.label,r=!1,d=l.axis,g=d.reversed;w&&w.textStr===n?(l.movedLabel=w,r=!0,delete l.label):I(d.ticks,function(a){r||a.isNew||a===l||!a.label||a.label.textStr!==n||(l.movedLabel=a.label,r=!0,a.labelPos=l.movedLabel.xy,delete a.label)});if(!r&&(l.labelPos||w)){var c=l.labelPos||w.xy;w=d.horiz?g?0:d.width+d.left:c.x;d=d.horiz?c.y:g?d.width+d.left:0;l.movedLabel=l.createLabel({x:w,y:d},n,e);l.movedLabel&&l.movedLabel.attr({opacity:0})}}; f.prototype.render=function(e,l,f){var n=this.axis,r=n.horiz,d=this.pos,g=v(this.tickmarkOffset,n.tickmarkOffset);d=this.getPosition(r,d,g,l);g=d.x;var c=d.y;n=r&&g===n.pos+n.len||!r&&c===n.pos?-1:1;f=v(f,1);this.isActive=!0;this.renderGridLine(l,f,n);this.renderMark(d,f,n);this.renderLabel(d,l,f,e);this.isNew=!1;C(this,"afterRender")};f.prototype.renderGridLine=function(n,e,f){var l=this.axis,r=l.options,d=this.gridLine,g={},c=this.pos,a=this.type,q=v(this.tickmarkOffset,l.tickmarkOffset),p=l.chart.renderer, B=a?a+"Grid":"grid",A=r[B+"LineWidth"],G=r[B+"LineColor"];r=r[B+"LineDashStyle"];d||(l.chart.styledMode||(g.stroke=G,g["stroke-width"]=A,r&&(g.dashstyle=r)),a||(g.zIndex=1),n&&(e=0),this.gridLine=d=p.path().attr(g).addClass("highcharts-"+(a?a+"-":"")+"grid-line").add(l.gridGroup));if(d&&(f=l.getPlotLinePath({value:c+q,lineWidth:d.strokeWidth()*f,force:"pass",old:n})))d[n||this.isNew?"attr":"animate"]({d:f,opacity:e})};f.prototype.renderMark=function(n,e,f){var l=this.axis,r=l.options,d=l.chart.renderer, g=this.type,c=g?g+"Tick":"tick",a=l.tickSize(c),q=this.mark,p=!q,B=n.x;n=n.y;var A=v(r[c+"Width"],!g&&l.isXAxis?1:0);r=r[c+"Color"];a&&(l.opposite&&(a[0]=-a[0]),p&&(this.mark=q=d.path().addClass("highcharts-"+(g?g+"-":"")+"tick").add(l.axisGroup),l.chart.styledMode||q.attr({stroke:r,"stroke-width":A})),q[p?"attr":"animate"]({d:this.getMarkPath(B,n,a[0],q.strokeWidth()*f,l.horiz,d),opacity:e}))};f.prototype.renderLabel=function(e,l,f,w){var n=this.axis,d=n.horiz,g=n.options,c=this.label,a=g.labels, q=a.step;n=v(this.tickmarkOffset,n.tickmarkOffset);var p=!0,B=e.x;e=e.y;c&&y(B)&&(c.xy=e=this.getLabelPosition(B,e,c,d,a,n,w,q),this.isFirst&&!this.isLast&&!v(g.showFirstLabel,1)||this.isLast&&!this.isFirst&&!v(g.showLastLabel,1)?p=!1:!d||a.step||a.rotation||l||0===f||this.handleOverflow(e),q&&w%q&&(p=!1),p&&y(e.y)?(e.opacity=f,c[this.isNewLabel?"attr":"animate"](e),this.isNewLabel=!1):(c.attr("y",-9999),this.isNewLabel=!0))};f.prototype.replaceMovedLabel=function(){var e=this.label,l=this.axis,f= l.reversed;if(e&&!this.isNew){var w=l.horiz?f?l.left:l.width+l.left:e.xy.x;f=l.horiz?e.xy.y:f?l.width+l.top:l.top;e.animate({x:w,y:f,opacity:0},void 0,e.destroy);delete this.label}l.isDirty=!0;this.label=this.movedLabel;delete this.movedLabel};return f}();f.Tick=h;return f.Tick});N(m,"Core/Time.js",[m["Core/Globals.js"],m["Core/Utilities.js"]],function(f,h){var m=h.defined,z=h.error,F=h.extend,L=h.isObject,K=h.merge,C=h.objectEach,y=h.pad,e=h.pick,I=h.splat,v=h.timeUnits,x=f.win;h=function(){function h(e){this.options= {};this.variableTimezone=this.useUTC=!1;this.Date=x.Date;this.getTimezoneOffset=this.timezoneOffsetFunction();this.update(e)}h.prototype.get=function(e,l){if(this.variableTimezone||this.timezoneOffset){var n=l.getTime(),f=n-this.getTimezoneOffset(l);l.setTime(f);e=l["getUTC"+e]();l.setTime(n);return e}return this.useUTC?l["getUTC"+e]():l["get"+e]()};h.prototype.set=function(e,l,f){if(this.variableTimezone||this.timezoneOffset){if("Milliseconds"===e||"Seconds"===e||"Minutes"===e)return l["setUTC"+ e](f);var n=this.getTimezoneOffset(l);n=l.getTime()-n;l.setTime(n);l["setUTC"+e](f);e=this.getTimezoneOffset(l);n=l.getTime()+e;return l.setTime(n)}return this.useUTC?l["setUTC"+e](f):l["set"+e](f)};h.prototype.update=function(n){var l=e(n&&n.useUTC,!0);this.options=n=K(!0,this.options||{},n);this.Date=n.Date||x.Date||Date;this.timezoneOffset=(this.useUTC=l)&&n.timezoneOffset;this.getTimezoneOffset=this.timezoneOffsetFunction();this.variableTimezone=!(l&&!n.getTimezoneOffset&&!n.timezone)};h.prototype.makeTime= function(n,l,h,w,r,d){if(this.useUTC){var g=this.Date.UTC.apply(0,arguments);var c=this.getTimezoneOffset(g);g+=c;var a=this.getTimezoneOffset(g);c!==a?g+=a-c:c-36E5!==this.getTimezoneOffset(g-36E5)||f.isSafari||(g-=36E5)}else g=(new this.Date(n,l,e(h,1),e(w,0),e(r,0),e(d,0))).getTime();return g};h.prototype.timezoneOffsetFunction=function(){var e=this,l=this.options,f=l.moment||x.moment;if(!this.useUTC)return function(e){return 6E4*(new Date(e.toString())).getTimezoneOffset()};if(l.timezone){if(f)return function(e){return 6E4* -f.tz(e,l.timezone).utcOffset()};z(25)}return this.useUTC&&l.getTimezoneOffset?function(e){return 6E4*l.getTimezoneOffset(e.valueOf())}:function(){return 6E4*(e.timezoneOffset||0)}};h.prototype.dateFormat=function(n,l,h){var w;if(!m(l)||isNaN(l))return(null===(w=f.defaultOptions.lang)||void 0===w?void 0:w.invalidDate)||"";n=e(n,"%Y-%m-%d %H:%M:%S");var r=this;w=new this.Date(l);var d=this.get("Hours",w),g=this.get("Day",w),c=this.get("Date",w),a=this.get("Month",w),q=this.get("FullYear",w),p=f.defaultOptions.lang, B=null===p||void 0===p?void 0:p.weekdays,A=null===p||void 0===p?void 0:p.shortWeekdays;w=F({a:A?A[g]:B[g].substr(0,3),A:B[g],d:y(c),e:y(c,2," "),w:g,b:p.shortMonths[a],B:p.months[a],m:y(a+1),o:a+1,y:q.toString().substr(2,2),Y:q,H:y(d),k:d,I:y(d%12||12),l:d%12||12,M:y(this.get("Minutes",w)),p:12>d?"AM":"PM",P:12>d?"am":"pm",S:y(w.getSeconds()),L:y(Math.floor(l%1E3),3)},f.dateFormats);C(w,function(a,c){for(;-1!==n.indexOf("%"+c);)n=n.replace("%"+c,"function"===typeof a?a.call(r,l):a)});return h?n.substr(0, 1).toUpperCase()+n.substr(1):n};h.prototype.resolveDTLFormat=function(e){return L(e,!0)?e:(e=I(e),{main:e[0],from:e[1],to:e[2]})};h.prototype.getTimeTicks=function(n,l,f,h){var r=this,d=[],g={};var c=new r.Date(l);var a=n.unitRange,q=n.count||1,p;h=e(h,1);if(m(l)){r.set("Milliseconds",c,a>=v.second?0:q*Math.floor(r.get("Milliseconds",c)/q));a>=v.second&&r.set("Seconds",c,a>=v.minute?0:q*Math.floor(r.get("Seconds",c)/q));a>=v.minute&&r.set("Minutes",c,a>=v.hour?0:q*Math.floor(r.get("Minutes",c)/q)); a>=v.hour&&r.set("Hours",c,a>=v.day?0:q*Math.floor(r.get("Hours",c)/q));a>=v.day&&r.set("Date",c,a>=v.month?1:Math.max(1,q*Math.floor(r.get("Date",c)/q)));if(a>=v.month){r.set("Month",c,a>=v.year?0:q*Math.floor(r.get("Month",c)/q));var B=r.get("FullYear",c)}a>=v.year&&r.set("FullYear",c,B-B%q);a===v.week&&(B=r.get("Day",c),r.set("Date",c,r.get("Date",c)-B+h+(B4*v.month|| r.getTimezoneOffset(l)!==r.getTimezoneOffset(f));l=c.getTime();for(c=1;ld.length&&d.forEach(function(a){0===a%18E5&&"000000000"===r.dateFormat("%H%M%S%L",a)&&(g[a]="day")})}d.info=F(n,{higherRanks:g,totalRange:a*q});return d};return h}();f.Time=h;return f.Time});N(m,"Core/Options.js", [m["Core/Globals.js"],m["Core/Color/Color.js"],m["Core/Time.js"],m["Core/Utilities.js"]],function(f,h,m,z){var F=f.isTouchDevice,P=f.svg;h=h.parse;z=z.merge;"";f.defaultOptions={colors:"#7cb5ec #434348 #90ed7d #f7a35c #8085e9 #f15c80 #e4d354 #2b908f #f45b5b #91e8e1".split(" "),symbols:["circle","diamond","square","triangle","triangle-down"],lang:{loading:"Loading...",months:"January February March April May June July August September October November December".split(" "),shortMonths:"Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "), weekdays:"Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),decimalPoint:".",numericSymbols:"kMGTPE".split(""),resetZoom:"Reset zoom",resetZoomTitle:"Reset zoom level 1:1",thousandsSep:" "},global:{},time:{Date:void 0,getTimezoneOffset:void 0,timezone:void 0,timezoneOffset:0,useUTC:!0},chart:{styledMode:!1,borderRadius:0,colorCount:10,defaultSeriesType:"line",ignoreHiddenSeries:!0,spacing:[10,10,15,10],resetZoomButton:{theme:{zIndex:6},position:{align:"right",x:-10,y:10}},width:null, height:null,borderColor:"#335cad",backgroundColor:"#ffffff",plotBorderColor:"#cccccc"},title:{text:"Chart title",align:"center",margin:15,widthAdjust:-44},subtitle:{text:"",align:"center",widthAdjust:-44},caption:{margin:15,text:"",align:"left",verticalAlign:"bottom"},plotOptions:{},labels:{style:{position:"absolute",color:"#333333"}},legend:{enabled:!0,align:"center",alignColumns:!0,layout:"horizontal",labelFormatter:function(){return this.name},borderColor:"#999999",borderRadius:0,navigation:{activeColor:"#003399", inactiveColor:"#cccccc"},itemStyle:{color:"#333333",cursor:"pointer",fontSize:"12px",fontWeight:"bold",textOverflow:"ellipsis"},itemHoverStyle:{color:"#000000"},itemHiddenStyle:{color:"#cccccc"},shadow:!1,itemCheckboxStyle:{position:"absolute",width:"13px",height:"13px"},squareSymbol:!0,symbolPadding:5,verticalAlign:"bottom",x:0,y:0,title:{style:{fontWeight:"bold"}}},loading:{labelStyle:{fontWeight:"bold",position:"relative",top:"45%"},style:{position:"absolute",backgroundColor:"#ffffff",opacity:.5, textAlign:"center"}},tooltip:{enabled:!0,animation:P,borderRadius:3,dateTimeLabelFormats:{millisecond:"%A, %b %e, %H:%M:%S.%L",second:"%A, %b %e, %H:%M:%S",minute:"%A, %b %e, %H:%M",hour:"%A, %b %e, %H:%M",day:"%A, %b %e, %Y",week:"Week from %A, %b %e, %Y",month:"%B %Y",year:"%Y"},footerFormat:"",padding:8,snap:F?25:10,headerFormat:'{point.key}
',pointFormat:'\u25cf {series.name}: {point.y}
',backgroundColor:h("#f7f7f7").setOpacity(.85).get(), borderWidth:1,shadow:!0,style:{color:"#333333",cursor:"default",fontSize:"12px",whiteSpace:"nowrap"}},credits:{enabled:!0,href:"https://www.highcharts.com?credits",position:{align:"right",x:-10,verticalAlign:"bottom",y:-5},style:{cursor:"pointer",color:"#999999",fontSize:"9px"},text:"Highcharts.com"}};"";f.time=new m(z(f.defaultOptions.global,f.defaultOptions.time));f.dateFormat=function(h,m,y){return f.time.dateFormat(h,m,y)};return{dateFormat:f.dateFormat,defaultOptions:f.defaultOptions,time:f.time}}); N(m,"Core/Axis/Axis.js",[m["Core/Animation/AnimationUtilities.js"],m["Core/Color/Color.js"],m["Core/Globals.js"],m["Core/Axis/Tick.js"],m["Core/Utilities.js"],m["Core/Options.js"]],function(f,h,m,z,F,L){var K=f.animObject,C=F.addEvent,y=F.arrayMax,e=F.arrayMin,I=F.clamp,v=F.correctFloat,x=F.defined,D=F.destroyObjectProperties,n=F.error,l=F.extend,J=F.fireEvent,w=F.format,r=F.getMagnitude,d=F.isArray,g=F.isFunction,c=F.isNumber,a=F.isString,q=F.merge,p=F.normalizeTickInterval,B=F.objectEach,A=F.pick, G=F.relativeLength,M=F.removeEvent,T=F.splat,Q=F.syncTimeout,O=L.defaultOptions,E=m.deg2rad;f=function(){function u(b,k){this.zoomEnabled=this.width=this.visible=this.userOptions=this.translationSlope=this.transB=this.transA=this.top=this.ticks=this.tickRotCorr=this.tickPositions=this.tickmarkOffset=this.tickInterval=this.tickAmount=this.side=this.series=this.right=this.positiveValuesOnly=this.pos=this.pointRangePadding=this.pointRange=this.plotLinesAndBandsGroups=this.plotLinesAndBands=this.paddedTicks= this.overlap=this.options=this.oldMin=this.oldMax=this.offset=this.names=this.minPixelPadding=this.minorTicks=this.minorTickInterval=this.min=this.maxLabelLength=this.max=this.len=this.left=this.labelFormatter=this.labelEdge=this.isLinked=this.height=this.hasVisibleSeries=this.hasNames=this.coll=this.closestPointRange=this.chart=this.categories=this.bottom=this.alternateBands=void 0;this.init(b,k)}u.prototype.init=function(b,k){var a=k.isX,c=this;c.chart=b;c.horiz=b.inverted&&!c.isZAxis?!a:a;c.isXAxis= a;c.coll=c.coll||(a?"xAxis":"yAxis");J(this,"init",{userOptions:k});c.opposite=k.opposite;c.side=k.side||(c.horiz?c.opposite?0:2:c.opposite?1:3);c.setOptions(k);var d=this.options,p=d.type;c.labelFormatter=d.labels.formatter||c.defaultLabelFormatter;c.userOptions=k;c.minPixelPadding=0;c.reversed=d.reversed;c.visible=!1!==d.visible;c.zoomEnabled=!1!==d.zoomEnabled;c.hasNames="category"===p||!0===d.categories;c.categories=d.categories||c.hasNames;c.names||(c.names=[],c.names.keys={});c.plotLinesAndBandsGroups= {};c.positiveValuesOnly=!!c.logarithmic;c.isLinked=x(d.linkedTo);c.ticks={};c.labelEdge=[];c.minorTicks={};c.plotLinesAndBands=[];c.alternateBands={};c.len=0;c.minRange=c.userMinRange=d.minRange||d.maxZoom;c.range=d.range;c.offset=d.offset||0;c.max=null;c.min=null;c.crosshair=A(d.crosshair,T(b.options.tooltip.crosshairs)[a?0:1],!1);k=c.options.events;-1===b.axes.indexOf(c)&&(a?b.axes.splice(b.xAxis.length,0,c):b.axes.push(c),b[c.coll].push(c));c.series=c.series||[];b.inverted&&!c.isZAxis&&a&&"undefined"=== typeof c.reversed&&(c.reversed=!0);c.labelRotation=c.options.labels.rotation;B(k,function(b,k){g(b)&&C(c,k,b)});J(this,"afterInit")};u.prototype.setOptions=function(b){this.options=q(u.defaultOptions,"yAxis"===this.coll&&u.defaultYAxisOptions,[u.defaultTopAxisOptions,u.defaultRightAxisOptions,u.defaultBottomAxisOptions,u.defaultLeftAxisOptions][this.side],q(O[this.coll],b));J(this,"afterSetOptions",{userOptions:b})};u.prototype.defaultLabelFormatter=function(){var b=this.axis,k=c(this.value)?this.value: NaN,a=b.chart.time,d=b.categories,g=this.dateTimeLabelFormat,p=O.lang,q=p.numericSymbols;p=p.numericSymbolMagnitude||1E3;var e=q&&q.length,u=b.options.labels.format;b=b.logarithmic?Math.abs(k):b.tickInterval;var B=this.chart,l=B.numberFormatter;if(u)var A=w(u,this,B);else if(d)A=""+this.value;else if(g)A=a.dateFormat(g,k);else if(e&&1E3<=b)for(;e--&&"undefined"===typeof A;)a=Math.pow(p,e+1),b>=a&&0===10*k%a&&null!==q[e]&&0!==k&&(A=l(k/a,-1)+q[e]);"undefined"===typeof A&&(A=1E4<=Math.abs(k)?l(k,-1): l(k,-1,void 0,""));return A};u.prototype.getSeriesExtremes=function(){var b=this,k=b.chart,a;J(this,"getSeriesExtremes",null,function(){b.hasVisibleSeries=!1;b.dataMin=b.dataMax=b.threshold=null;b.softThreshold=!b.isXAxis;b.stacking&&b.stacking.buildStacks();b.series.forEach(function(t){if(t.visible||!k.options.chart.ignoreHiddenSeries){var d=t.options,g=d.threshold;b.hasVisibleSeries=!0;b.positiveValuesOnly&&0>=g&&(g=null);if(b.isXAxis){if(d=t.xData,d.length){d=b.logarithmic?d.filter(b.validatePositiveValue): d;a=t.getXExtremes(d);var p=a.min;var q=a.max;c(p)||p instanceof Date||(d=d.filter(c),a=t.getXExtremes(d),p=a.min,q=a.max);d.length&&(b.dataMin=Math.min(A(b.dataMin,p),p),b.dataMax=Math.max(A(b.dataMax,q),q))}}else if(t=t.applyExtremes(),c(t.dataMin)&&(p=t.dataMin,b.dataMin=Math.min(A(b.dataMin,p),p)),c(t.dataMax)&&(q=t.dataMax,b.dataMax=Math.max(A(b.dataMax,q),q)),x(g)&&(b.threshold=g),!d.softThreshold||b.positiveValuesOnly)b.softThreshold=!1}})});J(this,"afterGetSeriesExtremes")};u.prototype.translate= function(b,a,t,d,g,p){var k=this.linkedParent||this,q=1,e=0,H=d?k.oldTransA:k.transA;d=d?k.oldMin:k.min;var u=k.minPixelPadding;g=(k.isOrdinal||k.brokenAxis&&k.brokenAxis.hasBreaks||k.logarithmic&&g)&&k.lin2val;H||(H=k.transA);t&&(q*=-1,e=k.len);k.reversed&&(q*=-1,e-=q*(k.sector||k.len));a?(b=(b*q+e-u)/H+d,g&&(b=k.lin2val(b))):(g&&(b=k.val2lin(b)),b=c(d)?q*(b-d)*H+e+q*u+(c(p)?H*p:0):void 0);return b};u.prototype.toPixels=function(b,k){return this.translate(b,!1,!this.horiz,null,!0)+(k?0:this.pos)}; u.prototype.toValue=function(b,k){return this.translate(b-(k?0:this.pos),!0,!this.horiz,null,!0)};u.prototype.getPlotLinePath=function(b){function k(b,a,k){if("pass"!==l&&bk)l?b=I(b,a,k):E=!0;return b}var a=this,d=a.chart,g=a.left,p=a.top,q=b.old,e=b.value,u=b.translatedValue,B=b.lineWidth,l=b.force,r,n,f,h,w=q&&d.oldChartHeight||d.chartHeight,G=q&&d.oldChartWidth||d.chartWidth,E,v=a.transB;b={value:e,lineWidth:B,old:q,force:l,acrossPanes:b.acrossPanes,translatedValue:u};J(this,"getPlotLinePath", b,function(b){u=A(u,a.translate(e,null,null,q));u=I(u,-1E5,1E5);r=f=Math.round(u+v);n=h=Math.round(w-u-v);c(u)?a.horiz?(n=p,h=w-a.bottom,r=f=k(r,g,g+a.width)):(r=g,f=G-a.right,n=h=k(n,p,p+a.height)):(E=!0,l=!1);b.path=E&&!l?null:d.renderer.crispLine([["M",r,n],["L",f,h]],B||1)});return b.path};u.prototype.getLinearTickPositions=function(b,a,c){var k=v(Math.floor(a/b)*b);c=v(Math.ceil(c/b)*b);var t=[],d;v(k+b)===k&&(d=20);if(this.single)return[a];for(a=k;a<=c;){t.push(a);a=v(a+b,d);if(a===g)break; var g=a}return t};u.prototype.getMinorTickInterval=function(){var b=this.options;return!0===b.minorTicks?A(b.minorTickInterval,"auto"):!1===b.minorTicks?null:b.minorTickInterval};u.prototype.getMinorTickPositions=function(){var b=this.options,a=this.tickPositions,c=this.minorTickInterval,d=[],g=this.pointRangePadding||0,p=this.min-g;g=this.max+g;var q=g-p;if(q&&q/c=this.minRange;var r=this.minRange;var n=(r-c+a)/2;n=[a-n,A(b.min,a-n)];l&&(n[2]=this.logarithmic?this.logarithmic.log2lin(this.dataMin):this.dataMin);a=y(n);c=[a+r,A(b.max,a+r)];l&&(c[2]=d?d.log2lin(this.dataMax):this.dataMax);c=e(c);c-a=G)M=G,l=0;else if(a.dataMax<=G){var m=G;B=0}a.min= A(O,M,a.dataMin);a.max=A(D,m,a.dataMax)}g&&(a.positiveValuesOnly&&!b&&0>=Math.min(a.min,A(a.dataMin,a.min))&&n(10,1,d),a.min=v(g.log2lin(a.min),16),a.max=v(g.log2lin(a.max),16));a.range&&x(a.max)&&(a.userMin=a.min=O=Math.max(a.dataMin,a.minFromRange()),a.userMax=D=a.max,a.range=null);J(a,"foundExtremes");a.beforePadding&&a.beforePadding();a.adjustForMinRange();!(w||a.axisPointRange||a.stacking&&a.stacking.usePercentage||u)&&x(a.min)&&x(a.max)&&(d=a.max-a.min)&&(!x(O)&&l&&(a.min-=d*l),!x(D)&&B&&(a.max+= d*B));c(a.userMin)||(c(q.softMin)&&q.softMina.max&&(a.max=D=q.softMax),c(q.ceiling)&&(a.max=Math.min(a.max,q.ceiling)));E&&x(a.dataMin)&&(G=G||0,!x(O)&&a.min=G?a.min=a.options.minRange?Math.min(G,a.max-a.minRange):G:!x(D)&&a.max>G&&a.dataMax<=G&&(a.max=a.options.minRange?Math.max(G,a.min+a.minRange):G));a.tickInterval=a.min===a.max||"undefined"===typeof a.min||"undefined"=== typeof a.max?1:u&&!f&&h===a.linkedParent.options.tickPixelInterval?f=a.linkedParent.tickInterval:A(f,this.tickAmount?(a.max-a.min)/Math.max(this.tickAmount-1,1):void 0,w?1:(a.max-a.min)*h/Math.max(a.len,h));e&&!b&&a.series.forEach(function(b){b.processData(a.min!==a.oldMin||a.max!==a.oldMax)});a.setAxisTranslation(!0);J(this,"initialAxisTranslation");a.pointRange&&!f&&(a.tickInterval=Math.max(a.pointRange,a.tickInterval));b=A(q.minTickInterval,a.dateTime&&!a.series.some(function(b){return b.noSharedTooltip})? a.closestPointRange:0);!f&&a.tickIntervala.tickInterval||void 0!==this.tickAmount),!!this.tickAmount));this.tickAmount||(a.tickInterval=a.unsquish());this.setTickPositions()};u.prototype.setTickPositions=function(){var b=this.options,a=b.tickPositions;var c=this.getMinorTickInterval();var d=b.tickPositioner,g=this.hasVerticalPanning(),p="colorAxis"===this.coll,q=(p|| !g)&&b.startOnTick;g=(p||!g)&&b.endOnTick;this.tickmarkOffset=this.categories&&"between"===b.tickmarkPlacement&&1===this.tickInterval?.5:0;this.minorTickInterval="auto"===c&&this.tickInterval?this.tickInterval/5:c;this.single=this.min===this.max&&x(this.min)&&!this.tickAmount&&(parseInt(this.min,10)===this.min||!1!==b.allowDecimals);this.tickPositions=c=a&&a.slice();!c&&(this.ordinal&&this.ordinal.positions||!((this.max-this.min)/this.tickInterval>Math.max(2*this.len,200))?c=this.dateTime?this.getTimeTicks(this.dateTime.normalizeTimeTickInterval(this.tickInterval, b.units),this.min,this.max,b.startOfWeek,this.ordinal&&this.ordinal.positions,this.closestPointRange,!0):this.logarithmic?this.logarithmic.getLogTickPositions(this.tickInterval,this.min,this.max):this.getLinearTickPositions(this.tickInterval,this.min,this.max):(c=[this.min,this.max],n(19,!1,this.chart)),c.length>this.len&&(c=[c[0],c.pop()],c[0]===c[1]&&(c.length=1)),this.tickPositions=c,d&&(d=d.apply(this,[this.min,this.max])))&&(this.tickPositions=c=d);this.paddedTicks=c.slice(0);this.trimTicks(c, q,g);this.isLinked||(this.single&&2>c.length&&!this.categories&&!this.series.some(function(b){return b.is("heatmap")&&"between"===b.options.pointPlacement})&&(this.min-=.5,this.max+=.5),a||d||this.adjustTickAmount());J(this,"afterSetTickPositions")};u.prototype.trimTicks=function(b,a,c){var k=b[0],d=b[b.length-1],t=!this.isOrdinal&&this.minPointOffset||0;J(this,"trimTicks");if(!this.isLinked){if(a&&-Infinity!==k)this.min=k;else for(;this.min-t>b[0];)b.shift();if(c)this.max=d;else for(;this.max+t< b[b.length-1];)b.pop();0===b.length&&x(k)&&!this.options.tickPositions&&b.push((d+k)/2)}};u.prototype.alignToOthers=function(){var b={},a,c=this.options;!1===this.chart.options.chart.alignTicks||!1===c.alignTicks||!1===c.startOnTick||!1===c.endOnTick||this.logarithmic||this.chart[this.coll].forEach(function(k){var c=k.options;c=[k.horiz?c.left:c.top,c.width,c.height,c.pane].join();k.series.length&&(b[c]?a=!0:b[c]=1)});return a};u.prototype.getTickAmount=function(){var b=this.options,a=b.tickAmount, c=b.tickPixelInterval;!x(b.tickInterval)&&!a&&this.lena&&(this.finalTickAmt=a,a=5);this.tickAmount=a};u.prototype.adjustTickAmount=function(){var b=this.options,a=this.tickInterval,c=this.tickPositions,d=this.tickAmount,g=this.finalTickAmt,p=c&&c.length,q=A(this.threshold,this.softThreshold?0:null),e;if(this.hasData()){if(pd&&(this.tickInterval*=2,this.setTickPositions());if(x(g)){for(a=b=c.length;a--;)(3===g&&1===a%2||2>=g&&0q&&(a=q)),x(d)&&(gq&&(g=q))),k.displayBtn="undefined"!==typeof a||"undefined"!==typeof g,k.setExtremes(a,g,!1,void 0,{trigger:"zoom"});b.zoomed=!0});return b.zoomed};u.prototype.setAxisSize=function(){var b=this.chart,a=this.options,c=a.offsets||[0,0,0,0],d=this.horiz,g=this.width=Math.round(G(A(a.width,b.plotWidth-c[3]+c[1]),b.plotWidth)), p=this.height=Math.round(G(A(a.height,b.plotHeight-c[0]+c[2]),b.plotHeight)),q=this.top=Math.round(G(A(a.top,b.plotTop+c[0]),b.plotHeight,b.plotTop));a=this.left=Math.round(G(A(a.left,b.plotLeft+c[3]),b.plotWidth,b.plotLeft));this.bottom=b.chartHeight-p-q;this.right=b.chartWidth-g-a;this.len=Math.max(d?g:p,0);this.pos=d?a:q};u.prototype.getExtremes=function(){var b=this.logarithmic;return{min:b?v(b.lin2log(this.min)):this.min,max:b?v(b.lin2log(this.max)):this.max,dataMin:this.dataMin,dataMax:this.dataMax, userMin:this.userMin,userMax:this.userMax}};u.prototype.getThreshold=function(b){var a=this.logarithmic,c=a?a.lin2log(this.min):this.min;a=a?a.lin2log(this.max):this.max;null===b||-Infinity===b?b=c:Infinity===b?b=a:c>b?b=c:aa?b.align="right":195a&&(b.align="left")});return b.align};u.prototype.tickSize=function(b){var a= this.options,c=a["tick"===b?"tickLength":"minorTickLength"],d=A(a["tick"===b?"tickWidth":"minorTickWidth"],"tick"===b&&this.isXAxis&&!this.categories?1:0);if(d&&c){"inside"===a[b+"Position"]&&(c=-c);var g=[c,d]}b={tickSize:g};J(this,"afterTickSize",b);return b.tickSize};u.prototype.labelMetrics=function(){var b=this.tickPositions&&this.tickPositions[0]||0;return this.chart.renderer.fontMetrics(this.options.labels.style&&this.options.labels.style.fontSize,this.ticks[b]&&this.ticks[b].label)};u.prototype.unsquish= function(){var b=this.options.labels,a=this.horiz,c=this.tickInterval,d=c,g=this.len/(((this.categories?1:0)+this.max-this.min)/c),p,q=b.rotation,e=this.labelMetrics(),u,B=Number.MAX_VALUE,l,r=this.max-this.min,n=function(b){var a=b/(g||1);a=1r&&Infinity!==b&&Infinity!==g&&r&&(a=Math.ceil(r/c));return v(a*c)};a?(l=!b.staggerLines&&!b.step&&(x(q)?[q]:g=b){u=n(Math.abs(e.h/Math.sin(E*b))); var a=u+Math.abs(b/360);a(p.step||0))return p.rotation?0:(this.staggerLines||1)*this.len/q;if(!g){b=null===(a=null===p||void 0===p?void 0:p.style)||void 0===a?void 0:a.width;if(void 0!==b)return parseInt(b, 10);if(e)return e-d.spacing[3]}return.33*d.chartWidth};u.prototype.renderUnsquish=function(){var b=this.chart,k=b.renderer,c=this.tickPositions,d=this.ticks,g=this.options.labels,p=g&&g.style||{},q=this.horiz,e=this.getSlotWidth(),u=Math.max(1,Math.round(e-2*(g.padding||5))),B={},l=this.labelMetrics(),r=g.style&&g.style.textOverflow,n=0;a(g.rotation)||(B.rotation=g.rotation||0);c.forEach(function(b){b=d[b];b.movedLabel&&b.replaceMovedLabel();b&&b.label&&b.label.textPxLength>n&&(n=b.label.textPxLength)}); this.maxLabelLength=n;if(this.autoRotation)n>u&&n>l.h?B.rotation=this.labelRotation:this.labelRotation=0;else if(e){var A=u;if(!r){var f="clip";for(u=c.length;!q&&u--;){var h=c[u];if(h=d[h].label)h.styles&&"ellipsis"===h.styles.textOverflow?h.css({textOverflow:"clip"}):h.textPxLength>e&&h.css({width:e+"px"}),h.getBBox().height>this.len/c.length-(l.h-l.f)&&(h.specificTextOverflow="ellipsis")}}}B.rotation&&(A=n>.5*b.chartHeight?.33*b.chartHeight:n,r||(f="ellipsis"));if(this.labelAlign=g.align||this.autoLabelAlign(this.labelRotation))B.align= this.labelAlign;c.forEach(function(b){var a=(b=d[b])&&b.label,k=p.width,c={};a&&(a.attr(B),b.shortenLabel?b.shortenLabel():A&&!k&&"nowrap"!==p.whiteSpace&&(A= this.min&&b<=this.max||(null===(k=this.grid)||void 0===k?0:k.isColumn))g[b]||(g[b]=new z(this,b)),p&&g[b].isNew&&g[b].render(a,!0,-1),g[b].render(a)};u.prototype.render=function(){var b=this,a=b.chart,d=b.logarithmic,g=b.options,p=b.isLinked,q=b.tickPositions,e=b.axisTitle,u=b.ticks,l=b.minorTicks,r=b.alternateBands,n=g.stackLabels,f=g.alternateGridColor,A=b.tickmarkOffset,h=b.axisLine,G=b.showAxis,w=K(a.renderer.globalAnimation),E,v;b.labelEdge.length=0;b.overlap=!1;[u,l,r].forEach(function(b){B(b, function(b){b.isActive=!1})});if(b.hasData()||p)b.minorTickInterval&&!b.categories&&b.getMinorTickPositions().forEach(function(a){b.renderMinorTick(a)}),q.length&&(q.forEach(function(a,c){b.renderTick(a,c)}),A&&(0===b.min||b.single)&&(u[-1]||(u[-1]=new z(b,-1,null,!0)),u[-1].render(-1))),f&&q.forEach(function(c,k){v="undefined"!==typeof q[k+1]?q[k+1]+A:b.max-A;0===k%2&&ce&&(!v||g<=h)&&"undefined"!==typeof g&&l.push(g);g>h&&(w=!0);var g=d}}}else e=this.lin2log(e),h=this.lin2log(h),f=v?x.getMinorTickInterval():n.tickInterval,f=L("auto"===f?null:f,this.minorAutoInterval,n.tickPixelInterval/(v?5:1)*(h-e)/((v?D/x.tickPositions.length:D)||1)),f=F(f,void 0,z(f)),l=x.getLinearTickPositions(f,e,h).map(this.log2lin), v||(this.minorAutoInterval=f/5);v||(x.tickInterval=f);return l};f.prototype.lin2log=function(f){return Math.pow(10,f)};f.prototype.log2lin=function(f){return Math.log(f)/Math.LN10};return f}();h=function(){function f(){}f.compose=function(f){f.keepProps.push("logarithmic");var e=f.prototype,h=K.prototype;e.log2lin=h.log2lin;e.lin2log=h.lin2log;m(f,"init",function(e){var f=this.logarithmic;"logarithmic"!==e.userOptions.type?this.logarithmic=void 0:(f||(f=this.logarithmic=new K(this)),this.log2lin!== f.log2lin&&(f.log2lin=this.log2lin.bind(this)),this.lin2log!==f.lin2log&&(f.lin2log=this.lin2log.bind(this)))});m(f,"afterInit",function(){var e=this.logarithmic;e&&(this.lin2val=function(f){return e.lin2log(f)},this.val2lin=function(f){return e.log2lin(f)})})};return f}();h.compose(f);return h});N(m,"Core/Axis/PlotLineOrBand.js",[m["Core/Axis/Axis.js"],m["Core/Globals.js"],m["Core/Utilities.js"]],function(f,h,m){var z=m.arrayMax,F=m.arrayMin,P=m.defined,K=m.destroyObjectProperties,C=m.erase,y=m.extend, e=m.merge,I=m.objectEach,v=m.pick;m=function(){function f(e,f){this.axis=e;f&&(this.options=f,this.id=f.id)}f.prototype.render=function(){h.fireEvent(this,"render");var f=this,n=f.axis,l=n.horiz,m=n.logarithmic,w=f.options,r=w.label,d=f.label,g=w.to,c=w.from,a=w.value,q=P(c)&&P(g),p=P(a),B=f.svgElem,A=!B,G=[],M=w.color,x=v(w.zIndex,0),Q=w.events;G={"class":"highcharts-plot-"+(q?"band ":"line ")+(w.className||"")};var O={},E=n.chart.renderer,u=q?"bands":"lines";m&&(c=m.log2lin(c),g=m.log2lin(g),a= m.log2lin(a));n.chart.styledMode||(p?(G.stroke=M||"#999999",G["stroke-width"]=v(w.width,1),w.dashStyle&&(G.dashstyle=w.dashStyle)):q&&(G.fill=M||"#e6ebf5",w.borderWidth&&(G.stroke=w.borderColor,G["stroke-width"]=w.borderWidth)));O.zIndex=x;u+="-"+x;(m=n.plotLinesAndBandsGroups[u])||(n.plotLinesAndBandsGroups[u]=m=E.g("plot-"+u).attr(O).add());A&&(f.svgElem=B=E.path().attr(G).add(m));if(p)G=n.getPlotLinePath({value:a,lineWidth:B.strokeWidth(),acrossPanes:w.acrossPanes});else if(q)G=n.getPlotBandPath(c, g,w);else return;!f.eventsAdded&&Q&&(I(Q,function(b,a){B.on(a,function(b){Q[a].apply(f,[b])})}),f.eventsAdded=!0);(A||!B.d)&&G&&G.length?B.attr({d:G}):B&&(G?(B.show(!0),B.animate({d:G})):B.d&&(B.hide(),d&&(f.label=d=d.destroy())));r&&(P(r.text)||P(r.formatter))&&G&&G.length&&0this.max&&f>this.max;if(n&&l){if(e){var d=n.toString()===l.toString(); r=0}for(e=0;ed){l=f;break}if(e[l]&&p.substr(e[l])!=="01-01 00:00:00.000".substr(e[l]))break;"week"!==l&&(f=l)}if(l)var r=q.resolveDTLFormat(a[l]).main;return r};r.prototype.getLabel=function(){var d,g,c=this,a=this.chart.renderer,q=this.chart.styledMode,p=this.options, e="tooltip"+(L(p.className)?" "+p.className:""),l=(null===(d=p.style)||void 0===d?void 0:d.pointerEvents)||(!this.followPointer&&p.stickOnContact?"auto":"none"),r;d=function(){c.inContact=!0};var n=function(){var a=c.chart.hoverSeries;c.inContact=!1;if(a&&a.onMouseOut)a.onMouseOut()};if(!this.label){this.outside&&(this.container=r=f.doc.createElement("div"),r.className="highcharts-tooltip-container",F(r,{position:"absolute",top:"1px",pointerEvents:l,zIndex:3}),f.doc.body.appendChild(r),this.renderer= a=new f.Renderer(r,0,0,null===(g=this.chart.options.chart)||void 0===g?void 0:g.style,void 0,void 0,a.styledMode));this.split?this.label=a.g(e):(this.label=a.label("",0,0,p.shape||"callout",null,null,p.useHTML,null,e).attr({padding:p.padding,r:p.borderRadius}),q||this.label.attr({fill:p.backgroundColor,"stroke-width":p.borderWidth}).css(p.style).css({pointerEvents:l}).shadow(p.shadow));q&&(this.applyFilter(),this.label.addClass("highcharts-tooltip-"+this.chart.index));if(c.outside&&!c.split){var h= this.label,w=h.xSetter,v=h.ySetter;h.xSetter=function(a){w.call(h,c.distance);r.style.left=a+"px"};h.ySetter=function(a){v.call(h,c.distance);r.style.top=a+"px"}}this.label.on("mouseenter",d).on("mouseleave",n).attr({zIndex:8}).add()}return this.label};r.prototype.getPosition=function(d,g,c){var a=this.chart,q=this.distance,p={},e=a.inverted&&c.h||0,f,l=this.outside,r=l?m.documentElement.clientWidth-2*q:a.chartWidth,n=l?Math.max(m.body.scrollHeight,m.documentElement.scrollHeight,m.body.offsetHeight, m.documentElement.offsetHeight,m.documentElement.clientHeight):a.chartHeight,h=a.pointer.getChartPosition(),w=a.containerScaling,E=function(b){return w?b*w.scaleX:b},u=function(b){return w?b*w.scaleY:b},b=function(b){var k="x"===b;return[b,k?r:n,k?d:g].concat(l?[k?E(d):u(g),k?h.left-q+E(c.plotX+a.plotLeft):h.top-q+u(c.plotY+a.plotTop),0,k?r:n]:[k?d:g,k?c.plotX+a.plotLeft:c.plotY+a.plotTop,k?a.plotLeft:a.plotTop,k?a.plotLeft+a.plotWidth:a.plotTop+a.plotHeight])},k=b("y"),t=b("x"),H=!this.followPointer&& D(c.ttBelow,!a.inverted===!!c.negative),v=function(b,a,c,k,d,g,t){var f="y"===b?u(q):E(q),l=(c-k)/2,r=kn-e?n:n-e);else if(B)p[b]=Math.max(g,d+e+c>a?d:d+e);else return!1},U=function(b,a,c,k,d){var g;da-q?g=!1:p[b]=da-k/2?a-k-2:d-c/2;return g},x=function(b){var a=k;k=t;t=a;f=b},I=function(){!1!==v.apply(0,k)?!1!==U.apply(0,t)||f||(x(!0),I()):f?p.x=p.y=0:(x(!0),I())};(a.inverted||1=u+r&&v.pos+E<=u+r+e-O&&(G=v.pos+E);w=z(w,m.left-k,m.right+k);"number"===typeof G?(A=A.height+1,E=H?H.call(a,n,A,q):c(w,G,f,n),d.push({align:H?0:void 0,anchorX:w,anchorY:G,boxWidth:n,point:q,rank:D(E.rank,f?1:0),size:A,target:E.y,tt:p, x:E.x})):p.isActive=!1}return d},[]);!H&&d.some(function(b){return b.xc[0]?Math.max(Math.abs(c[0]),q.width-c[0]):Math.max(Math.abs(c[0]),q.width);a.height=0>c[1]?Math.max(Math.abs(c[1]), q.height-Math.abs(c[1])):Math.max(Math.abs(c[1]),q.height);this.tracker?this.tracker.attr(a):(this.tracker=g.renderer.rect(a).addClass("highcharts-tracker").add(g),d.styledMode||this.tracker.attr({fill:"rgba(0,0,0,0)"}))}}};r.prototype.styledModeFormat=function(d){return d.replace('style="font-size: 10px"','class="highcharts-header"').replace(/style="color:{(point|series)\.color}"/g,'class="highcharts-color-{$1.colorIndex}"')};r.prototype.tooltipFooterHeaderFormatter=function(d,g){var c=g?"footer": "header",a=d.series,q=a.tooltipOptions,p=q.xDateFormat,f=a.xAxis,l=f&&"datetime"===f.options.type&&I(d.key),r=q[c+"Format"];g={isFooter:g,labelConfig:d};y(this,"headerFormatter",g,function(c){l&&!p&&(p=this.getXDateFormat(d,q,f));l&&p&&(d.point&&d.point.tooltipDateKeys||["key"]).forEach(function(a){r=r.replace("{point."+a+"}","{point."+a+":"+p+"}")});a.chart.styledMode&&(r=this.styledModeFormat(r));c.text=e(r,{point:d,series:a},this.chart)});return g.text};r.prototype.update=function(d){this.destroy(); x(!0,this.chart.options.tooltip.userOptions,d);this.init(this.chart,x(!0,this.options,d))};r.prototype.updatePosition=function(d){var g=this.chart,c=g.pointer,a=this.getLabel(),q=d.plotX+g.plotLeft,p=d.plotY+g.plotTop;c=c.getChartPosition();d=(this.options.positioner||this.getPosition).call(this,a.width,a.height,d);if(this.outside){var e=(this.options.borderWidth||0)+2*this.distance;this.renderer.setSize(a.width+e,a.height+e,!1);if(g=g.containerScaling)F(this.container,{transform:"scale("+g.scaleX+ ", "+g.scaleY+")"}),q*=g.scaleX,p*=g.scaleY;q+=c.left-d.x;p+=c.top-d.y}this.move(Math.round(d.x),Math.round(d.y||0),q,p)};return r}();f.Tooltip=w;return f.Tooltip});N(m,"Core/Pointer.js",[m["Core/Color/Color.js"],m["Core/Globals.js"],m["Core/Tooltip.js"],m["Core/Utilities.js"]],function(f,h,m,z){var F=f.parse,P=h.charts,K=h.noop,C=z.addEvent,y=z.attr,e=z.css,I=z.defined,v=z.extend,x=z.find,D=z.fireEvent,n=z.isNumber,l=z.isObject,J=z.objectEach,w=z.offset,r=z.pick,d=z.splat;"";f=function(){function g(c, a){this.lastValidTouch={};this.pinchDown=[];this.runChartClick=!1;this.chart=c;this.hasDragged=!1;this.options=a;this.unbindContainerMouseLeave=function(){};this.unbindContainerMouseEnter=function(){};this.init(c,a)}g.prototype.applyInactiveState=function(c){var a=[],d;(c||[]).forEach(function(c){d=c.series;a.push(d);d.linkedParent&&a.push(d.linkedParent);d.linkedSeries&&(a=a.concat(d.linkedSeries));d.navigatorSeries&&a.push(d.navigatorSeries)});this.chart.series.forEach(function(c){-1===a.indexOf(c)? c.setState("inactive",!0):c.options.inactiveOtherPoints&&c.setAllPointsToState("inactive")})};g.prototype.destroy=function(){var c=this;"undefined"!==typeof c.unDocMouseMove&&c.unDocMouseMove();this.unbindContainerMouseLeave();h.chartCount||(h.unbindDocumentMouseUp&&(h.unbindDocumentMouseUp=h.unbindDocumentMouseUp()),h.unbindDocumentTouchEnd&&(h.unbindDocumentTouchEnd=h.unbindDocumentTouchEnd()));clearInterval(c.tooltipTimeout);J(c,function(a,d){c[d]=void 0})};g.prototype.drag=function(c){var a=this.chart, d=a.options.chart,g=c.chartX,e=c.chartY,f=this.zoomHor,r=this.zoomVert,n=a.plotLeft,h=a.plotTop,w=a.plotWidth,v=a.plotHeight,E=this.selectionMarker,u=this.mouseDownX||0,b=this.mouseDownY||0,k=l(d.panning)?d.panning&&d.panning.enabled:d.panning,t=d.panKey&&c[d.panKey+"Key"];if(!E||!E.touch)if(gn+w&&(g=n+w),eh+v&&(e=h+v),this.hasDragged=Math.sqrt(Math.pow(u-g,2)+Math.pow(b-e,2)),10c.options.findNearestPointBy.indexOf("y");c=c.searchPoint(d,g);if((g=l(c,!0))&&!(g=!l(e,!0))){g=e.distX-c.distX;var p=e.dist-c.dist,q=(c.series.group&&c.series.group.zIndex)-(e.series.group&&e.series.group.zIndex);g=0<(0!==g&&a?g:0!==p?p:0!==q?q:e.series.index>c.series.index?-1:1)}g&&(e=c)});return e};g.prototype.getChartCoordinatesFromPoint=function(c,a){var d=c.series,g=d.xAxis;d=d.yAxis;var e=r(c.clientX, c.plotX),f=c.shapeArgs;if(g&&d)return a?{chartX:g.len+g.pos-e,chartY:d.len+d.pos-c.plotY}:{chartX:e+g.pos,chartY:c.plotY+d.pos};if(f&&f.x&&f.y)return{chartX:f.x,chartY:f.y}};g.prototype.getChartPosition=function(){return this.chartPosition||(this.chartPosition=w(this.chart.container))};g.prototype.getCoordinates=function(c){var a={xAxis:[],yAxis:[]};this.chart.axes.forEach(function(d){a[d.isXAxis?"xAxis":"yAxis"].push({axis:d,value:d.toValue(c[d.horiz?"chartX":"chartY"])})});return a};g.prototype.getHoverData= function(c,a,d,g,e,f){var p,q=[];g=!(!g||!c);var n=a&&!a.stickyTracking,h={chartX:f?f.chartX:void 0,chartY:f?f.chartY:void 0,shared:e};D(this,"beforeGetHoverData",h);n=n?[a]:d.filter(function(a){return h.filter?h.filter(a):a.visible&&!(!e&&a.directTouch)&&r(a.options.enableMouseTracking,!0)&&a.stickyTracking});a=(p=g||!f?c:this.findNearestKDPoint(n,e,f))&&p.series;p&&(e&&!a.noSharedTooltip?(n=d.filter(function(a){return h.filter?h.filter(a):a.visible&&!(!e&&a.directTouch)&&r(a.options.enableMouseTracking, !0)&&!a.noSharedTooltip}),n.forEach(function(a){var c=x(a.points,function(a){return a.x===p.x&&!a.isNull});l(c)&&(a.chart.isBoosting&&(c=a.getPoint(c)),q.push(c))})):q.push(p));h={hoverPoint:p};D(this,"afterGetHoverData",h);return{hoverPoint:h.hoverPoint,hoverSeries:a,hoverPoints:q}};g.prototype.getPointFromEvent=function(c){c=c.target;for(var a;c&&!a;)a=c.point,c=c.parentNode;return a};g.prototype.onTrackerMouseOut=function(c){c=c.relatedTarget||c.toElement;var a=this.chart.hoverSeries;this.isDirectTouch= !1;if(!(!a||!c||a.stickyTracking||this.inClass(c,"highcharts-tooltip")||this.inClass(c,"highcharts-series-"+a.index)&&this.inClass(c,"highcharts-tracker")))a.onMouseOut()};g.prototype.inClass=function(c,a){for(var d;c;){if(d=y(c,"class")){if(-1!==d.indexOf(a))return!0;if(-1!==d.indexOf("highcharts-container"))return!1}c=c.parentNode}};g.prototype.init=function(c,a){this.options=a;this.chart=c;this.runChartClick=a.chart.events&&!!a.chart.events.click;this.pinchDown=[];this.lastValidTouch={};m&&(c.tooltip= new m(c,a.tooltip),this.followTouchMove=r(a.tooltip.followTouchMove,!0));this.setDOMEvents()};g.prototype.normalize=function(c,a){var d=c.touches,g=d?d.length?d.item(0):r(d.changedTouches,c.changedTouches)[0]:c;a||(a=this.getChartPosition());d=g.pageX-a.left;a=g.pageY-a.top;if(g=this.chart.containerScaling)d/=g.scaleX,a/=g.scaleY;return v(c,{chartX:Math.round(d),chartY:Math.round(a)})};g.prototype.onContainerClick=function(c){var a=this.chart,d=a.hoverPoint;c=this.normalize(c);var g=a.plotLeft,e= a.plotTop;a.cancelClick||(d&&this.inClass(c.target,"highcharts-tracker")?(D(d.series,"click",v(c,{point:d})),a.hoverPoint&&d.firePointEvent("click",c)):(v(c,this.getCoordinates(c)),a.isInsidePlot(c.chartX-g,c.chartY-e)&&D(a,"click",c)))};g.prototype.onContainerMouseDown=function(c){var a=1===((c.buttons||c.button)&1);c=this.normalize(c);if(h.isFirefox&&0!==c.button)this.onContainerMouseMove(c);if("undefined"===typeof c.button||a)this.zoomOption(c),a&&c.preventDefault&&c.preventDefault(),this.dragStart(c)}; g.prototype.onContainerMouseLeave=function(c){var a=P[r(h.hoverChartIndex,-1)],d=this.chart.tooltip;c=this.normalize(c);a&&(c.relatedTarget||c.toElement)&&(a.pointer.reset(),a.pointer.chartPosition=void 0);d&&!d.isHidden&&this.reset()};g.prototype.onContainerMouseEnter=function(c){delete this.chartPosition};g.prototype.onContainerMouseMove=function(c){var a=this.chart;c=this.normalize(c);this.setHoverChartIndex();c.preventDefault||(c.returnValue=!1);"mousedown"===a.mouseIsDown&&this.drag(c);a.openMenu|| !this.inClass(c.target,"highcharts-tracker")&&!a.isInsidePlot(c.chartX-a.plotLeft,c.chartY-a.plotTop)||this.runPointActions(c)};g.prototype.onDocumentTouchEnd=function(c){P[h.hoverChartIndex]&&P[h.hoverChartIndex].pointer.drop(c)};g.prototype.onContainerTouchMove=function(c){this.touch(c)};g.prototype.onContainerTouchStart=function(c){this.zoomOption(c);this.touch(c,!0)};g.prototype.onDocumentMouseMove=function(c){var a=this.chart,d=this.chartPosition;c=this.normalize(c,d);var g=a.tooltip;!d||g&& g.isStickyOnContact()||a.isInsidePlot(c.chartX-a.plotLeft,c.chartY-a.plotTop)||this.inClass(c.target,"highcharts-tracker")||this.reset()};g.prototype.onDocumentMouseUp=function(c){var a=P[r(h.hoverChartIndex,-1)];a&&a.pointer.drop(c)};g.prototype.pinch=function(c){var a=this,d=a.chart,g=a.pinchDown,e=c.touches||[],f=e.length,l=a.lastValidTouch,n=a.hasZoom,h=a.selectionMarker,w={},m=1===f&&(a.inClass(c.target,"highcharts-tracker")&&d.runTrackerClick||a.runChartClick),E={};1A.max&&(a=A.max-k,x=!0);x?(m-=.8*(m-l[q][0]),"number"===typeof M&&(M-=.8*(M-l[q][1])), d()):l[q]=[m,M];w||(f[q]=t-b,f[u]=k);f=w?1/B:B;e[u]=k;e[q]=a;g[w?c?"scaleY":"scaleX":"scale"+n]=B;g["translate"+n]=f*b+(m-f*G)};g.prototype.reset=function(c,a){var g=this.chart,p=g.hoverSeries,e=g.hoverPoint,f=g.hoverPoints,l=g.tooltip,r=l&&l.shared?f:e;c&&r&&d(r).forEach(function(a){a.series.isCartesian&&"undefined"===typeof a.plotX&&(c=!1)});if(c)l&&r&&d(r).length&&(l.refresh(r),l.shared&&f?f.forEach(function(a){a.setState(a.state,!0);a.series.isCartesian&&(a.series.xAxis.crosshair&&a.series.xAxis.drawCrosshair(null, a),a.series.yAxis.crosshair&&a.series.yAxis.drawCrosshair(null,a))}):e&&(e.setState(e.state,!0),g.axes.forEach(function(a){a.crosshair&&e.series[a.coll]===a&&a.drawCrosshair(null,e)})));else{if(e)e.onMouseOut();f&&f.forEach(function(a){a.setState()});if(p)p.onMouseOut();l&&l.hide(a);this.unDocMouseMove&&(this.unDocMouseMove=this.unDocMouseMove());g.axes.forEach(function(a){a.hideCrosshair()});this.hoverX=g.hoverPoints=g.hoverPoint=null}};g.prototype.runPointActions=function(c,a){var d=this.chart, g=d.tooltip&&d.tooltip.options.enabled?d.tooltip:void 0,e=g?g.shared:!1,f=a||d.hoverPoint,l=f&&f.series||d.hoverSeries;l=this.getHoverData(f,l,d.series,(!c||"touchmove"!==c.type)&&(!!a||l&&l.directTouch&&this.isDirectTouch),e,c);f=l.hoverPoint;var n=l.hoverPoints;a=(l=l.hoverSeries)&&l.tooltipOptions.followPointer;e=e&&l&&!l.noSharedTooltip;if(f&&(f!==d.hoverPoint||g&&g.isHidden)){(d.hoverPoints||[]).forEach(function(a){-1===n.indexOf(a)&&a.setState()});if(d.hoverSeries!==l)l.onMouseOver();this.applyInactiveState(n); (n||[]).forEach(function(a){a.setState("hover")});d.hoverPoint&&d.hoverPoint.firePointEvent("mouseOut");if(!f.series)return;d.hoverPoints=n;d.hoverPoint=f;f.firePointEvent("mouseOver");g&&g.refresh(e?n:f,c)}else a&&g&&!g.isHidden&&(f=g.getAnchor([{}],c),g.updatePosition({plotX:f[0],plotY:f[1]}));this.unDocMouseMove||(this.unDocMouseMove=C(d.container.ownerDocument,"mousemove",function(a){var c=P[h.hoverChartIndex];if(c)c.pointer.onDocumentMouseMove(a)}));d.axes.forEach(function(a){var g=r((a.crosshair|| {}).snap,!0),p;g&&((p=d.hoverPoint)&&p.series[a.coll]===a||(p=x(n,function(c){return c.series[a.coll]===a})));p||!g?a.drawCrosshair(c,p):a.hideCrosshair()})};g.prototype.scaleGroups=function(c,a){var d=this.chart,g;d.series.forEach(function(p){g=c||p.getPlotBox();p.xAxis&&p.xAxis.zoomEnabled&&p.group&&(p.group.attr(g),p.markerGroup&&(p.markerGroup.attr(g),p.markerGroup.clip(a?d.clipRect:null)),p.dataLabelsGroup&&p.dataLabelsGroup.attr(g))});d.clipRect.attr(a||d.clipBox)};g.prototype.setDOMEvents= function(){var c=this.chart.container,a=c.ownerDocument;c.onmousedown=this.onContainerMouseDown.bind(this);c.onmousemove=this.onContainerMouseMove.bind(this);c.onclick=this.onContainerClick.bind(this);this.unbindContainerMouseEnter=C(c,"mouseenter",this.onContainerMouseEnter.bind(this));this.unbindContainerMouseLeave=C(c,"mouseleave",this.onContainerMouseLeave.bind(this));h.unbindDocumentMouseUp||(h.unbindDocumentMouseUp=C(a,"mouseup",this.onDocumentMouseUp.bind(this)));h.hasTouch&&(C(c,"touchstart", this.onContainerTouchStart.bind(this)),C(c,"touchmove",this.onContainerTouchMove.bind(this)),h.unbindDocumentTouchEnd||(h.unbindDocumentTouchEnd=C(a,"touchend",this.onDocumentTouchEnd.bind(this))))};g.prototype.setHoverChartIndex=function(){var c=this.chart,a=h.charts[r(h.hoverChartIndex,-1)];if(a&&a!==c)a.pointer.onContainerMouseLeave({relatedTarget:!0});a&&a.mouseIsDown||(h.hoverChartIndex=c.index)};g.prototype.touch=function(c,a){var d=this.chart,g;this.setHoverChartIndex();if(1===c.touches.length)if(c= this.normalize(c),(g=d.isInsidePlot(c.chartX-d.plotLeft,c.chartY-d.plotTop))&&!d.openMenu){a&&this.runPointActions(c);if("touchmove"===c.type){a=this.pinchDown;var e=a[0]?4<=Math.sqrt(Math.pow(a[0].chartX-c.chartX,2)+Math.pow(a[0].chartY-c.chartY,2)):!1}r(e,!0)&&this.pinch(c)}else a&&this.reset();else 2===c.touches.length&&this.pinch(c)};g.prototype.zoomOption=function(c){var a=this.chart,d=a.options.chart,g=d.zoomType||"";a=a.inverted;/touch/.test(c.type)&&(g=r(d.pinchType,g));this.zoomX=c=/x/.test(g); this.zoomY=g=/y/.test(g);this.zoomHor=c&&!a||g&&a;this.zoomVert=g&&!a||c&&a;this.hasZoom=c||g};return g}();return h.Pointer=f});N(m,"Core/MSPointer.js",[m["Core/Globals.js"],m["Core/Pointer.js"],m["Core/Utilities.js"]],function(f,h,m){function z(){var e=[];e.item=function(e){return this[e]};v(D,function(f){e.push({pageX:f.pageX,pageY:f.pageY,target:f.target})});return e}function F(e,n,h,r){"touch"!==e.pointerType&&e.pointerType!==e.MSPOINTER_TYPE_TOUCH||!K[f.hoverChartIndex]||(r(e),r=K[f.hoverChartIndex].pointer, r[n]({type:h,target:e.currentTarget,preventDefault:y,touches:z()}))}var P=this&&this.__extends||function(){var e=function(f,l){e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,d){e.__proto__=d}||function(e,d){for(var g in d)d.hasOwnProperty(g)&&(e[g]=d[g])};return e(f,l)};return function(f,l){function r(){this.constructor=f}e(f,l);f.prototype=null===l?Object.create(l):(r.prototype=l.prototype,new r)}}(),K=f.charts,C=f.doc,y=f.noop,e=m.addEvent,I=m.css,v=m.objectEach,x=m.removeEvent, D={},n=!!f.win.PointerEvent;return function(f){function l(){return null!==f&&f.apply(this,arguments)||this}P(l,f);l.prototype.batchMSEvents=function(e){e(this.chart.container,n?"pointerdown":"MSPointerDown",this.onContainerPointerDown);e(this.chart.container,n?"pointermove":"MSPointerMove",this.onContainerPointerMove);e(C,n?"pointerup":"MSPointerUp",this.onDocumentPointerUp)};l.prototype.destroy=function(){this.batchMSEvents(x);f.prototype.destroy.call(this)};l.prototype.init=function(e,l){f.prototype.init.call(this, e,l);this.hasZoom&&I(e.container,{"-ms-touch-action":"none","touch-action":"none"})};l.prototype.onContainerPointerDown=function(e){F(e,"onContainerTouchStart","touchstart",function(e){D[e.pointerId]={pageX:e.pageX,pageY:e.pageY,target:e.currentTarget}})};l.prototype.onContainerPointerMove=function(e){F(e,"onContainerTouchMove","touchmove",function(e){D[e.pointerId]={pageX:e.pageX,pageY:e.pageY};D[e.pointerId].target||(D[e.pointerId].target=e.currentTarget)})};l.prototype.onDocumentPointerUp=function(e){F(e, "onDocumentTouchEnd","touchend",function(e){delete D[e.pointerId]})};l.prototype.setDOMEvents=function(){f.prototype.setDOMEvents.call(this);(this.hasZoom||this.followTouchMove)&&this.batchMSEvents(e)};return l}(h)});N(m,"Core/Legend.js",[m["Core/Animation/AnimationUtilities.js"],m["Core/Globals.js"],m["Core/Utilities.js"]],function(f,h,m){var z=f.animObject,F=f.setAnimation,L=m.addEvent,K=m.css,C=m.defined,y=m.discardElement,e=m.find,I=m.fireEvent,v=m.format,x=m.isNumber,D=m.merge,n=m.pick,l=m.relativeLength, J=m.stableSort,w=m.syncTimeout;f=m.wrap;m=h.isFirefox;var r=h.marginNames,d=h.win,g=function(){function c(a,c){this.allItems=[];this.contentGroup=this.box=void 0;this.display=!1;this.group=void 0;this.offsetWidth=this.maxLegendWidth=this.maxItemWidth=this.legendWidth=this.legendHeight=this.lastLineHeight=this.lastItemY=this.itemY=this.itemX=this.itemMarginTop=this.itemMarginBottom=this.itemHeight=this.initialItemY=0;this.options={};this.padding=0;this.pages=[];this.proximate=!1;this.scrollGroup=void 0; this.widthOption=this.totalItemWidth=this.titleHeight=this.symbolWidth=this.symbolHeight=0;this.chart=a;this.init(a,c)}c.prototype.init=function(a,c){this.chart=a;this.setOptions(c);c.enabled&&(this.render(),L(this.chart,"endResize",function(){this.legend.positionCheckboxes()}),this.proximate?this.unchartrender=L(this.chart,"render",function(){this.legend.proximatePositions();this.legend.positionItems()}):this.unchartrender&&this.unchartrender())};c.prototype.setOptions=function(a){var c=n(a.padding, 8);this.options=a;this.chart.styledMode||(this.itemStyle=a.itemStyle,this.itemHiddenStyle=D(this.itemStyle,a.itemHiddenStyle));this.itemMarginTop=a.itemMarginTop||0;this.itemMarginBottom=a.itemMarginBottom||0;this.padding=c;this.initialItemY=c-5;this.symbolWidth=n(a.symbolWidth,16);this.pages=[];this.proximate="proximate"===a.layout&&!this.chart.inverted;this.baseline=void 0};c.prototype.update=function(a,c){var d=this.chart;this.setOptions(D(!0,this.options,a));this.destroy();d.isDirtyLegend=d.isDirtyBox= !0;n(c,!0)&&d.redraw();I(this,"afterUpdate")};c.prototype.colorizeItem=function(a,c){a.legendGroup[c?"removeClass":"addClass"]("highcharts-legend-item-hidden");if(!this.chart.styledMode){var d=this.options,g=a.legendItem,e=a.legendLine,f=a.legendSymbol,q=this.itemHiddenStyle.color;d=c?d.itemStyle.color:q;var l=c?a.color||q:q,r=a.options&&a.options.marker,n={fill:l};g&&g.css({fill:d,color:d});e&&e.attr({stroke:l});f&&(r&&f.isMarker&&(n=a.pointAttribs(),c||(n.stroke=n.fill=q)),f.attr(n))}I(this,"afterColorizeItem", {item:a,visible:c})};c.prototype.positionItems=function(){this.allItems.forEach(this.positionItem,this);this.chart.isResizing||this.positionCheckboxes()};c.prototype.positionItem=function(a){var c=this,d=this.options,g=d.symbolPadding,e=!d.rtl,f=a._legendItemPos;d=f[0];f=f[1];var l=a.checkbox,n=a.legendGroup;n&&n.element&&(g={translateX:e?d:this.legendWidth-d-2*g-4,translateY:f},e=function(){I(c,"afterPositionItem",{item:a})},C(n.translateY)?n.animate(g,void 0,e):(n.attr(g),e()));l&&(l.x=d,l.y=f)}; c.prototype.destroyItem=function(a){var c=a.checkbox;["legendItem","legendLine","legendSymbol","legendGroup"].forEach(function(c){a[c]&&(a[c]=a[c].destroy())});c&&y(a.checkbox)};c.prototype.destroy=function(){function a(a){this[a]&&(this[a]=this[a].destroy())}this.getAllItems().forEach(function(c){["legendItem","legendGroup"].forEach(a,c)});"clipRect up down pager nav box title group".split(" ").forEach(a,this);this.display=null};c.prototype.positionCheckboxes=function(){var a=this.group&&this.group.alignAttr, c=this.clipHeight||this.legendHeight,d=this.titleHeight;if(a){var g=a.translateY;this.allItems.forEach(function(e){var p=e.checkbox;if(p){var f=g+d+p.y+(this.scrollOffset||0)+3;K(p,{left:a.translateX+e.checkboxOffset+p.x-20+"px",top:f+"px",display:this.proximate||f>g-6&&fh?this.maxItemWidth:a.itemWidth;g&&this.itemX-d+c>h&&(this.itemX=d,this.lastLineHeight&&(this.itemY+=l+this.lastLineHeight+f),this.lastLineHeight=0);this.lastItemY=l+this.itemY+f;this.lastLineHeight=Math.max(e,this.lastLineHeight);a._legendItemPos=[this.itemX,this.itemY];g?this.itemX+=c:(this.itemY+=l+e+f,this.lastLineHeight=e);this.offsetWidth=this.widthOption||Math.max((g? this.itemX-d-(a.checkbox?0:r):c)+d,this.offsetWidth)};c.prototype.getAllItems=function(){var a=[];this.chart.series.forEach(function(c){var d=c&&c.options;c&&n(d.showInLegend,C(d.linkedTo)?!1:void 0,!0)&&(a=a.concat(c.legendItems||("point"===d.legendType?c.data:c)))});I(this,"afterGetAllItems",{allItems:a});return a};c.prototype.getAlignment=function(){var a=this.options;return this.proximate?a.align.charAt(0)+"tv":a.floating?"":a.align.charAt(0)+a.verticalAlign.charAt(0)+a.layout.charAt(0)};c.prototype.adjustMargins= function(a,c){var d=this.chart,g=this.options,e=this.getAlignment();e&&[/(lth|ct|rth)/,/(rtv|rm|rbv)/,/(rbh|cb|lbh)/,/(lbv|lm|ltv)/].forEach(function(f,p){f.test(e)&&!C(a[p])&&(d[r[p]]=Math.max(d[r[p]],d.legend[(p+1)%2?"legendHeight":"legendWidth"]+[1,-1,-1,1][p]*g[p%2?"x":"y"]+n(g.margin,12)+c[p]+(d.titleOffset[p]||0)))})};c.prototype.proximatePositions=function(){var a=this.chart,c=[],d="left"===this.options.align;this.allItems.forEach(function(g){var f;var p=d;if(g.yAxis){g.xAxis.options.reversed&& (p=!p);g.points&&(f=e(p?g.points:g.points.slice(0).reverse(),function(a){return x(a.plotY)}));p=this.itemMarginTop+g.legendItem.getBBox().height+this.itemMarginBottom;var q=g.yAxis.top-a.plotTop;g.visible?(f=f?f.plotY:g.yAxis.height,f+=q-.3*p):f=q+g.yAxis.height;c.push({target:f,size:p,item:g})}},this);h.distribute(c,a.plotHeight);c.forEach(function(c){c.item._legendItemPos[1]=a.plotTop-a.spacing[0]+c.pos})};c.prototype.render=function(){var a=this.chart,c=a.renderer,d=this.group,g=this.box,e=this.options, f=this.padding;this.itemX=f;this.itemY=this.initialItemY;this.lastItemY=this.offsetWidth=0;this.widthOption=l(e.width,a.spacingBox.width-f);var n=a.spacingBox.width-2*f-e.x;-1<["rm","lm"].indexOf(this.getAlignment().substring(0,2))&&(n/=2);this.maxLegendWidth=this.widthOption||n;d||(this.group=d=c.g("legend").attr({zIndex:7}).add(),this.contentGroup=c.g().attr({zIndex:1}).add(d),this.scrollGroup=c.g().add(this.contentGroup));this.renderTitle();var r=this.getAllItems();J(r,function(a,c){return(a.options&& a.options.legendIndex||0)-(c.options&&c.options.legendIndex||0)});e.reversed&&r.reverse();this.allItems=r;this.display=n=!!r.length;this.itemHeight=this.totalItemWidth=this.maxItemWidth=this.lastLineHeight=0;r.forEach(this.renderItem,this);r.forEach(this.layoutItem,this);r=(this.widthOption||this.offsetWidth)+f;var h=this.lastItemY+this.lastLineHeight+this.titleHeight;h=this.handleOverflow(h);h+=f;g||(this.box=g=c.rect().addClass("highcharts-legend-box").attr({r:e.borderRadius}).add(d),g.isNew=!0); a.styledMode||g.attr({stroke:e.borderColor,"stroke-width":e.borderWidth||0,fill:e.backgroundColor||"none"}).shadow(e.shadow);0f&&!1!==v.enabled?(this.clipHeight=h=Math.max(f-20-this.titleHeight-l,0),this.currentPage=n(this.currentPage,1),this.fullHeight=a,m.forEach(function(a,b){var c=a._legendItemPos[1],d=Math.round(a.legendItem.getBBox().height),g=t.length;if(!g||c-t[g-1]>h&&(H||c)!==t[g-1])t.push(H||c),g++;a.pageIx=g-1;H&&(m[b-1].pageIx=g-1);b===m.length-1&&c+d-t[g-1]>h&&c!==H&&(t.push(c),a.pageIx=g);c!==H&&(H=c)}),w||(w=c.clipRect=g.clipRect(0,l,9999, 0),c.contentGroup.clip(w)),D(h),k||(this.nav=k=g.g().attr({zIndex:1}).add(this.group),this.up=g.symbol("triangle",0,0,b,b).add(k),x("upTracker").on("click",function(){c.scroll(-1,u)}),this.pager=g.text("",15,10).addClass("highcharts-legend-navigation"),d.styledMode||this.pager.css(v.style),this.pager.add(k),this.down=g.symbol("triangle-down",0,0,b,b).add(k),x("downTracker").on("click",function(){c.scroll(1,u)})),c.scroll(0),a=f):k&&(D(),this.nav=k.destroy(),this.scrollGroup.attr({translateY:1}),this.clipHeight= 0);return a};c.prototype.scroll=function(a,c){var d=this,g=this.chart,e=this.pages,f=e.length,l=this.currentPage+a;a=this.clipHeight;var q=this.options.navigation,r=this.pager,h=this.padding;l>f&&(l=f);0=c.value;)c=d[++g];this.nonZonedColor||(this.nonZonedColor=this.color);this.color=c&&c.color&&!this.options.color?c.color:this.nonZonedColor;return c};f.prototype.hasNewShapeType=function(){return(this.graphic&&(this.graphic.symbolName||this.graphic.element.nodeName))!==this.shapeType};f.prototype.init=function(e,d,g){this.series=e;this.applyOptions(d,g);this.id=F(this.id)? this.id:J();this.resolveColor();e.chart.pointCount++;C(this,"afterInit");return this};f.prototype.optionsToObject=function(e){var d={},g=this.series,c=g.options.keys,a=c||g.pointArrayMap||["y"],l=a.length,p=0,n=0;if(v(e)||null===e)d[a[0]]=e;else if(I(e))for(!c&&e.length>l&&(g=typeof e[0],"string"===g?d.name=e[0]:"number"===g&&(d.x=e[0]),p++);n=M(a[c].options.index,a[c]._i)){a.splice(c+1,0,this);break}-1===c&&a.unshift(this);c+=1}else a.push(this);return M(c,a.length-1)},bindAxes:function(){var a= this,c=a.options,d=a.chart,e;g(this,"bindAxes",null,function(){(a.axisTypes||[]).forEach(function(b){d[b].forEach(function(d){e=d.options;if(c[b]===e.index||"undefined"!==typeof c[b]&&c[b]===e.id||"undefined"===typeof c[b]&&0===e.index)a.insert(d.series),a[b]=d,d.isDirty=!0});a[b]||a.optionalAxis===b||w(18,!0,d)})});g(this,"afterBindAxes")},updateParallelArrays:function(a,c){var b=a.series,d=arguments,g=p(c)?function(d){var g="y"===d&&b.toYData?b.toYData(a):a[d];b[d+"Data"][c]=g}:function(a){Array.prototype[c].apply(b[a+ "Data"],Array.prototype.slice.call(d,2))};b.parallelArrays.forEach(g)},hasData:function(){return this.visible&&"undefined"!==typeof this.dataMax&&"undefined"!==typeof this.dataMin||this.visible&&this.yData&&0=this.cropStart?q-this.cropStart:q);!e&&k[q]&&k[q].touched&&(q=void 0);return q},drawLegendSymbol:z.drawLineMarker,updateData:function(a,c){var b=this.options,d=b.dataSorting,g=this.points,k=[],e,f,h,q=this.requireSorting,n=a.length===g.length,u=!0;this.xIncrement=null;a.forEach(function(a,c){var f=l(a)&&this.pointClass.prototype.optionsToObject.call({series:this},a)||{};var t=f.x;if(f.id||p(t)){if(t=this.findPointIndex(f,h),-1===t||"undefined"=== typeof t?k.push(a):g[t]&&a!==b.data[t]?(g[t].update(a,!1,null,!1),g[t].touched=!0,q&&(h=t+1)):g[t]&&(g[t].touched=!0),!n||c!==t||d&&d.enabled||this.hasDerivedData)e=!0}else k.push(a)},this);if(e)for(a=g.length;a--;)(f=g[a])&&!f.touched&&f.remove&&f.remove(!1,c);else!n||d&&d.enabled?u=!1:(a.forEach(function(a,b){g[b].update&&a!==g[b].y&&g[b].update(a,!1,null,!1)}),k.length=0);g.forEach(function(a){a&&(a.touched=!1)});if(!u)return!1;k.forEach(function(a){this.addPoint(a,!1,null,null,!1)},this);null=== this.xIncrement&&this.xData&&this.xData.length&&(this.xIncrement=v(this.xData),this.autoIncrement());return!0},setData:function(b,c,d,g){var k=this,e=k.points,f=e&&e.length||0,t,l=k.options,h=k.chart,q=l.dataSorting,n=null,u=k.xAxis;n=l.turboThreshold;var r=this.xData,m=this.yData,A=(t=k.pointArrayMap)&&t.length,v=l.keys,E=0,H=1,O;b=b||[];t=b.length;c=M(c,!0);q&&q.enabled&&(b=this.sortData(b));!1!==g&&t&&f&&!k.cropped&&!k.hasGroupedData&&k.visible&&!k.isSeriesBoosting&&(O=this.updateData(b,d));if(!O){k.xIncrement= null;k.colorCounter=0;this.parallelArrays.forEach(function(a){k[a+"Data"].length=0});if(n&&t>n)if(n=k.getFirstValidPoint(b),p(n))for(d=0;da?1:0}).forEach(function(a,b){a.x=b},this);b.linkedSeries&&b.linkedSeries.forEach(function(b){var c=b.options,d=c.data;c.dataSorting&&c.dataSorting.enabled||!d||(d.forEach(function(c,k){d[k]=g(b,c);a[k]&&(d[k].x=a[k].x,d[k].index=k)}),b.setData(d,!1))});return a},getProcessedData:function(a){var b=this.xData,c=this.yData,d=b.length;var g=0;var e=this.xAxis,f=this.options;var p=f.cropThreshold;var l=a||this.getExtremesFromAll||f.getExtremesFromAll, h=this.isCartesian;a=e&&e.val2lin;f=!(!e||!e.logarithmic);var q=this.requireSorting;if(e){e=e.getExtremes();var n=e.min;var u=e.max}if(h&&this.sorted&&!l&&(!p||d>p||this.forceCrop))if(b[d-1]u)b=[],c=[];else if(this.yData&&(b[0]u)){g=this.cropData(this.xData,this.yData,n,u);b=g.xData;c=g.yData;g=g.start;var r=!0}for(p=b.length||1;--p;)if(d=f?a(b[p])-a(b[p-1]):b[p]-b[p-1],0d&&q&&(w(15,!1,this.chart),q=!1);return{xData:b,yData:c,cropped:r, cropStart:g,closestPointRange:m}},processData:function(a){var b=this.xAxis;if(this.isCartesian&&!this.isDirty&&!b.isDirty&&!this.yAxis.isDirty&&!a)return!1;a=this.getProcessedData();this.cropped=a.cropped;this.cropStart=a.cropStart;this.processedXData=a.xData;this.processedYData=a.yData;this.closestPointRange=this.basePointRange=a.closestPointRange},cropData:function(a,c,d,g,e){var b=a.length,k=0,f=b,p;e=M(e,this.cropShoulder);for(p=0;p=d){k=Math.max(0,p-e);break}for(d=p;d g){f=d+e;break}return{xData:a.slice(k,f),yData:c.slice(k,f),start:k,end:f}},generatePoints:function(){var a=this.options,c=a.data,d=this.data,e,f=this.processedXData,p=this.processedYData,l=this.pointClass,h=f.length,q=this.cropStart||0,n=this.hasGroupedData;a=a.keys;var u=[],m;d||n||(d=[],d.length=c.length,d=this.data=d);a&&n&&(this.options.keys=!1);for(m=0;m=h&&(e[r-n]||m)<=q;if(A&&m)if(A=w.length)for(;A--;)p(w[A])&&(f[l++]=w[A]);else f[l++]=w}b={dataMin:x(f),dataMax:v(f)};g(this,"afterGetExtremes",{dataExtremes:b}); return b},applyExtremes:function(){var a=this.getExtremes();this.dataMin=a.dataMin;this.dataMax=a.dataMax;return a},getFirstValidPoint:function(a){for(var b=null,c=a.length,d=0;null===b&&d=C&&(C=null),x.total=x.stackTotal=Q.total,x.percentage=Q.total&&x.y/Q.total*100,x.stackY=z,this.irregularWidths||Q.setOffset(this.pointXOffset||0,this.barW||0));x.yBottom=l(C)?D(h.translate(C,0,1,0,1),-1E5,1E5):null;r&&(z=this.modifyValue(z,x));x.plotY="number"===typeof z&&Infinity!==z?D(h.translate(z,0,1,0,1),-1E5,1E5):void 0;x.isInside=this.isPointInside(x);x.clientX=v?n(d.translate(y,0,0,0,1,w)):E;x.negative=x[O]<(b[O+ "Threshold"]||A||0);x.category=e&&"undefined"!==typeof e[x.x]?e[x.x]:x.x;if(!x.isNull&&!1!==x.visible){"undefined"!==typeof K&&(G=Math.min(G,Math.abs(E-K)));var K=E}x.zone=this.zones.length&&x.getZone();!x.graphic&&this.group&&f&&(x.isNew=!0)}this.closestPointRangePx=G;g(this,"afterTranslate")},getValidPoints:function(a,c,d){var b=this.chart;return(a||this.points||[]).filter(function(a){return c&&!b.isInsidePlot(a.plotX,a.plotY,b.inverted)?!1:!1!==a.visible&&(d||!a.isNull)})},getClipBox:function(a, c){var b=this.options,d=this.chart,g=d.inverted,k=this.xAxis,e=k&&this.yAxis,f=d.options.chart.scrollablePlotArea||{};a&&!1===b.clip&&e?a=g?{y:-d.chartWidth+e.len+e.pos,height:d.chartWidth,width:d.chartHeight,x:-d.chartHeight+k.len+k.pos}:{y:-e.pos,height:d.chartHeight,width:d.chartWidth,x:-k.pos}:(a=this.clipBox||d.clipBox,c&&(a.width=d.plotSizeX,a.x=(d.scrollablePixelsX||0)*(f.scrollPositionX||0)));return c?{width:a.width,x:a.x}:a},setClip:function(a){var b=this.chart,c=this.options,d=b.renderer, g=b.inverted,e=this.clipBox,f=this.getClipBox(a),p=this.sharedClipKey||["_sharedClip",a&&a.duration,a&&a.easing,f.height,c.xAxis,c.yAxis].join(),l=b[p],h=b[p+"m"];a&&(f.width=0,g&&(f.x=b.plotHeight+(!1!==c.clip?0:b.plotTop)));l?b.hasLoaded||l.attr(f):(a&&(b[p+"m"]=h=d.clipRect(g?b.plotSizeX+99:-99,g?-b.plotLeft:-b.plotTop,99,g?b.chartWidth:b.chartHeight)),b[p]=l=d.clipRect(f),l.count={length:0});a&&!l.count[this.index]&&(l.count[this.index]=!0,l.count.length+=1);if(!1!==c.clip||a)this.group.clip(a|| e?l:b.clipRect),this.markerGroup.clip(h),this.sharedClipKey=p;a||(l.count[this.index]&&(delete l.count[this.index],--l.count.length),0===l.count.length&&p&&b[p]&&(e||(b[p]=b[p].destroy()),b[p+"m"]&&(b[p+"m"]=b[p+"m"].destroy())))},animate:function(a){var b=this.chart,c=y(this.options.animation);if(!b.hasRendered)if(a)this.setClip(c);else{var d=this.sharedClipKey;a=b[d];var g=this.getClipBox(c,!0);a&&a.animate(g,c);b[d+"m"]&&b[d+"m"].animate({width:g.width+99,x:g.x-(b.inverted?0:99)},c)}},afterAnimate:function(){this.setClip(); g(this,"afterAnimate");this.finishedAnimating=!0},drawPoints:function(){var a=this.points,c=this.chart,d,g,e=this.options.marker,f=this[this.specialGroup]||this.markerGroup,p=this.xAxis,l=M(e.enabled,!p||p.isRadial?!0:null,this.closestPointRangePx>=e.enabledThreshold*e.radius);if(!1!==e.enabled||this._hasPointMarkers)for(d=0;de&&c.shadow));f&&(f.startX=d.xMap,f.isArea=d.isArea)})},getZonesGraphs:function(a){this.zones.forEach(function(b,c){c=["zone-graph-"+c,"highcharts-graph highcharts-zone-graph-"+ c+" "+(b.className||"")];this.chart.styledMode||c.push(b.color||this.color,b.dashStyle||this.options.dashStyle);a.push(c)},this);return a},applyZones:function(){var a=this,c=this.chart,d=c.renderer,g=this.zones,e,f,p=this.clips||[],h,l=this.graph,q=this.area,n=Math.max(c.chartWidth,c.chartHeight),u=this[(this.zoneAxis||"y")+"Axis"],r=c.inverted,m,w,v,A=!1,B,E;if(g.length&&(l||q)&&u&&"undefined"!==typeof u.min){var O=u.reversed;var G=u.horiz;l&&!this.showLine&&l.hide();q&&q.hide();var x=u.getExtremes(); g.forEach(function(b,g){e=O?G?c.plotWidth:0:G?0:u.toPixels(x.min)||0;e=D(M(f,e),0,n);f=D(Math.round(u.toPixels(M(b.value,x.max),!0)||0),0,n);A&&(e=f=u.toPixels(x.max));m=Math.abs(e-f);w=Math.min(e,f);v=Math.max(e,f);u.isXAxis?(h={x:r?v:w,y:0,width:m,height:n},G||(h.x=c.plotHeight-h.x)):(h={x:0,y:r?v:w,width:n,height:m},G&&(h.y=c.plotWidth-h.y));r&&d.isVML&&(h=u.isXAxis?{x:0,y:O?w:v,height:h.width,width:c.chartWidth}:{x:h.y-c.plotLeft-c.spacingBox.x,y:0,width:h.height,height:c.chartHeight});p[g]?p[g].animate(h): p[g]=d.clipRect(h);B=a["zone-area-"+g];E=a["zone-graph-"+g];l&&E&&E.clip(p[g]);q&&B&&B.clip(p[g]);A=b.value>x.max;a.resetZones&&0===f&&(f=void 0)});this.clips=p}else a.visible&&(l&&l.show(!0),q&&q.show(!0))},invertGroups:function(a){function b(){["group","markerGroup"].forEach(function(b){c[b]&&(d.renderer.isVML&&c[b].attr({width:c.yAxis.len,height:c.xAxis.len}),c[b].width=c.yAxis.len,c[b].height=c.xAxis.len,c[b].invert(c.isRadialSeries?!1:a))})}var c=this,d=c.chart;c.xAxis&&(c.eventsToUnbind.push(I(d, "resize",b)),b(),c.invertGroups=b)},plotGroup:function(a,c,d,g,e){var b=this[a],k=!b;d={visibility:d,zIndex:g||.1};"undefined"===typeof this.opacity||this.chart.styledMode||"inactive"===this.state||(d.opacity=this.opacity);k&&(this[a]=b=this.chart.renderer.g().add(e));b.addClass("highcharts-"+c+" highcharts-series-"+this.index+" highcharts-"+this.type+"-series "+(l(this.colorIndex)?"highcharts-color-"+this.colorIndex+" ":"")+(this.options.className||"")+(b.hasClass("highcharts-tracker")?" highcharts-tracker": ""),!0);b.attr(d)[k?"attr":"animate"](this.getPlotBox());return b},getPlotBox:function(){var a=this.chart,c=this.xAxis,d=this.yAxis;a.inverted&&(c=d,d=this.xAxis);return{translateX:c?c.left:a.plotLeft,translateY:d?d.top:a.plotTop,scaleX:1,scaleY:1}},removeEvents:function(a){a?this.eventsToUnbind.length&&(this.eventsToUnbind.forEach(function(a){a()}),this.eventsToUnbind.length=0):T(this)},render:function(){var a=this,c=a.chart,d=a.options,e=y(d.animation),f=!a.finishedAnimating&&c.renderer.isSVG&& e.duration,p=a.visible?"inherit":"hidden",h=d.zIndex,l=a.hasRendered,q=c.seriesGroup,n=c.inverted;g(this,"render");var u=a.plotGroup("group","series",p,h,q);a.markerGroup=a.plotGroup("markerGroup","markers",p,h,q);f&&a.animate&&a.animate(!0);u.inverted=a.isCartesian||a.invertable?n:!1;a.drawGraph&&(a.drawGraph(),a.applyZones());a.visible&&a.drawPoints();a.drawDataLabels&&a.drawDataLabels();a.redrawPoints&&a.redrawPoints();a.drawTracker&&!1!==a.options.enableMouseTracking&&a.drawTracker();a.invertGroups(n); !1===d.clip||a.sharedClipKey||l||u.clip(c.clipRect);f&&a.animate&&a.animate();l||(f&&e.defer&&(f+=e.defer),a.animationTimeout=O(function(){a.afterAnimate()},f||0));a.isDirty=!1;a.hasRendered=!0;g(a,"afterRender")},redraw:function(){var a=this.chart,c=this.isDirty||this.isDirtyData,d=this.group,g=this.xAxis,e=this.yAxis;d&&(a.inverted&&d.attr({width:a.plotWidth,height:a.plotHeight}),d.animate({translateX:M(g&&g.left,a.plotLeft),translateY:M(e&&e.top,a.plotTop)}));this.translate();this.render();c&& delete this.kdTree},kdAxisArray:["clientX","plotY"],searchPoint:function(a,c){var b=this.xAxis,d=this.yAxis,g=this.chart.inverted;return this.searchKDTree({clientX:g?b.len-a.chartY+b.pos:a.chartX-b.pos,plotY:g?d.len-a.chartX+d.pos:a.chartY-d.pos},c,a)},buildKDTree:function(a){function b(a,d,g){var e;if(e=a&&a.length){var f=c.kdAxisArray[d%g];a.sort(function(a,b){return a[f]-b[f]});e=Math.floor(e/2);return{point:a[e],left:b(a.slice(0,e),d+1,g),right:b(a.slice(e+1),d+1,g)}}}this.buildingKdTree=!0;var c= this,d=-1q?"left":"right";u=0>q?"right":"left";c[t]&&(t=b(a,c[t],d+1,p),n=t[k]m;)r--;this.updateParallelArrays(u,"splice",r,0,0);this.updateParallelArrays(u,r);h&&u.name&&(h[m]=u.name);q.splice(r,0,a);n&&(this.data.splice(r,0,null),this.processData());"point"===f.legendType&&this.generatePoints();g&&(k[0]&&k[0].remove?k[0].remove(!1):(k.shift(),this.updateParallelArrays(u,"shift"),q.shift()));!1!==e&&c(this,"addPoint",{point:u});this.isDirtyData=this.isDirty=!0;d&&p.redraw(b)},removePoint:function(a,c,d){var b=this,g=b.data, e=g[a],f=b.points,p=b.chart,h=function(){f&&f.length===g.length&&f.splice(a,1);g.splice(a,1);b.options.data.splice(a,1);b.updateParallelArrays(e||{series:b},"splice",a,1);e&&e.destroy();b.isDirty=!0;b.isDirtyData=!0;c&&p.redraw()};v(d,p);c=M(c,!0);e?e.firePointEvent("remove",null,h):h()},remove:function(a,d,g,b){function e(){f.destroy(b);f.remove=null;p.isDirtyLegend=p.isDirtyBox=!0;p.linkSeries();M(a,!0)&&p.redraw(d)}var f=this,p=f.chart;!1!==g?c(f,"remove",null,e):e()},update:function(a,e){a=F.cleanRecursively(a, this.userOptions);c(this,"update",{options:a});var f=this,b=f.chart,k=f.userOptions,p=f.initialType||f.type,h=b.options.plotOptions,q=a.type||k.type||b.options.chart.type,l=!(this.hasDerivedData||q&&q!==this.type||"undefined"!==typeof a.pointStart||"undefined"!==typeof a.pointInterval||f.hasOptionChanged("dataGrouping")||f.hasOptionChanged("pointStart")||f.hasOptionChanged("pointInterval")||f.hasOptionChanged("pointIntervalUnit")||f.hasOptionChanged("keys")),n=x[p].prototype,m,r=["eventOptions","navigatorSeries", "baseSeries"],w=f.finishedAnimating&&{animation:!1},v={};l&&(r.push("data","isDirtyData","points","processedXData","processedYData","xIncrement","cropped","_hasPointMarkers","_hasPointLabels","mapMap","mapData","minY","maxY","minX","maxX"),!1!==a.visible&&r.push("area","graph"),f.parallelArrays.forEach(function(a){r.push(a+"Data")}),a.data&&(a.dataSorting&&g(f.options.dataSorting,a.dataSorting),this.setData(a.data,!1)));a=A(k,w,{index:"undefined"===typeof k.index?f.index:k.index,pointStart:M(h&&h.series&& h.series.pointStart,k.pointStart,f.xData[0])},!l&&{data:f.options.data},a);l&&a.data&&(a.data=f.options.data);r=["group","markerGroup","dataLabelsGroup","transformGroup"].concat(r);r.forEach(function(a){r[a]=f[a];delete f[a]});f.remove(!1,null,!1,!0);for(m in n)f[m]=void 0;x[q||p]?g(f,x[q||p].prototype):d(17,!0,b,{missingModuleFor:q||p});r.forEach(function(a){f[a]=r[a]});f.init(b,a);if(l&&this.points){var B=f.options;!1===B.visible?(v.graphic=1,v.dataLabel=1):f._hasPointLabels||(a=B.marker,k=B.dataLabels, a&&(!1===a.enabled||"symbol"in a)&&(v.graphic=1),k&&!1===k.enabled&&(v.dataLabel=1));this.points.forEach(function(a){a&&a.series&&(a.resolveColor(),Object.keys(v).length&&a.destroyElements(v),!1===B.showInLegend&&a.legendItem&&b.legend.destroyItem(a))},this)}f.initialType=p;b.linkSeries();c(this,"afterUpdate");M(e,!0)&&b.redraw(l?void 0:!1)},setName:function(a){this.name=this.options.name=this.userOptions.name=a;this.chart.isDirtyLegend=!0},hasOptionChanged:function(a){var c=this.options[a],d=this.chart.options.plotOptions, b=this.userOptions[a];return b?c!==b:c!==M(d&&d[this.type]&&d[this.type][a],d&&d.series&&d.series[a],c)}});g(h.prototype,{update:function(a,c){var d=this.chart,b=a&&a.events||{};a=A(this.userOptions,a);d.options[this.coll].indexOf&&(d.options[this.coll][d.options[this.coll].indexOf(this.userOptions)]=a);G(d.options[this.coll].events,function(a,c){"undefined"===typeof b[c]&&(b[c]=void 0)});this.destroy(!0);this.init(d,g(a,{events:b}));d.isDirtyBox=!0;M(c,!0)&&d.redraw()},remove:function(c){for(var d= this.chart,g=this.coll,b=this.series,e=b.length;e--;)b[e]&&b[e].remove(!1);r(d.axes,this);r(d[g],this);a(d.options[g])?d.options[g].splice(this.options.index,1):delete d.options[g];d[g].forEach(function(a,b){a.options.index=a.userOptions.index=b});this.destroy();d.isDirtyBox=!0;M(c,!0)&&d.redraw()},setTitle:function(a,c){this.update({title:a},c)},setCategories:function(a,c){this.update({categories:a},c)}})});N(m,"Series/AreaSeries.js",[m["Core/Series/Series.js"],m["Core/Color/Color.js"],m["Core/Globals.js"], m["Mixins/LegendSymbol.js"],m["Core/Utilities.js"]],function(f,h,m,z,F){var L=h.parse,K=F.objectEach,C=F.pick,y=m.Series;f.seriesType("area","line",{threshold:0},{singleStacks:!1,getStackPoints:function(e){var f=[],h=[],m=this.xAxis,D=this.yAxis,n=D.stacking.stacks[this.stackKey],l={},y=this.index,w=D.series,r=w.length,d=C(D.options.reversedStacks,!0)?1:-1,g;e=e||this.points;if(this.options.stacking){for(g=0;gf&&x>C?(x=Math.max(f,C),D=2*C-x):xL&&D>C?(D=Math.max(L,C),x=2*C-D):D=Math.abs(f)&&.5f.closestPointRange*f.xAxis.transA;g=f.borderWidth=l(d.borderWidth,g?0:1);var c=f.xAxis,a=f.yAxis,q=d.threshold,p=f.translatedThreshold=a.getThreshold(q),n=l(d.minPointLength,5),m=f.getColumnMetrics(),v=m.width,x=f.barW=Math.max(v,1+2*g),y=f.pointXOffset=m.offset,z=f.dataMin,C=f.dataMax;h.inverted&&(p-=.5);d.pointPadding&&(x=Math.ceil(x));L.prototype.translate.apply(f);f.points.forEach(function(g){var u= l(g.yBottom,p),b=999+Math.abs(u),k=v,t=g.plotX||0;b=e(g.plotY,-b,a.len+b);var r=t+y,w=x,A=Math.min(b,u),B=Math.max(b,u)-A;if(n&&Math.abs(B)n?u-n:p-(E?n:0)}I(g.options.pointWidth)&&(k=w=Math.ceil(g.options.pointWidth),r-=Math.round((k-v)/2));d.centerInCategory&&(r=f.adjustForMissingColumns(r,k,g,m));g.barX=r;g.pointWidth=k;g.tooltipPos=h.inverted?[a.len+a.pos-h.plotLeft- b,c.len+c.pos-h.plotTop-(t||0)-y-w/2,B]:[r+w/2,b+a.pos-h.plotTop,B];g.shapeType=f.pointClass.prototype.shapeType||"rect";g.shapeArgs=f.crispCol.apply(f,g.isNull?[r,p,w,0]:[r,A,w,B])})},getSymbol:f,drawLegendSymbol:F.drawRectangle,drawGraph:function(){this.group[this.dense?"addClass":"removeClass"]("highcharts-dense-data")},pointAttribs:function(e,f){var d=this.options,g=this.pointAttrToOptions||{};var c=g.stroke||"borderColor";var a=g["stroke-width"]||"borderWidth",h=e&&e.color||this.color,p=e&&e[c]|| d[c]||this.color||h,m=e&&e[a]||d[a]||this[a]||0;g=e&&e.options.dashStyle||d.dashStyle;var r=l(e&&e.opacity,d.opacity,1);if(e&&this.zones.length){var v=e.getZone();h=e.options.color||v&&(v.color||e.nonZonedColor)||this.color;v&&(p=v.borderColor||p,g=v.dashStyle||g,m=v.borderWidth||m)}f&&e&&(e=n(d.states[f],e.options.states&&e.options.states[f]||{}),f=e.brightness,h=e.color||"undefined"!==typeof f&&y(h).brighten(e.brightness).get()||h,p=e[c]||p,m=e[a]||m,g=e.dashStyle||g,r=l(e.opacity,r));c={fill:h, stroke:p,"stroke-width":m,opacity:r};g&&(c.dashstyle=g);return c},drawPoints:function(){var e=this,f=this.chart,d=e.options,g=f.renderer,c=d.animationLimit||250,a;e.points.forEach(function(h){var p=h.graphic,l=!!p,q=p&&f.pointCount\u25cf
{series.name}
',pointFormat:"x: {point.x}
y: {point.y}
"}},{sorted:!1,requireSorting:!1,noSharedTooltip:!0,trackerGroups:["group", "markerGroup","dataLabelsGroup"],takeOrdinalPosition:!1,drawGraph:function(){(this.options.lineWidth||0===this.options.lineWidth&&this.graph&&this.graph.strokeWidth())&&z.prototype.drawGraph.call(this)},applyJitter:function(){var f=this,h=this.options.jitter,m=this.points.length;h&&this.points.forEach(function(z,y){["x","y"].forEach(function(e,C){var v="plot"+e.toUpperCase();if(h[e]&&!z.isNull){var x=f[e+"Axis"];var D=h[e]*x.transA;if(x&&!x.isLog){var n=Math.max(0,z[v]-D);x=Math.min(x.len,z[v]+D); C=1E4*Math.sin(y+C*m);z[v]=n+(x-n)*(C-Math.floor(C));"x"===e&&(z.clientX=z.plotX)}}})})}});m(z,"afterTranslate",function(){this.applyJitter&&this.applyJitter()});""});N(m,"Mixins/CenteredSeries.js",[m["Core/Globals.js"],m["Core/Utilities.js"]],function(f,h){var m=h.isNumber,z=h.pick,F=h.relativeLength,L=f.deg2rad;return f.CenteredSeriesMixin={getCenter:function(){var h=this.options,m=this.chart,y=2*(h.slicedOffset||0),e=m.plotWidth-2*y,I=m.plotHeight-2*y,v=h.center,x=Math.min(e,I),D=h.size,n=h.innerSize|| 0;"string"===typeof D&&(D=parseFloat(D));"string"===typeof n&&(n=parseFloat(n));h=[z(v[0],"50%"),z(v[1],"50%"),z(D&&0>D?void 0:h.size,"100%"),z(n&&0>n?void 0:h.innerSize||0,"0%")];!m.angular||this instanceof f.Series||(h[3]=0);for(v=0;4>v;++v)D=h[v],m=2>v||2===v&&/%$/.test(D),h[v]=F(D,[e,I,x,h[2]][v])+(m?y:0);h[3]>h[2]&&(h[3]=h[2]);return h},getStartAndEndRadians:function(f,h){f=m(f)?f:0;h=m(h)&&h>f&&360>h-f?h:f+360;return{start:L*(f+-90),end:L*(h+-90)}}}});N(m,"Series/PieSeries.js",[m["Core/Animation/AnimationUtilities.js"], m["Core/Series/Series.js"],m["Mixins/CenteredSeries.js"],m["Core/Globals.js"],m["Mixins/LegendSymbol.js"],m["Series/LineSeries.js"],m["Core/Series/Point.js"],m["Core/Renderer/SVG/SVGRenderer.js"],m["Core/Utilities.js"]],function(f,h,m,z,F,L,K,C,y){var e=f.setAnimation,I=m.getStartAndEndRadians;f=z.noop;var v=y.addEvent,x=y.clamp,D=y.defined,n=y.fireEvent,l=y.isNumber,J=y.merge,w=y.pick,r=y.relativeLength;h.seriesType("pie","line",{center:[null,null],clip:!1,colorByPoint:!0,dataLabels:{allowOverlap:!0, connectorPadding:5,connectorShape:"fixedOffset",crookDistance:"70%",distance:30,enabled:!0,formatter:function(){return this.point.isNull?void 0:this.point.name},softConnector:!0,x:0},fillColor:void 0,ignoreHiddenPoint:!0,inactiveOtherPoints:!0,legendType:"point",marker:null,size:null,showInLegend:!1,slicedOffset:10,stickyTracking:!1,tooltip:{followPointer:!0},borderColor:"#ffffff",borderWidth:1,lineWidth:void 0,states:{hover:{brightness:.1}}},{isCartesian:!1,requireSorting:!1,directTouch:!0,noSharedTooltip:!0, trackerGroups:["group","dataLabelsGroup"],axisTypes:[],pointAttribs:h.seriesTypes.column.prototype.pointAttribs,animate:function(d){var g=this,c=g.points,a=g.startAngleRad;d||c.forEach(function(c){var d=c.graphic,e=c.shapeArgs;d&&e&&(d.attr({r:w(c.startR,g.center&&g.center[3]/2),start:a,end:a}),d.animate({r:e.r,start:e.start,end:e.end},g.options.animation))})},hasData:function(){return!!this.processedXData.length},updateTotals:function(){var d,g=0,c=this.points,a=c.length,e=this.options.ignoreHiddenPoint; for(d=0;d1.5*Math.PI?E-=2*Math.PI:E<-Math.PI/2&&(E+=2*Math.PI);y.slicedTranslation={translateX:Math.round(Math.cos(E)*a),translateY:Math.round(Math.sin(E)*a)};var u=Math.cos(E)*d[2]/2;var b=Math.sin(E)*d[2]/2;y.tooltipPos=[d[0]+.7*u,d[1]+.7*b];y.half=E<-Math.PI/2||E>Math.PI/2?1:0;y.angle=E;z=Math.min(e,y.labelDistance/5);y.labelPosition={natural:{x:d[0]+ u+Math.cos(E)*y.labelDistance,y:d[1]+b+Math.sin(E)*y.labelDistance},"final":{},alignment:0>y.labelDistance?"center":y.half?"right":"left",connectorPosition:{breakAt:{x:d[0]+u+Math.cos(E)*z,y:d[1]+b+Math.sin(E)*z},touchingSliceAt:{x:d[0]+u,y:d[1]+b}}}}n(this,"afterTranslate")},drawEmpty:function(){var d=this.startAngleRad,g=this.endAngleRad,c=this.options;if(0===this.total&&this.center){var a=this.center[0];var e=this.center[1];this.graph||(this.graph=this.chart.renderer.arc(a,e,this.center[1]/2,0, d,g).addClass("highcharts-empty-series").add(this.group));this.graph.attr({d:C.prototype.symbols.arc(a,e,this.center[2]/2,0,{start:d,end:g,innerR:this.center[3]/2})});this.chart.styledMode||this.graph.attr({"stroke-width":c.borderWidth,fill:c.fillColor||"none",stroke:c.color||"#cccccc"})}else this.graph&&(this.graph=this.graph.destroy())},redrawPoints:function(){var d=this,e=d.chart,c=e.renderer,a,f,h,l,n=d.options.shadow;this.drawEmpty();!n||d.shadowGroup||e.styledMode||(d.shadowGroup=c.g("shadow").attr({zIndex:-1}).add(d.group)); d.points.forEach(function(g){var p={};f=g.graphic;if(!g.isNull&&f){l=g.shapeArgs;a=g.getTranslate();if(!e.styledMode){var q=g.shadowGroup;n&&!q&&(q=g.shadowGroup=c.g("shadow").add(d.shadowGroup));q&&q.attr(a);h=d.pointAttribs(g,g.selected&&"select")}g.delayedRendering?(f.setRadialReference(d.center).attr(l).attr(a),e.styledMode||f.attr(h).attr({"stroke-linejoin":"round"}).shadow(n,q),g.delayedRendering=!1):(f.setRadialReference(d.center),e.styledMode||J(!0,p,h),J(!0,p,l,a),f.animate(p));f.attr({visibility:g.visible? "inherit":"hidden"});f.addClass(g.getClassName())}else f&&(g.graphic=f.destroy())})},drawPoints:function(){var d=this.chart.renderer;this.points.forEach(function(e){e.graphic&&e.hasNewShapeType()&&(e.graphic=e.graphic.destroy());e.graphic||(e.graphic=d[e.shapeType](e.shapeArgs).add(e.series.group),e.delayedRendering=!0)})},searchPoint:f,sortByAngle:function(d,e){d.sort(function(c,a){return"undefined"!==typeof c.angle&&(a.angle-c.angle)*e})},drawLegendSymbol:F.drawRectangle,getCenter:m.getCenter,getSymbol:f, drawGraph:null},{init:function(){K.prototype.init.apply(this,arguments);var d=this;d.name=w(d.name,"Slice");var e=function(c){d.slice("select"===c.type)};v(d,"select",e);v(d,"unselect",e);return d},isValid:function(){return l(this.y)&&0<=this.y},setVisible:function(d,e){var c=this,a=c.series,g=a.chart,f=a.options.ignoreHiddenPoint;e=w(e,f);d!==c.visible&&(c.visible=c.options.visible=d="undefined"===typeof d?!c.visible:d,a.options.data[a.data.indexOf(c)]=c.options,["graphic","dataLabel","connector", "shadowGroup"].forEach(function(a){if(c[a])c[a][d?"show":"hide"](!0)}),c.legendItem&&g.legend.colorizeItem(c,d),d||"hover"!==c.state||c.setState(""),f&&(a.isDirty=!0),e&&g.redraw())},slice:function(d,g,c){var a=this.series;e(c,a.chart);w(g,!0);this.sliced=this.options.sliced=D(d)?d:!this.sliced;a.options.data[a.data.indexOf(this)]=this.options;this.graphic&&this.graphic.animate(this.getTranslate());this.shadowGroup&&this.shadowGroup.animate(this.getTranslate())},getTranslate:function(){return this.sliced? this.slicedTranslation:{translateX:0,translateY:0}},haloPath:function(d){var e=this.shapeArgs;return this.sliced||!this.visible?[]:this.series.chart.renderer.symbols.arc(e.x,e.y,e.r+d,e.r+d,{innerR:e.r-1,start:e.start,end:e.end})},connectorShapes:{fixedOffset:function(d,e,c){var a=e.breakAt;e=e.touchingSliceAt;return[["M",d.x,d.y],c.softConnector?["C",d.x+("left"===d.alignment?-5:5),d.y,2*a.x-e.x,2*a.y-e.y,a.x,a.y]:["L",a.x,a.y],["L",e.x,e.y]]},straight:function(d,e){e=e.touchingSliceAt;return[["M", d.x,d.y],["L",e.x,e.y]]},crookedLine:function(d,e,c){e=e.touchingSliceAt;var a=this.series,g=a.center[0],f=a.chart.plotWidth,h=a.chart.plotLeft;a=d.alignment;var l=this.shapeArgs.r;c=r(c.crookDistance,1);f="left"===a?g+l+(f+h-g-l)*(1-c):h+(g-l)*c;c=["L",f,d.y];g=!0;if("left"===a?f>d.x||fe.x)g=!1;d=[["M",d.x,d.y]];g&&d.push(c);d.push(["L",e.x,e.y]);return d}},getConnectorPath:function(){var d=this.labelPosition,e=this.series.options.dataLabels,c=e.connectorShape,a=this.connectorShapes; a[c]&&(c=a[c]);return c.call(this,{x:d.final.x,y:d.final.y,alignment:d.alignment},d.connectorPosition,e)}});""});N(m,"Core/Series/DataLabels.js",[m["Core/Animation/AnimationUtilities.js"],m["Core/Globals.js"],m["Core/Series/CartesianSeries.js"],m["Core/Utilities.js"]],function(f,h,m,z){var F=f.getDeferredAnimation;f=h.noop;var L=h.seriesTypes,K=z.arrayMax,C=z.clamp,y=z.defined,e=z.extend,I=z.fireEvent,v=z.format,x=z.isArray,D=z.merge,n=z.objectEach,l=z.pick,J=z.relativeLength,w=z.splat,r=z.stableSort; "";h.distribute=function(d,e,c){function a(a,c){return a.target-c.target}var f,g=!0,n=d,m=[];var v=0;var w=n.reducedLen||e;for(f=d.length;f--;)v+=d[f].size;if(v>w){r(d,function(a,c){return(c.rank||0)-(a.rank||0)});for(v=f=0;v<=w;)v+=d[f].size,f++;m=d.splice(f-1,d.length)}r(d,a);for(d=d.map(function(a){return{size:a.size,targets:[a.target],align:l(a.align,.5)}});g;){for(f=d.length;f--;)g=d[f],v=(Math.min.apply(0,g.targets)+Math.max.apply(0,g.targets))/2,g.pos=C(v-g.size*g.align,0,e-g.size);f=d.length; for(g=!1;f--;)0d[f].pos&&(d[f-1].size+=d[f].size,d[f-1].targets=d[f-1].targets.concat(d[f].targets),d[f-1].align=.5,d[f-1].pos+d[f-1].size>e&&(d[f-1].pos=e-d[f-1].size),d.splice(f,1),g=!0)}n.push.apply(n,m);f=0;d.some(function(a){var d=0;if(a.targets.some(function(){n[f].pos=a.pos+d;if("undefined"!==typeof c&&Math.abs(n[f].pos-n[f].target)>c)return n.slice(0,f+1).forEach(function(a){delete a.pos}),n.reducedLen=(n.reducedLen||e)-.1*e,n.reducedLen>.1*e&&h.distribute(n,e,c), !0;d+=n[f].size;f++}))return!0});r(n,a)};m.prototype.drawDataLabels=function(){function d(a,c){var d=c.filter;return d?(c=d.operator,a=a[d.property],d=d.value,">"===c&&a>d||"<"===c&&a="===c&&a>=d||"<="===c&&a<=d||"=="===c&&a==d||"==="===c&&a===d?!0:!1):!0}function e(a,c){var d=[],b;if(x(a)&&!x(c))d=a.map(function(a){return D(a,c)});else if(x(c)&&!x(a))d=c.map(function(b){return D(a,b)});else if(x(a)||x(c))for(b=Math.max(a.length,c.length);b--;)d[b]=D(a[b],c[b]);else d=D(a,c);return d}var c= this,a=c.chart,f=c.options,h=f.dataLabels,m=c.points,r,G=c.hasRendered||0,z=h.animation;z=h.defer?F(a,z,c):{defer:0,duration:0};var C=a.renderer;h=e(e(a.options.plotOptions&&a.options.plotOptions.series&&a.options.plotOptions.series.dataLabels,a.options.plotOptions&&a.options.plotOptions[c.type]&&a.options.plotOptions[c.type].dataLabels),h);I(this,"drawDataLabels");if(x(h)||h.enabled||c._hasPointLabels){var J=c.plotGroup("dataLabelsGroup","data-labels",G?"inherit":"hidden",h.zIndex||6);J.attr({opacity:+G}); !G&&(G=c.dataLabelsGroup)&&(c.visible&&J.show(!0),G[f.animation?"animate":"attr"]({opacity:1},z));m.forEach(function(g){r=w(e(h,g.dlOptions||g.options&&g.options.dataLabels));r.forEach(function(e,h){var b=e.enabled&&(!g.isNull||g.dataLabelOnNull)&&d(g,e),k=g.dataLabels?g.dataLabels[h]:g.dataLabel,p=g.connectors?g.connectors[h]:g.connector,m=l(e.distance,g.labelDistance),q=!k;if(b){var u=g.getLabelConfig();var r=l(e[g.formatPrefix+"Format"],e.format);u=y(r)?v(r,u,a):(e[g.formatPrefix+"Formatter"]|| e.formatter).call(u,e);r=e.style;var A=e.rotation;a.styledMode||(r.color=l(e.color,r.color,c.color,"#000000"),"contrast"===r.color?(g.contrastColor=C.getContrast(g.color||c.color),r.color=!y(m)&&e.inside||0>m||f.stacking?g.contrastColor:"#000000"):delete g.contrastColor,f.cursor&&(r.cursor=f.cursor));var w={r:e.borderRadius||0,rotation:A,padding:e.padding,zIndex:1};a.styledMode||(w.fill=e.backgroundColor,w.stroke=e.borderColor,w["stroke-width"]=e.borderWidth);n(w,function(a,b){"undefined"===typeof a&& delete w[b]})}!k||b&&y(u)?b&&y(u)&&(k?w.text=u:(g.dataLabels=g.dataLabels||[],k=g.dataLabels[h]=A?C.text(u,0,-9999,e.useHTML).addClass("highcharts-data-label"):C.label(u,0,-9999,e.shape,null,null,e.useHTML,null,"data-label"),h||(g.dataLabel=k),k.addClass(" highcharts-data-label-color-"+g.colorIndex+" "+(e.className||"")+(e.useHTML?" highcharts-tracker":""))),k.options=e,k.attr(w),a.styledMode||k.css(r).shadow(e.shadow),k.added||k.add(J),e.textPath&&!e.useHTML&&(k.setTextPath(g.getDataLabelPath&&g.getDataLabelPath(k)|| g.graphic,e.textPath),g.dataLabelPath&&!e.textPath.enabled&&(g.dataLabelPath=g.dataLabelPath.destroy())),c.alignDataLabel(g,k,e,null,q)):(g.dataLabel=g.dataLabel&&g.dataLabel.destroy(),g.dataLabels&&(1===g.dataLabels.length?delete g.dataLabels:delete g.dataLabels[h]),h||delete g.dataLabel,p&&(g.connector=g.connector.destroy(),g.connectors&&(1===g.connectors.length?delete g.connectors:delete g.connectors[h])))})})}I(this,"afterDrawDataLabels")};m.prototype.alignDataLabel=function(d,g,c,a,f){var h= this,n=this.chart,m=this.isCartesian&&n.inverted,q=this.enabledDataSorting,r=l(d.dlBox&&d.dlBox.centerX,d.plotX,-9999),v=l(d.plotY,-9999),w=g.getBBox(),x=c.rotation,y=c.align,u=n.isInsidePlot(r,Math.round(v),m),b="justify"===l(c.overflow,q?"none":"justify"),k=this.visible&&!1!==d.visible&&(d.series.forceDL||q&&!b||u||c.inside&&a&&n.isInsidePlot(r,m?a.x+1:a.y+a.height-1,m));var t=function(a){q&&h.xAxis&&!b&&h.setDataLabelStartPos(d,g,f,u,a)};if(k){var z=n.renderer.fontMetrics(n.styledMode?void 0:c.style.fontSize, g).b;a=e({x:m?this.yAxis.len-v:r,y:Math.round(m?this.xAxis.len-r:v),width:0,height:0},a);e(c,{width:w.width,height:w.height});x?(b=!1,r=n.renderer.rotCorr(z,x),r={x:a.x+(c.x||0)+a.width/2+r.x,y:a.y+(c.y||0)+{top:0,middle:.5,bottom:1}[c.verticalAlign]*a.height},t(r),g[f?"attr":"animate"](r).attr({align:y}),t=(x+720)%360,t=180t,"left"===y?r.y-=t?w.height:0:"center"===y?(r.x-=w.width/2,r.y-=w.height/2):"right"===y&&(r.x-=w.width,r.y-=t?0:w.height),g.placed=!0,g.alignAttr=r):(t(a),g.align(c,null, a),r=g.alignAttr);b&&0<=a.height?this.justifyDataLabel(g,c,r,w,a,f):l(c.crop,!0)&&(k=n.isInsidePlot(r.x,r.y)&&n.isInsidePlot(r.x+w.width,r.y+w.height));if(c.shape&&!x)g[f?"attr":"animate"]({anchorX:m?n.plotWidth-d.plotY:d.plotX,anchorY:m?n.plotHeight-d.plotX:d.plotY})}f&&q&&(g.placed=!1);k||q&&!b||(g.hide(!0),g.placed=!1)};m.prototype.setDataLabelStartPos=function(d,e,c,a,f){var g=this.chart,h=g.inverted,l=this.xAxis,n=l.reversed,m=h?e.height/2:e.width/2;d=(d=d.pointWidth)?d/2:0;l=h?f.x:n?-m-d:l.width- m+d;f=h?n?this.yAxis.height-m+d:-m-d:f.y;e.startXPos=l;e.startYPos=f;a?"hidden"===e.visibility&&(e.show(),e.attr({opacity:0}).animate({opacity:1})):e.attr({opacity:1}).animate({opacity:0},void 0,e.hide);g.hasRendered&&(c&&e.attr({x:e.startXPos,y:e.startYPos}),e.placed=!0)};m.prototype.justifyDataLabel=function(d,e,c,a,f,h){var g=this.chart,p=e.align,l=e.verticalAlign,n=d.box?0:d.padding||0,m=e.x;m=void 0===m?0:m;var q=e.y;var r=void 0===q?0:q;q=c.x+n;if(0>q){"right"===p&&0<=m?(e.align="left",e.inside= !0):m-=q;var v=!0}q=c.x+a.width-n;q>g.plotWidth&&("left"===p&&0>=m?(e.align="right",e.inside=!0):m+=g.plotWidth-q,v=!0);q=c.y+n;0>q&&("bottom"===l&&0<=r?(e.verticalAlign="top",e.inside=!0):r-=q,v=!0);q=c.y+a.height-n;q>g.plotHeight&&("top"===l&&0>=r?(e.verticalAlign="bottom",e.inside=!0):r+=g.plotHeight-q,v=!0);v&&(e.x=m,e.y=r,d.placed=!h,d.align(e,void 0,f));return v};L.pie&&(L.pie.prototype.dataLabelPositioners={radialDistributionY:function(d){return d.top+d.distributeBox.pos},radialDistributionX:function(d, e,c,a){return d.getX(ce.bottom-2?a:c,e.half,e)},justify:function(d,e,c){return c[0]+(d.half?-1:1)*(e+d.labelDistance)},alignToPlotEdges:function(d,e,c,a){d=d.getBBox().width;return e?d+a:c-d-a},alignToConnectors:function(d,e,c,a){var f=0,g;d.forEach(function(a){g=a.dataLabel.getBBox().width;g>f&&(f=g)});return e?f+a:c-f-a}},L.pie.prototype.drawDataLabels=function(){var d=this,e=d.data,c,a=d.chart,f=d.options.dataLabels||{},p=f.connectorPadding,n,r=a.plotWidth,v=a.plotHeight,w=a.plotLeft, x=Math.round(a.chartWidth/3),z,C=d.center,E=C[2]/2,u=C[1],b,k,t,F,I=[[],[]],J,L,N,P,S=[0,0,0,0],Y=d.dataLabelPositioners,W;d.visible&&(f.enabled||d._hasPointLabels)&&(e.forEach(function(a){a.dataLabel&&a.visible&&a.dataLabel.shortened&&(a.dataLabel.attr({width:"auto"}).css({width:"auto",textOverflow:"clip"}),a.dataLabel.shortened=!1)}),m.prototype.drawDataLabels.apply(d),e.forEach(function(a){a.dataLabel&&(a.visible?(I[a.half].push(a),a.dataLabel._pos=null,!y(f.style.width)&&!y(a.options.dataLabels&& a.options.dataLabels.style&&a.options.dataLabels.style.width)&&a.dataLabel.getBBox().width>x&&(a.dataLabel.css({width:Math.round(.7*x)+"px"}),a.dataLabel.shortened=!0)):(a.dataLabel=a.dataLabel.destroy(),a.dataLabels&&1===a.dataLabels.length&&delete a.dataLabels))}),I.forEach(function(e,g){var n=e.length,m=[],q;if(n){d.sortByAngle(e,g-.5);if(0r-p&&0===g&&(A=Math.round(J+ k-r+p),S[1]=Math.max(A,S[1])),0>L-F/2?S[0]=Math.max(Math.round(-L+F/2),S[0]):L+F/2>v&&(S[2]=Math.max(Math.round(L+F/2-v),S[2])),b.sideOverflow=A)}}}),0===K(S)||this.verifyDataLabelOverflow(S))&&(this.placeDataLabels(),this.points.forEach(function(c){W=D(f,c.options.dataLabels);if(n=l(W.connectorWidth,1)){var e;z=c.connector;if((b=c.dataLabel)&&b._pos&&c.visible&&0l(this.translatedThreshold,h.yAxis.len)),r=l(c.inside,!!this.options.stacking);n&&(a=D(n),0>a.y&&(a.height+=a.y,a.y=0),n=a.y+a.height-h.yAxis.len,0=w.x+w.width||r.x+r.width<=w.x||r.y>=w.y+w.height||r.y+r.height<=w.y||((C.labelrank=p&&h<=b||k||!n(h))l=!0;e[k?"zoomX":"zoomY"]&&l&&(d=g.zoom(a.min,a.max),g.displayBtn&&(f=!0))});var p=c.resetZoomButton;f&&!p?c.showResetZoom():!f&&g(p)&&(c.resetZoomButton=p.destroy());d&&c.redraw(q(c.options.chart.animation, a&&a.animation,100>c.pointCount))},pan:function(a,c){var e=this,f=e.hoverPoints,g=e.options.chart,h=e.options.mapNavigation&&e.options.mapNavigation.enabled,p;c="object"===typeof c?c:{enabled:c,type:"x"};g&&g.panning&&(g.panning=c);var l=c.type;J(this,"pan",{originalEvent:a},function(){f&&f.forEach(function(a){a.setState()});var c=[1];"xy"===l?c=[1,0]:"y"===l&&(c=[0]);c.forEach(function(c){var b=e[c?"xAxis":"yAxis"][0],f=b.horiz,g=a[f?"chartX":"chartY"];f=f?"mouseDownX":"mouseDownY";var n=e[f],m= (b.pointRange||0)/2,r=b.reversed&&!e.inverted||!b.reversed&&e.inverted?-1:1,u=b.getExtremes(),v=b.toValue(n-g,!0)+m*r;r=b.toValue(n+b.len-g,!0)-m*r;var w=r=r&&v<=m&&(b.setExtremes(n,v,!1,!1,{trigger:"pan"}),e.resetZoomButton||h||n===r||v===m||!l.match("y")||(e.showResetZoom(),b.displayBtn=!1),p=!0),e[f]= g)});p&&e.redraw(!1);D(e.container,{cursor:"move"})})}});l(K.prototype,{select:function(a,c){var d=this,e=d.series,f=e.chart;this.selectedStaging=a=q(a,!d.selected);d.firePointEvent(a?"select":"unselect",{accumulate:c},function(){d.selected=d.options.selected=a;e.options.data[e.data.indexOf(d)]=d.options;d.setState(a&&"select");c||f.getSelectedPoints().forEach(function(a){var c=a.series;a.selected&&a!==d&&(a.selected=a.options.selected=!1,c.options.data[c.data.indexOf(a)]=a.options,a.setState(f.hoverPoints&& c.options.inactiveOtherPoints?"inactive":""),a.firePointEvent("unselect"))})});delete this.selectedStaging},onMouseOver:function(a){var c=this.series.chart,d=c.pointer;a=a?d.normalize(a):d.getChartCoordinatesFromPoint(this,c.inverted);d.runPointActions(a,this)},onMouseOut:function(){var a=this.series.chart;this.firePointEvent("mouseOut");this.series.options.inactiveOtherPoints||(a.hoverPoints||[]).forEach(function(a){a.setState()});a.hoverPoints=a.hoverPoint=null},importEvents:function(){if(!this.hasImportedEvents){var d= this,e=c(d.series.options.point,d.options).events;d.events=e;a(e,function(a,c){r(a)&&v(d,c,a)});this.hasImportedEvents=!0}},setState:function(a,c){var d=this.series,e=this.state,f=d.options.states[a||"normal"]||{},g=I.plotOptions[d.type].marker&&d.options.marker,h=g&&!1===g.enabled,p=g&&g.states&&g.states[a||"normal"]||{},n=!1===p.enabled,m=d.stateMarkerGraphic,b=this.marker||{},k=d.chart,r=d.halo,v,w=g&&d.markerAttribs;a=a||"";if(!(a===this.state&&!c||this.selected&&"select"!==a||!1===f.enabled|| a&&(n||h&&!1===p.enabled)||a&&b.states&&b.states[a]&&!1===b.states[a].enabled)){this.state=a;w&&(v=d.markerAttribs(this,a));if(this.graphic){e&&this.graphic.removeClass("highcharts-point-"+e);a&&this.graphic.addClass("highcharts-point-"+a);if(!k.styledMode){var x=d.pointAttribs(this,a);var y=q(k.options.chart.animation,f.animation);d.options.inactiveOtherPoints&&x.opacity&&((this.dataLabels||[]).forEach(function(a){a&&a.animate({opacity:x.opacity},y)}),this.connector&&this.connector.animate({opacity:x.opacity}, y));this.graphic.animate(x,y)}v&&this.graphic.animate(v,q(k.options.chart.animation,p.animation,g.animation));m&&m.hide()}else{if(a&&p){e=b.symbol||d.symbol;m&&m.currentSymbol!==e&&(m=m.destroy());if(v)if(m)m[c?"animate":"attr"]({x:v.x,y:v.y});else e&&(d.stateMarkerGraphic=m=k.renderer.symbol(e,v.x,v.y,v.width,v.height).add(d.markerGroup),m.currentSymbol=e);!k.styledMode&&m&&m.attr(d.pointAttribs(this,a))}m&&(m[a&&this.isInside?"show":"hide"](),m.element.point=this)}a=f.halo;f=(m=this.graphic||m)&& m.visibility||"inherit";a&&a.size&&m&&"hidden"!==f&&!this.isCluster?(r||(d.halo=r=k.renderer.path().add(m.parentGroup)),r.show()[c?"animate":"attr"]({d:this.haloPath(a.size)}),r.attr({"class":"highcharts-halo highcharts-color-"+q(this.colorIndex,d.colorIndex)+(this.className?" "+this.className:""),visibility:f,zIndex:-1}),r.point=this,k.styledMode||r.attr(l({fill:this.color||d.color,"fill-opacity":a.opacity},a.attributes))):r&&r.point&&r.point.haloPath&&r.animate({d:r.point.haloPath(0)},null,r.hide); J(this,"afterSetState")}},haloPath:function(a){return this.series.chart.renderer.symbols.circle(Math.floor(this.plotX)-a,this.plotY-a,2*a,2*a)}});l(F.prototype,{onMouseOver:function(){var a=this.chart,c=a.hoverSeries;a.pointer.setHoverChartIndex();if(c&&c!==this)c.onMouseOut();this.options.events.mouseOver&&J(this,"mouseOver");this.setState("hover");a.hoverSeries=this},onMouseOut:function(){var a=this.options,c=this.chart,d=c.tooltip,e=c.hoverPoint;c.hoverSeries=null;if(e)e.onMouseOut();this&&a.events.mouseOut&& J(this,"mouseOut");!d||this.stickyTracking||d.shared&&!this.noSharedTooltip||d.hide();c.series.forEach(function(a){a.setState("",!0)})},setState:function(a,c){var d=this,e=d.options,f=d.graph,g=e.inactiveOtherPoints,h=e.states,l=e.lineWidth,m=e.opacity,n=q(h[a||"normal"]&&h[a||"normal"].animation,d.chart.options.chart.animation);e=0;a=a||"";if(d.state!==a&&([d.group,d.markerGroup,d.dataLabelsGroup].forEach(function(b){b&&(d.state&&b.removeClass("highcharts-series-"+d.state),a&&b.addClass("highcharts-series-"+ a))}),d.state=a,!d.chart.styledMode)){if(h[a]&&!1===h[a].enabled)return;a&&(l=h[a].lineWidth||l+(h[a].lineWidthPlus||0),m=q(h[a].opacity,m));if(f&&!f.dashstyle)for(h={"stroke-width":l},f.animate(h,n);d["zone-graph-"+e];)d["zone-graph-"+e].attr(h),e+=1;g||[d.group,d.markerGroup,d.dataLabelsGroup,d.labelBySeries].forEach(function(a){a&&a.animate({opacity:m},n)})}c&&g&&d.points&&d.setAllPointsToState(a)},setAllPointsToState:function(a){this.points.forEach(function(c){c.setState&&c.setState(a)})},setVisible:function(a, c){var d=this,e=d.chart,f=d.legendItem,g=e.options.chart.ignoreHiddenSeries,h=d.visible;var l=(d.visible=a=d.options.visible=d.userOptions.visible="undefined"===typeof a?!h:a)?"show":"hide";["group","dataLabelsGroup","markerGroup","tracker","tt"].forEach(function(a){if(d[a])d[a][l]()});if(e.hoverSeries===d||(e.hoverPoint&&e.hoverPoint.series)===d)d.onMouseOut();f&&e.legend.colorizeItem(d,a);d.isDirty=!0;d.options.stacking&&e.series.forEach(function(a){a.options.stacking&&a.visible&&(a.isDirty=!0)}); d.linkedSeries.forEach(function(c){c.setVisible(a,!1)});g&&(e.isDirtyBox=!0);J(d,l);!1!==c&&e.redraw()},show:function(){this.setVisible(!0)},hide:function(){this.setVisible(!1)},select:function(a){this.selected=a=this.options.selected="undefined"===typeof a?!this.selected:a;this.checkbox&&(this.checkbox.checked=a);J(this,a?"select":"unselect")},drawTracker:m.drawTrackerGraph})});N(m,"Core/Responsive.js",[m["Core/Chart/Chart.js"],m["Core/Utilities.js"]],function(f,h){var m=h.find,z=h.isArray,F=h.isObject, L=h.merge,K=h.objectEach,C=h.pick,y=h.splat,e=h.uniqueKey;f.prototype.setResponsive=function(f,h){var v=this.options.responsive,y=[],n=this.currentResponsive;!h&&v&&v.rules&&v.rules.forEach(function(f){"undefined"===typeof f._id&&(f._id=e());this.matchResponsiveRule(f,y)},this);h=L.apply(0,y.map(function(e){return m(v.rules,function(f){return f._id===e}).chartOptions}));h.isResponsiveOptions=!0;y=y.toString()||void 0;y!==(n&&n.ruleIds)&&(n&&this.update(n.undoOptions,f,!0),y?(n=this.currentOptions(h), n.isResponsiveOptions=!0,this.currentResponsive={ruleIds:y,mergedOptions:h,undoOptions:n},this.update(h,f,!0)):this.currentResponsive=void 0)};f.prototype.matchResponsiveRule=function(e,f){var h=e.condition;(h.callback||function(){return this.chartWidth<=C(h.maxWidth,Number.MAX_VALUE)&&this.chartHeight<=C(h.maxHeight,Number.MAX_VALUE)&&this.chartWidth>=C(h.minWidth,0)&&this.chartHeight>=C(h.minHeight,0)}).call(this)&&f.push(e._id)};f.prototype.currentOptions=function(e){function f(e,l,m,v){var n; K(e,function(d,e){if(!v&&-1d.userAgent.indexOf("Chrome"),c=n.URL||n.webkitURL||n;try{if(d.msSaveOrOpenBlob&&n.MSBlobBuilder){var m=new n.MSBlobBuilder;m.append(a);return m.getBlob("image/svg+xml")}if(!f)return c.createObjectURL(new n.Blob(["\ufeff"+a],{type:b}))}catch(N){}}var C=e.doc,f=e.seriesTypes,n=e.win;e=c.addEvent;var J=c.defined,K=c.extend,F=c.find,D= c.fireEvent,L=c.getOptions,M=c.isNumber,x=c.pick;c=c.setOptions;var G=g.downloadURL;c({exporting:{csv:{annotations:{itemDelimiter:"; ",join:!1},columnHeaderFormatter:null,dateFormat:"%Y-%m-%d %H:%M:%S",decimalPoint:null,itemDelimiter:null,lineDelimiter:"\n"},showTable:!1,useMultiLevelHeaders:!0,useRowspanHeaders:!0},lang:{downloadCSV:"Download CSV",downloadXLS:"Download XLS",exportData:{annotationHeader:"Annotations",categoryHeader:"Category",categoryDatetimeHeader:"DateTime"},viewData:"View data table", hideData:"Hide data table"}});e(b,"render",function(){this.options&&this.options.exporting&&this.options.exporting.showTable&&!this.options.chart.forExport&&!this.dataTableDiv&&this.viewData()});b.prototype.setUpKeyToAxis=function(){f.arearange&&(f.arearange.prototype.keyToAxis={low:"y",high:"y"});f.gantt&&(f.gantt.prototype.keyToAxis={start:"x",end:"x"})};b.prototype.getDataRows=function(d){var b=this.hasParallelCoordinates,f=this.time,c=this.options.exporting&&this.options.exporting.csv||{},e=this.xAxis, r={},g=[],n=[],E=[],t;var u=this.options.lang.exportData;var q=u.categoryHeader,y=u.categoryDatetimeHeader,H=function(k,b,f){if(c.columnHeaderFormatter){var h=c.columnHeaderFormatter(k,b,f);if(!1!==h)return h}return k?k instanceof a?k.options.title&&k.options.title.text||(k.dateTime?y:q):d?{columnTitle:1',d=this.options,c=a?(1.1).toLocaleString()[1]:".",f=x(d.exporting.useMultiLevelHeaders,!0);a=this.getDataRows(f);var e=0,g=f?a.shift():null,n=a.shift(),p=function(a,b,d,f){var e=x(f,""); b="text"+(b?" "+b:"");"number"===typeof e?(e=e.toString(),","===c&&(e=e.replace(".",c)),b="number"):f||(b="empty");return"<"+a+(d?" "+d:"")+' class="'+b+'">'+e+""};!1!==d.exporting.tableCaption&&(b+=''+x(d.exporting.tableCaption,d.title.text?d.title.text.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'").replace(/\//g,"/"):"Chart")+"");for(var t=0,u=a.length;t e&&(e=a[t].length);b+=function(a,b,c){var e="",g=0;c=c||b&&b.length;var h,m=0;if(h=f&&a&&b){a:if(h=a.length,b.length===h){for(;h--;)if(a[h]!==b[h]){h=!1;break a}h=!0}else h=!1;h=!h}if(h){for(e+="";g"}return e+""}(g,n,Math.max(e,n.length));b+="";a.forEach(function(a){b+="";for(var d=0;d"});b+="";a={html:b};D(this,"afterGetTable",a);return a.html};b.prototype.downloadCSV=function(){var a=this.getCSV(!0);G(v(a,"text/csv")||"data:text/csv,\ufeff"+encodeURIComponent(a),this.getFilename()+ ".csv")};b.prototype.downloadXLS=function(){var a='\x3c!--[if gte mso 9]>Ark1td{border:none;font-family: Calibri, sans-serif;} .number{mso-number-format:"0.00";} .text{ mso-number-format:"@";}'+ this.getTable(!0)+"";G(v(a,"application/vnd.ms-excel")||"data:application/vnd.ms-excel;base64,"+n.btoa(unescape(encodeURIComponent(a))),this.getFilename()+".xls")};b.prototype.viewData=function(){this.dataTableDiv||(this.dataTableDiv=C.createElement("div"),this.dataTableDiv.className="highcharts-data-table",this.renderTo.parentNode.insertBefore(this.dataTableDiv,this.renderTo.nextSibling),this.dataTableDiv.innerHTML=this.getTable());if(""===this.dataTableDiv.style.display||"none"=== this.dataTableDiv.style.display)this.dataTableDiv.style.display="block";this.isDataTableVisible=!0;D(this,"afterViewData",this.dataTableDiv)};b.prototype.hideData=function(){this.dataTableDiv&&"block"===this.dataTableDiv.style.display&&(this.dataTableDiv.style.display="none");this.isDataTableVisible=!1};b.prototype.toggleDataTable=function(){var a=this.exportDivElements,b=this.options.exporting;b=b&&b.buttons&&b.buttons.contextButton.menuItems;var c=this.options.lang;this.isDataTableVisible?this.hideData(): this.viewData();(null===p||void 0===p?0:p.menuItemDefinitions)&&(null===c||void 0===c?0:c.viewData)&&c.hideData&&b&&a&&a.length&&(a[b.indexOf("viewData")].innerHTML=this.isDataTableVisible?c.hideData:c.viewData)};var p=L().exporting;p&&(K(p.menuItemDefinitions,{downloadCSV:{textKey:"downloadCSV",onclick:function(){this.downloadCSV()}},downloadXLS:{textKey:"downloadXLS",onclick:function(){this.downloadXLS()}},viewData:{textKey:"viewData",onclick:function(){this.toggleDataTable()}}}),p.buttons&&p.buttons.contextButton.menuItems.push("separator", "downloadCSV","downloadXLS","viewData"));f.map&&(f.map.prototype.exportKey="name");f.mapbubble&&(f.mapbubble.prototype.exportKey="name");f.treemap&&(f.treemap.prototype.exportKey="name")});g(a,"masters/modules/export-data.src.js",[],function(){})}); //# sourceMappingURL=export-data.js.map /***/ }), /***/ "./node_modules/highcharts/modules/exporting.js": /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/* Highcharts JS v8.2.2 (2020-10-22) Exporting module (c) 2010-2019 Torstein Honsi License: www.highcharts.com/license */ (function(e){ true&&module.exports?(e["default"]=e,module.exports=e): true?!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__("./node_modules/highcharts/highcharts.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function(q){e(q);e.Highcharts=q;return e}).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)):undefined})(function(e){function q(e,l,g,k){e.hasOwnProperty(l)||(e[l]=k.apply(null,g))}e=e?e._modules:{};q(e,"Extensions/FullScreen.js",[e["Core/Chart/Chart.js"],e["Core/Globals.js"],e["Core/Utilities.js"]],function(e,l,g){var k=g.addEvent; g=function(){function e(f){this.chart=f;this.isOpen=!1;f=f.renderTo;this.browserProps||("function"===typeof f.requestFullscreen?this.browserProps={fullscreenChange:"fullscreenchange",requestFullscreen:"requestFullscreen",exitFullscreen:"exitFullscreen"}:f.mozRequestFullScreen?this.browserProps={fullscreenChange:"mozfullscreenchange",requestFullscreen:"mozRequestFullScreen",exitFullscreen:"mozCancelFullScreen"}:f.webkitRequestFullScreen?this.browserProps={fullscreenChange:"webkitfullscreenchange", requestFullscreen:"webkitRequestFullScreen",exitFullscreen:"webkitExitFullscreen"}:f.msRequestFullscreen&&(this.browserProps={fullscreenChange:"MSFullscreenChange",requestFullscreen:"msRequestFullscreen",exitFullscreen:"msExitFullscreen"}))}e.prototype.close=function(){var f=this.chart;if(this.isOpen&&this.browserProps&&f.container.ownerDocument instanceof Document)f.container.ownerDocument[this.browserProps.exitFullscreen]();this.unbindFullscreenEvent&&this.unbindFullscreenEvent();this.isOpen=!1; this.setButtonText()};e.prototype.open=function(){var f=this,e=f.chart;if(f.browserProps){f.unbindFullscreenEvent=k(e.container.ownerDocument,f.browserProps.fullscreenChange,function(){f.isOpen?(f.isOpen=!1,f.close()):(f.isOpen=!0,f.setButtonText())});var g=e.renderTo[f.browserProps.requestFullscreen]();if(g)g["catch"](function(){alert("Full screen is not supported inside a frame.")});k(e,"destroy",f.unbindFullscreenEvent)}};e.prototype.setButtonText=function(){var f,e=this.chart,g=e.exportDivElements, k=e.options.exporting,l=null===(f=null===k||void 0===k?void 0:k.buttons)||void 0===f?void 0:f.contextButton.menuItems;f=e.options.lang;(null===k||void 0===k?0:k.menuItemDefinitions)&&(null===f||void 0===f?0:f.exitFullscreen)&&f.viewFullscreen&&l&&g&&g.length&&(g[l.indexOf("viewFullscreen")].innerHTML=this.isOpen?f.exitFullscreen:k.menuItemDefinitions.viewFullscreen.text||f.viewFullscreen)};e.prototype.toggle=function(){this.isOpen?this.close():this.open()};return e}();l.Fullscreen=g;k(e,"beforeRender", function(){this.fullscreen=new l.Fullscreen(this)});return l.Fullscreen});q(e,"Mixins/Navigation.js",[],function(){return{initUpdate:function(e){e.navigation||(e.navigation={updates:[],update:function(e,g){this.updates.forEach(function(k){k.update.call(k.context,e,g)})}})},addUpdate:function(e,l){l.navigation||this.initUpdate(l);l.navigation.updates.push({update:e,context:l})}}});q(e,"Extensions/Exporting.js",[e["Core/Chart/Chart.js"],e["Mixins/Navigation.js"],e["Core/Globals.js"],e["Core/Options.js"], e["Core/Renderer/SVG/SVGRenderer.js"],e["Core/Utilities.js"]],function(e,l,g,k,q,f){var A=g.doc,H=g.isTouchDevice,y=g.win;k=k.defaultOptions;var v=f.addEvent,r=f.css,x=f.createElement,D=f.discardElement,z=f.extend,I=f.find,C=f.fireEvent,J=f.isObject,p=f.merge,E=f.objectEach,t=f.pick,K=f.removeEvent,L=f.uniqueKey,F=y.navigator.userAgent,G=g.Renderer.prototype.symbols,M=/Edge\/|Trident\/|MSIE /.test(F),N=/firefox/i.test(F);z(k.lang,{viewFullscreen:"View in full screen",exitFullscreen:"Exit from full screen", printChart:"Print chart",downloadPNG:"Download PNG image",downloadJPEG:"Download JPEG image",downloadPDF:"Download PDF document",downloadSVG:"Download SVG vector image",contextButtonTitle:"Chart context menu"});k.navigation||(k.navigation={});p(!0,k.navigation,{buttonOptions:{theme:{},symbolSize:14,symbolX:12.5,symbolY:10.5,align:"right",buttonSpacing:3,height:22,verticalAlign:"top",width:24}});p(!0,k.navigation,{menuStyle:{border:"1px solid #999999",background:"#ffffff",padding:"5px 0"},menuItemStyle:{padding:"0.5em 1em", color:"#333333",background:"none",fontSize:H?"14px":"11px",transition:"background 250ms, color 250ms"},menuItemHoverStyle:{background:"#335cad",color:"#ffffff"},buttonOptions:{symbolFill:"#666666",symbolStroke:"#666666",symbolStrokeWidth:3,theme:{padding:5}}});k.exporting={type:"image/png",url:"https://export.highcharts.com/",printMaxWidth:780,scale:2,buttons:{contextButton:{className:"highcharts-contextbutton",menuClassName:"highcharts-contextmenu",symbol:"menu",titleKey:"contextButtonTitle",menuItems:"viewFullscreen printChart separator downloadPNG downloadJPEG downloadPDF downloadSVG".split(" ")}}, menuItemDefinitions:{viewFullscreen:{textKey:"viewFullscreen",onclick:function(){this.fullscreen.toggle()}},printChart:{textKey:"printChart",onclick:function(){this.print()}},separator:{separator:!0},downloadPNG:{textKey:"downloadPNG",onclick:function(){this.exportChart()}},downloadJPEG:{textKey:"downloadJPEG",onclick:function(){this.exportChart({type:"image/jpeg"})}},downloadPDF:{textKey:"downloadPDF",onclick:function(){this.exportChart({type:"application/pdf"})}},downloadSVG:{textKey:"downloadSVG", onclick:function(){this.exportChart({type:"image/svg+xml"})}}}};g.post=function(a,b,c){var d=x("form",p({method:"post",action:a,enctype:"multipart/form-data"},c),{display:"none"},A.body);E(b,function(a,b){x("input",{type:"hidden",name:b,value:a},null,d)});d.submit();D(d)};g.isSafari&&g.win.matchMedia("print").addListener(function(a){g.printingChart&&(a.matches?g.printingChart.beforePrint():g.printingChart.afterPrint())});z(e.prototype,{sanitizeSVG:function(a,b){var c=a.indexOf("")+6,d=a.substr(c); a=a.substr(0,c);b&&b.exporting&&b.exporting.allowHTML&&d&&(d=''+d.replace(/(<(?:img|br).*?(?=>))>/g,"$1 />")+"",a=a.replace("",d+""));a=a.replace(/zIndex="[^"]+"/g,"").replace(/symbolName="[^"]+"/g,"").replace(/jQuery[0-9]+="[^"]+"/g,"").replace(/url\(("|")(.*?)("|");?\)/g,"url($2)").replace(/url\([^#]+#/g,"url(#").replace(/]+(>|$)/g,"").replace(/[\s_]+/g,"-").replace(/[^a-z0-9\-]/g,"").replace(/^[\-]+/g,"").replace(/[\-]+/g,"-").substr(0,24).replace(/[\-]+$/g,""));if(!b||5>b.length)b="chart";return b},exportChart:function(a,b){b=this.getSVGForExport(a,b);a=p(this.options.exporting,a);g.post(a.url,{filename:a.filename? a.filename.replace(/\//g,"-"):this.getFilename(),type:a.type,width:a.width||0,scale:a.scale,svg:b},a.formAttributes)},moveContainers:function(a){(this.fixedDiv?[this.fixedDiv,this.scrollingContainer]:[this.container]).forEach(function(b){a.appendChild(b)})},beforePrint:function(){var a=A.body,b=this.options.exporting.printMaxWidth,c={childNodes:a.childNodes,origDisplay:[],resetParams:void 0};this.isPrinting=!0;this.pointer.reset(null,0);C(this,"beforePrint");b&&this.chartWidth>b&&(c.resetParams=[this.options.chart.width, void 0,!1],this.setSize(b,void 0,!1));[].forEach.call(c.childNodes,function(a,b){1===a.nodeType&&(c.origDisplay[b]=a.style.display,a.style.display="none")});this.moveContainers(a);this.printReverseInfo=c},afterPrint:function(){if(this.printReverseInfo){var a=this.printReverseInfo.childNodes,b=this.printReverseInfo.origDisplay,c=this.printReverseInfo.resetParams;this.moveContainers(this.renderTo);[].forEach.call(a,function(a,c){1===a.nodeType&&(a.style.display=b[c]||"")});this.isPrinting=!1;c&&this.setSize.apply(this, c);delete this.printReverseInfo;delete g.printingChart;C(this,"afterPrint")}},print:function(){var a=this;a.isPrinting||(g.printingChart=a,g.isSafari||a.beforePrint(),setTimeout(function(){y.focus();y.print();g.isSafari||setTimeout(function(){a.afterPrint()},1E3)},1))},contextMenu:function(a,b,c,d,e,g,k){var h=this,w=h.options.navigation,l=h.chartWidth,B=h.chartHeight,n="cache-"+a,m=h[n],u=Math.max(e,g);if(!m){h.exportContextMenu=h[n]=m=x("div",{className:a},{position:"absolute",zIndex:1E3,padding:u+ "px",pointerEvents:"auto"},h.fixedDiv||h.container);var p=x("ul",{className:"highcharts-menu"},{listStyle:"none",margin:0,padding:0},m);h.styledMode||r(p,z({MozBoxShadow:"3px 3px 10px #888",WebkitBoxShadow:"3px 3px 10px #888",boxShadow:"3px 3px 10px #888"},w.menuStyle));m.hideMenu=function(){r(m,{display:"none"});k&&k.setState(0);h.openMenu=!1;r(h.renderTo,{overflow:"hidden"});f.clearTimeout(m.hideTimer);C(h,"exportMenuHidden")};h.exportEvents.push(v(m,"mouseleave",function(){m.hideTimer=y.setTimeout(m.hideMenu, 500)}),v(m,"mouseenter",function(){f.clearTimeout(m.hideTimer)}),v(A,"mouseup",function(b){h.pointer.inClass(b.target,a)||m.hideMenu()}),v(m,"click",function(){h.openMenu&&m.hideMenu()}));b.forEach(function(a){"string"===typeof a&&(a=h.options.exporting.menuItemDefinitions[a]);if(J(a,!0)){if(a.separator)var b=x("hr",null,null,p);else"viewData"===a.textKey&&h.isDataTableVisible&&(a.textKey="hideData"),b=x("li",{className:"highcharts-menu-item",onclick:function(b){b&&b.stopPropagation();m.hideMenu(); a.onclick&&a.onclick.apply(h,arguments)},innerHTML:a.text||h.options.lang[a.textKey]},null,p),h.styledMode||(b.onmouseover=function(){r(this,w.menuItemHoverStyle)},b.onmouseout=function(){r(this,w.menuItemStyle)},r(b,z({cursor:"pointer"},w.menuItemStyle)));h.exportDivElements.push(b)}});h.exportDivElements.push(p,m);h.exportMenuWidth=m.offsetWidth;h.exportMenuHeight=m.offsetHeight}b={display:"block"};c+h.exportMenuWidth>l?b.right=l-c-e-u+"px":b.left=c-u+"px";d+g+h.exportMenuHeight>B&&"top"!==k.alignOptions.verticalAlign? b.bottom=B-d-u+"px":b.top=d+g-u+"px";r(m,b);r(h.renderTo,{overflow:""});h.openMenu=!0;C(h,"exportMenuShown")},addButton:function(a){var b=this,c=b.renderer,d=p(b.options.navigation.buttonOptions,a),e=d.onclick,f=d.menuItems,g=d.symbolSize||12;b.btnCount||(b.btnCount=0);b.exportDivElements||(b.exportDivElements=[],b.exportSVGElements=[]);if(!1!==d.enabled){var h=d.theme,k=h.states,l=k&&k.hover;k=k&&k.select;var B;b.styledMode||(h.fill=t(h.fill,"#ffffff"),h.stroke=t(h.stroke,"none"));delete h.states; e?B=function(a){a&&a.stopPropagation();e.call(b,a)}:f&&(B=function(a){a&&a.stopPropagation();b.contextMenu(n.menuClassName,f,n.translateX,n.translateY,n.width,n.height,n);n.setState(2)});d.text&&d.symbol?h.paddingLeft=t(h.paddingLeft,25):d.text||z(h,{width:d.width,height:d.height,padding:0});b.styledMode||(h["stroke-linecap"]="round",h.fill=t(h.fill,"#ffffff"),h.stroke=t(h.stroke,"none"));var n=c.button(d.text,0,0,B,h,l,k).addClass(a.className).attr({title:t(b.options.lang[d._titleKey||d.titleKey], "")});n.menuClassName=a.menuClassName||"highcharts-menu-"+b.btnCount++;if(d.symbol){var m=c.symbol(d.symbol,d.symbolX-g/2,d.symbolY-g/2,g,g,{width:g,height:g}).addClass("highcharts-button-symbol").attr({zIndex:1}).add(n);b.styledMode||m.attr({stroke:d.symbolStroke,fill:d.symbolFill,"stroke-width":d.symbolStrokeWidth||1})}n.add(b.exportingGroup).align(z(d,{width:n.width,x:t(d.x,b.buttonOffset)}),!0,"spacingBox");b.buttonOffset+=(n.width+d.buttonSpacing)*("right"===d.align?-1:1);b.exportSVGElements.push(n, m)}},destroyExport:function(a){var b=a?a.target:this;a=b.exportSVGElements;var c=b.exportDivElements,d=b.exportEvents,e;a&&(a.forEach(function(a,d){a&&(a.onclick=a.ontouchstart=null,e="cache-"+a.menuClassName,b[e]&&delete b[e],b.exportSVGElements[d]=a.destroy())}),a.length=0);b.exportingGroup&&(b.exportingGroup.destroy(),delete b.exportingGroup);c&&(c.forEach(function(a,d){f.clearTimeout(a.hideTimer);K(a,"mouseleave");b.exportDivElements[d]=a.onmouseout=a.onmouseover=a.ontouchstart=a.onclick=null; D(a)}),c.length=0);d&&(d.forEach(function(a){a()}),d.length=0)}});q.prototype.inlineToAttributes="fill stroke strokeLinecap strokeLinejoin strokeWidth textAnchor x y".split(" ");q.prototype.inlineBlacklist=[/-/,/^(clipPath|cssText|d|height|width)$/,/^font$/,/[lL]ogical(Width|Height)$/,/perspective/,/TapHighlightColor/,/^transition/,/^length$/];q.prototype.unstyledElements=["clipPath","defs","desc"];e.prototype.inlineStyles=function(){function a(a){return a.replace(/([A-Z])/g,function(a,b){return"-"+ b.toLowerCase()})}function b(c){function n(b,g){u=q=!1;if(f){for(r=f.length;r--&&!q;)q=f[r].test(g);u=!q}"transform"===g&&"none"===b&&(u=!0);for(r=e.length;r--&&!u;)u=e[r].test(g)||"function"===typeof b;u||w[g]===b&&"svg"!==c.nodeName||h[c.nodeName][g]===b||(d&&-1===d.indexOf(g)?m+=a(g)+":"+b+";":b&&c.setAttribute(a(g),b))}var m="",u,q,r;if(1===c.nodeType&&-1===g.indexOf(c.nodeName)){var t=y.getComputedStyle(c,null);var w="svg"===c.nodeName?{}:y.getComputedStyle(c.parentNode,null);if(!h[c.nodeName]){k= l.getElementsByTagName("svg")[0];var v=l.createElementNS(c.namespaceURI,c.nodeName);k.appendChild(v);h[c.nodeName]=p(y.getComputedStyle(v,null));"text"===c.nodeName&&delete h.text.fill;k.removeChild(v)}if(N||M)for(var x in t)n(t[x],x);else E(t,n);m&&(t=c.getAttribute("style"),c.setAttribute("style",(t?t+";":"")+m));"svg"===c.nodeName&&c.setAttribute("stroke-width","1px");"text"!==c.nodeName&&[].forEach.call(c.children||c.childNodes,b)}}var c=this.renderer,d=c.inlineToAttributes,e=c.inlineBlacklist, f=c.inlineWhitelist,g=c.unstyledElements,h={},k;c=A.createElement("iframe");r(c,{width:"1px",height:"1px",visibility:"hidden"});A.body.appendChild(c);var l=c.contentWindow.document;l.open();l.write('');l.close();b(this.container.querySelector("svg"));k.parentNode.remove();c.remove()};G.menu=function(a,b,c,d){return[["M",a,b+2.5],["L",a+c,b+2.5],["M",a,b+d/2+.5],["L",a+c,b+d/2+.5],["M",a,b+d-1.5],["L",a+c,b+d-1.5]]};G.menuball=function(a,b,c,d){a=[];d= d/3-2;return a=a.concat(this.circle(c-d,b,d,d),this.circle(c-d,b+d+4,d,d),this.circle(c-d,b+2*(d+4),d,d))};e.prototype.renderExporting=function(){var a=this,b=a.options.exporting,c=b.buttons,d=a.isDirtyExporting||!a.exportSVGElements;a.buttonOffset=0;a.isDirtyExporting&&a.destroyExport();d&&!1!==b.enabled&&(a.exportEvents=[],a.exportingGroup=a.exportingGroup||a.renderer.g("exporting-group").attr({zIndex:3}).add(),E(c,function(b){a.addButton(b)}),a.isDirtyExporting=!1);v(a,"destroy",a.destroyExport)}; v(e,"init",function(){var a=this;a.exporting={update:function(b,c){a.isDirtyExporting=!0;p(!0,a.options.exporting,b);t(c,!0)&&a.redraw()}};l.addUpdate(function(b,c){a.isDirtyExporting=!0;p(!0,a.options.navigation,b);t(c,!0)&&a.redraw()},a)});e.prototype.callbacks.push(function(a){a.renderExporting();v(a,"redraw",a.renderExporting)})});q(e,"masters/modules/exporting.src.js",[],function(){})}); //# sourceMappingURL=exporting.js.map /***/ }), /***/ "./node_modules/highcharts/modules/xrange.js": /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/* Highcharts JS v8.2.2 (2020-10-22) X-range series (c) 2010-2019 Torstein Honsi, Lars A. V. Cabrera License: www.highcharts.com/license */ (function(b){ true&&module.exports?(b["default"]=b,module.exports=b): true?!(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__("./node_modules/highcharts/highcharts.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function(g){b(g);b.Highcharts=g;return b}).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)):undefined})(function(b){function g(b,g,p,r){b.hasOwnProperty(g)||(b[g]=r.apply(null,p))}b=b?b._modules:{};g(b,"Series/XRangeSeries.js",[b["Core/Axis/Axis.js"],b["Core/Series/Series.js"],b["Core/Globals.js"],b["Core/Color/Color.js"],b["Core/Series/Point.js"], b["Core/Utilities.js"]],function(b,g,p,r,y,k){var A=r.parse;r=k.addEvent;var t=k.clamp,D=k.correctFloat,E=k.defined,B=k.find,u=k.isNumber,w=k.isObject,v=k.merge,x=k.pick,F=p.Series,z=g.seriesTypes,C=z.column;g.seriesType("xrange","column",{colorByPoint:!0,dataLabels:{formatter:function(){var a=this.point.partialFill;w(a)&&(a=a.amount);if(u(a)&&0{point.x} - {point.x2}

',pointFormat:'\u25cf {series.name}: {point.yCategory}
'}, borderRadius:3,pointRange:0},{type:"xrange",parallelArrays:["x","x2","y"],requireSorting:!1,animate:z.line.prototype.animate,cropShoulder:1,getExtremesFromAll:!0,autoIncrement:p.noop,buildKDTree:p.noop,init:function(){z.column.prototype.init.apply(this,arguments);this.options.stacking=void 0},getColumnMetrics:function(){function a(){f.series.forEach(function(a){var c=a.xAxis;a.xAxis=a.yAxis;a.yAxis=c})}var f=this.chart;a();var d=C.prototype.getColumnMetrics.call(this);a();return d},cropData:function(a, f,d,l){f=F.prototype.cropData.call(this,this.x2Data,f,d,l);f.xData=a.slice(f.start,f.end);return f},findPointIndex:function(a){var f=this.cropped,d=this.cropStart,l=this.points,c=a.id;if(c)var e=(e=B(l,function(a){return a.id===c}))?e.index:void 0;"undefined"===typeof e&&(e=(e=B(l,function(c){return c.x===a.x&&c.x2===a.x2&&!c.touched}))?e.index:void 0);f&&u(e)&&u(d)&&e>=d&&(e-=d);return e},translatePoint:function(a){var f=this.xAxis,d=this.yAxis,l=this.columnMetrics,c=this.options,e=c.minPointLength|| 0,b=a.plotX,g=x(a.x2,a.x+(a.len||0)),h=f.translate(g,0,0,0,1);g=Math.abs(h-b);var n=this.chart.inverted,k=x(c.borderWidth,1)%2/2,m=l.offset,q=Math.round(l.width);e&&(e-=g,0>e&&(e=0),b-=e/2,h+=e/2);b=Math.max(b,-10);h=t(h,-10,f.len+10);E(a.options.pointWidth)&&(m-=(Math.ceil(a.options.pointWidth)-q)/2,q=Math.ceil(a.options.pointWidth));c.pointPlacement&&u(a.plotY)&&d.categories&&(a.plotY=d.translate(a.y,0,1,0,1,c.pointPlacement));a.shapeArgs={x:Math.floor(Math.min(b,h))+k,y:Math.floor(a.plotY+m)+k, width:Math.round(Math.abs(h-b)),height:q,r:this.options.borderRadius};c=a.shapeArgs.x;e=c+a.shapeArgs.width;0>c||e>f.len?(c=t(c,0,f.len),e=t(e,0,f.len),h=e-c,a.dlBox=v(a.shapeArgs,{x:c,width:e-c,centerX:h?h/2:null})):a.dlBox=null;c=a.tooltipPos;e=n?1:0;h=n?0:1;l=this.columnMetrics?this.columnMetrics.offset:-l.width/2;c[e]=t(c[e]+g/2*(f.reversed?-1:1)*(n?-1:1),0,f.len-1);c[h]=t(c[h]+(n?-1:1)*l,0,d.len-1);if(l=a.partialFill)w(l)&&(l=l.amount),u(l)||(l=0),d=a.shapeArgs,a.partShapeArgs={x:d.x,y:d.y,width:d.width, height:d.height,r:this.options.borderRadius},b=Math.max(Math.round(g*l+a.plotX-b),0),a.clipRectArgs={x:f.reversed?d.x+g-b:d.x,y:d.y,width:b,height:d.height}},translate:function(){C.prototype.translate.apply(this,arguments);this.points.forEach(function(a){this.translatePoint(a)},this)},drawPoint:function(a,f){var d=this.options,b=this.chart.renderer,c=a.graphic,e=a.shapeType,g=a.shapeArgs,k=a.partShapeArgs,h=a.clipRectArgs,n=a.partialFill,p=d.stacking&&!d.borderRadius,m=a.state,q=d.states[m||"normal"]|| {},r="undefined"===typeof m?"attr":f;m=this.pointAttribs(a,m);q=x(this.chart.options.chart.animation,q.animation);if(a.isNull||!1===a.visible)c&&(a.graphic=c.destroy());else{if(c)c.rect[f](g);else a.graphic=c=b.g("point").addClass(a.getClassName()).add(a.group||this.group),c.rect=b[e](v(g)).addClass(a.getClassName()).addClass("highcharts-partfill-original").add(c);k&&(c.partRect?(c.partRect[f](v(k)),c.partialClipRect[f](v(h))):(c.partialClipRect=b.clipRect(h.x,h.y,h.width,h.height),c.partRect=b[e](k).addClass("highcharts-partfill-overlay").add(c).clip(c.partialClipRect))); this.chart.styledMode||(c.rect[f](m,q).shadow(d.shadow,null,p),k&&(w(n)||(n={}),w(d.partialFill)&&(n=v(d.partialFill,n)),a=n.fill||A(m.fill).brighten(-.3).get()||A(a.color||this.color).brighten(-.3).get(),m.fill=a,c.partRect[r](m,q).shadow(d.shadow,null,p)))}},drawPoints:function(){var a=this,b=a.getAnimationVerb();a.points.forEach(function(f){a.drawPoint(f,b)})},getAnimationVerb:function(){return this.chart.pointCount<(this.options.animationLimit||250)?"animate":"attr"}},{resolveColor:function(){var a= this.series;if(a.options.colorByPoint&&!this.options.color){var b=a.options.colors||a.chart.options.colors;var d=this.y%(b?b.length:a.chart.options.chart.colorCount);b=b&&b[d];a.chart.styledMode||(this.color=b);this.options.colorIndex||(this.colorIndex=d)}else this.color||(this.color=a.color)},init:function(){y.prototype.init.apply(this,arguments);this.y||(this.y=0);return this},setState:function(){y.prototype.setState.apply(this,arguments);this.series.drawPoint(this,this.series.getAnimationVerb())}, getLabelConfig:function(){var a=y.prototype.getLabelConfig.call(this),b=this.series.yAxis.categories;a.x2=this.x2;a.yCategory=this.yCategory=b&&b[this.y];return a},tooltipDateKeys:["x","x2"],isValid:function(){return"number"===typeof this.x&&"number"===typeof this.x2}});r(b,"afterGetSeriesExtremes",function(){var a=this.series,b;if(this.isXAxis){var d=x(this.dataMax,-Number.MAX_VALUE);a.forEach(function(a){a.x2Data&&a.x2Data.forEach(function(a){a>d&&(d=a,b=!0)})});b&&(this.dataMax=d)}});""});g(b, "masters/modules/xrange.src.js",[],function(){})}); //# sourceMappingURL=xrange.js.map /***/ }), /***/ "./node_modules/history/es6/index.js": /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; // EXPORTS __webpack_require__.d(__webpack_exports__, "a", function() { return /* reexport */ es6_createBrowserHistory; }); // UNUSED EXPORTS: createHashHistory, createMemoryHistory, useBasename, useBeforeUnload, useQueries, Actions, enableBeforeUnload, enableQueries, createLocation // EXTERNAL MODULE: ./node_modules/history/node_modules/warning/browser.js var browser = __webpack_require__("./node_modules/history/node_modules/warning/browser.js"); // CONCATENATED MODULE: ./node_modules/history/es6/deprecate.js function deprecate(fn, message) { return function () { false ? undefined : undefined; return fn.apply(this, arguments); }; } /* harmony default export */ var es6_deprecate = (deprecate); // CONCATENATED MODULE: ./node_modules/history/es6/Actions.js /** * Indicates that navigation was caused by a call to history.push. */ var PUSH = 'PUSH'; /** * Indicates that navigation was caused by a call to history.replace. */ var REPLACE = 'REPLACE'; /** * Indicates that navigation was caused by some other action such * as using a browser's back/forward buttons and/or manually manipulating * the URL in a browser's location bar. This is the default. * * See https://developer.mozilla.org/en-US/docs/Web/API/WindowEventHandlers/onpopstate * for more information. */ var POP = 'POP'; /* harmony default export */ var Actions = ({ PUSH: PUSH, REPLACE: REPLACE, POP: POP }); // CONCATENATED MODULE: ./node_modules/history/es6/PathUtils.js function extractPath(string) { var match = string.match(/^https?:\/\/[^\/]*/); if (match == null) return string; return string.substring(match[0].length); } function parsePath(path) { var pathname = extractPath(path); var search = ''; var hash = ''; false ? undefined : undefined; var hashIndex = pathname.indexOf('#'); if (hashIndex !== -1) { hash = pathname.substring(hashIndex); pathname = pathname.substring(0, hashIndex); } var searchIndex = pathname.indexOf('?'); if (searchIndex !== -1) { search = pathname.substring(searchIndex); pathname = pathname.substring(0, searchIndex); } if (pathname === '') pathname = '/'; return { pathname: pathname, search: search, hash: hash }; } // CONCATENATED MODULE: ./node_modules/history/es6/createLocation.js var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; function createLocation_createLocation() { var location = arguments.length <= 0 || arguments[0] === undefined ? '/' : arguments[0]; var action = arguments.length <= 1 || arguments[1] === undefined ? POP : arguments[1]; var key = arguments.length <= 2 || arguments[2] === undefined ? null : arguments[2]; var _fourthArg = arguments.length <= 3 || arguments[3] === undefined ? null : arguments[3]; if (typeof location === 'string') location = parsePath(location); if (typeof action === 'object') { false ? undefined : undefined; location = _extends({}, location, { state: action }); action = key || POP; key = _fourthArg; } var pathname = location.pathname || '/'; var search = location.search || ''; var hash = location.hash || ''; var state = location.state || null; return { pathname: pathname, search: search, hash: hash, state: state, action: action, key: key }; } /* harmony default export */ var es6_createLocation = (createLocation_createLocation); // EXTERNAL MODULE: ./node_modules/invariant/browser.js var invariant_browser = __webpack_require__("./node_modules/invariant/browser.js"); var invariant_browser_default = /*#__PURE__*/__webpack_require__.n(invariant_browser); // CONCATENATED MODULE: ./node_modules/history/es6/ExecutionEnvironment.js var canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement); // CONCATENATED MODULE: ./node_modules/history/es6/DOMUtils.js function addEventListener(node, event, listener) { if (node.addEventListener) { node.addEventListener(event, listener, false); } else { node.attachEvent('on' + event, listener); } } function removeEventListener(node, event, listener) { if (node.removeEventListener) { node.removeEventListener(event, listener, false); } else { node.detachEvent('on' + event, listener); } } function getHashPath() { // We can't use window.location.hash here because it's not // consistent across browsers - Firefox will pre-decode it! return window.location.href.split('#')[1] || ''; } function replaceHashPath(path) { window.location.replace(window.location.pathname + window.location.search + '#' + path); } function getWindowPath() { return window.location.pathname + window.location.search + window.location.hash; } function DOMUtils_go(n) { if (n) window.history.go(n); } function DOMUtils_getUserConfirmation(message, callback) { callback(window.confirm(message)); } /** * Returns true if the HTML5 history API is supported. Taken from Modernizr. * * https://github.com/Modernizr/Modernizr/blob/master/LICENSE * https://github.com/Modernizr/Modernizr/blob/master/feature-detects/history.js * changed to avoid false negatives for Windows Phones: https://github.com/rackt/react-router/issues/586 */ function supportsHistory() { var ua = navigator.userAgent; if ((ua.indexOf('Android 2.') !== -1 || ua.indexOf('Android 4.0') !== -1) && ua.indexOf('Mobile Safari') !== -1 && ua.indexOf('Chrome') === -1 && ua.indexOf('Windows Phone') === -1) { return false; } return window.history && 'pushState' in window.history; } /** * Returns false if using go(n) with hash history causes a full page reload. */ function supportsGoWithoutReloadUsingHash() { var ua = navigator.userAgent; return ua.indexOf('Firefox') === -1; } // CONCATENATED MODULE: ./node_modules/history/es6/DOMStateStorage.js /*eslint-disable no-empty */ var KeyPrefix = '@@History/'; var QuotaExceededErrors = ['QuotaExceededError', 'QUOTA_EXCEEDED_ERR']; var SecurityError = 'SecurityError'; function DOMStateStorage_createKey(key) { return KeyPrefix + key; } function DOMStateStorage_saveState(key, state) { try { if (state == null) { window.sessionStorage.removeItem(DOMStateStorage_createKey(key)); } else { window.sessionStorage.setItem(DOMStateStorage_createKey(key), JSON.stringify(state)); } } catch (error) { if (error.name === SecurityError) { // Blocking cookies in Chrome/Firefox/Safari throws SecurityError on any // attempt to access window.sessionStorage. false ? undefined : undefined; return; } if (QuotaExceededErrors.indexOf(error.name) >= 0 && window.sessionStorage.length === 0) { // Safari "private mode" throws QuotaExceededError. false ? undefined : undefined; return; } throw error; } } function DOMStateStorage_readState(key) { var json = undefined; try { json = window.sessionStorage.getItem(DOMStateStorage_createKey(key)); } catch (error) { if (error.name === SecurityError) { // Blocking cookies in Chrome/Firefox/Safari throws SecurityError on any // attempt to access window.sessionStorage. false ? undefined : undefined; return null; } } if (json) { try { return JSON.parse(json); } catch (error) { // Ignore invalid JSON. } } return null; } // EXTERNAL MODULE: ./node_modules/deep-equal/index.js var deep_equal = __webpack_require__("./node_modules/deep-equal/index.js"); var deep_equal_default = /*#__PURE__*/__webpack_require__.n(deep_equal); // CONCATENATED MODULE: ./node_modules/history/es6/AsyncUtils.js var _slice = Array.prototype.slice; function loopAsync(turns, work, callback) { var currentTurn = 0, isDone = false; var sync = false, hasNext = false, doneArgs = undefined; function done() { isDone = true; if (sync) { // Iterate instead of recursing if possible. doneArgs = [].concat(_slice.call(arguments)); return; } callback.apply(this, arguments); } function next() { if (isDone) { return; } hasNext = true; if (sync) { // Iterate instead of recursing if possible. return; } sync = true; while (!isDone && currentTurn < turns && hasNext) { hasNext = false; work.call(this, currentTurn++, next, done); } sync = false; if (isDone) { // This means the loop finished synchronously. callback.apply(this, doneArgs); return; } if (currentTurn >= turns && hasNext) { isDone = true; callback(); } } next(); } // CONCATENATED MODULE: ./node_modules/history/es6/runTransitionHook.js function runTransitionHook(hook, location, callback) { var result = hook(location, callback); if (hook.length < 2) { // Assume the hook runs synchronously and automatically // call the callback with the return value. callback(result); } else { false ? undefined : undefined; } } /* harmony default export */ var es6_runTransitionHook = (runTransitionHook); // CONCATENATED MODULE: ./node_modules/history/es6/createHistory.js var createHistory_extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; function createRandomKey(length) { return Math.random().toString(36).substr(2, length); } function locationsAreEqual(a, b) { return a.pathname === b.pathname && a.search === b.search && //a.action === b.action && // Different action !== location change. a.key === b.key && deep_equal_default()(a.state, b.state); } var DefaultKeyLength = 6; function createHistory_createHistory() { var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0]; var getCurrentLocation = options.getCurrentLocation; var finishTransition = options.finishTransition; var saveState = options.saveState; var go = options.go; var getUserConfirmation = options.getUserConfirmation; var keyLength = options.keyLength; if (typeof keyLength !== 'number') keyLength = DefaultKeyLength; var transitionHooks = []; function listenBefore(hook) { transitionHooks.push(hook); return function () { transitionHooks = transitionHooks.filter(function (item) { return item !== hook; }); }; } var allKeys = []; var changeListeners = []; var location = undefined; function getCurrent() { if (pendingLocation && pendingLocation.action === POP) { return allKeys.indexOf(pendingLocation.key); } else if (location) { return allKeys.indexOf(location.key); } else { return -1; } } function updateLocation(newLocation) { var current = getCurrent(); location = newLocation; if (location.action === PUSH) { allKeys = [].concat(allKeys.slice(0, current + 1), [location.key]); } else if (location.action === REPLACE) { allKeys[current] = location.key; } changeListeners.forEach(function (listener) { listener(location); }); } function listen(listener) { changeListeners.push(listener); if (location) { listener(location); } else { var _location = getCurrentLocation(); allKeys = [_location.key]; updateLocation(_location); } return function () { changeListeners = changeListeners.filter(function (item) { return item !== listener; }); }; } function confirmTransitionTo(location, callback) { loopAsync(transitionHooks.length, function (index, next, done) { es6_runTransitionHook(transitionHooks[index], location, function (result) { if (result != null) { done(result); } else { next(); } }); }, function (message) { if (getUserConfirmation && typeof message === 'string') { getUserConfirmation(message, function (ok) { callback(ok !== false); }); } else { callback(message !== false); } }); } var pendingLocation = undefined; function transitionTo(nextLocation) { if (location && locationsAreEqual(location, nextLocation)) return; // Nothing to do. pendingLocation = nextLocation; confirmTransitionTo(nextLocation, function (ok) { if (pendingLocation !== nextLocation) return; // Transition was interrupted. if (ok) { // treat PUSH to current path like REPLACE to be consistent with browsers if (nextLocation.action === PUSH) { var prevPath = createPath(location); var nextPath = createPath(nextLocation); if (nextPath === prevPath && deep_equal_default()(location.state, nextLocation.state)) nextLocation.action = REPLACE; } if (finishTransition(nextLocation) !== false) updateLocation(nextLocation); } else if (location && nextLocation.action === POP) { var prevIndex = allKeys.indexOf(location.key); var nextIndex = allKeys.indexOf(nextLocation.key); if (prevIndex !== -1 && nextIndex !== -1) go(prevIndex - nextIndex); // Restore the URL. } }); } function push(location) { transitionTo(createLocation(location, PUSH, createKey())); } function replace(location) { transitionTo(createLocation(location, REPLACE, createKey())); } function goBack() { go(-1); } function goForward() { go(1); } function createKey() { return createRandomKey(keyLength); } function createPath(location) { if (location == null || typeof location === 'string') return location; var pathname = location.pathname; var search = location.search; var hash = location.hash; var result = pathname; if (search) result += search; if (hash) result += hash; return result; } function createHref(location) { return createPath(location); } function createLocation(location, action) { var key = arguments.length <= 2 || arguments[2] === undefined ? createKey() : arguments[2]; if (typeof action === 'object') { false ? undefined : undefined; if (typeof location === 'string') location = parsePath(location); location = createHistory_extends({}, location, { state: action }); action = key; key = arguments[3] || createKey(); } return es6_createLocation(location, action, key); } // deprecated function setState(state) { if (location) { updateLocationState(location, state); updateLocation(location); } else { updateLocationState(getCurrentLocation(), state); } } function updateLocationState(location, state) { location.state = createHistory_extends({}, location.state, state); saveState(location.key, location.state); } // deprecated function registerTransitionHook(hook) { if (transitionHooks.indexOf(hook) === -1) transitionHooks.push(hook); } // deprecated function unregisterTransitionHook(hook) { transitionHooks = transitionHooks.filter(function (item) { return item !== hook; }); } // deprecated function pushState(state, path) { if (typeof path === 'string') path = parsePath(path); push(createHistory_extends({ state: state }, path)); } // deprecated function replaceState(state, path) { if (typeof path === 'string') path = parsePath(path); replace(createHistory_extends({ state: state }, path)); } return { listenBefore: listenBefore, listen: listen, transitionTo: transitionTo, push: push, replace: replace, go: go, goBack: goBack, goForward: goForward, createKey: createKey, createPath: createPath, createHref: createHref, createLocation: createLocation, setState: es6_deprecate(setState, 'setState is deprecated; use location.key to save state instead'), registerTransitionHook: es6_deprecate(registerTransitionHook, 'registerTransitionHook is deprecated; use listenBefore instead'), unregisterTransitionHook: es6_deprecate(unregisterTransitionHook, 'unregisterTransitionHook is deprecated; use the callback returned from listenBefore instead'), pushState: es6_deprecate(pushState, 'pushState is deprecated; use push instead'), replaceState: es6_deprecate(replaceState, 'replaceState is deprecated; use replace instead') }; } /* harmony default export */ var es6_createHistory = (createHistory_createHistory); // CONCATENATED MODULE: ./node_modules/history/es6/createDOMHistory.js var createDOMHistory_extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; function createDOMHistory(options) { var history = es6_createHistory(createDOMHistory_extends({ getUserConfirmation: DOMUtils_getUserConfirmation }, options, { go: DOMUtils_go })); function listen(listener) { !canUseDOM ? false ? undefined : invariant_browser_default()(false) : undefined; return history.listen(listener); } return createDOMHistory_extends({}, history, { listen: listen }); } /* harmony default export */ var es6_createDOMHistory = (createDOMHistory); // CONCATENATED MODULE: ./node_modules/history/es6/createBrowserHistory.js var createBrowserHistory_extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; /** * Creates and returns a history object that uses HTML5's history API * (pushState, replaceState, and the popstate event) to manage history. * This is the recommended method of managing history in browsers because * it provides the cleanest URLs. * * Note: In browsers that do not support the HTML5 history API full * page reloads will be used to preserve URLs. */ function createBrowserHistory() { var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0]; !canUseDOM ? false ? undefined : invariant_browser_default()(false) : undefined; var forceRefresh = options.forceRefresh; var isSupported = supportsHistory(); var useRefresh = !isSupported || forceRefresh; function getCurrentLocation(historyState) { try { historyState = historyState || window.history.state || {}; } catch (e) { historyState = {}; } var path = getWindowPath(); var _historyState = historyState; var key = _historyState.key; var state = undefined; if (key) { state = DOMStateStorage_readState(key); } else { state = null; key = history.createKey(); if (isSupported) window.history.replaceState(createBrowserHistory_extends({}, historyState, { key: key }), null); } var location = parsePath(path); return history.createLocation(createBrowserHistory_extends({}, location, { state: state }), undefined, key); } function startPopStateListener(_ref) { var transitionTo = _ref.transitionTo; function popStateListener(event) { if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit. transitionTo(getCurrentLocation(event.state)); } addEventListener(window, 'popstate', popStateListener); return function () { removeEventListener(window, 'popstate', popStateListener); }; } function finishTransition(location) { var basename = location.basename; var pathname = location.pathname; var search = location.search; var hash = location.hash; var state = location.state; var action = location.action; var key = location.key; if (action === POP) return; // Nothing to do. DOMStateStorage_saveState(key, state); var path = (basename || '') + pathname + search + hash; var historyState = { key: key }; if (action === PUSH) { if (useRefresh) { window.location.href = path; return false; // Prevent location update. } else { window.history.pushState(historyState, null, path); } } else { // REPLACE if (useRefresh) { window.location.replace(path); return false; // Prevent location update. } else { window.history.replaceState(historyState, null, path); } } } var history = es6_createDOMHistory(createBrowserHistory_extends({}, options, { getCurrentLocation: getCurrentLocation, finishTransition: finishTransition, saveState: DOMStateStorage_saveState })); var listenerCount = 0, stopPopStateListener = undefined; function listenBefore(listener) { if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history); var unlisten = history.listenBefore(listener); return function () { unlisten(); if (--listenerCount === 0) stopPopStateListener(); }; } function listen(listener) { if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history); var unlisten = history.listen(listener); return function () { unlisten(); if (--listenerCount === 0) stopPopStateListener(); }; } // deprecated function registerTransitionHook(hook) { if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history); history.registerTransitionHook(hook); } // deprecated function unregisterTransitionHook(hook) { history.unregisterTransitionHook(hook); if (--listenerCount === 0) stopPopStateListener(); } return createBrowserHistory_extends({}, history, { listenBefore: listenBefore, listen: listen, registerTransitionHook: registerTransitionHook, unregisterTransitionHook: unregisterTransitionHook }); } /* harmony default export */ var es6_createBrowserHistory = (createBrowserHistory); // CONCATENATED MODULE: ./node_modules/history/es6/createHashHistory.js var createHashHistory_extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; function isAbsolutePath(path) { return typeof path === 'string' && path.charAt(0) === '/'; } function ensureSlash() { var path = getHashPath(); if (isAbsolutePath(path)) return true; replaceHashPath('/' + path); return false; } function addQueryStringValueToPath(path, key, value) { return path + (path.indexOf('?') === -1 ? '?' : '&') + (key + '=' + value); } function stripQueryStringValueFromPath(path, key) { return path.replace(new RegExp('[?&]?' + key + '=[a-zA-Z0-9]+'), ''); } function getQueryStringValueFromPath(path, key) { var match = path.match(new RegExp('\\?.*?\\b' + key + '=(.+?)\\b')); return match && match[1]; } var DefaultQueryKey = '_k'; function createHashHistory() { var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0]; !canUseDOM ? false ? undefined : invariant_browser_default()(false) : undefined; var queryKey = options.queryKey; if (queryKey === undefined || !!queryKey) queryKey = typeof queryKey === 'string' ? queryKey : DefaultQueryKey; function getCurrentLocation() { var path = getHashPath(); var key = undefined, state = undefined; if (queryKey) { key = getQueryStringValueFromPath(path, queryKey); path = stripQueryStringValueFromPath(path, queryKey); if (key) { state = DOMStateStorage_readState(key); } else { state = null; key = history.createKey(); replaceHashPath(addQueryStringValueToPath(path, queryKey, key)); } } else { key = state = null; } var location = parsePath(path); return history.createLocation(createHashHistory_extends({}, location, { state: state }), undefined, key); } function startHashChangeListener(_ref) { var transitionTo = _ref.transitionTo; function hashChangeListener() { if (!ensureSlash()) return; // Always make sure hashes are preceeded with a /. transitionTo(getCurrentLocation()); } ensureSlash(); addEventListener(window, 'hashchange', hashChangeListener); return function () { removeEventListener(window, 'hashchange', hashChangeListener); }; } function finishTransition(location) { var basename = location.basename; var pathname = location.pathname; var search = location.search; var state = location.state; var action = location.action; var key = location.key; if (action === POP) return; // Nothing to do. var path = (basename || '') + pathname + search; if (queryKey) { path = addQueryStringValueToPath(path, queryKey, key); DOMStateStorage_saveState(key, state); } else { // Drop key and state. location.key = location.state = null; } var currentHash = getHashPath(); if (action === PUSH) { if (currentHash !== path) { window.location.hash = path; } else { false ? undefined : undefined; } } else if (currentHash !== path) { // REPLACE replaceHashPath(path); } } var history = es6_createDOMHistory(createHashHistory_extends({}, options, { getCurrentLocation: getCurrentLocation, finishTransition: finishTransition, saveState: DOMStateStorage_saveState })); var listenerCount = 0, stopHashChangeListener = undefined; function listenBefore(listener) { if (++listenerCount === 1) stopHashChangeListener = startHashChangeListener(history); var unlisten = history.listenBefore(listener); return function () { unlisten(); if (--listenerCount === 0) stopHashChangeListener(); }; } function listen(listener) { if (++listenerCount === 1) stopHashChangeListener = startHashChangeListener(history); var unlisten = history.listen(listener); return function () { unlisten(); if (--listenerCount === 0) stopHashChangeListener(); }; } function push(location) { false ? undefined : undefined; history.push(location); } function replace(location) { false ? undefined : undefined; history.replace(location); } var goIsSupportedWithoutReload = supportsGoWithoutReloadUsingHash(); function go(n) { false ? undefined : undefined; history.go(n); } function createHref(path) { return '#' + history.createHref(path); } // deprecated function registerTransitionHook(hook) { if (++listenerCount === 1) stopHashChangeListener = startHashChangeListener(history); history.registerTransitionHook(hook); } // deprecated function unregisterTransitionHook(hook) { history.unregisterTransitionHook(hook); if (--listenerCount === 0) stopHashChangeListener(); } // deprecated function pushState(state, path) { false ? undefined : undefined; history.pushState(state, path); } // deprecated function replaceState(state, path) { false ? undefined : undefined; history.replaceState(state, path); } return createHashHistory_extends({}, history, { listenBefore: listenBefore, listen: listen, push: push, replace: replace, go: go, createHref: createHref, registerTransitionHook: registerTransitionHook, // deprecated - warning is in createHistory unregisterTransitionHook: unregisterTransitionHook, // deprecated - warning is in createHistory pushState: pushState, // deprecated - warning is in createHistory replaceState: replaceState // deprecated - warning is in createHistory }); } /* harmony default export */ var es6_createHashHistory = (createHashHistory); // CONCATENATED MODULE: ./node_modules/history/es6/createMemoryHistory.js var createMemoryHistory_extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; function createStateStorage(entries) { return entries.filter(function (entry) { return entry.state; }).reduce(function (memo, entry) { memo[entry.key] = entry.state; return memo; }, {}); } function createMemoryHistory() { var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0]; if (Array.isArray(options)) { options = { entries: options }; } else if (typeof options === 'string') { options = { entries: [options] }; } var history = es6_createHistory(createMemoryHistory_extends({}, options, { getCurrentLocation: getCurrentLocation, finishTransition: finishTransition, saveState: saveState, go: go })); var _options = options; var entries = _options.entries; var current = _options.current; if (typeof entries === 'string') { entries = [entries]; } else if (!Array.isArray(entries)) { entries = ['/']; } entries = entries.map(function (entry) { var key = history.createKey(); if (typeof entry === 'string') return { pathname: entry, key: key }; if (typeof entry === 'object' && entry) return createMemoryHistory_extends({}, entry, { key: key }); true ? false ? undefined : invariant_browser_default()(false) : undefined; }); if (current == null) { current = entries.length - 1; } else { !(current >= 0 && current < entries.length) ? false ? undefined : invariant_browser_default()(false) : undefined; } var storage = createStateStorage(entries); function saveState(key, state) { storage[key] = state; } function readState(key) { return storage[key]; } function getCurrentLocation() { var entry = entries[current]; var basename = entry.basename; var pathname = entry.pathname; var search = entry.search; var path = (basename || '') + pathname + (search || ''); var key = undefined, state = undefined; if (entry.key) { key = entry.key; state = readState(key); } else { key = history.createKey(); state = null; entry.key = key; } var location = parsePath(path); return history.createLocation(createMemoryHistory_extends({}, location, { state: state }), undefined, key); } function canGo(n) { var index = current + n; return index >= 0 && index < entries.length; } function go(n) { if (n) { if (!canGo(n)) { false ? undefined : undefined; return; } current += n; var currentLocation = getCurrentLocation(); // change action to POP history.transitionTo(createMemoryHistory_extends({}, currentLocation, { action: POP })); } } function finishTransition(location) { switch (location.action) { case PUSH: current += 1; // if we are not on the top of stack // remove rest and push new if (current < entries.length) entries.splice(current); entries.push(location); saveState(location.key, location.state); break; case REPLACE: entries[current] = location; saveState(location.key, location.state); break; } } return history; } /* harmony default export */ var es6_createMemoryHistory = (createMemoryHistory); // CONCATENATED MODULE: ./node_modules/history/es6/useBasename.js var useBasename_extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; function useBasename(createHistory) { return function () { var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0]; var history = createHistory(options); var basename = options.basename; var checkedBaseHref = false; function checkBaseHref() { if (checkedBaseHref) { return; } // Automatically use the value of in HTML // documents as basename if it's not explicitly given. if (basename == null && canUseDOM) { var base = document.getElementsByTagName('base')[0]; var baseHref = base && base.getAttribute('href'); if (baseHref != null) { basename = baseHref; false ? undefined : undefined; } } checkedBaseHref = true; } function addBasename(location) { checkBaseHref(); if (basename && location.basename == null) { if (location.pathname.indexOf(basename) === 0) { location.pathname = location.pathname.substring(basename.length); location.basename = basename; if (location.pathname === '') location.pathname = '/'; } else { location.basename = ''; } } return location; } function prependBasename(location) { checkBaseHref(); if (!basename) return location; if (typeof location === 'string') location = parsePath(location); var pname = location.pathname; var normalizedBasename = basename.slice(-1) === '/' ? basename : basename + '/'; var normalizedPathname = pname.charAt(0) === '/' ? pname.slice(1) : pname; var pathname = normalizedBasename + normalizedPathname; return useBasename_extends({}, location, { pathname: pathname }); } // Override all read methods with basename-aware versions. function listenBefore(hook) { return history.listenBefore(function (location, callback) { es6_runTransitionHook(hook, addBasename(location), callback); }); } function listen(listener) { return history.listen(function (location) { listener(addBasename(location)); }); } // Override all write methods with basename-aware versions. function push(location) { history.push(prependBasename(location)); } function replace(location) { history.replace(prependBasename(location)); } function createPath(location) { return history.createPath(prependBasename(location)); } function createHref(location) { return history.createHref(prependBasename(location)); } function createLocation(location) { for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { args[_key - 1] = arguments[_key]; } return addBasename(history.createLocation.apply(history, [prependBasename(location)].concat(args))); } // deprecated function pushState(state, path) { if (typeof path === 'string') path = parsePath(path); push(useBasename_extends({ state: state }, path)); } // deprecated function replaceState(state, path) { if (typeof path === 'string') path = parsePath(path); replace(useBasename_extends({ state: state }, path)); } return useBasename_extends({}, history, { listenBefore: listenBefore, listen: listen, push: push, replace: replace, createPath: createPath, createHref: createHref, createLocation: createLocation, pushState: es6_deprecate(pushState, 'pushState is deprecated; use push instead'), replaceState: es6_deprecate(replaceState, 'replaceState is deprecated; use replace instead') }); }; } /* harmony default export */ var es6_useBasename = (useBasename); // CONCATENATED MODULE: ./node_modules/history/es6/useBeforeUnload.js var useBeforeUnload_extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; function startBeforeUnloadListener(getBeforeUnloadPromptMessage) { function listener(event) { var message = getBeforeUnloadPromptMessage(); if (typeof message === 'string') { (event || window.event).returnValue = message; return message; } } addEventListener(window, 'beforeunload', listener); return function () { removeEventListener(window, 'beforeunload', listener); }; } /** * Returns a new createHistory function that can be used to create * history objects that know how to use the beforeunload event in web * browsers to cancel navigation. */ function useBeforeUnload(createHistory) { return function (options) { var history = createHistory(options); var stopBeforeUnloadListener = undefined; var beforeUnloadHooks = []; function getBeforeUnloadPromptMessage() { var message = undefined; for (var i = 0, len = beforeUnloadHooks.length; message == null && i < len; ++i) { message = beforeUnloadHooks[i].call(); }return message; } function listenBeforeUnload(hook) { beforeUnloadHooks.push(hook); if (beforeUnloadHooks.length === 1) { if (canUseDOM) { stopBeforeUnloadListener = startBeforeUnloadListener(getBeforeUnloadPromptMessage); } else { false ? undefined : undefined; } } return function () { beforeUnloadHooks = beforeUnloadHooks.filter(function (item) { return item !== hook; }); if (beforeUnloadHooks.length === 0 && stopBeforeUnloadListener) { stopBeforeUnloadListener(); stopBeforeUnloadListener = null; } }; } // deprecated function registerBeforeUnloadHook(hook) { if (canUseDOM && beforeUnloadHooks.indexOf(hook) === -1) { beforeUnloadHooks.push(hook); if (beforeUnloadHooks.length === 1) stopBeforeUnloadListener = startBeforeUnloadListener(getBeforeUnloadPromptMessage); } } // deprecated function unregisterBeforeUnloadHook(hook) { if (beforeUnloadHooks.length > 0) { beforeUnloadHooks = beforeUnloadHooks.filter(function (item) { return item !== hook; }); if (beforeUnloadHooks.length === 0) stopBeforeUnloadListener(); } } return useBeforeUnload_extends({}, history, { listenBeforeUnload: listenBeforeUnload, registerBeforeUnloadHook: es6_deprecate(registerBeforeUnloadHook, 'registerBeforeUnloadHook is deprecated; use listenBeforeUnload instead'), unregisterBeforeUnloadHook: es6_deprecate(unregisterBeforeUnloadHook, 'unregisterBeforeUnloadHook is deprecated; use the callback returned from listenBeforeUnload instead') }); }; } /* harmony default export */ var es6_useBeforeUnload = (useBeforeUnload); // EXTERNAL MODULE: ./node_modules/query-string/index.js var query_string = __webpack_require__("./node_modules/query-string/index.js"); // CONCATENATED MODULE: ./node_modules/history/es6/useQueries.js var useQueries_extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; var SEARCH_BASE_KEY = '$searchBase'; function defaultStringifyQuery(query) { return Object(query_string["stringify"])(query).replace(/%20/g, '+'); } var defaultParseQueryString = query_string["parse"]; function isNestedObject(object) { for (var p in object) { if (Object.prototype.hasOwnProperty.call(object, p) && typeof object[p] === 'object' && !Array.isArray(object[p]) && object[p] !== null) return true; }return false; } /** * Returns a new createHistory function that may be used to create * history objects that know how to handle URL queries. */ function useQueries(createHistory) { return function () { var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0]; var history = createHistory(options); var stringifyQuery = options.stringifyQuery; var parseQueryString = options.parseQueryString; if (typeof stringifyQuery !== 'function') stringifyQuery = defaultStringifyQuery; if (typeof parseQueryString !== 'function') parseQueryString = defaultParseQueryString; function addQuery(location) { if (location.query == null) { var search = location.search; location.query = parseQueryString(search.substring(1)); location[SEARCH_BASE_KEY] = { search: search, searchBase: '' }; } // TODO: Instead of all the book-keeping here, this should just strip the // stringified query from the search. return location; } function appendQuery(location, query) { var _extends2; var searchBaseSpec = location[SEARCH_BASE_KEY]; var queryString = query ? stringifyQuery(query) : ''; if (!searchBaseSpec && !queryString) { return location; } false ? undefined : undefined; if (typeof location === 'string') location = parsePath(location); var searchBase = undefined; if (searchBaseSpec && location.search === searchBaseSpec.search) { searchBase = searchBaseSpec.searchBase; } else { searchBase = location.search || ''; } var search = searchBase; if (queryString) { search += (search ? '&' : '?') + queryString; } return useQueries_extends({}, location, (_extends2 = { search: search }, _extends2[SEARCH_BASE_KEY] = { search: search, searchBase: searchBase }, _extends2)); } // Override all read methods with query-aware versions. function listenBefore(hook) { return history.listenBefore(function (location, callback) { es6_runTransitionHook(hook, addQuery(location), callback); }); } function listen(listener) { return history.listen(function (location) { listener(addQuery(location)); }); } // Override all write methods with query-aware versions. function push(location) { history.push(appendQuery(location, location.query)); } function replace(location) { history.replace(appendQuery(location, location.query)); } function createPath(location, query) { false ? undefined : undefined; return history.createPath(appendQuery(location, query || location.query)); } function createHref(location, query) { false ? undefined : undefined; return history.createHref(appendQuery(location, query || location.query)); } function createLocation(location) { for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { args[_key - 1] = arguments[_key]; } var fullLocation = history.createLocation.apply(history, [appendQuery(location, location.query)].concat(args)); if (location.query) { fullLocation.query = location.query; } return addQuery(fullLocation); } // deprecated function pushState(state, path, query) { if (typeof path === 'string') path = parsePath(path); push(useQueries_extends({ state: state }, path, { query: query })); } // deprecated function replaceState(state, path, query) { if (typeof path === 'string') path = parsePath(path); replace(useQueries_extends({ state: state }, path, { query: query })); } return useQueries_extends({}, history, { listenBefore: listenBefore, listen: listen, push: push, replace: replace, createPath: createPath, createHref: createHref, createLocation: createLocation, pushState: es6_deprecate(pushState, 'pushState is deprecated; use push instead'), replaceState: es6_deprecate(replaceState, 'replaceState is deprecated; use replace instead') }); }; } /* harmony default export */ var es6_useQueries = (useQueries); // CONCATENATED MODULE: ./node_modules/history/es6/enableBeforeUnload.js /* harmony default export */ var enableBeforeUnload = (es6_deprecate(es6_useBeforeUnload, 'enableBeforeUnload is deprecated, use useBeforeUnload instead')); // CONCATENATED MODULE: ./node_modules/history/es6/enableQueries.js /* harmony default export */ var enableQueries = (es6_deprecate(es6_useQueries, 'enableQueries is deprecated, use useQueries instead')); // CONCATENATED MODULE: ./node_modules/history/es6/index.js // deprecated var history_es6_createLocation = es6_deprecate(es6_createLocation, 'Using createLocation without a history instance is deprecated; please use history.createLocation instead'); /***/ }), /***/ "./node_modules/history/node_modules/warning/browser.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * Copyright 2014-2015, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. */ /** * Similar to invariant but only logs a warning if the condition is not met. * This can be used to log issues in development environments in critical * paths. Removing the logging code for production environments will keep the * same logic and follow the same code paths. */ var warning = function() {}; if (false) {} module.exports = warning; /***/ }), /***/ "./node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; var reactIs = __webpack_require__("./node_modules/react-is/index.js"); /** * Copyright 2015, Yahoo! Inc. * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms. */ var REACT_STATICS = { childContextTypes: true, contextType: true, contextTypes: true, defaultProps: true, displayName: true, getDefaultProps: true, getDerivedStateFromError: true, getDerivedStateFromProps: true, mixins: true, propTypes: true, type: true }; var KNOWN_STATICS = { name: true, length: true, prototype: true, caller: true, callee: true, arguments: true, arity: true }; var FORWARD_REF_STATICS = { '$$typeof': true, render: true, defaultProps: true, displayName: true, propTypes: true }; var MEMO_STATICS = { '$$typeof': true, compare: true, defaultProps: true, displayName: true, propTypes: true, type: true }; var TYPE_STATICS = {}; TYPE_STATICS[reactIs.ForwardRef] = FORWARD_REF_STATICS; TYPE_STATICS[reactIs.Memo] = MEMO_STATICS; function getStatics(component) { // React v16.11 and below if (reactIs.isMemo(component)) { return MEMO_STATICS; } // React v16.12 and above return TYPE_STATICS[component['$$typeof']] || REACT_STATICS; } var defineProperty = Object.defineProperty; var getOwnPropertyNames = Object.getOwnPropertyNames; var getOwnPropertySymbols = Object.getOwnPropertySymbols; var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; var getPrototypeOf = Object.getPrototypeOf; var objectPrototype = Object.prototype; function hoistNonReactStatics(targetComponent, sourceComponent, blacklist) { if (typeof sourceComponent !== 'string') { // don't hoist over string (html) components if (objectPrototype) { var inheritedComponent = getPrototypeOf(sourceComponent); if (inheritedComponent && inheritedComponent !== objectPrototype) { hoistNonReactStatics(targetComponent, inheritedComponent, blacklist); } } var keys = getOwnPropertyNames(sourceComponent); if (getOwnPropertySymbols) { keys = keys.concat(getOwnPropertySymbols(sourceComponent)); } var targetStatics = getStatics(targetComponent); var sourceStatics = getStatics(sourceComponent); for (var i = 0; i < keys.length; ++i) { var key = keys[i]; if (!KNOWN_STATICS[key] && !(blacklist && blacklist[key]) && !(sourceStatics && sourceStatics[key]) && !(targetStatics && targetStatics[key])) { var descriptor = getOwnPropertyDescriptor(sourceComponent, key); try { // Avoid failures from read-only properties defineProperty(targetComponent, key, descriptor); } catch (e) {} } } } return targetComponent; } module.exports = hoistNonReactStatics; /***/ }), /***/ "./node_modules/immutability-helper/index.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; /* WEBPACK VAR INJECTION */(function(process) { Object.defineProperty(exports, "__esModule", { value: true }); function stringifiable(obj) { // Safely stringify Object.create(null) /* istanbul ignore next */ return typeof obj === 'object' && !('toString' in obj) ? Object.prototype.toString.call(obj).slice(8, -1) : obj; } var isProduction = typeof process === 'object' && "production" === 'production'; function invariant(condition, message) { if (!condition) { /* istanbul ignore next */ if (isProduction) { throw new Error('Invariant failed'); } throw new Error(message()); } } exports.invariant = invariant; var hasOwnProperty = Object.prototype.hasOwnProperty; var splice = Array.prototype.splice; var toString = Object.prototype.toString; function type(obj) { return toString.call(obj).slice(8, -1); } var assign = Object.assign || /* istanbul ignore next */ (function (target, source) { getAllKeys(source).forEach(function (key) { if (hasOwnProperty.call(source, key)) { target[key] = source[key]; } }); return target; }); var getAllKeys = typeof Object.getOwnPropertySymbols === 'function' ? function (obj) { return Object.keys(obj).concat(Object.getOwnPropertySymbols(obj)); } /* istanbul ignore next */ : function (obj) { return Object.keys(obj); }; function copy(object) { return Array.isArray(object) ? assign(object.constructor(object.length), object) : (type(object) === 'Map') ? new Map(object) : (type(object) === 'Set') ? new Set(object) : (object && typeof object === 'object') ? assign(Object.create(Object.getPrototypeOf(object)), object) /* istanbul ignore next */ : object; } var Context = /** @class */ (function () { function Context() { this.commands = assign({}, defaultCommands); this.update = this.update.bind(this); // Deprecated: update.extend, update.isEquals and update.newContext this.update.extend = this.extend = this.extend.bind(this); this.update.isEquals = function (x, y) { return x === y; }; this.update.newContext = function () { return new Context().update; }; } Object.defineProperty(Context.prototype, "isEquals", { get: function () { return this.update.isEquals; }, set: function (value) { this.update.isEquals = value; }, enumerable: true, configurable: true }); Context.prototype.extend = function (directive, fn) { this.commands[directive] = fn; }; Context.prototype.update = function (object, $spec) { var _this = this; var spec = (typeof $spec === 'function') ? { $apply: $spec } : $spec; if (!(Array.isArray(object) && Array.isArray(spec))) { invariant(!Array.isArray(spec), function () { return "update(): You provided an invalid spec to update(). The spec may " + "not contain an array except as the value of $set, $push, $unshift, " + "$splice or any custom command allowing an array value."; }); } invariant(typeof spec === 'object' && spec !== null, function () { return "update(): You provided an invalid spec to update(). The spec and " + "every included key path must be plain objects containing one of the " + ("following commands: " + Object.keys(_this.commands).join(', ') + "."); }); var nextObject = object; getAllKeys(spec).forEach(function (key) { if (hasOwnProperty.call(_this.commands, key)) { var objectWasNextObject = object === nextObject; nextObject = _this.commands[key](spec[key], nextObject, spec, object); if (objectWasNextObject && _this.isEquals(nextObject, object)) { nextObject = object; } } else { var nextValueForKey = type(object) === 'Map' ? _this.update(object.get(key), spec[key]) : _this.update(object[key], spec[key]); var nextObjectValue = type(nextObject) === 'Map' ? nextObject.get(key) : nextObject[key]; if (!_this.isEquals(nextValueForKey, nextObjectValue) || typeof nextValueForKey === 'undefined' && !hasOwnProperty.call(object, key)) { if (nextObject === object) { nextObject = copy(object); } if (type(nextObject) === 'Map') { nextObject.set(key, nextValueForKey); } else { nextObject[key] = nextValueForKey; } } } }); return nextObject; }; return Context; }()); exports.Context = Context; var defaultCommands = { $push: function (value, nextObject, spec) { invariantPushAndUnshift(nextObject, spec, '$push'); return value.length ? nextObject.concat(value) : nextObject; }, $unshift: function (value, nextObject, spec) { invariantPushAndUnshift(nextObject, spec, '$unshift'); return value.length ? value.concat(nextObject) : nextObject; }, $splice: function (value, nextObject, spec, originalObject) { invariantSplices(nextObject, spec); value.forEach(function (args) { invariantSplice(args); if (nextObject === originalObject && args.length) { nextObject = copy(originalObject); } splice.apply(nextObject, args); }); return nextObject; }, $set: function (value, _nextObject, spec) { invariantSet(spec); return value; }, $toggle: function (targets, nextObject) { invariantSpecArray(targets, '$toggle'); var nextObjectCopy = targets.length ? copy(nextObject) : nextObject; targets.forEach(function (target) { nextObjectCopy[target] = !nextObject[target]; }); return nextObjectCopy; }, $unset: function (value, nextObject, _spec, originalObject) { invariantSpecArray(value, '$unset'); value.forEach(function (key) { if (Object.hasOwnProperty.call(nextObject, key)) { if (nextObject === originalObject) { nextObject = copy(originalObject); } delete nextObject[key]; } }); return nextObject; }, $add: function (values, nextObject, _spec, originalObject) { invariantMapOrSet(nextObject, '$add'); invariantSpecArray(values, '$add'); if (type(nextObject) === 'Map') { values.forEach(function (_a) { var key = _a[0], value = _a[1]; if (nextObject === originalObject && nextObject.get(key) !== value) { nextObject = copy(originalObject); } nextObject.set(key, value); }); } else { values.forEach(function (value) { if (nextObject === originalObject && !nextObject.has(value)) { nextObject = copy(originalObject); } nextObject.add(value); }); } return nextObject; }, $remove: function (value, nextObject, _spec, originalObject) { invariantMapOrSet(nextObject, '$remove'); invariantSpecArray(value, '$remove'); value.forEach(function (key) { if (nextObject === originalObject && nextObject.has(key)) { nextObject = copy(originalObject); } nextObject.delete(key); }); return nextObject; }, $merge: function (value, nextObject, _spec, originalObject) { invariantMerge(nextObject, value); getAllKeys(value).forEach(function (key) { if (value[key] !== nextObject[key]) { if (nextObject === originalObject) { nextObject = copy(originalObject); } nextObject[key] = value[key]; } }); return nextObject; }, $apply: function (value, original) { invariantApply(value); return value(original); }, }; var defaultContext = new Context(); exports.isEquals = defaultContext.update.isEquals; exports.extend = defaultContext.extend; exports.default = defaultContext.update; // @ts-ignore exports.default.default = module.exports = assign(exports.default, exports); // invariants function invariantPushAndUnshift(value, spec, command) { invariant(Array.isArray(value), function () { return "update(): expected target of " + stringifiable(command) + " to be an array; got " + stringifiable(value) + "."; }); invariantSpecArray(spec[command], command); } function invariantSpecArray(spec, command) { invariant(Array.isArray(spec), function () { return "update(): expected spec of " + stringifiable(command) + " to be an array; got " + stringifiable(spec) + ". " + "Did you forget to wrap your parameter in an array?"; }); } function invariantSplices(value, spec) { invariant(Array.isArray(value), function () { return "Expected $splice target to be an array; got " + stringifiable(value); }); invariantSplice(spec.$splice); } function invariantSplice(value) { invariant(Array.isArray(value), function () { return "update(): expected spec of $splice to be an array of arrays; got " + stringifiable(value) + ". " + "Did you forget to wrap your parameters in an array?"; }); } function invariantApply(fn) { invariant(typeof fn === 'function', function () { return "update(): expected spec of $apply to be a function; got " + stringifiable(fn) + "."; }); } function invariantSet(spec) { invariant(Object.keys(spec).length === 1, function () { return "Cannot have more than one key in an object with $set"; }); } function invariantMerge(target, specValue) { invariant(specValue && typeof specValue === 'object', function () { return "update(): $merge expects a spec of type 'object'; got " + stringifiable(specValue); }); invariant(target && typeof target === 'object', function () { return "update(): $merge expects a target of type 'object'; got " + stringifiable(target); }); } function invariantMapOrSet(target, command) { var typeOfTarget = type(target); invariant(typeOfTarget === 'Map' || typeOfTarget === 'Set', function () { return "update(): " + stringifiable(command) + " expects a target of type Set or Map; got " + stringifiable(typeOfTarget); }); } /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("./node_modules/process/browser.js"))) /***/ }), /***/ "./node_modules/input-format/commonjs/ReactInput.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = undefined; var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _class, _temp2; var _react = __webpack_require__("./node_modules/react/index.js"); var _react2 = _interopRequireDefault(_react); var _propTypes = __webpack_require__("./node_modules/prop-types/index.js"); var _propTypes2 = _interopRequireDefault(_propTypes); var _parse2 = __webpack_require__("./node_modules/input-format/commonjs/parse.js"); var _parse3 = _interopRequireDefault(_parse2); var _inputControl = __webpack_require__("./node_modules/input-format/commonjs/input control.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } // Usage: // // this.setState({ phone })} // parse={character => character} // format={value => ({ text: value, template: 'xxxxxxxx' })}/> // var ReactInput = (_temp2 = _class = function (_React$Component) { _inherits(ReactInput, _React$Component); function ReactInput() { var _ref; var _temp, _this, _ret; _classCallCheck(this, ReactInput); for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = ReactInput.__proto__ || Object.getPrototypeOf(ReactInput)).call.apply(_ref, [this].concat(args))), _this), _this.storeInstance = function (instance) { _this.input = instance; }, _this.getInputElement = function () { return _this.input; }, _this.onChange = function (event) { var _this$props = _this.props, parse = _this$props.parse, format = _this$props.format; return (0, _inputControl.onChange)(event, _this.getInputElement(), parse, format, _this.props.onChange); }, _this.onPaste = function (event) { var _this$props2 = _this.props, parse = _this$props2.parse, format = _this$props2.format; return (0, _inputControl.onPaste)(event, _this.getInputElement(), parse, format, _this.props.onChange); }, _this.onCut = function (event) { var _this$props3 = _this.props, parse = _this$props3.parse, format = _this$props3.format; return (0, _inputControl.onCut)(event, _this.getInputElement(), parse, format, _this.props.onChange); }, _this.onBlur = function (event) { var _this$props4 = _this.props, parse = _this$props4.parse, onBlur = _this$props4.onBlur; // This `onBlur` interceptor is a workaround for `redux-form`, // so that it gets the right (parsed, not the formatted one) // `event.target.value` in its `onBlur` handler. if (onBlur) { var _event = _extends({}, event, { target: _extends({}, event.target, { value: (0, _parse3.default)(_this.getInputElement().value, undefined, parse).value }) // For `redux-form` event detection. // https://github.com/erikras/redux-form/blob/v5/src/events/isEvent.js });_event.stopPropagation = event.stopPropagation; _event.preventDefault = event.preventDefault; onBlur(_event); } }, _this.onKeyDown = function (event) { var _this$props5 = _this.props, parse = _this$props5.parse, format = _this$props5.format; if (_this.props.onKeyDown) { _this.props.onKeyDown(event); } return (0, _inputControl.onKeyDown)(event, _this.getInputElement(), parse, format, _this.props.onChange); }, _temp), _possibleConstructorReturn(_this, _ret); } _createClass(ReactInput, [{ key: 'render', value: function render() { var _props = this.props, value = _props.value, parse = _props.parse, format = _props.format, inputComponent = _props.inputComponent, rest = _objectWithoutProperties(_props, ['value', 'parse', 'format', 'inputComponent']); // Non-string `inputComponent`s would work in this case // but it would also introduce a caret reset bug: // the caret position would reset on each input. // The origins of this bug are unknown, they may be // somehow related to the `ref` property // being intercepted by React here. return _react2.default.createElement(inputComponent, _extends({}, rest, { ref: this.storeInstance, value: format(isEmpty(value) ? '' : value).text, onKeyDown: this.onKeyDown, onChange: this.onChange, onPaste: this.onPaste, onCut: this.onCut, onBlur: this.onBlur })); } /** * Returns `` DOM Element. * @return {DOMElement} */ // This handler is a workaround for `redux-form`. }, { key: 'focus', /** * Focuses the ``. * Can be called manually. */ value: function focus() { this.getInputElement().focus(); } }]); return ReactInput; }(_react2.default.Component), _class.propTypes = { // Parses a single characher of `` text. parse: _propTypes2.default.func.isRequired, // Formats `value` into `` text. format: _propTypes2.default.func.isRequired, // Renders `` by default. inputComponent: _propTypes2.default.elementType.isRequired, // `` `type` attribute. type: _propTypes2.default.string.isRequired, // Is parsed from text. value: _propTypes2.default.string, // This handler is called each time `` text is changed. onChange: _propTypes2.default.func.isRequired, // This `onBlur` interceptor is a workaround for `redux-form`, // so that it gets the parsed `value` in its `onBlur` handler, // not the formatted text. onBlur: _propTypes2.default.func, // Passthrough onKeyDown: _propTypes2.default.func }, _class.defaultProps = { // Renders `` by default. inputComponent: 'input', // `` `type` attribute. type: 'text' }, _temp2); exports.default = ReactInput; function isEmpty(value) { return value === undefined || value === null; } //# sourceMappingURL=ReactInput.js.map /***/ }), /***/ "./node_modules/input-format/commonjs/close braces.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = close_braces; var _helpers = __webpack_require__("./node_modules/input-format/commonjs/helpers.js"); function close_braces(retained_template, template) { var placeholder = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'x'; var empty_placeholder = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : ' '; var cut_before = retained_template.length; var opening_braces = (0, _helpers.count_occurences)('(', retained_template); var closing_braces = (0, _helpers.count_occurences)(')', retained_template); var dangling_braces = opening_braces - closing_braces; while (dangling_braces > 0 && cut_before < template.length) { retained_template += template[cut_before].replace(placeholder, empty_placeholder); if (template[cut_before] === ')') { dangling_braces--; } cut_before++; } return retained_template; } //# sourceMappingURL=close braces.js.map /***/ }), /***/ "./node_modules/input-format/commonjs/dom.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getSelection = getSelection; exports.getOperation = getOperation; exports.getCaretPosition = getCaretPosition; exports.setCaretPosition = setCaretPosition; // Gets selection bounds function getSelection(element) { // If no selection, return nothing if (element.selectionStart === element.selectionEnd) { return; } return { start: element.selectionStart, end: element.selectionEnd }; } // Key codes var Keys = exports.Keys = { Backspace: 8, Delete: 46 // Finds out the operation to be intercepted and performed // based on the key down event `keyCode`. };function getOperation(event) { switch (event.keyCode) { case Keys.Backspace: return 'Backspace'; case Keys.Delete: return 'Delete'; } } // Gets caret position function getCaretPosition(element) { return element.selectionStart; } // Sets caret position function setCaretPosition(element, caret_position) { // Sanity check if (caret_position === undefined) { return; } // Set caret position. // There has been an issue with caret positioning on Android devices. // https://github.com/catamphetamine/input-format/issues/2 // I was revisiting this issue and looked for similar issues in other libraries. // For example, there's [`text-mask`](https://github.com/text-mask/text-mask) library. // They've had exactly the same issue when the caret seemingly refused to be repositioned programmatically. // The symptoms were the same: whenever the caret passed through a non-digit character of a mask (a whitespace, a bracket, a dash, etc), it looked as if it placed itself one character before its correct position. // https://github.com/text-mask/text-mask/issues/300 // They seem to have found a basic fix for it: calling `input.setSelectionRange()` in a timeout rather than instantly for Android devices. // https://github.com/text-mask/text-mask/pull/400/files // I've implemented the same workaround here. if (isAndroid()) { setTimeout(function () { return element.setSelectionRange(caret_position, caret_position); }, 0); } else { element.setSelectionRange(caret_position, caret_position); } } function isAndroid() { // `navigator` is not defined when running mocha tests. if (typeof navigator !== 'undefined') { return ANDROID_USER_AGENT_REG_EXP.test(navigator.userAgent); } } var ANDROID_USER_AGENT_REG_EXP = /Android/i; //# sourceMappingURL=dom.js.map /***/ }), /***/ "./node_modules/input-format/commonjs/edit.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = edit; // Edits text `value` (if `operation` is passed) and repositions the `caret` if needed. // // Example: // // value - '88005553535' // caret - 2 // starting from 0; is positioned before the first zero // operation - 'Backspace' // // Returns // { // value: '8005553535' // caret: 1 // } // // Currently supports just 'Delete' and 'Backspace' operations // function edit(value, caret, operation) { switch (operation) { case 'Backspace': // If there exists the previous character, // then erase it and reposition the caret. if (caret > 0) { // Remove the previous character value = value.slice(0, caret - 1) + value.slice(caret); // Position the caret where the previous (erased) character was caret--; } break; case 'Delete': // Remove current digit (if any) value = value.slice(0, caret) + value.slice(caret + 1); break; } return { value: value, caret: caret }; } //# sourceMappingURL=edit.js.map /***/ }), /***/ "./node_modules/input-format/commonjs/format.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = format; var _templateFormatter = __webpack_require__("./node_modules/input-format/commonjs/template formatter.js"); var _templateFormatter2 = _interopRequireDefault(_templateFormatter); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } // Formats `value` value preserving `caret` at the same character. // // `{ value, caret }` attribute is the result of `parse()` function call. // // Returns `{ text, caret }` where the new `caret` is the caret position // inside `text` text corresponding to the original `caret` position inside `value`. // // `formatter(value)` is a function returning `{ text, template }`. // // `text` is the `value` value formatted using `template`. // It may either cut off the non-filled right part of the `template` // or it may fill the non-filled character placeholders // in the right part of the `template` with `spacer` // which is a space (' ') character by default. // // `template` is the template used to format the `value`. // It can be either a full-length template or a partial template. // // `formatter` can also be a string — a `template` // where character placeholders are denoted by 'x'es. // In this case `formatter` function is automatically created. // // Example: // // `value` is '880', // `caret` is `2` (before the first `0`) // // `formatter` is `'880' => // { text: '8 (80 )', template: 'x (xxx) xxx-xx-xx' }` // // The result is `{ text: '8 (80 )', caret: 4 }`. // function format(value, caret, formatter) { if (typeof formatter === 'string') { formatter = (0, _templateFormatter2.default)(formatter); } var _ref = formatter(value) || {}, text = _ref.text, template = _ref.template; if (text === undefined) { text = value; } if (template) { if (caret === undefined) { caret = text.length; } else { var index = 0; var found = false; var possibly_last_input_character_index = -1; while (index < text.length && index < template.length) { // Character placeholder found if (text[index] !== template[index]) { if (caret === 0) { found = true; caret = index; break; } possibly_last_input_character_index = index; caret--; } index++; } // If the caret was positioned after last input character, // then the text caret index is just after the last input character. if (!found) { caret = possibly_last_input_character_index + 1; } } } return { text: text, caret: caret }; } //# sourceMappingURL=format.js.map /***/ }), /***/ "./node_modules/input-format/commonjs/helpers.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.count_occurences = count_occurences; // Counts all occurences of a symbol in a string function count_occurences(symbol, string) { var count = 0; // Using `.split('')` here instead of normal `for ... of` // because the importing application doesn't neccessarily include an ES6 polyfill. // The `.split('')` approach discards "exotic" UTF-8 characters // (the ones consisting of four bytes) // but template placeholder characters don't fall into that range // so skipping such miscellaneous "exotic" characters // won't matter here for just counting placeholder character occurrences. for (var _iterator = string.split(''), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { var _ref; if (_isArray) { if (_i >= _iterator.length) break; _ref = _iterator[_i++]; } else { _i = _iterator.next(); if (_i.done) break; _ref = _i.value; } var character = _ref; if (character === symbol) { count++; } } return count; } //# sourceMappingURL=helpers.js.map /***/ }), /***/ "./node_modules/input-format/commonjs/input control.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.onCut = onCut; exports.onPaste = onPaste; exports.onChange = onChange; exports.onKeyDown = onKeyDown; var _edit = __webpack_require__("./node_modules/input-format/commonjs/edit.js"); var _edit2 = _interopRequireDefault(_edit); var _parse3 = __webpack_require__("./node_modules/input-format/commonjs/parse.js"); var _parse4 = _interopRequireDefault(_parse3); var _format2 = __webpack_require__("./node_modules/input-format/commonjs/format.js"); var _format3 = _interopRequireDefault(_format2); var _dom = __webpack_require__("./node_modules/input-format/commonjs/dom.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function onCut(event, input, _parse, _format, on_change) { // The actual cut hasn't happened just yet hence the timeout. setTimeout(function () { return format_input_text(input, _parse, _format, undefined, on_change); }, 0); } function onPaste(event, input, _parse, _format, on_change) { var selection = (0, _dom.getSelection)(input); // If selection is made, // just erase the selected text // prior to pasting if (selection) { erase_selection(input, selection); } format_input_text(input, _parse, _format, undefined, on_change); } function onChange(event, input, _parse, _format, on_change) { format_input_text(input, _parse, _format, undefined, on_change); } // Intercepts "Delete" and "Backspace" keys. // (hitting "Delete" or "Backspace" at any caret // position should always result in rasing a digit) function onKeyDown(event, input, _parse, _format, on_change) { var operation = (0, _dom.getOperation)(event); switch (operation) { case 'Delete': case 'Backspace': // Intercept this operation and perform it manually. event.preventDefault(); var selection = (0, _dom.getSelection)(input); // If selection is made, // just erase the selected text, // and don't apply any more operations to it. if (selection) { erase_selection(input, selection); return format_input_text(input, _parse, _format, undefined, on_change); } // Else, perform the (character erasing) operation manually return format_input_text(input, _parse, _format, operation, on_change); default: // Will be handled when `onChange` fires. } } /** * Erases the selected text inside an ``. * @param {DOMElement} input * @param {Selection} selection */ function erase_selection(input, selection) { var text = input.value; text = text.slice(0, selection.start) + text.slice(selection.end); input.value = text; (0, _dom.setCaretPosition)(input, selection.start); } /** * Parses and re-formats `` textual value. * E.g. when a user enters something into the `` * that raw input must first be parsed and the re-formatted properly. * Is called either after some user input (e.g. entered a character, pasted something) * or after the user performed an `operation` (e.g. "Backspace", "Delete"). * @param {DOMElement} input * @param {Function} parse * @param {Function} format * @param {string} [operation] - The operation that triggered `` textual value change. E.g. "Backspace", "Delete". * @param {Function} onChange */ function format_input_text(input, _parse, _format, operation, on_change) { // Parse `` textual value. // Get `value` and `caret` position. var _parse2 = (0, _parse4.default)(input.value, (0, _dom.getCaretPosition)(input), _parse), value = _parse2.value, caret = _parse2.caret; // If a user performed an operation (e.g. "Backspace", "Delete") // then apply that operation and get new `value` and `caret` position. if (operation) { var operation_applied = (0, _edit2.default)(value, caret, operation); value = operation_applied.value; caret = operation_applied.caret; } // Format the `value`. // (and reposition the caret accordingly) var formatted = (0, _format3.default)(value, caret, _format); var text = formatted.text; caret = formatted.caret; // Set `` textual value manually // to prevent React from resetting the caret position // later inside subsequent `render()`. // Doesn't work for custom `inputComponent`s for some reason. input.value = text; // Position the caret properly. (0, _dom.setCaretPosition)(input, caret); // `` textual value may have changed, // so the parsed `value` may have changed too. // The `value` didn't neccessarily change // but it might have. on_change(value); } //# sourceMappingURL=input control.js.map /***/ }), /***/ "./node_modules/input-format/commonjs/parse digit.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = function (character, value) { return DIGITS[character]; }; // Copied from `libphonenumber-js`: // https://github.com/catamphetamine/libphonenumber-js/blob/master/source/parse.js // // These mappings map a character (key) to a specific digit that should // replace it for normalization purposes. Non-European digits that // may be used in phone numbers are mapped to a European equivalent. // // E.g. in Iraq they don't write `+442323234` but rather `+٤٤٢٣٢٣٢٣٤`. // var DIGITS = exports.DIGITS = { '0': '0', '1': '1', '2': '2', '3': '3', '4': '4', '5': '5', '6': '6', '7': '7', '8': '8', '9': '9', '\uFF10': '0', // Fullwidth digit 0 '\uFF11': '1', // Fullwidth digit 1 '\uFF12': '2', // Fullwidth digit 2 '\uFF13': '3', // Fullwidth digit 3 '\uFF14': '4', // Fullwidth digit 4 '\uFF15': '5', // Fullwidth digit 5 '\uFF16': '6', // Fullwidth digit 6 '\uFF17': '7', // Fullwidth digit 7 '\uFF18': '8', // Fullwidth digit 8 '\uFF19': '9', // Fullwidth digit 9 '\u0660': '0', // Arabic-indic digit 0 '\u0661': '1', // Arabic-indic digit 1 '\u0662': '2', // Arabic-indic digit 2 '\u0663': '3', // Arabic-indic digit 3 '\u0664': '4', // Arabic-indic digit 4 '\u0665': '5', // Arabic-indic digit 5 '\u0666': '6', // Arabic-indic digit 6 '\u0667': '7', // Arabic-indic digit 7 '\u0668': '8', // Arabic-indic digit 8 '\u0669': '9', // Arabic-indic digit 9 '\u06F0': '0', // Eastern-Arabic digit 0 '\u06F1': '1', // Eastern-Arabic digit 1 '\u06F2': '2', // Eastern-Arabic digit 2 '\u06F3': '3', // Eastern-Arabic digit 3 '\u06F4': '4', // Eastern-Arabic digit 4 '\u06F5': '5', // Eastern-Arabic digit 5 '\u06F6': '6', // Eastern-Arabic digit 6 '\u06F7': '7', // Eastern-Arabic digit 7 '\u06F8': '8', // Eastern-Arabic digit 8 '\u06F9': '9' // Eastern-Arabic digit 9 }; //# sourceMappingURL=parse digit.js.map /***/ }), /***/ "./node_modules/input-format/commonjs/parse.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = parse; // Parses the `text`. // // Returns `{ value, caret }` where `caret` is // the caret position inside `value` // corresponding to the `caret_position` inside `text`. // // The `text` is parsed by feeding each character sequentially to // `parse_character(character, value)` function // and appending the result (if it's not `undefined`) to `value`. // // Example: // // `text` is `8 (800) 555-35-35`, // `caret_position` is `4` (before the first `0`). // `parse_character` is `(character, value) => // if (character >= '0' && character <= '9') { return character }`. // // then `parse()` outputs `{ value: '88005553535', caret: 2 }`. // function parse(text, caret_position, parse_character) { var value = ''; var focused_input_character_index = 0; var index = 0; while (index < text.length) { var character = parse_character(text[index], value); if (character !== undefined) { value += character; if (caret_position !== undefined) { if (caret_position === index) { focused_input_character_index = value.length - 1; } else if (caret_position > index) { focused_input_character_index = value.length; } } } index++; } // If caret position wasn't specified if (caret_position === undefined) { // Then set caret position to "after the last input character" focused_input_character_index = value.length; } var result = { value: value, caret: focused_input_character_index }; return result; } //# sourceMappingURL=parse.js.map /***/ }), /***/ "./node_modules/input-format/commonjs/template formatter.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = function (template) { var placeholder = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'x'; var should_close_braces = arguments[2]; if (!template) { return function (value) { return { text: value }; }; } var characters_in_template = (0, _helpers.count_occurences)(placeholder, template); return function (value) { if (!value) { return { text: '', template: template }; } var value_character_index = 0; var filled_in_template = ''; // Using `.split('')` here instead of normal `for ... of` // because the importing application doesn't neccessarily include an ES6 polyfill. // The `.split('')` approach discards "exotic" UTF-8 characters // (the ones consisting of four bytes) // but template placeholder characters don't fall into that range // and appending UTF-8 characters to a string in parts still works. for (var _iterator = template.split(''), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { var _ref; if (_isArray) { if (_i >= _iterator.length) break; _ref = _iterator[_i++]; } else { _i = _iterator.next(); if (_i.done) break; _ref = _i.value; } var character = _ref; if (character !== placeholder) { filled_in_template += character; continue; } filled_in_template += value[value_character_index]; value_character_index++; // If the last available value character has been filled in, // then return the filled in template // (either trim the right part or retain it, // if no more character placeholders in there) if (value_character_index === value.length) { // If there are more character placeholders // in the right part of the template // then simply trim it. if (value.length < characters_in_template) { break; } } } if (should_close_braces) { filled_in_template = (0, _closeBraces2.default)(filled_in_template, template); } return { text: filled_in_template, template: template }; }; }; var _helpers = __webpack_require__("./node_modules/input-format/commonjs/helpers.js"); var _closeBraces = __webpack_require__("./node_modules/input-format/commonjs/close braces.js"); var _closeBraces2 = _interopRequireDefault(_closeBraces); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } //# sourceMappingURL=template formatter.js.map /***/ }), /***/ "./node_modules/input-format/commonjs/template parser.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = function (template, placeholder, parse) { if (typeof placeholder === 'function') { parse = placeholder; placeholder = 'x'; } var max_characters = (0, _helpers.count_occurences)(placeholder, template); return function (character, value) { if (value.length < max_characters) { return parse(character, value); } }; }; var _helpers = __webpack_require__("./node_modules/input-format/commonjs/helpers.js"); //# sourceMappingURL=template parser.js.map /***/ }), /***/ "./node_modules/input-format/index.commonjs.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; exports = module.exports = {} exports.ReactInput = __webpack_require__("./node_modules/input-format/commonjs/ReactInput.js").default exports.templateParser = __webpack_require__("./node_modules/input-format/commonjs/template parser.js").default exports.templateFormatter = __webpack_require__("./node_modules/input-format/commonjs/template formatter.js").default exports.parseDigit = __webpack_require__("./node_modules/input-format/commonjs/parse digit.js").default exports.parse = __webpack_require__("./node_modules/input-format/commonjs/parse.js").default exports.format = __webpack_require__("./node_modules/input-format/commonjs/format.js").default exports.onChange = __webpack_require__("./node_modules/input-format/commonjs/input control.js").onChange exports.onPaste = __webpack_require__("./node_modules/input-format/commonjs/input control.js").onPaste exports.onCut = __webpack_require__("./node_modules/input-format/commonjs/input control.js").onCut exports.onKeyDown = __webpack_require__("./node_modules/input-format/commonjs/input control.js").onKeyDown // exports['default'] = ... /***/ }), /***/ "./node_modules/intl-format-cache/dist/index.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; /* Copyright (c) 2014, Yahoo! Inc. All rights reserved. Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms. */ Object.defineProperty(exports, "__esModule", { value: true }); var RelativeTimeFormat; // -- Utilities ---------------------------------------------------------------- function getCacheId(inputs) { return JSON.stringify(inputs.map(function (input) { return input && typeof input === 'object' ? orderedProps(input) : input; })); } function orderedProps(obj) { return Object.keys(obj) .sort() .map(function (k) { var _a; return (_a = {}, _a[k] = obj[k], _a); }); } var memoizeFormatConstructor = function (FormatConstructor, cache) { if (cache === void 0) { cache = {}; } return function () { var _a; var args = []; for (var _i = 0; _i < arguments.length; _i++) { args[_i] = arguments[_i]; } var cacheId = getCacheId(args); var format = cacheId && cache[cacheId]; if (!format) { format = new ((_a = FormatConstructor).bind.apply(_a, [void 0].concat(args)))(); if (cacheId) { cache[cacheId] = format; } } return format; }; }; exports.default = memoizeFormatConstructor; //# sourceMappingURL=index.js.map /***/ }), /***/ "./node_modules/intl-format-cache/index.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; exports = module.exports = __webpack_require__("./node_modules/intl-format-cache/dist/index.js")['default']; exports['default'] = exports; /***/ }), /***/ "./node_modules/invariant/browser.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * Copyright (c) 2013-present, Facebook, Inc. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ /** * Use invariant() to assert state which your program assumes to be true. * * Provide sprintf-style format (only %s is supported) and arguments * to provide information about what broke and what you were * expecting. * * The invariant message will be stripped in production, but the invariant * will remain to ensure logic does not differ in production. */ var invariant = function(condition, format, a, b, c, d, e, f) { if (false) {} if (!condition) { var error; if (format === undefined) { error = new Error( 'Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.' ); } else { var args = [a, b, c, d, e, f]; var argIndex = 0; error = new Error( format.replace(/%s/g, function() { return args[argIndex++]; }) ); error.name = 'Invariant Violation'; } error.framesToPop = 1; // we don't care about invariant's own frame throw error; } }; module.exports = invariant; /***/ }), /***/ "./node_modules/is-arguments/index.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; var hasToStringTag = typeof Symbol === 'function' && typeof Symbol.toStringTag === 'symbol'; var toStr = Object.prototype.toString; var isStandardArguments = function isArguments(value) { if (hasToStringTag && value && typeof value === 'object' && Symbol.toStringTag in value) { return false; } return toStr.call(value) === '[object Arguments]'; }; var isLegacyArguments = function isArguments(value) { if (isStandardArguments(value)) { return true; } return value !== null && typeof value === 'object' && typeof value.length === 'number' && value.length >= 0 && toStr.call(value) !== '[object Array]' && toStr.call(value.callee) === '[object Function]'; }; var supportsStandardArguments = (function () { return isStandardArguments(arguments); }()); isStandardArguments.isLegacyArguments = isLegacyArguments; // for tests module.exports = supportsStandardArguments ? isStandardArguments : isLegacyArguments; /***/ }), /***/ "./node_modules/is-date-object/index.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; var getDay = Date.prototype.getDay; var tryDateObject = function tryDateGetDayCall(value) { try { getDay.call(value); return true; } catch (e) { return false; } }; var toStr = Object.prototype.toString; var dateClass = '[object Date]'; var hasToStringTag = __webpack_require__("./node_modules/has-tostringtag/shams.js")(); module.exports = function isDateObject(value) { if (typeof value !== 'object' || value === null) { return false; } return hasToStringTag ? tryDateObject(value) : toStr.call(value) === dateClass; }; /***/ }), /***/ "./node_modules/is-regex/index.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; var callBound = __webpack_require__("./node_modules/call-bind/callBound.js"); var hasToStringTag = __webpack_require__("./node_modules/has-tostringtag/shams.js")(); var has; var $exec; var isRegexMarker; var badStringifier; if (hasToStringTag) { has = callBound('Object.prototype.hasOwnProperty'); $exec = callBound('RegExp.prototype.exec'); isRegexMarker = {}; var throwRegexMarker = function () { throw isRegexMarker; }; badStringifier = { toString: throwRegexMarker, valueOf: throwRegexMarker }; if (typeof Symbol.toPrimitive === 'symbol') { badStringifier[Symbol.toPrimitive] = throwRegexMarker; } } var $toString = callBound('Object.prototype.toString'); var gOPD = Object.getOwnPropertyDescriptor; var regexClass = '[object RegExp]'; module.exports = hasToStringTag // eslint-disable-next-line consistent-return ? function isRegex(value) { if (!value || typeof value !== 'object') { return false; } var descriptor = gOPD(value, 'lastIndex'); var hasLastIndexDataProperty = descriptor && has(descriptor, 'value'); if (!hasLastIndexDataProperty) { return false; } try { $exec(value, badStringifier); } catch (e) { return e === isRegexMarker; } } : function isRegex(value) { // In older browsers, typeof regex incorrectly returns 'function' if (!value || (typeof value !== 'object' && typeof value !== 'function')) { return false; } return $toString(value) === regexClass; }; /***/ }), /***/ "./node_modules/js-file-download/file-download.js": /***/ (function(module, exports) { module.exports = function(data, filename, mime, bom) { var blobData = (typeof bom !== 'undefined') ? [bom, data] : [data] var blob = new Blob(blobData, {type: mime || 'application/octet-stream'}); if (typeof window.navigator.msSaveBlob !== 'undefined') { // IE workaround for "HTML7007: One or more blob URLs were // revoked by closing the blob for which they were created. // These URLs will no longer resolve as the data backing // the URL has been freed." window.navigator.msSaveBlob(blob, filename); } else { var blobURL = (window.URL && window.URL.createObjectURL) ? window.URL.createObjectURL(blob) : window.webkitURL.createObjectURL(blob); var tempLink = document.createElement('a'); tempLink.style.display = 'none'; tempLink.href = blobURL; tempLink.setAttribute('download', filename); // Safari thinks _blank anchor are pop ups. We only want to set _blank // target if the browser does not support the HTML5 download attribute. // This allows you to download files in desktop safari if pop up blocking // is enabled. if (typeof tempLink.download === 'undefined') { tempLink.setAttribute('target', '_blank'); } document.body.appendChild(tempLink); tempLink.click(); // Fixes "webkit blob resource error 1" setTimeout(function() { document.body.removeChild(tempLink); window.URL.revokeObjectURL(blobURL); }, 200) } } /***/ }), /***/ "./node_modules/jwt-decode/lib/atob.js": /***/ (function(module, exports) { /** * The code was extracted from: * https://github.com/davidchambers/Base64.js */ var chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='; function InvalidCharacterError(message) { this.message = message; } InvalidCharacterError.prototype = new Error(); InvalidCharacterError.prototype.name = 'InvalidCharacterError'; function polyfill (input) { var str = String(input).replace(/=+$/, ''); if (str.length % 4 == 1) { throw new InvalidCharacterError("'atob' failed: The string to be decoded is not correctly encoded."); } for ( // initialize result and counters var bc = 0, bs, buffer, idx = 0, output = ''; // get next character buffer = str.charAt(idx++); // character found in table? initialize bit storage and add its ascii value; ~buffer && (bs = bc % 4 ? bs * 64 + buffer : buffer, // and if not first of each 4 characters, // convert the first 8 bits to one ascii character bc++ % 4) ? output += String.fromCharCode(255 & bs >> (-2 * bc & 6)) : 0 ) { // try to find character in table (0-63, not found => -1) buffer = chars.indexOf(buffer); } return output; } module.exports = typeof window !== 'undefined' && window.atob && window.atob.bind(window) || polyfill; /***/ }), /***/ "./node_modules/jwt-decode/lib/base64_url_decode.js": /***/ (function(module, exports, __webpack_require__) { var atob = __webpack_require__("./node_modules/jwt-decode/lib/atob.js"); function b64DecodeUnicode(str) { return decodeURIComponent(atob(str).replace(/(.)/g, function (m, p) { var code = p.charCodeAt(0).toString(16).toUpperCase(); if (code.length < 2) { code = '0' + code; } return '%' + code; })); } module.exports = function(str) { var output = str.replace(/-/g, "+").replace(/_/g, "/"); switch (output.length % 4) { case 0: break; case 2: output += "=="; break; case 3: output += "="; break; default: throw "Illegal base64url string!"; } try{ return b64DecodeUnicode(output); } catch (err) { return atob(output); } }; /***/ }), /***/ "./node_modules/jwt-decode/lib/index.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; var base64_url_decode = __webpack_require__("./node_modules/jwt-decode/lib/base64_url_decode.js"); function InvalidTokenError(message) { this.message = message; } InvalidTokenError.prototype = new Error(); InvalidTokenError.prototype.name = 'InvalidTokenError'; module.exports = function (token,options) { if (typeof token !== 'string') { throw new InvalidTokenError('Invalid token specified'); } options = options || {}; var pos = options.header === true ? 0 : 1; try { return JSON.parse(base64_url_decode(token.split('.')[pos])); } catch (e) { throw new InvalidTokenError('Invalid token specified: ' + e.message); } }; module.exports.InvalidTokenError = InvalidTokenError; /***/ }), /***/ "./node_modules/libphonenumber-js/build/AsYouType.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports["default"] = void 0; var _metadata = _interopRequireDefault(__webpack_require__("./node_modules/libphonenumber-js/build/metadata.js")); var _PhoneNumber = _interopRequireDefault(__webpack_require__("./node_modules/libphonenumber-js/build/PhoneNumber.js")); var _AsYouTypeState = _interopRequireDefault(__webpack_require__("./node_modules/libphonenumber-js/build/AsYouTypeState.js")); var _AsYouTypeFormatter = _interopRequireWildcard(__webpack_require__("./node_modules/libphonenumber-js/build/AsYouTypeFormatter.js")); var _AsYouTypeParser = _interopRequireWildcard(__webpack_require__("./node_modules/libphonenumber-js/build/AsYouTypeParser.js")); var _getCountryByCallingCode = _interopRequireDefault(__webpack_require__("./node_modules/libphonenumber-js/build/helpers/getCountryByCallingCode.js")); function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } var USE_NON_GEOGRAPHIC_COUNTRY_CODE = false; var AsYouType = /*#__PURE__*/function () { /** * @param {(string|object)?} [optionsOrDefaultCountry] - The default country used for parsing non-international phone numbers. Can also be an `options` object. * @param {Object} metadata */ function AsYouType(optionsOrDefaultCountry, metadata) { _classCallCheck(this, AsYouType); this.metadata = new _metadata["default"](metadata); var _this$getCountryAndCa = this.getCountryAndCallingCode(optionsOrDefaultCountry), _this$getCountryAndCa2 = _slicedToArray(_this$getCountryAndCa, 2), defaultCountry = _this$getCountryAndCa2[0], defaultCallingCode = _this$getCountryAndCa2[1]; this.defaultCountry = defaultCountry; this.defaultCallingCode = defaultCallingCode; this.reset(); } _createClass(AsYouType, [{ key: "getCountryAndCallingCode", value: function getCountryAndCallingCode(optionsOrDefaultCountry) { // Set `defaultCountry` and `defaultCallingCode` options. var defaultCountry; var defaultCallingCode; // Turns out `null` also has type "object". Weird. if (optionsOrDefaultCountry) { if (_typeof(optionsOrDefaultCountry) === 'object') { defaultCountry = optionsOrDefaultCountry.defaultCountry; defaultCallingCode = optionsOrDefaultCountry.defaultCallingCode; } else { defaultCountry = optionsOrDefaultCountry; } } if (defaultCountry && !this.metadata.hasCountry(defaultCountry)) { defaultCountry = undefined; } if (defaultCallingCode) { /* istanbul ignore if */ if (USE_NON_GEOGRAPHIC_COUNTRY_CODE) { if (this.metadata.isNonGeographicCallingCode(defaultCallingCode)) { defaultCountry = '001'; } } } return [defaultCountry, defaultCallingCode]; } /** * Inputs "next" phone number characters. * @param {string} text * @return {string} Formatted phone number characters that have been input so far. */ }, { key: "input", value: function input(text) { var _this$parser$input = this.parser.input(text, this.state), digits = _this$parser$input.digits, justLeadingPlus = _this$parser$input.justLeadingPlus; if (justLeadingPlus) { this.formattedOutput = '+'; } else if (digits) { this.determineTheCountryIfNeeded(); // Match the available formats by the currently available leading digits. if (this.state.nationalSignificantNumber) { this.formatter.narrowDownMatchingFormats(this.state); } var formattedNationalNumber; if (this.metadata.hasSelectedNumberingPlan()) { formattedNationalNumber = this.formatter.format(digits, this.state); } if (formattedNationalNumber === undefined) { // See if another national (significant) number could be re-extracted. if (this.parser.reExtractNationalSignificantNumber(this.state)) { this.determineTheCountryIfNeeded(); // If it could, then re-try formatting the new national (significant) number. var nationalDigits = this.state.getNationalDigits(); if (nationalDigits) { formattedNationalNumber = this.formatter.format(nationalDigits, this.state); } } } this.formattedOutput = formattedNationalNumber ? this.getFullNumber(formattedNationalNumber) : this.getNonFormattedNumber(); } return this.formattedOutput; } }, { key: "reset", value: function reset() { var _this = this; this.state = new _AsYouTypeState["default"]({ onCountryChange: function onCountryChange(country) { // Before version `1.6.0`, the official `AsYouType` formatter API // included the `.country` property of an `AsYouType` instance. // Since that property (along with the others) have been moved to // `this.state`, `this.country` property is emulated for compatibility // with the old versions. _this.country = country; }, onCallingCodeChange: function onCallingCodeChange(country, callingCode) { _this.metadata.selectNumberingPlan(country, callingCode); _this.formatter.reset(_this.metadata.numberingPlan, _this.state); _this.parser.reset(_this.metadata.numberingPlan); } }); this.formatter = new _AsYouTypeFormatter["default"]({ state: this.state, metadata: this.metadata }); this.parser = new _AsYouTypeParser["default"]({ defaultCountry: this.defaultCountry, defaultCallingCode: this.defaultCallingCode, metadata: this.metadata, state: this.state, onNationalSignificantNumberChange: function onNationalSignificantNumberChange() { _this.determineTheCountryIfNeeded(); _this.formatter.reset(_this.metadata.numberingPlan, _this.state); } }); this.state.reset(this.defaultCountry, this.defaultCallingCode); this.formattedOutput = ''; return this; } /** * Returns `true` if the phone number is being input in international format. * In other words, returns `true` if and only if the parsed phone number starts with a `"+"`. * @return {boolean} */ }, { key: "isInternational", value: function isInternational() { return this.state.international; } /** * Returns the "calling code" part of the phone number when it's being input * in an international format. * If no valid calling code has been entered so far, returns `undefined`. * @return {string} [callingCode] */ }, { key: "getCallingCode", value: function getCallingCode() { // If the number is being input in national format and some "default calling code" // has been passed to `AsYouType` constructor, then `this.state.callingCode` // is equal to that "default calling code". // // If the number is being input in national format and no "default calling code" // has been passed to `AsYouType` constructor, then returns `undefined`, // even if a "default country" has been passed to `AsYouType` constructor. // if (this.isInternational()) { return this.state.callingCode; } } // A legacy alias. }, { key: "getCountryCallingCode", value: function getCountryCallingCode() { return this.getCallingCode(); } /** * Returns a two-letter country code of the phone number. * Returns `undefined` for "non-geographic" phone numbering plans. * Returns `undefined` if no phone number has been input yet. * @return {string} [country] */ }, { key: "getCountry", value: function getCountry() { var digits = this.state.digits; // Return `undefined` if no digits have been input yet. if (digits) { return this._getCountry(); } } /** * Returns a two-letter country code of the phone number. * Returns `undefined` for "non-geographic" phone numbering plans. * @return {string} [country] */ }, { key: "_getCountry", value: function _getCountry() { var country = this.state.country; /* istanbul ignore if */ if (USE_NON_GEOGRAPHIC_COUNTRY_CODE) { // `AsYouType.getCountry()` returns `undefined` // for "non-geographic" phone numbering plans. if (country === '001') { return; } } return country; } }, { key: "determineTheCountryIfNeeded", value: function determineTheCountryIfNeeded() { // Suppose a user enters a phone number in international format, // and there're several countries corresponding to that country calling code, // and a country has been derived from the number, and then // a user enters one more digit and the number is no longer // valid for the derived country, so the country should be re-derived // on every new digit in those cases. // // If the phone number is being input in national format, // then it could be a case when `defaultCountry` wasn't specified // when creating `AsYouType` instance, and just `defaultCallingCode` was specified, // and that "calling code" could correspond to a "non-geographic entity", // or there could be several countries corresponding to that country calling code. // In those cases, `this.country` is `undefined` and should be derived // from the number. Again, if country calling code is ambiguous, then // `this.country` should be re-derived with each new digit. // if (!this.state.country || this.isCountryCallingCodeAmbiguous()) { this.determineTheCountry(); } } // Prepends `+CountryCode ` in case of an international phone number }, { key: "getFullNumber", value: function getFullNumber(formattedNationalNumber) { var _this2 = this; if (this.isInternational()) { var prefix = function prefix(text) { return _this2.formatter.getInternationalPrefixBeforeCountryCallingCode(_this2.state, { spacing: text ? true : false }) + text; }; var callingCode = this.state.callingCode; if (!callingCode) { return prefix("".concat(this.state.getDigitsWithoutInternationalPrefix())); } if (!formattedNationalNumber) { return prefix(callingCode); } return prefix("".concat(callingCode, " ").concat(formattedNationalNumber)); } return formattedNationalNumber; } }, { key: "getNonFormattedNationalNumberWithPrefix", value: function getNonFormattedNationalNumberWithPrefix() { var _this$state = this.state, nationalSignificantNumber = _this$state.nationalSignificantNumber, complexPrefixBeforeNationalSignificantNumber = _this$state.complexPrefixBeforeNationalSignificantNumber, nationalPrefix = _this$state.nationalPrefix; var number = nationalSignificantNumber; var prefix = complexPrefixBeforeNationalSignificantNumber || nationalPrefix; if (prefix) { number = prefix + number; } return number; } }, { key: "getNonFormattedNumber", value: function getNonFormattedNumber() { var nationalSignificantNumberMatchesInput = this.state.nationalSignificantNumberMatchesInput; return this.getFullNumber(nationalSignificantNumberMatchesInput ? this.getNonFormattedNationalNumberWithPrefix() : this.state.getNationalDigits()); } }, { key: "getNonFormattedTemplate", value: function getNonFormattedTemplate() { var number = this.getNonFormattedNumber(); if (number) { return number.replace(/[\+\d]/g, _AsYouTypeFormatter.DIGIT_PLACEHOLDER); } } }, { key: "isCountryCallingCodeAmbiguous", value: function isCountryCallingCodeAmbiguous() { var callingCode = this.state.callingCode; var countryCodes = this.metadata.getCountryCodesForCallingCode(callingCode); return countryCodes && countryCodes.length > 1; } // Determines the country of the phone number // entered so far based on the country phone code // and the national phone number. }, { key: "determineTheCountry", value: function determineTheCountry() { this.state.setCountry((0, _getCountryByCallingCode["default"])(this.isInternational() ? this.state.callingCode : this.defaultCallingCode, this.state.nationalSignificantNumber, this.metadata)); } /** * Returns a E.164 phone number value for the user's input. * * For example, for country `"US"` and input `"(222) 333-4444"` * it will return `"+12223334444"`. * * For international phone number input, it will also auto-correct * some minor errors such as using a national prefix when writing * an international phone number. For example, if the user inputs * `"+44 0 7400 000000"` then it will return an auto-corrected * `"+447400000000"` phone number value. * * Will return `undefined` if no digits have been input, * or when inputting a phone number in national format and no * default country or default "country calling code" have been set. * * @return {string} [value] */ }, { key: "getNumberValue", value: function getNumberValue() { var _this$state2 = this.state, digits = _this$state2.digits, callingCode = _this$state2.callingCode, country = _this$state2.country, nationalSignificantNumber = _this$state2.nationalSignificantNumber; // Will return `undefined` if no digits have been input. if (!digits) { return; } if (this.isInternational()) { if (callingCode) { return '+' + callingCode + nationalSignificantNumber; } else { return '+' + digits; } } else { if (country || callingCode) { var callingCode_ = country ? this.metadata.countryCallingCode() : callingCode; return '+' + callingCode_ + nationalSignificantNumber; } } } /** * Returns an instance of `PhoneNumber` class. * Will return `undefined` if no national (significant) number * digits have been entered so far, or if no `defaultCountry` has been * set and the user enters a phone number not in international format. */ }, { key: "getNumber", value: function getNumber() { var _this$state3 = this.state, nationalSignificantNumber = _this$state3.nationalSignificantNumber, carrierCode = _this$state3.carrierCode, callingCode = _this$state3.callingCode; // `this._getCountry()` is basically same as `this.state.country` // with the only change that it return `undefined` in case of a // "non-geographic" numbering plan instead of `"001"` "internal use" value. var country = this._getCountry(); if (!nationalSignificantNumber) { return; } if (!country && !callingCode) { return; } var phoneNumber = new _PhoneNumber["default"](country || callingCode, nationalSignificantNumber, this.metadata.metadata); if (carrierCode) { phoneNumber.carrierCode = carrierCode; } // Phone number extensions are not supported by "As You Type" formatter. return phoneNumber; } /** * Returns `true` if the phone number is "possible". * Is just a shortcut for `PhoneNumber.isPossible()`. * @return {boolean} */ }, { key: "isPossible", value: function isPossible() { var phoneNumber = this.getNumber(); if (!phoneNumber) { return false; } return phoneNumber.isPossible(); } /** * Returns `true` if the phone number is "valid". * Is just a shortcut for `PhoneNumber.isValid()`. * @return {boolean} */ }, { key: "isValid", value: function isValid() { var phoneNumber = this.getNumber(); if (!phoneNumber) { return false; } return phoneNumber.isValid(); } /** * @deprecated * This method is used in `react-phone-number-input/source/input-control.js` * in versions before `3.0.16`. */ }, { key: "getNationalNumber", value: function getNationalNumber() { return this.state.nationalSignificantNumber; } /** * Returns the phone number characters entered by the user. * @return {string} */ }, { key: "getChars", value: function getChars() { return (this.state.international ? '+' : '') + this.state.digits; } /** * Returns the template for the formatted phone number. * @return {string} */ }, { key: "getTemplate", value: function getTemplate() { return this.formatter.getTemplate(this.state) || this.getNonFormattedTemplate() || ''; } }]); return AsYouType; }(); exports["default"] = AsYouType; //# sourceMappingURL=AsYouType.js.map /***/ }), /***/ "./node_modules/libphonenumber-js/build/AsYouTypeFormatter.PatternMatcher.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports["default"] = void 0; var _AsYouTypeFormatterPatternParser = _interopRequireDefault(__webpack_require__("./node_modules/libphonenumber-js/build/AsYouTypeFormatter.PatternParser.js")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } function _createForOfIteratorHelperLoose(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (it) return (it = it.call(o)).next.bind(it); if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } var PatternMatcher = /*#__PURE__*/function () { function PatternMatcher(pattern) { _classCallCheck(this, PatternMatcher); this.matchTree = new _AsYouTypeFormatterPatternParser["default"]().parse(pattern); } _createClass(PatternMatcher, [{ key: "match", value: function match(string) { var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, allowOverflow = _ref.allowOverflow; if (!string) { throw new Error('String is required'); } var result = _match(string.split(''), this.matchTree, true); if (result && result.match) { delete result.matchedChars; } if (result && result.overflow) { if (!allowOverflow) { return; } } return result; } }]); return PatternMatcher; }(); /** * Matches `characters` against a pattern compiled into a `tree`. * @param {string[]} characters * @param {Tree} tree — A pattern compiled into a `tree`. See the `*.d.ts` file for the description of the `tree` structure. * @param {boolean} last — Whether it's the last (rightmost) subtree on its level of the match tree. * @return {object} See the `*.d.ts` file for the description of the result object. */ exports["default"] = PatternMatcher; function _match(characters, tree, last) { // If `tree` is a string, then `tree` is a single character. // That's because when a pattern is parsed, multi-character-string parts // of a pattern are compiled into arrays of single characters. // I still wrote this piece of code for a "general" hypothetical case // when `tree` could be a string of several characters, even though // such case is not possible with the current implementation. if (typeof tree === 'string') { var characterString = characters.join(''); if (tree.indexOf(characterString) === 0) { // `tree` is always a single character. // If `tree.indexOf(characterString) === 0` // then `characters.length === tree.length`. /* istanbul ignore else */ if (characters.length === tree.length) { return { match: true, matchedChars: characters }; } // `tree` is always a single character. // If `tree.indexOf(characterString) === 0` // then `characters.length === tree.length`. /* istanbul ignore next */ return { partialMatch: true // matchedChars: characters }; } if (characterString.indexOf(tree) === 0) { if (last) { // The `else` path is not possible because `tree` is always a single character. // The `else` case for `characters.length > tree.length` would be // `characters.length <= tree.length` which means `characters.length <= 1`. // `characters` array can't be empty, so that means `characters === [tree]`, // which would also mean `tree.indexOf(characterString) === 0` and that'd mean // that the `if (tree.indexOf(characterString) === 0)` condition before this // `if` condition would be entered, and returned from there, not reaching this code. /* istanbul ignore else */ if (characters.length > tree.length) { return { overflow: true }; } } return { match: true, matchedChars: characters.slice(0, tree.length) }; } return; } if (Array.isArray(tree)) { var restCharacters = characters.slice(); var i = 0; while (i < tree.length) { var subtree = tree[i]; var result = _match(restCharacters, subtree, last && i === tree.length - 1); if (!result) { return; } else if (result.overflow) { return result; } else if (result.match) { // Continue with the next subtree with the rest of the characters. restCharacters = restCharacters.slice(result.matchedChars.length); if (restCharacters.length === 0) { if (i === tree.length - 1) { return { match: true, matchedChars: characters }; } else { return { partialMatch: true // matchedChars: characters }; } } } else { /* istanbul ignore else */ if (result.partialMatch) { return { partialMatch: true // matchedChars: characters }; } else { throw new Error("Unsupported match result:\n".concat(JSON.stringify(result, null, 2))); } } i++; } // If `last` then overflow has already been checked // by the last element of the `tree` array. /* istanbul ignore if */ if (last) { return { overflow: true }; } return { match: true, matchedChars: characters.slice(0, characters.length - restCharacters.length) }; } switch (tree.op) { case '|': var partialMatch; for (var _iterator = _createForOfIteratorHelperLoose(tree.args), _step; !(_step = _iterator()).done;) { var branch = _step.value; var _result = _match(characters, branch, last); if (_result) { if (_result.overflow) { return _result; } else if (_result.match) { return { match: true, matchedChars: _result.matchedChars }; } else { /* istanbul ignore else */ if (_result.partialMatch) { partialMatch = true; } else { throw new Error("Unsupported match result:\n".concat(JSON.stringify(_result, null, 2))); } } } } if (partialMatch) { return { partialMatch: true // matchedChars: ... }; } // Not even a partial match. return; case '[]': for (var _iterator2 = _createForOfIteratorHelperLoose(tree.args), _step2; !(_step2 = _iterator2()).done;) { var _char = _step2.value; if (characters[0] === _char) { if (characters.length === 1) { return { match: true, matchedChars: characters }; } if (last) { return { overflow: true }; } return { match: true, matchedChars: [_char] }; } } // No character matches. return; /* istanbul ignore next */ default: throw new Error("Unsupported instruction tree: ".concat(tree)); } } //# sourceMappingURL=AsYouTypeFormatter.PatternMatcher.js.map /***/ }), /***/ "./node_modules/libphonenumber-js/build/AsYouTypeFormatter.PatternParser.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports["default"] = void 0; function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } var PatternParser = /*#__PURE__*/function () { function PatternParser() { _classCallCheck(this, PatternParser); } _createClass(PatternParser, [{ key: "parse", value: function parse(pattern) { this.context = [{ or: true, instructions: [] }]; this.parsePattern(pattern); if (this.context.length !== 1) { throw new Error('Non-finalized contexts left when pattern parse ended'); } var _this$context$ = this.context[0], branches = _this$context$.branches, instructions = _this$context$.instructions; if (branches) { return { op: '|', args: branches.concat([expandSingleElementArray(instructions)]) }; } /* istanbul ignore if */ if (instructions.length === 0) { throw new Error('Pattern is required'); } if (instructions.length === 1) { return instructions[0]; } return instructions; } }, { key: "startContext", value: function startContext(context) { this.context.push(context); } }, { key: "endContext", value: function endContext() { this.context.pop(); } }, { key: "getContext", value: function getContext() { return this.context[this.context.length - 1]; } }, { key: "parsePattern", value: function parsePattern(pattern) { if (!pattern) { throw new Error('Pattern is required'); } var match = pattern.match(OPERATOR); if (!match) { if (ILLEGAL_CHARACTER_REGEXP.test(pattern)) { throw new Error("Illegal characters found in a pattern: ".concat(pattern)); } this.getContext().instructions = this.getContext().instructions.concat(pattern.split('')); return; } var operator = match[1]; var before = pattern.slice(0, match.index); var rightPart = pattern.slice(match.index + operator.length); switch (operator) { case '(?:': if (before) { this.parsePattern(before); } this.startContext({ or: true, instructions: [], branches: [] }); break; case ')': if (!this.getContext().or) { throw new Error('")" operator must be preceded by "(?:" operator'); } if (before) { this.parsePattern(before); } if (this.getContext().instructions.length === 0) { throw new Error('No instructions found after "|" operator in an "or" group'); } var _this$getContext = this.getContext(), branches = _this$getContext.branches; branches.push(expandSingleElementArray(this.getContext().instructions)); this.endContext(); this.getContext().instructions.push({ op: '|', args: branches }); break; case '|': if (!this.getContext().or) { throw new Error('"|" operator can only be used inside "or" groups'); } if (before) { this.parsePattern(before); } // The top-level is an implicit "or" group, if required. if (!this.getContext().branches) { // `branches` are not defined only for the root implicit "or" operator. /* istanbul ignore else */ if (this.context.length === 1) { this.getContext().branches = []; } else { throw new Error('"branches" not found in an "or" group context'); } } this.getContext().branches.push(expandSingleElementArray(this.getContext().instructions)); this.getContext().instructions = []; break; case '[': if (before) { this.parsePattern(before); } this.startContext({ oneOfSet: true }); break; case ']': if (!this.getContext().oneOfSet) { throw new Error('"]" operator must be preceded by "[" operator'); } this.endContext(); this.getContext().instructions.push({ op: '[]', args: parseOneOfSet(before) }); break; /* istanbul ignore next */ default: throw new Error("Unknown operator: ".concat(operator)); } if (rightPart) { this.parsePattern(rightPart); } } }]); return PatternParser; }(); exports["default"] = PatternParser; function parseOneOfSet(pattern) { var values = []; var i = 0; while (i < pattern.length) { if (pattern[i] === '-') { if (i === 0 || i === pattern.length - 1) { throw new Error("Couldn't parse a one-of set pattern: ".concat(pattern)); } var prevValue = pattern[i - 1].charCodeAt(0) + 1; var nextValue = pattern[i + 1].charCodeAt(0) - 1; var value = prevValue; while (value <= nextValue) { values.push(String.fromCharCode(value)); value++; } } else { values.push(pattern[i]); } i++; } return values; } var ILLEGAL_CHARACTER_REGEXP = /[\(\)\[\]\?\:\|]/; var OPERATOR = new RegExp( // any of: '(' + // or operator '\\|' + // or '|' + // or group start '\\(\\?\\:' + // or '|' + // or group end '\\)' + // or '|' + // one-of set start '\\[' + // or '|' + // one-of set end '\\]' + ')'); function expandSingleElementArray(array) { if (array.length === 1) { return array[0]; } return array; } //# sourceMappingURL=AsYouTypeFormatter.PatternParser.js.map /***/ }), /***/ "./node_modules/libphonenumber-js/build/AsYouTypeFormatter.complete.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.canFormatCompleteNumber = canFormatCompleteNumber; exports["default"] = formatCompleteNumber; var _checkNumberLength = _interopRequireDefault(__webpack_require__("./node_modules/libphonenumber-js/build/helpers/checkNumberLength.js")); var _parseDigits = _interopRequireDefault(__webpack_require__("./node_modules/libphonenumber-js/build/helpers/parseDigits.js")); var _formatNationalNumberUsingFormat = _interopRequireDefault(__webpack_require__("./node_modules/libphonenumber-js/build/helpers/formatNationalNumberUsingFormat.js")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } function formatCompleteNumber(state, format, _ref) { var metadata = _ref.metadata, shouldTryNationalPrefixFormattingRule = _ref.shouldTryNationalPrefixFormattingRule, getSeparatorAfterNationalPrefix = _ref.getSeparatorAfterNationalPrefix; var matcher = new RegExp("^(?:".concat(format.pattern(), ")$")); if (matcher.test(state.nationalSignificantNumber)) { return formatNationalNumberWithAndWithoutNationalPrefixFormattingRule(state, format, { metadata: metadata, shouldTryNationalPrefixFormattingRule: shouldTryNationalPrefixFormattingRule, getSeparatorAfterNationalPrefix: getSeparatorAfterNationalPrefix }); } } function canFormatCompleteNumber(nationalSignificantNumber, metadata) { return (0, _checkNumberLength["default"])(nationalSignificantNumber, metadata) === 'IS_POSSIBLE'; } function formatNationalNumberWithAndWithoutNationalPrefixFormattingRule(state, format, _ref2) { var metadata = _ref2.metadata, shouldTryNationalPrefixFormattingRule = _ref2.shouldTryNationalPrefixFormattingRule, getSeparatorAfterNationalPrefix = _ref2.getSeparatorAfterNationalPrefix; // `format` has already been checked for `nationalPrefix` requirement. var nationalSignificantNumber = state.nationalSignificantNumber, international = state.international, nationalPrefix = state.nationalPrefix, carrierCode = state.carrierCode; // Format the number with using `national_prefix_formatting_rule`. // If the resulting formatted number is a valid formatted number, then return it. // // Google's AsYouType formatter is different in a way that it doesn't try // to format using the "national prefix formatting rule", and instead it // simply prepends a national prefix followed by a " " character. // This code does that too, but as a fallback. // The reason is that "national prefix formatting rule" may use parentheses, // which wouldn't be included has it used the simpler Google's way. // if (shouldTryNationalPrefixFormattingRule(format)) { var formattedNumber = formatNationalNumber(state, format, { useNationalPrefixFormattingRule: true, getSeparatorAfterNationalPrefix: getSeparatorAfterNationalPrefix, metadata: metadata }); if (formattedNumber) { return formattedNumber; } } // Format the number without using `national_prefix_formatting_rule`. return formatNationalNumber(state, format, { useNationalPrefixFormattingRule: false, getSeparatorAfterNationalPrefix: getSeparatorAfterNationalPrefix, metadata: metadata }); } function formatNationalNumber(state, format, _ref3) { var metadata = _ref3.metadata, useNationalPrefixFormattingRule = _ref3.useNationalPrefixFormattingRule, getSeparatorAfterNationalPrefix = _ref3.getSeparatorAfterNationalPrefix; var formattedNationalNumber = (0, _formatNationalNumberUsingFormat["default"])(state.nationalSignificantNumber, format, { carrierCode: state.carrierCode, useInternationalFormat: state.international, withNationalPrefix: useNationalPrefixFormattingRule, metadata: metadata }); if (!useNationalPrefixFormattingRule) { if (state.nationalPrefix) { // If a national prefix was extracted, then just prepend it, // followed by a " " character. formattedNationalNumber = state.nationalPrefix + getSeparatorAfterNationalPrefix(format) + formattedNationalNumber; } else if (state.complexPrefixBeforeNationalSignificantNumber) { formattedNationalNumber = state.complexPrefixBeforeNationalSignificantNumber + ' ' + formattedNationalNumber; } } if (isValidFormattedNationalNumber(formattedNationalNumber, state)) { return formattedNationalNumber; } } // Check that the formatted phone number contains exactly // the same digits that have been input by the user. // For example, when "0111523456789" is input for `AR` country, // the extracted `this.nationalSignificantNumber` is "91123456789", // which means that the national part of `this.digits` isn't simply equal to // `this.nationalPrefix` + `this.nationalSignificantNumber`. // // Also, a `format` can add extra digits to the `this.nationalSignificantNumber` // being formatted via `metadata[country].national_prefix_transform_rule`. // For example, for `VI` country, it prepends `340` to the national number, // and if this check hasn't been implemented, then there would be a bug // when `340` "area coude" is "duplicated" during input for `VI` country: // https://github.com/catamphetamine/libphonenumber-js/issues/318 // // So, all these "gotchas" are filtered out. // // In the original Google's code, the comments say: // "Check that we didn't remove nor add any extra digits when we matched // this formatting pattern. This usually happens after we entered the last // digit during AYTF. Eg: In case of MX, we swallow mobile token (1) when // formatted but AYTF should retain all the number entered and not change // in order to match a format (of same leading digits and length) display // in that way." // "If it's the same (i.e entered number and format is same), then it's // safe to return this in formatted number as nothing is lost / added." // Otherwise, don't use this format. // https://github.com/google/libphonenumber/commit/3e7c1f04f5e7200f87fb131e6f85c6e99d60f510#diff-9149457fa9f5d608a11bb975c6ef4bc5 // https://github.com/google/libphonenumber/commit/3ac88c7106e7dcb553bcc794b15f19185928a1c6#diff-2dcb77e833422ee304da348b905cde0b // function isValidFormattedNationalNumber(formattedNationalNumber, state) { return (0, _parseDigits["default"])(formattedNationalNumber) === state.getNationalDigits(); } //# sourceMappingURL=AsYouTypeFormatter.complete.js.map /***/ }), /***/ "./node_modules/libphonenumber-js/build/AsYouTypeFormatter.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "DIGIT_PLACEHOLDER", { enumerable: true, get: function get() { return _AsYouTypeFormatterUtil.DIGIT_PLACEHOLDER; } }); exports["default"] = void 0; var _AsYouTypeFormatterUtil = __webpack_require__("./node_modules/libphonenumber-js/build/AsYouTypeFormatter.util.js"); var _AsYouTypeFormatterComplete = _interopRequireWildcard(__webpack_require__("./node_modules/libphonenumber-js/build/AsYouTypeFormatter.complete.js")); var _AsYouTypeFormatterPatternMatcher = _interopRequireDefault(__webpack_require__("./node_modules/libphonenumber-js/build/AsYouTypeFormatter.PatternMatcher.js")); var _parseDigits = _interopRequireDefault(__webpack_require__("./node_modules/libphonenumber-js/build/helpers/parseDigits.js")); var _formatNationalNumberUsingFormat = __webpack_require__("./node_modules/libphonenumber-js/build/helpers/formatNationalNumberUsingFormat.js"); var _constants = __webpack_require__("./node_modules/libphonenumber-js/build/constants.js"); var _applyInternationalSeparatorStyle = _interopRequireDefault(__webpack_require__("./node_modules/libphonenumber-js/build/helpers/applyInternationalSeparatorStyle.js")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; } function _createForOfIteratorHelperLoose(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (it) return (it = it.call(o)).next.bind(it); if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } // Used in phone number format template creation. // Could be any digit, I guess. var DUMMY_DIGIT = '9'; // I don't know why is it exactly `15` var LONGEST_NATIONAL_PHONE_NUMBER_LENGTH = 15; // Create a phone number consisting only of the digit 9 that matches the // `number_pattern` by applying the pattern to the "longest phone number" string. var LONGEST_DUMMY_PHONE_NUMBER = (0, _AsYouTypeFormatterUtil.repeat)(DUMMY_DIGIT, LONGEST_NATIONAL_PHONE_NUMBER_LENGTH); // A set of characters that, if found in a national prefix formatting rules, are an indicator to // us that we should separate the national prefix from the number when formatting. var NATIONAL_PREFIX_SEPARATORS_PATTERN = /[- ]/; // Deprecated: Google has removed some formatting pattern related code from their repo. // https://github.com/googlei18n/libphonenumber/commit/a395b4fef3caf57c4bc5f082e1152a4d2bd0ba4c // "We no longer have numbers in formatting matching patterns, only \d." // Because this library supports generating custom metadata // some users may still be using old metadata so the relevant // code seems to stay until some next major version update. var SUPPORT_LEGACY_FORMATTING_PATTERNS = true; // A pattern that is used to match character classes in regular expressions. // An example of a character class is "[1-4]". var CREATE_CHARACTER_CLASS_PATTERN = SUPPORT_LEGACY_FORMATTING_PATTERNS && function () { return /\[([^\[\]])*\]/g; }; // Any digit in a regular expression that actually denotes a digit. For // example, in the regular expression "80[0-2]\d{6,10}", the first 2 digits // (8 and 0) are standalone digits, but the rest are not. // Two look-aheads are needed because the number following \\d could be a // two-digit number, since the phone number can be as long as 15 digits. var CREATE_STANDALONE_DIGIT_PATTERN = SUPPORT_LEGACY_FORMATTING_PATTERNS && function () { return /\d(?=[^,}][^,}])/g; }; // A regular expression that is used to determine if a `format` is // suitable to be used in the "as you type formatter". // A `format` is suitable when the resulting formatted number has // the same digits as the user has entered. // // In the simplest case, that would mean that the format // doesn't add any additional digits when formatting a number. // Google says that it also shouldn't add "star" (`*`) characters, // like it does in some Israeli formats. // Such basic format would only contain "valid punctuation" // and "captured group" identifiers ($1, $2, etc). // // An example of a format that adds additional digits: // // Country: `AR` (Argentina). // Format: // { // "pattern": "(\\d)(\\d{2})(\\d{4})(\\d{4})", // "leading_digits_patterns": ["91"], // "national_prefix_formatting_rule": "0$1", // "format": "$2 15-$3-$4", // "international_format": "$1 $2 $3-$4" // } // // In the format above, the `format` adds `15` to the digits when formatting a number. // A sidenote: this format actually is suitable because `national_prefix_for_parsing` // has previously removed `15` from a national number, so re-adding `15` in `format` // doesn't actually result in any extra digits added to user's input. // But verifying that would be a complex procedure, so the code chooses a simpler path: // it simply filters out all `format`s that contain anything but "captured group" ids. // // This regular expression is called `ELIGIBLE_FORMAT_PATTERN` in Google's // `libphonenumber` code. // var NON_ALTERING_FORMAT_REG_EXP = new RegExp('[' + _constants.VALID_PUNCTUATION + ']*' + // Google developers say: // "We require that the first matching group is present in the // output pattern to ensure no data is lost while formatting." '\\$1' + '[' + _constants.VALID_PUNCTUATION + ']*' + '(\\$\\d[' + _constants.VALID_PUNCTUATION + ']*)*' + '$'); // This is the minimum length of the leading digits of a phone number // to guarantee the first "leading digits pattern" for a phone number format // to be preemptive. var MIN_LEADING_DIGITS_LENGTH = 3; var AsYouTypeFormatter = /*#__PURE__*/function () { function AsYouTypeFormatter(_ref) { var state = _ref.state, metadata = _ref.metadata; _classCallCheck(this, AsYouTypeFormatter); this.metadata = metadata; this.resetFormat(); } _createClass(AsYouTypeFormatter, [{ key: "resetFormat", value: function resetFormat() { this.chosenFormat = undefined; this.template = undefined; this.nationalNumberTemplate = undefined; this.populatedNationalNumberTemplate = undefined; this.populatedNationalNumberTemplatePosition = -1; } }, { key: "reset", value: function reset(numberingPlan, state) { this.resetFormat(); if (numberingPlan) { this.isNANP = numberingPlan.callingCode() === '1'; this.matchingFormats = numberingPlan.formats(); if (state.nationalSignificantNumber) { this.narrowDownMatchingFormats(state); } } else { this.isNANP = undefined; this.matchingFormats = []; } } /** * Formats an updated phone number. * @param {string} nextDigits — Additional phone number digits. * @param {object} state — `AsYouType` state. * @return {[string]} Returns undefined if the updated phone number can't be formatted using any of the available formats. */ }, { key: "format", value: function format(nextDigits, state) { var _this = this; // See if the phone number digits can be formatted as a complete phone number. // If not, use the results from `formatNationalNumberWithNextDigits()`, // which formats based on the chosen formatting pattern. // // Attempting to format complete phone number first is how it's done // in Google's `libphonenumber`, so this library just follows it. // Google's `libphonenumber` code doesn't explain in detail why does it // attempt to format digits as a complete phone number // instead of just going with a previoulsy (or newly) chosen `format`: // // "Checks to see if there is an exact pattern match for these digits. // If so, we should use this instead of any other formatting template // whose leadingDigitsPattern also matches the input." // if ((0, _AsYouTypeFormatterComplete.canFormatCompleteNumber)(state.nationalSignificantNumber, this.metadata)) { for (var _iterator = _createForOfIteratorHelperLoose(this.matchingFormats), _step; !(_step = _iterator()).done;) { var format = _step.value; var formattedCompleteNumber = (0, _AsYouTypeFormatterComplete["default"])(state, format, { metadata: this.metadata, shouldTryNationalPrefixFormattingRule: function shouldTryNationalPrefixFormattingRule(format) { return _this.shouldTryNationalPrefixFormattingRule(format, { international: state.international, nationalPrefix: state.nationalPrefix }); }, getSeparatorAfterNationalPrefix: function getSeparatorAfterNationalPrefix(format) { return _this.getSeparatorAfterNationalPrefix(format); } }); if (formattedCompleteNumber) { this.resetFormat(); this.chosenFormat = format; this.setNationalNumberTemplate(formattedCompleteNumber.replace(/\d/g, _AsYouTypeFormatterUtil.DIGIT_PLACEHOLDER), state); this.populatedNationalNumberTemplate = formattedCompleteNumber; // With a new formatting template, the matched position // using the old template needs to be reset. this.populatedNationalNumberTemplatePosition = this.template.lastIndexOf(_AsYouTypeFormatterUtil.DIGIT_PLACEHOLDER); return formattedCompleteNumber; } } } // Format the digits as a partial (incomplete) phone number // using the previously chosen formatting pattern (or a newly chosen one). return this.formatNationalNumberWithNextDigits(nextDigits, state); } // Formats the next phone number digits. }, { key: "formatNationalNumberWithNextDigits", value: function formatNationalNumberWithNextDigits(nextDigits, state) { var previouslyChosenFormat = this.chosenFormat; // Choose a format from the list of matching ones. var newlyChosenFormat = this.chooseFormat(state); if (newlyChosenFormat) { if (newlyChosenFormat === previouslyChosenFormat) { // If it can format the next (current) digits // using the previously chosen phone number format // then return the updated formatted number. return this.formatNextNationalNumberDigits(nextDigits); } else { // If a more appropriate phone number format // has been chosen for these "leading digits", // then re-format the national phone number part // using the newly selected format. return this.formatNextNationalNumberDigits(state.getNationalDigits()); } } } }, { key: "narrowDownMatchingFormats", value: function narrowDownMatchingFormats(_ref2) { var _this2 = this; var nationalSignificantNumber = _ref2.nationalSignificantNumber, nationalPrefix = _ref2.nationalPrefix, international = _ref2.international; var leadingDigits = nationalSignificantNumber; // "leading digits" pattern list starts with a // "leading digits" pattern fitting a maximum of 3 leading digits. // So, after a user inputs 3 digits of a national (significant) phone number // this national (significant) number can already be formatted. // The next "leading digits" pattern is for 4 leading digits max, // and the "leading digits" pattern after it is for 5 leading digits max, etc. // This implementation is different from Google's // in that it searches for a fitting format // even if the user has entered less than // `MIN_LEADING_DIGITS_LENGTH` digits of a national number. // Because some leading digit patterns already match for a single first digit. var leadingDigitsPatternIndex = leadingDigits.length - MIN_LEADING_DIGITS_LENGTH; if (leadingDigitsPatternIndex < 0) { leadingDigitsPatternIndex = 0; } this.matchingFormats = this.matchingFormats.filter(function (format) { return _this2.formatSuits(format, international, nationalPrefix) && _this2.formatMatches(format, leadingDigits, leadingDigitsPatternIndex); }); // If there was a phone number format chosen // and it no longer holds given the new leading digits then reset it. // The test for this `if` condition is marked as: // "Reset a chosen format when it no longer holds given the new leading digits". // To construct a valid test case for this one can find a country // in `PhoneNumberMetadata.xml` yielding one format for 3 `` // and yielding another format for 4 `` (Australia in this case). if (this.chosenFormat && this.matchingFormats.indexOf(this.chosenFormat) === -1) { this.resetFormat(); } } }, { key: "formatSuits", value: function formatSuits(format, international, nationalPrefix) { // When a prefix before a national (significant) number is // simply a national prefix, then it's parsed as `this.nationalPrefix`. // In more complex cases, a prefix before national (significant) number // could include a national prefix as well as some "capturing groups", // and in that case there's no info whether a national prefix has been parsed. // If national prefix is not used when formatting a phone number // using this format, but a national prefix has been entered by the user, // and was extracted, then discard such phone number format. // In Google's "AsYouType" formatter code, the equivalent would be this part: // https://github.com/google/libphonenumber/blob/0a45cfd96e71cad8edb0e162a70fcc8bd9728933/java/libphonenumber/src/com/google/i18n/phonenumbers/AsYouTypeFormatter.java#L175-L184 if (nationalPrefix && !format.usesNationalPrefix() && // !format.domesticCarrierCodeFormattingRule() && !format.nationalPrefixIsOptionalWhenFormattingInNationalFormat()) { return false; } // If national prefix is mandatory for this phone number format // and there're no guarantees that a national prefix is present in user input // then discard this phone number format as not suitable. // In Google's "AsYouType" formatter code, the equivalent would be this part: // https://github.com/google/libphonenumber/blob/0a45cfd96e71cad8edb0e162a70fcc8bd9728933/java/libphonenumber/src/com/google/i18n/phonenumbers/AsYouTypeFormatter.java#L185-L193 if (!international && !nationalPrefix && format.nationalPrefixIsMandatoryWhenFormattingInNationalFormat()) { return false; } return true; } }, { key: "formatMatches", value: function formatMatches(format, leadingDigits, leadingDigitsPatternIndex) { var leadingDigitsPatternsCount = format.leadingDigitsPatterns().length; // If this format is not restricted to a certain // leading digits pattern then it fits. // The test case could be found by searching for "leadingDigitsPatternsCount === 0". if (leadingDigitsPatternsCount === 0) { return true; } // Start narrowing down the list of possible formats based on the leading digits. // (only previously matched formats take part in the narrowing down process) // `leading_digits_patterns` start with 3 digits min // and then go up from there one digit at a time. leadingDigitsPatternIndex = Math.min(leadingDigitsPatternIndex, leadingDigitsPatternsCount - 1); var leadingDigitsPattern = format.leadingDigitsPatterns()[leadingDigitsPatternIndex]; // Google imposes a requirement on the leading digits // to be minimum 3 digits long in order to be eligible // for checking those with a leading digits pattern. // // Since `leading_digits_patterns` start with 3 digits min, // Google's original `libphonenumber` library only starts // excluding any non-matching formats only when the // national number entered so far is at least 3 digits long, // otherwise format matching would give false negatives. // // For example, when the digits entered so far are `2` // and the leading digits pattern is `21` – // it's quite obvious in this case that the format could be the one // but due to the absence of further digits it would give false negative. // // Also, `leading_digits_patterns` doesn't always correspond to a single // digits count. For example, `60|8` pattern would already match `8` // but the `60` part would require having at least two leading digits, // so the whole pattern would require inputting two digits first in order to // decide on whether it matches the input, even when the input is "80". // // This library — `libphonenumber-js` — allows filtering by `leading_digits_patterns` // even when there's only 1 or 2 digits of the national (significant) number. // To do that, it uses a non-strict pattern matcher written specifically for that. // if (leadingDigits.length < MIN_LEADING_DIGITS_LENGTH) { // Before leading digits < 3 matching was implemented: // return true // // After leading digits < 3 matching was implemented: try { return new _AsYouTypeFormatterPatternMatcher["default"](leadingDigitsPattern).match(leadingDigits, { allowOverflow: true }) !== undefined; } catch (error) /* istanbul ignore next */ { // There's a slight possibility that there could be some undiscovered bug // in the pattern matcher code. Since the "leading digits < 3 matching" // feature is not "essential" for operation, it can fall back to the old way // in case of any issues rather than halting the application's execution. console.error(error); return true; } } // If at least `MIN_LEADING_DIGITS_LENGTH` digits of a national number are // available then use the usual regular expression matching. // // The whole pattern is wrapped in round brackets (`()`) because // the pattern can use "or" operator (`|`) at the top level of the pattern. // return new RegExp("^(".concat(leadingDigitsPattern, ")")).test(leadingDigits); } }, { key: "getFormatFormat", value: function getFormatFormat(format, international) { return international ? format.internationalFormat() : format.format(); } }, { key: "chooseFormat", value: function chooseFormat(state) { var _this3 = this; var _loop = function _loop() { var format = _step2.value; // If this format is currently being used // and is still suitable, then stick to it. if (_this3.chosenFormat === format) { return "break"; } // Sometimes, a formatting rule inserts additional digits in a phone number, // and "as you type" formatter can't do that: it should only use the digits // that the user has input. // // For example, in Argentina, there's a format for mobile phone numbers: // // { // "pattern": "(\\d)(\\d{2})(\\d{4})(\\d{4})", // "leading_digits_patterns": ["91"], // "national_prefix_formatting_rule": "0$1", // "format": "$2 15-$3-$4", // "international_format": "$1 $2 $3-$4" // } // // In that format, `international_format` is used instead of `format` // because `format` inserts `15` in the formatted number, // and `AsYouType` formatter should only use the digits // the user has actually input, without adding any extra digits. // In this case, it wouldn't make a difference, because the `15` // is first stripped when applying `national_prefix_for_parsing` // and then re-added when using `format`, so in reality it doesn't // add any new digits to the number, but to detect that, the code // would have to be more complex: it would have to try formatting // the digits using the format and then see if any digits have // actually been added or removed, and then, every time a new digit // is input, it should re-check whether the chosen format doesn't // alter the digits. // // Google's code doesn't go that far, and so does this library: // it simply requires that a `format` doesn't add any additonal // digits to user's input. // // Also, people in general should move from inputting phone numbers // in national format (possibly with national prefixes) // and use international phone number format instead: // it's a logical thing in the modern age of mobile phones, // globalization and the internet. // /* istanbul ignore if */ if (!NON_ALTERING_FORMAT_REG_EXP.test(_this3.getFormatFormat(format, state.international))) { return "continue"; } if (!_this3.createTemplateForFormat(format, state)) { // Remove the format if it can't generate a template. _this3.matchingFormats = _this3.matchingFormats.filter(function (_) { return _ !== format; }); return "continue"; } _this3.chosenFormat = format; return "break"; }; // When there are multiple available formats, the formatter uses the first // format where a formatting template could be created. // // For some weird reason, `istanbul` says "else path not taken" // for the `for of` line below. Supposedly that means that // the loop doesn't ever go over the last element in the list. // That's true because there always is `this.chosenFormat` // when `this.matchingFormats` is non-empty. // And, for some weird reason, it doesn't think that the case // with empty `this.matchingFormats` qualifies for a valid "else" path. // So simply muting this `istanbul` warning. // It doesn't skip the contents of the `for of` loop, // it just skips the `for of` line. // /* istanbul ignore next */ for (var _iterator2 = _createForOfIteratorHelperLoose(this.matchingFormats.slice()), _step2; !(_step2 = _iterator2()).done;) { var _ret = _loop(); if (_ret === "break") break; if (_ret === "continue") continue; } if (!this.chosenFormat) { // No format matches the national (significant) phone number. this.resetFormat(); } return this.chosenFormat; } }, { key: "createTemplateForFormat", value: function createTemplateForFormat(format, state) { // The formatter doesn't format numbers when numberPattern contains '|', e.g. // (20|3)\d{4}. In those cases we quickly return. // (Though there's no such format in current metadata) /* istanbul ignore if */ if (SUPPORT_LEGACY_FORMATTING_PATTERNS && format.pattern().indexOf('|') >= 0) { return; } // Get formatting template for this phone number format var template = this.getTemplateForFormat(format, state); // If the national number entered is too long // for any phone number format, then abort. if (template) { this.setNationalNumberTemplate(template, state); return true; } } }, { key: "getSeparatorAfterNationalPrefix", value: function getSeparatorAfterNationalPrefix(format) { // `US` metadata doesn't have a `national_prefix_formatting_rule`, // so the `if` condition below doesn't apply to `US`, // but in reality there shoudl be a separator // between a national prefix and a national (significant) number. // So `US` national prefix separator is a "special" "hardcoded" case. if (this.isNANP) { return ' '; } // If a `format` has a `national_prefix_formatting_rule` // and that rule has a separator after a national prefix, // then it means that there should be a separator // between a national prefix and a national (significant) number. if (format && format.nationalPrefixFormattingRule() && NATIONAL_PREFIX_SEPARATORS_PATTERN.test(format.nationalPrefixFormattingRule())) { return ' '; } // At this point, there seems to be no clear evidence that // there should be a separator between a national prefix // and a national (significant) number. So don't insert one. return ''; } }, { key: "getInternationalPrefixBeforeCountryCallingCode", value: function getInternationalPrefixBeforeCountryCallingCode(_ref3, options) { var IDDPrefix = _ref3.IDDPrefix, missingPlus = _ref3.missingPlus; if (IDDPrefix) { return options && options.spacing === false ? IDDPrefix : IDDPrefix + ' '; } if (missingPlus) { return ''; } return '+'; } }, { key: "getTemplate", value: function getTemplate(state) { if (!this.template) { return; } // `this.template` holds the template for a "complete" phone number. // The currently entered phone number is most likely not "complete", // so trim all non-populated digits. var index = -1; var i = 0; var internationalPrefix = state.international ? this.getInternationalPrefixBeforeCountryCallingCode(state, { spacing: false }) : ''; while (i < internationalPrefix.length + state.getDigitsWithoutInternationalPrefix().length) { index = this.template.indexOf(_AsYouTypeFormatterUtil.DIGIT_PLACEHOLDER, index + 1); i++; } return (0, _AsYouTypeFormatterUtil.cutAndStripNonPairedParens)(this.template, index + 1); } }, { key: "setNationalNumberTemplate", value: function setNationalNumberTemplate(template, state) { this.nationalNumberTemplate = template; this.populatedNationalNumberTemplate = template; // With a new formatting template, the matched position // using the old template needs to be reset. this.populatedNationalNumberTemplatePosition = -1; // For convenience, the public `.template` property // contains the whole international number // if the phone number being input is international: // 'x' for the '+' sign, 'x'es for the country phone code, // a spacebar and then the template for the formatted national number. if (state.international) { this.template = this.getInternationalPrefixBeforeCountryCallingCode(state).replace(/[\d\+]/g, _AsYouTypeFormatterUtil.DIGIT_PLACEHOLDER) + (0, _AsYouTypeFormatterUtil.repeat)(_AsYouTypeFormatterUtil.DIGIT_PLACEHOLDER, state.callingCode.length) + ' ' + template; } else { this.template = template; } } /** * Generates formatting template for a national phone number, * optionally containing a national prefix, for a format. * @param {Format} format * @param {string} nationalPrefix * @return {string} */ }, { key: "getTemplateForFormat", value: function getTemplateForFormat(format, _ref4) { var nationalSignificantNumber = _ref4.nationalSignificantNumber, international = _ref4.international, nationalPrefix = _ref4.nationalPrefix, complexPrefixBeforeNationalSignificantNumber = _ref4.complexPrefixBeforeNationalSignificantNumber; var pattern = format.pattern(); /* istanbul ignore else */ if (SUPPORT_LEGACY_FORMATTING_PATTERNS) { pattern = pattern // Replace anything in the form of [..] with \d .replace(CREATE_CHARACTER_CLASS_PATTERN(), '\\d') // Replace any standalone digit (not the one in `{}`) with \d .replace(CREATE_STANDALONE_DIGIT_PATTERN(), '\\d'); } // Generate a dummy national number (consisting of `9`s) // that fits this format's `pattern`. // // This match will always succeed, // because the "longest dummy phone number" // has enough length to accomodate any possible // national phone number format pattern. // var digits = LONGEST_DUMMY_PHONE_NUMBER.match(pattern)[0]; // If the national number entered is too long // for any phone number format, then abort. if (nationalSignificantNumber.length > digits.length) { return; } // Get a formatting template which can be used to efficiently format // a partial number where digits are added one by one. // Below `strictPattern` is used for the // regular expression (with `^` and `$`). // This wasn't originally in Google's `libphonenumber` // and I guess they don't really need it // because they're not using "templates" to format phone numbers // but I added `strictPattern` after encountering // South Korean phone number formatting bug. // // Non-strict regular expression bug demonstration: // // this.nationalSignificantNumber : `111111111` (9 digits) // // pattern : (\d{2})(\d{3,4})(\d{4}) // format : `$1 $2 $3` // digits : `9999999999` (10 digits) // // '9999999999'.replace(new RegExp(/(\d{2})(\d{3,4})(\d{4})/g), '$1 $2 $3') = "99 9999 9999" // // template : xx xxxx xxxx // // But the correct template in this case is `xx xxx xxxx`. // The template was generated incorrectly because of the // `{3,4}` variability in the `pattern`. // // The fix is, if `this.nationalSignificantNumber` has already sufficient length // to satisfy the `pattern` completely then `this.nationalSignificantNumber` // is used instead of `digits`. var strictPattern = new RegExp('^' + pattern + '$'); var nationalNumberDummyDigits = nationalSignificantNumber.replace(/\d/g, DUMMY_DIGIT); // If `this.nationalSignificantNumber` has already sufficient length // to satisfy the `pattern` completely then use it // instead of `digits`. if (strictPattern.test(nationalNumberDummyDigits)) { digits = nationalNumberDummyDigits; } var numberFormat = this.getFormatFormat(format, international); var nationalPrefixIncludedInTemplate; // If a user did input a national prefix (and that's guaranteed), // and if a `format` does have a national prefix formatting rule, // then see if that national prefix formatting rule // prepends exactly the same national prefix the user has input. // If that's the case, then use the `format` with the national prefix formatting rule. // Otherwise, use the `format` without the national prefix formatting rule, // and prepend a national prefix manually to it. if (this.shouldTryNationalPrefixFormattingRule(format, { international: international, nationalPrefix: nationalPrefix })) { var numberFormatWithNationalPrefix = numberFormat.replace(_formatNationalNumberUsingFormat.FIRST_GROUP_PATTERN, format.nationalPrefixFormattingRule()); // If `national_prefix_formatting_rule` of a `format` simply prepends // national prefix at the start of a national (significant) number, // then such formatting can be used with `AsYouType` formatter. // There seems to be no `else` case: everywhere in metadata, // national prefix formatting rule is national prefix + $1, // or `($1)`, in which case such format isn't even considered // when the user has input a national prefix. /* istanbul ignore else */ if ((0, _parseDigits["default"])(format.nationalPrefixFormattingRule()) === (nationalPrefix || '') + (0, _parseDigits["default"])('$1')) { numberFormat = numberFormatWithNationalPrefix; nationalPrefixIncludedInTemplate = true; // Replace all digits of the national prefix in the formatting template // with `DIGIT_PLACEHOLDER`s. if (nationalPrefix) { var i = nationalPrefix.length; while (i > 0) { numberFormat = numberFormat.replace(/\d/, _AsYouTypeFormatterUtil.DIGIT_PLACEHOLDER); i--; } } } } // Generate formatting template for this phone number format. var template = digits // Format the dummy phone number according to the format. .replace(new RegExp(pattern), numberFormat) // Replace each dummy digit with a DIGIT_PLACEHOLDER. .replace(new RegExp(DUMMY_DIGIT, 'g'), _AsYouTypeFormatterUtil.DIGIT_PLACEHOLDER); // If a prefix of a national (significant) number is not as simple // as just a basic national prefix, then just prepend such prefix // before the national (significant) number, optionally spacing // the two with a whitespace. if (!nationalPrefixIncludedInTemplate) { if (complexPrefixBeforeNationalSignificantNumber) { // Prepend the prefix to the template manually. template = (0, _AsYouTypeFormatterUtil.repeat)(_AsYouTypeFormatterUtil.DIGIT_PLACEHOLDER, complexPrefixBeforeNationalSignificantNumber.length) + ' ' + template; } else if (nationalPrefix) { // Prepend national prefix to the template manually. template = (0, _AsYouTypeFormatterUtil.repeat)(_AsYouTypeFormatterUtil.DIGIT_PLACEHOLDER, nationalPrefix.length) + this.getSeparatorAfterNationalPrefix(format) + template; } } if (international) { template = (0, _applyInternationalSeparatorStyle["default"])(template); } return template; } }, { key: "formatNextNationalNumberDigits", value: function formatNextNationalNumberDigits(digits) { var result = (0, _AsYouTypeFormatterUtil.populateTemplateWithDigits)(this.populatedNationalNumberTemplate, this.populatedNationalNumberTemplatePosition, digits); if (!result) { // Reset the format. this.resetFormat(); return; } this.populatedNationalNumberTemplate = result[0]; this.populatedNationalNumberTemplatePosition = result[1]; // Return the formatted phone number so far. return (0, _AsYouTypeFormatterUtil.cutAndStripNonPairedParens)(this.populatedNationalNumberTemplate, this.populatedNationalNumberTemplatePosition + 1); // The old way which was good for `input-format` but is not so good // for `react-phone-number-input`'s default input (`InputBasic`). // return closeNonPairedParens(this.populatedNationalNumberTemplate, this.populatedNationalNumberTemplatePosition + 1) // .replace(new RegExp(DIGIT_PLACEHOLDER, 'g'), ' ') } }, { key: "shouldTryNationalPrefixFormattingRule", value: function shouldTryNationalPrefixFormattingRule(format, _ref5) { var international = _ref5.international, nationalPrefix = _ref5.nationalPrefix; if (format.nationalPrefixFormattingRule()) { // In some countries, `national_prefix_formatting_rule` is `($1)`, // so it applies even if the user hasn't input a national prefix. // `format.usesNationalPrefix()` detects such cases. var usesNationalPrefix = format.usesNationalPrefix(); if (usesNationalPrefix && nationalPrefix || !usesNationalPrefix && !international) { return true; } } } }]); return AsYouTypeFormatter; }(); exports["default"] = AsYouTypeFormatter; //# sourceMappingURL=AsYouTypeFormatter.js.map /***/ }), /***/ "./node_modules/libphonenumber-js/build/AsYouTypeFormatter.util.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.DIGIT_PLACEHOLDER = void 0; exports.closeNonPairedParens = closeNonPairedParens; exports.countOccurences = countOccurences; exports.cutAndStripNonPairedParens = cutAndStripNonPairedParens; exports.populateTemplateWithDigits = populateTemplateWithDigits; exports.repeat = repeat; exports.stripNonPairedParens = stripNonPairedParens; function _createForOfIteratorHelperLoose(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (it) return (it = it.call(o)).next.bind(it); if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } // Should be the same as `DIGIT_PLACEHOLDER` in `libphonenumber-metadata-generator`. var DIGIT_PLACEHOLDER = 'x'; // '\u2008' (punctuation space) exports.DIGIT_PLACEHOLDER = DIGIT_PLACEHOLDER; var DIGIT_PLACEHOLDER_MATCHER = new RegExp(DIGIT_PLACEHOLDER); // Counts all occurences of a symbol in a string. // Unicode-unsafe (because using `.split()`). function countOccurences(symbol, string) { var count = 0; // Using `.split('')` to iterate through a string here // to avoid requiring `Symbol.iterator` polyfill. // `.split('')` is generally not safe for Unicode, // but in this particular case for counting brackets it is safe. // for (const character of string) for (var _iterator = _createForOfIteratorHelperLoose(string.split('')), _step; !(_step = _iterator()).done;) { var character = _step.value; if (character === symbol) { count++; } } return count; } // Repeats a string (or a symbol) N times. // http://stackoverflow.com/questions/202605/repeat-string-javascript function repeat(string, times) { if (times < 1) { return ''; } var result = ''; while (times > 1) { if (times & 1) { result += string; } times >>= 1; string += string; } return result + string; } function cutAndStripNonPairedParens(string, cutBeforeIndex) { if (string[cutBeforeIndex] === ')') { cutBeforeIndex++; } return stripNonPairedParens(string.slice(0, cutBeforeIndex)); } function closeNonPairedParens(template, cut_before) { var retained_template = template.slice(0, cut_before); var opening_braces = countOccurences('(', retained_template); var closing_braces = countOccurences(')', retained_template); var dangling_braces = opening_braces - closing_braces; while (dangling_braces > 0 && cut_before < template.length) { if (template[cut_before] === ')') { dangling_braces--; } cut_before++; } return template.slice(0, cut_before); } function stripNonPairedParens(string) { var dangling_braces = []; var i = 0; while (i < string.length) { if (string[i] === '(') { dangling_braces.push(i); } else if (string[i] === ')') { dangling_braces.pop(); } i++; } var start = 0; var cleared_string = ''; dangling_braces.push(string.length); for (var _i = 0, _dangling_braces = dangling_braces; _i < _dangling_braces.length; _i++) { var index = _dangling_braces[_i]; cleared_string += string.slice(start, index); start = index + 1; } return cleared_string; } function populateTemplateWithDigits(template, position, digits) { // Using `.split('')` to iterate through a string here // to avoid requiring `Symbol.iterator` polyfill. // `.split('')` is generally not safe for Unicode, // but in this particular case for `digits` it is safe. // for (const digit of digits) for (var _iterator2 = _createForOfIteratorHelperLoose(digits.split('')), _step2; !(_step2 = _iterator2()).done;) { var digit = _step2.value; // If there is room for more digits in current `template`, // then set the next digit in the `template`, // and return the formatted digits so far. // If more digits are entered than the current format could handle. if (template.slice(position + 1).search(DIGIT_PLACEHOLDER_MATCHER) < 0) { return; } position = template.search(DIGIT_PLACEHOLDER_MATCHER); template = template.replace(DIGIT_PLACEHOLDER_MATCHER, digit); } return [template, position]; } //# sourceMappingURL=AsYouTypeFormatter.util.js.map /***/ }), /***/ "./node_modules/libphonenumber-js/build/AsYouTypeParser.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports["default"] = void 0; exports.extractFormattedDigitsAndPlus = extractFormattedDigitsAndPlus; var _extractCountryCallingCode2 = _interopRequireDefault(__webpack_require__("./node_modules/libphonenumber-js/build/helpers/extractCountryCallingCode.js")); var _extractCountryCallingCodeFromInternationalNumberWithoutPlusSign = _interopRequireDefault(__webpack_require__("./node_modules/libphonenumber-js/build/helpers/extractCountryCallingCodeFromInternationalNumberWithoutPlusSign.js")); var _extractNationalNumberFromPossiblyIncompleteNumber = _interopRequireDefault(__webpack_require__("./node_modules/libphonenumber-js/build/helpers/extractNationalNumberFromPossiblyIncompleteNumber.js")); var _stripIddPrefix = _interopRequireDefault(__webpack_require__("./node_modules/libphonenumber-js/build/helpers/stripIddPrefix.js")); var _parseDigits = _interopRequireDefault(__webpack_require__("./node_modules/libphonenumber-js/build/helpers/parseDigits.js")); var _constants = __webpack_require__("./node_modules/libphonenumber-js/build/constants.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } var VALID_FORMATTED_PHONE_NUMBER_DIGITS_PART = '[' + _constants.VALID_PUNCTUATION + _constants.VALID_DIGITS + ']+'; var VALID_FORMATTED_PHONE_NUMBER_DIGITS_PART_PATTERN = new RegExp('^' + VALID_FORMATTED_PHONE_NUMBER_DIGITS_PART + '$', 'i'); var VALID_FORMATTED_PHONE_NUMBER_PART = '(?:' + '[' + _constants.PLUS_CHARS + ']' + '[' + _constants.VALID_PUNCTUATION + _constants.VALID_DIGITS + ']*' + '|' + '[' + _constants.VALID_PUNCTUATION + _constants.VALID_DIGITS + ']+' + ')'; var AFTER_PHONE_NUMBER_DIGITS_END_PATTERN = new RegExp('[^' + _constants.VALID_PUNCTUATION + _constants.VALID_DIGITS + ']+' + '.*' + '$'); // Tests whether `national_prefix_for_parsing` could match // different national prefixes. // Matches anything that's not a digit or a square bracket. var COMPLEX_NATIONAL_PREFIX = /[^\d\[\]]/; var AsYouTypeParser = /*#__PURE__*/function () { function AsYouTypeParser(_ref) { var defaultCountry = _ref.defaultCountry, defaultCallingCode = _ref.defaultCallingCode, metadata = _ref.metadata, onNationalSignificantNumberChange = _ref.onNationalSignificantNumberChange; _classCallCheck(this, AsYouTypeParser); this.defaultCountry = defaultCountry; this.defaultCallingCode = defaultCallingCode; this.metadata = metadata; this.onNationalSignificantNumberChange = onNationalSignificantNumberChange; } _createClass(AsYouTypeParser, [{ key: "input", value: function input(text, state) { var _extractFormattedDigi = extractFormattedDigitsAndPlus(text), _extractFormattedDigi2 = _slicedToArray(_extractFormattedDigi, 2), formattedDigits = _extractFormattedDigi2[0], hasPlus = _extractFormattedDigi2[1]; var digits = (0, _parseDigits["default"])(formattedDigits); // Checks for a special case: just a leading `+` has been entered. var justLeadingPlus; if (hasPlus) { if (!state.digits) { state.startInternationalNumber(); if (!digits) { justLeadingPlus = true; } } } if (digits) { this.inputDigits(digits, state); } return { digits: digits, justLeadingPlus: justLeadingPlus }; } /** * Inputs "next" phone number digits. * @param {string} digits * @return {string} [formattedNumber] Formatted national phone number (if it can be formatted at this stage). Returning `undefined` means "don't format the national phone number at this stage". */ }, { key: "inputDigits", value: function inputDigits(nextDigits, state) { var digits = state.digits; var hasReceivedThreeLeadingDigits = digits.length < 3 && digits.length + nextDigits.length >= 3; // Append phone number digits. state.appendDigits(nextDigits); // Attempt to extract IDD prefix: // Some users input their phone number in international format, // but in an "out-of-country" dialing format instead of using the leading `+`. // https://github.com/catamphetamine/libphonenumber-js/issues/185 // Detect such numbers as soon as there're at least 3 digits. // Google's library attempts to extract IDD prefix at 3 digits, // so this library just copies that behavior. // I guess that's because the most commot IDD prefixes are // `00` (Europe) and `011` (US). // There exist really long IDD prefixes too: // for example, in Australia the default IDD prefix is `0011`, // and it could even be as long as `14880011`. // An IDD prefix is extracted here, and then every time when // there's a new digit and the number couldn't be formatted. if (hasReceivedThreeLeadingDigits) { this.extractIddPrefix(state); } if (this.isWaitingForCountryCallingCode(state)) { if (!this.extractCountryCallingCode(state)) { return; } } else { state.appendNationalSignificantNumberDigits(nextDigits); } // If a phone number is being input in international format, // then it's not valid for it to have a national prefix. // Still, some people incorrectly input such numbers with a national prefix. // In such cases, only attempt to strip a national prefix if the number becomes too long. // (but that is done later, not here) if (!state.international) { if (!this.hasExtractedNationalSignificantNumber) { this.extractNationalSignificantNumber(state.getNationalDigits(), function (stateUpdate) { return state.update(stateUpdate); }); } } } }, { key: "isWaitingForCountryCallingCode", value: function isWaitingForCountryCallingCode(_ref2) { var international = _ref2.international, callingCode = _ref2.callingCode; return international && !callingCode; } // Extracts a country calling code from a number // being entered in internatonal format. }, { key: "extractCountryCallingCode", value: function extractCountryCallingCode(state) { var _extractCountryCallin = (0, _extractCountryCallingCode2["default"])('+' + state.getDigitsWithoutInternationalPrefix(), this.defaultCountry, this.defaultCallingCode, this.metadata.metadata), countryCallingCode = _extractCountryCallin.countryCallingCode, number = _extractCountryCallin.number; if (countryCallingCode) { state.setCallingCode(countryCallingCode); state.update({ nationalSignificantNumber: number }); return true; } } }, { key: "reset", value: function reset(numberingPlan) { if (numberingPlan) { this.hasSelectedNumberingPlan = true; var nationalPrefixForParsing = numberingPlan._nationalPrefixForParsing(); this.couldPossiblyExtractAnotherNationalSignificantNumber = nationalPrefixForParsing && COMPLEX_NATIONAL_PREFIX.test(nationalPrefixForParsing); } else { this.hasSelectedNumberingPlan = undefined; this.couldPossiblyExtractAnotherNationalSignificantNumber = undefined; } } /** * Extracts a national (significant) number from user input. * Google's library is different in that it only applies `national_prefix_for_parsing` * and doesn't apply `national_prefix_transform_rule` after that. * https://github.com/google/libphonenumber/blob/a3d70b0487875475e6ad659af404943211d26456/java/libphonenumber/src/com/google/i18n/phonenumbers/AsYouTypeFormatter.java#L539 * @return {boolean} [extracted] */ }, { key: "extractNationalSignificantNumber", value: function extractNationalSignificantNumber(nationalDigits, setState) { if (!this.hasSelectedNumberingPlan) { return; } var _extractNationalNumbe = (0, _extractNationalNumberFromPossiblyIncompleteNumber["default"])(nationalDigits, this.metadata), nationalPrefix = _extractNationalNumbe.nationalPrefix, nationalNumber = _extractNationalNumbe.nationalNumber, carrierCode = _extractNationalNumbe.carrierCode; if (nationalNumber === nationalDigits) { return; } this.onExtractedNationalNumber(nationalPrefix, carrierCode, nationalNumber, nationalDigits, setState); return true; } /** * In Google's code this function is called "attempt to extract longer NDD". * "Some national prefixes are a substring of others", they say. * @return {boolean} [result] — Returns `true` if extracting a national prefix produced different results from what they were. */ }, { key: "extractAnotherNationalSignificantNumber", value: function extractAnotherNationalSignificantNumber(nationalDigits, prevNationalSignificantNumber, setState) { if (!this.hasExtractedNationalSignificantNumber) { return this.extractNationalSignificantNumber(nationalDigits, setState); } if (!this.couldPossiblyExtractAnotherNationalSignificantNumber) { return; } var _extractNationalNumbe2 = (0, _extractNationalNumberFromPossiblyIncompleteNumber["default"])(nationalDigits, this.metadata), nationalPrefix = _extractNationalNumbe2.nationalPrefix, nationalNumber = _extractNationalNumbe2.nationalNumber, carrierCode = _extractNationalNumbe2.carrierCode; // If a national prefix has been extracted previously, // then it's always extracted as additional digits are added. // That's assuming `extractNationalNumberFromPossiblyIncompleteNumber()` // doesn't do anything different from what it currently does. // So, just in case, here's this check, though it doesn't occur. /* istanbul ignore if */ if (nationalNumber === prevNationalSignificantNumber) { return; } this.onExtractedNationalNumber(nationalPrefix, carrierCode, nationalNumber, nationalDigits, setState); return true; } }, { key: "onExtractedNationalNumber", value: function onExtractedNationalNumber(nationalPrefix, carrierCode, nationalSignificantNumber, nationalDigits, setState) { var complexPrefixBeforeNationalSignificantNumber; var nationalSignificantNumberMatchesInput; // This check also works with empty `this.nationalSignificantNumber`. var nationalSignificantNumberIndex = nationalDigits.lastIndexOf(nationalSignificantNumber); // If the extracted national (significant) number is the // last substring of the `digits`, then it means that it hasn't been altered: // no digits have been removed from the national (significant) number // while applying `national_prefix_transform_rule`. // https://gitlab.com/catamphetamine/libphonenumber-js/-/blob/master/METADATA.md#national_prefix_for_parsing--national_prefix_transform_rule if (nationalSignificantNumberIndex >= 0 && nationalSignificantNumberIndex === nationalDigits.length - nationalSignificantNumber.length) { nationalSignificantNumberMatchesInput = true; // If a prefix of a national (significant) number is not as simple // as just a basic national prefix, then such prefix is stored in // `this.complexPrefixBeforeNationalSignificantNumber` property and will be // prepended "as is" to the national (significant) number to produce // a formatted result. var prefixBeforeNationalNumber = nationalDigits.slice(0, nationalSignificantNumberIndex); // `prefixBeforeNationalNumber` is always non-empty, // because `onExtractedNationalNumber()` isn't called // when a national (significant) number hasn't been actually "extracted": // when a national (significant) number is equal to the national part of `digits`, // then `onExtractedNationalNumber()` doesn't get called. if (prefixBeforeNationalNumber !== nationalPrefix) { complexPrefixBeforeNationalSignificantNumber = prefixBeforeNationalNumber; } } setState({ nationalPrefix: nationalPrefix, carrierCode: carrierCode, nationalSignificantNumber: nationalSignificantNumber, nationalSignificantNumberMatchesInput: nationalSignificantNumberMatchesInput, complexPrefixBeforeNationalSignificantNumber: complexPrefixBeforeNationalSignificantNumber }); // `onExtractedNationalNumber()` is only called when // the national (significant) number actually did change. this.hasExtractedNationalSignificantNumber = true; this.onNationalSignificantNumberChange(); } }, { key: "reExtractNationalSignificantNumber", value: function reExtractNationalSignificantNumber(state) { // Attempt to extract a national prefix. // // Some people incorrectly input national prefix // in an international phone number. // For example, some people write British phone numbers as `+44(0)...`. // // Also, in some rare cases, it is valid for a national prefix // to be a part of an international phone number. // For example, mobile phone numbers in Mexico are supposed to be // dialled internationally using a `1` national prefix, // so the national prefix will be part of an international number. // // Quote from: // https://www.mexperience.com/dialing-cell-phones-in-mexico/ // // "Dialing a Mexican cell phone from abroad // When you are calling a cell phone number in Mexico from outside Mexico, // it’s necessary to dial an additional “1” after Mexico’s country code // (which is “52”) and before the area code. // You also ignore the 045, and simply dial the area code and the // cell phone’s number. // // If you don’t add the “1”, you’ll receive a recorded announcement // asking you to redial using it. // // For example, if you are calling from the USA to a cell phone // in Mexico City, you would dial +52 – 1 – 55 – 1234 5678. // (Note that this is different to calling a land line in Mexico City // from abroad, where the number dialed would be +52 – 55 – 1234 5678)". // // Google's demo output: // https://libphonenumber.appspot.com/phonenumberparser?number=%2b5215512345678&country=MX // if (this.extractAnotherNationalSignificantNumber(state.getNationalDigits(), state.nationalSignificantNumber, function (stateUpdate) { return state.update(stateUpdate); })) { return true; } // If no format matches the phone number, then it could be // "a really long IDD" (quote from a comment in Google's library). // An IDD prefix is first extracted when the user has entered at least 3 digits, // and then here — every time when there's a new digit and the number // couldn't be formatted. // For example, in Australia the default IDD prefix is `0011`, // and it could even be as long as `14880011`. // // Could also check `!hasReceivedThreeLeadingDigits` here // to filter out the case when this check duplicates the one // already performed when there're 3 leading digits, // but it's not a big deal, and in most cases there // will be a suitable `format` when there're 3 leading digits. // if (this.extractIddPrefix(state)) { this.extractCallingCodeAndNationalSignificantNumber(state); return true; } // Google's AsYouType formatter supports sort of an "autocorrection" feature // when it "autocorrects" numbers that have been input for a country // with that country's calling code. // Such "autocorrection" feature looks weird, but different people have been requesting it: // https://github.com/catamphetamine/libphonenumber-js/issues/376 // https://github.com/catamphetamine/libphonenumber-js/issues/375 // https://github.com/catamphetamine/libphonenumber-js/issues/316 if (this.fixMissingPlus(state)) { this.extractCallingCodeAndNationalSignificantNumber(state); return true; } } }, { key: "extractIddPrefix", value: function extractIddPrefix(state) { // An IDD prefix can't be present in a number written with a `+`. // Also, don't re-extract an IDD prefix if has already been extracted. var international = state.international, IDDPrefix = state.IDDPrefix, digits = state.digits, nationalSignificantNumber = state.nationalSignificantNumber; if (international || IDDPrefix) { return; } // Some users input their phone number in "out-of-country" // dialing format instead of using the leading `+`. // https://github.com/catamphetamine/libphonenumber-js/issues/185 // Detect such numbers. var numberWithoutIDD = (0, _stripIddPrefix["default"])(digits, this.defaultCountry, this.defaultCallingCode, this.metadata.metadata); if (numberWithoutIDD !== undefined && numberWithoutIDD !== digits) { // If an IDD prefix was stripped then convert the IDD-prefixed number // to international number for subsequent parsing. state.update({ IDDPrefix: digits.slice(0, digits.length - numberWithoutIDD.length) }); this.startInternationalNumber(state); return true; } } }, { key: "fixMissingPlus", value: function fixMissingPlus(state) { if (!state.international) { var _extractCountryCallin2 = (0, _extractCountryCallingCodeFromInternationalNumberWithoutPlusSign["default"])(state.digits, this.defaultCountry, this.defaultCallingCode, this.metadata.metadata), newCallingCode = _extractCountryCallin2.countryCallingCode, number = _extractCountryCallin2.number; if (newCallingCode) { state.update({ missingPlus: true }); this.startInternationalNumber(state); return true; } } } }, { key: "startInternationalNumber", value: function startInternationalNumber(state) { state.startInternationalNumber(); // If a national (significant) number has been extracted before, reset it. if (state.nationalSignificantNumber) { state.resetNationalSignificantNumber(); this.onNationalSignificantNumberChange(); this.hasExtractedNationalSignificantNumber = undefined; } } }, { key: "extractCallingCodeAndNationalSignificantNumber", value: function extractCallingCodeAndNationalSignificantNumber(state) { if (this.extractCountryCallingCode(state)) { // `this.extractCallingCode()` is currently called when the number // couldn't be formatted during the standard procedure. // Normally, the national prefix would be re-extracted // for an international number if such number couldn't be formatted, // but since it's already not able to be formatted, // there won't be yet another retry, so also extract national prefix here. this.extractNationalSignificantNumber(state.getNationalDigits(), function (stateUpdate) { return state.update(stateUpdate); }); } } }]); return AsYouTypeParser; }(); /** * Extracts formatted phone number from text (if there's any). * @param {string} text * @return {string} [formattedPhoneNumber] */ exports["default"] = AsYouTypeParser; function extractFormattedPhoneNumber(text) { // Attempt to extract a possible number from the string passed in. var startsAt = text.search(VALID_FORMATTED_PHONE_NUMBER_PART); if (startsAt < 0) { return; } // Trim everything to the left of the phone number. text = text.slice(startsAt); // Trim the `+`. var hasPlus; if (text[0] === '+') { hasPlus = true; text = text.slice('+'.length); } // Trim everything to the right of the phone number. text = text.replace(AFTER_PHONE_NUMBER_DIGITS_END_PATTERN, ''); // Re-add the previously trimmed `+`. if (hasPlus) { text = '+' + text; } return text; } /** * Extracts formatted phone number digits (and a `+`) from text (if there're any). * @param {string} text * @return {any[]} */ function _extractFormattedDigitsAndPlus(text) { // Extract a formatted phone number part from text. var extractedNumber = extractFormattedPhoneNumber(text) || ''; // Trim a `+`. if (extractedNumber[0] === '+') { return [extractedNumber.slice('+'.length), true]; } return [extractedNumber]; } /** * Extracts formatted phone number digits (and a `+`) from text (if there're any). * @param {string} text * @return {any[]} */ function extractFormattedDigitsAndPlus(text) { var _extractFormattedDigi3 = _extractFormattedDigitsAndPlus(text), _extractFormattedDigi4 = _slicedToArray(_extractFormattedDigi3, 2), formattedDigits = _extractFormattedDigi4[0], hasPlus = _extractFormattedDigi4[1]; // If the extracted phone number part // can possibly be a part of some valid phone number // then parse phone number characters from a formatted phone number. if (!VALID_FORMATTED_PHONE_NUMBER_DIGITS_PART_PATTERN.test(formattedDigits)) { formattedDigits = ''; } return [formattedDigits, hasPlus]; } //# sourceMappingURL=AsYouTypeParser.js.map /***/ }), /***/ "./node_modules/libphonenumber-js/build/AsYouTypeState.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports["default"] = void 0; function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } var AsYouTypeState = /*#__PURE__*/function () { function AsYouTypeState(_ref) { var onCountryChange = _ref.onCountryChange, onCallingCodeChange = _ref.onCallingCodeChange; _classCallCheck(this, AsYouTypeState); this.onCountryChange = onCountryChange; this.onCallingCodeChange = onCallingCodeChange; } _createClass(AsYouTypeState, [{ key: "reset", value: function reset(defaultCountry, defaultCallingCode) { this.international = false; this.IDDPrefix = undefined; this.missingPlus = undefined; this.callingCode = undefined; this.digits = ''; this.resetNationalSignificantNumber(); this.initCountryAndCallingCode(defaultCountry, defaultCallingCode); } }, { key: "resetNationalSignificantNumber", value: function resetNationalSignificantNumber() { this.nationalSignificantNumber = this.getNationalDigits(); this.nationalSignificantNumberMatchesInput = true; this.nationalPrefix = undefined; this.carrierCode = undefined; this.complexPrefixBeforeNationalSignificantNumber = undefined; } }, { key: "update", value: function update(properties) { for (var _i = 0, _Object$keys = Object.keys(properties); _i < _Object$keys.length; _i++) { var key = _Object$keys[_i]; this[key] = properties[key]; } } }, { key: "initCountryAndCallingCode", value: function initCountryAndCallingCode(country, callingCode) { this.setCountry(country); this.setCallingCode(callingCode); } }, { key: "setCountry", value: function setCountry(country) { this.country = country; this.onCountryChange(country); } }, { key: "setCallingCode", value: function setCallingCode(callingCode) { this.callingCode = callingCode; return this.onCallingCodeChange(this.country, callingCode); } }, { key: "startInternationalNumber", value: function startInternationalNumber() { // Prepend the `+` to parsed input. this.international = true; // If a default country was set then reset it // because an explicitly international phone // number is being entered. this.initCountryAndCallingCode(); } }, { key: "appendDigits", value: function appendDigits(nextDigits) { this.digits += nextDigits; } }, { key: "appendNationalSignificantNumberDigits", value: function appendNationalSignificantNumberDigits(nextDigits) { this.nationalSignificantNumber += nextDigits; } /** * Returns the part of `this.digits` that corresponds to the national number. * Basically, all digits that have been input by the user, except for the * international prefix and the country calling code part * (if the number is an international one). * @return {string} */ }, { key: "getNationalDigits", value: function getNationalDigits() { if (this.international) { return this.digits.slice((this.IDDPrefix ? this.IDDPrefix.length : 0) + (this.callingCode ? this.callingCode.length : 0)); } return this.digits; } }, { key: "getDigitsWithoutInternationalPrefix", value: function getDigitsWithoutInternationalPrefix() { if (this.international) { if (this.IDDPrefix) { return this.digits.slice(this.IDDPrefix.length); } } return this.digits; } }]); return AsYouTypeState; }(); exports["default"] = AsYouTypeState; //# sourceMappingURL=AsYouTypeState.js.map /***/ }), /***/ "./node_modules/libphonenumber-js/build/ParseError.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } Object.defineProperty(exports, "__esModule", { value: true }); exports["default"] = void 0; function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); } function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _wrapNativeSuper(Class) { var _cache = typeof Map === "function" ? new Map() : undefined; _wrapNativeSuper = function _wrapNativeSuper(Class) { if (Class === null || !_isNativeFunction(Class)) return Class; if (typeof Class !== "function") { throw new TypeError("Super expression must either be null or a function"); } if (typeof _cache !== "undefined") { if (_cache.has(Class)) return _cache.get(Class); _cache.set(Class, Wrapper); } function Wrapper() { return _construct(Class, arguments, _getPrototypeOf(this).constructor); } Wrapper.prototype = Object.create(Class.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } }); return _setPrototypeOf(Wrapper, Class); }; return _wrapNativeSuper(Class); } function _construct(Parent, args, Class) { if (_isNativeReflectConstruct()) { _construct = Reflect.construct; } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); } function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } function _isNativeFunction(fn) { return Function.toString.call(fn).indexOf("[native code]") !== -1; } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } // https://stackoverflow.com/a/46971044/970769 // "Breaking changes in Typescript 2.1" // "Extending built-ins like Error, Array, and Map may no longer work." // "As a recommendation, you can manually adjust the prototype immediately after any super(...) calls." // https://github.com/Microsoft/TypeScript-wiki/blob/main/Breaking-Changes.md#extending-built-ins-like-error-array-and-map-may-no-longer-work var ParseError = /*#__PURE__*/function (_Error) { _inherits(ParseError, _Error); var _super = _createSuper(ParseError); function ParseError(code) { var _this; _classCallCheck(this, ParseError); _this = _super.call(this, code); // Set the prototype explicitly. // Any subclass of FooError will have to manually set the prototype as well. Object.setPrototypeOf(_assertThisInitialized(_this), ParseError.prototype); _this.name = _this.constructor.name; return _this; } return _createClass(ParseError); }( /*#__PURE__*/_wrapNativeSuper(Error)); exports["default"] = ParseError; //# sourceMappingURL=ParseError.js.map /***/ }), /***/ "./node_modules/libphonenumber-js/build/PhoneNumber.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports["default"] = void 0; var _metadata2 = _interopRequireDefault(__webpack_require__("./node_modules/libphonenumber-js/build/metadata.js")); var _isPossibleNumber_ = _interopRequireDefault(__webpack_require__("./node_modules/libphonenumber-js/build/isPossibleNumber_.js")); var _validate_ = _interopRequireDefault(__webpack_require__("./node_modules/libphonenumber-js/build/validate_.js")); var _isValidNumberForRegion_ = _interopRequireDefault(__webpack_require__("./node_modules/libphonenumber-js/build/isValidNumberForRegion_.js")); var _getNumberType = _interopRequireDefault(__webpack_require__("./node_modules/libphonenumber-js/build/helpers/getNumberType.js")); var _format_ = _interopRequireDefault(__webpack_require__("./node_modules/libphonenumber-js/build/format_.js")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } var USE_NON_GEOGRAPHIC_COUNTRY_CODE = false; var PhoneNumber = /*#__PURE__*/function () { function PhoneNumber(countryCallingCode, nationalNumber, metadata) { _classCallCheck(this, PhoneNumber); if (!countryCallingCode) { throw new TypeError('`country` or `countryCallingCode` not passed'); } if (!nationalNumber) { throw new TypeError('`nationalNumber` not passed'); } if (!metadata) { throw new TypeError('`metadata` not passed'); } var _metadata = new _metadata2["default"](metadata); // If country code is passed then derive `countryCallingCode` from it. // Also store the country code as `.country`. if (isCountryCode(countryCallingCode)) { this.country = countryCallingCode; _metadata.country(countryCallingCode); countryCallingCode = _metadata.countryCallingCode(); } else { /* istanbul ignore if */ if (USE_NON_GEOGRAPHIC_COUNTRY_CODE) { if (_metadata.isNonGeographicCallingCode(countryCallingCode)) { this.country = '001'; } } } this.countryCallingCode = countryCallingCode; this.nationalNumber = nationalNumber; this.number = '+' + this.countryCallingCode + this.nationalNumber; this.metadata = metadata; } _createClass(PhoneNumber, [{ key: "setExt", value: function setExt(ext) { this.ext = ext; } }, { key: "isPossible", value: function isPossible() { return (0, _isPossibleNumber_["default"])(this, { v2: true }, this.metadata); } }, { key: "isValid", value: function isValid() { return (0, _validate_["default"])(this, { v2: true }, this.metadata); } }, { key: "isNonGeographic", value: function isNonGeographic() { var metadata = new _metadata2["default"](this.metadata); return metadata.isNonGeographicCallingCode(this.countryCallingCode); } }, { key: "isEqual", value: function isEqual(phoneNumber) { return this.number === phoneNumber.number && this.ext === phoneNumber.ext; } // // Is just an alias for `this.isValid() && this.country === country`. // // https://github.com/googlei18n/libphonenumber/blob/master/FAQ.md#when-should-i-use-isvalidnumberforregion // isValidForRegion(country) { // return isValidNumberForRegion(this, country, { v2: true }, this.metadata) // } }, { key: "getType", value: function getType() { return (0, _getNumberType["default"])(this, { v2: true }, this.metadata); } }, { key: "format", value: function format(_format, options) { return (0, _format_["default"])(this, _format, options ? _objectSpread(_objectSpread({}, options), {}, { v2: true }) : { v2: true }, this.metadata); } }, { key: "formatNational", value: function formatNational(options) { return this.format('NATIONAL', options); } }, { key: "formatInternational", value: function formatInternational(options) { return this.format('INTERNATIONAL', options); } }, { key: "getURI", value: function getURI(options) { return this.format('RFC3966', options); } }]); return PhoneNumber; }(); exports["default"] = PhoneNumber; var isCountryCode = function isCountryCode(value) { return /^[A-Z]{2}$/.test(value); }; //# sourceMappingURL=PhoneNumber.js.map /***/ }), /***/ "./node_modules/libphonenumber-js/build/PhoneNumberMatcher.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } Object.defineProperty(exports, "__esModule", { value: true }); exports["default"] = void 0; var _PhoneNumber = _interopRequireDefault(__webpack_require__("./node_modules/libphonenumber-js/build/PhoneNumber.js")); var _constants = __webpack_require__("./node_modules/libphonenumber-js/build/constants.js"); var _createExtensionPattern = _interopRequireDefault(__webpack_require__("./node_modules/libphonenumber-js/build/helpers/extension/createExtensionPattern.js")); var _RegExpCache = _interopRequireDefault(__webpack_require__("./node_modules/libphonenumber-js/build/findNumbers/RegExpCache.js")); var _util = __webpack_require__("./node_modules/libphonenumber-js/build/findNumbers/util.js"); var _utf = __webpack_require__("./node_modules/libphonenumber-js/build/findNumbers/utf-8.js"); var _Leniency = _interopRequireDefault(__webpack_require__("./node_modules/libphonenumber-js/build/findNumbers/Leniency.js")); var _parsePreCandidate = _interopRequireDefault(__webpack_require__("./node_modules/libphonenumber-js/build/findNumbers/parsePreCandidate.js")); var _isValidPreCandidate = _interopRequireDefault(__webpack_require__("./node_modules/libphonenumber-js/build/findNumbers/isValidPreCandidate.js")); var _isValidCandidate = _interopRequireWildcard(__webpack_require__("./node_modules/libphonenumber-js/build/findNumbers/isValidCandidate.js")); var _metadata = __webpack_require__("./node_modules/libphonenumber-js/build/metadata.js"); var _parse_ = _interopRequireDefault(__webpack_require__("./node_modules/libphonenumber-js/build/parse_.js")); function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } function _createForOfIteratorHelperLoose(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (it) return (it = it.call(o)).next.bind(it); if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } var EXTN_PATTERNS_FOR_MATCHING = (0, _createExtensionPattern["default"])('matching'); /** * Patterns used to extract phone numbers from a larger phone-number-like pattern. These are * ordered according to specificity. For example, white-space is last since that is frequently * used in numbers, not just to separate two numbers. We have separate patterns since we don't * want to break up the phone-number-like text on more than one different kind of symbol at one * time, although symbols of the same type (e.g. space) can be safely grouped together. * * Note that if there is a match, we will always check any text found up to the first match as * well. */ var INNER_MATCHES = [// Breaks on the slash - e.g. "651-234-2345/332-445-1234" '\\/+(.*)/', // Note that the bracket here is inside the capturing group, since we consider it part of the // phone number. Will match a pattern like "(650) 223 3345 (754) 223 3321". '(\\([^(]*)', // Breaks on a hyphen - e.g. "12345 - 332-445-1234 is my number." // We require a space on either side of the hyphen for it to be considered a separator. "(?:".concat(_utf.pZ, "-|-").concat(_utf.pZ, ")").concat(_utf.pZ, "*(.+)"), // Various types of wide hyphens. Note we have decided not to enforce a space here, since it's // possible that it's supposed to be used to break two numbers without spaces, and we haven't // seen many instances of it used within a number. "[\u2012-\u2015\uFF0D]".concat(_utf.pZ, "*(.+)"), // Breaks on a full stop - e.g. "12345. 332-445-1234 is my number." "\\.+".concat(_utf.pZ, "*([^.]+)"), // Breaks on space - e.g. "3324451234 8002341234" "".concat(_utf.pZ, "+(").concat(_utf.PZ, "+)")]; // Limit on the number of leading (plus) characters. var leadLimit = (0, _util.limit)(0, 2); // Limit on the number of consecutive punctuation characters. var punctuationLimit = (0, _util.limit)(0, 4); /* The maximum number of digits allowed in a digit-separated block. As we allow all digits in a * single block, set high enough to accommodate the entire national number and the international * country code. */ var digitBlockLimit = _constants.MAX_LENGTH_FOR_NSN + _constants.MAX_LENGTH_COUNTRY_CODE; // Limit on the number of blocks separated by punctuation. // Uses digitBlockLimit since some formats use spaces to separate each digit. var blockLimit = (0, _util.limit)(0, digitBlockLimit); /* A punctuation sequence allowing white space. */ var punctuation = "[".concat(_constants.VALID_PUNCTUATION, "]") + punctuationLimit; // A digits block without punctuation. var digitSequence = _utf.pNd + (0, _util.limit)(1, digitBlockLimit); /** * Phone number pattern allowing optional punctuation. * The phone number pattern used by `find()`, similar to * VALID_PHONE_NUMBER, but with the following differences: *
    *
  • All captures are limited in order to place an upper bound to the text matched by the * pattern. *
      *
    • Leading punctuation / plus signs are limited. *
    • Consecutive occurrences of punctuation are limited. *
    • Number of digits is limited. *
    *
  • No whitespace is allowed at the start or end. *
  • No alpha digits (vanity numbers such as 1-800-SIX-FLAGS) are currently supported. *
*/ var PATTERN = '(?:' + _isValidCandidate.LEAD_CLASS + punctuation + ')' + leadLimit + digitSequence + '(?:' + punctuation + digitSequence + ')' + blockLimit + '(?:' + EXTN_PATTERNS_FOR_MATCHING + ')?'; // Regular expression of trailing characters that we want to remove. // We remove all characters that are not alpha or numerical characters. // The hash character is retained here, as it may signify // the previous block was an extension. // // // Don't know what does '&&' mean here. // const UNWANTED_END_CHAR_PATTERN = new RegExp(`[[\\P{N}&&\\P{L}]&&[^#]]+$`) // var UNWANTED_END_CHAR_PATTERN = new RegExp("[^".concat(_utf._pN).concat(_utf._pL, "#]+$")); var NON_DIGITS_PATTERN = /(\D+)/; var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || Math.pow(2, 53) - 1; /** * A stateful class that finds and extracts telephone numbers from {@linkplain CharSequence text}. * Instances can be created using the {@linkplain PhoneNumberUtil#findNumbers factory methods} in * {@link PhoneNumberUtil}. * *

Vanity numbers (phone numbers using alphabetic digits such as 1-800-SIX-FLAGS are * not found. * *

This class is not thread-safe. */ var PhoneNumberMatcher = /*#__PURE__*/function () { /** * Creates a new instance. See the factory methods in {@link PhoneNumberUtil} on how to obtain a * new instance. * * @param util the phone number util to use * @param text the character sequence that we will search, null for no text * @param country the country to assume for phone numbers not written in international format * (with a leading plus, or with the international dialing prefix of the specified region). * May be null or "ZZ" if only numbers with a leading plus should be * considered. * @param leniency the leniency to use when evaluating candidate phone numbers * @param maxTries the maximum number of invalid numbers to try before giving up on the text. * This is to cover degenerate cases where the text has a lot of false positives in it. Must * be {@code >= 0}. */ function PhoneNumberMatcher() { var text = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; var metadata = arguments.length > 2 ? arguments[2] : undefined; _classCallCheck(this, PhoneNumberMatcher); options = _objectSpread(_objectSpread({}, options), {}, { defaultCallingCode: options.defaultCallingCode, defaultCountry: options.defaultCountry && (0, _metadata.isSupportedCountry)(options.defaultCountry, metadata) ? options.defaultCountry : undefined, leniency: options.leniency || options.extended ? 'POSSIBLE' : 'VALID', maxTries: options.maxTries || MAX_SAFE_INTEGER }); if (!options.leniency) { throw new TypeError('`Leniency` not supplied'); } if (options.maxTries < 0) { throw new TypeError('`maxTries` not supplied'); } this.text = text; this.options = options; this.metadata = metadata; /** The degree of validation requested. */ this.leniency = _Leniency["default"][options.leniency]; if (!this.leniency) { throw new TypeError("Unknown leniency: ".concat(options.leniency, ".")); } /** The maximum number of retries after matching an invalid number. */ this.maxTries = options.maxTries; this.PATTERN = new RegExp(PATTERN, 'ig'); /** The iteration tristate. */ this.state = 'NOT_READY'; /** The next index to start searching at. Undefined in {@link State#DONE}. */ this.searchIndex = 0; // A cache for frequently used country-specific regular expressions. Set to 32 to cover ~2-3 // countries being used for the same doc with ~10 patterns for each country. Some pages will have // a lot more countries in use, but typically fewer numbers for each so expanding the cache for // that use-case won't have a lot of benefit. this.regExpCache = new _RegExpCache["default"](32); } /** * Attempts to find the next subsequence in the searched sequence on or after {@code searchIndex} * that represents a phone number. Returns the next match, null if none was found. * * @param index the search index to start searching at * @return the phone number match found, null if none can be found */ _createClass(PhoneNumberMatcher, [{ key: "find", value: function find() { // // Reset the regular expression. // this.PATTERN.lastIndex = index var matches; while (this.maxTries > 0 && (matches = this.PATTERN.exec(this.text)) !== null) { var candidate = matches[0]; var offset = matches.index; candidate = (0, _parsePreCandidate["default"])(candidate); if ((0, _isValidPreCandidate["default"])(candidate, offset, this.text)) { var match = // Try to come up with a valid match given the entire candidate. this.parseAndVerify(candidate, offset, this.text) // If that failed, try to find an "inner match" - // there might be a phone number within this candidate. || this.extractInnerMatch(candidate, offset, this.text); if (match) { if (this.options.v2) { var phoneNumber = new _PhoneNumber["default"](match.country || match.countryCallingCode, match.phone, this.metadata); if (match.ext) { phoneNumber.ext = match.ext; } return { startsAt: match.startsAt, endsAt: match.endsAt, number: phoneNumber }; } return match; } } this.maxTries--; } } /** * Attempts to extract a match from `substring` * if the substring itself does not qualify as a match. */ }, { key: "extractInnerMatch", value: function extractInnerMatch(substring, offset, text) { for (var _iterator = _createForOfIteratorHelperLoose(INNER_MATCHES), _step; !(_step = _iterator()).done;) { var innerMatchPattern = _step.value; var isFirstMatch = true; var candidateMatch = void 0; var innerMatchRegExp = new RegExp(innerMatchPattern, 'g'); while (this.maxTries > 0 && (candidateMatch = innerMatchRegExp.exec(substring)) !== null) { if (isFirstMatch) { // We should handle any group before this one too. var _candidate = (0, _util.trimAfterFirstMatch)(UNWANTED_END_CHAR_PATTERN, substring.slice(0, candidateMatch.index)); var _match = this.parseAndVerify(_candidate, offset, text); if (_match) { return _match; } this.maxTries--; isFirstMatch = false; } var candidate = (0, _util.trimAfterFirstMatch)(UNWANTED_END_CHAR_PATTERN, candidateMatch[1]); // Java code does `groupMatcher.start(1)` here, // but there's no way in javascript to get a `candidate` start index, // therefore resort to using this kind of an approximation. // (`groupMatcher` is called `candidateInSubstringMatch` in this javascript port) // https://stackoverflow.com/questions/15934353/get-index-of-each-capture-in-a-javascript-regex var candidateIndexGuess = substring.indexOf(candidate, candidateMatch.index); var match = this.parseAndVerify(candidate, offset + candidateIndexGuess, text); if (match) { return match; } this.maxTries--; } } } /** * Parses a phone number from the `candidate` using `parseNumber` and * verifies it matches the requested `leniency`. If parsing and verification succeed, * a corresponding `PhoneNumberMatch` is returned, otherwise this method returns `null`. * * @param candidate the candidate match * @param offset the offset of {@code candidate} within {@link #text} * @return the parsed and validated phone number match, or null */ }, { key: "parseAndVerify", value: function parseAndVerify(candidate, offset, text) { if (!(0, _isValidCandidate["default"])(candidate, offset, text, this.options.leniency)) { return; } var number = (0, _parse_["default"])(candidate, { extended: true, defaultCountry: this.options.defaultCountry, defaultCallingCode: this.options.defaultCallingCode }, this.metadata); if (!number.possible) { return; } if (this.leniency(number, candidate, this.metadata, this.regExpCache)) { // // We used parseAndKeepRawInput to create this number, // // but for now we don't return the extra values parsed. // // TODO: stop clearing all values here and switch all users over // // to using rawInput() rather than the rawString() of PhoneNumberMatch. // number.clearCountryCodeSource() // number.clearRawInput() // number.clearPreferredDomesticCarrierCode() var result = { startsAt: offset, endsAt: offset + candidate.length, phone: number.phone }; if (number.country && number.country !== '001') { result.country = number.country; } else { result.countryCallingCode = number.countryCallingCode; } if (number.ext) { result.ext = number.ext; } return result; } } }, { key: "hasNext", value: function hasNext() { if (this.state === 'NOT_READY') { this.lastMatch = this.find(); // (this.searchIndex) if (this.lastMatch) { // this.searchIndex = this.lastMatch.endsAt this.state = 'READY'; } else { this.state = 'DONE'; } } return this.state === 'READY'; } }, { key: "next", value: function next() { // Check the state and find the next match as a side-effect if necessary. if (!this.hasNext()) { throw new Error('No next element'); } // Don't retain that memory any longer than necessary. var result = this.lastMatch; this.lastMatch = null; this.state = 'NOT_READY'; return result; } }]); return PhoneNumberMatcher; }(); exports["default"] = PhoneNumberMatcher; //# sourceMappingURL=PhoneNumberMatcher.js.map /***/ }), /***/ "./node_modules/libphonenumber-js/build/constants.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.WHITESPACE = exports.VALID_PUNCTUATION = exports.VALID_DIGITS = exports.PLUS_CHARS = exports.MIN_LENGTH_FOR_NSN = exports.MAX_LENGTH_FOR_NSN = exports.MAX_LENGTH_COUNTRY_CODE = void 0; // The minimum length of the national significant number. var MIN_LENGTH_FOR_NSN = 2; // The ITU says the maximum length should be 15, // but one can find longer numbers in Germany. exports.MIN_LENGTH_FOR_NSN = MIN_LENGTH_FOR_NSN; var MAX_LENGTH_FOR_NSN = 17; // The maximum length of the country calling code. exports.MAX_LENGTH_FOR_NSN = MAX_LENGTH_FOR_NSN; var MAX_LENGTH_COUNTRY_CODE = 3; // Digits accepted in phone numbers // (ascii, fullwidth, arabic-indic, and eastern arabic digits). exports.MAX_LENGTH_COUNTRY_CODE = MAX_LENGTH_COUNTRY_CODE; var VALID_DIGITS = "0-9\uFF10-\uFF19\u0660-\u0669\u06F0-\u06F9"; // `DASHES` will be right after the opening square bracket of the "character class" exports.VALID_DIGITS = VALID_DIGITS; var DASHES = "-\u2010-\u2015\u2212\u30FC\uFF0D"; var SLASHES = "\uFF0F/"; var DOTS = "\uFF0E."; var WHITESPACE = " \xA0\xAD\u200B\u2060\u3000"; exports.WHITESPACE = WHITESPACE; var BRACKETS = "()\uFF08\uFF09\uFF3B\uFF3D\\[\\]"; // export const OPENING_BRACKETS = '(\uFF08\uFF3B\\\[' var TILDES = "~\u2053\u223C\uFF5E"; // Regular expression of acceptable punctuation found in phone numbers. This // excludes punctuation found as a leading character only. This consists of dash // characters, white space characters, full stops, slashes, square brackets, // parentheses and tildes. Full-width variants are also present. var VALID_PUNCTUATION = "".concat(DASHES).concat(SLASHES).concat(DOTS).concat(WHITESPACE).concat(BRACKETS).concat(TILDES); exports.VALID_PUNCTUATION = VALID_PUNCTUATION; var PLUS_CHARS = "+\uFF0B"; // const LEADING_PLUS_CHARS_PATTERN = new RegExp('^[' + PLUS_CHARS + ']+') exports.PLUS_CHARS = PLUS_CHARS; //# sourceMappingURL=constants.js.map /***/ }), /***/ "./node_modules/libphonenumber-js/build/findNumbers.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports["default"] = findNumbers; var _findNumbers_ = _interopRequireDefault(__webpack_require__("./node_modules/libphonenumber-js/build/findNumbers_.js")); var _parsePhoneNumber = __webpack_require__("./node_modules/libphonenumber-js/build/parsePhoneNumber.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } function findNumbers() { var _normalizeArguments = (0, _parsePhoneNumber.normalizeArguments)(arguments), text = _normalizeArguments.text, options = _normalizeArguments.options, metadata = _normalizeArguments.metadata; return (0, _findNumbers_["default"])(text, options, metadata); } //# sourceMappingURL=findNumbers.js.map /***/ }), /***/ "./node_modules/libphonenumber-js/build/findNumbers/LRUCache.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports["default"] = void 0; function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } // https://medium.com/dsinjs/implementing-lru-cache-in-javascript-94ba6755cda9 var Node = /*#__PURE__*/_createClass(function Node(key, value) { var next = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null; var prev = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null; _classCallCheck(this, Node); this.key = key; this.value = value; this.next = next; this.prev = prev; }); var LRUCache = /*#__PURE__*/function () { //set default limit of 10 if limit is not passed. function LRUCache() { var limit = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 10; _classCallCheck(this, LRUCache); this.size = 0; this.limit = limit; this.head = null; this.tail = null; this.cache = {}; } // Write Node to head of LinkedList // update cache with Node key and Node reference _createClass(LRUCache, [{ key: "put", value: function put(key, value) { this.ensureLimit(); if (!this.head) { this.head = this.tail = new Node(key, value); } else { var node = new Node(key, value, this.head); this.head.prev = node; this.head = node; } //Update the cache map this.cache[key] = this.head; this.size++; } // Read from cache map and make that node as new Head of LinkedList }, { key: "get", value: function get(key) { if (this.cache[key]) { var value = this.cache[key].value; // node removed from it's position and cache this.remove(key); // write node again to the head of LinkedList to make it most recently used this.put(key, value); return value; } console.log("Item not available in cache for key ".concat(key)); } }, { key: "ensureLimit", value: function ensureLimit() { if (this.size === this.limit) { this.remove(this.tail.key); } } }, { key: "remove", value: function remove(key) { var node = this.cache[key]; if (node.prev !== null) { node.prev.next = node.next; } else { this.head = node.next; } if (node.next !== null) { node.next.prev = node.prev; } else { this.tail = node.prev; } delete this.cache[key]; this.size--; } }, { key: "clear", value: function clear() { this.head = null; this.tail = null; this.size = 0; this.cache = {}; } // // Invokes the callback function with every node of the chain and the index of the node. // forEach(fn) { // let node = this.head; // let counter = 0; // while (node) { // fn(node, counter); // node = node.next; // counter++; // } // } // // To iterate over LRU with a 'for...of' loop // *[Symbol.iterator]() { // let node = this.head; // while (node) { // yield node; // node = node.next; // } // } }]); return LRUCache; }(); exports["default"] = LRUCache; //# sourceMappingURL=LRUCache.js.map /***/ }), /***/ "./node_modules/libphonenumber-js/build/findNumbers/Leniency.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.containsMoreThanOneSlashInNationalNumber = containsMoreThanOneSlashInNationalNumber; exports["default"] = void 0; var _validate_ = _interopRequireDefault(__webpack_require__("./node_modules/libphonenumber-js/build/validate_.js")); var _parseDigits = _interopRequireDefault(__webpack_require__("./node_modules/libphonenumber-js/build/helpers/parseDigits.js")); var _util = __webpack_require__("./node_modules/libphonenumber-js/build/findNumbers/util.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } function _createForOfIteratorHelperLoose(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (it) return (it = it.call(o)).next.bind(it); if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } /** * Leniency when finding potential phone numbers in text segments * The levels here are ordered in increasing strictness. */ var _default = { /** * Phone numbers accepted are "possible", but not necessarily "valid". */ POSSIBLE: function POSSIBLE(number, candidate, metadata) { return true; }, /** * Phone numbers accepted are "possible" and "valid". * Numbers written in national format must have their national-prefix * present if it is usually written for a number of this type. */ VALID: function VALID(number, candidate, metadata) { if (!(0, _validate_["default"])(number, undefined, metadata) || !containsOnlyValidXChars(number, candidate.toString(), metadata)) { return false; } // Skipped for simplicity. // return isNationalPrefixPresentIfRequired(number, metadata) return true; }, /** * Phone numbers accepted are "valid" and * are grouped in a possible way for this locale. For example, a US number written as * "65 02 53 00 00" and "650253 0000" are not accepted at this leniency level, whereas * "650 253 0000", "650 2530000" or "6502530000" are. * Numbers with more than one '/' symbol in the national significant number * are also dropped at this level. * * Warning: This level might result in lower coverage especially for regions outside of * country code "+1". If you are not sure about which level to use, * email the discussion group libphonenumber-discuss@googlegroups.com. */ STRICT_GROUPING: function STRICT_GROUPING(number, candidate, metadata, regExpCache) { var candidateString = candidate.toString(); if (!(0, _validate_["default"])(number, undefined, metadata) || !containsOnlyValidXChars(number, candidateString, metadata) || containsMoreThanOneSlashInNationalNumber(number, candidateString) || !isNationalPrefixPresentIfRequired(number, metadata)) { return false; } return checkNumberGroupingIsValid(number, candidate, metadata, allNumberGroupsRemainGrouped, regExpCache); }, /** * Phone numbers accepted are {@linkplain PhoneNumberUtil#isValidNumber(PhoneNumber) valid} and * are grouped in the same way that we would have formatted it, or as a single block. For * example, a US number written as "650 2530000" is not accepted at this leniency level, whereas * "650 253 0000" or "6502530000" are. * Numbers with more than one '/' symbol are also dropped at this level. *

* Warning: This level might result in lower coverage especially for regions outside of country * code "+1". If you are not sure about which level to use, email the discussion group * libphonenumber-discuss@googlegroups.com. */ EXACT_GROUPING: function EXACT_GROUPING(number, candidate, metadata, regExpCache) { var candidateString = candidate.toString(); if (!(0, _validate_["default"])(number, undefined, metadata) || !containsOnlyValidXChars(number, candidateString, metadata) || containsMoreThanOneSlashInNationalNumber(number, candidateString) || !isNationalPrefixPresentIfRequired(number, metadata)) { return false; } return checkNumberGroupingIsValid(number, candidate, metadata, allNumberGroupsAreExactlyPresent, regExpCache); } }; exports["default"] = _default; function containsOnlyValidXChars(number, candidate, metadata) { // The characters 'x' and 'X' can be (1) a carrier code, in which case they always precede the // national significant number or (2) an extension sign, in which case they always precede the // extension number. We assume a carrier code is more than 1 digit, so the first case has to // have more than 1 consecutive 'x' or 'X', whereas the second case can only have exactly 1 'x' // or 'X'. We ignore the character if it appears as the last character of the string. for (var index = 0; index < candidate.length - 1; index++) { var charAtIndex = candidate.charAt(index); if (charAtIndex === 'x' || charAtIndex === 'X') { var charAtNextIndex = candidate.charAt(index + 1); if (charAtNextIndex === 'x' || charAtNextIndex === 'X') { // This is the carrier code case, in which the 'X's always precede the national // significant number. index++; if (util.isNumberMatch(number, candidate.substring(index)) != MatchType.NSN_MATCH) { return false; } // This is the extension sign case, in which the 'x' or 'X' should always precede the // extension number. } else if ((0, _parseDigits["default"])(candidate.substring(index)) !== number.ext) { return false; } } } return true; } function isNationalPrefixPresentIfRequired(number, _metadata) { // First, check how we deduced the country code. If it was written in international format, then // the national prefix is not required. if (number.getCountryCodeSource() != 'FROM_DEFAULT_COUNTRY') { return true; } var phoneNumberRegion = util.getRegionCodeForCountryCode(number.getCountryCode()); var metadata = util.getMetadataForRegion(phoneNumberRegion); if (metadata == null) { return true; } // Check if a national prefix should be present when formatting this number. var nationalNumber = util.getNationalSignificantNumber(number); var formatRule = util.chooseFormattingPatternForNumber(metadata.numberFormats(), nationalNumber); // To do this, we check that a national prefix formatting rule was present // and that it wasn't just the first-group symbol ($1) with punctuation. if (formatRule && formatRule.getNationalPrefixFormattingRule().length > 0) { if (formatRule.getNationalPrefixOptionalWhenFormatting()) { // The national-prefix is optional in these cases, so we don't need to check if it was // present. return true; } if (PhoneNumberUtil.formattingRuleHasFirstGroupOnly(formatRule.getNationalPrefixFormattingRule())) { // National Prefix not needed for this number. return true; } // Normalize the remainder. var rawInputCopy = PhoneNumberUtil.normalizeDigitsOnly(number.getRawInput()); // Check if we found a national prefix and/or carrier code at the start of the raw input, and // return the result. return util.maybeStripNationalPrefixAndCarrierCode(rawInputCopy, metadata, null); } return true; } function containsMoreThanOneSlashInNationalNumber(number, candidate) { var firstSlashInBodyIndex = candidate.indexOf('/'); if (firstSlashInBodyIndex < 0) { // No slashes, this is okay. return false; } // Now look for a second one. var secondSlashInBodyIndex = candidate.indexOf('/', firstSlashInBodyIndex + 1); if (secondSlashInBodyIndex < 0) { // Only one slash, this is okay. return false; } // If the first slash is after the country calling code, this is permitted. var candidateHasCountryCode = number.getCountryCodeSource() === CountryCodeSource.FROM_NUMBER_WITH_PLUS_SIGN || number.getCountryCodeSource() === CountryCodeSource.FROM_NUMBER_WITHOUT_PLUS_SIGN; if (candidateHasCountryCode && PhoneNumberUtil.normalizeDigitsOnly(candidate.substring(0, firstSlashInBodyIndex)) === String(number.getCountryCode())) { // Any more slashes and this is illegal. return candidate.slice(secondSlashInBodyIndex + 1).indexOf('/') >= 0; } return true; } function checkNumberGroupingIsValid(number, candidate, metadata, checkGroups, regExpCache) { var normalizedCandidate = normalizeDigits(candidate, true /* keep non-digits */ ); var formattedNumberGroups = getNationalNumberGroups(metadata, number, null); if (checkGroups(metadata, number, normalizedCandidate, formattedNumberGroups)) { return true; } // If this didn't pass, see if there are any alternate formats that match, and try them instead. var alternateFormats = MetadataManager.getAlternateFormatsForCountry(number.getCountryCode()); var nationalSignificantNumber = util.getNationalSignificantNumber(number); if (alternateFormats) { for (var _iterator = _createForOfIteratorHelperLoose(alternateFormats.numberFormats()), _step; !(_step = _iterator()).done;) { var alternateFormat = _step.value; if (alternateFormat.leadingDigitsPatterns().length > 0) { // There is only one leading digits pattern for alternate formats. var leadingDigitsRegExp = regExpCache.getPatternForRegExp('^' + alternateFormat.leadingDigitsPatterns()[0]); if (!leadingDigitsRegExp.test(nationalSignificantNumber)) { // Leading digits don't match; try another one. continue; } } formattedNumberGroups = getNationalNumberGroups(metadata, number, alternateFormat); if (checkGroups(metadata, number, normalizedCandidate, formattedNumberGroups)) { return true; } } } return false; } /** * Helper method to get the national-number part of a number, formatted without any national * prefix, and return it as a set of digit blocks that would be formatted together following * standard formatting rules. */ function getNationalNumberGroups(metadata, number, formattingPattern) { if (formattingPattern) { // We format the NSN only, and split that according to the separator. var nationalSignificantNumber = util.getNationalSignificantNumber(number); return util.formatNsnUsingPattern(nationalSignificantNumber, formattingPattern, 'RFC3966', metadata).split('-'); } // This will be in the format +CC-DG1-DG2-DGX;ext=EXT where DG1..DGX represents groups of digits. var rfc3966Format = formatNumber(number, 'RFC3966', metadata); // We remove the extension part from the formatted string before splitting it into different // groups. var endIndex = rfc3966Format.indexOf(';'); if (endIndex < 0) { endIndex = rfc3966Format.length; } // The country-code will have a '-' following it. var startIndex = rfc3966Format.indexOf('-') + 1; return rfc3966Format.slice(startIndex, endIndex).split('-'); } function allNumberGroupsAreExactlyPresent(metadata, number, normalizedCandidate, formattedNumberGroups) { var candidateGroups = normalizedCandidate.split(NON_DIGITS_PATTERN); // Set this to the last group, skipping it if the number has an extension. var candidateNumberGroupIndex = number.hasExtension() ? candidateGroups.length - 2 : candidateGroups.length - 1; // First we check if the national significant number is formatted as a block. // We use contains and not equals, since the national significant number may be present with // a prefix such as a national number prefix, or the country code itself. if (candidateGroups.length == 1 || candidateGroups[candidateNumberGroupIndex].contains(util.getNationalSignificantNumber(number))) { return true; } // Starting from the end, go through in reverse, excluding the first group, and check the // candidate and number groups are the same. var formattedNumberGroupIndex = formattedNumberGroups.length - 1; while (formattedNumberGroupIndex > 0 && candidateNumberGroupIndex >= 0) { if (candidateGroups[candidateNumberGroupIndex] !== formattedNumberGroups[formattedNumberGroupIndex]) { return false; } formattedNumberGroupIndex--; candidateNumberGroupIndex--; } // Now check the first group. There may be a national prefix at the start, so we only check // that the candidate group ends with the formatted number group. return candidateNumberGroupIndex >= 0 && (0, _util.endsWith)(candidateGroups[candidateNumberGroupIndex], formattedNumberGroups[0]); } function allNumberGroupsRemainGrouped(metadata, number, normalizedCandidate, formattedNumberGroups) { var fromIndex = 0; if (number.getCountryCodeSource() !== CountryCodeSource.FROM_DEFAULT_COUNTRY) { // First skip the country code if the normalized candidate contained it. var countryCode = String(number.getCountryCode()); fromIndex = normalizedCandidate.indexOf(countryCode) + countryCode.length(); } // Check each group of consecutive digits are not broken into separate groupings in the // {@code normalizedCandidate} string. for (var i = 0; i < formattedNumberGroups.length; i++) { // Fails if the substring of {@code normalizedCandidate} starting from {@code fromIndex} // doesn't contain the consecutive digits in formattedNumberGroups[i]. fromIndex = normalizedCandidate.indexOf(formattedNumberGroups[i], fromIndex); if (fromIndex < 0) { return false; } // Moves {@code fromIndex} forward. fromIndex += formattedNumberGroups[i].length(); if (i == 0 && fromIndex < normalizedCandidate.length()) { // We are at the position right after the NDC. We get the region used for formatting // information based on the country code in the phone number, rather than the number itself, // as we do not need to distinguish between different countries with the same country // calling code and this is faster. var region = util.getRegionCodeForCountryCode(number.getCountryCode()); if (util.getNddPrefixForRegion(region, true) != null && Character.isDigit(normalizedCandidate.charAt(fromIndex))) { // This means there is no formatting symbol after the NDC. In this case, we only // accept the number if there is no formatting symbol at all in the number, except // for extensions. This is only important for countries with national prefixes. var nationalSignificantNumber = util.getNationalSignificantNumber(number); return (0, _util.startsWith)(normalizedCandidate.slice(fromIndex - formattedNumberGroups[i].length), nationalSignificantNumber); } } } // The check here makes sure that we haven't mistakenly already used the extension to // match the last group of the subscriber number. Note the extension cannot have // formatting in-between digits. return normalizedCandidate.slice(fromIndex).contains(number.getExtension()); } //# sourceMappingURL=Leniency.js.map /***/ }), /***/ "./node_modules/libphonenumber-js/build/findNumbers/RegExpCache.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports["default"] = void 0; var _LRUCache = _interopRequireDefault(__webpack_require__("./node_modules/libphonenumber-js/build/findNumbers/LRUCache.js")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } // A cache for frequently used country-specific regular expressions. Set to 32 to cover ~2-3 // countries being used for the same doc with ~10 patterns for each country. Some pages will have // a lot more countries in use, but typically fewer numbers for each so expanding the cache for // that use-case won't have a lot of benefit. var RegExpCache = /*#__PURE__*/function () { function RegExpCache(size) { _classCallCheck(this, RegExpCache); this.cache = new _LRUCache["default"](size); } _createClass(RegExpCache, [{ key: "getPatternForRegExp", value: function getPatternForRegExp(pattern) { var regExp = this.cache.get(pattern); if (!regExp) { regExp = new RegExp('^' + pattern); this.cache.put(pattern, regExp); } return regExp; } }]); return RegExpCache; }(); exports["default"] = RegExpCache; //# sourceMappingURL=RegExpCache.js.map /***/ }), /***/ "./node_modules/libphonenumber-js/build/findNumbers/isValidCandidate.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.LEAD_CLASS = void 0; exports["default"] = isValidCandidate; var _constants = __webpack_require__("./node_modules/libphonenumber-js/build/constants.js"); var _util = __webpack_require__("./node_modules/libphonenumber-js/build/findNumbers/util.js"); var _utf = __webpack_require__("./node_modules/libphonenumber-js/build/findNumbers/utf-8.js"); // Copy-pasted from `PhoneNumberMatcher.js`. var OPENING_PARENS = "(\\[\uFF08\uFF3B"; var CLOSING_PARENS = ")\\]\uFF09\uFF3D"; var NON_PARENS = "[^".concat(OPENING_PARENS).concat(CLOSING_PARENS, "]"); var LEAD_CLASS = "[".concat(OPENING_PARENS).concat(_constants.PLUS_CHARS, "]"); // Punctuation that may be at the start of a phone number - brackets and plus signs. exports.LEAD_CLASS = LEAD_CLASS; var LEAD_CLASS_LEADING = new RegExp('^' + LEAD_CLASS); // Limit on the number of pairs of brackets in a phone number. var BRACKET_PAIR_LIMIT = (0, _util.limit)(0, 3); /** * Pattern to check that brackets match. Opening brackets should be closed within a phone number. * This also checks that there is something inside the brackets. Having no brackets at all is also * fine. * * An opening bracket at the beginning may not be closed, but subsequent ones should be. It's * also possible that the leading bracket was dropped, so we shouldn't be surprised if we see a * closing bracket first. We limit the sets of brackets in a phone number to four. */ var MATCHING_BRACKETS_ENTIRE = new RegExp('^' + "(?:[" + OPENING_PARENS + "])?" + "(?:" + NON_PARENS + "+" + "[" + CLOSING_PARENS + "])?" + NON_PARENS + "+" + "(?:[" + OPENING_PARENS + "]" + NON_PARENS + "+[" + CLOSING_PARENS + "])" + BRACKET_PAIR_LIMIT + NON_PARENS + "*" + '$'); /** * Matches strings that look like publication pages. Example: *

Computing Complete Answers to Queries in the Presence of Limited Access Patterns.
 * Chen Li. VLDB J. 12(3): 211-227 (2003).
* * The string "211-227 (2003)" is not a telephone number. */ var PUB_PAGES = /\d{1,5}-+\d{1,5}\s{0,4}\(\d{1,4}/; function isValidCandidate(candidate, offset, text, leniency) { // Check the candidate doesn't contain any formatting // which would indicate that it really isn't a phone number. if (!MATCHING_BRACKETS_ENTIRE.test(candidate) || PUB_PAGES.test(candidate)) { return; } // If leniency is set to VALID or stricter, we also want to skip numbers that are surrounded // by Latin alphabetic characters, to skip cases like abc8005001234 or 8005001234def. if (leniency !== 'POSSIBLE') { // If the candidate is not at the start of the text, // and does not start with phone-number punctuation, // check the previous character. if (offset > 0 && !LEAD_CLASS_LEADING.test(candidate)) { var previousChar = text[offset - 1]; // We return null if it is a latin letter or an invalid punctuation symbol. if ((0, _utf.isInvalidPunctuationSymbol)(previousChar) || (0, _utf.isLatinLetter)(previousChar)) { return false; } } var lastCharIndex = offset + candidate.length; if (lastCharIndex < text.length) { var nextChar = text[lastCharIndex]; if ((0, _utf.isInvalidPunctuationSymbol)(nextChar) || (0, _utf.isLatinLetter)(nextChar)) { return false; } } } return true; } //# sourceMappingURL=isValidCandidate.js.map /***/ }), /***/ "./node_modules/libphonenumber-js/build/findNumbers/isValidPreCandidate.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports["default"] = isValidPreCandidate; // Matches strings that look like dates using "/" as a separator. // Examples: 3/10/2011, 31/10/96 or 08/31/95. var SLASH_SEPARATED_DATES = /(?:(?:[0-3]?\d\/[01]?\d)|(?:[01]?\d\/[0-3]?\d))\/(?:[12]\d)?\d{2}/; // Matches timestamps. // Examples: "2012-01-02 08:00". // Note that the reg-ex does not include the // trailing ":\d\d" -- that is covered by TIME_STAMPS_SUFFIX. var TIME_STAMPS = /[12]\d{3}[-/]?[01]\d[-/]?[0-3]\d +[0-2]\d$/; var TIME_STAMPS_SUFFIX_LEADING = /^:[0-5]\d/; function isValidPreCandidate(candidate, offset, text) { // Skip a match that is more likely to be a date. if (SLASH_SEPARATED_DATES.test(candidate)) { return false; } // Skip potential time-stamps. if (TIME_STAMPS.test(candidate)) { var followingText = text.slice(offset + candidate.length); if (TIME_STAMPS_SUFFIX_LEADING.test(followingText)) { return false; } } return true; } //# sourceMappingURL=isValidPreCandidate.js.map /***/ }), /***/ "./node_modules/libphonenumber-js/build/findNumbers/parsePreCandidate.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports["default"] = parsePreCandidate; var _util = __webpack_require__("./node_modules/libphonenumber-js/build/findNumbers/util.js"); // Regular expression of characters typically used to start a second phone number for the purposes // of parsing. This allows us to strip off parts of the number that are actually the start of // another number, such as for: (530) 583-6985 x302/x2303 -> the second extension here makes this // actually two phone numbers, (530) 583-6985 x302 and (530) 583-6985 x2303. We remove the second // extension so that the first number is parsed correctly. // // Matches a slash (\ or /) followed by a space followed by an `x`. // var SECOND_NUMBER_START_PATTERN = /[\\/] *x/; function parsePreCandidate(candidate) { // Check for extra numbers at the end. // TODO: This is the place to start when trying to support extraction of multiple phone number // from split notations (+41 79 123 45 67 / 68). return (0, _util.trimAfterFirstMatch)(SECOND_NUMBER_START_PATTERN, candidate); } //# sourceMappingURL=parsePreCandidate.js.map /***/ }), /***/ "./node_modules/libphonenumber-js/build/findNumbers/utf-8.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports._pN = exports._pL = exports.PZ = void 0; exports.isInvalidPunctuationSymbol = isInvalidPunctuationSymbol; exports.isLatinLetter = isLatinLetter; exports.pZ = exports.pNd = void 0; // Javascript doesn't support UTF-8 regular expressions. // So mimicking them here. // Copy-pasted from `PhoneNumberMatcher.js`. /** * "\p{Z}" is any kind of whitespace or invisible separator ("Separator"). * http://www.regular-expressions.info/unicode.html * "\P{Z}" is the reverse of "\p{Z}". * "\p{N}" is any kind of numeric character in any script ("Number"). * "\p{Nd}" is a digit zero through nine in any script except "ideographic scripts" ("Decimal_Digit_Number"). * "\p{Sc}" is a currency symbol ("Currency_Symbol"). * "\p{L}" is any kind of letter from any language ("Letter"). * "\p{Mn}" is "non-spacing mark". * * Javascript doesn't support Unicode Regular Expressions * so substituting it with this explicit set of characters. * * https://stackoverflow.com/questions/13210194/javascript-regex-equivalent-of-a-za-z-using-pl * https://github.com/danielberndt/babel-plugin-utf-8-regex/blob/master/src/transformer.js */ var _pZ = " \xA0\u1680\u180E\u2000-\u200A\u2028\u2029\u202F\u205F\u3000"; var pZ = "[".concat(_pZ, "]"); exports.pZ = pZ; var PZ = "[^".concat(_pZ, "]"); exports.PZ = PZ; var _pN = "0-9\xB2\xB3\xB9\xBC-\xBE\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u09F4-\u09F9\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0B72-\u0B77\u0BE6-\u0BF2\u0C66-\u0C6F\u0C78-\u0C7E\u0CE6-\u0CEF\u0D66-\u0D75\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F33\u1040-\u1049\u1090-\u1099\u1369-\u137C\u16EE-\u16F0\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1946-\u194F\u19D0-\u19DA\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\u2070\u2074-\u2079\u2080-\u2089\u2150-\u2182\u2185-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2CFD\u3007\u3021-\u3029\u3038-\u303A\u3192-\u3195\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\uA620-\uA629\uA6E6-\uA6EF\uA830-\uA835\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19"; // const pN = `[${_pN}]` exports._pN = _pN; var _pNd = "0-9\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0BE6-\u0BEF\u0C66-\u0C6F\u0CE6-\u0CEF\u0D66-\u0D6F\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F29\u1040-\u1049\u1090-\u1099\u17E0-\u17E9\u1810-\u1819\u1946-\u194F\u19D0-\u19D9\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\uA620-\uA629\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19"; var pNd = "[".concat(_pNd, "]"); exports.pNd = pNd; var _pL = "A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC"; exports._pL = _pL; var pL = "[".concat(_pL, "]"); var pL_regexp = new RegExp(pL); var _pSc = "$\xA2-\xA5\u058F\u060B\u09F2\u09F3\u09FB\u0AF1\u0BF9\u0E3F\u17DB\u20A0-\u20B9\uA838\uFDFC\uFE69\uFF04\uFFE0\uFFE1\uFFE5\uFFE6"; var pSc = "[".concat(_pSc, "]"); var pSc_regexp = new RegExp(pSc); var _pMn = "\u0300-\u036F\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08E4-\u08FE\u0900-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962\u0963\u0981\u09BC\u09C1-\u09C4\u09CD\u09E2\u09E3\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0B01\u0B3C\u0B3F\u0B41-\u0B44\u0B4D\u0B56\u0B62\u0B63\u0B82\u0BC0\u0BCD\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0CBC\u0CBF\u0CC6\u0CCC\u0CCD\u0CE2\u0CE3\u0D41-\u0D44\u0D4D\u0D62\u0D63\u0DCA\u0DD2-\u0DD4\u0DD6\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F71-\u0F7E\u0F80-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DD\u180B-\u180D\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1A17\u1A18\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1B00-\u1B03\u1B34\u1B36-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1DC0-\u1DE6\u1DFC-\u1DFF\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302D\u3099\u309A\uA66F\uA674-\uA67D\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA825\uA826\uA8C4\uA8E0-\uA8F1\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEC\uAAED\uAAF6\uABE5\uABE8\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE26"; var pMn = "[".concat(_pMn, "]"); var pMn_regexp = new RegExp(pMn); var _InBasic_Latin = "\0-\x7F"; var _InLatin_1_Supplement = "\x80-\xFF"; var _InLatin_Extended_A = "\u0100-\u017F"; var _InLatin_Extended_Additional = "\u1E00-\u1EFF"; var _InLatin_Extended_B = "\u0180-\u024F"; var _InCombining_Diacritical_Marks = "\u0300-\u036F"; var latinLetterRegexp = new RegExp('[' + _InBasic_Latin + _InLatin_1_Supplement + _InLatin_Extended_A + _InLatin_Extended_Additional + _InLatin_Extended_B + _InCombining_Diacritical_Marks + ']'); /** * Helper method to determine if a character is a Latin-script letter or not. * For our purposes, combining marks should also return true since we assume * they have been added to a preceding Latin character. */ function isLatinLetter(letter) { // Combining marks are a subset of non-spacing-mark. if (!pL_regexp.test(letter) && !pMn_regexp.test(letter)) { return false; } return latinLetterRegexp.test(letter); } function isInvalidPunctuationSymbol(character) { return character === '%' || pSc_regexp.test(character); } //# sourceMappingURL=utf-8.js.map /***/ }), /***/ "./node_modules/libphonenumber-js/build/findNumbers/util.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.endsWith = endsWith; exports.limit = limit; exports.startsWith = startsWith; exports.trimAfterFirstMatch = trimAfterFirstMatch; /** Returns a regular expression quantifier with an upper and lower limit. */ function limit(lower, upper) { if (lower < 0 || upper <= 0 || upper < lower) { throw new TypeError(); } return "{".concat(lower, ",").concat(upper, "}"); } /** * Trims away any characters after the first match of {@code pattern} in {@code candidate}, * returning the trimmed version. */ function trimAfterFirstMatch(regexp, string) { var index = string.search(regexp); if (index >= 0) { return string.slice(0, index); } return string; } function startsWith(string, substring) { return string.indexOf(substring) === 0; } function endsWith(string, substring) { return string.indexOf(substring, string.length - substring.length) === string.length - substring.length; } //# sourceMappingURL=util.js.map /***/ }), /***/ "./node_modules/libphonenumber-js/build/findNumbers_.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports["default"] = findNumbers; var _PhoneNumberMatcher = _interopRequireDefault(__webpack_require__("./node_modules/libphonenumber-js/build/PhoneNumberMatcher.js")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } function findNumbers(text, options, metadata) { var matcher = new _PhoneNumberMatcher["default"](text, options, metadata); var results = []; while (matcher.hasNext()) { results.push(matcher.next()); } return results; } //# sourceMappingURL=findNumbers_.js.map /***/ }), /***/ "./node_modules/libphonenumber-js/build/findPhoneNumbers.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } Object.defineProperty(exports, "__esModule", { value: true }); exports["default"] = findPhoneNumbers; exports.searchPhoneNumbers = searchPhoneNumbers; var _findPhoneNumbers_ = _interopRequireWildcard(__webpack_require__("./node_modules/libphonenumber-js/build/findPhoneNumbers_.js")); var _parsePhoneNumber = __webpack_require__("./node_modules/libphonenumber-js/build/parsePhoneNumber.js"); function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; } // This is a legacy function. // Use `findNumbers()` instead. function findPhoneNumbers() { var _normalizeArguments = (0, _parsePhoneNumber.normalizeArguments)(arguments), text = _normalizeArguments.text, options = _normalizeArguments.options, metadata = _normalizeArguments.metadata; return (0, _findPhoneNumbers_["default"])(text, options, metadata); } /** * @return ES6 `for ... of` iterator. */ function searchPhoneNumbers() { var _normalizeArguments2 = (0, _parsePhoneNumber.normalizeArguments)(arguments), text = _normalizeArguments2.text, options = _normalizeArguments2.options, metadata = _normalizeArguments2.metadata; return (0, _findPhoneNumbers_.searchPhoneNumbers)(text, options, metadata); } //# sourceMappingURL=findPhoneNumbers.js.map /***/ }), /***/ "./node_modules/libphonenumber-js/build/findPhoneNumbersInText.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports["default"] = findPhoneNumbersInText; exports.getArguments = getArguments; var _findNumbers = _interopRequireDefault(__webpack_require__("./node_modules/libphonenumber-js/build/findNumbers.js")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } function findPhoneNumbersInText(text, defaultCountry, options, metadata) { var args = getArguments(defaultCountry, options, metadata); return (0, _findNumbers["default"])(text, args.options, args.metadata); } function getArguments(defaultCountry, options, metadata) { if (metadata) { if (defaultCountry) { options = _objectSpread(_objectSpread({}, options), {}, { defaultCountry: defaultCountry }); } } else { if (options) { metadata = options; if (defaultCountry) { if (is_object(defaultCountry)) { options = defaultCountry; } else { options = { defaultCountry: defaultCountry }; } } else { options = undefined; } } else { metadata = defaultCountry; options = undefined; } } return { options: _objectSpread(_objectSpread({}, options), {}, { v2: true }), metadata: metadata }; } // Babel transforms `typeof` into some "branches" // so istanbul will show this as "branch not covered". /* istanbul ignore next */ var is_object = function is_object(_) { return _typeof(_) === 'object'; }; //# sourceMappingURL=findPhoneNumbersInText.js.map /***/ }), /***/ "./node_modules/libphonenumber-js/build/findPhoneNumbers_.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.PhoneNumberSearch = exports.EXTN_PATTERNS_FOR_PARSING = void 0; exports["default"] = findPhoneNumbers; exports.searchPhoneNumbers = searchPhoneNumbers; var _constants = __webpack_require__("./node_modules/libphonenumber-js/build/constants.js"); var _parse_ = _interopRequireDefault(__webpack_require__("./node_modules/libphonenumber-js/build/parse_.js")); var _isViablePhoneNumber = __webpack_require__("./node_modules/libphonenumber-js/build/helpers/isViablePhoneNumber.js"); var _createExtensionPattern = _interopRequireDefault(__webpack_require__("./node_modules/libphonenumber-js/build/helpers/extension/createExtensionPattern.js")); var _parsePreCandidate = _interopRequireDefault(__webpack_require__("./node_modules/libphonenumber-js/build/findNumbers/parsePreCandidate.js")); var _isValidPreCandidate = _interopRequireDefault(__webpack_require__("./node_modules/libphonenumber-js/build/findNumbers/isValidPreCandidate.js")); var _isValidCandidate = _interopRequireDefault(__webpack_require__("./node_modules/libphonenumber-js/build/findNumbers/isValidCandidate.js")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } /** * Regexp of all possible ways to write extensions, for use when parsing. This * will be run as a case-insensitive regexp match. Wide character versions are * also provided after each ASCII version. There are three regular expressions * here. The first covers RFC 3966 format, where the extension is added using * ';ext='. The second more generic one starts with optional white space and * ends with an optional full stop (.), followed by zero or more spaces/tabs * /commas and then the numbers themselves. The other one covers the special * case of American numbers where the extension is written with a hash at the * end, such as '- 503#'. Note that the only capturing groups should be around * the digits that you want to capture as part of the extension, or else parsing * will fail! We allow two options for representing the accented o - the * character itself, and one in the unicode decomposed form with the combining * acute accent. */ var EXTN_PATTERNS_FOR_PARSING = (0, _createExtensionPattern["default"])('parsing'); exports.EXTN_PATTERNS_FOR_PARSING = EXTN_PATTERNS_FOR_PARSING; var WHITESPACE_IN_THE_BEGINNING_PATTERN = new RegExp('^[' + _constants.WHITESPACE + ']+'); var PUNCTUATION_IN_THE_END_PATTERN = new RegExp('[' + _constants.VALID_PUNCTUATION + ']+$'); // // Regular expression for getting opening brackets for a valid number // // found using `PHONE_NUMBER_START_PATTERN` for prepending those brackets to the number. // const BEFORE_NUMBER_DIGITS_PUNCTUATION = new RegExp('[' + OPENING_BRACKETS + ']+' + '[' + WHITESPACE + ']*' + '$') var VALID_PRECEDING_CHARACTER_PATTERN = /[^a-zA-Z0-9]/; function findPhoneNumbers(text, options, metadata) { /* istanbul ignore if */ if (options === undefined) { options = {}; } var search = new PhoneNumberSearch(text, options, metadata); var phones = []; while (search.hasNext()) { phones.push(search.next()); } return phones; } /** * @return ES6 `for ... of` iterator. */ function searchPhoneNumbers(text, options, metadata) { /* istanbul ignore if */ if (options === undefined) { options = {}; } var search = new PhoneNumberSearch(text, options, metadata); return _defineProperty({}, Symbol.iterator, function () { return { next: function next() { if (search.hasNext()) { return { done: false, value: search.next() }; } return { done: true }; } }; }); } /** * Extracts a parseable phone number including any opening brackets, etc. * @param {string} text - Input. * @return {object} `{ ?number, ?startsAt, ?endsAt }`. */ var PhoneNumberSearch = /*#__PURE__*/function () { function PhoneNumberSearch(text, options, metadata) { _classCallCheck(this, PhoneNumberSearch); this.text = text; // If assigning the `{}` default value is moved to the arguments above, // code coverage would decrease for some weird reason. this.options = options || {}; this.metadata = metadata; // Iteration tristate. this.state = 'NOT_READY'; this.regexp = new RegExp(_isViablePhoneNumber.VALID_PHONE_NUMBER_WITH_EXTENSION, 'ig'); } _createClass(PhoneNumberSearch, [{ key: "find", value: function find() { var matches = this.regexp.exec(this.text); if (!matches) { return; } var number = matches[0]; var startsAt = matches.index; number = number.replace(WHITESPACE_IN_THE_BEGINNING_PATTERN, ''); startsAt += matches[0].length - number.length; // Fixes not parsing numbers with whitespace in the end. // Also fixes not parsing numbers with opening parentheses in the end. // https://github.com/catamphetamine/libphonenumber-js/issues/252 number = number.replace(PUNCTUATION_IN_THE_END_PATTERN, ''); number = (0, _parsePreCandidate["default"])(number); var result = this.parseCandidate(number, startsAt); if (result) { return result; } // Tail recursion. // Try the next one if this one is not a valid phone number. return this.find(); } }, { key: "parseCandidate", value: function parseCandidate(number, startsAt) { if (!(0, _isValidPreCandidate["default"])(number, startsAt, this.text)) { return; } // Don't parse phone numbers which are non-phone numbers // due to being part of something else (e.g. a UUID). // https://github.com/catamphetamine/libphonenumber-js/issues/213 // Copy-pasted from Google's `PhoneNumberMatcher.js` (`.parseAndValidate()`). if (!(0, _isValidCandidate["default"])(number, startsAt, this.text, this.options.extended ? 'POSSIBLE' : 'VALID')) { return; } // // Prepend any opening brackets left behind by the // // `PHONE_NUMBER_START_PATTERN` regexp. // const text_before_number = text.slice(this.searching_from, startsAt) // const full_number_starts_at = text_before_number.search(BEFORE_NUMBER_DIGITS_PUNCTUATION) // if (full_number_starts_at >= 0) // { // number = text_before_number.slice(full_number_starts_at) + number // startsAt = full_number_starts_at // } // // this.searching_from = matches.lastIndex var result = (0, _parse_["default"])(number, this.options, this.metadata); if (!result.phone) { return; } result.startsAt = startsAt; result.endsAt = startsAt + number.length; return result; } }, { key: "hasNext", value: function hasNext() { if (this.state === 'NOT_READY') { this.last_match = this.find(); if (this.last_match) { this.state = 'READY'; } else { this.state = 'DONE'; } } return this.state === 'READY'; } }, { key: "next", value: function next() { // Check the state and find the next match as a side-effect if necessary. if (!this.hasNext()) { throw new Error('No next element'); } // Don't retain that memory any longer than necessary. var result = this.last_match; this.last_match = null; this.state = 'NOT_READY'; return result; } }]); return PhoneNumberSearch; }(); exports.PhoneNumberSearch = PhoneNumberSearch; //# sourceMappingURL=findPhoneNumbers_.js.map /***/ }), /***/ "./node_modules/libphonenumber-js/build/format.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports["default"] = formatNumber; var _format_ = _interopRequireDefault(__webpack_require__("./node_modules/libphonenumber-js/build/format_.js")); var _parse_ = _interopRequireDefault(__webpack_require__("./node_modules/libphonenumber-js/build/parse_.js")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } function formatNumber() { var _normalizeArguments = normalizeArguments(arguments), input = _normalizeArguments.input, format = _normalizeArguments.format, options = _normalizeArguments.options, metadata = _normalizeArguments.metadata; return (0, _format_["default"])(input, format, options, metadata); } // Sort out arguments function normalizeArguments(args) { var _Array$prototype$slic = Array.prototype.slice.call(args), _Array$prototype$slic2 = _slicedToArray(_Array$prototype$slic, 5), arg_1 = _Array$prototype$slic2[0], arg_2 = _Array$prototype$slic2[1], arg_3 = _Array$prototype$slic2[2], arg_4 = _Array$prototype$slic2[3], arg_5 = _Array$prototype$slic2[4]; var input; var format; var options; var metadata; // Sort out arguments. // If the phone number is passed as a string. // `format('8005553535', ...)`. if (typeof arg_1 === 'string') { // If country code is supplied. // `format('8005553535', 'RU', 'NATIONAL', [options], metadata)`. if (typeof arg_3 === 'string') { format = arg_3; if (arg_5) { options = arg_4; metadata = arg_5; } else { metadata = arg_4; } input = (0, _parse_["default"])(arg_1, { defaultCountry: arg_2, extended: true }, metadata); } // Just an international phone number is supplied // `format('+78005553535', 'NATIONAL', [options], metadata)`. else { if (typeof arg_2 !== 'string') { throw new Error('`format` argument not passed to `formatNumber(number, format)`'); } format = arg_2; if (arg_4) { options = arg_3; metadata = arg_4; } else { metadata = arg_3; } input = (0, _parse_["default"])(arg_1, { extended: true }, metadata); } } // If the phone number is passed as a parsed number object. // `format({ phone: '8005553535', country: 'RU' }, 'NATIONAL', [options], metadata)`. else if (is_object(arg_1)) { input = arg_1; format = arg_2; if (arg_4) { options = arg_3; metadata = arg_4; } else { metadata = arg_3; } } else throw new TypeError('A phone number must either be a string or an object of shape { phone, [country] }.'); // Legacy lowercase formats. if (format === 'International') { format = 'INTERNATIONAL'; } else if (format === 'National') { format = 'NATIONAL'; } return { input: input, format: format, options: options, metadata: metadata }; } // Babel transforms `typeof` into some "branches" // so istanbul will show this as "branch not covered". /* istanbul ignore next */ var is_object = function is_object(_) { return _typeof(_) === 'object'; }; //# sourceMappingURL=format.js.map /***/ }), /***/ "./node_modules/libphonenumber-js/build/formatIncompletePhoneNumber.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports["default"] = formatIncompletePhoneNumber; var _AsYouType = _interopRequireDefault(__webpack_require__("./node_modules/libphonenumber-js/build/AsYouType.js")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } /** * Formats a (possibly incomplete) phone number. * The phone number can be either in E.164 format * or in a form of national number digits. * @param {string} value - A possibly incomplete phone number. Either in E.164 format or in a form of national number digits. * @param {string?} country - Two-letter ("ISO 3166-1 alpha-2") country code. * @return {string} Formatted (possibly incomplete) phone number. */ function formatIncompletePhoneNumber(value, country, metadata) { if (!metadata) { metadata = country; country = undefined; } return new _AsYouType["default"](country, metadata).input(value); } //# sourceMappingURL=formatIncompletePhoneNumber.js.map /***/ }), /***/ "./node_modules/libphonenumber-js/build/format_.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } Object.defineProperty(exports, "__esModule", { value: true }); exports["default"] = formatNumber; var _matchesEntirely = _interopRequireDefault(__webpack_require__("./node_modules/libphonenumber-js/build/helpers/matchesEntirely.js")); var _formatNationalNumberUsingFormat = _interopRequireDefault(__webpack_require__("./node_modules/libphonenumber-js/build/helpers/formatNationalNumberUsingFormat.js")); var _metadata = _interopRequireWildcard(__webpack_require__("./node_modules/libphonenumber-js/build/metadata.js")); var _getIddPrefix = _interopRequireDefault(__webpack_require__("./node_modules/libphonenumber-js/build/helpers/getIddPrefix.js")); var _RFC = __webpack_require__("./node_modules/libphonenumber-js/build/helpers/RFC3966.js"); function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } function _createForOfIteratorHelperLoose(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (it) return (it = it.call(o)).next.bind(it); if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } var DEFAULT_OPTIONS = { formatExtension: function formatExtension(formattedNumber, extension, metadata) { return "".concat(formattedNumber).concat(metadata.ext()).concat(extension); } }; // Formats a phone number // // Example use cases: // // ```js // formatNumber('8005553535', 'RU', 'INTERNATIONAL') // formatNumber('8005553535', 'RU', 'INTERNATIONAL', metadata) // formatNumber({ phone: '8005553535', country: 'RU' }, 'INTERNATIONAL') // formatNumber({ phone: '8005553535', country: 'RU' }, 'INTERNATIONAL', metadata) // formatNumber('+78005553535', 'NATIONAL') // formatNumber('+78005553535', 'NATIONAL', metadata) // ``` // function formatNumber(input, format, options, metadata) { // Apply default options. if (options) { options = _objectSpread(_objectSpread({}, DEFAULT_OPTIONS), options); } else { options = DEFAULT_OPTIONS; } metadata = new _metadata["default"](metadata); if (input.country && input.country !== '001') { // Validate `input.country`. if (!metadata.hasCountry(input.country)) { throw new Error("Unknown country: ".concat(input.country)); } metadata.country(input.country); } else if (input.countryCallingCode) { metadata.selectNumberingPlan(input.countryCallingCode); } else return input.phone || ''; var countryCallingCode = metadata.countryCallingCode(); var nationalNumber = options.v2 ? input.nationalNumber : input.phone; // This variable should have been declared inside `case`s // but Babel has a bug and it says "duplicate variable declaration". var number; switch (format) { case 'NATIONAL': // Legacy argument support. // (`{ country: ..., phone: '' }`) if (!nationalNumber) { return ''; } number = formatNationalNumber(nationalNumber, input.carrierCode, 'NATIONAL', metadata, options); return addExtension(number, input.ext, metadata, options.formatExtension); case 'INTERNATIONAL': // Legacy argument support. // (`{ country: ..., phone: '' }`) if (!nationalNumber) { return "+".concat(countryCallingCode); } number = formatNationalNumber(nationalNumber, null, 'INTERNATIONAL', metadata, options); number = "+".concat(countryCallingCode, " ").concat(number); return addExtension(number, input.ext, metadata, options.formatExtension); case 'E.164': // `E.164` doesn't define "phone number extensions". return "+".concat(countryCallingCode).concat(nationalNumber); case 'RFC3966': return (0, _RFC.formatRFC3966)({ number: "+".concat(countryCallingCode).concat(nationalNumber), ext: input.ext }); // For reference, here's Google's IDD formatter: // https://github.com/google/libphonenumber/blob/32719cf74e68796788d1ca45abc85dcdc63ba5b9/java/libphonenumber/src/com/google/i18n/phonenumbers/PhoneNumberUtil.java#L1546 // Not saying that this IDD formatter replicates it 1:1, but it seems to work. // Who would even need to format phone numbers in IDD format anyway? case 'IDD': if (!options.fromCountry) { return; // throw new Error('`fromCountry` option not passed for IDD-prefixed formatting.') } var formattedNumber = formatIDD(nationalNumber, input.carrierCode, countryCallingCode, options.fromCountry, metadata); return addExtension(formattedNumber, input.ext, metadata, options.formatExtension); default: throw new Error("Unknown \"format\" argument passed to \"formatNumber()\": \"".concat(format, "\"")); } } function formatNationalNumber(number, carrierCode, formatAs, metadata, options) { var format = chooseFormatForNumber(metadata.formats(), number); if (!format) { return number; } return (0, _formatNationalNumberUsingFormat["default"])(number, format, { useInternationalFormat: formatAs === 'INTERNATIONAL', withNationalPrefix: format.nationalPrefixIsOptionalWhenFormattingInNationalFormat() && options && options.nationalPrefix === false ? false : true, carrierCode: carrierCode, metadata: metadata }); } function chooseFormatForNumber(availableFormats, nationalNnumber) { for (var _iterator = _createForOfIteratorHelperLoose(availableFormats), _step; !(_step = _iterator()).done;) { var format = _step.value; // Validate leading digits. // The test case for "else path" could be found by searching for // "format.leadingDigitsPatterns().length === 0". if (format.leadingDigitsPatterns().length > 0) { // The last leading_digits_pattern is used here, as it is the most detailed var lastLeadingDigitsPattern = format.leadingDigitsPatterns()[format.leadingDigitsPatterns().length - 1]; // If leading digits don't match then move on to the next phone number format if (nationalNnumber.search(lastLeadingDigitsPattern) !== 0) { continue; } } // Check that the national number matches the phone number format regular expression if ((0, _matchesEntirely["default"])(nationalNnumber, format.pattern())) { return format; } } } function addExtension(formattedNumber, ext, metadata, formatExtension) { return ext ? formatExtension(formattedNumber, ext, metadata) : formattedNumber; } function formatIDD(nationalNumber, carrierCode, countryCallingCode, fromCountry, metadata) { var fromCountryCallingCode = (0, _metadata.getCountryCallingCode)(fromCountry, metadata.metadata); // When calling within the same country calling code. if (fromCountryCallingCode === countryCallingCode) { var formattedNumber = formatNationalNumber(nationalNumber, carrierCode, 'NATIONAL', metadata); // For NANPA regions, return the national format for these regions // but prefix it with the country calling code. if (countryCallingCode === '1') { return countryCallingCode + ' ' + formattedNumber; } // If regions share a country calling code, the country calling code need // not be dialled. This also applies when dialling within a region, so this // if clause covers both these cases. Technically this is the case for // dialling from La Reunion to other overseas departments of France (French // Guiana, Martinique, Guadeloupe), but not vice versa - so we don't cover // this edge case for now and for those cases return the version including // country calling code. Details here: // http://www.petitfute.com/voyage/225-info-pratiques-reunion // return formattedNumber; } var iddPrefix = (0, _getIddPrefix["default"])(fromCountry, undefined, metadata.metadata); if (iddPrefix) { return "".concat(iddPrefix, " ").concat(countryCallingCode, " ").concat(formatNationalNumber(nationalNumber, null, 'INTERNATIONAL', metadata)); } } //# sourceMappingURL=format_.js.map /***/ }), /***/ "./node_modules/libphonenumber-js/build/getCountries.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports["default"] = getCountries; var _metadata = _interopRequireDefault(__webpack_require__("./node_modules/libphonenumber-js/build/metadata.js")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } function getCountries(metadata) { return new _metadata["default"](metadata).getCountries(); } //# sourceMappingURL=getCountries.js.map /***/ }), /***/ "./node_modules/libphonenumber-js/build/getCountryCallingCode.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "default", { enumerable: true, get: function get() { return _metadata.getCountryCallingCode; } }); var _metadata = __webpack_require__("./node_modules/libphonenumber-js/build/metadata.js"); //# sourceMappingURL=getCountryCallingCode.js.map /***/ }), /***/ "./node_modules/libphonenumber-js/build/getExampleNumber.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports["default"] = getExampleNumber; var _PhoneNumber = _interopRequireDefault(__webpack_require__("./node_modules/libphonenumber-js/build/PhoneNumber.js")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } function getExampleNumber(country, examples, metadata) { if (examples[country]) { return new _PhoneNumber["default"](country, examples[country], metadata); } } //# sourceMappingURL=getExampleNumber.js.map /***/ }), /***/ "./node_modules/libphonenumber-js/build/getNumberType.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports["default"] = getNumberType; exports.normalizeArguments = normalizeArguments; var _isViablePhoneNumber = _interopRequireDefault(__webpack_require__("./node_modules/libphonenumber-js/build/helpers/isViablePhoneNumber.js")); var _getNumberType2 = _interopRequireDefault(__webpack_require__("./node_modules/libphonenumber-js/build/helpers/getNumberType.js")); var _parse_ = _interopRequireDefault(__webpack_require__("./node_modules/libphonenumber-js/build/parse_.js")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } // Finds out national phone number type (fixed line, mobile, etc) function getNumberType() { var _normalizeArguments = normalizeArguments(arguments), input = _normalizeArguments.input, options = _normalizeArguments.options, metadata = _normalizeArguments.metadata; return (0, _getNumberType2["default"])(input, options, metadata); } // Sort out arguments function normalizeArguments(args) { var _Array$prototype$slic = Array.prototype.slice.call(args), _Array$prototype$slic2 = _slicedToArray(_Array$prototype$slic, 4), arg_1 = _Array$prototype$slic2[0], arg_2 = _Array$prototype$slic2[1], arg_3 = _Array$prototype$slic2[2], arg_4 = _Array$prototype$slic2[3]; var input; var options = {}; var metadata; // If the phone number is passed as a string. // `getNumberType('88005553535', ...)`. if (typeof arg_1 === 'string') { // If "default country" argument is being passed // then convert it to an `options` object. // `getNumberType('88005553535', 'RU', metadata)`. if (_typeof(arg_2) !== 'object') { if (arg_4) { options = arg_3; metadata = arg_4; } else { metadata = arg_3; } // `parse` extracts phone numbers from raw text, // therefore it will cut off all "garbage" characters, // while this `validate` function needs to verify // that the phone number contains no "garbage" // therefore the explicit `isViablePhoneNumber` check. if ((0, _isViablePhoneNumber["default"])(arg_1)) { input = (0, _parse_["default"])(arg_1, { defaultCountry: arg_2 }, metadata); } else { input = {}; } } // No "resrict country" argument is being passed. // International phone number is passed. // `getNumberType('+78005553535', metadata)`. else { if (arg_3) { options = arg_2; metadata = arg_3; } else { metadata = arg_2; } // `parse` extracts phone numbers from raw text, // therefore it will cut off all "garbage" characters, // while this `validate` function needs to verify // that the phone number contains no "garbage" // therefore the explicit `isViablePhoneNumber` check. if ((0, _isViablePhoneNumber["default"])(arg_1)) { input = (0, _parse_["default"])(arg_1, undefined, metadata); } else { input = {}; } } } // If the phone number is passed as a parsed phone number. // `getNumberType({ phone: '88005553535', country: 'RU' }, ...)`. else if (is_object(arg_1)) { input = arg_1; if (arg_3) { options = arg_2; metadata = arg_3; } else { metadata = arg_2; } } else throw new TypeError('A phone number must either be a string or an object of shape { phone, [country] }.'); return { input: input, options: options, metadata: metadata }; } // Babel transforms `typeof` into some "branches" // so istanbul will show this as "branch not covered". /* istanbul ignore next */ var is_object = function is_object(_) { return _typeof(_) === 'object'; }; //# sourceMappingURL=getNumberType.js.map /***/ }), /***/ "./node_modules/libphonenumber-js/build/helpers/RFC3966.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.formatRFC3966 = formatRFC3966; exports.parseRFC3966 = parseRFC3966; var _isViablePhoneNumber = _interopRequireDefault(__webpack_require__("./node_modules/libphonenumber-js/build/helpers/isViablePhoneNumber.js")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } function _createForOfIteratorHelperLoose(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (it) return (it = it.call(o)).next.bind(it); if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } // https://www.ietf.org/rfc/rfc3966.txt /** * @param {string} text - Phone URI (RFC 3966). * @return {object} `{ ?number, ?ext }`. */ function parseRFC3966(text) { var number; var ext; // Replace "tel:" with "tel=" for parsing convenience. text = text.replace(/^tel:/, 'tel='); for (var _iterator = _createForOfIteratorHelperLoose(text.split(';')), _step; !(_step = _iterator()).done;) { var part = _step.value; var _part$split = part.split('='), _part$split2 = _slicedToArray(_part$split, 2), name = _part$split2[0], value = _part$split2[1]; switch (name) { case 'tel': number = value; break; case 'ext': ext = value; break; case 'phone-context': // Only "country contexts" are supported. // "Domain contexts" are ignored. if (value[0] === '+') { number = value + number; } break; } } // If the phone number is not viable, then abort. if (!(0, _isViablePhoneNumber["default"])(number)) { return {}; } var result = { number: number }; if (ext) { result.ext = ext; } return result; } /** * @param {object} - `{ ?number, ?extension }`. * @return {string} Phone URI (RFC 3966). */ function formatRFC3966(_ref) { var number = _ref.number, ext = _ref.ext; if (!number) { return ''; } if (number[0] !== '+') { throw new Error("\"formatRFC3966()\" expects \"number\" to be in E.164 format."); } return "tel:".concat(number).concat(ext ? ';ext=' + ext : ''); } //# sourceMappingURL=RFC3966.js.map /***/ }), /***/ "./node_modules/libphonenumber-js/build/helpers/applyInternationalSeparatorStyle.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports["default"] = applyInternationalSeparatorStyle; var _constants = __webpack_require__("./node_modules/libphonenumber-js/build/constants.js"); // Removes brackets and replaces dashes with spaces. // // E.g. "(999) 111-22-33" -> "999 111 22 33" // // For some reason Google's metadata contains ``s with brackets and dashes. // Meanwhile, there's no single opinion about using punctuation in international phone numbers. // // For example, Google's `` for USA is `+1 213-373-4253`. // And here's a quote from WikiPedia's "North American Numbering Plan" page: // https://en.wikipedia.org/wiki/North_American_Numbering_Plan // // "The country calling code for all countries participating in the NANP is 1. // In international format, an NANP number should be listed as +1 301 555 01 00, // where 301 is an area code (Maryland)." // // I personally prefer the international format without any punctuation. // For example, brackets are remnants of the old age, meaning that the // phone number part in brackets (so called "area code") can be omitted // if dialing within the same "area". // And hyphens were clearly introduced for splitting local numbers into memorizable groups. // For example, remembering "5553535" is difficult but "555-35-35" is much simpler. // Imagine a man taking a bus from home to work and seeing an ad with a phone number. // He has a couple of seconds to memorize that number until it passes by. // If it were spaces instead of hyphens the man wouldn't necessarily get it, // but with hyphens instead of spaces the grouping is more explicit. // I personally think that hyphens introduce visual clutter, // so I prefer replacing them with spaces in international numbers. // In the modern age all output is done on displays where spaces are clearly distinguishable // so hyphens can be safely replaced with spaces without losing any legibility. // function applyInternationalSeparatorStyle(formattedNumber) { return formattedNumber.replace(new RegExp("[".concat(_constants.VALID_PUNCTUATION, "]+"), 'g'), ' ').trim(); } //# sourceMappingURL=applyInternationalSeparatorStyle.js.map /***/ }), /***/ "./node_modules/libphonenumber-js/build/helpers/checkNumberLength.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.checkNumberLengthForType = checkNumberLengthForType; exports["default"] = checkNumberLength; var _mergeArrays = _interopRequireDefault(__webpack_require__("./node_modules/libphonenumber-js/build/helpers/mergeArrays.js")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } function checkNumberLength(nationalNumber, metadata) { return checkNumberLengthForType(nationalNumber, undefined, metadata); } // Checks whether a number is possible for the country based on its length. // Should only be called for the "new" metadata which has "possible lengths". function checkNumberLengthForType(nationalNumber, type, metadata) { var type_info = metadata.type(type); // There should always be "" set for every type element. // This is declared in the XML schema. // For size efficiency, where a sub-description (e.g. fixed-line) // has the same "" as the "general description", this is missing, // so we fall back to the "general description". Where no numbers of the type // exist at all, there is one possible length (-1) which is guaranteed // not to match the length of any real phone number. var possible_lengths = type_info && type_info.possibleLengths() || metadata.possibleLengths(); // let local_lengths = type_info && type.possibleLengthsLocal() || metadata.possibleLengthsLocal() // Metadata before version `1.0.18` didn't contain `possible_lengths`. if (!possible_lengths) { return 'IS_POSSIBLE'; } if (type === 'FIXED_LINE_OR_MOBILE') { // No such country in metadata. /* istanbul ignore next */ if (!metadata.type('FIXED_LINE')) { // The rare case has been encountered where no fixedLine data is available // (true for some non-geographic entities), so we just check mobile. return checkNumberLengthForType(nationalNumber, 'MOBILE', metadata); } var mobile_type = metadata.type('MOBILE'); if (mobile_type) { // Merge the mobile data in if there was any. "Concat" creates a new // array, it doesn't edit possible_lengths in place, so we don't need a copy. // Note that when adding the possible lengths from mobile, we have // to again check they aren't empty since if they are this indicates // they are the same as the general desc and should be obtained from there. possible_lengths = (0, _mergeArrays["default"])(possible_lengths, mobile_type.possibleLengths()); // The current list is sorted; we need to merge in the new list and // re-sort (duplicates are okay). Sorting isn't so expensive because // the lists are very small. // if (local_lengths) { // local_lengths = mergeArrays(local_lengths, mobile_type.possibleLengthsLocal()) // } else { // local_lengths = mobile_type.possibleLengthsLocal() // } } } // If the type doesn't exist then return 'INVALID_LENGTH'. else if (type && !type_info) { return 'INVALID_LENGTH'; } var actual_length = nationalNumber.length; // In `libphonenumber-js` all "local-only" formats are dropped for simplicity. // // This is safe because there is never an overlap beween the possible lengths // // and the local-only lengths; this is checked at build time. // if (local_lengths && local_lengths.indexOf(nationalNumber.length) >= 0) // { // return 'IS_POSSIBLE_LOCAL_ONLY' // } var minimum_length = possible_lengths[0]; if (minimum_length === actual_length) { return 'IS_POSSIBLE'; } if (minimum_length > actual_length) { return 'TOO_SHORT'; } if (possible_lengths[possible_lengths.length - 1] < actual_length) { return 'TOO_LONG'; } // We skip the first element since we've already checked it. return possible_lengths.indexOf(actual_length, 1) >= 0 ? 'IS_POSSIBLE' : 'INVALID_LENGTH'; } //# sourceMappingURL=checkNumberLength.js.map /***/ }), /***/ "./node_modules/libphonenumber-js/build/helpers/extension/createExtensionPattern.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports["default"] = createExtensionPattern; var _constants = __webpack_require__("./node_modules/libphonenumber-js/build/constants.js"); // The RFC 3966 format for extensions. var RFC3966_EXTN_PREFIX = ';ext='; /** * Helper method for constructing regular expressions for parsing. Creates * an expression that captures up to max_length digits. * @return {string} RegEx pattern to capture extension digits. */ var getExtensionDigitsPattern = function getExtensionDigitsPattern(maxLength) { return "([".concat(_constants.VALID_DIGITS, "]{1,").concat(maxLength, "})"); }; /** * Helper initialiser method to create the regular-expression pattern to match * extensions. * Copy-pasted from Google's `libphonenumber`: * https://github.com/google/libphonenumber/blob/55b2646ec9393f4d3d6661b9c82ef9e258e8b829/javascript/i18n/phonenumbers/phonenumberutil.js#L759-L766 * @return {string} RegEx pattern to capture extensions. */ function createExtensionPattern(purpose) { // We cap the maximum length of an extension based on the ambiguity of the way // the extension is prefixed. As per ITU, the officially allowed length for // extensions is actually 40, but we don't support this since we haven't seen real // examples and this introduces many false interpretations as the extension labels // are not standardized. /** @type {string} */ var extLimitAfterExplicitLabel = '20'; /** @type {string} */ var extLimitAfterLikelyLabel = '15'; /** @type {string} */ var extLimitAfterAmbiguousChar = '9'; /** @type {string} */ var extLimitWhenNotSure = '6'; /** @type {string} */ var possibleSeparatorsBetweenNumberAndExtLabel = "[ \xA0\\t,]*"; // Optional full stop (.) or colon, followed by zero or more spaces/tabs/commas. /** @type {string} */ var possibleCharsAfterExtLabel = "[:\\.\uFF0E]?[ \xA0\\t,-]*"; /** @type {string} */ var optionalExtnSuffix = "#?"; // Here the extension is called out in more explicit way, i.e mentioning it obvious // patterns like "ext.". /** @type {string} */ var explicitExtLabels = "(?:e?xt(?:ensi(?:o\u0301?|\xF3))?n?|\uFF45?\uFF58\uFF54\uFF4E?|\u0434\u043E\u0431|anexo)"; // One-character symbols that can be used to indicate an extension, and less // commonly used or more ambiguous extension labels. /** @type {string} */ var ambiguousExtLabels = "(?:[x\uFF58#\uFF03~\uFF5E]|int|\uFF49\uFF4E\uFF54)"; // When extension is not separated clearly. /** @type {string} */ var ambiguousSeparator = "[- ]+"; // This is the same as possibleSeparatorsBetweenNumberAndExtLabel, but not matching // comma as extension label may have it. /** @type {string} */ var possibleSeparatorsNumberExtLabelNoComma = "[ \xA0\\t]*"; // ",," is commonly used for auto dialling the extension when connected. First // comma is matched through possibleSeparatorsBetweenNumberAndExtLabel, so we do // not repeat it here. Semi-colon works in Iphone and Android also to pop up a // button with the extension number following. /** @type {string} */ var autoDiallingAndExtLabelsFound = "(?:,{2}|;)"; /** @type {string} */ var rfcExtn = RFC3966_EXTN_PREFIX + getExtensionDigitsPattern(extLimitAfterExplicitLabel); /** @type {string} */ var explicitExtn = possibleSeparatorsBetweenNumberAndExtLabel + explicitExtLabels + possibleCharsAfterExtLabel + getExtensionDigitsPattern(extLimitAfterExplicitLabel) + optionalExtnSuffix; /** @type {string} */ var ambiguousExtn = possibleSeparatorsBetweenNumberAndExtLabel + ambiguousExtLabels + possibleCharsAfterExtLabel + getExtensionDigitsPattern(extLimitAfterAmbiguousChar) + optionalExtnSuffix; /** @type {string} */ var americanStyleExtnWithSuffix = ambiguousSeparator + getExtensionDigitsPattern(extLimitWhenNotSure) + "#"; /** @type {string} */ var autoDiallingExtn = possibleSeparatorsNumberExtLabelNoComma + autoDiallingAndExtLabelsFound + possibleCharsAfterExtLabel + getExtensionDigitsPattern(extLimitAfterLikelyLabel) + optionalExtnSuffix; /** @type {string} */ var onlyCommasExtn = possibleSeparatorsNumberExtLabelNoComma + "(?:,)+" + possibleCharsAfterExtLabel + getExtensionDigitsPattern(extLimitAfterAmbiguousChar) + optionalExtnSuffix; // The first regular expression covers RFC 3966 format, where the extension is added // using ";ext=". The second more generic where extension is mentioned with explicit // labels like "ext:". In both the above cases we allow more numbers in extension than // any other extension labels. The third one captures when single character extension // labels or less commonly used labels are used. In such cases we capture fewer // extension digits in order to reduce the chance of falsely interpreting two // numbers beside each other as a number + extension. The fourth one covers the // special case of American numbers where the extension is written with a hash // at the end, such as "- 503#". The fifth one is exclusively for extension // autodialling formats which are used when dialling and in this case we accept longer // extensions. The last one is more liberal on the number of commas that acts as // extension labels, so we have a strict cap on the number of digits in such extensions. return rfcExtn + "|" + explicitExtn + "|" + ambiguousExtn + "|" + americanStyleExtnWithSuffix + "|" + autoDiallingExtn + "|" + onlyCommasExtn; } //# sourceMappingURL=createExtensionPattern.js.map /***/ }), /***/ "./node_modules/libphonenumber-js/build/helpers/extension/extractExtension.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports["default"] = extractExtension; var _createExtensionPattern = _interopRequireDefault(__webpack_require__("./node_modules/libphonenumber-js/build/helpers/extension/createExtensionPattern.js")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } // Regexp of all known extension prefixes used by different regions followed by // 1 or more valid digits, for use when parsing. var EXTN_PATTERN = new RegExp('(?:' + (0, _createExtensionPattern["default"])() + ')$', 'i'); // Strips any extension (as in, the part of the number dialled after the call is // connected, usually indicated with extn, ext, x or similar) from the end of // the number, and returns it. function extractExtension(number) { var start = number.search(EXTN_PATTERN); if (start < 0) { return {}; } // If we find a potential extension, and the number preceding this is a viable // number, we assume it is an extension. var numberWithoutExtension = number.slice(0, start); var matches = number.match(EXTN_PATTERN); var i = 1; while (i < matches.length) { if (matches[i]) { return { number: numberWithoutExtension, ext: matches[i] }; } i++; } } //# sourceMappingURL=extractExtension.js.map /***/ }), /***/ "./node_modules/libphonenumber-js/build/helpers/extractCountryCallingCode.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports["default"] = extractCountryCallingCode; var _stripIddPrefix = _interopRequireDefault(__webpack_require__("./node_modules/libphonenumber-js/build/helpers/stripIddPrefix.js")); var _extractCountryCallingCodeFromInternationalNumberWithoutPlusSign = _interopRequireDefault(__webpack_require__("./node_modules/libphonenumber-js/build/helpers/extractCountryCallingCodeFromInternationalNumberWithoutPlusSign.js")); var _metadata = _interopRequireDefault(__webpack_require__("./node_modules/libphonenumber-js/build/metadata.js")); var _constants = __webpack_require__("./node_modules/libphonenumber-js/build/constants.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } /** * Converts a phone number digits (possibly with a `+`) * into a calling code and the rest phone number digits. * The "rest phone number digits" could include * a national prefix, carrier code, and national * (significant) number. * @param {string} number — Phone number digits (possibly with a `+`). * @param {string} [country] — Default country. * @param {string} [callingCode] — Default calling code (some phone numbering plans are non-geographic). * @param {object} metadata * @return {object} `{ countryCallingCode: string?, number: string }` * @example * // Returns `{ countryCallingCode: "1", number: "2133734253" }`. * extractCountryCallingCode('2133734253', 'US', null, metadata) * extractCountryCallingCode('2133734253', null, '1', metadata) * extractCountryCallingCode('+12133734253', null, null, metadata) * extractCountryCallingCode('+12133734253', 'RU', null, metadata) */ function extractCountryCallingCode(number, country, callingCode, metadata) { if (!number) { return {}; } // If this is not an international phone number, // then either extract an "IDD" prefix, or extract a // country calling code from a number by autocorrecting it // by prepending a leading `+` in cases when it starts // with the country calling code. // https://wikitravel.org/en/International_dialling_prefix // https://github.com/catamphetamine/libphonenumber-js/issues/376 if (number[0] !== '+') { // Convert an "out-of-country" dialing phone number // to a proper international phone number. var numberWithoutIDD = (0, _stripIddPrefix["default"])(number, country, callingCode, metadata); // If an IDD prefix was stripped then // convert the number to international one // for subsequent parsing. if (numberWithoutIDD && numberWithoutIDD !== number) { number = '+' + numberWithoutIDD; } else { // Check to see if the number starts with the country calling code // for the default country. If so, we remove the country calling code, // and do some checks on the validity of the number before and after. // https://github.com/catamphetamine/libphonenumber-js/issues/376 if (country || callingCode) { var _extractCountryCallin = (0, _extractCountryCallingCodeFromInternationalNumberWithoutPlusSign["default"])(number, country, callingCode, metadata), countryCallingCode = _extractCountryCallin.countryCallingCode, shorterNumber = _extractCountryCallin.number; if (countryCallingCode) { return { countryCallingCode: countryCallingCode, number: shorterNumber }; } } return { number: number }; } } // Fast abortion: country codes do not begin with a '0' if (number[1] === '0') { return {}; } metadata = new _metadata["default"](metadata); // The thing with country phone codes // is that they are orthogonal to each other // i.e. there's no such country phone code A // for which country phone code B exists // where B starts with A. // Therefore, while scanning digits, // if a valid country code is found, // that means that it is the country code. // var i = 2; while (i - 1 <= _constants.MAX_LENGTH_COUNTRY_CODE && i <= number.length) { var _countryCallingCode = number.slice(1, i); if (metadata.hasCallingCode(_countryCallingCode)) { metadata.selectNumberingPlan(_countryCallingCode); return { countryCallingCode: _countryCallingCode, number: number.slice(i) }; } i++; } return {}; } //# sourceMappingURL=extractCountryCallingCode.js.map /***/ }), /***/ "./node_modules/libphonenumber-js/build/helpers/extractCountryCallingCodeFromInternationalNumberWithoutPlusSign.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports["default"] = extractCountryCallingCodeFromInternationalNumberWithoutPlusSign; var _metadata = _interopRequireDefault(__webpack_require__("./node_modules/libphonenumber-js/build/metadata.js")); var _matchesEntirely = _interopRequireDefault(__webpack_require__("./node_modules/libphonenumber-js/build/helpers/matchesEntirely.js")); var _extractNationalNumber = _interopRequireDefault(__webpack_require__("./node_modules/libphonenumber-js/build/helpers/extractNationalNumber.js")); var _checkNumberLength = _interopRequireDefault(__webpack_require__("./node_modules/libphonenumber-js/build/helpers/checkNumberLength.js")); var _getCountryCallingCode = _interopRequireDefault(__webpack_require__("./node_modules/libphonenumber-js/build/getCountryCallingCode.js")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } /** * Sometimes some people incorrectly input international phone numbers * without the leading `+`. This function corrects such input. * @param {string} number — Phone number digits. * @param {string?} country * @param {string?} callingCode * @param {object} metadata * @return {object} `{ countryCallingCode: string?, number: string }`. */ function extractCountryCallingCodeFromInternationalNumberWithoutPlusSign(number, country, callingCode, metadata) { var countryCallingCode = country ? (0, _getCountryCallingCode["default"])(country, metadata) : callingCode; if (number.indexOf(countryCallingCode) === 0) { metadata = new _metadata["default"](metadata); metadata.selectNumberingPlan(country, callingCode); var possibleShorterNumber = number.slice(countryCallingCode.length); var _extractNationalNumbe = (0, _extractNationalNumber["default"])(possibleShorterNumber, metadata), possibleShorterNationalNumber = _extractNationalNumbe.nationalNumber; var _extractNationalNumbe2 = (0, _extractNationalNumber["default"])(number, metadata), nationalNumber = _extractNationalNumbe2.nationalNumber; // If the number was not valid before but is valid now, // or if it was too long before, we consider the number // with the country calling code stripped to be a better result // and keep that instead. // For example, in Germany (+49), `49` is a valid area code, // so if a number starts with `49`, it could be both a valid // national German number or an international number without // a leading `+`. if (!(0, _matchesEntirely["default"])(nationalNumber, metadata.nationalNumberPattern()) && (0, _matchesEntirely["default"])(possibleShorterNationalNumber, metadata.nationalNumberPattern()) || (0, _checkNumberLength["default"])(nationalNumber, metadata) === 'TOO_LONG') { return { countryCallingCode: countryCallingCode, number: possibleShorterNumber }; } } return { number: number }; } //# sourceMappingURL=extractCountryCallingCodeFromInternationalNumberWithoutPlusSign.js.map /***/ }), /***/ "./node_modules/libphonenumber-js/build/helpers/extractNationalNumber.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports["default"] = extractNationalNumber; var _extractNationalNumberFromPossiblyIncompleteNumber = _interopRequireDefault(__webpack_require__("./node_modules/libphonenumber-js/build/helpers/extractNationalNumberFromPossiblyIncompleteNumber.js")); var _matchesEntirely = _interopRequireDefault(__webpack_require__("./node_modules/libphonenumber-js/build/helpers/matchesEntirely.js")); var _checkNumberLength = _interopRequireDefault(__webpack_require__("./node_modules/libphonenumber-js/build/helpers/checkNumberLength.js")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } /** * Strips national prefix and carrier code from a complete phone number. * The difference from the non-"FromCompleteNumber" function is that * it won't extract national prefix if the resultant number is too short * to be a complete number for the selected phone numbering plan. * @param {string} number — Complete phone number digits. * @param {Metadata} metadata — Metadata with a phone numbering plan selected. * @return {object} `{ nationalNumber: string, carrierCode: string? }`. */ function extractNationalNumber(number, metadata) { // Parsing national prefixes and carrier codes // is only required for local phone numbers // but some people don't understand that // and sometimes write international phone numbers // with national prefixes (or maybe even carrier codes). // http://ucken.blogspot.ru/2016/03/trunk-prefixes-in-skype4b.html // Google's original library forgives such mistakes // and so does this library, because it has been requested: // https://github.com/catamphetamine/libphonenumber-js/issues/127 var _extractNationalNumbe = (0, _extractNationalNumberFromPossiblyIncompleteNumber["default"])(number, metadata), carrierCode = _extractNationalNumbe.carrierCode, nationalNumber = _extractNationalNumbe.nationalNumber; if (nationalNumber !== number) { if (!shouldHaveExtractedNationalPrefix(number, nationalNumber, metadata)) { // Don't strip the national prefix. return { nationalNumber: number }; } // Check the national (significant) number length after extracting national prefix and carrier code. // Legacy generated metadata (before `1.0.18`) didn't support the "possible lengths" feature. if (metadata.possibleLengths()) { // The number remaining after stripping the national prefix and carrier code // should be long enough to have a possible length for the country. // Otherwise, don't strip the national prefix and carrier code, // since the original number could be a valid number. // This check has been copy-pasted "as is" from Google's original library: // https://github.com/google/libphonenumber/blob/876268eb1ad6cdc1b7b5bef17fc5e43052702d57/java/libphonenumber/src/com/google/i18n/phonenumbers/PhoneNumberUtil.java#L3236-L3250 // It doesn't check for the "possibility" of the original `number`. // I guess it's fine not checking that one. It works as is anyway. if (!isPossibleIncompleteNationalNumber(nationalNumber, metadata)) { // Don't strip the national prefix. return { nationalNumber: number }; } } } return { nationalNumber: nationalNumber, carrierCode: carrierCode }; } // In some countries, the same digit could be a national prefix // or a leading digit of a valid phone number. // For example, in Russia, national prefix is `8`, // and also `800 555 35 35` is a valid number // in which `8` is not a national prefix, but the first digit // of a national (significant) number. // Same's with Belarus: // `82004910060` is a valid national (significant) number, // but `2004910060` is not. // To support such cases (to prevent the code from always stripping // national prefix), a condition is imposed: a national prefix // is not extracted when the original number is "viable" and the // resultant number is not, a "viable" national number being the one // that matches `national_number_pattern`. function shouldHaveExtractedNationalPrefix(nationalNumberBefore, nationalNumberAfter, metadata) { // The equivalent in Google's code is: // https://github.com/google/libphonenumber/blob/e326fa1fc4283bb05eb35cb3c15c18f98a31af33/java/libphonenumber/src/com/google/i18n/phonenumbers/PhoneNumberUtil.java#L2969-L3004 if ((0, _matchesEntirely["default"])(nationalNumberBefore, metadata.nationalNumberPattern()) && !(0, _matchesEntirely["default"])(nationalNumberAfter, metadata.nationalNumberPattern())) { return false; } // This "is possible" national number (length) check has been commented out // because it's superceded by the (effectively) same check done in the // `extractNationalNumber()` function after it calls `shouldHaveExtractedNationalPrefix()`. // In other words, why run the same check twice if it could only be run once. // // Check the national (significant) number length after extracting national prefix and carrier code. // // Fixes a minor "weird behavior" bug: https://gitlab.com/catamphetamine/libphonenumber-js/-/issues/57 // // (Legacy generated metadata (before `1.0.18`) didn't support the "possible lengths" feature). // if (metadata.possibleLengths()) { // if (isPossibleIncompleteNationalNumber(nationalNumberBefore, metadata) && // !isPossibleIncompleteNationalNumber(nationalNumberAfter, metadata)) { // return false // } // } return true; } function isPossibleIncompleteNationalNumber(nationalNumber, metadata) { switch ((0, _checkNumberLength["default"])(nationalNumber, metadata)) { case 'TOO_SHORT': case 'INVALID_LENGTH': // This library ignores "local-only" phone numbers (for simplicity). // See the readme for more info on what are "local-only" phone numbers. // case 'IS_POSSIBLE_LOCAL_ONLY': return false; default: return true; } } //# sourceMappingURL=extractNationalNumber.js.map /***/ }), /***/ "./node_modules/libphonenumber-js/build/helpers/extractNationalNumberFromPossiblyIncompleteNumber.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports["default"] = extractNationalNumberFromPossiblyIncompleteNumber; /** * Strips any national prefix (such as 0, 1) present in a * (possibly incomplete) number provided. * "Carrier codes" are only used in Colombia and Brazil, * and only when dialing within those countries from a mobile phone to a fixed line number. * Sometimes it won't actually strip national prefix * and will instead prepend some digits to the `number`: * for example, when number `2345678` is passed with `VI` country selected, * it will return `{ number: "3402345678" }`, because `340` area code is prepended. * @param {string} number — National number digits. * @param {object} metadata — Metadata with country selected. * @return {object} `{ nationalNumber: string, nationalPrefix: string? carrierCode: string? }`. Even if a national prefix was extracted, it's not necessarily present in the returned object, so don't rely on its presence in the returned object in order to find out whether a national prefix has been extracted or not. */ function extractNationalNumberFromPossiblyIncompleteNumber(number, metadata) { if (number && metadata.numberingPlan.nationalPrefixForParsing()) { // See METADATA.md for the description of // `national_prefix_for_parsing` and `national_prefix_transform_rule`. // Attempt to parse the first digits as a national prefix. var prefixPattern = new RegExp('^(?:' + metadata.numberingPlan.nationalPrefixForParsing() + ')'); var prefixMatch = prefixPattern.exec(number); if (prefixMatch) { var nationalNumber; var carrierCode; // https://gitlab.com/catamphetamine/libphonenumber-js/-/blob/master/METADATA.md#national_prefix_for_parsing--national_prefix_transform_rule // If a `national_prefix_for_parsing` has any "capturing groups" // then it means that the national (significant) number is equal to // those "capturing groups" transformed via `national_prefix_transform_rule`, // and nothing could be said about the actual national prefix: // what is it and was it even there. // If a `national_prefix_for_parsing` doesn't have any "capturing groups", // then everything it matches is a national prefix. // To determine whether `national_prefix_for_parsing` matched any // "capturing groups", the value of the result of calling `.exec()` // is looked at, and if it has non-undefined values where there're // "capturing groups" in the regular expression, then it means // that "capturing groups" have been matched. // It's not possible to tell whether there'll be any "capturing gropus" // before the matching process, because a `national_prefix_for_parsing` // could exhibit both behaviors. var capturedGroupsCount = prefixMatch.length - 1; var hasCapturedGroups = capturedGroupsCount > 0 && prefixMatch[capturedGroupsCount]; if (metadata.nationalPrefixTransformRule() && hasCapturedGroups) { nationalNumber = number.replace(prefixPattern, metadata.nationalPrefixTransformRule()); // If there's more than one captured group, // then carrier code is the second one. if (capturedGroupsCount > 1) { carrierCode = prefixMatch[1]; } } // If there're no "capturing groups", // or if there're "capturing groups" but no // `national_prefix_transform_rule`, // then just strip the national prefix from the number, // and possibly a carrier code. // Seems like there could be more. else { // `prefixBeforeNationalNumber` is the whole substring matched by // the `national_prefix_for_parsing` regular expression. // There seem to be no guarantees that it's just a national prefix. // For example, if there's a carrier code, it's gonna be a // part of `prefixBeforeNationalNumber` too. var prefixBeforeNationalNumber = prefixMatch[0]; nationalNumber = number.slice(prefixBeforeNationalNumber.length); // If there's at least one captured group, // then carrier code is the first one. if (hasCapturedGroups) { carrierCode = prefixMatch[1]; } } // Tries to guess whether a national prefix was present in the input. // This is not something copy-pasted from Google's library: // they don't seem to have an equivalent for that. // So this isn't an "officially approved" way of doing something like that. // But since there seems no other existing method, this library uses it. var nationalPrefix; if (hasCapturedGroups) { var possiblePositionOfTheFirstCapturedGroup = number.indexOf(prefixMatch[1]); var possibleNationalPrefix = number.slice(0, possiblePositionOfTheFirstCapturedGroup); // Example: an Argentinian (AR) phone number `0111523456789`. // `prefixMatch[0]` is `01115`, and `$1` is `11`, // and the rest of the phone number is `23456789`. // The national number is transformed via `9$1` to `91123456789`. // National prefix `0` is detected being present at the start. // if (possibleNationalPrefix.indexOf(metadata.numberingPlan.nationalPrefix()) === 0) { if (possibleNationalPrefix === metadata.numberingPlan.nationalPrefix()) { nationalPrefix = metadata.numberingPlan.nationalPrefix(); } } else { nationalPrefix = prefixMatch[0]; } return { nationalNumber: nationalNumber, nationalPrefix: nationalPrefix, carrierCode: carrierCode }; } } return { nationalNumber: number }; } //# sourceMappingURL=extractNationalNumberFromPossiblyIncompleteNumber.js.map /***/ }), /***/ "./node_modules/libphonenumber-js/build/helpers/formatNationalNumberUsingFormat.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.FIRST_GROUP_PATTERN = void 0; exports["default"] = formatNationalNumberUsingFormat; var _applyInternationalSeparatorStyle = _interopRequireDefault(__webpack_require__("./node_modules/libphonenumber-js/build/helpers/applyInternationalSeparatorStyle.js")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } // This was originally set to $1 but there are some countries for which the // first group is not used in the national pattern (e.g. Argentina) so the $1 // group does not match correctly. Therefore, we use `\d`, so that the first // group actually used in the pattern will be matched. var FIRST_GROUP_PATTERN = /(\$\d)/; exports.FIRST_GROUP_PATTERN = FIRST_GROUP_PATTERN; function formatNationalNumberUsingFormat(number, format, _ref) { var useInternationalFormat = _ref.useInternationalFormat, withNationalPrefix = _ref.withNationalPrefix, carrierCode = _ref.carrierCode, metadata = _ref.metadata; var formattedNumber = number.replace(new RegExp(format.pattern()), useInternationalFormat ? format.internationalFormat() : // This library doesn't use `domestic_carrier_code_formatting_rule`, // because that one is only used when formatting phone numbers // for dialing from a mobile phone, and this is not a dialing library. // carrierCode && format.domesticCarrierCodeFormattingRule() // // First, replace the $CC in the formatting rule with the desired carrier code. // // Then, replace the $FG in the formatting rule with the first group // // and the carrier code combined in the appropriate way. // ? format.format().replace(FIRST_GROUP_PATTERN, format.domesticCarrierCodeFormattingRule().replace('$CC', carrierCode)) // : ( // withNationalPrefix && format.nationalPrefixFormattingRule() // ? format.format().replace(FIRST_GROUP_PATTERN, format.nationalPrefixFormattingRule()) // : format.format() // ) withNationalPrefix && format.nationalPrefixFormattingRule() ? format.format().replace(FIRST_GROUP_PATTERN, format.nationalPrefixFormattingRule()) : format.format()); if (useInternationalFormat) { return (0, _applyInternationalSeparatorStyle["default"])(formattedNumber); } return formattedNumber; } //# sourceMappingURL=formatNationalNumberUsingFormat.js.map /***/ }), /***/ "./node_modules/libphonenumber-js/build/helpers/getCountryByCallingCode.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports["default"] = getCountryByCallingCode; var _metadata = _interopRequireDefault(__webpack_require__("./node_modules/libphonenumber-js/build/metadata.js")); var _getNumberType = _interopRequireDefault(__webpack_require__("./node_modules/libphonenumber-js/build/helpers/getNumberType.js")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } function _createForOfIteratorHelperLoose(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (it) return (it = it.call(o)).next.bind(it); if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } var USE_NON_GEOGRAPHIC_COUNTRY_CODE = false; function getCountryByCallingCode(callingCode, nationalPhoneNumber, metadata) { /* istanbul ignore if */ if (USE_NON_GEOGRAPHIC_COUNTRY_CODE) { if (metadata.isNonGeographicCallingCode(callingCode)) { return '001'; } } // Is always non-empty, because `callingCode` is always valid var possibleCountries = metadata.getCountryCodesForCallingCode(callingCode); if (!possibleCountries) { return; } // If there's just one country corresponding to the country code, // then just return it, without further phone number digits validation. if (possibleCountries.length === 1) { return possibleCountries[0]; } return selectCountryFromList(possibleCountries, nationalPhoneNumber, metadata.metadata); } function selectCountryFromList(possibleCountries, nationalPhoneNumber, metadata) { // Re-create `metadata` because it will be selecting a `country`. metadata = new _metadata["default"](metadata); for (var _iterator = _createForOfIteratorHelperLoose(possibleCountries), _step; !(_step = _iterator()).done;) { var country = _step.value; metadata.country(country); // Leading digits check would be the simplest and fastest one. // Leading digits patterns are only defined for about 20% of all countries. // https://gitlab.com/catamphetamine/libphonenumber-js/blob/master/METADATA.md#leading_digits // Matching "leading digits" is a sufficient but not necessary condition. if (metadata.leadingDigits()) { if (nationalPhoneNumber && nationalPhoneNumber.search(metadata.leadingDigits()) === 0) { return country; } } // Else perform full validation with all of those // fixed-line/mobile/etc regular expressions. else if ((0, _getNumberType["default"])({ phone: nationalPhoneNumber, country: country }, undefined, metadata.metadata)) { return country; } } } //# sourceMappingURL=getCountryByCallingCode.js.map /***/ }), /***/ "./node_modules/libphonenumber-js/build/helpers/getIddPrefix.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports["default"] = getIddPrefix; var _metadata = _interopRequireDefault(__webpack_require__("./node_modules/libphonenumber-js/build/metadata.js")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } /** * Pattern that makes it easy to distinguish whether a region has a single * international dialing prefix or not. If a region has a single international * prefix (e.g. 011 in USA), it will be represented as a string that contains * a sequence of ASCII digits, and possibly a tilde, which signals waiting for * the tone. If there are multiple available international prefixes in a * region, they will be represented as a regex string that always contains one * or more characters that are not ASCII digits or a tilde. */ var SINGLE_IDD_PREFIX_REG_EXP = /^[\d]+(?:[~\u2053\u223C\uFF5E][\d]+)?$/; // For regions that have multiple IDD prefixes // a preferred IDD prefix is returned. function getIddPrefix(country, callingCode, metadata) { var countryMetadata = new _metadata["default"](metadata); countryMetadata.selectNumberingPlan(country, callingCode); if (countryMetadata.defaultIDDPrefix()) { return countryMetadata.defaultIDDPrefix(); } if (SINGLE_IDD_PREFIX_REG_EXP.test(countryMetadata.IDDPrefix())) { return countryMetadata.IDDPrefix(); } } //# sourceMappingURL=getIddPrefix.js.map /***/ }), /***/ "./node_modules/libphonenumber-js/build/helpers/getNumberType.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports["default"] = getNumberType; exports.isNumberTypeEqualTo = isNumberTypeEqualTo; var _metadata = _interopRequireDefault(__webpack_require__("./node_modules/libphonenumber-js/build/metadata.js")); var _matchesEntirely = _interopRequireDefault(__webpack_require__("./node_modules/libphonenumber-js/build/helpers/matchesEntirely.js")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } function _createForOfIteratorHelperLoose(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (it) return (it = it.call(o)).next.bind(it); if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } var NON_FIXED_LINE_PHONE_TYPES = ['MOBILE', 'PREMIUM_RATE', 'TOLL_FREE', 'SHARED_COST', 'VOIP', 'PERSONAL_NUMBER', 'PAGER', 'UAN', 'VOICEMAIL']; // Finds out national phone number type (fixed line, mobile, etc) function getNumberType(input, options, metadata) { // If assigning the `{}` default value is moved to the arguments above, // code coverage would decrease for some weird reason. options = options || {}; // When `parse()` returned `{}` // meaning that the phone number is not a valid one. if (!input.country) { return; } metadata = new _metadata["default"](metadata); metadata.selectNumberingPlan(input.country, input.countryCallingCode); var nationalNumber = options.v2 ? input.nationalNumber : input.phone; // The following is copy-pasted from the original function: // https://github.com/googlei18n/libphonenumber/blob/3ea547d4fbaa2d0b67588904dfa5d3f2557c27ff/javascript/i18n/phonenumbers/phonenumberutil.js#L2835 // Is this national number even valid for this country if (!(0, _matchesEntirely["default"])(nationalNumber, metadata.nationalNumberPattern())) { return; } // Is it fixed line number if (isNumberTypeEqualTo(nationalNumber, 'FIXED_LINE', metadata)) { // Because duplicate regular expressions are removed // to reduce metadata size, if "mobile" pattern is "" // then it means it was removed due to being a duplicate of the fixed-line pattern. // if (metadata.type('MOBILE') && metadata.type('MOBILE').pattern() === '') { return 'FIXED_LINE_OR_MOBILE'; } // `MOBILE` type pattern isn't included if it matched `FIXED_LINE` one. // For example, for "US" country. // Old metadata (< `1.0.18`) had a specific "types" data structure // that happened to be `undefined` for `MOBILE` in that case. // Newer metadata (>= `1.0.18`) has another data structure that is // not `undefined` for `MOBILE` in that case (it's just an empty array). // So this `if` is just for backwards compatibility with old metadata. if (!metadata.type('MOBILE')) { return 'FIXED_LINE_OR_MOBILE'; } // Check if the number happens to qualify as both fixed line and mobile. // (no such country in the minimal metadata set) /* istanbul ignore if */ if (isNumberTypeEqualTo(nationalNumber, 'MOBILE', metadata)) { return 'FIXED_LINE_OR_MOBILE'; } return 'FIXED_LINE'; } for (var _iterator = _createForOfIteratorHelperLoose(NON_FIXED_LINE_PHONE_TYPES), _step; !(_step = _iterator()).done;) { var type = _step.value; if (isNumberTypeEqualTo(nationalNumber, type, metadata)) { return type; } } } function isNumberTypeEqualTo(nationalNumber, type, metadata) { type = metadata.type(type); if (!type || !type.pattern()) { return false; } // Check if any possible number lengths are present; // if so, we use them to avoid checking // the validation pattern if they don't match. // If they are absent, this means they match // the general description, which we have // already checked before a specific number type. if (type.possibleLengths() && type.possibleLengths().indexOf(nationalNumber.length) < 0) { return false; } return (0, _matchesEntirely["default"])(nationalNumber, type.pattern()); } //# sourceMappingURL=getNumberType.js.map /***/ }), /***/ "./node_modules/libphonenumber-js/build/helpers/isViablePhoneNumber.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.VALID_PHONE_NUMBER_WITH_EXTENSION = exports.VALID_PHONE_NUMBER = void 0; exports["default"] = isViablePhoneNumber; exports.isViablePhoneNumberStart = isViablePhoneNumberStart; var _constants = __webpack_require__("./node_modules/libphonenumber-js/build/constants.js"); var _createExtensionPattern = _interopRequireDefault(__webpack_require__("./node_modules/libphonenumber-js/build/helpers/extension/createExtensionPattern.js")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } // Regular expression of viable phone numbers. This is location independent. // Checks we have at least three leading digits, and only valid punctuation, // alpha characters and digits in the phone number. Does not include extension // data. The symbol 'x' is allowed here as valid punctuation since it is often // used as a placeholder for carrier codes, for example in Brazilian phone // numbers. We also allow multiple '+' characters at the start. // // Corresponds to the following: // [digits]{minLengthNsn}| // plus_sign* // (([punctuation]|[star])*[digits]){3,}([punctuation]|[star]|[digits]|[alpha])* // // The first reg-ex is to allow short numbers (two digits long) to be parsed if // they are entered as "15" etc, but only if there is no punctuation in them. // The second expression restricts the number of digits to three or more, but // then allows them to be in international form, and to have alpha-characters // and punctuation. We split up the two reg-exes here and combine them when // creating the reg-ex VALID_PHONE_NUMBER_PATTERN itself so we can prefix it // with ^ and append $ to each branch. // // "Note VALID_PUNCTUATION starts with a -, // so must be the first in the range" (c) Google devs. // (wtf did they mean by saying that; probably nothing) // var MIN_LENGTH_PHONE_NUMBER_PATTERN = '[' + _constants.VALID_DIGITS + ']{' + _constants.MIN_LENGTH_FOR_NSN + '}'; // // And this is the second reg-exp: // (see MIN_LENGTH_PHONE_NUMBER_PATTERN for a full description of this reg-exp) // var VALID_PHONE_NUMBER = '[' + _constants.PLUS_CHARS + ']{0,1}' + '(?:' + '[' + _constants.VALID_PUNCTUATION + ']*' + '[' + _constants.VALID_DIGITS + ']' + '){3,}' + '[' + _constants.VALID_PUNCTUATION + _constants.VALID_DIGITS + ']*'; // This regular expression isn't present in Google's `libphonenumber` // and is only used to determine whether the phone number being input // is too short for it to even consider it a "valid" number. // This is just a way to differentiate between a really invalid phone // number like "abcde" and a valid phone number that a user has just // started inputting, like "+1" or "1": both these cases would be // considered `NOT_A_NUMBER` by Google's `libphonenumber`, but this // library can provide a more detailed error message — whether it's // really "not a number", or is it just a start of a valid phone number. exports.VALID_PHONE_NUMBER = VALID_PHONE_NUMBER; var VALID_PHONE_NUMBER_START_REG_EXP = new RegExp('^' + '[' + _constants.PLUS_CHARS + ']{0,1}' + '(?:' + '[' + _constants.VALID_PUNCTUATION + ']*' + '[' + _constants.VALID_DIGITS + ']' + '){1,2}' + '$', 'i'); var VALID_PHONE_NUMBER_WITH_EXTENSION = VALID_PHONE_NUMBER + // Phone number extensions '(?:' + (0, _createExtensionPattern["default"])() + ')?'; // The combined regular expression for valid phone numbers: // exports.VALID_PHONE_NUMBER_WITH_EXTENSION = VALID_PHONE_NUMBER_WITH_EXTENSION; var VALID_PHONE_NUMBER_PATTERN = new RegExp( // Either a short two-digit-only phone number '^' + MIN_LENGTH_PHONE_NUMBER_PATTERN + '$' + '|' + // Or a longer fully parsed phone number (min 3 characters) '^' + VALID_PHONE_NUMBER_WITH_EXTENSION + '$', 'i'); // Checks to see if the string of characters could possibly be a phone number at // all. At the moment, checks to see that the string begins with at least 2 // digits, ignoring any punctuation commonly found in phone numbers. This method // does not require the number to be normalized in advance - but does assume // that leading non-number symbols have been removed, such as by the method // `extract_possible_number`. // function isViablePhoneNumber(number) { return number.length >= _constants.MIN_LENGTH_FOR_NSN && VALID_PHONE_NUMBER_PATTERN.test(number); } // This is just a way to differentiate between a really invalid phone // number like "abcde" and a valid phone number that a user has just // started inputting, like "+1" or "1": both these cases would be // considered `NOT_A_NUMBER` by Google's `libphonenumber`, but this // library can provide a more detailed error message — whether it's // really "not a number", or is it just a start of a valid phone number. function isViablePhoneNumberStart(number) { return VALID_PHONE_NUMBER_START_REG_EXP.test(number); } //# sourceMappingURL=isViablePhoneNumber.js.map /***/ }), /***/ "./node_modules/libphonenumber-js/build/helpers/matchesEntirely.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports["default"] = matchesEntirely; /** * Checks whether the entire input sequence can be matched * against the regular expression. * @return {boolean} */ function matchesEntirely(text, regular_expression) { // If assigning the `''` default value is moved to the arguments above, // code coverage would decrease for some weird reason. text = text || ''; return new RegExp('^(?:' + regular_expression + ')$').test(text); } //# sourceMappingURL=matchesEntirely.js.map /***/ }), /***/ "./node_modules/libphonenumber-js/build/helpers/mergeArrays.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports["default"] = mergeArrays; function _createForOfIteratorHelperLoose(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (it) return (it = it.call(o)).next.bind(it); if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } /** * Merges two arrays. * @param {*} a * @param {*} b * @return {*} */ function mergeArrays(a, b) { var merged = a.slice(); for (var _iterator = _createForOfIteratorHelperLoose(b), _step; !(_step = _iterator()).done;) { var element = _step.value; if (a.indexOf(element) < 0) { merged.push(element); } } return merged.sort(function (a, b) { return a - b; }); // ES6 version, requires Set polyfill. // let merged = new Set(a) // for (const element of b) { // merged.add(i) // } // return Array.from(merged).sort((a, b) => a - b) } //# sourceMappingURL=mergeArrays.js.map /***/ }), /***/ "./node_modules/libphonenumber-js/build/helpers/parseDigits.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.DIGITS = void 0; exports["default"] = parseDigits; exports.parseDigit = parseDigit; function _createForOfIteratorHelperLoose(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (it) return (it = it.call(o)).next.bind(it); if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } // These mappings map a character (key) to a specific digit that should // replace it for normalization purposes. Non-European digits that // may be used in phone numbers are mapped to a European equivalent. // // E.g. in Iraq they don't write `+442323234` but rather `+٤٤٢٣٢٣٢٣٤`. // var DIGITS = { '0': '0', '1': '1', '2': '2', '3': '3', '4': '4', '5': '5', '6': '6', '7': '7', '8': '8', '9': '9', "\uFF10": '0', // Fullwidth digit 0 "\uFF11": '1', // Fullwidth digit 1 "\uFF12": '2', // Fullwidth digit 2 "\uFF13": '3', // Fullwidth digit 3 "\uFF14": '4', // Fullwidth digit 4 "\uFF15": '5', // Fullwidth digit 5 "\uFF16": '6', // Fullwidth digit 6 "\uFF17": '7', // Fullwidth digit 7 "\uFF18": '8', // Fullwidth digit 8 "\uFF19": '9', // Fullwidth digit 9 "\u0660": '0', // Arabic-indic digit 0 "\u0661": '1', // Arabic-indic digit 1 "\u0662": '2', // Arabic-indic digit 2 "\u0663": '3', // Arabic-indic digit 3 "\u0664": '4', // Arabic-indic digit 4 "\u0665": '5', // Arabic-indic digit 5 "\u0666": '6', // Arabic-indic digit 6 "\u0667": '7', // Arabic-indic digit 7 "\u0668": '8', // Arabic-indic digit 8 "\u0669": '9', // Arabic-indic digit 9 "\u06F0": '0', // Eastern-Arabic digit 0 "\u06F1": '1', // Eastern-Arabic digit 1 "\u06F2": '2', // Eastern-Arabic digit 2 "\u06F3": '3', // Eastern-Arabic digit 3 "\u06F4": '4', // Eastern-Arabic digit 4 "\u06F5": '5', // Eastern-Arabic digit 5 "\u06F6": '6', // Eastern-Arabic digit 6 "\u06F7": '7', // Eastern-Arabic digit 7 "\u06F8": '8', // Eastern-Arabic digit 8 "\u06F9": '9' // Eastern-Arabic digit 9 }; exports.DIGITS = DIGITS; function parseDigit(character) { return DIGITS[character]; } /** * Parses phone number digits from a string. * Drops all punctuation leaving only digits. * Also converts wide-ascii and arabic-indic numerals to conventional numerals. * E.g. in Iraq they don't write `+442323234` but rather `+٤٤٢٣٢٣٢٣٤`. * @param {string} string * @return {string} * @example * ```js * parseDigits('8 (800) 555') * // Outputs '8800555'. * ``` */ function parseDigits(string) { var result = ''; // Using `.split('')` here instead of normal `for ... of` // because the importing application doesn't neccessarily include an ES6 polyfill. // The `.split('')` approach discards "exotic" UTF-8 characters // (the ones consisting of four bytes) but digits // (including non-European ones) don't fall into that range // so such "exotic" characters would be discarded anyway. for (var _iterator = _createForOfIteratorHelperLoose(string.split('')), _step; !(_step = _iterator()).done;) { var character = _step.value; var digit = parseDigit(character); if (digit) { result += digit; } } return result; } //# sourceMappingURL=parseDigits.js.map /***/ }), /***/ "./node_modules/libphonenumber-js/build/helpers/stripIddPrefix.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports["default"] = stripIddPrefix; var _metadata = _interopRequireDefault(__webpack_require__("./node_modules/libphonenumber-js/build/metadata.js")); var _constants = __webpack_require__("./node_modules/libphonenumber-js/build/constants.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } var CAPTURING_DIGIT_PATTERN = new RegExp('([' + _constants.VALID_DIGITS + '])'); function stripIddPrefix(number, country, callingCode, metadata) { if (!country) { return; } // Check if the number is IDD-prefixed. var countryMetadata = new _metadata["default"](metadata); countryMetadata.selectNumberingPlan(country, callingCode); var IDDPrefixPattern = new RegExp(countryMetadata.IDDPrefix()); if (number.search(IDDPrefixPattern) !== 0) { return; } // Strip IDD prefix. number = number.slice(number.match(IDDPrefixPattern)[0].length); // If there're any digits after an IDD prefix, // then those digits are a country calling code. // Since no country code starts with a `0`, // the code below validates that the next digit (if present) is not `0`. var matchedGroups = number.match(CAPTURING_DIGIT_PATTERN); if (matchedGroups && matchedGroups[1] != null && matchedGroups[1].length > 0) { if (matchedGroups[1] === '0') { return; } } return number; } //# sourceMappingURL=stripIddPrefix.js.map /***/ }), /***/ "./node_modules/libphonenumber-js/build/isPossibleNumber.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports["default"] = isPossibleNumber; var _getNumberType = __webpack_require__("./node_modules/libphonenumber-js/build/getNumberType.js"); var _isPossibleNumber_ = _interopRequireDefault(__webpack_require__("./node_modules/libphonenumber-js/build/isPossibleNumber_.js")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } /** * Checks if a given phone number is possible. * Which means it only checks phone number length * and doesn't test any regular expressions. * * Examples: * * ```js * isPossibleNumber('+78005553535', metadata) * isPossibleNumber('8005553535', 'RU', metadata) * isPossibleNumber('88005553535', 'RU', metadata) * isPossibleNumber({ phone: '8005553535', country: 'RU' }, metadata) * ``` */ function isPossibleNumber() { var _normalizeArguments = (0, _getNumberType.normalizeArguments)(arguments), input = _normalizeArguments.input, options = _normalizeArguments.options, metadata = _normalizeArguments.metadata; return (0, _isPossibleNumber_["default"])(input, options, metadata); } //# sourceMappingURL=isPossibleNumber.js.map /***/ }), /***/ "./node_modules/libphonenumber-js/build/isPossibleNumber_.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports["default"] = isPossiblePhoneNumber; exports.isPossibleNumber = isPossibleNumber; var _metadata = _interopRequireDefault(__webpack_require__("./node_modules/libphonenumber-js/build/metadata.js")); var _checkNumberLength = _interopRequireDefault(__webpack_require__("./node_modules/libphonenumber-js/build/helpers/checkNumberLength.js")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } function isPossiblePhoneNumber(input, options, metadata) { /* istanbul ignore if */ if (options === undefined) { options = {}; } metadata = new _metadata["default"](metadata); if (options.v2) { if (!input.countryCallingCode) { throw new Error('Invalid phone number object passed'); } metadata.selectNumberingPlan(input.countryCallingCode); } else { if (!input.phone) { return false; } if (input.country) { if (!metadata.hasCountry(input.country)) { throw new Error("Unknown country: ".concat(input.country)); } metadata.country(input.country); } else { if (!input.countryCallingCode) { throw new Error('Invalid phone number object passed'); } metadata.selectNumberingPlan(input.countryCallingCode); } } // Old metadata (< 1.0.18) had no "possible length" data. if (metadata.possibleLengths()) { return isPossibleNumber(input.phone || input.nationalNumber, metadata); } else { // There was a bug between `1.7.35` and `1.7.37` where "possible_lengths" // were missing for "non-geographical" numbering plans. // Just assume the number is possible in such cases: // it's unlikely that anyone generated their custom metadata // in that short period of time (one day). // This code can be removed in some future major version update. if (input.countryCallingCode && metadata.isNonGeographicCallingCode(input.countryCallingCode)) { // "Non-geographic entities" did't have `possibleLengths` // due to a bug in metadata generation process. return true; } else { throw new Error('Missing "possibleLengths" in metadata. Perhaps the metadata has been generated before v1.0.18.'); } } } function isPossibleNumber(nationalNumber, metadata) { //, isInternational) { switch ((0, _checkNumberLength["default"])(nationalNumber, metadata)) { case 'IS_POSSIBLE': return true; // This library ignores "local-only" phone numbers (for simplicity). // See the readme for more info on what are "local-only" phone numbers. // case 'IS_POSSIBLE_LOCAL_ONLY': // return !isInternational default: return false; } } //# sourceMappingURL=isPossibleNumber_.js.map /***/ }), /***/ "./node_modules/libphonenumber-js/build/isPossiblePhoneNumber.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports["default"] = isPossiblePhoneNumber; var _parsePhoneNumber = __webpack_require__("./node_modules/libphonenumber-js/build/parsePhoneNumber.js"); var _parsePhoneNumberFromString_ = _interopRequireDefault(__webpack_require__("./node_modules/libphonenumber-js/build/parsePhoneNumberFromString_.js")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } function isPossiblePhoneNumber() { var _normalizeArguments = (0, _parsePhoneNumber.normalizeArguments)(arguments), text = _normalizeArguments.text, options = _normalizeArguments.options, metadata = _normalizeArguments.metadata; options = _objectSpread(_objectSpread({}, options), {}, { extract: false }); var phoneNumber = (0, _parsePhoneNumberFromString_["default"])(text, options, metadata); return phoneNumber && phoneNumber.isPossible() || false; } //# sourceMappingURL=isPossiblePhoneNumber.js.map /***/ }), /***/ "./node_modules/libphonenumber-js/build/isValidNumberForRegion.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports["default"] = isValidNumberForRegion; var _isViablePhoneNumber = _interopRequireDefault(__webpack_require__("./node_modules/libphonenumber-js/build/helpers/isViablePhoneNumber.js")); var _parse_ = _interopRequireDefault(__webpack_require__("./node_modules/libphonenumber-js/build/parse_.js")); var _isValidNumberForRegion_ = _interopRequireDefault(__webpack_require__("./node_modules/libphonenumber-js/build/isValidNumberForRegion_.js")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } function isValidNumberForRegion(number, country, metadata) { if (typeof number !== 'string') { throw new TypeError('number must be a string'); } if (typeof country !== 'string') { throw new TypeError('country must be a string'); } // `parse` extracts phone numbers from raw text, // therefore it will cut off all "garbage" characters, // while this `validate` function needs to verify // that the phone number contains no "garbage" // therefore the explicit `isViablePhoneNumber` check. var input; if ((0, _isViablePhoneNumber["default"])(number)) { input = (0, _parse_["default"])(number, { defaultCountry: country }, metadata); } else { input = {}; } return (0, _isValidNumberForRegion_["default"])(input, country, undefined, metadata); } //# sourceMappingURL=isValidNumberForRegion.js.map /***/ }), /***/ "./node_modules/libphonenumber-js/build/isValidNumberForRegion_.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports["default"] = isValidNumberForRegion; var _validate_ = _interopRequireDefault(__webpack_require__("./node_modules/libphonenumber-js/build/validate_.js")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } /** * Checks if a given phone number is valid within a given region. * Is just an alias for `phoneNumber.isValid() && phoneNumber.country === country`. * https://github.com/googlei18n/libphonenumber/blob/master/FAQ.md#when-should-i-use-isvalidnumberforregion */ function isValidNumberForRegion(input, country, options, metadata) { // If assigning the `{}` default value is moved to the arguments above, // code coverage would decrease for some weird reason. options = options || {}; return input.country === country && (0, _validate_["default"])(input, options, metadata); } //# sourceMappingURL=isValidNumberForRegion_.js.map /***/ }), /***/ "./node_modules/libphonenumber-js/build/isValidPhoneNumber.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports["default"] = isValidPhoneNumber; var _parsePhoneNumber = __webpack_require__("./node_modules/libphonenumber-js/build/parsePhoneNumber.js"); var _parsePhoneNumberFromString_ = _interopRequireDefault(__webpack_require__("./node_modules/libphonenumber-js/build/parsePhoneNumberFromString_.js")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } function isValidPhoneNumber() { var _normalizeArguments = (0, _parsePhoneNumber.normalizeArguments)(arguments), text = _normalizeArguments.text, options = _normalizeArguments.options, metadata = _normalizeArguments.metadata; options = _objectSpread(_objectSpread({}, options), {}, { extract: false }); var phoneNumber = (0, _parsePhoneNumberFromString_["default"])(text, options, metadata); return phoneNumber && phoneNumber.isValid() || false; } //# sourceMappingURL=isValidPhoneNumber.js.map /***/ }), /***/ "./node_modules/libphonenumber-js/build/metadata.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports["default"] = void 0; exports.getCountryCallingCode = getCountryCallingCode; exports.getExtPrefix = getExtPrefix; exports.isSupportedCountry = isSupportedCountry; exports.validateMetadata = validateMetadata; var _semverCompare = _interopRequireDefault(__webpack_require__("./node_modules/libphonenumber-js/build/tools/semver-compare.js")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } // Added "possibleLengths" and renamed // "country_phone_code_to_countries" to "country_calling_codes". var V2 = '1.0.18'; // Added "idd_prefix" and "default_idd_prefix". var V3 = '1.2.0'; // Moved `001` country code to "nonGeographic" section of metadata. var V4 = '1.7.35'; var DEFAULT_EXT_PREFIX = ' ext. '; var CALLING_CODE_REG_EXP = /^\d+$/; /** * See: https://gitlab.com/catamphetamine/libphonenumber-js/blob/master/METADATA.md */ var Metadata = /*#__PURE__*/function () { function Metadata(metadata) { _classCallCheck(this, Metadata); validateMetadata(metadata); this.metadata = metadata; setVersion.call(this, metadata); } _createClass(Metadata, [{ key: "getCountries", value: function getCountries() { return Object.keys(this.metadata.countries).filter(function (_) { return _ !== '001'; }); } }, { key: "getCountryMetadata", value: function getCountryMetadata(countryCode) { return this.metadata.countries[countryCode]; } }, { key: "nonGeographic", value: function nonGeographic() { if (this.v1 || this.v2 || this.v3) return; // `nonGeographical` was a typo. // It's present in metadata generated from `1.7.35` to `1.7.37`. // The test case could be found by searching for "nonGeographical". return this.metadata.nonGeographic || this.metadata.nonGeographical; } }, { key: "hasCountry", value: function hasCountry(country) { return this.getCountryMetadata(country) !== undefined; } }, { key: "hasCallingCode", value: function hasCallingCode(callingCode) { if (this.getCountryCodesForCallingCode(callingCode)) { return true; } if (this.nonGeographic()) { if (this.nonGeographic()[callingCode]) { return true; } } else { // A hacky workaround for old custom metadata (generated before V4). var countryCodes = this.countryCallingCodes()[callingCode]; if (countryCodes && countryCodes.length === 1 && countryCodes[0] === '001') { return true; } } } }, { key: "isNonGeographicCallingCode", value: function isNonGeographicCallingCode(callingCode) { if (this.nonGeographic()) { return this.nonGeographic()[callingCode] ? true : false; } else { return this.getCountryCodesForCallingCode(callingCode) ? false : true; } } // Deprecated. }, { key: "country", value: function country(countryCode) { return this.selectNumberingPlan(countryCode); } }, { key: "selectNumberingPlan", value: function selectNumberingPlan(countryCode, callingCode) { // Supports just passing `callingCode` as the first argument. if (countryCode && CALLING_CODE_REG_EXP.test(countryCode)) { callingCode = countryCode; countryCode = null; } if (countryCode && countryCode !== '001') { if (!this.hasCountry(countryCode)) { throw new Error("Unknown country: ".concat(countryCode)); } this.numberingPlan = new NumberingPlan(this.getCountryMetadata(countryCode), this); } else if (callingCode) { if (!this.hasCallingCode(callingCode)) { throw new Error("Unknown calling code: ".concat(callingCode)); } this.numberingPlan = new NumberingPlan(this.getNumberingPlanMetadata(callingCode), this); } else { this.numberingPlan = undefined; } return this; } }, { key: "getCountryCodesForCallingCode", value: function getCountryCodesForCallingCode(callingCode) { var countryCodes = this.countryCallingCodes()[callingCode]; if (countryCodes) { // Metadata before V4 included "non-geographic entity" calling codes // inside `country_calling_codes` (for example, `"881":["001"]`). // Now the semantics of `country_calling_codes` has changed: // it's specifically for "countries" now. // Older versions of custom metadata will simply skip parsing // "non-geographic entity" phone numbers with new versions // of this library: it's not considered a bug, // because such numbers are extremely rare, // and developers extremely rarely use custom metadata. if (countryCodes.length === 1 && countryCodes[0].length === 3) { return; } return countryCodes; } } }, { key: "getCountryCodeForCallingCode", value: function getCountryCodeForCallingCode(callingCode) { var countryCodes = this.getCountryCodesForCallingCode(callingCode); if (countryCodes) { return countryCodes[0]; } } }, { key: "getNumberingPlanMetadata", value: function getNumberingPlanMetadata(callingCode) { var countryCode = this.getCountryCodeForCallingCode(callingCode); if (countryCode) { return this.getCountryMetadata(countryCode); } if (this.nonGeographic()) { var metadata = this.nonGeographic()[callingCode]; if (metadata) { return metadata; } } else { // A hacky workaround for old custom metadata (generated before V4). // In that metadata, there was no concept of "non-geographic" metadata // so metadata for `001` country code was stored along with other countries. // The test case can be found by searching for: // "should work around `nonGeographic` metadata not existing". var countryCodes = this.countryCallingCodes()[callingCode]; if (countryCodes && countryCodes.length === 1 && countryCodes[0] === '001') { return this.metadata.countries['001']; } } } // Deprecated. }, { key: "countryCallingCode", value: function countryCallingCode() { return this.numberingPlan.callingCode(); } // Deprecated. }, { key: "IDDPrefix", value: function IDDPrefix() { return this.numberingPlan.IDDPrefix(); } // Deprecated. }, { key: "defaultIDDPrefix", value: function defaultIDDPrefix() { return this.numberingPlan.defaultIDDPrefix(); } // Deprecated. }, { key: "nationalNumberPattern", value: function nationalNumberPattern() { return this.numberingPlan.nationalNumberPattern(); } // Deprecated. }, { key: "possibleLengths", value: function possibleLengths() { return this.numberingPlan.possibleLengths(); } // Deprecated. }, { key: "formats", value: function formats() { return this.numberingPlan.formats(); } // Deprecated. }, { key: "nationalPrefixForParsing", value: function nationalPrefixForParsing() { return this.numberingPlan.nationalPrefixForParsing(); } // Deprecated. }, { key: "nationalPrefixTransformRule", value: function nationalPrefixTransformRule() { return this.numberingPlan.nationalPrefixTransformRule(); } // Deprecated. }, { key: "leadingDigits", value: function leadingDigits() { return this.numberingPlan.leadingDigits(); } // Deprecated. }, { key: "hasTypes", value: function hasTypes() { return this.numberingPlan.hasTypes(); } // Deprecated. }, { key: "type", value: function type(_type) { return this.numberingPlan.type(_type); } // Deprecated. }, { key: "ext", value: function ext() { return this.numberingPlan.ext(); } }, { key: "countryCallingCodes", value: function countryCallingCodes() { if (this.v1) return this.metadata.country_phone_code_to_countries; return this.metadata.country_calling_codes; } // Deprecated. }, { key: "chooseCountryByCountryCallingCode", value: function chooseCountryByCountryCallingCode(callingCode) { return this.selectNumberingPlan(callingCode); } }, { key: "hasSelectedNumberingPlan", value: function hasSelectedNumberingPlan() { return this.numberingPlan !== undefined; } }]); return Metadata; }(); exports["default"] = Metadata; var NumberingPlan = /*#__PURE__*/function () { function NumberingPlan(metadata, globalMetadataObject) { _classCallCheck(this, NumberingPlan); this.globalMetadataObject = globalMetadataObject; this.metadata = metadata; setVersion.call(this, globalMetadataObject.metadata); } _createClass(NumberingPlan, [{ key: "callingCode", value: function callingCode() { return this.metadata[0]; } // Formatting information for regions which share // a country calling code is contained by only one region // for performance reasons. For example, for NANPA region // ("North American Numbering Plan Administration", // which includes USA, Canada, Cayman Islands, Bahamas, etc) // it will be contained in the metadata for `US`. }, { key: "getDefaultCountryMetadataForRegion", value: function getDefaultCountryMetadataForRegion() { return this.globalMetadataObject.getNumberingPlanMetadata(this.callingCode()); } // Is always present. }, { key: "IDDPrefix", value: function IDDPrefix() { if (this.v1 || this.v2) return; return this.metadata[1]; } // Is only present when a country supports multiple IDD prefixes. }, { key: "defaultIDDPrefix", value: function defaultIDDPrefix() { if (this.v1 || this.v2) return; return this.metadata[12]; } }, { key: "nationalNumberPattern", value: function nationalNumberPattern() { if (this.v1 || this.v2) return this.metadata[1]; return this.metadata[2]; } // "possible length" data is always present in Google's metadata. }, { key: "possibleLengths", value: function possibleLengths() { if (this.v1) return; return this.metadata[this.v2 ? 2 : 3]; } }, { key: "_getFormats", value: function _getFormats(metadata) { return metadata[this.v1 ? 2 : this.v2 ? 3 : 4]; } // For countries of the same region (e.g. NANPA) // formats are all stored in the "main" country for that region. // E.g. "RU" and "KZ", "US" and "CA". }, { key: "formats", value: function formats() { var _this = this; var formats = this._getFormats(this.metadata) || this._getFormats(this.getDefaultCountryMetadataForRegion()) || []; return formats.map(function (_) { return new Format(_, _this); }); } }, { key: "nationalPrefix", value: function nationalPrefix() { return this.metadata[this.v1 ? 3 : this.v2 ? 4 : 5]; } }, { key: "_getNationalPrefixFormattingRule", value: function _getNationalPrefixFormattingRule(metadata) { return metadata[this.v1 ? 4 : this.v2 ? 5 : 6]; } // For countries of the same region (e.g. NANPA) // national prefix formatting rule is stored in the "main" country for that region. // E.g. "RU" and "KZ", "US" and "CA". }, { key: "nationalPrefixFormattingRule", value: function nationalPrefixFormattingRule() { return this._getNationalPrefixFormattingRule(this.metadata) || this._getNationalPrefixFormattingRule(this.getDefaultCountryMetadataForRegion()); } }, { key: "_nationalPrefixForParsing", value: function _nationalPrefixForParsing() { return this.metadata[this.v1 ? 5 : this.v2 ? 6 : 7]; } }, { key: "nationalPrefixForParsing", value: function nationalPrefixForParsing() { // If `national_prefix_for_parsing` is not set explicitly, // then infer it from `national_prefix` (if any) return this._nationalPrefixForParsing() || this.nationalPrefix(); } }, { key: "nationalPrefixTransformRule", value: function nationalPrefixTransformRule() { return this.metadata[this.v1 ? 6 : this.v2 ? 7 : 8]; } }, { key: "_getNationalPrefixIsOptionalWhenFormatting", value: function _getNationalPrefixIsOptionalWhenFormatting() { return !!this.metadata[this.v1 ? 7 : this.v2 ? 8 : 9]; } // For countries of the same region (e.g. NANPA) // "national prefix is optional when formatting" flag is // stored in the "main" country for that region. // E.g. "RU" and "KZ", "US" and "CA". }, { key: "nationalPrefixIsOptionalWhenFormattingInNationalFormat", value: function nationalPrefixIsOptionalWhenFormattingInNationalFormat() { return this._getNationalPrefixIsOptionalWhenFormatting(this.metadata) || this._getNationalPrefixIsOptionalWhenFormatting(this.getDefaultCountryMetadataForRegion()); } }, { key: "leadingDigits", value: function leadingDigits() { return this.metadata[this.v1 ? 8 : this.v2 ? 9 : 10]; } }, { key: "types", value: function types() { return this.metadata[this.v1 ? 9 : this.v2 ? 10 : 11]; } }, { key: "hasTypes", value: function hasTypes() { // Versions 1.2.0 - 1.2.4: can be `[]`. /* istanbul ignore next */ if (this.types() && this.types().length === 0) { return false; } // Versions <= 1.2.4: can be `undefined`. // Version >= 1.2.5: can be `0`. return !!this.types(); } }, { key: "type", value: function type(_type2) { if (this.hasTypes() && getType(this.types(), _type2)) { return new Type(getType(this.types(), _type2), this); } } }, { key: "ext", value: function ext() { if (this.v1 || this.v2) return DEFAULT_EXT_PREFIX; return this.metadata[13] || DEFAULT_EXT_PREFIX; } }]); return NumberingPlan; }(); var Format = /*#__PURE__*/function () { function Format(format, metadata) { _classCallCheck(this, Format); this._format = format; this.metadata = metadata; } _createClass(Format, [{ key: "pattern", value: function pattern() { return this._format[0]; } }, { key: "format", value: function format() { return this._format[1]; } }, { key: "leadingDigitsPatterns", value: function leadingDigitsPatterns() { return this._format[2] || []; } }, { key: "nationalPrefixFormattingRule", value: function nationalPrefixFormattingRule() { return this._format[3] || this.metadata.nationalPrefixFormattingRule(); } }, { key: "nationalPrefixIsOptionalWhenFormattingInNationalFormat", value: function nationalPrefixIsOptionalWhenFormattingInNationalFormat() { return !!this._format[4] || this.metadata.nationalPrefixIsOptionalWhenFormattingInNationalFormat(); } }, { key: "nationalPrefixIsMandatoryWhenFormattingInNationalFormat", value: function nationalPrefixIsMandatoryWhenFormattingInNationalFormat() { // National prefix is omitted if there's no national prefix formatting rule // set for this country, or when the national prefix formatting rule // contains no national prefix itself, or when this rule is set but // national prefix is optional for this phone number format // (and it is not enforced explicitly) return this.usesNationalPrefix() && !this.nationalPrefixIsOptionalWhenFormattingInNationalFormat(); } // Checks whether national prefix formatting rule contains national prefix. }, { key: "usesNationalPrefix", value: function usesNationalPrefix() { return this.nationalPrefixFormattingRule() && // Check that national prefix formatting rule is not a "dummy" one. !FIRST_GROUP_ONLY_PREFIX_PATTERN.test(this.nationalPrefixFormattingRule()) // In compressed metadata, `this.nationalPrefixFormattingRule()` is `0` // when `national_prefix_formatting_rule` is not present. // So, `true` or `false` are returned explicitly here, so that // `0` number isn't returned. ? true : false; } }, { key: "internationalFormat", value: function internationalFormat() { return this._format[5] || this.format(); } }]); return Format; }(); /** * A pattern that is used to determine if the national prefix formatting rule * has the first group only, i.e., does not start with the national prefix. * Note that the pattern explicitly allows for unbalanced parentheses. */ var FIRST_GROUP_ONLY_PREFIX_PATTERN = /^\(?\$1\)?$/; var Type = /*#__PURE__*/function () { function Type(type, metadata) { _classCallCheck(this, Type); this.type = type; this.metadata = metadata; } _createClass(Type, [{ key: "pattern", value: function pattern() { if (this.metadata.v1) return this.type; return this.type[0]; } }, { key: "possibleLengths", value: function possibleLengths() { if (this.metadata.v1) return; return this.type[1] || this.metadata.possibleLengths(); } }]); return Type; }(); function getType(types, type) { switch (type) { case 'FIXED_LINE': return types[0]; case 'MOBILE': return types[1]; case 'TOLL_FREE': return types[2]; case 'PREMIUM_RATE': return types[3]; case 'PERSONAL_NUMBER': return types[4]; case 'VOICEMAIL': return types[5]; case 'UAN': return types[6]; case 'PAGER': return types[7]; case 'VOIP': return types[8]; case 'SHARED_COST': return types[9]; } } function validateMetadata(metadata) { if (!metadata) { throw new Error('[libphonenumber-js] `metadata` argument not passed. Check your arguments.'); } // `country_phone_code_to_countries` was renamed to // `country_calling_codes` in `1.0.18`. if (!is_object(metadata) || !is_object(metadata.countries)) { throw new Error("[libphonenumber-js] `metadata` argument was passed but it's not a valid metadata. Must be an object having `.countries` child object property. Got ".concat(is_object(metadata) ? 'an object of shape: { ' + Object.keys(metadata).join(', ') + ' }' : 'a ' + type_of(metadata) + ': ' + metadata, ".")); } } // Babel transforms `typeof` into some "branches" // so istanbul will show this as "branch not covered". /* istanbul ignore next */ var is_object = function is_object(_) { return _typeof(_) === 'object'; }; // Babel transforms `typeof` into some "branches" // so istanbul will show this as "branch not covered". /* istanbul ignore next */ var type_of = function type_of(_) { return _typeof(_); }; /** * Returns extension prefix for a country. * @param {string} country * @param {object} metadata * @return {string?} * @example * // Returns " ext. " * getExtPrefix("US") */ function getExtPrefix(country, metadata) { metadata = new Metadata(metadata); if (metadata.hasCountry(country)) { return metadata.country(country).ext(); } return DEFAULT_EXT_PREFIX; } /** * Returns "country calling code" for a country. * Throws an error if the country doesn't exist or isn't supported by this library. * @param {string} country * @param {object} metadata * @return {string} * @example * // Returns "44" * getCountryCallingCode("GB") */ function getCountryCallingCode(country, metadata) { metadata = new Metadata(metadata); if (metadata.hasCountry(country)) { return metadata.country(country).countryCallingCode(); } throw new Error("Unknown country: ".concat(country)); } function isSupportedCountry(country, metadata) { // metadata = new Metadata(metadata) // return metadata.hasCountry(country) return metadata.countries[country] !== undefined; } function setVersion(metadata) { var version = metadata.version; if (typeof version === 'number') { this.v1 = version === 1; this.v2 = version === 2; this.v3 = version === 3; this.v4 = version === 4; } else { if (!version) { this.v1 = true; } else if ((0, _semverCompare["default"])(version, V3) === -1) { this.v2 = true; } else if ((0, _semverCompare["default"])(version, V4) === -1) { this.v3 = true; } else { this.v4 = true; } } } // const ISO_COUNTRY_CODE = /^[A-Z]{2}$/ // function isCountryCode(countryCode) { // return ISO_COUNTRY_CODE.test(countryCodeOrCountryCallingCode) // } //# sourceMappingURL=metadata.js.map /***/ }), /***/ "./node_modules/libphonenumber-js/build/parse.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports["default"] = parseNumber; var _parse_ = _interopRequireDefault(__webpack_require__("./node_modules/libphonenumber-js/build/parse_.js")); var _parsePhoneNumber = __webpack_require__("./node_modules/libphonenumber-js/build/parsePhoneNumber.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } // `options`: // { // country: // { // restrict - (a two-letter country code) // the phone number must be in this country // // default - (a two-letter country code) // default country to use for phone number parsing and validation // (if no country code could be derived from the phone number) // } // } // // Returns `{ country, number }` // // Example use cases: // // ```js // parse('8 (800) 555-35-35', 'RU') // parse('8 (800) 555-35-35', 'RU', metadata) // parse('8 (800) 555-35-35', { country: { default: 'RU' } }) // parse('8 (800) 555-35-35', { country: { default: 'RU' } }, metadata) // parse('+7 800 555 35 35') // parse('+7 800 555 35 35', metadata) // ``` // function parseNumber() { var _normalizeArguments = (0, _parsePhoneNumber.normalizeArguments)(arguments), text = _normalizeArguments.text, options = _normalizeArguments.options, metadata = _normalizeArguments.metadata; return (0, _parse_["default"])(text, options, metadata); } //# sourceMappingURL=parse.js.map /***/ }), /***/ "./node_modules/libphonenumber-js/build/parseIncompletePhoneNumber.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports["default"] = parseIncompletePhoneNumber; exports.parsePhoneNumberCharacter = parsePhoneNumberCharacter; var _parseDigits = __webpack_require__("./node_modules/libphonenumber-js/build/helpers/parseDigits.js"); function _createForOfIteratorHelperLoose(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (it) return (it = it.call(o)).next.bind(it); if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } /** * Parses phone number characters from a string. * Drops all punctuation leaving only digits and the leading `+` sign (if any). * Also converts wide-ascii and arabic-indic numerals to conventional numerals. * E.g. in Iraq they don't write `+442323234` but rather `+٤٤٢٣٢٣٢٣٤`. * @param {string} string * @return {string} * @example * ```js * // Outputs '8800555'. * parseIncompletePhoneNumber('8 (800) 555') * // Outputs '+7800555'. * parseIncompletePhoneNumber('+7 800 555') * ``` */ function parseIncompletePhoneNumber(string) { var result = ''; // Using `.split('')` here instead of normal `for ... of` // because the importing application doesn't neccessarily include an ES6 polyfill. // The `.split('')` approach discards "exotic" UTF-8 characters // (the ones consisting of four bytes) but digits // (including non-European ones) don't fall into that range // so such "exotic" characters would be discarded anyway. for (var _iterator = _createForOfIteratorHelperLoose(string.split('')), _step; !(_step = _iterator()).done;) { var character = _step.value; result += parsePhoneNumberCharacter(character, result) || ''; } return result; } /** * Parses next character while parsing phone number digits (including a `+`) * from text: discards everything except `+` and digits, and `+` is only allowed * at the start of a phone number. * For example, is used in `react-phone-number-input` where it uses * [`input-format`](https://gitlab.com/catamphetamine/input-format). * @param {string} character - Yet another character from raw input string. * @param {string?} prevParsedCharacters - Previous parsed characters. * @param {object} meta - Optional custom use-case-specific metadata. * @return {string?} The parsed character. */ function parsePhoneNumberCharacter(character, prevParsedCharacters) { // Only allow a leading `+`. if (character === '+') { // If this `+` is not the first parsed character // then discard it. if (prevParsedCharacters) { return; } return '+'; } // Allow digits. return (0, _parseDigits.parseDigit)(character); } //# sourceMappingURL=parseIncompletePhoneNumber.js.map /***/ }), /***/ "./node_modules/libphonenumber-js/build/parsePhoneNumber.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports["default"] = parsePhoneNumber; exports.normalizeArguments = normalizeArguments; var _parsePhoneNumber_ = _interopRequireDefault(__webpack_require__("./node_modules/libphonenumber-js/build/parsePhoneNumber_.js")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } function parsePhoneNumber() { var _normalizeArguments = normalizeArguments(arguments), text = _normalizeArguments.text, options = _normalizeArguments.options, metadata = _normalizeArguments.metadata; return (0, _parsePhoneNumber_["default"])(text, options, metadata); } function normalizeArguments(args) { var _Array$prototype$slic = Array.prototype.slice.call(args), _Array$prototype$slic2 = _slicedToArray(_Array$prototype$slic, 4), arg_1 = _Array$prototype$slic2[0], arg_2 = _Array$prototype$slic2[1], arg_3 = _Array$prototype$slic2[2], arg_4 = _Array$prototype$slic2[3]; var text; var options; var metadata; // If the phone number is passed as a string. // `parsePhoneNumber('88005553535', ...)`. if (typeof arg_1 === 'string') { text = arg_1; } else throw new TypeError('A text for parsing must be a string.'); // If "default country" argument is being passed then move it to `options`. // `parsePhoneNumber('88005553535', 'RU', [options], metadata)`. if (!arg_2 || typeof arg_2 === 'string') { if (arg_4) { options = arg_3; metadata = arg_4; } else { options = undefined; metadata = arg_3; } if (arg_2) { options = _objectSpread({ defaultCountry: arg_2 }, options); } } // `defaultCountry` is not passed. // Example: `parsePhoneNumber('+78005553535', [options], metadata)`. else if (isObject(arg_2)) { if (arg_3) { options = arg_2; metadata = arg_3; } else { metadata = arg_2; } } else throw new Error("Invalid second argument: ".concat(arg_2)); return { text: text, options: options, metadata: metadata }; } // Otherwise istanbul would show this as "branch not covered". /* istanbul ignore next */ var isObject = function isObject(_) { return _typeof(_) === 'object'; }; //# sourceMappingURL=parsePhoneNumber.js.map /***/ }), /***/ "./node_modules/libphonenumber-js/build/parsePhoneNumberFromString.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports["default"] = parsePhoneNumberFromString; var _parsePhoneNumber = __webpack_require__("./node_modules/libphonenumber-js/build/parsePhoneNumber.js"); var _parsePhoneNumberFromString_ = _interopRequireDefault(__webpack_require__("./node_modules/libphonenumber-js/build/parsePhoneNumberFromString_.js")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } function parsePhoneNumberFromString() { var _normalizeArguments = (0, _parsePhoneNumber.normalizeArguments)(arguments), text = _normalizeArguments.text, options = _normalizeArguments.options, metadata = _normalizeArguments.metadata; return (0, _parsePhoneNumberFromString_["default"])(text, options, metadata); } //# sourceMappingURL=parsePhoneNumberFromString.js.map /***/ }), /***/ "./node_modules/libphonenumber-js/build/parsePhoneNumberFromString_.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports["default"] = parsePhoneNumberFromString; var _parsePhoneNumber_ = _interopRequireDefault(__webpack_require__("./node_modules/libphonenumber-js/build/parsePhoneNumber_.js")); var _ParseError = _interopRequireDefault(__webpack_require__("./node_modules/libphonenumber-js/build/ParseError.js")); var _metadata = __webpack_require__("./node_modules/libphonenumber-js/build/metadata.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } function parsePhoneNumberFromString(text, options, metadata) { // Validate `defaultCountry`. if (options && options.defaultCountry && !(0, _metadata.isSupportedCountry)(options.defaultCountry, metadata)) { options = _objectSpread(_objectSpread({}, options), {}, { defaultCountry: undefined }); } // Parse phone number. try { return (0, _parsePhoneNumber_["default"])(text, options, metadata); } catch (error) { /* istanbul ignore else */ if (error instanceof _ParseError["default"]) {// } else { throw error; } } } //# sourceMappingURL=parsePhoneNumberFromString_.js.map /***/ }), /***/ "./node_modules/libphonenumber-js/build/parsePhoneNumber_.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports["default"] = parsePhoneNumber; var _parse_ = _interopRequireDefault(__webpack_require__("./node_modules/libphonenumber-js/build/parse_.js")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } function parsePhoneNumber(text, options, metadata) { return (0, _parse_["default"])(text, _objectSpread(_objectSpread({}, options), {}, { v2: true }), metadata); } //# sourceMappingURL=parsePhoneNumber_.js.map /***/ }), /***/ "./node_modules/libphonenumber-js/build/parse_.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } Object.defineProperty(exports, "__esModule", { value: true }); exports["default"] = parse; var _constants = __webpack_require__("./node_modules/libphonenumber-js/build/constants.js"); var _ParseError = _interopRequireDefault(__webpack_require__("./node_modules/libphonenumber-js/build/ParseError.js")); var _metadata = _interopRequireDefault(__webpack_require__("./node_modules/libphonenumber-js/build/metadata.js")); var _isViablePhoneNumber = _interopRequireWildcard(__webpack_require__("./node_modules/libphonenumber-js/build/helpers/isViablePhoneNumber.js")); var _extractExtension = _interopRequireDefault(__webpack_require__("./node_modules/libphonenumber-js/build/helpers/extension/extractExtension.js")); var _parseIncompletePhoneNumber = _interopRequireDefault(__webpack_require__("./node_modules/libphonenumber-js/build/parseIncompletePhoneNumber.js")); var _getCountryCallingCode = _interopRequireDefault(__webpack_require__("./node_modules/libphonenumber-js/build/getCountryCallingCode.js")); var _isPossibleNumber_ = __webpack_require__("./node_modules/libphonenumber-js/build/isPossibleNumber_.js"); var _RFC = __webpack_require__("./node_modules/libphonenumber-js/build/helpers/RFC3966.js"); var _PhoneNumber = _interopRequireDefault(__webpack_require__("./node_modules/libphonenumber-js/build/PhoneNumber.js")); var _matchesEntirely = _interopRequireDefault(__webpack_require__("./node_modules/libphonenumber-js/build/helpers/matchesEntirely.js")); var _extractCountryCallingCode = _interopRequireDefault(__webpack_require__("./node_modules/libphonenumber-js/build/helpers/extractCountryCallingCode.js")); var _extractCountryCallingCodeFromInternationalNumberWithoutPlusSign = _interopRequireDefault(__webpack_require__("./node_modules/libphonenumber-js/build/helpers/extractCountryCallingCodeFromInternationalNumberWithoutPlusSign.js")); var _extractNationalNumber = _interopRequireDefault(__webpack_require__("./node_modules/libphonenumber-js/build/helpers/extractNationalNumber.js")); var _stripIddPrefix = _interopRequireDefault(__webpack_require__("./node_modules/libphonenumber-js/build/helpers/stripIddPrefix.js")); var _getCountryByCallingCode = _interopRequireDefault(__webpack_require__("./node_modules/libphonenumber-js/build/helpers/getCountryByCallingCode.js")); function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } // This is a port of Google Android `libphonenumber`'s // `phonenumberutil.js` of December 31th, 2018. // // https://github.com/googlei18n/libphonenumber/commits/master/javascript/i18n/phonenumbers/phonenumberutil.js // We don't allow input strings for parsing to be longer than 250 chars. // This prevents malicious input from consuming CPU. var MAX_INPUT_STRING_LENGTH = 250; // This consists of the plus symbol, digits, and arabic-indic digits. var PHONE_NUMBER_START_PATTERN = new RegExp('[' + _constants.PLUS_CHARS + _constants.VALID_DIGITS + ']'); // Regular expression of trailing characters that we want to remove. // A trailing `#` is sometimes used when writing phone numbers with extensions in US. // Example: "+1 (645) 123 1234-910#" number has extension "910". var AFTER_PHONE_NUMBER_END_PATTERN = new RegExp('[^' + _constants.VALID_DIGITS + '#' + ']+$'); var USE_NON_GEOGRAPHIC_COUNTRY_CODE = false; // Examples: // // ```js // parse('8 (800) 555-35-35', 'RU') // parse('8 (800) 555-35-35', 'RU', metadata) // parse('8 (800) 555-35-35', { country: { default: 'RU' } }) // parse('8 (800) 555-35-35', { country: { default: 'RU' } }, metadata) // parse('+7 800 555 35 35') // parse('+7 800 555 35 35', metadata) // ``` // function parse(text, options, metadata) { // If assigning the `{}` default value is moved to the arguments above, // code coverage would decrease for some weird reason. options = options || {}; metadata = new _metadata["default"](metadata); // Validate `defaultCountry`. if (options.defaultCountry && !metadata.hasCountry(options.defaultCountry)) { if (options.v2) { throw new _ParseError["default"]('INVALID_COUNTRY'); } throw new Error("Unknown country: ".concat(options.defaultCountry)); } // Parse the phone number. var _parseInput = parseInput(text, options.v2, options.extract), formattedPhoneNumber = _parseInput.number, ext = _parseInput.ext, error = _parseInput.error; // If the phone number is not viable then return nothing. if (!formattedPhoneNumber) { if (options.v2) { if (error === 'TOO_SHORT') { throw new _ParseError["default"]('TOO_SHORT'); } throw new _ParseError["default"]('NOT_A_NUMBER'); } return {}; } var _parsePhoneNumber = parsePhoneNumber(formattedPhoneNumber, options.defaultCountry, options.defaultCallingCode, metadata), country = _parsePhoneNumber.country, nationalNumber = _parsePhoneNumber.nationalNumber, countryCallingCode = _parsePhoneNumber.countryCallingCode, carrierCode = _parsePhoneNumber.carrierCode; if (!metadata.hasSelectedNumberingPlan()) { if (options.v2) { throw new _ParseError["default"]('INVALID_COUNTRY'); } return {}; } // Validate national (significant) number length. if (!nationalNumber || nationalNumber.length < _constants.MIN_LENGTH_FOR_NSN) { // Won't throw here because the regexp already demands length > 1. /* istanbul ignore if */ if (options.v2) { throw new _ParseError["default"]('TOO_SHORT'); } // Google's demo just throws an error in this case. return {}; } // Validate national (significant) number length. // // A sidenote: // // They say that sometimes national (significant) numbers // can be longer than `MAX_LENGTH_FOR_NSN` (e.g. in Germany). // https://github.com/googlei18n/libphonenumber/blob/7e1748645552da39c4e1ba731e47969d97bdb539/resources/phonenumber.proto#L36 // Such numbers will just be discarded. // if (nationalNumber.length > _constants.MAX_LENGTH_FOR_NSN) { if (options.v2) { throw new _ParseError["default"]('TOO_LONG'); } // Google's demo just throws an error in this case. return {}; } if (options.v2) { var phoneNumber = new _PhoneNumber["default"](countryCallingCode, nationalNumber, metadata.metadata); if (country) { phoneNumber.country = country; } if (carrierCode) { phoneNumber.carrierCode = carrierCode; } if (ext) { phoneNumber.ext = ext; } return phoneNumber; } // Check if national phone number pattern matches the number. // National number pattern is different for each country, // even for those ones which are part of the "NANPA" group. var valid = (options.extended ? metadata.hasSelectedNumberingPlan() : country) ? (0, _matchesEntirely["default"])(nationalNumber, metadata.nationalNumberPattern()) : false; if (!options.extended) { return valid ? result(country, nationalNumber, ext) : {}; } // isInternational: countryCallingCode !== undefined return { country: country, countryCallingCode: countryCallingCode, carrierCode: carrierCode, valid: valid, possible: valid ? true : options.extended === true && metadata.possibleLengths() && (0, _isPossibleNumber_.isPossibleNumber)(nationalNumber, metadata) ? true : false, phone: nationalNumber, ext: ext }; } /** * Extracts a formatted phone number from text. * Doesn't guarantee that the extracted phone number * is a valid phone number (for example, doesn't validate its length). * @param {string} text * @param {boolean} [extract] — If `false`, then will parse the entire `text` as a phone number. * @param {boolean} [throwOnError] — By default, it won't throw if the text is too long. * @return {string} * @example * // Returns "(213) 373-4253". * extractFormattedPhoneNumber("Call (213) 373-4253 for assistance.") */ function extractFormattedPhoneNumber(text, extract, throwOnError) { if (!text) { return; } if (text.length > MAX_INPUT_STRING_LENGTH) { if (throwOnError) { throw new _ParseError["default"]('TOO_LONG'); } return; } if (extract === false) { return text; } // Attempt to extract a possible number from the string passed in var startsAt = text.search(PHONE_NUMBER_START_PATTERN); if (startsAt < 0) { return; } return text // Trim everything to the left of the phone number .slice(startsAt) // Remove trailing non-numerical characters .replace(AFTER_PHONE_NUMBER_END_PATTERN, ''); } /** * @param {string} text - Input. * @param {boolean} v2 - Legacy API functions don't pass `v2: true` flag. * @param {boolean} [extract] - Whether to extract a phone number from `text`, or attempt to parse the entire text as a phone number. * @return {object} `{ ?number, ?ext }`. */ function parseInput(text, v2, extract) { // Parse RFC 3966 phone number URI. if (text && text.indexOf('tel:') === 0) { return (0, _RFC.parseRFC3966)(text); } var number = extractFormattedPhoneNumber(text, extract, v2); // If the phone number is not viable, then abort. if (!number) { return {}; } if (!(0, _isViablePhoneNumber["default"])(number)) { if ((0, _isViablePhoneNumber.isViablePhoneNumberStart)(number)) { return { error: 'TOO_SHORT' }; } return {}; } // Attempt to parse extension first, since it doesn't require region-specific // data and we want to have the non-normalised number here. var withExtensionStripped = (0, _extractExtension["default"])(number); if (withExtensionStripped.ext) { return withExtensionStripped; } return { number: number }; } /** * Creates `parse()` result object. */ function result(country, nationalNumber, ext) { var result = { country: country, phone: nationalNumber }; if (ext) { result.ext = ext; } return result; } /** * Parses a viable phone number. * @param {string} formattedPhoneNumber — Example: "(213) 373-4253". * @param {string} [defaultCountry] * @param {string} [defaultCallingCode] * @param {Metadata} metadata * @return {object} Returns `{ country: string?, countryCallingCode: string?, nationalNumber: string? }`. */ function parsePhoneNumber(formattedPhoneNumber, defaultCountry, defaultCallingCode, metadata) { // Extract calling code from phone number. var _extractCountryCallin = (0, _extractCountryCallingCode["default"])((0, _parseIncompletePhoneNumber["default"])(formattedPhoneNumber), defaultCountry, defaultCallingCode, metadata.metadata), countryCallingCode = _extractCountryCallin.countryCallingCode, number = _extractCountryCallin.number; // Choose a country by `countryCallingCode`. var country; if (countryCallingCode) { metadata.selectNumberingPlan(countryCallingCode); } // If `formattedPhoneNumber` is in "national" format // then `number` is defined and `countryCallingCode` isn't. else if (number && (defaultCountry || defaultCallingCode)) { metadata.selectNumberingPlan(defaultCountry, defaultCallingCode); if (defaultCountry) { country = defaultCountry; } else { /* istanbul ignore if */ if (USE_NON_GEOGRAPHIC_COUNTRY_CODE) { if (metadata.isNonGeographicCallingCode(defaultCallingCode)) { country = '001'; } } } countryCallingCode = defaultCallingCode || (0, _getCountryCallingCode["default"])(defaultCountry, metadata.metadata); } else return {}; if (!number) { return { countryCallingCode: countryCallingCode }; } var _extractNationalNumbe = (0, _extractNationalNumber["default"])((0, _parseIncompletePhoneNumber["default"])(number), metadata), nationalNumber = _extractNationalNumbe.nationalNumber, carrierCode = _extractNationalNumbe.carrierCode; // Sometimes there are several countries // corresponding to the same country phone code // (e.g. NANPA countries all having `1` country phone code). // Therefore, to reliably determine the exact country, // national (significant) number should have been parsed first. // // When `metadata.json` is generated, all "ambiguous" country phone codes // get their countries populated with the full set of // "phone number type" regular expressions. // var exactCountry = (0, _getCountryByCallingCode["default"])(countryCallingCode, nationalNumber, metadata); if (exactCountry) { country = exactCountry; /* istanbul ignore if */ if (exactCountry === '001') {// Can't happen with `USE_NON_GEOGRAPHIC_COUNTRY_CODE` being `false`. // If `USE_NON_GEOGRAPHIC_COUNTRY_CODE` is set to `true` for some reason, // then remove the "istanbul ignore if". } else { metadata.country(country); } } return { country: country, countryCallingCode: countryCallingCode, nationalNumber: nationalNumber, carrierCode: carrierCode }; } //# sourceMappingURL=parse_.js.map /***/ }), /***/ "./node_modules/libphonenumber-js/build/searchNumbers.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports["default"] = searchNumbers; var _parsePhoneNumber = __webpack_require__("./node_modules/libphonenumber-js/build/parsePhoneNumber.js"); var _PhoneNumberMatcher = _interopRequireDefault(__webpack_require__("./node_modules/libphonenumber-js/build/PhoneNumberMatcher.js")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } /** * @return ES6 `for ... of` iterator. */ function searchNumbers() { var _normalizeArguments = (0, _parsePhoneNumber.normalizeArguments)(arguments), text = _normalizeArguments.text, options = _normalizeArguments.options, metadata = _normalizeArguments.metadata; var matcher = new _PhoneNumberMatcher["default"](text, options, metadata); return _defineProperty({}, Symbol.iterator, function () { return { next: function next() { if (matcher.hasNext()) { return { done: false, value: matcher.next() }; } return { done: true }; } }; }); } //# sourceMappingURL=searchNumbers.js.map /***/ }), /***/ "./node_modules/libphonenumber-js/build/searchPhoneNumbersInText.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports["default"] = searchPhoneNumbersInText; var _searchNumbers = _interopRequireDefault(__webpack_require__("./node_modules/libphonenumber-js/build/searchNumbers.js")); var _findPhoneNumbersInText = __webpack_require__("./node_modules/libphonenumber-js/build/findPhoneNumbersInText.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } function searchPhoneNumbersInText(text, defaultCountry, options, metadata) { var args = (0, _findPhoneNumbersInText.getArguments)(defaultCountry, options, metadata); return (0, _searchNumbers["default"])(text, args.options, args.metadata); } //# sourceMappingURL=searchPhoneNumbersInText.js.map /***/ }), /***/ "./node_modules/libphonenumber-js/build/tools/semver-compare.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports["default"] = _default; // Copy-pasted from: // https://github.com/substack/semver-compare/blob/master/index.js // // Inlining this function because some users reported issues with // importing from `semver-compare` in a browser with ES6 "native" modules. // // Fixes `semver-compare` not being able to compare versions with alpha/beta/etc "tags". // https://github.com/catamphetamine/libphonenumber-js/issues/381 function _default(a, b) { a = a.split('-'); b = b.split('-'); var pa = a[0].split('.'); var pb = b[0].split('.'); for (var i = 0; i < 3; i++) { var na = Number(pa[i]); var nb = Number(pb[i]); if (na > nb) return 1; if (nb > na) return -1; if (!isNaN(na) && isNaN(nb)) return 1; if (isNaN(na) && !isNaN(nb)) return -1; } if (a[1] && b[1]) { return a[1] > b[1] ? 1 : a[1] < b[1] ? -1 : 0; } return !a[1] && b[1] ? 1 : a[1] && !b[1] ? -1 : 0; } //# sourceMappingURL=semver-compare.js.map /***/ }), /***/ "./node_modules/libphonenumber-js/build/validate.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports["default"] = isValidNumber; var _validate_ = _interopRequireDefault(__webpack_require__("./node_modules/libphonenumber-js/build/validate_.js")); var _getNumberType = __webpack_require__("./node_modules/libphonenumber-js/build/getNumberType.js"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } // Finds out national phone number type (fixed line, mobile, etc) function isValidNumber() { var _normalizeArguments = (0, _getNumberType.normalizeArguments)(arguments), input = _normalizeArguments.input, options = _normalizeArguments.options, metadata = _normalizeArguments.metadata; return (0, _validate_["default"])(input, options, metadata); } //# sourceMappingURL=validate.js.map /***/ }), /***/ "./node_modules/libphonenumber-js/build/validatePhoneNumberLength.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports["default"] = validatePhoneNumberLength; var _parsePhoneNumber = __webpack_require__("./node_modules/libphonenumber-js/build/parsePhoneNumber.js"); var _parsePhoneNumber_ = _interopRequireDefault(__webpack_require__("./node_modules/libphonenumber-js/build/parsePhoneNumber_.js")); var _ParseError = _interopRequireDefault(__webpack_require__("./node_modules/libphonenumber-js/build/ParseError.js")); var _metadata = _interopRequireDefault(__webpack_require__("./node_modules/libphonenumber-js/build/metadata.js")); var _checkNumberLength = _interopRequireDefault(__webpack_require__("./node_modules/libphonenumber-js/build/helpers/checkNumberLength.js")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } function validatePhoneNumberLength() { var _normalizeArguments = (0, _parsePhoneNumber.normalizeArguments)(arguments), text = _normalizeArguments.text, options = _normalizeArguments.options, metadata = _normalizeArguments.metadata; options = _objectSpread(_objectSpread({}, options), {}, { extract: false }); // Parse phone number. try { var phoneNumber = (0, _parsePhoneNumber_["default"])(text, options, metadata); metadata = new _metadata["default"](metadata); metadata.selectNumberingPlan(phoneNumber.countryCallingCode); var result = (0, _checkNumberLength["default"])(phoneNumber.nationalNumber, metadata); if (result !== 'IS_POSSIBLE') { return result; } } catch (error) { /* istanbul ignore else */ if (error instanceof _ParseError["default"]) { return error.message; } else { throw error; } } } //# sourceMappingURL=validatePhoneNumberLength.js.map /***/ }), /***/ "./node_modules/libphonenumber-js/build/validate_.js": /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports["default"] = isValidNumber; var _metadata = _interopRequireDefault(__webpack_require__("./node_modules/libphonenumber-js/build/metadata.js")); var _matchesEntirely = _interopRequireDefault(__webpack_require__("./node_modules/libphonenumber-js/build/helpers/matchesEntirely.js")); var _getNumberType = _interopRequireDefault(__webpack_require__("./node_modules/libphonenumber-js/build/helpers/getNumberType.js")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } /** * Checks if a given phone number is valid. * * If the `number` is a string, it will be parsed to an object, * but only if it contains only valid phone number characters (including punctuation). * If the `number` is an object, it is used as is. * * The optional `defaultCountry` argument is the default country. * I.e. it does not restrict to just that country, * e.g. in those cases where several countries share * the same phone numbering rules (NANPA, Britain, etc). * For example, even though the number `07624 369230` * belongs to the Isle of Man ("IM" country code) * calling `isValidNumber('07624369230', 'GB', metadata)` * still returns `true` because the country is not restricted to `GB`, * it's just that `GB` is the default one for the phone numbering rules. * For restricting the country see `isValidNumberForRegion()` * though restricting a country might not be a good idea. * https://github.com/googlei18n/libphonenumber/blob/master/FAQ.md#when-should-i-use-isvalidnumberforregion * * Examples: * * ```js * isValidNumber('+78005553535', metadata) * isValidNumber('8005553535', 'RU', metadata) * isValidNumber('88005553535', 'RU', metadata) * isValidNumber({ phone: '8005553535', country: 'RU' }, metadata) * ``` */ function isValidNumber(input, options, metadata) { // If assigning the `{}` default value is moved to the arguments above, // code coverage would decrease for some weird reason. options = options || {}; metadata = new _metadata["default"](metadata); // This is just to support `isValidNumber({})` // for cases when `parseNumber()` returns `{}`. if (!input.country) { return false; } metadata.selectNumberingPlan(input.country, input.countryCallingCode); // By default, countries only have type regexps when it's required for // distinguishing different countries having the same `countryCallingCode`. if (metadata.hasTypes()) { return (0, _getNumberType["default"])(input, options, metadata.metadata) !== undefined; } // If there are no type regexps for this country in metadata then use // `nationalNumberPattern` as a "better than nothing" replacement. var national_number = options.v2 ? input.nationalNumber : input.phone; return (0, _matchesEntirely["default"])(national_number, metadata.nationalNumberPattern()); } //# sourceMappingURL=validate_.js.map /***/ }), /***/ "./node_modules/libphonenumber-js/core/index.cjs": /***/ (function(module, exports, __webpack_require__) { "use strict"; var parsePhoneNumberFromString = __webpack_require__("./node_modules/libphonenumber-js/build/parsePhoneNumberFromString.js").default // ES5 `require()` "default" "interoperability" hack. // https://github.com/babel/babel/issues/2212#issuecomment-131827986 // An alternative approach: // https://www.npmjs.com/package/babel-plugin-add-module-exports exports = module.exports = parsePhoneNumberFromString exports['default'] = parsePhoneNumberFromString exports.ParseError = __webpack_require__("./node_modules/libphonenumber-js/build/ParseError.js").default var parsePhoneNumberWithError = __webpack_require__("./node_modules/libphonenumber-js/build/parsePhoneNumber.js").default // `parsePhoneNumber()` named export has been renamed to `parsePhoneNumberWithError()`. exports.parsePhoneNumberWithError = parsePhoneNumberWithError exports.parsePhoneNumber = parsePhoneNumberWithError // `parsePhoneNumberFromString()` named export is now considered legacy: // it has been promoted to a default export due to being too verbose. exports.parsePhoneNumberFromString = parsePhoneNumberFromString exports.isValidPhoneNumber = __webpack_require__("./node_modules/libphonenumber-js/build/isValidPhoneNumber.js").default exports.isPossiblePhoneNumber = __webpack_require__("./node_modules/libphonenumber-js/build/isPossiblePhoneNumber.js").default exports.validatePhoneNumberLength = __webpack_require__("./node_modules/libphonenumber-js/build/validatePhoneNumberLength.js").default exports.findNumbers = __webpack_require__("./node_modules/libphonenumber-js/build/findNumbers.js").default exports.searchNumbers = __webpack_require__("./node_modules/libphonenumber-js/build/searchNumbers.js").default exports.findPhoneNumbersInText = __webpack_require__("./node_modules/libphonenumber-js/build/findPhoneNumbersInText.js").default exports.searchPhoneNumbersInText = __webpack_require__("./node_modules/libphonenumber-js/build/searchPhoneNumbersInText.js").default exports.PhoneNumberMatcher = __webpack_require__("./node_modules/libphonenumber-js/build/PhoneNumberMatcher.js").default exports.AsYouType = __webpack_require__("./node_modules/libphonenumber-js/build/AsYouType.js").default exports.Metadata = __webpack_require__("./node_modules/libphonenumber-js/build/metadata.js").default exports.isSupportedCountry = __webpack_require__("./node_modules/libphonenumber-js/build/metadata.js").isSupportedCountry exports.getCountries = __webpack_require__("./node_modules/libphonenumber-js/build/getCountries.js").default exports.getCountryCallingCode = __webpack_require__("./node_modules/libphonenumber-js/build/metadata.js").getCountryCallingCode exports.getExtPrefix = __webpack_require__("./node_modules/libphonenumber-js/build/metadata.js").getExtPrefix exports.getExampleNumber = __webpack_require__("./node_modules/libphonenumber-js/build/getExampleNumber.js").default exports.formatIncompletePhoneNumber = __webpack_require__("./node_modules/libphonenumber-js/build/formatIncompletePhoneNumber.js").default exports.parseIncompletePhoneNumber = __webpack_require__("./node_modules/libphonenumber-js/build/parseIncompletePhoneNumber.js").default exports.parsePhoneNumberCharacter = __webpack_require__("./node_modules/libphonenumber-js/build/parseIncompletePhoneNumber.js").parsePhoneNumberCharacter exports.parseDigits = __webpack_require__("./node_modules/libphonenumber-js/build/helpers/parseDigits.js").default exports.DIGIT_PLACEHOLDER = __webpack_require__("./node_modules/libphonenumber-js/build/AsYouTypeFormatter.js").DIGIT_PLACEHOLDER exports.parseRFC3966 = __webpack_require__("./node_modules/libphonenumber-js/build/helpers/RFC3966.js").parseRFC3966 exports.formatRFC3966 = __webpack_require__("./node_modules/libphonenumber-js/build/helpers/RFC3966.js").formatRFC3966 /***/ }), /***/ "./node_modules/libphonenumber-js/index.cjs": /***/ (function(module, exports, __webpack_require__) { "use strict"; var min = __webpack_require__("./node_modules/libphonenumber-js/min/index.cjs") var metadata = __webpack_require__("./node_modules/libphonenumber-js/metadata.min.json") function withMetadataArgument(func, _arguments) { var args = Array.prototype.slice.call(_arguments) args.push(metadata) return func.apply(this, args) } // ES5 `require()` "default" "interoperability" hack. // https://github.com/babel/babel/issues/2212#issuecomment-131827986 // An alternative approach: // https://www.npmjs.com/package/babel-plugin-add-module-exports exports = module.exports = min.parsePhoneNumberFromString exports['default'] = min.parsePhoneNumberFromString // `parsePhoneNumberFromString()` named export is now considered legacy: // it has been promoted to a default export due to being too verbose. exports.parsePhoneNumberFromString = min.parsePhoneNumberFromString exports.ParseError = min.ParseError // `parsePhoneNumber()` named export has been renamed to `parsePhoneNumberWithError()`. exports.parsePhoneNumber = min.parsePhoneNumberWithError exports.parsePhoneNumberWithError = min.parsePhoneNumberWithError exports.isValidPhoneNumber = min.isValidPhoneNumber exports.isPossiblePhoneNumber = min.isPossiblePhoneNumber exports.validatePhoneNumberLength = min.validatePhoneNumberLength // `parse()` and `parseNumber()` functions are deprecated. var parse_ = __webpack_require__("./node_modules/libphonenumber-js/build/parse.js").default exports.parse = function parse() { return withMetadataArgument(parse_, arguments) } exports.parseNumber = exports.parse // `format()` and `formatNumber()` functions are deprecated. var format_ = __webpack_require__("./node_modules/libphonenumber-js/build/format.js").default exports.format = function format() { return withMetadataArgument(format_, arguments) } exports.formatNumber = exports.format // Deprecated. var getNumberType_ = __webpack_require__("./node_modules/libphonenumber-js/build/getNumberType.js").default exports.getNumberType = function getNumberType() { return withMetadataArgument(getNumberType_, arguments) } // Deprecated. var isPossibleNumber_ = __webpack_require__("./node_modules/libphonenumber-js/build/isPossibleNumber.js").default exports.isPossibleNumber = function isPossibleNumber() { return withMetadataArgument(isPossibleNumber_, arguments) } // Deprecated. var isValidNumber_ = __webpack_require__("./node_modules/libphonenumber-js/build/validate.js").default exports.isValidNumber = function isValidNumber() { return withMetadataArgument(isValidNumber_, arguments) } // Deprecated. var isValidNumberForRegion_ = __webpack_require__("./node_modules/libphonenumber-js/build/isValidNumberForRegion.js").default exports.isValidNumberForRegion = function isValidNumberForRegion() { return withMetadataArgument(isValidNumberForRegion_, arguments) } exports.getExampleNumber = min.getExampleNumber exports.Metadata = min.Metadata // Deprecated. var findPhoneNumbers_ = __webpack_require__("./node_modules/libphonenumber-js/build/findPhoneNumbers.js").default exports.findPhoneNumbers = function findPhoneNumbers() { return withMetadataArgument(findPhoneNumbers_, arguments) } // Deprecated. var searchPhoneNumbers_ = __webpack_require__("./node_modules/libphonenumber-js/build/findPhoneNumbers.js").searchPhoneNumbers exports.searchPhoneNumbers = function searchPhoneNumbers() { return withMetadataArgument(searchPhoneNumbers_, arguments) } // Deprecated. var PhoneNumberSearch_ = __webpack_require__("./node_modules/libphonenumber-js/build/findPhoneNumbers_.js").PhoneNumberSearch exports.PhoneNumberSearch = function PhoneNumberSearch(text, options) { return PhoneNumberSearch_.call(this, text, options, metadata) } exports.PhoneNumberSearch.prototype = Object.create(PhoneNumberSearch_.prototype, {}) exports.PhoneNumberSearch.prototype.constructor = exports.PhoneNumberSearch // Deprecated. exports.findNumbers = min.findNumbers // Deprecated. exports.searchNumbers = min.searchNumbers exports.findPhoneNumbersInText = min.findPhoneNumbersInText exports.searchPhoneNumbersInText = min.searchPhoneNumbersInText exports.PhoneNumberMatcher = min.PhoneNumberMatcher exports.AsYouType = min.AsYouType exports.getCountries = min.getCountries exports.getCountryCallingCode = min.getCountryCallingCode exports.isSupportedCountry = min.isSupportedCountry exports.getExtPrefix = min.getExtPrefix exports.parseRFC3966 = min.parseRFC3966 exports.formatRFC3966 = min.formatRFC3966 // Deprecated: `DIGITS` were used by `react-phone-number-input`. // Replaced by `parseDigits()`. exports.DIGITS = __webpack_require__("./node_modules/libphonenumber-js/build/helpers/parseDigits.js").DIGITS exports.DIGIT_PLACEHOLDER = min.DIGIT_PLACEHOLDER // `getPhoneCode` name is deprecated exports.getPhoneCode = min.getCountryCallingCode exports.formatIncompletePhoneNumber = min.formatIncompletePhoneNumber exports.parseIncompletePhoneNumber = min.parseIncompletePhoneNumber exports.parsePhoneNumberCharacter = min.parsePhoneNumberCharacter exports.parseDigits = min.parseDigits /***/ }), /***/ "./node_modules/libphonenumber-js/metadata.min.json": /***/ (function(module) { module.exports = JSON.parse("{\"version\":4,\"country_calling_codes\":{\"1\":[\"US\",\"AG\",\"AI\",\"AS\",\"BB\",\"BM\",\"BS\",\"CA\",\"DM\",\"DO\",\"GD\",\"GU\",\"JM\",\"KN\",\"KY\",\"LC\",\"MP\",\"MS\",\"PR\",\"SX\",\"TC\",\"TT\",\"VC\",\"VG\",\"VI\"],\"7\":[\"RU\",\"KZ\"],\"20\":[\"EG\"],\"27\":[\"ZA\"],\"30\":[\"GR\"],\"31\":[\"NL\"],\"32\":[\"BE\"],\"33\":[\"FR\"],\"34\":[\"ES\"],\"36\":[\"HU\"],\"39\":[\"IT\",\"VA\"],\"40\":[\"RO\"],\"41\":[\"CH\"],\"43\":[\"AT\"],\"44\":[\"GB\",\"GG\",\"IM\",\"JE\"],\"45\":[\"DK\"],\"46\":[\"SE\"],\"47\":[\"NO\",\"SJ\"],\"48\":[\"PL\"],\"49\":[\"DE\"],\"51\":[\"PE\"],\"52\":[\"MX\"],\"53\":[\"CU\"],\"54\":[\"AR\"],\"55\":[\"BR\"],\"56\":[\"CL\"],\"57\":[\"CO\"],\"58\":[\"VE\"],\"60\":[\"MY\"],\"61\":[\"AU\",\"CC\",\"CX\"],\"62\":[\"ID\"],\"63\":[\"PH\"],\"64\":[\"NZ\"],\"65\":[\"SG\"],\"66\":[\"TH\"],\"81\":[\"JP\"],\"82\":[\"KR\"],\"84\":[\"VN\"],\"86\":[\"CN\"],\"90\":[\"TR\"],\"91\":[\"IN\"],\"92\":[\"PK\"],\"93\":[\"AF\"],\"94\":[\"LK\"],\"95\":[\"MM\"],\"98\":[\"IR\"],\"211\":[\"SS\"],\"212\":[\"MA\",\"EH\"],\"213\":[\"DZ\"],\"216\":[\"TN\"],\"218\":[\"LY\"],\"220\":[\"GM\"],\"221\":[\"SN\"],\"222\":[\"MR\"],\"223\":[\"ML\"],\"224\":[\"GN\"],\"225\":[\"CI\"],\"226\":[\"BF\"],\"227\":[\"NE\"],\"228\":[\"TG\"],\"229\":[\"BJ\"],\"230\":[\"MU\"],\"231\":[\"LR\"],\"232\":[\"SL\"],\"233\":[\"GH\"],\"234\":[\"NG\"],\"235\":[\"TD\"],\"236\":[\"CF\"],\"237\":[\"CM\"],\"238\":[\"CV\"],\"239\":[\"ST\"],\"240\":[\"GQ\"],\"241\":[\"GA\"],\"242\":[\"CG\"],\"243\":[\"CD\"],\"244\":[\"AO\"],\"245\":[\"GW\"],\"246\":[\"IO\"],\"247\":[\"AC\"],\"248\":[\"SC\"],\"249\":[\"SD\"],\"250\":[\"RW\"],\"251\":[\"ET\"],\"252\":[\"SO\"],\"253\":[\"DJ\"],\"254\":[\"KE\"],\"255\":[\"TZ\"],\"256\":[\"UG\"],\"257\":[\"BI\"],\"258\":[\"MZ\"],\"260\":[\"ZM\"],\"261\":[\"MG\"],\"262\":[\"RE\",\"YT\"],\"263\":[\"ZW\"],\"264\":[\"NA\"],\"265\":[\"MW\"],\"266\":[\"LS\"],\"267\":[\"BW\"],\"268\":[\"SZ\"],\"269\":[\"KM\"],\"290\":[\"SH\",\"TA\"],\"291\":[\"ER\"],\"297\":[\"AW\"],\"298\":[\"FO\"],\"299\":[\"GL\"],\"350\":[\"GI\"],\"351\":[\"PT\"],\"352\":[\"LU\"],\"353\":[\"IE\"],\"354\":[\"IS\"],\"355\":[\"AL\"],\"356\":[\"MT\"],\"357\":[\"CY\"],\"358\":[\"FI\",\"AX\"],\"359\":[\"BG\"],\"370\":[\"LT\"],\"371\":[\"LV\"],\"372\":[\"EE\"],\"373\":[\"MD\"],\"374\":[\"AM\"],\"375\":[\"BY\"],\"376\":[\"AD\"],\"377\":[\"MC\"],\"378\":[\"SM\"],\"380\":[\"UA\"],\"381\":[\"RS\"],\"382\":[\"ME\"],\"383\":[\"XK\"],\"385\":[\"HR\"],\"386\":[\"SI\"],\"387\":[\"BA\"],\"389\":[\"MK\"],\"420\":[\"CZ\"],\"421\":[\"SK\"],\"423\":[\"LI\"],\"500\":[\"FK\"],\"501\":[\"BZ\"],\"502\":[\"GT\"],\"503\":[\"SV\"],\"504\":[\"HN\"],\"505\":[\"NI\"],\"506\":[\"CR\"],\"507\":[\"PA\"],\"508\":[\"PM\"],\"509\":[\"HT\"],\"590\":[\"GP\",\"BL\",\"MF\"],\"591\":[\"BO\"],\"592\":[\"GY\"],\"593\":[\"EC\"],\"594\":[\"GF\"],\"595\":[\"PY\"],\"596\":[\"MQ\"],\"597\":[\"SR\"],\"598\":[\"UY\"],\"599\":[\"CW\",\"BQ\"],\"670\":[\"TL\"],\"672\":[\"NF\"],\"673\":[\"BN\"],\"674\":[\"NR\"],\"675\":[\"PG\"],\"676\":[\"TO\"],\"677\":[\"SB\"],\"678\":[\"VU\"],\"679\":[\"FJ\"],\"680\":[\"PW\"],\"681\":[\"WF\"],\"682\":[\"CK\"],\"683\":[\"NU\"],\"685\":[\"WS\"],\"686\":[\"KI\"],\"687\":[\"NC\"],\"688\":[\"TV\"],\"689\":[\"PF\"],\"690\":[\"TK\"],\"691\":[\"FM\"],\"692\":[\"MH\"],\"850\":[\"KP\"],\"852\":[\"HK\"],\"853\":[\"MO\"],\"855\":[\"KH\"],\"856\":[\"LA\"],\"880\":[\"BD\"],\"886\":[\"TW\"],\"960\":[\"MV\"],\"961\":[\"LB\"],\"962\":[\"JO\"],\"963\":[\"SY\"],\"964\":[\"IQ\"],\"965\":[\"KW\"],\"966\":[\"SA\"],\"967\":[\"YE\"],\"968\":[\"OM\"],\"970\":[\"PS\"],\"971\":[\"AE\"],\"972\":[\"IL\"],\"973\":[\"BH\"],\"974\":[\"QA\"],\"975\":[\"BT\"],\"976\":[\"MN\"],\"977\":[\"NP\"],\"992\":[\"TJ\"],\"993\":[\"TM\"],\"994\":[\"AZ\"],\"995\":[\"GE\"],\"996\":[\"KG\"],\"998\":[\"UZ\"]},\"countries\":{\"AC\":[\"247\",\"00\",\"(?:[01589]\\\\d|[46])\\\\d{4}\",[5,6]],\"AD\":[\"376\",\"00\",\"(?:1|6\\\\d)\\\\d{7}|[135-9]\\\\d{5}\",[6,8,9],[[\"(\\\\d{3})(\\\\d{3})\",\"$1 $2\",[\"[135-9]\"]],[\"(\\\\d{4})(\\\\d{4})\",\"$1 $2\",[\"1\"]],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"6\"]]]],\"AE\":[\"971\",\"00\",\"(?:[4-7]\\\\d|9[0-689])\\\\d{7}|800\\\\d{2,9}|[2-4679]\\\\d{7}\",[5,6,7,8,9,10,11,12],[[\"(\\\\d{3})(\\\\d{2,9})\",\"$1 $2\",[\"60|8\"]],[\"(\\\\d)(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"[236]|[479][2-8]\"],\"0$1\"],[\"(\\\\d{3})(\\\\d)(\\\\d{5})\",\"$1 $2 $3\",[\"[479]\"]],[\"(\\\\d{2})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"5\"],\"0$1\"]],\"0\"],\"AF\":[\"93\",\"00\",\"[2-7]\\\\d{8}\",[9],[[\"(\\\\d{2})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"[2-7]\"],\"0$1\"]],\"0\"],\"AG\":[\"1\",\"011\",\"(?:268|[58]\\\\d\\\\d|900)\\\\d{7}\",[10],0,\"1\",0,\"1|([457]\\\\d{6})$\",\"268$1\",0,\"268\"],\"AI\":[\"1\",\"011\",\"(?:264|[58]\\\\d\\\\d|900)\\\\d{7}\",[10],0,\"1\",0,\"1|([2457]\\\\d{6})$\",\"264$1\",0,\"264\"],\"AL\":[\"355\",\"00\",\"(?:700\\\\d\\\\d|900)\\\\d{3}|8\\\\d{5,7}|(?:[2-5]|6\\\\d)\\\\d{7}\",[6,7,8,9],[[\"(\\\\d{3})(\\\\d{3,4})\",\"$1 $2\",[\"80|9\"],\"0$1\"],[\"(\\\\d)(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"4[2-6]\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"[2358][2-5]|4\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{5})\",\"$1 $2\",[\"[23578]\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"6\"],\"0$1\"]],\"0\"],\"AM\":[\"374\",\"00\",\"(?:[1-489]\\\\d|55|60|77)\\\\d{6}\",[8],[[\"(\\\\d{3})(\\\\d{2})(\\\\d{3})\",\"$1 $2 $3\",[\"[89]0\"],\"0 $1\"],[\"(\\\\d{3})(\\\\d{5})\",\"$1 $2\",[\"2|3[12]\"],\"(0$1)\"],[\"(\\\\d{2})(\\\\d{6})\",\"$1 $2\",[\"1|47\"],\"(0$1)\"],[\"(\\\\d{2})(\\\\d{6})\",\"$1 $2\",[\"[3-9]\"],\"0$1\"]],\"0\"],\"AO\":[\"244\",\"00\",\"[29]\\\\d{8}\",[9],[[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"[29]\"]]]],\"AR\":[\"54\",\"00\",\"(?:11|[89]\\\\d\\\\d)\\\\d{8}|[2368]\\\\d{9}\",[10,11],[[\"(\\\\d{4})(\\\\d{2})(\\\\d{4})\",\"$1 $2-$3\",[\"2(?:2[024-9]|3[0-59]|47|6[245]|9[02-8])|3(?:3[28]|4[03-9]|5[2-46-8]|7[1-578]|8[2-9])\",\"2(?:[23]02|6(?:[25]|4[6-8])|9(?:[02356]|4[02568]|72|8[23]))|3(?:3[28]|4(?:[04679]|3[5-8]|5[4-68]|8[2379])|5(?:[2467]|3[237]|8[2-5])|7[1-578]|8(?:[2469]|3[2578]|5[4-8]|7[36-8]|8[5-8]))|2(?:2[24-9]|3[1-59]|47)\",\"2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3[78]|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8[23])|7[1-578]|8(?:[2469]|3[278]|5[56][46]|86[3-6]))|2(?:2[24-9]|3[1-59]|47)|38(?:[58][78]|7[378])|3(?:4[35][56]|58[45]|8(?:[38]5|54|76))[4-6]\",\"2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3(?:5(?:4[0-25689]|[56])|[78])|58|8[2379])|5(?:[2467]|3[237]|8(?:[23]|4(?:[45]|60)|5(?:4[0-39]|5|64)))|7[1-578]|8(?:[2469]|3[278]|54(?:4|5[13-7]|6[89])|86[3-6]))|2(?:2[24-9]|3[1-59]|47)|38(?:[58][78]|7[378])|3(?:454|85[56])[46]|3(?:4(?:36|5[56])|8(?:[38]5|76))[4-6]\"],\"0$1\",1],[\"(\\\\d{2})(\\\\d{4})(\\\\d{4})\",\"$1 $2-$3\",[\"1\"],\"0$1\",1],[\"(\\\\d{3})(\\\\d{3})(\\\\d{4})\",\"$1-$2-$3\",[\"[68]\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{3})(\\\\d{4})\",\"$1 $2-$3\",[\"[23]\"],\"0$1\",1],[\"(\\\\d)(\\\\d{4})(\\\\d{2})(\\\\d{4})\",\"$2 15-$3-$4\",[\"9(?:2[2-469]|3[3-578])\",\"9(?:2(?:2[024-9]|3[0-59]|47|6[245]|9[02-8])|3(?:3[28]|4[03-9]|5[2-46-8]|7[1-578]|8[2-9]))\",\"9(?:2(?:[23]02|6(?:[25]|4[6-8])|9(?:[02356]|4[02568]|72|8[23]))|3(?:3[28]|4(?:[04679]|3[5-8]|5[4-68]|8[2379])|5(?:[2467]|3[237]|8[2-5])|7[1-578]|8(?:[2469]|3[2578]|5[4-8]|7[36-8]|8[5-8])))|92(?:2[24-9]|3[1-59]|47)\",\"9(?:2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3[78]|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8[23])|7[1-578]|8(?:[2469]|3[278]|5(?:[56][46]|[78])|7[378]|8(?:6[3-6]|[78]))))|92(?:2[24-9]|3[1-59]|47)|93(?:4[35][56]|58[45]|8(?:[38]5|54|76))[4-6]\",\"9(?:2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3(?:5(?:4[0-25689]|[56])|[78])|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8(?:[23]|4(?:[45]|60)|5(?:4[0-39]|5|64)))|7[1-578]|8(?:[2469]|3[278]|5(?:4(?:4|5[13-7]|6[89])|[56][46]|[78])|7[378]|8(?:6[3-6]|[78]))))|92(?:2[24-9]|3[1-59]|47)|93(?:4(?:36|5[56])|8(?:[38]5|76))[4-6]\"],\"0$1\",0,\"$1 $2 $3-$4\"],[\"(\\\\d)(\\\\d{2})(\\\\d{4})(\\\\d{4})\",\"$2 15-$3-$4\",[\"91\"],\"0$1\",0,\"$1 $2 $3-$4\"],[\"(\\\\d{3})(\\\\d{3})(\\\\d{5})\",\"$1-$2-$3\",[\"8\"],\"0$1\"],[\"(\\\\d)(\\\\d{3})(\\\\d{3})(\\\\d{4})\",\"$2 15-$3-$4\",[\"9\"],\"0$1\",0,\"$1 $2 $3-$4\"]],\"0\",0,\"0?(?:(11|2(?:2(?:02?|[13]|2[13-79]|4[1-6]|5[2457]|6[124-8]|7[1-4]|8[13-6]|9[1267])|3(?:02?|1[467]|2[03-6]|3[13-8]|[49][2-6]|5[2-8]|[67])|4(?:7[3-578]|9)|6(?:[0136]|2[24-6]|4[6-8]?|5[15-8])|80|9(?:0[1-3]|[19]|2\\\\d|3[1-6]|4[02568]?|5[2-4]|6[2-46]|72?|8[23]?))|3(?:3(?:2[79]|6|8[2578])|4(?:0[0-24-9]|[12]|3[5-8]?|4[24-7]|5[4-68]?|6[02-9]|7[126]|8[2379]?|9[1-36-8])|5(?:1|2[1245]|3[237]?|4[1-46-9]|6[2-4]|7[1-6]|8[2-5]?)|6[24]|7(?:[069]|1[1568]|2[15]|3[145]|4[13]|5[14-8]|7[2-57]|8[126])|8(?:[01]|2[15-7]|3[2578]?|4[13-6]|5[4-8]?|6[1-357-9]|7[36-8]?|8[5-8]?|9[124])))15)?\",\"9$1\"],\"AS\":[\"1\",\"011\",\"(?:[58]\\\\d\\\\d|684|900)\\\\d{7}\",[10],0,\"1\",0,\"1|([267]\\\\d{6})$\",\"684$1\",0,\"684\"],\"AT\":[\"43\",\"00\",\"1\\\\d{3,12}|2\\\\d{6,12}|43(?:(?:0\\\\d|5[02-9])\\\\d{3,9}|2\\\\d{4,5}|[3467]\\\\d{4}|8\\\\d{4,6}|9\\\\d{4,7})|5\\\\d{4,12}|8\\\\d{7,12}|9\\\\d{8,12}|(?:[367]\\\\d|4[0-24-9])\\\\d{4,11}\",[4,5,6,7,8,9,10,11,12,13],[[\"(\\\\d)(\\\\d{3,12})\",\"$1 $2\",[\"1(?:11|[2-9])\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{2})\",\"$1 $2\",[\"517\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3,5})\",\"$1 $2\",[\"5[079]\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{3,10})\",\"$1 $2\",[\"(?:31|4)6|51|6(?:5[0-3579]|[6-9])|7(?:20|32|8)|[89]\"],\"0$1\"],[\"(\\\\d{4})(\\\\d{3,9})\",\"$1 $2\",[\"[2-467]|5[2-6]\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{3,4})\",\"$1 $2 $3\",[\"5\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{4})(\\\\d{4,7})\",\"$1 $2 $3\",[\"5\"],\"0$1\"]],\"0\"],\"AU\":[\"61\",\"001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011\",\"1(?:[0-79]\\\\d{7}(?:\\\\d(?:\\\\d{2})?)?|8[0-24-9]\\\\d{7})|[2-478]\\\\d{8}|1\\\\d{4,7}\",[5,6,7,8,9,10,12],[[\"(\\\\d{2})(\\\\d{3,4})\",\"$1 $2\",[\"16\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{2,4})\",\"$1 $2 $3\",[\"16\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"14|4\"],\"0$1\"],[\"(\\\\d)(\\\\d{4})(\\\\d{4})\",\"$1 $2 $3\",[\"[2378]\"],\"(0$1)\"],[\"(\\\\d{4})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"1(?:30|[89])\"]]],\"0\",0,\"0|(183[12])\",0,0,0,[[\"(?:(?:2(?:[0-26-9]\\\\d|3[0-8]|4[02-9]|5[0135-9])|3(?:[0-3589]\\\\d|4[0-578]|6[1-9]|7[0-35-9])|7(?:[013-57-9]\\\\d|2[0-8]))\\\\d{3}|8(?:51(?:0(?:0[03-9]|[12479]\\\\d|3[2-9]|5[0-8]|6[1-9]|8[0-7])|1(?:[0235689]\\\\d|1[0-69]|4[0-589]|7[0-47-9])|2(?:0[0-79]|[18][13579]|2[14-9]|3[0-46-9]|[4-6]\\\\d|7[89]|9[0-4]))|(?:6[0-8]|[78]\\\\d)\\\\d{3}|9(?:[02-9]\\\\d{3}|1(?:(?:[0-58]\\\\d|6[0135-9])\\\\d|7(?:0[0-24-9]|[1-9]\\\\d)|9(?:[0-46-9]\\\\d|5[0-79])))))\\\\d{3}\",[9]],[\"4(?:83[0-38]|93[0-6])\\\\d{5}|4(?:[0-3]\\\\d|4[047-9]|5[0-25-9]|6[06-9]|7[02-9]|8[0-24-9]|9[0-27-9])\\\\d{6}\",[9]],[\"180(?:0\\\\d{3}|2)\\\\d{3}\",[7,10]],[\"190[0-26]\\\\d{6}\",[10]],0,0,0,[\"163\\\\d{2,6}\",[5,6,7,8,9]],[\"14(?:5(?:1[0458]|[23][458])|71\\\\d)\\\\d{4}\",[9]],[\"13(?:00\\\\d{6}(?:\\\\d{2})?|45[0-4]\\\\d{3})|13\\\\d{4}\",[6,8,10,12]]],\"0011\"],\"AW\":[\"297\",\"00\",\"(?:[25-79]\\\\d\\\\d|800)\\\\d{4}\",[7],[[\"(\\\\d{3})(\\\\d{4})\",\"$1 $2\",[\"[25-9]\"]]]],\"AX\":[\"358\",\"00|99(?:[01469]|5(?:[14]1|3[23]|5[59]|77|88|9[09]))\",\"2\\\\d{4,9}|35\\\\d{4,5}|(?:60\\\\d\\\\d|800)\\\\d{4,6}|7\\\\d{5,11}|(?:[14]\\\\d|3[0-46-9]|50)\\\\d{4,8}\",[5,6,7,8,9,10,11,12],0,\"0\",0,0,0,0,\"18\",0,\"00\"],\"AZ\":[\"994\",\"00\",\"365\\\\d{6}|(?:[124579]\\\\d|60|88)\\\\d{7}\",[9],[[\"(\\\\d{3})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"90\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"1[28]|2|365|46\",\"1[28]|2|365[45]|46\",\"1[28]|2|365(?:4|5[02])|46\"],\"(0$1)\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"[13-9]\"],\"0$1\"]],\"0\"],\"BA\":[\"387\",\"00\",\"6\\\\d{8}|(?:[35689]\\\\d|49|70)\\\\d{6}\",[8,9],[[\"(\\\\d{2})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"6[1-3]|[7-9]\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{3})\",\"$1 $2-$3\",[\"[3-5]|6[56]\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{2})(\\\\d{2})(\\\\d{3})\",\"$1 $2 $3 $4\",[\"6\"],\"0$1\"]],\"0\"],\"BB\":[\"1\",\"011\",\"(?:246|[58]\\\\d\\\\d|900)\\\\d{7}\",[10],0,\"1\",0,\"1|([2-9]\\\\d{6})$\",\"246$1\",0,\"246\"],\"BD\":[\"880\",\"00\",\"[1-469]\\\\d{9}|8[0-79]\\\\d{7,8}|[2-79]\\\\d{8}|[2-9]\\\\d{7}|[3-9]\\\\d{6}|[57-9]\\\\d{5}\",[6,7,8,9,10],[[\"(\\\\d{2})(\\\\d{4,6})\",\"$1-$2\",[\"31[5-8]|[459]1\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{3,7})\",\"$1-$2\",[\"3(?:[67]|8[013-9])|4(?:6[168]|7|[89][18])|5(?:6[128]|9)|6(?:28|4[14]|5)|7[2-589]|8(?:0[014-9]|[12])|9[358]|(?:3[2-5]|4[235]|5[2-578]|6[0389]|76|8[3-7]|9[24])1|(?:44|66)[01346-9]\"],\"0$1\"],[\"(\\\\d{4})(\\\\d{3,6})\",\"$1-$2\",[\"[13-9]|22\"],\"0$1\"],[\"(\\\\d)(\\\\d{7,8})\",\"$1-$2\",[\"2\"],\"0$1\"]],\"0\"],\"BE\":[\"32\",\"00\",\"4\\\\d{8}|[1-9]\\\\d{7}\",[8,9],[[\"(\\\\d{3})(\\\\d{2})(\\\\d{3})\",\"$1 $2 $3\",[\"(?:80|9)0\"],\"0$1\"],[\"(\\\\d)(\\\\d{3})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"[239]|4[23]\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"[15-8]\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"4\"],\"0$1\"]],\"0\"],\"BF\":[\"226\",\"00\",\"[025-7]\\\\d{7}\",[8],[[\"(\\\\d{2})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"[025-7]\"]]]],\"BG\":[\"359\",\"00\",\"[2-7]\\\\d{6,7}|[89]\\\\d{6,8}|2\\\\d{5}\",[6,7,8,9],[[\"(\\\\d)(\\\\d)(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"2\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{4})\",\"$1 $2\",[\"43[1-6]|70[1-9]\"],\"0$1\"],[\"(\\\\d)(\\\\d{3})(\\\\d{3,4})\",\"$1 $2 $3\",[\"2\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{2,3})\",\"$1 $2 $3\",[\"[356]|4[124-7]|7[1-9]|8[1-6]|9[1-7]\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{2})(\\\\d{3})\",\"$1 $2 $3\",[\"(?:70|8)0\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{3})(\\\\d{2})\",\"$1 $2 $3\",[\"43[1-7]|7\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{3,4})\",\"$1 $2 $3\",[\"[48]|9[08]\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"9\"],\"0$1\"]],\"0\"],\"BH\":[\"973\",\"00\",\"[136-9]\\\\d{7}\",[8],[[\"(\\\\d{4})(\\\\d{4})\",\"$1 $2\",[\"[13679]|8[047]\"]]]],\"BI\":[\"257\",\"00\",\"(?:[267]\\\\d|31)\\\\d{6}\",[8],[[\"(\\\\d{2})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"[2367]\"]]]],\"BJ\":[\"229\",\"00\",\"(?:[25689]\\\\d|40)\\\\d{6}\",[8],[[\"(\\\\d{2})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"[24-689]\"]]]],\"BL\":[\"590\",\"00\",\"(?:590|(?:69|80)\\\\d|976)\\\\d{6}\",[9],0,\"0\",0,0,0,0,0,[[\"590(?:2[7-9]|5[12]|87)\\\\d{4}\"],[\"69(?:0\\\\d\\\\d|1(?:2[2-9]|3[0-5]))\\\\d{4}\"],[\"80[0-5]\\\\d{6}\"],0,0,0,0,0,[\"976[01]\\\\d{5}\"]]],\"BM\":[\"1\",\"011\",\"(?:441|[58]\\\\d\\\\d|900)\\\\d{7}\",[10],0,\"1\",0,\"1|([2-8]\\\\d{6})$\",\"441$1\",0,\"441\"],\"BN\":[\"673\",\"00\",\"[2-578]\\\\d{6}\",[7],[[\"(\\\\d{3})(\\\\d{4})\",\"$1 $2\",[\"[2-578]\"]]]],\"BO\":[\"591\",\"00(?:1\\\\d)?\",\"(?:[2-467]\\\\d\\\\d|8001)\\\\d{5}\",[8,9],[[\"(\\\\d)(\\\\d{7})\",\"$1 $2\",[\"[23]|4[46]\"]],[\"(\\\\d{8})\",\"$1\",[\"[67]\"]],[\"(\\\\d{3})(\\\\d{2})(\\\\d{4})\",\"$1 $2 $3\",[\"8\"]]],\"0\",0,\"0(1\\\\d)?\"],\"BQ\":[\"599\",\"00\",\"(?:[34]1|7\\\\d)\\\\d{5}\",[7],0,0,0,0,0,0,\"[347]\"],\"BR\":[\"55\",\"00(?:1[245]|2[1-35]|31|4[13]|[56]5|99)\",\"(?:[1-46-9]\\\\d\\\\d|5(?:[0-46-9]\\\\d|5[0-24679]))\\\\d{8}|[1-9]\\\\d{9}|[3589]\\\\d{8}|[34]\\\\d{7}\",[8,9,10,11],[[\"(\\\\d{4})(\\\\d{4})\",\"$1-$2\",[\"300|4(?:0[02]|37)\",\"4(?:02|37)0|[34]00\"]],[\"(\\\\d{3})(\\\\d{2,3})(\\\\d{4})\",\"$1 $2 $3\",[\"(?:[358]|90)0\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{4})(\\\\d{4})\",\"$1 $2-$3\",[\"(?:[14689][1-9]|2[12478]|3[1-578]|5[13-5]|7[13-579])[2-57]\"],\"($1)\"],[\"(\\\\d{2})(\\\\d{5})(\\\\d{4})\",\"$1 $2-$3\",[\"[16][1-9]|[2-57-9]\"],\"($1)\"]],\"0\",0,\"(?:0|90)(?:(1[245]|2[1-35]|31|4[13]|[56]5|99)(\\\\d{10,11}))?\",\"$2\"],\"BS\":[\"1\",\"011\",\"(?:242|[58]\\\\d\\\\d|900)\\\\d{7}\",[10],0,\"1\",0,\"1|([3-8]\\\\d{6})$\",\"242$1\",0,\"242\"],\"BT\":[\"975\",\"00\",\"[17]\\\\d{7}|[2-8]\\\\d{6}\",[7,8],[[\"(\\\\d)(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"[2-68]|7[246]\"]],[\"(\\\\d{2})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"1[67]|7\"]]]],\"BW\":[\"267\",\"00\",\"(?:0800|(?:[37]|800)\\\\d)\\\\d{6}|(?:[2-6]\\\\d|90)\\\\d{5}\",[7,8,10],[[\"(\\\\d{2})(\\\\d{5})\",\"$1 $2\",[\"90\"]],[\"(\\\\d{3})(\\\\d{4})\",\"$1 $2\",[\"[24-6]|3[15-79]\"]],[\"(\\\\d{2})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"[37]\"]],[\"(\\\\d{4})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"0\"]],[\"(\\\\d{3})(\\\\d{4})(\\\\d{3})\",\"$1 $2 $3\",[\"8\"]]]],\"BY\":[\"375\",\"810\",\"(?:[12]\\\\d|33|44|902)\\\\d{7}|8(?:0[0-79]\\\\d{5,7}|[1-7]\\\\d{9})|8(?:1[0-489]|[5-79]\\\\d)\\\\d{7}|8[1-79]\\\\d{6,7}|8[0-79]\\\\d{5}|8\\\\d{5}\",[6,7,8,9,10,11],[[\"(\\\\d{3})(\\\\d{3})\",\"$1 $2\",[\"800\"],\"8 $1\"],[\"(\\\\d{3})(\\\\d{2})(\\\\d{2,4})\",\"$1 $2 $3\",[\"800\"],\"8 $1\"],[\"(\\\\d{4})(\\\\d{2})(\\\\d{3})\",\"$1 $2-$3\",[\"1(?:5[169]|6[3-5]|7[179])|2(?:1[35]|2[34]|3[3-5])\",\"1(?:5[169]|6(?:3[1-3]|4|5[125])|7(?:1[3-9]|7[0-24-6]|9[2-7]))|2(?:1[35]|2[34]|3[3-5])\"],\"8 0$1\"],[\"(\\\\d{3})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2-$3-$4\",[\"1(?:[56]|7[467])|2[1-3]\"],\"8 0$1\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{2})(\\\\d{2})\",\"$1 $2-$3-$4\",[\"[1-4]\"],\"8 0$1\"],[\"(\\\\d{3})(\\\\d{3,4})(\\\\d{4})\",\"$1 $2 $3\",[\"[89]\"],\"8 $1\"]],\"8\",0,\"0|80?\",0,0,0,0,\"8~10\"],\"BZ\":[\"501\",\"00\",\"(?:0800\\\\d|[2-8])\\\\d{6}\",[7,11],[[\"(\\\\d{3})(\\\\d{4})\",\"$1-$2\",[\"[2-8]\"]],[\"(\\\\d)(\\\\d{3})(\\\\d{4})(\\\\d{3})\",\"$1-$2-$3-$4\",[\"0\"]]]],\"CA\":[\"1\",\"011\",\"(?:[2-8]\\\\d|90)\\\\d{8}|3\\\\d{6}\",[7,10],0,\"1\",0,0,0,0,0,[[\"(?:2(?:04|[23]6|[48]9|50|63)|3(?:06|43|6[578])|4(?:03|1[68]|3[178]|50|68|74)|5(?:06|1[49]|48|79|8[147])|6(?:04|13|39|47|72)|7(?:0[59]|78|8[02])|8(?:[06]7|19|25|73)|90[25])[2-9]\\\\d{6}\",[10]],[\"\",[10]],[\"8(?:00|33|44|55|66|77|88)[2-9]\\\\d{6}\",[10]],[\"900[2-9]\\\\d{6}\",[10]],[\"52(?:3(?:[2-46-9][02-9]\\\\d|5(?:[02-46-9]\\\\d|5[0-46-9]))|4(?:[2-478][02-9]\\\\d|5(?:[034]\\\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\\\d)|9(?:[05-9]\\\\d|2[0-5]|49)))\\\\d{4}|52[34][2-9]1[02-9]\\\\d{4}|(?:5(?:00|2[125-7]|33|44|66|77|88)|622)[2-9]\\\\d{6}\",[10]],0,[\"310\\\\d{4}\",[7]],0,[\"600[2-9]\\\\d{6}\",[10]]]],\"CC\":[\"61\",\"001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011\",\"1(?:[0-79]\\\\d{8}(?:\\\\d{2})?|8[0-24-9]\\\\d{7})|[148]\\\\d{8}|1\\\\d{5,7}\",[6,7,8,9,10,12],0,\"0\",0,\"0|([59]\\\\d{7})$\",\"8$1\",0,0,[[\"8(?:51(?:0(?:02|31|60|89)|1(?:18|76)|223)|91(?:0(?:1[0-2]|29)|1(?:[28]2|50|79)|2(?:10|64)|3(?:[06]8|22)|4[29]8|62\\\\d|70[23]|959))\\\\d{3}\",[9]],[\"4(?:83[0-38]|93[0-6])\\\\d{5}|4(?:[0-3]\\\\d|4[047-9]|5[0-25-9]|6[06-9]|7[02-9]|8[0-24-9]|9[0-27-9])\\\\d{6}\",[9]],[\"180(?:0\\\\d{3}|2)\\\\d{3}\",[7,10]],[\"190[0-26]\\\\d{6}\",[10]],0,0,0,0,[\"14(?:5(?:1[0458]|[23][458])|71\\\\d)\\\\d{4}\",[9]],[\"13(?:00\\\\d{6}(?:\\\\d{2})?|45[0-4]\\\\d{3})|13\\\\d{4}\",[6,8,10,12]]],\"0011\"],\"CD\":[\"243\",\"00\",\"[189]\\\\d{8}|[1-68]\\\\d{6}\",[7,9],[[\"(\\\\d{2})(\\\\d{2})(\\\\d{3})\",\"$1 $2 $3\",[\"88\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{5})\",\"$1 $2\",[\"[1-6]\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"1\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"[89]\"],\"0$1\"]],\"0\"],\"CF\":[\"236\",\"00\",\"(?:[27]\\\\d{3}|8776)\\\\d{4}\",[8],[[\"(\\\\d{2})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"[278]\"]]]],\"CG\":[\"242\",\"00\",\"222\\\\d{6}|(?:0\\\\d|80)\\\\d{7}\",[9],[[\"(\\\\d)(\\\\d{4})(\\\\d{4})\",\"$1 $2 $3\",[\"8\"]],[\"(\\\\d{2})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"[02]\"]]]],\"CH\":[\"41\",\"00\",\"8\\\\d{11}|[2-9]\\\\d{8}\",[9],[[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"8[047]|90\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"[2-79]|81\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{2})(\\\\d{3})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4 $5\",[\"8\"],\"0$1\"]],\"0\"],\"CI\":[\"225\",\"00\",\"[02]\\\\d{9}\",[10],[[\"(\\\\d{2})(\\\\d{2})(\\\\d)(\\\\d{5})\",\"$1 $2 $3 $4\",[\"2\"]],[\"(\\\\d{2})(\\\\d{2})(\\\\d{2})(\\\\d{4})\",\"$1 $2 $3 $4\",[\"0\"]]]],\"CK\":[\"682\",\"00\",\"[2-578]\\\\d{4}\",[5],[[\"(\\\\d{2})(\\\\d{3})\",\"$1 $2\",[\"[2-578]\"]]]],\"CL\":[\"56\",\"(?:0|1(?:1[0-69]|2[02-5]|5[13-58]|69|7[0167]|8[018]))0\",\"12300\\\\d{6}|6\\\\d{9,10}|[2-9]\\\\d{8}\",[9,10,11],[[\"(\\\\d{5})(\\\\d{4})\",\"$1 $2\",[\"219\",\"2196\"],\"($1)\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"44\"]],[\"(\\\\d)(\\\\d{4})(\\\\d{4})\",\"$1 $2 $3\",[\"2[1-36]\"],\"($1)\"],[\"(\\\\d)(\\\\d{4})(\\\\d{4})\",\"$1 $2 $3\",[\"9[2-9]\"]],[\"(\\\\d{2})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"3[2-5]|[47]|5[1-3578]|6[13-57]|8(?:0[1-9]|[1-9])\"],\"($1)\"],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3,4})\",\"$1 $2 $3\",[\"60|8\"]],[\"(\\\\d{4})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"1\"]],[\"(\\\\d{3})(\\\\d{3})(\\\\d{2})(\\\\d{3})\",\"$1 $2 $3 $4\",[\"60\"]]]],\"CM\":[\"237\",\"00\",\"[26]\\\\d{8}|88\\\\d{6,7}\",[8,9],[[\"(\\\\d{2})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"88\"]],[\"(\\\\d)(\\\\d{2})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4 $5\",[\"[26]|88\"]]]],\"CN\":[\"86\",\"00|1(?:[12]\\\\d|79)\\\\d\\\\d00\",\"1[127]\\\\d{8,9}|2\\\\d{9}(?:\\\\d{2})?|[12]\\\\d{6,7}|86\\\\d{6}|(?:1[03-689]\\\\d|6)\\\\d{7,9}|(?:[3-579]\\\\d|8[0-57-9])\\\\d{6,9}\",[7,8,9,10,11,12],[[\"(\\\\d{2})(\\\\d{5,6})\",\"$1 $2\",[\"(?:10|2[0-57-9])[19]\",\"(?:10|2[0-57-9])(?:10|9[56])\",\"(?:10|2[0-57-9])(?:100|9[56])\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{5,6})\",\"$1 $2\",[\"3(?:[157]|35|49|9[1-68])|4(?:[17]|2[179]|6[47-9]|8[23])|5(?:[1357]|2[37]|4[36]|6[1-46]|80)|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]|4[13]|5[1-5])|(?:4[35]|59|85)[1-9]\",\"(?:3(?:[157]\\\\d|35|49|9[1-68])|4(?:[17]\\\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\\\d|4[13]|5[1-5]))[19]\",\"85[23](?:10|95)|(?:3(?:[157]\\\\d|35|49|9[1-68])|4(?:[17]\\\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\\\d|5[14-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\\\d|4[13]|5[1-5]))(?:10|9[56])\",\"85[23](?:100|95)|(?:3(?:[157]\\\\d|35|49|9[1-68])|4(?:[17]\\\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\\\d|5[14-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\\\d|4[13]|5[1-5]))(?:100|9[56])\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"(?:4|80)0\"]],[\"(\\\\d{2})(\\\\d{4})(\\\\d{4})\",\"$1 $2 $3\",[\"10|2(?:[02-57-9]|1[1-9])\",\"10|2(?:[02-57-9]|1[1-9])\",\"10[0-79]|2(?:[02-57-9]|1[1-79])|(?:10|21)8(?:0[1-9]|[1-9])\"],\"0$1\",1],[\"(\\\\d{3})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"3(?:[3-59]|7[02-68])|4(?:[26-8]|3[3-9]|5[2-9])|5(?:3[03-9]|[468]|7[028]|9[2-46-9])|6|7(?:[0-247]|3[04-9]|5[0-4689]|6[2368])|8(?:[1-358]|9[1-7])|9(?:[013479]|5[1-5])|(?:[34]1|55|79|87)[02-9]\"],\"0$1\",1],[\"(\\\\d{3})(\\\\d{7,8})\",\"$1 $2\",[\"9\"]],[\"(\\\\d{4})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"80\"],\"0$1\",1],[\"(\\\\d{3})(\\\\d{4})(\\\\d{4})\",\"$1 $2 $3\",[\"[3-578]\"],\"0$1\",1],[\"(\\\\d{3})(\\\\d{4})(\\\\d{4})\",\"$1 $2 $3\",[\"1[3-9]\"]],[\"(\\\\d{2})(\\\\d{3})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3 $4\",[\"[12]\"],\"0$1\",1]],\"0\",0,\"0|(1(?:[12]\\\\d|79)\\\\d\\\\d)\",0,0,0,0,\"00\"],\"CO\":[\"57\",\"00(?:4(?:[14]4|56)|[579])\",\"(?:(?:1\\\\d|[36])\\\\d{3}|9101)\\\\d{6}|[124-8]\\\\d{7}\",[8,10,11],[[\"(\\\\d)(\\\\d{7})\",\"$1 $2\",[\"[146][2-9]|[2578]\"],\"($1)\"],[\"(\\\\d{3})(\\\\d{7})\",\"$1 $2\",[\"6\"],\"($1)\"],[\"(\\\\d{3})(\\\\d{7})\",\"$1 $2\",[\"[39]\"]],[\"(\\\\d)(\\\\d{3})(\\\\d{7})\",\"$1-$2-$3\",[\"1\"],\"0$1\",0,\"$1 $2 $3\"]],\"0\",0,\"0([3579]|4(?:[14]4|56))?\"],\"CR\":[\"506\",\"00\",\"(?:8\\\\d|90)\\\\d{8}|(?:[24-8]\\\\d{3}|3005)\\\\d{4}\",[8,10],[[\"(\\\\d{4})(\\\\d{4})\",\"$1 $2\",[\"[2-7]|8[3-9]\"]],[\"(\\\\d{3})(\\\\d{3})(\\\\d{4})\",\"$1-$2-$3\",[\"[89]\"]]],0,0,\"(19(?:0[0-2468]|1[09]|20|66|77|99))\"],\"CU\":[\"53\",\"119\",\"[27]\\\\d{6,7}|[34]\\\\d{5,7}|(?:5|8\\\\d\\\\d)\\\\d{7}\",[6,7,8,10],[[\"(\\\\d{2})(\\\\d{4,6})\",\"$1 $2\",[\"2[1-4]|[34]\"],\"(0$1)\"],[\"(\\\\d)(\\\\d{6,7})\",\"$1 $2\",[\"7\"],\"(0$1)\"],[\"(\\\\d)(\\\\d{7})\",\"$1 $2\",[\"5\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{7})\",\"$1 $2\",[\"8\"],\"0$1\"]],\"0\"],\"CV\":[\"238\",\"0\",\"(?:[2-59]\\\\d\\\\d|800)\\\\d{4}\",[7],[[\"(\\\\d{3})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3\",[\"[2-589]\"]]]],\"CW\":[\"599\",\"00\",\"(?:[34]1|60|(?:7|9\\\\d)\\\\d)\\\\d{5}\",[7,8],[[\"(\\\\d{3})(\\\\d{4})\",\"$1 $2\",[\"[3467]\"]],[\"(\\\\d)(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"9[4-8]\"]]],0,0,0,0,0,\"[69]\"],\"CX\":[\"61\",\"001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011\",\"1(?:[0-79]\\\\d{8}(?:\\\\d{2})?|8[0-24-9]\\\\d{7})|[148]\\\\d{8}|1\\\\d{5,7}\",[6,7,8,9,10,12],0,\"0\",0,\"0|([59]\\\\d{7})$\",\"8$1\",0,0,[[\"8(?:51(?:0(?:01|30|59|88)|1(?:17|46|75)|2(?:22|35))|91(?:00[6-9]|1(?:[28]1|49|78)|2(?:09|63)|3(?:12|26|75)|4(?:56|97)|64\\\\d|7(?:0[01]|1[0-2])|958))\\\\d{3}\",[9]],[\"4(?:83[0-38]|93[0-6])\\\\d{5}|4(?:[0-3]\\\\d|4[047-9]|5[0-25-9]|6[06-9]|7[02-9]|8[0-24-9]|9[0-27-9])\\\\d{6}\",[9]],[\"180(?:0\\\\d{3}|2)\\\\d{3}\",[7,10]],[\"190[0-26]\\\\d{6}\",[10]],0,0,0,0,[\"14(?:5(?:1[0458]|[23][458])|71\\\\d)\\\\d{4}\",[9]],[\"13(?:00\\\\d{6}(?:\\\\d{2})?|45[0-4]\\\\d{3})|13\\\\d{4}\",[6,8,10,12]]],\"0011\"],\"CY\":[\"357\",\"00\",\"(?:[279]\\\\d|[58]0)\\\\d{6}\",[8],[[\"(\\\\d{2})(\\\\d{6})\",\"$1 $2\",[\"[257-9]\"]]]],\"CZ\":[\"420\",\"00\",\"(?:[2-578]\\\\d|60)\\\\d{7}|9\\\\d{8,11}\",[9],[[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"[2-8]|9[015-7]\"]],[\"(\\\\d{2})(\\\\d{3})(\\\\d{3})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"96\"]],[\"(\\\\d{2})(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3 $4\",[\"9\"]],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3 $4\",[\"9\"]]]],\"DE\":[\"49\",\"00\",\"[2579]\\\\d{5,14}|49(?:[34]0|69|8\\\\d)\\\\d\\\\d?|49(?:37|49|60|7[089]|9\\\\d)\\\\d{1,3}|49(?:1\\\\d|2[02-9]|3[2-689]|7[1-7])\\\\d{1,8}|(?:1|[368]\\\\d|4[0-8])\\\\d{3,13}|49(?:[05]\\\\d|[23]1|[46][1-8])\\\\d{1,9}\",[4,5,6,7,8,9,10,11,12,13,14,15],[[\"(\\\\d{2})(\\\\d{3,13})\",\"$1 $2\",[\"3[02]|40|[68]9\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{3,12})\",\"$1 $2\",[\"2(?:0[1-389]|1[124]|2[18]|3[14])|3(?:[35-9][15]|4[015])|906|(?:2[4-9]|4[2-9]|[579][1-9]|[68][1-8])1\",\"2(?:0[1-389]|12[0-8])|3(?:[35-9][15]|4[015])|906|2(?:[13][14]|2[18])|(?:2[4-9]|4[2-9]|[579][1-9]|[68][1-8])1\"],\"0$1\"],[\"(\\\\d{4})(\\\\d{2,11})\",\"$1 $2\",[\"[24-6]|3(?:[3569][02-46-9]|4[2-4679]|7[2-467]|8[2-46-8])|70[2-8]|8(?:0[2-9]|[1-8])|90[7-9]|[79][1-9]\",\"[24-6]|3(?:3(?:0[1-467]|2[127-9]|3[124578]|7[1257-9]|8[1256]|9[145])|4(?:2[135]|4[13578]|9[1346])|5(?:0[14]|2[1-3589]|6[1-4]|7[13468]|8[13568])|6(?:2[1-489]|3[124-6]|6[13]|7[12579]|8[1-356]|9[135])|7(?:2[1-7]|4[145]|6[1-5]|7[1-4])|8(?:21|3[1468]|6|7[1467]|8[136])|9(?:0[12479]|2[1358]|4[134679]|6[1-9]|7[136]|8[147]|9[1468]))|70[2-8]|8(?:0[2-9]|[1-8])|90[7-9]|[79][1-9]|3[68]4[1347]|3(?:47|60)[1356]|3(?:3[46]|46|5[49])[1246]|3[4579]3[1357]\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{4})\",\"$1 $2\",[\"138\"],\"0$1\"],[\"(\\\\d{5})(\\\\d{2,10})\",\"$1 $2\",[\"3\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{5,11})\",\"$1 $2\",[\"181\"],\"0$1\"],[\"(\\\\d{3})(\\\\d)(\\\\d{4,10})\",\"$1 $2 $3\",[\"1(?:3|80)|9\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{7,8})\",\"$1 $2\",[\"1[67]\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{7,12})\",\"$1 $2\",[\"8\"],\"0$1\"],[\"(\\\\d{5})(\\\\d{6})\",\"$1 $2\",[\"185\",\"1850\",\"18500\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{4})(\\\\d{4})\",\"$1 $2 $3\",[\"7\"],\"0$1\"],[\"(\\\\d{4})(\\\\d{7})\",\"$1 $2\",[\"18[68]\"],\"0$1\"],[\"(\\\\d{5})(\\\\d{6})\",\"$1 $2\",[\"15[0568]\"],\"0$1\"],[\"(\\\\d{4})(\\\\d{7})\",\"$1 $2\",[\"15[1279]\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{8})\",\"$1 $2\",[\"18\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{2})(\\\\d{7,8})\",\"$1 $2 $3\",[\"1(?:6[023]|7)\"],\"0$1\"],[\"(\\\\d{4})(\\\\d{2})(\\\\d{7})\",\"$1 $2 $3\",[\"15[279]\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{2})(\\\\d{8})\",\"$1 $2 $3\",[\"15\"],\"0$1\"]],\"0\"],\"DJ\":[\"253\",\"00\",\"(?:2\\\\d|77)\\\\d{6}\",[8],[[\"(\\\\d{2})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"[27]\"]]]],\"DK\":[\"45\",\"00\",\"[2-9]\\\\d{7}\",[8],[[\"(\\\\d{2})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"[2-9]\"]]]],\"DM\":[\"1\",\"011\",\"(?:[58]\\\\d\\\\d|767|900)\\\\d{7}\",[10],0,\"1\",0,\"1|([2-7]\\\\d{6})$\",\"767$1\",0,\"767\"],\"DO\":[\"1\",\"011\",\"(?:[58]\\\\d\\\\d|900)\\\\d{7}\",[10],0,\"1\",0,0,0,0,\"8001|8[024]9\"],\"DZ\":[\"213\",\"00\",\"(?:[1-4]|[5-79]\\\\d|80)\\\\d{7}\",[8,9],[[\"(\\\\d{2})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"[1-4]\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"9\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"[5-8]\"],\"0$1\"]],\"0\"],\"EC\":[\"593\",\"00\",\"1\\\\d{9,10}|(?:[2-7]|9\\\\d)\\\\d{7}\",[8,9,10,11],[[\"(\\\\d)(\\\\d{3})(\\\\d{4})\",\"$1 $2-$3\",[\"[2-7]\"],\"(0$1)\",0,\"$1-$2-$3\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"9\"],\"0$1\"],[\"(\\\\d{4})(\\\\d{3})(\\\\d{3,4})\",\"$1 $2 $3\",[\"1\"]]],\"0\"],\"EE\":[\"372\",\"00\",\"8\\\\d{9}|[4578]\\\\d{7}|(?:[3-8]\\\\d|90)\\\\d{5}\",[7,8,10],[[\"(\\\\d{3})(\\\\d{4})\",\"$1 $2\",[\"[369]|4[3-8]|5(?:[0-2]|5[0-478]|6[45])|7[1-9]|88\",\"[369]|4[3-8]|5(?:[02]|1(?:[0-8]|95)|5[0-478]|6(?:4[0-4]|5[1-589]))|7[1-9]|88\"]],[\"(\\\\d{4})(\\\\d{3,4})\",\"$1 $2\",[\"[45]|8(?:00|[1-49])\",\"[45]|8(?:00[1-9]|[1-49])\"]],[\"(\\\\d{2})(\\\\d{2})(\\\\d{4})\",\"$1 $2 $3\",[\"7\"]],[\"(\\\\d{4})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"8\"]]]],\"EG\":[\"20\",\"00\",\"[189]\\\\d{8,9}|[24-6]\\\\d{8}|[135]\\\\d{7}\",[8,9,10],[[\"(\\\\d)(\\\\d{7,8})\",\"$1 $2\",[\"[23]\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{6,7})\",\"$1 $2\",[\"1[35]|[4-6]|8[2468]|9[235-7]\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"[189]\"],\"0$1\"]],\"0\"],\"EH\":[\"212\",\"00\",\"[5-8]\\\\d{8}\",[9],0,\"0\",0,0,0,0,\"528[89]\"],\"ER\":[\"291\",\"00\",\"[178]\\\\d{6}\",[7],[[\"(\\\\d)(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"[178]\"],\"0$1\"]],\"0\"],\"ES\":[\"34\",\"00\",\"[5-9]\\\\d{8}\",[9],[[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"[89]00\"]],[\"(\\\\d{3})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"[5-9]\"]]]],\"ET\":[\"251\",\"00\",\"(?:11|[2-59]\\\\d)\\\\d{7}\",[9],[[\"(\\\\d{2})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"[1-59]\"],\"0$1\"]],\"0\"],\"FI\":[\"358\",\"00|99(?:[01469]|5(?:[14]1|3[23]|5[59]|77|88|9[09]))\",\"[1-35689]\\\\d{4}|7\\\\d{10,11}|(?:[124-7]\\\\d|3[0-46-9])\\\\d{8}|[1-9]\\\\d{5,8}\",[5,6,7,8,9,10,11,12],[[\"(\\\\d)(\\\\d{4,9})\",\"$1 $2\",[\"[2568][1-8]|3(?:0[1-9]|[1-9])|9\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{3,7})\",\"$1 $2\",[\"[12]00|[368]|70[07-9]\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{4,8})\",\"$1 $2\",[\"[1245]|7[135]\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{6,10})\",\"$1 $2\",[\"7\"],\"0$1\"]],\"0\",0,0,0,0,\"1[03-79]|[2-9]\",0,\"00\"],\"FJ\":[\"679\",\"0(?:0|52)\",\"45\\\\d{5}|(?:0800\\\\d|[235-9])\\\\d{6}\",[7,11],[[\"(\\\\d{3})(\\\\d{4})\",\"$1 $2\",[\"[235-9]|45\"]],[\"(\\\\d{4})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"0\"]]],0,0,0,0,0,0,0,\"00\"],\"FK\":[\"500\",\"00\",\"[2-7]\\\\d{4}\",[5]],\"FM\":[\"691\",\"00\",\"(?:[39]\\\\d\\\\d|820)\\\\d{4}\",[7],[[\"(\\\\d{3})(\\\\d{4})\",\"$1 $2\",[\"[389]\"]]]],\"FO\":[\"298\",\"00\",\"[2-9]\\\\d{5}\",[6],[[\"(\\\\d{6})\",\"$1\",[\"[2-9]\"]]],0,0,\"(10(?:01|[12]0|88))\"],\"FR\":[\"33\",\"00\",\"[1-9]\\\\d{8}\",[9],[[\"(\\\\d{3})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"8\"],\"0 $1\"],[\"(\\\\d)(\\\\d{2})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4 $5\",[\"[1-79]\"],\"0$1\"]],\"0\"],\"GA\":[\"241\",\"00\",\"(?:[067]\\\\d|11)\\\\d{6}|[2-7]\\\\d{6}\",[7,8],[[\"(\\\\d)(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"[2-7]\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"0\"]],[\"(\\\\d{2})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"11|[67]\"],\"0$1\"]],0,0,\"0(11\\\\d{6}|60\\\\d{6}|61\\\\d{6}|6[256]\\\\d{6}|7[467]\\\\d{6})\",\"$1\"],\"GB\":[\"44\",\"00\",\"[1-357-9]\\\\d{9}|[18]\\\\d{8}|8\\\\d{6}\",[7,9,10],[[\"(\\\\d{3})(\\\\d{4})\",\"$1 $2\",[\"800\",\"8001\",\"80011\",\"800111\",\"8001111\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3\",[\"845\",\"8454\",\"84546\",\"845464\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{6})\",\"$1 $2\",[\"800\"],\"0$1\"],[\"(\\\\d{5})(\\\\d{4,5})\",\"$1 $2\",[\"1(?:38|5[23]|69|76|94)\",\"1(?:(?:38|69)7|5(?:24|39)|768|946)\",\"1(?:3873|5(?:242|39[4-6])|(?:697|768)[347]|9467)\"],\"0$1\"],[\"(\\\\d{4})(\\\\d{5,6})\",\"$1 $2\",[\"1(?:[2-69][02-9]|[78])\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{4})(\\\\d{4})\",\"$1 $2 $3\",[\"[25]|7(?:0|6[02-9])\",\"[25]|7(?:0|6(?:[03-9]|2[356]))\"],\"0$1\"],[\"(\\\\d{4})(\\\\d{6})\",\"$1 $2\",[\"7\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"[1389]\"],\"0$1\"]],\"0\",0,0,0,0,0,[[\"(?:1(?:1(?:3(?:[0-58]\\\\d\\\\d|73[0235])|4(?:[0-5]\\\\d\\\\d|69[7-9]|70[01359])|(?:5[0-26-9]|[78][0-49])\\\\d\\\\d|6(?:[0-4]\\\\d\\\\d|50[0-79]))|2(?:(?:0[024-9]|2[3-9]|3[3-79]|4[1-689]|[58][02-9]|6[0-47-9]|7[013-9]|9\\\\d)\\\\d\\\\d|1(?:[0-7]\\\\d\\\\d|8(?:[02]\\\\d|1[0-26-9])))|(?:3(?:0\\\\d|1[0-8]|[25][02-9]|3[02-579]|[468][0-46-9]|7[1-35-79]|9[2-578])|4(?:0[03-9]|[137]\\\\d|[28][02-57-9]|4[02-69]|5[0-8]|[69][0-79])|5(?:0[1-35-9]|[16]\\\\d|2[024-9]|3[015689]|4[02-9]|5[03-9]|7[0-35-9]|8[0-468]|9[0-57-9])|6(?:0[034689]|1\\\\d|2[0-35689]|[38][013-9]|4[1-467]|5[0-69]|6[13-9]|7[0-8]|9[0-24578])|7(?:0[0246-9]|2\\\\d|3[0236-8]|4[03-9]|5[0-46-9]|6[013-9]|7[0-35-9]|8[024-9]|9[02-9])|8(?:0[35-9]|2[1-57-9]|3[02-578]|4[0-578]|5[124-9]|6[2-69]|7\\\\d|8[02-9]|9[02569])|9(?:0[02-589]|[18]\\\\d|2[02-689]|3[1-57-9]|4[2-9]|5[0-579]|6[2-47-9]|7[0-24578]|9[2-57]))\\\\d\\\\d)|2(?:0[013478]|3[0189]|4[017]|8[0-46-9]|9[0-2])\\\\d{3})\\\\d{4}|1(?:2(?:0(?:46[1-4]|87[2-9])|545[1-79]|76(?:2\\\\d|3[1-8]|6[1-6])|9(?:7(?:2[0-4]|3[2-5])|8(?:2[2-8]|7[0-47-9]|8[3-5])))|3(?:6(?:38[2-5]|47[23])|8(?:47[04-9]|64[0157-9]))|4(?:044[1-7]|20(?:2[23]|8\\\\d)|6(?:0(?:30|5[2-57]|6[1-8]|7[2-8])|140)|8(?:052|87[1-3]))|5(?:2(?:4(?:3[2-79]|6\\\\d)|76\\\\d)|6(?:26[06-9]|686))|6(?:06(?:4\\\\d|7[4-79])|295[5-7]|35[34]\\\\d|47(?:24|61)|59(?:5[08]|6[67]|74)|9(?:55[0-4]|77[23]))|7(?:26(?:6[13-9]|7[0-7])|(?:442|688)\\\\d|50(?:2[0-3]|[3-68]2|76))|8(?:27[56]\\\\d|37(?:5[2-5]|8[239])|843[2-58])|9(?:0(?:0(?:6[1-8]|85)|52\\\\d)|3583|4(?:66[1-8]|9(?:2[01]|81))|63(?:23|3[1-4])|9561))\\\\d{3}\",[9,10]],[\"7(?:457[0-57-9]|700[01]|911[028])\\\\d{5}|7(?:[1-3]\\\\d\\\\d|4(?:[0-46-9]\\\\d|5[0-689])|5(?:0[0-8]|[13-9]\\\\d|2[0-35-9])|7(?:0[1-9]|[1-7]\\\\d|8[02-9]|9[0-689])|8(?:[014-9]\\\\d|[23][0-8])|9(?:[024-9]\\\\d|1[02-9]|3[0-689]))\\\\d{6}\",[10]],[\"80[08]\\\\d{7}|800\\\\d{6}|8001111\"],[\"(?:8(?:4[2-5]|7[0-3])|9(?:[01]\\\\d|8[2-49]))\\\\d{7}|845464\\\\d\",[7,10]],[\"70\\\\d{8}\",[10]],0,[\"(?:3[0347]|55)\\\\d{8}\",[10]],[\"76(?:464|652)\\\\d{5}|76(?:0[0-2]|2[356]|34|4[01347]|5[49]|6[0-369]|77|8[14]|9[139])\\\\d{6}\",[10]],[\"56\\\\d{8}\",[10]]],0,\" x\"],\"GD\":[\"1\",\"011\",\"(?:473|[58]\\\\d\\\\d|900)\\\\d{7}\",[10],0,\"1\",0,\"1|([2-9]\\\\d{6})$\",\"473$1\",0,\"473\"],\"GE\":[\"995\",\"00\",\"(?:[3-57]\\\\d\\\\d|800)\\\\d{6}\",[9],[[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"70\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"32\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"[57]\"]],[\"(\\\\d{3})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"[348]\"],\"0$1\"]],\"0\"],\"GF\":[\"594\",\"00\",\"(?:[56]94|80\\\\d|976)\\\\d{6}\",[9],[[\"(\\\\d{3})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"[569]\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"8\"],\"0$1\"]],\"0\"],\"GG\":[\"44\",\"00\",\"(?:1481|[357-9]\\\\d{3})\\\\d{6}|8\\\\d{6}(?:\\\\d{2})?\",[7,9,10],0,\"0\",0,\"0|([25-9]\\\\d{5})$\",\"1481$1\",0,0,[[\"1481[25-9]\\\\d{5}\",[10]],[\"7(?:(?:781|839)\\\\d|911[17])\\\\d{5}\",[10]],[\"80[08]\\\\d{7}|800\\\\d{6}|8001111\"],[\"(?:8(?:4[2-5]|7[0-3])|9(?:[01]\\\\d|8[0-3]))\\\\d{7}|845464\\\\d\",[7,10]],[\"70\\\\d{8}\",[10]],0,[\"(?:3[0347]|55)\\\\d{8}\",[10]],[\"76(?:464|652)\\\\d{5}|76(?:0[0-2]|2[356]|34|4[01347]|5[49]|6[0-369]|77|8[14]|9[139])\\\\d{6}\",[10]],[\"56\\\\d{8}\",[10]]]],\"GH\":[\"233\",\"00\",\"(?:[235]\\\\d{3}|800)\\\\d{5}\",[8,9],[[\"(\\\\d{3})(\\\\d{5})\",\"$1 $2\",[\"8\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"[235]\"],\"0$1\"]],\"0\"],\"GI\":[\"350\",\"00\",\"(?:[25]\\\\d\\\\d|606)\\\\d{5}\",[8],[[\"(\\\\d{3})(\\\\d{5})\",\"$1 $2\",[\"2\"]]]],\"GL\":[\"299\",\"00\",\"(?:19|[2-689]\\\\d|70)\\\\d{4}\",[6],[[\"(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3\",[\"19|[2-9]\"]]]],\"GM\":[\"220\",\"00\",\"[2-9]\\\\d{6}\",[7],[[\"(\\\\d{3})(\\\\d{4})\",\"$1 $2\",[\"[2-9]\"]]]],\"GN\":[\"224\",\"00\",\"722\\\\d{6}|(?:3|6\\\\d)\\\\d{7}\",[8,9],[[\"(\\\\d{2})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"3\"]],[\"(\\\\d{3})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"[67]\"]]]],\"GP\":[\"590\",\"00\",\"(?:590|(?:69|80)\\\\d|976)\\\\d{6}\",[9],[[\"(\\\\d{3})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"[569]\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"8\"],\"0$1\"]],\"0\",0,0,0,0,0,[[\"590(?:0[1-68]|[14][0-24-9]|2[0-68]|3[1289]|5[3-579]|6[0189]|7[08]|8[0-689]|9\\\\d)\\\\d{4}\"],[\"69(?:0\\\\d\\\\d|1(?:2[2-9]|3[0-5]))\\\\d{4}\"],[\"80[0-5]\\\\d{6}\"],0,0,0,0,0,[\"976[01]\\\\d{5}\"]]],\"GQ\":[\"240\",\"00\",\"222\\\\d{6}|(?:3\\\\d|55|[89]0)\\\\d{7}\",[9],[[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"[235]\"]],[\"(\\\\d{3})(\\\\d{6})\",\"$1 $2\",[\"[89]\"]]]],\"GR\":[\"30\",\"00\",\"5005000\\\\d{3}|8\\\\d{9,11}|(?:[269]\\\\d|70)\\\\d{8}\",[10,11,12],[[\"(\\\\d{2})(\\\\d{4})(\\\\d{4})\",\"$1 $2 $3\",[\"21|7\"]],[\"(\\\\d{4})(\\\\d{6})\",\"$1 $2\",[\"2(?:2|3[2-57-9]|4[2-469]|5[2-59]|6[2-9]|7[2-69]|8[2-49])|5\"]],[\"(\\\\d{3})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"[2689]\"]],[\"(\\\\d{3})(\\\\d{3,4})(\\\\d{5})\",\"$1 $2 $3\",[\"8\"]]]],\"GT\":[\"502\",\"00\",\"(?:1\\\\d{3}|[2-7])\\\\d{7}\",[8,11],[[\"(\\\\d{4})(\\\\d{4})\",\"$1 $2\",[\"[2-7]\"]],[\"(\\\\d{4})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"1\"]]]],\"GU\":[\"1\",\"011\",\"(?:[58]\\\\d\\\\d|671|900)\\\\d{7}\",[10],0,\"1\",0,\"1|([3-9]\\\\d{6})$\",\"671$1\",0,\"671\"],\"GW\":[\"245\",\"00\",\"[49]\\\\d{8}|4\\\\d{6}\",[7,9],[[\"(\\\\d{3})(\\\\d{4})\",\"$1 $2\",[\"40\"]],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"[49]\"]]]],\"GY\":[\"592\",\"001\",\"9008\\\\d{3}|(?:[2-467]\\\\d\\\\d|862)\\\\d{4}\",[7],[[\"(\\\\d{3})(\\\\d{4})\",\"$1 $2\",[\"[2-46-9]\"]]]],\"HK\":[\"852\",\"00(?:30|5[09]|[126-9]?)\",\"8[0-46-9]\\\\d{6,7}|9\\\\d{4,7}|(?:[2-7]|9\\\\d{3})\\\\d{7}\",[5,6,7,8,9,11],[[\"(\\\\d{3})(\\\\d{2,5})\",\"$1 $2\",[\"900\",\"9003\"]],[\"(\\\\d{4})(\\\\d{4})\",\"$1 $2\",[\"[2-7]|8[1-4]|9(?:0[1-9]|[1-8])\"]],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"8\"]],[\"(\\\\d{3})(\\\\d{2})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3 $4\",[\"9\"]]],0,0,0,0,0,0,0,\"00\"],\"HN\":[\"504\",\"00\",\"8\\\\d{10}|[237-9]\\\\d{7}\",[8,11],[[\"(\\\\d{4})(\\\\d{4})\",\"$1-$2\",[\"[237-9]\"]]]],\"HR\":[\"385\",\"00\",\"(?:[24-69]\\\\d|3[0-79])\\\\d{7}|80\\\\d{5,7}|[1-79]\\\\d{7}|6\\\\d{5,6}\",[6,7,8,9],[[\"(\\\\d{2})(\\\\d{2})(\\\\d{2,3})\",\"$1 $2 $3\",[\"6[01]\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{2})(\\\\d{2,3})\",\"$1 $2 $3\",[\"8\"],\"0$1\"],[\"(\\\\d)(\\\\d{4})(\\\\d{3})\",\"$1 $2 $3\",[\"1\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{3,4})\",\"$1 $2 $3\",[\"[67]\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{3,4})\",\"$1 $2 $3\",[\"9\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{3,4})\",\"$1 $2 $3\",[\"[2-5]\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"8\"],\"0$1\"]],\"0\"],\"HT\":[\"509\",\"00\",\"[2-489]\\\\d{7}\",[8],[[\"(\\\\d{2})(\\\\d{2})(\\\\d{4})\",\"$1 $2 $3\",[\"[2-489]\"]]]],\"HU\":[\"36\",\"00\",\"[235-7]\\\\d{8}|[1-9]\\\\d{7}\",[8,9],[[\"(\\\\d)(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"1\"],\"(06 $1)\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"[27][2-9]|3[2-7]|4[24-9]|5[2-79]|6|8[2-57-9]|9[2-69]\"],\"(06 $1)\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{3,4})\",\"$1 $2 $3\",[\"[2-9]\"],\"06 $1\"]],\"06\"],\"ID\":[\"62\",\"00[89]\",\"(?:(?:00[1-9]|8\\\\d)\\\\d{4}|[1-36])\\\\d{6}|00\\\\d{10}|[1-9]\\\\d{8,10}|[2-9]\\\\d{7}\",[7,8,9,10,11,12,13],[[\"(\\\\d)(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"15\"]],[\"(\\\\d{2})(\\\\d{5,9})\",\"$1 $2\",[\"2[124]|[36]1\"],\"(0$1)\"],[\"(\\\\d{3})(\\\\d{5,7})\",\"$1 $2\",[\"800\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{5,8})\",\"$1 $2\",[\"[2-79]\"],\"(0$1)\"],[\"(\\\\d{3})(\\\\d{3,4})(\\\\d{3})\",\"$1-$2-$3\",[\"8[1-35-9]\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{6,8})\",\"$1 $2\",[\"1\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"804\"],\"0$1\"],[\"(\\\\d{3})(\\\\d)(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3 $4\",[\"80\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{4})(\\\\d{4,5})\",\"$1-$2-$3\",[\"8\"],\"0$1\"]],\"0\"],\"IE\":[\"353\",\"00\",\"(?:1\\\\d|[2569])\\\\d{6,8}|4\\\\d{6,9}|7\\\\d{8}|8\\\\d{8,9}\",[7,8,9,10],[[\"(\\\\d{2})(\\\\d{5})\",\"$1 $2\",[\"2[24-9]|47|58|6[237-9]|9[35-9]\"],\"(0$1)\"],[\"(\\\\d{3})(\\\\d{5})\",\"$1 $2\",[\"[45]0\"],\"(0$1)\"],[\"(\\\\d)(\\\\d{3,4})(\\\\d{4})\",\"$1 $2 $3\",[\"1\"],\"(0$1)\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{3,4})\",\"$1 $2 $3\",[\"[2569]|4[1-69]|7[14]\"],\"(0$1)\"],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"70\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"81\"],\"(0$1)\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"[78]\"],\"0$1\"],[\"(\\\\d{4})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"1\"]],[\"(\\\\d{2})(\\\\d{4})(\\\\d{4})\",\"$1 $2 $3\",[\"4\"],\"(0$1)\"],[\"(\\\\d{2})(\\\\d)(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3 $4\",[\"8\"],\"0$1\"]],\"0\"],\"IL\":[\"972\",\"0(?:0|1[2-9])\",\"1\\\\d{6}(?:\\\\d{3,5})?|[57]\\\\d{8}|[1-489]\\\\d{7}\",[7,8,9,10,11,12],[[\"(\\\\d{4})(\\\\d{3})\",\"$1-$2\",[\"125\"]],[\"(\\\\d{4})(\\\\d{2})(\\\\d{2})\",\"$1-$2-$3\",[\"121\"]],[\"(\\\\d)(\\\\d{3})(\\\\d{4})\",\"$1-$2-$3\",[\"[2-489]\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{4})\",\"$1-$2-$3\",[\"[57]\"],\"0$1\"],[\"(\\\\d{4})(\\\\d{3})(\\\\d{3})\",\"$1-$2-$3\",[\"12\"]],[\"(\\\\d{4})(\\\\d{6})\",\"$1-$2\",[\"159\"]],[\"(\\\\d)(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1-$2-$3-$4\",[\"1[7-9]\"]],[\"(\\\\d{3})(\\\\d{1,2})(\\\\d{3})(\\\\d{4})\",\"$1-$2 $3-$4\",[\"15\"]]],\"0\"],\"IM\":[\"44\",\"00\",\"1624\\\\d{6}|(?:[3578]\\\\d|90)\\\\d{8}\",[10],0,\"0\",0,\"0|([25-8]\\\\d{5})$\",\"1624$1\",0,\"74576|(?:16|7[56])24\"],\"IN\":[\"91\",\"00\",\"(?:000800|[2-9]\\\\d\\\\d)\\\\d{7}|1\\\\d{7,12}\",[8,9,10,11,12,13],[[\"(\\\\d{8})\",\"$1\",[\"5(?:0|2[23]|3[03]|[67]1|88)\",\"5(?:0|2(?:21|3)|3(?:0|3[23])|616|717|888)\",\"5(?:0|2(?:21|3)|3(?:0|3[23])|616|717|8888)\"],0,1],[\"(\\\\d{4})(\\\\d{4,5})\",\"$1 $2\",[\"180\",\"1800\"],0,1],[\"(\\\\d{3})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"140\"],0,1],[\"(\\\\d{2})(\\\\d{4})(\\\\d{4})\",\"$1 $2 $3\",[\"11|2[02]|33|4[04]|79[1-7]|80[2-46]\",\"11|2[02]|33|4[04]|79(?:[1-6]|7[19])|80(?:[2-4]|6[0-589])\",\"11|2[02]|33|4[04]|79(?:[124-6]|3(?:[02-9]|1[0-24-9])|7(?:1|9[1-6]))|80(?:[2-4]|6[0-589])\"],\"0$1\",1],[\"(\\\\d{3})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"1(?:2[0-249]|3[0-25]|4[145]|[68]|7[1257])|2(?:1[257]|3[013]|4[01]|5[0137]|6[0158]|78|8[1568])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|5[12]|[78]1)|6(?:12|[2-4]1|5[17]|6[13]|80)|7(?:12|3[134]|4[47]|61|88)|8(?:16|2[014]|3[126]|6[136]|7[078]|8[34]|91)|(?:43|59|75)[15]|(?:1[59]|29|67|72)[14]\",\"1(?:2[0-24]|3[0-25]|4[145]|[59][14]|6[1-9]|7[1257]|8[1-57-9])|2(?:1[257]|3[013]|4[01]|5[0137]|6[058]|78|8[1568]|9[14])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|3[15]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|[578]1|9[15])|674|7(?:(?:2[14]|3[34]|5[15])[2-6]|61[346]|88[0-8])|8(?:70[2-6]|84[235-7]|91[3-7])|(?:1(?:29|60|8[06])|261|552|6(?:12|[2-47]1|5[17]|6[13]|80)|7(?:12|31|4[47])|8(?:16|2[014]|3[126]|6[136]|7[78]|83))[2-7]\",\"1(?:2[0-24]|3[0-25]|4[145]|[59][14]|6[1-9]|7[1257]|8[1-57-9])|2(?:1[257]|3[013]|4[01]|5[0137]|6[058]|78|8[1568]|9[14])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|3[15]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|[578]1|9[15])|6(?:12(?:[2-6]|7[0-8])|74[2-7])|7(?:(?:2[14]|5[15])[2-6]|3171|61[346]|88(?:[2-7]|82))|8(?:70[2-6]|84(?:[2356]|7[19])|91(?:[3-6]|7[19]))|73[134][2-6]|(?:74[47]|8(?:16|2[014]|3[126]|6[136]|7[78]|83))(?:[2-6]|7[19])|(?:1(?:29|60|8[06])|261|552|6(?:[2-4]1|5[17]|6[13]|7(?:1|4[0189])|80)|7(?:12|88[01]))[2-7]\"],\"0$1\",1],[\"(\\\\d{4})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"1(?:[2-479]|5[0235-9])|[2-5]|6(?:1[1358]|2[2457-9]|3[2-5]|4[235-7]|5[2-689]|6[24578]|7[235689]|8[1-6])|7(?:1[013-9]|28|3[129]|4[1-35689]|5[29]|6[02-5]|70)|807\",\"1(?:[2-479]|5[0235-9])|[2-5]|6(?:1[1358]|2(?:[2457]|84|95)|3(?:[2-4]|55)|4[235-7]|5[2-689]|6[24578]|7[235689]|8[1-6])|7(?:1(?:[013-8]|9[6-9])|28[6-8]|3(?:17|2[0-49]|9[2-57])|4(?:1[2-4]|[29][0-7]|3[0-8]|[56]|8[0-24-7])|5(?:2[1-3]|9[0-6])|6(?:0[5689]|2[5-9]|3[02-8]|4|5[0-367])|70[13-7])|807[19]\",\"1(?:[2-479]|5(?:[0236-9]|5[013-9]))|[2-5]|6(?:2(?:84|95)|355|83)|73179|807(?:1|9[1-3])|(?:1552|6(?:1[1358]|2[2457]|3[2-4]|4[235-7]|5[2-689]|6[24578]|7[235689]|8[124-6])\\\\d|7(?:1(?:[013-8]\\\\d|9[6-9])|28[6-8]|3(?:2[0-49]|9[2-57])|4(?:1[2-4]|[29][0-7]|3[0-8]|[56]\\\\d|8[0-24-7])|5(?:2[1-3]|9[0-6])|6(?:0[5689]|2[5-9]|3[02-8]|4\\\\d|5[0-367])|70[13-7]))[2-7]\"],\"0$1\",1],[\"(\\\\d{5})(\\\\d{5})\",\"$1 $2\",[\"[6-9]\"],\"0$1\",1],[\"(\\\\d{4})(\\\\d{2,4})(\\\\d{4})\",\"$1 $2 $3\",[\"1(?:6|8[06])\",\"1(?:6|8[06]0)\"],0,1],[\"(\\\\d{4})(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3 $4\",[\"18\"],0,1]],\"0\"],\"IO\":[\"246\",\"00\",\"3\\\\d{6}\",[7],[[\"(\\\\d{3})(\\\\d{4})\",\"$1 $2\",[\"3\"]]]],\"IQ\":[\"964\",\"00\",\"(?:1|7\\\\d\\\\d)\\\\d{7}|[2-6]\\\\d{7,8}\",[8,9,10],[[\"(\\\\d)(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"1\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{3,4})\",\"$1 $2 $3\",[\"[2-6]\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"7\"],\"0$1\"]],\"0\"],\"IR\":[\"98\",\"00\",\"[1-9]\\\\d{9}|(?:[1-8]\\\\d\\\\d|9)\\\\d{3,4}\",[4,5,6,7,10],[[\"(\\\\d{4,5})\",\"$1\",[\"96\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{4,5})\",\"$1 $2\",[\"(?:1[137]|2[13-68]|3[1458]|4[145]|5[1468]|6[16]|7[1467]|8[13467])[12689]\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3,4})\",\"$1 $2 $3\",[\"9\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{4})(\\\\d{4})\",\"$1 $2 $3\",[\"[1-8]\"],\"0$1\"]],\"0\"],\"IS\":[\"354\",\"00|1(?:0(?:01|[12]0)|100)\",\"(?:38\\\\d|[4-9])\\\\d{6}\",[7,9],[[\"(\\\\d{3})(\\\\d{4})\",\"$1 $2\",[\"[4-9]\"]],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"3\"]]],0,0,0,0,0,0,0,\"00\"],\"IT\":[\"39\",\"00\",\"0\\\\d{5,10}|1\\\\d{8,10}|3(?:[0-8]\\\\d{7,10}|9\\\\d{7,8})|(?:55|70)\\\\d{8}|8\\\\d{5}(?:\\\\d{2,4})?\",[6,7,8,9,10,11],[[\"(\\\\d{2})(\\\\d{4,6})\",\"$1 $2\",[\"0[26]\"]],[\"(\\\\d{3})(\\\\d{3,6})\",\"$1 $2\",[\"0[13-57-9][0159]|8(?:03|4[17]|9[2-5])\",\"0[13-57-9][0159]|8(?:03|4[17]|9(?:2|3[04]|[45][0-4]))\"]],[\"(\\\\d{4})(\\\\d{2,6})\",\"$1 $2\",[\"0(?:[13-579][2-46-8]|8[236-8])\"]],[\"(\\\\d{4})(\\\\d{4})\",\"$1 $2\",[\"894\"]],[\"(\\\\d{2})(\\\\d{3,4})(\\\\d{4})\",\"$1 $2 $3\",[\"0[26]|5\"]],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3,4})\",\"$1 $2 $3\",[\"1(?:44|[679])|[378]\"]],[\"(\\\\d{3})(\\\\d{3,4})(\\\\d{4})\",\"$1 $2 $3\",[\"0[13-57-9][0159]|14\"]],[\"(\\\\d{2})(\\\\d{4})(\\\\d{5})\",\"$1 $2 $3\",[\"0[26]\"]],[\"(\\\\d{4})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"0\"]],[\"(\\\\d{3})(\\\\d{4})(\\\\d{4,5})\",\"$1 $2 $3\",[\"3\"]]],0,0,0,0,0,0,[[\"0669[0-79]\\\\d{1,6}|0(?:1(?:[0159]\\\\d|[27][1-5]|31|4[1-4]|6[1356]|8[2-57])|2\\\\d\\\\d|3(?:[0159]\\\\d|2[1-4]|3[12]|[48][1-6]|6[2-59]|7[1-7])|4(?:[0159]\\\\d|[23][1-9]|4[245]|6[1-5]|7[1-4]|81)|5(?:[0159]\\\\d|2[1-5]|3[2-6]|4[1-79]|6[4-6]|7[1-578]|8[3-8])|6(?:[0-57-9]\\\\d|6[0-8])|7(?:[0159]\\\\d|2[12]|3[1-7]|4[2-46]|6[13569]|7[13-6]|8[1-59])|8(?:[0159]\\\\d|2[3-578]|3[1-356]|[6-8][1-5])|9(?:[0159]\\\\d|[238][1-5]|4[12]|6[1-8]|7[1-6]))\\\\d{2,7}\"],[\"3[1-9]\\\\d{8}|3[2-9]\\\\d{7}\",[9,10]],[\"80(?:0\\\\d{3}|3)\\\\d{3}\",[6,9]],[\"(?:0878\\\\d{3}|89(?:2\\\\d|3[04]|4(?:[0-4]|[5-9]\\\\d\\\\d)|5[0-4]))\\\\d\\\\d|(?:1(?:44|6[346])|89(?:38|5[5-9]|9))\\\\d{6}\",[6,8,9,10]],[\"1(?:78\\\\d|99)\\\\d{6}\",[9,10]],0,0,0,[\"55\\\\d{8}\",[10]],[\"84(?:[08]\\\\d{3}|[17])\\\\d{3}\",[6,9]]]],\"JE\":[\"44\",\"00\",\"1534\\\\d{6}|(?:[3578]\\\\d|90)\\\\d{8}\",[10],0,\"0\",0,\"0|([0-24-8]\\\\d{5})$\",\"1534$1\",0,0,[[\"1534[0-24-8]\\\\d{5}\"],[\"7(?:(?:(?:50|82)9|937)\\\\d|7(?:00[378]|97[7-9]))\\\\d{5}\"],[\"80(?:07(?:35|81)|8901)\\\\d{4}\"],[\"(?:8(?:4(?:4(?:4(?:05|42|69)|703)|5(?:041|800))|7(?:0002|1206))|90(?:066[59]|1810|71(?:07|55)))\\\\d{4}\"],[\"701511\\\\d{4}\"],0,[\"(?:3(?:0(?:07(?:35|81)|8901)|3\\\\d{4}|4(?:4(?:4(?:05|42|69)|703)|5(?:041|800))|7(?:0002|1206))|55\\\\d{4})\\\\d{4}\"],[\"76(?:464|652)\\\\d{5}|76(?:0[0-2]|2[356]|34|4[01347]|5[49]|6[0-369]|77|8[14]|9[139])\\\\d{6}\"],[\"56\\\\d{8}\"]]],\"JM\":[\"1\",\"011\",\"(?:[58]\\\\d\\\\d|658|900)\\\\d{7}\",[10],0,\"1\",0,0,0,0,\"658|876\"],\"JO\":[\"962\",\"00\",\"(?:(?:[2689]|7\\\\d)\\\\d|32|53)\\\\d{6}\",[8,9],[[\"(\\\\d)(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"[2356]|87\"],\"(0$1)\"],[\"(\\\\d{3})(\\\\d{5,6})\",\"$1 $2\",[\"[89]\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{7})\",\"$1 $2\",[\"70\"],\"0$1\"],[\"(\\\\d)(\\\\d{4})(\\\\d{4})\",\"$1 $2 $3\",[\"7\"],\"0$1\"]],\"0\"],\"JP\":[\"81\",\"010\",\"00[1-9]\\\\d{6,14}|[257-9]\\\\d{9}|(?:00|[1-9]\\\\d\\\\d)\\\\d{6}\",[8,9,10,11,12,13,14,15,16,17],[[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1-$2-$3\",[\"(?:12|57|99)0\"],\"0$1\"],[\"(\\\\d{4})(\\\\d)(\\\\d{4})\",\"$1-$2-$3\",[\"1(?:26|3[79]|4[56]|5[4-68]|6[3-5])|499|5(?:76|97)|746|8(?:3[89]|47|51|63)|9(?:80|9[16])\",\"1(?:267|3(?:7[247]|9[278])|466|5(?:47|58|64)|6(?:3[245]|48|5[4-68]))|499[2468]|5(?:76|97)9|7468|8(?:3(?:8[7-9]|96)|477|51[2-9]|636)|9(?:802|9(?:1[23]|69))|1(?:45|58)[67]\",\"1(?:267|3(?:7[247]|9[278])|466|5(?:47|58|64)|6(?:3[245]|48|5[4-68]))|499[2468]|5(?:769|979[2-69])|7468|8(?:3(?:8[7-9]|96[2457-9])|477|51[2-9]|636[457-9])|9(?:802|9(?:1[23]|69))|1(?:45|58)[67]\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{4})\",\"$1-$2-$3\",[\"60\"],\"0$1\"],[\"(\\\\d)(\\\\d{4})(\\\\d{4})\",\"$1-$2-$3\",[\"[36]|4(?:2[09]|7[01])\",\"[36]|4(?:2(?:0|9[02-69])|7(?:0[019]|1))\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{4})\",\"$1-$2-$3\",[\"1(?:1|5[45]|77|88|9[69])|2(?:2[1-37]|3[0-269]|4[59]|5|6[24]|7[1-358]|8[1369]|9[0-38])|4(?:[28][1-9]|3[0-57]|[45]|6[248]|7[2-579]|9[29])|5(?:2|3[045]|4[0-369]|5[29]|8[02389]|9[0-389])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9[2-6])|8(?:2[124589]|3[27-9]|49|51|6|7[0-468]|8[68]|9[019])|9(?:[23][1-9]|4[15]|5[138]|6[1-3]|7[156]|8[189]|9[1-489])\",\"1(?:1|5(?:4[018]|5[017])|77|88|9[69])|2(?:2(?:[127]|3[014-9])|3[0-269]|4[59]|5(?:[1-3]|5[0-69]|9[19])|62|7(?:[1-35]|8[0189])|8(?:[16]|3[0134]|9[0-5])|9(?:[028]|17))|4(?:2(?:[13-79]|8[014-6])|3[0-57]|[45]|6[248]|7[2-47]|8[1-9])|5(?:2|3[045]|4[0-369]|8[02389]|9[0-3])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9(?:[23]|4[0-59]|5[01569]|6[0167]))|8(?:2(?:[1258]|4[0-39]|9[0-2469])|49|51|6(?:[0-24]|36|5[0-3589]|72|9[01459])|7[0-468]|8[68])|9(?:[23][1-9]|4[15]|5[138]|6[1-3]|7[156]|8[189]|9(?:[1289]|3[34]|4[0178]))|(?:49|55|83)[29]|(?:264|837)[016-9]|2(?:57|93)[015-9]|(?:25[0468]|422|838)[01]|(?:47[59]|59[89]|8(?:6[68]|9))[019]\",\"1(?:1|5(?:4[018]|5[017])|77|88|9[69])|2(?:2[127]|3[0-269]|4[59]|5(?:[1-3]|5[0-69]|9(?:17|99))|6(?:2|4[016-9])|7(?:[1-35]|8[0189])|8(?:[16]|3[0134]|9[0-5])|9(?:[028]|17))|4(?:2(?:[13-79]|8[014-6])|3[0-57]|[45]|6[248]|7[2-47]|9[29])|5(?:2|3[045]|4[0-369]|5[29]|8[02389]|9[0-3])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9(?:[23]|4[0-59]|5[01569]|6[0167]))|8(?:2(?:[1258]|4[0-39]|9[0169])|3(?:[29]|7(?:[017-9]|6[6-8]))|49|51|6(?:[0-24]|36[23]|5(?:[0-389]|5[23])|6(?:[01]|9[178])|72|9[0145])|7[0-468]|8[68])|9(?:4[15]|5[138]|7[156]|8[189]|9(?:[1289]|3(?:31|4[357])|4[0178]))|(?:8294|96)[1-3]|2(?:57|93)[015-9]|(?:223|8699)[014-9]|(?:25[0468]|422|838)[01]|(?:48|8292|9[23])[1-9]|(?:47[59]|59[89]|8(?:68|9))[019]\",\"1(?:1|5(?:4[018]|5[017])|77|88|9[69])|2(?:2[127]|3[0-269]|4[59]|5(?:[1-3]|5[0-69]|7[015-9]|9(?:17|99))|6(?:2|4[016-9])|7(?:[1-35]|8[0189])|8(?:[16]|3[0134]|9[0-5])|9(?:[028]|17|3[015-9]))|4(?:2(?:[13-79]|8[014-6])|3[0-57]|[45]|6[248]|7[2-47]|9[29])|5(?:2|3[045]|4[0-369]|5[29]|8[02389]|9[0-3])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9(?:[23]|4[0-59]|5[01569]|6[0167]))|8(?:2(?:[1258]|4[0-39]|9(?:[019]|4[1-3]|6(?:[0-47-9]|5[01346-9])))|3(?:[29]|7(?:[017-9]|6[6-8]))|49|51|6(?:[0-24]|36[23]|5(?:[0-389]|5[23])|6(?:[01]|9[178])|72|9[0145])|7[0-468]|8[68])|9(?:4[15]|5[138]|6[1-3]|7[156]|8[189]|9(?:[1289]|3(?:31|4[357])|4[0178]))|(?:223|8699)[014-9]|(?:25[0468]|422|838)[01]|(?:48|829(?:2|66)|9[23])[1-9]|(?:47[59]|59[89]|8(?:68|9))[019]\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{2})(\\\\d{4})\",\"$1-$2-$3\",[\"[14]|[289][2-9]|5[3-9]|7[2-4679]\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{3})(\\\\d{4})\",\"$1-$2-$3\",[\"800\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{4})(\\\\d{4})\",\"$1-$2-$3\",[\"[257-9]\"],\"0$1\"]],\"0\"],\"KE\":[\"254\",\"000\",\"(?:[17]\\\\d\\\\d|900)\\\\d{6}|(?:2|80)0\\\\d{6,7}|[4-6]\\\\d{6,8}\",[7,8,9,10],[[\"(\\\\d{2})(\\\\d{5,7})\",\"$1 $2\",[\"[24-6]\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{6})\",\"$1 $2\",[\"[17]\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3,4})\",\"$1 $2 $3\",[\"[89]\"],\"0$1\"]],\"0\"],\"KG\":[\"996\",\"00\",\"8\\\\d{9}|(?:[235-8]\\\\d|99)\\\\d{7}\",[9,10],[[\"(\\\\d{4})(\\\\d{5})\",\"$1 $2\",[\"3(?:1[346]|[24-79])\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"[235-79]|88\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{3})(\\\\d)(\\\\d{2,3})\",\"$1 $2 $3 $4\",[\"8\"],\"0$1\"]],\"0\"],\"KH\":[\"855\",\"00[14-9]\",\"1\\\\d{9}|[1-9]\\\\d{7,8}\",[8,9,10],[[\"(\\\\d{2})(\\\\d{3})(\\\\d{3,4})\",\"$1 $2 $3\",[\"[1-9]\"],\"0$1\"],[\"(\\\\d{4})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"1\"]]],\"0\"],\"KI\":[\"686\",\"00\",\"(?:[37]\\\\d|6[0-79])\\\\d{6}|(?:[2-48]\\\\d|50)\\\\d{3}\",[5,8],0,\"0\"],\"KM\":[\"269\",\"00\",\"[3478]\\\\d{6}\",[7],[[\"(\\\\d{3})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3\",[\"[3478]\"]]]],\"KN\":[\"1\",\"011\",\"(?:[58]\\\\d\\\\d|900)\\\\d{7}\",[10],0,\"1\",0,\"1|([2-7]\\\\d{6})$\",\"869$1\",0,\"869\"],\"KP\":[\"850\",\"00|99\",\"85\\\\d{6}|(?:19\\\\d|[2-7])\\\\d{7}\",[8,10],[[\"(\\\\d{2})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"8\"],\"0$1\"],[\"(\\\\d)(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"[2-7]\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"1\"],\"0$1\"]],\"0\"],\"KR\":[\"82\",\"00(?:[125689]|3(?:[46]5|91)|7(?:00|27|3|55|6[126]))\",\"00[1-9]\\\\d{8,11}|(?:[12]|5\\\\d{3})\\\\d{7}|[13-6]\\\\d{9}|(?:[1-6]\\\\d|80)\\\\d{7}|[3-6]\\\\d{4,5}|(?:00|7)0\\\\d{8}\",[5,6,8,9,10,11,12,13,14],[[\"(\\\\d{2})(\\\\d{3,4})\",\"$1-$2\",[\"(?:3[1-3]|[46][1-4]|5[1-5])1\"],\"0$1\"],[\"(\\\\d{4})(\\\\d{4})\",\"$1-$2\",[\"1\"]],[\"(\\\\d)(\\\\d{3,4})(\\\\d{4})\",\"$1-$2-$3\",[\"2\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{4})\",\"$1-$2-$3\",[\"60|8\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3,4})(\\\\d{4})\",\"$1-$2-$3\",[\"[1346]|5[1-5]\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{4})(\\\\d{4})\",\"$1-$2-$3\",[\"[57]\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{5})(\\\\d{4})\",\"$1-$2-$3\",[\"5\"],\"0$1\"]],\"0\",0,\"0(8(?:[1-46-8]|5\\\\d\\\\d))?\"],\"KW\":[\"965\",\"00\",\"18\\\\d{5}|(?:[2569]\\\\d|41)\\\\d{6}\",[7,8],[[\"(\\\\d{4})(\\\\d{3,4})\",\"$1 $2\",[\"[169]|2(?:[235]|4[1-35-9])|52\"]],[\"(\\\\d{3})(\\\\d{5})\",\"$1 $2\",[\"[245]\"]]]],\"KY\":[\"1\",\"011\",\"(?:345|[58]\\\\d\\\\d|900)\\\\d{7}\",[10],0,\"1\",0,\"1|([2-9]\\\\d{6})$\",\"345$1\",0,\"345\"],\"KZ\":[\"7\",\"810\",\"(?:33622|8\\\\d{8})\\\\d{5}|[78]\\\\d{9}\",[10,14],0,\"8\",0,0,0,0,\"33|7\",0,\"8~10\"],\"LA\":[\"856\",\"00\",\"[23]\\\\d{9}|3\\\\d{8}|(?:[235-8]\\\\d|41)\\\\d{6}\",[8,9,10],[[\"(\\\\d{2})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"2[13]|3[14]|[4-8]\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{2})(\\\\d{2})(\\\\d{3})\",\"$1 $2 $3 $4\",[\"30[013-9]\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{2})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3 $4\",[\"[23]\"],\"0$1\"]],\"0\"],\"LB\":[\"961\",\"00\",\"[27-9]\\\\d{7}|[13-9]\\\\d{6}\",[7,8],[[\"(\\\\d)(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"[13-69]|7(?:[2-57]|62|8[0-7]|9[04-9])|8[02-9]\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"[27-9]\"]]],\"0\"],\"LC\":[\"1\",\"011\",\"(?:[58]\\\\d\\\\d|758|900)\\\\d{7}\",[10],0,\"1\",0,\"1|([2-8]\\\\d{6})$\",\"758$1\",0,\"758\"],\"LI\":[\"423\",\"00\",\"[68]\\\\d{8}|(?:[2378]\\\\d|90)\\\\d{5}\",[7,9],[[\"(\\\\d{3})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3\",[\"[2379]|8(?:0[09]|7)\",\"[2379]|8(?:0(?:02|9)|7)\"]],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"8\"]],[\"(\\\\d{2})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"69\"]],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"6\"]]],\"0\",0,\"0|(1001)\"],\"LK\":[\"94\",\"00\",\"[1-9]\\\\d{8}\",[9],[[\"(\\\\d{2})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"7\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"[1-689]\"],\"0$1\"]],\"0\"],\"LR\":[\"231\",\"00\",\"(?:2|33|5\\\\d|77|88)\\\\d{7}|[4-6]\\\\d{6}\",[7,8,9],[[\"(\\\\d)(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"[4-6]\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"2\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"[3578]\"],\"0$1\"]],\"0\"],\"LS\":[\"266\",\"00\",\"(?:[256]\\\\d\\\\d|800)\\\\d{5}\",[8],[[\"(\\\\d{4})(\\\\d{4})\",\"$1 $2\",[\"[2568]\"]]]],\"LT\":[\"370\",\"00\",\"(?:[3469]\\\\d|52|[78]0)\\\\d{6}\",[8],[[\"(\\\\d)(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"52[0-7]\"],\"(8-$1)\",1],[\"(\\\\d{3})(\\\\d{2})(\\\\d{3})\",\"$1 $2 $3\",[\"[7-9]\"],\"8 $1\",1],[\"(\\\\d{2})(\\\\d{6})\",\"$1 $2\",[\"37|4(?:[15]|6[1-8])\"],\"(8-$1)\",1],[\"(\\\\d{3})(\\\\d{5})\",\"$1 $2\",[\"[3-6]\"],\"(8-$1)\",1]],\"8\",0,\"[08]\"],\"LU\":[\"352\",\"00\",\"35[013-9]\\\\d{4,8}|6\\\\d{8}|35\\\\d{2,4}|(?:[2457-9]\\\\d|3[0-46-9])\\\\d{2,9}\",[4,5,6,7,8,9,10,11],[[\"(\\\\d{2})(\\\\d{3})\",\"$1 $2\",[\"2(?:0[2-689]|[2-9])|[3-57]|8(?:0[2-9]|[13-9])|9(?:0[89]|[2-579])\"]],[\"(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3\",[\"2(?:0[2-689]|[2-9])|[3-57]|8(?:0[2-9]|[13-9])|9(?:0[89]|[2-579])\"]],[\"(\\\\d{2})(\\\\d{2})(\\\\d{3})\",\"$1 $2 $3\",[\"20[2-689]\"]],[\"(\\\\d{2})(\\\\d{2})(\\\\d{2})(\\\\d{1,2})\",\"$1 $2 $3 $4\",[\"2(?:[0367]|4[3-8])\"]],[\"(\\\\d{3})(\\\\d{2})(\\\\d{3})\",\"$1 $2 $3\",[\"80[01]|90[015]\"]],[\"(\\\\d{2})(\\\\d{2})(\\\\d{2})(\\\\d{3})\",\"$1 $2 $3 $4\",[\"20\"]],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"6\"]],[\"(\\\\d{2})(\\\\d{2})(\\\\d{2})(\\\\d{2})(\\\\d{1,2})\",\"$1 $2 $3 $4 $5\",[\"2(?:[0367]|4[3-8])\"]],[\"(\\\\d{2})(\\\\d{2})(\\\\d{2})(\\\\d{1,5})\",\"$1 $2 $3 $4\",[\"[3-57]|8[13-9]|9(?:0[89]|[2-579])|(?:2|80)[2-9]\"]]],0,0,\"(15(?:0[06]|1[12]|[35]5|4[04]|6[26]|77|88|99)\\\\d)\"],\"LV\":[\"371\",\"00\",\"(?:[268]\\\\d|90)\\\\d{6}\",[8],[[\"(\\\\d{2})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"[269]|8[01]\"]]]],\"LY\":[\"218\",\"00\",\"[2-9]\\\\d{8}\",[9],[[\"(\\\\d{2})(\\\\d{7})\",\"$1-$2\",[\"[2-9]\"],\"0$1\"]],\"0\"],\"MA\":[\"212\",\"00\",\"[5-8]\\\\d{8}\",[9],[[\"(\\\\d{5})(\\\\d{4})\",\"$1-$2\",[\"5(?:29|38)\",\"5(?:29[89]|389)\",\"5(?:29[89]|389)0\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"5[45]\"],\"0$1\"],[\"(\\\\d{4})(\\\\d{5})\",\"$1-$2\",[\"5(?:2[2-489]|3[5-9]|9)|892\",\"5(?:2(?:[2-49]|8[235-9])|3[5-9]|9)|892\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{7})\",\"$1-$2\",[\"8\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{6})\",\"$1-$2\",[\"[5-7]\"],\"0$1\"]],\"0\",0,0,0,0,0,[[\"5(?:29(?:[189][05]|2[29]|3[01])|389[05])\\\\d{4}|5(?:2(?:[0-25-7]\\\\d|3[1-578]|4[02-46-8]|8[0235-7]|90)|3(?:[0-47]\\\\d|5[02-9]|6[02-8]|8[08]|9[3-9])|(?:4[067]|5[03])\\\\d)\\\\d{5}\"],[\"(?:6(?:[0-79]\\\\d|8[0-247-9])|7(?:[017]\\\\d|2[0-2]|6[0-367]))\\\\d{6}\"],[\"80\\\\d{7}\"],[\"89\\\\d{7}\"],0,0,0,0,[\"592(?:4[0-2]|93)\\\\d{4}\"]]],\"MC\":[\"377\",\"00\",\"(?:[3489]|6\\\\d)\\\\d{7}\",[8,9],[[\"(\\\\d{2})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"4\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"[389]\"]],[\"(\\\\d)(\\\\d{2})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4 $5\",[\"6\"],\"0$1\"]],\"0\"],\"MD\":[\"373\",\"00\",\"(?:[235-7]\\\\d|[89]0)\\\\d{6}\",[8],[[\"(\\\\d{3})(\\\\d{5})\",\"$1 $2\",[\"[89]\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"22|3\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{2})(\\\\d{3})\",\"$1 $2 $3\",[\"[25-7]\"],\"0$1\"]],\"0\"],\"ME\":[\"382\",\"00\",\"(?:20|[3-79]\\\\d)\\\\d{6}|80\\\\d{6,7}\",[8,9],[[\"(\\\\d{2})(\\\\d{3})(\\\\d{3,4})\",\"$1 $2 $3\",[\"[2-9]\"],\"0$1\"]],\"0\"],\"MF\":[\"590\",\"00\",\"(?:590|(?:69|80)\\\\d|976)\\\\d{6}\",[9],0,\"0\",0,0,0,0,0,[[\"590(?:0[079]|[14]3|[27][79]|30|5[0-268]|87)\\\\d{4}\"],[\"69(?:0\\\\d\\\\d|1(?:2[2-9]|3[0-5]))\\\\d{4}\"],[\"80[0-5]\\\\d{6}\"],0,0,0,0,0,[\"976[01]\\\\d{5}\"]]],\"MG\":[\"261\",\"00\",\"[23]\\\\d{8}\",[9],[[\"(\\\\d{2})(\\\\d{2})(\\\\d{3})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"[23]\"],\"0$1\"]],\"0\",0,\"0|([24-9]\\\\d{6})$\",\"20$1\"],\"MH\":[\"692\",\"011\",\"329\\\\d{4}|(?:[256]\\\\d|45)\\\\d{5}\",[7],[[\"(\\\\d{3})(\\\\d{4})\",\"$1-$2\",[\"[2-6]\"]]],\"1\"],\"MK\":[\"389\",\"00\",\"[2-578]\\\\d{7}\",[8],[[\"(\\\\d)(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"2|34[47]|4(?:[37]7|5[47]|64)\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"[347]\"],\"0$1\"],[\"(\\\\d{3})(\\\\d)(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"[58]\"],\"0$1\"]],\"0\"],\"ML\":[\"223\",\"00\",\"[24-9]\\\\d{7}\",[8],[[\"(\\\\d{2})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"[24-9]\"]]]],\"MM\":[\"95\",\"00\",\"1\\\\d{5,7}|95\\\\d{6}|(?:[4-7]|9[0-46-9])\\\\d{6,8}|(?:2|8\\\\d)\\\\d{5,8}\",[6,7,8,9,10],[[\"(\\\\d)(\\\\d{2})(\\\\d{3})\",\"$1 $2 $3\",[\"16|2\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{2})(\\\\d{3})\",\"$1 $2 $3\",[\"[45]|6(?:0[23]|[1-689]|7[235-7])|7(?:[0-4]|5[2-7])|8[1-6]\"],\"0$1\"],[\"(\\\\d)(\\\\d{3})(\\\\d{3,4})\",\"$1 $2 $3\",[\"[12]\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{3,4})\",\"$1 $2 $3\",[\"[4-7]|8[1-35]\"],\"0$1\"],[\"(\\\\d)(\\\\d{3})(\\\\d{4,6})\",\"$1 $2 $3\",[\"9(?:2[0-4]|[35-9]|4[137-9])\"],\"0$1\"],[\"(\\\\d)(\\\\d{4})(\\\\d{4})\",\"$1 $2 $3\",[\"2\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"8\"],\"0$1\"],[\"(\\\\d)(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3 $4\",[\"92\"],\"0$1\"],[\"(\\\\d)(\\\\d{5})(\\\\d{4})\",\"$1 $2 $3\",[\"9\"],\"0$1\"]],\"0\"],\"MN\":[\"976\",\"001\",\"[12]\\\\d{7,9}|[57-9]\\\\d{7}\",[8,9,10],[[\"(\\\\d{2})(\\\\d{2})(\\\\d{4})\",\"$1 $2 $3\",[\"[12]1\"],\"0$1\"],[\"(\\\\d{4})(\\\\d{4})\",\"$1 $2\",[\"[57-9]\"]],[\"(\\\\d{3})(\\\\d{5,6})\",\"$1 $2\",[\"[12]2[1-3]\"],\"0$1\"],[\"(\\\\d{4})(\\\\d{5,6})\",\"$1 $2\",[\"[12](?:27|3[2-8]|4[2-68]|5[1-4689])\",\"[12](?:27|3[2-8]|4[2-68]|5[1-4689])[0-3]\"],\"0$1\"],[\"(\\\\d{5})(\\\\d{4,5})\",\"$1 $2\",[\"[12]\"],\"0$1\"]],\"0\"],\"MO\":[\"853\",\"00\",\"0800\\\\d{3}|(?:28|[68]\\\\d)\\\\d{6}\",[7,8],[[\"(\\\\d{4})(\\\\d{3})\",\"$1 $2\",[\"0\"]],[\"(\\\\d{4})(\\\\d{4})\",\"$1 $2\",[\"[268]\"]]]],\"MP\":[\"1\",\"011\",\"[58]\\\\d{9}|(?:67|90)0\\\\d{7}\",[10],0,\"1\",0,\"1|([2-9]\\\\d{6})$\",\"670$1\",0,\"670\"],\"MQ\":[\"596\",\"00\",\"(?:69|80)\\\\d{7}|(?:59|97)6\\\\d{6}\",[9],[[\"(\\\\d{3})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"[569]\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"8\"],\"0$1\"]],\"0\"],\"MR\":[\"222\",\"00\",\"(?:[2-4]\\\\d\\\\d|800)\\\\d{5}\",[8],[[\"(\\\\d{2})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"[2-48]\"]]]],\"MS\":[\"1\",\"011\",\"(?:[58]\\\\d\\\\d|664|900)\\\\d{7}\",[10],0,\"1\",0,\"1|([34]\\\\d{6})$\",\"664$1\",0,\"664\"],\"MT\":[\"356\",\"00\",\"3550\\\\d{4}|(?:[2579]\\\\d\\\\d|800)\\\\d{5}\",[8],[[\"(\\\\d{4})(\\\\d{4})\",\"$1 $2\",[\"[2357-9]\"]]]],\"MU\":[\"230\",\"0(?:0|[24-7]0|3[03])\",\"(?:5|8\\\\d\\\\d)\\\\d{7}|[2-468]\\\\d{6}\",[7,8,10],[[\"(\\\\d{3})(\\\\d{4})\",\"$1 $2\",[\"[2-46]|8[013]\"]],[\"(\\\\d{4})(\\\\d{4})\",\"$1 $2\",[\"5\"]],[\"(\\\\d{5})(\\\\d{5})\",\"$1 $2\",[\"8\"]]],0,0,0,0,0,0,0,\"020\"],\"MV\":[\"960\",\"0(?:0|19)\",\"(?:800|9[0-57-9]\\\\d)\\\\d{7}|[34679]\\\\d{6}\",[7,10],[[\"(\\\\d{3})(\\\\d{4})\",\"$1-$2\",[\"[3467]|9[13-9]\"]],[\"(\\\\d{3})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"[89]\"]]],0,0,0,0,0,0,0,\"00\"],\"MW\":[\"265\",\"00\",\"(?:[129]\\\\d|31|77|88)\\\\d{7}|1\\\\d{6}\",[7,9],[[\"(\\\\d)(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"1[2-9]\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"2\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"[137-9]\"],\"0$1\"]],\"0\"],\"MX\":[\"52\",\"0[09]\",\"1(?:(?:44|99)[1-9]|65[0-689])\\\\d{7}|(?:1(?:[017]\\\\d|[235][1-9]|4[0-35-9]|6[0-46-9]|8[1-79]|9[1-8])|[2-9]\\\\d)\\\\d{8}\",[10,11],[[\"(\\\\d{2})(\\\\d{4})(\\\\d{4})\",\"$1 $2 $3\",[\"33|5[56]|81\"],0,1],[\"(\\\\d{3})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"[2-9]\"],0,1],[\"(\\\\d)(\\\\d{2})(\\\\d{4})(\\\\d{4})\",\"$2 $3 $4\",[\"1(?:33|5[56]|81)\"],0,1],[\"(\\\\d)(\\\\d{3})(\\\\d{3})(\\\\d{4})\",\"$2 $3 $4\",[\"1\"],0,1]],\"01\",0,\"0(?:[12]|4[45])|1\",0,0,0,0,\"00\"],\"MY\":[\"60\",\"00\",\"1\\\\d{8,9}|(?:3\\\\d|[4-9])\\\\d{7}\",[8,9,10],[[\"(\\\\d)(\\\\d{3})(\\\\d{4})\",\"$1-$2 $3\",[\"[4-79]\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{3,4})\",\"$1-$2 $3\",[\"1(?:[02469]|[378][1-9])|8\"],\"0$1\"],[\"(\\\\d)(\\\\d{4})(\\\\d{4})\",\"$1-$2 $3\",[\"3\"],\"0$1\"],[\"(\\\\d)(\\\\d{3})(\\\\d{2})(\\\\d{4})\",\"$1-$2-$3-$4\",[\"1[36-8]\"]],[\"(\\\\d{3})(\\\\d{3})(\\\\d{4})\",\"$1-$2 $3\",[\"15\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{4})(\\\\d{4})\",\"$1-$2 $3\",[\"1\"],\"0$1\"]],\"0\"],\"MZ\":[\"258\",\"00\",\"(?:2|8\\\\d)\\\\d{7}\",[8,9],[[\"(\\\\d{2})(\\\\d{3})(\\\\d{3,4})\",\"$1 $2 $3\",[\"2|8[2-79]\"]],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"8\"]]]],\"NA\":[\"264\",\"00\",\"[68]\\\\d{7,8}\",[8,9],[[\"(\\\\d{2})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"88\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{3,4})\",\"$1 $2 $3\",[\"6\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"87\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"8\"],\"0$1\"]],\"0\"],\"NC\":[\"687\",\"00\",\"(?:050|[2-57-9]\\\\d\\\\d)\\\\d{3}\",[6],[[\"(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1.$2.$3\",[\"[02-57-9]\"]]]],\"NE\":[\"227\",\"00\",\"[027-9]\\\\d{7}\",[8],[[\"(\\\\d{2})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"08\"]],[\"(\\\\d{2})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"[089]|2[013]|7[04]\"]]]],\"NF\":[\"672\",\"00\",\"[13]\\\\d{5}\",[6],[[\"(\\\\d{2})(\\\\d{4})\",\"$1 $2\",[\"1[0-3]\"]],[\"(\\\\d)(\\\\d{5})\",\"$1 $2\",[\"[13]\"]]],0,0,\"([0-258]\\\\d{4})$\",\"3$1\"],\"NG\":[\"234\",\"009\",\"(?:[124-7]|9\\\\d{3})\\\\d{6}|[1-9]\\\\d{7}|[78]\\\\d{9,13}\",[7,8,10,11,12,13,14],[[\"(\\\\d{2})(\\\\d{2})(\\\\d{3})\",\"$1 $2 $3\",[\"78\"],\"0$1\"],[\"(\\\\d)(\\\\d{3})(\\\\d{3,4})\",\"$1 $2 $3\",[\"[12]|9(?:0[3-9]|[1-9])\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{2,3})\",\"$1 $2 $3\",[\"[3-7]|8[2-9]\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3,4})\",\"$1 $2 $3\",[\"[7-9]\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{4})(\\\\d{4,5})\",\"$1 $2 $3\",[\"[78]\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{5})(\\\\d{5,6})\",\"$1 $2 $3\",[\"[78]\"],\"0$1\"]],\"0\"],\"NI\":[\"505\",\"00\",\"(?:1800|[25-8]\\\\d{3})\\\\d{4}\",[8],[[\"(\\\\d{4})(\\\\d{4})\",\"$1 $2\",[\"[125-8]\"]]]],\"NL\":[\"31\",\"00\",\"(?:[124-7]\\\\d\\\\d|3(?:[02-9]\\\\d|1[0-8]))\\\\d{6}|8\\\\d{6,9}|9\\\\d{6,10}|1\\\\d{4,5}\",[5,6,7,8,9,10,11],[[\"(\\\\d{3})(\\\\d{4,7})\",\"$1 $2\",[\"[89]0\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{7})\",\"$1 $2\",[\"66\"],\"0$1\"],[\"(\\\\d)(\\\\d{8})\",\"$1 $2\",[\"6\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"1[16-8]|2[259]|3[124]|4[17-9]|5[124679]\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"[1-578]|91\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{3})(\\\\d{5})\",\"$1 $2 $3\",[\"9\"],\"0$1\"]],\"0\"],\"NO\":[\"47\",\"00\",\"(?:0|[2-9]\\\\d{3})\\\\d{4}\",[5,8],[[\"(\\\\d{3})(\\\\d{2})(\\\\d{3})\",\"$1 $2 $3\",[\"[489]|59\"]],[\"(\\\\d{2})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"[235-7]\"]]],0,0,0,0,0,\"[02-689]|7[0-8]\"],\"NP\":[\"977\",\"00\",\"(?:1\\\\d|9)\\\\d{9}|[1-9]\\\\d{7}\",[8,10,11],[[\"(\\\\d)(\\\\d{7})\",\"$1-$2\",[\"1[2-6]\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{6})\",\"$1-$2\",[\"1[01]|[2-8]|9(?:[1-579]|6[2-6])\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{7})\",\"$1-$2\",[\"9\"]]],\"0\"],\"NR\":[\"674\",\"00\",\"(?:444|(?:55|8\\\\d)\\\\d|666)\\\\d{4}\",[7],[[\"(\\\\d{3})(\\\\d{4})\",\"$1 $2\",[\"[4-68]\"]]]],\"NU\":[\"683\",\"00\",\"(?:[47]|888\\\\d)\\\\d{3}\",[4,7],[[\"(\\\\d{3})(\\\\d{4})\",\"$1 $2\",[\"8\"]]]],\"NZ\":[\"64\",\"0(?:0|161)\",\"[29]\\\\d{7,9}|50\\\\d{5}(?:\\\\d{2,3})?|6[0-35-9]\\\\d{6}|7\\\\d{7,8}|8\\\\d{4,9}|(?:11\\\\d|[34])\\\\d{7}\",[5,6,7,8,9,10],[[\"(\\\\d{2})(\\\\d{3,8})\",\"$1 $2\",[\"8[1-579]\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{2})(\\\\d{2,3})\",\"$1 $2 $3\",[\"50[036-8]|[89]0\",\"50(?:[0367]|88)|[89]0\"],\"0$1\"],[\"(\\\\d)(\\\\d{3})(\\\\d{4})\",\"$1-$2 $3\",[\"24|[346]|7[2-57-9]|9[2-9]\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3,4})\",\"$1 $2 $3\",[\"2(?:10|74)|[59]|80\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3,4})(\\\\d{4})\",\"$1 $2 $3\",[\"1|2[028]\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{3,5})\",\"$1 $2 $3\",[\"2(?:[169]|7[0-35-9])|7|86\"],\"0$1\"]],\"0\",0,0,0,0,0,0,\"00\"],\"OM\":[\"968\",\"00\",\"(?:1505|[279]\\\\d{3}|500)\\\\d{4}|800\\\\d{5,6}\",[7,8,9],[[\"(\\\\d{3})(\\\\d{4,6})\",\"$1 $2\",[\"[58]\"]],[\"(\\\\d{2})(\\\\d{6})\",\"$1 $2\",[\"2\"]],[\"(\\\\d{4})(\\\\d{4})\",\"$1 $2\",[\"[179]\"]]]],\"PA\":[\"507\",\"00\",\"(?:00800|8\\\\d{3})\\\\d{6}|[68]\\\\d{7}|[1-57-9]\\\\d{6}\",[7,8,10,11],[[\"(\\\\d{3})(\\\\d{4})\",\"$1-$2\",[\"[1-57-9]\"]],[\"(\\\\d{4})(\\\\d{4})\",\"$1-$2\",[\"[68]\"]],[\"(\\\\d{3})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"8\"]]]],\"PE\":[\"51\",\"19(?:1[124]|77|90)00\",\"(?:[14-8]|9\\\\d)\\\\d{7}\",[8,9],[[\"(\\\\d{3})(\\\\d{5})\",\"$1 $2\",[\"80\"],\"(0$1)\"],[\"(\\\\d)(\\\\d{7})\",\"$1 $2\",[\"1\"],\"(0$1)\"],[\"(\\\\d{2})(\\\\d{6})\",\"$1 $2\",[\"[4-8]\"],\"(0$1)\"],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"9\"]]],\"0\",0,0,0,0,0,0,0,\" Anexo \"],\"PF\":[\"689\",\"00\",\"4\\\\d{5}(?:\\\\d{2})?|8\\\\d{7,8}\",[6,8,9],[[\"(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3\",[\"44\"]],[\"(\\\\d{2})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"4|8[7-9]\"]],[\"(\\\\d{3})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"8\"]]]],\"PG\":[\"675\",\"00|140[1-3]\",\"(?:180|[78]\\\\d{3})\\\\d{4}|(?:[2-589]\\\\d|64)\\\\d{5}\",[7,8],[[\"(\\\\d{3})(\\\\d{4})\",\"$1 $2\",[\"18|[2-69]|85\"]],[\"(\\\\d{4})(\\\\d{4})\",\"$1 $2\",[\"[78]\"]]],0,0,0,0,0,0,0,\"00\"],\"PH\":[\"63\",\"00\",\"(?:[2-7]|9\\\\d)\\\\d{8}|2\\\\d{5}|(?:1800|8)\\\\d{7,9}\",[6,8,9,10,11,12,13],[[\"(\\\\d)(\\\\d{5})\",\"$1 $2\",[\"2\"],\"(0$1)\"],[\"(\\\\d{4})(\\\\d{4,6})\",\"$1 $2\",[\"3(?:23|39|46)|4(?:2[3-6]|[35]9|4[26]|76)|544|88[245]|(?:52|64|86)2\",\"3(?:230|397|461)|4(?:2(?:35|[46]4|51)|396|4(?:22|63)|59[347]|76[15])|5(?:221|446)|642[23]|8(?:622|8(?:[24]2|5[13]))\"],\"(0$1)\"],[\"(\\\\d{5})(\\\\d{4})\",\"$1 $2\",[\"346|4(?:27|9[35])|883\",\"3469|4(?:279|9(?:30|56))|8834\"],\"(0$1)\"],[\"(\\\\d)(\\\\d{4})(\\\\d{4})\",\"$1 $2 $3\",[\"2\"],\"(0$1)\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"[3-7]|8[2-8]\"],\"(0$1)\"],[\"(\\\\d{3})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"[89]\"],\"0$1\"],[\"(\\\\d{4})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"1\"]],[\"(\\\\d{4})(\\\\d{1,2})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3 $4\",[\"1\"]]],\"0\"],\"PK\":[\"92\",\"00\",\"122\\\\d{6}|[24-8]\\\\d{10,11}|9(?:[013-9]\\\\d{8,10}|2(?:[01]\\\\d\\\\d|2(?:[06-8]\\\\d|1[01]))\\\\d{7})|(?:[2-8]\\\\d{3}|92(?:[0-7]\\\\d|8[1-9]))\\\\d{6}|[24-9]\\\\d{8}|[89]\\\\d{7}\",[8,9,10,11,12],[[\"(\\\\d{3})(\\\\d{3})(\\\\d{2,7})\",\"$1 $2 $3\",[\"[89]0\"],\"0$1\"],[\"(\\\\d{4})(\\\\d{5})\",\"$1 $2\",[\"1\"]],[\"(\\\\d{3})(\\\\d{6,7})\",\"$1 $2\",[\"2(?:3[2358]|4[2-4]|9[2-8])|45[3479]|54[2-467]|60[468]|72[236]|8(?:2[2-689]|3[23578]|4[3478]|5[2356])|9(?:2[2-8]|3[27-9]|4[2-6]|6[3569]|9[25-8])\",\"9(?:2[3-8]|98)|(?:2(?:3[2358]|4[2-4]|9[2-8])|45[3479]|54[2-467]|60[468]|72[236]|8(?:2[2-689]|3[23578]|4[3478]|5[2356])|9(?:22|3[27-9]|4[2-6]|6[3569]|9[25-7]))[2-9]\"],\"(0$1)\"],[\"(\\\\d{2})(\\\\d{7,8})\",\"$1 $2\",[\"(?:2[125]|4[0-246-9]|5[1-35-7]|6[1-8]|7[14]|8[16]|91)[2-9]\"],\"(0$1)\"],[\"(\\\\d{5})(\\\\d{5})\",\"$1 $2\",[\"58\"],\"(0$1)\"],[\"(\\\\d{3})(\\\\d{7})\",\"$1 $2\",[\"3\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3 $4\",[\"2[125]|4[0-246-9]|5[1-35-7]|6[1-8]|7[14]|8[16]|91\"],\"(0$1)\"],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3 $4\",[\"[24-9]\"],\"(0$1)\"]],\"0\"],\"PL\":[\"48\",\"00\",\"6\\\\d{5}(?:\\\\d{2})?|8\\\\d{9}|[1-9]\\\\d{6}(?:\\\\d{2})?\",[6,7,8,9,10],[[\"(\\\\d{5})\",\"$1\",[\"19\"]],[\"(\\\\d{3})(\\\\d{3})\",\"$1 $2\",[\"11|64\"]],[\"(\\\\d{2})(\\\\d{2})(\\\\d{3})\",\"$1 $2 $3\",[\"(?:1[2-8]|2[2-69]|3[2-4]|4[1-468]|5[24-689]|6[1-3578]|7[14-7]|8[1-79]|9[145])1\",\"(?:1[2-8]|2[2-69]|3[2-4]|4[1-468]|5[24-689]|6[1-3578]|7[14-7]|8[1-79]|9[145])19\"]],[\"(\\\\d{3})(\\\\d{2})(\\\\d{2,3})\",\"$1 $2 $3\",[\"64\"]],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"21|39|45|5[0137]|6[0469]|7[02389]|8(?:0[14]|8)\"]],[\"(\\\\d{2})(\\\\d{3})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"1[2-8]|[2-7]|8[1-79]|9[145]\"]],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3,4})\",\"$1 $2 $3\",[\"8\"]]]],\"PM\":[\"508\",\"00\",\"(?:[45]|80\\\\d\\\\d)\\\\d{5}\",[6,9],[[\"(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3\",[\"[45]\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"8\"],\"0$1\"]],\"0\"],\"PR\":[\"1\",\"011\",\"(?:[589]\\\\d\\\\d|787)\\\\d{7}\",[10],0,\"1\",0,0,0,0,\"787|939\"],\"PS\":[\"970\",\"00\",\"[2489]2\\\\d{6}|(?:1\\\\d|5)\\\\d{8}\",[8,9,10],[[\"(\\\\d)(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"[2489]\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"5\"],\"0$1\"],[\"(\\\\d{4})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"1\"]]],\"0\"],\"PT\":[\"351\",\"00\",\"1693\\\\d{5}|(?:[26-9]\\\\d|30)\\\\d{7}\",[9],[[\"(\\\\d{2})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"2[12]\"]],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"16|[236-9]\"]]]],\"PW\":[\"680\",\"01[12]\",\"(?:[24-8]\\\\d\\\\d|345|900)\\\\d{4}\",[7],[[\"(\\\\d{3})(\\\\d{4})\",\"$1 $2\",[\"[2-9]\"]]]],\"PY\":[\"595\",\"00\",\"59\\\\d{4,6}|9\\\\d{5,10}|(?:[2-46-8]\\\\d|5[0-8])\\\\d{4,7}\",[6,7,8,9,10,11],[[\"(\\\\d{3})(\\\\d{3,6})\",\"$1 $2\",[\"[2-9]0\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{5})\",\"$1 $2\",[\"[26]1|3[289]|4[1246-8]|7[1-3]|8[1-36]\"],\"(0$1)\"],[\"(\\\\d{3})(\\\\d{4,5})\",\"$1 $2\",[\"2[279]|3[13-5]|4[359]|5|6(?:[34]|7[1-46-8])|7[46-8]|85\"],\"(0$1)\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{3,4})\",\"$1 $2 $3\",[\"2[14-68]|3[26-9]|4[1246-8]|6(?:1|75)|7[1-35]|8[1-36]\"],\"(0$1)\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"87\"]],[\"(\\\\d{3})(\\\\d{6})\",\"$1 $2\",[\"9(?:[5-79]|8[1-6])\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"[2-8]\"],\"0$1\"],[\"(\\\\d{4})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"9\"]]],\"0\"],\"QA\":[\"974\",\"00\",\"[2-7]\\\\d{7}|800\\\\d{4}(?:\\\\d{2})?|2\\\\d{6}\",[7,8,9],[[\"(\\\\d{3})(\\\\d{4})\",\"$1 $2\",[\"2[126]|8\"]],[\"(\\\\d{4})(\\\\d{4})\",\"$1 $2\",[\"[2-7]\"]]]],\"RE\":[\"262\",\"00\",\"9769\\\\d{5}|(?:26|[68]\\\\d)\\\\d{7}\",[9],[[\"(\\\\d{3})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"[2689]\"],\"0$1\"]],\"0\",0,0,0,0,\"26[23]|69|[89]\"],\"RO\":[\"40\",\"00\",\"(?:[2378]\\\\d|90)\\\\d{7}|[23]\\\\d{5}\",[6,9],[[\"(\\\\d{3})(\\\\d{3})\",\"$1 $2\",[\"2[3-6]\",\"2[3-6]\\\\d9\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{4})\",\"$1 $2\",[\"219|31\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"[23]1\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"[237-9]\"],\"0$1\"]],\"0\",0,0,0,0,0,0,0,\" int \"],\"RS\":[\"381\",\"00\",\"38[02-9]\\\\d{6,9}|6\\\\d{7,9}|90\\\\d{4,8}|38\\\\d{5,6}|(?:7\\\\d\\\\d|800)\\\\d{3,9}|(?:[12]\\\\d|3[0-79])\\\\d{5,10}\",[6,7,8,9,10,11,12],[[\"(\\\\d{3})(\\\\d{3,9})\",\"$1 $2\",[\"(?:2[389]|39)0|[7-9]\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{5,10})\",\"$1 $2\",[\"[1-36]\"],\"0$1\"]],\"0\"],\"RU\":[\"7\",\"810\",\"8\\\\d{13}|[347-9]\\\\d{9}\",[10,14],[[\"(\\\\d{4})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"7(?:1[0-8]|2[1-9])\",\"7(?:1(?:[0-6]2|7|8[27])|2(?:1[23]|[2-9]2))\",\"7(?:1(?:[0-6]2|7|8[27])|2(?:13[03-69]|62[013-9]))|72[1-57-9]2\"],\"8 ($1)\",1],[\"(\\\\d{5})(\\\\d)(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"7(?:1[0-68]|2[1-9])\",\"7(?:1(?:[06][3-6]|[18]|2[35]|[3-5][3-5])|2(?:[13][3-5]|[24-689]|7[457]))\",\"7(?:1(?:0(?:[356]|4[023])|[18]|2(?:3[013-9]|5)|3[45]|43[013-79]|5(?:3[1-8]|4[1-7]|5)|6(?:3[0-35-9]|[4-6]))|2(?:1(?:3[178]|[45])|[24-689]|3[35]|7[457]))|7(?:14|23)4[0-8]|71(?:33|45)[1-79]\"],\"8 ($1)\",1],[\"(\\\\d{3})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"7\"],\"8 ($1)\",1],[\"(\\\\d{3})(\\\\d{3})(\\\\d{2})(\\\\d{2})\",\"$1 $2-$3-$4\",[\"[349]|8(?:[02-7]|1[1-8])\"],\"8 ($1)\",1],[\"(\\\\d{4})(\\\\d{4})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3 $4\",[\"8\"],\"8 ($1)\"]],\"8\",0,0,0,0,\"3[04-689]|[489]\",0,\"8~10\"],\"RW\":[\"250\",\"00\",\"(?:06|[27]\\\\d\\\\d|[89]00)\\\\d{6}\",[8,9],[[\"(\\\\d{2})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"0\"]],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"[7-9]\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"2\"]]],\"0\"],\"SA\":[\"966\",\"00\",\"92\\\\d{7}|(?:[15]|8\\\\d)\\\\d{8}\",[9,10],[[\"(\\\\d{4})(\\\\d{5})\",\"$1 $2\",[\"9\"]],[\"(\\\\d{2})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"1\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"5\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3,4})\",\"$1 $2 $3\",[\"81\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"8\"]]],\"0\"],\"SB\":[\"677\",\"0[01]\",\"(?:[1-6]|[7-9]\\\\d\\\\d)\\\\d{4}\",[5,7],[[\"(\\\\d{2})(\\\\d{5})\",\"$1 $2\",[\"7|8[4-9]|9(?:[1-8]|9[0-8])\"]]]],\"SC\":[\"248\",\"010|0[0-2]\",\"800\\\\d{4}|(?:[249]\\\\d|64)\\\\d{5}\",[7],[[\"(\\\\d)(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"[246]|9[57]\"]]],0,0,0,0,0,0,0,\"00\"],\"SD\":[\"249\",\"00\",\"[19]\\\\d{8}\",[9],[[\"(\\\\d{2})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"[19]\"],\"0$1\"]],\"0\"],\"SE\":[\"46\",\"00\",\"(?:[26]\\\\d\\\\d|9)\\\\d{9}|[1-9]\\\\d{8}|[1-689]\\\\d{7}|[1-4689]\\\\d{6}|2\\\\d{5}\",[6,7,8,9,10],[[\"(\\\\d{2})(\\\\d{2,3})(\\\\d{2})\",\"$1-$2 $3\",[\"20\"],\"0$1\",0,\"$1 $2 $3\"],[\"(\\\\d{3})(\\\\d{4})\",\"$1-$2\",[\"9(?:00|39|44|9)\"],\"0$1\",0,\"$1 $2\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{2})\",\"$1-$2 $3\",[\"[12][136]|3[356]|4[0246]|6[03]|90[1-9]\"],\"0$1\",0,\"$1 $2 $3\"],[\"(\\\\d)(\\\\d{2,3})(\\\\d{2})(\\\\d{2})\",\"$1-$2 $3 $4\",[\"8\"],\"0$1\",0,\"$1 $2 $3 $4\"],[\"(\\\\d{3})(\\\\d{2,3})(\\\\d{2})\",\"$1-$2 $3\",[\"1[2457]|2(?:[247-9]|5[0138])|3[0247-9]|4[1357-9]|5[0-35-9]|6(?:[125689]|4[02-57]|7[0-2])|9(?:[125-8]|3[02-5]|4[0-3])\"],\"0$1\",0,\"$1 $2 $3\"],[\"(\\\\d{3})(\\\\d{2,3})(\\\\d{3})\",\"$1-$2 $3\",[\"9(?:00|39|44)\"],\"0$1\",0,\"$1 $2 $3\"],[\"(\\\\d{2})(\\\\d{2,3})(\\\\d{2})(\\\\d{2})\",\"$1-$2 $3 $4\",[\"1[13689]|2[0136]|3[1356]|4[0246]|54|6[03]|90[1-9]\"],\"0$1\",0,\"$1 $2 $3 $4\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{2})(\\\\d{2})\",\"$1-$2 $3 $4\",[\"10|7\"],\"0$1\",0,\"$1 $2 $3 $4\"],[\"(\\\\d)(\\\\d{3})(\\\\d{3})(\\\\d{2})\",\"$1-$2 $3 $4\",[\"8\"],\"0$1\",0,\"$1 $2 $3 $4\"],[\"(\\\\d{3})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1-$2 $3 $4\",[\"[13-5]|2(?:[247-9]|5[0138])|6(?:[124-689]|7[0-2])|9(?:[125-8]|3[02-5]|4[0-3])\"],\"0$1\",0,\"$1 $2 $3 $4\"],[\"(\\\\d{3})(\\\\d{2})(\\\\d{2})(\\\\d{3})\",\"$1-$2 $3 $4\",[\"9\"],\"0$1\",0,\"$1 $2 $3 $4\"],[\"(\\\\d{3})(\\\\d{2})(\\\\d{3})(\\\\d{2})(\\\\d{2})\",\"$1-$2 $3 $4 $5\",[\"[26]\"],\"0$1\",0,\"$1 $2 $3 $4 $5\"]],\"0\"],\"SG\":[\"65\",\"0[0-3]\\\\d\",\"(?:(?:1\\\\d|8)\\\\d\\\\d|7000)\\\\d{7}|[3689]\\\\d{7}\",[8,10,11],[[\"(\\\\d{4})(\\\\d{4})\",\"$1 $2\",[\"[369]|8(?:0[1-5]|[1-9])\"]],[\"(\\\\d{3})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"8\"]],[\"(\\\\d{4})(\\\\d{4})(\\\\d{3})\",\"$1 $2 $3\",[\"7\"]],[\"(\\\\d{4})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"1\"]]]],\"SH\":[\"290\",\"00\",\"(?:[256]\\\\d|8)\\\\d{3}\",[4,5],0,0,0,0,0,0,\"[256]\"],\"SI\":[\"386\",\"00|10(?:22|66|88|99)\",\"[1-7]\\\\d{7}|8\\\\d{4,7}|90\\\\d{4,6}\",[5,6,7,8],[[\"(\\\\d{2})(\\\\d{3,6})\",\"$1 $2\",[\"8[09]|9\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{5})\",\"$1 $2\",[\"59|8\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"[37][01]|4[0139]|51|6\"],\"0$1\"],[\"(\\\\d)(\\\\d{3})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"[1-57]\"],\"(0$1)\"]],\"0\",0,0,0,0,0,0,\"00\"],\"SJ\":[\"47\",\"00\",\"0\\\\d{4}|(?:[489]\\\\d|[57]9)\\\\d{6}\",[5,8],0,0,0,0,0,0,\"79\"],\"SK\":[\"421\",\"00\",\"[2-689]\\\\d{8}|[2-59]\\\\d{6}|[2-5]\\\\d{5}\",[6,7,9],[[\"(\\\\d)(\\\\d{2})(\\\\d{3,4})\",\"$1 $2 $3\",[\"21\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{2})(\\\\d{2,3})\",\"$1 $2 $3\",[\"[3-5][1-8]1\",\"[3-5][1-8]1[67]\"],\"0$1\"],[\"(\\\\d)(\\\\d{3})(\\\\d{3})(\\\\d{2})\",\"$1/$2 $3 $4\",[\"2\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"[689]\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{2})(\\\\d{2})\",\"$1/$2 $3 $4\",[\"[3-5]\"],\"0$1\"]],\"0\"],\"SL\":[\"232\",\"00\",\"(?:[237-9]\\\\d|66)\\\\d{6}\",[8],[[\"(\\\\d{2})(\\\\d{6})\",\"$1 $2\",[\"[236-9]\"],\"(0$1)\"]],\"0\"],\"SM\":[\"378\",\"00\",\"(?:0549|[5-7]\\\\d)\\\\d{6}\",[8,10],[[\"(\\\\d{2})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"[5-7]\"]],[\"(\\\\d{4})(\\\\d{6})\",\"$1 $2\",[\"0\"]]],0,0,\"([89]\\\\d{5})$\",\"0549$1\"],\"SN\":[\"221\",\"00\",\"(?:[378]\\\\d|93)\\\\d{7}\",[9],[[\"(\\\\d{3})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"8\"]],[\"(\\\\d{2})(\\\\d{3})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"[379]\"]]]],\"SO\":[\"252\",\"00\",\"[346-9]\\\\d{8}|[12679]\\\\d{7}|[1-5]\\\\d{6}|[1348]\\\\d{5}\",[6,7,8,9],[[\"(\\\\d{2})(\\\\d{4})\",\"$1 $2\",[\"8[125]\"]],[\"(\\\\d{6})\",\"$1\",[\"[134]\"]],[\"(\\\\d)(\\\\d{6})\",\"$1 $2\",[\"[15]|2[0-79]|3[0-46-8]|4[0-7]\"]],[\"(\\\\d)(\\\\d{7})\",\"$1 $2\",[\"24|[67]\"]],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"[3478]|64|90\"]],[\"(\\\\d{2})(\\\\d{5,7})\",\"$1 $2\",[\"1|28|6(?:0[5-7]|[1-35-9])|9[2-9]\"]]],\"0\"],\"SR\":[\"597\",\"00\",\"(?:[2-5]|68|[78]\\\\d)\\\\d{5}\",[6,7],[[\"(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1-$2-$3\",[\"56\"]],[\"(\\\\d{3})(\\\\d{3})\",\"$1-$2\",[\"[2-5]\"]],[\"(\\\\d{3})(\\\\d{4})\",\"$1-$2\",[\"[6-8]\"]]]],\"SS\":[\"211\",\"00\",\"[19]\\\\d{8}\",[9],[[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"[19]\"],\"0$1\"]],\"0\"],\"ST\":[\"239\",\"00\",\"(?:22|9\\\\d)\\\\d{5}\",[7],[[\"(\\\\d{3})(\\\\d{4})\",\"$1 $2\",[\"[29]\"]]]],\"SV\":[\"503\",\"00\",\"[267]\\\\d{7}|[89]00\\\\d{4}(?:\\\\d{4})?\",[7,8,11],[[\"(\\\\d{3})(\\\\d{4})\",\"$1 $2\",[\"[89]\"]],[\"(\\\\d{4})(\\\\d{4})\",\"$1 $2\",[\"[267]\"]],[\"(\\\\d{3})(\\\\d{4})(\\\\d{4})\",\"$1 $2 $3\",[\"[89]\"]]]],\"SX\":[\"1\",\"011\",\"7215\\\\d{6}|(?:[58]\\\\d\\\\d|900)\\\\d{7}\",[10],0,\"1\",0,\"1|(5\\\\d{6})$\",\"721$1\",0,\"721\"],\"SY\":[\"963\",\"00\",\"[1-39]\\\\d{8}|[1-5]\\\\d{7}\",[8,9],[[\"(\\\\d{2})(\\\\d{3})(\\\\d{3,4})\",\"$1 $2 $3\",[\"[1-5]\"],\"0$1\",1],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"9\"],\"0$1\",1]],\"0\"],\"SZ\":[\"268\",\"00\",\"0800\\\\d{4}|(?:[237]\\\\d|900)\\\\d{6}\",[8,9],[[\"(\\\\d{4})(\\\\d{4})\",\"$1 $2\",[\"[0237]\"]],[\"(\\\\d{5})(\\\\d{4})\",\"$1 $2\",[\"9\"]]]],\"TA\":[\"290\",\"00\",\"8\\\\d{3}\",[4],0,0,0,0,0,0,\"8\"],\"TC\":[\"1\",\"011\",\"(?:[58]\\\\d\\\\d|649|900)\\\\d{7}\",[10],0,\"1\",0,\"1|([2-479]\\\\d{6})$\",\"649$1\",0,\"649\"],\"TD\":[\"235\",\"00|16\",\"(?:22|[69]\\\\d|77)\\\\d{6}\",[8],[[\"(\\\\d{2})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"[2679]\"]]],0,0,0,0,0,0,0,\"00\"],\"TG\":[\"228\",\"00\",\"[279]\\\\d{7}\",[8],[[\"(\\\\d{2})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"[279]\"]]]],\"TH\":[\"66\",\"00[1-9]\",\"(?:001800|[2-57]|[689]\\\\d)\\\\d{7}|1\\\\d{7,9}\",[8,9,10,13],[[\"(\\\\d)(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"2\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{3,4})\",\"$1 $2 $3\",[\"[13-9]\"],\"0$1\"],[\"(\\\\d{4})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"1\"]]],\"0\"],\"TJ\":[\"992\",\"810\",\"(?:00|[1-57-9]\\\\d)\\\\d{7}\",[9],[[\"(\\\\d{6})(\\\\d)(\\\\d{2})\",\"$1 $2 $3\",[\"331\",\"3317\"]],[\"(\\\\d{3})(\\\\d{2})(\\\\d{4})\",\"$1 $2 $3\",[\"[34]7|91[78]\"]],[\"(\\\\d{4})(\\\\d)(\\\\d{4})\",\"$1 $2 $3\",[\"3[1-5]\"]],[\"(\\\\d{2})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"[0-57-9]\"]]],0,0,0,0,0,0,0,\"8~10\"],\"TK\":[\"690\",\"00\",\"[2-47]\\\\d{3,6}\",[4,5,6,7]],\"TL\":[\"670\",\"00\",\"7\\\\d{7}|(?:[2-47]\\\\d|[89]0)\\\\d{5}\",[7,8],[[\"(\\\\d{3})(\\\\d{4})\",\"$1 $2\",[\"[2-489]|70\"]],[\"(\\\\d{4})(\\\\d{4})\",\"$1 $2\",[\"7\"]]]],\"TM\":[\"993\",\"810\",\"[1-6]\\\\d{7}\",[8],[[\"(\\\\d{2})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2-$3-$4\",[\"12\"],\"(8 $1)\"],[\"(\\\\d{3})(\\\\d)(\\\\d{2})(\\\\d{2})\",\"$1 $2-$3-$4\",[\"[1-5]\"],\"(8 $1)\"],[\"(\\\\d{2})(\\\\d{6})\",\"$1 $2\",[\"6\"],\"8 $1\"]],\"8\",0,0,0,0,0,0,\"8~10\"],\"TN\":[\"216\",\"00\",\"[2-57-9]\\\\d{7}\",[8],[[\"(\\\\d{2})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"[2-57-9]\"]]]],\"TO\":[\"676\",\"00\",\"(?:0800|(?:[5-8]\\\\d\\\\d|999)\\\\d)\\\\d{3}|[2-8]\\\\d{4}\",[5,7],[[\"(\\\\d{2})(\\\\d{3})\",\"$1-$2\",[\"[2-4]|50|6[09]|7[0-24-69]|8[05]\"]],[\"(\\\\d{4})(\\\\d{3})\",\"$1 $2\",[\"0\"]],[\"(\\\\d{3})(\\\\d{4})\",\"$1 $2\",[\"[5-9]\"]]]],\"TR\":[\"90\",\"00\",\"4\\\\d{6}|8\\\\d{11,12}|(?:[2-58]\\\\d\\\\d|900)\\\\d{7}\",[7,10,12,13],[[\"(\\\\d{3})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"512|8[01589]|90\"],\"0$1\",1],[\"(\\\\d{3})(\\\\d{3})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"5(?:[0-59]|61)\",\"5(?:[0-59]|616)\",\"5(?:[0-59]|6161)\"],\"0$1\",1],[\"(\\\\d{3})(\\\\d{3})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"[24][1-8]|3[1-9]\"],\"(0$1)\",1],[\"(\\\\d{3})(\\\\d{3})(\\\\d{6,7})\",\"$1 $2 $3\",[\"80\"],\"0$1\",1]],\"0\"],\"TT\":[\"1\",\"011\",\"(?:[58]\\\\d\\\\d|900)\\\\d{7}\",[10],0,\"1\",0,\"1|([2-46-8]\\\\d{6})$\",\"868$1\",0,\"868\"],\"TV\":[\"688\",\"00\",\"(?:2|7\\\\d\\\\d|90)\\\\d{4}\",[5,6,7],[[\"(\\\\d{2})(\\\\d{3})\",\"$1 $2\",[\"2\"]],[\"(\\\\d{2})(\\\\d{4})\",\"$1 $2\",[\"90\"]],[\"(\\\\d{2})(\\\\d{5})\",\"$1 $2\",[\"7\"]]]],\"TW\":[\"886\",\"0(?:0[25-79]|19)\",\"[2-689]\\\\d{8}|7\\\\d{9,10}|[2-8]\\\\d{7}|2\\\\d{6}\",[7,8,9,10,11],[[\"(\\\\d{2})(\\\\d)(\\\\d{4})\",\"$1 $2 $3\",[\"202\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{3,4})\",\"$1 $2 $3\",[\"[258]0\"],\"0$1\"],[\"(\\\\d)(\\\\d{3,4})(\\\\d{4})\",\"$1 $2 $3\",[\"[23568]|4(?:0[02-48]|[1-47-9])|7[1-9]\",\"[23568]|4(?:0[2-48]|[1-47-9])|(?:400|7)[1-9]\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"[49]\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{4})(\\\\d{4,5})\",\"$1 $2 $3\",[\"7\"],\"0$1\"]],\"0\",0,0,0,0,0,0,0,\"#\"],\"TZ\":[\"255\",\"00[056]\",\"(?:[26-8]\\\\d|41|90)\\\\d{7}\",[9],[[\"(\\\\d{3})(\\\\d{2})(\\\\d{4})\",\"$1 $2 $3\",[\"[89]\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"[24]\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"[67]\"],\"0$1\"]],\"0\"],\"UA\":[\"380\",\"00\",\"[89]\\\\d{9}|[3-9]\\\\d{8}\",[9,10],[[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"6[12][29]|(?:3[1-8]|4[136-8]|5[12457]|6[49])2|(?:56|65)[24]\",\"6[12][29]|(?:35|4[1378]|5[12457]|6[49])2|(?:56|65)[24]|(?:3[1-46-8]|46)2[013-9]\"],\"0$1\"],[\"(\\\\d{4})(\\\\d{5})\",\"$1 $2\",[\"3[1-8]|4(?:[1367]|[45][6-9]|8[4-6])|5(?:[1-5]|6[0135689]|7[4-6])|6(?:[12][3-7]|[459])\",\"3[1-8]|4(?:[1367]|[45][6-9]|8[4-6])|5(?:[1-5]|6(?:[015689]|3[02389])|7[4-6])|6(?:[12][3-7]|[459])\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"[3-7]|89|9[1-9]\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3,4})\",\"$1 $2 $3\",[\"[89]\"],\"0$1\"]],\"0\",0,0,0,0,0,0,\"0~0\"],\"UG\":[\"256\",\"00[057]\",\"800\\\\d{6}|(?:[29]0|[347]\\\\d)\\\\d{7}\",[9],[[\"(\\\\d{4})(\\\\d{5})\",\"$1 $2\",[\"202\",\"2024\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{6})\",\"$1 $2\",[\"[27-9]|4(?:6[45]|[7-9])\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{7})\",\"$1 $2\",[\"[34]\"],\"0$1\"]],\"0\"],\"US\":[\"1\",\"011\",\"[2-9]\\\\d{9}|3\\\\d{6}\",[10],[[\"(\\\\d{3})(\\\\d{4})\",\"$1-$2\",[\"310\"],0,1],[\"(\\\\d{3})(\\\\d{3})(\\\\d{4})\",\"($1) $2-$3\",[\"[2-9]\"],0,1,\"$1-$2-$3\"]],\"1\",0,0,0,0,0,[[\"5(?:05(?:[2-57-9]\\\\d\\\\d|6(?:[0-35-9]\\\\d|44))|82(?:2(?:0[0-3]|[268]2)|3(?:0[02]|22|33)|4(?:00|4[24]|65|82)|5(?:00|29|58|83)|6(?:00|66|82)|7(?:58|77)|8(?:00|42|88)|9(?:00|9[89])))\\\\d{4}|(?:2(?:0[1-35-9]|1[02-9]|2[03-589]|3[149]|4[08]|5[1-46]|6[0279]|7[0269]|8[13])|3(?:0[1-57-9]|1[02-9]|2[01356]|3[0-24679]|4[167]|5[12]|6[014]|8[056])|4(?:0[124-9]|1[02-579]|2[3-5]|3[0245]|4[023578]|58|6[349]|7[0589]|8[04])|5(?:0[1-47-9]|1[0235-8]|20|3[0149]|4[01]|5[19]|6[1-47]|7[0-5]|8[056])|6(?:0[1-35-9]|1[024-9]|2[03689]|[34][016]|5[01679]|6[0-279]|78|8[0-29])|7(?:0[1-46-8]|1[2-9]|2[04-7]|3[1247]|4[037]|5[47]|6[02359]|7[0-59]|8[156])|8(?:0[1-68]|1[02-8]|2[068]|3[0-289]|4[03578]|5[046-9]|6[02-5]|7[028])|9(?:0[1346-9]|1[02-9]|2[0589]|3[0146-8]|4[0157-9]|5[12469]|7[0-389]|8[04-69]))[2-9]\\\\d{6}\"],[\"\"],[\"8(?:00|33|44|55|66|77|88)[2-9]\\\\d{6}\"],[\"900[2-9]\\\\d{6}\"],[\"52(?:3(?:[2-46-9][02-9]\\\\d|5(?:[02-46-9]\\\\d|5[0-46-9]))|4(?:[2-478][02-9]\\\\d|5(?:[034]\\\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\\\d)|9(?:[05-9]\\\\d|2[0-5]|49)))\\\\d{4}|52[34][2-9]1[02-9]\\\\d{4}|5(?:00|2[125-7]|33|44|66|77|88)[2-9]\\\\d{6}\"]]],\"UY\":[\"598\",\"0(?:0|1[3-9]\\\\d)\",\"4\\\\d{9}|[1249]\\\\d{7}|(?:[49]\\\\d|80)\\\\d{5}\",[7,8,10],[[\"(\\\\d{3})(\\\\d{4})\",\"$1 $2\",[\"405|8|90\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"9\"],\"0$1\"],[\"(\\\\d{4})(\\\\d{4})\",\"$1 $2\",[\"[124]\"]],[\"(\\\\d{3})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"4\"],\"0$1\"]],\"0\",0,0,0,0,0,0,\"00\",\" int. \"],\"UZ\":[\"998\",\"810\",\"(?:33|55|[679]\\\\d|88)\\\\d{7}\",[9],[[\"(\\\\d{2})(\\\\d{3})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"[35-9]\"],\"8 $1\"]],\"8\",0,0,0,0,0,0,\"8~10\"],\"VA\":[\"39\",\"00\",\"0\\\\d{5,10}|3[0-8]\\\\d{7,10}|55\\\\d{8}|8\\\\d{5}(?:\\\\d{2,4})?|(?:1\\\\d|39)\\\\d{7,8}\",[6,7,8,9,10,11],0,0,0,0,0,0,\"06698\"],\"VC\":[\"1\",\"011\",\"(?:[58]\\\\d\\\\d|784|900)\\\\d{7}\",[10],0,\"1\",0,\"1|([2-7]\\\\d{6})$\",\"784$1\",0,\"784\"],\"VE\":[\"58\",\"00\",\"[68]00\\\\d{7}|(?:[24]\\\\d|[59]0)\\\\d{8}\",[10],[[\"(\\\\d{3})(\\\\d{7})\",\"$1-$2\",[\"[24-689]\"],\"0$1\"]],\"0\"],\"VG\":[\"1\",\"011\",\"(?:284|[58]\\\\d\\\\d|900)\\\\d{7}\",[10],0,\"1\",0,\"1|([2-578]\\\\d{6})$\",\"284$1\",0,\"284\"],\"VI\":[\"1\",\"011\",\"[58]\\\\d{9}|(?:34|90)0\\\\d{7}\",[10],0,\"1\",0,\"1|([2-9]\\\\d{6})$\",\"340$1\",0,\"340\"],\"VN\":[\"84\",\"00\",\"[12]\\\\d{9}|[135-9]\\\\d{8}|[16]\\\\d{7}|[16-8]\\\\d{6}\",[7,8,9,10],[[\"(\\\\d{2})(\\\\d{5})\",\"$1 $2\",[\"80\"],\"0$1\",1],[\"(\\\\d{4})(\\\\d{4,6})\",\"$1 $2\",[\"1\"],0,1],[\"(\\\\d{2})(\\\\d{3})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"[69]\"],\"0$1\",1],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"[3578]\"],\"0$1\",1],[\"(\\\\d{2})(\\\\d{4})(\\\\d{4})\",\"$1 $2 $3\",[\"2[48]\"],\"0$1\",1],[\"(\\\\d{3})(\\\\d{4})(\\\\d{3})\",\"$1 $2 $3\",[\"2\"],\"0$1\",1]],\"0\"],\"VU\":[\"678\",\"00\",\"[57-9]\\\\d{6}|(?:[238]\\\\d|48)\\\\d{3}\",[5,7],[[\"(\\\\d{3})(\\\\d{4})\",\"$1 $2\",[\"[57-9]\"]]]],\"WF\":[\"681\",\"00\",\"(?:40|72)\\\\d{4}|8\\\\d{5}(?:\\\\d{3})?\",[6,9],[[\"(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3\",[\"[478]\"]],[\"(\\\\d{3})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"8\"]]]],\"WS\":[\"685\",\"0\",\"(?:[2-6]|8\\\\d{5})\\\\d{4}|[78]\\\\d{6}|[68]\\\\d{5}\",[5,6,7,10],[[\"(\\\\d{5})\",\"$1\",[\"[2-5]|6[1-9]\"]],[\"(\\\\d{3})(\\\\d{3,7})\",\"$1 $2\",[\"[68]\"]],[\"(\\\\d{2})(\\\\d{5})\",\"$1 $2\",[\"7\"]]]],\"XK\":[\"383\",\"00\",\"[23]\\\\d{7,8}|(?:4\\\\d\\\\d|[89]00)\\\\d{5}\",[8,9],[[\"(\\\\d{3})(\\\\d{5})\",\"$1 $2\",[\"[89]\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"[2-4]\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"[23]\"],\"0$1\"]],\"0\"],\"YE\":[\"967\",\"00\",\"(?:1|7\\\\d)\\\\d{7}|[1-7]\\\\d{6}\",[7,8,9],[[\"(\\\\d)(\\\\d{3})(\\\\d{3,4})\",\"$1 $2 $3\",[\"[1-6]|7[24-68]\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"7\"],\"0$1\"]],\"0\"],\"YT\":[\"262\",\"00\",\"80\\\\d{7}|(?:26|63)9\\\\d{6}\",[9],0,\"0\",0,0,0,0,\"269|63\"],\"ZA\":[\"27\",\"00\",\"[1-79]\\\\d{8}|8\\\\d{4,9}\",[5,6,7,8,9,10],[[\"(\\\\d{2})(\\\\d{3,4})\",\"$1 $2\",[\"8[1-4]\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{2,3})\",\"$1 $2 $3\",[\"8[1-4]\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"860\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"[1-9]\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"8\"],\"0$1\"]],\"0\"],\"ZM\":[\"260\",\"00\",\"800\\\\d{6}|(?:21|63|[79]\\\\d)\\\\d{7}\",[9],[[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"[28]\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{7})\",\"$1 $2\",[\"[79]\"],\"0$1\"]],\"0\"],\"ZW\":[\"263\",\"00\",\"2(?:[0-57-9]\\\\d{6,8}|6[0-24-9]\\\\d{6,7})|[38]\\\\d{9}|[35-8]\\\\d{8}|[3-6]\\\\d{7}|[1-689]\\\\d{6}|[1-3569]\\\\d{5}|[1356]\\\\d{4}\",[5,6,7,8,9,10],[[\"(\\\\d{3})(\\\\d{3,5})\",\"$1 $2\",[\"2(?:0[45]|2[278]|[49]8)|3(?:[09]8|17)|6(?:[29]8|37|75)|[23][78]|(?:33|5[15]|6[68])[78]\"],\"0$1\"],[\"(\\\\d)(\\\\d{3})(\\\\d{2,4})\",\"$1 $2 $3\",[\"[49]\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{4})\",\"$1 $2\",[\"80\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{7})\",\"$1 $2\",[\"24|8[13-59]|(?:2[05-79]|39|5[45]|6[15-8])2\",\"2(?:02[014]|4|[56]20|[79]2)|392|5(?:42|525)|6(?:[16-8]21|52[013])|8[13-59]\"],\"(0$1)\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"7\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3,4})\",\"$1 $2 $3\",[\"2(?:1[39]|2[0157]|[378]|[56][14])|3(?:12|29)\",\"2(?:1[39]|2[0157]|[378]|[56][14])|3(?:123|29)\"],\"0$1\"],[\"(\\\\d{4})(\\\\d{6})\",\"$1 $2\",[\"8\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3,5})\",\"$1 $2\",[\"1|2(?:0[0-36-9]|12|29|[56])|3(?:1[0-689]|[24-6])|5(?:[0236-9]|1[2-4])|6(?:[013-59]|7[0-46-9])|(?:33|55|6[68])[0-69]|(?:29|3[09]|62)[0-79]\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{3,4})\",\"$1 $2 $3\",[\"29[013-9]|39|54\"],\"0$1\"],[\"(\\\\d{4})(\\\\d{3,5})\",\"$1 $2\",[\"(?:25|54)8\",\"258|5483\"],\"0$1\"]],\"0\"]},\"nonGeographic\":{\"800\":[\"800\",0,\"(?:005|[1-9]\\\\d\\\\d)\\\\d{5}\",[8],[[\"(\\\\d{4})(\\\\d{4})\",\"$1 $2\",[\"\\\\d\"]]],0,0,0,0,0,0,[0,0,[\"(?:005|[1-9]\\\\d\\\\d)\\\\d{5}\"]]],\"808\":[\"808\",0,\"[1-9]\\\\d{7}\",[8],[[\"(\\\\d{4})(\\\\d{4})\",\"$1 $2\",[\"[1-9]\"]]],0,0,0,0,0,0,[0,0,0,0,0,0,0,0,0,[\"[1-9]\\\\d{7}\"]]],\"870\":[\"870\",0,\"7\\\\d{11}|[35-7]\\\\d{8}\",[9,12],[[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"[35-7]\"]]],0,0,0,0,0,0,[0,[\"(?:[356]|774[45])\\\\d{8}|7[6-8]\\\\d{7}\"]]],\"878\":[\"878\",0,\"10\\\\d{10}\",[12],[[\"(\\\\d{2})(\\\\d{5})(\\\\d{5})\",\"$1 $2 $3\",[\"1\"]]],0,0,0,0,0,0,[0,0,0,0,0,0,0,0,[\"10\\\\d{10}\"]]],\"881\":[\"881\",0,\"[0-36-9]\\\\d{8}\",[9],[[\"(\\\\d)(\\\\d{3})(\\\\d{5})\",\"$1 $2 $3\",[\"[0-36-9]\"]]],0,0,0,0,0,0,[0,[\"[0-36-9]\\\\d{8}\"]]],\"882\":[\"882\",0,\"[13]\\\\d{6}(?:\\\\d{2,5})?|285\\\\d{9}|(?:[19]\\\\d|49)\\\\d{6}\",[7,8,9,10,11,12],[[\"(\\\\d{2})(\\\\d{5})\",\"$1 $2\",[\"16|342\"]],[\"(\\\\d{2})(\\\\d{6})\",\"$1 $2\",[\"4\"]],[\"(\\\\d{2})(\\\\d{2})(\\\\d{4})\",\"$1 $2 $3\",[\"[19]\"]],[\"(\\\\d{2})(\\\\d{4})(\\\\d{3})\",\"$1 $2 $3\",[\"3[23]\"]],[\"(\\\\d{2})(\\\\d{3,4})(\\\\d{4})\",\"$1 $2 $3\",[\"1\"]],[\"(\\\\d{2})(\\\\d{4})(\\\\d{4})\",\"$1 $2 $3\",[\"34[57]\"]],[\"(\\\\d{3})(\\\\d{4})(\\\\d{4})\",\"$1 $2 $3\",[\"34\"]],[\"(\\\\d{2})(\\\\d{4,5})(\\\\d{5})\",\"$1 $2 $3\",[\"[1-3]\"]]],0,0,0,0,0,0,[0,[\"342\\\\d{4}|(?:337|49)\\\\d{6}|3(?:2|47|7\\\\d{3})\\\\d{7}\",[7,8,9,10,12]],0,0,0,0,0,0,[\"1(?:3(?:0[0347]|[13][0139]|2[035]|4[013568]|6[0459]|7[06]|8[15-8]|9[0689])\\\\d{4}|6\\\\d{5,10})|(?:(?:285\\\\d\\\\d|3(?:45|[69]\\\\d{3}))\\\\d|9[89])\\\\d{6}\"]]],\"883\":[\"883\",0,\"(?:210|370\\\\d\\\\d)\\\\d{7}|51\\\\d{7}(?:\\\\d{3})?\",[9,10,12],[[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"510\"]],[\"(\\\\d{3})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"2\"]],[\"(\\\\d{4})(\\\\d{4})(\\\\d{4})\",\"$1 $2 $3\",[\"51[13]\"]],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3 $4\",[\"[35]\"]]],0,0,0,0,0,0,[0,0,0,0,0,0,0,0,[\"(?:210|(?:370[1-9]|51[013]0)\\\\d)\\\\d{7}|5100\\\\d{5}\"]]],\"888\":[\"888\",0,\"\\\\d{11}\",[11],[[\"(\\\\d{3})(\\\\d{3})(\\\\d{5})\",\"$1 $2 $3\"]],0,0,0,0,0,0,[0,0,0,0,0,0,[\"\\\\d{11}\"]]],\"979\":[\"979\",0,\"[1359]\\\\d{8}\",[9],[[\"(\\\\d)(\\\\d{4})(\\\\d{4})\",\"$1 $2 $3\",[\"[1359]\"]]],0,0,0,0,0,0,[0,0,0,[\"[1359]\\\\d{8}\"]]]}}"); /***/ }), /***/ "./node_modules/libphonenumber-js/min/index.cjs": /***/ (function(module, exports, __webpack_require__) { "use strict"; var metadata = __webpack_require__("./node_modules/libphonenumber-js/metadata.min.json") var core = __webpack_require__("./node_modules/libphonenumber-js/core/index.cjs") function call(func, _arguments) { var args = Array.prototype.slice.call(_arguments) args.push(metadata) return func.apply(this, args) } function parsePhoneNumberFromString() { return call(core.parsePhoneNumberFromString, arguments) } // ES5 `require()` "default" "interoperability" hack. // https://github.com/babel/babel/issues/2212#issuecomment-131827986 // An alternative approach: // https://www.npmjs.com/package/babel-plugin-add-module-exports exports = module.exports = parsePhoneNumberFromString exports['default'] = parsePhoneNumberFromString exports.ParseError = core.ParseError function parsePhoneNumberWithError() { return call(core.parsePhoneNumberWithError, arguments) } // `parsePhoneNumber()` named export has been renamed to `parsePhoneNumberWithError()`. exports.parsePhoneNumber = parsePhoneNumberWithError exports.parsePhoneNumberWithError = parsePhoneNumberWithError // `parsePhoneNumberFromString()` named export is now considered legacy: // it has been promoted to a default export due to being too verbose. exports.parsePhoneNumberFromString = parsePhoneNumberFromString exports.isValidPhoneNumber = function isValidPhoneNumber() { return call(core.isValidPhoneNumber, arguments) } exports.isPossiblePhoneNumber = function isPossiblePhoneNumber() { return call(core.isPossiblePhoneNumber, arguments) } exports.validatePhoneNumberLength = function validatePhoneNumberLength() { return call(core.validatePhoneNumberLength, arguments) } exports.findNumbers = function findNumbers() { return call(core.findNumbers, arguments) } exports.searchNumbers = function searchNumbers() { return call(core.searchNumbers, arguments) } exports.findPhoneNumbersInText = function findPhoneNumbersInText() { return call(core.findPhoneNumbersInText, arguments) } exports.searchPhoneNumbersInText = function searchPhoneNumbersInText() { return call(core.searchPhoneNumbersInText, arguments) } exports.PhoneNumberMatcher = function PhoneNumberMatcher(text, options) { return core.PhoneNumberMatcher.call(this, text, options, metadata) } exports.PhoneNumberMatcher.prototype = Object.create(core.PhoneNumberMatcher.prototype, {}) exports.PhoneNumberMatcher.prototype.constructor = exports.PhoneNumberMatcher exports.AsYouType = function AsYouType(country) { return core.AsYouType.call(this, country, metadata) } exports.AsYouType.prototype = Object.create(core.AsYouType.prototype, {}) exports.AsYouType.prototype.constructor = exports.AsYouType exports.isSupportedCountry = function isSupportedCountry(country) { return call(core.isSupportedCountry, arguments) } exports.getCountries = function getCountries() { return call(core.getCountries, arguments) } exports.getCountryCallingCode = function getCountryCallingCode() { return call(core.getCountryCallingCode, arguments) } exports.getExtPrefix = function getExtPrefix(country) { return call(core.getExtPrefix, arguments) } exports.getExampleNumber = function getExampleNumber() { return call(core.getExampleNumber, arguments) } exports.Metadata = function Metadata() { return core.Metadata.call(this, metadata) } exports.Metadata.prototype = Object.create(core.Metadata.prototype, {}) exports.Metadata.prototype.constructor = exports.Metadata exports.formatIncompletePhoneNumber = function formatIncompletePhoneNumber() { return call(core.formatIncompletePhoneNumber, arguments) } exports.parseIncompletePhoneNumber = core.parseIncompletePhoneNumber exports.parsePhoneNumberCharacter = core.parsePhoneNumberCharacter exports.parseDigits = core.parseDigits exports.DIGIT_PLACEHOLDER = core.DIGIT_PLACEHOLDER exports.parseRFC3966 = core.parseRFC3966 exports.formatRFC3966 = core.formatRFC3966 /***/ }), /***/ "./node_modules/loaders.css/loaders.css": /***/ (function(module, exports, __webpack_require__) { var api = __webpack_require__("./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"); var content = __webpack_require__("./node_modules/css-loader/dist/cjs.js!./node_modules/loaders.css/loaders.css"); content = content.__esModule ? content.default : content; if (typeof content === 'string') { content = [[module.i, content, '']]; } var options = {}; options.insert = "head"; options.singleton = false; var update = api(content, options); module.exports = content.locals || {}; /***/ }), /***/ "./node_modules/lodash/_SetCache.js": /***/ (function(module, exports, __webpack_require__) { var isArray = __webpack_require__("./node_modules/lodash/isArray.js"); /** * Casts `value` as an array if it's not one. * * @static * @memberOf _ * @since 4.4.0 * @category Lang * @param {*} value The value to inspect. * @returns {Array} Returns the cast array. * @example * * _.castArray(1); * // => [1] * * _.castArray({ 'a': 1 }); * // => [{ 'a': 1 }] * * _.castArray('abc'); * // => ['abc'] * * _.castArray(null); * // => [null] * * _.castArray(undefined); * // => [undefined] * * _.castArray(); * // => [] * * var array = [1, 2, 3]; * console.log(_.castArray(array) === array); * // => true */ function castArray() { if (!arguments.length) { return []; } var value = arguments[0]; return isArray(value) ? value : [value]; } module.exports = castArray; /***/ }), /***/ "./node_modules/lodash/_Stack.js": /***/ (function(module, exports, __webpack_require__) { var listCacheClear = __webpack_require__("./node_modules/lodash/_listCacheClear.js"), listCacheDelete = __webpack_require__("./node_modules/lodash/_listCacheDelete.js"), listCacheGet = __webpack_require__("./node_modules/lodash/_listCacheGet.js"), listCacheHas = __webpack_require__("./node_modules/lodash/_listCacheHas.js"), listCacheSet = __webpack_require__("./node_modules/lodash/_listCacheSet.js"); /** * Creates an list cache object. * * @private * @constructor * @param {Array} [entries] The key-value pairs to cache. */ function ListCache(entries) { var index = -1, length = entries == null ? 0 : entries.length; this.clear(); while (++index < length) { var entry = entries[index]; this.set(entry[0], entry[1]); } } // Add methods to `ListCache`. ListCache.prototype.clear = listCacheClear; ListCache.prototype['delete'] = listCacheDelete; ListCache.prototype.get = listCacheGet; ListCache.prototype.has = listCacheHas; ListCache.prototype.set = listCacheSet; module.exports = ListCache; /***/ }), /***/ "./node_modules/lodash/_Uint8Array.js": /***/ (function(module, exports, __webpack_require__) { var root = __webpack_require__("./node_modules/lodash/_root.js"); /** Built-in value references. */ var Uint8Array = root.Uint8Array; module.exports = Uint8Array; /***/ }), /***/ "./node_modules/lodash/_apply.js": /***/ (function(module, exports) { /** * A faster alternative to `Function#apply`, this function invokes `func` * with the `this` binding of `thisArg` and the arguments of `args`. * * @private * @param {Function} func The function to invoke. * @param {*} thisArg The `this` binding of `func`. * @param {Array} args The arguments to invoke `func` with. * @returns {*} Returns the result of `func`. */ function apply(func, thisArg, args) { switch (args.length) { case 0: return func.call(thisArg); case 1: return func.call(thisArg, args[0]); case 2: return func.call(thisArg, args[0], args[1]); case 3: return func.call(thisArg, args[0], args[1], args[2]); } return func.apply(thisArg, args); } module.exports = apply; /***/ }), /***/ "./node_modules/lodash/_arrayIncludes.js": /***/ (function(module, exports, __webpack_require__) { var baseIndexOf = __webpack_require__("./node_modules/lodash/_baseIndexOf.js"); /** * A specialized version of `_.includes` for arrays without support for * specifying an index to search from. * * @private * @param {Array} [array] The array to inspect. * @param {*} target The value to search for. * @returns {boolean} Returns `true` if `target` is found, else `false`. */ function arrayIncludes(array, value) { var length = array == null ? 0 : array.length; return !!length && baseIndexOf(array, value, 0) > -1; } module.exports = arrayIncludes; /***/ }), /***/ "./node_modules/lodash/_arrayIncludesWith.js": /***/ (function(module, exports) { /** * This function is like `arrayIncludes` except that it accepts a comparator. * * @private * @param {Array} [array] The array to inspect. * @param {*} target The value to search for. * @param {Function} comparator The comparator invoked per element. * @returns {boolean} Returns `true` if `target` is found, else `false`. */ function arrayIncludesWith(array, value, comparator) { var index = -1, length = array == null ? 0 : array.length; while (++index < length) { if (comparator(value, array[index])) { return true; } } return false; } module.exports = arrayIncludesWith; /***/ }), /***/ "./node_modules/lodash/_arrayMap.js": /***/ (function(module, exports) { /** * A specialized version of `_.map` for arrays without support for iteratee * shorthands. * * @private * @param {Array} [array] The array to iterate over. * @param {Function} iteratee The function invoked per iteration. * @returns {Array} Returns the new mapped array. */ function arrayMap(array, iteratee) { var index = -1, length = array == null ? 0 : array.length, result = Array(length); while (++index < length) { result[index] = iteratee(array[index], index, array); } return result; } module.exports = arrayMap; /***/ }), /***/ "./node_modules/lodash/_arraySome.js": /***/ (function(module, exports) { /** * A specialized version of `_.some` for arrays without support for iteratee * shorthands. * * @private * @param {Array} [array] The array to iterate over. * @param {Function} predicate The function invoked per iteration. * @returns {boolean} Returns `true` if any element passes the predicate check, * else `false`. */ function arraySome(array, predicate) { var index = -1, length = array == null ? 0 : array.length; while (++index < length) { if (predicate(array[index], index, array)) { return true; } } return false; } module.exports = arraySome; /***/ }), /***/ "./node_modules/lodash/_assignMergeValue.js": /***/ (function(module, exports, __webpack_require__) { var baseAssignValue = __webpack_require__("./node_modules/lodash/_baseAssignValue.js"), eq = __webpack_require__("./node_modules/lodash/eq.js"); /** * This function is like `assignValue` except that it doesn't assign * `undefined` values. * * @private * @param {Object} object The object to modify. * @param {string} key The key of the property to assign. * @param {*} value The value to assign. */ function assignMergeValue(object, key, value) { if ((value !== undefined && !eq(object[key], value)) || (value === undefined && !(key in object))) { baseAssignValue(object, key, value); } } module.exports = assignMergeValue; /***/ }), /***/ "./node_modules/lodash/_assignValue.js": /***/ (function(module, exports, __webpack_require__) { var baseAssignValue = __webpack_require__("./node_modules/lodash/_baseAssignValue.js"), eq = __webpack_require__("./node_modules/lodash/eq.js"); /** Used for built-in method references. */ var objectProto = Object.prototype; /** Used to check objects for own properties. */ var hasOwnProperty = objectProto.hasOwnProperty; /** * Assigns `value` to `key` of `object` if the existing value is not equivalent * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * for equality comparisons. * * @private * @param {Object} object The object to modify. * @param {string} key The key of the property to assign. * @param {*} value The value to assign. */ function assignValue(object, key, value) { var objValue = object[key]; if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || (value === undefined && !(key in object))) { baseAssignValue(object, key, value); } } module.exports = assignValue; /***/ }), /***/ "./node_modules/lodash/_assocIndexOf.js": /***/ (function(module, exports, __webpack_require__) { var eq = __webpack_require__("./node_modules/lodash/eq.js"); /** * Gets the index at which the `key` is found in `array` of key-value pairs. * * @private * @param {Array} array The array to inspect. * @param {*} key The key to search for. * @returns {number} Returns the index of the matched value, else `-1`. */ function assocIndexOf(array, key) { var length = array.length; while (length--) { if (eq(array[length][0], key)) { return length; } } return -1; } module.exports = assocIndexOf; /***/ }), /***/ "./node_modules/lodash/_baseAssignValue.js": /***/ (function(module, exports, __webpack_require__) { var defineProperty = __webpack_require__("./node_modules/lodash/_defineProperty.js"); /** * The base implementation of `assignValue` and `assignMergeValue` without * value checks. * * @private * @param {Object} object The object to modify. * @param {string} key The key of the property to assign. * @param {*} value The value to assign. */ function baseAssignValue(object, key, value) { if (key == '__proto__' && defineProperty) { defineProperty(object, key, { 'configurable': true, 'enumerable': true, 'value': value, 'writable': true }); } else { object[key] = value; } } module.exports = baseAssignValue; /***/ }), /***/ "./node_modules/lodash/_baseCreate.js": /***/ (function(module, exports, __webpack_require__) { var isObject = __webpack_require__("./node_modules/lodash/isObject.js"); /** Built-in value references. */ var objectCreate = Object.create; /** * The base implementation of `_.create` without support for assigning * properties to the created object. * * @private * @param {Object} proto The object to inherit from. * @returns {Object} Returns the new object. */ var baseCreate = (function() { function object() {} return function(proto) { if (!isObject(proto)) { return {}; } if (objectCreate) { return objectCreate(proto); } object.prototype = proto; var result = new object; object.prototype = undefined; return result; }; }()); module.exports = baseCreate; /***/ }), /***/ "./node_modules/lodash/_baseEach.js": /***/ (function(module, exports, __webpack_require__) { var baseForOwn = __webpack_require__("./node_modules/lodash/_baseForOwn.js"), createBaseEach = __webpack_require__("./node_modules/lodash/_createBaseEach.js"); /** * The base implementation of `_.forEach` without support for iteratee shorthands. * * @private * @param {Array|Object} collection The collection to iterate over. * @param {Function} iteratee The function invoked per iteration. * @returns {Array|Object} Returns `collection`. */ var baseEach = createBaseEach(baseForOwn); module.exports = baseEach; /***/ }), /***/ "./node_modules/lodash/_baseExtremum.js": /***/ (function(module, exports, __webpack_require__) { var isSymbol = __webpack_require__("./node_modules/lodash/isSymbol.js"); /** * The base implementation of methods like `_.max` and `_.min` which accepts a * `comparator` to determine the extremum value. * * @private * @param {Array} array The array to iterate over. * @param {Function} iteratee The iteratee invoked per iteration. * @param {Function} comparator The comparator used to compare values. * @returns {*} Returns the extremum value. */ function baseExtremum(array, iteratee, comparator) { var index = -1, length = array.length; while (++index < length) { var value = array[index], current = iteratee(value); if (current != null && (computed === undefined ? (current === current && !isSymbol(current)) : comparator(current, computed) )) { var computed = current, result = value; } } return result; } module.exports = baseExtremum; /***/ }), /***/ "./node_modules/lodash/_baseFlatten.js": /***/ (function(module, exports) { /** * Gets the first element of `array`. * * @static * @memberOf _ * @since 0.1.0 * @alias first * @category Array * @param {Array} array The array to query. * @returns {*} Returns the first element of `array`. * @example * * _.head([1, 2, 3]); * // => 1 * * _.head([]); * // => undefined */ function head(array) { return (array && array.length) ? array[0] : undefined; } module.exports = head; /***/ }), /***/ "./node_modules/lodash/_baseFor.js": /***/ (function(module, exports, __webpack_require__) { var createBaseFor = __webpack_require__("./node_modules/lodash/_createBaseFor.js"); /** * The base implementation of `baseForOwn` which iterates over `object` * properties returned by `keysFunc` and invokes `iteratee` for each property. * Iteratee functions may exit iteration early by explicitly returning `false`. * * @private * @param {Object} object The object to iterate over. * @param {Function} iteratee The function invoked per iteration. * @param {Function} keysFunc The function to get the keys of `object`. * @returns {Object} Returns `object`. */ var baseFor = createBaseFor(); module.exports = baseFor; /***/ }), /***/ "./node_modules/lodash/_baseForOwn.js": /***/ (function(module, exports, __webpack_require__) { var baseFor = __webpack_require__("./node_modules/lodash/_baseFor.js"), keys = __webpack_require__("./node_modules/lodash/keys.js"); /** * The base implementation of `_.forOwn` without support for iteratee shorthands. * * @private * @param {Object} object The object to iterate over. * @param {Function} iteratee The function invoked per iteration. * @returns {Object} Returns `object`. */ function baseForOwn(object, iteratee) { return object && baseFor(object, iteratee, keys); } module.exports = baseForOwn; /***/ }), /***/ "./node_modules/lodash/_baseGet.js": /***/ (function(module, exports) { /** * Gets the value at `key` of `object`. * * @private * @param {Object} [object] The object to query. * @param {string} key The key of the property to get. * @returns {*} Returns the property value. */ function getValue(object, key) { return object == null ? undefined : object[key]; } module.exports = getValue; /***/ }), /***/ "./node_modules/lodash/_baseGetTag.js": /***/ (function(module, exports) { /** Used for built-in method references. */ var objectProto = Object.prototype; /** * Used to resolve the * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) * of values. */ var nativeObjectToString = objectProto.toString; /** * Converts `value` to a string using `Object.prototype.toString`. * * @private * @param {*} value The value to convert. * @returns {string} Returns the converted string. */ function objectToString(value) { return nativeObjectToString.call(value); } module.exports = objectToString; /***/ }), /***/ "./node_modules/lodash/_baseGt.js": /***/ (function(module, exports) { /** * The base implementation of `_.gt` which doesn't coerce arguments. * * @private * @param {*} value The value to compare. * @param {*} other The other value to compare. * @returns {boolean} Returns `true` if `value` is greater than `other`, * else `false`. */ function baseGt(value, other) { return value > other; } module.exports = baseGt; /***/ }), /***/ "./node_modules/lodash/_baseIndexOf.js": /***/ (function(module, exports) { /** * A specialized version of `_.indexOf` which performs strict equality * comparisons of values, i.e. `===`. * * @private * @param {Array} array The array to inspect. * @param {*} value The value to search for. * @param {number} fromIndex The index to search from. * @returns {number} Returns the index of the matched value, else `-1`. */ function strictIndexOf(array, value, fromIndex) { var index = fromIndex - 1, length = array.length; while (++index < length) { if (array[index] === value) { return index; } } return -1; } module.exports = strictIndexOf; /***/ }), /***/ "./node_modules/lodash/_baseIsEqual.js": /***/ (function(module, exports, __webpack_require__) { var baseIsEqualDeep = __webpack_require__("./node_modules/lodash/_baseIsEqualDeep.js"), isObjectLike = __webpack_require__("./node_modules/lodash/isObjectLike.js"); /** * The base implementation of `_.isEqual` which supports partial comparisons * and tracks traversed objects. * * @private * @param {*} value The value to compare. * @param {*} other The other value to compare. * @param {boolean} bitmask The bitmask flags. * 1 - Unordered comparison * 2 - Partial comparison * @param {Function} [customizer] The function to customize comparisons. * @param {Object} [stack] Tracks traversed `value` and `other` objects. * @returns {boolean} Returns `true` if the values are equivalent, else `false`. */ function baseIsEqual(value, other, bitmask, customizer, stack) { if (value === other) { return true; } if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) { return value !== value && other !== other; } return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack); } module.exports = baseIsEqual; /***/ }), /***/ "./node_modules/lodash/_baseIsEqualDeep.js": /***/ (function(module, exports, __webpack_require__) { var Stack = __webpack_require__("./node_modules/lodash/_Stack.js"), equalArrays = __webpack_require__("./node_modules/lodash/_equalArrays.js"), equalByTag = __webpack_require__("./node_modules/lodash/_equalByTag.js"), equalObjects = __webpack_require__("./node_modules/lodash/_equalObjects.js"), getTag = __webpack_require__("./node_modules/lodash/_getTag.js"), isArray = __webpack_require__("./node_modules/lodash/isArray.js"), isBuffer = __webpack_require__("./node_modules/lodash/isBuffer.js"), isTypedArray = __webpack_require__("./node_modules/lodash/isTypedArray.js"); /** Used to compose bitmasks for value comparisons. */ var COMPARE_PARTIAL_FLAG = 1; /** `Object#toString` result references. */ var argsTag = '[object Arguments]', arrayTag = '[object Array]', objectTag = '[object Object]'; /** Used for built-in method references. */ var objectProto = Object.prototype; /** Used to check objects for own properties. */ var hasOwnProperty = objectProto.hasOwnProperty; /** * A specialized version of `baseIsEqual` for arrays and objects which performs * deep comparisons and tracks traversed objects enabling objects with circular * references to be compared. * * @private * @param {Object} object The object to compare. * @param {Object} other The other object to compare. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. * @param {Function} customizer The function to customize comparisons. * @param {Function} equalFunc The function to determine equivalents of values. * @param {Object} [stack] Tracks traversed `object` and `other` objects. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. */ function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) { var objIsArr = isArray(object), othIsArr = isArray(other), objTag = objIsArr ? arrayTag : getTag(object), othTag = othIsArr ? arrayTag : getTag(other); objTag = objTag == argsTag ? objectTag : objTag; othTag = othTag == argsTag ? objectTag : othTag; var objIsObj = objTag == objectTag, othIsObj = othTag == objectTag, isSameTag = objTag == othTag; if (isSameTag && isBuffer(object)) { if (!isBuffer(other)) { return false; } objIsArr = true; objIsObj = false; } if (isSameTag && !objIsObj) { stack || (stack = new Stack); return (objIsArr || isTypedArray(object)) ? equalArrays(object, other, bitmask, customizer, equalFunc, stack) : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack); } if (!(bitmask & COMPARE_PARTIAL_FLAG)) { var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'), othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__'); if (objIsWrapped || othIsWrapped) { var objUnwrapped = objIsWrapped ? object.value() : object, othUnwrapped = othIsWrapped ? other.value() : other; stack || (stack = new Stack); return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack); } } if (!isSameTag) { return false; } stack || (stack = new Stack); return equalObjects(object, other, bitmask, customizer, equalFunc, stack); } module.exports = baseIsEqualDeep; /***/ }), /***/ "./node_modules/lodash/_baseIsMatch.js": /***/ (function(module, exports, __webpack_require__) { var Stack = __webpack_require__("./node_modules/lodash/_Stack.js"), baseIsEqual = __webpack_require__("./node_modules/lodash/_baseIsEqual.js"); /** Used to compose bitmasks for value comparisons. */ var COMPARE_PARTIAL_FLAG = 1, COMPARE_UNORDERED_FLAG = 2; /** * The base implementation of `_.isMatch` without support for iteratee shorthands. * * @private * @param {Object} object The object to inspect. * @param {Object} source The object of property values to match. * @param {Array} matchData The property names, values, and compare flags to match. * @param {Function} [customizer] The function to customize comparisons. * @returns {boolean} Returns `true` if `object` is a match, else `false`. */ function baseIsMatch(object, source, matchData, customizer) { var index = matchData.length, length = index, noCustomizer = !customizer; if (object == null) { return !length; } object = Object(object); while (index--) { var data = matchData[index]; if ((noCustomizer && data[2]) ? data[1] !== object[data[0]] : !(data[0] in object) ) { return false; } } while (++index < length) { data = matchData[index]; var key = data[0], objValue = object[key], srcValue = data[1]; if (noCustomizer && data[2]) { if (objValue === undefined && !(key in object)) { return false; } } else { var stack = new Stack; if (customizer) { var result = customizer(objValue, srcValue, key, object, source, stack); } if (!(result === undefined ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack) : result )) { return false; } } } return true; } module.exports = baseIsMatch; /***/ }), /***/ "./node_modules/lodash/_baseIteratee.js": /***/ (function(module, exports, __webpack_require__) { var baseMatches = __webpack_require__("./node_modules/lodash/_baseMatches.js"), baseMatchesProperty = __webpack_require__("./node_modules/lodash/_baseMatchesProperty.js"), identity = __webpack_require__("./node_modules/lodash/identity.js"), isArray = __webpack_require__("./node_modules/lodash/isArray.js"), property = __webpack_require__("./node_modules/lodash/property.js"); /** * The base implementation of `_.iteratee`. * * @private * @param {*} [value=_.identity] The value to convert to an iteratee. * @returns {Function} Returns the iteratee. */ function baseIteratee(value) { // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9. // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details. if (typeof value == 'function') { return value; } if (value == null) { return identity; } if (typeof value == 'object') { return isArray(value) ? baseMatchesProperty(value[0], value[1]) : baseMatches(value); } return property(value); } module.exports = baseIteratee; /***/ }), /***/ "./node_modules/lodash/_baseLt.js": /***/ (function(module, exports) { /** * The base implementation of `_.lt` which doesn't coerce arguments. * * @private * @param {*} value The value to compare. * @param {*} other The other value to compare. * @returns {boolean} Returns `true` if `value` is less than `other`, * else `false`. */ function baseLt(value, other) { return value < other; } module.exports = baseLt; /***/ }), /***/ "./node_modules/lodash/_baseMap.js": /***/ (function(module, exports, __webpack_require__) { var baseEach = __webpack_require__("./node_modules/lodash/_baseEach.js"), isArrayLike = __webpack_require__("./node_modules/lodash/isArrayLike.js"); /** * The base implementation of `_.map` without support for iteratee shorthands. * * @private * @param {Array|Object} collection The collection to iterate over. * @param {Function} iteratee The function invoked per iteration. * @returns {Array} Returns the new mapped array. */ function baseMap(collection, iteratee) { var index = -1, result = isArrayLike(collection) ? Array(collection.length) : []; baseEach(collection, function(value, key, collection) { result[++index] = iteratee(value, key, collection); }); return result; } module.exports = baseMap; /***/ }), /***/ "./node_modules/lodash/_baseMatches.js": /***/ (function(module, exports, __webpack_require__) { var baseIsMatch = __webpack_require__("./node_modules/lodash/_baseIsMatch.js"), getMatchData = __webpack_require__("./node_modules/lodash/_getMatchData.js"), matchesStrictComparable = __webpack_require__("./node_modules/lodash/_matchesStrictComparable.js"); /** * The base implementation of `_.matches` which doesn't clone `source`. * * @private * @param {Object} source The object of property values to match. * @returns {Function} Returns the new spec function. */ function baseMatches(source) { var matchData = getMatchData(source); if (matchData.length == 1 && matchData[0][2]) { return matchesStrictComparable(matchData[0][0], matchData[0][1]); } return function(object) { return object === source || baseIsMatch(object, source, matchData); }; } module.exports = baseMatches; /***/ }), /***/ "./node_modules/lodash/_baseMatchesProperty.js": /***/ (function(module, exports, __webpack_require__) { var baseIsEqual = __webpack_require__("./node_modules/lodash/_baseIsEqual.js"), get = __webpack_require__("./node_modules/lodash/get.js"), hasIn = __webpack_require__("./node_modules/lodash/hasIn.js"), isKey = __webpack_require__("./node_modules/lodash/_isKey.js"), isStrictComparable = __webpack_require__("./node_modules/lodash/_isStrictComparable.js"), matchesStrictComparable = __webpack_require__("./node_modules/lodash/_matchesStrictComparable.js"), toKey = __webpack_require__("./node_modules/lodash/_toKey.js"); /** Used to compose bitmasks for value comparisons. */ var COMPARE_PARTIAL_FLAG = 1, COMPARE_UNORDERED_FLAG = 2; /** * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`. * * @private * @param {string} path The path of the property to get. * @param {*} srcValue The value to match. * @returns {Function} Returns the new spec function. */ function baseMatchesProperty(path, srcValue) { if (isKey(path) && isStrictComparable(srcValue)) { return matchesStrictComparable(toKey(path), srcValue); } return function(object) { var objValue = get(object, path); return (objValue === undefined && objValue === srcValue) ? hasIn(object, path) : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG); }; } module.exports = baseMatchesProperty; /***/ }), /***/ "./node_modules/lodash/_baseMerge.js": /***/ (function(module, exports, __webpack_require__) { var Stack = __webpack_require__("./node_modules/lodash/_Stack.js"), assignMergeValue = __webpack_require__("./node_modules/lodash/_assignMergeValue.js"), baseFor = __webpack_require__("./node_modules/lodash/_baseFor.js"), baseMergeDeep = __webpack_require__("./node_modules/lodash/_baseMergeDeep.js"), isObject = __webpack_require__("./node_modules/lodash/isObject.js"), keysIn = __webpack_require__("./node_modules/lodash/keysIn.js"), safeGet = __webpack_require__("./node_modules/lodash/_safeGet.js"); /** * The base implementation of `_.merge` without support for multiple sources. * * @private * @param {Object} object The destination object. * @param {Object} source The source object. * @param {number} srcIndex The index of `source`. * @param {Function} [customizer] The function to customize merged values. * @param {Object} [stack] Tracks traversed source values and their merged * counterparts. */ function baseMerge(object, source, srcIndex, customizer, stack) { if (object === source) { return; } baseFor(source, function(srcValue, key) { stack || (stack = new Stack); if (isObject(srcValue)) { baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack); } else { var newValue = customizer ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack) : undefined; if (newValue === undefined) { newValue = srcValue; } assignMergeValue(object, key, newValue); } }, keysIn); } module.exports = baseMerge; /***/ }), /***/ "./node_modules/lodash/_baseMergeDeep.js": /***/ (function(module, exports, __webpack_require__) { var assignMergeValue = __webpack_require__("./node_modules/lodash/_assignMergeValue.js"), cloneBuffer = __webpack_require__("./node_modules/lodash/_cloneBuffer.js"), cloneTypedArray = __webpack_require__("./node_modules/lodash/_cloneTypedArray.js"), copyArray = __webpack_require__("./node_modules/lodash/_copyArray.js"), initCloneObject = __webpack_require__("./node_modules/lodash/_initCloneObject.js"), isArguments = __webpack_require__("./node_modules/lodash/isArguments.js"), isArray = __webpack_require__("./node_modules/lodash/isArray.js"), isArrayLikeObject = __webpack_require__("./node_modules/lodash/isArrayLikeObject.js"), isBuffer = __webpack_require__("./node_modules/lodash/isBuffer.js"), isFunction = __webpack_require__("./node_modules/lodash/isFunction.js"), isObject = __webpack_require__("./node_modules/lodash/isObject.js"), isPlainObject = __webpack_require__("./node_modules/lodash/isPlainObject.js"), isTypedArray = __webpack_require__("./node_modules/lodash/isTypedArray.js"), safeGet = __webpack_require__("./node_modules/lodash/_safeGet.js"), toPlainObject = __webpack_require__("./node_modules/lodash/toPlainObject.js"); /** * A specialized version of `baseMerge` for arrays and objects which performs * deep merges and tracks traversed objects enabling objects with circular * references to be merged. * * @private * @param {Object} object The destination object. * @param {Object} source The source object. * @param {string} key The key of the value to merge. * @param {number} srcIndex The index of `source`. * @param {Function} mergeFunc The function to merge values. * @param {Function} [customizer] The function to customize assigned values. * @param {Object} [stack] Tracks traversed source values and their merged * counterparts. */ function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) { var objValue = safeGet(object, key), srcValue = safeGet(source, key), stacked = stack.get(srcValue); if (stacked) { assignMergeValue(object, key, stacked); return; } var newValue = customizer ? customizer(objValue, srcValue, (key + ''), object, source, stack) : undefined; var isCommon = newValue === undefined; if (isCommon) { var isArr = isArray(srcValue), isBuff = !isArr && isBuffer(srcValue), isTyped = !isArr && !isBuff && isTypedArray(srcValue); newValue = srcValue; if (isArr || isBuff || isTyped) { if (isArray(objValue)) { newValue = objValue; } else if (isArrayLikeObject(objValue)) { newValue = copyArray(objValue); } else if (isBuff) { isCommon = false; newValue = cloneBuffer(srcValue, true); } else if (isTyped) { isCommon = false; newValue = cloneTypedArray(srcValue, true); } else { newValue = []; } } else if (isPlainObject(srcValue) || isArguments(srcValue)) { newValue = objValue; if (isArguments(objValue)) { newValue = toPlainObject(objValue); } else if (!isObject(objValue) || isFunction(objValue)) { newValue = initCloneObject(srcValue); } } else { isCommon = false; } } if (isCommon) { // Recursively merge objects and arrays (susceptible to call stack limits). stack.set(srcValue, newValue); mergeFunc(newValue, srcValue, srcIndex, customizer, stack); stack['delete'](srcValue); } assignMergeValue(object, key, newValue); } module.exports = baseMergeDeep; /***/ }), /***/ "./node_modules/lodash/_baseOrderBy.js": /***/ (function(module, exports, __webpack_require__) { var arrayMap = __webpack_require__("./node_modules/lodash/_arrayMap.js"), baseGet = __webpack_require__("./node_modules/lodash/_baseGet.js"), baseIteratee = __webpack_require__("./node_modules/lodash/_baseIteratee.js"), baseMap = __webpack_require__("./node_modules/lodash/_baseMap.js"), baseSortBy = __webpack_require__("./node_modules/lodash/_baseSortBy.js"), baseUnary = __webpack_require__("./node_modules/lodash/_baseUnary.js"), compareMultiple = __webpack_require__("./node_modules/lodash/_compareMultiple.js"), identity = __webpack_require__("./node_modules/lodash/identity.js"), isArray = __webpack_require__("./node_modules/lodash/isArray.js"); /** * The base implementation of `_.orderBy` without param guards. * * @private * @param {Array|Object} collection The collection to iterate over. * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by. * @param {string[]} orders The sort orders of `iteratees`. * @returns {Array} Returns the new sorted array. */ function baseOrderBy(collection, iteratees, orders) { if (iteratees.length) { iteratees = arrayMap(iteratees, function(iteratee) { if (isArray(iteratee)) { return function(value) { return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee); } } return iteratee; }); } else { iteratees = [identity]; } var index = -1; iteratees = arrayMap(iteratees, baseUnary(baseIteratee)); var result = baseMap(collection, function(value, key, collection) { var criteria = arrayMap(iteratees, function(iteratee) { return iteratee(value); }); return { 'criteria': criteria, 'index': ++index, 'value': value }; }); return baseSortBy(result, function(object, other) { return compareMultiple(object, other, orders); }); } module.exports = baseOrderBy; /***/ }), /***/ "./node_modules/lodash/_baseRest.js": /***/ (function(module, exports, __webpack_require__) { var identity = __webpack_require__("./node_modules/lodash/identity.js"), overRest = __webpack_require__("./node_modules/lodash/_overRest.js"), setToString = __webpack_require__("./node_modules/lodash/_setToString.js"); /** * The base implementation of `_.rest` which doesn't validate or coerce arguments. * * @private * @param {Function} func The function to apply a rest parameter to. * @param {number} [start=func.length-1] The start position of the rest parameter. * @returns {Function} Returns the new function. */ function baseRest(func, start) { return setToString(overRest(func, start, identity), func + ''); } module.exports = baseRest; /***/ }), /***/ "./node_modules/lodash/_baseSortBy.js": /***/ (function(module, exports) { /** * The base implementation of `_.sortBy` which uses `comparer` to define the * sort order of `array` and replaces criteria objects with their corresponding * values. * * @private * @param {Array} array The array to sort. * @param {Function} comparer The function to define sort order. * @returns {Array} Returns `array`. */ function baseSortBy(array, comparer) { var length = array.length; array.sort(comparer); while (length--) { array[length] = array[length].value; } return array; } module.exports = baseSortBy; /***/ }), /***/ "./node_modules/lodash/_baseSum.js": /***/ (function(module, exports) { /** * The base implementation of `_.sum` and `_.sumBy` without support for * iteratee shorthands. * * @private * @param {Array} array The array to iterate over. * @param {Function} iteratee The function invoked per iteration. * @returns {number} Returns the sum. */ function baseSum(array, iteratee) { var result, index = -1, length = array.length; while (++index < length) { var current = iteratee(array[index]); if (current !== undefined) { result = result === undefined ? current : (result + current); } } return result; } module.exports = baseSum; /***/ }), /***/ "./node_modules/lodash/_baseUnary.js": /***/ (function(module, exports) { /** * The base implementation of `_.unary` without support for storing metadata. * * @private * @param {Function} func The function to cap arguments for. * @returns {Function} Returns the new capped function. */ function baseUnary(func) { return function(value) { return func(value); }; } module.exports = baseUnary; /***/ }), /***/ "./node_modules/lodash/_baseUniq.js": /***/ (function(module, exports, __webpack_require__) { var SetCache = __webpack_require__("./node_modules/lodash/_SetCache.js"), arrayIncludes = __webpack_require__("./node_modules/lodash/_arrayIncludes.js"), arrayIncludesWith = __webpack_require__("./node_modules/lodash/_arrayIncludesWith.js"), cacheHas = __webpack_require__("./node_modules/lodash/_cacheHas.js"), createSet = __webpack_require__("./node_modules/lodash/_createSet.js"), setToArray = __webpack_require__("./node_modules/lodash/_setToArray.js"); /** Used as the size to enable large array optimizations. */ var LARGE_ARRAY_SIZE = 200; /** * The base implementation of `_.uniqBy` without support for iteratee shorthands. * * @private * @param {Array} array The array to inspect. * @param {Function} [iteratee] The iteratee invoked per element. * @param {Function} [comparator] The comparator invoked per element. * @returns {Array} Returns the new duplicate free array. */ function baseUniq(array, iteratee, comparator) { var index = -1, includes = arrayIncludes, length = array.length, isCommon = true, result = [], seen = result; if (comparator) { isCommon = false; includes = arrayIncludesWith; } else if (length >= LARGE_ARRAY_SIZE) { var set = iteratee ? null : createSet(array); if (set) { return setToArray(set); } isCommon = false; includes = cacheHas; seen = new SetCache; } else { seen = iteratee ? [] : result; } outer: while (++index < length) { var value = array[index], computed = iteratee ? iteratee(value) : value; value = (comparator || value !== 0) ? value : 0; if (isCommon && computed === computed) { var seenIndex = seen.length; while (seenIndex--) { if (seen[seenIndex] === computed) { continue outer; } } if (iteratee) { seen.push(computed); } result.push(value); } else if (!includes(seen, computed, comparator)) { if (seen !== result) { seen.push(computed); } result.push(value); } } return result; } module.exports = baseUniq; /***/ }), /***/ "./node_modules/lodash/_cacheHas.js": /***/ (function(module, exports, __webpack_require__) { var baseIndexOf = __webpack_require__("./node_modules/lodash/_baseIndexOf.js"); /** * A specialized version of `_.includes` for arrays without support for * specifying an index to search from. * * @private * @param {Array} [array] The array to inspect. * @param {*} target The value to search for. * @returns {boolean} Returns `true` if `target` is found, else `false`. */ function arrayIncludes(array, value) { var length = array == null ? 0 : array.length; return !!length && baseIndexOf(array, value, 0) > -1; } module.exports = arrayIncludes; /***/ }), /***/ "./node_modules/lodash/_cloneArrayBuffer.js": /***/ (function(module, exports, __webpack_require__) { var Uint8Array = __webpack_require__("./node_modules/lodash/_Uint8Array.js"); /** * Creates a clone of `arrayBuffer`. * * @private * @param {ArrayBuffer} arrayBuffer The array buffer to clone. * @returns {ArrayBuffer} Returns the cloned array buffer. */ function cloneArrayBuffer(arrayBuffer) { var result = new arrayBuffer.constructor(arrayBuffer.byteLength); new Uint8Array(result).set(new Uint8Array(arrayBuffer)); return result; } module.exports = cloneArrayBuffer; /***/ }), /***/ "./node_modules/lodash/_cloneBuffer.js": /***/ (function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(module) {var root = __webpack_require__("./node_modules/lodash/_root.js"); /** Detect free variable `exports`. */ var freeExports = true && exports && !exports.nodeType && exports; /** Detect free variable `module`. */ var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module; /** Detect the popular CommonJS extension `module.exports`. */ var moduleExports = freeModule && freeModule.exports === freeExports; /** Built-in value references. */ var Buffer = moduleExports ? root.Buffer : undefined, allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined; /** * Creates a clone of `buffer`. * * @private * @param {Buffer} buffer The buffer to clone. * @param {boolean} [isDeep] Specify a deep clone. * @returns {Buffer} Returns the cloned buffer. */ function cloneBuffer(buffer, isDeep) { if (isDeep) { return buffer.slice(); } var length = buffer.length, result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length); buffer.copy(result); return result; } module.exports = cloneBuffer; /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("./node_modules/webpack/buildin/module.js")(module))) /***/ }), /***/ "./node_modules/lodash/_cloneTypedArray.js": /***/ (function(module, exports, __webpack_require__) { var cloneArrayBuffer = __webpack_require__("./node_modules/lodash/_cloneArrayBuffer.js"); /** * Creates a clone of `typedArray`. * * @private * @param {Object} typedArray The typed array to clone. * @param {boolean} [isDeep] Specify a deep clone. * @returns {Object} Returns the cloned typed array. */ function cloneTypedArray(typedArray, isDeep) { var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer; return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length); } module.exports = cloneTypedArray; /***/ }), /***/ "./node_modules/lodash/_compareAscending.js": /***/ (function(module, exports, __webpack_require__) { var isSymbol = __webpack_require__("./node_modules/lodash/isSymbol.js"); /** * Compares values to sort them in ascending order. * * @private * @param {*} value The value to compare. * @param {*} other The other value to compare. * @returns {number} Returns the sort order indicator for `value`. */ function compareAscending(value, other) { if (value !== other) { var valIsDefined = value !== undefined, valIsNull = value === null, valIsReflexive = value === value, valIsSymbol = isSymbol(value); var othIsDefined = other !== undefined, othIsNull = other === null, othIsReflexive = other === other, othIsSymbol = isSymbol(other); if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) || (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) || (valIsNull && othIsDefined && othIsReflexive) || (!valIsDefined && othIsReflexive) || !valIsReflexive) { return 1; } if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) || (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) || (othIsNull && valIsDefined && valIsReflexive) || (!othIsDefined && valIsReflexive) || !othIsReflexive) { return -1; } } return 0; } module.exports = compareAscending; /***/ }), /***/ "./node_modules/lodash/_compareMultiple.js": /***/ (function(module, exports, __webpack_require__) { var compareAscending = __webpack_require__("./node_modules/lodash/_compareAscending.js"); /** * Used by `_.orderBy` to compare multiple properties of a value to another * and stable sort them. * * If `orders` is unspecified, all values are sorted in ascending order. Otherwise, * specify an order of "desc" for descending or "asc" for ascending sort order * of corresponding values. * * @private * @param {Object} object The object to compare. * @param {Object} other The other object to compare. * @param {boolean[]|string[]} orders The order to sort by for each property. * @returns {number} Returns the sort order indicator for `object`. */ function compareMultiple(object, other, orders) { var index = -1, objCriteria = object.criteria, othCriteria = other.criteria, length = objCriteria.length, ordersLength = orders.length; while (++index < length) { var result = compareAscending(objCriteria[index], othCriteria[index]); if (result) { if (index >= ordersLength) { return result; } var order = orders[index]; return result * (order == 'desc' ? -1 : 1); } } // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications // that causes it, under certain circumstances, to provide the same value for // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247 // for more details. // // This also ensures a stable sort in V8 and other engines. // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details. return object.index - other.index; } module.exports = compareMultiple; /***/ }), /***/ "./node_modules/lodash/_copyArray.js": /***/ (function(module, exports) { /** * Copies the values of `source` to `array`. * * @private * @param {Array} source The array to copy values from. * @param {Array} [array=[]] The array to copy values to. * @returns {Array} Returns `array`. */ function copyArray(source, array) { var index = -1, length = source.length; array || (array = Array(length)); while (++index < length) { array[index] = source[index]; } return array; } module.exports = copyArray; /***/ }), /***/ "./node_modules/lodash/_copyObject.js": /***/ (function(module, exports, __webpack_require__) { var assignValue = __webpack_require__("./node_modules/lodash/_assignValue.js"), baseAssignValue = __webpack_require__("./node_modules/lodash/_baseAssignValue.js"); /** * Copies properties of `source` to `object`. * * @private * @param {Object} source The object to copy properties from. * @param {Array} props The property identifiers to copy. * @param {Object} [object={}] The object to copy properties to. * @param {Function} [customizer] The function to customize copied values. * @returns {Object} Returns `object`. */ function copyObject(source, props, object, customizer) { var isNew = !object; object || (object = {}); var index = -1, length = props.length; while (++index < length) { var key = props[index]; var newValue = customizer ? customizer(object[key], source[key], key, object, source) : undefined; if (newValue === undefined) { newValue = source[key]; } if (isNew) { baseAssignValue(object, key, newValue); } else { assignValue(object, key, newValue); } } return object; } module.exports = copyObject; /***/ }), /***/ "./node_modules/lodash/_createAssigner.js": /***/ (function(module, exports, __webpack_require__) { var baseRest = __webpack_require__("./node_modules/lodash/_baseRest.js"), isIterateeCall = __webpack_require__("./node_modules/lodash/_isIterateeCall.js"); /** * Creates a function like `_.assign`. * * @private * @param {Function} assigner The function to assign values. * @returns {Function} Returns the new assigner function. */ function createAssigner(assigner) { return baseRest(function(object, sources) { var index = -1, length = sources.length, customizer = length > 1 ? sources[length - 1] : undefined, guard = length > 2 ? sources[2] : undefined; customizer = (assigner.length > 3 && typeof customizer == 'function') ? (length--, customizer) : undefined; if (guard && isIterateeCall(sources[0], sources[1], guard)) { customizer = length < 3 ? undefined : customizer; length = 1; } object = Object(object); while (++index < length) { var source = sources[index]; if (source) { assigner(object, source, index, customizer); } } return object; }); } module.exports = createAssigner; /***/ }), /***/ "./node_modules/lodash/_createBaseEach.js": /***/ (function(module, exports, __webpack_require__) { var isArrayLike = __webpack_require__("./node_modules/lodash/isArrayLike.js"); /** * Creates a `baseEach` or `baseEachRight` function. * * @private * @param {Function} eachFunc The function to iterate over a collection. * @param {boolean} [fromRight] Specify iterating from right to left. * @returns {Function} Returns the new base function. */ function createBaseEach(eachFunc, fromRight) { return function(collection, iteratee) { if (collection == null) { return collection; } if (!isArrayLike(collection)) { return eachFunc(collection, iteratee); } var length = collection.length, index = fromRight ? length : -1, iterable = Object(collection); while ((fromRight ? index-- : ++index < length)) { if (iteratee(iterable[index], index, iterable) === false) { break; } } return collection; }; } module.exports = createBaseEach; /***/ }), /***/ "./node_modules/lodash/_createBaseFor.js": /***/ (function(module, exports) { /** * Creates a base function for methods like `_.forIn` and `_.forOwn`. * * @private * @param {boolean} [fromRight] Specify iterating from right to left. * @returns {Function} Returns the new base function. */ function createBaseFor(fromRight) { return function(object, iteratee, keysFunc) { var index = -1, iterable = Object(object), props = keysFunc(object), length = props.length; while (length--) { var key = props[fromRight ? length : ++index]; if (iteratee(iterable[key], key, iterable) === false) { break; } } return object; }; } module.exports = createBaseFor; /***/ }), /***/ "./node_modules/lodash/_createSet.js": /***/ (function(module, exports) { /** * This method returns `undefined`. * * @static * @memberOf _ * @since 2.3.0 * @category Util * @example * * _.times(2, _.noop); * // => [undefined, undefined] */ function noop() { // No operation performed. } module.exports = noop; /***/ }), /***/ "./node_modules/lodash/_defineProperty.js": /***/ (function(module, exports, __webpack_require__) { var getNative = __webpack_require__("./node_modules/lodash/_getNative.js"); var defineProperty = (function() { try { var func = getNative(Object, 'defineProperty'); func({}, '', {}); return func; } catch (e) {} }()); module.exports = defineProperty; /***/ }), /***/ "./node_modules/lodash/_equalArrays.js": /***/ (function(module, exports, __webpack_require__) { var SetCache = __webpack_require__("./node_modules/lodash/_SetCache.js"), arraySome = __webpack_require__("./node_modules/lodash/_arraySome.js"), cacheHas = __webpack_require__("./node_modules/lodash/_cacheHas.js"); /** Used to compose bitmasks for value comparisons. */ var COMPARE_PARTIAL_FLAG = 1, COMPARE_UNORDERED_FLAG = 2; /** * A specialized version of `baseIsEqualDeep` for arrays with support for * partial deep comparisons. * * @private * @param {Array} array The array to compare. * @param {Array} other The other array to compare. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. * @param {Function} customizer The function to customize comparisons. * @param {Function} equalFunc The function to determine equivalents of values. * @param {Object} stack Tracks traversed `array` and `other` objects. * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`. */ function equalArrays(array, other, bitmask, customizer, equalFunc, stack) { var isPartial = bitmask & COMPARE_PARTIAL_FLAG, arrLength = array.length, othLength = other.length; if (arrLength != othLength && !(isPartial && othLength > arrLength)) { return false; } // Check that cyclic values are equal. var arrStacked = stack.get(array); var othStacked = stack.get(other); if (arrStacked && othStacked) { return arrStacked == other && othStacked == array; } var index = -1, result = true, seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined; stack.set(array, other); stack.set(other, array); // Ignore non-index properties. while (++index < arrLength) { var arrValue = array[index], othValue = other[index]; if (customizer) { var compared = isPartial ? customizer(othValue, arrValue, index, other, array, stack) : customizer(arrValue, othValue, index, array, other, stack); } if (compared !== undefined) { if (compared) { continue; } result = false; break; } // Recursively compare arrays (susceptible to call stack limits). if (seen) { if (!arraySome(other, function(othValue, othIndex) { if (!cacheHas(seen, othIndex) && (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) { return seen.push(othIndex); } })) { result = false; break; } } else if (!( arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack) )) { result = false; break; } } stack['delete'](array); stack['delete'](other); return result; } module.exports = equalArrays; /***/ }), /***/ "./node_modules/lodash/_equalByTag.js": /***/ (function(module, exports) { /** * Performs a * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * comparison between two values to determine if they are equivalent. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to compare. * @param {*} other The other value to compare. * @returns {boolean} Returns `true` if the values are equivalent, else `false`. * @example * * var object = { 'a': 1 }; * var other = { 'a': 1 }; * * _.eq(object, object); * // => true * * _.eq(object, other); * // => false * * _.eq('a', 'a'); * // => true * * _.eq('a', Object('a')); * // => false * * _.eq(NaN, NaN); * // => true */ function eq(value, other) { return value === other || (value !== value && other !== other); } module.exports = eq; /***/ }), /***/ "./node_modules/lodash/_equalObjects.js": /***/ (function(module, exports, __webpack_require__) { var getAllKeys = __webpack_require__("./node_modules/lodash/_getAllKeys.js"); /** Used to compose bitmasks for value comparisons. */ var COMPARE_PARTIAL_FLAG = 1; /** Used for built-in method references. */ var objectProto = Object.prototype; /** Used to check objects for own properties. */ var hasOwnProperty = objectProto.hasOwnProperty; /** * A specialized version of `baseIsEqualDeep` for objects with support for * partial deep comparisons. * * @private * @param {Object} object The object to compare. * @param {Object} other The other object to compare. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. * @param {Function} customizer The function to customize comparisons. * @param {Function} equalFunc The function to determine equivalents of values. * @param {Object} stack Tracks traversed `object` and `other` objects. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. */ function equalObjects(object, other, bitmask, customizer, equalFunc, stack) { var isPartial = bitmask & COMPARE_PARTIAL_FLAG, objProps = getAllKeys(object), objLength = objProps.length, othProps = getAllKeys(other), othLength = othProps.length; if (objLength != othLength && !isPartial) { return false; } var index = objLength; while (index--) { var key = objProps[index]; if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) { return false; } } // Check that cyclic values are equal. var objStacked = stack.get(object); var othStacked = stack.get(other); if (objStacked && othStacked) { return objStacked == other && othStacked == object; } var result = true; stack.set(object, other); stack.set(other, object); var skipCtor = isPartial; while (++index < objLength) { key = objProps[index]; var objValue = object[key], othValue = other[key]; if (customizer) { var compared = isPartial ? customizer(othValue, objValue, key, other, object, stack) : customizer(objValue, othValue, key, object, other, stack); } // Recursively compare objects (susceptible to call stack limits). if (!(compared === undefined ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack)) : compared )) { result = false; break; } skipCtor || (skipCtor = key == 'constructor'); } if (result && !skipCtor) { var objCtor = object.constructor, othCtor = other.constructor; // Non `Object` object instances with different constructors are not equal. if (objCtor != othCtor && ('constructor' in object && 'constructor' in other) && !(typeof objCtor == 'function' && objCtor instanceof objCtor && typeof othCtor == 'function' && othCtor instanceof othCtor)) { result = false; } } stack['delete'](object); stack['delete'](other); return result; } module.exports = equalObjects; /***/ }), /***/ "./node_modules/lodash/_freeGlobal.js": /***/ (function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(global) {/** Detect free variable `global` from Node.js. */ var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; module.exports = freeGlobal; /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("./node_modules/webpack/buildin/global.js"))) /***/ }), /***/ "./node_modules/lodash/_getAllKeys.js": /***/ (function(module, exports, __webpack_require__) { var overArg = __webpack_require__("./node_modules/lodash/_overArg.js"); /* Built-in method references for those with the same name as other `lodash` methods. */ var nativeKeys = overArg(Object.keys, Object); module.exports = nativeKeys; /***/ }), /***/ "./node_modules/lodash/_getMatchData.js": /***/ (function(module, exports, __webpack_require__) { var isStrictComparable = __webpack_require__("./node_modules/lodash/_isStrictComparable.js"), keys = __webpack_require__("./node_modules/lodash/keys.js"); /** * Gets the property names, values, and compare flags of `object`. * * @private * @param {Object} object The object to query. * @returns {Array} Returns the match data of `object`. */ function getMatchData(object) { var result = keys(object), length = result.length; while (length--) { var key = result[length], value = object[key]; result[length] = [key, value, isStrictComparable(value)]; } return result; } module.exports = getMatchData; /***/ }), /***/ "./node_modules/lodash/_getNative.js": /***/ (function(module, exports) { /** * Gets the value at `key` of `object`. * * @private * @param {Object} [object] The object to query. * @param {string} key The key of the property to get. * @returns {*} Returns the property value. */ function getValue(object, key) { return object == null ? undefined : object[key]; } module.exports = getValue; /***/ }), /***/ "./node_modules/lodash/_getPrototype.js": /***/ (function(module, exports, __webpack_require__) { var overArg = __webpack_require__("./node_modules/lodash/_overArg.js"); /** Built-in value references. */ var getPrototype = overArg(Object.getPrototypeOf, Object); module.exports = getPrototype; /***/ }), /***/ "./node_modules/lodash/_getTag.js": /***/ (function(module, exports) { /** Used for built-in method references. */ var objectProto = Object.prototype; /** * Used to resolve the * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) * of values. */ var nativeObjectToString = objectProto.toString; /** * Converts `value` to a string using `Object.prototype.toString`. * * @private * @param {*} value The value to convert. * @returns {string} Returns the converted string. */ function objectToString(value) { return nativeObjectToString.call(value); } module.exports = objectToString; /***/ }), /***/ "./node_modules/lodash/_initCloneObject.js": /***/ (function(module, exports, __webpack_require__) { var baseCreate = __webpack_require__("./node_modules/lodash/_baseCreate.js"), getPrototype = __webpack_require__("./node_modules/lodash/_getPrototype.js"), isPrototype = __webpack_require__("./node_modules/lodash/_isPrototype.js"); /** * Initializes an object clone. * * @private * @param {Object} object The object to clone. * @returns {Object} Returns the initialized clone. */ function initCloneObject(object) { return (typeof object.constructor == 'function' && !isPrototype(object)) ? baseCreate(getPrototype(object)) : {}; } module.exports = initCloneObject; /***/ }), /***/ "./node_modules/lodash/_isIterateeCall.js": /***/ (function(module, exports) { /** * This method returns `false`. * * @static * @memberOf _ * @since 4.13.0 * @category Util * @returns {boolean} Returns `false`. * @example * * _.times(2, _.stubFalse); * // => [false, false] */ function stubFalse() { return false; } module.exports = stubFalse; /***/ }), /***/ "./node_modules/lodash/_isKey.js": /***/ (function(module, exports) { /** * This method returns the first argument it receives. * * @static * @since 0.1.0 * @memberOf _ * @category Util * @param {*} value Any value. * @returns {*} Returns `value`. * @example * * var object = { 'a': 1 }; * * console.log(_.identity(object) === object); * // => true */ function identity(value) { return value; } module.exports = identity; /***/ }), /***/ "./node_modules/lodash/_isPrototype.js": /***/ (function(module, exports) { /** * This method returns `false`. * * @static * @memberOf _ * @since 4.13.0 * @category Util * @returns {boolean} Returns `false`. * @example * * _.times(2, _.stubFalse); * // => [false, false] */ function stubFalse() { return false; } module.exports = stubFalse; /***/ }), /***/ "./node_modules/lodash/_isStrictComparable.js": /***/ (function(module, exports, __webpack_require__) { var isObject = __webpack_require__("./node_modules/lodash/isObject.js"); /** * Checks if `value` is suitable for strict equality comparisons, i.e. `===`. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` if suitable for strict * equality comparisons, else `false`. */ function isStrictComparable(value) { return value === value && !isObject(value); } module.exports = isStrictComparable; /***/ }), /***/ "./node_modules/lodash/_listCacheClear.js": /***/ (function(module, exports) { /** * Removes all key-value entries from the list cache. * * @private * @name clear * @memberOf ListCache */ function listCacheClear() { this.__data__ = []; this.size = 0; } module.exports = listCacheClear; /***/ }), /***/ "./node_modules/lodash/_listCacheDelete.js": /***/ (function(module, exports, __webpack_require__) { var assocIndexOf = __webpack_require__("./node_modules/lodash/_assocIndexOf.js"); /** Used for built-in method references. */ var arrayProto = Array.prototype; /** Built-in value references. */ var splice = arrayProto.splice; /** * Removes `key` and its value from the list cache. * * @private * @name delete * @memberOf ListCache * @param {string} key The key of the value to remove. * @returns {boolean} Returns `true` if the entry was removed, else `false`. */ function listCacheDelete(key) { var data = this.__data__, index = assocIndexOf(data, key); if (index < 0) { return false; } var lastIndex = data.length - 1; if (index == lastIndex) { data.pop(); } else { splice.call(data, index, 1); } --this.size; return true; } module.exports = listCacheDelete; /***/ }), /***/ "./node_modules/lodash/_listCacheGet.js": /***/ (function(module, exports, __webpack_require__) { var assocIndexOf = __webpack_require__("./node_modules/lodash/_assocIndexOf.js"); /** * Gets the list cache value for `key`. * * @private * @name get * @memberOf ListCache * @param {string} key The key of the value to get. * @returns {*} Returns the entry value. */ function listCacheGet(key) { var data = this.__data__, index = assocIndexOf(data, key); return index < 0 ? undefined : data[index][1]; } module.exports = listCacheGet; /***/ }), /***/ "./node_modules/lodash/_listCacheHas.js": /***/ (function(module, exports, __webpack_require__) { var assocIndexOf = __webpack_require__("./node_modules/lodash/_assocIndexOf.js"); /** * Checks if a list cache value for `key` exists. * * @private * @name has * @memberOf ListCache * @param {string} key The key of the entry to check. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. */ function listCacheHas(key) { return assocIndexOf(this.__data__, key) > -1; } module.exports = listCacheHas; /***/ }), /***/ "./node_modules/lodash/_listCacheSet.js": /***/ (function(module, exports, __webpack_require__) { var assocIndexOf = __webpack_require__("./node_modules/lodash/_assocIndexOf.js"); /** * Sets the list cache `key` to `value`. * * @private * @name set * @memberOf ListCache * @param {string} key The key of the value to set. * @param {*} value The value to set. * @returns {Object} Returns the list cache instance. */ function listCacheSet(key, value) { var data = this.__data__, index = assocIndexOf(data, key); if (index < 0) { ++this.size; data.push([key, value]); } else { data[index][1] = value; } return this; } module.exports = listCacheSet; /***/ }), /***/ "./node_modules/lodash/_matchesStrictComparable.js": /***/ (function(module, exports) { /** * A specialized version of `matchesProperty` for source values suitable * for strict equality comparisons, i.e. `===`. * * @private * @param {string} key The key of the property to get. * @param {*} srcValue The value to match. * @returns {Function} Returns the new spec function. */ function matchesStrictComparable(key, srcValue) { return function(object) { if (object == null) { return false; } return object[key] === srcValue && (srcValue !== undefined || (key in Object(object))); }; } module.exports = matchesStrictComparable; /***/ }), /***/ "./node_modules/lodash/_overArg.js": /***/ (function(module, exports) { /** * Creates a unary function that invokes `func` with its argument transformed. * * @private * @param {Function} func The function to wrap. * @param {Function} transform The argument transform. * @returns {Function} Returns the new function. */ function overArg(func, transform) { return function(arg) { return func(transform(arg)); }; } module.exports = overArg; /***/ }), /***/ "./node_modules/lodash/_overRest.js": /***/ (function(module, exports, __webpack_require__) { var apply = __webpack_require__("./node_modules/lodash/_apply.js"); /* Built-in method references for those with the same name as other `lodash` methods. */ var nativeMax = Math.max; /** * A specialized version of `baseRest` which transforms the rest array. * * @private * @param {Function} func The function to apply a rest parameter to. * @param {number} [start=func.length-1] The start position of the rest parameter. * @param {Function} transform The rest array transform. * @returns {Function} Returns the new function. */ function overRest(func, start, transform) { start = nativeMax(start === undefined ? (func.length - 1) : start, 0); return function() { var args = arguments, index = -1, length = nativeMax(args.length - start, 0), array = Array(length); while (++index < length) { array[index] = args[start + index]; } index = -1; var otherArgs = Array(start + 1); while (++index < start) { otherArgs[index] = args[index]; } otherArgs[start] = transform(array); return apply(func, this, otherArgs); }; } module.exports = overRest; /***/ }), /***/ "./node_modules/lodash/_root.js": /***/ (function(module, exports, __webpack_require__) { var freeGlobal = __webpack_require__("./node_modules/lodash/_freeGlobal.js"); /** Detect free variable `self`. */ var freeSelf = typeof self == 'object' && self && self.Object === Object && self; /** Used as a reference to the global object. */ var root = freeGlobal || freeSelf || Function('return this')(); module.exports = root; /***/ }), /***/ "./node_modules/lodash/_safeGet.js": /***/ (function(module, exports) { /** * Gets the value at `key`, unless `key` is "__proto__" or "constructor". * * @private * @param {Object} object The object to query. * @param {string} key The key of the property to get. * @returns {*} Returns the property value. */ function safeGet(object, key) { if (key === 'constructor' && typeof object[key] === 'function') { return; } if (key == '__proto__') { return; } return object[key]; } module.exports = safeGet; /***/ }), /***/ "./node_modules/lodash/_setToArray.js": /***/ (function(module, exports) { /** * This method returns a new empty array. * * @static * @memberOf _ * @since 4.13.0 * @category Util * @returns {Array} Returns the new empty array. * @example * * var arrays = _.times(2, _.stubArray); * * console.log(arrays); * // => [[], []] * * console.log(arrays[0] === arrays[1]); * // => false */ function stubArray() { return []; } module.exports = stubArray; /***/ }), /***/ "./node_modules/lodash/_setToString.js": /***/ (function(module, exports) { /** * This method returns the first argument it receives. * * @static * @since 0.1.0 * @memberOf _ * @category Util * @param {*} value Any value. * @returns {*} Returns `value`. * @example * * var object = { 'a': 1 }; * * console.log(_.identity(object) === object); * // => true */ function identity(value) { return value; } module.exports = identity; /***/ }), /***/ "./node_modules/lodash/_toKey.js": /***/ (function(module, exports) { /** * This method returns the first argument it receives. * * @static * @since 0.1.0 * @memberOf _ * @category Util * @param {*} value Any value. * @returns {*} Returns `value`. * @example * * var object = { 'a': 1 }; * * console.log(_.identity(object) === object); * // => true */ function identity(value) { return value; } module.exports = identity; /***/ }), /***/ "./node_modules/lodash/assignIn.js": /***/ (function(module, exports, __webpack_require__) { var copyObject = __webpack_require__("./node_modules/lodash/_copyObject.js"), createAssigner = __webpack_require__("./node_modules/lodash/_createAssigner.js"), keysIn = __webpack_require__("./node_modules/lodash/keysIn.js"); /** * This method is like `_.assign` except that it iterates over own and * inherited source properties. * * **Note:** This method mutates `object`. * * @static * @memberOf _ * @since 4.0.0 * @alias extend * @category Object * @param {Object} object The destination object. * @param {...Object} [sources] The source objects. * @returns {Object} Returns `object`. * @see _.assign * @example * * function Foo() { * this.a = 1; * } * * function Bar() { * this.c = 3; * } * * Foo.prototype.b = 2; * Bar.prototype.d = 4; * * _.assignIn({ 'a': 0 }, new Foo, new Bar); * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 } */ var assignIn = createAssigner(function(object, source) { copyObject(source, keysIn(source), object); }); module.exports = assignIn; /***/ }), /***/ "./node_modules/lodash/eq.js": /***/ (function(module, exports) { /** * Performs a * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * comparison between two values to determine if they are equivalent. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to compare. * @param {*} other The other value to compare. * @returns {boolean} Returns `true` if the values are equivalent, else `false`. * @example * * var object = { 'a': 1 }; * var other = { 'a': 1 }; * * _.eq(object, object); * // => true * * _.eq(object, other); * // => false * * _.eq('a', 'a'); * // => true * * _.eq('a', Object('a')); * // => false * * _.eq(NaN, NaN); * // => true */ function eq(value, other) { return value === other || (value !== value && other !== other); } module.exports = eq; /***/ }), /***/ "./node_modules/lodash/extend.js": /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__("./node_modules/lodash/assignIn.js"); /***/ }), /***/ "./node_modules/lodash/get.js": /***/ (function(module, exports, __webpack_require__) { var baseGet = __webpack_require__("./node_modules/lodash/_baseGet.js"); /** * Gets the value at `path` of `object`. If the resolved value is * `undefined`, the `defaultValue` is returned in its place. * * @static * @memberOf _ * @since 3.7.0 * @category Object * @param {Object} object The object to query. * @param {Array|string} path The path of the property to get. * @param {*} [defaultValue] The value returned for `undefined` resolved values. * @returns {*} Returns the resolved value. * @example * * var object = { 'a': [{ 'b': { 'c': 3 } }] }; * * _.get(object, 'a[0].b.c'); * // => 3 * * _.get(object, ['a', '0', 'b', 'c']); * // => 3 * * _.get(object, 'a.b.c', 'default'); * // => 'default' */ function get(object, path, defaultValue) { var result = object == null ? undefined : baseGet(object, path); return result === undefined ? defaultValue : result; } module.exports = get; /***/ }), /***/ "./node_modules/lodash/hasIn.js": /***/ (function(module, exports) { /** * The base implementation of `_.hasIn` without support for deep paths. * * @private * @param {Object} [object] The object to query. * @param {Array|string} key The key to check. * @returns {boolean} Returns `true` if `key` exists, else `false`. */ function baseHasIn(object, key) { return object != null && key in Object(object); } module.exports = baseHasIn; /***/ }), /***/ "./node_modules/lodash/identity.js": /***/ (function(module, exports) { /** * This method returns the first argument it receives. * * @static * @since 0.1.0 * @memberOf _ * @category Util * @param {*} value Any value. * @returns {*} Returns `value`. * @example * * var object = { 'a': 1 }; * * console.log(_.identity(object) === object); * // => true */ function identity(value) { return value; } module.exports = identity; /***/ }), /***/ "./node_modules/lodash/isArguments.js": /***/ (function(module, exports) { /** * This method returns `false`. * * @static * @memberOf _ * @since 4.13.0 * @category Util * @returns {boolean} Returns `false`. * @example * * _.times(2, _.stubFalse); * // => [false, false] */ function stubFalse() { return false; } module.exports = stubFalse; /***/ }), /***/ "./node_modules/lodash/isArray.js": /***/ (function(module, exports) { /** * Checks if `value` is classified as an `Array` object. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an array, else `false`. * @example * * _.isArray([1, 2, 3]); * // => true * * _.isArray(document.body.children); * // => false * * _.isArray('abc'); * // => false * * _.isArray(_.noop); * // => false */ var isArray = Array.isArray; module.exports = isArray; /***/ }), /***/ "./node_modules/lodash/isArrayLike.js": /***/ (function(module, exports, __webpack_require__) { var isFunction = __webpack_require__("./node_modules/lodash/isFunction.js"), isLength = __webpack_require__("./node_modules/lodash/isLength.js"); /** * Checks if `value` is array-like. A value is considered array-like if it's * not a function and has a `value.length` that's an integer greater than or * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is array-like, else `false`. * @example * * _.isArrayLike([1, 2, 3]); * // => true * * _.isArrayLike(document.body.children); * // => true * * _.isArrayLike('abc'); * // => true * * _.isArrayLike(_.noop); * // => false */ function isArrayLike(value) { return value != null && isLength(value.length) && !isFunction(value); } module.exports = isArrayLike; /***/ }), /***/ "./node_modules/lodash/isArrayLikeObject.js": /***/ (function(module, exports, __webpack_require__) { var isArrayLike = __webpack_require__("./node_modules/lodash/isArrayLike.js"), isObjectLike = __webpack_require__("./node_modules/lodash/isObjectLike.js"); /** * This method is like `_.isArrayLike` except that it also checks if `value` * is an object. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an array-like object, * else `false`. * @example * * _.isArrayLikeObject([1, 2, 3]); * // => true * * _.isArrayLikeObject(document.body.children); * // => true * * _.isArrayLikeObject('abc'); * // => false * * _.isArrayLikeObject(_.noop); * // => false */ function isArrayLikeObject(value) { return isObjectLike(value) && isArrayLike(value); } module.exports = isArrayLikeObject; /***/ }), /***/ "./node_modules/lodash/isBuffer.js": /***/ (function(module, exports) { /** * This method returns `false`. * * @static * @memberOf _ * @since 4.13.0 * @category Util * @returns {boolean} Returns `false`. * @example * * _.times(2, _.stubFalse); * // => [false, false] */ function stubFalse() { return false; } module.exports = stubFalse; /***/ }), /***/ "./node_modules/lodash/isEqual.js": /***/ (function(module, exports, __webpack_require__) { var baseIsEqual = __webpack_require__("./node_modules/lodash/_baseIsEqual.js"); /** * Performs a deep comparison between two values to determine if they are * equivalent. * * **Note:** This method supports comparing arrays, array buffers, booleans, * date objects, error objects, maps, numbers, `Object` objects, regexes, * sets, strings, symbols, and typed arrays. `Object` objects are compared * by their own, not inherited, enumerable properties. Functions and DOM * nodes are compared by strict equality, i.e. `===`. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to compare. * @param {*} other The other value to compare. * @returns {boolean} Returns `true` if the values are equivalent, else `false`. * @example * * var object = { 'a': 1 }; * var other = { 'a': 1 }; * * _.isEqual(object, other); * // => true * * object === other; * // => false */ function isEqual(value, other) { return baseIsEqual(value, other); } module.exports = isEqual; /***/ }), /***/ "./node_modules/lodash/isFunction.js": /***/ (function(module, exports, __webpack_require__) { var baseGetTag = __webpack_require__("./node_modules/lodash/_baseGetTag.js"), isObject = __webpack_require__("./node_modules/lodash/isObject.js"); /** `Object#toString` result references. */ var asyncTag = '[object AsyncFunction]', funcTag = '[object Function]', genTag = '[object GeneratorFunction]', proxyTag = '[object Proxy]'; /** * Checks if `value` is classified as a `Function` object. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a function, else `false`. * @example * * _.isFunction(_); * // => true * * _.isFunction(/abc/); * // => false */ function isFunction(value) { if (!isObject(value)) { return false; } // The use of `Object#toString` avoids issues with the `typeof` operator // in Safari 9 which returns 'object' for typed arrays and other constructors. var tag = baseGetTag(value); return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag; } module.exports = isFunction; /***/ }), /***/ "./node_modules/lodash/isLength.js": /***/ (function(module, exports) { /** Used as references for various `Number` constants. */ var MAX_SAFE_INTEGER = 9007199254740991; /** * Checks if `value` is a valid array-like length. * * **Note:** This method is loosely based on * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. * @example * * _.isLength(3); * // => true * * _.isLength(Number.MIN_VALUE); * // => false * * _.isLength(Infinity); * // => false * * _.isLength('3'); * // => false */ function isLength(value) { return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; } module.exports = isLength; /***/ }), /***/ "./node_modules/lodash/isObject.js": /***/ (function(module, exports) { /** * Checks if `value` is the * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an object, else `false`. * @example * * _.isObject({}); * // => true * * _.isObject([1, 2, 3]); * // => true * * _.isObject(_.noop); * // => true * * _.isObject(null); * // => false */ function isObject(value) { var type = typeof value; return value != null && (type == 'object' || type == 'function'); } module.exports = isObject; /***/ }), /***/ "./node_modules/lodash/isObjectLike.js": /***/ (function(module, exports) { /** * Checks if `value` is object-like. A value is object-like if it's not `null` * and has a `typeof` result of "object". * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is object-like, else `false`. * @example * * _.isObjectLike({}); * // => true * * _.isObjectLike([1, 2, 3]); * // => true * * _.isObjectLike(_.noop); * // => false * * _.isObjectLike(null); * // => false */ function isObjectLike(value) { return value != null && typeof value == 'object'; } module.exports = isObjectLike; /***/ }), /***/ "./node_modules/lodash/isPlainObject.js": /***/ (function(module, exports, __webpack_require__) { var baseGetTag = __webpack_require__("./node_modules/lodash/_baseGetTag.js"), getPrototype = __webpack_require__("./node_modules/lodash/_getPrototype.js"), isObjectLike = __webpack_require__("./node_modules/lodash/isObjectLike.js"); /** `Object#toString` result references. */ var objectTag = '[object Object]'; /** Used for built-in method references. */ var funcProto = Function.prototype, objectProto = Object.prototype; /** Used to resolve the decompiled source of functions. */ var funcToString = funcProto.toString; /** Used to check objects for own properties. */ var hasOwnProperty = objectProto.hasOwnProperty; /** Used to infer the `Object` constructor. */ var objectCtorString = funcToString.call(Object); /** * Checks if `value` is a plain object, that is, an object created by the * `Object` constructor or one with a `[[Prototype]]` of `null`. * * @static * @memberOf _ * @since 0.8.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a plain object, else `false`. * @example * * function Foo() { * this.a = 1; * } * * _.isPlainObject(new Foo); * // => false * * _.isPlainObject([1, 2, 3]); * // => false * * _.isPlainObject({ 'x': 0, 'y': 0 }); * // => true * * _.isPlainObject(Object.create(null)); * // => true */ function isPlainObject(value) { if (!isObjectLike(value) || baseGetTag(value) != objectTag) { return false; } var proto = getPrototype(value); if (proto === null) { return true; } var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor; return typeof Ctor == 'function' && Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString; } module.exports = isPlainObject; /***/ }), /***/ "./node_modules/lodash/isSymbol.js": /***/ (function(module, exports) { /** * This method returns `false`. * * @static * @memberOf _ * @since 4.13.0 * @category Util * @returns {boolean} Returns `false`. * @example * * _.times(2, _.stubFalse); * // => [false, false] */ function stubFalse() { return false; } module.exports = stubFalse; /***/ }), /***/ "./node_modules/lodash/isTypedArray.js": /***/ (function(module, exports) { /** * This method returns `false`. * * @static * @memberOf _ * @since 4.13.0 * @category Util * @returns {boolean} Returns `false`. * @example * * _.times(2, _.stubFalse); * // => [false, false] */ function stubFalse() { return false; } module.exports = stubFalse; /***/ }), /***/ "./node_modules/lodash/keys.js": /***/ (function(module, exports, __webpack_require__) { var overArg = __webpack_require__("./node_modules/lodash/_overArg.js"); /* Built-in method references for those with the same name as other `lodash` methods. */ var nativeKeys = overArg(Object.keys, Object); module.exports = nativeKeys; /***/ }), /***/ "./node_modules/lodash/keysIn.js": /***/ (function(module, exports) { /** * This function is like * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) * except that it includes inherited enumerable properties. * * @private * @param {Object} object The object to query. * @returns {Array} Returns the array of property names. */ function nativeKeysIn(object) { var result = []; if (object != null) { for (var key in Object(object)) { result.push(key); } } return result; } module.exports = nativeKeysIn; /***/ }), /***/ "./node_modules/lodash/lodash.js": /***/ (function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(global, module) {var __WEBPACK_AMD_DEFINE_RESULT__;/** * @license * Lodash * Copyright OpenJS Foundation and other contributors * Released under MIT license * Based on Underscore.js 1.8.3 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors */ ;(function() { /** Used as a safe reference for `undefined` in pre-ES5 environments. */ var undefined; /** Used as the semantic version number. */ var VERSION = '4.17.21'; /** Used as the size to enable large array optimizations. */ var LARGE_ARRAY_SIZE = 200; /** Error message constants. */ var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.', FUNC_ERROR_TEXT = 'Expected a function', INVALID_TEMPL_VAR_ERROR_TEXT = 'Invalid `variable` option passed into `_.template`'; /** Used to stand-in for `undefined` hash values. */ var HASH_UNDEFINED = '__lodash_hash_undefined__'; /** Used as the maximum memoize cache size. */ var MAX_MEMOIZE_SIZE = 500; /** Used as the internal argument placeholder. */ var PLACEHOLDER = '__lodash_placeholder__'; /** Used to compose bitmasks for cloning. */ var CLONE_DEEP_FLAG = 1, CLONE_FLAT_FLAG = 2, CLONE_SYMBOLS_FLAG = 4; /** Used to compose bitmasks for value comparisons. */ var COMPARE_PARTIAL_FLAG = 1, COMPARE_UNORDERED_FLAG = 2; /** Used to compose bitmasks for function metadata. */ var WRAP_BIND_FLAG = 1, WRAP_BIND_KEY_FLAG = 2, WRAP_CURRY_BOUND_FLAG = 4, WRAP_CURRY_FLAG = 8, WRAP_CURRY_RIGHT_FLAG = 16, WRAP_PARTIAL_FLAG = 32, WRAP_PARTIAL_RIGHT_FLAG = 64, WRAP_ARY_FLAG = 128, WRAP_REARG_FLAG = 256, WRAP_FLIP_FLAG = 512; /** Used as default options for `_.truncate`. */ var DEFAULT_TRUNC_LENGTH = 30, DEFAULT_TRUNC_OMISSION = '...'; /** Used to detect hot functions by number of calls within a span of milliseconds. */ var HOT_COUNT = 800, HOT_SPAN = 16; /** Used to indicate the type of lazy iteratees. */ var LAZY_FILTER_FLAG = 1, LAZY_MAP_FLAG = 2, LAZY_WHILE_FLAG = 3; /** Used as references for various `Number` constants. */ var INFINITY = 1 / 0, MAX_SAFE_INTEGER = 9007199254740991, MAX_INTEGER = 1.7976931348623157e+308, NAN = 0 / 0; /** Used as references for the maximum length and index of an array. */ var MAX_ARRAY_LENGTH = 4294967295, MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1, HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1; /** Used to associate wrap methods with their bit flags. */ var wrapFlags = [ ['ary', WRAP_ARY_FLAG], ['bind', WRAP_BIND_FLAG], ['bindKey', WRAP_BIND_KEY_FLAG], ['curry', WRAP_CURRY_FLAG], ['curryRight', WRAP_CURRY_RIGHT_FLAG], ['flip', WRAP_FLIP_FLAG], ['partial', WRAP_PARTIAL_FLAG], ['partialRight', WRAP_PARTIAL_RIGHT_FLAG], ['rearg', WRAP_REARG_FLAG] ]; /** `Object#toString` result references. */ var argsTag = '[object Arguments]', arrayTag = '[object Array]', asyncTag = '[object AsyncFunction]', boolTag = '[object Boolean]', dateTag = '[object Date]', domExcTag = '[object DOMException]', errorTag = '[object Error]', funcTag = '[object Function]', genTag = '[object GeneratorFunction]', mapTag = '[object Map]', numberTag = '[object Number]', nullTag = '[object Null]', objectTag = '[object Object]', promiseTag = '[object Promise]', proxyTag = '[object Proxy]', regexpTag = '[object RegExp]', setTag = '[object Set]', stringTag = '[object String]', symbolTag = '[object Symbol]', undefinedTag = '[object Undefined]', weakMapTag = '[object WeakMap]', weakSetTag = '[object WeakSet]'; var arrayBufferTag = '[object ArrayBuffer]', dataViewTag = '[object DataView]', float32Tag = '[object Float32Array]', float64Tag = '[object Float64Array]', int8Tag = '[object Int8Array]', int16Tag = '[object Int16Array]', int32Tag = '[object Int32Array]', uint8Tag = '[object Uint8Array]', uint8ClampedTag = '[object Uint8ClampedArray]', uint16Tag = '[object Uint16Array]', uint32Tag = '[object Uint32Array]'; /** Used to match empty string literals in compiled template source. */ var reEmptyStringLeading = /\b__p \+= '';/g, reEmptyStringMiddle = /\b(__p \+=) '' \+/g, reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g; /** Used to match HTML entities and HTML characters. */ var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g, reUnescapedHtml = /[&<>"']/g, reHasEscapedHtml = RegExp(reEscapedHtml.source), reHasUnescapedHtml = RegExp(reUnescapedHtml.source); /** Used to match template delimiters. */ var reEscape = /<%-([\s\S]+?)%>/g, reEvaluate = /<%([\s\S]+?)%>/g, reInterpolate = /<%=([\s\S]+?)%>/g; /** Used to match property names within property paths. */ var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, reIsPlainProp = /^\w*$/, rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; /** * Used to match `RegExp` * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). */ var reRegExpChar = /[\\^$.*+?()[\]{}|]/g, reHasRegExpChar = RegExp(reRegExpChar.source); /** Used to match leading whitespace. */ var reTrimStart = /^\s+/; /** Used to match a single whitespace character. */ var reWhitespace = /\s/; /** Used to match wrap detail comments. */ var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/, reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/, reSplitDetails = /,? & /; /** Used to match words composed of alphanumeric characters. */ var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g; /** * Used to validate the `validate` option in `_.template` variable. * * Forbids characters which could potentially change the meaning of the function argument definition: * - "()," (modification of function parameters) * - "=" (default value) * - "[]{}" (destructuring of function parameters) * - "/" (beginning of a comment) * - whitespace */ var reForbiddenIdentifierChars = /[()=,{}\[\]\/\s]/; /** Used to match backslashes in property paths. */ var reEscapeChar = /\\(\\)?/g; /** * Used to match * [ES template delimiters](http://ecma-international.org/ecma-262/7.0/#sec-template-literal-lexical-components). */ var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g; /** Used to match `RegExp` flags from their coerced string values. */ var reFlags = /\w*$/; /** Used to detect bad signed hexadecimal string values. */ var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; /** Used to detect binary string values. */ var reIsBinary = /^0b[01]+$/i; /** Used to detect host constructors (Safari). */ var reIsHostCtor = /^\[object .+?Constructor\]$/; /** Used to detect octal string values. */ var reIsOctal = /^0o[0-7]+$/i; /** Used to detect unsigned integer values. */ var reIsUint = /^(?:0|[1-9]\d*)$/; /** Used to match Latin Unicode letters (excluding mathematical operators). */ var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g; /** Used to ensure capturing order of template delimiters. */ var reNoMatch = /($^)/; /** Used to match unescaped characters in compiled string literals. */ var reUnescapedString = /['\n\r\u2028\u2029\\]/g; /** Used to compose unicode character classes. */ var rsAstralRange = '\\ud800-\\udfff', rsComboMarksRange = '\\u0300-\\u036f', reComboHalfMarksRange = '\\ufe20-\\ufe2f', rsComboSymbolsRange = '\\u20d0-\\u20ff', rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange, rsDingbatRange = '\\u2700-\\u27bf', rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff', rsMathOpRange = '\\xac\\xb1\\xd7\\xf7', rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf', rsPunctuationRange = '\\u2000-\\u206f', rsSpaceRange = ' \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000', rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde', rsVarRange = '\\ufe0e\\ufe0f', rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange; /** Used to compose unicode capture groups. */ var rsApos = "['\u2019]", rsAstral = '[' + rsAstralRange + ']', rsBreak = '[' + rsBreakRange + ']', rsCombo = '[' + rsComboRange + ']', rsDigits = '\\d+', rsDingbat = '[' + rsDingbatRange + ']', rsLower = '[' + rsLowerRange + ']', rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']', rsFitz = '\\ud83c[\\udffb-\\udfff]', rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')', rsNonAstral = '[^' + rsAstralRange + ']', rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}', rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]', rsUpper = '[' + rsUpperRange + ']', rsZWJ = '\\u200d'; /** Used to compose unicode regexes. */ var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')', rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')', rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?', rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?', reOptMod = rsModifier + '?', rsOptVar = '[' + rsVarRange + ']?', rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*', rsOrdLower = '\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])', rsOrdUpper = '\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])', rsSeq = rsOptVar + reOptMod + rsOptJoin, rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq, rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')'; /** Used to match apostrophes. */ var reApos = RegExp(rsApos, 'g'); /** * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols). */ var reComboMark = RegExp(rsCombo, 'g'); /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */ var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g'); /** Used to match complex or compound words. */ var reUnicodeWord = RegExp([ rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')', rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')', rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower, rsUpper + '+' + rsOptContrUpper, rsOrdUpper, rsOrdLower, rsDigits, rsEmoji ].join('|'), 'g'); /** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */ var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']'); /** Used to detect strings that need a more robust regexp to match words. */ var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/; /** Used to assign default `context` object properties. */ var contextProps = [ 'Array', 'Buffer', 'DataView', 'Date', 'Error', 'Float32Array', 'Float64Array', 'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Math', 'Object', 'Promise', 'RegExp', 'Set', 'String', 'Symbol', 'TypeError', 'Uint8Array', 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap', '_', 'clearTimeout', 'isFinite', 'parseInt', 'setTimeout' ]; /** Used to make template sourceURLs easier to identify. */ var templateCounter = -1; /** Used to identify `toStringTag` values of typed arrays. */ var typedArrayTags = {}; typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true; typedArrayTags[argsTag] = typedArrayTags[arrayTag] = typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = typedArrayTags[errorTag] = typedArrayTags[funcTag] = typedArrayTags[mapTag] = typedArrayTags[numberTag] = typedArrayTags[objectTag] = typedArrayTags[regexpTag] = typedArrayTags[setTag] = typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false; /** Used to identify `toStringTag` values supported by `_.clone`. */ var cloneableTags = {}; cloneableTags[argsTag] = cloneableTags[arrayTag] = cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] = cloneableTags[boolTag] = cloneableTags[dateTag] = cloneableTags[float32Tag] = cloneableTags[float64Tag] = cloneableTags[int8Tag] = cloneableTags[int16Tag] = cloneableTags[int32Tag] = cloneableTags[mapTag] = cloneableTags[numberTag] = cloneableTags[objectTag] = cloneableTags[regexpTag] = cloneableTags[setTag] = cloneableTags[stringTag] = cloneableTags[symbolTag] = cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true; cloneableTags[errorTag] = cloneableTags[funcTag] = cloneableTags[weakMapTag] = false; /** Used to map Latin Unicode letters to basic Latin letters. */ var deburredLetters = { // Latin-1 Supplement block. '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A', '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a', '\xc7': 'C', '\xe7': 'c', '\xd0': 'D', '\xf0': 'd', '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E', '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e', '\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I', '\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i', '\xd1': 'N', '\xf1': 'n', '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O', '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o', '\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U', '\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u', '\xdd': 'Y', '\xfd': 'y', '\xff': 'y', '\xc6': 'Ae', '\xe6': 'ae', '\xde': 'Th', '\xfe': 'th', '\xdf': 'ss', // Latin Extended-A block. '\u0100': 'A', '\u0102': 'A', '\u0104': 'A', '\u0101': 'a', '\u0103': 'a', '\u0105': 'a', '\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C', '\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c', '\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd', '\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E', '\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e', '\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G', '\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g', '\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h', '\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I', '\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i', '\u0134': 'J', '\u0135': 'j', '\u0136': 'K', '\u0137': 'k', '\u0138': 'k', '\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L', '\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l', '\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N', '\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n', '\u014c': 'O', '\u014e': 'O', '\u0150': 'O', '\u014d': 'o', '\u014f': 'o', '\u0151': 'o', '\u0154': 'R', '\u0156': 'R', '\u0158': 'R', '\u0155': 'r', '\u0157': 'r', '\u0159': 'r', '\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S', '\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's', '\u0162': 'T', '\u0164': 'T', '\u0166': 'T', '\u0163': 't', '\u0165': 't', '\u0167': 't', '\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U', '\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u', '\u0174': 'W', '\u0175': 'w', '\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y', '\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z', '\u017a': 'z', '\u017c': 'z', '\u017e': 'z', '\u0132': 'IJ', '\u0133': 'ij', '\u0152': 'Oe', '\u0153': 'oe', '\u0149': "'n", '\u017f': 's' }; /** Used to map characters to HTML entities. */ var htmlEscapes = { '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' }; /** Used to map HTML entities to characters. */ var htmlUnescapes = { '&': '&', '<': '<', '>': '>', '"': '"', ''': "'" }; /** Used to escape characters for inclusion in compiled string literals. */ var stringEscapes = { '\\': '\\', "'": "'", '\n': 'n', '\r': 'r', '\u2028': 'u2028', '\u2029': 'u2029' }; /** Built-in method references without a dependency on `root`. */ var freeParseFloat = parseFloat, freeParseInt = parseInt; /** Detect free variable `global` from Node.js. */ var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; /** Detect free variable `self`. */ var freeSelf = typeof self == 'object' && self && self.Object === Object && self; /** Used as a reference to the global object. */ var root = freeGlobal || freeSelf || Function('return this')(); /** Detect free variable `exports`. */ var freeExports = true && exports && !exports.nodeType && exports; /** Detect free variable `module`. */ var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module; /** Detect the popular CommonJS extension `module.exports`. */ var moduleExports = freeModule && freeModule.exports === freeExports; /** Detect free variable `process` from Node.js. */ var freeProcess = moduleExports && freeGlobal.process; /** Used to access faster Node.js helpers. */ var nodeUtil = (function() { try { // Use `util.types` for Node.js 10+. var types = freeModule && freeModule.require && freeModule.require('util').types; if (types) { return types; } // Legacy `process.binding('util')` for Node.js < 10. return freeProcess && freeProcess.binding && freeProcess.binding('util'); } catch (e) {} }()); /* Node.js helper references. */ var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer, nodeIsDate = nodeUtil && nodeUtil.isDate, nodeIsMap = nodeUtil && nodeUtil.isMap, nodeIsRegExp = nodeUtil && nodeUtil.isRegExp, nodeIsSet = nodeUtil && nodeUtil.isSet, nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray; /*--------------------------------------------------------------------------*/ /** * A faster alternative to `Function#apply`, this function invokes `func` * with the `this` binding of `thisArg` and the arguments of `args`. * * @private * @param {Function} func The function to invoke. * @param {*} thisArg The `this` binding of `func`. * @param {Array} args The arguments to invoke `func` with. * @returns {*} Returns the result of `func`. */ function apply(func, thisArg, args) { switch (args.length) { case 0: return func.call(thisArg); case 1: return func.call(thisArg, args[0]); case 2: return func.call(thisArg, args[0], args[1]); case 3: return func.call(thisArg, args[0], args[1], args[2]); } return func.apply(thisArg, args); } /** * A specialized version of `baseAggregator` for arrays. * * @private * @param {Array} [array] The array to iterate over. * @param {Function} setter The function to set `accumulator` values. * @param {Function} iteratee The iteratee to transform keys. * @param {Object} accumulator The initial aggregated object. * @returns {Function} Returns `accumulator`. */ function arrayAggregator(array, setter, iteratee, accumulator) { var index = -1, length = array == null ? 0 : array.length; while (++index < length) { var value = array[index]; setter(accumulator, value, iteratee(value), array); } return accumulator; } /** * A specialized version of `_.forEach` for arrays without support for * iteratee shorthands. * * @private * @param {Array} [array] The array to iterate over. * @param {Function} iteratee The function invoked per iteration. * @returns {Array} Returns `array`. */ function arrayEach(array, iteratee) { var index = -1, length = array == null ? 0 : array.length; while (++index < length) { if (iteratee(array[index], index, array) === false) { break; } } return array; } /** * A specialized version of `_.forEachRight` for arrays without support for * iteratee shorthands. * * @private * @param {Array} [array] The array to iterate over. * @param {Function} iteratee The function invoked per iteration. * @returns {Array} Returns `array`. */ function arrayEachRight(array, iteratee) { var length = array == null ? 0 : array.length; while (length--) { if (iteratee(array[length], length, array) === false) { break; } } return array; } /** * A specialized version of `_.every` for arrays without support for * iteratee shorthands. * * @private * @param {Array} [array] The array to iterate over. * @param {Function} predicate The function invoked per iteration. * @returns {boolean} Returns `true` if all elements pass the predicate check, * else `false`. */ function arrayEvery(array, predicate) { var index = -1, length = array == null ? 0 : array.length; while (++index < length) { if (!predicate(array[index], index, array)) { return false; } } return true; } /** * A specialized version of `_.filter` for arrays without support for * iteratee shorthands. * * @private * @param {Array} [array] The array to iterate over. * @param {Function} predicate The function invoked per iteration. * @returns {Array} Returns the new filtered array. */ function arrayFilter(array, predicate) { var index = -1, length = array == null ? 0 : array.length, resIndex = 0, result = []; while (++index < length) { var value = array[index]; if (predicate(value, index, array)) { result[resIndex++] = value; } } return result; } /** * A specialized version of `_.includes` for arrays without support for * specifying an index to search from. * * @private * @param {Array} [array] The array to inspect. * @param {*} target The value to search for. * @returns {boolean} Returns `true` if `target` is found, else `false`. */ function arrayIncludes(array, value) { var length = array == null ? 0 : array.length; return !!length && baseIndexOf(array, value, 0) > -1; } /** * This function is like `arrayIncludes` except that it accepts a comparator. * * @private * @param {Array} [array] The array to inspect. * @param {*} target The value to search for. * @param {Function} comparator The comparator invoked per element. * @returns {boolean} Returns `true` if `target` is found, else `false`. */ function arrayIncludesWith(array, value, comparator) { var index = -1, length = array == null ? 0 : array.length; while (++index < length) { if (comparator(value, array[index])) { return true; } } return false; } /** * A specialized version of `_.map` for arrays without support for iteratee * shorthands. * * @private * @param {Array} [array] The array to iterate over. * @param {Function} iteratee The function invoked per iteration. * @returns {Array} Returns the new mapped array. */ function arrayMap(array, iteratee) { var index = -1, length = array == null ? 0 : array.length, result = Array(length); while (++index < length) { result[index] = iteratee(array[index], index, array); } return result; } /** * Appends the elements of `values` to `array`. * * @private * @param {Array} array The array to modify. * @param {Array} values The values to append. * @returns {Array} Returns `array`. */ function arrayPush(array, values) { var index = -1, length = values.length, offset = array.length; while (++index < length) { array[offset + index] = values[index]; } return array; } /** * A specialized version of `_.reduce` for arrays without support for * iteratee shorthands. * * @private * @param {Array} [array] The array to iterate over. * @param {Function} iteratee The function invoked per iteration. * @param {*} [accumulator] The initial value. * @param {boolean} [initAccum] Specify using the first element of `array` as * the initial value. * @returns {*} Returns the accumulated value. */ function arrayReduce(array, iteratee, accumulator, initAccum) { var index = -1, length = array == null ? 0 : array.length; if (initAccum && length) { accumulator = array[++index]; } while (++index < length) { accumulator = iteratee(accumulator, array[index], index, array); } return accumulator; } /** * A specialized version of `_.reduceRight` for arrays without support for * iteratee shorthands. * * @private * @param {Array} [array] The array to iterate over. * @param {Function} iteratee The function invoked per iteration. * @param {*} [accumulator] The initial value. * @param {boolean} [initAccum] Specify using the last element of `array` as * the initial value. * @returns {*} Returns the accumulated value. */ function arrayReduceRight(array, iteratee, accumulator, initAccum) { var length = array == null ? 0 : array.length; if (initAccum && length) { accumulator = array[--length]; } while (length--) { accumulator = iteratee(accumulator, array[length], length, array); } return accumulator; } /** * A specialized version of `_.some` for arrays without support for iteratee * shorthands. * * @private * @param {Array} [array] The array to iterate over. * @param {Function} predicate The function invoked per iteration. * @returns {boolean} Returns `true` if any element passes the predicate check, * else `false`. */ function arraySome(array, predicate) { var index = -1, length = array == null ? 0 : array.length; while (++index < length) { if (predicate(array[index], index, array)) { return true; } } return false; } /** * Gets the size of an ASCII `string`. * * @private * @param {string} string The string inspect. * @returns {number} Returns the string size. */ var asciiSize = baseProperty('length'); /** * Converts an ASCII `string` to an array. * * @private * @param {string} string The string to convert. * @returns {Array} Returns the converted array. */ function asciiToArray(string) { return string.split(''); } /** * Splits an ASCII `string` into an array of its words. * * @private * @param {string} The string to inspect. * @returns {Array} Returns the words of `string`. */ function asciiWords(string) { return string.match(reAsciiWord) || []; } /** * The base implementation of methods like `_.findKey` and `_.findLastKey`, * without support for iteratee shorthands, which iterates over `collection` * using `eachFunc`. * * @private * @param {Array|Object} collection The collection to inspect. * @param {Function} predicate The function invoked per iteration. * @param {Function} eachFunc The function to iterate over `collection`. * @returns {*} Returns the found element or its key, else `undefined`. */ function baseFindKey(collection, predicate, eachFunc) { var result; eachFunc(collection, function(value, key, collection) { if (predicate(value, key, collection)) { result = key; return false; } }); return result; } /** * The base implementation of `_.findIndex` and `_.findLastIndex` without * support for iteratee shorthands. * * @private * @param {Array} array The array to inspect. * @param {Function} predicate The function invoked per iteration. * @param {number} fromIndex The index to search from. * @param {boolean} [fromRight] Specify iterating from right to left. * @returns {number} Returns the index of the matched value, else `-1`. */ function baseFindIndex(array, predicate, fromIndex, fromRight) { var length = array.length, index = fromIndex + (fromRight ? 1 : -1); while ((fromRight ? index-- : ++index < length)) { if (predicate(array[index], index, array)) { return index; } } return -1; } /** * The base implementation of `_.indexOf` without `fromIndex` bounds checks. * * @private * @param {Array} array The array to inspect. * @param {*} value The value to search for. * @param {number} fromIndex The index to search from. * @returns {number} Returns the index of the matched value, else `-1`. */ function baseIndexOf(array, value, fromIndex) { return value === value ? strictIndexOf(array, value, fromIndex) : baseFindIndex(array, baseIsNaN, fromIndex); } /** * This function is like `baseIndexOf` except that it accepts a comparator. * * @private * @param {Array} array The array to inspect. * @param {*} value The value to search for. * @param {number} fromIndex The index to search from. * @param {Function} comparator The comparator invoked per element. * @returns {number} Returns the index of the matched value, else `-1`. */ function baseIndexOfWith(array, value, fromIndex, comparator) { var index = fromIndex - 1, length = array.length; while (++index < length) { if (comparator(array[index], value)) { return index; } } return -1; } /** * The base implementation of `_.isNaN` without support for number objects. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. */ function baseIsNaN(value) { return value !== value; } /** * The base implementation of `_.mean` and `_.meanBy` without support for * iteratee shorthands. * * @private * @param {Array} array The array to iterate over. * @param {Function} iteratee The function invoked per iteration. * @returns {number} Returns the mean. */ function baseMean(array, iteratee) { var length = array == null ? 0 : array.length; return length ? (baseSum(array, iteratee) / length) : NAN; } /** * The base implementation of `_.property` without support for deep paths. * * @private * @param {string} key The key of the property to get. * @returns {Function} Returns the new accessor function. */ function baseProperty(key) { return function(object) { return object == null ? undefined : object[key]; }; } /** * The base implementation of `_.propertyOf` without support for deep paths. * * @private * @param {Object} object The object to query. * @returns {Function} Returns the new accessor function. */ function basePropertyOf(object) { return function(key) { return object == null ? undefined : object[key]; }; } /** * The base implementation of `_.reduce` and `_.reduceRight`, without support * for iteratee shorthands, which iterates over `collection` using `eachFunc`. * * @private * @param {Array|Object} collection The collection to iterate over. * @param {Function} iteratee The function invoked per iteration. * @param {*} accumulator The initial value. * @param {boolean} initAccum Specify using the first or last element of * `collection` as the initial value. * @param {Function} eachFunc The function to iterate over `collection`. * @returns {*} Returns the accumulated value. */ function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) { eachFunc(collection, function(value, index, collection) { accumulator = initAccum ? (initAccum = false, value) : iteratee(accumulator, value, index, collection); }); return accumulator; } /** * The base implementation of `_.sortBy` which uses `comparer` to define the * sort order of `array` and replaces criteria objects with their corresponding * values. * * @private * @param {Array} array The array to sort. * @param {Function} comparer The function to define sort order. * @returns {Array} Returns `array`. */ function baseSortBy(array, comparer) { var length = array.length; array.sort(comparer); while (length--) { array[length] = array[length].value; } return array; } /** * The base implementation of `_.sum` and `_.sumBy` without support for * iteratee shorthands. * * @private * @param {Array} array The array to iterate over. * @param {Function} iteratee The function invoked per iteration. * @returns {number} Returns the sum. */ function baseSum(array, iteratee) { var result, index = -1, length = array.length; while (++index < length) { var current = iteratee(array[index]); if (current !== undefined) { result = result === undefined ? current : (result + current); } } return result; } /** * The base implementation of `_.times` without support for iteratee shorthands * or max array length checks. * * @private * @param {number} n The number of times to invoke `iteratee`. * @param {Function} iteratee The function invoked per iteration. * @returns {Array} Returns the array of results. */ function baseTimes(n, iteratee) { var index = -1, result = Array(n); while (++index < n) { result[index] = iteratee(index); } return result; } /** * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array * of key-value pairs for `object` corresponding to the property names of `props`. * * @private * @param {Object} object The object to query. * @param {Array} props The property names to get values for. * @returns {Object} Returns the key-value pairs. */ function baseToPairs(object, props) { return arrayMap(props, function(key) { return [key, object[key]]; }); } /** * The base implementation of `_.trim`. * * @private * @param {string} string The string to trim. * @returns {string} Returns the trimmed string. */ function baseTrim(string) { return string ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '') : string; } /** * The base implementation of `_.unary` without support for storing metadata. * * @private * @param {Function} func The function to cap arguments for. * @returns {Function} Returns the new capped function. */ function baseUnary(func) { return function(value) { return func(value); }; } /** * The base implementation of `_.values` and `_.valuesIn` which creates an * array of `object` property values corresponding to the property names * of `props`. * * @private * @param {Object} object The object to query. * @param {Array} props The property names to get values for. * @returns {Object} Returns the array of property values. */ function baseValues(object, props) { return arrayMap(props, function(key) { return object[key]; }); } /** * Checks if a `cache` value for `key` exists. * * @private * @param {Object} cache The cache to query. * @param {string} key The key of the entry to check. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. */ function cacheHas(cache, key) { return cache.has(key); } /** * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol * that is not found in the character symbols. * * @private * @param {Array} strSymbols The string symbols to inspect. * @param {Array} chrSymbols The character symbols to find. * @returns {number} Returns the index of the first unmatched string symbol. */ function charsStartIndex(strSymbols, chrSymbols) { var index = -1, length = strSymbols.length; while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {} return index; } /** * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol * that is not found in the character symbols. * * @private * @param {Array} strSymbols The string symbols to inspect. * @param {Array} chrSymbols The character symbols to find. * @returns {number} Returns the index of the last unmatched string symbol. */ function charsEndIndex(strSymbols, chrSymbols) { var index = strSymbols.length; while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {} return index; } /** * Gets the number of `placeholder` occurrences in `array`. * * @private * @param {Array} array The array to inspect. * @param {*} placeholder The placeholder to search for. * @returns {number} Returns the placeholder count. */ function countHolders(array, placeholder) { var length = array.length, result = 0; while (length--) { if (array[length] === placeholder) { ++result; } } return result; } /** * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A * letters to basic Latin letters. * * @private * @param {string} letter The matched letter to deburr. * @returns {string} Returns the deburred letter. */ var deburrLetter = basePropertyOf(deburredLetters); /** * Used by `_.escape` to convert characters to HTML entities. * * @private * @param {string} chr The matched character to escape. * @returns {string} Returns the escaped character. */ var escapeHtmlChar = basePropertyOf(htmlEscapes); /** * Used by `_.template` to escape characters for inclusion in compiled string literals. * * @private * @param {string} chr The matched character to escape. * @returns {string} Returns the escaped character. */ function escapeStringChar(chr) { return '\\' + stringEscapes[chr]; } /** * Gets the value at `key` of `object`. * * @private * @param {Object} [object] The object to query. * @param {string} key The key of the property to get. * @returns {*} Returns the property value. */ function getValue(object, key) { return object == null ? undefined : object[key]; } /** * Checks if `string` contains Unicode symbols. * * @private * @param {string} string The string to inspect. * @returns {boolean} Returns `true` if a symbol is found, else `false`. */ function hasUnicode(string) { return reHasUnicode.test(string); } /** * Checks if `string` contains a word composed of Unicode symbols. * * @private * @param {string} string The string to inspect. * @returns {boolean} Returns `true` if a word is found, else `false`. */ function hasUnicodeWord(string) { return reHasUnicodeWord.test(string); } /** * Converts `iterator` to an array. * * @private * @param {Object} iterator The iterator to convert. * @returns {Array} Returns the converted array. */ function iteratorToArray(iterator) { var data, result = []; while (!(data = iterator.next()).done) { result.push(data.value); } return result; } /** * Converts `map` to its key-value pairs. * * @private * @param {Object} map The map to convert. * @returns {Array} Returns the key-value pairs. */ function mapToArray(map) { var index = -1, result = Array(map.size); map.forEach(function(value, key) { result[++index] = [key, value]; }); return result; } /** * Creates a unary function that invokes `func` with its argument transformed. * * @private * @param {Function} func The function to wrap. * @param {Function} transform The argument transform. * @returns {Function} Returns the new function. */ function overArg(func, transform) { return function(arg) { return func(transform(arg)); }; } /** * Replaces all `placeholder` elements in `array` with an internal placeholder * and returns an array of their indexes. * * @private * @param {Array} array The array to modify. * @param {*} placeholder The placeholder to replace. * @returns {Array} Returns the new array of placeholder indexes. */ function replaceHolders(array, placeholder) { var index = -1, length = array.length, resIndex = 0, result = []; while (++index < length) { var value = array[index]; if (value === placeholder || value === PLACEHOLDER) { array[index] = PLACEHOLDER; result[resIndex++] = index; } } return result; } /** * Converts `set` to an array of its values. * * @private * @param {Object} set The set to convert. * @returns {Array} Returns the values. */ function setToArray(set) { var index = -1, result = Array(set.size); set.forEach(function(value) { result[++index] = value; }); return result; } /** * Converts `set` to its value-value pairs. * * @private * @param {Object} set The set to convert. * @returns {Array} Returns the value-value pairs. */ function setToPairs(set) { var index = -1, result = Array(set.size); set.forEach(function(value) { result[++index] = [value, value]; }); return result; } /** * A specialized version of `_.indexOf` which performs strict equality * comparisons of values, i.e. `===`. * * @private * @param {Array} array The array to inspect. * @param {*} value The value to search for. * @param {number} fromIndex The index to search from. * @returns {number} Returns the index of the matched value, else `-1`. */ function strictIndexOf(array, value, fromIndex) { var index = fromIndex - 1, length = array.length; while (++index < length) { if (array[index] === value) { return index; } } return -1; } /** * A specialized version of `_.lastIndexOf` which performs strict equality * comparisons of values, i.e. `===`. * * @private * @param {Array} array The array to inspect. * @param {*} value The value to search for. * @param {number} fromIndex The index to search from. * @returns {number} Returns the index of the matched value, else `-1`. */ function strictLastIndexOf(array, value, fromIndex) { var index = fromIndex + 1; while (index--) { if (array[index] === value) { return index; } } return index; } /** * Gets the number of symbols in `string`. * * @private * @param {string} string The string to inspect. * @returns {number} Returns the string size. */ function stringSize(string) { return hasUnicode(string) ? unicodeSize(string) : asciiSize(string); } /** * Converts `string` to an array. * * @private * @param {string} string The string to convert. * @returns {Array} Returns the converted array. */ function stringToArray(string) { return hasUnicode(string) ? unicodeToArray(string) : asciiToArray(string); } /** * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace * character of `string`. * * @private * @param {string} string The string to inspect. * @returns {number} Returns the index of the last non-whitespace character. */ function trimmedEndIndex(string) { var index = string.length; while (index-- && reWhitespace.test(string.charAt(index))) {} return index; } /** * Used by `_.unescape` to convert HTML entities to characters. * * @private * @param {string} chr The matched character to unescape. * @returns {string} Returns the unescaped character. */ var unescapeHtmlChar = basePropertyOf(htmlUnescapes); /** * Gets the size of a Unicode `string`. * * @private * @param {string} string The string inspect. * @returns {number} Returns the string size. */ function unicodeSize(string) { var result = reUnicode.lastIndex = 0; while (reUnicode.test(string)) { ++result; } return result; } /** * Converts a Unicode `string` to an array. * * @private * @param {string} string The string to convert. * @returns {Array} Returns the converted array. */ function unicodeToArray(string) { return string.match(reUnicode) || []; } /** * Splits a Unicode `string` into an array of its words. * * @private * @param {string} The string to inspect. * @returns {Array} Returns the words of `string`. */ function unicodeWords(string) { return string.match(reUnicodeWord) || []; } /*--------------------------------------------------------------------------*/ /** * Create a new pristine `lodash` function using the `context` object. * * @static * @memberOf _ * @since 1.1.0 * @category Util * @param {Object} [context=root] The context object. * @returns {Function} Returns a new `lodash` function. * @example * * _.mixin({ 'foo': _.constant('foo') }); * * var lodash = _.runInContext(); * lodash.mixin({ 'bar': lodash.constant('bar') }); * * _.isFunction(_.foo); * // => true * _.isFunction(_.bar); * // => false * * lodash.isFunction(lodash.foo); * // => false * lodash.isFunction(lodash.bar); * // => true * * // Create a suped-up `defer` in Node.js. * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer; */ var runInContext = (function runInContext(context) { context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps)); /** Built-in constructor references. */ var Array = context.Array, Date = context.Date, Error = context.Error, Function = context.Function, Math = context.Math, Object = context.Object, RegExp = context.RegExp, String = context.String, TypeError = context.TypeError; /** Used for built-in method references. */ var arrayProto = Array.prototype, funcProto = Function.prototype, objectProto = Object.prototype; /** Used to detect overreaching core-js shims. */ var coreJsData = context['__core-js_shared__']; /** Used to resolve the decompiled source of functions. */ var funcToString = funcProto.toString; /** Used to check objects for own properties. */ var hasOwnProperty = objectProto.hasOwnProperty; /** Used to generate unique IDs. */ var idCounter = 0; /** Used to detect methods masquerading as native. */ var maskSrcKey = (function() { var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); return uid ? ('Symbol(src)_1.' + uid) : ''; }()); /** * Used to resolve the * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) * of values. */ var nativeObjectToString = objectProto.toString; /** Used to infer the `Object` constructor. */ var objectCtorString = funcToString.call(Object); /** Used to restore the original `_` reference in `_.noConflict`. */ var oldDash = root._; /** Used to detect if a method is native. */ var reIsNative = RegExp('^' + funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' ); /** Built-in value references. */ var Buffer = moduleExports ? context.Buffer : undefined, Symbol = context.Symbol, Uint8Array = context.Uint8Array, allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined, getPrototype = overArg(Object.getPrototypeOf, Object), objectCreate = Object.create, propertyIsEnumerable = objectProto.propertyIsEnumerable, splice = arrayProto.splice, spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined, symIterator = Symbol ? Symbol.iterator : undefined, symToStringTag = Symbol ? Symbol.toStringTag : undefined; var defineProperty = (function() { try { var func = getNative(Object, 'defineProperty'); func({}, '', {}); return func; } catch (e) {} }()); /** Mocked built-ins. */ var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout, ctxNow = Date && Date.now !== root.Date.now && Date.now, ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout; /* Built-in method references for those with the same name as other `lodash` methods. */ var nativeCeil = Math.ceil, nativeFloor = Math.floor, nativeGetSymbols = Object.getOwnPropertySymbols, nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined, nativeIsFinite = context.isFinite, nativeJoin = arrayProto.join, nativeKeys = overArg(Object.keys, Object), nativeMax = Math.max, nativeMin = Math.min, nativeNow = Date.now, nativeParseInt = context.parseInt, nativeRandom = Math.random, nativeReverse = arrayProto.reverse; /* Built-in method references that are verified to be native. */ var DataView = getNative(context, 'DataView'), Map = getNative(context, 'Map'), Promise = getNative(context, 'Promise'), Set = getNative(context, 'Set'), WeakMap = getNative(context, 'WeakMap'), nativeCreate = getNative(Object, 'create'); /** Used to store function metadata. */ var metaMap = WeakMap && new WeakMap; /** Used to lookup unminified function names. */ var realNames = {}; /** Used to detect maps, sets, and weakmaps. */ var dataViewCtorString = toSource(DataView), mapCtorString = toSource(Map), promiseCtorString = toSource(Promise), setCtorString = toSource(Set), weakMapCtorString = toSource(WeakMap); /** Used to convert symbols to primitives and strings. */ var symbolProto = Symbol ? Symbol.prototype : undefined, symbolValueOf = symbolProto ? symbolProto.valueOf : undefined, symbolToString = symbolProto ? symbolProto.toString : undefined; /*------------------------------------------------------------------------*/ /** * Creates a `lodash` object which wraps `value` to enable implicit method * chain sequences. Methods that operate on and return arrays, collections, * and functions can be chained together. Methods that retrieve a single value * or may return a primitive value will automatically end the chain sequence * and return the unwrapped value. Otherwise, the value must be unwrapped * with `_#value`. * * Explicit chain sequences, which must be unwrapped with `_#value`, may be * enabled using `_.chain`. * * The execution of chained methods is lazy, that is, it's deferred until * `_#value` is implicitly or explicitly called. * * Lazy evaluation allows several methods to support shortcut fusion. * Shortcut fusion is an optimization to merge iteratee calls; this avoids * the creation of intermediate arrays and can greatly reduce the number of * iteratee executions. Sections of a chain sequence qualify for shortcut * fusion if the section is applied to an array and iteratees accept only * one argument. The heuristic for whether a section qualifies for shortcut * fusion is subject to change. * * Chaining is supported in custom builds as long as the `_#value` method is * directly or indirectly included in the build. * * In addition to lodash methods, wrappers have `Array` and `String` methods. * * The wrapper `Array` methods are: * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift` * * The wrapper `String` methods are: * `replace` and `split` * * The wrapper methods that support shortcut fusion are: * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`, * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`, * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray` * * The chainable wrapper methods are: * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`, * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`, * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`, * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`, * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`, * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`, * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`, * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`, * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`, * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`, * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`, * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`, * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`, * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`, * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`, * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`, * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`, * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`, * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`, * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`, * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`, * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`, * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`, * `zipObject`, `zipObjectDeep`, and `zipWith` * * The wrapper methods that are **not** chainable by default are: * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`, * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`, * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`, * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`, * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`, * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`, * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`, * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`, * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`, * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`, * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`, * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`, * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`, * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`, * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`, * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`, * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`, * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`, * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`, * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`, * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`, * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`, * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`, * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`, * `upperFirst`, `value`, and `words` * * @name _ * @constructor * @category Seq * @param {*} value The value to wrap in a `lodash` instance. * @returns {Object} Returns the new `lodash` wrapper instance. * @example * * function square(n) { * return n * n; * } * * var wrapped = _([1, 2, 3]); * * // Returns an unwrapped value. * wrapped.reduce(_.add); * // => 6 * * // Returns a wrapped value. * var squares = wrapped.map(square); * * _.isArray(squares); * // => false * * _.isArray(squares.value()); * // => true */ function lodash(value) { if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) { if (value instanceof LodashWrapper) { return value; } if (hasOwnProperty.call(value, '__wrapped__')) { return wrapperClone(value); } } return new LodashWrapper(value); } /** * The base implementation of `_.create` without support for assigning * properties to the created object. * * @private * @param {Object} proto The object to inherit from. * @returns {Object} Returns the new object. */ var baseCreate = (function() { function object() {} return function(proto) { if (!isObject(proto)) { return {}; } if (objectCreate) { return objectCreate(proto); } object.prototype = proto; var result = new object; object.prototype = undefined; return result; }; }()); /** * The function whose prototype chain sequence wrappers inherit from. * * @private */ function baseLodash() { // No operation performed. } /** * The base constructor for creating `lodash` wrapper objects. * * @private * @param {*} value The value to wrap. * @param {boolean} [chainAll] Enable explicit method chain sequences. */ function LodashWrapper(value, chainAll) { this.__wrapped__ = value; this.__actions__ = []; this.__chain__ = !!chainAll; this.__index__ = 0; this.__values__ = undefined; } /** * By default, the template delimiters used by lodash are like those in * embedded Ruby (ERB) as well as ES2015 template strings. Change the * following template settings to use alternative delimiters. * * @static * @memberOf _ * @type {Object} */ lodash.templateSettings = { /** * Used to detect `data` property values to be HTML-escaped. * * @memberOf _.templateSettings * @type {RegExp} */ 'escape': reEscape, /** * Used to detect code to be evaluated. * * @memberOf _.templateSettings * @type {RegExp} */ 'evaluate': reEvaluate, /** * Used to detect `data` property values to inject. * * @memberOf _.templateSettings * @type {RegExp} */ 'interpolate': reInterpolate, /** * Used to reference the data object in the template text. * * @memberOf _.templateSettings * @type {string} */ 'variable': '', /** * Used to import variables into the compiled template. * * @memberOf _.templateSettings * @type {Object} */ 'imports': { /** * A reference to the `lodash` function. * * @memberOf _.templateSettings.imports * @type {Function} */ '_': lodash } }; // Ensure wrappers are instances of `baseLodash`. lodash.prototype = baseLodash.prototype; lodash.prototype.constructor = lodash; LodashWrapper.prototype = baseCreate(baseLodash.prototype); LodashWrapper.prototype.constructor = LodashWrapper; /*------------------------------------------------------------------------*/ /** * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation. * * @private * @constructor * @param {*} value The value to wrap. */ function LazyWrapper(value) { this.__wrapped__ = value; this.__actions__ = []; this.__dir__ = 1; this.__filtered__ = false; this.__iteratees__ = []; this.__takeCount__ = MAX_ARRAY_LENGTH; this.__views__ = []; } /** * Creates a clone of the lazy wrapper object. * * @private * @name clone * @memberOf LazyWrapper * @returns {Object} Returns the cloned `LazyWrapper` object. */ function lazyClone() { var result = new LazyWrapper(this.__wrapped__); result.__actions__ = copyArray(this.__actions__); result.__dir__ = this.__dir__; result.__filtered__ = this.__filtered__; result.__iteratees__ = copyArray(this.__iteratees__); result.__takeCount__ = this.__takeCount__; result.__views__ = copyArray(this.__views__); return result; } /** * Reverses the direction of lazy iteration. * * @private * @name reverse * @memberOf LazyWrapper * @returns {Object} Returns the new reversed `LazyWrapper` object. */ function lazyReverse() { if (this.__filtered__) { var result = new LazyWrapper(this); result.__dir__ = -1; result.__filtered__ = true; } else { result = this.clone(); result.__dir__ *= -1; } return result; } /** * Extracts the unwrapped value from its lazy wrapper. * * @private * @name value * @memberOf LazyWrapper * @returns {*} Returns the unwrapped value. */ function lazyValue() { var array = this.__wrapped__.value(), dir = this.__dir__, isArr = isArray(array), isRight = dir < 0, arrLength = isArr ? array.length : 0, view = getView(0, arrLength, this.__views__), start = view.start, end = view.end, length = end - start, index = isRight ? end : (start - 1), iteratees = this.__iteratees__, iterLength = iteratees.length, resIndex = 0, takeCount = nativeMin(length, this.__takeCount__); if (!isArr || (!isRight && arrLength == length && takeCount == length)) { return baseWrapperValue(array, this.__actions__); } var result = []; outer: while (length-- && resIndex < takeCount) { index += dir; var iterIndex = -1, value = array[index]; while (++iterIndex < iterLength) { var data = iteratees[iterIndex], iteratee = data.iteratee, type = data.type, computed = iteratee(value); if (type == LAZY_MAP_FLAG) { value = computed; } else if (!computed) { if (type == LAZY_FILTER_FLAG) { continue outer; } else { break outer; } } } result[resIndex++] = value; } return result; } // Ensure `LazyWrapper` is an instance of `baseLodash`. LazyWrapper.prototype = baseCreate(baseLodash.prototype); LazyWrapper.prototype.constructor = LazyWrapper; /*------------------------------------------------------------------------*/ /** * Creates a hash object. * * @private * @constructor * @param {Array} [entries] The key-value pairs to cache. */ function Hash(entries) { var index = -1, length = entries == null ? 0 : entries.length; this.clear(); while (++index < length) { var entry = entries[index]; this.set(entry[0], entry[1]); } } /** * Removes all key-value entries from the hash. * * @private * @name clear * @memberOf Hash */ function hashClear() { this.__data__ = nativeCreate ? nativeCreate(null) : {}; this.size = 0; } /** * Removes `key` and its value from the hash. * * @private * @name delete * @memberOf Hash * @param {Object} hash The hash to modify. * @param {string} key The key of the value to remove. * @returns {boolean} Returns `true` if the entry was removed, else `false`. */ function hashDelete(key) { var result = this.has(key) && delete this.__data__[key]; this.size -= result ? 1 : 0; return result; } /** * Gets the hash value for `key`. * * @private * @name get * @memberOf Hash * @param {string} key The key of the value to get. * @returns {*} Returns the entry value. */ function hashGet(key) { var data = this.__data__; if (nativeCreate) { var result = data[key]; return result === HASH_UNDEFINED ? undefined : result; } return hasOwnProperty.call(data, key) ? data[key] : undefined; } /** * Checks if a hash value for `key` exists. * * @private * @name has * @memberOf Hash * @param {string} key The key of the entry to check. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. */ function hashHas(key) { var data = this.__data__; return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key); } /** * Sets the hash `key` to `value`. * * @private * @name set * @memberOf Hash * @param {string} key The key of the value to set. * @param {*} value The value to set. * @returns {Object} Returns the hash instance. */ function hashSet(key, value) { var data = this.__data__; this.size += this.has(key) ? 0 : 1; data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; return this; } // Add methods to `Hash`. Hash.prototype.clear = hashClear; Hash.prototype['delete'] = hashDelete; Hash.prototype.get = hashGet; Hash.prototype.has = hashHas; Hash.prototype.set = hashSet; /*------------------------------------------------------------------------*/ /** * Creates an list cache object. * * @private * @constructor * @param {Array} [entries] The key-value pairs to cache. */ function ListCache(entries) { var index = -1, length = entries == null ? 0 : entries.length; this.clear(); while (++index < length) { var entry = entries[index]; this.set(entry[0], entry[1]); } } /** * Removes all key-value entries from the list cache. * * @private * @name clear * @memberOf ListCache */ function listCacheClear() { this.__data__ = []; this.size = 0; } /** * Removes `key` and its value from the list cache. * * @private * @name delete * @memberOf ListCache * @param {string} key The key of the value to remove. * @returns {boolean} Returns `true` if the entry was removed, else `false`. */ function listCacheDelete(key) { var data = this.__data__, index = assocIndexOf(data, key); if (index < 0) { return false; } var lastIndex = data.length - 1; if (index == lastIndex) { data.pop(); } else { splice.call(data, index, 1); } --this.size; return true; } /** * Gets the list cache value for `key`. * * @private * @name get * @memberOf ListCache * @param {string} key The key of the value to get. * @returns {*} Returns the entry value. */ function listCacheGet(key) { var data = this.__data__, index = assocIndexOf(data, key); return index < 0 ? undefined : data[index][1]; } /** * Checks if a list cache value for `key` exists. * * @private * @name has * @memberOf ListCache * @param {string} key The key of the entry to check. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. */ function listCacheHas(key) { return assocIndexOf(this.__data__, key) > -1; } /** * Sets the list cache `key` to `value`. * * @private * @name set * @memberOf ListCache * @param {string} key The key of the value to set. * @param {*} value The value to set. * @returns {Object} Returns the list cache instance. */ function listCacheSet(key, value) { var data = this.__data__, index = assocIndexOf(data, key); if (index < 0) { ++this.size; data.push([key, value]); } else { data[index][1] = value; } return this; } // Add methods to `ListCache`. ListCache.prototype.clear = listCacheClear; ListCache.prototype['delete'] = listCacheDelete; ListCache.prototype.get = listCacheGet; ListCache.prototype.has = listCacheHas; ListCache.prototype.set = listCacheSet; /*------------------------------------------------------------------------*/ /** * Creates a map cache object to store key-value pairs. * * @private * @constructor * @param {Array} [entries] The key-value pairs to cache. */ function MapCache(entries) { var index = -1, length = entries == null ? 0 : entries.length; this.clear(); while (++index < length) { var entry = entries[index]; this.set(entry[0], entry[1]); } } /** * Removes all key-value entries from the map. * * @private * @name clear * @memberOf MapCache */ function mapCacheClear() { this.size = 0; this.__data__ = { 'hash': new Hash, 'map': new (Map || ListCache), 'string': new Hash }; } /** * Removes `key` and its value from the map. * * @private * @name delete * @memberOf MapCache * @param {string} key The key of the value to remove. * @returns {boolean} Returns `true` if the entry was removed, else `false`. */ function mapCacheDelete(key) { var result = getMapData(this, key)['delete'](key); this.size -= result ? 1 : 0; return result; } /** * Gets the map value for `key`. * * @private * @name get * @memberOf MapCache * @param {string} key The key of the value to get. * @returns {*} Returns the entry value. */ function mapCacheGet(key) { return getMapData(this, key).get(key); } /** * Checks if a map value for `key` exists. * * @private * @name has * @memberOf MapCache * @param {string} key The key of the entry to check. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. */ function mapCacheHas(key) { return getMapData(this, key).has(key); } /** * Sets the map `key` to `value`. * * @private * @name set * @memberOf MapCache * @param {string} key The key of the value to set. * @param {*} value The value to set. * @returns {Object} Returns the map cache instance. */ function mapCacheSet(key, value) { var data = getMapData(this, key), size = data.size; data.set(key, value); this.size += data.size == size ? 0 : 1; return this; } // Add methods to `MapCache`. MapCache.prototype.clear = mapCacheClear; MapCache.prototype['delete'] = mapCacheDelete; MapCache.prototype.get = mapCacheGet; MapCache.prototype.has = mapCacheHas; MapCache.prototype.set = mapCacheSet; /*------------------------------------------------------------------------*/ /** * * Creates an array cache object to store unique values. * * @private * @constructor * @param {Array} [values] The values to cache. */ function SetCache(values) { var index = -1, length = values == null ? 0 : values.length; this.__data__ = new MapCache; while (++index < length) { this.add(values[index]); } } /** * Adds `value` to the array cache. * * @private * @name add * @memberOf SetCache * @alias push * @param {*} value The value to cache. * @returns {Object} Returns the cache instance. */ function setCacheAdd(value) { this.__data__.set(value, HASH_UNDEFINED); return this; } /** * Checks if `value` is in the array cache. * * @private * @name has * @memberOf SetCache * @param {*} value The value to search for. * @returns {number} Returns `true` if `value` is found, else `false`. */ function setCacheHas(value) { return this.__data__.has(value); } // Add methods to `SetCache`. SetCache.prototype.add = SetCache.prototype.push = setCacheAdd; SetCache.prototype.has = setCacheHas; /*------------------------------------------------------------------------*/ /** * Creates a stack cache object to store key-value pairs. * * @private * @constructor * @param {Array} [entries] The key-value pairs to cache. */ function Stack(entries) { var data = this.__data__ = new ListCache(entries); this.size = data.size; } /** * Removes all key-value entries from the stack. * * @private * @name clear * @memberOf Stack */ function stackClear() { this.__data__ = new ListCache; this.size = 0; } /** * Removes `key` and its value from the stack. * * @private * @name delete * @memberOf Stack * @param {string} key The key of the value to remove. * @returns {boolean} Returns `true` if the entry was removed, else `false`. */ function stackDelete(key) { var data = this.__data__, result = data['delete'](key); this.size = data.size; return result; } /** * Gets the stack value for `key`. * * @private * @name get * @memberOf Stack * @param {string} key The key of the value to get. * @returns {*} Returns the entry value. */ function stackGet(key) { return this.__data__.get(key); } /** * Checks if a stack value for `key` exists. * * @private * @name has * @memberOf Stack * @param {string} key The key of the entry to check. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. */ function stackHas(key) { return this.__data__.has(key); } /** * Sets the stack `key` to `value`. * * @private * @name set * @memberOf Stack * @param {string} key The key of the value to set. * @param {*} value The value to set. * @returns {Object} Returns the stack cache instance. */ function stackSet(key, value) { var data = this.__data__; if (data instanceof ListCache) { var pairs = data.__data__; if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) { pairs.push([key, value]); this.size = ++data.size; return this; } data = this.__data__ = new MapCache(pairs); } data.set(key, value); this.size = data.size; return this; } // Add methods to `Stack`. Stack.prototype.clear = stackClear; Stack.prototype['delete'] = stackDelete; Stack.prototype.get = stackGet; Stack.prototype.has = stackHas; Stack.prototype.set = stackSet; /*------------------------------------------------------------------------*/ /** * Creates an array of the enumerable property names of the array-like `value`. * * @private * @param {*} value The value to query. * @param {boolean} inherited Specify returning inherited property names. * @returns {Array} Returns the array of property names. */ function arrayLikeKeys(value, inherited) { var isArr = isArray(value), isArg = !isArr && isArguments(value), isBuff = !isArr && !isArg && isBuffer(value), isType = !isArr && !isArg && !isBuff && isTypedArray(value), skipIndexes = isArr || isArg || isBuff || isType, result = skipIndexes ? baseTimes(value.length, String) : [], length = result.length; for (var key in value) { if ((inherited || hasOwnProperty.call(value, key)) && !(skipIndexes && ( // Safari 9 has enumerable `arguments.length` in strict mode. key == 'length' || // Node.js 0.10 has enumerable non-index properties on buffers. (isBuff && (key == 'offset' || key == 'parent')) || // PhantomJS 2 has enumerable non-index properties on typed arrays. (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) || // Skip index properties. isIndex(key, length) ))) { result.push(key); } } return result; } /** * A specialized version of `_.sample` for arrays. * * @private * @param {Array} array The array to sample. * @returns {*} Returns the random element. */ function arraySample(array) { var length = array.length; return length ? array[baseRandom(0, length - 1)] : undefined; } /** * A specialized version of `_.sampleSize` for arrays. * * @private * @param {Array} array The array to sample. * @param {number} n The number of elements to sample. * @returns {Array} Returns the random elements. */ function arraySampleSize(array, n) { return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length)); } /** * A specialized version of `_.shuffle` for arrays. * * @private * @param {Array} array The array to shuffle. * @returns {Array} Returns the new shuffled array. */ function arrayShuffle(array) { return shuffleSelf(copyArray(array)); } /** * This function is like `assignValue` except that it doesn't assign * `undefined` values. * * @private * @param {Object} object The object to modify. * @param {string} key The key of the property to assign. * @param {*} value The value to assign. */ function assignMergeValue(object, key, value) { if ((value !== undefined && !eq(object[key], value)) || (value === undefined && !(key in object))) { baseAssignValue(object, key, value); } } /** * Assigns `value` to `key` of `object` if the existing value is not equivalent * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * for equality comparisons. * * @private * @param {Object} object The object to modify. * @param {string} key The key of the property to assign. * @param {*} value The value to assign. */ function assignValue(object, key, value) { var objValue = object[key]; if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || (value === undefined && !(key in object))) { baseAssignValue(object, key, value); } } /** * Gets the index at which the `key` is found in `array` of key-value pairs. * * @private * @param {Array} array The array to inspect. * @param {*} key The key to search for. * @returns {number} Returns the index of the matched value, else `-1`. */ function assocIndexOf(array, key) { var length = array.length; while (length--) { if (eq(array[length][0], key)) { return length; } } return -1; } /** * Aggregates elements of `collection` on `accumulator` with keys transformed * by `iteratee` and values set by `setter`. * * @private * @param {Array|Object} collection The collection to iterate over. * @param {Function} setter The function to set `accumulator` values. * @param {Function} iteratee The iteratee to transform keys. * @param {Object} accumulator The initial aggregated object. * @returns {Function} Returns `accumulator`. */ function baseAggregator(collection, setter, iteratee, accumulator) { baseEach(collection, function(value, key, collection) { setter(accumulator, value, iteratee(value), collection); }); return accumulator; } /** * The base implementation of `_.assign` without support for multiple sources * or `customizer` functions. * * @private * @param {Object} object The destination object. * @param {Object} source The source object. * @returns {Object} Returns `object`. */ function baseAssign(object, source) { return object && copyObject(source, keys(source), object); } /** * The base implementation of `_.assignIn` without support for multiple sources * or `customizer` functions. * * @private * @param {Object} object The destination object. * @param {Object} source The source object. * @returns {Object} Returns `object`. */ function baseAssignIn(object, source) { return object && copyObject(source, keysIn(source), object); } /** * The base implementation of `assignValue` and `assignMergeValue` without * value checks. * * @private * @param {Object} object The object to modify. * @param {string} key The key of the property to assign. * @param {*} value The value to assign. */ function baseAssignValue(object, key, value) { if (key == '__proto__' && defineProperty) { defineProperty(object, key, { 'configurable': true, 'enumerable': true, 'value': value, 'writable': true }); } else { object[key] = value; } } /** * The base implementation of `_.at` without support for individual paths. * * @private * @param {Object} object The object to iterate over. * @param {string[]} paths The property paths to pick. * @returns {Array} Returns the picked elements. */ function baseAt(object, paths) { var index = -1, length = paths.length, result = Array(length), skip = object == null; while (++index < length) { result[index] = skip ? undefined : get(object, paths[index]); } return result; } /** * The base implementation of `_.clamp` which doesn't coerce arguments. * * @private * @param {number} number The number to clamp. * @param {number} [lower] The lower bound. * @param {number} upper The upper bound. * @returns {number} Returns the clamped number. */ function baseClamp(number, lower, upper) { if (number === number) { if (upper !== undefined) { number = number <= upper ? number : upper; } if (lower !== undefined) { number = number >= lower ? number : lower; } } return number; } /** * The base implementation of `_.clone` and `_.cloneDeep` which tracks * traversed objects. * * @private * @param {*} value The value to clone. * @param {boolean} bitmask The bitmask flags. * 1 - Deep clone * 2 - Flatten inherited properties * 4 - Clone symbols * @param {Function} [customizer] The function to customize cloning. * @param {string} [key] The key of `value`. * @param {Object} [object] The parent object of `value`. * @param {Object} [stack] Tracks traversed objects and their clone counterparts. * @returns {*} Returns the cloned value. */ function baseClone(value, bitmask, customizer, key, object, stack) { var result, isDeep = bitmask & CLONE_DEEP_FLAG, isFlat = bitmask & CLONE_FLAT_FLAG, isFull = bitmask & CLONE_SYMBOLS_FLAG; if (customizer) { result = object ? customizer(value, key, object, stack) : customizer(value); } if (result !== undefined) { return result; } if (!isObject(value)) { return value; } var isArr = isArray(value); if (isArr) { result = initCloneArray(value); if (!isDeep) { return copyArray(value, result); } } else { var tag = getTag(value), isFunc = tag == funcTag || tag == genTag; if (isBuffer(value)) { return cloneBuffer(value, isDeep); } if (tag == objectTag || tag == argsTag || (isFunc && !object)) { result = (isFlat || isFunc) ? {} : initCloneObject(value); if (!isDeep) { return isFlat ? copySymbolsIn(value, baseAssignIn(result, value)) : copySymbols(value, baseAssign(result, value)); } } else { if (!cloneableTags[tag]) { return object ? value : {}; } result = initCloneByTag(value, tag, isDeep); } } // Check for circular references and return its corresponding clone. stack || (stack = new Stack); var stacked = stack.get(value); if (stacked) { return stacked; } stack.set(value, result); if (isSet(value)) { value.forEach(function(subValue) { result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack)); }); } else if (isMap(value)) { value.forEach(function(subValue, key) { result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack)); }); } var keysFunc = isFull ? (isFlat ? getAllKeysIn : getAllKeys) : (isFlat ? keysIn : keys); var props = isArr ? undefined : keysFunc(value); arrayEach(props || value, function(subValue, key) { if (props) { key = subValue; subValue = value[key]; } // Recursively populate clone (susceptible to call stack limits). assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack)); }); return result; } /** * The base implementation of `_.conforms` which doesn't clone `source`. * * @private * @param {Object} source The object of property predicates to conform to. * @returns {Function} Returns the new spec function. */ function baseConforms(source) { var props = keys(source); return function(object) { return baseConformsTo(object, source, props); }; } /** * The base implementation of `_.conformsTo` which accepts `props` to check. * * @private * @param {Object} object The object to inspect. * @param {Object} source The object of property predicates to conform to. * @returns {boolean} Returns `true` if `object` conforms, else `false`. */ function baseConformsTo(object, source, props) { var length = props.length; if (object == null) { return !length; } object = Object(object); while (length--) { var key = props[length], predicate = source[key], value = object[key]; if ((value === undefined && !(key in object)) || !predicate(value)) { return false; } } return true; } /** * The base implementation of `_.delay` and `_.defer` which accepts `args` * to provide to `func`. * * @private * @param {Function} func The function to delay. * @param {number} wait The number of milliseconds to delay invocation. * @param {Array} args The arguments to provide to `func`. * @returns {number|Object} Returns the timer id or timeout object. */ function baseDelay(func, wait, args) { if (typeof func != 'function') { throw new TypeError(FUNC_ERROR_TEXT); } return setTimeout(function() { func.apply(undefined, args); }, wait); } /** * The base implementation of methods like `_.difference` without support * for excluding multiple arrays or iteratee shorthands. * * @private * @param {Array} array The array to inspect. * @param {Array} values The values to exclude. * @param {Function} [iteratee] The iteratee invoked per element. * @param {Function} [comparator] The comparator invoked per element. * @returns {Array} Returns the new array of filtered values. */ function baseDifference(array, values, iteratee, comparator) { var index = -1, includes = arrayIncludes, isCommon = true, length = array.length, result = [], valuesLength = values.length; if (!length) { return result; } if (iteratee) { values = arrayMap(values, baseUnary(iteratee)); } if (comparator) { includes = arrayIncludesWith; isCommon = false; } else if (values.length >= LARGE_ARRAY_SIZE) { includes = cacheHas; isCommon = false; values = new SetCache(values); } outer: while (++index < length) { var value = array[index], computed = iteratee == null ? value : iteratee(value); value = (comparator || value !== 0) ? value : 0; if (isCommon && computed === computed) { var valuesIndex = valuesLength; while (valuesIndex--) { if (values[valuesIndex] === computed) { continue outer; } } result.push(value); } else if (!includes(values, computed, comparator)) { result.push(value); } } return result; } /** * The base implementation of `_.forEach` without support for iteratee shorthands. * * @private * @param {Array|Object} collection The collection to iterate over. * @param {Function} iteratee The function invoked per iteration. * @returns {Array|Object} Returns `collection`. */ var baseEach = createBaseEach(baseForOwn); /** * The base implementation of `_.forEachRight` without support for iteratee shorthands. * * @private * @param {Array|Object} collection The collection to iterate over. * @param {Function} iteratee The function invoked per iteration. * @returns {Array|Object} Returns `collection`. */ var baseEachRight = createBaseEach(baseForOwnRight, true); /** * The base implementation of `_.every` without support for iteratee shorthands. * * @private * @param {Array|Object} collection The collection to iterate over. * @param {Function} predicate The function invoked per iteration. * @returns {boolean} Returns `true` if all elements pass the predicate check, * else `false` */ function baseEvery(collection, predicate) { var result = true; baseEach(collection, function(value, index, collection) { result = !!predicate(value, index, collection); return result; }); return result; } /** * The base implementation of methods like `_.max` and `_.min` which accepts a * `comparator` to determine the extremum value. * * @private * @param {Array} array The array to iterate over. * @param {Function} iteratee The iteratee invoked per iteration. * @param {Function} comparator The comparator used to compare values. * @returns {*} Returns the extremum value. */ function baseExtremum(array, iteratee, comparator) { var index = -1, length = array.length; while (++index < length) { var value = array[index], current = iteratee(value); if (current != null && (computed === undefined ? (current === current && !isSymbol(current)) : comparator(current, computed) )) { var computed = current, result = value; } } return result; } /** * The base implementation of `_.fill` without an iteratee call guard. * * @private * @param {Array} array The array to fill. * @param {*} value The value to fill `array` with. * @param {number} [start=0] The start position. * @param {number} [end=array.length] The end position. * @returns {Array} Returns `array`. */ function baseFill(array, value, start, end) { var length = array.length; start = toInteger(start); if (start < 0) { start = -start > length ? 0 : (length + start); } end = (end === undefined || end > length) ? length : toInteger(end); if (end < 0) { end += length; } end = start > end ? 0 : toLength(end); while (start < end) { array[start++] = value; } return array; } /** * The base implementation of `_.filter` without support for iteratee shorthands. * * @private * @param {Array|Object} collection The collection to iterate over. * @param {Function} predicate The function invoked per iteration. * @returns {Array} Returns the new filtered array. */ function baseFilter(collection, predicate) { var result = []; baseEach(collection, function(value, index, collection) { if (predicate(value, index, collection)) { result.push(value); } }); return result; } /** * The base implementation of `_.flatten` with support for restricting flattening. * * @private * @param {Array} array The array to flatten. * @param {number} depth The maximum recursion depth. * @param {boolean} [predicate=isFlattenable] The function invoked per iteration. * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks. * @param {Array} [result=[]] The initial result value. * @returns {Array} Returns the new flattened array. */ function baseFlatten(array, depth, predicate, isStrict, result) { var index = -1, length = array.length; predicate || (predicate = isFlattenable); result || (result = []); while (++index < length) { var value = array[index]; if (depth > 0 && predicate(value)) { if (depth > 1) { // Recursively flatten arrays (susceptible to call stack limits). baseFlatten(value, depth - 1, predicate, isStrict, result); } else { arrayPush(result, value); } } else if (!isStrict) { result[result.length] = value; } } return result; } /** * The base implementation of `baseForOwn` which iterates over `object` * properties returned by `keysFunc` and invokes `iteratee` for each property. * Iteratee functions may exit iteration early by explicitly returning `false`. * * @private * @param {Object} object The object to iterate over. * @param {Function} iteratee The function invoked per iteration. * @param {Function} keysFunc The function to get the keys of `object`. * @returns {Object} Returns `object`. */ var baseFor = createBaseFor(); /** * This function is like `baseFor` except that it iterates over properties * in the opposite order. * * @private * @param {Object} object The object to iterate over. * @param {Function} iteratee The function invoked per iteration. * @param {Function} keysFunc The function to get the keys of `object`. * @returns {Object} Returns `object`. */ var baseForRight = createBaseFor(true); /** * The base implementation of `_.forOwn` without support for iteratee shorthands. * * @private * @param {Object} object The object to iterate over. * @param {Function} iteratee The function invoked per iteration. * @returns {Object} Returns `object`. */ function baseForOwn(object, iteratee) { return object && baseFor(object, iteratee, keys); } /** * The base implementation of `_.forOwnRight` without support for iteratee shorthands. * * @private * @param {Object} object The object to iterate over. * @param {Function} iteratee The function invoked per iteration. * @returns {Object} Returns `object`. */ function baseForOwnRight(object, iteratee) { return object && baseForRight(object, iteratee, keys); } /** * The base implementation of `_.functions` which creates an array of * `object` function property names filtered from `props`. * * @private * @param {Object} object The object to inspect. * @param {Array} props The property names to filter. * @returns {Array} Returns the function names. */ function baseFunctions(object, props) { return arrayFilter(props, function(key) { return isFunction(object[key]); }); } /** * The base implementation of `_.get` without support for default values. * * @private * @param {Object} object The object to query. * @param {Array|string} path The path of the property to get. * @returns {*} Returns the resolved value. */ function baseGet(object, path) { path = castPath(path, object); var index = 0, length = path.length; while (object != null && index < length) { object = object[toKey(path[index++])]; } return (index && index == length) ? object : undefined; } /** * The base implementation of `getAllKeys` and `getAllKeysIn` which uses * `keysFunc` and `symbolsFunc` to get the enumerable property names and * symbols of `object`. * * @private * @param {Object} object The object to query. * @param {Function} keysFunc The function to get the keys of `object`. * @param {Function} symbolsFunc The function to get the symbols of `object`. * @returns {Array} Returns the array of property names and symbols. */ function baseGetAllKeys(object, keysFunc, symbolsFunc) { var result = keysFunc(object); return isArray(object) ? result : arrayPush(result, symbolsFunc(object)); } /** * The base implementation of `getTag` without fallbacks for buggy environments. * * @private * @param {*} value The value to query. * @returns {string} Returns the `toStringTag`. */ function baseGetTag(value) { if (value == null) { return value === undefined ? undefinedTag : nullTag; } return (symToStringTag && symToStringTag in Object(value)) ? getRawTag(value) : objectToString(value); } /** * The base implementation of `_.gt` which doesn't coerce arguments. * * @private * @param {*} value The value to compare. * @param {*} other The other value to compare. * @returns {boolean} Returns `true` if `value` is greater than `other`, * else `false`. */ function baseGt(value, other) { return value > other; } /** * The base implementation of `_.has` without support for deep paths. * * @private * @param {Object} [object] The object to query. * @param {Array|string} key The key to check. * @returns {boolean} Returns `true` if `key` exists, else `false`. */ function baseHas(object, key) { return object != null && hasOwnProperty.call(object, key); } /** * The base implementation of `_.hasIn` without support for deep paths. * * @private * @param {Object} [object] The object to query. * @param {Array|string} key The key to check. * @returns {boolean} Returns `true` if `key` exists, else `false`. */ function baseHasIn(object, key) { return object != null && key in Object(object); } /** * The base implementation of `_.inRange` which doesn't coerce arguments. * * @private * @param {number} number The number to check. * @param {number} start The start of the range. * @param {number} end The end of the range. * @returns {boolean} Returns `true` if `number` is in the range, else `false`. */ function baseInRange(number, start, end) { return number >= nativeMin(start, end) && number < nativeMax(start, end); } /** * The base implementation of methods like `_.intersection`, without support * for iteratee shorthands, that accepts an array of arrays to inspect. * * @private * @param {Array} arrays The arrays to inspect. * @param {Function} [iteratee] The iteratee invoked per element. * @param {Function} [comparator] The comparator invoked per element. * @returns {Array} Returns the new array of shared values. */ function baseIntersection(arrays, iteratee, comparator) { var includes = comparator ? arrayIncludesWith : arrayIncludes, length = arrays[0].length, othLength = arrays.length, othIndex = othLength, caches = Array(othLength), maxLength = Infinity, result = []; while (othIndex--) { var array = arrays[othIndex]; if (othIndex && iteratee) { array = arrayMap(array, baseUnary(iteratee)); } maxLength = nativeMin(array.length, maxLength); caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120)) ? new SetCache(othIndex && array) : undefined; } array = arrays[0]; var index = -1, seen = caches[0]; outer: while (++index < length && result.length < maxLength) { var value = array[index], computed = iteratee ? iteratee(value) : value; value = (comparator || value !== 0) ? value : 0; if (!(seen ? cacheHas(seen, computed) : includes(result, computed, comparator) )) { othIndex = othLength; while (--othIndex) { var cache = caches[othIndex]; if (!(cache ? cacheHas(cache, computed) : includes(arrays[othIndex], computed, comparator)) ) { continue outer; } } if (seen) { seen.push(computed); } result.push(value); } } return result; } /** * The base implementation of `_.invert` and `_.invertBy` which inverts * `object` with values transformed by `iteratee` and set by `setter`. * * @private * @param {Object} object The object to iterate over. * @param {Function} setter The function to set `accumulator` values. * @param {Function} iteratee The iteratee to transform values. * @param {Object} accumulator The initial inverted object. * @returns {Function} Returns `accumulator`. */ function baseInverter(object, setter, iteratee, accumulator) { baseForOwn(object, function(value, key, object) { setter(accumulator, iteratee(value), key, object); }); return accumulator; } /** * The base implementation of `_.invoke` without support for individual * method arguments. * * @private * @param {Object} object The object to query. * @param {Array|string} path The path of the method to invoke. * @param {Array} args The arguments to invoke the method with. * @returns {*} Returns the result of the invoked method. */ function baseInvoke(object, path, args) { path = castPath(path, object); object = parent(object, path); var func = object == null ? object : object[toKey(last(path))]; return func == null ? undefined : apply(func, object, args); } /** * The base implementation of `_.isArguments`. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an `arguments` object, */ function baseIsArguments(value) { return isObjectLike(value) && baseGetTag(value) == argsTag; } /** * The base implementation of `_.isArrayBuffer` without Node.js optimizations. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`. */ function baseIsArrayBuffer(value) { return isObjectLike(value) && baseGetTag(value) == arrayBufferTag; } /** * The base implementation of `_.isDate` without Node.js optimizations. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a date object, else `false`. */ function baseIsDate(value) { return isObjectLike(value) && baseGetTag(value) == dateTag; } /** * The base implementation of `_.isEqual` which supports partial comparisons * and tracks traversed objects. * * @private * @param {*} value The value to compare. * @param {*} other The other value to compare. * @param {boolean} bitmask The bitmask flags. * 1 - Unordered comparison * 2 - Partial comparison * @param {Function} [customizer] The function to customize comparisons. * @param {Object} [stack] Tracks traversed `value` and `other` objects. * @returns {boolean} Returns `true` if the values are equivalent, else `false`. */ function baseIsEqual(value, other, bitmask, customizer, stack) { if (value === other) { return true; } if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) { return value !== value && other !== other; } return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack); } /** * A specialized version of `baseIsEqual` for arrays and objects which performs * deep comparisons and tracks traversed objects enabling objects with circular * references to be compared. * * @private * @param {Object} object The object to compare. * @param {Object} other The other object to compare. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. * @param {Function} customizer The function to customize comparisons. * @param {Function} equalFunc The function to determine equivalents of values. * @param {Object} [stack] Tracks traversed `object` and `other` objects. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. */ function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) { var objIsArr = isArray(object), othIsArr = isArray(other), objTag = objIsArr ? arrayTag : getTag(object), othTag = othIsArr ? arrayTag : getTag(other); objTag = objTag == argsTag ? objectTag : objTag; othTag = othTag == argsTag ? objectTag : othTag; var objIsObj = objTag == objectTag, othIsObj = othTag == objectTag, isSameTag = objTag == othTag; if (isSameTag && isBuffer(object)) { if (!isBuffer(other)) { return false; } objIsArr = true; objIsObj = false; } if (isSameTag && !objIsObj) { stack || (stack = new Stack); return (objIsArr || isTypedArray(object)) ? equalArrays(object, other, bitmask, customizer, equalFunc, stack) : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack); } if (!(bitmask & COMPARE_PARTIAL_FLAG)) { var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'), othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__'); if (objIsWrapped || othIsWrapped) { var objUnwrapped = objIsWrapped ? object.value() : object, othUnwrapped = othIsWrapped ? other.value() : other; stack || (stack = new Stack); return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack); } } if (!isSameTag) { return false; } stack || (stack = new Stack); return equalObjects(object, other, bitmask, customizer, equalFunc, stack); } /** * The base implementation of `_.isMap` without Node.js optimizations. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a map, else `false`. */ function baseIsMap(value) { return isObjectLike(value) && getTag(value) == mapTag; } /** * The base implementation of `_.isMatch` without support for iteratee shorthands. * * @private * @param {Object} object The object to inspect. * @param {Object} source The object of property values to match. * @param {Array} matchData The property names, values, and compare flags to match. * @param {Function} [customizer] The function to customize comparisons. * @returns {boolean} Returns `true` if `object` is a match, else `false`. */ function baseIsMatch(object, source, matchData, customizer) { var index = matchData.length, length = index, noCustomizer = !customizer; if (object == null) { return !length; } object = Object(object); while (index--) { var data = matchData[index]; if ((noCustomizer && data[2]) ? data[1] !== object[data[0]] : !(data[0] in object) ) { return false; } } while (++index < length) { data = matchData[index]; var key = data[0], objValue = object[key], srcValue = data[1]; if (noCustomizer && data[2]) { if (objValue === undefined && !(key in object)) { return false; } } else { var stack = new Stack; if (customizer) { var result = customizer(objValue, srcValue, key, object, source, stack); } if (!(result === undefined ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack) : result )) { return false; } } } return true; } /** * The base implementation of `_.isNative` without bad shim checks. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a native function, * else `false`. */ function baseIsNative(value) { if (!isObject(value) || isMasked(value)) { return false; } var pattern = isFunction(value) ? reIsNative : reIsHostCtor; return pattern.test(toSource(value)); } /** * The base implementation of `_.isRegExp` without Node.js optimizations. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`. */ function baseIsRegExp(value) { return isObjectLike(value) && baseGetTag(value) == regexpTag; } /** * The base implementation of `_.isSet` without Node.js optimizations. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a set, else `false`. */ function baseIsSet(value) { return isObjectLike(value) && getTag(value) == setTag; } /** * The base implementation of `_.isTypedArray` without Node.js optimizations. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. */ function baseIsTypedArray(value) { return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[baseGetTag(value)]; } /** * The base implementation of `_.iteratee`. * * @private * @param {*} [value=_.identity] The value to convert to an iteratee. * @returns {Function} Returns the iteratee. */ function baseIteratee(value) { // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9. // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details. if (typeof value == 'function') { return value; } if (value == null) { return identity; } if (typeof value == 'object') { return isArray(value) ? baseMatchesProperty(value[0], value[1]) : baseMatches(value); } return property(value); } /** * The base implementation of `_.keys` which doesn't treat sparse arrays as dense. * * @private * @param {Object} object The object to query. * @returns {Array} Returns the array of property names. */ function baseKeys(object) { if (!isPrototype(object)) { return nativeKeys(object); } var result = []; for (var key in Object(object)) { if (hasOwnProperty.call(object, key) && key != 'constructor') { result.push(key); } } return result; } /** * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense. * * @private * @param {Object} object The object to query. * @returns {Array} Returns the array of property names. */ function baseKeysIn(object) { if (!isObject(object)) { return nativeKeysIn(object); } var isProto = isPrototype(object), result = []; for (var key in object) { if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) { result.push(key); } } return result; } /** * The base implementation of `_.lt` which doesn't coerce arguments. * * @private * @param {*} value The value to compare. * @param {*} other The other value to compare. * @returns {boolean} Returns `true` if `value` is less than `other`, * else `false`. */ function baseLt(value, other) { return value < other; } /** * The base implementation of `_.map` without support for iteratee shorthands. * * @private * @param {Array|Object} collection The collection to iterate over. * @param {Function} iteratee The function invoked per iteration. * @returns {Array} Returns the new mapped array. */ function baseMap(collection, iteratee) { var index = -1, result = isArrayLike(collection) ? Array(collection.length) : []; baseEach(collection, function(value, key, collection) { result[++index] = iteratee(value, key, collection); }); return result; } /** * The base implementation of `_.matches` which doesn't clone `source`. * * @private * @param {Object} source The object of property values to match. * @returns {Function} Returns the new spec function. */ function baseMatches(source) { var matchData = getMatchData(source); if (matchData.length == 1 && matchData[0][2]) { return matchesStrictComparable(matchData[0][0], matchData[0][1]); } return function(object) { return object === source || baseIsMatch(object, source, matchData); }; } /** * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`. * * @private * @param {string} path The path of the property to get. * @param {*} srcValue The value to match. * @returns {Function} Returns the new spec function. */ function baseMatchesProperty(path, srcValue) { if (isKey(path) && isStrictComparable(srcValue)) { return matchesStrictComparable(toKey(path), srcValue); } return function(object) { var objValue = get(object, path); return (objValue === undefined && objValue === srcValue) ? hasIn(object, path) : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG); }; } /** * The base implementation of `_.merge` without support for multiple sources. * * @private * @param {Object} object The destination object. * @param {Object} source The source object. * @param {number} srcIndex The index of `source`. * @param {Function} [customizer] The function to customize merged values. * @param {Object} [stack] Tracks traversed source values and their merged * counterparts. */ function baseMerge(object, source, srcIndex, customizer, stack) { if (object === source) { return; } baseFor(source, function(srcValue, key) { stack || (stack = new Stack); if (isObject(srcValue)) { baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack); } else { var newValue = customizer ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack) : undefined; if (newValue === undefined) { newValue = srcValue; } assignMergeValue(object, key, newValue); } }, keysIn); } /** * A specialized version of `baseMerge` for arrays and objects which performs * deep merges and tracks traversed objects enabling objects with circular * references to be merged. * * @private * @param {Object} object The destination object. * @param {Object} source The source object. * @param {string} key The key of the value to merge. * @param {number} srcIndex The index of `source`. * @param {Function} mergeFunc The function to merge values. * @param {Function} [customizer] The function to customize assigned values. * @param {Object} [stack] Tracks traversed source values and their merged * counterparts. */ function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) { var objValue = safeGet(object, key), srcValue = safeGet(source, key), stacked = stack.get(srcValue); if (stacked) { assignMergeValue(object, key, stacked); return; } var newValue = customizer ? customizer(objValue, srcValue, (key + ''), object, source, stack) : undefined; var isCommon = newValue === undefined; if (isCommon) { var isArr = isArray(srcValue), isBuff = !isArr && isBuffer(srcValue), isTyped = !isArr && !isBuff && isTypedArray(srcValue); newValue = srcValue; if (isArr || isBuff || isTyped) { if (isArray(objValue)) { newValue = objValue; } else if (isArrayLikeObject(objValue)) { newValue = copyArray(objValue); } else if (isBuff) { isCommon = false; newValue = cloneBuffer(srcValue, true); } else if (isTyped) { isCommon = false; newValue = cloneTypedArray(srcValue, true); } else { newValue = []; } } else if (isPlainObject(srcValue) || isArguments(srcValue)) { newValue = objValue; if (isArguments(objValue)) { newValue = toPlainObject(objValue); } else if (!isObject(objValue) || isFunction(objValue)) { newValue = initCloneObject(srcValue); } } else { isCommon = false; } } if (isCommon) { // Recursively merge objects and arrays (susceptible to call stack limits). stack.set(srcValue, newValue); mergeFunc(newValue, srcValue, srcIndex, customizer, stack); stack['delete'](srcValue); } assignMergeValue(object, key, newValue); } /** * The base implementation of `_.nth` which doesn't coerce arguments. * * @private * @param {Array} array The array to query. * @param {number} n The index of the element to return. * @returns {*} Returns the nth element of `array`. */ function baseNth(array, n) { var length = array.length; if (!length) { return; } n += n < 0 ? length : 0; return isIndex(n, length) ? array[n] : undefined; } /** * The base implementation of `_.orderBy` without param guards. * * @private * @param {Array|Object} collection The collection to iterate over. * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by. * @param {string[]} orders The sort orders of `iteratees`. * @returns {Array} Returns the new sorted array. */ function baseOrderBy(collection, iteratees, orders) { if (iteratees.length) { iteratees = arrayMap(iteratees, function(iteratee) { if (isArray(iteratee)) { return function(value) { return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee); } } return iteratee; }); } else { iteratees = [identity]; } var index = -1; iteratees = arrayMap(iteratees, baseUnary(getIteratee())); var result = baseMap(collection, function(value, key, collection) { var criteria = arrayMap(iteratees, function(iteratee) { return iteratee(value); }); return { 'criteria': criteria, 'index': ++index, 'value': value }; }); return baseSortBy(result, function(object, other) { return compareMultiple(object, other, orders); }); } /** * The base implementation of `_.pick` without support for individual * property identifiers. * * @private * @param {Object} object The source object. * @param {string[]} paths The property paths to pick. * @returns {Object} Returns the new object. */ function basePick(object, paths) { return basePickBy(object, paths, function(value, path) { return hasIn(object, path); }); } /** * The base implementation of `_.pickBy` without support for iteratee shorthands. * * @private * @param {Object} object The source object. * @param {string[]} paths The property paths to pick. * @param {Function} predicate The function invoked per property. * @returns {Object} Returns the new object. */ function basePickBy(object, paths, predicate) { var index = -1, length = paths.length, result = {}; while (++index < length) { var path = paths[index], value = baseGet(object, path); if (predicate(value, path)) { baseSet(result, castPath(path, object), value); } } return result; } /** * A specialized version of `baseProperty` which supports deep paths. * * @private * @param {Array|string} path The path of the property to get. * @returns {Function} Returns the new accessor function. */ function basePropertyDeep(path) { return function(object) { return baseGet(object, path); }; } /** * The base implementation of `_.pullAllBy` without support for iteratee * shorthands. * * @private * @param {Array} array The array to modify. * @param {Array} values The values to remove. * @param {Function} [iteratee] The iteratee invoked per element. * @param {Function} [comparator] The comparator invoked per element. * @returns {Array} Returns `array`. */ function basePullAll(array, values, iteratee, comparator) { var indexOf = comparator ? baseIndexOfWith : baseIndexOf, index = -1, length = values.length, seen = array; if (array === values) { values = copyArray(values); } if (iteratee) { seen = arrayMap(array, baseUnary(iteratee)); } while (++index < length) { var fromIndex = 0, value = values[index], computed = iteratee ? iteratee(value) : value; while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) { if (seen !== array) { splice.call(seen, fromIndex, 1); } splice.call(array, fromIndex, 1); } } return array; } /** * The base implementation of `_.pullAt` without support for individual * indexes or capturing the removed elements. * * @private * @param {Array} array The array to modify. * @param {number[]} indexes The indexes of elements to remove. * @returns {Array} Returns `array`. */ function basePullAt(array, indexes) { var length = array ? indexes.length : 0, lastIndex = length - 1; while (length--) { var index = indexes[length]; if (length == lastIndex || index !== previous) { var previous = index; if (isIndex(index)) { splice.call(array, index, 1); } else { baseUnset(array, index); } } } return array; } /** * The base implementation of `_.random` without support for returning * floating-point numbers. * * @private * @param {number} lower The lower bound. * @param {number} upper The upper bound. * @returns {number} Returns the random number. */ function baseRandom(lower, upper) { return lower + nativeFloor(nativeRandom() * (upper - lower + 1)); } /** * The base implementation of `_.range` and `_.rangeRight` which doesn't * coerce arguments. * * @private * @param {number} start The start of the range. * @param {number} end The end of the range. * @param {number} step The value to increment or decrement by. * @param {boolean} [fromRight] Specify iterating from right to left. * @returns {Array} Returns the range of numbers. */ function baseRange(start, end, step, fromRight) { var index = -1, length = nativeMax(nativeCeil((end - start) / (step || 1)), 0), result = Array(length); while (length--) { result[fromRight ? length : ++index] = start; start += step; } return result; } /** * The base implementation of `_.repeat` which doesn't coerce arguments. * * @private * @param {string} string The string to repeat. * @param {number} n The number of times to repeat the string. * @returns {string} Returns the repeated string. */ function baseRepeat(string, n) { var result = ''; if (!string || n < 1 || n > MAX_SAFE_INTEGER) { return result; } // Leverage the exponentiation by squaring algorithm for a faster repeat. // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details. do { if (n % 2) { result += string; } n = nativeFloor(n / 2); if (n) { string += string; } } while (n); return result; } /** * The base implementation of `_.rest` which doesn't validate or coerce arguments. * * @private * @param {Function} func The function to apply a rest parameter to. * @param {number} [start=func.length-1] The start position of the rest parameter. * @returns {Function} Returns the new function. */ function baseRest(func, start) { return setToString(overRest(func, start, identity), func + ''); } /** * The base implementation of `_.sample`. * * @private * @param {Array|Object} collection The collection to sample. * @returns {*} Returns the random element. */ function baseSample(collection) { return arraySample(values(collection)); } /** * The base implementation of `_.sampleSize` without param guards. * * @private * @param {Array|Object} collection The collection to sample. * @param {number} n The number of elements to sample. * @returns {Array} Returns the random elements. */ function baseSampleSize(collection, n) { var array = values(collection); return shuffleSelf(array, baseClamp(n, 0, array.length)); } /** * The base implementation of `_.set`. * * @private * @param {Object} object The object to modify. * @param {Array|string} path The path of the property to set. * @param {*} value The value to set. * @param {Function} [customizer] The function to customize path creation. * @returns {Object} Returns `object`. */ function baseSet(object, path, value, customizer) { if (!isObject(object)) { return object; } path = castPath(path, object); var index = -1, length = path.length, lastIndex = length - 1, nested = object; while (nested != null && ++index < length) { var key = toKey(path[index]), newValue = value; if (key === '__proto__' || key === 'constructor' || key === 'prototype') { return object; } if (index != lastIndex) { var objValue = nested[key]; newValue = customizer ? customizer(objValue, key, nested) : undefined; if (newValue === undefined) { newValue = isObject(objValue) ? objValue : (isIndex(path[index + 1]) ? [] : {}); } } assignValue(nested, key, newValue); nested = nested[key]; } return object; } /** * The base implementation of `setData` without support for hot loop shorting. * * @private * @param {Function} func The function to associate metadata with. * @param {*} data The metadata. * @returns {Function} Returns `func`. */ var baseSetData = !metaMap ? identity : function(func, data) { metaMap.set(func, data); return func; }; /** * The base implementation of `setToString` without support for hot loop shorting. * * @private * @param {Function} func The function to modify. * @param {Function} string The `toString` result. * @returns {Function} Returns `func`. */ var baseSetToString = !defineProperty ? identity : function(func, string) { return defineProperty(func, 'toString', { 'configurable': true, 'enumerable': false, 'value': constant(string), 'writable': true }); }; /** * The base implementation of `_.shuffle`. * * @private * @param {Array|Object} collection The collection to shuffle. * @returns {Array} Returns the new shuffled array. */ function baseShuffle(collection) { return shuffleSelf(values(collection)); } /** * The base implementation of `_.slice` without an iteratee call guard. * * @private * @param {Array} array The array to slice. * @param {number} [start=0] The start position. * @param {number} [end=array.length] The end position. * @returns {Array} Returns the slice of `array`. */ function baseSlice(array, start, end) { var index = -1, length = array.length; if (start < 0) { start = -start > length ? 0 : (length + start); } end = end > length ? length : end; if (end < 0) { end += length; } length = start > end ? 0 : ((end - start) >>> 0); start >>>= 0; var result = Array(length); while (++index < length) { result[index] = array[index + start]; } return result; } /** * The base implementation of `_.some` without support for iteratee shorthands. * * @private * @param {Array|Object} collection The collection to iterate over. * @param {Function} predicate The function invoked per iteration. * @returns {boolean} Returns `true` if any element passes the predicate check, * else `false`. */ function baseSome(collection, predicate) { var result; baseEach(collection, function(value, index, collection) { result = predicate(value, index, collection); return !result; }); return !!result; } /** * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which * performs a binary search of `array` to determine the index at which `value` * should be inserted into `array` in order to maintain its sort order. * * @private * @param {Array} array The sorted array to inspect. * @param {*} value The value to evaluate. * @param {boolean} [retHighest] Specify returning the highest qualified index. * @returns {number} Returns the index at which `value` should be inserted * into `array`. */ function baseSortedIndex(array, value, retHighest) { var low = 0, high = array == null ? low : array.length; if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) { while (low < high) { var mid = (low + high) >>> 1, computed = array[mid]; if (computed !== null && !isSymbol(computed) && (retHighest ? (computed <= value) : (computed < value))) { low = mid + 1; } else { high = mid; } } return high; } return baseSortedIndexBy(array, value, identity, retHighest); } /** * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy` * which invokes `iteratee` for `value` and each element of `array` to compute * their sort ranking. The iteratee is invoked with one argument; (value). * * @private * @param {Array} array The sorted array to inspect. * @param {*} value The value to evaluate. * @param {Function} iteratee The iteratee invoked per element. * @param {boolean} [retHighest] Specify returning the highest qualified index. * @returns {number} Returns the index at which `value` should be inserted * into `array`. */ function baseSortedIndexBy(array, value, iteratee, retHighest) { var low = 0, high = array == null ? 0 : array.length; if (high === 0) { return 0; } value = iteratee(value); var valIsNaN = value !== value, valIsNull = value === null, valIsSymbol = isSymbol(value), valIsUndefined = value === undefined; while (low < high) { var mid = nativeFloor((low + high) / 2), computed = iteratee(array[mid]), othIsDefined = computed !== undefined, othIsNull = computed === null, othIsReflexive = computed === computed, othIsSymbol = isSymbol(computed); if (valIsNaN) { var setLow = retHighest || othIsReflexive; } else if (valIsUndefined) { setLow = othIsReflexive && (retHighest || othIsDefined); } else if (valIsNull) { setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull); } else if (valIsSymbol) { setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol); } else if (othIsNull || othIsSymbol) { setLow = false; } else { setLow = retHighest ? (computed <= value) : (computed < value); } if (setLow) { low = mid + 1; } else { high = mid; } } return nativeMin(high, MAX_ARRAY_INDEX); } /** * The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without * support for iteratee shorthands. * * @private * @param {Array} array The array to inspect. * @param {Function} [iteratee] The iteratee invoked per element. * @returns {Array} Returns the new duplicate free array. */ function baseSortedUniq(array, iteratee) { var index = -1, length = array.length, resIndex = 0, result = []; while (++index < length) { var value = array[index], computed = iteratee ? iteratee(value) : value; if (!index || !eq(computed, seen)) { var seen = computed; result[resIndex++] = value === 0 ? 0 : value; } } return result; } /** * The base implementation of `_.toNumber` which doesn't ensure correct * conversions of binary, hexadecimal, or octal string values. * * @private * @param {*} value The value to process. * @returns {number} Returns the number. */ function baseToNumber(value) { if (typeof value == 'number') { return value; } if (isSymbol(value)) { return NAN; } return +value; } /** * The base implementation of `_.toString` which doesn't convert nullish * values to empty strings. * * @private * @param {*} value The value to process. * @returns {string} Returns the string. */ function baseToString(value) { // Exit early for strings to avoid a performance hit in some environments. if (typeof value == 'string') { return value; } if (isArray(value)) { // Recursively convert values (susceptible to call stack limits). return arrayMap(value, baseToString) + ''; } if (isSymbol(value)) { return symbolToString ? symbolToString.call(value) : ''; } var result = (value + ''); return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; } /** * The base implementation of `_.uniqBy` without support for iteratee shorthands. * * @private * @param {Array} array The array to inspect. * @param {Function} [iteratee] The iteratee invoked per element. * @param {Function} [comparator] The comparator invoked per element. * @returns {Array} Returns the new duplicate free array. */ function baseUniq(array, iteratee, comparator) { var index = -1, includes = arrayIncludes, length = array.length, isCommon = true, result = [], seen = result; if (comparator) { isCommon = false; includes = arrayIncludesWith; } else if (length >= LARGE_ARRAY_SIZE) { var set = iteratee ? null : createSet(array); if (set) { return setToArray(set); } isCommon = false; includes = cacheHas; seen = new SetCache; } else { seen = iteratee ? [] : result; } outer: while (++index < length) { var value = array[index], computed = iteratee ? iteratee(value) : value; value = (comparator || value !== 0) ? value : 0; if (isCommon && computed === computed) { var seenIndex = seen.length; while (seenIndex--) { if (seen[seenIndex] === computed) { continue outer; } } if (iteratee) { seen.push(computed); } result.push(value); } else if (!includes(seen, computed, comparator)) { if (seen !== result) { seen.push(computed); } result.push(value); } } return result; } /** * The base implementation of `_.unset`. * * @private * @param {Object} object The object to modify. * @param {Array|string} path The property path to unset. * @returns {boolean} Returns `true` if the property is deleted, else `false`. */ function baseUnset(object, path) { path = castPath(path, object); object = parent(object, path); return object == null || delete object[toKey(last(path))]; } /** * The base implementation of `_.update`. * * @private * @param {Object} object The object to modify. * @param {Array|string} path The path of the property to update. * @param {Function} updater The function to produce the updated value. * @param {Function} [customizer] The function to customize path creation. * @returns {Object} Returns `object`. */ function baseUpdate(object, path, updater, customizer) { return baseSet(object, path, updater(baseGet(object, path)), customizer); } /** * The base implementation of methods like `_.dropWhile` and `_.takeWhile` * without support for iteratee shorthands. * * @private * @param {Array} array The array to query. * @param {Function} predicate The function invoked per iteration. * @param {boolean} [isDrop] Specify dropping elements instead of taking them. * @param {boolean} [fromRight] Specify iterating from right to left. * @returns {Array} Returns the slice of `array`. */ function baseWhile(array, predicate, isDrop, fromRight) { var length = array.length, index = fromRight ? length : -1; while ((fromRight ? index-- : ++index < length) && predicate(array[index], index, array)) {} return isDrop ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length)) : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index)); } /** * The base implementation of `wrapperValue` which returns the result of * performing a sequence of actions on the unwrapped `value`, where each * successive action is supplied the return value of the previous. * * @private * @param {*} value The unwrapped value. * @param {Array} actions Actions to perform to resolve the unwrapped value. * @returns {*} Returns the resolved value. */ function baseWrapperValue(value, actions) { var result = value; if (result instanceof LazyWrapper) { result = result.value(); } return arrayReduce(actions, function(result, action) { return action.func.apply(action.thisArg, arrayPush([result], action.args)); }, result); } /** * The base implementation of methods like `_.xor`, without support for * iteratee shorthands, that accepts an array of arrays to inspect. * * @private * @param {Array} arrays The arrays to inspect. * @param {Function} [iteratee] The iteratee invoked per element. * @param {Function} [comparator] The comparator invoked per element. * @returns {Array} Returns the new array of values. */ function baseXor(arrays, iteratee, comparator) { var length = arrays.length; if (length < 2) { return length ? baseUniq(arrays[0]) : []; } var index = -1, result = Array(length); while (++index < length) { var array = arrays[index], othIndex = -1; while (++othIndex < length) { if (othIndex != index) { result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator); } } } return baseUniq(baseFlatten(result, 1), iteratee, comparator); } /** * This base implementation of `_.zipObject` which assigns values using `assignFunc`. * * @private * @param {Array} props The property identifiers. * @param {Array} values The property values. * @param {Function} assignFunc The function to assign values. * @returns {Object} Returns the new object. */ function baseZipObject(props, values, assignFunc) { var index = -1, length = props.length, valsLength = values.length, result = {}; while (++index < length) { var value = index < valsLength ? values[index] : undefined; assignFunc(result, props[index], value); } return result; } /** * Casts `value` to an empty array if it's not an array like object. * * @private * @param {*} value The value to inspect. * @returns {Array|Object} Returns the cast array-like object. */ function castArrayLikeObject(value) { return isArrayLikeObject(value) ? value : []; } /** * Casts `value` to `identity` if it's not a function. * * @private * @param {*} value The value to inspect. * @returns {Function} Returns cast function. */ function castFunction(value) { return typeof value == 'function' ? value : identity; } /** * Casts `value` to a path array if it's not one. * * @private * @param {*} value The value to inspect. * @param {Object} [object] The object to query keys on. * @returns {Array} Returns the cast property path array. */ function castPath(value, object) { if (isArray(value)) { return value; } return isKey(value, object) ? [value] : stringToPath(toString(value)); } /** * A `baseRest` alias which can be replaced with `identity` by module * replacement plugins. * * @private * @type {Function} * @param {Function} func The function to apply a rest parameter to. * @returns {Function} Returns the new function. */ var castRest = baseRest; /** * Casts `array` to a slice if it's needed. * * @private * @param {Array} array The array to inspect. * @param {number} start The start position. * @param {number} [end=array.length] The end position. * @returns {Array} Returns the cast slice. */ function castSlice(array, start, end) { var length = array.length; end = end === undefined ? length : end; return (!start && end >= length) ? array : baseSlice(array, start, end); } /** * A simple wrapper around the global [`clearTimeout`](https://mdn.io/clearTimeout). * * @private * @param {number|Object} id The timer id or timeout object of the timer to clear. */ var clearTimeout = ctxClearTimeout || function(id) { return root.clearTimeout(id); }; /** * Creates a clone of `buffer`. * * @private * @param {Buffer} buffer The buffer to clone. * @param {boolean} [isDeep] Specify a deep clone. * @returns {Buffer} Returns the cloned buffer. */ function cloneBuffer(buffer, isDeep) { if (isDeep) { return buffer.slice(); } var length = buffer.length, result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length); buffer.copy(result); return result; } /** * Creates a clone of `arrayBuffer`. * * @private * @param {ArrayBuffer} arrayBuffer The array buffer to clone. * @returns {ArrayBuffer} Returns the cloned array buffer. */ function cloneArrayBuffer(arrayBuffer) { var result = new arrayBuffer.constructor(arrayBuffer.byteLength); new Uint8Array(result).set(new Uint8Array(arrayBuffer)); return result; } /** * Creates a clone of `dataView`. * * @private * @param {Object} dataView The data view to clone. * @param {boolean} [isDeep] Specify a deep clone. * @returns {Object} Returns the cloned data view. */ function cloneDataView(dataView, isDeep) { var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer; return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength); } /** * Creates a clone of `regexp`. * * @private * @param {Object} regexp The regexp to clone. * @returns {Object} Returns the cloned regexp. */ function cloneRegExp(regexp) { var result = new regexp.constructor(regexp.source, reFlags.exec(regexp)); result.lastIndex = regexp.lastIndex; return result; } /** * Creates a clone of the `symbol` object. * * @private * @param {Object} symbol The symbol object to clone. * @returns {Object} Returns the cloned symbol object. */ function cloneSymbol(symbol) { return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {}; } /** * Creates a clone of `typedArray`. * * @private * @param {Object} typedArray The typed array to clone. * @param {boolean} [isDeep] Specify a deep clone. * @returns {Object} Returns the cloned typed array. */ function cloneTypedArray(typedArray, isDeep) { var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer; return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length); } /** * Compares values to sort them in ascending order. * * @private * @param {*} value The value to compare. * @param {*} other The other value to compare. * @returns {number} Returns the sort order indicator for `value`. */ function compareAscending(value, other) { if (value !== other) { var valIsDefined = value !== undefined, valIsNull = value === null, valIsReflexive = value === value, valIsSymbol = isSymbol(value); var othIsDefined = other !== undefined, othIsNull = other === null, othIsReflexive = other === other, othIsSymbol = isSymbol(other); if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) || (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) || (valIsNull && othIsDefined && othIsReflexive) || (!valIsDefined && othIsReflexive) || !valIsReflexive) { return 1; } if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) || (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) || (othIsNull && valIsDefined && valIsReflexive) || (!othIsDefined && valIsReflexive) || !othIsReflexive) { return -1; } } return 0; } /** * Used by `_.orderBy` to compare multiple properties of a value to another * and stable sort them. * * If `orders` is unspecified, all values are sorted in ascending order. Otherwise, * specify an order of "desc" for descending or "asc" for ascending sort order * of corresponding values. * * @private * @param {Object} object The object to compare. * @param {Object} other The other object to compare. * @param {boolean[]|string[]} orders The order to sort by for each property. * @returns {number} Returns the sort order indicator for `object`. */ function compareMultiple(object, other, orders) { var index = -1, objCriteria = object.criteria, othCriteria = other.criteria, length = objCriteria.length, ordersLength = orders.length; while (++index < length) { var result = compareAscending(objCriteria[index], othCriteria[index]); if (result) { if (index >= ordersLength) { return result; } var order = orders[index]; return result * (order == 'desc' ? -1 : 1); } } // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications // that causes it, under certain circumstances, to provide the same value for // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247 // for more details. // // This also ensures a stable sort in V8 and other engines. // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details. return object.index - other.index; } /** * Creates an array that is the composition of partially applied arguments, * placeholders, and provided arguments into a single array of arguments. * * @private * @param {Array} args The provided arguments. * @param {Array} partials The arguments to prepend to those provided. * @param {Array} holders The `partials` placeholder indexes. * @params {boolean} [isCurried] Specify composing for a curried function. * @returns {Array} Returns the new array of composed arguments. */ function composeArgs(args, partials, holders, isCurried) { var argsIndex = -1, argsLength = args.length, holdersLength = holders.length, leftIndex = -1, leftLength = partials.length, rangeLength = nativeMax(argsLength - holdersLength, 0), result = Array(leftLength + rangeLength), isUncurried = !isCurried; while (++leftIndex < leftLength) { result[leftIndex] = partials[leftIndex]; } while (++argsIndex < holdersLength) { if (isUncurried || argsIndex < argsLength) { result[holders[argsIndex]] = args[argsIndex]; } } while (rangeLength--) { result[leftIndex++] = args[argsIndex++]; } return result; } /** * This function is like `composeArgs` except that the arguments composition * is tailored for `_.partialRight`. * * @private * @param {Array} args The provided arguments. * @param {Array} partials The arguments to append to those provided. * @param {Array} holders The `partials` placeholder indexes. * @params {boolean} [isCurried] Specify composing for a curried function. * @returns {Array} Returns the new array of composed arguments. */ function composeArgsRight(args, partials, holders, isCurried) { var argsIndex = -1, argsLength = args.length, holdersIndex = -1, holdersLength = holders.length, rightIndex = -1, rightLength = partials.length, rangeLength = nativeMax(argsLength - holdersLength, 0), result = Array(rangeLength + rightLength), isUncurried = !isCurried; while (++argsIndex < rangeLength) { result[argsIndex] = args[argsIndex]; } var offset = argsIndex; while (++rightIndex < rightLength) { result[offset + rightIndex] = partials[rightIndex]; } while (++holdersIndex < holdersLength) { if (isUncurried || argsIndex < argsLength) { result[offset + holders[holdersIndex]] = args[argsIndex++]; } } return result; } /** * Copies the values of `source` to `array`. * * @private * @param {Array} source The array to copy values from. * @param {Array} [array=[]] The array to copy values to. * @returns {Array} Returns `array`. */ function copyArray(source, array) { var index = -1, length = source.length; array || (array = Array(length)); while (++index < length) { array[index] = source[index]; } return array; } /** * Copies properties of `source` to `object`. * * @private * @param {Object} source The object to copy properties from. * @param {Array} props The property identifiers to copy. * @param {Object} [object={}] The object to copy properties to. * @param {Function} [customizer] The function to customize copied values. * @returns {Object} Returns `object`. */ function copyObject(source, props, object, customizer) { var isNew = !object; object || (object = {}); var index = -1, length = props.length; while (++index < length) { var key = props[index]; var newValue = customizer ? customizer(object[key], source[key], key, object, source) : undefined; if (newValue === undefined) { newValue = source[key]; } if (isNew) { baseAssignValue(object, key, newValue); } else { assignValue(object, key, newValue); } } return object; } /** * Copies own symbols of `source` to `object`. * * @private * @param {Object} source The object to copy symbols from. * @param {Object} [object={}] The object to copy symbols to. * @returns {Object} Returns `object`. */ function copySymbols(source, object) { return copyObject(source, getSymbols(source), object); } /** * Copies own and inherited symbols of `source` to `object`. * * @private * @param {Object} source The object to copy symbols from. * @param {Object} [object={}] The object to copy symbols to. * @returns {Object} Returns `object`. */ function copySymbolsIn(source, object) { return copyObject(source, getSymbolsIn(source), object); } /** * Creates a function like `_.groupBy`. * * @private * @param {Function} setter The function to set accumulator values. * @param {Function} [initializer] The accumulator object initializer. * @returns {Function} Returns the new aggregator function. */ function createAggregator(setter, initializer) { return function(collection, iteratee) { var func = isArray(collection) ? arrayAggregator : baseAggregator, accumulator = initializer ? initializer() : {}; return func(collection, setter, getIteratee(iteratee, 2), accumulator); }; } /** * Creates a function like `_.assign`. * * @private * @param {Function} assigner The function to assign values. * @returns {Function} Returns the new assigner function. */ function createAssigner(assigner) { return baseRest(function(object, sources) { var index = -1, length = sources.length, customizer = length > 1 ? sources[length - 1] : undefined, guard = length > 2 ? sources[2] : undefined; customizer = (assigner.length > 3 && typeof customizer == 'function') ? (length--, customizer) : undefined; if (guard && isIterateeCall(sources[0], sources[1], guard)) { customizer = length < 3 ? undefined : customizer; length = 1; } object = Object(object); while (++index < length) { var source = sources[index]; if (source) { assigner(object, source, index, customizer); } } return object; }); } /** * Creates a `baseEach` or `baseEachRight` function. * * @private * @param {Function} eachFunc The function to iterate over a collection. * @param {boolean} [fromRight] Specify iterating from right to left. * @returns {Function} Returns the new base function. */ function createBaseEach(eachFunc, fromRight) { return function(collection, iteratee) { if (collection == null) { return collection; } if (!isArrayLike(collection)) { return eachFunc(collection, iteratee); } var length = collection.length, index = fromRight ? length : -1, iterable = Object(collection); while ((fromRight ? index-- : ++index < length)) { if (iteratee(iterable[index], index, iterable) === false) { break; } } return collection; }; } /** * Creates a base function for methods like `_.forIn` and `_.forOwn`. * * @private * @param {boolean} [fromRight] Specify iterating from right to left. * @returns {Function} Returns the new base function. */ function createBaseFor(fromRight) { return function(object, iteratee, keysFunc) { var index = -1, iterable = Object(object), props = keysFunc(object), length = props.length; while (length--) { var key = props[fromRight ? length : ++index]; if (iteratee(iterable[key], key, iterable) === false) { break; } } return object; }; } /** * Creates a function that wraps `func` to invoke it with the optional `this` * binding of `thisArg`. * * @private * @param {Function} func The function to wrap. * @param {number} bitmask The bitmask flags. See `createWrap` for more details. * @param {*} [thisArg] The `this` binding of `func`. * @returns {Function} Returns the new wrapped function. */ function createBind(func, bitmask, thisArg) { var isBind = bitmask & WRAP_BIND_FLAG, Ctor = createCtor(func); function wrapper() { var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; return fn.apply(isBind ? thisArg : this, arguments); } return wrapper; } /** * Creates a function like `_.lowerFirst`. * * @private * @param {string} methodName The name of the `String` case method to use. * @returns {Function} Returns the new case function. */ function createCaseFirst(methodName) { return function(string) { string = toString(string); var strSymbols = hasUnicode(string) ? stringToArray(string) : undefined; var chr = strSymbols ? strSymbols[0] : string.charAt(0); var trailing = strSymbols ? castSlice(strSymbols, 1).join('') : string.slice(1); return chr[methodName]() + trailing; }; } /** * Creates a function like `_.camelCase`. * * @private * @param {Function} callback The function to combine each word. * @returns {Function} Returns the new compounder function. */ function createCompounder(callback) { return function(string) { return arrayReduce(words(deburr(string).replace(reApos, '')), callback, ''); }; } /** * Creates a function that produces an instance of `Ctor` regardless of * whether it was invoked as part of a `new` expression or by `call` or `apply`. * * @private * @param {Function} Ctor The constructor to wrap. * @returns {Function} Returns the new wrapped function. */ function createCtor(Ctor) { return function() { // Use a `switch` statement to work with class constructors. See // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist // for more details. var args = arguments; switch (args.length) { case 0: return new Ctor; case 1: return new Ctor(args[0]); case 2: return new Ctor(args[0], args[1]); case 3: return new Ctor(args[0], args[1], args[2]); case 4: return new Ctor(args[0], args[1], args[2], args[3]); case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]); case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]); case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]); } var thisBinding = baseCreate(Ctor.prototype), result = Ctor.apply(thisBinding, args); // Mimic the constructor's `return` behavior. // See https://es5.github.io/#x13.2.2 for more details. return isObject(result) ? result : thisBinding; }; } /** * Creates a function that wraps `func` to enable currying. * * @private * @param {Function} func The function to wrap. * @param {number} bitmask The bitmask flags. See `createWrap` for more details. * @param {number} arity The arity of `func`. * @returns {Function} Returns the new wrapped function. */ function createCurry(func, bitmask, arity) { var Ctor = createCtor(func); function wrapper() { var length = arguments.length, args = Array(length), index = length, placeholder = getHolder(wrapper); while (index--) { args[index] = arguments[index]; } var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder) ? [] : replaceHolders(args, placeholder); length -= holders.length; if (length < arity) { return createRecurry( func, bitmask, createHybrid, wrapper.placeholder, undefined, args, holders, undefined, undefined, arity - length); } var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; return apply(fn, this, args); } return wrapper; } /** * Creates a `_.find` or `_.findLast` function. * * @private * @param {Function} findIndexFunc The function to find the collection index. * @returns {Function} Returns the new find function. */ function createFind(findIndexFunc) { return function(collection, predicate, fromIndex) { var iterable = Object(collection); if (!isArrayLike(collection)) { var iteratee = getIteratee(predicate, 3); collection = keys(collection); predicate = function(key) { return iteratee(iterable[key], key, iterable); }; } var index = findIndexFunc(collection, predicate, fromIndex); return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined; }; } /** * Creates a `_.flow` or `_.flowRight` function. * * @private * @param {boolean} [fromRight] Specify iterating from right to left. * @returns {Function} Returns the new flow function. */ function createFlow(fromRight) { return flatRest(function(funcs) { var length = funcs.length, index = length, prereq = LodashWrapper.prototype.thru; if (fromRight) { funcs.reverse(); } while (index--) { var func = funcs[index]; if (typeof func != 'function') { throw new TypeError(FUNC_ERROR_TEXT); } if (prereq && !wrapper && getFuncName(func) == 'wrapper') { var wrapper = new LodashWrapper([], true); } } index = wrapper ? index : length; while (++index < length) { func = funcs[index]; var funcName = getFuncName(func), data = funcName == 'wrapper' ? getData(func) : undefined; if (data && isLaziable(data[0]) && data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) && !data[4].length && data[9] == 1 ) { wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]); } else { wrapper = (func.length == 1 && isLaziable(func)) ? wrapper[funcName]() : wrapper.thru(func); } } return function() { var args = arguments, value = args[0]; if (wrapper && args.length == 1 && isArray(value)) { return wrapper.plant(value).value(); } var index = 0, result = length ? funcs[index].apply(this, args) : value; while (++index < length) { result = funcs[index].call(this, result); } return result; }; }); } /** * Creates a function that wraps `func` to invoke it with optional `this` * binding of `thisArg`, partial application, and currying. * * @private * @param {Function|string} func The function or method name to wrap. * @param {number} bitmask The bitmask flags. See `createWrap` for more details. * @param {*} [thisArg] The `this` binding of `func`. * @param {Array} [partials] The arguments to prepend to those provided to * the new function. * @param {Array} [holders] The `partials` placeholder indexes. * @param {Array} [partialsRight] The arguments to append to those provided * to the new function. * @param {Array} [holdersRight] The `partialsRight` placeholder indexes. * @param {Array} [argPos] The argument positions of the new function. * @param {number} [ary] The arity cap of `func`. * @param {number} [arity] The arity of `func`. * @returns {Function} Returns the new wrapped function. */ function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) { var isAry = bitmask & WRAP_ARY_FLAG, isBind = bitmask & WRAP_BIND_FLAG, isBindKey = bitmask & WRAP_BIND_KEY_FLAG, isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG), isFlip = bitmask & WRAP_FLIP_FLAG, Ctor = isBindKey ? undefined : createCtor(func); function wrapper() { var length = arguments.length, args = Array(length), index = length; while (index--) { args[index] = arguments[index]; } if (isCurried) { var placeholder = getHolder(wrapper), holdersCount = countHolders(args, placeholder); } if (partials) { args = composeArgs(args, partials, holders, isCurried); } if (partialsRight) { args = composeArgsRight(args, partialsRight, holdersRight, isCurried); } length -= holdersCount; if (isCurried && length < arity) { var newHolders = replaceHolders(args, placeholder); return createRecurry( func, bitmask, createHybrid, wrapper.placeholder, thisArg, args, newHolders, argPos, ary, arity - length ); } var thisBinding = isBind ? thisArg : this, fn = isBindKey ? thisBinding[func] : func; length = args.length; if (argPos) { args = reorder(args, argPos); } else if (isFlip && length > 1) { args.reverse(); } if (isAry && ary < length) { args.length = ary; } if (this && this !== root && this instanceof wrapper) { fn = Ctor || createCtor(fn); } return fn.apply(thisBinding, args); } return wrapper; } /** * Creates a function like `_.invertBy`. * * @private * @param {Function} setter The function to set accumulator values. * @param {Function} toIteratee The function to resolve iteratees. * @returns {Function} Returns the new inverter function. */ function createInverter(setter, toIteratee) { return function(object, iteratee) { return baseInverter(object, setter, toIteratee(iteratee), {}); }; } /** * Creates a function that performs a mathematical operation on two values. * * @private * @param {Function} operator The function to perform the operation. * @param {number} [defaultValue] The value used for `undefined` arguments. * @returns {Function} Returns the new mathematical operation function. */ function createMathOperation(operator, defaultValue) { return function(value, other) { var result; if (value === undefined && other === undefined) { return defaultValue; } if (value !== undefined) { result = value; } if (other !== undefined) { if (result === undefined) { return other; } if (typeof value == 'string' || typeof other == 'string') { value = baseToString(value); other = baseToString(other); } else { value = baseToNumber(value); other = baseToNumber(other); } result = operator(value, other); } return result; }; } /** * Creates a function like `_.over`. * * @private * @param {Function} arrayFunc The function to iterate over iteratees. * @returns {Function} Returns the new over function. */ function createOver(arrayFunc) { return flatRest(function(iteratees) { iteratees = arrayMap(iteratees, baseUnary(getIteratee())); return baseRest(function(args) { var thisArg = this; return arrayFunc(iteratees, function(iteratee) { return apply(iteratee, thisArg, args); }); }); }); } /** * Creates the padding for `string` based on `length`. The `chars` string * is truncated if the number of characters exceeds `length`. * * @private * @param {number} length The padding length. * @param {string} [chars=' '] The string used as padding. * @returns {string} Returns the padding for `string`. */ function createPadding(length, chars) { chars = chars === undefined ? ' ' : baseToString(chars); var charsLength = chars.length; if (charsLength < 2) { return charsLength ? baseRepeat(chars, length) : chars; } var result = baseRepeat(chars, nativeCeil(length / stringSize(chars))); return hasUnicode(chars) ? castSlice(stringToArray(result), 0, length).join('') : result.slice(0, length); } /** * Creates a function that wraps `func` to invoke it with the `this` binding * of `thisArg` and `partials` prepended to the arguments it receives. * * @private * @param {Function} func The function to wrap. * @param {number} bitmask The bitmask flags. See `createWrap` for more details. * @param {*} thisArg The `this` binding of `func`. * @param {Array} partials The arguments to prepend to those provided to * the new function. * @returns {Function} Returns the new wrapped function. */ function createPartial(func, bitmask, thisArg, partials) { var isBind = bitmask & WRAP_BIND_FLAG, Ctor = createCtor(func); function wrapper() { var argsIndex = -1, argsLength = arguments.length, leftIndex = -1, leftLength = partials.length, args = Array(leftLength + argsLength), fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; while (++leftIndex < leftLength) { args[leftIndex] = partials[leftIndex]; } while (argsLength--) { args[leftIndex++] = arguments[++argsIndex]; } return apply(fn, isBind ? thisArg : this, args); } return wrapper; } /** * Creates a `_.range` or `_.rangeRight` function. * * @private * @param {boolean} [fromRight] Specify iterating from right to left. * @returns {Function} Returns the new range function. */ function createRange(fromRight) { return function(start, end, step) { if (step && typeof step != 'number' && isIterateeCall(start, end, step)) { end = step = undefined; } // Ensure the sign of `-0` is preserved. start = toFinite(start); if (end === undefined) { end = start; start = 0; } else { end = toFinite(end); } step = step === undefined ? (start < end ? 1 : -1) : toFinite(step); return baseRange(start, end, step, fromRight); }; } /** * Creates a function that performs a relational operation on two values. * * @private * @param {Function} operator The function to perform the operation. * @returns {Function} Returns the new relational operation function. */ function createRelationalOperation(operator) { return function(value, other) { if (!(typeof value == 'string' && typeof other == 'string')) { value = toNumber(value); other = toNumber(other); } return operator(value, other); }; } /** * Creates a function that wraps `func` to continue currying. * * @private * @param {Function} func The function to wrap. * @param {number} bitmask The bitmask flags. See `createWrap` for more details. * @param {Function} wrapFunc The function to create the `func` wrapper. * @param {*} placeholder The placeholder value. * @param {*} [thisArg] The `this` binding of `func`. * @param {Array} [partials] The arguments to prepend to those provided to * the new function. * @param {Array} [holders] The `partials` placeholder indexes. * @param {Array} [argPos] The argument positions of the new function. * @param {number} [ary] The arity cap of `func`. * @param {number} [arity] The arity of `func`. * @returns {Function} Returns the new wrapped function. */ function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) { var isCurry = bitmask & WRAP_CURRY_FLAG, newHolders = isCurry ? holders : undefined, newHoldersRight = isCurry ? undefined : holders, newPartials = isCurry ? partials : undefined, newPartialsRight = isCurry ? undefined : partials; bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG); bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG); if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) { bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG); } var newData = [ func, bitmask, thisArg, newPartials, newHolders, newPartialsRight, newHoldersRight, argPos, ary, arity ]; var result = wrapFunc.apply(undefined, newData); if (isLaziable(func)) { setData(result, newData); } result.placeholder = placeholder; return setWrapToString(result, func, bitmask); } /** * Creates a function like `_.round`. * * @private * @param {string} methodName The name of the `Math` method to use when rounding. * @returns {Function} Returns the new round function. */ function createRound(methodName) { var func = Math[methodName]; return function(number, precision) { number = toNumber(number); precision = precision == null ? 0 : nativeMin(toInteger(precision), 292); if (precision && nativeIsFinite(number)) { // Shift with exponential notation to avoid floating-point issues. // See [MDN](https://mdn.io/round#Examples) for more details. var pair = (toString(number) + 'e').split('e'), value = func(pair[0] + 'e' + (+pair[1] + precision)); pair = (toString(value) + 'e').split('e'); return +(pair[0] + 'e' + (+pair[1] - precision)); } return func(number); }; } /** * Creates a set object of `values`. * * @private * @param {Array} values The values to add to the set. * @returns {Object} Returns the new set. */ var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) { return new Set(values); }; /** * Creates a `_.toPairs` or `_.toPairsIn` function. * * @private * @param {Function} keysFunc The function to get the keys of a given object. * @returns {Function} Returns the new pairs function. */ function createToPairs(keysFunc) { return function(object) { var tag = getTag(object); if (tag == mapTag) { return mapToArray(object); } if (tag == setTag) { return setToPairs(object); } return baseToPairs(object, keysFunc(object)); }; } /** * Creates a function that either curries or invokes `func` with optional * `this` binding and partially applied arguments. * * @private * @param {Function|string} func The function or method name to wrap. * @param {number} bitmask The bitmask flags. * 1 - `_.bind` * 2 - `_.bindKey` * 4 - `_.curry` or `_.curryRight` of a bound function * 8 - `_.curry` * 16 - `_.curryRight` * 32 - `_.partial` * 64 - `_.partialRight` * 128 - `_.rearg` * 256 - `_.ary` * 512 - `_.flip` * @param {*} [thisArg] The `this` binding of `func`. * @param {Array} [partials] The arguments to be partially applied. * @param {Array} [holders] The `partials` placeholder indexes. * @param {Array} [argPos] The argument positions of the new function. * @param {number} [ary] The arity cap of `func`. * @param {number} [arity] The arity of `func`. * @returns {Function} Returns the new wrapped function. */ function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) { var isBindKey = bitmask & WRAP_BIND_KEY_FLAG; if (!isBindKey && typeof func != 'function') { throw new TypeError(FUNC_ERROR_TEXT); } var length = partials ? partials.length : 0; if (!length) { bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG); partials = holders = undefined; } ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0); arity = arity === undefined ? arity : toInteger(arity); length -= holders ? holders.length : 0; if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) { var partialsRight = partials, holdersRight = holders; partials = holders = undefined; } var data = isBindKey ? undefined : getData(func); var newData = [ func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity ]; if (data) { mergeData(newData, data); } func = newData[0]; bitmask = newData[1]; thisArg = newData[2]; partials = newData[3]; holders = newData[4]; arity = newData[9] = newData[9] === undefined ? (isBindKey ? 0 : func.length) : nativeMax(newData[9] - length, 0); if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) { bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG); } if (!bitmask || bitmask == WRAP_BIND_FLAG) { var result = createBind(func, bitmask, thisArg); } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) { result = createCurry(func, bitmask, arity); } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) { result = createPartial(func, bitmask, thisArg, partials); } else { result = createHybrid.apply(undefined, newData); } var setter = data ? baseSetData : setData; return setWrapToString(setter(result, newData), func, bitmask); } /** * Used by `_.defaults` to customize its `_.assignIn` use to assign properties * of source objects to the destination object for all destination properties * that resolve to `undefined`. * * @private * @param {*} objValue The destination value. * @param {*} srcValue The source value. * @param {string} key The key of the property to assign. * @param {Object} object The parent object of `objValue`. * @returns {*} Returns the value to assign. */ function customDefaultsAssignIn(objValue, srcValue, key, object) { if (objValue === undefined || (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) { return srcValue; } return objValue; } /** * Used by `_.defaultsDeep` to customize its `_.merge` use to merge source * objects into destination objects that are passed thru. * * @private * @param {*} objValue The destination value. * @param {*} srcValue The source value. * @param {string} key The key of the property to merge. * @param {Object} object The parent object of `objValue`. * @param {Object} source The parent object of `srcValue`. * @param {Object} [stack] Tracks traversed source values and their merged * counterparts. * @returns {*} Returns the value to assign. */ function customDefaultsMerge(objValue, srcValue, key, object, source, stack) { if (isObject(objValue) && isObject(srcValue)) { // Recursively merge objects and arrays (susceptible to call stack limits). stack.set(srcValue, objValue); baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack); stack['delete'](srcValue); } return objValue; } /** * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain * objects. * * @private * @param {*} value The value to inspect. * @param {string} key The key of the property to inspect. * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`. */ function customOmitClone(value) { return isPlainObject(value) ? undefined : value; } /** * A specialized version of `baseIsEqualDeep` for arrays with support for * partial deep comparisons. * * @private * @param {Array} array The array to compare. * @param {Array} other The other array to compare. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. * @param {Function} customizer The function to customize comparisons. * @param {Function} equalFunc The function to determine equivalents of values. * @param {Object} stack Tracks traversed `array` and `other` objects. * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`. */ function equalArrays(array, other, bitmask, customizer, equalFunc, stack) { var isPartial = bitmask & COMPARE_PARTIAL_FLAG, arrLength = array.length, othLength = other.length; if (arrLength != othLength && !(isPartial && othLength > arrLength)) { return false; } // Check that cyclic values are equal. var arrStacked = stack.get(array); var othStacked = stack.get(other); if (arrStacked && othStacked) { return arrStacked == other && othStacked == array; } var index = -1, result = true, seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined; stack.set(array, other); stack.set(other, array); // Ignore non-index properties. while (++index < arrLength) { var arrValue = array[index], othValue = other[index]; if (customizer) { var compared = isPartial ? customizer(othValue, arrValue, index, other, array, stack) : customizer(arrValue, othValue, index, array, other, stack); } if (compared !== undefined) { if (compared) { continue; } result = false; break; } // Recursively compare arrays (susceptible to call stack limits). if (seen) { if (!arraySome(other, function(othValue, othIndex) { if (!cacheHas(seen, othIndex) && (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) { return seen.push(othIndex); } })) { result = false; break; } } else if (!( arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack) )) { result = false; break; } } stack['delete'](array); stack['delete'](other); return result; } /** * A specialized version of `baseIsEqualDeep` for comparing objects of * the same `toStringTag`. * * **Note:** This function only supports comparing values with tags of * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. * * @private * @param {Object} object The object to compare. * @param {Object} other The other object to compare. * @param {string} tag The `toStringTag` of the objects to compare. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. * @param {Function} customizer The function to customize comparisons. * @param {Function} equalFunc The function to determine equivalents of values. * @param {Object} stack Tracks traversed `object` and `other` objects. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. */ function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) { switch (tag) { case dataViewTag: if ((object.byteLength != other.byteLength) || (object.byteOffset != other.byteOffset)) { return false; } object = object.buffer; other = other.buffer; case arrayBufferTag: if ((object.byteLength != other.byteLength) || !equalFunc(new Uint8Array(object), new Uint8Array(other))) { return false; } return true; case boolTag: case dateTag: case numberTag: // Coerce booleans to `1` or `0` and dates to milliseconds. // Invalid dates are coerced to `NaN`. return eq(+object, +other); case errorTag: return object.name == other.name && object.message == other.message; case regexpTag: case stringTag: // Coerce regexes to strings and treat strings, primitives and objects, // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring // for more details. return object == (other + ''); case mapTag: var convert = mapToArray; case setTag: var isPartial = bitmask & COMPARE_PARTIAL_FLAG; convert || (convert = setToArray); if (object.size != other.size && !isPartial) { return false; } // Assume cyclic values are equal. var stacked = stack.get(object); if (stacked) { return stacked == other; } bitmask |= COMPARE_UNORDERED_FLAG; // Recursively compare objects (susceptible to call stack limits). stack.set(object, other); var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack); stack['delete'](object); return result; case symbolTag: if (symbolValueOf) { return symbolValueOf.call(object) == symbolValueOf.call(other); } } return false; } /** * A specialized version of `baseIsEqualDeep` for objects with support for * partial deep comparisons. * * @private * @param {Object} object The object to compare. * @param {Object} other The other object to compare. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. * @param {Function} customizer The function to customize comparisons. * @param {Function} equalFunc The function to determine equivalents of values. * @param {Object} stack Tracks traversed `object` and `other` objects. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. */ function equalObjects(object, other, bitmask, customizer, equalFunc, stack) { var isPartial = bitmask & COMPARE_PARTIAL_FLAG, objProps = getAllKeys(object), objLength = objProps.length, othProps = getAllKeys(other), othLength = othProps.length; if (objLength != othLength && !isPartial) { return false; } var index = objLength; while (index--) { var key = objProps[index]; if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) { return false; } } // Check that cyclic values are equal. var objStacked = stack.get(object); var othStacked = stack.get(other); if (objStacked && othStacked) { return objStacked == other && othStacked == object; } var result = true; stack.set(object, other); stack.set(other, object); var skipCtor = isPartial; while (++index < objLength) { key = objProps[index]; var objValue = object[key], othValue = other[key]; if (customizer) { var compared = isPartial ? customizer(othValue, objValue, key, other, object, stack) : customizer(objValue, othValue, key, object, other, stack); } // Recursively compare objects (susceptible to call stack limits). if (!(compared === undefined ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack)) : compared )) { result = false; break; } skipCtor || (skipCtor = key == 'constructor'); } if (result && !skipCtor) { var objCtor = object.constructor, othCtor = other.constructor; // Non `Object` object instances with different constructors are not equal. if (objCtor != othCtor && ('constructor' in object && 'constructor' in other) && !(typeof objCtor == 'function' && objCtor instanceof objCtor && typeof othCtor == 'function' && othCtor instanceof othCtor)) { result = false; } } stack['delete'](object); stack['delete'](other); return result; } /** * A specialized version of `baseRest` which flattens the rest array. * * @private * @param {Function} func The function to apply a rest parameter to. * @returns {Function} Returns the new function. */ function flatRest(func) { return setToString(overRest(func, undefined, flatten), func + ''); } /** * Creates an array of own enumerable property names and symbols of `object`. * * @private * @param {Object} object The object to query. * @returns {Array} Returns the array of property names and symbols. */ function getAllKeys(object) { return baseGetAllKeys(object, keys, getSymbols); } /** * Creates an array of own and inherited enumerable property names and * symbols of `object`. * * @private * @param {Object} object The object to query. * @returns {Array} Returns the array of property names and symbols. */ function getAllKeysIn(object) { return baseGetAllKeys(object, keysIn, getSymbolsIn); } /** * Gets metadata for `func`. * * @private * @param {Function} func The function to query. * @returns {*} Returns the metadata for `func`. */ var getData = !metaMap ? noop : function(func) { return metaMap.get(func); }; /** * Gets the name of `func`. * * @private * @param {Function} func The function to query. * @returns {string} Returns the function name. */ function getFuncName(func) { var result = (func.name + ''), array = realNames[result], length = hasOwnProperty.call(realNames, result) ? array.length : 0; while (length--) { var data = array[length], otherFunc = data.func; if (otherFunc == null || otherFunc == func) { return data.name; } } return result; } /** * Gets the argument placeholder value for `func`. * * @private * @param {Function} func The function to inspect. * @returns {*} Returns the placeholder value. */ function getHolder(func) { var object = hasOwnProperty.call(lodash, 'placeholder') ? lodash : func; return object.placeholder; } /** * Gets the appropriate "iteratee" function. If `_.iteratee` is customized, * this function returns the custom method, otherwise it returns `baseIteratee`. * If arguments are provided, the chosen function is invoked with them and * its result is returned. * * @private * @param {*} [value] The value to convert to an iteratee. * @param {number} [arity] The arity of the created iteratee. * @returns {Function} Returns the chosen function or its result. */ function getIteratee() { var result = lodash.iteratee || iteratee; result = result === iteratee ? baseIteratee : result; return arguments.length ? result(arguments[0], arguments[1]) : result; } /** * Gets the data for `map`. * * @private * @param {Object} map The map to query. * @param {string} key The reference key. * @returns {*} Returns the map data. */ function getMapData(map, key) { var data = map.__data__; return isKeyable(key) ? data[typeof key == 'string' ? 'string' : 'hash'] : data.map; } /** * Gets the property names, values, and compare flags of `object`. * * @private * @param {Object} object The object to query. * @returns {Array} Returns the match data of `object`. */ function getMatchData(object) { var result = keys(object), length = result.length; while (length--) { var key = result[length], value = object[key]; result[length] = [key, value, isStrictComparable(value)]; } return result; } /** * Gets the native function at `key` of `object`. * * @private * @param {Object} object The object to query. * @param {string} key The key of the method to get. * @returns {*} Returns the function if it's native, else `undefined`. */ function getNative(object, key) { var value = getValue(object, key); return baseIsNative(value) ? value : undefined; } /** * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values. * * @private * @param {*} value The value to query. * @returns {string} Returns the raw `toStringTag`. */ function getRawTag(value) { var isOwn = hasOwnProperty.call(value, symToStringTag), tag = value[symToStringTag]; try { value[symToStringTag] = undefined; var unmasked = true; } catch (e) {} var result = nativeObjectToString.call(value); if (unmasked) { if (isOwn) { value[symToStringTag] = tag; } else { delete value[symToStringTag]; } } return result; } /** * Creates an array of the own enumerable symbols of `object`. * * @private * @param {Object} object The object to query. * @returns {Array} Returns the array of symbols. */ var getSymbols = !nativeGetSymbols ? stubArray : function(object) { if (object == null) { return []; } object = Object(object); return arrayFilter(nativeGetSymbols(object), function(symbol) { return propertyIsEnumerable.call(object, symbol); }); }; /** * Creates an array of the own and inherited enumerable symbols of `object`. * * @private * @param {Object} object The object to query. * @returns {Array} Returns the array of symbols. */ var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) { var result = []; while (object) { arrayPush(result, getSymbols(object)); object = getPrototype(object); } return result; }; /** * Gets the `toStringTag` of `value`. * * @private * @param {*} value The value to query. * @returns {string} Returns the `toStringTag`. */ var getTag = baseGetTag; // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6. if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) || (Map && getTag(new Map) != mapTag) || (Promise && getTag(Promise.resolve()) != promiseTag) || (Set && getTag(new Set) != setTag) || (WeakMap && getTag(new WeakMap) != weakMapTag)) { getTag = function(value) { var result = baseGetTag(value), Ctor = result == objectTag ? value.constructor : undefined, ctorString = Ctor ? toSource(Ctor) : ''; if (ctorString) { switch (ctorString) { case dataViewCtorString: return dataViewTag; case mapCtorString: return mapTag; case promiseCtorString: return promiseTag; case setCtorString: return setTag; case weakMapCtorString: return weakMapTag; } } return result; }; } /** * Gets the view, applying any `transforms` to the `start` and `end` positions. * * @private * @param {number} start The start of the view. * @param {number} end The end of the view. * @param {Array} transforms The transformations to apply to the view. * @returns {Object} Returns an object containing the `start` and `end` * positions of the view. */ function getView(start, end, transforms) { var index = -1, length = transforms.length; while (++index < length) { var data = transforms[index], size = data.size; switch (data.type) { case 'drop': start += size; break; case 'dropRight': end -= size; break; case 'take': end = nativeMin(end, start + size); break; case 'takeRight': start = nativeMax(start, end - size); break; } } return { 'start': start, 'end': end }; } /** * Extracts wrapper details from the `source` body comment. * * @private * @param {string} source The source to inspect. * @returns {Array} Returns the wrapper details. */ function getWrapDetails(source) { var match = source.match(reWrapDetails); return match ? match[1].split(reSplitDetails) : []; } /** * Checks if `path` exists on `object`. * * @private * @param {Object} object The object to query. * @param {Array|string} path The path to check. * @param {Function} hasFunc The function to check properties. * @returns {boolean} Returns `true` if `path` exists, else `false`. */ function hasPath(object, path, hasFunc) { path = castPath(path, object); var index = -1, length = path.length, result = false; while (++index < length) { var key = toKey(path[index]); if (!(result = object != null && hasFunc(object, key))) { break; } object = object[key]; } if (result || ++index != length) { return result; } length = object == null ? 0 : object.length; return !!length && isLength(length) && isIndex(key, length) && (isArray(object) || isArguments(object)); } /** * Initializes an array clone. * * @private * @param {Array} array The array to clone. * @returns {Array} Returns the initialized clone. */ function initCloneArray(array) { var length = array.length, result = new array.constructor(length); // Add properties assigned by `RegExp#exec`. if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) { result.index = array.index; result.input = array.input; } return result; } /** * Initializes an object clone. * * @private * @param {Object} object The object to clone. * @returns {Object} Returns the initialized clone. */ function initCloneObject(object) { return (typeof object.constructor == 'function' && !isPrototype(object)) ? baseCreate(getPrototype(object)) : {}; } /** * Initializes an object clone based on its `toStringTag`. * * **Note:** This function only supports cloning values with tags of * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`. * * @private * @param {Object} object The object to clone. * @param {string} tag The `toStringTag` of the object to clone. * @param {boolean} [isDeep] Specify a deep clone. * @returns {Object} Returns the initialized clone. */ function initCloneByTag(object, tag, isDeep) { var Ctor = object.constructor; switch (tag) { case arrayBufferTag: return cloneArrayBuffer(object); case boolTag: case dateTag: return new Ctor(+object); case dataViewTag: return cloneDataView(object, isDeep); case float32Tag: case float64Tag: case int8Tag: case int16Tag: case int32Tag: case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag: return cloneTypedArray(object, isDeep); case mapTag: return new Ctor; case numberTag: case stringTag: return new Ctor(object); case regexpTag: return cloneRegExp(object); case setTag: return new Ctor; case symbolTag: return cloneSymbol(object); } } /** * Inserts wrapper `details` in a comment at the top of the `source` body. * * @private * @param {string} source The source to modify. * @returns {Array} details The details to insert. * @returns {string} Returns the modified source. */ function insertWrapDetails(source, details) { var length = details.length; if (!length) { return source; } var lastIndex = length - 1; details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex]; details = details.join(length > 2 ? ', ' : ' '); return source.replace(reWrapComment, '{\n/* [wrapped with ' + details + '] */\n'); } /** * Checks if `value` is a flattenable `arguments` object or array. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is flattenable, else `false`. */ function isFlattenable(value) { return isArray(value) || isArguments(value) || !!(spreadableSymbol && value && value[spreadableSymbol]); } /** * Checks if `value` is a valid array-like index. * * @private * @param {*} value The value to check. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. */ function isIndex(value, length) { var type = typeof value; length = length == null ? MAX_SAFE_INTEGER : length; return !!length && (type == 'number' || (type != 'symbol' && reIsUint.test(value))) && (value > -1 && value % 1 == 0 && value < length); } /** * Checks if the given arguments are from an iteratee call. * * @private * @param {*} value The potential iteratee value argument. * @param {*} index The potential iteratee index or key argument. * @param {*} object The potential iteratee object argument. * @returns {boolean} Returns `true` if the arguments are from an iteratee call, * else `false`. */ function isIterateeCall(value, index, object) { if (!isObject(object)) { return false; } var type = typeof index; if (type == 'number' ? (isArrayLike(object) && isIndex(index, object.length)) : (type == 'string' && index in object) ) { return eq(object[index], value); } return false; } /** * Checks if `value` is a property name and not a property path. * * @private * @param {*} value The value to check. * @param {Object} [object] The object to query keys on. * @returns {boolean} Returns `true` if `value` is a property name, else `false`. */ function isKey(value, object) { if (isArray(value)) { return false; } var type = typeof value; if (type == 'number' || type == 'symbol' || type == 'boolean' || value == null || isSymbol(value)) { return true; } return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || (object != null && value in Object(object)); } /** * Checks if `value` is suitable for use as unique object key. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is suitable, else `false`. */ function isKeyable(value) { var type = typeof value; return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') ? (value !== '__proto__') : (value === null); } /** * Checks if `func` has a lazy counterpart. * * @private * @param {Function} func The function to check. * @returns {boolean} Returns `true` if `func` has a lazy counterpart, * else `false`. */ function isLaziable(func) { var funcName = getFuncName(func), other = lodash[funcName]; if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) { return false; } if (func === other) { return true; } var data = getData(other); return !!data && func === data[0]; } /** * Checks if `func` has its source masked. * * @private * @param {Function} func The function to check. * @returns {boolean} Returns `true` if `func` is masked, else `false`. */ function isMasked(func) { return !!maskSrcKey && (maskSrcKey in func); } /** * Checks if `func` is capable of being masked. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `func` is maskable, else `false`. */ var isMaskable = coreJsData ? isFunction : stubFalse; /** * Checks if `value` is likely a prototype object. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a prototype, else `false`. */ function isPrototype(value) { var Ctor = value && value.constructor, proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto; return value === proto; } /** * Checks if `value` is suitable for strict equality comparisons, i.e. `===`. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` if suitable for strict * equality comparisons, else `false`. */ function isStrictComparable(value) { return value === value && !isObject(value); } /** * A specialized version of `matchesProperty` for source values suitable * for strict equality comparisons, i.e. `===`. * * @private * @param {string} key The key of the property to get. * @param {*} srcValue The value to match. * @returns {Function} Returns the new spec function. */ function matchesStrictComparable(key, srcValue) { return function(object) { if (object == null) { return false; } return object[key] === srcValue && (srcValue !== undefined || (key in Object(object))); }; } /** * A specialized version of `_.memoize` which clears the memoized function's * cache when it exceeds `MAX_MEMOIZE_SIZE`. * * @private * @param {Function} func The function to have its output memoized. * @returns {Function} Returns the new memoized function. */ function memoizeCapped(func) { var result = memoize(func, function(key) { if (cache.size === MAX_MEMOIZE_SIZE) { cache.clear(); } return key; }); var cache = result.cache; return result; } /** * Merges the function metadata of `source` into `data`. * * Merging metadata reduces the number of wrappers used to invoke a function. * This is possible because methods like `_.bind`, `_.curry`, and `_.partial` * may be applied regardless of execution order. Methods like `_.ary` and * `_.rearg` modify function arguments, making the order in which they are * executed important, preventing the merging of metadata. However, we make * an exception for a safe combined case where curried functions have `_.ary` * and or `_.rearg` applied. * * @private * @param {Array} data The destination metadata. * @param {Array} source The source metadata. * @returns {Array} Returns `data`. */ function mergeData(data, source) { var bitmask = data[1], srcBitmask = source[1], newBitmask = bitmask | srcBitmask, isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG); var isCombo = ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) || ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) || ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG)); // Exit early if metadata can't be merged. if (!(isCommon || isCombo)) { return data; } // Use source `thisArg` if available. if (srcBitmask & WRAP_BIND_FLAG) { data[2] = source[2]; // Set when currying a bound function. newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG; } // Compose partial arguments. var value = source[3]; if (value) { var partials = data[3]; data[3] = partials ? composeArgs(partials, value, source[4]) : value; data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4]; } // Compose partial right arguments. value = source[5]; if (value) { partials = data[5]; data[5] = partials ? composeArgsRight(partials, value, source[6]) : value; data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6]; } // Use source `argPos` if available. value = source[7]; if (value) { data[7] = value; } // Use source `ary` if it's smaller. if (srcBitmask & WRAP_ARY_FLAG) { data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]); } // Use source `arity` if one is not provided. if (data[9] == null) { data[9] = source[9]; } // Use source `func` and merge bitmasks. data[0] = source[0]; data[1] = newBitmask; return data; } /** * This function is like * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) * except that it includes inherited enumerable properties. * * @private * @param {Object} object The object to query. * @returns {Array} Returns the array of property names. */ function nativeKeysIn(object) { var result = []; if (object != null) { for (var key in Object(object)) { result.push(key); } } return result; } /** * Converts `value` to a string using `Object.prototype.toString`. * * @private * @param {*} value The value to convert. * @returns {string} Returns the converted string. */ function objectToString(value) { return nativeObjectToString.call(value); } /** * A specialized version of `baseRest` which transforms the rest array. * * @private * @param {Function} func The function to apply a rest parameter to. * @param {number} [start=func.length-1] The start position of the rest parameter. * @param {Function} transform The rest array transform. * @returns {Function} Returns the new function. */ function overRest(func, start, transform) { start = nativeMax(start === undefined ? (func.length - 1) : start, 0); return function() { var args = arguments, index = -1, length = nativeMax(args.length - start, 0), array = Array(length); while (++index < length) { array[index] = args[start + index]; } index = -1; var otherArgs = Array(start + 1); while (++index < start) { otherArgs[index] = args[index]; } otherArgs[start] = transform(array); return apply(func, this, otherArgs); }; } /** * Gets the parent value at `path` of `object`. * * @private * @param {Object} object The object to query. * @param {Array} path The path to get the parent value of. * @returns {*} Returns the parent value. */ function parent(object, path) { return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1)); } /** * Reorder `array` according to the specified indexes where the element at * the first index is assigned as the first element, the element at * the second index is assigned as the second element, and so on. * * @private * @param {Array} array The array to reorder. * @param {Array} indexes The arranged array indexes. * @returns {Array} Returns `array`. */ function reorder(array, indexes) { var arrLength = array.length, length = nativeMin(indexes.length, arrLength), oldArray = copyArray(array); while (length--) { var index = indexes[length]; array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined; } return array; } /** * Gets the value at `key`, unless `key` is "__proto__" or "constructor". * * @private * @param {Object} object The object to query. * @param {string} key The key of the property to get. * @returns {*} Returns the property value. */ function safeGet(object, key) { if (key === 'constructor' && typeof object[key] === 'function') { return; } if (key == '__proto__') { return; } return object[key]; } /** * Sets metadata for `func`. * * **Note:** If this function becomes hot, i.e. is invoked a lot in a short * period of time, it will trip its breaker and transition to an identity * function to avoid garbage collection pauses in V8. See * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070) * for more details. * * @private * @param {Function} func The function to associate metadata with. * @param {*} data The metadata. * @returns {Function} Returns `func`. */ var setData = shortOut(baseSetData); /** * A simple wrapper around the global [`setTimeout`](https://mdn.io/setTimeout). * * @private * @param {Function} func The function to delay. * @param {number} wait The number of milliseconds to delay invocation. * @returns {number|Object} Returns the timer id or timeout object. */ var setTimeout = ctxSetTimeout || function(func, wait) { return root.setTimeout(func, wait); }; /** * Sets the `toString` method of `func` to return `string`. * * @private * @param {Function} func The function to modify. * @param {Function} string The `toString` result. * @returns {Function} Returns `func`. */ var setToString = shortOut(baseSetToString); /** * Sets the `toString` method of `wrapper` to mimic the source of `reference` * with wrapper details in a comment at the top of the source body. * * @private * @param {Function} wrapper The function to modify. * @param {Function} reference The reference function. * @param {number} bitmask The bitmask flags. See `createWrap` for more details. * @returns {Function} Returns `wrapper`. */ function setWrapToString(wrapper, reference, bitmask) { var source = (reference + ''); return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask))); } /** * Creates a function that'll short out and invoke `identity` instead * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN` * milliseconds. * * @private * @param {Function} func The function to restrict. * @returns {Function} Returns the new shortable function. */ function shortOut(func) { var count = 0, lastCalled = 0; return function() { var stamp = nativeNow(), remaining = HOT_SPAN - (stamp - lastCalled); lastCalled = stamp; if (remaining > 0) { if (++count >= HOT_COUNT) { return arguments[0]; } } else { count = 0; } return func.apply(undefined, arguments); }; } /** * A specialized version of `_.shuffle` which mutates and sets the size of `array`. * * @private * @param {Array} array The array to shuffle. * @param {number} [size=array.length] The size of `array`. * @returns {Array} Returns `array`. */ function shuffleSelf(array, size) { var index = -1, length = array.length, lastIndex = length - 1; size = size === undefined ? length : size; while (++index < size) { var rand = baseRandom(index, lastIndex), value = array[rand]; array[rand] = array[index]; array[index] = value; } array.length = size; return array; } /** * Converts `string` to a property path array. * * @private * @param {string} string The string to convert. * @returns {Array} Returns the property path array. */ var stringToPath = memoizeCapped(function(string) { var result = []; if (string.charCodeAt(0) === 46 /* . */) { result.push(''); } string.replace(rePropName, function(match, number, quote, subString) { result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match)); }); return result; }); /** * Converts `value` to a string key if it's not a string or symbol. * * @private * @param {*} value The value to inspect. * @returns {string|symbol} Returns the key. */ function toKey(value) { if (typeof value == 'string' || isSymbol(value)) { return value; } var result = (value + ''); return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; } /** * Converts `func` to its source code. * * @private * @param {Function} func The function to convert. * @returns {string} Returns the source code. */ function toSource(func) { if (func != null) { try { return funcToString.call(func); } catch (e) {} try { return (func + ''); } catch (e) {} } return ''; } /** * Updates wrapper `details` based on `bitmask` flags. * * @private * @returns {Array} details The details to modify. * @param {number} bitmask The bitmask flags. See `createWrap` for more details. * @returns {Array} Returns `details`. */ function updateWrapDetails(details, bitmask) { arrayEach(wrapFlags, function(pair) { var value = '_.' + pair[0]; if ((bitmask & pair[1]) && !arrayIncludes(details, value)) { details.push(value); } }); return details.sort(); } /** * Creates a clone of `wrapper`. * * @private * @param {Object} wrapper The wrapper to clone. * @returns {Object} Returns the cloned wrapper. */ function wrapperClone(wrapper) { if (wrapper instanceof LazyWrapper) { return wrapper.clone(); } var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__); result.__actions__ = copyArray(wrapper.__actions__); result.__index__ = wrapper.__index__; result.__values__ = wrapper.__values__; return result; } /*------------------------------------------------------------------------*/ /** * Creates an array of elements split into groups the length of `size`. * If `array` can't be split evenly, the final chunk will be the remaining * elements. * * @static * @memberOf _ * @since 3.0.0 * @category Array * @param {Array} array The array to process. * @param {number} [size=1] The length of each chunk * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {Array} Returns the new array of chunks. * @example * * _.chunk(['a', 'b', 'c', 'd'], 2); * // => [['a', 'b'], ['c', 'd']] * * _.chunk(['a', 'b', 'c', 'd'], 3); * // => [['a', 'b', 'c'], ['d']] */ function chunk(array, size, guard) { if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) { size = 1; } else { size = nativeMax(toInteger(size), 0); } var length = array == null ? 0 : array.length; if (!length || size < 1) { return []; } var index = 0, resIndex = 0, result = Array(nativeCeil(length / size)); while (index < length) { result[resIndex++] = baseSlice(array, index, (index += size)); } return result; } /** * Creates an array with all falsey values removed. The values `false`, `null`, * `0`, `""`, `undefined`, and `NaN` are falsey. * * @static * @memberOf _ * @since 0.1.0 * @category Array * @param {Array} array The array to compact. * @returns {Array} Returns the new array of filtered values. * @example * * _.compact([0, 1, false, 2, '', 3]); * // => [1, 2, 3] */ function compact(array) { var index = -1, length = array == null ? 0 : array.length, resIndex = 0, result = []; while (++index < length) { var value = array[index]; if (value) { result[resIndex++] = value; } } return result; } /** * Creates a new array concatenating `array` with any additional arrays * and/or values. * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {Array} array The array to concatenate. * @param {...*} [values] The values to concatenate. * @returns {Array} Returns the new concatenated array. * @example * * var array = [1]; * var other = _.concat(array, 2, [3], [[4]]); * * console.log(other); * // => [1, 2, 3, [4]] * * console.log(array); * // => [1] */ function concat() { var length = arguments.length; if (!length) { return []; } var args = Array(length - 1), array = arguments[0], index = length; while (index--) { args[index - 1] = arguments[index]; } return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1)); } /** * Creates an array of `array` values not included in the other given arrays * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * for equality comparisons. The order and references of result values are * determined by the first array. * * **Note:** Unlike `_.pullAll`, this method returns a new array. * * @static * @memberOf _ * @since 0.1.0 * @category Array * @param {Array} array The array to inspect. * @param {...Array} [values] The values to exclude. * @returns {Array} Returns the new array of filtered values. * @see _.without, _.xor * @example * * _.difference([2, 1], [2, 3]); * // => [1] */ var difference = baseRest(function(array, values) { return isArrayLikeObject(array) ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true)) : []; }); /** * This method is like `_.difference` except that it accepts `iteratee` which * is invoked for each element of `array` and `values` to generate the criterion * by which they're compared. The order and references of result values are * determined by the first array. The iteratee is invoked with one argument: * (value). * * **Note:** Unlike `_.pullAllBy`, this method returns a new array. * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {Array} array The array to inspect. * @param {...Array} [values] The values to exclude. * @param {Function} [iteratee=_.identity] The iteratee invoked per element. * @returns {Array} Returns the new array of filtered values. * @example * * _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor); * // => [1.2] * * // The `_.property` iteratee shorthand. * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x'); * // => [{ 'x': 2 }] */ var differenceBy = baseRest(function(array, values) { var iteratee = last(values); if (isArrayLikeObject(iteratee)) { iteratee = undefined; } return isArrayLikeObject(array) ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee, 2)) : []; }); /** * This method is like `_.difference` except that it accepts `comparator` * which is invoked to compare elements of `array` to `values`. The order and * references of result values are determined by the first array. The comparator * is invoked with two arguments: (arrVal, othVal). * * **Note:** Unlike `_.pullAllWith`, this method returns a new array. * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {Array} array The array to inspect. * @param {...Array} [values] The values to exclude. * @param {Function} [comparator] The comparator invoked per element. * @returns {Array} Returns the new array of filtered values. * @example * * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; * * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual); * // => [{ 'x': 2, 'y': 1 }] */ var differenceWith = baseRest(function(array, values) { var comparator = last(values); if (isArrayLikeObject(comparator)) { comparator = undefined; } return isArrayLikeObject(array) ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator) : []; }); /** * Creates a slice of `array` with `n` elements dropped from the beginning. * * @static * @memberOf _ * @since 0.5.0 * @category Array * @param {Array} array The array to query. * @param {number} [n=1] The number of elements to drop. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {Array} Returns the slice of `array`. * @example * * _.drop([1, 2, 3]); * // => [2, 3] * * _.drop([1, 2, 3], 2); * // => [3] * * _.drop([1, 2, 3], 5); * // => [] * * _.drop([1, 2, 3], 0); * // => [1, 2, 3] */ function drop(array, n, guard) { var length = array == null ? 0 : array.length; if (!length) { return []; } n = (guard || n === undefined) ? 1 : toInteger(n); return baseSlice(array, n < 0 ? 0 : n, length); } /** * Creates a slice of `array` with `n` elements dropped from the end. * * @static * @memberOf _ * @since 3.0.0 * @category Array * @param {Array} array The array to query. * @param {number} [n=1] The number of elements to drop. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {Array} Returns the slice of `array`. * @example * * _.dropRight([1, 2, 3]); * // => [1, 2] * * _.dropRight([1, 2, 3], 2); * // => [1] * * _.dropRight([1, 2, 3], 5); * // => [] * * _.dropRight([1, 2, 3], 0); * // => [1, 2, 3] */ function dropRight(array, n, guard) { var length = array == null ? 0 : array.length; if (!length) { return []; } n = (guard || n === undefined) ? 1 : toInteger(n); n = length - n; return baseSlice(array, 0, n < 0 ? 0 : n); } /** * Creates a slice of `array` excluding elements dropped from the end. * Elements are dropped until `predicate` returns falsey. The predicate is * invoked with three arguments: (value, index, array). * * @static * @memberOf _ * @since 3.0.0 * @category Array * @param {Array} array The array to query. * @param {Function} [predicate=_.identity] The function invoked per iteration. * @returns {Array} Returns the slice of `array`. * @example * * var users = [ * { 'user': 'barney', 'active': true }, * { 'user': 'fred', 'active': false }, * { 'user': 'pebbles', 'active': false } * ]; * * _.dropRightWhile(users, function(o) { return !o.active; }); * // => objects for ['barney'] * * // The `_.matches` iteratee shorthand. * _.dropRightWhile(users, { 'user': 'pebbles', 'active': false }); * // => objects for ['barney', 'fred'] * * // The `_.matchesProperty` iteratee shorthand. * _.dropRightWhile(users, ['active', false]); * // => objects for ['barney'] * * // The `_.property` iteratee shorthand. * _.dropRightWhile(users, 'active'); * // => objects for ['barney', 'fred', 'pebbles'] */ function dropRightWhile(array, predicate) { return (array && array.length) ? baseWhile(array, getIteratee(predicate, 3), true, true) : []; } /** * Creates a slice of `array` excluding elements dropped from the beginning. * Elements are dropped until `predicate` returns falsey. The predicate is * invoked with three arguments: (value, index, array). * * @static * @memberOf _ * @since 3.0.0 * @category Array * @param {Array} array The array to query. * @param {Function} [predicate=_.identity] The function invoked per iteration. * @returns {Array} Returns the slice of `array`. * @example * * var users = [ * { 'user': 'barney', 'active': false }, * { 'user': 'fred', 'active': false }, * { 'user': 'pebbles', 'active': true } * ]; * * _.dropWhile(users, function(o) { return !o.active; }); * // => objects for ['pebbles'] * * // The `_.matches` iteratee shorthand. * _.dropWhile(users, { 'user': 'barney', 'active': false }); * // => objects for ['fred', 'pebbles'] * * // The `_.matchesProperty` iteratee shorthand. * _.dropWhile(users, ['active', false]); * // => objects for ['pebbles'] * * // The `_.property` iteratee shorthand. * _.dropWhile(users, 'active'); * // => objects for ['barney', 'fred', 'pebbles'] */ function dropWhile(array, predicate) { return (array && array.length) ? baseWhile(array, getIteratee(predicate, 3), true) : []; } /** * Fills elements of `array` with `value` from `start` up to, but not * including, `end`. * * **Note:** This method mutates `array`. * * @static * @memberOf _ * @since 3.2.0 * @category Array * @param {Array} array The array to fill. * @param {*} value The value to fill `array` with. * @param {number} [start=0] The start position. * @param {number} [end=array.length] The end position. * @returns {Array} Returns `array`. * @example * * var array = [1, 2, 3]; * * _.fill(array, 'a'); * console.log(array); * // => ['a', 'a', 'a'] * * _.fill(Array(3), 2); * // => [2, 2, 2] * * _.fill([4, 6, 8, 10], '*', 1, 3); * // => [4, '*', '*', 10] */ function fill(array, value, start, end) { var length = array == null ? 0 : array.length; if (!length) { return []; } if (start && typeof start != 'number' && isIterateeCall(array, value, start)) { start = 0; end = length; } return baseFill(array, value, start, end); } /** * This method is like `_.find` except that it returns the index of the first * element `predicate` returns truthy for instead of the element itself. * * @static * @memberOf _ * @since 1.1.0 * @category Array * @param {Array} array The array to inspect. * @param {Function} [predicate=_.identity] The function invoked per iteration. * @param {number} [fromIndex=0] The index to search from. * @returns {number} Returns the index of the found element, else `-1`. * @example * * var users = [ * { 'user': 'barney', 'active': false }, * { 'user': 'fred', 'active': false }, * { 'user': 'pebbles', 'active': true } * ]; * * _.findIndex(users, function(o) { return o.user == 'barney'; }); * // => 0 * * // The `_.matches` iteratee shorthand. * _.findIndex(users, { 'user': 'fred', 'active': false }); * // => 1 * * // The `_.matchesProperty` iteratee shorthand. * _.findIndex(users, ['active', false]); * // => 0 * * // The `_.property` iteratee shorthand. * _.findIndex(users, 'active'); * // => 2 */ function findIndex(array, predicate, fromIndex) { var length = array == null ? 0 : array.length; if (!length) { return -1; } var index = fromIndex == null ? 0 : toInteger(fromIndex); if (index < 0) { index = nativeMax(length + index, 0); } return baseFindIndex(array, getIteratee(predicate, 3), index); } /** * This method is like `_.findIndex` except that it iterates over elements * of `collection` from right to left. * * @static * @memberOf _ * @since 2.0.0 * @category Array * @param {Array} array The array to inspect. * @param {Function} [predicate=_.identity] The function invoked per iteration. * @param {number} [fromIndex=array.length-1] The index to search from. * @returns {number} Returns the index of the found element, else `-1`. * @example * * var users = [ * { 'user': 'barney', 'active': true }, * { 'user': 'fred', 'active': false }, * { 'user': 'pebbles', 'active': false } * ]; * * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; }); * // => 2 * * // The `_.matches` iteratee shorthand. * _.findLastIndex(users, { 'user': 'barney', 'active': true }); * // => 0 * * // The `_.matchesProperty` iteratee shorthand. * _.findLastIndex(users, ['active', false]); * // => 2 * * // The `_.property` iteratee shorthand. * _.findLastIndex(users, 'active'); * // => 0 */ function findLastIndex(array, predicate, fromIndex) { var length = array == null ? 0 : array.length; if (!length) { return -1; } var index = length - 1; if (fromIndex !== undefined) { index = toInteger(fromIndex); index = fromIndex < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1); } return baseFindIndex(array, getIteratee(predicate, 3), index, true); } /** * Flattens `array` a single level deep. * * @static * @memberOf _ * @since 0.1.0 * @category Array * @param {Array} array The array to flatten. * @returns {Array} Returns the new flattened array. * @example * * _.flatten([1, [2, [3, [4]], 5]]); * // => [1, 2, [3, [4]], 5] */ function flatten(array) { var length = array == null ? 0 : array.length; return length ? baseFlatten(array, 1) : []; } /** * Recursively flattens `array`. * * @static * @memberOf _ * @since 3.0.0 * @category Array * @param {Array} array The array to flatten. * @returns {Array} Returns the new flattened array. * @example * * _.flattenDeep([1, [2, [3, [4]], 5]]); * // => [1, 2, 3, 4, 5] */ function flattenDeep(array) { var length = array == null ? 0 : array.length; return length ? baseFlatten(array, INFINITY) : []; } /** * Recursively flatten `array` up to `depth` times. * * @static * @memberOf _ * @since 4.4.0 * @category Array * @param {Array} array The array to flatten. * @param {number} [depth=1] The maximum recursion depth. * @returns {Array} Returns the new flattened array. * @example * * var array = [1, [2, [3, [4]], 5]]; * * _.flattenDepth(array, 1); * // => [1, 2, [3, [4]], 5] * * _.flattenDepth(array, 2); * // => [1, 2, 3, [4], 5] */ function flattenDepth(array, depth) { var length = array == null ? 0 : array.length; if (!length) { return []; } depth = depth === undefined ? 1 : toInteger(depth); return baseFlatten(array, depth); } /** * The inverse of `_.toPairs`; this method returns an object composed * from key-value `pairs`. * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {Array} pairs The key-value pairs. * @returns {Object} Returns the new object. * @example * * _.fromPairs([['a', 1], ['b', 2]]); * // => { 'a': 1, 'b': 2 } */ function fromPairs(pairs) { var index = -1, length = pairs == null ? 0 : pairs.length, result = {}; while (++index < length) { var pair = pairs[index]; result[pair[0]] = pair[1]; } return result; } /** * Gets the first element of `array`. * * @static * @memberOf _ * @since 0.1.0 * @alias first * @category Array * @param {Array} array The array to query. * @returns {*} Returns the first element of `array`. * @example * * _.head([1, 2, 3]); * // => 1 * * _.head([]); * // => undefined */ function head(array) { return (array && array.length) ? array[0] : undefined; } /** * Gets the index at which the first occurrence of `value` is found in `array` * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * for equality comparisons. If `fromIndex` is negative, it's used as the * offset from the end of `array`. * * @static * @memberOf _ * @since 0.1.0 * @category Array * @param {Array} array The array to inspect. * @param {*} value The value to search for. * @param {number} [fromIndex=0] The index to search from. * @returns {number} Returns the index of the matched value, else `-1`. * @example * * _.indexOf([1, 2, 1, 2], 2); * // => 1 * * // Search from the `fromIndex`. * _.indexOf([1, 2, 1, 2], 2, 2); * // => 3 */ function indexOf(array, value, fromIndex) { var length = array == null ? 0 : array.length; if (!length) { return -1; } var index = fromIndex == null ? 0 : toInteger(fromIndex); if (index < 0) { index = nativeMax(length + index, 0); } return baseIndexOf(array, value, index); } /** * Gets all but the last element of `array`. * * @static * @memberOf _ * @since 0.1.0 * @category Array * @param {Array} array The array to query. * @returns {Array} Returns the slice of `array`. * @example * * _.initial([1, 2, 3]); * // => [1, 2] */ function initial(array) { var length = array == null ? 0 : array.length; return length ? baseSlice(array, 0, -1) : []; } /** * Creates an array of unique values that are included in all given arrays * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * for equality comparisons. The order and references of result values are * determined by the first array. * * @static * @memberOf _ * @since 0.1.0 * @category Array * @param {...Array} [arrays] The arrays to inspect. * @returns {Array} Returns the new array of intersecting values. * @example * * _.intersection([2, 1], [2, 3]); * // => [2] */ var intersection = baseRest(function(arrays) { var mapped = arrayMap(arrays, castArrayLikeObject); return (mapped.length && mapped[0] === arrays[0]) ? baseIntersection(mapped) : []; }); /** * This method is like `_.intersection` except that it accepts `iteratee` * which is invoked for each element of each `arrays` to generate the criterion * by which they're compared. The order and references of result values are * determined by the first array. The iteratee is invoked with one argument: * (value). * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {...Array} [arrays] The arrays to inspect. * @param {Function} [iteratee=_.identity] The iteratee invoked per element. * @returns {Array} Returns the new array of intersecting values. * @example * * _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor); * // => [2.1] * * // The `_.property` iteratee shorthand. * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); * // => [{ 'x': 1 }] */ var intersectionBy = baseRest(function(arrays) { var iteratee = last(arrays), mapped = arrayMap(arrays, castArrayLikeObject); if (iteratee === last(mapped)) { iteratee = undefined; } else { mapped.pop(); } return (mapped.length && mapped[0] === arrays[0]) ? baseIntersection(mapped, getIteratee(iteratee, 2)) : []; }); /** * This method is like `_.intersection` except that it accepts `comparator` * which is invoked to compare elements of `arrays`. The order and references * of result values are determined by the first array. The comparator is * invoked with two arguments: (arrVal, othVal). * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {...Array} [arrays] The arrays to inspect. * @param {Function} [comparator] The comparator invoked per element. * @returns {Array} Returns the new array of intersecting values. * @example * * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; * * _.intersectionWith(objects, others, _.isEqual); * // => [{ 'x': 1, 'y': 2 }] */ var intersectionWith = baseRest(function(arrays) { var comparator = last(arrays), mapped = arrayMap(arrays, castArrayLikeObject); comparator = typeof comparator == 'function' ? comparator : undefined; if (comparator) { mapped.pop(); } return (mapped.length && mapped[0] === arrays[0]) ? baseIntersection(mapped, undefined, comparator) : []; }); /** * Converts all elements in `array` into a string separated by `separator`. * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {Array} array The array to convert. * @param {string} [separator=','] The element separator. * @returns {string} Returns the joined string. * @example * * _.join(['a', 'b', 'c'], '~'); * // => 'a~b~c' */ function join(array, separator) { return array == null ? '' : nativeJoin.call(array, separator); } /** * Gets the last element of `array`. * * @static * @memberOf _ * @since 0.1.0 * @category Array * @param {Array} array The array to query. * @returns {*} Returns the last element of `array`. * @example * * _.last([1, 2, 3]); * // => 3 */ function last(array) { var length = array == null ? 0 : array.length; return length ? array[length - 1] : undefined; } /** * This method is like `_.indexOf` except that it iterates over elements of * `array` from right to left. * * @static * @memberOf _ * @since 0.1.0 * @category Array * @param {Array} array The array to inspect. * @param {*} value The value to search for. * @param {number} [fromIndex=array.length-1] The index to search from. * @returns {number} Returns the index of the matched value, else `-1`. * @example * * _.lastIndexOf([1, 2, 1, 2], 2); * // => 3 * * // Search from the `fromIndex`. * _.lastIndexOf([1, 2, 1, 2], 2, 2); * // => 1 */ function lastIndexOf(array, value, fromIndex) { var length = array == null ? 0 : array.length; if (!length) { return -1; } var index = length; if (fromIndex !== undefined) { index = toInteger(fromIndex); index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1); } return value === value ? strictLastIndexOf(array, value, index) : baseFindIndex(array, baseIsNaN, index, true); } /** * Gets the element at index `n` of `array`. If `n` is negative, the nth * element from the end is returned. * * @static * @memberOf _ * @since 4.11.0 * @category Array * @param {Array} array The array to query. * @param {number} [n=0] The index of the element to return. * @returns {*} Returns the nth element of `array`. * @example * * var array = ['a', 'b', 'c', 'd']; * * _.nth(array, 1); * // => 'b' * * _.nth(array, -2); * // => 'c'; */ function nth(array, n) { return (array && array.length) ? baseNth(array, toInteger(n)) : undefined; } /** * Removes all given values from `array` using * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * for equality comparisons. * * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove` * to remove elements from an array by predicate. * * @static * @memberOf _ * @since 2.0.0 * @category Array * @param {Array} array The array to modify. * @param {...*} [values] The values to remove. * @returns {Array} Returns `array`. * @example * * var array = ['a', 'b', 'c', 'a', 'b', 'c']; * * _.pull(array, 'a', 'c'); * console.log(array); * // => ['b', 'b'] */ var pull = baseRest(pullAll); /** * This method is like `_.pull` except that it accepts an array of values to remove. * * **Note:** Unlike `_.difference`, this method mutates `array`. * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {Array} array The array to modify. * @param {Array} values The values to remove. * @returns {Array} Returns `array`. * @example * * var array = ['a', 'b', 'c', 'a', 'b', 'c']; * * _.pullAll(array, ['a', 'c']); * console.log(array); * // => ['b', 'b'] */ function pullAll(array, values) { return (array && array.length && values && values.length) ? basePullAll(array, values) : array; } /** * This method is like `_.pullAll` except that it accepts `iteratee` which is * invoked for each element of `array` and `values` to generate the criterion * by which they're compared. The iteratee is invoked with one argument: (value). * * **Note:** Unlike `_.differenceBy`, this method mutates `array`. * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {Array} array The array to modify. * @param {Array} values The values to remove. * @param {Function} [iteratee=_.identity] The iteratee invoked per element. * @returns {Array} Returns `array`. * @example * * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }]; * * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x'); * console.log(array); * // => [{ 'x': 2 }] */ function pullAllBy(array, values, iteratee) { return (array && array.length && values && values.length) ? basePullAll(array, values, getIteratee(iteratee, 2)) : array; } /** * This method is like `_.pullAll` except that it accepts `comparator` which * is invoked to compare elements of `array` to `values`. The comparator is * invoked with two arguments: (arrVal, othVal). * * **Note:** Unlike `_.differenceWith`, this method mutates `array`. * * @static * @memberOf _ * @since 4.6.0 * @category Array * @param {Array} array The array to modify. * @param {Array} values The values to remove. * @param {Function} [comparator] The comparator invoked per element. * @returns {Array} Returns `array`. * @example * * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }]; * * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual); * console.log(array); * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }] */ function pullAllWith(array, values, comparator) { return (array && array.length && values && values.length) ? basePullAll(array, values, undefined, comparator) : array; } /** * Removes elements from `array` corresponding to `indexes` and returns an * array of removed elements. * * **Note:** Unlike `_.at`, this method mutates `array`. * * @static * @memberOf _ * @since 3.0.0 * @category Array * @param {Array} array The array to modify. * @param {...(number|number[])} [indexes] The indexes of elements to remove. * @returns {Array} Returns the new array of removed elements. * @example * * var array = ['a', 'b', 'c', 'd']; * var pulled = _.pullAt(array, [1, 3]); * * console.log(array); * // => ['a', 'c'] * * console.log(pulled); * // => ['b', 'd'] */ var pullAt = flatRest(function(array, indexes) { var length = array == null ? 0 : array.length, result = baseAt(array, indexes); basePullAt(array, arrayMap(indexes, function(index) { return isIndex(index, length) ? +index : index; }).sort(compareAscending)); return result; }); /** * Removes all elements from `array` that `predicate` returns truthy for * and returns an array of the removed elements. The predicate is invoked * with three arguments: (value, index, array). * * **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull` * to pull elements from an array by value. * * @static * @memberOf _ * @since 2.0.0 * @category Array * @param {Array} array The array to modify. * @param {Function} [predicate=_.identity] The function invoked per iteration. * @returns {Array} Returns the new array of removed elements. * @example * * var array = [1, 2, 3, 4]; * var evens = _.remove(array, function(n) { * return n % 2 == 0; * }); * * console.log(array); * // => [1, 3] * * console.log(evens); * // => [2, 4] */ function remove(array, predicate) { var result = []; if (!(array && array.length)) { return result; } var index = -1, indexes = [], length = array.length; predicate = getIteratee(predicate, 3); while (++index < length) { var value = array[index]; if (predicate(value, index, array)) { result.push(value); indexes.push(index); } } basePullAt(array, indexes); return result; } /** * Reverses `array` so that the first element becomes the last, the second * element becomes the second to last, and so on. * * **Note:** This method mutates `array` and is based on * [`Array#reverse`](https://mdn.io/Array/reverse). * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {Array} array The array to modify. * @returns {Array} Returns `array`. * @example * * var array = [1, 2, 3]; * * _.reverse(array); * // => [3, 2, 1] * * console.log(array); * // => [3, 2, 1] */ function reverse(array) { return array == null ? array : nativeReverse.call(array); } /** * Creates a slice of `array` from `start` up to, but not including, `end`. * * **Note:** This method is used instead of * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are * returned. * * @static * @memberOf _ * @since 3.0.0 * @category Array * @param {Array} array The array to slice. * @param {number} [start=0] The start position. * @param {number} [end=array.length] The end position. * @returns {Array} Returns the slice of `array`. */ function slice(array, start, end) { var length = array == null ? 0 : array.length; if (!length) { return []; } if (end && typeof end != 'number' && isIterateeCall(array, start, end)) { start = 0; end = length; } else { start = start == null ? 0 : toInteger(start); end = end === undefined ? length : toInteger(end); } return baseSlice(array, start, end); } /** * Uses a binary search to determine the lowest index at which `value` * should be inserted into `array` in order to maintain its sort order. * * @static * @memberOf _ * @since 0.1.0 * @category Array * @param {Array} array The sorted array to inspect. * @param {*} value The value to evaluate. * @returns {number} Returns the index at which `value` should be inserted * into `array`. * @example * * _.sortedIndex([30, 50], 40); * // => 1 */ function sortedIndex(array, value) { return baseSortedIndex(array, value); } /** * This method is like `_.sortedIndex` except that it accepts `iteratee` * which is invoked for `value` and each element of `array` to compute their * sort ranking. The iteratee is invoked with one argument: (value). * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {Array} array The sorted array to inspect. * @param {*} value The value to evaluate. * @param {Function} [iteratee=_.identity] The iteratee invoked per element. * @returns {number} Returns the index at which `value` should be inserted * into `array`. * @example * * var objects = [{ 'x': 4 }, { 'x': 5 }]; * * _.sortedIndexBy(objects, { 'x': 4 }, function(o) { return o.x; }); * // => 0 * * // The `_.property` iteratee shorthand. * _.sortedIndexBy(objects, { 'x': 4 }, 'x'); * // => 0 */ function sortedIndexBy(array, value, iteratee) { return baseSortedIndexBy(array, value, getIteratee(iteratee, 2)); } /** * This method is like `_.indexOf` except that it performs a binary * search on a sorted `array`. * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {Array} array The array to inspect. * @param {*} value The value to search for. * @returns {number} Returns the index of the matched value, else `-1`. * @example * * _.sortedIndexOf([4, 5, 5, 5, 6], 5); * // => 1 */ function sortedIndexOf(array, value) { var length = array == null ? 0 : array.length; if (length) { var index = baseSortedIndex(array, value); if (index < length && eq(array[index], value)) { return index; } } return -1; } /** * This method is like `_.sortedIndex` except that it returns the highest * index at which `value` should be inserted into `array` in order to * maintain its sort order. * * @static * @memberOf _ * @since 3.0.0 * @category Array * @param {Array} array The sorted array to inspect. * @param {*} value The value to evaluate. * @returns {number} Returns the index at which `value` should be inserted * into `array`. * @example * * _.sortedLastIndex([4, 5, 5, 5, 6], 5); * // => 4 */ function sortedLastIndex(array, value) { return baseSortedIndex(array, value, true); } /** * This method is like `_.sortedLastIndex` except that it accepts `iteratee` * which is invoked for `value` and each element of `array` to compute their * sort ranking. The iteratee is invoked with one argument: (value). * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {Array} array The sorted array to inspect. * @param {*} value The value to evaluate. * @param {Function} [iteratee=_.identity] The iteratee invoked per element. * @returns {number} Returns the index at which `value` should be inserted * into `array`. * @example * * var objects = [{ 'x': 4 }, { 'x': 5 }]; * * _.sortedLastIndexBy(objects, { 'x': 4 }, function(o) { return o.x; }); * // => 1 * * // The `_.property` iteratee shorthand. * _.sortedLastIndexBy(objects, { 'x': 4 }, 'x'); * // => 1 */ function sortedLastIndexBy(array, value, iteratee) { return baseSortedIndexBy(array, value, getIteratee(iteratee, 2), true); } /** * This method is like `_.lastIndexOf` except that it performs a binary * search on a sorted `array`. * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {Array} array The array to inspect. * @param {*} value The value to search for. * @returns {number} Returns the index of the matched value, else `-1`. * @example * * _.sortedLastIndexOf([4, 5, 5, 5, 6], 5); * // => 3 */ function sortedLastIndexOf(array, value) { var length = array == null ? 0 : array.length; if (length) { var index = baseSortedIndex(array, value, true) - 1; if (eq(array[index], value)) { return index; } } return -1; } /** * This method is like `_.uniq` except that it's designed and optimized * for sorted arrays. * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {Array} array The array to inspect. * @returns {Array} Returns the new duplicate free array. * @example * * _.sortedUniq([1, 1, 2]); * // => [1, 2] */ function sortedUniq(array) { return (array && array.length) ? baseSortedUniq(array) : []; } /** * This method is like `_.uniqBy` except that it's designed and optimized * for sorted arrays. * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {Array} array The array to inspect. * @param {Function} [iteratee] The iteratee invoked per element. * @returns {Array} Returns the new duplicate free array. * @example * * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor); * // => [1.1, 2.3] */ function sortedUniqBy(array, iteratee) { return (array && array.length) ? baseSortedUniq(array, getIteratee(iteratee, 2)) : []; } /** * Gets all but the first element of `array`. * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {Array} array The array to query. * @returns {Array} Returns the slice of `array`. * @example * * _.tail([1, 2, 3]); * // => [2, 3] */ function tail(array) { var length = array == null ? 0 : array.length; return length ? baseSlice(array, 1, length) : []; } /** * Creates a slice of `array` with `n` elements taken from the beginning. * * @static * @memberOf _ * @since 0.1.0 * @category Array * @param {Array} array The array to query. * @param {number} [n=1] The number of elements to take. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {Array} Returns the slice of `array`. * @example * * _.take([1, 2, 3]); * // => [1] * * _.take([1, 2, 3], 2); * // => [1, 2] * * _.take([1, 2, 3], 5); * // => [1, 2, 3] * * _.take([1, 2, 3], 0); * // => [] */ function take(array, n, guard) { if (!(array && array.length)) { return []; } n = (guard || n === undefined) ? 1 : toInteger(n); return baseSlice(array, 0, n < 0 ? 0 : n); } /** * Creates a slice of `array` with `n` elements taken from the end. * * @static * @memberOf _ * @since 3.0.0 * @category Array * @param {Array} array The array to query. * @param {number} [n=1] The number of elements to take. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {Array} Returns the slice of `array`. * @example * * _.takeRight([1, 2, 3]); * // => [3] * * _.takeRight([1, 2, 3], 2); * // => [2, 3] * * _.takeRight([1, 2, 3], 5); * // => [1, 2, 3] * * _.takeRight([1, 2, 3], 0); * // => [] */ function takeRight(array, n, guard) { var length = array == null ? 0 : array.length; if (!length) { return []; } n = (guard || n === undefined) ? 1 : toInteger(n); n = length - n; return baseSlice(array, n < 0 ? 0 : n, length); } /** * Creates a slice of `array` with elements taken from the end. Elements are * taken until `predicate` returns falsey. The predicate is invoked with * three arguments: (value, index, array). * * @static * @memberOf _ * @since 3.0.0 * @category Array * @param {Array} array The array to query. * @param {Function} [predicate=_.identity] The function invoked per iteration. * @returns {Array} Returns the slice of `array`. * @example * * var users = [ * { 'user': 'barney', 'active': true }, * { 'user': 'fred', 'active': false }, * { 'user': 'pebbles', 'active': false } * ]; * * _.takeRightWhile(users, function(o) { return !o.active; }); * // => objects for ['fred', 'pebbles'] * * // The `_.matches` iteratee shorthand. * _.takeRightWhile(users, { 'user': 'pebbles', 'active': false }); * // => objects for ['pebbles'] * * // The `_.matchesProperty` iteratee shorthand. * _.takeRightWhile(users, ['active', false]); * // => objects for ['fred', 'pebbles'] * * // The `_.property` iteratee shorthand. * _.takeRightWhile(users, 'active'); * // => [] */ function takeRightWhile(array, predicate) { return (array && array.length) ? baseWhile(array, getIteratee(predicate, 3), false, true) : []; } /** * Creates a slice of `array` with elements taken from the beginning. Elements * are taken until `predicate` returns falsey. The predicate is invoked with * three arguments: (value, index, array). * * @static * @memberOf _ * @since 3.0.0 * @category Array * @param {Array} array The array to query. * @param {Function} [predicate=_.identity] The function invoked per iteration. * @returns {Array} Returns the slice of `array`. * @example * * var users = [ * { 'user': 'barney', 'active': false }, * { 'user': 'fred', 'active': false }, * { 'user': 'pebbles', 'active': true } * ]; * * _.takeWhile(users, function(o) { return !o.active; }); * // => objects for ['barney', 'fred'] * * // The `_.matches` iteratee shorthand. * _.takeWhile(users, { 'user': 'barney', 'active': false }); * // => objects for ['barney'] * * // The `_.matchesProperty` iteratee shorthand. * _.takeWhile(users, ['active', false]); * // => objects for ['barney', 'fred'] * * // The `_.property` iteratee shorthand. * _.takeWhile(users, 'active'); * // => [] */ function takeWhile(array, predicate) { return (array && array.length) ? baseWhile(array, getIteratee(predicate, 3)) : []; } /** * Creates an array of unique values, in order, from all given arrays using * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * for equality comparisons. * * @static * @memberOf _ * @since 0.1.0 * @category Array * @param {...Array} [arrays] The arrays to inspect. * @returns {Array} Returns the new array of combined values. * @example * * _.union([2], [1, 2]); * // => [2, 1] */ var union = baseRest(function(arrays) { return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true)); }); /** * This method is like `_.union` except that it accepts `iteratee` which is * invoked for each element of each `arrays` to generate the criterion by * which uniqueness is computed. Result values are chosen from the first * array in which the value occurs. The iteratee is invoked with one argument: * (value). * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {...Array} [arrays] The arrays to inspect. * @param {Function} [iteratee=_.identity] The iteratee invoked per element. * @returns {Array} Returns the new array of combined values. * @example * * _.unionBy([2.1], [1.2, 2.3], Math.floor); * // => [2.1, 1.2] * * // The `_.property` iteratee shorthand. * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); * // => [{ 'x': 1 }, { 'x': 2 }] */ var unionBy = baseRest(function(arrays) { var iteratee = last(arrays); if (isArrayLikeObject(iteratee)) { iteratee = undefined; } return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee, 2)); }); /** * This method is like `_.union` except that it accepts `comparator` which * is invoked to compare elements of `arrays`. Result values are chosen from * the first array in which the value occurs. The comparator is invoked * with two arguments: (arrVal, othVal). * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {...Array} [arrays] The arrays to inspect. * @param {Function} [comparator] The comparator invoked per element. * @returns {Array} Returns the new array of combined values. * @example * * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; * * _.unionWith(objects, others, _.isEqual); * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] */ var unionWith = baseRest(function(arrays) { var comparator = last(arrays); comparator = typeof comparator == 'function' ? comparator : undefined; return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined, comparator); }); /** * Creates a duplicate-free version of an array, using * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * for equality comparisons, in which only the first occurrence of each element * is kept. The order of result values is determined by the order they occur * in the array. * * @static * @memberOf _ * @since 0.1.0 * @category Array * @param {Array} array The array to inspect. * @returns {Array} Returns the new duplicate free array. * @example * * _.uniq([2, 1, 2]); * // => [2, 1] */ function uniq(array) { return (array && array.length) ? baseUniq(array) : []; } /** * This method is like `_.uniq` except that it accepts `iteratee` which is * invoked for each element in `array` to generate the criterion by which * uniqueness is computed. The order of result values is determined by the * order they occur in the array. The iteratee is invoked with one argument: * (value). * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {Array} array The array to inspect. * @param {Function} [iteratee=_.identity] The iteratee invoked per element. * @returns {Array} Returns the new duplicate free array. * @example * * _.uniqBy([2.1, 1.2, 2.3], Math.floor); * // => [2.1, 1.2] * * // The `_.property` iteratee shorthand. * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x'); * // => [{ 'x': 1 }, { 'x': 2 }] */ function uniqBy(array, iteratee) { return (array && array.length) ? baseUniq(array, getIteratee(iteratee, 2)) : []; } /** * This method is like `_.uniq` except that it accepts `comparator` which * is invoked to compare elements of `array`. The order of result values is * determined by the order they occur in the array.The comparator is invoked * with two arguments: (arrVal, othVal). * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {Array} array The array to inspect. * @param {Function} [comparator] The comparator invoked per element. * @returns {Array} Returns the new duplicate free array. * @example * * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }]; * * _.uniqWith(objects, _.isEqual); * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }] */ function uniqWith(array, comparator) { comparator = typeof comparator == 'function' ? comparator : undefined; return (array && array.length) ? baseUniq(array, undefined, comparator) : []; } /** * This method is like `_.zip` except that it accepts an array of grouped * elements and creates an array regrouping the elements to their pre-zip * configuration. * * @static * @memberOf _ * @since 1.2.0 * @category Array * @param {Array} array The array of grouped elements to process. * @returns {Array} Returns the new array of regrouped elements. * @example * * var zipped = _.zip(['a', 'b'], [1, 2], [true, false]); * // => [['a', 1, true], ['b', 2, false]] * * _.unzip(zipped); * // => [['a', 'b'], [1, 2], [true, false]] */ function unzip(array) { if (!(array && array.length)) { return []; } var length = 0; array = arrayFilter(array, function(group) { if (isArrayLikeObject(group)) { length = nativeMax(group.length, length); return true; } }); return baseTimes(length, function(index) { return arrayMap(array, baseProperty(index)); }); } /** * This method is like `_.unzip` except that it accepts `iteratee` to specify * how regrouped values should be combined. The iteratee is invoked with the * elements of each group: (...group). * * @static * @memberOf _ * @since 3.8.0 * @category Array * @param {Array} array The array of grouped elements to process. * @param {Function} [iteratee=_.identity] The function to combine * regrouped values. * @returns {Array} Returns the new array of regrouped elements. * @example * * var zipped = _.zip([1, 2], [10, 20], [100, 200]); * // => [[1, 10, 100], [2, 20, 200]] * * _.unzipWith(zipped, _.add); * // => [3, 30, 300] */ function unzipWith(array, iteratee) { if (!(array && array.length)) { return []; } var result = unzip(array); if (iteratee == null) { return result; } return arrayMap(result, function(group) { return apply(iteratee, undefined, group); }); } /** * Creates an array excluding all given values using * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * for equality comparisons. * * **Note:** Unlike `_.pull`, this method returns a new array. * * @static * @memberOf _ * @since 0.1.0 * @category Array * @param {Array} array The array to inspect. * @param {...*} [values] The values to exclude. * @returns {Array} Returns the new array of filtered values. * @see _.difference, _.xor * @example * * _.without([2, 1, 2, 3], 1, 2); * // => [3] */ var without = baseRest(function(array, values) { return isArrayLikeObject(array) ? baseDifference(array, values) : []; }); /** * Creates an array of unique values that is the * [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference) * of the given arrays. The order of result values is determined by the order * they occur in the arrays. * * @static * @memberOf _ * @since 2.4.0 * @category Array * @param {...Array} [arrays] The arrays to inspect. * @returns {Array} Returns the new array of filtered values. * @see _.difference, _.without * @example * * _.xor([2, 1], [2, 3]); * // => [1, 3] */ var xor = baseRest(function(arrays) { return baseXor(arrayFilter(arrays, isArrayLikeObject)); }); /** * This method is like `_.xor` except that it accepts `iteratee` which is * invoked for each element of each `arrays` to generate the criterion by * which by which they're compared. The order of result values is determined * by the order they occur in the arrays. The iteratee is invoked with one * argument: (value). * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {...Array} [arrays] The arrays to inspect. * @param {Function} [iteratee=_.identity] The iteratee invoked per element. * @returns {Array} Returns the new array of filtered values. * @example * * _.xorBy([2.1, 1.2], [2.3, 3.4], Math.floor); * // => [1.2, 3.4] * * // The `_.property` iteratee shorthand. * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); * // => [{ 'x': 2 }] */ var xorBy = baseRest(function(arrays) { var iteratee = last(arrays); if (isArrayLikeObject(iteratee)) { iteratee = undefined; } return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee, 2)); }); /** * This method is like `_.xor` except that it accepts `comparator` which is * invoked to compare elements of `arrays`. The order of result values is * determined by the order they occur in the arrays. The comparator is invoked * with two arguments: (arrVal, othVal). * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {...Array} [arrays] The arrays to inspect. * @param {Function} [comparator] The comparator invoked per element. * @returns {Array} Returns the new array of filtered values. * @example * * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; * * _.xorWith(objects, others, _.isEqual); * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] */ var xorWith = baseRest(function(arrays) { var comparator = last(arrays); comparator = typeof comparator == 'function' ? comparator : undefined; return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined, comparator); }); /** * Creates an array of grouped elements, the first of which contains the * first elements of the given arrays, the second of which contains the * second elements of the given arrays, and so on. * * @static * @memberOf _ * @since 0.1.0 * @category Array * @param {...Array} [arrays] The arrays to process. * @returns {Array} Returns the new array of grouped elements. * @example * * _.zip(['a', 'b'], [1, 2], [true, false]); * // => [['a', 1, true], ['b', 2, false]] */ var zip = baseRest(unzip); /** * This method is like `_.fromPairs` except that it accepts two arrays, * one of property identifiers and one of corresponding values. * * @static * @memberOf _ * @since 0.4.0 * @category Array * @param {Array} [props=[]] The property identifiers. * @param {Array} [values=[]] The property values. * @returns {Object} Returns the new object. * @example * * _.zipObject(['a', 'b'], [1, 2]); * // => { 'a': 1, 'b': 2 } */ function zipObject(props, values) { return baseZipObject(props || [], values || [], assignValue); } /** * This method is like `_.zipObject` except that it supports property paths. * * @static * @memberOf _ * @since 4.1.0 * @category Array * @param {Array} [props=[]] The property identifiers. * @param {Array} [values=[]] The property values. * @returns {Object} Returns the new object. * @example * * _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]); * // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } } */ function zipObjectDeep(props, values) { return baseZipObject(props || [], values || [], baseSet); } /** * This method is like `_.zip` except that it accepts `iteratee` to specify * how grouped values should be combined. The iteratee is invoked with the * elements of each group: (...group). * * @static * @memberOf _ * @since 3.8.0 * @category Array * @param {...Array} [arrays] The arrays to process. * @param {Function} [iteratee=_.identity] The function to combine * grouped values. * @returns {Array} Returns the new array of grouped elements. * @example * * _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) { * return a + b + c; * }); * // => [111, 222] */ var zipWith = baseRest(function(arrays) { var length = arrays.length, iteratee = length > 1 ? arrays[length - 1] : undefined; iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined; return unzipWith(arrays, iteratee); }); /*------------------------------------------------------------------------*/ /** * Creates a `lodash` wrapper instance that wraps `value` with explicit method * chain sequences enabled. The result of such sequences must be unwrapped * with `_#value`. * * @static * @memberOf _ * @since 1.3.0 * @category Seq * @param {*} value The value to wrap. * @returns {Object} Returns the new `lodash` wrapper instance. * @example * * var users = [ * { 'user': 'barney', 'age': 36 }, * { 'user': 'fred', 'age': 40 }, * { 'user': 'pebbles', 'age': 1 } * ]; * * var youngest = _ * .chain(users) * .sortBy('age') * .map(function(o) { * return o.user + ' is ' + o.age; * }) * .head() * .value(); * // => 'pebbles is 1' */ function chain(value) { var result = lodash(value); result.__chain__ = true; return result; } /** * This method invokes `interceptor` and returns `value`. The interceptor * is invoked with one argument; (value). The purpose of this method is to * "tap into" a method chain sequence in order to modify intermediate results. * * @static * @memberOf _ * @since 0.1.0 * @category Seq * @param {*} value The value to provide to `interceptor`. * @param {Function} interceptor The function to invoke. * @returns {*} Returns `value`. * @example * * _([1, 2, 3]) * .tap(function(array) { * // Mutate input array. * array.pop(); * }) * .reverse() * .value(); * // => [2, 1] */ function tap(value, interceptor) { interceptor(value); return value; } /** * This method is like `_.tap` except that it returns the result of `interceptor`. * The purpose of this method is to "pass thru" values replacing intermediate * results in a method chain sequence. * * @static * @memberOf _ * @since 3.0.0 * @category Seq * @param {*} value The value to provide to `interceptor`. * @param {Function} interceptor The function to invoke. * @returns {*} Returns the result of `interceptor`. * @example * * _(' abc ') * .chain() * .trim() * .thru(function(value) { * return [value]; * }) * .value(); * // => ['abc'] */ function thru(value, interceptor) { return interceptor(value); } /** * This method is the wrapper version of `_.at`. * * @name at * @memberOf _ * @since 1.0.0 * @category Seq * @param {...(string|string[])} [paths] The property paths to pick. * @returns {Object} Returns the new `lodash` wrapper instance. * @example * * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] }; * * _(object).at(['a[0].b.c', 'a[1]']).value(); * // => [3, 4] */ var wrapperAt = flatRest(function(paths) { var length = paths.length, start = length ? paths[0] : 0, value = this.__wrapped__, interceptor = function(object) { return baseAt(object, paths); }; if (length > 1 || this.__actions__.length || !(value instanceof LazyWrapper) || !isIndex(start)) { return this.thru(interceptor); } value = value.slice(start, +start + (length ? 1 : 0)); value.__actions__.push({ 'func': thru, 'args': [interceptor], 'thisArg': undefined }); return new LodashWrapper(value, this.__chain__).thru(function(array) { if (length && !array.length) { array.push(undefined); } return array; }); }); /** * Creates a `lodash` wrapper instance with explicit method chain sequences enabled. * * @name chain * @memberOf _ * @since 0.1.0 * @category Seq * @returns {Object} Returns the new `lodash` wrapper instance. * @example * * var users = [ * { 'user': 'barney', 'age': 36 }, * { 'user': 'fred', 'age': 40 } * ]; * * // A sequence without explicit chaining. * _(users).head(); * // => { 'user': 'barney', 'age': 36 } * * // A sequence with explicit chaining. * _(users) * .chain() * .head() * .pick('user') * .value(); * // => { 'user': 'barney' } */ function wrapperChain() { return chain(this); } /** * Executes the chain sequence and returns the wrapped result. * * @name commit * @memberOf _ * @since 3.2.0 * @category Seq * @returns {Object} Returns the new `lodash` wrapper instance. * @example * * var array = [1, 2]; * var wrapped = _(array).push(3); * * console.log(array); * // => [1, 2] * * wrapped = wrapped.commit(); * console.log(array); * // => [1, 2, 3] * * wrapped.last(); * // => 3 * * console.log(array); * // => [1, 2, 3] */ function wrapperCommit() { return new LodashWrapper(this.value(), this.__chain__); } /** * Gets the next value on a wrapped object following the * [iterator protocol](https://mdn.io/iteration_protocols#iterator). * * @name next * @memberOf _ * @since 4.0.0 * @category Seq * @returns {Object} Returns the next iterator value. * @example * * var wrapped = _([1, 2]); * * wrapped.next(); * // => { 'done': false, 'value': 1 } * * wrapped.next(); * // => { 'done': false, 'value': 2 } * * wrapped.next(); * // => { 'done': true, 'value': undefined } */ function wrapperNext() { if (this.__values__ === undefined) { this.__values__ = toArray(this.value()); } var done = this.__index__ >= this.__values__.length, value = done ? undefined : this.__values__[this.__index__++]; return { 'done': done, 'value': value }; } /** * Enables the wrapper to be iterable. * * @name Symbol.iterator * @memberOf _ * @since 4.0.0 * @category Seq * @returns {Object} Returns the wrapper object. * @example * * var wrapped = _([1, 2]); * * wrapped[Symbol.iterator]() === wrapped; * // => true * * Array.from(wrapped); * // => [1, 2] */ function wrapperToIterator() { return this; } /** * Creates a clone of the chain sequence planting `value` as the wrapped value. * * @name plant * @memberOf _ * @since 3.2.0 * @category Seq * @param {*} value The value to plant. * @returns {Object} Returns the new `lodash` wrapper instance. * @example * * function square(n) { * return n * n; * } * * var wrapped = _([1, 2]).map(square); * var other = wrapped.plant([3, 4]); * * other.value(); * // => [9, 16] * * wrapped.value(); * // => [1, 4] */ function wrapperPlant(value) { var result, parent = this; while (parent instanceof baseLodash) { var clone = wrapperClone(parent); clone.__index__ = 0; clone.__values__ = undefined; if (result) { previous.__wrapped__ = clone; } else { result = clone; } var previous = clone; parent = parent.__wrapped__; } previous.__wrapped__ = value; return result; } /** * This method is the wrapper version of `_.reverse`. * * **Note:** This method mutates the wrapped array. * * @name reverse * @memberOf _ * @since 0.1.0 * @category Seq * @returns {Object} Returns the new `lodash` wrapper instance. * @example * * var array = [1, 2, 3]; * * _(array).reverse().value() * // => [3, 2, 1] * * console.log(array); * // => [3, 2, 1] */ function wrapperReverse() { var value = this.__wrapped__; if (value instanceof LazyWrapper) { var wrapped = value; if (this.__actions__.length) { wrapped = new LazyWrapper(this); } wrapped = wrapped.reverse(); wrapped.__actions__.push({ 'func': thru, 'args': [reverse], 'thisArg': undefined }); return new LodashWrapper(wrapped, this.__chain__); } return this.thru(reverse); } /** * Executes the chain sequence to resolve the unwrapped value. * * @name value * @memberOf _ * @since 0.1.0 * @alias toJSON, valueOf * @category Seq * @returns {*} Returns the resolved unwrapped value. * @example * * _([1, 2, 3]).value(); * // => [1, 2, 3] */ function wrapperValue() { return baseWrapperValue(this.__wrapped__, this.__actions__); } /*------------------------------------------------------------------------*/ /** * Creates an object composed of keys generated from the results of running * each element of `collection` thru `iteratee`. The corresponding value of * each key is the number of times the key was returned by `iteratee`. The * iteratee is invoked with one argument: (value). * * @static * @memberOf _ * @since 0.5.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Function} [iteratee=_.identity] The iteratee to transform keys. * @returns {Object} Returns the composed aggregate object. * @example * * _.countBy([6.1, 4.2, 6.3], Math.floor); * // => { '4': 1, '6': 2 } * * // The `_.property` iteratee shorthand. * _.countBy(['one', 'two', 'three'], 'length'); * // => { '3': 2, '5': 1 } */ var countBy = createAggregator(function(result, value, key) { if (hasOwnProperty.call(result, key)) { ++result[key]; } else { baseAssignValue(result, key, 1); } }); /** * Checks if `predicate` returns truthy for **all** elements of `collection`. * Iteration is stopped once `predicate` returns falsey. The predicate is * invoked with three arguments: (value, index|key, collection). * * **Note:** This method returns `true` for * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of * elements of empty collections. * * @static * @memberOf _ * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Function} [predicate=_.identity] The function invoked per iteration. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {boolean} Returns `true` if all elements pass the predicate check, * else `false`. * @example * * _.every([true, 1, null, 'yes'], Boolean); * // => false * * var users = [ * { 'user': 'barney', 'age': 36, 'active': false }, * { 'user': 'fred', 'age': 40, 'active': false } * ]; * * // The `_.matches` iteratee shorthand. * _.every(users, { 'user': 'barney', 'active': false }); * // => false * * // The `_.matchesProperty` iteratee shorthand. * _.every(users, ['active', false]); * // => true * * // The `_.property` iteratee shorthand. * _.every(users, 'active'); * // => false */ function every(collection, predicate, guard) { var func = isArray(collection) ? arrayEvery : baseEvery; if (guard && isIterateeCall(collection, predicate, guard)) { predicate = undefined; } return func(collection, getIteratee(predicate, 3)); } /** * Iterates over elements of `collection`, returning an array of all elements * `predicate` returns truthy for. The predicate is invoked with three * arguments: (value, index|key, collection). * * **Note:** Unlike `_.remove`, this method returns a new array. * * @static * @memberOf _ * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Function} [predicate=_.identity] The function invoked per iteration. * @returns {Array} Returns the new filtered array. * @see _.reject * @example * * var users = [ * { 'user': 'barney', 'age': 36, 'active': true }, * { 'user': 'fred', 'age': 40, 'active': false } * ]; * * _.filter(users, function(o) { return !o.active; }); * // => objects for ['fred'] * * // The `_.matches` iteratee shorthand. * _.filter(users, { 'age': 36, 'active': true }); * // => objects for ['barney'] * * // The `_.matchesProperty` iteratee shorthand. * _.filter(users, ['active', false]); * // => objects for ['fred'] * * // The `_.property` iteratee shorthand. * _.filter(users, 'active'); * // => objects for ['barney'] * * // Combining several predicates using `_.overEvery` or `_.overSome`. * _.filter(users, _.overSome([{ 'age': 36 }, ['age', 40]])); * // => objects for ['fred', 'barney'] */ function filter(collection, predicate) { var func = isArray(collection) ? arrayFilter : baseFilter; return func(collection, getIteratee(predicate, 3)); } /** * Iterates over elements of `collection`, returning the first element * `predicate` returns truthy for. The predicate is invoked with three * arguments: (value, index|key, collection). * * @static * @memberOf _ * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to inspect. * @param {Function} [predicate=_.identity] The function invoked per iteration. * @param {number} [fromIndex=0] The index to search from. * @returns {*} Returns the matched element, else `undefined`. * @example * * var users = [ * { 'user': 'barney', 'age': 36, 'active': true }, * { 'user': 'fred', 'age': 40, 'active': false }, * { 'user': 'pebbles', 'age': 1, 'active': true } * ]; * * _.find(users, function(o) { return o.age < 40; }); * // => object for 'barney' * * // The `_.matches` iteratee shorthand. * _.find(users, { 'age': 1, 'active': true }); * // => object for 'pebbles' * * // The `_.matchesProperty` iteratee shorthand. * _.find(users, ['active', false]); * // => object for 'fred' * * // The `_.property` iteratee shorthand. * _.find(users, 'active'); * // => object for 'barney' */ var find = createFind(findIndex); /** * This method is like `_.find` except that it iterates over elements of * `collection` from right to left. * * @static * @memberOf _ * @since 2.0.0 * @category Collection * @param {Array|Object} collection The collection to inspect. * @param {Function} [predicate=_.identity] The function invoked per iteration. * @param {number} [fromIndex=collection.length-1] The index to search from. * @returns {*} Returns the matched element, else `undefined`. * @example * * _.findLast([1, 2, 3, 4], function(n) { * return n % 2 == 1; * }); * // => 3 */ var findLast = createFind(findLastIndex); /** * Creates a flattened array of values by running each element in `collection` * thru `iteratee` and flattening the mapped results. The iteratee is invoked * with three arguments: (value, index|key, collection). * * @static * @memberOf _ * @since 4.0.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Function} [iteratee=_.identity] The function invoked per iteration. * @returns {Array} Returns the new flattened array. * @example * * function duplicate(n) { * return [n, n]; * } * * _.flatMap([1, 2], duplicate); * // => [1, 1, 2, 2] */ function flatMap(collection, iteratee) { return baseFlatten(map(collection, iteratee), 1); } /** * This method is like `_.flatMap` except that it recursively flattens the * mapped results. * * @static * @memberOf _ * @since 4.7.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Function} [iteratee=_.identity] The function invoked per iteration. * @returns {Array} Returns the new flattened array. * @example * * function duplicate(n) { * return [[[n, n]]]; * } * * _.flatMapDeep([1, 2], duplicate); * // => [1, 1, 2, 2] */ function flatMapDeep(collection, iteratee) { return baseFlatten(map(collection, iteratee), INFINITY); } /** * This method is like `_.flatMap` except that it recursively flattens the * mapped results up to `depth` times. * * @static * @memberOf _ * @since 4.7.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Function} [iteratee=_.identity] The function invoked per iteration. * @param {number} [depth=1] The maximum recursion depth. * @returns {Array} Returns the new flattened array. * @example * * function duplicate(n) { * return [[[n, n]]]; * } * * _.flatMapDepth([1, 2], duplicate, 2); * // => [[1, 1], [2, 2]] */ function flatMapDepth(collection, iteratee, depth) { depth = depth === undefined ? 1 : toInteger(depth); return baseFlatten(map(collection, iteratee), depth); } /** * Iterates over elements of `collection` and invokes `iteratee` for each element. * The iteratee is invoked with three arguments: (value, index|key, collection). * Iteratee functions may exit iteration early by explicitly returning `false`. * * **Note:** As with other "Collections" methods, objects with a "length" * property are iterated like arrays. To avoid this behavior use `_.forIn` * or `_.forOwn` for object iteration. * * @static * @memberOf _ * @since 0.1.0 * @alias each * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Function} [iteratee=_.identity] The function invoked per iteration. * @returns {Array|Object} Returns `collection`. * @see _.forEachRight * @example * * _.forEach([1, 2], function(value) { * console.log(value); * }); * // => Logs `1` then `2`. * * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) { * console.log(key); * }); * // => Logs 'a' then 'b' (iteration order is not guaranteed). */ function forEach(collection, iteratee) { var func = isArray(collection) ? arrayEach : baseEach; return func(collection, getIteratee(iteratee, 3)); } /** * This method is like `_.forEach` except that it iterates over elements of * `collection` from right to left. * * @static * @memberOf _ * @since 2.0.0 * @alias eachRight * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Function} [iteratee=_.identity] The function invoked per iteration. * @returns {Array|Object} Returns `collection`. * @see _.forEach * @example * * _.forEachRight([1, 2], function(value) { * console.log(value); * }); * // => Logs `2` then `1`. */ function forEachRight(collection, iteratee) { var func = isArray(collection) ? arrayEachRight : baseEachRight; return func(collection, getIteratee(iteratee, 3)); } /** * Creates an object composed of keys generated from the results of running * each element of `collection` thru `iteratee`. The order of grouped values * is determined by the order they occur in `collection`. The corresponding * value of each key is an array of elements responsible for generating the * key. The iteratee is invoked with one argument: (value). * * @static * @memberOf _ * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Function} [iteratee=_.identity] The iteratee to transform keys. * @returns {Object} Returns the composed aggregate object. * @example * * _.groupBy([6.1, 4.2, 6.3], Math.floor); * // => { '4': [4.2], '6': [6.1, 6.3] } * * // The `_.property` iteratee shorthand. * _.groupBy(['one', 'two', 'three'], 'length'); * // => { '3': ['one', 'two'], '5': ['three'] } */ var groupBy = createAggregator(function(result, value, key) { if (hasOwnProperty.call(result, key)) { result[key].push(value); } else { baseAssignValue(result, key, [value]); } }); /** * Checks if `value` is in `collection`. If `collection` is a string, it's * checked for a substring of `value`, otherwise * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * is used for equality comparisons. If `fromIndex` is negative, it's used as * the offset from the end of `collection`. * * @static * @memberOf _ * @since 0.1.0 * @category Collection * @param {Array|Object|string} collection The collection to inspect. * @param {*} value The value to search for. * @param {number} [fromIndex=0] The index to search from. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`. * @returns {boolean} Returns `true` if `value` is found, else `false`. * @example * * _.includes([1, 2, 3], 1); * // => true * * _.includes([1, 2, 3], 1, 2); * // => false * * _.includes({ 'a': 1, 'b': 2 }, 1); * // => true * * _.includes('abcd', 'bc'); * // => true */ function includes(collection, value, fromIndex, guard) { collection = isArrayLike(collection) ? collection : values(collection); fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0; var length = collection.length; if (fromIndex < 0) { fromIndex = nativeMax(length + fromIndex, 0); } return isString(collection) ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1) : (!!length && baseIndexOf(collection, value, fromIndex) > -1); } /** * Invokes the method at `path` of each element in `collection`, returning * an array of the results of each invoked method. Any additional arguments * are provided to each invoked method. If `path` is a function, it's invoked * for, and `this` bound to, each element in `collection`. * * @static * @memberOf _ * @since 4.0.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Array|Function|string} path The path of the method to invoke or * the function invoked per iteration. * @param {...*} [args] The arguments to invoke each method with. * @returns {Array} Returns the array of results. * @example * * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort'); * // => [[1, 5, 7], [1, 2, 3]] * * _.invokeMap([123, 456], String.prototype.split, ''); * // => [['1', '2', '3'], ['4', '5', '6']] */ var invokeMap = baseRest(function(collection, path, args) { var index = -1, isFunc = typeof path == 'function', result = isArrayLike(collection) ? Array(collection.length) : []; baseEach(collection, function(value) { result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args); }); return result; }); /** * Creates an object composed of keys generated from the results of running * each element of `collection` thru `iteratee`. The corresponding value of * each key is the last element responsible for generating the key. The * iteratee is invoked with one argument: (value). * * @static * @memberOf _ * @since 4.0.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Function} [iteratee=_.identity] The iteratee to transform keys. * @returns {Object} Returns the composed aggregate object. * @example * * var array = [ * { 'dir': 'left', 'code': 97 }, * { 'dir': 'right', 'code': 100 } * ]; * * _.keyBy(array, function(o) { * return String.fromCharCode(o.code); * }); * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } } * * _.keyBy(array, 'dir'); * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } } */ var keyBy = createAggregator(function(result, value, key) { baseAssignValue(result, key, value); }); /** * Creates an array of values by running each element in `collection` thru * `iteratee`. The iteratee is invoked with three arguments: * (value, index|key, collection). * * Many lodash methods are guarded to work as iteratees for methods like * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`. * * The guarded methods are: * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`, * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`, * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`, * `template`, `trim`, `trimEnd`, `trimStart`, and `words` * * @static * @memberOf _ * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Function} [iteratee=_.identity] The function invoked per iteration. * @returns {Array} Returns the new mapped array. * @example * * function square(n) { * return n * n; * } * * _.map([4, 8], square); * // => [16, 64] * * _.map({ 'a': 4, 'b': 8 }, square); * // => [16, 64] (iteration order is not guaranteed) * * var users = [ * { 'user': 'barney' }, * { 'user': 'fred' } * ]; * * // The `_.property` iteratee shorthand. * _.map(users, 'user'); * // => ['barney', 'fred'] */ function map(collection, iteratee) { var func = isArray(collection) ? arrayMap : baseMap; return func(collection, getIteratee(iteratee, 3)); } /** * This method is like `_.sortBy` except that it allows specifying the sort * orders of the iteratees to sort by. If `orders` is unspecified, all values * are sorted in ascending order. Otherwise, specify an order of "desc" for * descending or "asc" for ascending sort order of corresponding values. * * @static * @memberOf _ * @since 4.0.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]] * The iteratees to sort by. * @param {string[]} [orders] The sort orders of `iteratees`. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`. * @returns {Array} Returns the new sorted array. * @example * * var users = [ * { 'user': 'fred', 'age': 48 }, * { 'user': 'barney', 'age': 34 }, * { 'user': 'fred', 'age': 40 }, * { 'user': 'barney', 'age': 36 } * ]; * * // Sort by `user` in ascending order and by `age` in descending order. * _.orderBy(users, ['user', 'age'], ['asc', 'desc']); * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]] */ function orderBy(collection, iteratees, orders, guard) { if (collection == null) { return []; } if (!isArray(iteratees)) { iteratees = iteratees == null ? [] : [iteratees]; } orders = guard ? undefined : orders; if (!isArray(orders)) { orders = orders == null ? [] : [orders]; } return baseOrderBy(collection, iteratees, orders); } /** * Creates an array of elements split into two groups, the first of which * contains elements `predicate` returns truthy for, the second of which * contains elements `predicate` returns falsey for. The predicate is * invoked with one argument: (value). * * @static * @memberOf _ * @since 3.0.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Function} [predicate=_.identity] The function invoked per iteration. * @returns {Array} Returns the array of grouped elements. * @example * * var users = [ * { 'user': 'barney', 'age': 36, 'active': false }, * { 'user': 'fred', 'age': 40, 'active': true }, * { 'user': 'pebbles', 'age': 1, 'active': false } * ]; * * _.partition(users, function(o) { return o.active; }); * // => objects for [['fred'], ['barney', 'pebbles']] * * // The `_.matches` iteratee shorthand. * _.partition(users, { 'age': 1, 'active': false }); * // => objects for [['pebbles'], ['barney', 'fred']] * * // The `_.matchesProperty` iteratee shorthand. * _.partition(users, ['active', false]); * // => objects for [['barney', 'pebbles'], ['fred']] * * // The `_.property` iteratee shorthand. * _.partition(users, 'active'); * // => objects for [['fred'], ['barney', 'pebbles']] */ var partition = createAggregator(function(result, value, key) { result[key ? 0 : 1].push(value); }, function() { return [[], []]; }); /** * Reduces `collection` to a value which is the accumulated result of running * each element in `collection` thru `iteratee`, where each successive * invocation is supplied the return value of the previous. If `accumulator` * is not given, the first element of `collection` is used as the initial * value. The iteratee is invoked with four arguments: * (accumulator, value, index|key, collection). * * Many lodash methods are guarded to work as iteratees for methods like * `_.reduce`, `_.reduceRight`, and `_.transform`. * * The guarded methods are: * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`, * and `sortBy` * * @static * @memberOf _ * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Function} [iteratee=_.identity] The function invoked per iteration. * @param {*} [accumulator] The initial value. * @returns {*} Returns the accumulated value. * @see _.reduceRight * @example * * _.reduce([1, 2], function(sum, n) { * return sum + n; * }, 0); * // => 3 * * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) { * (result[value] || (result[value] = [])).push(key); * return result; * }, {}); * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed) */ function reduce(collection, iteratee, accumulator) { var func = isArray(collection) ? arrayReduce : baseReduce, initAccum = arguments.length < 3; return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEach); } /** * This method is like `_.reduce` except that it iterates over elements of * `collection` from right to left. * * @static * @memberOf _ * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Function} [iteratee=_.identity] The function invoked per iteration. * @param {*} [accumulator] The initial value. * @returns {*} Returns the accumulated value. * @see _.reduce * @example * * var array = [[0, 1], [2, 3], [4, 5]]; * * _.reduceRight(array, function(flattened, other) { * return flattened.concat(other); * }, []); * // => [4, 5, 2, 3, 0, 1] */ function reduceRight(collection, iteratee, accumulator) { var func = isArray(collection) ? arrayReduceRight : baseReduce, initAccum = arguments.length < 3; return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEachRight); } /** * The opposite of `_.filter`; this method returns the elements of `collection` * that `predicate` does **not** return truthy for. * * @static * @memberOf _ * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Function} [predicate=_.identity] The function invoked per iteration. * @returns {Array} Returns the new filtered array. * @see _.filter * @example * * var users = [ * { 'user': 'barney', 'age': 36, 'active': false }, * { 'user': 'fred', 'age': 40, 'active': true } * ]; * * _.reject(users, function(o) { return !o.active; }); * // => objects for ['fred'] * * // The `_.matches` iteratee shorthand. * _.reject(users, { 'age': 40, 'active': true }); * // => objects for ['barney'] * * // The `_.matchesProperty` iteratee shorthand. * _.reject(users, ['active', false]); * // => objects for ['fred'] * * // The `_.property` iteratee shorthand. * _.reject(users, 'active'); * // => objects for ['barney'] */ function reject(collection, predicate) { var func = isArray(collection) ? arrayFilter : baseFilter; return func(collection, negate(getIteratee(predicate, 3))); } /** * Gets a random element from `collection`. * * @static * @memberOf _ * @since 2.0.0 * @category Collection * @param {Array|Object} collection The collection to sample. * @returns {*} Returns the random element. * @example * * _.sample([1, 2, 3, 4]); * // => 2 */ function sample(collection) { var func = isArray(collection) ? arraySample : baseSample; return func(collection); } /** * Gets `n` random elements at unique keys from `collection` up to the * size of `collection`. * * @static * @memberOf _ * @since 4.0.0 * @category Collection * @param {Array|Object} collection The collection to sample. * @param {number} [n=1] The number of elements to sample. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {Array} Returns the random elements. * @example * * _.sampleSize([1, 2, 3], 2); * // => [3, 1] * * _.sampleSize([1, 2, 3], 4); * // => [2, 3, 1] */ function sampleSize(collection, n, guard) { if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) { n = 1; } else { n = toInteger(n); } var func = isArray(collection) ? arraySampleSize : baseSampleSize; return func(collection, n); } /** * Creates an array of shuffled values, using a version of the * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle). * * @static * @memberOf _ * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to shuffle. * @returns {Array} Returns the new shuffled array. * @example * * _.shuffle([1, 2, 3, 4]); * // => [4, 1, 3, 2] */ function shuffle(collection) { var func = isArray(collection) ? arrayShuffle : baseShuffle; return func(collection); } /** * Gets the size of `collection` by returning its length for array-like * values or the number of own enumerable string keyed properties for objects. * * @static * @memberOf _ * @since 0.1.0 * @category Collection * @param {Array|Object|string} collection The collection to inspect. * @returns {number} Returns the collection size. * @example * * _.size([1, 2, 3]); * // => 3 * * _.size({ 'a': 1, 'b': 2 }); * // => 2 * * _.size('pebbles'); * // => 7 */ function size(collection) { if (collection == null) { return 0; } if (isArrayLike(collection)) { return isString(collection) ? stringSize(collection) : collection.length; } var tag = getTag(collection); if (tag == mapTag || tag == setTag) { return collection.size; } return baseKeys(collection).length; } /** * Checks if `predicate` returns truthy for **any** element of `collection`. * Iteration is stopped once `predicate` returns truthy. The predicate is * invoked with three arguments: (value, index|key, collection). * * @static * @memberOf _ * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Function} [predicate=_.identity] The function invoked per iteration. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {boolean} Returns `true` if any element passes the predicate check, * else `false`. * @example * * _.some([null, 0, 'yes', false], Boolean); * // => true * * var users = [ * { 'user': 'barney', 'active': true }, * { 'user': 'fred', 'active': false } * ]; * * // The `_.matches` iteratee shorthand. * _.some(users, { 'user': 'barney', 'active': false }); * // => false * * // The `_.matchesProperty` iteratee shorthand. * _.some(users, ['active', false]); * // => true * * // The `_.property` iteratee shorthand. * _.some(users, 'active'); * // => true */ function some(collection, predicate, guard) { var func = isArray(collection) ? arraySome : baseSome; if (guard && isIterateeCall(collection, predicate, guard)) { predicate = undefined; } return func(collection, getIteratee(predicate, 3)); } /** * Creates an array of elements, sorted in ascending order by the results of * running each element in a collection thru each iteratee. This method * performs a stable sort, that is, it preserves the original sort order of * equal elements. The iteratees are invoked with one argument: (value). * * @static * @memberOf _ * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {...(Function|Function[])} [iteratees=[_.identity]] * The iteratees to sort by. * @returns {Array} Returns the new sorted array. * @example * * var users = [ * { 'user': 'fred', 'age': 48 }, * { 'user': 'barney', 'age': 36 }, * { 'user': 'fred', 'age': 30 }, * { 'user': 'barney', 'age': 34 } * ]; * * _.sortBy(users, [function(o) { return o.user; }]); * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 30]] * * _.sortBy(users, ['user', 'age']); * // => objects for [['barney', 34], ['barney', 36], ['fred', 30], ['fred', 48]] */ var sortBy = baseRest(function(collection, iteratees) { if (collection == null) { return []; } var length = iteratees.length; if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) { iteratees = []; } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) { iteratees = [iteratees[0]]; } return baseOrderBy(collection, baseFlatten(iteratees, 1), []); }); /*------------------------------------------------------------------------*/ /** * Gets the timestamp of the number of milliseconds that have elapsed since * the Unix epoch (1 January 1970 00:00:00 UTC). * * @static * @memberOf _ * @since 2.4.0 * @category Date * @returns {number} Returns the timestamp. * @example * * _.defer(function(stamp) { * console.log(_.now() - stamp); * }, _.now()); * // => Logs the number of milliseconds it took for the deferred invocation. */ var now = ctxNow || function() { return root.Date.now(); }; /*------------------------------------------------------------------------*/ /** * The opposite of `_.before`; this method creates a function that invokes * `func` once it's called `n` or more times. * * @static * @memberOf _ * @since 0.1.0 * @category Function * @param {number} n The number of calls before `func` is invoked. * @param {Function} func The function to restrict. * @returns {Function} Returns the new restricted function. * @example * * var saves = ['profile', 'settings']; * * var done = _.after(saves.length, function() { * console.log('done saving!'); * }); * * _.forEach(saves, function(type) { * asyncSave({ 'type': type, 'complete': done }); * }); * // => Logs 'done saving!' after the two async saves have completed. */ function after(n, func) { if (typeof func != 'function') { throw new TypeError(FUNC_ERROR_TEXT); } n = toInteger(n); return function() { if (--n < 1) { return func.apply(this, arguments); } }; } /** * Creates a function that invokes `func`, with up to `n` arguments, * ignoring any additional arguments. * * @static * @memberOf _ * @since 3.0.0 * @category Function * @param {Function} func The function to cap arguments for. * @param {number} [n=func.length] The arity cap. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {Function} Returns the new capped function. * @example * * _.map(['6', '8', '10'], _.ary(parseInt, 1)); * // => [6, 8, 10] */ function ary(func, n, guard) { n = guard ? undefined : n; n = (func && n == null) ? func.length : n; return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n); } /** * Creates a function that invokes `func`, with the `this` binding and arguments * of the created function, while it's called less than `n` times. Subsequent * calls to the created function return the result of the last `func` invocation. * * @static * @memberOf _ * @since 3.0.0 * @category Function * @param {number} n The number of calls at which `func` is no longer invoked. * @param {Function} func The function to restrict. * @returns {Function} Returns the new restricted function. * @example * * jQuery(element).on('click', _.before(5, addContactToList)); * // => Allows adding up to 4 contacts to the list. */ function before(n, func) { var result; if (typeof func != 'function') { throw new TypeError(FUNC_ERROR_TEXT); } n = toInteger(n); return function() { if (--n > 0) { result = func.apply(this, arguments); } if (n <= 1) { func = undefined; } return result; }; } /** * Creates a function that invokes `func` with the `this` binding of `thisArg` * and `partials` prepended to the arguments it receives. * * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds, * may be used as a placeholder for partially applied arguments. * * **Note:** Unlike native `Function#bind`, this method doesn't set the "length" * property of bound functions. * * @static * @memberOf _ * @since 0.1.0 * @category Function * @param {Function} func The function to bind. * @param {*} thisArg The `this` binding of `func`. * @param {...*} [partials] The arguments to be partially applied. * @returns {Function} Returns the new bound function. * @example * * function greet(greeting, punctuation) { * return greeting + ' ' + this.user + punctuation; * } * * var object = { 'user': 'fred' }; * * var bound = _.bind(greet, object, 'hi'); * bound('!'); * // => 'hi fred!' * * // Bound with placeholders. * var bound = _.bind(greet, object, _, '!'); * bound('hi'); * // => 'hi fred!' */ var bind = baseRest(function(func, thisArg, partials) { var bitmask = WRAP_BIND_FLAG; if (partials.length) { var holders = replaceHolders(partials, getHolder(bind)); bitmask |= WRAP_PARTIAL_FLAG; } return createWrap(func, bitmask, thisArg, partials, holders); }); /** * Creates a function that invokes the method at `object[key]` with `partials` * prepended to the arguments it receives. * * This method differs from `_.bind` by allowing bound functions to reference * methods that may be redefined or don't yet exist. See * [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern) * for more details. * * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic * builds, may be used as a placeholder for partially applied arguments. * * @static * @memberOf _ * @since 0.10.0 * @category Function * @param {Object} object The object to invoke the method on. * @param {string} key The key of the method. * @param {...*} [partials] The arguments to be partially applied. * @returns {Function} Returns the new bound function. * @example * * var object = { * 'user': 'fred', * 'greet': function(greeting, punctuation) { * return greeting + ' ' + this.user + punctuation; * } * }; * * var bound = _.bindKey(object, 'greet', 'hi'); * bound('!'); * // => 'hi fred!' * * object.greet = function(greeting, punctuation) { * return greeting + 'ya ' + this.user + punctuation; * }; * * bound('!'); * // => 'hiya fred!' * * // Bound with placeholders. * var bound = _.bindKey(object, 'greet', _, '!'); * bound('hi'); * // => 'hiya fred!' */ var bindKey = baseRest(function(object, key, partials) { var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG; if (partials.length) { var holders = replaceHolders(partials, getHolder(bindKey)); bitmask |= WRAP_PARTIAL_FLAG; } return createWrap(key, bitmask, object, partials, holders); }); /** * Creates a function that accepts arguments of `func` and either invokes * `func` returning its result, if at least `arity` number of arguments have * been provided, or returns a function that accepts the remaining `func` * arguments, and so on. The arity of `func` may be specified if `func.length` * is not sufficient. * * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds, * may be used as a placeholder for provided arguments. * * **Note:** This method doesn't set the "length" property of curried functions. * * @static * @memberOf _ * @since 2.0.0 * @category Function * @param {Function} func The function to curry. * @param {number} [arity=func.length] The arity of `func`. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {Function} Returns the new curried function. * @example * * var abc = function(a, b, c) { * return [a, b, c]; * }; * * var curried = _.curry(abc); * * curried(1)(2)(3); * // => [1, 2, 3] * * curried(1, 2)(3); * // => [1, 2, 3] * * curried(1, 2, 3); * // => [1, 2, 3] * * // Curried with placeholders. * curried(1)(_, 3)(2); * // => [1, 2, 3] */ function curry(func, arity, guard) { arity = guard ? undefined : arity; var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity); result.placeholder = curry.placeholder; return result; } /** * This method is like `_.curry` except that arguments are applied to `func` * in the manner of `_.partialRight` instead of `_.partial`. * * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic * builds, may be used as a placeholder for provided arguments. * * **Note:** This method doesn't set the "length" property of curried functions. * * @static * @memberOf _ * @since 3.0.0 * @category Function * @param {Function} func The function to curry. * @param {number} [arity=func.length] The arity of `func`. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {Function} Returns the new curried function. * @example * * var abc = function(a, b, c) { * return [a, b, c]; * }; * * var curried = _.curryRight(abc); * * curried(3)(2)(1); * // => [1, 2, 3] * * curried(2, 3)(1); * // => [1, 2, 3] * * curried(1, 2, 3); * // => [1, 2, 3] * * // Curried with placeholders. * curried(3)(1, _)(2); * // => [1, 2, 3] */ function curryRight(func, arity, guard) { arity = guard ? undefined : arity; var result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity); result.placeholder = curryRight.placeholder; return result; } /** * Creates a debounced function that delays invoking `func` until after `wait` * milliseconds have elapsed since the last time the debounced function was * invoked. The debounced function comes with a `cancel` method to cancel * delayed `func` invocations and a `flush` method to immediately invoke them. * Provide `options` to indicate whether `func` should be invoked on the * leading and/or trailing edge of the `wait` timeout. The `func` is invoked * with the last arguments provided to the debounced function. Subsequent * calls to the debounced function return the result of the last `func` * invocation. * * **Note:** If `leading` and `trailing` options are `true`, `func` is * invoked on the trailing edge of the timeout only if the debounced function * is invoked more than once during the `wait` timeout. * * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred * until to the next tick, similar to `setTimeout` with a timeout of `0`. * * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) * for details over the differences between `_.debounce` and `_.throttle`. * * @static * @memberOf _ * @since 0.1.0 * @category Function * @param {Function} func The function to debounce. * @param {number} [wait=0] The number of milliseconds to delay. * @param {Object} [options={}] The options object. * @param {boolean} [options.leading=false] * Specify invoking on the leading edge of the timeout. * @param {number} [options.maxWait] * The maximum time `func` is allowed to be delayed before it's invoked. * @param {boolean} [options.trailing=true] * Specify invoking on the trailing edge of the timeout. * @returns {Function} Returns the new debounced function. * @example * * // Avoid costly calculations while the window size is in flux. * jQuery(window).on('resize', _.debounce(calculateLayout, 150)); * * // Invoke `sendMail` when clicked, debouncing subsequent calls. * jQuery(element).on('click', _.debounce(sendMail, 300, { * 'leading': true, * 'trailing': false * })); * * // Ensure `batchLog` is invoked once after 1 second of debounced calls. * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 }); * var source = new EventSource('/stream'); * jQuery(source).on('message', debounced); * * // Cancel the trailing debounced invocation. * jQuery(window).on('popstate', debounced.cancel); */ function debounce(func, wait, options) { var lastArgs, lastThis, maxWait, result, timerId, lastCallTime, lastInvokeTime = 0, leading = false, maxing = false, trailing = true; if (typeof func != 'function') { throw new TypeError(FUNC_ERROR_TEXT); } wait = toNumber(wait) || 0; if (isObject(options)) { leading = !!options.leading; maxing = 'maxWait' in options; maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait; trailing = 'trailing' in options ? !!options.trailing : trailing; } function invokeFunc(time) { var args = lastArgs, thisArg = lastThis; lastArgs = lastThis = undefined; lastInvokeTime = time; result = func.apply(thisArg, args); return result; } function leadingEdge(time) { // Reset any `maxWait` timer. lastInvokeTime = time; // Start the timer for the trailing edge. timerId = setTimeout(timerExpired, wait); // Invoke the leading edge. return leading ? invokeFunc(time) : result; } function remainingWait(time) { var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime, timeWaiting = wait - timeSinceLastCall; return maxing ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke) : timeWaiting; } function shouldInvoke(time) { var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime; // Either this is the first call, activity has stopped and we're at the // trailing edge, the system time has gone backwards and we're treating // it as the trailing edge, or we've hit the `maxWait` limit. return (lastCallTime === undefined || (timeSinceLastCall >= wait) || (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait)); } function timerExpired() { var time = now(); if (shouldInvoke(time)) { return trailingEdge(time); } // Restart the timer. timerId = setTimeout(timerExpired, remainingWait(time)); } function trailingEdge(time) { timerId = undefined; // Only invoke if we have `lastArgs` which means `func` has been // debounced at least once. if (trailing && lastArgs) { return invokeFunc(time); } lastArgs = lastThis = undefined; return result; } function cancel() { if (timerId !== undefined) { clearTimeout(timerId); } lastInvokeTime = 0; lastArgs = lastCallTime = lastThis = timerId = undefined; } function flush() { return timerId === undefined ? result : trailingEdge(now()); } function debounced() { var time = now(), isInvoking = shouldInvoke(time); lastArgs = arguments; lastThis = this; lastCallTime = time; if (isInvoking) { if (timerId === undefined) { return leadingEdge(lastCallTime); } if (maxing) { // Handle invocations in a tight loop. clearTimeout(timerId); timerId = setTimeout(timerExpired, wait); return invokeFunc(lastCallTime); } } if (timerId === undefined) { timerId = setTimeout(timerExpired, wait); } return result; } debounced.cancel = cancel; debounced.flush = flush; return debounced; } /** * Defers invoking the `func` until the current call stack has cleared. Any * additional arguments are provided to `func` when it's invoked. * * @static * @memberOf _ * @since 0.1.0 * @category Function * @param {Function} func The function to defer. * @param {...*} [args] The arguments to invoke `func` with. * @returns {number} Returns the timer id. * @example * * _.defer(function(text) { * console.log(text); * }, 'deferred'); * // => Logs 'deferred' after one millisecond. */ var defer = baseRest(function(func, args) { return baseDelay(func, 1, args); }); /** * Invokes `func` after `wait` milliseconds. Any additional arguments are * provided to `func` when it's invoked. * * @static * @memberOf _ * @since 0.1.0 * @category Function * @param {Function} func The function to delay. * @param {number} wait The number of milliseconds to delay invocation. * @param {...*} [args] The arguments to invoke `func` with. * @returns {number} Returns the timer id. * @example * * _.delay(function(text) { * console.log(text); * }, 1000, 'later'); * // => Logs 'later' after one second. */ var delay = baseRest(function(func, wait, args) { return baseDelay(func, toNumber(wait) || 0, args); }); /** * Creates a function that invokes `func` with arguments reversed. * * @static * @memberOf _ * @since 4.0.0 * @category Function * @param {Function} func The function to flip arguments for. * @returns {Function} Returns the new flipped function. * @example * * var flipped = _.flip(function() { * return _.toArray(arguments); * }); * * flipped('a', 'b', 'c', 'd'); * // => ['d', 'c', 'b', 'a'] */ function flip(func) { return createWrap(func, WRAP_FLIP_FLAG); } /** * Creates a function that memoizes the result of `func`. If `resolver` is * provided, it determines the cache key for storing the result based on the * arguments provided to the memoized function. By default, the first argument * provided to the memoized function is used as the map cache key. The `func` * is invoked with the `this` binding of the memoized function. * * **Note:** The cache is exposed as the `cache` property on the memoized * function. Its creation may be customized by replacing the `_.memoize.Cache` * constructor with one whose instances implement the * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object) * method interface of `clear`, `delete`, `get`, `has`, and `set`. * * @static * @memberOf _ * @since 0.1.0 * @category Function * @param {Function} func The function to have its output memoized. * @param {Function} [resolver] The function to resolve the cache key. * @returns {Function} Returns the new memoized function. * @example * * var object = { 'a': 1, 'b': 2 }; * var other = { 'c': 3, 'd': 4 }; * * var values = _.memoize(_.values); * values(object); * // => [1, 2] * * values(other); * // => [3, 4] * * object.a = 2; * values(object); * // => [1, 2] * * // Modify the result cache. * values.cache.set(object, ['a', 'b']); * values(object); * // => ['a', 'b'] * * // Replace `_.memoize.Cache`. * _.memoize.Cache = WeakMap; */ function memoize(func, resolver) { if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) { throw new TypeError(FUNC_ERROR_TEXT); } var memoized = function() { var args = arguments, key = resolver ? resolver.apply(this, args) : args[0], cache = memoized.cache; if (cache.has(key)) { return cache.get(key); } var result = func.apply(this, args); memoized.cache = cache.set(key, result) || cache; return result; }; memoized.cache = new (memoize.Cache || MapCache); return memoized; } // Expose `MapCache`. memoize.Cache = MapCache; /** * Creates a function that negates the result of the predicate `func`. The * `func` predicate is invoked with the `this` binding and arguments of the * created function. * * @static * @memberOf _ * @since 3.0.0 * @category Function * @param {Function} predicate The predicate to negate. * @returns {Function} Returns the new negated function. * @example * * function isEven(n) { * return n % 2 == 0; * } * * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven)); * // => [1, 3, 5] */ function negate(predicate) { if (typeof predicate != 'function') { throw new TypeError(FUNC_ERROR_TEXT); } return function() { var args = arguments; switch (args.length) { case 0: return !predicate.call(this); case 1: return !predicate.call(this, args[0]); case 2: return !predicate.call(this, args[0], args[1]); case 3: return !predicate.call(this, args[0], args[1], args[2]); } return !predicate.apply(this, args); }; } /** * Creates a function that is restricted to invoking `func` once. Repeat calls * to the function return the value of the first invocation. The `func` is * invoked with the `this` binding and arguments of the created function. * * @static * @memberOf _ * @since 0.1.0 * @category Function * @param {Function} func The function to restrict. * @returns {Function} Returns the new restricted function. * @example * * var initialize = _.once(createApplication); * initialize(); * initialize(); * // => `createApplication` is invoked once */ function once(func) { return before(2, func); } /** * Creates a function that invokes `func` with its arguments transformed. * * @static * @since 4.0.0 * @memberOf _ * @category Function * @param {Function} func The function to wrap. * @param {...(Function|Function[])} [transforms=[_.identity]] * The argument transforms. * @returns {Function} Returns the new function. * @example * * function doubled(n) { * return n * 2; * } * * function square(n) { * return n * n; * } * * var func = _.overArgs(function(x, y) { * return [x, y]; * }, [square, doubled]); * * func(9, 3); * // => [81, 6] * * func(10, 5); * // => [100, 10] */ var overArgs = castRest(function(func, transforms) { transforms = (transforms.length == 1 && isArray(transforms[0])) ? arrayMap(transforms[0], baseUnary(getIteratee())) : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee())); var funcsLength = transforms.length; return baseRest(function(args) { var index = -1, length = nativeMin(args.length, funcsLength); while (++index < length) { args[index] = transforms[index].call(this, args[index]); } return apply(func, this, args); }); }); /** * Creates a function that invokes `func` with `partials` prepended to the * arguments it receives. This method is like `_.bind` except it does **not** * alter the `this` binding. * * The `_.partial.placeholder` value, which defaults to `_` in monolithic * builds, may be used as a placeholder for partially applied arguments. * * **Note:** This method doesn't set the "length" property of partially * applied functions. * * @static * @memberOf _ * @since 0.2.0 * @category Function * @param {Function} func The function to partially apply arguments to. * @param {...*} [partials] The arguments to be partially applied. * @returns {Function} Returns the new partially applied function. * @example * * function greet(greeting, name) { * return greeting + ' ' + name; * } * * var sayHelloTo = _.partial(greet, 'hello'); * sayHelloTo('fred'); * // => 'hello fred' * * // Partially applied with placeholders. * var greetFred = _.partial(greet, _, 'fred'); * greetFred('hi'); * // => 'hi fred' */ var partial = baseRest(function(func, partials) { var holders = replaceHolders(partials, getHolder(partial)); return createWrap(func, WRAP_PARTIAL_FLAG, undefined, partials, holders); }); /** * This method is like `_.partial` except that partially applied arguments * are appended to the arguments it receives. * * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic * builds, may be used as a placeholder for partially applied arguments. * * **Note:** This method doesn't set the "length" property of partially * applied functions. * * @static * @memberOf _ * @since 1.0.0 * @category Function * @param {Function} func The function to partially apply arguments to. * @param {...*} [partials] The arguments to be partially applied. * @returns {Function} Returns the new partially applied function. * @example * * function greet(greeting, name) { * return greeting + ' ' + name; * } * * var greetFred = _.partialRight(greet, 'fred'); * greetFred('hi'); * // => 'hi fred' * * // Partially applied with placeholders. * var sayHelloTo = _.partialRight(greet, 'hello', _); * sayHelloTo('fred'); * // => 'hello fred' */ var partialRight = baseRest(function(func, partials) { var holders = replaceHolders(partials, getHolder(partialRight)); return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined, partials, holders); }); /** * Creates a function that invokes `func` with arguments arranged according * to the specified `indexes` where the argument value at the first index is * provided as the first argument, the argument value at the second index is * provided as the second argument, and so on. * * @static * @memberOf _ * @since 3.0.0 * @category Function * @param {Function} func The function to rearrange arguments for. * @param {...(number|number[])} indexes The arranged argument indexes. * @returns {Function} Returns the new function. * @example * * var rearged = _.rearg(function(a, b, c) { * return [a, b, c]; * }, [2, 0, 1]); * * rearged('b', 'c', 'a') * // => ['a', 'b', 'c'] */ var rearg = flatRest(function(func, indexes) { return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes); }); /** * Creates a function that invokes `func` with the `this` binding of the * created function and arguments from `start` and beyond provided as * an array. * * **Note:** This method is based on the * [rest parameter](https://mdn.io/rest_parameters). * * @static * @memberOf _ * @since 4.0.0 * @category Function * @param {Function} func The function to apply a rest parameter to. * @param {number} [start=func.length-1] The start position of the rest parameter. * @returns {Function} Returns the new function. * @example * * var say = _.rest(function(what, names) { * return what + ' ' + _.initial(names).join(', ') + * (_.size(names) > 1 ? ', & ' : '') + _.last(names); * }); * * say('hello', 'fred', 'barney', 'pebbles'); * // => 'hello fred, barney, & pebbles' */ function rest(func, start) { if (typeof func != 'function') { throw new TypeError(FUNC_ERROR_TEXT); } start = start === undefined ? start : toInteger(start); return baseRest(func, start); } /** * Creates a function that invokes `func` with the `this` binding of the * create function and an array of arguments much like * [`Function#apply`](http://www.ecma-international.org/ecma-262/7.0/#sec-function.prototype.apply). * * **Note:** This method is based on the * [spread operator](https://mdn.io/spread_operator). * * @static * @memberOf _ * @since 3.2.0 * @category Function * @param {Function} func The function to spread arguments over. * @param {number} [start=0] The start position of the spread. * @returns {Function} Returns the new function. * @example * * var say = _.spread(function(who, what) { * return who + ' says ' + what; * }); * * say(['fred', 'hello']); * // => 'fred says hello' * * var numbers = Promise.all([ * Promise.resolve(40), * Promise.resolve(36) * ]); * * numbers.then(_.spread(function(x, y) { * return x + y; * })); * // => a Promise of 76 */ function spread(func, start) { if (typeof func != 'function') { throw new TypeError(FUNC_ERROR_TEXT); } start = start == null ? 0 : nativeMax(toInteger(start), 0); return baseRest(function(args) { var array = args[start], otherArgs = castSlice(args, 0, start); if (array) { arrayPush(otherArgs, array); } return apply(func, this, otherArgs); }); } /** * Creates a throttled function that only invokes `func` at most once per * every `wait` milliseconds. The throttled function comes with a `cancel` * method to cancel delayed `func` invocations and a `flush` method to * immediately invoke them. Provide `options` to indicate whether `func` * should be invoked on the leading and/or trailing edge of the `wait` * timeout. The `func` is invoked with the last arguments provided to the * throttled function. Subsequent calls to the throttled function return the * result of the last `func` invocation. * * **Note:** If `leading` and `trailing` options are `true`, `func` is * invoked on the trailing edge of the timeout only if the throttled function * is invoked more than once during the `wait` timeout. * * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred * until to the next tick, similar to `setTimeout` with a timeout of `0`. * * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) * for details over the differences between `_.throttle` and `_.debounce`. * * @static * @memberOf _ * @since 0.1.0 * @category Function * @param {Function} func The function to throttle. * @param {number} [wait=0] The number of milliseconds to throttle invocations to. * @param {Object} [options={}] The options object. * @param {boolean} [options.leading=true] * Specify invoking on the leading edge of the timeout. * @param {boolean} [options.trailing=true] * Specify invoking on the trailing edge of the timeout. * @returns {Function} Returns the new throttled function. * @example * * // Avoid excessively updating the position while scrolling. * jQuery(window).on('scroll', _.throttle(updatePosition, 100)); * * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes. * var throttled = _.throttle(renewToken, 300000, { 'trailing': false }); * jQuery(element).on('click', throttled); * * // Cancel the trailing throttled invocation. * jQuery(window).on('popstate', throttled.cancel); */ function throttle(func, wait, options) { var leading = true, trailing = true; if (typeof func != 'function') { throw new TypeError(FUNC_ERROR_TEXT); } if (isObject(options)) { leading = 'leading' in options ? !!options.leading : leading; trailing = 'trailing' in options ? !!options.trailing : trailing; } return debounce(func, wait, { 'leading': leading, 'maxWait': wait, 'trailing': trailing }); } /** * Creates a function that accepts up to one argument, ignoring any * additional arguments. * * @static * @memberOf _ * @since 4.0.0 * @category Function * @param {Function} func The function to cap arguments for. * @returns {Function} Returns the new capped function. * @example * * _.map(['6', '8', '10'], _.unary(parseInt)); * // => [6, 8, 10] */ function unary(func) { return ary(func, 1); } /** * Creates a function that provides `value` to `wrapper` as its first * argument. Any additional arguments provided to the function are appended * to those provided to the `wrapper`. The wrapper is invoked with the `this` * binding of the created function. * * @static * @memberOf _ * @since 0.1.0 * @category Function * @param {*} value The value to wrap. * @param {Function} [wrapper=identity] The wrapper function. * @returns {Function} Returns the new function. * @example * * var p = _.wrap(_.escape, function(func, text) { * return '

' + func(text) + '

'; * }); * * p('fred, barney, & pebbles'); * // => '

fred, barney, & pebbles

' */ function wrap(value, wrapper) { return partial(castFunction(wrapper), value); } /*------------------------------------------------------------------------*/ /** * Casts `value` as an array if it's not one. * * @static * @memberOf _ * @since 4.4.0 * @category Lang * @param {*} value The value to inspect. * @returns {Array} Returns the cast array. * @example * * _.castArray(1); * // => [1] * * _.castArray({ 'a': 1 }); * // => [{ 'a': 1 }] * * _.castArray('abc'); * // => ['abc'] * * _.castArray(null); * // => [null] * * _.castArray(undefined); * // => [undefined] * * _.castArray(); * // => [] * * var array = [1, 2, 3]; * console.log(_.castArray(array) === array); * // => true */ function castArray() { if (!arguments.length) { return []; } var value = arguments[0]; return isArray(value) ? value : [value]; } /** * Creates a shallow clone of `value`. * * **Note:** This method is loosely based on the * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm) * and supports cloning arrays, array buffers, booleans, date objects, maps, * numbers, `Object` objects, regexes, sets, strings, symbols, and typed * arrays. The own enumerable properties of `arguments` objects are cloned * as plain objects. An empty object is returned for uncloneable values such * as error objects, functions, DOM nodes, and WeakMaps. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to clone. * @returns {*} Returns the cloned value. * @see _.cloneDeep * @example * * var objects = [{ 'a': 1 }, { 'b': 2 }]; * * var shallow = _.clone(objects); * console.log(shallow[0] === objects[0]); * // => true */ function clone(value) { return baseClone(value, CLONE_SYMBOLS_FLAG); } /** * This method is like `_.clone` except that it accepts `customizer` which * is invoked to produce the cloned value. If `customizer` returns `undefined`, * cloning is handled by the method instead. The `customizer` is invoked with * up to four arguments; (value [, index|key, object, stack]). * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to clone. * @param {Function} [customizer] The function to customize cloning. * @returns {*} Returns the cloned value. * @see _.cloneDeepWith * @example * * function customizer(value) { * if (_.isElement(value)) { * return value.cloneNode(false); * } * } * * var el = _.cloneWith(document.body, customizer); * * console.log(el === document.body); * // => false * console.log(el.nodeName); * // => 'BODY' * console.log(el.childNodes.length); * // => 0 */ function cloneWith(value, customizer) { customizer = typeof customizer == 'function' ? customizer : undefined; return baseClone(value, CLONE_SYMBOLS_FLAG, customizer); } /** * This method is like `_.clone` except that it recursively clones `value`. * * @static * @memberOf _ * @since 1.0.0 * @category Lang * @param {*} value The value to recursively clone. * @returns {*} Returns the deep cloned value. * @see _.clone * @example * * var objects = [{ 'a': 1 }, { 'b': 2 }]; * * var deep = _.cloneDeep(objects); * console.log(deep[0] === objects[0]); * // => false */ function cloneDeep(value) { return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG); } /** * This method is like `_.cloneWith` except that it recursively clones `value`. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to recursively clone. * @param {Function} [customizer] The function to customize cloning. * @returns {*} Returns the deep cloned value. * @see _.cloneWith * @example * * function customizer(value) { * if (_.isElement(value)) { * return value.cloneNode(true); * } * } * * var el = _.cloneDeepWith(document.body, customizer); * * console.log(el === document.body); * // => false * console.log(el.nodeName); * // => 'BODY' * console.log(el.childNodes.length); * // => 20 */ function cloneDeepWith(value, customizer) { customizer = typeof customizer == 'function' ? customizer : undefined; return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer); } /** * Checks if `object` conforms to `source` by invoking the predicate * properties of `source` with the corresponding property values of `object`. * * **Note:** This method is equivalent to `_.conforms` when `source` is * partially applied. * * @static * @memberOf _ * @since 4.14.0 * @category Lang * @param {Object} object The object to inspect. * @param {Object} source The object of property predicates to conform to. * @returns {boolean} Returns `true` if `object` conforms, else `false`. * @example * * var object = { 'a': 1, 'b': 2 }; * * _.conformsTo(object, { 'b': function(n) { return n > 1; } }); * // => true * * _.conformsTo(object, { 'b': function(n) { return n > 2; } }); * // => false */ function conformsTo(object, source) { return source == null || baseConformsTo(object, source, keys(source)); } /** * Performs a * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * comparison between two values to determine if they are equivalent. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to compare. * @param {*} other The other value to compare. * @returns {boolean} Returns `true` if the values are equivalent, else `false`. * @example * * var object = { 'a': 1 }; * var other = { 'a': 1 }; * * _.eq(object, object); * // => true * * _.eq(object, other); * // => false * * _.eq('a', 'a'); * // => true * * _.eq('a', Object('a')); * // => false * * _.eq(NaN, NaN); * // => true */ function eq(value, other) { return value === other || (value !== value && other !== other); } /** * Checks if `value` is greater than `other`. * * @static * @memberOf _ * @since 3.9.0 * @category Lang * @param {*} value The value to compare. * @param {*} other The other value to compare. * @returns {boolean} Returns `true` if `value` is greater than `other`, * else `false`. * @see _.lt * @example * * _.gt(3, 1); * // => true * * _.gt(3, 3); * // => false * * _.gt(1, 3); * // => false */ var gt = createRelationalOperation(baseGt); /** * Checks if `value` is greater than or equal to `other`. * * @static * @memberOf _ * @since 3.9.0 * @category Lang * @param {*} value The value to compare. * @param {*} other The other value to compare. * @returns {boolean} Returns `true` if `value` is greater than or equal to * `other`, else `false`. * @see _.lte * @example * * _.gte(3, 1); * // => true * * _.gte(3, 3); * // => true * * _.gte(1, 3); * // => false */ var gte = createRelationalOperation(function(value, other) { return value >= other; }); /** * Checks if `value` is likely an `arguments` object. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an `arguments` object, * else `false`. * @example * * _.isArguments(function() { return arguments; }()); * // => true * * _.isArguments([1, 2, 3]); * // => false */ var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) { return isObjectLike(value) && hasOwnProperty.call(value, 'callee') && !propertyIsEnumerable.call(value, 'callee'); }; /** * Checks if `value` is classified as an `Array` object. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an array, else `false`. * @example * * _.isArray([1, 2, 3]); * // => true * * _.isArray(document.body.children); * // => false * * _.isArray('abc'); * // => false * * _.isArray(_.noop); * // => false */ var isArray = Array.isArray; /** * Checks if `value` is classified as an `ArrayBuffer` object. * * @static * @memberOf _ * @since 4.3.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`. * @example * * _.isArrayBuffer(new ArrayBuffer(2)); * // => true * * _.isArrayBuffer(new Array(2)); * // => false */ var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer; /** * Checks if `value` is array-like. A value is considered array-like if it's * not a function and has a `value.length` that's an integer greater than or * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is array-like, else `false`. * @example * * _.isArrayLike([1, 2, 3]); * // => true * * _.isArrayLike(document.body.children); * // => true * * _.isArrayLike('abc'); * // => true * * _.isArrayLike(_.noop); * // => false */ function isArrayLike(value) { return value != null && isLength(value.length) && !isFunction(value); } /** * This method is like `_.isArrayLike` except that it also checks if `value` * is an object. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an array-like object, * else `false`. * @example * * _.isArrayLikeObject([1, 2, 3]); * // => true * * _.isArrayLikeObject(document.body.children); * // => true * * _.isArrayLikeObject('abc'); * // => false * * _.isArrayLikeObject(_.noop); * // => false */ function isArrayLikeObject(value) { return isObjectLike(value) && isArrayLike(value); } /** * Checks if `value` is classified as a boolean primitive or object. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a boolean, else `false`. * @example * * _.isBoolean(false); * // => true * * _.isBoolean(null); * // => false */ function isBoolean(value) { return value === true || value === false || (isObjectLike(value) && baseGetTag(value) == boolTag); } /** * Checks if `value` is a buffer. * * @static * @memberOf _ * @since 4.3.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a buffer, else `false`. * @example * * _.isBuffer(new Buffer(2)); * // => true * * _.isBuffer(new Uint8Array(2)); * // => false */ var isBuffer = nativeIsBuffer || stubFalse; /** * Checks if `value` is classified as a `Date` object. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a date object, else `false`. * @example * * _.isDate(new Date); * // => true * * _.isDate('Mon April 23 2012'); * // => false */ var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate; /** * Checks if `value` is likely a DOM element. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`. * @example * * _.isElement(document.body); * // => true * * _.isElement(''); * // => false */ function isElement(value) { return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value); } /** * Checks if `value` is an empty object, collection, map, or set. * * Objects are considered empty if they have no own enumerable string keyed * properties. * * Array-like values such as `arguments` objects, arrays, buffers, strings, or * jQuery-like collections are considered empty if they have a `length` of `0`. * Similarly, maps and sets are considered empty if they have a `size` of `0`. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is empty, else `false`. * @example * * _.isEmpty(null); * // => true * * _.isEmpty(true); * // => true * * _.isEmpty(1); * // => true * * _.isEmpty([1, 2, 3]); * // => false * * _.isEmpty({ 'a': 1 }); * // => false */ function isEmpty(value) { if (value == null) { return true; } if (isArrayLike(value) && (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' || isBuffer(value) || isTypedArray(value) || isArguments(value))) { return !value.length; } var tag = getTag(value); if (tag == mapTag || tag == setTag) { return !value.size; } if (isPrototype(value)) { return !baseKeys(value).length; } for (var key in value) { if (hasOwnProperty.call(value, key)) { return false; } } return true; } /** * Performs a deep comparison between two values to determine if they are * equivalent. * * **Note:** This method supports comparing arrays, array buffers, booleans, * date objects, error objects, maps, numbers, `Object` objects, regexes, * sets, strings, symbols, and typed arrays. `Object` objects are compared * by their own, not inherited, enumerable properties. Functions and DOM * nodes are compared by strict equality, i.e. `===`. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to compare. * @param {*} other The other value to compare. * @returns {boolean} Returns `true` if the values are equivalent, else `false`. * @example * * var object = { 'a': 1 }; * var other = { 'a': 1 }; * * _.isEqual(object, other); * // => true * * object === other; * // => false */ function isEqual(value, other) { return baseIsEqual(value, other); } /** * This method is like `_.isEqual` except that it accepts `customizer` which * is invoked to compare values. If `customizer` returns `undefined`, comparisons * are handled by the method instead. The `customizer` is invoked with up to * six arguments: (objValue, othValue [, index|key, object, other, stack]). * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to compare. * @param {*} other The other value to compare. * @param {Function} [customizer] The function to customize comparisons. * @returns {boolean} Returns `true` if the values are equivalent, else `false`. * @example * * function isGreeting(value) { * return /^h(?:i|ello)$/.test(value); * } * * function customizer(objValue, othValue) { * if (isGreeting(objValue) && isGreeting(othValue)) { * return true; * } * } * * var array = ['hello', 'goodbye']; * var other = ['hi', 'goodbye']; * * _.isEqualWith(array, other, customizer); * // => true */ function isEqualWith(value, other, customizer) { customizer = typeof customizer == 'function' ? customizer : undefined; var result = customizer ? customizer(value, other) : undefined; return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result; } /** * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`, * `SyntaxError`, `TypeError`, or `URIError` object. * * @static * @memberOf _ * @since 3.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an error object, else `false`. * @example * * _.isError(new Error); * // => true * * _.isError(Error); * // => false */ function isError(value) { if (!isObjectLike(value)) { return false; } var tag = baseGetTag(value); return tag == errorTag || tag == domExcTag || (typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value)); } /** * Checks if `value` is a finite primitive number. * * **Note:** This method is based on * [`Number.isFinite`](https://mdn.io/Number/isFinite). * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a finite number, else `false`. * @example * * _.isFinite(3); * // => true * * _.isFinite(Number.MIN_VALUE); * // => true * * _.isFinite(Infinity); * // => false * * _.isFinite('3'); * // => false */ function isFinite(value) { return typeof value == 'number' && nativeIsFinite(value); } /** * Checks if `value` is classified as a `Function` object. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a function, else `false`. * @example * * _.isFunction(_); * // => true * * _.isFunction(/abc/); * // => false */ function isFunction(value) { if (!isObject(value)) { return false; } // The use of `Object#toString` avoids issues with the `typeof` operator // in Safari 9 which returns 'object' for typed arrays and other constructors. var tag = baseGetTag(value); return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag; } /** * Checks if `value` is an integer. * * **Note:** This method is based on * [`Number.isInteger`](https://mdn.io/Number/isInteger). * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an integer, else `false`. * @example * * _.isInteger(3); * // => true * * _.isInteger(Number.MIN_VALUE); * // => false * * _.isInteger(Infinity); * // => false * * _.isInteger('3'); * // => false */ function isInteger(value) { return typeof value == 'number' && value == toInteger(value); } /** * Checks if `value` is a valid array-like length. * * **Note:** This method is loosely based on * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. * @example * * _.isLength(3); * // => true * * _.isLength(Number.MIN_VALUE); * // => false * * _.isLength(Infinity); * // => false * * _.isLength('3'); * // => false */ function isLength(value) { return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; } /** * Checks if `value` is the * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an object, else `false`. * @example * * _.isObject({}); * // => true * * _.isObject([1, 2, 3]); * // => true * * _.isObject(_.noop); * // => true * * _.isObject(null); * // => false */ function isObject(value) { var type = typeof value; return value != null && (type == 'object' || type == 'function'); } /** * Checks if `value` is object-like. A value is object-like if it's not `null` * and has a `typeof` result of "object". * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is object-like, else `false`. * @example * * _.isObjectLike({}); * // => true * * _.isObjectLike([1, 2, 3]); * // => true * * _.isObjectLike(_.noop); * // => false * * _.isObjectLike(null); * // => false */ function isObjectLike(value) { return value != null && typeof value == 'object'; } /** * Checks if `value` is classified as a `Map` object. * * @static * @memberOf _ * @since 4.3.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a map, else `false`. * @example * * _.isMap(new Map); * // => true * * _.isMap(new WeakMap); * // => false */ var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap; /** * Performs a partial deep comparison between `object` and `source` to * determine if `object` contains equivalent property values. * * **Note:** This method is equivalent to `_.matches` when `source` is * partially applied. * * Partial comparisons will match empty array and empty object `source` * values against any array or object value, respectively. See `_.isEqual` * for a list of supported value comparisons. * * @static * @memberOf _ * @since 3.0.0 * @category Lang * @param {Object} object The object to inspect. * @param {Object} source The object of property values to match. * @returns {boolean} Returns `true` if `object` is a match, else `false`. * @example * * var object = { 'a': 1, 'b': 2 }; * * _.isMatch(object, { 'b': 2 }); * // => true * * _.isMatch(object, { 'b': 1 }); * // => false */ function isMatch(object, source) { return object === source || baseIsMatch(object, source, getMatchData(source)); } /** * This method is like `_.isMatch` except that it accepts `customizer` which * is invoked to compare values. If `customizer` returns `undefined`, comparisons * are handled by the method instead. The `customizer` is invoked with five * arguments: (objValue, srcValue, index|key, object, source). * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {Object} object The object to inspect. * @param {Object} source The object of property values to match. * @param {Function} [customizer] The function to customize comparisons. * @returns {boolean} Returns `true` if `object` is a match, else `false`. * @example * * function isGreeting(value) { * return /^h(?:i|ello)$/.test(value); * } * * function customizer(objValue, srcValue) { * if (isGreeting(objValue) && isGreeting(srcValue)) { * return true; * } * } * * var object = { 'greeting': 'hello' }; * var source = { 'greeting': 'hi' }; * * _.isMatchWith(object, source, customizer); * // => true */ function isMatchWith(object, source, customizer) { customizer = typeof customizer == 'function' ? customizer : undefined; return baseIsMatch(object, source, getMatchData(source), customizer); } /** * Checks if `value` is `NaN`. * * **Note:** This method is based on * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for * `undefined` and other non-number values. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. * @example * * _.isNaN(NaN); * // => true * * _.isNaN(new Number(NaN)); * // => true * * isNaN(undefined); * // => true * * _.isNaN(undefined); * // => false */ function isNaN(value) { // An `NaN` primitive is the only value that is not equal to itself. // Perform the `toStringTag` check first to avoid errors with some // ActiveX objects in IE. return isNumber(value) && value != +value; } /** * Checks if `value` is a pristine native function. * * **Note:** This method can't reliably detect native functions in the presence * of the core-js package because core-js circumvents this kind of detection. * Despite multiple requests, the core-js maintainer has made it clear: any * attempt to fix the detection will be obstructed. As a result, we're left * with little choice but to throw an error. Unfortunately, this also affects * packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill), * which rely on core-js. * * @static * @memberOf _ * @since 3.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a native function, * else `false`. * @example * * _.isNative(Array.prototype.push); * // => true * * _.isNative(_); * // => false */ function isNative(value) { if (isMaskable(value)) { throw new Error(CORE_ERROR_TEXT); } return baseIsNative(value); } /** * Checks if `value` is `null`. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is `null`, else `false`. * @example * * _.isNull(null); * // => true * * _.isNull(void 0); * // => false */ function isNull(value) { return value === null; } /** * Checks if `value` is `null` or `undefined`. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is nullish, else `false`. * @example * * _.isNil(null); * // => true * * _.isNil(void 0); * // => true * * _.isNil(NaN); * // => false */ function isNil(value) { return value == null; } /** * Checks if `value` is classified as a `Number` primitive or object. * * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are * classified as numbers, use the `_.isFinite` method. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a number, else `false`. * @example * * _.isNumber(3); * // => true * * _.isNumber(Number.MIN_VALUE); * // => true * * _.isNumber(Infinity); * // => true * * _.isNumber('3'); * // => false */ function isNumber(value) { return typeof value == 'number' || (isObjectLike(value) && baseGetTag(value) == numberTag); } /** * Checks if `value` is a plain object, that is, an object created by the * `Object` constructor or one with a `[[Prototype]]` of `null`. * * @static * @memberOf _ * @since 0.8.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a plain object, else `false`. * @example * * function Foo() { * this.a = 1; * } * * _.isPlainObject(new Foo); * // => false * * _.isPlainObject([1, 2, 3]); * // => false * * _.isPlainObject({ 'x': 0, 'y': 0 }); * // => true * * _.isPlainObject(Object.create(null)); * // => true */ function isPlainObject(value) { if (!isObjectLike(value) || baseGetTag(value) != objectTag) { return false; } var proto = getPrototype(value); if (proto === null) { return true; } var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor; return typeof Ctor == 'function' && Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString; } /** * Checks if `value` is classified as a `RegExp` object. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`. * @example * * _.isRegExp(/abc/); * // => true * * _.isRegExp('/abc/'); * // => false */ var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp; /** * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754 * double precision number which isn't the result of a rounded unsafe integer. * * **Note:** This method is based on * [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger). * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a safe integer, else `false`. * @example * * _.isSafeInteger(3); * // => true * * _.isSafeInteger(Number.MIN_VALUE); * // => false * * _.isSafeInteger(Infinity); * // => false * * _.isSafeInteger('3'); * // => false */ function isSafeInteger(value) { return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER; } /** * Checks if `value` is classified as a `Set` object. * * @static * @memberOf _ * @since 4.3.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a set, else `false`. * @example * * _.isSet(new Set); * // => true * * _.isSet(new WeakSet); * // => false */ var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet; /** * Checks if `value` is classified as a `String` primitive or object. * * @static * @since 0.1.0 * @memberOf _ * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a string, else `false`. * @example * * _.isString('abc'); * // => true * * _.isString(1); * // => false */ function isString(value) { return typeof value == 'string' || (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag); } /** * Checks if `value` is classified as a `Symbol` primitive or object. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. * @example * * _.isSymbol(Symbol.iterator); * // => true * * _.isSymbol('abc'); * // => false */ function isSymbol(value) { return typeof value == 'symbol' || (isObjectLike(value) && baseGetTag(value) == symbolTag); } /** * Checks if `value` is classified as a typed array. * * @static * @memberOf _ * @since 3.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. * @example * * _.isTypedArray(new Uint8Array); * // => true * * _.isTypedArray([]); * // => false */ var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray; /** * Checks if `value` is `undefined`. * * @static * @since 0.1.0 * @memberOf _ * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`. * @example * * _.isUndefined(void 0); * // => true * * _.isUndefined(null); * // => false */ function isUndefined(value) { return value === undefined; } /** * Checks if `value` is classified as a `WeakMap` object. * * @static * @memberOf _ * @since 4.3.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a weak map, else `false`. * @example * * _.isWeakMap(new WeakMap); * // => true * * _.isWeakMap(new Map); * // => false */ function isWeakMap(value) { return isObjectLike(value) && getTag(value) == weakMapTag; } /** * Checks if `value` is classified as a `WeakSet` object. * * @static * @memberOf _ * @since 4.3.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a weak set, else `false`. * @example * * _.isWeakSet(new WeakSet); * // => true * * _.isWeakSet(new Set); * // => false */ function isWeakSet(value) { return isObjectLike(value) && baseGetTag(value) == weakSetTag; } /** * Checks if `value` is less than `other`. * * @static * @memberOf _ * @since 3.9.0 * @category Lang * @param {*} value The value to compare. * @param {*} other The other value to compare. * @returns {boolean} Returns `true` if `value` is less than `other`, * else `false`. * @see _.gt * @example * * _.lt(1, 3); * // => true * * _.lt(3, 3); * // => false * * _.lt(3, 1); * // => false */ var lt = createRelationalOperation(baseLt); /** * Checks if `value` is less than or equal to `other`. * * @static * @memberOf _ * @since 3.9.0 * @category Lang * @param {*} value The value to compare. * @param {*} other The other value to compare. * @returns {boolean} Returns `true` if `value` is less than or equal to * `other`, else `false`. * @see _.gte * @example * * _.lte(1, 3); * // => true * * _.lte(3, 3); * // => true * * _.lte(3, 1); * // => false */ var lte = createRelationalOperation(function(value, other) { return value <= other; }); /** * Converts `value` to an array. * * @static * @since 0.1.0 * @memberOf _ * @category Lang * @param {*} value The value to convert. * @returns {Array} Returns the converted array. * @example * * _.toArray({ 'a': 1, 'b': 2 }); * // => [1, 2] * * _.toArray('abc'); * // => ['a', 'b', 'c'] * * _.toArray(1); * // => [] * * _.toArray(null); * // => [] */ function toArray(value) { if (!value) { return []; } if (isArrayLike(value)) { return isString(value) ? stringToArray(value) : copyArray(value); } if (symIterator && value[symIterator]) { return iteratorToArray(value[symIterator]()); } var tag = getTag(value), func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values); return func(value); } /** * Converts `value` to a finite number. * * @static * @memberOf _ * @since 4.12.0 * @category Lang * @param {*} value The value to convert. * @returns {number} Returns the converted number. * @example * * _.toFinite(3.2); * // => 3.2 * * _.toFinite(Number.MIN_VALUE); * // => 5e-324 * * _.toFinite(Infinity); * // => 1.7976931348623157e+308 * * _.toFinite('3.2'); * // => 3.2 */ function toFinite(value) { if (!value) { return value === 0 ? value : 0; } value = toNumber(value); if (value === INFINITY || value === -INFINITY) { var sign = (value < 0 ? -1 : 1); return sign * MAX_INTEGER; } return value === value ? value : 0; } /** * Converts `value` to an integer. * * **Note:** This method is loosely based on * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger). * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to convert. * @returns {number} Returns the converted integer. * @example * * _.toInteger(3.2); * // => 3 * * _.toInteger(Number.MIN_VALUE); * // => 0 * * _.toInteger(Infinity); * // => 1.7976931348623157e+308 * * _.toInteger('3.2'); * // => 3 */ function toInteger(value) { var result = toFinite(value), remainder = result % 1; return result === result ? (remainder ? result - remainder : result) : 0; } /** * Converts `value` to an integer suitable for use as the length of an * array-like object. * * **Note:** This method is based on * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to convert. * @returns {number} Returns the converted integer. * @example * * _.toLength(3.2); * // => 3 * * _.toLength(Number.MIN_VALUE); * // => 0 * * _.toLength(Infinity); * // => 4294967295 * * _.toLength('3.2'); * // => 3 */ function toLength(value) { return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0; } /** * Converts `value` to a number. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to process. * @returns {number} Returns the number. * @example * * _.toNumber(3.2); * // => 3.2 * * _.toNumber(Number.MIN_VALUE); * // => 5e-324 * * _.toNumber(Infinity); * // => Infinity * * _.toNumber('3.2'); * // => 3.2 */ function toNumber(value) { if (typeof value == 'number') { return value; } if (isSymbol(value)) { return NAN; } if (isObject(value)) { var other = typeof value.valueOf == 'function' ? value.valueOf() : value; value = isObject(other) ? (other + '') : other; } if (typeof value != 'string') { return value === 0 ? value : +value; } value = baseTrim(value); var isBinary = reIsBinary.test(value); return (isBinary || reIsOctal.test(value)) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : (reIsBadHex.test(value) ? NAN : +value); } /** * Converts `value` to a plain object flattening inherited enumerable string * keyed properties of `value` to own properties of the plain object. * * @static * @memberOf _ * @since 3.0.0 * @category Lang * @param {*} value The value to convert. * @returns {Object} Returns the converted plain object. * @example * * function Foo() { * this.b = 2; * } * * Foo.prototype.c = 3; * * _.assign({ 'a': 1 }, new Foo); * // => { 'a': 1, 'b': 2 } * * _.assign({ 'a': 1 }, _.toPlainObject(new Foo)); * // => { 'a': 1, 'b': 2, 'c': 3 } */ function toPlainObject(value) { return copyObject(value, keysIn(value)); } /** * Converts `value` to a safe integer. A safe integer can be compared and * represented correctly. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to convert. * @returns {number} Returns the converted integer. * @example * * _.toSafeInteger(3.2); * // => 3 * * _.toSafeInteger(Number.MIN_VALUE); * // => 0 * * _.toSafeInteger(Infinity); * // => 9007199254740991 * * _.toSafeInteger('3.2'); * // => 3 */ function toSafeInteger(value) { return value ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER) : (value === 0 ? value : 0); } /** * Converts `value` to a string. An empty string is returned for `null` * and `undefined` values. The sign of `-0` is preserved. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to convert. * @returns {string} Returns the converted string. * @example * * _.toString(null); * // => '' * * _.toString(-0); * // => '-0' * * _.toString([1, 2, 3]); * // => '1,2,3' */ function toString(value) { return value == null ? '' : baseToString(value); } /*------------------------------------------------------------------------*/ /** * Assigns own enumerable string keyed properties of source objects to the * destination object. Source objects are applied from left to right. * Subsequent sources overwrite property assignments of previous sources. * * **Note:** This method mutates `object` and is loosely based on * [`Object.assign`](https://mdn.io/Object/assign). * * @static * @memberOf _ * @since 0.10.0 * @category Object * @param {Object} object The destination object. * @param {...Object} [sources] The source objects. * @returns {Object} Returns `object`. * @see _.assignIn * @example * * function Foo() { * this.a = 1; * } * * function Bar() { * this.c = 3; * } * * Foo.prototype.b = 2; * Bar.prototype.d = 4; * * _.assign({ 'a': 0 }, new Foo, new Bar); * // => { 'a': 1, 'c': 3 } */ var assign = createAssigner(function(object, source) { if (isPrototype(source) || isArrayLike(source)) { copyObject(source, keys(source), object); return; } for (var key in source) { if (hasOwnProperty.call(source, key)) { assignValue(object, key, source[key]); } } }); /** * This method is like `_.assign` except that it iterates over own and * inherited source properties. * * **Note:** This method mutates `object`. * * @static * @memberOf _ * @since 4.0.0 * @alias extend * @category Object * @param {Object} object The destination object. * @param {...Object} [sources] The source objects. * @returns {Object} Returns `object`. * @see _.assign * @example * * function Foo() { * this.a = 1; * } * * function Bar() { * this.c = 3; * } * * Foo.prototype.b = 2; * Bar.prototype.d = 4; * * _.assignIn({ 'a': 0 }, new Foo, new Bar); * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 } */ var assignIn = createAssigner(function(object, source) { copyObject(source, keysIn(source), object); }); /** * This method is like `_.assignIn` except that it accepts `customizer` * which is invoked to produce the assigned values. If `customizer` returns * `undefined`, assignment is handled by the method instead. The `customizer` * is invoked with five arguments: (objValue, srcValue, key, object, source). * * **Note:** This method mutates `object`. * * @static * @memberOf _ * @since 4.0.0 * @alias extendWith * @category Object * @param {Object} object The destination object. * @param {...Object} sources The source objects. * @param {Function} [customizer] The function to customize assigned values. * @returns {Object} Returns `object`. * @see _.assignWith * @example * * function customizer(objValue, srcValue) { * return _.isUndefined(objValue) ? srcValue : objValue; * } * * var defaults = _.partialRight(_.assignInWith, customizer); * * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); * // => { 'a': 1, 'b': 2 } */ var assignInWith = createAssigner(function(object, source, srcIndex, customizer) { copyObject(source, keysIn(source), object, customizer); }); /** * This method is like `_.assign` except that it accepts `customizer` * which is invoked to produce the assigned values. If `customizer` returns * `undefined`, assignment is handled by the method instead. The `customizer` * is invoked with five arguments: (objValue, srcValue, key, object, source). * * **Note:** This method mutates `object`. * * @static * @memberOf _ * @since 4.0.0 * @category Object * @param {Object} object The destination object. * @param {...Object} sources The source objects. * @param {Function} [customizer] The function to customize assigned values. * @returns {Object} Returns `object`. * @see _.assignInWith * @example * * function customizer(objValue, srcValue) { * return _.isUndefined(objValue) ? srcValue : objValue; * } * * var defaults = _.partialRight(_.assignWith, customizer); * * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); * // => { 'a': 1, 'b': 2 } */ var assignWith = createAssigner(function(object, source, srcIndex, customizer) { copyObject(source, keys(source), object, customizer); }); /** * Creates an array of values corresponding to `paths` of `object`. * * @static * @memberOf _ * @since 1.0.0 * @category Object * @param {Object} object The object to iterate over. * @param {...(string|string[])} [paths] The property paths to pick. * @returns {Array} Returns the picked values. * @example * * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] }; * * _.at(object, ['a[0].b.c', 'a[1]']); * // => [3, 4] */ var at = flatRest(baseAt); /** * Creates an object that inherits from the `prototype` object. If a * `properties` object is given, its own enumerable string keyed properties * are assigned to the created object. * * @static * @memberOf _ * @since 2.3.0 * @category Object * @param {Object} prototype The object to inherit from. * @param {Object} [properties] The properties to assign to the object. * @returns {Object} Returns the new object. * @example * * function Shape() { * this.x = 0; * this.y = 0; * } * * function Circle() { * Shape.call(this); * } * * Circle.prototype = _.create(Shape.prototype, { * 'constructor': Circle * }); * * var circle = new Circle; * circle instanceof Circle; * // => true * * circle instanceof Shape; * // => true */ function create(prototype, properties) { var result = baseCreate(prototype); return properties == null ? result : baseAssign(result, properties); } /** * Assigns own and inherited enumerable string keyed properties of source * objects to the destination object for all destination properties that * resolve to `undefined`. Source objects are applied from left to right. * Once a property is set, additional values of the same property are ignored. * * **Note:** This method mutates `object`. * * @static * @since 0.1.0 * @memberOf _ * @category Object * @param {Object} object The destination object. * @param {...Object} [sources] The source objects. * @returns {Object} Returns `object`. * @see _.defaultsDeep * @example * * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); * // => { 'a': 1, 'b': 2 } */ var defaults = baseRest(function(object, sources) { object = Object(object); var index = -1; var length = sources.length; var guard = length > 2 ? sources[2] : undefined; if (guard && isIterateeCall(sources[0], sources[1], guard)) { length = 1; } while (++index < length) { var source = sources[index]; var props = keysIn(source); var propsIndex = -1; var propsLength = props.length; while (++propsIndex < propsLength) { var key = props[propsIndex]; var value = object[key]; if (value === undefined || (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) { object[key] = source[key]; } } } return object; }); /** * This method is like `_.defaults` except that it recursively assigns * default properties. * * **Note:** This method mutates `object`. * * @static * @memberOf _ * @since 3.10.0 * @category Object * @param {Object} object The destination object. * @param {...Object} [sources] The source objects. * @returns {Object} Returns `object`. * @see _.defaults * @example * * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } }); * // => { 'a': { 'b': 2, 'c': 3 } } */ var defaultsDeep = baseRest(function(args) { args.push(undefined, customDefaultsMerge); return apply(mergeWith, undefined, args); }); /** * This method is like `_.find` except that it returns the key of the first * element `predicate` returns truthy for instead of the element itself. * * @static * @memberOf _ * @since 1.1.0 * @category Object * @param {Object} object The object to inspect. * @param {Function} [predicate=_.identity] The function invoked per iteration. * @returns {string|undefined} Returns the key of the matched element, * else `undefined`. * @example * * var users = { * 'barney': { 'age': 36, 'active': true }, * 'fred': { 'age': 40, 'active': false }, * 'pebbles': { 'age': 1, 'active': true } * }; * * _.findKey(users, function(o) { return o.age < 40; }); * // => 'barney' (iteration order is not guaranteed) * * // The `_.matches` iteratee shorthand. * _.findKey(users, { 'age': 1, 'active': true }); * // => 'pebbles' * * // The `_.matchesProperty` iteratee shorthand. * _.findKey(users, ['active', false]); * // => 'fred' * * // The `_.property` iteratee shorthand. * _.findKey(users, 'active'); * // => 'barney' */ function findKey(object, predicate) { return baseFindKey(object, getIteratee(predicate, 3), baseForOwn); } /** * This method is like `_.findKey` except that it iterates over elements of * a collection in the opposite order. * * @static * @memberOf _ * @since 2.0.0 * @category Object * @param {Object} object The object to inspect. * @param {Function} [predicate=_.identity] The function invoked per iteration. * @returns {string|undefined} Returns the key of the matched element, * else `undefined`. * @example * * var users = { * 'barney': { 'age': 36, 'active': true }, * 'fred': { 'age': 40, 'active': false }, * 'pebbles': { 'age': 1, 'active': true } * }; * * _.findLastKey(users, function(o) { return o.age < 40; }); * // => returns 'pebbles' assuming `_.findKey` returns 'barney' * * // The `_.matches` iteratee shorthand. * _.findLastKey(users, { 'age': 36, 'active': true }); * // => 'barney' * * // The `_.matchesProperty` iteratee shorthand. * _.findLastKey(users, ['active', false]); * // => 'fred' * * // The `_.property` iteratee shorthand. * _.findLastKey(users, 'active'); * // => 'pebbles' */ function findLastKey(object, predicate) { return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight); } /** * Iterates over own and inherited enumerable string keyed properties of an * object and invokes `iteratee` for each property. The iteratee is invoked * with three arguments: (value, key, object). Iteratee functions may exit * iteration early by explicitly returning `false`. * * @static * @memberOf _ * @since 0.3.0 * @category Object * @param {Object} object The object to iterate over. * @param {Function} [iteratee=_.identity] The function invoked per iteration. * @returns {Object} Returns `object`. * @see _.forInRight * @example * * function Foo() { * this.a = 1; * this.b = 2; * } * * Foo.prototype.c = 3; * * _.forIn(new Foo, function(value, key) { * console.log(key); * }); * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed). */ function forIn(object, iteratee) { return object == null ? object : baseFor(object, getIteratee(iteratee, 3), keysIn); } /** * This method is like `_.forIn` except that it iterates over properties of * `object` in the opposite order. * * @static * @memberOf _ * @since 2.0.0 * @category Object * @param {Object} object The object to iterate over. * @param {Function} [iteratee=_.identity] The function invoked per iteration. * @returns {Object} Returns `object`. * @see _.forIn * @example * * function Foo() { * this.a = 1; * this.b = 2; * } * * Foo.prototype.c = 3; * * _.forInRight(new Foo, function(value, key) { * console.log(key); * }); * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'. */ function forInRight(object, iteratee) { return object == null ? object : baseForRight(object, getIteratee(iteratee, 3), keysIn); } /** * Iterates over own enumerable string keyed properties of an object and * invokes `iteratee` for each property. The iteratee is invoked with three * arguments: (value, key, object). Iteratee functions may exit iteration * early by explicitly returning `false`. * * @static * @memberOf _ * @since 0.3.0 * @category Object * @param {Object} object The object to iterate over. * @param {Function} [iteratee=_.identity] The function invoked per iteration. * @returns {Object} Returns `object`. * @see _.forOwnRight * @example * * function Foo() { * this.a = 1; * this.b = 2; * } * * Foo.prototype.c = 3; * * _.forOwn(new Foo, function(value, key) { * console.log(key); * }); * // => Logs 'a' then 'b' (iteration order is not guaranteed). */ function forOwn(object, iteratee) { return object && baseForOwn(object, getIteratee(iteratee, 3)); } /** * This method is like `_.forOwn` except that it iterates over properties of * `object` in the opposite order. * * @static * @memberOf _ * @since 2.0.0 * @category Object * @param {Object} object The object to iterate over. * @param {Function} [iteratee=_.identity] The function invoked per iteration. * @returns {Object} Returns `object`. * @see _.forOwn * @example * * function Foo() { * this.a = 1; * this.b = 2; * } * * Foo.prototype.c = 3; * * _.forOwnRight(new Foo, function(value, key) { * console.log(key); * }); * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'. */ function forOwnRight(object, iteratee) { return object && baseForOwnRight(object, getIteratee(iteratee, 3)); } /** * Creates an array of function property names from own enumerable properties * of `object`. * * @static * @since 0.1.0 * @memberOf _ * @category Object * @param {Object} object The object to inspect. * @returns {Array} Returns the function names. * @see _.functionsIn * @example * * function Foo() { * this.a = _.constant('a'); * this.b = _.constant('b'); * } * * Foo.prototype.c = _.constant('c'); * * _.functions(new Foo); * // => ['a', 'b'] */ function functions(object) { return object == null ? [] : baseFunctions(object, keys(object)); } /** * Creates an array of function property names from own and inherited * enumerable properties of `object`. * * @static * @memberOf _ * @since 4.0.0 * @category Object * @param {Object} object The object to inspect. * @returns {Array} Returns the function names. * @see _.functions * @example * * function Foo() { * this.a = _.constant('a'); * this.b = _.constant('b'); * } * * Foo.prototype.c = _.constant('c'); * * _.functionsIn(new Foo); * // => ['a', 'b', 'c'] */ function functionsIn(object) { return object == null ? [] : baseFunctions(object, keysIn(object)); } /** * Gets the value at `path` of `object`. If the resolved value is * `undefined`, the `defaultValue` is returned in its place. * * @static * @memberOf _ * @since 3.7.0 * @category Object * @param {Object} object The object to query. * @param {Array|string} path The path of the property to get. * @param {*} [defaultValue] The value returned for `undefined` resolved values. * @returns {*} Returns the resolved value. * @example * * var object = { 'a': [{ 'b': { 'c': 3 } }] }; * * _.get(object, 'a[0].b.c'); * // => 3 * * _.get(object, ['a', '0', 'b', 'c']); * // => 3 * * _.get(object, 'a.b.c', 'default'); * // => 'default' */ function get(object, path, defaultValue) { var result = object == null ? undefined : baseGet(object, path); return result === undefined ? defaultValue : result; } /** * Checks if `path` is a direct property of `object`. * * @static * @since 0.1.0 * @memberOf _ * @category Object * @param {Object} object The object to query. * @param {Array|string} path The path to check. * @returns {boolean} Returns `true` if `path` exists, else `false`. * @example * * var object = { 'a': { 'b': 2 } }; * var other = _.create({ 'a': _.create({ 'b': 2 }) }); * * _.has(object, 'a'); * // => true * * _.has(object, 'a.b'); * // => true * * _.has(object, ['a', 'b']); * // => true * * _.has(other, 'a'); * // => false */ function has(object, path) { return object != null && hasPath(object, path, baseHas); } /** * Checks if `path` is a direct or inherited property of `object`. * * @static * @memberOf _ * @since 4.0.0 * @category Object * @param {Object} object The object to query. * @param {Array|string} path The path to check. * @returns {boolean} Returns `true` if `path` exists, else `false`. * @example * * var object = _.create({ 'a': _.create({ 'b': 2 }) }); * * _.hasIn(object, 'a'); * // => true * * _.hasIn(object, 'a.b'); * // => true * * _.hasIn(object, ['a', 'b']); * // => true * * _.hasIn(object, 'b'); * // => false */ function hasIn(object, path) { return object != null && hasPath(object, path, baseHasIn); } /** * Creates an object composed of the inverted keys and values of `object`. * If `object` contains duplicate values, subsequent values overwrite * property assignments of previous values. * * @static * @memberOf _ * @since 0.7.0 * @category Object * @param {Object} object The object to invert. * @returns {Object} Returns the new inverted object. * @example * * var object = { 'a': 1, 'b': 2, 'c': 1 }; * * _.invert(object); * // => { '1': 'c', '2': 'b' } */ var invert = createInverter(function(result, value, key) { if (value != null && typeof value.toString != 'function') { value = nativeObjectToString.call(value); } result[value] = key; }, constant(identity)); /** * This method is like `_.invert` except that the inverted object is generated * from the results of running each element of `object` thru `iteratee`. The * corresponding inverted value of each inverted key is an array of keys * responsible for generating the inverted value. The iteratee is invoked * with one argument: (value). * * @static * @memberOf _ * @since 4.1.0 * @category Object * @param {Object} object The object to invert. * @param {Function} [iteratee=_.identity] The iteratee invoked per element. * @returns {Object} Returns the new inverted object. * @example * * var object = { 'a': 1, 'b': 2, 'c': 1 }; * * _.invertBy(object); * // => { '1': ['a', 'c'], '2': ['b'] } * * _.invertBy(object, function(value) { * return 'group' + value; * }); * // => { 'group1': ['a', 'c'], 'group2': ['b'] } */ var invertBy = createInverter(function(result, value, key) { if (value != null && typeof value.toString != 'function') { value = nativeObjectToString.call(value); } if (hasOwnProperty.call(result, value)) { result[value].push(key); } else { result[value] = [key]; } }, getIteratee); /** * Invokes the method at `path` of `object`. * * @static * @memberOf _ * @since 4.0.0 * @category Object * @param {Object} object The object to query. * @param {Array|string} path The path of the method to invoke. * @param {...*} [args] The arguments to invoke the method with. * @returns {*} Returns the result of the invoked method. * @example * * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] }; * * _.invoke(object, 'a[0].b.c.slice', 1, 3); * // => [2, 3] */ var invoke = baseRest(baseInvoke); /** * Creates an array of the own enumerable property names of `object`. * * **Note:** Non-object values are coerced to objects. See the * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) * for more details. * * @static * @since 0.1.0 * @memberOf _ * @category Object * @param {Object} object The object to query. * @returns {Array} Returns the array of property names. * @example * * function Foo() { * this.a = 1; * this.b = 2; * } * * Foo.prototype.c = 3; * * _.keys(new Foo); * // => ['a', 'b'] (iteration order is not guaranteed) * * _.keys('hi'); * // => ['0', '1'] */ function keys(object) { return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object); } /** * Creates an array of the own and inherited enumerable property names of `object`. * * **Note:** Non-object values are coerced to objects. * * @static * @memberOf _ * @since 3.0.0 * @category Object * @param {Object} object The object to query. * @returns {Array} Returns the array of property names. * @example * * function Foo() { * this.a = 1; * this.b = 2; * } * * Foo.prototype.c = 3; * * _.keysIn(new Foo); * // => ['a', 'b', 'c'] (iteration order is not guaranteed) */ function keysIn(object) { return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object); } /** * The opposite of `_.mapValues`; this method creates an object with the * same values as `object` and keys generated by running each own enumerable * string keyed property of `object` thru `iteratee`. The iteratee is invoked * with three arguments: (value, key, object). * * @static * @memberOf _ * @since 3.8.0 * @category Object * @param {Object} object The object to iterate over. * @param {Function} [iteratee=_.identity] The function invoked per iteration. * @returns {Object} Returns the new mapped object. * @see _.mapValues * @example * * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) { * return key + value; * }); * // => { 'a1': 1, 'b2': 2 } */ function mapKeys(object, iteratee) { var result = {}; iteratee = getIteratee(iteratee, 3); baseForOwn(object, function(value, key, object) { baseAssignValue(result, iteratee(value, key, object), value); }); return result; } /** * Creates an object with the same keys as `object` and values generated * by running each own enumerable string keyed property of `object` thru * `iteratee`. The iteratee is invoked with three arguments: * (value, key, object). * * @static * @memberOf _ * @since 2.4.0 * @category Object * @param {Object} object The object to iterate over. * @param {Function} [iteratee=_.identity] The function invoked per iteration. * @returns {Object} Returns the new mapped object. * @see _.mapKeys * @example * * var users = { * 'fred': { 'user': 'fred', 'age': 40 }, * 'pebbles': { 'user': 'pebbles', 'age': 1 } * }; * * _.mapValues(users, function(o) { return o.age; }); * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed) * * // The `_.property` iteratee shorthand. * _.mapValues(users, 'age'); * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed) */ function mapValues(object, iteratee) { var result = {}; iteratee = getIteratee(iteratee, 3); baseForOwn(object, function(value, key, object) { baseAssignValue(result, key, iteratee(value, key, object)); }); return result; } /** * This method is like `_.assign` except that it recursively merges own and * inherited enumerable string keyed properties of source objects into the * destination object. Source properties that resolve to `undefined` are * skipped if a destination value exists. Array and plain object properties * are merged recursively. Other objects and value types are overridden by * assignment. Source objects are applied from left to right. Subsequent * sources overwrite property assignments of previous sources. * * **Note:** This method mutates `object`. * * @static * @memberOf _ * @since 0.5.0 * @category Object * @param {Object} object The destination object. * @param {...Object} [sources] The source objects. * @returns {Object} Returns `object`. * @example * * var object = { * 'a': [{ 'b': 2 }, { 'd': 4 }] * }; * * var other = { * 'a': [{ 'c': 3 }, { 'e': 5 }] * }; * * _.merge(object, other); * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] } */ var merge = createAssigner(function(object, source, srcIndex) { baseMerge(object, source, srcIndex); }); /** * This method is like `_.merge` except that it accepts `customizer` which * is invoked to produce the merged values of the destination and source * properties. If `customizer` returns `undefined`, merging is handled by the * method instead. The `customizer` is invoked with six arguments: * (objValue, srcValue, key, object, source, stack). * * **Note:** This method mutates `object`. * * @static * @memberOf _ * @since 4.0.0 * @category Object * @param {Object} object The destination object. * @param {...Object} sources The source objects. * @param {Function} customizer The function to customize assigned values. * @returns {Object} Returns `object`. * @example * * function customizer(objValue, srcValue) { * if (_.isArray(objValue)) { * return objValue.concat(srcValue); * } * } * * var object = { 'a': [1], 'b': [2] }; * var other = { 'a': [3], 'b': [4] }; * * _.mergeWith(object, other, customizer); * // => { 'a': [1, 3], 'b': [2, 4] } */ var mergeWith = createAssigner(function(object, source, srcIndex, customizer) { baseMerge(object, source, srcIndex, customizer); }); /** * The opposite of `_.pick`; this method creates an object composed of the * own and inherited enumerable property paths of `object` that are not omitted. * * **Note:** This method is considerably slower than `_.pick`. * * @static * @since 0.1.0 * @memberOf _ * @category Object * @param {Object} object The source object. * @param {...(string|string[])} [paths] The property paths to omit. * @returns {Object} Returns the new object. * @example * * var object = { 'a': 1, 'b': '2', 'c': 3 }; * * _.omit(object, ['a', 'c']); * // => { 'b': '2' } */ var omit = flatRest(function(object, paths) { var result = {}; if (object == null) { return result; } var isDeep = false; paths = arrayMap(paths, function(path) { path = castPath(path, object); isDeep || (isDeep = path.length > 1); return path; }); copyObject(object, getAllKeysIn(object), result); if (isDeep) { result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone); } var length = paths.length; while (length--) { baseUnset(result, paths[length]); } return result; }); /** * The opposite of `_.pickBy`; this method creates an object composed of * the own and inherited enumerable string keyed properties of `object` that * `predicate` doesn't return truthy for. The predicate is invoked with two * arguments: (value, key). * * @static * @memberOf _ * @since 4.0.0 * @category Object * @param {Object} object The source object. * @param {Function} [predicate=_.identity] The function invoked per property. * @returns {Object} Returns the new object. * @example * * var object = { 'a': 1, 'b': '2', 'c': 3 }; * * _.omitBy(object, _.isNumber); * // => { 'b': '2' } */ function omitBy(object, predicate) { return pickBy(object, negate(getIteratee(predicate))); } /** * Creates an object composed of the picked `object` properties. * * @static * @since 0.1.0 * @memberOf _ * @category Object * @param {Object} object The source object. * @param {...(string|string[])} [paths] The property paths to pick. * @returns {Object} Returns the new object. * @example * * var object = { 'a': 1, 'b': '2', 'c': 3 }; * * _.pick(object, ['a', 'c']); * // => { 'a': 1, 'c': 3 } */ var pick = flatRest(function(object, paths) { return object == null ? {} : basePick(object, paths); }); /** * Creates an object composed of the `object` properties `predicate` returns * truthy for. The predicate is invoked with two arguments: (value, key). * * @static * @memberOf _ * @since 4.0.0 * @category Object * @param {Object} object The source object. * @param {Function} [predicate=_.identity] The function invoked per property. * @returns {Object} Returns the new object. * @example * * var object = { 'a': 1, 'b': '2', 'c': 3 }; * * _.pickBy(object, _.isNumber); * // => { 'a': 1, 'c': 3 } */ function pickBy(object, predicate) { if (object == null) { return {}; } var props = arrayMap(getAllKeysIn(object), function(prop) { return [prop]; }); predicate = getIteratee(predicate); return basePickBy(object, props, function(value, path) { return predicate(value, path[0]); }); } /** * This method is like `_.get` except that if the resolved value is a * function it's invoked with the `this` binding of its parent object and * its result is returned. * * @static * @since 0.1.0 * @memberOf _ * @category Object * @param {Object} object The object to query. * @param {Array|string} path The path of the property to resolve. * @param {*} [defaultValue] The value returned for `undefined` resolved values. * @returns {*} Returns the resolved value. * @example * * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] }; * * _.result(object, 'a[0].b.c1'); * // => 3 * * _.result(object, 'a[0].b.c2'); * // => 4 * * _.result(object, 'a[0].b.c3', 'default'); * // => 'default' * * _.result(object, 'a[0].b.c3', _.constant('default')); * // => 'default' */ function result(object, path, defaultValue) { path = castPath(path, object); var index = -1, length = path.length; // Ensure the loop is entered when path is empty. if (!length) { length = 1; object = undefined; } while (++index < length) { var value = object == null ? undefined : object[toKey(path[index])]; if (value === undefined) { index = length; value = defaultValue; } object = isFunction(value) ? value.call(object) : value; } return object; } /** * Sets the value at `path` of `object`. If a portion of `path` doesn't exist, * it's created. Arrays are created for missing index properties while objects * are created for all other missing properties. Use `_.setWith` to customize * `path` creation. * * **Note:** This method mutates `object`. * * @static * @memberOf _ * @since 3.7.0 * @category Object * @param {Object} object The object to modify. * @param {Array|string} path The path of the property to set. * @param {*} value The value to set. * @returns {Object} Returns `object`. * @example * * var object = { 'a': [{ 'b': { 'c': 3 } }] }; * * _.set(object, 'a[0].b.c', 4); * console.log(object.a[0].b.c); * // => 4 * * _.set(object, ['x', '0', 'y', 'z'], 5); * console.log(object.x[0].y.z); * // => 5 */ function set(object, path, value) { return object == null ? object : baseSet(object, path, value); } /** * This method is like `_.set` except that it accepts `customizer` which is * invoked to produce the objects of `path`. If `customizer` returns `undefined` * path creation is handled by the method instead. The `customizer` is invoked * with three arguments: (nsValue, key, nsObject). * * **Note:** This method mutates `object`. * * @static * @memberOf _ * @since 4.0.0 * @category Object * @param {Object} object The object to modify. * @param {Array|string} path The path of the property to set. * @param {*} value The value to set. * @param {Function} [customizer] The function to customize assigned values. * @returns {Object} Returns `object`. * @example * * var object = {}; * * _.setWith(object, '[0][1]', 'a', Object); * // => { '0': { '1': 'a' } } */ function setWith(object, path, value, customizer) { customizer = typeof customizer == 'function' ? customizer : undefined; return object == null ? object : baseSet(object, path, value, customizer); } /** * Creates an array of own enumerable string keyed-value pairs for `object` * which can be consumed by `_.fromPairs`. If `object` is a map or set, its * entries are returned. * * @static * @memberOf _ * @since 4.0.0 * @alias entries * @category Object * @param {Object} object The object to query. * @returns {Array} Returns the key-value pairs. * @example * * function Foo() { * this.a = 1; * this.b = 2; * } * * Foo.prototype.c = 3; * * _.toPairs(new Foo); * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed) */ var toPairs = createToPairs(keys); /** * Creates an array of own and inherited enumerable string keyed-value pairs * for `object` which can be consumed by `_.fromPairs`. If `object` is a map * or set, its entries are returned. * * @static * @memberOf _ * @since 4.0.0 * @alias entriesIn * @category Object * @param {Object} object The object to query. * @returns {Array} Returns the key-value pairs. * @example * * function Foo() { * this.a = 1; * this.b = 2; * } * * Foo.prototype.c = 3; * * _.toPairsIn(new Foo); * // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed) */ var toPairsIn = createToPairs(keysIn); /** * An alternative to `_.reduce`; this method transforms `object` to a new * `accumulator` object which is the result of running each of its own * enumerable string keyed properties thru `iteratee`, with each invocation * potentially mutating the `accumulator` object. If `accumulator` is not * provided, a new object with the same `[[Prototype]]` will be used. The * iteratee is invoked with four arguments: (accumulator, value, key, object). * Iteratee functions may exit iteration early by explicitly returning `false`. * * @static * @memberOf _ * @since 1.3.0 * @category Object * @param {Object} object The object to iterate over. * @param {Function} [iteratee=_.identity] The function invoked per iteration. * @param {*} [accumulator] The custom accumulator value. * @returns {*} Returns the accumulated value. * @example * * _.transform([2, 3, 4], function(result, n) { * result.push(n *= n); * return n % 2 == 0; * }, []); * // => [4, 9] * * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) { * (result[value] || (result[value] = [])).push(key); * }, {}); * // => { '1': ['a', 'c'], '2': ['b'] } */ function transform(object, iteratee, accumulator) { var isArr = isArray(object), isArrLike = isArr || isBuffer(object) || isTypedArray(object); iteratee = getIteratee(iteratee, 4); if (accumulator == null) { var Ctor = object && object.constructor; if (isArrLike) { accumulator = isArr ? new Ctor : []; } else if (isObject(object)) { accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {}; } else { accumulator = {}; } } (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object) { return iteratee(accumulator, value, index, object); }); return accumulator; } /** * Removes the property at `path` of `object`. * * **Note:** This method mutates `object`. * * @static * @memberOf _ * @since 4.0.0 * @category Object * @param {Object} object The object to modify. * @param {Array|string} path The path of the property to unset. * @returns {boolean} Returns `true` if the property is deleted, else `false`. * @example * * var object = { 'a': [{ 'b': { 'c': 7 } }] }; * _.unset(object, 'a[0].b.c'); * // => true * * console.log(object); * // => { 'a': [{ 'b': {} }] }; * * _.unset(object, ['a', '0', 'b', 'c']); * // => true * * console.log(object); * // => { 'a': [{ 'b': {} }] }; */ function unset(object, path) { return object == null ? true : baseUnset(object, path); } /** * This method is like `_.set` except that accepts `updater` to produce the * value to set. Use `_.updateWith` to customize `path` creation. The `updater` * is invoked with one argument: (value). * * **Note:** This method mutates `object`. * * @static * @memberOf _ * @since 4.6.0 * @category Object * @param {Object} object The object to modify. * @param {Array|string} path The path of the property to set. * @param {Function} updater The function to produce the updated value. * @returns {Object} Returns `object`. * @example * * var object = { 'a': [{ 'b': { 'c': 3 } }] }; * * _.update(object, 'a[0].b.c', function(n) { return n * n; }); * console.log(object.a[0].b.c); * // => 9 * * _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; }); * console.log(object.x[0].y.z); * // => 0 */ function update(object, path, updater) { return object == null ? object : baseUpdate(object, path, castFunction(updater)); } /** * This method is like `_.update` except that it accepts `customizer` which is * invoked to produce the objects of `path`. If `customizer` returns `undefined` * path creation is handled by the method instead. The `customizer` is invoked * with three arguments: (nsValue, key, nsObject). * * **Note:** This method mutates `object`. * * @static * @memberOf _ * @since 4.6.0 * @category Object * @param {Object} object The object to modify. * @param {Array|string} path The path of the property to set. * @param {Function} updater The function to produce the updated value. * @param {Function} [customizer] The function to customize assigned values. * @returns {Object} Returns `object`. * @example * * var object = {}; * * _.updateWith(object, '[0][1]', _.constant('a'), Object); * // => { '0': { '1': 'a' } } */ function updateWith(object, path, updater, customizer) { customizer = typeof customizer == 'function' ? customizer : undefined; return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer); } /** * Creates an array of the own enumerable string keyed property values of `object`. * * **Note:** Non-object values are coerced to objects. * * @static * @since 0.1.0 * @memberOf _ * @category Object * @param {Object} object The object to query. * @returns {Array} Returns the array of property values. * @example * * function Foo() { * this.a = 1; * this.b = 2; * } * * Foo.prototype.c = 3; * * _.values(new Foo); * // => [1, 2] (iteration order is not guaranteed) * * _.values('hi'); * // => ['h', 'i'] */ function values(object) { return object == null ? [] : baseValues(object, keys(object)); } /** * Creates an array of the own and inherited enumerable string keyed property * values of `object`. * * **Note:** Non-object values are coerced to objects. * * @static * @memberOf _ * @since 3.0.0 * @category Object * @param {Object} object The object to query. * @returns {Array} Returns the array of property values. * @example * * function Foo() { * this.a = 1; * this.b = 2; * } * * Foo.prototype.c = 3; * * _.valuesIn(new Foo); * // => [1, 2, 3] (iteration order is not guaranteed) */ function valuesIn(object) { return object == null ? [] : baseValues(object, keysIn(object)); } /*------------------------------------------------------------------------*/ /** * Clamps `number` within the inclusive `lower` and `upper` bounds. * * @static * @memberOf _ * @since 4.0.0 * @category Number * @param {number} number The number to clamp. * @param {number} [lower] The lower bound. * @param {number} upper The upper bound. * @returns {number} Returns the clamped number. * @example * * _.clamp(-10, -5, 5); * // => -5 * * _.clamp(10, -5, 5); * // => 5 */ function clamp(number, lower, upper) { if (upper === undefined) { upper = lower; lower = undefined; } if (upper !== undefined) { upper = toNumber(upper); upper = upper === upper ? upper : 0; } if (lower !== undefined) { lower = toNumber(lower); lower = lower === lower ? lower : 0; } return baseClamp(toNumber(number), lower, upper); } /** * Checks if `n` is between `start` and up to, but not including, `end`. If * `end` is not specified, it's set to `start` with `start` then set to `0`. * If `start` is greater than `end` the params are swapped to support * negative ranges. * * @static * @memberOf _ * @since 3.3.0 * @category Number * @param {number} number The number to check. * @param {number} [start=0] The start of the range. * @param {number} end The end of the range. * @returns {boolean} Returns `true` if `number` is in the range, else `false`. * @see _.range, _.rangeRight * @example * * _.inRange(3, 2, 4); * // => true * * _.inRange(4, 8); * // => true * * _.inRange(4, 2); * // => false * * _.inRange(2, 2); * // => false * * _.inRange(1.2, 2); * // => true * * _.inRange(5.2, 4); * // => false * * _.inRange(-3, -2, -6); * // => true */ function inRange(number, start, end) { start = toFinite(start); if (end === undefined) { end = start; start = 0; } else { end = toFinite(end); } number = toNumber(number); return baseInRange(number, start, end); } /** * Produces a random number between the inclusive `lower` and `upper` bounds. * If only one argument is provided a number between `0` and the given number * is returned. If `floating` is `true`, or either `lower` or `upper` are * floats, a floating-point number is returned instead of an integer. * * **Note:** JavaScript follows the IEEE-754 standard for resolving * floating-point values which can produce unexpected results. * * @static * @memberOf _ * @since 0.7.0 * @category Number * @param {number} [lower=0] The lower bound. * @param {number} [upper=1] The upper bound. * @param {boolean} [floating] Specify returning a floating-point number. * @returns {number} Returns the random number. * @example * * _.random(0, 5); * // => an integer between 0 and 5 * * _.random(5); * // => also an integer between 0 and 5 * * _.random(5, true); * // => a floating-point number between 0 and 5 * * _.random(1.2, 5.2); * // => a floating-point number between 1.2 and 5.2 */ function random(lower, upper, floating) { if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) { upper = floating = undefined; } if (floating === undefined) { if (typeof upper == 'boolean') { floating = upper; upper = undefined; } else if (typeof lower == 'boolean') { floating = lower; lower = undefined; } } if (lower === undefined && upper === undefined) { lower = 0; upper = 1; } else { lower = toFinite(lower); if (upper === undefined) { upper = lower; lower = 0; } else { upper = toFinite(upper); } } if (lower > upper) { var temp = lower; lower = upper; upper = temp; } if (floating || lower % 1 || upper % 1) { var rand = nativeRandom(); return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper); } return baseRandom(lower, upper); } /*------------------------------------------------------------------------*/ /** * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase). * * @static * @memberOf _ * @since 3.0.0 * @category String * @param {string} [string=''] The string to convert. * @returns {string} Returns the camel cased string. * @example * * _.camelCase('Foo Bar'); * // => 'fooBar' * * _.camelCase('--foo-bar--'); * // => 'fooBar' * * _.camelCase('__FOO_BAR__'); * // => 'fooBar' */ var camelCase = createCompounder(function(result, word, index) { word = word.toLowerCase(); return result + (index ? capitalize(word) : word); }); /** * Converts the first character of `string` to upper case and the remaining * to lower case. * * @static * @memberOf _ * @since 3.0.0 * @category String * @param {string} [string=''] The string to capitalize. * @returns {string} Returns the capitalized string. * @example * * _.capitalize('FRED'); * // => 'Fred' */ function capitalize(string) { return upperFirst(toString(string).toLowerCase()); } /** * Deburrs `string` by converting * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table) * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A) * letters to basic Latin letters and removing * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks). * * @static * @memberOf _ * @since 3.0.0 * @category String * @param {string} [string=''] The string to deburr. * @returns {string} Returns the deburred string. * @example * * _.deburr('déjà vu'); * // => 'deja vu' */ function deburr(string) { string = toString(string); return string && string.replace(reLatin, deburrLetter).replace(reComboMark, ''); } /** * Checks if `string` ends with the given target string. * * @static * @memberOf _ * @since 3.0.0 * @category String * @param {string} [string=''] The string to inspect. * @param {string} [target] The string to search for. * @param {number} [position=string.length] The position to search up to. * @returns {boolean} Returns `true` if `string` ends with `target`, * else `false`. * @example * * _.endsWith('abc', 'c'); * // => true * * _.endsWith('abc', 'b'); * // => false * * _.endsWith('abc', 'b', 2); * // => true */ function endsWith(string, target, position) { string = toString(string); target = baseToString(target); var length = string.length; position = position === undefined ? length : baseClamp(toInteger(position), 0, length); var end = position; position -= target.length; return position >= 0 && string.slice(position, end) == target; } /** * Converts the characters "&", "<", ">", '"', and "'" in `string` to their * corresponding HTML entities. * * **Note:** No other characters are escaped. To escape additional * characters use a third-party library like [_he_](https://mths.be/he). * * Though the ">" character is escaped for symmetry, characters like * ">" and "/" don't need escaping in HTML and have no special meaning * unless they're part of a tag or unquoted attribute value. See * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands) * (under "semi-related fun fact") for more details. * * When working with HTML you should always * [quote attribute values](http://wonko.com/post/html-escaping) to reduce * XSS vectors. * * @static * @since 0.1.0 * @memberOf _ * @category String * @param {string} [string=''] The string to escape. * @returns {string} Returns the escaped string. * @example * * _.escape('fred, barney, & pebbles'); * // => 'fred, barney, & pebbles' */ function escape(string) { string = toString(string); return (string && reHasUnescapedHtml.test(string)) ? string.replace(reUnescapedHtml, escapeHtmlChar) : string; } /** * Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+", * "?", "(", ")", "[", "]", "{", "}", and "|" in `string`. * * @static * @memberOf _ * @since 3.0.0 * @category String * @param {string} [string=''] The string to escape. * @returns {string} Returns the escaped string. * @example * * _.escapeRegExp('[lodash](https://lodash.com/)'); * // => '\[lodash\]\(https://lodash\.com/\)' */ function escapeRegExp(string) { string = toString(string); return (string && reHasRegExpChar.test(string)) ? string.replace(reRegExpChar, '\\$&') : string; } /** * Converts `string` to * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles). * * @static * @memberOf _ * @since 3.0.0 * @category String * @param {string} [string=''] The string to convert. * @returns {string} Returns the kebab cased string. * @example * * _.kebabCase('Foo Bar'); * // => 'foo-bar' * * _.kebabCase('fooBar'); * // => 'foo-bar' * * _.kebabCase('__FOO_BAR__'); * // => 'foo-bar' */ var kebabCase = createCompounder(function(result, word, index) { return result + (index ? '-' : '') + word.toLowerCase(); }); /** * Converts `string`, as space separated words, to lower case. * * @static * @memberOf _ * @since 4.0.0 * @category String * @param {string} [string=''] The string to convert. * @returns {string} Returns the lower cased string. * @example * * _.lowerCase('--Foo-Bar--'); * // => 'foo bar' * * _.lowerCase('fooBar'); * // => 'foo bar' * * _.lowerCase('__FOO_BAR__'); * // => 'foo bar' */ var lowerCase = createCompounder(function(result, word, index) { return result + (index ? ' ' : '') + word.toLowerCase(); }); /** * Converts the first character of `string` to lower case. * * @static * @memberOf _ * @since 4.0.0 * @category String * @param {string} [string=''] The string to convert. * @returns {string} Returns the converted string. * @example * * _.lowerFirst('Fred'); * // => 'fred' * * _.lowerFirst('FRED'); * // => 'fRED' */ var lowerFirst = createCaseFirst('toLowerCase'); /** * Pads `string` on the left and right sides if it's shorter than `length`. * Padding characters are truncated if they can't be evenly divided by `length`. * * @static * @memberOf _ * @since 3.0.0 * @category String * @param {string} [string=''] The string to pad. * @param {number} [length=0] The padding length. * @param {string} [chars=' '] The string used as padding. * @returns {string} Returns the padded string. * @example * * _.pad('abc', 8); * // => ' abc ' * * _.pad('abc', 8, '_-'); * // => '_-abc_-_' * * _.pad('abc', 3); * // => 'abc' */ function pad(string, length, chars) { string = toString(string); length = toInteger(length); var strLength = length ? stringSize(string) : 0; if (!length || strLength >= length) { return string; } var mid = (length - strLength) / 2; return ( createPadding(nativeFloor(mid), chars) + string + createPadding(nativeCeil(mid), chars) ); } /** * Pads `string` on the right side if it's shorter than `length`. Padding * characters are truncated if they exceed `length`. * * @static * @memberOf _ * @since 4.0.0 * @category String * @param {string} [string=''] The string to pad. * @param {number} [length=0] The padding length. * @param {string} [chars=' '] The string used as padding. * @returns {string} Returns the padded string. * @example * * _.padEnd('abc', 6); * // => 'abc ' * * _.padEnd('abc', 6, '_-'); * // => 'abc_-_' * * _.padEnd('abc', 3); * // => 'abc' */ function padEnd(string, length, chars) { string = toString(string); length = toInteger(length); var strLength = length ? stringSize(string) : 0; return (length && strLength < length) ? (string + createPadding(length - strLength, chars)) : string; } /** * Pads `string` on the left side if it's shorter than `length`. Padding * characters are truncated if they exceed `length`. * * @static * @memberOf _ * @since 4.0.0 * @category String * @param {string} [string=''] The string to pad. * @param {number} [length=0] The padding length. * @param {string} [chars=' '] The string used as padding. * @returns {string} Returns the padded string. * @example * * _.padStart('abc', 6); * // => ' abc' * * _.padStart('abc', 6, '_-'); * // => '_-_abc' * * _.padStart('abc', 3); * // => 'abc' */ function padStart(string, length, chars) { string = toString(string); length = toInteger(length); var strLength = length ? stringSize(string) : 0; return (length && strLength < length) ? (createPadding(length - strLength, chars) + string) : string; } /** * Converts `string` to an integer of the specified radix. If `radix` is * `undefined` or `0`, a `radix` of `10` is used unless `value` is a * hexadecimal, in which case a `radix` of `16` is used. * * **Note:** This method aligns with the * [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`. * * @static * @memberOf _ * @since 1.1.0 * @category String * @param {string} string The string to convert. * @param {number} [radix=10] The radix to interpret `value` by. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {number} Returns the converted integer. * @example * * _.parseInt('08'); * // => 8 * * _.map(['6', '08', '10'], _.parseInt); * // => [6, 8, 10] */ function parseInt(string, radix, guard) { if (guard || radix == null) { radix = 0; } else if (radix) { radix = +radix; } return nativeParseInt(toString(string).replace(reTrimStart, ''), radix || 0); } /** * Repeats the given string `n` times. * * @static * @memberOf _ * @since 3.0.0 * @category String * @param {string} [string=''] The string to repeat. * @param {number} [n=1] The number of times to repeat the string. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {string} Returns the repeated string. * @example * * _.repeat('*', 3); * // => '***' * * _.repeat('abc', 2); * // => 'abcabc' * * _.repeat('abc', 0); * // => '' */ function repeat(string, n, guard) { if ((guard ? isIterateeCall(string, n, guard) : n === undefined)) { n = 1; } else { n = toInteger(n); } return baseRepeat(toString(string), n); } /** * Replaces matches for `pattern` in `string` with `replacement`. * * **Note:** This method is based on * [`String#replace`](https://mdn.io/String/replace). * * @static * @memberOf _ * @since 4.0.0 * @category String * @param {string} [string=''] The string to modify. * @param {RegExp|string} pattern The pattern to replace. * @param {Function|string} replacement The match replacement. * @returns {string} Returns the modified string. * @example * * _.replace('Hi Fred', 'Fred', 'Barney'); * // => 'Hi Barney' */ function replace() { var args = arguments, string = toString(args[0]); return args.length < 3 ? string : string.replace(args[1], args[2]); } /** * Converts `string` to * [snake case](https://en.wikipedia.org/wiki/Snake_case). * * @static * @memberOf _ * @since 3.0.0 * @category String * @param {string} [string=''] The string to convert. * @returns {string} Returns the snake cased string. * @example * * _.snakeCase('Foo Bar'); * // => 'foo_bar' * * _.snakeCase('fooBar'); * // => 'foo_bar' * * _.snakeCase('--FOO-BAR--'); * // => 'foo_bar' */ var snakeCase = createCompounder(function(result, word, index) { return result + (index ? '_' : '') + word.toLowerCase(); }); /** * Splits `string` by `separator`. * * **Note:** This method is based on * [`String#split`](https://mdn.io/String/split). * * @static * @memberOf _ * @since 4.0.0 * @category String * @param {string} [string=''] The string to split. * @param {RegExp|string} separator The separator pattern to split by. * @param {number} [limit] The length to truncate results to. * @returns {Array} Returns the string segments. * @example * * _.split('a-b-c', '-', 2); * // => ['a', 'b'] */ function split(string, separator, limit) { if (limit && typeof limit != 'number' && isIterateeCall(string, separator, limit)) { separator = limit = undefined; } limit = limit === undefined ? MAX_ARRAY_LENGTH : limit >>> 0; if (!limit) { return []; } string = toString(string); if (string && ( typeof separator == 'string' || (separator != null && !isRegExp(separator)) )) { separator = baseToString(separator); if (!separator && hasUnicode(string)) { return castSlice(stringToArray(string), 0, limit); } } return string.split(separator, limit); } /** * Converts `string` to * [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage). * * @static * @memberOf _ * @since 3.1.0 * @category String * @param {string} [string=''] The string to convert. * @returns {string} Returns the start cased string. * @example * * _.startCase('--foo-bar--'); * // => 'Foo Bar' * * _.startCase('fooBar'); * // => 'Foo Bar' * * _.startCase('__FOO_BAR__'); * // => 'FOO BAR' */ var startCase = createCompounder(function(result, word, index) { return result + (index ? ' ' : '') + upperFirst(word); }); /** * Checks if `string` starts with the given target string. * * @static * @memberOf _ * @since 3.0.0 * @category String * @param {string} [string=''] The string to inspect. * @param {string} [target] The string to search for. * @param {number} [position=0] The position to search from. * @returns {boolean} Returns `true` if `string` starts with `target`, * else `false`. * @example * * _.startsWith('abc', 'a'); * // => true * * _.startsWith('abc', 'b'); * // => false * * _.startsWith('abc', 'b', 1); * // => true */ function startsWith(string, target, position) { string = toString(string); position = position == null ? 0 : baseClamp(toInteger(position), 0, string.length); target = baseToString(target); return string.slice(position, position + target.length) == target; } /** * Creates a compiled template function that can interpolate data properties * in "interpolate" delimiters, HTML-escape interpolated data properties in * "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data * properties may be accessed as free variables in the template. If a setting * object is given, it takes precedence over `_.templateSettings` values. * * **Note:** In the development build `_.template` utilizes * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl) * for easier debugging. * * For more information on precompiling templates see * [lodash's custom builds documentation](https://lodash.com/custom-builds). * * For more information on Chrome extension sandboxes see * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval). * * @static * @since 0.1.0 * @memberOf _ * @category String * @param {string} [string=''] The template string. * @param {Object} [options={}] The options object. * @param {RegExp} [options.escape=_.templateSettings.escape] * The HTML "escape" delimiter. * @param {RegExp} [options.evaluate=_.templateSettings.evaluate] * The "evaluate" delimiter. * @param {Object} [options.imports=_.templateSettings.imports] * An object to import into the template as free variables. * @param {RegExp} [options.interpolate=_.templateSettings.interpolate] * The "interpolate" delimiter. * @param {string} [options.sourceURL='lodash.templateSources[n]'] * The sourceURL of the compiled template. * @param {string} [options.variable='obj'] * The data object variable name. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {Function} Returns the compiled template function. * @example * * // Use the "interpolate" delimiter to create a compiled template. * var compiled = _.template('hello <%= user %>!'); * compiled({ 'user': 'fred' }); * // => 'hello fred!' * * // Use the HTML "escape" delimiter to escape data property values. * var compiled = _.template('<%- value %>'); * compiled({ 'value': '