@k8slens/extensions 6.4.0-git.4b3fad57cb.0 → 6.4.0-git.5eefa8f03a.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (24) hide show
  1. package/dist/src/common/cluster/cluster.d.ts +4 -4
  2. package/dist/src/common/fetch/lens-fetch.global-override-for-injectable.d.ts +9 -0
  3. package/dist/src/common/fetch/lens-fetch.injectable.d.ts +5 -0
  4. package/dist/src/common/utils/type-narrowing.d.ts +1 -1
  5. package/dist/src/extensions/common-api/k8s-api.d.ts +7 -0
  6. package/dist/src/extensions/extension-api.js +100 -100
  7. package/dist/src/main/cluster-detectors/cluster-distribution-detector.injectable.d.ts +14 -0
  8. package/dist/src/main/cluster-detectors/cluster-id-detector.injectable.d.ts +14 -0
  9. package/dist/src/main/cluster-detectors/{last-seen-detector.d.ts → cluster-last-seen-detector.injectable.d.ts} +4 -4
  10. package/dist/src/main/cluster-detectors/{nodes-count-detector.d.ts → cluster-nodes-count-detector.injectable.d.ts} +5 -5
  11. package/dist/src/main/cluster-detectors/{cluster-id-detector.d.ts → cluster-version-detector.injectable.d.ts} +4 -5
  12. package/dist/src/main/cluster-detectors/detect-cluster-metadata.injectable.d.ts +5 -0
  13. package/dist/src/main/cluster-detectors/request-cluster-version.injectable.d.ts +3 -0
  14. package/dist/src/main/cluster-detectors/token.d.ts +18 -0
  15. package/dist/src/main/get-metrics.injectable.d.ts +1 -1
  16. package/dist/src/main/k8s-request.injectable.d.ts +6 -3
  17. package/package.json +1 -1
  18. package/dist/src/main/cluster-detectors/base-cluster-detector.d.ts +0 -19
  19. package/dist/src/main/cluster-detectors/create-version-detector.injectable.d.ts +0 -4
  20. package/dist/src/main/cluster-detectors/detector-registry.d.ts +0 -20
  21. package/dist/src/main/cluster-detectors/detector-registry.injectable.d.ts +0 -3
  22. package/dist/src/main/cluster-detectors/distribution-detector.d.ts +0 -34
  23. package/dist/src/main/cluster-detectors/version-detector.d.ts +0 -14
  24. package/dist/src/main/start-main-application/runnables/setup-detector-registry.injectable.d.ts +0 -5
@@ -10753,16 +10753,6 @@ eval("\n\nvar hasOwn = Object.prototype.hasOwnProperty;\nvar toStr = Object.prot
10753
10753
 
10754
10754
  /***/ }),
10755
10755
 
10756
- /***/ "./node_modules/extsprintf/lib/extsprintf.js":
10757
- /*!***************************************************!*\
10758
- !*** ./node_modules/extsprintf/lib/extsprintf.js ***!
10759
- \***************************************************/
10760
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
10761
-
10762
- eval("/*\n * extsprintf.js: extended POSIX-style sprintf\n */\n\nvar mod_assert = __webpack_require__(/*! assert */ \"assert\");\nvar mod_util = __webpack_require__(/*! util */ \"util\");\n\n/*\n * Public interface\n */\nexports.sprintf = jsSprintf;\nexports.printf = jsPrintf;\nexports.fprintf = jsFprintf;\n\n/*\n * Stripped down version of s[n]printf(3c). We make a best effort to throw an\n * exception when given a format string we don't understand, rather than\n * ignoring it, so that we won't break existing programs if/when we go implement\n * the rest of this.\n *\n * This implementation currently supports specifying\n *\t- field alignment ('-' flag),\n * \t- zero-pad ('0' flag)\n *\t- always show numeric sign ('+' flag),\n *\t- field width\n *\t- conversions for strings, decimal integers, and floats (numbers).\n *\t- argument size specifiers. These are all accepted but ignored, since\n *\t Javascript has no notion of the physical size of an argument.\n *\n * Everything else is currently unsupported, most notably precision, unsigned\n * numbers, non-decimal numbers, and characters.\n */\nfunction jsSprintf(ofmt)\n{\n\tvar regex = [\n\t '([^%]*)',\t\t\t\t/* normal text */\n\t '%',\t\t\t\t/* start of format */\n\t '([\\'\\\\-+ #0]*?)',\t\t\t/* flags (optional) */\n\t '([1-9]\\\\d*)?',\t\t\t/* width (optional) */\n\t '(\\\\.([1-9]\\\\d*))?',\t\t/* precision (optional) */\n\t '[lhjztL]*?',\t\t\t/* length mods (ignored) */\n\t '([diouxXfFeEgGaAcCsSp%jr])'\t/* conversion */\n\t].join('');\n\n\tvar re = new RegExp(regex);\n\n\t/* variadic arguments used to fill in conversion specifiers */\n\tvar args = Array.prototype.slice.call(arguments, 1);\n\t/* remaining format string */\n\tvar fmt = ofmt;\n\n\t/* components of the current conversion specifier */\n\tvar flags, width, precision, conversion;\n\tvar left, pad, sign, arg, match;\n\n\t/* return value */\n\tvar ret = '';\n\n\t/* current variadic argument (1-based) */\n\tvar argn = 1;\n\t/* 0-based position in the format string that we've read */\n\tvar posn = 0;\n\t/* 1-based position in the format string of the current conversion */\n\tvar convposn;\n\t/* current conversion specifier */\n\tvar curconv;\n\n\tmod_assert.equal('string', typeof (fmt),\n\t 'first argument must be a format string');\n\n\twhile ((match = re.exec(fmt)) !== null) {\n\t\tret += match[1];\n\t\tfmt = fmt.substring(match[0].length);\n\n\t\t/*\n\t\t * Update flags related to the current conversion specifier's\n\t\t * position so that we can report clear error messages.\n\t\t */\n\t\tcurconv = match[0].substring(match[1].length);\n\t\tconvposn = posn + match[1].length + 1;\n\t\tposn += match[0].length;\n\n\t\tflags = match[2] || '';\n\t\twidth = match[3] || 0;\n\t\tprecision = match[4] || '';\n\t\tconversion = match[6];\n\t\tleft = false;\n\t\tsign = false;\n\t\tpad = ' ';\n\n\t\tif (conversion == '%') {\n\t\t\tret += '%';\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (args.length === 0) {\n\t\t\tthrow (jsError(ofmt, convposn, curconv,\n\t\t\t 'has no matching argument ' +\n\t\t\t '(too few arguments passed)'));\n\t\t}\n\n\t\targ = args.shift();\n\t\targn++;\n\n\t\tif (flags.match(/[\\' #]/)) {\n\t\t\tthrow (jsError(ofmt, convposn, curconv,\n\t\t\t 'uses unsupported flags'));\n\t\t}\n\n\t\tif (precision.length > 0) {\n\t\t\tthrow (jsError(ofmt, convposn, curconv,\n\t\t\t 'uses non-zero precision (not supported)'));\n\t\t}\n\n\t\tif (flags.match(/-/))\n\t\t\tleft = true;\n\n\t\tif (flags.match(/0/))\n\t\t\tpad = '0';\n\n\t\tif (flags.match(/\\+/))\n\t\t\tsign = true;\n\n\t\tswitch (conversion) {\n\t\tcase 's':\n\t\t\tif (arg === undefined || arg === null) {\n\t\t\t\tthrow (jsError(ofmt, convposn, curconv,\n\t\t\t\t 'attempted to print undefined or null ' +\n\t\t\t\t 'as a string (argument ' + argn + ' to ' +\n\t\t\t\t 'sprintf)'));\n\t\t\t}\n\t\t\tret += doPad(pad, width, left, arg.toString());\n\t\t\tbreak;\n\n\t\tcase 'd':\n\t\t\targ = Math.floor(arg);\n\t\t\t/*jsl:fallthru*/\n\t\tcase 'f':\n\t\t\tsign = sign && arg > 0 ? '+' : '';\n\t\t\tret += sign + doPad(pad, width, left,\n\t\t\t arg.toString());\n\t\t\tbreak;\n\n\t\tcase 'x':\n\t\t\tret += doPad(pad, width, left, arg.toString(16));\n\t\t\tbreak;\n\n\t\tcase 'j': /* non-standard */\n\t\t\tif (width === 0)\n\t\t\t\twidth = 10;\n\t\t\tret += mod_util.inspect(arg, false, width);\n\t\t\tbreak;\n\n\t\tcase 'r': /* non-standard */\n\t\t\tret += dumpException(arg);\n\t\t\tbreak;\n\n\t\tdefault:\n\t\t\tthrow (jsError(ofmt, convposn, curconv,\n\t\t\t 'is not supported'));\n\t\t}\n\t}\n\n\tret += fmt;\n\treturn (ret);\n}\n\nfunction jsError(fmtstr, convposn, curconv, reason) {\n\tmod_assert.equal(typeof (fmtstr), 'string');\n\tmod_assert.equal(typeof (curconv), 'string');\n\tmod_assert.equal(typeof (convposn), 'number');\n\tmod_assert.equal(typeof (reason), 'string');\n\treturn (new Error('format string \"' + fmtstr +\n\t '\": conversion specifier \"' + curconv + '\" at character ' +\n\t convposn + ' ' + reason));\n}\n\nfunction jsPrintf() {\n\tvar args = Array.prototype.slice.call(arguments);\n\targs.unshift(process.stdout);\n\tjsFprintf.apply(null, args);\n}\n\nfunction jsFprintf(stream) {\n\tvar args = Array.prototype.slice.call(arguments, 1);\n\treturn (stream.write(jsSprintf.apply(this, args)));\n}\n\nfunction doPad(chr, width, left, str)\n{\n\tvar ret = str;\n\n\twhile (ret.length < width) {\n\t\tif (left)\n\t\t\tret += chr;\n\t\telse\n\t\t\tret = chr + ret;\n\t}\n\n\treturn (ret);\n}\n\n/*\n * This function dumps long stack traces for exceptions having a cause() method.\n * See node-verror for an example.\n */\nfunction dumpException(ex)\n{\n\tvar ret;\n\n\tif (!(ex instanceof Error))\n\t\tthrow (new Error(jsSprintf('invalid type for %%r: %j', ex)));\n\n\t/* Note that V8 prepends \"ex.stack\" with ex.toString(). */\n\tret = 'EXCEPTION: ' + ex.constructor.name + ': ' + ex.stack;\n\n\tif (ex.cause && typeof (ex.cause) === 'function') {\n\t\tvar cex = ex.cause();\n\t\tif (cex) {\n\t\t\tret += '\\nCaused by: ' + dumpException(cex);\n\t\t}\n\t}\n\n\treturn (ret);\n}\n\n\n//# sourceURL=webpack://@k8slens/open-lens/./node_modules/extsprintf/lib/extsprintf.js?");
10763
-
10764
- /***/ }),
10765
-
10766
10756
  /***/ "./node_modules/fast-deep-equal/index.js":
10767
10757
  /*!***********************************************!*\
10768
10758
  !*** ./node_modules/fast-deep-equal/index.js ***!
@@ -12308,7 +12298,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
12308
12298
  \*******************************************/
12309
12299
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
12310
12300
 
12311
- eval("/*\n * lib/jsprim.js: utilities for primitive JavaScript types\n */\n\nvar mod_assert = __webpack_require__(/*! assert-plus */ \"./node_modules/assert-plus/assert.js\");\nvar mod_util = __webpack_require__(/*! util */ \"util\");\n\nvar mod_extsprintf = __webpack_require__(/*! extsprintf */ \"./node_modules/jsprim/node_modules/extsprintf/lib/extsprintf.js\");\nvar mod_verror = __webpack_require__(/*! verror */ \"./node_modules/verror/lib/verror.js\");\nvar mod_jsonschema = __webpack_require__(/*! json-schema */ \"./node_modules/json-schema/lib/validate.js\");\n\n/*\n * Public interface\n */\nexports.deepCopy = deepCopy;\nexports.deepEqual = deepEqual;\nexports.isEmpty = isEmpty;\nexports.hasKey = hasKey;\nexports.forEachKey = forEachKey;\nexports.pluck = pluck;\nexports.flattenObject = flattenObject;\nexports.flattenIter = flattenIter;\nexports.validateJsonObject = validateJsonObjectJS;\nexports.validateJsonObjectJS = validateJsonObjectJS;\nexports.randElt = randElt;\nexports.extraProperties = extraProperties;\nexports.mergeObjects = mergeObjects;\n\nexports.startsWith = startsWith;\nexports.endsWith = endsWith;\n\nexports.parseInteger = parseInteger;\n\nexports.iso8601 = iso8601;\nexports.rfc1123 = rfc1123;\nexports.parseDateTime = parseDateTime;\n\nexports.hrtimediff = hrtimeDiff;\nexports.hrtimeDiff = hrtimeDiff;\nexports.hrtimeAccum = hrtimeAccum;\nexports.hrtimeAdd = hrtimeAdd;\nexports.hrtimeNanosec = hrtimeNanosec;\nexports.hrtimeMicrosec = hrtimeMicrosec;\nexports.hrtimeMillisec = hrtimeMillisec;\n\n\n/*\n * Deep copy an acyclic *basic* Javascript object. This only handles basic\n * scalars (strings, numbers, booleans) and arbitrarily deep arrays and objects\n * containing these. This does *not* handle instances of other classes.\n */\nfunction deepCopy(obj)\n{\n\tvar ret, key;\n\tvar marker = '__deepCopy';\n\n\tif (obj && obj[marker])\n\t\tthrow (new Error('attempted deep copy of cyclic object'));\n\n\tif (obj && obj.constructor == Object) {\n\t\tret = {};\n\t\tobj[marker] = true;\n\n\t\tfor (key in obj) {\n\t\t\tif (key == marker)\n\t\t\t\tcontinue;\n\n\t\t\tret[key] = deepCopy(obj[key]);\n\t\t}\n\n\t\tdelete (obj[marker]);\n\t\treturn (ret);\n\t}\n\n\tif (obj && obj.constructor == Array) {\n\t\tret = [];\n\t\tobj[marker] = true;\n\n\t\tfor (key = 0; key < obj.length; key++)\n\t\t\tret.push(deepCopy(obj[key]));\n\n\t\tdelete (obj[marker]);\n\t\treturn (ret);\n\t}\n\n\t/*\n\t * It must be a primitive type -- just return it.\n\t */\n\treturn (obj);\n}\n\nfunction deepEqual(obj1, obj2)\n{\n\tif (typeof (obj1) != typeof (obj2))\n\t\treturn (false);\n\n\tif (obj1 === null || obj2 === null || typeof (obj1) != 'object')\n\t\treturn (obj1 === obj2);\n\n\tif (obj1.constructor != obj2.constructor)\n\t\treturn (false);\n\n\tvar k;\n\tfor (k in obj1) {\n\t\tif (!obj2.hasOwnProperty(k))\n\t\t\treturn (false);\n\n\t\tif (!deepEqual(obj1[k], obj2[k]))\n\t\t\treturn (false);\n\t}\n\n\tfor (k in obj2) {\n\t\tif (!obj1.hasOwnProperty(k))\n\t\t\treturn (false);\n\t}\n\n\treturn (true);\n}\n\nfunction isEmpty(obj)\n{\n\tvar key;\n\tfor (key in obj)\n\t\treturn (false);\n\treturn (true);\n}\n\nfunction hasKey(obj, key)\n{\n\tmod_assert.equal(typeof (key), 'string');\n\treturn (Object.prototype.hasOwnProperty.call(obj, key));\n}\n\nfunction forEachKey(obj, callback)\n{\n\tfor (var key in obj) {\n\t\tif (hasKey(obj, key)) {\n\t\t\tcallback(key, obj[key]);\n\t\t}\n\t}\n}\n\nfunction pluck(obj, key)\n{\n\tmod_assert.equal(typeof (key), 'string');\n\treturn (pluckv(obj, key));\n}\n\nfunction pluckv(obj, key)\n{\n\tif (obj === null || typeof (obj) !== 'object')\n\t\treturn (undefined);\n\n\tif (obj.hasOwnProperty(key))\n\t\treturn (obj[key]);\n\n\tvar i = key.indexOf('.');\n\tif (i == -1)\n\t\treturn (undefined);\n\n\tvar key1 = key.substr(0, i);\n\tif (!obj.hasOwnProperty(key1))\n\t\treturn (undefined);\n\n\treturn (pluckv(obj[key1], key.substr(i + 1)));\n}\n\n/*\n * Invoke callback(row) for each entry in the array that would be returned by\n * flattenObject(data, depth). This is just like flattenObject(data,\n * depth).forEach(callback), except that the intermediate array is never\n * created.\n */\nfunction flattenIter(data, depth, callback)\n{\n\tdoFlattenIter(data, depth, [], callback);\n}\n\nfunction doFlattenIter(data, depth, accum, callback)\n{\n\tvar each;\n\tvar key;\n\n\tif (depth === 0) {\n\t\teach = accum.slice(0);\n\t\teach.push(data);\n\t\tcallback(each);\n\t\treturn;\n\t}\n\n\tmod_assert.ok(data !== null);\n\tmod_assert.equal(typeof (data), 'object');\n\tmod_assert.equal(typeof (depth), 'number');\n\tmod_assert.ok(depth >= 0);\n\n\tfor (key in data) {\n\t\teach = accum.slice(0);\n\t\teach.push(key);\n\t\tdoFlattenIter(data[key], depth - 1, each, callback);\n\t}\n}\n\nfunction flattenObject(data, depth)\n{\n\tif (depth === 0)\n\t\treturn ([ data ]);\n\n\tmod_assert.ok(data !== null);\n\tmod_assert.equal(typeof (data), 'object');\n\tmod_assert.equal(typeof (depth), 'number');\n\tmod_assert.ok(depth >= 0);\n\n\tvar rv = [];\n\tvar key;\n\n\tfor (key in data) {\n\t\tflattenObject(data[key], depth - 1).forEach(function (p) {\n\t\t\trv.push([ key ].concat(p));\n\t\t});\n\t}\n\n\treturn (rv);\n}\n\nfunction startsWith(str, prefix)\n{\n\treturn (str.substr(0, prefix.length) == prefix);\n}\n\nfunction endsWith(str, suffix)\n{\n\treturn (str.substr(\n\t str.length - suffix.length, suffix.length) == suffix);\n}\n\nfunction iso8601(d)\n{\n\tif (typeof (d) == 'number')\n\t\td = new Date(d);\n\tmod_assert.ok(d.constructor === Date);\n\treturn (mod_extsprintf.sprintf('%4d-%02d-%02dT%02d:%02d:%02d.%03dZ',\n\t d.getUTCFullYear(), d.getUTCMonth() + 1, d.getUTCDate(),\n\t d.getUTCHours(), d.getUTCMinutes(), d.getUTCSeconds(),\n\t d.getUTCMilliseconds()));\n}\n\nvar RFC1123_MONTHS = [\n 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',\n 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];\nvar RFC1123_DAYS = [\n 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];\n\nfunction rfc1123(date) {\n\treturn (mod_extsprintf.sprintf('%s, %02d %s %04d %02d:%02d:%02d GMT',\n\t RFC1123_DAYS[date.getUTCDay()], date.getUTCDate(),\n\t RFC1123_MONTHS[date.getUTCMonth()], date.getUTCFullYear(),\n\t date.getUTCHours(), date.getUTCMinutes(),\n\t date.getUTCSeconds()));\n}\n\n/*\n * Parses a date expressed as a string, as either a number of milliseconds since\n * the epoch or any string format that Date accepts, giving preference to the\n * former where these two sets overlap (e.g., small numbers).\n */\nfunction parseDateTime(str)\n{\n\t/*\n\t * This is irritatingly implicit, but significantly more concise than\n\t * alternatives. The \"+str\" will convert a string containing only a\n\t * number directly to a Number, or NaN for other strings. Thus, if the\n\t * conversion succeeds, we use it (this is the milliseconds-since-epoch\n\t * case). Otherwise, we pass the string directly to the Date\n\t * constructor to parse.\n\t */\n\tvar numeric = +str;\n\tif (!isNaN(numeric)) {\n\t\treturn (new Date(numeric));\n\t} else {\n\t\treturn (new Date(str));\n\t}\n}\n\n\n/*\n * Number.*_SAFE_INTEGER isn't present before node v0.12, so we hardcode\n * the ES6 definitions here, while allowing for them to someday be higher.\n */\nvar MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || 9007199254740991;\nvar MIN_SAFE_INTEGER = Number.MIN_SAFE_INTEGER || -9007199254740991;\n\n\n/*\n * Default options for parseInteger().\n */\nvar PI_DEFAULTS = {\n\tbase: 10,\n\tallowSign: true,\n\tallowPrefix: false,\n\tallowTrailing: false,\n\tallowImprecise: false,\n\ttrimWhitespace: false,\n\tleadingZeroIsOctal: false\n};\n\nvar CP_0 = 0x30;\nvar CP_9 = 0x39;\n\nvar CP_A = 0x41;\nvar CP_B = 0x42;\nvar CP_O = 0x4f;\nvar CP_T = 0x54;\nvar CP_X = 0x58;\nvar CP_Z = 0x5a;\n\nvar CP_a = 0x61;\nvar CP_b = 0x62;\nvar CP_o = 0x6f;\nvar CP_t = 0x74;\nvar CP_x = 0x78;\nvar CP_z = 0x7a;\n\nvar PI_CONV_DEC = 0x30;\nvar PI_CONV_UC = 0x37;\nvar PI_CONV_LC = 0x57;\n\n\n/*\n * A stricter version of parseInt() that provides options for changing what\n * is an acceptable string (for example, disallowing trailing characters).\n */\nfunction parseInteger(str, uopts)\n{\n\tmod_assert.string(str, 'str');\n\tmod_assert.optionalObject(uopts, 'options');\n\n\tvar baseOverride = false;\n\tvar options = PI_DEFAULTS;\n\n\tif (uopts) {\n\t\tbaseOverride = hasKey(uopts, 'base');\n\t\toptions = mergeObjects(options, uopts);\n\t\tmod_assert.number(options.base, 'options.base');\n\t\tmod_assert.ok(options.base >= 2, 'options.base >= 2');\n\t\tmod_assert.ok(options.base <= 36, 'options.base <= 36');\n\t\tmod_assert.bool(options.allowSign, 'options.allowSign');\n\t\tmod_assert.bool(options.allowPrefix, 'options.allowPrefix');\n\t\tmod_assert.bool(options.allowTrailing,\n\t\t 'options.allowTrailing');\n\t\tmod_assert.bool(options.allowImprecise,\n\t\t 'options.allowImprecise');\n\t\tmod_assert.bool(options.trimWhitespace,\n\t\t 'options.trimWhitespace');\n\t\tmod_assert.bool(options.leadingZeroIsOctal,\n\t\t 'options.leadingZeroIsOctal');\n\n\t\tif (options.leadingZeroIsOctal) {\n\t\t\tmod_assert.ok(!baseOverride,\n\t\t\t '\"base\" and \"leadingZeroIsOctal\" are ' +\n\t\t\t 'mutually exclusive');\n\t\t}\n\t}\n\n\tvar c;\n\tvar pbase = -1;\n\tvar base = options.base;\n\tvar start;\n\tvar mult = 1;\n\tvar value = 0;\n\tvar idx = 0;\n\tvar len = str.length;\n\n\t/* Trim any whitespace on the left side. */\n\tif (options.trimWhitespace) {\n\t\twhile (idx < len && isSpace(str.charCodeAt(idx))) {\n\t\t\t++idx;\n\t\t}\n\t}\n\n\t/* Check the number for a leading sign. */\n\tif (options.allowSign) {\n\t\tif (str[idx] === '-') {\n\t\t\tidx += 1;\n\t\t\tmult = -1;\n\t\t} else if (str[idx] === '+') {\n\t\t\tidx += 1;\n\t\t}\n\t}\n\n\t/* Parse the base-indicating prefix if there is one. */\n\tif (str[idx] === '0') {\n\t\tif (options.allowPrefix) {\n\t\t\tpbase = prefixToBase(str.charCodeAt(idx + 1));\n\t\t\tif (pbase !== -1 && (!baseOverride || pbase === base)) {\n\t\t\t\tbase = pbase;\n\t\t\t\tidx += 2;\n\t\t\t}\n\t\t}\n\n\t\tif (pbase === -1 && options.leadingZeroIsOctal) {\n\t\t\tbase = 8;\n\t\t}\n\t}\n\n\t/* Parse the actual digits. */\n\tfor (start = idx; idx < len; ++idx) {\n\t\tc = translateDigit(str.charCodeAt(idx));\n\t\tif (c !== -1 && c < base) {\n\t\t\tvalue *= base;\n\t\t\tvalue += c;\n\t\t} else {\n\t\t\tbreak;\n\t\t}\n\t}\n\n\t/* If we didn't parse any digits, we have an invalid number. */\n\tif (start === idx) {\n\t\treturn (new Error('invalid number: ' + JSON.stringify(str)));\n\t}\n\n\t/* Trim any whitespace on the right side. */\n\tif (options.trimWhitespace) {\n\t\twhile (idx < len && isSpace(str.charCodeAt(idx))) {\n\t\t\t++idx;\n\t\t}\n\t}\n\n\t/* Check for trailing characters. */\n\tif (idx < len && !options.allowTrailing) {\n\t\treturn (new Error('trailing characters after number: ' +\n\t\t JSON.stringify(str.slice(idx))));\n\t}\n\n\t/* If our value is 0, we return now, to avoid returning -0. */\n\tif (value === 0) {\n\t\treturn (0);\n\t}\n\n\t/* Calculate our final value. */\n\tvar result = value * mult;\n\n\t/*\n\t * If the string represents a value that cannot be precisely represented\n\t * by JavaScript, then we want to check that:\n\t *\n\t * - We never increased the value past MAX_SAFE_INTEGER\n\t * - We don't make the result negative and below MIN_SAFE_INTEGER\n\t *\n\t * Because we only ever increment the value during parsing, there's no\n\t * chance of moving past MAX_SAFE_INTEGER and then dropping below it\n\t * again, losing precision in the process. This means that we only need\n\t * to do our checks here, at the end.\n\t */\n\tif (!options.allowImprecise &&\n\t (value > MAX_SAFE_INTEGER || result < MIN_SAFE_INTEGER)) {\n\t\treturn (new Error('number is outside of the supported range: ' +\n\t\t JSON.stringify(str.slice(start, idx))));\n\t}\n\n\treturn (result);\n}\n\n\n/*\n * Interpret a character code as a base-36 digit.\n */\nfunction translateDigit(d)\n{\n\tif (d >= CP_0 && d <= CP_9) {\n\t\t/* '0' to '9' -> 0 to 9 */\n\t\treturn (d - PI_CONV_DEC);\n\t} else if (d >= CP_A && d <= CP_Z) {\n\t\t/* 'A' - 'Z' -> 10 to 35 */\n\t\treturn (d - PI_CONV_UC);\n\t} else if (d >= CP_a && d <= CP_z) {\n\t\t/* 'a' - 'z' -> 10 to 35 */\n\t\treturn (d - PI_CONV_LC);\n\t} else {\n\t\t/* Invalid character code */\n\t\treturn (-1);\n\t}\n}\n\n\n/*\n * Test if a value matches the ECMAScript definition of trimmable whitespace.\n */\nfunction isSpace(c)\n{\n\treturn (c === 0x20) ||\n\t (c >= 0x0009 && c <= 0x000d) ||\n\t (c === 0x00a0) ||\n\t (c === 0x1680) ||\n\t (c === 0x180e) ||\n\t (c >= 0x2000 && c <= 0x200a) ||\n\t (c === 0x2028) ||\n\t (c === 0x2029) ||\n\t (c === 0x202f) ||\n\t (c === 0x205f) ||\n\t (c === 0x3000) ||\n\t (c === 0xfeff);\n}\n\n\n/*\n * Determine which base a character indicates (e.g., 'x' indicates hex).\n */\nfunction prefixToBase(c)\n{\n\tif (c === CP_b || c === CP_B) {\n\t\t/* 0b/0B (binary) */\n\t\treturn (2);\n\t} else if (c === CP_o || c === CP_O) {\n\t\t/* 0o/0O (octal) */\n\t\treturn (8);\n\t} else if (c === CP_t || c === CP_T) {\n\t\t/* 0t/0T (decimal) */\n\t\treturn (10);\n\t} else if (c === CP_x || c === CP_X) {\n\t\t/* 0x/0X (hexadecimal) */\n\t\treturn (16);\n\t} else {\n\t\t/* Not a meaningful character */\n\t\treturn (-1);\n\t}\n}\n\n\nfunction validateJsonObjectJS(schema, input)\n{\n\tvar report = mod_jsonschema.validate(input, schema);\n\n\tif (report.errors.length === 0)\n\t\treturn (null);\n\n\t/* Currently, we only do anything useful with the first error. */\n\tvar error = report.errors[0];\n\n\t/* The failed property is given by a URI with an irrelevant prefix. */\n\tvar propname = error['property'];\n\tvar reason = error['message'].toLowerCase();\n\tvar i, j;\n\n\t/*\n\t * There's at least one case where the property error message is\n\t * confusing at best. We work around this here.\n\t */\n\tif ((i = reason.indexOf('the property ')) != -1 &&\n\t (j = reason.indexOf(' is not defined in the schema and the ' +\n\t 'schema does not allow additional properties')) != -1) {\n\t\ti += 'the property '.length;\n\t\tif (propname === '')\n\t\t\tpropname = reason.substr(i, j - i);\n\t\telse\n\t\t\tpropname = propname + '.' + reason.substr(i, j - i);\n\n\t\treason = 'unsupported property';\n\t}\n\n\tvar rv = new mod_verror.VError('property \"%s\": %s', propname, reason);\n\trv.jsv_details = error;\n\treturn (rv);\n}\n\nfunction randElt(arr)\n{\n\tmod_assert.ok(Array.isArray(arr) && arr.length > 0,\n\t 'randElt argument must be a non-empty array');\n\n\treturn (arr[Math.floor(Math.random() * arr.length)]);\n}\n\nfunction assertHrtime(a)\n{\n\tmod_assert.ok(a[0] >= 0 && a[1] >= 0,\n\t 'negative numbers not allowed in hrtimes');\n\tmod_assert.ok(a[1] < 1e9, 'nanoseconds column overflow');\n}\n\n/*\n * Compute the time elapsed between hrtime readings A and B, where A is later\n * than B. hrtime readings come from Node's process.hrtime(). There is no\n * defined way to represent negative deltas, so it's illegal to diff B from A\n * where the time denoted by B is later than the time denoted by A. If this\n * becomes valuable, we can define a representation and extend the\n * implementation to support it.\n */\nfunction hrtimeDiff(a, b)\n{\n\tassertHrtime(a);\n\tassertHrtime(b);\n\tmod_assert.ok(a[0] > b[0] || (a[0] == b[0] && a[1] >= b[1]),\n\t 'negative differences not allowed');\n\n\tvar rv = [ a[0] - b[0], 0 ];\n\n\tif (a[1] >= b[1]) {\n\t\trv[1] = a[1] - b[1];\n\t} else {\n\t\trv[0]--;\n\t\trv[1] = 1e9 - (b[1] - a[1]);\n\t}\n\n\treturn (rv);\n}\n\n/*\n * Convert a hrtime reading from the array format returned by Node's\n * process.hrtime() into a scalar number of nanoseconds.\n */\nfunction hrtimeNanosec(a)\n{\n\tassertHrtime(a);\n\n\treturn (Math.floor(a[0] * 1e9 + a[1]));\n}\n\n/*\n * Convert a hrtime reading from the array format returned by Node's\n * process.hrtime() into a scalar number of microseconds.\n */\nfunction hrtimeMicrosec(a)\n{\n\tassertHrtime(a);\n\n\treturn (Math.floor(a[0] * 1e6 + a[1] / 1e3));\n}\n\n/*\n * Convert a hrtime reading from the array format returned by Node's\n * process.hrtime() into a scalar number of milliseconds.\n */\nfunction hrtimeMillisec(a)\n{\n\tassertHrtime(a);\n\n\treturn (Math.floor(a[0] * 1e3 + a[1] / 1e6));\n}\n\n/*\n * Add two hrtime readings A and B, overwriting A with the result of the\n * addition. This function is useful for accumulating several hrtime intervals\n * into a counter. Returns A.\n */\nfunction hrtimeAccum(a, b)\n{\n\tassertHrtime(a);\n\tassertHrtime(b);\n\n\t/*\n\t * Accumulate the nanosecond component.\n\t */\n\ta[1] += b[1];\n\tif (a[1] >= 1e9) {\n\t\t/*\n\t\t * The nanosecond component overflowed, so carry to the seconds\n\t\t * field.\n\t\t */\n\t\ta[0]++;\n\t\ta[1] -= 1e9;\n\t}\n\n\t/*\n\t * Accumulate the seconds component.\n\t */\n\ta[0] += b[0];\n\n\treturn (a);\n}\n\n/*\n * Add two hrtime readings A and B, returning the result as a new hrtime array.\n * Does not modify either input argument.\n */\nfunction hrtimeAdd(a, b)\n{\n\tassertHrtime(a);\n\n\tvar rv = [ a[0], a[1] ];\n\n\treturn (hrtimeAccum(rv, b));\n}\n\n\n/*\n * Check an object for unexpected properties. Accepts the object to check, and\n * an array of allowed property names (strings). Returns an array of key names\n * that were found on the object, but did not appear in the list of allowed\n * properties. If no properties were found, the returned array will be of\n * zero length.\n */\nfunction extraProperties(obj, allowed)\n{\n\tmod_assert.ok(typeof (obj) === 'object' && obj !== null,\n\t 'obj argument must be a non-null object');\n\tmod_assert.ok(Array.isArray(allowed),\n\t 'allowed argument must be an array of strings');\n\tfor (var i = 0; i < allowed.length; i++) {\n\t\tmod_assert.ok(typeof (allowed[i]) === 'string',\n\t\t 'allowed argument must be an array of strings');\n\t}\n\n\treturn (Object.keys(obj).filter(function (key) {\n\t\treturn (allowed.indexOf(key) === -1);\n\t}));\n}\n\n/*\n * Given three sets of properties \"provided\" (may be undefined), \"overrides\"\n * (required), and \"defaults\" (may be undefined), construct an object containing\n * the union of these sets with \"overrides\" overriding \"provided\", and\n * \"provided\" overriding \"defaults\". None of the input objects are modified.\n */\nfunction mergeObjects(provided, overrides, defaults)\n{\n\tvar rv, k;\n\n\trv = {};\n\tif (defaults) {\n\t\tfor (k in defaults)\n\t\t\trv[k] = defaults[k];\n\t}\n\n\tif (provided) {\n\t\tfor (k in provided)\n\t\t\trv[k] = provided[k];\n\t}\n\n\tif (overrides) {\n\t\tfor (k in overrides)\n\t\t\trv[k] = overrides[k];\n\t}\n\n\treturn (rv);\n}\n\n\n//# sourceURL=webpack://@k8slens/open-lens/./node_modules/jsprim/lib/jsprim.js?");
12301
+ eval("/*\n * lib/jsprim.js: utilities for primitive JavaScript types\n */\n\nvar mod_assert = __webpack_require__(/*! assert-plus */ \"./node_modules/assert-plus/assert.js\");\nvar mod_util = __webpack_require__(/*! util */ \"util\");\n\nvar mod_extsprintf = __webpack_require__(/*! extsprintf */ \"./node_modules/jsprim/node_modules/extsprintf/lib/extsprintf.js\");\nvar mod_verror = __webpack_require__(/*! verror */ \"./node_modules/jsprim/node_modules/verror/lib/verror.js\");\nvar mod_jsonschema = __webpack_require__(/*! json-schema */ \"./node_modules/json-schema/lib/validate.js\");\n\n/*\n * Public interface\n */\nexports.deepCopy = deepCopy;\nexports.deepEqual = deepEqual;\nexports.isEmpty = isEmpty;\nexports.hasKey = hasKey;\nexports.forEachKey = forEachKey;\nexports.pluck = pluck;\nexports.flattenObject = flattenObject;\nexports.flattenIter = flattenIter;\nexports.validateJsonObject = validateJsonObjectJS;\nexports.validateJsonObjectJS = validateJsonObjectJS;\nexports.randElt = randElt;\nexports.extraProperties = extraProperties;\nexports.mergeObjects = mergeObjects;\n\nexports.startsWith = startsWith;\nexports.endsWith = endsWith;\n\nexports.parseInteger = parseInteger;\n\nexports.iso8601 = iso8601;\nexports.rfc1123 = rfc1123;\nexports.parseDateTime = parseDateTime;\n\nexports.hrtimediff = hrtimeDiff;\nexports.hrtimeDiff = hrtimeDiff;\nexports.hrtimeAccum = hrtimeAccum;\nexports.hrtimeAdd = hrtimeAdd;\nexports.hrtimeNanosec = hrtimeNanosec;\nexports.hrtimeMicrosec = hrtimeMicrosec;\nexports.hrtimeMillisec = hrtimeMillisec;\n\n\n/*\n * Deep copy an acyclic *basic* Javascript object. This only handles basic\n * scalars (strings, numbers, booleans) and arbitrarily deep arrays and objects\n * containing these. This does *not* handle instances of other classes.\n */\nfunction deepCopy(obj)\n{\n\tvar ret, key;\n\tvar marker = '__deepCopy';\n\n\tif (obj && obj[marker])\n\t\tthrow (new Error('attempted deep copy of cyclic object'));\n\n\tif (obj && obj.constructor == Object) {\n\t\tret = {};\n\t\tobj[marker] = true;\n\n\t\tfor (key in obj) {\n\t\t\tif (key == marker)\n\t\t\t\tcontinue;\n\n\t\t\tret[key] = deepCopy(obj[key]);\n\t\t}\n\n\t\tdelete (obj[marker]);\n\t\treturn (ret);\n\t}\n\n\tif (obj && obj.constructor == Array) {\n\t\tret = [];\n\t\tobj[marker] = true;\n\n\t\tfor (key = 0; key < obj.length; key++)\n\t\t\tret.push(deepCopy(obj[key]));\n\n\t\tdelete (obj[marker]);\n\t\treturn (ret);\n\t}\n\n\t/*\n\t * It must be a primitive type -- just return it.\n\t */\n\treturn (obj);\n}\n\nfunction deepEqual(obj1, obj2)\n{\n\tif (typeof (obj1) != typeof (obj2))\n\t\treturn (false);\n\n\tif (obj1 === null || obj2 === null || typeof (obj1) != 'object')\n\t\treturn (obj1 === obj2);\n\n\tif (obj1.constructor != obj2.constructor)\n\t\treturn (false);\n\n\tvar k;\n\tfor (k in obj1) {\n\t\tif (!obj2.hasOwnProperty(k))\n\t\t\treturn (false);\n\n\t\tif (!deepEqual(obj1[k], obj2[k]))\n\t\t\treturn (false);\n\t}\n\n\tfor (k in obj2) {\n\t\tif (!obj1.hasOwnProperty(k))\n\t\t\treturn (false);\n\t}\n\n\treturn (true);\n}\n\nfunction isEmpty(obj)\n{\n\tvar key;\n\tfor (key in obj)\n\t\treturn (false);\n\treturn (true);\n}\n\nfunction hasKey(obj, key)\n{\n\tmod_assert.equal(typeof (key), 'string');\n\treturn (Object.prototype.hasOwnProperty.call(obj, key));\n}\n\nfunction forEachKey(obj, callback)\n{\n\tfor (var key in obj) {\n\t\tif (hasKey(obj, key)) {\n\t\t\tcallback(key, obj[key]);\n\t\t}\n\t}\n}\n\nfunction pluck(obj, key)\n{\n\tmod_assert.equal(typeof (key), 'string');\n\treturn (pluckv(obj, key));\n}\n\nfunction pluckv(obj, key)\n{\n\tif (obj === null || typeof (obj) !== 'object')\n\t\treturn (undefined);\n\n\tif (obj.hasOwnProperty(key))\n\t\treturn (obj[key]);\n\n\tvar i = key.indexOf('.');\n\tif (i == -1)\n\t\treturn (undefined);\n\n\tvar key1 = key.substr(0, i);\n\tif (!obj.hasOwnProperty(key1))\n\t\treturn (undefined);\n\n\treturn (pluckv(obj[key1], key.substr(i + 1)));\n}\n\n/*\n * Invoke callback(row) for each entry in the array that would be returned by\n * flattenObject(data, depth). This is just like flattenObject(data,\n * depth).forEach(callback), except that the intermediate array is never\n * created.\n */\nfunction flattenIter(data, depth, callback)\n{\n\tdoFlattenIter(data, depth, [], callback);\n}\n\nfunction doFlattenIter(data, depth, accum, callback)\n{\n\tvar each;\n\tvar key;\n\n\tif (depth === 0) {\n\t\teach = accum.slice(0);\n\t\teach.push(data);\n\t\tcallback(each);\n\t\treturn;\n\t}\n\n\tmod_assert.ok(data !== null);\n\tmod_assert.equal(typeof (data), 'object');\n\tmod_assert.equal(typeof (depth), 'number');\n\tmod_assert.ok(depth >= 0);\n\n\tfor (key in data) {\n\t\teach = accum.slice(0);\n\t\teach.push(key);\n\t\tdoFlattenIter(data[key], depth - 1, each, callback);\n\t}\n}\n\nfunction flattenObject(data, depth)\n{\n\tif (depth === 0)\n\t\treturn ([ data ]);\n\n\tmod_assert.ok(data !== null);\n\tmod_assert.equal(typeof (data), 'object');\n\tmod_assert.equal(typeof (depth), 'number');\n\tmod_assert.ok(depth >= 0);\n\n\tvar rv = [];\n\tvar key;\n\n\tfor (key in data) {\n\t\tflattenObject(data[key], depth - 1).forEach(function (p) {\n\t\t\trv.push([ key ].concat(p));\n\t\t});\n\t}\n\n\treturn (rv);\n}\n\nfunction startsWith(str, prefix)\n{\n\treturn (str.substr(0, prefix.length) == prefix);\n}\n\nfunction endsWith(str, suffix)\n{\n\treturn (str.substr(\n\t str.length - suffix.length, suffix.length) == suffix);\n}\n\nfunction iso8601(d)\n{\n\tif (typeof (d) == 'number')\n\t\td = new Date(d);\n\tmod_assert.ok(d.constructor === Date);\n\treturn (mod_extsprintf.sprintf('%4d-%02d-%02dT%02d:%02d:%02d.%03dZ',\n\t d.getUTCFullYear(), d.getUTCMonth() + 1, d.getUTCDate(),\n\t d.getUTCHours(), d.getUTCMinutes(), d.getUTCSeconds(),\n\t d.getUTCMilliseconds()));\n}\n\nvar RFC1123_MONTHS = [\n 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',\n 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];\nvar RFC1123_DAYS = [\n 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];\n\nfunction rfc1123(date) {\n\treturn (mod_extsprintf.sprintf('%s, %02d %s %04d %02d:%02d:%02d GMT',\n\t RFC1123_DAYS[date.getUTCDay()], date.getUTCDate(),\n\t RFC1123_MONTHS[date.getUTCMonth()], date.getUTCFullYear(),\n\t date.getUTCHours(), date.getUTCMinutes(),\n\t date.getUTCSeconds()));\n}\n\n/*\n * Parses a date expressed as a string, as either a number of milliseconds since\n * the epoch or any string format that Date accepts, giving preference to the\n * former where these two sets overlap (e.g., small numbers).\n */\nfunction parseDateTime(str)\n{\n\t/*\n\t * This is irritatingly implicit, but significantly more concise than\n\t * alternatives. The \"+str\" will convert a string containing only a\n\t * number directly to a Number, or NaN for other strings. Thus, if the\n\t * conversion succeeds, we use it (this is the milliseconds-since-epoch\n\t * case). Otherwise, we pass the string directly to the Date\n\t * constructor to parse.\n\t */\n\tvar numeric = +str;\n\tif (!isNaN(numeric)) {\n\t\treturn (new Date(numeric));\n\t} else {\n\t\treturn (new Date(str));\n\t}\n}\n\n\n/*\n * Number.*_SAFE_INTEGER isn't present before node v0.12, so we hardcode\n * the ES6 definitions here, while allowing for them to someday be higher.\n */\nvar MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || 9007199254740991;\nvar MIN_SAFE_INTEGER = Number.MIN_SAFE_INTEGER || -9007199254740991;\n\n\n/*\n * Default options for parseInteger().\n */\nvar PI_DEFAULTS = {\n\tbase: 10,\n\tallowSign: true,\n\tallowPrefix: false,\n\tallowTrailing: false,\n\tallowImprecise: false,\n\ttrimWhitespace: false,\n\tleadingZeroIsOctal: false\n};\n\nvar CP_0 = 0x30;\nvar CP_9 = 0x39;\n\nvar CP_A = 0x41;\nvar CP_B = 0x42;\nvar CP_O = 0x4f;\nvar CP_T = 0x54;\nvar CP_X = 0x58;\nvar CP_Z = 0x5a;\n\nvar CP_a = 0x61;\nvar CP_b = 0x62;\nvar CP_o = 0x6f;\nvar CP_t = 0x74;\nvar CP_x = 0x78;\nvar CP_z = 0x7a;\n\nvar PI_CONV_DEC = 0x30;\nvar PI_CONV_UC = 0x37;\nvar PI_CONV_LC = 0x57;\n\n\n/*\n * A stricter version of parseInt() that provides options for changing what\n * is an acceptable string (for example, disallowing trailing characters).\n */\nfunction parseInteger(str, uopts)\n{\n\tmod_assert.string(str, 'str');\n\tmod_assert.optionalObject(uopts, 'options');\n\n\tvar baseOverride = false;\n\tvar options = PI_DEFAULTS;\n\n\tif (uopts) {\n\t\tbaseOverride = hasKey(uopts, 'base');\n\t\toptions = mergeObjects(options, uopts);\n\t\tmod_assert.number(options.base, 'options.base');\n\t\tmod_assert.ok(options.base >= 2, 'options.base >= 2');\n\t\tmod_assert.ok(options.base <= 36, 'options.base <= 36');\n\t\tmod_assert.bool(options.allowSign, 'options.allowSign');\n\t\tmod_assert.bool(options.allowPrefix, 'options.allowPrefix');\n\t\tmod_assert.bool(options.allowTrailing,\n\t\t 'options.allowTrailing');\n\t\tmod_assert.bool(options.allowImprecise,\n\t\t 'options.allowImprecise');\n\t\tmod_assert.bool(options.trimWhitespace,\n\t\t 'options.trimWhitespace');\n\t\tmod_assert.bool(options.leadingZeroIsOctal,\n\t\t 'options.leadingZeroIsOctal');\n\n\t\tif (options.leadingZeroIsOctal) {\n\t\t\tmod_assert.ok(!baseOverride,\n\t\t\t '\"base\" and \"leadingZeroIsOctal\" are ' +\n\t\t\t 'mutually exclusive');\n\t\t}\n\t}\n\n\tvar c;\n\tvar pbase = -1;\n\tvar base = options.base;\n\tvar start;\n\tvar mult = 1;\n\tvar value = 0;\n\tvar idx = 0;\n\tvar len = str.length;\n\n\t/* Trim any whitespace on the left side. */\n\tif (options.trimWhitespace) {\n\t\twhile (idx < len && isSpace(str.charCodeAt(idx))) {\n\t\t\t++idx;\n\t\t}\n\t}\n\n\t/* Check the number for a leading sign. */\n\tif (options.allowSign) {\n\t\tif (str[idx] === '-') {\n\t\t\tidx += 1;\n\t\t\tmult = -1;\n\t\t} else if (str[idx] === '+') {\n\t\t\tidx += 1;\n\t\t}\n\t}\n\n\t/* Parse the base-indicating prefix if there is one. */\n\tif (str[idx] === '0') {\n\t\tif (options.allowPrefix) {\n\t\t\tpbase = prefixToBase(str.charCodeAt(idx + 1));\n\t\t\tif (pbase !== -1 && (!baseOverride || pbase === base)) {\n\t\t\t\tbase = pbase;\n\t\t\t\tidx += 2;\n\t\t\t}\n\t\t}\n\n\t\tif (pbase === -1 && options.leadingZeroIsOctal) {\n\t\t\tbase = 8;\n\t\t}\n\t}\n\n\t/* Parse the actual digits. */\n\tfor (start = idx; idx < len; ++idx) {\n\t\tc = translateDigit(str.charCodeAt(idx));\n\t\tif (c !== -1 && c < base) {\n\t\t\tvalue *= base;\n\t\t\tvalue += c;\n\t\t} else {\n\t\t\tbreak;\n\t\t}\n\t}\n\n\t/* If we didn't parse any digits, we have an invalid number. */\n\tif (start === idx) {\n\t\treturn (new Error('invalid number: ' + JSON.stringify(str)));\n\t}\n\n\t/* Trim any whitespace on the right side. */\n\tif (options.trimWhitespace) {\n\t\twhile (idx < len && isSpace(str.charCodeAt(idx))) {\n\t\t\t++idx;\n\t\t}\n\t}\n\n\t/* Check for trailing characters. */\n\tif (idx < len && !options.allowTrailing) {\n\t\treturn (new Error('trailing characters after number: ' +\n\t\t JSON.stringify(str.slice(idx))));\n\t}\n\n\t/* If our value is 0, we return now, to avoid returning -0. */\n\tif (value === 0) {\n\t\treturn (0);\n\t}\n\n\t/* Calculate our final value. */\n\tvar result = value * mult;\n\n\t/*\n\t * If the string represents a value that cannot be precisely represented\n\t * by JavaScript, then we want to check that:\n\t *\n\t * - We never increased the value past MAX_SAFE_INTEGER\n\t * - We don't make the result negative and below MIN_SAFE_INTEGER\n\t *\n\t * Because we only ever increment the value during parsing, there's no\n\t * chance of moving past MAX_SAFE_INTEGER and then dropping below it\n\t * again, losing precision in the process. This means that we only need\n\t * to do our checks here, at the end.\n\t */\n\tif (!options.allowImprecise &&\n\t (value > MAX_SAFE_INTEGER || result < MIN_SAFE_INTEGER)) {\n\t\treturn (new Error('number is outside of the supported range: ' +\n\t\t JSON.stringify(str.slice(start, idx))));\n\t}\n\n\treturn (result);\n}\n\n\n/*\n * Interpret a character code as a base-36 digit.\n */\nfunction translateDigit(d)\n{\n\tif (d >= CP_0 && d <= CP_9) {\n\t\t/* '0' to '9' -> 0 to 9 */\n\t\treturn (d - PI_CONV_DEC);\n\t} else if (d >= CP_A && d <= CP_Z) {\n\t\t/* 'A' - 'Z' -> 10 to 35 */\n\t\treturn (d - PI_CONV_UC);\n\t} else if (d >= CP_a && d <= CP_z) {\n\t\t/* 'a' - 'z' -> 10 to 35 */\n\t\treturn (d - PI_CONV_LC);\n\t} else {\n\t\t/* Invalid character code */\n\t\treturn (-1);\n\t}\n}\n\n\n/*\n * Test if a value matches the ECMAScript definition of trimmable whitespace.\n */\nfunction isSpace(c)\n{\n\treturn (c === 0x20) ||\n\t (c >= 0x0009 && c <= 0x000d) ||\n\t (c === 0x00a0) ||\n\t (c === 0x1680) ||\n\t (c === 0x180e) ||\n\t (c >= 0x2000 && c <= 0x200a) ||\n\t (c === 0x2028) ||\n\t (c === 0x2029) ||\n\t (c === 0x202f) ||\n\t (c === 0x205f) ||\n\t (c === 0x3000) ||\n\t (c === 0xfeff);\n}\n\n\n/*\n * Determine which base a character indicates (e.g., 'x' indicates hex).\n */\nfunction prefixToBase(c)\n{\n\tif (c === CP_b || c === CP_B) {\n\t\t/* 0b/0B (binary) */\n\t\treturn (2);\n\t} else if (c === CP_o || c === CP_O) {\n\t\t/* 0o/0O (octal) */\n\t\treturn (8);\n\t} else if (c === CP_t || c === CP_T) {\n\t\t/* 0t/0T (decimal) */\n\t\treturn (10);\n\t} else if (c === CP_x || c === CP_X) {\n\t\t/* 0x/0X (hexadecimal) */\n\t\treturn (16);\n\t} else {\n\t\t/* Not a meaningful character */\n\t\treturn (-1);\n\t}\n}\n\n\nfunction validateJsonObjectJS(schema, input)\n{\n\tvar report = mod_jsonschema.validate(input, schema);\n\n\tif (report.errors.length === 0)\n\t\treturn (null);\n\n\t/* Currently, we only do anything useful with the first error. */\n\tvar error = report.errors[0];\n\n\t/* The failed property is given by a URI with an irrelevant prefix. */\n\tvar propname = error['property'];\n\tvar reason = error['message'].toLowerCase();\n\tvar i, j;\n\n\t/*\n\t * There's at least one case where the property error message is\n\t * confusing at best. We work around this here.\n\t */\n\tif ((i = reason.indexOf('the property ')) != -1 &&\n\t (j = reason.indexOf(' is not defined in the schema and the ' +\n\t 'schema does not allow additional properties')) != -1) {\n\t\ti += 'the property '.length;\n\t\tif (propname === '')\n\t\t\tpropname = reason.substr(i, j - i);\n\t\telse\n\t\t\tpropname = propname + '.' + reason.substr(i, j - i);\n\n\t\treason = 'unsupported property';\n\t}\n\n\tvar rv = new mod_verror.VError('property \"%s\": %s', propname, reason);\n\trv.jsv_details = error;\n\treturn (rv);\n}\n\nfunction randElt(arr)\n{\n\tmod_assert.ok(Array.isArray(arr) && arr.length > 0,\n\t 'randElt argument must be a non-empty array');\n\n\treturn (arr[Math.floor(Math.random() * arr.length)]);\n}\n\nfunction assertHrtime(a)\n{\n\tmod_assert.ok(a[0] >= 0 && a[1] >= 0,\n\t 'negative numbers not allowed in hrtimes');\n\tmod_assert.ok(a[1] < 1e9, 'nanoseconds column overflow');\n}\n\n/*\n * Compute the time elapsed between hrtime readings A and B, where A is later\n * than B. hrtime readings come from Node's process.hrtime(). There is no\n * defined way to represent negative deltas, so it's illegal to diff B from A\n * where the time denoted by B is later than the time denoted by A. If this\n * becomes valuable, we can define a representation and extend the\n * implementation to support it.\n */\nfunction hrtimeDiff(a, b)\n{\n\tassertHrtime(a);\n\tassertHrtime(b);\n\tmod_assert.ok(a[0] > b[0] || (a[0] == b[0] && a[1] >= b[1]),\n\t 'negative differences not allowed');\n\n\tvar rv = [ a[0] - b[0], 0 ];\n\n\tif (a[1] >= b[1]) {\n\t\trv[1] = a[1] - b[1];\n\t} else {\n\t\trv[0]--;\n\t\trv[1] = 1e9 - (b[1] - a[1]);\n\t}\n\n\treturn (rv);\n}\n\n/*\n * Convert a hrtime reading from the array format returned by Node's\n * process.hrtime() into a scalar number of nanoseconds.\n */\nfunction hrtimeNanosec(a)\n{\n\tassertHrtime(a);\n\n\treturn (Math.floor(a[0] * 1e9 + a[1]));\n}\n\n/*\n * Convert a hrtime reading from the array format returned by Node's\n * process.hrtime() into a scalar number of microseconds.\n */\nfunction hrtimeMicrosec(a)\n{\n\tassertHrtime(a);\n\n\treturn (Math.floor(a[0] * 1e6 + a[1] / 1e3));\n}\n\n/*\n * Convert a hrtime reading from the array format returned by Node's\n * process.hrtime() into a scalar number of milliseconds.\n */\nfunction hrtimeMillisec(a)\n{\n\tassertHrtime(a);\n\n\treturn (Math.floor(a[0] * 1e3 + a[1] / 1e6));\n}\n\n/*\n * Add two hrtime readings A and B, overwriting A with the result of the\n * addition. This function is useful for accumulating several hrtime intervals\n * into a counter. Returns A.\n */\nfunction hrtimeAccum(a, b)\n{\n\tassertHrtime(a);\n\tassertHrtime(b);\n\n\t/*\n\t * Accumulate the nanosecond component.\n\t */\n\ta[1] += b[1];\n\tif (a[1] >= 1e9) {\n\t\t/*\n\t\t * The nanosecond component overflowed, so carry to the seconds\n\t\t * field.\n\t\t */\n\t\ta[0]++;\n\t\ta[1] -= 1e9;\n\t}\n\n\t/*\n\t * Accumulate the seconds component.\n\t */\n\ta[0] += b[0];\n\n\treturn (a);\n}\n\n/*\n * Add two hrtime readings A and B, returning the result as a new hrtime array.\n * Does not modify either input argument.\n */\nfunction hrtimeAdd(a, b)\n{\n\tassertHrtime(a);\n\n\tvar rv = [ a[0], a[1] ];\n\n\treturn (hrtimeAccum(rv, b));\n}\n\n\n/*\n * Check an object for unexpected properties. Accepts the object to check, and\n * an array of allowed property names (strings). Returns an array of key names\n * that were found on the object, but did not appear in the list of allowed\n * properties. If no properties were found, the returned array will be of\n * zero length.\n */\nfunction extraProperties(obj, allowed)\n{\n\tmod_assert.ok(typeof (obj) === 'object' && obj !== null,\n\t 'obj argument must be a non-null object');\n\tmod_assert.ok(Array.isArray(allowed),\n\t 'allowed argument must be an array of strings');\n\tfor (var i = 0; i < allowed.length; i++) {\n\t\tmod_assert.ok(typeof (allowed[i]) === 'string',\n\t\t 'allowed argument must be an array of strings');\n\t}\n\n\treturn (Object.keys(obj).filter(function (key) {\n\t\treturn (allowed.indexOf(key) === -1);\n\t}));\n}\n\n/*\n * Given three sets of properties \"provided\" (may be undefined), \"overrides\"\n * (required), and \"defaults\" (may be undefined), construct an object containing\n * the union of these sets with \"overrides\" overriding \"provided\", and\n * \"provided\" overriding \"defaults\". None of the input objects are modified.\n */\nfunction mergeObjects(provided, overrides, defaults)\n{\n\tvar rv, k;\n\n\trv = {};\n\tif (defaults) {\n\t\tfor (k in defaults)\n\t\t\trv[k] = defaults[k];\n\t}\n\n\tif (provided) {\n\t\tfor (k in provided)\n\t\t\trv[k] = provided[k];\n\t}\n\n\tif (overrides) {\n\t\tfor (k in overrides)\n\t\t\trv[k] = overrides[k];\n\t}\n\n\treturn (rv);\n}\n\n\n//# sourceURL=webpack://@k8slens/open-lens/./node_modules/jsprim/lib/jsprim.js?");
12312
12302
 
12313
12303
  /***/ }),
12314
12304
 
@@ -12322,6 +12312,26 @@ eval("/*\n * extsprintf.js: extended POSIX-style sprintf\n */\n\nvar mod_assert
12322
12312
 
12323
12313
  /***/ }),
12324
12314
 
12315
+ /***/ "./node_modules/jsprim/node_modules/verror/lib/verror.js":
12316
+ /*!***************************************************************!*\
12317
+ !*** ./node_modules/jsprim/node_modules/verror/lib/verror.js ***!
12318
+ \***************************************************************/
12319
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
12320
+
12321
+ eval("/*\n * verror.js: richer JavaScript errors\n */\n\nvar mod_assertplus = __webpack_require__(/*! assert-plus */ \"./node_modules/assert-plus/assert.js\");\nvar mod_util = __webpack_require__(/*! util */ \"util\");\n\nvar mod_extsprintf = __webpack_require__(/*! extsprintf */ \"./node_modules/jsprim/node_modules/verror/node_modules/extsprintf/lib/extsprintf.js\");\nvar mod_isError = (__webpack_require__(/*! core-util-is */ \"./node_modules/core-util-is/lib/util.js\").isError);\nvar sprintf = mod_extsprintf.sprintf;\n\n/*\n * Public interface\n */\n\n/* So you can 'var VError = require('verror')' */\nmodule.exports = VError;\n/* For compatibility */\nVError.VError = VError;\n/* Other exported classes */\nVError.SError = SError;\nVError.WError = WError;\nVError.MultiError = MultiError;\n\n/*\n * Common function used to parse constructor arguments for VError, WError, and\n * SError. Named arguments to this function:\n *\n * strict\t\tforce strict interpretation of sprintf arguments, even\n * \t\t\tif the options in \"argv\" don't say so\n *\n * argv\t\terror's constructor arguments, which are to be\n * \t\t\tinterpreted as described in README.md. For quick\n * \t\t\treference, \"argv\" has one of the following forms:\n *\n * [ sprintf_args... ] (argv[0] is a string)\n * [ cause, sprintf_args... ] (argv[0] is an Error)\n * [ options, sprintf_args... ] (argv[0] is an object)\n *\n * This function normalizes these forms, producing an object with the following\n * properties:\n *\n * options equivalent to \"options\" in third form. This will never\n * \t\t\tbe a direct reference to what the caller passed in\n * \t\t\t(i.e., it may be a shallow copy), so it can be freely\n * \t\t\tmodified.\n *\n * shortmessage result of sprintf(sprintf_args), taking options.strict\n * \t\t\tinto account as described in README.md.\n */\nfunction parseConstructorArguments(args)\n{\n\tvar argv, options, sprintf_args, shortmessage, k;\n\n\tmod_assertplus.object(args, 'args');\n\tmod_assertplus.bool(args.strict, 'args.strict');\n\tmod_assertplus.array(args.argv, 'args.argv');\n\targv = args.argv;\n\n\t/*\n\t * First, figure out which form of invocation we've been given.\n\t */\n\tif (argv.length === 0) {\n\t\toptions = {};\n\t\tsprintf_args = [];\n\t} else if (mod_isError(argv[0])) {\n\t\toptions = { 'cause': argv[0] };\n\t\tsprintf_args = argv.slice(1);\n\t} else if (typeof (argv[0]) === 'object') {\n\t\toptions = {};\n\t\tfor (k in argv[0]) {\n\t\t\toptions[k] = argv[0][k];\n\t\t}\n\t\tsprintf_args = argv.slice(1);\n\t} else {\n\t\tmod_assertplus.string(argv[0],\n\t\t 'first argument to VError, SError, or WError ' +\n\t\t 'constructor must be a string, object, or Error');\n\t\toptions = {};\n\t\tsprintf_args = argv;\n\t}\n\n\t/*\n\t * Now construct the error's message.\n\t *\n\t * extsprintf (which we invoke here with our caller's arguments in order\n\t * to construct this Error's message) is strict in its interpretation of\n\t * values to be processed by the \"%s\" specifier. The value passed to\n\t * extsprintf must actually be a string or something convertible to a\n\t * String using .toString(). Passing other values (notably \"null\" and\n\t * \"undefined\") is considered a programmer error. The assumption is\n\t * that if you actually want to print the string \"null\" or \"undefined\",\n\t * then that's easy to do that when you're calling extsprintf; on the\n\t * other hand, if you did NOT want that (i.e., there's actually a bug\n\t * where the program assumes some variable is non-null and tries to\n\t * print it, which might happen when constructing a packet or file in\n\t * some specific format), then it's better to stop immediately than\n\t * produce bogus output.\n\t *\n\t * However, sometimes the bug is only in the code calling VError, and a\n\t * programmer might prefer to have the error message contain \"null\" or\n\t * \"undefined\" rather than have the bug in the error path crash the\n\t * program (making the first bug harder to identify). For that reason,\n\t * by default VError converts \"null\" or \"undefined\" arguments to their\n\t * string representations and passes those to extsprintf. Programmers\n\t * desiring the strict behavior can use the SError class or pass the\n\t * \"strict\" option to the VError constructor.\n\t */\n\tmod_assertplus.object(options);\n\tif (!options.strict && !args.strict) {\n\t\tsprintf_args = sprintf_args.map(function (a) {\n\t\t\treturn (a === null ? 'null' :\n\t\t\t a === undefined ? 'undefined' : a);\n\t\t});\n\t}\n\n\tif (sprintf_args.length === 0) {\n\t\tshortmessage = '';\n\t} else {\n\t\tshortmessage = sprintf.apply(null, sprintf_args);\n\t}\n\n\treturn ({\n\t 'options': options,\n\t 'shortmessage': shortmessage\n\t});\n}\n\n/*\n * See README.md for reference documentation.\n */\nfunction VError()\n{\n\tvar args, obj, parsed, cause, ctor, message, k;\n\n\targs = Array.prototype.slice.call(arguments, 0);\n\n\t/*\n\t * This is a regrettable pattern, but JavaScript's built-in Error class\n\t * is defined to work this way, so we allow the constructor to be called\n\t * without \"new\".\n\t */\n\tif (!(this instanceof VError)) {\n\t\tobj = Object.create(VError.prototype);\n\t\tVError.apply(obj, arguments);\n\t\treturn (obj);\n\t}\n\n\t/*\n\t * For convenience and backwards compatibility, we support several\n\t * different calling forms. Normalize them here.\n\t */\n\tparsed = parseConstructorArguments({\n\t 'argv': args,\n\t 'strict': false\n\t});\n\n\t/*\n\t * If we've been given a name, apply it now.\n\t */\n\tif (parsed.options.name) {\n\t\tmod_assertplus.string(parsed.options.name,\n\t\t 'error\\'s \"name\" must be a string');\n\t\tthis.name = parsed.options.name;\n\t}\n\n\t/*\n\t * For debugging, we keep track of the original short message (attached\n\t * this Error particularly) separately from the complete message (which\n\t * includes the messages of our cause chain).\n\t */\n\tthis.jse_shortmsg = parsed.shortmessage;\n\tmessage = parsed.shortmessage;\n\n\t/*\n\t * If we've been given a cause, record a reference to it and update our\n\t * message appropriately.\n\t */\n\tcause = parsed.options.cause;\n\tif (cause) {\n\t\tmod_assertplus.ok(mod_isError(cause), 'cause is not an Error');\n\t\tthis.jse_cause = cause;\n\n\t\tif (!parsed.options.skipCauseMessage) {\n\t\t\tmessage += ': ' + cause.message;\n\t\t}\n\t}\n\n\t/*\n\t * If we've been given an object with properties, shallow-copy that\n\t * here. We don't want to use a deep copy in case there are non-plain\n\t * objects here, but we don't want to use the original object in case\n\t * the caller modifies it later.\n\t */\n\tthis.jse_info = {};\n\tif (parsed.options.info) {\n\t\tfor (k in parsed.options.info) {\n\t\t\tthis.jse_info[k] = parsed.options.info[k];\n\t\t}\n\t}\n\n\tthis.message = message;\n\tError.call(this, message);\n\n\tif (Error.captureStackTrace) {\n\t\tctor = parsed.options.constructorOpt || this.constructor;\n\t\tError.captureStackTrace(this, ctor);\n\t}\n\n\treturn (this);\n}\n\nmod_util.inherits(VError, Error);\nVError.prototype.name = 'VError';\n\nVError.prototype.toString = function ve_toString()\n{\n\tvar str = (this.hasOwnProperty('name') && this.name ||\n\t\tthis.constructor.name || this.constructor.prototype.name);\n\tif (this.message)\n\t\tstr += ': ' + this.message;\n\n\treturn (str);\n};\n\n/*\n * This method is provided for compatibility. New callers should use\n * VError.cause() instead. That method also uses the saner `null` return value\n * when there is no cause.\n */\nVError.prototype.cause = function ve_cause()\n{\n\tvar cause = VError.cause(this);\n\treturn (cause === null ? undefined : cause);\n};\n\n/*\n * Static methods\n *\n * These class-level methods are provided so that callers can use them on\n * instances of Errors that are not VErrors. New interfaces should be provided\n * only using static methods to eliminate the class of programming mistake where\n * people fail to check whether the Error object has the corresponding methods.\n */\n\nVError.cause = function (err)\n{\n\tmod_assertplus.ok(mod_isError(err), 'err must be an Error');\n\treturn (mod_isError(err.jse_cause) ? err.jse_cause : null);\n};\n\nVError.info = function (err)\n{\n\tvar rv, cause, k;\n\n\tmod_assertplus.ok(mod_isError(err), 'err must be an Error');\n\tcause = VError.cause(err);\n\tif (cause !== null) {\n\t\trv = VError.info(cause);\n\t} else {\n\t\trv = {};\n\t}\n\n\tif (typeof (err.jse_info) == 'object' && err.jse_info !== null) {\n\t\tfor (k in err.jse_info) {\n\t\t\trv[k] = err.jse_info[k];\n\t\t}\n\t}\n\n\treturn (rv);\n};\n\nVError.findCauseByName = function (err, name)\n{\n\tvar cause;\n\n\tmod_assertplus.ok(mod_isError(err), 'err must be an Error');\n\tmod_assertplus.string(name, 'name');\n\tmod_assertplus.ok(name.length > 0, 'name cannot be empty');\n\n\tfor (cause = err; cause !== null; cause = VError.cause(cause)) {\n\t\tmod_assertplus.ok(mod_isError(cause));\n\t\tif (cause.name == name) {\n\t\t\treturn (cause);\n\t\t}\n\t}\n\n\treturn (null);\n};\n\nVError.hasCauseWithName = function (err, name)\n{\n\treturn (VError.findCauseByName(err, name) !== null);\n};\n\nVError.fullStack = function (err)\n{\n\tmod_assertplus.ok(mod_isError(err), 'err must be an Error');\n\n\tvar cause = VError.cause(err);\n\n\tif (cause) {\n\t\treturn (err.stack + '\\ncaused by: ' + VError.fullStack(cause));\n\t}\n\n\treturn (err.stack);\n};\n\nVError.errorFromList = function (errors)\n{\n\tmod_assertplus.arrayOfObject(errors, 'errors');\n\n\tif (errors.length === 0) {\n\t\treturn (null);\n\t}\n\n\terrors.forEach(function (e) {\n\t\tmod_assertplus.ok(mod_isError(e));\n\t});\n\n\tif (errors.length == 1) {\n\t\treturn (errors[0]);\n\t}\n\n\treturn (new MultiError(errors));\n};\n\nVError.errorForEach = function (err, func)\n{\n\tmod_assertplus.ok(mod_isError(err), 'err must be an Error');\n\tmod_assertplus.func(func, 'func');\n\n\tif (err instanceof MultiError) {\n\t\terr.errors().forEach(function iterError(e) { func(e); });\n\t} else {\n\t\tfunc(err);\n\t}\n};\n\n\n/*\n * SError is like VError, but stricter about types. You cannot pass \"null\" or\n * \"undefined\" as string arguments to the formatter.\n */\nfunction SError()\n{\n\tvar args, obj, parsed, options;\n\n\targs = Array.prototype.slice.call(arguments, 0);\n\tif (!(this instanceof SError)) {\n\t\tobj = Object.create(SError.prototype);\n\t\tSError.apply(obj, arguments);\n\t\treturn (obj);\n\t}\n\n\tparsed = parseConstructorArguments({\n\t 'argv': args,\n\t 'strict': true\n\t});\n\n\toptions = parsed.options;\n\tVError.call(this, options, '%s', parsed.shortmessage);\n\n\treturn (this);\n}\n\n/*\n * We don't bother setting SError.prototype.name because once constructed,\n * SErrors are just like VErrors.\n */\nmod_util.inherits(SError, VError);\n\n\n/*\n * Represents a collection of errors for the purpose of consumers that generally\n * only deal with one error. Callers can extract the individual errors\n * contained in this object, but may also just treat it as a normal single\n * error, in which case a summary message will be printed.\n */\nfunction MultiError(errors)\n{\n\tmod_assertplus.array(errors, 'list of errors');\n\tmod_assertplus.ok(errors.length > 0, 'must be at least one error');\n\tthis.ase_errors = errors;\n\n\tVError.call(this, {\n\t 'cause': errors[0]\n\t}, 'first of %d error%s', errors.length, errors.length == 1 ? '' : 's');\n}\n\nmod_util.inherits(MultiError, VError);\nMultiError.prototype.name = 'MultiError';\n\nMultiError.prototype.errors = function me_errors()\n{\n\treturn (this.ase_errors.slice(0));\n};\n\n\n/*\n * See README.md for reference details.\n */\nfunction WError()\n{\n\tvar args, obj, parsed, options;\n\n\targs = Array.prototype.slice.call(arguments, 0);\n\tif (!(this instanceof WError)) {\n\t\tobj = Object.create(WError.prototype);\n\t\tWError.apply(obj, args);\n\t\treturn (obj);\n\t}\n\n\tparsed = parseConstructorArguments({\n\t 'argv': args,\n\t 'strict': false\n\t});\n\n\toptions = parsed.options;\n\toptions['skipCauseMessage'] = true;\n\tVError.call(this, options, '%s', parsed.shortmessage);\n\n\treturn (this);\n}\n\nmod_util.inherits(WError, VError);\nWError.prototype.name = 'WError';\n\nWError.prototype.toString = function we_toString()\n{\n\tvar str = (this.hasOwnProperty('name') && this.name ||\n\t\tthis.constructor.name || this.constructor.prototype.name);\n\tif (this.message)\n\t\tstr += ': ' + this.message;\n\tif (this.jse_cause && this.jse_cause.message)\n\t\tstr += '; caused by ' + this.jse_cause.toString();\n\n\treturn (str);\n};\n\n/*\n * For purely historical reasons, WError's cause() function allows you to set\n * the cause.\n */\nWError.prototype.cause = function we_cause(c)\n{\n\tif (mod_isError(c))\n\t\tthis.jse_cause = c;\n\n\treturn (this.jse_cause);\n};\n\n\n//# sourceURL=webpack://@k8slens/open-lens/./node_modules/jsprim/node_modules/verror/lib/verror.js?");
12322
+
12323
+ /***/ }),
12324
+
12325
+ /***/ "./node_modules/jsprim/node_modules/verror/node_modules/extsprintf/lib/extsprintf.js":
12326
+ /*!*******************************************************************************************!*\
12327
+ !*** ./node_modules/jsprim/node_modules/verror/node_modules/extsprintf/lib/extsprintf.js ***!
12328
+ \*******************************************************************************************/
12329
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
12330
+
12331
+ eval("/*\n * extsprintf.js: extended POSIX-style sprintf\n */\n\nvar mod_assert = __webpack_require__(/*! assert */ \"assert\");\nvar mod_util = __webpack_require__(/*! util */ \"util\");\n\n/*\n * Public interface\n */\nexports.sprintf = jsSprintf;\nexports.printf = jsPrintf;\nexports.fprintf = jsFprintf;\n\n/*\n * Stripped down version of s[n]printf(3c). We make a best effort to throw an\n * exception when given a format string we don't understand, rather than\n * ignoring it, so that we won't break existing programs if/when we go implement\n * the rest of this.\n *\n * This implementation currently supports specifying\n *\t- field alignment ('-' flag),\n * \t- zero-pad ('0' flag)\n *\t- always show numeric sign ('+' flag),\n *\t- field width\n *\t- conversions for strings, decimal integers, and floats (numbers).\n *\t- argument size specifiers. These are all accepted but ignored, since\n *\t Javascript has no notion of the physical size of an argument.\n *\n * Everything else is currently unsupported, most notably precision, unsigned\n * numbers, non-decimal numbers, and characters.\n */\nfunction jsSprintf(ofmt)\n{\n\tvar regex = [\n\t '([^%]*)',\t\t\t\t/* normal text */\n\t '%',\t\t\t\t/* start of format */\n\t '([\\'\\\\-+ #0]*?)',\t\t\t/* flags (optional) */\n\t '([1-9]\\\\d*)?',\t\t\t/* width (optional) */\n\t '(\\\\.([1-9]\\\\d*))?',\t\t/* precision (optional) */\n\t '[lhjztL]*?',\t\t\t/* length mods (ignored) */\n\t '([diouxXfFeEgGaAcCsSp%jr])'\t/* conversion */\n\t].join('');\n\n\tvar re = new RegExp(regex);\n\n\t/* variadic arguments used to fill in conversion specifiers */\n\tvar args = Array.prototype.slice.call(arguments, 1);\n\t/* remaining format string */\n\tvar fmt = ofmt;\n\n\t/* components of the current conversion specifier */\n\tvar flags, width, precision, conversion;\n\tvar left, pad, sign, arg, match;\n\n\t/* return value */\n\tvar ret = '';\n\n\t/* current variadic argument (1-based) */\n\tvar argn = 1;\n\t/* 0-based position in the format string that we've read */\n\tvar posn = 0;\n\t/* 1-based position in the format string of the current conversion */\n\tvar convposn;\n\t/* current conversion specifier */\n\tvar curconv;\n\n\tmod_assert.equal('string', typeof (fmt),\n\t 'first argument must be a format string');\n\n\twhile ((match = re.exec(fmt)) !== null) {\n\t\tret += match[1];\n\t\tfmt = fmt.substring(match[0].length);\n\n\t\t/*\n\t\t * Update flags related to the current conversion specifier's\n\t\t * position so that we can report clear error messages.\n\t\t */\n\t\tcurconv = match[0].substring(match[1].length);\n\t\tconvposn = posn + match[1].length + 1;\n\t\tposn += match[0].length;\n\n\t\tflags = match[2] || '';\n\t\twidth = match[3] || 0;\n\t\tprecision = match[4] || '';\n\t\tconversion = match[6];\n\t\tleft = false;\n\t\tsign = false;\n\t\tpad = ' ';\n\n\t\tif (conversion == '%') {\n\t\t\tret += '%';\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (args.length === 0) {\n\t\t\tthrow (jsError(ofmt, convposn, curconv,\n\t\t\t 'has no matching argument ' +\n\t\t\t '(too few arguments passed)'));\n\t\t}\n\n\t\targ = args.shift();\n\t\targn++;\n\n\t\tif (flags.match(/[\\' #]/)) {\n\t\t\tthrow (jsError(ofmt, convposn, curconv,\n\t\t\t 'uses unsupported flags'));\n\t\t}\n\n\t\tif (precision.length > 0) {\n\t\t\tthrow (jsError(ofmt, convposn, curconv,\n\t\t\t 'uses non-zero precision (not supported)'));\n\t\t}\n\n\t\tif (flags.match(/-/))\n\t\t\tleft = true;\n\n\t\tif (flags.match(/0/))\n\t\t\tpad = '0';\n\n\t\tif (flags.match(/\\+/))\n\t\t\tsign = true;\n\n\t\tswitch (conversion) {\n\t\tcase 's':\n\t\t\tif (arg === undefined || arg === null) {\n\t\t\t\tthrow (jsError(ofmt, convposn, curconv,\n\t\t\t\t 'attempted to print undefined or null ' +\n\t\t\t\t 'as a string (argument ' + argn + ' to ' +\n\t\t\t\t 'sprintf)'));\n\t\t\t}\n\t\t\tret += doPad(pad, width, left, arg.toString());\n\t\t\tbreak;\n\n\t\tcase 'd':\n\t\t\targ = Math.floor(arg);\n\t\t\t/*jsl:fallthru*/\n\t\tcase 'f':\n\t\t\tsign = sign && arg > 0 ? '+' : '';\n\t\t\tret += sign + doPad(pad, width, left,\n\t\t\t arg.toString());\n\t\t\tbreak;\n\n\t\tcase 'x':\n\t\t\tret += doPad(pad, width, left, arg.toString(16));\n\t\t\tbreak;\n\n\t\tcase 'j': /* non-standard */\n\t\t\tif (width === 0)\n\t\t\t\twidth = 10;\n\t\t\tret += mod_util.inspect(arg, false, width);\n\t\t\tbreak;\n\n\t\tcase 'r': /* non-standard */\n\t\t\tret += dumpException(arg);\n\t\t\tbreak;\n\n\t\tdefault:\n\t\t\tthrow (jsError(ofmt, convposn, curconv,\n\t\t\t 'is not supported'));\n\t\t}\n\t}\n\n\tret += fmt;\n\treturn (ret);\n}\n\nfunction jsError(fmtstr, convposn, curconv, reason) {\n\tmod_assert.equal(typeof (fmtstr), 'string');\n\tmod_assert.equal(typeof (curconv), 'string');\n\tmod_assert.equal(typeof (convposn), 'number');\n\tmod_assert.equal(typeof (reason), 'string');\n\treturn (new Error('format string \"' + fmtstr +\n\t '\": conversion specifier \"' + curconv + '\" at character ' +\n\t convposn + ' ' + reason));\n}\n\nfunction jsPrintf() {\n\tvar args = Array.prototype.slice.call(arguments);\n\targs.unshift(process.stdout);\n\tjsFprintf.apply(null, args);\n}\n\nfunction jsFprintf(stream) {\n\tvar args = Array.prototype.slice.call(arguments, 1);\n\treturn (stream.write(jsSprintf.apply(this, args)));\n}\n\nfunction doPad(chr, width, left, str)\n{\n\tvar ret = str;\n\n\twhile (ret.length < width) {\n\t\tif (left)\n\t\t\tret += chr;\n\t\telse\n\t\t\tret = chr + ret;\n\t}\n\n\treturn (ret);\n}\n\n/*\n * This function dumps long stack traces for exceptions having a cause() method.\n * See node-verror for an example.\n */\nfunction dumpException(ex)\n{\n\tvar ret;\n\n\tif (!(ex instanceof Error))\n\t\tthrow (new Error(jsSprintf('invalid type for %%r: %j', ex)));\n\n\t/* Note that V8 prepends \"ex.stack\" with ex.toString(). */\n\tret = 'EXCEPTION: ' + ex.constructor.name + ': ' + ex.stack;\n\n\tif (ex.cause && typeof (ex.cause) === 'function') {\n\t\tvar cex = ex.cause();\n\t\tif (cex) {\n\t\t\tret += '\\nCaused by: ' + dumpException(cex);\n\t\t}\n\t}\n\n\treturn (ret);\n}\n\n\n//# sourceURL=webpack://@k8slens/open-lens/./node_modules/jsprim/node_modules/verror/node_modules/extsprintf/lib/extsprintf.js?");
12332
+
12333
+ /***/ }),
12334
+
12325
12335
  /***/ "./node_modules/jss-plugin-camel-case/dist/jss-plugin-camel-case.esm.js":
12326
12336
  /*!******************************************************************************!*\
12327
12337
  !*** ./node_modules/jss-plugin-camel-case/dist/jss-plugin-camel-case.esm.js ***!
@@ -24368,7 +24378,7 @@ eval("\n\nvar caseless = __webpack_require__(/*! caseless */ \"./node_modules/ca
24368
24378
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
24369
24379
 
24370
24380
  "use strict";
24371
- eval("\n\nvar tough = __webpack_require__(/*! tough-cookie */ \"./node_modules/tough-cookie/lib/cookie.js\")\n\nvar Cookie = tough.Cookie\nvar CookieJar = tough.CookieJar\n\nexports.parse = function (str) {\n if (str && str.uri) {\n str = str.uri\n }\n if (typeof str !== 'string') {\n throw new Error('The cookie function only accepts STRING as param')\n }\n return Cookie.parse(str, {loose: true})\n}\n\n// Adapt the sometimes-Async api of tough.CookieJar to our requirements\nfunction RequestJar (store) {\n var self = this\n self._jar = new CookieJar(store, {looseMode: true})\n}\nRequestJar.prototype.setCookie = function (cookieOrStr, uri, options) {\n var self = this\n return self._jar.setCookieSync(cookieOrStr, uri, options || {})\n}\nRequestJar.prototype.getCookieString = function (uri) {\n var self = this\n return self._jar.getCookieStringSync(uri)\n}\nRequestJar.prototype.getCookies = function (uri) {\n var self = this\n return self._jar.getCookiesSync(uri)\n}\n\nexports.jar = function (store) {\n return new RequestJar(store)\n}\n\n\n//# sourceURL=webpack://@k8slens/open-lens/./node_modules/request/lib/cookies.js?");
24381
+ eval("\n\nvar tough = __webpack_require__(/*! tough-cookie */ \"./node_modules/request/node_modules/tough-cookie/lib/cookie.js\")\n\nvar Cookie = tough.Cookie\nvar CookieJar = tough.CookieJar\n\nexports.parse = function (str) {\n if (str && str.uri) {\n str = str.uri\n }\n if (typeof str !== 'string') {\n throw new Error('The cookie function only accepts STRING as param')\n }\n return Cookie.parse(str, {loose: true})\n}\n\n// Adapt the sometimes-Async api of tough.CookieJar to our requirements\nfunction RequestJar (store) {\n var self = this\n self._jar = new CookieJar(store, {looseMode: true})\n}\nRequestJar.prototype.setCookie = function (cookieOrStr, uri, options) {\n var self = this\n return self._jar.setCookieSync(cookieOrStr, uri, options || {})\n}\nRequestJar.prototype.getCookieString = function (uri) {\n var self = this\n return self._jar.getCookieStringSync(uri)\n}\nRequestJar.prototype.getCookies = function (uri) {\n var self = this\n return self._jar.getCookiesSync(uri)\n}\n\nexports.jar = function (store) {\n return new RequestJar(store)\n}\n\n\n//# sourceURL=webpack://@k8slens/open-lens/./node_modules/request/lib/cookies.js?");
24372
24382
 
24373
24383
  /***/ }),
24374
24384
 
@@ -24536,6 +24546,82 @@ eval("\n\nvar has = Object.prototype.hasOwnProperty;\n\nvar hexTable = (function
24536
24546
 
24537
24547
  /***/ }),
24538
24548
 
24549
+ /***/ "./node_modules/request/node_modules/tough-cookie/lib/cookie.js":
24550
+ /*!**********************************************************************!*\
24551
+ !*** ./node_modules/request/node_modules/tough-cookie/lib/cookie.js ***!
24552
+ \**********************************************************************/
24553
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
24554
+
24555
+ "use strict";
24556
+ eval("/*!\n * Copyright (c) 2015, Salesforce.com, Inc.\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * 1. Redistributions of source code must retain the above copyright notice,\n * this list of conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following disclaimer in the documentation\n * and/or other materials provided with the distribution.\n *\n * 3. Neither the name of Salesforce.com nor the names of its contributors may\n * be used to endorse or promote products derived from this software without\n * specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n */\n\nvar net = __webpack_require__(/*! net */ \"net\");\nvar urlParse = (__webpack_require__(/*! url */ \"url\").parse);\nvar util = __webpack_require__(/*! util */ \"util\");\nvar pubsuffix = __webpack_require__(/*! ./pubsuffix-psl */ \"./node_modules/request/node_modules/tough-cookie/lib/pubsuffix-psl.js\");\nvar Store = (__webpack_require__(/*! ./store */ \"./node_modules/request/node_modules/tough-cookie/lib/store.js\").Store);\nvar MemoryCookieStore = (__webpack_require__(/*! ./memstore */ \"./node_modules/request/node_modules/tough-cookie/lib/memstore.js\").MemoryCookieStore);\nvar pathMatch = (__webpack_require__(/*! ./pathMatch */ \"./node_modules/request/node_modules/tough-cookie/lib/pathMatch.js\").pathMatch);\nvar VERSION = __webpack_require__(/*! ./version */ \"./node_modules/request/node_modules/tough-cookie/lib/version.js\");\n\nvar punycode;\ntry {\n punycode = __webpack_require__(/*! punycode */ \"punycode\");\n} catch(e) {\n console.warn(\"tough-cookie: can't load punycode; won't use punycode for domain normalization\");\n}\n\n// From RFC6265 S4.1.1\n// note that it excludes \\x3B \";\"\nvar COOKIE_OCTETS = /^[\\x21\\x23-\\x2B\\x2D-\\x3A\\x3C-\\x5B\\x5D-\\x7E]+$/;\n\nvar CONTROL_CHARS = /[\\x00-\\x1F]/;\n\n// From Chromium // '\\r', '\\n' and '\\0' should be treated as a terminator in\n// the \"relaxed\" mode, see:\n// https://github.com/ChromiumWebApps/chromium/blob/b3d3b4da8bb94c1b2e061600df106d590fda3620/net/cookies/parsed_cookie.cc#L60\nvar TERMINATORS = ['\\n', '\\r', '\\0'];\n\n// RFC6265 S4.1.1 defines path value as 'any CHAR except CTLs or \";\"'\n// Note ';' is \\x3B\nvar PATH_VALUE = /[\\x20-\\x3A\\x3C-\\x7E]+/;\n\n// date-time parsing constants (RFC6265 S5.1.1)\n\nvar DATE_DELIM = /[\\x09\\x20-\\x2F\\x3B-\\x40\\x5B-\\x60\\x7B-\\x7E]/;\n\nvar MONTH_TO_NUM = {\n jan:0, feb:1, mar:2, apr:3, may:4, jun:5,\n jul:6, aug:7, sep:8, oct:9, nov:10, dec:11\n};\nvar NUM_TO_MONTH = [\n 'Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'\n];\nvar NUM_TO_DAY = [\n 'Sun','Mon','Tue','Wed','Thu','Fri','Sat'\n];\n\nvar MAX_TIME = 2147483647000; // 31-bit max\nvar MIN_TIME = 0; // 31-bit min\n\n/*\n * Parses a Natural number (i.e., non-negative integer) with either the\n * <min>*<max>DIGIT ( non-digit *OCTET )\n * or\n * <min>*<max>DIGIT\n * grammar (RFC6265 S5.1.1).\n *\n * The \"trailingOK\" boolean controls if the grammar accepts a\n * \"( non-digit *OCTET )\" trailer.\n */\nfunction parseDigits(token, minDigits, maxDigits, trailingOK) {\n var count = 0;\n while (count < token.length) {\n var c = token.charCodeAt(count);\n // \"non-digit = %x00-2F / %x3A-FF\"\n if (c <= 0x2F || c >= 0x3A) {\n break;\n }\n count++;\n }\n\n // constrain to a minimum and maximum number of digits.\n if (count < minDigits || count > maxDigits) {\n return null;\n }\n\n if (!trailingOK && count != token.length) {\n return null;\n }\n\n return parseInt(token.substr(0,count), 10);\n}\n\nfunction parseTime(token) {\n var parts = token.split(':');\n var result = [0,0,0];\n\n /* RF6256 S5.1.1:\n * time = hms-time ( non-digit *OCTET )\n * hms-time = time-field \":\" time-field \":\" time-field\n * time-field = 1*2DIGIT\n */\n\n if (parts.length !== 3) {\n return null;\n }\n\n for (var i = 0; i < 3; i++) {\n // \"time-field\" must be strictly \"1*2DIGIT\", HOWEVER, \"hms-time\" can be\n // followed by \"( non-digit *OCTET )\" so therefore the last time-field can\n // have a trailer\n var trailingOK = (i == 2);\n var num = parseDigits(parts[i], 1, 2, trailingOK);\n if (num === null) {\n return null;\n }\n result[i] = num;\n }\n\n return result;\n}\n\nfunction parseMonth(token) {\n token = String(token).substr(0,3).toLowerCase();\n var num = MONTH_TO_NUM[token];\n return num >= 0 ? num : null;\n}\n\n/*\n * RFC6265 S5.1.1 date parser (see RFC for full grammar)\n */\nfunction parseDate(str) {\n if (!str) {\n return;\n }\n\n /* RFC6265 S5.1.1:\n * 2. Process each date-token sequentially in the order the date-tokens\n * appear in the cookie-date\n */\n var tokens = str.split(DATE_DELIM);\n if (!tokens) {\n return;\n }\n\n var hour = null;\n var minute = null;\n var second = null;\n var dayOfMonth = null;\n var month = null;\n var year = null;\n\n for (var i=0; i<tokens.length; i++) {\n var token = tokens[i].trim();\n if (!token.length) {\n continue;\n }\n\n var result;\n\n /* 2.1. If the found-time flag is not set and the token matches the time\n * production, set the found-time flag and set the hour- value,\n * minute-value, and second-value to the numbers denoted by the digits in\n * the date-token, respectively. Skip the remaining sub-steps and continue\n * to the next date-token.\n */\n if (second === null) {\n result = parseTime(token);\n if (result) {\n hour = result[0];\n minute = result[1];\n second = result[2];\n continue;\n }\n }\n\n /* 2.2. If the found-day-of-month flag is not set and the date-token matches\n * the day-of-month production, set the found-day-of- month flag and set\n * the day-of-month-value to the number denoted by the date-token. Skip\n * the remaining sub-steps and continue to the next date-token.\n */\n if (dayOfMonth === null) {\n // \"day-of-month = 1*2DIGIT ( non-digit *OCTET )\"\n result = parseDigits(token, 1, 2, true);\n if (result !== null) {\n dayOfMonth = result;\n continue;\n }\n }\n\n /* 2.3. If the found-month flag is not set and the date-token matches the\n * month production, set the found-month flag and set the month-value to\n * the month denoted by the date-token. Skip the remaining sub-steps and\n * continue to the next date-token.\n */\n if (month === null) {\n result = parseMonth(token);\n if (result !== null) {\n month = result;\n continue;\n }\n }\n\n /* 2.4. If the found-year flag is not set and the date-token matches the\n * year production, set the found-year flag and set the year-value to the\n * number denoted by the date-token. Skip the remaining sub-steps and\n * continue to the next date-token.\n */\n if (year === null) {\n // \"year = 2*4DIGIT ( non-digit *OCTET )\"\n result = parseDigits(token, 2, 4, true);\n if (result !== null) {\n year = result;\n /* From S5.1.1:\n * 3. If the year-value is greater than or equal to 70 and less\n * than or equal to 99, increment the year-value by 1900.\n * 4. If the year-value is greater than or equal to 0 and less\n * than or equal to 69, increment the year-value by 2000.\n */\n if (year >= 70 && year <= 99) {\n year += 1900;\n } else if (year >= 0 && year <= 69) {\n year += 2000;\n }\n }\n }\n }\n\n /* RFC 6265 S5.1.1\n * \"5. Abort these steps and fail to parse the cookie-date if:\n * * at least one of the found-day-of-month, found-month, found-\n * year, or found-time flags is not set,\n * * the day-of-month-value is less than 1 or greater than 31,\n * * the year-value is less than 1601,\n * * the hour-value is greater than 23,\n * * the minute-value is greater than 59, or\n * * the second-value is greater than 59.\n * (Note that leap seconds cannot be represented in this syntax.)\"\n *\n * So, in order as above:\n */\n if (\n dayOfMonth === null || month === null || year === null || second === null ||\n dayOfMonth < 1 || dayOfMonth > 31 ||\n year < 1601 ||\n hour > 23 ||\n minute > 59 ||\n second > 59\n ) {\n return;\n }\n\n return new Date(Date.UTC(year, month, dayOfMonth, hour, minute, second));\n}\n\nfunction formatDate(date) {\n var d = date.getUTCDate(); d = d >= 10 ? d : '0'+d;\n var h = date.getUTCHours(); h = h >= 10 ? h : '0'+h;\n var m = date.getUTCMinutes(); m = m >= 10 ? m : '0'+m;\n var s = date.getUTCSeconds(); s = s >= 10 ? s : '0'+s;\n return NUM_TO_DAY[date.getUTCDay()] + ', ' +\n d+' '+ NUM_TO_MONTH[date.getUTCMonth()] +' '+ date.getUTCFullYear() +' '+\n h+':'+m+':'+s+' GMT';\n}\n\n// S5.1.2 Canonicalized Host Names\nfunction canonicalDomain(str) {\n if (str == null) {\n return null;\n }\n str = str.trim().replace(/^\\./,''); // S4.1.2.3 & S5.2.3: ignore leading .\n\n // convert to IDN if any non-ASCII characters\n if (punycode && /[^\\u0001-\\u007f]/.test(str)) {\n str = punycode.toASCII(str);\n }\n\n return str.toLowerCase();\n}\n\n// S5.1.3 Domain Matching\nfunction domainMatch(str, domStr, canonicalize) {\n if (str == null || domStr == null) {\n return null;\n }\n if (canonicalize !== false) {\n str = canonicalDomain(str);\n domStr = canonicalDomain(domStr);\n }\n\n /*\n * \"The domain string and the string are identical. (Note that both the\n * domain string and the string will have been canonicalized to lower case at\n * this point)\"\n */\n if (str == domStr) {\n return true;\n }\n\n /* \"All of the following [three] conditions hold:\" (order adjusted from the RFC) */\n\n /* \"* The string is a host name (i.e., not an IP address).\" */\n if (net.isIP(str)) {\n return false;\n }\n\n /* \"* The domain string is a suffix of the string\" */\n var idx = str.indexOf(domStr);\n if (idx <= 0) {\n return false; // it's a non-match (-1) or prefix (0)\n }\n\n // e.g \"a.b.c\".indexOf(\"b.c\") === 2\n // 5 === 3+2\n if (str.length !== domStr.length + idx) { // it's not a suffix\n return false;\n }\n\n /* \"* The last character of the string that is not included in the domain\n * string is a %x2E (\".\") character.\" */\n if (str.substr(idx-1,1) !== '.') {\n return false;\n }\n\n return true;\n}\n\n\n// RFC6265 S5.1.4 Paths and Path-Match\n\n/*\n * \"The user agent MUST use an algorithm equivalent to the following algorithm\n * to compute the default-path of a cookie:\"\n *\n * Assumption: the path (and not query part or absolute uri) is passed in.\n */\nfunction defaultPath(path) {\n // \"2. If the uri-path is empty or if the first character of the uri-path is not\n // a %x2F (\"/\") character, output %x2F (\"/\") and skip the remaining steps.\n if (!path || path.substr(0,1) !== \"/\") {\n return \"/\";\n }\n\n // \"3. If the uri-path contains no more than one %x2F (\"/\") character, output\n // %x2F (\"/\") and skip the remaining step.\"\n if (path === \"/\") {\n return path;\n }\n\n var rightSlash = path.lastIndexOf(\"/\");\n if (rightSlash === 0) {\n return \"/\";\n }\n\n // \"4. Output the characters of the uri-path from the first character up to,\n // but not including, the right-most %x2F (\"/\").\"\n return path.slice(0, rightSlash);\n}\n\nfunction trimTerminator(str) {\n for (var t = 0; t < TERMINATORS.length; t++) {\n var terminatorIdx = str.indexOf(TERMINATORS[t]);\n if (terminatorIdx !== -1) {\n str = str.substr(0,terminatorIdx);\n }\n }\n\n return str;\n}\n\nfunction parseCookiePair(cookiePair, looseMode) {\n cookiePair = trimTerminator(cookiePair);\n\n var firstEq = cookiePair.indexOf('=');\n if (looseMode) {\n if (firstEq === 0) { // '=' is immediately at start\n cookiePair = cookiePair.substr(1);\n firstEq = cookiePair.indexOf('='); // might still need to split on '='\n }\n } else { // non-loose mode\n if (firstEq <= 0) { // no '=' or is at start\n return; // needs to have non-empty \"cookie-name\"\n }\n }\n\n var cookieName, cookieValue;\n if (firstEq <= 0) {\n cookieName = \"\";\n cookieValue = cookiePair.trim();\n } else {\n cookieName = cookiePair.substr(0, firstEq).trim();\n cookieValue = cookiePair.substr(firstEq+1).trim();\n }\n\n if (CONTROL_CHARS.test(cookieName) || CONTROL_CHARS.test(cookieValue)) {\n return;\n }\n\n var c = new Cookie();\n c.key = cookieName;\n c.value = cookieValue;\n return c;\n}\n\nfunction parse(str, options) {\n if (!options || typeof options !== 'object') {\n options = {};\n }\n str = str.trim();\n\n // We use a regex to parse the \"name-value-pair\" part of S5.2\n var firstSemi = str.indexOf(';'); // S5.2 step 1\n var cookiePair = (firstSemi === -1) ? str : str.substr(0, firstSemi);\n var c = parseCookiePair(cookiePair, !!options.loose);\n if (!c) {\n return;\n }\n\n if (firstSemi === -1) {\n return c;\n }\n\n // S5.2.3 \"unparsed-attributes consist of the remainder of the set-cookie-string\n // (including the %x3B (\";\") in question).\" plus later on in the same section\n // \"discard the first \";\" and trim\".\n var unparsed = str.slice(firstSemi + 1).trim();\n\n // \"If the unparsed-attributes string is empty, skip the rest of these\n // steps.\"\n if (unparsed.length === 0) {\n return c;\n }\n\n /*\n * S5.2 says that when looping over the items \"[p]rocess the attribute-name\n * and attribute-value according to the requirements in the following\n * subsections\" for every item. Plus, for many of the individual attributes\n * in S5.3 it says to use the \"attribute-value of the last attribute in the\n * cookie-attribute-list\". Therefore, in this implementation, we overwrite\n * the previous value.\n */\n var cookie_avs = unparsed.split(';');\n while (cookie_avs.length) {\n var av = cookie_avs.shift().trim();\n if (av.length === 0) { // happens if \";;\" appears\n continue;\n }\n var av_sep = av.indexOf('=');\n var av_key, av_value;\n\n if (av_sep === -1) {\n av_key = av;\n av_value = null;\n } else {\n av_key = av.substr(0,av_sep);\n av_value = av.substr(av_sep+1);\n }\n\n av_key = av_key.trim().toLowerCase();\n\n if (av_value) {\n av_value = av_value.trim();\n }\n\n switch(av_key) {\n case 'expires': // S5.2.1\n if (av_value) {\n var exp = parseDate(av_value);\n // \"If the attribute-value failed to parse as a cookie date, ignore the\n // cookie-av.\"\n if (exp) {\n // over and underflow not realistically a concern: V8's getTime() seems to\n // store something larger than a 32-bit time_t (even with 32-bit node)\n c.expires = exp;\n }\n }\n break;\n\n case 'max-age': // S5.2.2\n if (av_value) {\n // \"If the first character of the attribute-value is not a DIGIT or a \"-\"\n // character ...[or]... If the remainder of attribute-value contains a\n // non-DIGIT character, ignore the cookie-av.\"\n if (/^-?[0-9]+$/.test(av_value)) {\n var delta = parseInt(av_value, 10);\n // \"If delta-seconds is less than or equal to zero (0), let expiry-time\n // be the earliest representable date and time.\"\n c.setMaxAge(delta);\n }\n }\n break;\n\n case 'domain': // S5.2.3\n // \"If the attribute-value is empty, the behavior is undefined. However,\n // the user agent SHOULD ignore the cookie-av entirely.\"\n if (av_value) {\n // S5.2.3 \"Let cookie-domain be the attribute-value without the leading %x2E\n // (\".\") character.\"\n var domain = av_value.trim().replace(/^\\./, '');\n if (domain) {\n // \"Convert the cookie-domain to lower case.\"\n c.domain = domain.toLowerCase();\n }\n }\n break;\n\n case 'path': // S5.2.4\n /*\n * \"If the attribute-value is empty or if the first character of the\n * attribute-value is not %x2F (\"/\"):\n * Let cookie-path be the default-path.\n * Otherwise:\n * Let cookie-path be the attribute-value.\"\n *\n * We'll represent the default-path as null since it depends on the\n * context of the parsing.\n */\n c.path = av_value && av_value[0] === \"/\" ? av_value : null;\n break;\n\n case 'secure': // S5.2.5\n /*\n * \"If the attribute-name case-insensitively matches the string \"Secure\",\n * the user agent MUST append an attribute to the cookie-attribute-list\n * with an attribute-name of Secure and an empty attribute-value.\"\n */\n c.secure = true;\n break;\n\n case 'httponly': // S5.2.6 -- effectively the same as 'secure'\n c.httpOnly = true;\n break;\n\n default:\n c.extensions = c.extensions || [];\n c.extensions.push(av);\n break;\n }\n }\n\n return c;\n}\n\n// avoid the V8 deoptimization monster!\nfunction jsonParse(str) {\n var obj;\n try {\n obj = JSON.parse(str);\n } catch (e) {\n return e;\n }\n return obj;\n}\n\nfunction fromJSON(str) {\n if (!str) {\n return null;\n }\n\n var obj;\n if (typeof str === 'string') {\n obj = jsonParse(str);\n if (obj instanceof Error) {\n return null;\n }\n } else {\n // assume it's an Object\n obj = str;\n }\n\n var c = new Cookie();\n for (var i=0; i<Cookie.serializableProperties.length; i++) {\n var prop = Cookie.serializableProperties[i];\n if (obj[prop] === undefined ||\n obj[prop] === Cookie.prototype[prop])\n {\n continue; // leave as prototype default\n }\n\n if (prop === 'expires' ||\n prop === 'creation' ||\n prop === 'lastAccessed')\n {\n if (obj[prop] === null) {\n c[prop] = null;\n } else {\n c[prop] = obj[prop] == \"Infinity\" ?\n \"Infinity\" : new Date(obj[prop]);\n }\n } else {\n c[prop] = obj[prop];\n }\n }\n\n return c;\n}\n\n/* Section 5.4 part 2:\n * \"* Cookies with longer paths are listed before cookies with\n * shorter paths.\n *\n * * Among cookies that have equal-length path fields, cookies with\n * earlier creation-times are listed before cookies with later\n * creation-times.\"\n */\n\nfunction cookieCompare(a,b) {\n var cmp = 0;\n\n // descending for length: b CMP a\n var aPathLen = a.path ? a.path.length : 0;\n var bPathLen = b.path ? b.path.length : 0;\n cmp = bPathLen - aPathLen;\n if (cmp !== 0) {\n return cmp;\n }\n\n // ascending for time: a CMP b\n var aTime = a.creation ? a.creation.getTime() : MAX_TIME;\n var bTime = b.creation ? b.creation.getTime() : MAX_TIME;\n cmp = aTime - bTime;\n if (cmp !== 0) {\n return cmp;\n }\n\n // break ties for the same millisecond (precision of JavaScript's clock)\n cmp = a.creationIndex - b.creationIndex;\n\n return cmp;\n}\n\n// Gives the permutation of all possible pathMatch()es of a given path. The\n// array is in longest-to-shortest order. Handy for indexing.\nfunction permutePath(path) {\n if (path === '/') {\n return ['/'];\n }\n if (path.lastIndexOf('/') === path.length-1) {\n path = path.substr(0,path.length-1);\n }\n var permutations = [path];\n while (path.length > 1) {\n var lindex = path.lastIndexOf('/');\n if (lindex === 0) {\n break;\n }\n path = path.substr(0,lindex);\n permutations.push(path);\n }\n permutations.push('/');\n return permutations;\n}\n\nfunction getCookieContext(url) {\n if (url instanceof Object) {\n return url;\n }\n // NOTE: decodeURI will throw on malformed URIs (see GH-32).\n // Therefore, we will just skip decoding for such URIs.\n try {\n url = decodeURI(url);\n }\n catch(err) {\n // Silently swallow error\n }\n\n return urlParse(url);\n}\n\nfunction Cookie(options) {\n options = options || {};\n\n Object.keys(options).forEach(function(prop) {\n if (Cookie.prototype.hasOwnProperty(prop) &&\n Cookie.prototype[prop] !== options[prop] &&\n prop.substr(0,1) !== '_')\n {\n this[prop] = options[prop];\n }\n }, this);\n\n this.creation = this.creation || new Date();\n\n // used to break creation ties in cookieCompare():\n Object.defineProperty(this, 'creationIndex', {\n configurable: false,\n enumerable: false, // important for assert.deepEqual checks\n writable: true,\n value: ++Cookie.cookiesCreated\n });\n}\n\nCookie.cookiesCreated = 0; // incremented each time a cookie is created\n\nCookie.parse = parse;\nCookie.fromJSON = fromJSON;\n\nCookie.prototype.key = \"\";\nCookie.prototype.value = \"\";\n\n// the order in which the RFC has them:\nCookie.prototype.expires = \"Infinity\"; // coerces to literal Infinity\nCookie.prototype.maxAge = null; // takes precedence over expires for TTL\nCookie.prototype.domain = null;\nCookie.prototype.path = null;\nCookie.prototype.secure = false;\nCookie.prototype.httpOnly = false;\nCookie.prototype.extensions = null;\n\n// set by the CookieJar:\nCookie.prototype.hostOnly = null; // boolean when set\nCookie.prototype.pathIsDefault = null; // boolean when set\nCookie.prototype.creation = null; // Date when set; defaulted by Cookie.parse\nCookie.prototype.lastAccessed = null; // Date when set\nObject.defineProperty(Cookie.prototype, 'creationIndex', {\n configurable: true,\n enumerable: false,\n writable: true,\n value: 0\n});\n\nCookie.serializableProperties = Object.keys(Cookie.prototype)\n .filter(function(prop) {\n return !(\n Cookie.prototype[prop] instanceof Function ||\n prop === 'creationIndex' ||\n prop.substr(0,1) === '_'\n );\n });\n\nCookie.prototype.inspect = function inspect() {\n var now = Date.now();\n return 'Cookie=\"'+this.toString() +\n '; hostOnly='+(this.hostOnly != null ? this.hostOnly : '?') +\n '; aAge='+(this.lastAccessed ? (now-this.lastAccessed.getTime())+'ms' : '?') +\n '; cAge='+(this.creation ? (now-this.creation.getTime())+'ms' : '?') +\n '\"';\n};\n\n// Use the new custom inspection symbol to add the custom inspect function if\n// available.\nif (util.inspect.custom) {\n Cookie.prototype[util.inspect.custom] = Cookie.prototype.inspect;\n}\n\nCookie.prototype.toJSON = function() {\n var obj = {};\n\n var props = Cookie.serializableProperties;\n for (var i=0; i<props.length; i++) {\n var prop = props[i];\n if (this[prop] === Cookie.prototype[prop]) {\n continue; // leave as prototype default\n }\n\n if (prop === 'expires' ||\n prop === 'creation' ||\n prop === 'lastAccessed')\n {\n if (this[prop] === null) {\n obj[prop] = null;\n } else {\n obj[prop] = this[prop] == \"Infinity\" ? // intentionally not ===\n \"Infinity\" : this[prop].toISOString();\n }\n } else if (prop === 'maxAge') {\n if (this[prop] !== null) {\n // again, intentionally not ===\n obj[prop] = (this[prop] == Infinity || this[prop] == -Infinity) ?\n this[prop].toString() : this[prop];\n }\n } else {\n if (this[prop] !== Cookie.prototype[prop]) {\n obj[prop] = this[prop];\n }\n }\n }\n\n return obj;\n};\n\nCookie.prototype.clone = function() {\n return fromJSON(this.toJSON());\n};\n\nCookie.prototype.validate = function validate() {\n if (!COOKIE_OCTETS.test(this.value)) {\n return false;\n }\n if (this.expires != Infinity && !(this.expires instanceof Date) && !parseDate(this.expires)) {\n return false;\n }\n if (this.maxAge != null && this.maxAge <= 0) {\n return false; // \"Max-Age=\" non-zero-digit *DIGIT\n }\n if (this.path != null && !PATH_VALUE.test(this.path)) {\n return false;\n }\n\n var cdomain = this.cdomain();\n if (cdomain) {\n if (cdomain.match(/\\.$/)) {\n return false; // S4.1.2.3 suggests that this is bad. domainMatch() tests confirm this\n }\n var suffix = pubsuffix.getPublicSuffix(cdomain);\n if (suffix == null) { // it's a public suffix\n return false;\n }\n }\n return true;\n};\n\nCookie.prototype.setExpires = function setExpires(exp) {\n if (exp instanceof Date) {\n this.expires = exp;\n } else {\n this.expires = parseDate(exp) || \"Infinity\";\n }\n};\n\nCookie.prototype.setMaxAge = function setMaxAge(age) {\n if (age === Infinity || age === -Infinity) {\n this.maxAge = age.toString(); // so JSON.stringify() works\n } else {\n this.maxAge = age;\n }\n};\n\n// gives Cookie header format\nCookie.prototype.cookieString = function cookieString() {\n var val = this.value;\n if (val == null) {\n val = '';\n }\n if (this.key === '') {\n return val;\n }\n return this.key+'='+val;\n};\n\n// gives Set-Cookie header format\nCookie.prototype.toString = function toString() {\n var str = this.cookieString();\n\n if (this.expires != Infinity) {\n if (this.expires instanceof Date) {\n str += '; Expires='+formatDate(this.expires);\n } else {\n str += '; Expires='+this.expires;\n }\n }\n\n if (this.maxAge != null && this.maxAge != Infinity) {\n str += '; Max-Age='+this.maxAge;\n }\n\n if (this.domain && !this.hostOnly) {\n str += '; Domain='+this.domain;\n }\n if (this.path) {\n str += '; Path='+this.path;\n }\n\n if (this.secure) {\n str += '; Secure';\n }\n if (this.httpOnly) {\n str += '; HttpOnly';\n }\n if (this.extensions) {\n this.extensions.forEach(function(ext) {\n str += '; '+ext;\n });\n }\n\n return str;\n};\n\n// TTL() partially replaces the \"expiry-time\" parts of S5.3 step 3 (setCookie()\n// elsewhere)\n// S5.3 says to give the \"latest representable date\" for which we use Infinity\n// For \"expired\" we use 0\nCookie.prototype.TTL = function TTL(now) {\n /* RFC6265 S4.1.2.2 If a cookie has both the Max-Age and the Expires\n * attribute, the Max-Age attribute has precedence and controls the\n * expiration date of the cookie.\n * (Concurs with S5.3 step 3)\n */\n if (this.maxAge != null) {\n return this.maxAge<=0 ? 0 : this.maxAge*1000;\n }\n\n var expires = this.expires;\n if (expires != Infinity) {\n if (!(expires instanceof Date)) {\n expires = parseDate(expires) || Infinity;\n }\n\n if (expires == Infinity) {\n return Infinity;\n }\n\n return expires.getTime() - (now || Date.now());\n }\n\n return Infinity;\n};\n\n// expiryTime() replaces the \"expiry-time\" parts of S5.3 step 3 (setCookie()\n// elsewhere)\nCookie.prototype.expiryTime = function expiryTime(now) {\n if (this.maxAge != null) {\n var relativeTo = now || this.creation || new Date();\n var age = (this.maxAge <= 0) ? -Infinity : this.maxAge*1000;\n return relativeTo.getTime() + age;\n }\n\n if (this.expires == Infinity) {\n return Infinity;\n }\n return this.expires.getTime();\n};\n\n// expiryDate() replaces the \"expiry-time\" parts of S5.3 step 3 (setCookie()\n// elsewhere), except it returns a Date\nCookie.prototype.expiryDate = function expiryDate(now) {\n var millisec = this.expiryTime(now);\n if (millisec == Infinity) {\n return new Date(MAX_TIME);\n } else if (millisec == -Infinity) {\n return new Date(MIN_TIME);\n } else {\n return new Date(millisec);\n }\n};\n\n// This replaces the \"persistent-flag\" parts of S5.3 step 3\nCookie.prototype.isPersistent = function isPersistent() {\n return (this.maxAge != null || this.expires != Infinity);\n};\n\n// Mostly S5.1.2 and S5.2.3:\nCookie.prototype.cdomain =\nCookie.prototype.canonicalizedDomain = function canonicalizedDomain() {\n if (this.domain == null) {\n return null;\n }\n return canonicalDomain(this.domain);\n};\n\nfunction CookieJar(store, options) {\n if (typeof options === \"boolean\") {\n options = {rejectPublicSuffixes: options};\n } else if (options == null) {\n options = {};\n }\n if (options.rejectPublicSuffixes != null) {\n this.rejectPublicSuffixes = options.rejectPublicSuffixes;\n }\n if (options.looseMode != null) {\n this.enableLooseMode = options.looseMode;\n }\n\n if (!store) {\n store = new MemoryCookieStore();\n }\n this.store = store;\n}\nCookieJar.prototype.store = null;\nCookieJar.prototype.rejectPublicSuffixes = true;\nCookieJar.prototype.enableLooseMode = false;\nvar CAN_BE_SYNC = [];\n\nCAN_BE_SYNC.push('setCookie');\nCookieJar.prototype.setCookie = function(cookie, url, options, cb) {\n var err;\n var context = getCookieContext(url);\n if (options instanceof Function) {\n cb = options;\n options = {};\n }\n\n var host = canonicalDomain(context.hostname);\n var loose = this.enableLooseMode;\n if (options.loose != null) {\n loose = options.loose;\n }\n\n // S5.3 step 1\n if (!(cookie instanceof Cookie)) {\n cookie = Cookie.parse(cookie, { loose: loose });\n }\n if (!cookie) {\n err = new Error(\"Cookie failed to parse\");\n return cb(options.ignoreError ? null : err);\n }\n\n // S5.3 step 2\n var now = options.now || new Date(); // will assign later to save effort in the face of errors\n\n // S5.3 step 3: NOOP; persistent-flag and expiry-time is handled by getCookie()\n\n // S5.3 step 4: NOOP; domain is null by default\n\n // S5.3 step 5: public suffixes\n if (this.rejectPublicSuffixes && cookie.domain) {\n var suffix = pubsuffix.getPublicSuffix(cookie.cdomain());\n if (suffix == null) { // e.g. \"com\"\n err = new Error(\"Cookie has domain set to a public suffix\");\n return cb(options.ignoreError ? null : err);\n }\n }\n\n // S5.3 step 6:\n if (cookie.domain) {\n if (!domainMatch(host, cookie.cdomain(), false)) {\n err = new Error(\"Cookie not in this host's domain. Cookie:\"+cookie.cdomain()+\" Request:\"+host);\n return cb(options.ignoreError ? null : err);\n }\n\n if (cookie.hostOnly == null) { // don't reset if already set\n cookie.hostOnly = false;\n }\n\n } else {\n cookie.hostOnly = true;\n cookie.domain = host;\n }\n\n //S5.2.4 If the attribute-value is empty or if the first character of the\n //attribute-value is not %x2F (\"/\"):\n //Let cookie-path be the default-path.\n if (!cookie.path || cookie.path[0] !== '/') {\n cookie.path = defaultPath(context.pathname);\n cookie.pathIsDefault = true;\n }\n\n // S5.3 step 8: NOOP; secure attribute\n // S5.3 step 9: NOOP; httpOnly attribute\n\n // S5.3 step 10\n if (options.http === false && cookie.httpOnly) {\n err = new Error(\"Cookie is HttpOnly and this isn't an HTTP API\");\n return cb(options.ignoreError ? null : err);\n }\n\n var store = this.store;\n\n if (!store.updateCookie) {\n store.updateCookie = function(oldCookie, newCookie, cb) {\n this.putCookie(newCookie, cb);\n };\n }\n\n function withCookie(err, oldCookie) {\n if (err) {\n return cb(err);\n }\n\n var next = function(err) {\n if (err) {\n return cb(err);\n } else {\n cb(null, cookie);\n }\n };\n\n if (oldCookie) {\n // S5.3 step 11 - \"If the cookie store contains a cookie with the same name,\n // domain, and path as the newly created cookie:\"\n if (options.http === false && oldCookie.httpOnly) { // step 11.2\n err = new Error(\"old Cookie is HttpOnly and this isn't an HTTP API\");\n return cb(options.ignoreError ? null : err);\n }\n cookie.creation = oldCookie.creation; // step 11.3\n cookie.creationIndex = oldCookie.creationIndex; // preserve tie-breaker\n cookie.lastAccessed = now;\n // Step 11.4 (delete cookie) is implied by just setting the new one:\n store.updateCookie(oldCookie, cookie, next); // step 12\n\n } else {\n cookie.creation = cookie.lastAccessed = now;\n store.putCookie(cookie, next); // step 12\n }\n }\n\n store.findCookie(cookie.domain, cookie.path, cookie.key, withCookie);\n};\n\n// RFC6365 S5.4\nCAN_BE_SYNC.push('getCookies');\nCookieJar.prototype.getCookies = function(url, options, cb) {\n var context = getCookieContext(url);\n if (options instanceof Function) {\n cb = options;\n options = {};\n }\n\n var host = canonicalDomain(context.hostname);\n var path = context.pathname || '/';\n\n var secure = options.secure;\n if (secure == null && context.protocol &&\n (context.protocol == 'https:' || context.protocol == 'wss:'))\n {\n secure = true;\n }\n\n var http = options.http;\n if (http == null) {\n http = true;\n }\n\n var now = options.now || Date.now();\n var expireCheck = options.expire !== false;\n var allPaths = !!options.allPaths;\n var store = this.store;\n\n function matchingCookie(c) {\n // \"Either:\n // The cookie's host-only-flag is true and the canonicalized\n // request-host is identical to the cookie's domain.\n // Or:\n // The cookie's host-only-flag is false and the canonicalized\n // request-host domain-matches the cookie's domain.\"\n if (c.hostOnly) {\n if (c.domain != host) {\n return false;\n }\n } else {\n if (!domainMatch(host, c.domain, false)) {\n return false;\n }\n }\n\n // \"The request-uri's path path-matches the cookie's path.\"\n if (!allPaths && !pathMatch(path, c.path)) {\n return false;\n }\n\n // \"If the cookie's secure-only-flag is true, then the request-uri's\n // scheme must denote a \"secure\" protocol\"\n if (c.secure && !secure) {\n return false;\n }\n\n // \"If the cookie's http-only-flag is true, then exclude the cookie if the\n // cookie-string is being generated for a \"non-HTTP\" API\"\n if (c.httpOnly && !http) {\n return false;\n }\n\n // deferred from S5.3\n // non-RFC: allow retention of expired cookies by choice\n if (expireCheck && c.expiryTime() <= now) {\n store.removeCookie(c.domain, c.path, c.key, function(){}); // result ignored\n return false;\n }\n\n return true;\n }\n\n store.findCookies(host, allPaths ? null : path, function(err,cookies) {\n if (err) {\n return cb(err);\n }\n\n cookies = cookies.filter(matchingCookie);\n\n // sorting of S5.4 part 2\n if (options.sort !== false) {\n cookies = cookies.sort(cookieCompare);\n }\n\n // S5.4 part 3\n var now = new Date();\n cookies.forEach(function(c) {\n c.lastAccessed = now;\n });\n // TODO persist lastAccessed\n\n cb(null,cookies);\n });\n};\n\nCAN_BE_SYNC.push('getCookieString');\nCookieJar.prototype.getCookieString = function(/*..., cb*/) {\n var args = Array.prototype.slice.call(arguments,0);\n var cb = args.pop();\n var next = function(err,cookies) {\n if (err) {\n cb(err);\n } else {\n cb(null, cookies\n .sort(cookieCompare)\n .map(function(c){\n return c.cookieString();\n })\n .join('; '));\n }\n };\n args.push(next);\n this.getCookies.apply(this,args);\n};\n\nCAN_BE_SYNC.push('getSetCookieStrings');\nCookieJar.prototype.getSetCookieStrings = function(/*..., cb*/) {\n var args = Array.prototype.slice.call(arguments,0);\n var cb = args.pop();\n var next = function(err,cookies) {\n if (err) {\n cb(err);\n } else {\n cb(null, cookies.map(function(c){\n return c.toString();\n }));\n }\n };\n args.push(next);\n this.getCookies.apply(this,args);\n};\n\nCAN_BE_SYNC.push('serialize');\nCookieJar.prototype.serialize = function(cb) {\n var type = this.store.constructor.name;\n if (type === 'Object') {\n type = null;\n }\n\n // update README.md \"Serialization Format\" if you change this, please!\n var serialized = {\n // The version of tough-cookie that serialized this jar. Generally a good\n // practice since future versions can make data import decisions based on\n // known past behavior. When/if this matters, use `semver`.\n version: 'tough-cookie@'+VERSION,\n\n // add the store type, to make humans happy:\n storeType: type,\n\n // CookieJar configuration:\n rejectPublicSuffixes: !!this.rejectPublicSuffixes,\n\n // this gets filled from getAllCookies:\n cookies: []\n };\n\n if (!(this.store.getAllCookies &&\n typeof this.store.getAllCookies === 'function'))\n {\n return cb(new Error('store does not support getAllCookies and cannot be serialized'));\n }\n\n this.store.getAllCookies(function(err,cookies) {\n if (err) {\n return cb(err);\n }\n\n serialized.cookies = cookies.map(function(cookie) {\n // convert to serialized 'raw' cookies\n cookie = (cookie instanceof Cookie) ? cookie.toJSON() : cookie;\n\n // Remove the index so new ones get assigned during deserialization\n delete cookie.creationIndex;\n\n return cookie;\n });\n\n return cb(null, serialized);\n });\n};\n\n// well-known name that JSON.stringify calls\nCookieJar.prototype.toJSON = function() {\n return this.serializeSync();\n};\n\n// use the class method CookieJar.deserialize instead of calling this directly\nCAN_BE_SYNC.push('_importCookies');\nCookieJar.prototype._importCookies = function(serialized, cb) {\n var jar = this;\n var cookies = serialized.cookies;\n if (!cookies || !Array.isArray(cookies)) {\n return cb(new Error('serialized jar has no cookies array'));\n }\n cookies = cookies.slice(); // do not modify the original\n\n function putNext(err) {\n if (err) {\n return cb(err);\n }\n\n if (!cookies.length) {\n return cb(err, jar);\n }\n\n var cookie;\n try {\n cookie = fromJSON(cookies.shift());\n } catch (e) {\n return cb(e);\n }\n\n if (cookie === null) {\n return putNext(null); // skip this cookie\n }\n\n jar.store.putCookie(cookie, putNext);\n }\n\n putNext();\n};\n\nCookieJar.deserialize = function(strOrObj, store, cb) {\n if (arguments.length !== 3) {\n // store is optional\n cb = store;\n store = null;\n }\n\n var serialized;\n if (typeof strOrObj === 'string') {\n serialized = jsonParse(strOrObj);\n if (serialized instanceof Error) {\n return cb(serialized);\n }\n } else {\n serialized = strOrObj;\n }\n\n var jar = new CookieJar(store, serialized.rejectPublicSuffixes);\n jar._importCookies(serialized, function(err) {\n if (err) {\n return cb(err);\n }\n cb(null, jar);\n });\n};\n\nCookieJar.deserializeSync = function(strOrObj, store) {\n var serialized = typeof strOrObj === 'string' ?\n JSON.parse(strOrObj) : strOrObj;\n var jar = new CookieJar(store, serialized.rejectPublicSuffixes);\n\n // catch this mistake early:\n if (!jar.store.synchronous) {\n throw new Error('CookieJar store is not synchronous; use async API instead.');\n }\n\n jar._importCookiesSync(serialized);\n return jar;\n};\nCookieJar.fromJSON = CookieJar.deserializeSync;\n\nCookieJar.prototype.clone = function(newStore, cb) {\n if (arguments.length === 1) {\n cb = newStore;\n newStore = null;\n }\n\n this.serialize(function(err,serialized) {\n if (err) {\n return cb(err);\n }\n CookieJar.deserialize(serialized, newStore, cb);\n });\n};\n\nCAN_BE_SYNC.push('removeAllCookies');\nCookieJar.prototype.removeAllCookies = function(cb) {\n var store = this.store;\n\n // Check that the store implements its own removeAllCookies(). The default\n // implementation in Store will immediately call the callback with a \"not\n // implemented\" Error.\n if (store.removeAllCookies instanceof Function &&\n store.removeAllCookies !== Store.prototype.removeAllCookies)\n {\n return store.removeAllCookies(cb);\n }\n\n store.getAllCookies(function(err, cookies) {\n if (err) {\n return cb(err);\n }\n\n if (cookies.length === 0) {\n return cb(null);\n }\n\n var completedCount = 0;\n var removeErrors = [];\n\n function removeCookieCb(removeErr) {\n if (removeErr) {\n removeErrors.push(removeErr);\n }\n\n completedCount++;\n\n if (completedCount === cookies.length) {\n return cb(removeErrors.length ? removeErrors[0] : null);\n }\n }\n\n cookies.forEach(function(cookie) {\n store.removeCookie(cookie.domain, cookie.path, cookie.key, removeCookieCb);\n });\n });\n};\n\nCookieJar.prototype._cloneSync = syncWrap('clone');\nCookieJar.prototype.cloneSync = function(newStore) {\n if (!newStore.synchronous) {\n throw new Error('CookieJar clone destination store is not synchronous; use async API instead.');\n }\n return this._cloneSync(newStore);\n};\n\n// Use a closure to provide a true imperative API for synchronous stores.\nfunction syncWrap(method) {\n return function() {\n if (!this.store.synchronous) {\n throw new Error('CookieJar store is not synchronous; use async API instead.');\n }\n\n var args = Array.prototype.slice.call(arguments);\n var syncErr, syncResult;\n args.push(function syncCb(err, result) {\n syncErr = err;\n syncResult = result;\n });\n this[method].apply(this, args);\n\n if (syncErr) {\n throw syncErr;\n }\n return syncResult;\n };\n}\n\n// wrap all declared CAN_BE_SYNC methods in the sync wrapper\nCAN_BE_SYNC.forEach(function(method) {\n CookieJar.prototype[method+'Sync'] = syncWrap(method);\n});\n\nexports.version = VERSION;\nexports.CookieJar = CookieJar;\nexports.Cookie = Cookie;\nexports.Store = Store;\nexports.MemoryCookieStore = MemoryCookieStore;\nexports.parseDate = parseDate;\nexports.formatDate = formatDate;\nexports.parse = parse;\nexports.fromJSON = fromJSON;\nexports.domainMatch = domainMatch;\nexports.defaultPath = defaultPath;\nexports.pathMatch = pathMatch;\nexports.getPublicSuffix = pubsuffix.getPublicSuffix;\nexports.cookieCompare = cookieCompare;\nexports.permuteDomain = __webpack_require__(/*! ./permuteDomain */ \"./node_modules/request/node_modules/tough-cookie/lib/permuteDomain.js\").permuteDomain;\nexports.permutePath = permutePath;\nexports.canonicalDomain = canonicalDomain;\n\n\n//# sourceURL=webpack://@k8slens/open-lens/./node_modules/request/node_modules/tough-cookie/lib/cookie.js?");
24557
+
24558
+ /***/ }),
24559
+
24560
+ /***/ "./node_modules/request/node_modules/tough-cookie/lib/memstore.js":
24561
+ /*!************************************************************************!*\
24562
+ !*** ./node_modules/request/node_modules/tough-cookie/lib/memstore.js ***!
24563
+ \************************************************************************/
24564
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
24565
+
24566
+ "use strict";
24567
+ eval("/*!\n * Copyright (c) 2015, Salesforce.com, Inc.\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * 1. Redistributions of source code must retain the above copyright notice,\n * this list of conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following disclaimer in the documentation\n * and/or other materials provided with the distribution.\n *\n * 3. Neither the name of Salesforce.com nor the names of its contributors may\n * be used to endorse or promote products derived from this software without\n * specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n */\n\nvar Store = (__webpack_require__(/*! ./store */ \"./node_modules/request/node_modules/tough-cookie/lib/store.js\").Store);\nvar permuteDomain = (__webpack_require__(/*! ./permuteDomain */ \"./node_modules/request/node_modules/tough-cookie/lib/permuteDomain.js\").permuteDomain);\nvar pathMatch = (__webpack_require__(/*! ./pathMatch */ \"./node_modules/request/node_modules/tough-cookie/lib/pathMatch.js\").pathMatch);\nvar util = __webpack_require__(/*! util */ \"util\");\n\nfunction MemoryCookieStore() {\n Store.call(this);\n this.idx = {};\n}\nutil.inherits(MemoryCookieStore, Store);\nexports.MemoryCookieStore = MemoryCookieStore;\nMemoryCookieStore.prototype.idx = null;\n\n// Since it's just a struct in RAM, this Store is synchronous\nMemoryCookieStore.prototype.synchronous = true;\n\n// force a default depth:\nMemoryCookieStore.prototype.inspect = function() {\n return \"{ idx: \"+util.inspect(this.idx, false, 2)+' }';\n};\n\n// Use the new custom inspection symbol to add the custom inspect function if\n// available.\nif (util.inspect.custom) {\n MemoryCookieStore.prototype[util.inspect.custom] = MemoryCookieStore.prototype.inspect;\n}\n\nMemoryCookieStore.prototype.findCookie = function(domain, path, key, cb) {\n if (!this.idx[domain]) {\n return cb(null,undefined);\n }\n if (!this.idx[domain][path]) {\n return cb(null,undefined);\n }\n return cb(null,this.idx[domain][path][key]||null);\n};\n\nMemoryCookieStore.prototype.findCookies = function(domain, path, cb) {\n var results = [];\n if (!domain) {\n return cb(null,[]);\n }\n\n var pathMatcher;\n if (!path) {\n // null means \"all paths\"\n pathMatcher = function matchAll(domainIndex) {\n for (var curPath in domainIndex) {\n var pathIndex = domainIndex[curPath];\n for (var key in pathIndex) {\n results.push(pathIndex[key]);\n }\n }\n };\n\n } else {\n pathMatcher = function matchRFC(domainIndex) {\n //NOTE: we should use path-match algorithm from S5.1.4 here\n //(see : https://github.com/ChromiumWebApps/chromium/blob/b3d3b4da8bb94c1b2e061600df106d590fda3620/net/cookies/canonical_cookie.cc#L299)\n Object.keys(domainIndex).forEach(function (cookiePath) {\n if (pathMatch(path, cookiePath)) {\n var pathIndex = domainIndex[cookiePath];\n\n for (var key in pathIndex) {\n results.push(pathIndex[key]);\n }\n }\n });\n };\n }\n\n var domains = permuteDomain(domain) || [domain];\n var idx = this.idx;\n domains.forEach(function(curDomain) {\n var domainIndex = idx[curDomain];\n if (!domainIndex) {\n return;\n }\n pathMatcher(domainIndex);\n });\n\n cb(null,results);\n};\n\nMemoryCookieStore.prototype.putCookie = function(cookie, cb) {\n if (!this.idx[cookie.domain]) {\n this.idx[cookie.domain] = {};\n }\n if (!this.idx[cookie.domain][cookie.path]) {\n this.idx[cookie.domain][cookie.path] = {};\n }\n this.idx[cookie.domain][cookie.path][cookie.key] = cookie;\n cb(null);\n};\n\nMemoryCookieStore.prototype.updateCookie = function(oldCookie, newCookie, cb) {\n // updateCookie() may avoid updating cookies that are identical. For example,\n // lastAccessed may not be important to some stores and an equality\n // comparison could exclude that field.\n this.putCookie(newCookie,cb);\n};\n\nMemoryCookieStore.prototype.removeCookie = function(domain, path, key, cb) {\n if (this.idx[domain] && this.idx[domain][path] && this.idx[domain][path][key]) {\n delete this.idx[domain][path][key];\n }\n cb(null);\n};\n\nMemoryCookieStore.prototype.removeCookies = function(domain, path, cb) {\n if (this.idx[domain]) {\n if (path) {\n delete this.idx[domain][path];\n } else {\n delete this.idx[domain];\n }\n }\n return cb(null);\n};\n\nMemoryCookieStore.prototype.removeAllCookies = function(cb) {\n this.idx = {};\n return cb(null);\n}\n\nMemoryCookieStore.prototype.getAllCookies = function(cb) {\n var cookies = [];\n var idx = this.idx;\n\n var domains = Object.keys(idx);\n domains.forEach(function(domain) {\n var paths = Object.keys(idx[domain]);\n paths.forEach(function(path) {\n var keys = Object.keys(idx[domain][path]);\n keys.forEach(function(key) {\n if (key !== null) {\n cookies.push(idx[domain][path][key]);\n }\n });\n });\n });\n\n // Sort by creationIndex so deserializing retains the creation order.\n // When implementing your own store, this SHOULD retain the order too\n cookies.sort(function(a,b) {\n return (a.creationIndex||0) - (b.creationIndex||0);\n });\n\n cb(null, cookies);\n};\n\n\n//# sourceURL=webpack://@k8slens/open-lens/./node_modules/request/node_modules/tough-cookie/lib/memstore.js?");
24568
+
24569
+ /***/ }),
24570
+
24571
+ /***/ "./node_modules/request/node_modules/tough-cookie/lib/pathMatch.js":
24572
+ /*!*************************************************************************!*\
24573
+ !*** ./node_modules/request/node_modules/tough-cookie/lib/pathMatch.js ***!
24574
+ \*************************************************************************/
24575
+ /***/ ((__unused_webpack_module, exports) => {
24576
+
24577
+ "use strict";
24578
+ eval("/*!\n * Copyright (c) 2015, Salesforce.com, Inc.\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * 1. Redistributions of source code must retain the above copyright notice,\n * this list of conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following disclaimer in the documentation\n * and/or other materials provided with the distribution.\n *\n * 3. Neither the name of Salesforce.com nor the names of its contributors may\n * be used to endorse or promote products derived from this software without\n * specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n */\n\n/*\n * \"A request-path path-matches a given cookie-path if at least one of the\n * following conditions holds:\"\n */\nfunction pathMatch (reqPath, cookiePath) {\n // \"o The cookie-path and the request-path are identical.\"\n if (cookiePath === reqPath) {\n return true;\n }\n\n var idx = reqPath.indexOf(cookiePath);\n if (idx === 0) {\n // \"o The cookie-path is a prefix of the request-path, and the last\n // character of the cookie-path is %x2F (\"/\").\"\n if (cookiePath.substr(-1) === \"/\") {\n return true;\n }\n\n // \" o The cookie-path is a prefix of the request-path, and the first\n // character of the request-path that is not included in the cookie- path\n // is a %x2F (\"/\") character.\"\n if (reqPath.substr(cookiePath.length, 1) === \"/\") {\n return true;\n }\n }\n\n return false;\n}\n\nexports.pathMatch = pathMatch;\n\n\n//# sourceURL=webpack://@k8slens/open-lens/./node_modules/request/node_modules/tough-cookie/lib/pathMatch.js?");
24579
+
24580
+ /***/ }),
24581
+
24582
+ /***/ "./node_modules/request/node_modules/tough-cookie/lib/permuteDomain.js":
24583
+ /*!*****************************************************************************!*\
24584
+ !*** ./node_modules/request/node_modules/tough-cookie/lib/permuteDomain.js ***!
24585
+ \*****************************************************************************/
24586
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
24587
+
24588
+ "use strict";
24589
+ eval("/*!\n * Copyright (c) 2015, Salesforce.com, Inc.\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * 1. Redistributions of source code must retain the above copyright notice,\n * this list of conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following disclaimer in the documentation\n * and/or other materials provided with the distribution.\n *\n * 3. Neither the name of Salesforce.com nor the names of its contributors may\n * be used to endorse or promote products derived from this software without\n * specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n */\n\nvar pubsuffix = __webpack_require__(/*! ./pubsuffix-psl */ \"./node_modules/request/node_modules/tough-cookie/lib/pubsuffix-psl.js\");\n\n// Gives the permutation of all possible domainMatch()es of a given domain. The\n// array is in shortest-to-longest order. Handy for indexing.\nfunction permuteDomain (domain) {\n var pubSuf = pubsuffix.getPublicSuffix(domain);\n if (!pubSuf) {\n return null;\n }\n if (pubSuf == domain) {\n return [domain];\n }\n\n var prefix = domain.slice(0, -(pubSuf.length + 1)); // \".example.com\"\n var parts = prefix.split('.').reverse();\n var cur = pubSuf;\n var permutations = [cur];\n while (parts.length) {\n cur = parts.shift() + '.' + cur;\n permutations.push(cur);\n }\n return permutations;\n}\n\nexports.permuteDomain = permuteDomain;\n\n\n//# sourceURL=webpack://@k8slens/open-lens/./node_modules/request/node_modules/tough-cookie/lib/permuteDomain.js?");
24590
+
24591
+ /***/ }),
24592
+
24593
+ /***/ "./node_modules/request/node_modules/tough-cookie/lib/pubsuffix-psl.js":
24594
+ /*!*****************************************************************************!*\
24595
+ !*** ./node_modules/request/node_modules/tough-cookie/lib/pubsuffix-psl.js ***!
24596
+ \*****************************************************************************/
24597
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
24598
+
24599
+ "use strict";
24600
+ eval("/*!\n * Copyright (c) 2018, Salesforce.com, Inc.\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * 1. Redistributions of source code must retain the above copyright notice,\n * this list of conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following disclaimer in the documentation\n * and/or other materials provided with the distribution.\n *\n * 3. Neither the name of Salesforce.com nor the names of its contributors may\n * be used to endorse or promote products derived from this software without\n * specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n */\n\nvar psl = __webpack_require__(/*! psl */ \"./node_modules/psl/index.js\");\n\nfunction getPublicSuffix(domain) {\n return psl.get(domain);\n}\n\nexports.getPublicSuffix = getPublicSuffix;\n\n\n//# sourceURL=webpack://@k8slens/open-lens/./node_modules/request/node_modules/tough-cookie/lib/pubsuffix-psl.js?");
24601
+
24602
+ /***/ }),
24603
+
24604
+ /***/ "./node_modules/request/node_modules/tough-cookie/lib/store.js":
24605
+ /*!*********************************************************************!*\
24606
+ !*** ./node_modules/request/node_modules/tough-cookie/lib/store.js ***!
24607
+ \*********************************************************************/
24608
+ /***/ ((__unused_webpack_module, exports) => {
24609
+
24610
+ "use strict";
24611
+ eval("/*!\n * Copyright (c) 2015, Salesforce.com, Inc.\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * 1. Redistributions of source code must retain the above copyright notice,\n * this list of conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following disclaimer in the documentation\n * and/or other materials provided with the distribution.\n *\n * 3. Neither the name of Salesforce.com nor the names of its contributors may\n * be used to endorse or promote products derived from this software without\n * specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n */\n\n/*jshint unused:false */\n\nfunction Store() {\n}\nexports.Store = Store;\n\n// Stores may be synchronous, but are still required to use a\n// Continuation-Passing Style API. The CookieJar itself will expose a \"*Sync\"\n// API that converts from synchronous-callbacks to imperative style.\nStore.prototype.synchronous = false;\n\nStore.prototype.findCookie = function(domain, path, key, cb) {\n throw new Error('findCookie is not implemented');\n};\n\nStore.prototype.findCookies = function(domain, path, cb) {\n throw new Error('findCookies is not implemented');\n};\n\nStore.prototype.putCookie = function(cookie, cb) {\n throw new Error('putCookie is not implemented');\n};\n\nStore.prototype.updateCookie = function(oldCookie, newCookie, cb) {\n // recommended default implementation:\n // return this.putCookie(newCookie, cb);\n throw new Error('updateCookie is not implemented');\n};\n\nStore.prototype.removeCookie = function(domain, path, key, cb) {\n throw new Error('removeCookie is not implemented');\n};\n\nStore.prototype.removeCookies = function(domain, path, cb) {\n throw new Error('removeCookies is not implemented');\n};\n\nStore.prototype.removeAllCookies = function(cb) {\n throw new Error('removeAllCookies is not implemented');\n}\n\nStore.prototype.getAllCookies = function(cb) {\n throw new Error('getAllCookies is not implemented (therefore jar cannot be serialized)');\n};\n\n\n//# sourceURL=webpack://@k8slens/open-lens/./node_modules/request/node_modules/tough-cookie/lib/store.js?");
24612
+
24613
+ /***/ }),
24614
+
24615
+ /***/ "./node_modules/request/node_modules/tough-cookie/lib/version.js":
24616
+ /*!***********************************************************************!*\
24617
+ !*** ./node_modules/request/node_modules/tough-cookie/lib/version.js ***!
24618
+ \***********************************************************************/
24619
+ /***/ ((module) => {
24620
+
24621
+ eval("// generated by genversion\nmodule.exports = '2.5.0'\n\n\n//# sourceURL=webpack://@k8slens/open-lens/./node_modules/request/node_modules/tough-cookie/lib/version.js?");
24622
+
24623
+ /***/ }),
24624
+
24539
24625
  /***/ "./node_modules/request/node_modules/uuid/lib/bytesToUuid.js":
24540
24626
  /*!*******************************************************************!*\
24541
24627
  !*** ./node_modules/request/node_modules/uuid/lib/bytesToUuid.js ***!
@@ -27629,82 +27715,6 @@ eval("/*!\n * is-number <https://github.com/jonschlinkert/is-number>\n *\n * Cop
27629
27715
 
27630
27716
  /***/ }),
27631
27717
 
27632
- /***/ "./node_modules/tough-cookie/lib/cookie.js":
27633
- /*!*************************************************!*\
27634
- !*** ./node_modules/tough-cookie/lib/cookie.js ***!
27635
- \*************************************************/
27636
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
27637
-
27638
- "use strict";
27639
- eval("/*!\n * Copyright (c) 2015, Salesforce.com, Inc.\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * 1. Redistributions of source code must retain the above copyright notice,\n * this list of conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following disclaimer in the documentation\n * and/or other materials provided with the distribution.\n *\n * 3. Neither the name of Salesforce.com nor the names of its contributors may\n * be used to endorse or promote products derived from this software without\n * specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n */\n\nvar net = __webpack_require__(/*! net */ \"net\");\nvar urlParse = (__webpack_require__(/*! url */ \"url\").parse);\nvar util = __webpack_require__(/*! util */ \"util\");\nvar pubsuffix = __webpack_require__(/*! ./pubsuffix-psl */ \"./node_modules/tough-cookie/lib/pubsuffix-psl.js\");\nvar Store = (__webpack_require__(/*! ./store */ \"./node_modules/tough-cookie/lib/store.js\").Store);\nvar MemoryCookieStore = (__webpack_require__(/*! ./memstore */ \"./node_modules/tough-cookie/lib/memstore.js\").MemoryCookieStore);\nvar pathMatch = (__webpack_require__(/*! ./pathMatch */ \"./node_modules/tough-cookie/lib/pathMatch.js\").pathMatch);\nvar VERSION = __webpack_require__(/*! ./version */ \"./node_modules/tough-cookie/lib/version.js\");\n\nvar punycode;\ntry {\n punycode = __webpack_require__(/*! punycode */ \"punycode\");\n} catch(e) {\n console.warn(\"tough-cookie: can't load punycode; won't use punycode for domain normalization\");\n}\n\n// From RFC6265 S4.1.1\n// note that it excludes \\x3B \";\"\nvar COOKIE_OCTETS = /^[\\x21\\x23-\\x2B\\x2D-\\x3A\\x3C-\\x5B\\x5D-\\x7E]+$/;\n\nvar CONTROL_CHARS = /[\\x00-\\x1F]/;\n\n// From Chromium // '\\r', '\\n' and '\\0' should be treated as a terminator in\n// the \"relaxed\" mode, see:\n// https://github.com/ChromiumWebApps/chromium/blob/b3d3b4da8bb94c1b2e061600df106d590fda3620/net/cookies/parsed_cookie.cc#L60\nvar TERMINATORS = ['\\n', '\\r', '\\0'];\n\n// RFC6265 S4.1.1 defines path value as 'any CHAR except CTLs or \";\"'\n// Note ';' is \\x3B\nvar PATH_VALUE = /[\\x20-\\x3A\\x3C-\\x7E]+/;\n\n// date-time parsing constants (RFC6265 S5.1.1)\n\nvar DATE_DELIM = /[\\x09\\x20-\\x2F\\x3B-\\x40\\x5B-\\x60\\x7B-\\x7E]/;\n\nvar MONTH_TO_NUM = {\n jan:0, feb:1, mar:2, apr:3, may:4, jun:5,\n jul:6, aug:7, sep:8, oct:9, nov:10, dec:11\n};\nvar NUM_TO_MONTH = [\n 'Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'\n];\nvar NUM_TO_DAY = [\n 'Sun','Mon','Tue','Wed','Thu','Fri','Sat'\n];\n\nvar MAX_TIME = 2147483647000; // 31-bit max\nvar MIN_TIME = 0; // 31-bit min\n\n/*\n * Parses a Natural number (i.e., non-negative integer) with either the\n * <min>*<max>DIGIT ( non-digit *OCTET )\n * or\n * <min>*<max>DIGIT\n * grammar (RFC6265 S5.1.1).\n *\n * The \"trailingOK\" boolean controls if the grammar accepts a\n * \"( non-digit *OCTET )\" trailer.\n */\nfunction parseDigits(token, minDigits, maxDigits, trailingOK) {\n var count = 0;\n while (count < token.length) {\n var c = token.charCodeAt(count);\n // \"non-digit = %x00-2F / %x3A-FF\"\n if (c <= 0x2F || c >= 0x3A) {\n break;\n }\n count++;\n }\n\n // constrain to a minimum and maximum number of digits.\n if (count < minDigits || count > maxDigits) {\n return null;\n }\n\n if (!trailingOK && count != token.length) {\n return null;\n }\n\n return parseInt(token.substr(0,count), 10);\n}\n\nfunction parseTime(token) {\n var parts = token.split(':');\n var result = [0,0,0];\n\n /* RF6256 S5.1.1:\n * time = hms-time ( non-digit *OCTET )\n * hms-time = time-field \":\" time-field \":\" time-field\n * time-field = 1*2DIGIT\n */\n\n if (parts.length !== 3) {\n return null;\n }\n\n for (var i = 0; i < 3; i++) {\n // \"time-field\" must be strictly \"1*2DIGIT\", HOWEVER, \"hms-time\" can be\n // followed by \"( non-digit *OCTET )\" so therefore the last time-field can\n // have a trailer\n var trailingOK = (i == 2);\n var num = parseDigits(parts[i], 1, 2, trailingOK);\n if (num === null) {\n return null;\n }\n result[i] = num;\n }\n\n return result;\n}\n\nfunction parseMonth(token) {\n token = String(token).substr(0,3).toLowerCase();\n var num = MONTH_TO_NUM[token];\n return num >= 0 ? num : null;\n}\n\n/*\n * RFC6265 S5.1.1 date parser (see RFC for full grammar)\n */\nfunction parseDate(str) {\n if (!str) {\n return;\n }\n\n /* RFC6265 S5.1.1:\n * 2. Process each date-token sequentially in the order the date-tokens\n * appear in the cookie-date\n */\n var tokens = str.split(DATE_DELIM);\n if (!tokens) {\n return;\n }\n\n var hour = null;\n var minute = null;\n var second = null;\n var dayOfMonth = null;\n var month = null;\n var year = null;\n\n for (var i=0; i<tokens.length; i++) {\n var token = tokens[i].trim();\n if (!token.length) {\n continue;\n }\n\n var result;\n\n /* 2.1. If the found-time flag is not set and the token matches the time\n * production, set the found-time flag and set the hour- value,\n * minute-value, and second-value to the numbers denoted by the digits in\n * the date-token, respectively. Skip the remaining sub-steps and continue\n * to the next date-token.\n */\n if (second === null) {\n result = parseTime(token);\n if (result) {\n hour = result[0];\n minute = result[1];\n second = result[2];\n continue;\n }\n }\n\n /* 2.2. If the found-day-of-month flag is not set and the date-token matches\n * the day-of-month production, set the found-day-of- month flag and set\n * the day-of-month-value to the number denoted by the date-token. Skip\n * the remaining sub-steps and continue to the next date-token.\n */\n if (dayOfMonth === null) {\n // \"day-of-month = 1*2DIGIT ( non-digit *OCTET )\"\n result = parseDigits(token, 1, 2, true);\n if (result !== null) {\n dayOfMonth = result;\n continue;\n }\n }\n\n /* 2.3. If the found-month flag is not set and the date-token matches the\n * month production, set the found-month flag and set the month-value to\n * the month denoted by the date-token. Skip the remaining sub-steps and\n * continue to the next date-token.\n */\n if (month === null) {\n result = parseMonth(token);\n if (result !== null) {\n month = result;\n continue;\n }\n }\n\n /* 2.4. If the found-year flag is not set and the date-token matches the\n * year production, set the found-year flag and set the year-value to the\n * number denoted by the date-token. Skip the remaining sub-steps and\n * continue to the next date-token.\n */\n if (year === null) {\n // \"year = 2*4DIGIT ( non-digit *OCTET )\"\n result = parseDigits(token, 2, 4, true);\n if (result !== null) {\n year = result;\n /* From S5.1.1:\n * 3. If the year-value is greater than or equal to 70 and less\n * than or equal to 99, increment the year-value by 1900.\n * 4. If the year-value is greater than or equal to 0 and less\n * than or equal to 69, increment the year-value by 2000.\n */\n if (year >= 70 && year <= 99) {\n year += 1900;\n } else if (year >= 0 && year <= 69) {\n year += 2000;\n }\n }\n }\n }\n\n /* RFC 6265 S5.1.1\n * \"5. Abort these steps and fail to parse the cookie-date if:\n * * at least one of the found-day-of-month, found-month, found-\n * year, or found-time flags is not set,\n * * the day-of-month-value is less than 1 or greater than 31,\n * * the year-value is less than 1601,\n * * the hour-value is greater than 23,\n * * the minute-value is greater than 59, or\n * * the second-value is greater than 59.\n * (Note that leap seconds cannot be represented in this syntax.)\"\n *\n * So, in order as above:\n */\n if (\n dayOfMonth === null || month === null || year === null || second === null ||\n dayOfMonth < 1 || dayOfMonth > 31 ||\n year < 1601 ||\n hour > 23 ||\n minute > 59 ||\n second > 59\n ) {\n return;\n }\n\n return new Date(Date.UTC(year, month, dayOfMonth, hour, minute, second));\n}\n\nfunction formatDate(date) {\n var d = date.getUTCDate(); d = d >= 10 ? d : '0'+d;\n var h = date.getUTCHours(); h = h >= 10 ? h : '0'+h;\n var m = date.getUTCMinutes(); m = m >= 10 ? m : '0'+m;\n var s = date.getUTCSeconds(); s = s >= 10 ? s : '0'+s;\n return NUM_TO_DAY[date.getUTCDay()] + ', ' +\n d+' '+ NUM_TO_MONTH[date.getUTCMonth()] +' '+ date.getUTCFullYear() +' '+\n h+':'+m+':'+s+' GMT';\n}\n\n// S5.1.2 Canonicalized Host Names\nfunction canonicalDomain(str) {\n if (str == null) {\n return null;\n }\n str = str.trim().replace(/^\\./,''); // S4.1.2.3 & S5.2.3: ignore leading .\n\n // convert to IDN if any non-ASCII characters\n if (punycode && /[^\\u0001-\\u007f]/.test(str)) {\n str = punycode.toASCII(str);\n }\n\n return str.toLowerCase();\n}\n\n// S5.1.3 Domain Matching\nfunction domainMatch(str, domStr, canonicalize) {\n if (str == null || domStr == null) {\n return null;\n }\n if (canonicalize !== false) {\n str = canonicalDomain(str);\n domStr = canonicalDomain(domStr);\n }\n\n /*\n * \"The domain string and the string are identical. (Note that both the\n * domain string and the string will have been canonicalized to lower case at\n * this point)\"\n */\n if (str == domStr) {\n return true;\n }\n\n /* \"All of the following [three] conditions hold:\" (order adjusted from the RFC) */\n\n /* \"* The string is a host name (i.e., not an IP address).\" */\n if (net.isIP(str)) {\n return false;\n }\n\n /* \"* The domain string is a suffix of the string\" */\n var idx = str.indexOf(domStr);\n if (idx <= 0) {\n return false; // it's a non-match (-1) or prefix (0)\n }\n\n // e.g \"a.b.c\".indexOf(\"b.c\") === 2\n // 5 === 3+2\n if (str.length !== domStr.length + idx) { // it's not a suffix\n return false;\n }\n\n /* \"* The last character of the string that is not included in the domain\n * string is a %x2E (\".\") character.\" */\n if (str.substr(idx-1,1) !== '.') {\n return false;\n }\n\n return true;\n}\n\n\n// RFC6265 S5.1.4 Paths and Path-Match\n\n/*\n * \"The user agent MUST use an algorithm equivalent to the following algorithm\n * to compute the default-path of a cookie:\"\n *\n * Assumption: the path (and not query part or absolute uri) is passed in.\n */\nfunction defaultPath(path) {\n // \"2. If the uri-path is empty or if the first character of the uri-path is not\n // a %x2F (\"/\") character, output %x2F (\"/\") and skip the remaining steps.\n if (!path || path.substr(0,1) !== \"/\") {\n return \"/\";\n }\n\n // \"3. If the uri-path contains no more than one %x2F (\"/\") character, output\n // %x2F (\"/\") and skip the remaining step.\"\n if (path === \"/\") {\n return path;\n }\n\n var rightSlash = path.lastIndexOf(\"/\");\n if (rightSlash === 0) {\n return \"/\";\n }\n\n // \"4. Output the characters of the uri-path from the first character up to,\n // but not including, the right-most %x2F (\"/\").\"\n return path.slice(0, rightSlash);\n}\n\nfunction trimTerminator(str) {\n for (var t = 0; t < TERMINATORS.length; t++) {\n var terminatorIdx = str.indexOf(TERMINATORS[t]);\n if (terminatorIdx !== -1) {\n str = str.substr(0,terminatorIdx);\n }\n }\n\n return str;\n}\n\nfunction parseCookiePair(cookiePair, looseMode) {\n cookiePair = trimTerminator(cookiePair);\n\n var firstEq = cookiePair.indexOf('=');\n if (looseMode) {\n if (firstEq === 0) { // '=' is immediately at start\n cookiePair = cookiePair.substr(1);\n firstEq = cookiePair.indexOf('='); // might still need to split on '='\n }\n } else { // non-loose mode\n if (firstEq <= 0) { // no '=' or is at start\n return; // needs to have non-empty \"cookie-name\"\n }\n }\n\n var cookieName, cookieValue;\n if (firstEq <= 0) {\n cookieName = \"\";\n cookieValue = cookiePair.trim();\n } else {\n cookieName = cookiePair.substr(0, firstEq).trim();\n cookieValue = cookiePair.substr(firstEq+1).trim();\n }\n\n if (CONTROL_CHARS.test(cookieName) || CONTROL_CHARS.test(cookieValue)) {\n return;\n }\n\n var c = new Cookie();\n c.key = cookieName;\n c.value = cookieValue;\n return c;\n}\n\nfunction parse(str, options) {\n if (!options || typeof options !== 'object') {\n options = {};\n }\n str = str.trim();\n\n // We use a regex to parse the \"name-value-pair\" part of S5.2\n var firstSemi = str.indexOf(';'); // S5.2 step 1\n var cookiePair = (firstSemi === -1) ? str : str.substr(0, firstSemi);\n var c = parseCookiePair(cookiePair, !!options.loose);\n if (!c) {\n return;\n }\n\n if (firstSemi === -1) {\n return c;\n }\n\n // S5.2.3 \"unparsed-attributes consist of the remainder of the set-cookie-string\n // (including the %x3B (\";\") in question).\" plus later on in the same section\n // \"discard the first \";\" and trim\".\n var unparsed = str.slice(firstSemi + 1).trim();\n\n // \"If the unparsed-attributes string is empty, skip the rest of these\n // steps.\"\n if (unparsed.length === 0) {\n return c;\n }\n\n /*\n * S5.2 says that when looping over the items \"[p]rocess the attribute-name\n * and attribute-value according to the requirements in the following\n * subsections\" for every item. Plus, for many of the individual attributes\n * in S5.3 it says to use the \"attribute-value of the last attribute in the\n * cookie-attribute-list\". Therefore, in this implementation, we overwrite\n * the previous value.\n */\n var cookie_avs = unparsed.split(';');\n while (cookie_avs.length) {\n var av = cookie_avs.shift().trim();\n if (av.length === 0) { // happens if \";;\" appears\n continue;\n }\n var av_sep = av.indexOf('=');\n var av_key, av_value;\n\n if (av_sep === -1) {\n av_key = av;\n av_value = null;\n } else {\n av_key = av.substr(0,av_sep);\n av_value = av.substr(av_sep+1);\n }\n\n av_key = av_key.trim().toLowerCase();\n\n if (av_value) {\n av_value = av_value.trim();\n }\n\n switch(av_key) {\n case 'expires': // S5.2.1\n if (av_value) {\n var exp = parseDate(av_value);\n // \"If the attribute-value failed to parse as a cookie date, ignore the\n // cookie-av.\"\n if (exp) {\n // over and underflow not realistically a concern: V8's getTime() seems to\n // store something larger than a 32-bit time_t (even with 32-bit node)\n c.expires = exp;\n }\n }\n break;\n\n case 'max-age': // S5.2.2\n if (av_value) {\n // \"If the first character of the attribute-value is not a DIGIT or a \"-\"\n // character ...[or]... If the remainder of attribute-value contains a\n // non-DIGIT character, ignore the cookie-av.\"\n if (/^-?[0-9]+$/.test(av_value)) {\n var delta = parseInt(av_value, 10);\n // \"If delta-seconds is less than or equal to zero (0), let expiry-time\n // be the earliest representable date and time.\"\n c.setMaxAge(delta);\n }\n }\n break;\n\n case 'domain': // S5.2.3\n // \"If the attribute-value is empty, the behavior is undefined. However,\n // the user agent SHOULD ignore the cookie-av entirely.\"\n if (av_value) {\n // S5.2.3 \"Let cookie-domain be the attribute-value without the leading %x2E\n // (\".\") character.\"\n var domain = av_value.trim().replace(/^\\./, '');\n if (domain) {\n // \"Convert the cookie-domain to lower case.\"\n c.domain = domain.toLowerCase();\n }\n }\n break;\n\n case 'path': // S5.2.4\n /*\n * \"If the attribute-value is empty or if the first character of the\n * attribute-value is not %x2F (\"/\"):\n * Let cookie-path be the default-path.\n * Otherwise:\n * Let cookie-path be the attribute-value.\"\n *\n * We'll represent the default-path as null since it depends on the\n * context of the parsing.\n */\n c.path = av_value && av_value[0] === \"/\" ? av_value : null;\n break;\n\n case 'secure': // S5.2.5\n /*\n * \"If the attribute-name case-insensitively matches the string \"Secure\",\n * the user agent MUST append an attribute to the cookie-attribute-list\n * with an attribute-name of Secure and an empty attribute-value.\"\n */\n c.secure = true;\n break;\n\n case 'httponly': // S5.2.6 -- effectively the same as 'secure'\n c.httpOnly = true;\n break;\n\n default:\n c.extensions = c.extensions || [];\n c.extensions.push(av);\n break;\n }\n }\n\n return c;\n}\n\n// avoid the V8 deoptimization monster!\nfunction jsonParse(str) {\n var obj;\n try {\n obj = JSON.parse(str);\n } catch (e) {\n return e;\n }\n return obj;\n}\n\nfunction fromJSON(str) {\n if (!str) {\n return null;\n }\n\n var obj;\n if (typeof str === 'string') {\n obj = jsonParse(str);\n if (obj instanceof Error) {\n return null;\n }\n } else {\n // assume it's an Object\n obj = str;\n }\n\n var c = new Cookie();\n for (var i=0; i<Cookie.serializableProperties.length; i++) {\n var prop = Cookie.serializableProperties[i];\n if (obj[prop] === undefined ||\n obj[prop] === Cookie.prototype[prop])\n {\n continue; // leave as prototype default\n }\n\n if (prop === 'expires' ||\n prop === 'creation' ||\n prop === 'lastAccessed')\n {\n if (obj[prop] === null) {\n c[prop] = null;\n } else {\n c[prop] = obj[prop] == \"Infinity\" ?\n \"Infinity\" : new Date(obj[prop]);\n }\n } else {\n c[prop] = obj[prop];\n }\n }\n\n return c;\n}\n\n/* Section 5.4 part 2:\n * \"* Cookies with longer paths are listed before cookies with\n * shorter paths.\n *\n * * Among cookies that have equal-length path fields, cookies with\n * earlier creation-times are listed before cookies with later\n * creation-times.\"\n */\n\nfunction cookieCompare(a,b) {\n var cmp = 0;\n\n // descending for length: b CMP a\n var aPathLen = a.path ? a.path.length : 0;\n var bPathLen = b.path ? b.path.length : 0;\n cmp = bPathLen - aPathLen;\n if (cmp !== 0) {\n return cmp;\n }\n\n // ascending for time: a CMP b\n var aTime = a.creation ? a.creation.getTime() : MAX_TIME;\n var bTime = b.creation ? b.creation.getTime() : MAX_TIME;\n cmp = aTime - bTime;\n if (cmp !== 0) {\n return cmp;\n }\n\n // break ties for the same millisecond (precision of JavaScript's clock)\n cmp = a.creationIndex - b.creationIndex;\n\n return cmp;\n}\n\n// Gives the permutation of all possible pathMatch()es of a given path. The\n// array is in longest-to-shortest order. Handy for indexing.\nfunction permutePath(path) {\n if (path === '/') {\n return ['/'];\n }\n if (path.lastIndexOf('/') === path.length-1) {\n path = path.substr(0,path.length-1);\n }\n var permutations = [path];\n while (path.length > 1) {\n var lindex = path.lastIndexOf('/');\n if (lindex === 0) {\n break;\n }\n path = path.substr(0,lindex);\n permutations.push(path);\n }\n permutations.push('/');\n return permutations;\n}\n\nfunction getCookieContext(url) {\n if (url instanceof Object) {\n return url;\n }\n // NOTE: decodeURI will throw on malformed URIs (see GH-32).\n // Therefore, we will just skip decoding for such URIs.\n try {\n url = decodeURI(url);\n }\n catch(err) {\n // Silently swallow error\n }\n\n return urlParse(url);\n}\n\nfunction Cookie(options) {\n options = options || {};\n\n Object.keys(options).forEach(function(prop) {\n if (Cookie.prototype.hasOwnProperty(prop) &&\n Cookie.prototype[prop] !== options[prop] &&\n prop.substr(0,1) !== '_')\n {\n this[prop] = options[prop];\n }\n }, this);\n\n this.creation = this.creation || new Date();\n\n // used to break creation ties in cookieCompare():\n Object.defineProperty(this, 'creationIndex', {\n configurable: false,\n enumerable: false, // important for assert.deepEqual checks\n writable: true,\n value: ++Cookie.cookiesCreated\n });\n}\n\nCookie.cookiesCreated = 0; // incremented each time a cookie is created\n\nCookie.parse = parse;\nCookie.fromJSON = fromJSON;\n\nCookie.prototype.key = \"\";\nCookie.prototype.value = \"\";\n\n// the order in which the RFC has them:\nCookie.prototype.expires = \"Infinity\"; // coerces to literal Infinity\nCookie.prototype.maxAge = null; // takes precedence over expires for TTL\nCookie.prototype.domain = null;\nCookie.prototype.path = null;\nCookie.prototype.secure = false;\nCookie.prototype.httpOnly = false;\nCookie.prototype.extensions = null;\n\n// set by the CookieJar:\nCookie.prototype.hostOnly = null; // boolean when set\nCookie.prototype.pathIsDefault = null; // boolean when set\nCookie.prototype.creation = null; // Date when set; defaulted by Cookie.parse\nCookie.prototype.lastAccessed = null; // Date when set\nObject.defineProperty(Cookie.prototype, 'creationIndex', {\n configurable: true,\n enumerable: false,\n writable: true,\n value: 0\n});\n\nCookie.serializableProperties = Object.keys(Cookie.prototype)\n .filter(function(prop) {\n return !(\n Cookie.prototype[prop] instanceof Function ||\n prop === 'creationIndex' ||\n prop.substr(0,1) === '_'\n );\n });\n\nCookie.prototype.inspect = function inspect() {\n var now = Date.now();\n return 'Cookie=\"'+this.toString() +\n '; hostOnly='+(this.hostOnly != null ? this.hostOnly : '?') +\n '; aAge='+(this.lastAccessed ? (now-this.lastAccessed.getTime())+'ms' : '?') +\n '; cAge='+(this.creation ? (now-this.creation.getTime())+'ms' : '?') +\n '\"';\n};\n\n// Use the new custom inspection symbol to add the custom inspect function if\n// available.\nif (util.inspect.custom) {\n Cookie.prototype[util.inspect.custom] = Cookie.prototype.inspect;\n}\n\nCookie.prototype.toJSON = function() {\n var obj = {};\n\n var props = Cookie.serializableProperties;\n for (var i=0; i<props.length; i++) {\n var prop = props[i];\n if (this[prop] === Cookie.prototype[prop]) {\n continue; // leave as prototype default\n }\n\n if (prop === 'expires' ||\n prop === 'creation' ||\n prop === 'lastAccessed')\n {\n if (this[prop] === null) {\n obj[prop] = null;\n } else {\n obj[prop] = this[prop] == \"Infinity\" ? // intentionally not ===\n \"Infinity\" : this[prop].toISOString();\n }\n } else if (prop === 'maxAge') {\n if (this[prop] !== null) {\n // again, intentionally not ===\n obj[prop] = (this[prop] == Infinity || this[prop] == -Infinity) ?\n this[prop].toString() : this[prop];\n }\n } else {\n if (this[prop] !== Cookie.prototype[prop]) {\n obj[prop] = this[prop];\n }\n }\n }\n\n return obj;\n};\n\nCookie.prototype.clone = function() {\n return fromJSON(this.toJSON());\n};\n\nCookie.prototype.validate = function validate() {\n if (!COOKIE_OCTETS.test(this.value)) {\n return false;\n }\n if (this.expires != Infinity && !(this.expires instanceof Date) && !parseDate(this.expires)) {\n return false;\n }\n if (this.maxAge != null && this.maxAge <= 0) {\n return false; // \"Max-Age=\" non-zero-digit *DIGIT\n }\n if (this.path != null && !PATH_VALUE.test(this.path)) {\n return false;\n }\n\n var cdomain = this.cdomain();\n if (cdomain) {\n if (cdomain.match(/\\.$/)) {\n return false; // S4.1.2.3 suggests that this is bad. domainMatch() tests confirm this\n }\n var suffix = pubsuffix.getPublicSuffix(cdomain);\n if (suffix == null) { // it's a public suffix\n return false;\n }\n }\n return true;\n};\n\nCookie.prototype.setExpires = function setExpires(exp) {\n if (exp instanceof Date) {\n this.expires = exp;\n } else {\n this.expires = parseDate(exp) || \"Infinity\";\n }\n};\n\nCookie.prototype.setMaxAge = function setMaxAge(age) {\n if (age === Infinity || age === -Infinity) {\n this.maxAge = age.toString(); // so JSON.stringify() works\n } else {\n this.maxAge = age;\n }\n};\n\n// gives Cookie header format\nCookie.prototype.cookieString = function cookieString() {\n var val = this.value;\n if (val == null) {\n val = '';\n }\n if (this.key === '') {\n return val;\n }\n return this.key+'='+val;\n};\n\n// gives Set-Cookie header format\nCookie.prototype.toString = function toString() {\n var str = this.cookieString();\n\n if (this.expires != Infinity) {\n if (this.expires instanceof Date) {\n str += '; Expires='+formatDate(this.expires);\n } else {\n str += '; Expires='+this.expires;\n }\n }\n\n if (this.maxAge != null && this.maxAge != Infinity) {\n str += '; Max-Age='+this.maxAge;\n }\n\n if (this.domain && !this.hostOnly) {\n str += '; Domain='+this.domain;\n }\n if (this.path) {\n str += '; Path='+this.path;\n }\n\n if (this.secure) {\n str += '; Secure';\n }\n if (this.httpOnly) {\n str += '; HttpOnly';\n }\n if (this.extensions) {\n this.extensions.forEach(function(ext) {\n str += '; '+ext;\n });\n }\n\n return str;\n};\n\n// TTL() partially replaces the \"expiry-time\" parts of S5.3 step 3 (setCookie()\n// elsewhere)\n// S5.3 says to give the \"latest representable date\" for which we use Infinity\n// For \"expired\" we use 0\nCookie.prototype.TTL = function TTL(now) {\n /* RFC6265 S4.1.2.2 If a cookie has both the Max-Age and the Expires\n * attribute, the Max-Age attribute has precedence and controls the\n * expiration date of the cookie.\n * (Concurs with S5.3 step 3)\n */\n if (this.maxAge != null) {\n return this.maxAge<=0 ? 0 : this.maxAge*1000;\n }\n\n var expires = this.expires;\n if (expires != Infinity) {\n if (!(expires instanceof Date)) {\n expires = parseDate(expires) || Infinity;\n }\n\n if (expires == Infinity) {\n return Infinity;\n }\n\n return expires.getTime() - (now || Date.now());\n }\n\n return Infinity;\n};\n\n// expiryTime() replaces the \"expiry-time\" parts of S5.3 step 3 (setCookie()\n// elsewhere)\nCookie.prototype.expiryTime = function expiryTime(now) {\n if (this.maxAge != null) {\n var relativeTo = now || this.creation || new Date();\n var age = (this.maxAge <= 0) ? -Infinity : this.maxAge*1000;\n return relativeTo.getTime() + age;\n }\n\n if (this.expires == Infinity) {\n return Infinity;\n }\n return this.expires.getTime();\n};\n\n// expiryDate() replaces the \"expiry-time\" parts of S5.3 step 3 (setCookie()\n// elsewhere), except it returns a Date\nCookie.prototype.expiryDate = function expiryDate(now) {\n var millisec = this.expiryTime(now);\n if (millisec == Infinity) {\n return new Date(MAX_TIME);\n } else if (millisec == -Infinity) {\n return new Date(MIN_TIME);\n } else {\n return new Date(millisec);\n }\n};\n\n// This replaces the \"persistent-flag\" parts of S5.3 step 3\nCookie.prototype.isPersistent = function isPersistent() {\n return (this.maxAge != null || this.expires != Infinity);\n};\n\n// Mostly S5.1.2 and S5.2.3:\nCookie.prototype.cdomain =\nCookie.prototype.canonicalizedDomain = function canonicalizedDomain() {\n if (this.domain == null) {\n return null;\n }\n return canonicalDomain(this.domain);\n};\n\nfunction CookieJar(store, options) {\n if (typeof options === \"boolean\") {\n options = {rejectPublicSuffixes: options};\n } else if (options == null) {\n options = {};\n }\n if (options.rejectPublicSuffixes != null) {\n this.rejectPublicSuffixes = options.rejectPublicSuffixes;\n }\n if (options.looseMode != null) {\n this.enableLooseMode = options.looseMode;\n }\n\n if (!store) {\n store = new MemoryCookieStore();\n }\n this.store = store;\n}\nCookieJar.prototype.store = null;\nCookieJar.prototype.rejectPublicSuffixes = true;\nCookieJar.prototype.enableLooseMode = false;\nvar CAN_BE_SYNC = [];\n\nCAN_BE_SYNC.push('setCookie');\nCookieJar.prototype.setCookie = function(cookie, url, options, cb) {\n var err;\n var context = getCookieContext(url);\n if (options instanceof Function) {\n cb = options;\n options = {};\n }\n\n var host = canonicalDomain(context.hostname);\n var loose = this.enableLooseMode;\n if (options.loose != null) {\n loose = options.loose;\n }\n\n // S5.3 step 1\n if (!(cookie instanceof Cookie)) {\n cookie = Cookie.parse(cookie, { loose: loose });\n }\n if (!cookie) {\n err = new Error(\"Cookie failed to parse\");\n return cb(options.ignoreError ? null : err);\n }\n\n // S5.3 step 2\n var now = options.now || new Date(); // will assign later to save effort in the face of errors\n\n // S5.3 step 3: NOOP; persistent-flag and expiry-time is handled by getCookie()\n\n // S5.3 step 4: NOOP; domain is null by default\n\n // S5.3 step 5: public suffixes\n if (this.rejectPublicSuffixes && cookie.domain) {\n var suffix = pubsuffix.getPublicSuffix(cookie.cdomain());\n if (suffix == null) { // e.g. \"com\"\n err = new Error(\"Cookie has domain set to a public suffix\");\n return cb(options.ignoreError ? null : err);\n }\n }\n\n // S5.3 step 6:\n if (cookie.domain) {\n if (!domainMatch(host, cookie.cdomain(), false)) {\n err = new Error(\"Cookie not in this host's domain. Cookie:\"+cookie.cdomain()+\" Request:\"+host);\n return cb(options.ignoreError ? null : err);\n }\n\n if (cookie.hostOnly == null) { // don't reset if already set\n cookie.hostOnly = false;\n }\n\n } else {\n cookie.hostOnly = true;\n cookie.domain = host;\n }\n\n //S5.2.4 If the attribute-value is empty or if the first character of the\n //attribute-value is not %x2F (\"/\"):\n //Let cookie-path be the default-path.\n if (!cookie.path || cookie.path[0] !== '/') {\n cookie.path = defaultPath(context.pathname);\n cookie.pathIsDefault = true;\n }\n\n // S5.3 step 8: NOOP; secure attribute\n // S5.3 step 9: NOOP; httpOnly attribute\n\n // S5.3 step 10\n if (options.http === false && cookie.httpOnly) {\n err = new Error(\"Cookie is HttpOnly and this isn't an HTTP API\");\n return cb(options.ignoreError ? null : err);\n }\n\n var store = this.store;\n\n if (!store.updateCookie) {\n store.updateCookie = function(oldCookie, newCookie, cb) {\n this.putCookie(newCookie, cb);\n };\n }\n\n function withCookie(err, oldCookie) {\n if (err) {\n return cb(err);\n }\n\n var next = function(err) {\n if (err) {\n return cb(err);\n } else {\n cb(null, cookie);\n }\n };\n\n if (oldCookie) {\n // S5.3 step 11 - \"If the cookie store contains a cookie with the same name,\n // domain, and path as the newly created cookie:\"\n if (options.http === false && oldCookie.httpOnly) { // step 11.2\n err = new Error(\"old Cookie is HttpOnly and this isn't an HTTP API\");\n return cb(options.ignoreError ? null : err);\n }\n cookie.creation = oldCookie.creation; // step 11.3\n cookie.creationIndex = oldCookie.creationIndex; // preserve tie-breaker\n cookie.lastAccessed = now;\n // Step 11.4 (delete cookie) is implied by just setting the new one:\n store.updateCookie(oldCookie, cookie, next); // step 12\n\n } else {\n cookie.creation = cookie.lastAccessed = now;\n store.putCookie(cookie, next); // step 12\n }\n }\n\n store.findCookie(cookie.domain, cookie.path, cookie.key, withCookie);\n};\n\n// RFC6365 S5.4\nCAN_BE_SYNC.push('getCookies');\nCookieJar.prototype.getCookies = function(url, options, cb) {\n var context = getCookieContext(url);\n if (options instanceof Function) {\n cb = options;\n options = {};\n }\n\n var host = canonicalDomain(context.hostname);\n var path = context.pathname || '/';\n\n var secure = options.secure;\n if (secure == null && context.protocol &&\n (context.protocol == 'https:' || context.protocol == 'wss:'))\n {\n secure = true;\n }\n\n var http = options.http;\n if (http == null) {\n http = true;\n }\n\n var now = options.now || Date.now();\n var expireCheck = options.expire !== false;\n var allPaths = !!options.allPaths;\n var store = this.store;\n\n function matchingCookie(c) {\n // \"Either:\n // The cookie's host-only-flag is true and the canonicalized\n // request-host is identical to the cookie's domain.\n // Or:\n // The cookie's host-only-flag is false and the canonicalized\n // request-host domain-matches the cookie's domain.\"\n if (c.hostOnly) {\n if (c.domain != host) {\n return false;\n }\n } else {\n if (!domainMatch(host, c.domain, false)) {\n return false;\n }\n }\n\n // \"The request-uri's path path-matches the cookie's path.\"\n if (!allPaths && !pathMatch(path, c.path)) {\n return false;\n }\n\n // \"If the cookie's secure-only-flag is true, then the request-uri's\n // scheme must denote a \"secure\" protocol\"\n if (c.secure && !secure) {\n return false;\n }\n\n // \"If the cookie's http-only-flag is true, then exclude the cookie if the\n // cookie-string is being generated for a \"non-HTTP\" API\"\n if (c.httpOnly && !http) {\n return false;\n }\n\n // deferred from S5.3\n // non-RFC: allow retention of expired cookies by choice\n if (expireCheck && c.expiryTime() <= now) {\n store.removeCookie(c.domain, c.path, c.key, function(){}); // result ignored\n return false;\n }\n\n return true;\n }\n\n store.findCookies(host, allPaths ? null : path, function(err,cookies) {\n if (err) {\n return cb(err);\n }\n\n cookies = cookies.filter(matchingCookie);\n\n // sorting of S5.4 part 2\n if (options.sort !== false) {\n cookies = cookies.sort(cookieCompare);\n }\n\n // S5.4 part 3\n var now = new Date();\n cookies.forEach(function(c) {\n c.lastAccessed = now;\n });\n // TODO persist lastAccessed\n\n cb(null,cookies);\n });\n};\n\nCAN_BE_SYNC.push('getCookieString');\nCookieJar.prototype.getCookieString = function(/*..., cb*/) {\n var args = Array.prototype.slice.call(arguments,0);\n var cb = args.pop();\n var next = function(err,cookies) {\n if (err) {\n cb(err);\n } else {\n cb(null, cookies\n .sort(cookieCompare)\n .map(function(c){\n return c.cookieString();\n })\n .join('; '));\n }\n };\n args.push(next);\n this.getCookies.apply(this,args);\n};\n\nCAN_BE_SYNC.push('getSetCookieStrings');\nCookieJar.prototype.getSetCookieStrings = function(/*..., cb*/) {\n var args = Array.prototype.slice.call(arguments,0);\n var cb = args.pop();\n var next = function(err,cookies) {\n if (err) {\n cb(err);\n } else {\n cb(null, cookies.map(function(c){\n return c.toString();\n }));\n }\n };\n args.push(next);\n this.getCookies.apply(this,args);\n};\n\nCAN_BE_SYNC.push('serialize');\nCookieJar.prototype.serialize = function(cb) {\n var type = this.store.constructor.name;\n if (type === 'Object') {\n type = null;\n }\n\n // update README.md \"Serialization Format\" if you change this, please!\n var serialized = {\n // The version of tough-cookie that serialized this jar. Generally a good\n // practice since future versions can make data import decisions based on\n // known past behavior. When/if this matters, use `semver`.\n version: 'tough-cookie@'+VERSION,\n\n // add the store type, to make humans happy:\n storeType: type,\n\n // CookieJar configuration:\n rejectPublicSuffixes: !!this.rejectPublicSuffixes,\n\n // this gets filled from getAllCookies:\n cookies: []\n };\n\n if (!(this.store.getAllCookies &&\n typeof this.store.getAllCookies === 'function'))\n {\n return cb(new Error('store does not support getAllCookies and cannot be serialized'));\n }\n\n this.store.getAllCookies(function(err,cookies) {\n if (err) {\n return cb(err);\n }\n\n serialized.cookies = cookies.map(function(cookie) {\n // convert to serialized 'raw' cookies\n cookie = (cookie instanceof Cookie) ? cookie.toJSON() : cookie;\n\n // Remove the index so new ones get assigned during deserialization\n delete cookie.creationIndex;\n\n return cookie;\n });\n\n return cb(null, serialized);\n });\n};\n\n// well-known name that JSON.stringify calls\nCookieJar.prototype.toJSON = function() {\n return this.serializeSync();\n};\n\n// use the class method CookieJar.deserialize instead of calling this directly\nCAN_BE_SYNC.push('_importCookies');\nCookieJar.prototype._importCookies = function(serialized, cb) {\n var jar = this;\n var cookies = serialized.cookies;\n if (!cookies || !Array.isArray(cookies)) {\n return cb(new Error('serialized jar has no cookies array'));\n }\n cookies = cookies.slice(); // do not modify the original\n\n function putNext(err) {\n if (err) {\n return cb(err);\n }\n\n if (!cookies.length) {\n return cb(err, jar);\n }\n\n var cookie;\n try {\n cookie = fromJSON(cookies.shift());\n } catch (e) {\n return cb(e);\n }\n\n if (cookie === null) {\n return putNext(null); // skip this cookie\n }\n\n jar.store.putCookie(cookie, putNext);\n }\n\n putNext();\n};\n\nCookieJar.deserialize = function(strOrObj, store, cb) {\n if (arguments.length !== 3) {\n // store is optional\n cb = store;\n store = null;\n }\n\n var serialized;\n if (typeof strOrObj === 'string') {\n serialized = jsonParse(strOrObj);\n if (serialized instanceof Error) {\n return cb(serialized);\n }\n } else {\n serialized = strOrObj;\n }\n\n var jar = new CookieJar(store, serialized.rejectPublicSuffixes);\n jar._importCookies(serialized, function(err) {\n if (err) {\n return cb(err);\n }\n cb(null, jar);\n });\n};\n\nCookieJar.deserializeSync = function(strOrObj, store) {\n var serialized = typeof strOrObj === 'string' ?\n JSON.parse(strOrObj) : strOrObj;\n var jar = new CookieJar(store, serialized.rejectPublicSuffixes);\n\n // catch this mistake early:\n if (!jar.store.synchronous) {\n throw new Error('CookieJar store is not synchronous; use async API instead.');\n }\n\n jar._importCookiesSync(serialized);\n return jar;\n};\nCookieJar.fromJSON = CookieJar.deserializeSync;\n\nCookieJar.prototype.clone = function(newStore, cb) {\n if (arguments.length === 1) {\n cb = newStore;\n newStore = null;\n }\n\n this.serialize(function(err,serialized) {\n if (err) {\n return cb(err);\n }\n CookieJar.deserialize(serialized, newStore, cb);\n });\n};\n\nCAN_BE_SYNC.push('removeAllCookies');\nCookieJar.prototype.removeAllCookies = function(cb) {\n var store = this.store;\n\n // Check that the store implements its own removeAllCookies(). The default\n // implementation in Store will immediately call the callback with a \"not\n // implemented\" Error.\n if (store.removeAllCookies instanceof Function &&\n store.removeAllCookies !== Store.prototype.removeAllCookies)\n {\n return store.removeAllCookies(cb);\n }\n\n store.getAllCookies(function(err, cookies) {\n if (err) {\n return cb(err);\n }\n\n if (cookies.length === 0) {\n return cb(null);\n }\n\n var completedCount = 0;\n var removeErrors = [];\n\n function removeCookieCb(removeErr) {\n if (removeErr) {\n removeErrors.push(removeErr);\n }\n\n completedCount++;\n\n if (completedCount === cookies.length) {\n return cb(removeErrors.length ? removeErrors[0] : null);\n }\n }\n\n cookies.forEach(function(cookie) {\n store.removeCookie(cookie.domain, cookie.path, cookie.key, removeCookieCb);\n });\n });\n};\n\nCookieJar.prototype._cloneSync = syncWrap('clone');\nCookieJar.prototype.cloneSync = function(newStore) {\n if (!newStore.synchronous) {\n throw new Error('CookieJar clone destination store is not synchronous; use async API instead.');\n }\n return this._cloneSync(newStore);\n};\n\n// Use a closure to provide a true imperative API for synchronous stores.\nfunction syncWrap(method) {\n return function() {\n if (!this.store.synchronous) {\n throw new Error('CookieJar store is not synchronous; use async API instead.');\n }\n\n var args = Array.prototype.slice.call(arguments);\n var syncErr, syncResult;\n args.push(function syncCb(err, result) {\n syncErr = err;\n syncResult = result;\n });\n this[method].apply(this, args);\n\n if (syncErr) {\n throw syncErr;\n }\n return syncResult;\n };\n}\n\n// wrap all declared CAN_BE_SYNC methods in the sync wrapper\nCAN_BE_SYNC.forEach(function(method) {\n CookieJar.prototype[method+'Sync'] = syncWrap(method);\n});\n\nexports.version = VERSION;\nexports.CookieJar = CookieJar;\nexports.Cookie = Cookie;\nexports.Store = Store;\nexports.MemoryCookieStore = MemoryCookieStore;\nexports.parseDate = parseDate;\nexports.formatDate = formatDate;\nexports.parse = parse;\nexports.fromJSON = fromJSON;\nexports.domainMatch = domainMatch;\nexports.defaultPath = defaultPath;\nexports.pathMatch = pathMatch;\nexports.getPublicSuffix = pubsuffix.getPublicSuffix;\nexports.cookieCompare = cookieCompare;\nexports.permuteDomain = __webpack_require__(/*! ./permuteDomain */ \"./node_modules/tough-cookie/lib/permuteDomain.js\").permuteDomain;\nexports.permutePath = permutePath;\nexports.canonicalDomain = canonicalDomain;\n\n\n//# sourceURL=webpack://@k8slens/open-lens/./node_modules/tough-cookie/lib/cookie.js?");
27640
-
27641
- /***/ }),
27642
-
27643
- /***/ "./node_modules/tough-cookie/lib/memstore.js":
27644
- /*!***************************************************!*\
27645
- !*** ./node_modules/tough-cookie/lib/memstore.js ***!
27646
- \***************************************************/
27647
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
27648
-
27649
- "use strict";
27650
- eval("/*!\n * Copyright (c) 2015, Salesforce.com, Inc.\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * 1. Redistributions of source code must retain the above copyright notice,\n * this list of conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following disclaimer in the documentation\n * and/or other materials provided with the distribution.\n *\n * 3. Neither the name of Salesforce.com nor the names of its contributors may\n * be used to endorse or promote products derived from this software without\n * specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n */\n\nvar Store = (__webpack_require__(/*! ./store */ \"./node_modules/tough-cookie/lib/store.js\").Store);\nvar permuteDomain = (__webpack_require__(/*! ./permuteDomain */ \"./node_modules/tough-cookie/lib/permuteDomain.js\").permuteDomain);\nvar pathMatch = (__webpack_require__(/*! ./pathMatch */ \"./node_modules/tough-cookie/lib/pathMatch.js\").pathMatch);\nvar util = __webpack_require__(/*! util */ \"util\");\n\nfunction MemoryCookieStore() {\n Store.call(this);\n this.idx = {};\n}\nutil.inherits(MemoryCookieStore, Store);\nexports.MemoryCookieStore = MemoryCookieStore;\nMemoryCookieStore.prototype.idx = null;\n\n// Since it's just a struct in RAM, this Store is synchronous\nMemoryCookieStore.prototype.synchronous = true;\n\n// force a default depth:\nMemoryCookieStore.prototype.inspect = function() {\n return \"{ idx: \"+util.inspect(this.idx, false, 2)+' }';\n};\n\n// Use the new custom inspection symbol to add the custom inspect function if\n// available.\nif (util.inspect.custom) {\n MemoryCookieStore.prototype[util.inspect.custom] = MemoryCookieStore.prototype.inspect;\n}\n\nMemoryCookieStore.prototype.findCookie = function(domain, path, key, cb) {\n if (!this.idx[domain]) {\n return cb(null,undefined);\n }\n if (!this.idx[domain][path]) {\n return cb(null,undefined);\n }\n return cb(null,this.idx[domain][path][key]||null);\n};\n\nMemoryCookieStore.prototype.findCookies = function(domain, path, cb) {\n var results = [];\n if (!domain) {\n return cb(null,[]);\n }\n\n var pathMatcher;\n if (!path) {\n // null means \"all paths\"\n pathMatcher = function matchAll(domainIndex) {\n for (var curPath in domainIndex) {\n var pathIndex = domainIndex[curPath];\n for (var key in pathIndex) {\n results.push(pathIndex[key]);\n }\n }\n };\n\n } else {\n pathMatcher = function matchRFC(domainIndex) {\n //NOTE: we should use path-match algorithm from S5.1.4 here\n //(see : https://github.com/ChromiumWebApps/chromium/blob/b3d3b4da8bb94c1b2e061600df106d590fda3620/net/cookies/canonical_cookie.cc#L299)\n Object.keys(domainIndex).forEach(function (cookiePath) {\n if (pathMatch(path, cookiePath)) {\n var pathIndex = domainIndex[cookiePath];\n\n for (var key in pathIndex) {\n results.push(pathIndex[key]);\n }\n }\n });\n };\n }\n\n var domains = permuteDomain(domain) || [domain];\n var idx = this.idx;\n domains.forEach(function(curDomain) {\n var domainIndex = idx[curDomain];\n if (!domainIndex) {\n return;\n }\n pathMatcher(domainIndex);\n });\n\n cb(null,results);\n};\n\nMemoryCookieStore.prototype.putCookie = function(cookie, cb) {\n if (!this.idx[cookie.domain]) {\n this.idx[cookie.domain] = {};\n }\n if (!this.idx[cookie.domain][cookie.path]) {\n this.idx[cookie.domain][cookie.path] = {};\n }\n this.idx[cookie.domain][cookie.path][cookie.key] = cookie;\n cb(null);\n};\n\nMemoryCookieStore.prototype.updateCookie = function(oldCookie, newCookie, cb) {\n // updateCookie() may avoid updating cookies that are identical. For example,\n // lastAccessed may not be important to some stores and an equality\n // comparison could exclude that field.\n this.putCookie(newCookie,cb);\n};\n\nMemoryCookieStore.prototype.removeCookie = function(domain, path, key, cb) {\n if (this.idx[domain] && this.idx[domain][path] && this.idx[domain][path][key]) {\n delete this.idx[domain][path][key];\n }\n cb(null);\n};\n\nMemoryCookieStore.prototype.removeCookies = function(domain, path, cb) {\n if (this.idx[domain]) {\n if (path) {\n delete this.idx[domain][path];\n } else {\n delete this.idx[domain];\n }\n }\n return cb(null);\n};\n\nMemoryCookieStore.prototype.removeAllCookies = function(cb) {\n this.idx = {};\n return cb(null);\n}\n\nMemoryCookieStore.prototype.getAllCookies = function(cb) {\n var cookies = [];\n var idx = this.idx;\n\n var domains = Object.keys(idx);\n domains.forEach(function(domain) {\n var paths = Object.keys(idx[domain]);\n paths.forEach(function(path) {\n var keys = Object.keys(idx[domain][path]);\n keys.forEach(function(key) {\n if (key !== null) {\n cookies.push(idx[domain][path][key]);\n }\n });\n });\n });\n\n // Sort by creationIndex so deserializing retains the creation order.\n // When implementing your own store, this SHOULD retain the order too\n cookies.sort(function(a,b) {\n return (a.creationIndex||0) - (b.creationIndex||0);\n });\n\n cb(null, cookies);\n};\n\n\n//# sourceURL=webpack://@k8slens/open-lens/./node_modules/tough-cookie/lib/memstore.js?");
27651
-
27652
- /***/ }),
27653
-
27654
- /***/ "./node_modules/tough-cookie/lib/pathMatch.js":
27655
- /*!****************************************************!*\
27656
- !*** ./node_modules/tough-cookie/lib/pathMatch.js ***!
27657
- \****************************************************/
27658
- /***/ ((__unused_webpack_module, exports) => {
27659
-
27660
- "use strict";
27661
- eval("/*!\n * Copyright (c) 2015, Salesforce.com, Inc.\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * 1. Redistributions of source code must retain the above copyright notice,\n * this list of conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following disclaimer in the documentation\n * and/or other materials provided with the distribution.\n *\n * 3. Neither the name of Salesforce.com nor the names of its contributors may\n * be used to endorse or promote products derived from this software without\n * specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n */\n\n/*\n * \"A request-path path-matches a given cookie-path if at least one of the\n * following conditions holds:\"\n */\nfunction pathMatch (reqPath, cookiePath) {\n // \"o The cookie-path and the request-path are identical.\"\n if (cookiePath === reqPath) {\n return true;\n }\n\n var idx = reqPath.indexOf(cookiePath);\n if (idx === 0) {\n // \"o The cookie-path is a prefix of the request-path, and the last\n // character of the cookie-path is %x2F (\"/\").\"\n if (cookiePath.substr(-1) === \"/\") {\n return true;\n }\n\n // \" o The cookie-path is a prefix of the request-path, and the first\n // character of the request-path that is not included in the cookie- path\n // is a %x2F (\"/\") character.\"\n if (reqPath.substr(cookiePath.length, 1) === \"/\") {\n return true;\n }\n }\n\n return false;\n}\n\nexports.pathMatch = pathMatch;\n\n\n//# sourceURL=webpack://@k8slens/open-lens/./node_modules/tough-cookie/lib/pathMatch.js?");
27662
-
27663
- /***/ }),
27664
-
27665
- /***/ "./node_modules/tough-cookie/lib/permuteDomain.js":
27666
- /*!********************************************************!*\
27667
- !*** ./node_modules/tough-cookie/lib/permuteDomain.js ***!
27668
- \********************************************************/
27669
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
27670
-
27671
- "use strict";
27672
- eval("/*!\n * Copyright (c) 2015, Salesforce.com, Inc.\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * 1. Redistributions of source code must retain the above copyright notice,\n * this list of conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following disclaimer in the documentation\n * and/or other materials provided with the distribution.\n *\n * 3. Neither the name of Salesforce.com nor the names of its contributors may\n * be used to endorse or promote products derived from this software without\n * specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n */\n\nvar pubsuffix = __webpack_require__(/*! ./pubsuffix-psl */ \"./node_modules/tough-cookie/lib/pubsuffix-psl.js\");\n\n// Gives the permutation of all possible domainMatch()es of a given domain. The\n// array is in shortest-to-longest order. Handy for indexing.\nfunction permuteDomain (domain) {\n var pubSuf = pubsuffix.getPublicSuffix(domain);\n if (!pubSuf) {\n return null;\n }\n if (pubSuf == domain) {\n return [domain];\n }\n\n var prefix = domain.slice(0, -(pubSuf.length + 1)); // \".example.com\"\n var parts = prefix.split('.').reverse();\n var cur = pubSuf;\n var permutations = [cur];\n while (parts.length) {\n cur = parts.shift() + '.' + cur;\n permutations.push(cur);\n }\n return permutations;\n}\n\nexports.permuteDomain = permuteDomain;\n\n\n//# sourceURL=webpack://@k8slens/open-lens/./node_modules/tough-cookie/lib/permuteDomain.js?");
27673
-
27674
- /***/ }),
27675
-
27676
- /***/ "./node_modules/tough-cookie/lib/pubsuffix-psl.js":
27677
- /*!********************************************************!*\
27678
- !*** ./node_modules/tough-cookie/lib/pubsuffix-psl.js ***!
27679
- \********************************************************/
27680
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
27681
-
27682
- "use strict";
27683
- eval("/*!\n * Copyright (c) 2018, Salesforce.com, Inc.\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * 1. Redistributions of source code must retain the above copyright notice,\n * this list of conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following disclaimer in the documentation\n * and/or other materials provided with the distribution.\n *\n * 3. Neither the name of Salesforce.com nor the names of its contributors may\n * be used to endorse or promote products derived from this software without\n * specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n */\n\nvar psl = __webpack_require__(/*! psl */ \"./node_modules/psl/index.js\");\n\nfunction getPublicSuffix(domain) {\n return psl.get(domain);\n}\n\nexports.getPublicSuffix = getPublicSuffix;\n\n\n//# sourceURL=webpack://@k8slens/open-lens/./node_modules/tough-cookie/lib/pubsuffix-psl.js?");
27684
-
27685
- /***/ }),
27686
-
27687
- /***/ "./node_modules/tough-cookie/lib/store.js":
27688
- /*!************************************************!*\
27689
- !*** ./node_modules/tough-cookie/lib/store.js ***!
27690
- \************************************************/
27691
- /***/ ((__unused_webpack_module, exports) => {
27692
-
27693
- "use strict";
27694
- eval("/*!\n * Copyright (c) 2015, Salesforce.com, Inc.\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * 1. Redistributions of source code must retain the above copyright notice,\n * this list of conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following disclaimer in the documentation\n * and/or other materials provided with the distribution.\n *\n * 3. Neither the name of Salesforce.com nor the names of its contributors may\n * be used to endorse or promote products derived from this software without\n * specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n */\n\n/*jshint unused:false */\n\nfunction Store() {\n}\nexports.Store = Store;\n\n// Stores may be synchronous, but are still required to use a\n// Continuation-Passing Style API. The CookieJar itself will expose a \"*Sync\"\n// API that converts from synchronous-callbacks to imperative style.\nStore.prototype.synchronous = false;\n\nStore.prototype.findCookie = function(domain, path, key, cb) {\n throw new Error('findCookie is not implemented');\n};\n\nStore.prototype.findCookies = function(domain, path, cb) {\n throw new Error('findCookies is not implemented');\n};\n\nStore.prototype.putCookie = function(cookie, cb) {\n throw new Error('putCookie is not implemented');\n};\n\nStore.prototype.updateCookie = function(oldCookie, newCookie, cb) {\n // recommended default implementation:\n // return this.putCookie(newCookie, cb);\n throw new Error('updateCookie is not implemented');\n};\n\nStore.prototype.removeCookie = function(domain, path, key, cb) {\n throw new Error('removeCookie is not implemented');\n};\n\nStore.prototype.removeCookies = function(domain, path, cb) {\n throw new Error('removeCookies is not implemented');\n};\n\nStore.prototype.removeAllCookies = function(cb) {\n throw new Error('removeAllCookies is not implemented');\n}\n\nStore.prototype.getAllCookies = function(cb) {\n throw new Error('getAllCookies is not implemented (therefore jar cannot be serialized)');\n};\n\n\n//# sourceURL=webpack://@k8slens/open-lens/./node_modules/tough-cookie/lib/store.js?");
27695
-
27696
- /***/ }),
27697
-
27698
- /***/ "./node_modules/tough-cookie/lib/version.js":
27699
- /*!**************************************************!*\
27700
- !*** ./node_modules/tough-cookie/lib/version.js ***!
27701
- \**************************************************/
27702
- /***/ ((module) => {
27703
-
27704
- eval("// generated by genversion\nmodule.exports = '2.5.0'\n\n\n//# sourceURL=webpack://@k8slens/open-lens/./node_modules/tough-cookie/lib/version.js?");
27705
-
27706
- /***/ }),
27707
-
27708
27718
  /***/ "./node_modules/triple-beam/config/cli.js":
27709
27719
  /*!************************************************!*\
27710
27720
  !*** ./node_modules/triple-beam/config/cli.js ***!
@@ -28097,7 +28107,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
28097
28107
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
28098
28108
 
28099
28109
  "use strict";
28100
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"Cluster\": () => (/* binding */ Cluster)\n/* harmony export */ });\n/* harmony import */ var mobx__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! mobx */ \"./node_modules/mobx/dist/mobx.esm.js\");\n/* harmony import */ var _kubernetes_client_node__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @kubernetes/client-node */ \"./node_modules/@kubernetes/client-node/dist/index.js\");\n/* harmony import */ var _kubernetes_client_node__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_kubernetes_client_node__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _rbac__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../rbac */ \"./src/common/rbac.ts\");\n/* harmony import */ var p_limit__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! p-limit */ \"./node_modules/p-limit/index.js\");\n/* harmony import */ var p_limit__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(p_limit__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _cluster_types__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../cluster-types */ \"./src/common/cluster-types.ts\");\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../utils */ \"./src/common/utils/index.ts\");\n/* harmony import */ var _ipc_cluster__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../ipc/cluster */ \"./src/common/ipc/cluster.ts\");\n/* harmony import */ var assert__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! assert */ \"assert\");\n/* harmony import */ var assert__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(assert__WEBPACK_IMPORTED_MODULE_6__);\n/**\n * Copyright (c) OpenLens Authors. All rights reserved.\n * Licensed under MIT License. See LICENSE in root directory for more information.\n */\nvar __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n 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;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __metadata = (undefined && undefined.__metadata) || function (k, v) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(k, v);\n};\n\n\n\n\n\n\n\n\n/**\n * Cluster\n *\n * @beta\n */\nclass Cluster {\n get contextHandler() {\n // TODO: remove these once main/renderer are seperate classes\n assert__WEBPACK_IMPORTED_MODULE_6___default()(this._contextHandler, \"contextHandler is only defined in the main environment\");\n return this._contextHandler;\n }\n get proxyKubeconfigManager() {\n // TODO: remove these once main/renderer are seperate classes\n assert__WEBPACK_IMPORTED_MODULE_6___default()(this._proxyKubeconfigManager, \"proxyKubeconfigManager is only defined in the main environment\");\n return this._proxyKubeconfigManager;\n }\n get whenReady() {\n return (0,mobx__WEBPACK_IMPORTED_MODULE_7__.when)(() => this.ready);\n }\n /**\n * Is cluster available\n *\n * @computed\n */\n get available() {\n return this.accessible && !this.disconnected;\n }\n /**\n * Cluster name\n *\n * @computed\n */\n get name() {\n return this.preferences.clusterName || this.contextName;\n }\n /**\n * The detected kubernetes distribution\n */\n get distribution() {\n var _a;\n return ((_a = this.metadata[_cluster_types__WEBPACK_IMPORTED_MODULE_3__.ClusterMetadataKey.DISTRIBUTION]) === null || _a === void 0 ? void 0 : _a.toString()) || \"unknown\";\n }\n /**\n * The detected kubernetes version\n */\n get version() {\n var _a;\n return ((_a = this.metadata[_cluster_types__WEBPACK_IMPORTED_MODULE_3__.ClusterMetadataKey.VERSION]) === null || _a === void 0 ? void 0 : _a.toString()) || \"unknown\";\n }\n /**\n * Prometheus preferences\n *\n * @computed\n * @internal\n */\n get prometheusPreferences() {\n const { prometheus, prometheusProvider } = this.preferences;\n return (0,_utils__WEBPACK_IMPORTED_MODULE_4__.toJS)({ prometheus, prometheusProvider });\n }\n /**\n * defaultNamespace preference\n *\n * @computed\n * @internal\n */\n get defaultNamespace() {\n return this.preferences.defaultNamespace;\n }\n constructor(dependencies, { id, ...model }, configData) {\n Object.defineProperty(this, \"dependencies\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: dependencies\n });\n /** Unique id for a cluster */\n Object.defineProperty(this, \"id\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"kubeCtl\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n /**\n * Context handler\n *\n * @internal\n */\n Object.defineProperty(this, \"_contextHandler\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"_proxyKubeconfigManager\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"eventsDisposer\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: (0,_utils__WEBPACK_IMPORTED_MODULE_4__.disposer)()\n });\n Object.defineProperty(this, \"activated\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: false\n });\n /**\n * Kubeconfig context name\n *\n * @observable\n */\n Object.defineProperty(this, \"contextName\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n /**\n * Path to kubeconfig\n *\n * @observable\n */\n Object.defineProperty(this, \"kubeConfigPath\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n /**\n * @deprecated\n */\n Object.defineProperty(this, \"workspace\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n /**\n * @deprecated\n */\n Object.defineProperty(this, \"workspaces\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n /**\n * Kubernetes API server URL\n *\n * @observable\n */\n Object.defineProperty(this, \"apiUrl\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n }); // cluster server url\n /**\n * Is cluster online\n *\n * @observable\n */\n Object.defineProperty(this, \"online\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: false\n }); // describes if we can detect that cluster is online\n /**\n * Can user access cluster resources\n *\n * @observable\n */\n Object.defineProperty(this, \"accessible\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: false\n }); // if user is able to access cluster resources\n /**\n * Is cluster instance in usable state\n *\n * @observable\n */\n Object.defineProperty(this, \"ready\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: false\n }); // cluster is in usable state\n /**\n * Is cluster currently reconnecting\n *\n * @observable\n */\n Object.defineProperty(this, \"reconnecting\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: false\n });\n /**\n * Is cluster disconnected. False if user has selected to connect.\n *\n * @observable\n */\n Object.defineProperty(this, \"disconnected\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: true\n });\n /**\n * Does user have admin like access\n *\n * @observable\n */\n Object.defineProperty(this, \"isAdmin\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: false\n });\n /**\n * Global watch-api accessibility , e.g. \"/api/v1/services?watch=1\"\n *\n * @observable\n */\n Object.defineProperty(this, \"isGlobalWatchEnabled\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: false\n });\n /**\n * Preferences\n *\n * @observable\n */\n Object.defineProperty(this, \"preferences\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: {}\n });\n /**\n * Metadata\n *\n * @observable\n */\n Object.defineProperty(this, \"metadata\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: {}\n });\n /**\n * List of allowed namespaces verified via K8S::SelfSubjectAccessReview api\n */\n Object.defineProperty(this, \"allowedNamespaces\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: mobx__WEBPACK_IMPORTED_MODULE_7__.observable.array()\n });\n /**\n * List of accessible namespaces provided by user in the Cluster Settings\n */\n Object.defineProperty(this, \"accessibleNamespaces\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: mobx__WEBPACK_IMPORTED_MODULE_7__.observable.array()\n });\n Object.defineProperty(this, \"knownResources\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: mobx__WEBPACK_IMPORTED_MODULE_7__.observable.array()\n });\n // The formatting of this is `group.name` or `name` (if in core)\n Object.defineProperty(this, \"allowedResources\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: mobx__WEBPACK_IMPORTED_MODULE_7__.observable.set()\n });\n /**\n * Labels for the catalog entity\n */\n Object.defineProperty(this, \"labels\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: {}\n });\n (0,mobx__WEBPACK_IMPORTED_MODULE_7__.makeObservable)(this);\n const { error } = _cluster_types__WEBPACK_IMPORTED_MODULE_3__.clusterModelIdChecker.validate({ id });\n if (error) {\n throw error;\n }\n this.id = id;\n this.updateModel(model);\n this.apiUrl = configData.clusterServerUrl;\n // for the time being, until renderer gets its own cluster type\n this._contextHandler = this.dependencies.createContextHandler(this);\n this._proxyKubeconfigManager = this.dependencies.createKubeconfigManager(this);\n this.dependencies.logger.debug(`[CLUSTER]: Cluster init success`, {\n id: this.id,\n context: this.contextName,\n apiUrl: this.apiUrl,\n });\n }\n /**\n * Update cluster data model\n *\n * @param model\n */\n updateModel(model) {\n // Note: do not assign ID as that should never be updated\n const { error } = _cluster_types__WEBPACK_IMPORTED_MODULE_3__.updateClusterModelChecker.validate(model, { allowUnknown: true });\n if (error) {\n throw error;\n }\n this.kubeConfigPath = model.kubeConfigPath;\n this.contextName = model.contextName;\n if (model.workspace) {\n this.workspace = model.workspace;\n }\n if (model.workspaces) {\n this.workspaces = model.workspaces;\n }\n if (model.preferences) {\n this.preferences = model.preferences;\n }\n if (model.metadata) {\n this.metadata = model.metadata;\n }\n if (model.accessibleNamespaces) {\n this.accessibleNamespaces.replace(model.accessibleNamespaces);\n }\n if (model.labels) {\n this.labels = model.labels;\n }\n }\n /**\n * @internal\n */\n bindEvents() {\n this.dependencies.logger.info(`[CLUSTER]: bind events`, this.getMeta());\n const refreshTimer = setInterval(() => !this.disconnected && this.refresh(), 30000); // every 30s\n const refreshMetadataTimer = setInterval(() => this.available && this.refreshAccessibilityAndMetadata(), 900000); // every 15 minutes\n this.eventsDisposer.push((0,mobx__WEBPACK_IMPORTED_MODULE_7__.reaction)(() => this.prometheusPreferences, prefs => this.contextHandler.setupPrometheus(prefs), { equals: mobx__WEBPACK_IMPORTED_MODULE_7__.comparer.structural }), () => clearInterval(refreshTimer), () => clearInterval(refreshMetadataTimer), (0,mobx__WEBPACK_IMPORTED_MODULE_7__.reaction)(() => this.defaultNamespace, () => this.recreateProxyKubeconfig()));\n }\n /**\n * @internal\n */\n async recreateProxyKubeconfig() {\n this.dependencies.logger.info(\"[CLUSTER]: Recreating proxy kubeconfig\");\n try {\n await this.proxyKubeconfigManager.clear();\n await this.getProxyKubeconfig();\n }\n catch (error) {\n this.dependencies.logger.error(`[CLUSTER]: failed to recreate proxy kubeconfig`, error);\n }\n }\n /**\n * @param force force activation\n * @internal\n */\n async activate(force = false) {\n if (this.activated && !force) {\n return;\n }\n this.dependencies.logger.info(`[CLUSTER]: activate`, this.getMeta());\n if (!this.eventsDisposer.length) {\n this.bindEvents();\n }\n if (this.disconnected || !this.accessible) {\n try {\n this.broadcastConnectUpdate(\"Starting connection ...\");\n await this.reconnect();\n }\n catch (error) {\n this.broadcastConnectUpdate(`Failed to start connection: ${error}`, true);\n return;\n }\n }\n try {\n this.broadcastConnectUpdate(\"Refreshing connection status ...\");\n await this.refreshConnectionStatus();\n }\n catch (error) {\n this.broadcastConnectUpdate(`Failed to connection status: ${error}`, true);\n return;\n }\n if (this.accessible) {\n try {\n this.broadcastConnectUpdate(\"Refreshing cluster accessibility ...\");\n await this.refreshAccessibility();\n }\n catch (error) {\n this.broadcastConnectUpdate(`Failed to refresh accessibility: ${error}`, true);\n return;\n }\n // download kubectl in background, so it's not blocking dashboard\n this.ensureKubectl()\n .catch(error => this.dependencies.logger.warn(`[CLUSTER]: failed to download kubectl for clusterId=${this.id}`, error));\n this.broadcastConnectUpdate(\"Connected, waiting for view to load ...\");\n }\n this.activated = true;\n }\n /**\n * @internal\n */\n async ensureKubectl() {\n var _a;\n (_a = this.kubeCtl) !== null && _a !== void 0 ? _a : (this.kubeCtl = this.dependencies.createKubectl(this.version));\n await this.kubeCtl.ensureKubectl();\n return this.kubeCtl;\n }\n /**\n * @internal\n */\n async reconnect() {\n var _a;\n this.dependencies.logger.info(`[CLUSTER]: reconnect`, this.getMeta());\n await ((_a = this.contextHandler) === null || _a === void 0 ? void 0 : _a.restartServer());\n this.disconnected = false;\n }\n /**\n * @internal\n */\n disconnect() {\n var _a;\n if (this.disconnected) {\n return void this.dependencies.logger.debug(\"[CLUSTER]: already disconnected\", { id: this.id });\n }\n this.dependencies.logger.info(`[CLUSTER]: disconnecting`, { id: this.id });\n this.eventsDisposer();\n (_a = this.contextHandler) === null || _a === void 0 ? void 0 : _a.stopServer();\n this.disconnected = true;\n this.online = false;\n this.accessible = false;\n this.ready = false;\n this.activated = false;\n this.allowedNamespaces.clear();\n this.dependencies.logger.info(`[CLUSTER]: disconnected`, { id: this.id });\n }\n /**\n * @internal\n */\n async refresh() {\n this.dependencies.logger.info(`[CLUSTER]: refresh`, this.getMeta());\n await this.refreshConnectionStatus();\n }\n /**\n * @internal\n */\n async refreshAccessibilityAndMetadata() {\n await this.refreshAccessibility();\n await this.refreshMetadata();\n }\n /**\n * @internal\n */\n async refreshMetadata() {\n this.dependencies.logger.info(`[CLUSTER]: refreshMetadata`, this.getMeta());\n const metadata = await this.dependencies.detectorRegistry.detectForCluster(this);\n const existingMetadata = this.metadata;\n this.metadata = Object.assign(existingMetadata, metadata);\n }\n /**\n * @internal\n */\n async refreshAccessibility() {\n this.dependencies.logger.info(`[CLUSTER]: refreshAccessibility`, this.getMeta());\n const proxyConfig = await this.getProxyKubeconfig();\n const canI = this.dependencies.createAuthorizationReview(proxyConfig);\n const requestNamespaceListPermissions = this.dependencies.requestNamespaceListPermissionsFor(proxyConfig);\n this.isAdmin = await canI({\n namespace: \"kube-system\",\n resource: \"*\",\n verb: \"create\",\n });\n this.isGlobalWatchEnabled = await canI({\n verb: \"watch\",\n resource: \"*\",\n });\n this.allowedNamespaces.replace(await this.requestAllowedNamespaces(proxyConfig));\n this.knownResources.replace(await this.dependencies.requestApiResources(this));\n this.allowedResources.replace(await this.getAllowedResources(requestNamespaceListPermissions));\n this.ready = true;\n }\n /**\n * @internal\n */\n async refreshConnectionStatus() {\n const connectionStatus = await this.getConnectionStatus();\n this.online = connectionStatus > _cluster_types__WEBPACK_IMPORTED_MODULE_3__.ClusterStatus.Offline;\n this.accessible = connectionStatus == _cluster_types__WEBPACK_IMPORTED_MODULE_3__.ClusterStatus.AccessGranted;\n }\n async getKubeconfig() {\n const { config } = await this.dependencies.loadConfigfromFile(this.kubeConfigPath);\n return config;\n }\n /**\n * @internal\n */\n async getProxyKubeconfig() {\n const proxyKCPath = await this.getProxyKubeconfigPath();\n const { config } = await this.dependencies.loadConfigfromFile(proxyKCPath);\n return config;\n }\n /**\n * @internal\n */\n async getProxyKubeconfigPath() {\n return this.proxyKubeconfigManager.getPath();\n }\n async getConnectionStatus() {\n try {\n const versionDetector = this.dependencies.createVersionDetector(this);\n const versionData = await versionDetector.detect();\n this.metadata.version = versionData.value;\n return _cluster_types__WEBPACK_IMPORTED_MODULE_3__.ClusterStatus.AccessGranted;\n }\n catch (error) {\n this.dependencies.logger.error(`[CLUSTER]: Failed to connect to \"${this.contextName}\": ${error}`);\n if ((0,_utils__WEBPACK_IMPORTED_MODULE_4__.isRequestError)(error)) {\n if (error.statusCode) {\n if (error.statusCode >= 400 && error.statusCode < 500) {\n this.broadcastConnectUpdate(\"Invalid credentials\", true);\n return _cluster_types__WEBPACK_IMPORTED_MODULE_3__.ClusterStatus.AccessDenied;\n }\n const message = String(error.error || error.message) || String(error);\n this.broadcastConnectUpdate(message, true);\n return _cluster_types__WEBPACK_IMPORTED_MODULE_3__.ClusterStatus.Offline;\n }\n if (error.failed === true) {\n if (error.timedOut === true) {\n this.broadcastConnectUpdate(\"Connection timed out\", true);\n return _cluster_types__WEBPACK_IMPORTED_MODULE_3__.ClusterStatus.Offline;\n }\n this.broadcastConnectUpdate(\"Failed to fetch credentials\", true);\n return _cluster_types__WEBPACK_IMPORTED_MODULE_3__.ClusterStatus.AccessDenied;\n }\n const message = String(error.error || error.message) || String(error);\n this.broadcastConnectUpdate(message, true);\n }\n else {\n this.broadcastConnectUpdate(\"Unknown error has occurred\", true);\n }\n return _cluster_types__WEBPACK_IMPORTED_MODULE_3__.ClusterStatus.Offline;\n }\n }\n toJSON() {\n return (0,_utils__WEBPACK_IMPORTED_MODULE_4__.toJS)({\n id: this.id,\n contextName: this.contextName,\n kubeConfigPath: this.kubeConfigPath,\n workspace: this.workspace,\n workspaces: this.workspaces,\n preferences: this.preferences,\n metadata: this.metadata,\n accessibleNamespaces: this.accessibleNamespaces,\n labels: this.labels,\n });\n }\n /**\n * Serializable cluster-state used for sync btw main <-> renderer\n */\n getState() {\n return (0,_utils__WEBPACK_IMPORTED_MODULE_4__.toJS)({\n apiUrl: this.apiUrl,\n online: this.online,\n ready: this.ready,\n disconnected: this.disconnected,\n accessible: this.accessible,\n isAdmin: this.isAdmin,\n allowedNamespaces: this.allowedNamespaces,\n allowedResources: [...this.allowedResources],\n isGlobalWatchEnabled: this.isGlobalWatchEnabled,\n });\n }\n /**\n * @internal\n * @param state cluster state\n */\n setState(state) {\n this.accessible = state.accessible;\n this.allowedNamespaces.replace(state.allowedNamespaces);\n this.allowedResources.replace(state.allowedResources);\n this.apiUrl = state.apiUrl;\n this.disconnected = state.disconnected;\n this.isAdmin = state.isAdmin;\n this.isGlobalWatchEnabled = state.isGlobalWatchEnabled;\n this.online = state.online;\n this.ready = state.ready;\n }\n // get cluster system meta, e.g. use in \"logger\"\n getMeta() {\n return {\n id: this.id,\n name: this.contextName,\n ready: this.ready,\n online: this.online,\n accessible: this.accessible,\n disconnected: this.disconnected,\n };\n }\n /**\n * broadcast an authentication update concerning this cluster\n * @internal\n */\n broadcastConnectUpdate(message, isError = false) {\n const update = { message, isError };\n this.dependencies.logger.debug(`[CLUSTER]: broadcasting connection update`, { ...update, meta: this.getMeta() });\n this.dependencies.broadcastMessage(`cluster:${this.id}:connection-update`, update);\n }\n async requestAllowedNamespaces(proxyConfig) {\n if (this.accessibleNamespaces.length) {\n return this.accessibleNamespaces;\n }\n try {\n const listNamespaces = this.dependencies.createListNamespaces(proxyConfig);\n return await listNamespaces();\n }\n catch (error) {\n const ctx = proxyConfig.getContextObject(this.contextName);\n const namespaceList = [ctx === null || ctx === void 0 ? void 0 : ctx.namespace].filter(_utils__WEBPACK_IMPORTED_MODULE_4__.isDefined);\n if (namespaceList.length === 0 && error instanceof _kubernetes_client_node__WEBPACK_IMPORTED_MODULE_0__.HttpError && error.statusCode === 403) {\n const { response } = error;\n this.dependencies.logger.info(\"[CLUSTER]: listing namespaces is forbidden, broadcasting\", { clusterId: this.id, error: response.body });\n this.dependencies.broadcastMessage(_ipc_cluster__WEBPACK_IMPORTED_MODULE_5__.clusterListNamespaceForbiddenChannel, this.id);\n }\n return namespaceList;\n }\n }\n async getAllowedResources(requestNamespaceListPermissions) {\n if (!this.allowedNamespaces.length) {\n return [];\n }\n try {\n const apiLimit = p_limit__WEBPACK_IMPORTED_MODULE_2___default()(5); // 5 concurrent api requests\n const canListResourceCheckers = await Promise.all((this.allowedNamespaces.map(namespace => apiLimit(() => requestNamespaceListPermissions(namespace)))));\n const canListNamespacedResource = (resource) => canListResourceCheckers.some(fn => fn(resource));\n return this.knownResources\n .filter(canListNamespacedResource)\n .map(_rbac__WEBPACK_IMPORTED_MODULE_1__.formatKubeApiResource);\n }\n catch (error) {\n return [];\n }\n }\n shouldShowResource(resource) {\n return this.allowedResources.has((0,_rbac__WEBPACK_IMPORTED_MODULE_1__.formatKubeApiResource)(resource));\n }\n isMetricHidden(resource) {\n var _a;\n return Boolean((_a = this.preferences.hiddenMetrics) === null || _a === void 0 ? void 0 : _a.includes(resource));\n }\n get nodeShellImage() {\n var _a;\n return ((_a = this.preferences) === null || _a === void 0 ? void 0 : _a.nodeShellImage) || _cluster_types__WEBPACK_IMPORTED_MODULE_3__.initialNodeShellImage;\n }\n get imagePullSecret() {\n var _a;\n return (_a = this.preferences) === null || _a === void 0 ? void 0 : _a.imagePullSecret;\n }\n isInLocalKubeconfig() {\n return this.kubeConfigPath.startsWith(this.dependencies.directoryForKubeConfigs);\n }\n}\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_7__.observable,\n __metadata(\"design:type\", String)\n], Cluster.prototype, \"contextName\", void 0);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_7__.observable,\n __metadata(\"design:type\", String)\n], Cluster.prototype, \"kubeConfigPath\", void 0);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_7__.observable,\n __metadata(\"design:type\", String)\n], Cluster.prototype, \"workspace\", void 0);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_7__.observable,\n __metadata(\"design:type\", Array)\n], Cluster.prototype, \"workspaces\", void 0);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_7__.observable,\n __metadata(\"design:type\", String)\n], Cluster.prototype, \"apiUrl\", void 0);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_7__.observable,\n __metadata(\"design:type\", Object)\n], Cluster.prototype, \"online\", void 0);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_7__.observable,\n __metadata(\"design:type\", Object)\n], Cluster.prototype, \"accessible\", void 0);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_7__.observable,\n __metadata(\"design:type\", Object)\n], Cluster.prototype, \"ready\", void 0);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_7__.observable,\n __metadata(\"design:type\", Object)\n], Cluster.prototype, \"reconnecting\", void 0);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_7__.observable,\n __metadata(\"design:type\", Object)\n], Cluster.prototype, \"disconnected\", void 0);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_7__.observable,\n __metadata(\"design:type\", Object)\n], Cluster.prototype, \"isAdmin\", void 0);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_7__.observable,\n __metadata(\"design:type\", Object)\n], Cluster.prototype, \"isGlobalWatchEnabled\", void 0);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_7__.observable,\n __metadata(\"design:type\", Object)\n], Cluster.prototype, \"preferences\", void 0);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_7__.observable,\n __metadata(\"design:type\", Object)\n], Cluster.prototype, \"metadata\", void 0);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_7__.observable,\n __metadata(\"design:type\", Object)\n], Cluster.prototype, \"labels\", void 0);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_7__.computed,\n __metadata(\"design:type\", Object),\n __metadata(\"design:paramtypes\", [])\n], Cluster.prototype, \"available\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_7__.computed,\n __metadata(\"design:type\", Object),\n __metadata(\"design:paramtypes\", [])\n], Cluster.prototype, \"name\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_7__.computed,\n __metadata(\"design:type\", String),\n __metadata(\"design:paramtypes\", [])\n], Cluster.prototype, \"distribution\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_7__.computed,\n __metadata(\"design:type\", String),\n __metadata(\"design:paramtypes\", [])\n], Cluster.prototype, \"version\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_7__.computed,\n __metadata(\"design:type\", Object),\n __metadata(\"design:paramtypes\", [])\n], Cluster.prototype, \"prometheusPreferences\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_7__.computed,\n __metadata(\"design:type\", Object),\n __metadata(\"design:paramtypes\", [])\n], Cluster.prototype, \"defaultNamespace\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_7__.action,\n __metadata(\"design:type\", Function),\n __metadata(\"design:paramtypes\", [Object]),\n __metadata(\"design:returntype\", void 0)\n], Cluster.prototype, \"updateModel\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_7__.action,\n __metadata(\"design:type\", Function),\n __metadata(\"design:paramtypes\", [Object]),\n __metadata(\"design:returntype\", Promise)\n], Cluster.prototype, \"activate\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_7__.action,\n __metadata(\"design:type\", Function),\n __metadata(\"design:paramtypes\", []),\n __metadata(\"design:returntype\", Promise)\n], Cluster.prototype, \"reconnect\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_7__.action,\n __metadata(\"design:type\", Function),\n __metadata(\"design:paramtypes\", []),\n __metadata(\"design:returntype\", void 0)\n], Cluster.prototype, \"disconnect\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_7__.action,\n __metadata(\"design:type\", Function),\n __metadata(\"design:paramtypes\", []),\n __metadata(\"design:returntype\", Promise)\n], Cluster.prototype, \"refresh\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_7__.action,\n __metadata(\"design:type\", Function),\n __metadata(\"design:paramtypes\", []),\n __metadata(\"design:returntype\", Promise)\n], Cluster.prototype, \"refreshAccessibilityAndMetadata\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_7__.action,\n __metadata(\"design:type\", Function),\n __metadata(\"design:paramtypes\", []),\n __metadata(\"design:returntype\", Promise)\n], Cluster.prototype, \"refreshConnectionStatus\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_7__.action,\n __metadata(\"design:type\", Function),\n __metadata(\"design:paramtypes\", [Object]),\n __metadata(\"design:returntype\", void 0)\n], Cluster.prototype, \"setState\", null);\n\n\n//# sourceURL=webpack://@k8slens/open-lens/./src/common/cluster/cluster.ts?");
28110
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"Cluster\": () => (/* binding */ Cluster)\n/* harmony export */ });\n/* harmony import */ var mobx__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! mobx */ \"./node_modules/mobx/dist/mobx.esm.js\");\n/* harmony import */ var _kubernetes_client_node__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @kubernetes/client-node */ \"./node_modules/@kubernetes/client-node/dist/index.js\");\n/* harmony import */ var _kubernetes_client_node__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_kubernetes_client_node__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _rbac__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../rbac */ \"./src/common/rbac.ts\");\n/* harmony import */ var p_limit__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! p-limit */ \"./node_modules/p-limit/index.js\");\n/* harmony import */ var p_limit__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(p_limit__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _cluster_types__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../cluster-types */ \"./src/common/cluster-types.ts\");\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../utils */ \"./src/common/utils/index.ts\");\n/* harmony import */ var _ipc_cluster__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../ipc/cluster */ \"./src/common/ipc/cluster.ts\");\n/* harmony import */ var assert__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! assert */ \"assert\");\n/* harmony import */ var assert__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(assert__WEBPACK_IMPORTED_MODULE_6__);\n/**\n * Copyright (c) OpenLens Authors. All rights reserved.\n * Licensed under MIT License. See LICENSE in root directory for more information.\n */\nvar __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n 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;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __metadata = (undefined && undefined.__metadata) || function (k, v) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(k, v);\n};\n\n\n\n\n\n\n\n\n/**\n * Cluster\n *\n * @beta\n */\nclass Cluster {\n get contextHandler() {\n // TODO: remove these once main/renderer are seperate classes\n assert__WEBPACK_IMPORTED_MODULE_6___default()(this._contextHandler, \"contextHandler is only defined in the main environment\");\n return this._contextHandler;\n }\n get proxyKubeconfigManager() {\n // TODO: remove these once main/renderer are seperate classes\n assert__WEBPACK_IMPORTED_MODULE_6___default()(this._proxyKubeconfigManager, \"proxyKubeconfigManager is only defined in the main environment\");\n return this._proxyKubeconfigManager;\n }\n get whenReady() {\n return (0,mobx__WEBPACK_IMPORTED_MODULE_7__.when)(() => this.ready);\n }\n /**\n * Is cluster available\n *\n * @computed\n */\n get available() {\n return this.accessible && !this.disconnected;\n }\n /**\n * Cluster name\n *\n * @computed\n */\n get name() {\n return this.preferences.clusterName || this.contextName;\n }\n /**\n * The detected kubernetes distribution\n */\n get distribution() {\n var _a;\n return ((_a = this.metadata[_cluster_types__WEBPACK_IMPORTED_MODULE_3__.ClusterMetadataKey.DISTRIBUTION]) === null || _a === void 0 ? void 0 : _a.toString()) || \"unknown\";\n }\n /**\n * The detected kubernetes version\n */\n get version() {\n var _a;\n return ((_a = this.metadata[_cluster_types__WEBPACK_IMPORTED_MODULE_3__.ClusterMetadataKey.VERSION]) === null || _a === void 0 ? void 0 : _a.toString()) || \"unknown\";\n }\n /**\n * Prometheus preferences\n *\n * @computed\n * @internal\n */\n get prometheusPreferences() {\n const { prometheus, prometheusProvider } = this.preferences;\n return (0,_utils__WEBPACK_IMPORTED_MODULE_4__.toJS)({ prometheus, prometheusProvider });\n }\n /**\n * defaultNamespace preference\n *\n * @computed\n * @internal\n */\n get defaultNamespace() {\n return this.preferences.defaultNamespace;\n }\n constructor(dependencies, { id, ...model }, configData) {\n Object.defineProperty(this, \"dependencies\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: dependencies\n });\n /** Unique id for a cluster */\n Object.defineProperty(this, \"id\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"kubeCtl\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n /**\n * Context handler\n *\n * @internal\n */\n Object.defineProperty(this, \"_contextHandler\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"_proxyKubeconfigManager\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"eventsDisposer\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: (0,_utils__WEBPACK_IMPORTED_MODULE_4__.disposer)()\n });\n Object.defineProperty(this, \"activated\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: false\n });\n /**\n * Kubeconfig context name\n *\n * @observable\n */\n Object.defineProperty(this, \"contextName\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n /**\n * Path to kubeconfig\n *\n * @observable\n */\n Object.defineProperty(this, \"kubeConfigPath\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n /**\n * @deprecated\n */\n Object.defineProperty(this, \"workspace\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n /**\n * @deprecated\n */\n Object.defineProperty(this, \"workspaces\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n /**\n * Kubernetes API server URL\n *\n * @observable\n */\n Object.defineProperty(this, \"apiUrl\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n }); // cluster server url\n /**\n * Is cluster online\n *\n * @observable\n */\n Object.defineProperty(this, \"online\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: false\n }); // describes if we can detect that cluster is online\n /**\n * Can user access cluster resources\n *\n * @observable\n */\n Object.defineProperty(this, \"accessible\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: false\n }); // if user is able to access cluster resources\n /**\n * Is cluster instance in usable state\n *\n * @observable\n */\n Object.defineProperty(this, \"ready\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: false\n }); // cluster is in usable state\n /**\n * Is cluster currently reconnecting\n *\n * @observable\n */\n Object.defineProperty(this, \"reconnecting\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: false\n });\n /**\n * Is cluster disconnected. False if user has selected to connect.\n *\n * @observable\n */\n Object.defineProperty(this, \"disconnected\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: true\n });\n /**\n * Does user have admin like access\n *\n * @observable\n */\n Object.defineProperty(this, \"isAdmin\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: false\n });\n /**\n * Global watch-api accessibility , e.g. \"/api/v1/services?watch=1\"\n *\n * @observable\n */\n Object.defineProperty(this, \"isGlobalWatchEnabled\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: false\n });\n /**\n * Preferences\n *\n * @observable\n */\n Object.defineProperty(this, \"preferences\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: {}\n });\n /**\n * Metadata\n *\n * @observable\n */\n Object.defineProperty(this, \"metadata\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: {}\n });\n /**\n * List of allowed namespaces verified via K8S::SelfSubjectAccessReview api\n */\n Object.defineProperty(this, \"allowedNamespaces\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: mobx__WEBPACK_IMPORTED_MODULE_7__.observable.array()\n });\n /**\n * List of accessible namespaces provided by user in the Cluster Settings\n */\n Object.defineProperty(this, \"accessibleNamespaces\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: mobx__WEBPACK_IMPORTED_MODULE_7__.observable.array()\n });\n Object.defineProperty(this, \"knownResources\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: mobx__WEBPACK_IMPORTED_MODULE_7__.observable.array()\n });\n // The formatting of this is `group.name` or `name` (if in core)\n Object.defineProperty(this, \"allowedResources\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: mobx__WEBPACK_IMPORTED_MODULE_7__.observable.set()\n });\n /**\n * Labels for the catalog entity\n */\n Object.defineProperty(this, \"labels\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: {}\n });\n (0,mobx__WEBPACK_IMPORTED_MODULE_7__.makeObservable)(this);\n const { error } = _cluster_types__WEBPACK_IMPORTED_MODULE_3__.clusterModelIdChecker.validate({ id });\n if (error) {\n throw error;\n }\n this.id = id;\n this.updateModel(model);\n this.apiUrl = configData.clusterServerUrl;\n // for the time being, until renderer gets its own cluster type\n this._contextHandler = this.dependencies.createContextHandler(this);\n this._proxyKubeconfigManager = this.dependencies.createKubeconfigManager(this);\n this.dependencies.logger.debug(`[CLUSTER]: Cluster init success`, {\n id: this.id,\n context: this.contextName,\n apiUrl: this.apiUrl,\n });\n }\n /**\n * Update cluster data model\n *\n * @param model\n */\n updateModel(model) {\n // Note: do not assign ID as that should never be updated\n const { error } = _cluster_types__WEBPACK_IMPORTED_MODULE_3__.updateClusterModelChecker.validate(model, { allowUnknown: true });\n if (error) {\n throw error;\n }\n this.kubeConfigPath = model.kubeConfigPath;\n this.contextName = model.contextName;\n if (model.workspace) {\n this.workspace = model.workspace;\n }\n if (model.workspaces) {\n this.workspaces = model.workspaces;\n }\n if (model.preferences) {\n this.preferences = model.preferences;\n }\n if (model.metadata) {\n this.metadata = model.metadata;\n }\n if (model.accessibleNamespaces) {\n this.accessibleNamespaces.replace(model.accessibleNamespaces);\n }\n if (model.labels) {\n this.labels = model.labels;\n }\n }\n /**\n * @internal\n */\n bindEvents() {\n this.dependencies.logger.info(`[CLUSTER]: bind events`, this.getMeta());\n const refreshTimer = setInterval(() => !this.disconnected && this.refresh(), 30000); // every 30s\n const refreshMetadataTimer = setInterval(() => this.available && this.refreshAccessibilityAndMetadata(), 900000); // every 15 minutes\n this.eventsDisposer.push((0,mobx__WEBPACK_IMPORTED_MODULE_7__.reaction)(() => this.prometheusPreferences, prefs => this.contextHandler.setupPrometheus(prefs), { equals: mobx__WEBPACK_IMPORTED_MODULE_7__.comparer.structural }), () => clearInterval(refreshTimer), () => clearInterval(refreshMetadataTimer), (0,mobx__WEBPACK_IMPORTED_MODULE_7__.reaction)(() => this.defaultNamespace, () => this.recreateProxyKubeconfig()));\n }\n /**\n * @internal\n */\n async recreateProxyKubeconfig() {\n this.dependencies.logger.info(\"[CLUSTER]: Recreating proxy kubeconfig\");\n try {\n await this.proxyKubeconfigManager.clear();\n await this.getProxyKubeconfig();\n }\n catch (error) {\n this.dependencies.logger.error(`[CLUSTER]: failed to recreate proxy kubeconfig`, error);\n }\n }\n /**\n * @param force force activation\n * @internal\n */\n async activate(force = false) {\n if (this.activated && !force) {\n return;\n }\n this.dependencies.logger.info(`[CLUSTER]: activate`, this.getMeta());\n if (!this.eventsDisposer.length) {\n this.bindEvents();\n }\n if (this.disconnected || !this.accessible) {\n try {\n this.broadcastConnectUpdate(\"Starting connection ...\");\n await this.reconnect();\n }\n catch (error) {\n this.broadcastConnectUpdate(`Failed to start connection: ${error}`, true);\n return;\n }\n }\n try {\n this.broadcastConnectUpdate(\"Refreshing connection status ...\");\n await this.refreshConnectionStatus();\n }\n catch (error) {\n this.broadcastConnectUpdate(`Failed to connection status: ${error}`, true);\n return;\n }\n if (this.accessible) {\n try {\n this.broadcastConnectUpdate(\"Refreshing cluster accessibility ...\");\n await this.refreshAccessibility();\n }\n catch (error) {\n this.broadcastConnectUpdate(`Failed to refresh accessibility: ${error}`, true);\n return;\n }\n // download kubectl in background, so it's not blocking dashboard\n this.ensureKubectl()\n .catch(error => this.dependencies.logger.warn(`[CLUSTER]: failed to download kubectl for clusterId=${this.id}`, error));\n this.broadcastConnectUpdate(\"Connected, waiting for view to load ...\");\n }\n this.activated = true;\n }\n /**\n * @internal\n */\n async ensureKubectl() {\n var _a;\n (_a = this.kubeCtl) !== null && _a !== void 0 ? _a : (this.kubeCtl = this.dependencies.createKubectl(this.version));\n await this.kubeCtl.ensureKubectl();\n return this.kubeCtl;\n }\n /**\n * @internal\n */\n async reconnect() {\n var _a;\n this.dependencies.logger.info(`[CLUSTER]: reconnect`, this.getMeta());\n await ((_a = this.contextHandler) === null || _a === void 0 ? void 0 : _a.restartServer());\n this.disconnected = false;\n }\n /**\n * @internal\n */\n disconnect() {\n var _a;\n if (this.disconnected) {\n return void this.dependencies.logger.debug(\"[CLUSTER]: already disconnected\", { id: this.id });\n }\n this.dependencies.logger.info(`[CLUSTER]: disconnecting`, { id: this.id });\n this.eventsDisposer();\n (_a = this.contextHandler) === null || _a === void 0 ? void 0 : _a.stopServer();\n this.disconnected = true;\n this.online = false;\n this.accessible = false;\n this.ready = false;\n this.activated = false;\n this.allowedNamespaces.clear();\n this.dependencies.logger.info(`[CLUSTER]: disconnected`, { id: this.id });\n }\n /**\n * @internal\n */\n async refresh() {\n this.dependencies.logger.info(`[CLUSTER]: refresh`, this.getMeta());\n await this.refreshConnectionStatus();\n }\n /**\n * @internal\n */\n async refreshAccessibilityAndMetadata() {\n await this.refreshAccessibility();\n await this.refreshMetadata();\n }\n /**\n * @internal\n */\n async refreshMetadata() {\n this.dependencies.logger.info(`[CLUSTER]: refreshMetadata`, this.getMeta());\n const newMetadata = await this.dependencies.detectClusterMetadata(this);\n (0,mobx__WEBPACK_IMPORTED_MODULE_7__.runInAction)(() => {\n this.metadata = {\n ...this.metadata,\n ...newMetadata,\n };\n });\n }\n /**\n * @internal\n */\n async refreshAccessibility() {\n this.dependencies.logger.info(`[CLUSTER]: refreshAccessibility`, this.getMeta());\n const proxyConfig = await this.getProxyKubeconfig();\n const canI = this.dependencies.createAuthorizationReview(proxyConfig);\n const requestNamespaceListPermissions = this.dependencies.requestNamespaceListPermissionsFor(proxyConfig);\n this.isAdmin = await canI({\n namespace: \"kube-system\",\n resource: \"*\",\n verb: \"create\",\n });\n this.isGlobalWatchEnabled = await canI({\n verb: \"watch\",\n resource: \"*\",\n });\n this.allowedNamespaces.replace(await this.requestAllowedNamespaces(proxyConfig));\n this.knownResources.replace(await this.dependencies.requestApiResources(this));\n this.allowedResources.replace(await this.getAllowedResources(requestNamespaceListPermissions));\n this.ready = true;\n }\n /**\n * @internal\n */\n async refreshConnectionStatus() {\n const connectionStatus = await this.getConnectionStatus();\n this.online = connectionStatus > _cluster_types__WEBPACK_IMPORTED_MODULE_3__.ClusterStatus.Offline;\n this.accessible = connectionStatus == _cluster_types__WEBPACK_IMPORTED_MODULE_3__.ClusterStatus.AccessGranted;\n }\n async getKubeconfig() {\n const { config } = await this.dependencies.loadConfigfromFile(this.kubeConfigPath);\n return config;\n }\n /**\n * @internal\n */\n async getProxyKubeconfig() {\n const proxyKCPath = await this.getProxyKubeconfigPath();\n const { config } = await this.dependencies.loadConfigfromFile(proxyKCPath);\n return config;\n }\n /**\n * @internal\n */\n async getProxyKubeconfigPath() {\n return this.proxyKubeconfigManager.getPath();\n }\n async getConnectionStatus() {\n try {\n const versionData = await this.dependencies.clusterVersionDetector.detect(this);\n this.metadata.version = versionData.value;\n return _cluster_types__WEBPACK_IMPORTED_MODULE_3__.ClusterStatus.AccessGranted;\n }\n catch (error) {\n this.dependencies.logger.error(`[CLUSTER]: Failed to connect to \"${this.contextName}\": ${error}`);\n if ((0,_utils__WEBPACK_IMPORTED_MODULE_4__.isRequestError)(error)) {\n if (error.statusCode) {\n if (error.statusCode >= 400 && error.statusCode < 500) {\n this.broadcastConnectUpdate(\"Invalid credentials\", true);\n return _cluster_types__WEBPACK_IMPORTED_MODULE_3__.ClusterStatus.AccessDenied;\n }\n const message = String(error.error || error.message) || String(error);\n this.broadcastConnectUpdate(message, true);\n return _cluster_types__WEBPACK_IMPORTED_MODULE_3__.ClusterStatus.Offline;\n }\n if (error.failed === true) {\n if (error.timedOut === true) {\n this.broadcastConnectUpdate(\"Connection timed out\", true);\n return _cluster_types__WEBPACK_IMPORTED_MODULE_3__.ClusterStatus.Offline;\n }\n this.broadcastConnectUpdate(\"Failed to fetch credentials\", true);\n return _cluster_types__WEBPACK_IMPORTED_MODULE_3__.ClusterStatus.AccessDenied;\n }\n const message = String(error.error || error.message) || String(error);\n this.broadcastConnectUpdate(message, true);\n }\n else if (error instanceof Error || typeof error === \"string\") {\n this.broadcastConnectUpdate(`${error}`, true);\n }\n else {\n this.broadcastConnectUpdate(\"Unknown error has occurred\", true);\n }\n return _cluster_types__WEBPACK_IMPORTED_MODULE_3__.ClusterStatus.Offline;\n }\n }\n toJSON() {\n return (0,_utils__WEBPACK_IMPORTED_MODULE_4__.toJS)({\n id: this.id,\n contextName: this.contextName,\n kubeConfigPath: this.kubeConfigPath,\n workspace: this.workspace,\n workspaces: this.workspaces,\n preferences: this.preferences,\n metadata: this.metadata,\n accessibleNamespaces: this.accessibleNamespaces,\n labels: this.labels,\n });\n }\n /**\n * Serializable cluster-state used for sync btw main <-> renderer\n */\n getState() {\n return (0,_utils__WEBPACK_IMPORTED_MODULE_4__.toJS)({\n apiUrl: this.apiUrl,\n online: this.online,\n ready: this.ready,\n disconnected: this.disconnected,\n accessible: this.accessible,\n isAdmin: this.isAdmin,\n allowedNamespaces: this.allowedNamespaces,\n allowedResources: [...this.allowedResources],\n isGlobalWatchEnabled: this.isGlobalWatchEnabled,\n });\n }\n /**\n * @internal\n * @param state cluster state\n */\n setState(state) {\n this.accessible = state.accessible;\n this.allowedNamespaces.replace(state.allowedNamespaces);\n this.allowedResources.replace(state.allowedResources);\n this.apiUrl = state.apiUrl;\n this.disconnected = state.disconnected;\n this.isAdmin = state.isAdmin;\n this.isGlobalWatchEnabled = state.isGlobalWatchEnabled;\n this.online = state.online;\n this.ready = state.ready;\n }\n // get cluster system meta, e.g. use in \"logger\"\n getMeta() {\n return {\n id: this.id,\n name: this.contextName,\n ready: this.ready,\n online: this.online,\n accessible: this.accessible,\n disconnected: this.disconnected,\n };\n }\n /**\n * broadcast an authentication update concerning this cluster\n * @internal\n */\n broadcastConnectUpdate(message, isError = false) {\n const update = { message, isError };\n this.dependencies.logger.debug(`[CLUSTER]: broadcasting connection update`, { ...update, meta: this.getMeta() });\n this.dependencies.broadcastMessage(`cluster:${this.id}:connection-update`, update);\n }\n async requestAllowedNamespaces(proxyConfig) {\n if (this.accessibleNamespaces.length) {\n return this.accessibleNamespaces;\n }\n try {\n const listNamespaces = this.dependencies.createListNamespaces(proxyConfig);\n return await listNamespaces();\n }\n catch (error) {\n const ctx = proxyConfig.getContextObject(this.contextName);\n const namespaceList = [ctx === null || ctx === void 0 ? void 0 : ctx.namespace].filter(_utils__WEBPACK_IMPORTED_MODULE_4__.isDefined);\n if (namespaceList.length === 0 && error instanceof _kubernetes_client_node__WEBPACK_IMPORTED_MODULE_0__.HttpError && error.statusCode === 403) {\n const { response } = error;\n this.dependencies.logger.info(\"[CLUSTER]: listing namespaces is forbidden, broadcasting\", { clusterId: this.id, error: response.body });\n this.dependencies.broadcastMessage(_ipc_cluster__WEBPACK_IMPORTED_MODULE_5__.clusterListNamespaceForbiddenChannel, this.id);\n }\n return namespaceList;\n }\n }\n async getAllowedResources(requestNamespaceListPermissions) {\n if (!this.allowedNamespaces.length) {\n return [];\n }\n try {\n const apiLimit = p_limit__WEBPACK_IMPORTED_MODULE_2___default()(5); // 5 concurrent api requests\n const canListResourceCheckers = await Promise.all((this.allowedNamespaces.map(namespace => apiLimit(() => requestNamespaceListPermissions(namespace)))));\n const canListNamespacedResource = (resource) => canListResourceCheckers.some(fn => fn(resource));\n return this.knownResources\n .filter(canListNamespacedResource)\n .map(_rbac__WEBPACK_IMPORTED_MODULE_1__.formatKubeApiResource);\n }\n catch (error) {\n return [];\n }\n }\n shouldShowResource(resource) {\n return this.allowedResources.has((0,_rbac__WEBPACK_IMPORTED_MODULE_1__.formatKubeApiResource)(resource));\n }\n isMetricHidden(resource) {\n var _a;\n return Boolean((_a = this.preferences.hiddenMetrics) === null || _a === void 0 ? void 0 : _a.includes(resource));\n }\n get nodeShellImage() {\n var _a;\n return ((_a = this.preferences) === null || _a === void 0 ? void 0 : _a.nodeShellImage) || _cluster_types__WEBPACK_IMPORTED_MODULE_3__.initialNodeShellImage;\n }\n get imagePullSecret() {\n var _a;\n return (_a = this.preferences) === null || _a === void 0 ? void 0 : _a.imagePullSecret;\n }\n isInLocalKubeconfig() {\n return this.kubeConfigPath.startsWith(this.dependencies.directoryForKubeConfigs);\n }\n}\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_7__.observable,\n __metadata(\"design:type\", String)\n], Cluster.prototype, \"contextName\", void 0);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_7__.observable,\n __metadata(\"design:type\", String)\n], Cluster.prototype, \"kubeConfigPath\", void 0);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_7__.observable,\n __metadata(\"design:type\", String)\n], Cluster.prototype, \"workspace\", void 0);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_7__.observable,\n __metadata(\"design:type\", Array)\n], Cluster.prototype, \"workspaces\", void 0);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_7__.observable,\n __metadata(\"design:type\", String)\n], Cluster.prototype, \"apiUrl\", void 0);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_7__.observable,\n __metadata(\"design:type\", Object)\n], Cluster.prototype, \"online\", void 0);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_7__.observable,\n __metadata(\"design:type\", Object)\n], Cluster.prototype, \"accessible\", void 0);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_7__.observable,\n __metadata(\"design:type\", Object)\n], Cluster.prototype, \"ready\", void 0);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_7__.observable,\n __metadata(\"design:type\", Object)\n], Cluster.prototype, \"reconnecting\", void 0);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_7__.observable,\n __metadata(\"design:type\", Object)\n], Cluster.prototype, \"disconnected\", void 0);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_7__.observable,\n __metadata(\"design:type\", Object)\n], Cluster.prototype, \"isAdmin\", void 0);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_7__.observable,\n __metadata(\"design:type\", Object)\n], Cluster.prototype, \"isGlobalWatchEnabled\", void 0);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_7__.observable,\n __metadata(\"design:type\", Object)\n], Cluster.prototype, \"preferences\", void 0);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_7__.observable,\n __metadata(\"design:type\", Object)\n], Cluster.prototype, \"metadata\", void 0);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_7__.observable,\n __metadata(\"design:type\", Object)\n], Cluster.prototype, \"labels\", void 0);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_7__.computed,\n __metadata(\"design:type\", Object),\n __metadata(\"design:paramtypes\", [])\n], Cluster.prototype, \"available\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_7__.computed,\n __metadata(\"design:type\", Object),\n __metadata(\"design:paramtypes\", [])\n], Cluster.prototype, \"name\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_7__.computed,\n __metadata(\"design:type\", String),\n __metadata(\"design:paramtypes\", [])\n], Cluster.prototype, \"distribution\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_7__.computed,\n __metadata(\"design:type\", String),\n __metadata(\"design:paramtypes\", [])\n], Cluster.prototype, \"version\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_7__.computed,\n __metadata(\"design:type\", Object),\n __metadata(\"design:paramtypes\", [])\n], Cluster.prototype, \"prometheusPreferences\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_7__.computed,\n __metadata(\"design:type\", Object),\n __metadata(\"design:paramtypes\", [])\n], Cluster.prototype, \"defaultNamespace\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_7__.action,\n __metadata(\"design:type\", Function),\n __metadata(\"design:paramtypes\", [Object]),\n __metadata(\"design:returntype\", void 0)\n], Cluster.prototype, \"updateModel\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_7__.action,\n __metadata(\"design:type\", Function),\n __metadata(\"design:paramtypes\", [Object]),\n __metadata(\"design:returntype\", Promise)\n], Cluster.prototype, \"activate\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_7__.action,\n __metadata(\"design:type\", Function),\n __metadata(\"design:paramtypes\", []),\n __metadata(\"design:returntype\", Promise)\n], Cluster.prototype, \"reconnect\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_7__.action,\n __metadata(\"design:type\", Function),\n __metadata(\"design:paramtypes\", []),\n __metadata(\"design:returntype\", void 0)\n], Cluster.prototype, \"disconnect\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_7__.action,\n __metadata(\"design:type\", Function),\n __metadata(\"design:paramtypes\", []),\n __metadata(\"design:returntype\", Promise)\n], Cluster.prototype, \"refresh\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_7__.action,\n __metadata(\"design:type\", Function),\n __metadata(\"design:paramtypes\", []),\n __metadata(\"design:returntype\", Promise)\n], Cluster.prototype, \"refreshAccessibilityAndMetadata\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_7__.action,\n __metadata(\"design:type\", Function),\n __metadata(\"design:paramtypes\", []),\n __metadata(\"design:returntype\", Promise)\n], Cluster.prototype, \"refreshConnectionStatus\", null);\n__decorate([\n mobx__WEBPACK_IMPORTED_MODULE_7__.action,\n __metadata(\"design:type\", Function),\n __metadata(\"design:paramtypes\", [Object]),\n __metadata(\"design:returntype\", void 0)\n], Cluster.prototype, \"setState\", null);\n\n\n//# sourceURL=webpack://@k8slens/open-lens/./src/common/cluster/cluster.ts?");
28101
28111
 
28102
28112
  /***/ }),
28103
28113
 
@@ -32981,7 +32991,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
32981
32991
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
32982
32992
 
32983
32993
  "use strict";
32984
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"KubeObjectMeta\": () => (/* binding */ KubeObjectMeta)\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var _common_k8s_api_kube_object__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../common/k8s-api/kube-object */ \"./src/common/k8s-api/kube-object.ts\");\n/* harmony import */ var _drawer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../drawer */ \"./src/renderer/components/drawer/index.ts\");\n/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! react-router-dom */ \"./node_modules/react-router-dom/esm/react-router-dom.js\");\n/* harmony import */ var _kube_object_status_icon__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../kube-object-status-icon */ \"./src/renderer/components/kube-object-status-icon/index.ts\");\n/* harmony import */ var _locale_date__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../locale-date */ \"./src/renderer/components/locale-date/index.ts\");\n/* harmony import */ var _kube_object_age__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../kube-object/age */ \"./src/renderer/components/kube-object/age.tsx\");\n/* harmony import */ var mobx_react__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! mobx-react */ \"./node_modules/mobx-react/dist/mobxreact.esm.js\");\n/* harmony import */ var _ogre_tools_injectable_react__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @ogre-tools/injectable-react */ \"./node_modules/@ogre-tools/injectable-react/build/index.js\");\n/* harmony import */ var _ogre_tools_injectable_react__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_ogre_tools_injectable_react__WEBPACK_IMPORTED_MODULE_6__);\n/* harmony import */ var _kube_detail_params_get_details_url_injectable__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../kube-detail-params/get-details-url.injectable */ \"./src/renderer/components/kube-detail-params/get-details-url.injectable.ts\");\n/* harmony import */ var _common_k8s_api_api_manager_manager_injectable__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../../common/k8s-api/api-manager/manager.injectable */ \"./src/common/k8s-api/api-manager/manager.injectable.ts\");\n/* harmony import */ var _common_logger_injectable__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../../common/logger.injectable */ \"./src/common/logger.injectable.ts\");\n/**\n * Copyright (c) OpenLens Authors. All rights reserved.\n * Licensed under MIT License. See LICENSE in root directory for more information.\n */\n\n\n\n\n\n\n\n\n\n\n\n\nconst NonInjectedKubeObjectMeta = (0,mobx_react__WEBPACK_IMPORTED_MODULE_10__.observer)(({ apiManager, getDetailsUrl, object, hideFields = [\n \"uid\",\n \"resourceVersion\",\n \"selfLink\",\n], logger, }) => {\n if (!object) {\n return null;\n }\n if (!(object instanceof _common_k8s_api_kube_object__WEBPACK_IMPORTED_MODULE_1__.KubeObject)) {\n logger.error(\"[KubeObjectMeta]: passed object that is not an instanceof KubeObject\", object);\n return null;\n }\n const isHidden = (field) => hideFields.includes(field);\n const { getNs, getLabels, getResourceVersion, selfLink, getAnnotations, getFinalizers, getId, getName, metadata: { creationTimestamp }, } = object;\n const ownerRefs = object.getOwnerRefs();\n return (react__WEBPACK_IMPORTED_MODULE_0__.createElement(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null,\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(_drawer__WEBPACK_IMPORTED_MODULE_2__.DrawerItem, { name: \"Created\", hidden: isHidden(\"creationTimestamp\") },\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(_kube_object_age__WEBPACK_IMPORTED_MODULE_5__.KubeObjectAge, { object: object, compact: false }),\n \" ago \",\n creationTimestamp && react__WEBPACK_IMPORTED_MODULE_0__.createElement(_locale_date__WEBPACK_IMPORTED_MODULE_4__.LocaleDate, { date: creationTimestamp })),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(_drawer__WEBPACK_IMPORTED_MODULE_2__.DrawerItem, { name: \"Name\", hidden: isHidden(\"name\") },\n getName(),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(_kube_object_status_icon__WEBPACK_IMPORTED_MODULE_3__.KubeObjectStatusIcon, { key: \"icon\", object: object })),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(_drawer__WEBPACK_IMPORTED_MODULE_2__.DrawerItem, { name: \"Namespace\", hidden: isHidden(\"namespace\") || !getNs() }, getNs()),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(_drawer__WEBPACK_IMPORTED_MODULE_2__.DrawerItem, { name: \"UID\", hidden: isHidden(\"uid\") }, getId()),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(_drawer__WEBPACK_IMPORTED_MODULE_2__.DrawerItem, { name: \"Link\", hidden: isHidden(\"selfLink\") }, selfLink),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(_drawer__WEBPACK_IMPORTED_MODULE_2__.DrawerItem, { name: \"Resource Version\", hidden: isHidden(\"resourceVersion\") }, getResourceVersion()),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(_drawer__WEBPACK_IMPORTED_MODULE_2__.DrawerItemLabels, { name: \"Labels\", labels: getLabels(), hidden: isHidden(\"labels\") }),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(_drawer__WEBPACK_IMPORTED_MODULE_2__.DrawerItemLabels, { name: \"Annotations\", labels: getAnnotations(), hidden: isHidden(\"annotations\") }),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(_drawer__WEBPACK_IMPORTED_MODULE_2__.DrawerItemLabels, { name: \"Finalizers\", labels: getFinalizers(), hidden: isHidden(\"finalizers\") }),\n (ownerRefs === null || ownerRefs === void 0 ? void 0 : ownerRefs.length) > 0 && (react__WEBPACK_IMPORTED_MODULE_0__.createElement(_drawer__WEBPACK_IMPORTED_MODULE_2__.DrawerItem, { name: \"Controlled By\", hidden: isHidden(\"ownerReferences\") }, ownerRefs.map(ref => (react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"p\", { key: ref.name },\n `${ref.kind} `,\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(react_router_dom__WEBPACK_IMPORTED_MODULE_11__.Link, { to: getDetailsUrl(apiManager.lookupApiLink(ref, object)) }, ref.name))))))));\n});\nconst KubeObjectMeta = (0,_ogre_tools_injectable_react__WEBPACK_IMPORTED_MODULE_6__.withInjectables)(NonInjectedKubeObjectMeta, {\n getProps: (di, props) => ({\n ...props,\n getDetailsUrl: di.inject(_kube_detail_params_get_details_url_injectable__WEBPACK_IMPORTED_MODULE_7__[\"default\"]),\n apiManager: di.inject(_common_k8s_api_api_manager_manager_injectable__WEBPACK_IMPORTED_MODULE_8__[\"default\"]),\n logger: di.inject(_common_logger_injectable__WEBPACK_IMPORTED_MODULE_9__[\"default\"]),\n }),\n});\n\n\n//# sourceURL=webpack://@k8slens/open-lens/./src/renderer/components/kube-object-meta/kube-object-meta.tsx?");
32994
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"KubeObjectMeta\": () => (/* binding */ KubeObjectMeta)\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var _common_k8s_api_kube_object__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../common/k8s-api/kube-object */ \"./src/common/k8s-api/kube-object.ts\");\n/* harmony import */ var _drawer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../drawer */ \"./src/renderer/components/drawer/index.ts\");\n/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! react-router-dom */ \"./node_modules/react-router-dom/esm/react-router-dom.js\");\n/* harmony import */ var _kube_object_status_icon__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../kube-object-status-icon */ \"./src/renderer/components/kube-object-status-icon/index.ts\");\n/* harmony import */ var _locale_date__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../locale-date */ \"./src/renderer/components/locale-date/index.ts\");\n/* harmony import */ var _kube_object_age__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../kube-object/age */ \"./src/renderer/components/kube-object/age.tsx\");\n/* harmony import */ var mobx_react__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! mobx-react */ \"./node_modules/mobx-react/dist/mobxreact.esm.js\");\n/* harmony import */ var _ogre_tools_injectable_react__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @ogre-tools/injectable-react */ \"./node_modules/@ogre-tools/injectable-react/build/index.js\");\n/* harmony import */ var _ogre_tools_injectable_react__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_ogre_tools_injectable_react__WEBPACK_IMPORTED_MODULE_6__);\n/* harmony import */ var _kube_detail_params_get_details_url_injectable__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../kube-detail-params/get-details-url.injectable */ \"./src/renderer/components/kube-detail-params/get-details-url.injectable.ts\");\n/* harmony import */ var _common_k8s_api_api_manager_manager_injectable__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../../common/k8s-api/api-manager/manager.injectable */ \"./src/common/k8s-api/api-manager/manager.injectable.ts\");\n/* harmony import */ var _common_logger_injectable__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../../common/logger.injectable */ \"./src/common/logger.injectable.ts\");\n/**\n * Copyright (c) OpenLens Authors. All rights reserved.\n * Licensed under MIT License. See LICENSE in root directory for more information.\n */\n\n\n\n\n\n\n\n\n\n\n\n\nconst NonInjectedKubeObjectMeta = (0,mobx_react__WEBPACK_IMPORTED_MODULE_10__.observer)(({ apiManager, getDetailsUrl, object, hideFields = [\n \"uid\",\n \"resourceVersion\",\n \"selfLink\",\n], logger, }) => {\n if (!object) {\n return null;\n }\n if (!(object instanceof _common_k8s_api_kube_object__WEBPACK_IMPORTED_MODULE_1__.KubeObject)) {\n logger.error(\"[KubeObjectMeta]: passed object that is not an instanceof KubeObject\", object);\n return null;\n }\n const isHidden = (field) => hideFields.includes(field);\n const { getNs, getLabels, getResourceVersion, selfLink, getAnnotations, getFinalizers, getId, getName, metadata: { creationTimestamp }, } = object;\n const ownerRefs = object.getOwnerRefs();\n return (react__WEBPACK_IMPORTED_MODULE_0__.createElement(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null,\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(_drawer__WEBPACK_IMPORTED_MODULE_2__.DrawerItem, { name: \"Created\", hidden: isHidden(\"creationTimestamp\") || !creationTimestamp },\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(_kube_object_age__WEBPACK_IMPORTED_MODULE_5__.KubeObjectAge, { object: object, compact: false }),\n \" ago \",\n creationTimestamp && react__WEBPACK_IMPORTED_MODULE_0__.createElement(_locale_date__WEBPACK_IMPORTED_MODULE_4__.LocaleDate, { date: creationTimestamp })),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(_drawer__WEBPACK_IMPORTED_MODULE_2__.DrawerItem, { name: \"Name\", hidden: isHidden(\"name\") },\n getName(),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(_kube_object_status_icon__WEBPACK_IMPORTED_MODULE_3__.KubeObjectStatusIcon, { key: \"icon\", object: object })),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(_drawer__WEBPACK_IMPORTED_MODULE_2__.DrawerItem, { name: \"Namespace\", hidden: isHidden(\"namespace\") || !getNs() }, getNs()),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(_drawer__WEBPACK_IMPORTED_MODULE_2__.DrawerItem, { name: \"UID\", hidden: isHidden(\"uid\") }, getId()),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(_drawer__WEBPACK_IMPORTED_MODULE_2__.DrawerItem, { name: \"Link\", hidden: isHidden(\"selfLink\") }, selfLink),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(_drawer__WEBPACK_IMPORTED_MODULE_2__.DrawerItem, { name: \"Resource Version\", hidden: isHidden(\"resourceVersion\") }, getResourceVersion()),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(_drawer__WEBPACK_IMPORTED_MODULE_2__.DrawerItemLabels, { name: \"Labels\", labels: getLabels(), hidden: isHidden(\"labels\") }),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(_drawer__WEBPACK_IMPORTED_MODULE_2__.DrawerItemLabels, { name: \"Annotations\", labels: getAnnotations(), hidden: isHidden(\"annotations\") }),\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(_drawer__WEBPACK_IMPORTED_MODULE_2__.DrawerItemLabels, { name: \"Finalizers\", labels: getFinalizers(), hidden: isHidden(\"finalizers\") }),\n (ownerRefs === null || ownerRefs === void 0 ? void 0 : ownerRefs.length) > 0 && (react__WEBPACK_IMPORTED_MODULE_0__.createElement(_drawer__WEBPACK_IMPORTED_MODULE_2__.DrawerItem, { name: \"Controlled By\", hidden: isHidden(\"ownerReferences\") }, ownerRefs.map(ref => (react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"p\", { key: ref.name },\n `${ref.kind} `,\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(react_router_dom__WEBPACK_IMPORTED_MODULE_11__.Link, { to: getDetailsUrl(apiManager.lookupApiLink(ref, object)) }, ref.name))))))));\n});\nconst KubeObjectMeta = (0,_ogre_tools_injectable_react__WEBPACK_IMPORTED_MODULE_6__.withInjectables)(NonInjectedKubeObjectMeta, {\n getProps: (di, props) => ({\n ...props,\n getDetailsUrl: di.inject(_kube_detail_params_get_details_url_injectable__WEBPACK_IMPORTED_MODULE_7__[\"default\"]),\n apiManager: di.inject(_common_k8s_api_api_manager_manager_injectable__WEBPACK_IMPORTED_MODULE_8__[\"default\"]),\n logger: di.inject(_common_logger_injectable__WEBPACK_IMPORTED_MODULE_9__[\"default\"]),\n }),\n});\n\n\n//# sourceURL=webpack://@k8slens/open-lens/./src/renderer/components/kube-object-meta/kube-object-meta.tsx?");
32985
32995
 
32986
32996
  /***/ }),
32987
32997
 
@@ -34390,16 +34400,6 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
34390
34400
 
34391
34401
  /***/ }),
34392
34402
 
34393
- /***/ "./node_modules/verror/lib/verror.js":
34394
- /*!*******************************************!*\
34395
- !*** ./node_modules/verror/lib/verror.js ***!
34396
- \*******************************************/
34397
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
34398
-
34399
- eval("/*\n * verror.js: richer JavaScript errors\n */\n\nvar mod_assertplus = __webpack_require__(/*! assert-plus */ \"./node_modules/assert-plus/assert.js\");\nvar mod_util = __webpack_require__(/*! util */ \"util\");\n\nvar mod_extsprintf = __webpack_require__(/*! extsprintf */ \"./node_modules/extsprintf/lib/extsprintf.js\");\nvar mod_isError = (__webpack_require__(/*! core-util-is */ \"./node_modules/core-util-is/lib/util.js\").isError);\nvar sprintf = mod_extsprintf.sprintf;\n\n/*\n * Public interface\n */\n\n/* So you can 'var VError = require('verror')' */\nmodule.exports = VError;\n/* For compatibility */\nVError.VError = VError;\n/* Other exported classes */\nVError.SError = SError;\nVError.WError = WError;\nVError.MultiError = MultiError;\n\n/*\n * Common function used to parse constructor arguments for VError, WError, and\n * SError. Named arguments to this function:\n *\n * strict\t\tforce strict interpretation of sprintf arguments, even\n * \t\t\tif the options in \"argv\" don't say so\n *\n * argv\t\terror's constructor arguments, which are to be\n * \t\t\tinterpreted as described in README.md. For quick\n * \t\t\treference, \"argv\" has one of the following forms:\n *\n * [ sprintf_args... ] (argv[0] is a string)\n * [ cause, sprintf_args... ] (argv[0] is an Error)\n * [ options, sprintf_args... ] (argv[0] is an object)\n *\n * This function normalizes these forms, producing an object with the following\n * properties:\n *\n * options equivalent to \"options\" in third form. This will never\n * \t\t\tbe a direct reference to what the caller passed in\n * \t\t\t(i.e., it may be a shallow copy), so it can be freely\n * \t\t\tmodified.\n *\n * shortmessage result of sprintf(sprintf_args), taking options.strict\n * \t\t\tinto account as described in README.md.\n */\nfunction parseConstructorArguments(args)\n{\n\tvar argv, options, sprintf_args, shortmessage, k;\n\n\tmod_assertplus.object(args, 'args');\n\tmod_assertplus.bool(args.strict, 'args.strict');\n\tmod_assertplus.array(args.argv, 'args.argv');\n\targv = args.argv;\n\n\t/*\n\t * First, figure out which form of invocation we've been given.\n\t */\n\tif (argv.length === 0) {\n\t\toptions = {};\n\t\tsprintf_args = [];\n\t} else if (mod_isError(argv[0])) {\n\t\toptions = { 'cause': argv[0] };\n\t\tsprintf_args = argv.slice(1);\n\t} else if (typeof (argv[0]) === 'object') {\n\t\toptions = {};\n\t\tfor (k in argv[0]) {\n\t\t\toptions[k] = argv[0][k];\n\t\t}\n\t\tsprintf_args = argv.slice(1);\n\t} else {\n\t\tmod_assertplus.string(argv[0],\n\t\t 'first argument to VError, SError, or WError ' +\n\t\t 'constructor must be a string, object, or Error');\n\t\toptions = {};\n\t\tsprintf_args = argv;\n\t}\n\n\t/*\n\t * Now construct the error's message.\n\t *\n\t * extsprintf (which we invoke here with our caller's arguments in order\n\t * to construct this Error's message) is strict in its interpretation of\n\t * values to be processed by the \"%s\" specifier. The value passed to\n\t * extsprintf must actually be a string or something convertible to a\n\t * String using .toString(). Passing other values (notably \"null\" and\n\t * \"undefined\") is considered a programmer error. The assumption is\n\t * that if you actually want to print the string \"null\" or \"undefined\",\n\t * then that's easy to do that when you're calling extsprintf; on the\n\t * other hand, if you did NOT want that (i.e., there's actually a bug\n\t * where the program assumes some variable is non-null and tries to\n\t * print it, which might happen when constructing a packet or file in\n\t * some specific format), then it's better to stop immediately than\n\t * produce bogus output.\n\t *\n\t * However, sometimes the bug is only in the code calling VError, and a\n\t * programmer might prefer to have the error message contain \"null\" or\n\t * \"undefined\" rather than have the bug in the error path crash the\n\t * program (making the first bug harder to identify). For that reason,\n\t * by default VError converts \"null\" or \"undefined\" arguments to their\n\t * string representations and passes those to extsprintf. Programmers\n\t * desiring the strict behavior can use the SError class or pass the\n\t * \"strict\" option to the VError constructor.\n\t */\n\tmod_assertplus.object(options);\n\tif (!options.strict && !args.strict) {\n\t\tsprintf_args = sprintf_args.map(function (a) {\n\t\t\treturn (a === null ? 'null' :\n\t\t\t a === undefined ? 'undefined' : a);\n\t\t});\n\t}\n\n\tif (sprintf_args.length === 0) {\n\t\tshortmessage = '';\n\t} else {\n\t\tshortmessage = sprintf.apply(null, sprintf_args);\n\t}\n\n\treturn ({\n\t 'options': options,\n\t 'shortmessage': shortmessage\n\t});\n}\n\n/*\n * See README.md for reference documentation.\n */\nfunction VError()\n{\n\tvar args, obj, parsed, cause, ctor, message, k;\n\n\targs = Array.prototype.slice.call(arguments, 0);\n\n\t/*\n\t * This is a regrettable pattern, but JavaScript's built-in Error class\n\t * is defined to work this way, so we allow the constructor to be called\n\t * without \"new\".\n\t */\n\tif (!(this instanceof VError)) {\n\t\tobj = Object.create(VError.prototype);\n\t\tVError.apply(obj, arguments);\n\t\treturn (obj);\n\t}\n\n\t/*\n\t * For convenience and backwards compatibility, we support several\n\t * different calling forms. Normalize them here.\n\t */\n\tparsed = parseConstructorArguments({\n\t 'argv': args,\n\t 'strict': false\n\t});\n\n\t/*\n\t * If we've been given a name, apply it now.\n\t */\n\tif (parsed.options.name) {\n\t\tmod_assertplus.string(parsed.options.name,\n\t\t 'error\\'s \"name\" must be a string');\n\t\tthis.name = parsed.options.name;\n\t}\n\n\t/*\n\t * For debugging, we keep track of the original short message (attached\n\t * this Error particularly) separately from the complete message (which\n\t * includes the messages of our cause chain).\n\t */\n\tthis.jse_shortmsg = parsed.shortmessage;\n\tmessage = parsed.shortmessage;\n\n\t/*\n\t * If we've been given a cause, record a reference to it and update our\n\t * message appropriately.\n\t */\n\tcause = parsed.options.cause;\n\tif (cause) {\n\t\tmod_assertplus.ok(mod_isError(cause), 'cause is not an Error');\n\t\tthis.jse_cause = cause;\n\n\t\tif (!parsed.options.skipCauseMessage) {\n\t\t\tmessage += ': ' + cause.message;\n\t\t}\n\t}\n\n\t/*\n\t * If we've been given an object with properties, shallow-copy that\n\t * here. We don't want to use a deep copy in case there are non-plain\n\t * objects here, but we don't want to use the original object in case\n\t * the caller modifies it later.\n\t */\n\tthis.jse_info = {};\n\tif (parsed.options.info) {\n\t\tfor (k in parsed.options.info) {\n\t\t\tthis.jse_info[k] = parsed.options.info[k];\n\t\t}\n\t}\n\n\tthis.message = message;\n\tError.call(this, message);\n\n\tif (Error.captureStackTrace) {\n\t\tctor = parsed.options.constructorOpt || this.constructor;\n\t\tError.captureStackTrace(this, ctor);\n\t}\n\n\treturn (this);\n}\n\nmod_util.inherits(VError, Error);\nVError.prototype.name = 'VError';\n\nVError.prototype.toString = function ve_toString()\n{\n\tvar str = (this.hasOwnProperty('name') && this.name ||\n\t\tthis.constructor.name || this.constructor.prototype.name);\n\tif (this.message)\n\t\tstr += ': ' + this.message;\n\n\treturn (str);\n};\n\n/*\n * This method is provided for compatibility. New callers should use\n * VError.cause() instead. That method also uses the saner `null` return value\n * when there is no cause.\n */\nVError.prototype.cause = function ve_cause()\n{\n\tvar cause = VError.cause(this);\n\treturn (cause === null ? undefined : cause);\n};\n\n/*\n * Static methods\n *\n * These class-level methods are provided so that callers can use them on\n * instances of Errors that are not VErrors. New interfaces should be provided\n * only using static methods to eliminate the class of programming mistake where\n * people fail to check whether the Error object has the corresponding methods.\n */\n\nVError.cause = function (err)\n{\n\tmod_assertplus.ok(mod_isError(err), 'err must be an Error');\n\treturn (mod_isError(err.jse_cause) ? err.jse_cause : null);\n};\n\nVError.info = function (err)\n{\n\tvar rv, cause, k;\n\n\tmod_assertplus.ok(mod_isError(err), 'err must be an Error');\n\tcause = VError.cause(err);\n\tif (cause !== null) {\n\t\trv = VError.info(cause);\n\t} else {\n\t\trv = {};\n\t}\n\n\tif (typeof (err.jse_info) == 'object' && err.jse_info !== null) {\n\t\tfor (k in err.jse_info) {\n\t\t\trv[k] = err.jse_info[k];\n\t\t}\n\t}\n\n\treturn (rv);\n};\n\nVError.findCauseByName = function (err, name)\n{\n\tvar cause;\n\n\tmod_assertplus.ok(mod_isError(err), 'err must be an Error');\n\tmod_assertplus.string(name, 'name');\n\tmod_assertplus.ok(name.length > 0, 'name cannot be empty');\n\n\tfor (cause = err; cause !== null; cause = VError.cause(cause)) {\n\t\tmod_assertplus.ok(mod_isError(cause));\n\t\tif (cause.name == name) {\n\t\t\treturn (cause);\n\t\t}\n\t}\n\n\treturn (null);\n};\n\nVError.hasCauseWithName = function (err, name)\n{\n\treturn (VError.findCauseByName(err, name) !== null);\n};\n\nVError.fullStack = function (err)\n{\n\tmod_assertplus.ok(mod_isError(err), 'err must be an Error');\n\n\tvar cause = VError.cause(err);\n\n\tif (cause) {\n\t\treturn (err.stack + '\\ncaused by: ' + VError.fullStack(cause));\n\t}\n\n\treturn (err.stack);\n};\n\nVError.errorFromList = function (errors)\n{\n\tmod_assertplus.arrayOfObject(errors, 'errors');\n\n\tif (errors.length === 0) {\n\t\treturn (null);\n\t}\n\n\terrors.forEach(function (e) {\n\t\tmod_assertplus.ok(mod_isError(e));\n\t});\n\n\tif (errors.length == 1) {\n\t\treturn (errors[0]);\n\t}\n\n\treturn (new MultiError(errors));\n};\n\nVError.errorForEach = function (err, func)\n{\n\tmod_assertplus.ok(mod_isError(err), 'err must be an Error');\n\tmod_assertplus.func(func, 'func');\n\n\tif (err instanceof MultiError) {\n\t\terr.errors().forEach(function iterError(e) { func(e); });\n\t} else {\n\t\tfunc(err);\n\t}\n};\n\n\n/*\n * SError is like VError, but stricter about types. You cannot pass \"null\" or\n * \"undefined\" as string arguments to the formatter.\n */\nfunction SError()\n{\n\tvar args, obj, parsed, options;\n\n\targs = Array.prototype.slice.call(arguments, 0);\n\tif (!(this instanceof SError)) {\n\t\tobj = Object.create(SError.prototype);\n\t\tSError.apply(obj, arguments);\n\t\treturn (obj);\n\t}\n\n\tparsed = parseConstructorArguments({\n\t 'argv': args,\n\t 'strict': true\n\t});\n\n\toptions = parsed.options;\n\tVError.call(this, options, '%s', parsed.shortmessage);\n\n\treturn (this);\n}\n\n/*\n * We don't bother setting SError.prototype.name because once constructed,\n * SErrors are just like VErrors.\n */\nmod_util.inherits(SError, VError);\n\n\n/*\n * Represents a collection of errors for the purpose of consumers that generally\n * only deal with one error. Callers can extract the individual errors\n * contained in this object, but may also just treat it as a normal single\n * error, in which case a summary message will be printed.\n */\nfunction MultiError(errors)\n{\n\tmod_assertplus.array(errors, 'list of errors');\n\tmod_assertplus.ok(errors.length > 0, 'must be at least one error');\n\tthis.ase_errors = errors;\n\n\tVError.call(this, {\n\t 'cause': errors[0]\n\t}, 'first of %d error%s', errors.length, errors.length == 1 ? '' : 's');\n}\n\nmod_util.inherits(MultiError, VError);\nMultiError.prototype.name = 'MultiError';\n\nMultiError.prototype.errors = function me_errors()\n{\n\treturn (this.ase_errors.slice(0));\n};\n\n\n/*\n * See README.md for reference details.\n */\nfunction WError()\n{\n\tvar args, obj, parsed, options;\n\n\targs = Array.prototype.slice.call(arguments, 0);\n\tif (!(this instanceof WError)) {\n\t\tobj = Object.create(WError.prototype);\n\t\tWError.apply(obj, args);\n\t\treturn (obj);\n\t}\n\n\tparsed = parseConstructorArguments({\n\t 'argv': args,\n\t 'strict': false\n\t});\n\n\toptions = parsed.options;\n\toptions['skipCauseMessage'] = true;\n\tVError.call(this, options, '%s', parsed.shortmessage);\n\n\treturn (this);\n}\n\nmod_util.inherits(WError, VError);\nWError.prototype.name = 'WError';\n\nWError.prototype.toString = function we_toString()\n{\n\tvar str = (this.hasOwnProperty('name') && this.name ||\n\t\tthis.constructor.name || this.constructor.prototype.name);\n\tif (this.message)\n\t\tstr += ': ' + this.message;\n\tif (this.jse_cause && this.jse_cause.message)\n\t\tstr += '; caused by ' + this.jse_cause.toString();\n\n\treturn (str);\n};\n\n/*\n * For purely historical reasons, WError's cause() function allows you to set\n * the cause.\n */\nWError.prototype.cause = function we_cause(c)\n{\n\tif (mod_isError(c))\n\t\tthis.jse_cause = c;\n\n\treturn (this.jse_cause);\n};\n\n\n//# sourceURL=webpack://@k8slens/open-lens/./node_modules/verror/lib/verror.js?");
34400
-
34401
- /***/ }),
34402
-
34403
34403
  /***/ "./node_modules/which/which.js":
34404
34404
  /*!*************************************!*\
34405
34405
  !*** ./node_modules/which/which.js ***!