diff --git a/dist/autofill-debug.js b/dist/autofill-debug.js index 3a49c3477..4d7388a9c 100644 --- a/dist/autofill-debug.js +++ b/dist/autofill-debug.js @@ -5,7 +5,6 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.processConfig = processConfig; - function getTopLevelURL() { try { // FROM: https://stackoverflow.com/a/7739035/73479 @@ -19,20 +18,18 @@ function getTopLevelURL() { return new URL(location.href); } } - function isUnprotectedDomain(topLevelUrl, featureList) { let unprotectedDomain = false; - const domainParts = topLevelUrl && topLevelUrl.host ? topLevelUrl.host.split('.') : []; // walk up the domain to see if it's unprotected + const domainParts = topLevelUrl && topLevelUrl.host ? topLevelUrl.host.split('.') : []; + // walk up the domain to see if it's unprotected while (domainParts.length > 1 && !unprotectedDomain) { const partialDomain = domainParts.join('.'); unprotectedDomain = featureList.filter(domain => domain.domain === partialDomain).length > 0; domainParts.shift(); } - return unprotectedDomain; } - function processConfig(data, userList, preferences) { const topLevelUrl = getTopLevelURL(); const allowlisted = userList.filter(domain => domain === topLevelUrl.host).length > 0; @@ -46,8 +43,8 @@ function processConfig(data, userList, preferences) { isBroken, allowlisted, enabledFeatures - }; // TODO - + }; + // TODO preferences.cookie = {}; return preferences; } @@ -58,64 +55,46 @@ function processConfig(data, userList, preferences) { Object.defineProperty(exports, "__esModule", { value: true }); -exports.setErrorMap = exports.overrideErrorMap = exports.defaultErrorMap = exports.ZodError = exports.quotelessJson = exports.ZodIssueCode = void 0; - -const parseUtil_1 = require("./helpers/parseUtil"); - +exports.ZodError = exports.quotelessJson = exports.ZodIssueCode = void 0; const util_1 = require("./helpers/util"); - -exports.ZodIssueCode = util_1.util.arrayToEnum(["invalid_type", "invalid_literal", "custom", "invalid_union", "invalid_union_discriminator", "invalid_enum_value", "unrecognized_keys", "invalid_arguments", "invalid_return_type", "invalid_date", "invalid_string", "too_small", "too_big", "invalid_intersection_types", "not_multiple_of"]); - +exports.ZodIssueCode = util_1.util.arrayToEnum(["invalid_type", "invalid_literal", "custom", "invalid_union", "invalid_union_discriminator", "invalid_enum_value", "unrecognized_keys", "invalid_arguments", "invalid_return_type", "invalid_date", "invalid_string", "too_small", "too_big", "invalid_intersection_types", "not_multiple_of", "not_finite"]); const quotelessJson = obj => { const json = JSON.stringify(obj, null, 2); return json.replace(/"([^"]+)":/g, "$1:"); }; - exports.quotelessJson = quotelessJson; - class ZodError extends Error { constructor(issues) { var _this; - super(); _this = this; this.issues = []; - this.addIssue = sub => { this.issues = [...this.issues, sub]; }; - this.addIssues = function () { let subs = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; _this.issues = [..._this.issues, ...subs]; }; - const actualProto = new.target.prototype; - if (Object.setPrototypeOf) { - // eslint-disable-next-line ban/ban Object.setPrototypeOf(this, actualProto); } else { this.__proto__ = actualProto; } - this.name = "ZodError"; this.issues = issues; } - get errors() { return this.issues; } - format(_mapper) { const mapper = _mapper || function (issue) { return issue.message; }; - const fieldErrors = { _errors: [] }; - const processError = error => { for (const issue of error.issues) { if (issue.code === "invalid_union") { @@ -129,57 +108,41 @@ class ZodError extends Error { } else { let curr = fieldErrors; let i = 0; - while (i < issue.path.length) { const el = issue.path[i]; const terminal = i === issue.path.length - 1; - if (!terminal) { curr[el] = curr[el] || { _errors: [] - }; // if (typeof el === "string") { - // curr[el] = curr[el] || { _errors: [] }; - // } else if (typeof el === "number") { - // const errorArray: any = []; - // errorArray._errors = []; - // curr[el] = curr[el] || errorArray; - // } + }; } else { curr[el] = curr[el] || { _errors: [] }; - curr[el]._errors.push(mapper(issue)); } - curr = curr[el]; i++; } } } }; - processError(this); return fieldErrors; } - toString() { return this.message; } - get message() { - return JSON.stringify(this.issues, null, 2); + return JSON.stringify(this.issues, util_1.util.jsonStringifyReplacer, 2); } - get isEmpty() { return this.issues.length === 0; } - flatten() { let mapper = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : issue => issue.message; const fieldErrors = {}; const formErrors = []; - for (const sub of this.issues) { if (sub.path.length > 0) { fieldErrors[sub.path[0]] = fieldErrors[sub.path[0]] || []; @@ -188,153 +151,74 @@ class ZodError extends Error { formErrors.push(mapper(sub)); } } - return { formErrors, fieldErrors }; } - get formErrors() { return this.flatten(); } - } - exports.ZodError = ZodError; - ZodError.create = issues => { const error = new ZodError(issues); return error; }; -const defaultErrorMap = (issue, _ctx) => { - let message; - - switch (issue.code) { - case exports.ZodIssueCode.invalid_type: - if (issue.received === parseUtil_1.ZodParsedType.undefined) { - message = "Required"; - } else { - message = "Expected ".concat(issue.expected, ", received ").concat(issue.received); - } - - break; - - case exports.ZodIssueCode.invalid_literal: - message = "Invalid literal value, expected ".concat(JSON.stringify(issue.expected)); - break; - - case exports.ZodIssueCode.unrecognized_keys: - message = "Unrecognized key(s) in object: ".concat(util_1.util.joinValues(issue.keys, ", ")); - break; - - case exports.ZodIssueCode.invalid_union: - message = "Invalid input"; - break; - - case exports.ZodIssueCode.invalid_union_discriminator: - message = "Invalid discriminator value. Expected ".concat(util_1.util.joinValues(issue.options)); - break; - - case exports.ZodIssueCode.invalid_enum_value: - message = "Invalid enum value. Expected ".concat(util_1.util.joinValues(issue.options), ", received '").concat(issue.received, "'"); - break; - - case exports.ZodIssueCode.invalid_arguments: - message = "Invalid function arguments"; - break; - - case exports.ZodIssueCode.invalid_return_type: - message = "Invalid function return type"; - break; - - case exports.ZodIssueCode.invalid_date: - message = "Invalid date"; - break; - - case exports.ZodIssueCode.invalid_string: - if (issue.validation !== "regex") message = "Invalid ".concat(issue.validation);else message = "Invalid"; - break; - - case exports.ZodIssueCode.too_small: - if (issue.type === "array") message = "Array must contain ".concat(issue.inclusive ? "at least" : "more than", " ").concat(issue.minimum, " element(s)");else if (issue.type === "string") message = "String must contain ".concat(issue.inclusive ? "at least" : "over", " ").concat(issue.minimum, " character(s)");else if (issue.type === "number") message = "Number must be greater than ".concat(issue.inclusive ? "or equal to " : "").concat(issue.minimum);else message = "Invalid input"; - break; - - case exports.ZodIssueCode.too_big: - if (issue.type === "array") message = "Array must contain ".concat(issue.inclusive ? "at most" : "less than", " ").concat(issue.maximum, " element(s)");else if (issue.type === "string") message = "String must contain ".concat(issue.inclusive ? "at most" : "under", " ").concat(issue.maximum, " character(s)");else if (issue.type === "number") message = "Number must be less than ".concat(issue.inclusive ? "or equal to " : "").concat(issue.maximum);else message = "Invalid input"; - break; - - case exports.ZodIssueCode.custom: - message = "Invalid input"; - break; - - case exports.ZodIssueCode.invalid_intersection_types: - message = "Intersection results could not be merged"; - break; - - case exports.ZodIssueCode.not_multiple_of: - message = "Number must be a multiple of ".concat(issue.multipleOf); - break; - - default: - message = _ctx.defaultError; - util_1.util.assertNever(issue); - } +},{"./helpers/util":8}],3:[function(require,module,exports){ +"use strict"; - return { - message +var __importDefault = void 0 && (void 0).__importDefault || function (mod) { + return mod && mod.__esModule ? mod : { + "default": mod }; }; - -exports.defaultErrorMap = defaultErrorMap; -exports.overrideErrorMap = exports.defaultErrorMap; - -const setErrorMap = map => { - exports.overrideErrorMap = map; -}; - +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.getErrorMap = exports.setErrorMap = exports.defaultErrorMap = void 0; +const en_1 = __importDefault(require("./locales/en")); +exports.defaultErrorMap = en_1.default; +let overrideErrorMap = en_1.default; +function setErrorMap(map) { + overrideErrorMap = map; +} exports.setErrorMap = setErrorMap; +function getErrorMap() { + return overrideErrorMap; +} +exports.getErrorMap = getErrorMap; -},{"./helpers/parseUtil":5,"./helpers/util":7}],3:[function(require,module,exports){ +},{"./locales/en":10}],4:[function(require,module,exports){ "use strict"; var __createBinding = void 0 && (void 0).__createBinding || (Object.create ? function (o, m, k, k2) { if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { - enumerable: true, - get: function () { - return m[k]; - } - }; - } - - Object.defineProperty(o, k2, desc); + Object.defineProperty(o, k2, { + enumerable: true, + get: function () { + return m[k]; + } + }); } : function (o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; }); - var __exportStar = void 0 && (void 0).__exportStar || function (m, exports) { for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); }; - Object.defineProperty(exports, "__esModule", { value: true }); - +__exportStar(require("./errors"), exports); __exportStar(require("./helpers/parseUtil"), exports); - __exportStar(require("./helpers/typeAliases"), exports); - +__exportStar(require("./helpers/util"), exports); __exportStar(require("./types"), exports); - __exportStar(require("./ZodError"), exports); -},{"./ZodError":2,"./helpers/parseUtil":5,"./helpers/typeAliases":6,"./types":9}],4:[function(require,module,exports){ +},{"./ZodError":2,"./errors":3,"./helpers/parseUtil":6,"./helpers/typeAliases":7,"./helpers/util":8,"./types":11}],5:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { @@ -342,85 +226,27 @@ Object.defineProperty(exports, "__esModule", { }); exports.errorUtil = void 0; var errorUtil; - (function (errorUtil) { errorUtil.errToObj = message => typeof message === "string" ? { message } : message || {}; - errorUtil.toString = message => typeof message === "string" ? message : message === null || message === void 0 ? void 0 : message.message; })(errorUtil = exports.errorUtil || (exports.errorUtil = {})); -},{}],5:[function(require,module,exports){ +},{}],6:[function(require,module,exports){ "use strict"; +var __importDefault = void 0 && (void 0).__importDefault || function (mod) { + return mod && mod.__esModule ? mod : { + "default": mod + }; +}; Object.defineProperty(exports, "__esModule", { value: true }); -exports.isAsync = exports.isValid = exports.isDirty = exports.isAborted = exports.OK = exports.DIRTY = exports.INVALID = exports.ParseStatus = exports.addIssueToContext = exports.EMPTY_PATH = exports.makeIssue = exports.getParsedType = exports.ZodParsedType = void 0; - -const ZodError_1 = require("../ZodError"); - -const util_1 = require("./util"); - -exports.ZodParsedType = util_1.util.arrayToEnum(["string", "nan", "number", "integer", "float", "boolean", "date", "bigint", "symbol", "function", "undefined", "null", "array", "object", "unknown", "promise", "void", "never", "map", "set"]); - -const getParsedType = data => { - const t = typeof data; - - switch (t) { - case "undefined": - return exports.ZodParsedType.undefined; - - case "string": - return exports.ZodParsedType.string; - - case "number": - return isNaN(data) ? exports.ZodParsedType.nan : exports.ZodParsedType.number; - - case "boolean": - return exports.ZodParsedType.boolean; - - case "function": - return exports.ZodParsedType.function; - - case "bigint": - return exports.ZodParsedType.bigint; - - case "object": - if (Array.isArray(data)) { - return exports.ZodParsedType.array; - } - - if (data === null) { - return exports.ZodParsedType.null; - } - - if (data.then && typeof data.then === "function" && data.catch && typeof data.catch === "function") { - return exports.ZodParsedType.promise; - } - - if (typeof Map !== "undefined" && data instanceof Map) { - return exports.ZodParsedType.map; - } - - if (typeof Set !== "undefined" && data instanceof Set) { - return exports.ZodParsedType.set; - } - - if (typeof Date !== "undefined" && data instanceof Date) { - return exports.ZodParsedType.date; - } - - return exports.ZodParsedType.object; - - default: - return exports.ZodParsedType.unknown; - } -}; - -exports.getParsedType = getParsedType; - +exports.isAsync = exports.isValid = exports.isDirty = exports.isAborted = exports.OK = exports.DIRTY = exports.INVALID = exports.ParseStatus = exports.addIssueToContext = exports.EMPTY_PATH = exports.makeIssue = void 0; +const errors_1 = require("../errors"); +const en_1 = __importDefault(require("../locales/en")); const makeIssue = params => { const { data, @@ -429,85 +255,70 @@ const makeIssue = params => { issueData } = params; const fullPath = [...path, ...(issueData.path || [])]; - const fullIssue = { ...issueData, + const fullIssue = { + ...issueData, path: fullPath }; let errorMessage = ""; const maps = errorMaps.filter(m => !!m).slice().reverse(); - for (const map of maps) { errorMessage = map(fullIssue, { data, defaultError: errorMessage }).message; } - - return { ...issueData, + return { + ...issueData, path: fullPath, message: issueData.message || errorMessage }; }; - exports.makeIssue = makeIssue; exports.EMPTY_PATH = []; - function addIssueToContext(ctx, issueData) { const issue = (0, exports.makeIssue)({ issueData: issueData, data: ctx.data, path: ctx.path, - errorMaps: [ctx.common.contextualErrorMap, ctx.schemaErrorMap, ZodError_1.overrideErrorMap, ZodError_1.defaultErrorMap // then global default map - ].filter(x => !!x) + errorMaps: [ctx.common.contextualErrorMap, ctx.schemaErrorMap, (0, errors_1.getErrorMap)(), en_1.default].filter(x => !!x) }); ctx.common.issues.push(issue); } - exports.addIssueToContext = addIssueToContext; - class ParseStatus { constructor() { this.value = "valid"; } - dirty() { if (this.value === "valid") this.value = "dirty"; } - abort() { if (this.value !== "aborted") this.value = "aborted"; } - static mergeArray(status, results) { const arrayValue = []; - for (const s of results) { if (s.status === "aborted") return exports.INVALID; if (s.status === "dirty") status.dirty(); arrayValue.push(s.value); } - return { status: status.value, value: arrayValue }; } - static async mergeObjectAsync(status, pairs) { const syncPairs = []; - for (const pair of pairs) { syncPairs.push({ key: await pair.key, value: await pair.value }); } - return ParseStatus.mergeObjectSync(status, syncPairs); } - static mergeObjectSync(status, pairs) { const finalObject = {}; - for (const pair of pairs) { const { key, @@ -517,227 +328,327 @@ class ParseStatus { if (value.status === "aborted") return exports.INVALID; if (key.status === "dirty") status.dirty(); if (value.status === "dirty") status.dirty(); - - if (typeof value.value !== "undefined" || pair.alwaysSet) { + if (key.value !== "__proto__" && (typeof value.value !== "undefined" || pair.alwaysSet)) { finalObject[key.value] = value.value; } } - return { status: status.value, value: finalObject }; } - } - exports.ParseStatus = ParseStatus; exports.INVALID = Object.freeze({ status: "aborted" }); - const DIRTY = value => ({ status: "dirty", value }); - exports.DIRTY = DIRTY; - const OK = value => ({ status: "valid", value }); - exports.OK = OK; - const isAborted = x => x.status === "aborted"; - exports.isAborted = isAborted; - const isDirty = x => x.status === "dirty"; - exports.isDirty = isDirty; - const isValid = x => x.status === "valid"; - exports.isValid = isValid; - -const isAsync = x => typeof Promise !== undefined && x instanceof Promise; - +const isAsync = x => typeof Promise !== "undefined" && x instanceof Promise; exports.isAsync = isAsync; -},{"../ZodError":2,"./util":7}],6:[function(require,module,exports){ +},{"../errors":3,"../locales/en":10}],7:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -},{}],7:[function(require,module,exports){ +},{}],8:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -exports.util = void 0; +exports.getParsedType = exports.ZodParsedType = exports.objectUtil = exports.util = void 0; var util; - (function (util) { + util.assertEqual = val => val; + function assertIs(_arg) {} + util.assertIs = assertIs; function assertNever(_x) { throw new Error(); } - util.assertNever = assertNever; - util.arrayToEnum = items => { const obj = {}; - for (const item of items) { obj[item] = item; } - return obj; }; - util.getValidEnumValues = obj => { const validKeys = util.objectKeys(obj).filter(k => typeof obj[obj[k]] !== "number"); const filtered = {}; - for (const k of validKeys) { filtered[k] = obj[k]; } - return util.objectValues(filtered); }; - util.objectValues = obj => { return util.objectKeys(obj).map(function (e) { return obj[e]; }); }; - - util.objectKeys = typeof Object.keys === "function" // eslint-disable-line ban/ban - ? obj => Object.keys(obj) // eslint-disable-line ban/ban - : object => { + util.objectKeys = typeof Object.keys === "function" ? obj => Object.keys(obj) : object => { const keys = []; - for (const key in object) { if (Object.prototype.hasOwnProperty.call(object, key)) { keys.push(key); } } - return keys; }; - util.find = (arr, checker) => { for (const item of arr) { if (checker(item)) return item; } - return undefined; }; - - util.isInteger = typeof Number.isInteger === "function" ? val => Number.isInteger(val) // eslint-disable-line ban/ban - : val => typeof val === "number" && isFinite(val) && Math.floor(val) === val; - + util.isInteger = typeof Number.isInteger === "function" ? val => Number.isInteger(val) : val => typeof val === "number" && isFinite(val) && Math.floor(val) === val; function joinValues(array) { let separator = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : " | "; - return array.map(val => typeof val === "string" ? "'".concat(val, "'") : val).join(separator); + return array.map(val => typeof val === "string" ? `'${val}'` : val).join(separator); } - util.joinValues = joinValues; + util.jsonStringifyReplacer = (_, value) => { + if (typeof value === "bigint") { + return value.toString(); + } + return value; + }; })(util = exports.util || (exports.util = {})); - -},{}],8:[function(require,module,exports){ -"use strict"; - -var __createBinding = void 0 && (void 0).__createBinding || (Object.create ? function (o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { - enumerable: true, - get: function () { - return m[k]; - } +var objectUtil; +(function (objectUtil) { + objectUtil.mergeShapes = (first, second) => { + return { + ...first, + ...second }; - } - - Object.defineProperty(o, k2, desc); -} : function (o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -}); - -var __setModuleDefault = void 0 && (void 0).__setModuleDefault || (Object.create ? function (o, v) { - Object.defineProperty(o, "default", { - enumerable: true, - value: v - }); -} : function (o, v) { - o["default"] = v; -}); - -var __importStar = void 0 && (void 0).__importStar || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + }; +})(objectUtil = exports.objectUtil || (exports.objectUtil = {})); +exports.ZodParsedType = util.arrayToEnum(["string", "nan", "number", "integer", "float", "boolean", "date", "bigint", "symbol", "function", "undefined", "null", "array", "object", "unknown", "promise", "void", "never", "map", "set"]); +const getParsedType = data => { + const t = typeof data; + switch (t) { + case "undefined": + return exports.ZodParsedType.undefined; + case "string": + return exports.ZodParsedType.string; + case "number": + return isNaN(data) ? exports.ZodParsedType.nan : exports.ZodParsedType.number; + case "boolean": + return exports.ZodParsedType.boolean; + case "function": + return exports.ZodParsedType.function; + case "bigint": + return exports.ZodParsedType.bigint; + case "symbol": + return exports.ZodParsedType.symbol; + case "object": + if (Array.isArray(data)) { + return exports.ZodParsedType.array; + } + if (data === null) { + return exports.ZodParsedType.null; + } + if (data.then && typeof data.then === "function" && data.catch && typeof data.catch === "function") { + return exports.ZodParsedType.promise; + } + if (typeof Map !== "undefined" && data instanceof Map) { + return exports.ZodParsedType.map; + } + if (typeof Set !== "undefined" && data instanceof Set) { + return exports.ZodParsedType.set; + } + if (typeof Date !== "undefined" && data instanceof Date) { + return exports.ZodParsedType.date; + } + return exports.ZodParsedType.object; + default: + return exports.ZodParsedType.unknown; + } +}; +exports.getParsedType = getParsedType; - __setModuleDefault(result, mod); +},{}],9:[function(require,module,exports){ +"use strict"; +var __createBinding = void 0 && (void 0).__createBinding || (Object.create ? function (o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { + enumerable: true, + get: function () { + return m[k]; + } + }); +} : function (o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +}); +var __setModuleDefault = void 0 && (void 0).__setModuleDefault || (Object.create ? function (o, v) { + Object.defineProperty(o, "default", { + enumerable: true, + value: v + }); +} : function (o, v) { + o["default"] = v; +}); +var __importStar = void 0 && (void 0).__importStar || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); return result; }; - var __exportStar = void 0 && (void 0).__exportStar || function (m, exports) { for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); }; - Object.defineProperty(exports, "__esModule", { value: true }); exports.z = void 0; - -const mod = __importStar(require("./external")); - -exports.z = mod; - +const z = __importStar(require("./external")); +exports.z = z; __exportStar(require("./external"), exports); +exports.default = z; -exports.default = mod; - -},{"./external":3}],9:[function(require,module,exports){ +},{"./external":4}],10:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -exports.intersection = exports.instanceof = exports.function = exports.enum = exports.effect = exports.discriminatedUnion = exports.date = exports.boolean = exports.bigint = exports.array = exports.any = exports.ZodFirstPartyTypeKind = exports.late = exports.ZodSchema = exports.Schema = exports.custom = exports.ZodNaN = exports.ZodDefault = exports.ZodNullable = exports.ZodOptional = exports.ZodTransformer = exports.ZodEffects = exports.ZodPromise = exports.ZodNativeEnum = exports.ZodEnum = exports.ZodLiteral = exports.ZodLazy = exports.ZodFunction = exports.ZodSet = exports.ZodMap = exports.ZodRecord = exports.ZodTuple = exports.ZodIntersection = exports.ZodDiscriminatedUnion = exports.ZodUnion = exports.ZodObject = exports.objectUtil = exports.ZodArray = exports.ZodVoid = exports.ZodNever = exports.ZodUnknown = exports.ZodAny = exports.ZodNull = exports.ZodUndefined = exports.ZodDate = exports.ZodBoolean = exports.ZodBigInt = exports.ZodNumber = exports.ZodString = exports.ZodType = void 0; -exports.void = exports.unknown = exports.union = exports.undefined = exports.tuple = exports.transformer = exports.string = exports.strictObject = exports.set = exports.record = exports.promise = exports.preprocess = exports.ostring = exports.optional = exports.onumber = exports.oboolean = exports.object = exports.number = exports.nullable = exports.null = exports.never = exports.nativeEnum = exports.nan = exports.map = exports.literal = exports.lazy = void 0; +const util_1 = require("../helpers/util"); +const ZodError_1 = require("../ZodError"); +const errorMap = (issue, _ctx) => { + let message; + switch (issue.code) { + case ZodError_1.ZodIssueCode.invalid_type: + if (issue.received === util_1.ZodParsedType.undefined) { + message = "Required"; + } else { + message = `Expected ${issue.expected}, received ${issue.received}`; + } + break; + case ZodError_1.ZodIssueCode.invalid_literal: + message = `Invalid literal value, expected ${JSON.stringify(issue.expected, util_1.util.jsonStringifyReplacer)}`; + break; + case ZodError_1.ZodIssueCode.unrecognized_keys: + message = `Unrecognized key(s) in object: ${util_1.util.joinValues(issue.keys, ", ")}`; + break; + case ZodError_1.ZodIssueCode.invalid_union: + message = `Invalid input`; + break; + case ZodError_1.ZodIssueCode.invalid_union_discriminator: + message = `Invalid discriminator value. Expected ${util_1.util.joinValues(issue.options)}`; + break; + case ZodError_1.ZodIssueCode.invalid_enum_value: + message = `Invalid enum value. Expected ${util_1.util.joinValues(issue.options)}, received '${issue.received}'`; + break; + case ZodError_1.ZodIssueCode.invalid_arguments: + message = `Invalid function arguments`; + break; + case ZodError_1.ZodIssueCode.invalid_return_type: + message = `Invalid function return type`; + break; + case ZodError_1.ZodIssueCode.invalid_date: + message = `Invalid date`; + break; + case ZodError_1.ZodIssueCode.invalid_string: + if (typeof issue.validation === "object") { + if ("includes" in issue.validation) { + message = `Invalid input: must include "${issue.validation.includes}"`; + if (typeof issue.validation.position === "number") { + message = `${message} at one or more positions greater than or equal to ${issue.validation.position}`; + } + } else if ("startsWith" in issue.validation) { + message = `Invalid input: must start with "${issue.validation.startsWith}"`; + } else if ("endsWith" in issue.validation) { + message = `Invalid input: must end with "${issue.validation.endsWith}"`; + } else { + util_1.util.assertNever(issue.validation); + } + } else if (issue.validation !== "regex") { + message = `Invalid ${issue.validation}`; + } else { + message = "Invalid"; + } + break; + case ZodError_1.ZodIssueCode.too_small: + if (issue.type === "array") message = `Array must contain ${issue.exact ? "exactly" : issue.inclusive ? `at least` : `more than`} ${issue.minimum} element(s)`;else if (issue.type === "string") message = `String must contain ${issue.exact ? "exactly" : issue.inclusive ? `at least` : `over`} ${issue.minimum} character(s)`;else if (issue.type === "number") message = `Number must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${issue.minimum}`;else if (issue.type === "date") message = `Date must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${new Date(Number(issue.minimum))}`;else message = "Invalid input"; + break; + case ZodError_1.ZodIssueCode.too_big: + if (issue.type === "array") message = `Array must contain ${issue.exact ? `exactly` : issue.inclusive ? `at most` : `less than`} ${issue.maximum} element(s)`;else if (issue.type === "string") message = `String must contain ${issue.exact ? `exactly` : issue.inclusive ? `at most` : `under`} ${issue.maximum} character(s)`;else if (issue.type === "number") message = `Number must be ${issue.exact ? `exactly` : issue.inclusive ? `less than or equal to` : `less than`} ${issue.maximum}`;else if (issue.type === "bigint") message = `BigInt must be ${issue.exact ? `exactly` : issue.inclusive ? `less than or equal to` : `less than`} ${issue.maximum}`;else if (issue.type === "date") message = `Date must be ${issue.exact ? `exactly` : issue.inclusive ? `smaller than or equal to` : `smaller than`} ${new Date(Number(issue.maximum))}`;else message = "Invalid input"; + break; + case ZodError_1.ZodIssueCode.custom: + message = `Invalid input`; + break; + case ZodError_1.ZodIssueCode.invalid_intersection_types: + message = `Intersection results could not be merged`; + break; + case ZodError_1.ZodIssueCode.not_multiple_of: + message = `Number must be a multiple of ${issue.multipleOf}`; + break; + case ZodError_1.ZodIssueCode.not_finite: + message = "Number must be finite"; + break; + default: + message = _ctx.defaultError; + util_1.util.assertNever(issue); + } + return { + message + }; +}; +exports.default = errorMap; -const errorUtil_1 = require("./helpers/errorUtil"); +},{"../ZodError":2,"../helpers/util":8}],11:[function(require,module,exports){ +"use strict"; +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.date = exports.boolean = exports.bigint = exports.array = exports.any = exports.coerce = exports.ZodFirstPartyTypeKind = exports.late = exports.ZodSchema = exports.Schema = exports.custom = exports.ZodReadonly = exports.ZodPipeline = exports.ZodBranded = exports.BRAND = exports.ZodNaN = exports.ZodCatch = exports.ZodDefault = exports.ZodNullable = exports.ZodOptional = exports.ZodTransformer = exports.ZodEffects = exports.ZodPromise = exports.ZodNativeEnum = exports.ZodEnum = exports.ZodLiteral = exports.ZodLazy = exports.ZodFunction = exports.ZodSet = exports.ZodMap = exports.ZodRecord = exports.ZodTuple = exports.ZodIntersection = exports.ZodDiscriminatedUnion = exports.ZodUnion = exports.ZodObject = exports.ZodArray = exports.ZodVoid = exports.ZodNever = exports.ZodUnknown = exports.ZodAny = exports.ZodNull = exports.ZodUndefined = exports.ZodSymbol = exports.ZodDate = exports.ZodBoolean = exports.ZodBigInt = exports.ZodNumber = exports.ZodString = exports.ZodType = void 0; +exports.NEVER = exports.void = exports.unknown = exports.union = exports.undefined = exports.tuple = exports.transformer = exports.symbol = exports.string = exports.strictObject = exports.set = exports.record = exports.promise = exports.preprocess = exports.pipeline = exports.ostring = exports.optional = exports.onumber = exports.oboolean = exports.object = exports.number = exports.nullable = exports.null = exports.never = exports.nativeEnum = exports.nan = exports.map = exports.literal = exports.lazy = exports.intersection = exports.instanceof = exports.function = exports.enum = exports.effect = exports.discriminatedUnion = void 0; +const errors_1 = require("./errors"); +const errorUtil_1 = require("./helpers/errorUtil"); const parseUtil_1 = require("./helpers/parseUtil"); - const util_1 = require("./helpers/util"); - const ZodError_1 = require("./ZodError"); - class ParseInputLazyPath { constructor(parent, value, path, key) { + this._cachedPath = []; this.parent = parent; this.data = value; this._path = path; this._key = key; } - get path() { - return this._path.concat(this._key); + if (!this._cachedPath.length) { + if (this._key instanceof Array) { + this._cachedPath.push(...this._path, ...this._key); + } else { + this._cachedPath.push(...this._path, this._key); + } + } + return this._cachedPath; } - } - const handleResult = (ctx, result) => { if ((0, parseUtil_1.isValid)(result)) { return { @@ -748,15 +659,17 @@ const handleResult = (ctx, result) => { if (!ctx.common.issues.length) { throw new Error("Validation failed but no issues detected."); } - - const error = new ZodError_1.ZodError(ctx.common.issues); return { success: false, - error + get error() { + if (this._error) return this._error; + const error = new ZodError_1.ZodError(ctx.common.issues); + this._error = error; + return this._error; + } }; } }; - function processCreateParams(params) { if (!params) return {}; const { @@ -765,42 +678,34 @@ function processCreateParams(params) { required_error, description } = params; - if (errorMap && (invalid_type_error || required_error)) { - throw new Error("Can't use \"invalid\" or \"required\" in conjunction with custom error map."); + throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`); } - if (errorMap) return { errorMap: errorMap, description }; - const customMap = (iss, ctx) => { if (iss.code !== "invalid_type") return { message: ctx.defaultError }; - if (typeof ctx.data === "undefined" && required_error) return { - message: required_error - }; - if (params.invalid_type_error) return { - message: params.invalid_type_error - }; + if (typeof ctx.data === "undefined") { + return { + message: required_error !== null && required_error !== void 0 ? required_error : ctx.defaultError + }; + } return { - message: ctx.defaultError + message: invalid_type_error !== null && invalid_type_error !== void 0 ? invalid_type_error : ctx.defaultError }; }; - return { errorMap: customMap, description }; } - class ZodType { constructor(def) { - /** Alias of safeParseAsync */ this.spa = this.safeParseAsync; - this.superRefine = this._refinement; this._def = def; this.parse = this.parse.bind(this); this.safeParse = this.safeParse.bind(this); @@ -818,70 +723,62 @@ class ZodType { this.or = this.or.bind(this); this.and = this.and.bind(this); this.transform = this.transform.bind(this); + this.brand = this.brand.bind(this); this.default = this.default.bind(this); + this.catch = this.catch.bind(this); this.describe = this.describe.bind(this); + this.pipe = this.pipe.bind(this); + this.readonly = this.readonly.bind(this); this.isNullable = this.isNullable.bind(this); this.isOptional = this.isOptional.bind(this); } - get description() { return this._def.description; } - _getType(input) { - return (0, parseUtil_1.getParsedType)(input.data); + return (0, util_1.getParsedType)(input.data); } - _getOrReturnCtx(input, ctx) { return ctx || { common: input.parent.common, data: input.data, - parsedType: (0, parseUtil_1.getParsedType)(input.data), + parsedType: (0, util_1.getParsedType)(input.data), schemaErrorMap: this._def.errorMap, path: input.path, parent: input.parent }; } - _processInputParams(input) { return { status: new parseUtil_1.ParseStatus(), ctx: { common: input.parent.common, data: input.data, - parsedType: (0, parseUtil_1.getParsedType)(input.data), + parsedType: (0, util_1.getParsedType)(input.data), schemaErrorMap: this._def.errorMap, path: input.path, parent: input.parent } }; } - _parseSync(input) { const result = this._parse(input); - if ((0, parseUtil_1.isAsync)(result)) { throw new Error("Synchronous parse encountered promise."); } - return result; } - _parseAsync(input) { const result = this._parse(input); - return Promise.resolve(result); } - parse(data, params) { const result = this.safeParse(data, params); if (result.success) return result.data; throw result.error; } - safeParse(data, params) { var _a; - const ctx = { common: { issues: [], @@ -892,24 +789,20 @@ class ZodType { schemaErrorMap: this._def.errorMap, parent: null, data, - parsedType: (0, parseUtil_1.getParsedType)(data) + parsedType: (0, util_1.getParsedType)(data) }; - const result = this._parseSync({ data, path: ctx.path, parent: ctx }); - return handleResult(ctx, result); } - async parseAsync(data, params) { const result = await this.safeParseAsync(data, params); if (result.success) return result.data; throw result.error; } - async safeParseAsync(data, params) { const ctx = { common: { @@ -921,19 +814,16 @@ class ZodType { schemaErrorMap: this._def.errorMap, parent: null, data, - parsedType: (0, parseUtil_1.getParsedType)(data) + parsedType: (0, util_1.getParsedType)(data) }; - const maybeAsyncResult = this._parse({ data, - path: [], + path: ctx.path, parent: ctx }); - const result = await ((0, parseUtil_1.isAsync)(maybeAsyncResult) ? maybeAsyncResult : Promise.resolve(maybeAsyncResult)); return handleResult(ctx, result); } - refine(check, message) { const getIssueProperties = val => { if (typeof message === "string" || typeof message === "undefined") { @@ -946,15 +836,12 @@ class ZodType { return message; } }; - return this._refinement((val, ctx) => { const result = check(val); - const setError = () => ctx.addIssue({ code: ZodError_1.ZodIssueCode.custom, ...getIssueProperties(val) }); - if (typeof Promise !== "undefined" && result instanceof Promise) { return result.then(data => { if (!data) { @@ -965,7 +852,6 @@ class ZodType { } }); } - if (!result) { setError(); return false; @@ -974,7 +860,6 @@ class ZodType { } }); } - refinement(check, refinementData) { return this._refinement((val, ctx) => { if (!check(val)) { @@ -985,7 +870,6 @@ class ZodType { } }); } - _refinement(refinement) { return new ZodEffects({ schema: this, @@ -996,37 +880,33 @@ class ZodType { } }); } - + superRefine(refinement) { + return this._refinement(refinement); + } optional() { - return ZodOptional.create(this); + return ZodOptional.create(this, this._def); } - nullable() { - return ZodNullable.create(this); + return ZodNullable.create(this, this._def); } - nullish() { - return this.optional().nullable(); + return this.nullable().optional(); } - array() { - return ZodArray.create(this); + return ZodArray.create(this, this._def); } - promise() { - return ZodPromise.create(this); + return ZodPromise.create(this, this._def); } - or(option) { - return ZodUnion.create([this, option]); + return ZodUnion.create([this, option], this._def); } - and(incoming) { - return ZodIntersection.create(this, incoming); + return ZodIntersection.create(this, incoming, this._def); } - transform(transform) { return new ZodEffects({ + ...processCreateParams(this._def), schema: this, typeName: ZodFirstPartyTypeKind.ZodEffects, effect: { @@ -1035,80 +915,136 @@ class ZodType { } }); } - default(def) { const defaultValueFunc = typeof def === "function" ? def : () => def; return new ZodDefault({ + ...processCreateParams(this._def), innerType: this, defaultValue: defaultValueFunc, typeName: ZodFirstPartyTypeKind.ZodDefault }); } - + brand() { + return new ZodBranded({ + typeName: ZodFirstPartyTypeKind.ZodBranded, + type: this, + ...processCreateParams(this._def) + }); + } + catch(def) { + const catchValueFunc = typeof def === "function" ? def : () => def; + return new ZodCatch({ + ...processCreateParams(this._def), + innerType: this, + catchValue: catchValueFunc, + typeName: ZodFirstPartyTypeKind.ZodCatch + }); + } describe(description) { const This = this.constructor; - return new This({ ...this._def, + return new This({ + ...this._def, description }); } - + pipe(target) { + return ZodPipeline.create(this, target); + } + readonly() { + return ZodReadonly.create(this); + } isOptional() { return this.safeParse(undefined).success; } - isNullable() { return this.safeParse(null).success; } - } - exports.ZodType = ZodType; exports.Schema = ZodType; exports.ZodSchema = ZodType; const cuidRegex = /^c[^\s-]{8,}$/i; -const uuidRegex = /^([a-f0-9]{8}-[a-f0-9]{4}-[1-5][a-f0-9]{3}-[a-f0-9]{4}-[a-f0-9]{12}|00000000-0000-0000-0000-000000000000)$/i; // from https://stackoverflow.com/a/46181/1550155 -// old version: too slow, didn't support unicode -// const emailRegex = /^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))$/i; -// eslint-disable-next-line - -const emailRegex = /^(([^<>()[\]\.,;:\s@\"]+(\.[^<>()[\]\.,;:\s@\"]+)*)|(\".+\"))@(([^<>()[\]\.,;:\s@\"]+\.)+[^<>()[\]\.,;:\s@\"]{2,})$/i; - +const cuid2Regex = /^[a-z][a-z0-9]*$/; +const ulidRegex = /[0-9A-HJKMNP-TV-Z]{26}/; +const uuidRegex = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i; +const emailRegex = /^([A-Z0-9_+-]+\.?)*[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i; +const emojiRegex = /^(\p{Extended_Pictographic}|\p{Emoji_Component})+$/u; +const ipv4Regex = /^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/; +const ipv6Regex = /^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/; +const datetimeRegex = args => { + if (args.precision) { + if (args.offset) { + return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${args.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`); + } else { + return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${args.precision}}Z$`); + } + } else if (args.precision === 0) { + if (args.offset) { + return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$`); + } else { + return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$`); + } + } else { + if (args.offset) { + return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$`); + } else { + return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$`); + } + } +}; +function isValidIP(ip, version) { + if ((version === "v4" || !version) && ipv4Regex.test(ip)) { + return true; + } + if ((version === "v6" || !version) && ipv6Regex.test(ip)) { + return true; + } + return false; +} class ZodString extends ZodType { constructor() { super(...arguments); - this._regex = (regex, validation, message) => this.refinement(data => regex.test(data), { validation, code: ZodError_1.ZodIssueCode.invalid_string, ...errorUtil_1.errorUtil.errToObj(message) }); - /** - * Deprecated. - * Use z.string().min(1) instead. - */ - - this.nonempty = message => this.min(1, errorUtil_1.errorUtil.errToObj(message)); + this.trim = () => new ZodString({ + ...this._def, + checks: [...this._def.checks, { + kind: "trim" + }] + }); + this.toLowerCase = () => new ZodString({ + ...this._def, + checks: [...this._def.checks, { + kind: "toLowerCase" + }] + }); + this.toUpperCase = () => new ZodString({ + ...this._def, + checks: [...this._def.checks, { + kind: "toUpperCase" + }] + }); } - _parse(input) { + if (this._def.coerce) { + input.data = String(input.data); + } const parsedType = this._getType(input); - - if (parsedType !== parseUtil_1.ZodParsedType.string) { + if (parsedType !== util_1.ZodParsedType.string) { const ctx = this._getOrReturnCtx(input); - (0, parseUtil_1.addIssueToContext)(ctx, { code: ZodError_1.ZodIssueCode.invalid_type, - expected: parseUtil_1.ZodParsedType.string, + expected: util_1.ZodParsedType.string, received: ctx.parsedType - } // - ); + }); return parseUtil_1.INVALID; } - const status = new parseUtil_1.ParseStatus(); let ctx = undefined; - for (const check of this._def.checks) { if (check.kind === "min") { if (input.data.length < check.value) { @@ -1118,6 +1054,7 @@ class ZodString extends ZodType { minimum: check.value, type: "string", inclusive: true, + exact: false, message: check.message }); status.dirty(); @@ -1130,10 +1067,37 @@ class ZodString extends ZodType { maximum: check.value, type: "string", inclusive: true, + exact: false, message: check.message }); status.dirty(); } + } else if (check.kind === "length") { + const tooBig = input.data.length > check.value; + const tooSmall = input.data.length < check.value; + if (tooBig || tooSmall) { + ctx = this._getOrReturnCtx(input, ctx); + if (tooBig) { + (0, parseUtil_1.addIssueToContext)(ctx, { + code: ZodError_1.ZodIssueCode.too_big, + maximum: check.value, + type: "string", + inclusive: true, + exact: true, + message: check.message + }); + } else if (tooSmall) { + (0, parseUtil_1.addIssueToContext)(ctx, { + code: ZodError_1.ZodIssueCode.too_small, + minimum: check.value, + type: "string", + inclusive: true, + exact: true, + message: check.message + }); + } + status.dirty(); + } } else if (check.kind === "email") { if (!emailRegex.test(input.data)) { ctx = this._getOrReturnCtx(input, ctx); @@ -1144,6 +1108,16 @@ class ZodString extends ZodType { }); status.dirty(); } + } else if (check.kind === "emoji") { + if (!emojiRegex.test(input.data)) { + ctx = this._getOrReturnCtx(input, ctx); + (0, parseUtil_1.addIssueToContext)(ctx, { + validation: "emoji", + code: ZodError_1.ZodIssueCode.invalid_string, + message: check.message + }); + status.dirty(); + } } else if (check.kind === "uuid") { if (!uuidRegex.test(input.data)) { ctx = this._getOrReturnCtx(input, ctx); @@ -1164,6 +1138,26 @@ class ZodString extends ZodType { }); status.dirty(); } + } else if (check.kind === "cuid2") { + if (!cuid2Regex.test(input.data)) { + ctx = this._getOrReturnCtx(input, ctx); + (0, parseUtil_1.addIssueToContext)(ctx, { + validation: "cuid2", + code: ZodError_1.ZodIssueCode.invalid_string, + message: check.message + }); + status.dirty(); + } + } else if (check.kind === "ulid") { + if (!ulidRegex.test(input.data)) { + ctx = this._getOrReturnCtx(input, ctx); + (0, parseUtil_1.addIssueToContext)(ctx, { + validation: "ulid", + code: ZodError_1.ZodIssueCode.invalid_string, + message: check.message + }); + status.dirty(); + } } else if (check.kind === "url") { try { new URL(input.data); @@ -1179,7 +1173,6 @@ class ZodString extends ZodType { } else if (check.kind === "regex") { check.regex.lastIndex = 0; const testResult = check.regex.test(input.data); - if (!testResult) { ctx = this._getOrReturnCtx(input, ctx); (0, parseUtil_1.addIssueToContext)(ctx, { @@ -1189,49 +1182,150 @@ class ZodString extends ZodType { }); status.dirty(); } - } - } - - return { - status: status.value, - value: input.data + } else if (check.kind === "trim") { + input.data = input.data.trim(); + } else if (check.kind === "includes") { + if (!input.data.includes(check.value, check.position)) { + ctx = this._getOrReturnCtx(input, ctx); + (0, parseUtil_1.addIssueToContext)(ctx, { + code: ZodError_1.ZodIssueCode.invalid_string, + validation: { + includes: check.value, + position: check.position + }, + message: check.message + }); + status.dirty(); + } + } else if (check.kind === "toLowerCase") { + input.data = input.data.toLowerCase(); + } else if (check.kind === "toUpperCase") { + input.data = input.data.toUpperCase(); + } else if (check.kind === "startsWith") { + if (!input.data.startsWith(check.value)) { + ctx = this._getOrReturnCtx(input, ctx); + (0, parseUtil_1.addIssueToContext)(ctx, { + code: ZodError_1.ZodIssueCode.invalid_string, + validation: { + startsWith: check.value + }, + message: check.message + }); + status.dirty(); + } + } else if (check.kind === "endsWith") { + if (!input.data.endsWith(check.value)) { + ctx = this._getOrReturnCtx(input, ctx); + (0, parseUtil_1.addIssueToContext)(ctx, { + code: ZodError_1.ZodIssueCode.invalid_string, + validation: { + endsWith: check.value + }, + message: check.message + }); + status.dirty(); + } + } else if (check.kind === "datetime") { + const regex = datetimeRegex(check); + if (!regex.test(input.data)) { + ctx = this._getOrReturnCtx(input, ctx); + (0, parseUtil_1.addIssueToContext)(ctx, { + code: ZodError_1.ZodIssueCode.invalid_string, + validation: "datetime", + message: check.message + }); + status.dirty(); + } + } else if (check.kind === "ip") { + if (!isValidIP(input.data, check.version)) { + ctx = this._getOrReturnCtx(input, ctx); + (0, parseUtil_1.addIssueToContext)(ctx, { + validation: "ip", + code: ZodError_1.ZodIssueCode.invalid_string, + message: check.message + }); + status.dirty(); + } + } else { + util_1.util.assertNever(check); + } + } + return { + status: status.value, + value: input.data }; } - _addCheck(check) { - return new ZodString({ ...this._def, + return new ZodString({ + ...this._def, checks: [...this._def.checks, check] }); } - email(message) { return this._addCheck({ kind: "email", ...errorUtil_1.errorUtil.errToObj(message) }); } - url(message) { return this._addCheck({ kind: "url", ...errorUtil_1.errorUtil.errToObj(message) }); } - + emoji(message) { + return this._addCheck({ + kind: "emoji", + ...errorUtil_1.errorUtil.errToObj(message) + }); + } uuid(message) { return this._addCheck({ kind: "uuid", ...errorUtil_1.errorUtil.errToObj(message) }); } - cuid(message) { return this._addCheck({ kind: "cuid", ...errorUtil_1.errorUtil.errToObj(message) }); } - + cuid2(message) { + return this._addCheck({ + kind: "cuid2", + ...errorUtil_1.errorUtil.errToObj(message) + }); + } + ulid(message) { + return this._addCheck({ + kind: "ulid", + ...errorUtil_1.errorUtil.errToObj(message) + }); + } + ip(options) { + return this._addCheck({ + kind: "ip", + ...errorUtil_1.errorUtil.errToObj(options) + }); + } + datetime(options) { + var _a; + if (typeof options === "string") { + return this._addCheck({ + kind: "datetime", + precision: null, + offset: false, + message: options + }); + } + return this._addCheck({ + kind: "datetime", + precision: typeof (options === null || options === void 0 ? void 0 : options.precision) === "undefined" ? null : options === null || options === void 0 ? void 0 : options.precision, + offset: (_a = options === null || options === void 0 ? void 0 : options.offset) !== null && _a !== void 0 ? _a : false, + ...errorUtil_1.errorUtil.errToObj(options === null || options === void 0 ? void 0 : options.message) + }); + } regex(regex, message) { return this._addCheck({ kind: "regex", @@ -1239,7 +1333,28 @@ class ZodString extends ZodType { ...errorUtil_1.errorUtil.errToObj(message) }); } - + includes(value, options) { + return this._addCheck({ + kind: "includes", + value: value, + position: options === null || options === void 0 ? void 0 : options.position, + ...errorUtil_1.errorUtil.errToObj(options === null || options === void 0 ? void 0 : options.message) + }); + } + startsWith(value, message) { + return this._addCheck({ + kind: "startsWith", + value: value, + ...errorUtil_1.errorUtil.errToObj(message) + }); + } + endsWith(value, message) { + return this._addCheck({ + kind: "endsWith", + value: value, + ...errorUtil_1.errorUtil.errToObj(message) + }); + } min(minLength, message) { return this._addCheck({ kind: "min", @@ -1247,7 +1362,6 @@ class ZodString extends ZodType { ...errorUtil_1.errorUtil.errToObj(message) }); } - max(maxLength, message) { return this._addCheck({ kind: "max", @@ -1255,68 +1369,69 @@ class ZodString extends ZodType { ...errorUtil_1.errorUtil.errToObj(message) }); } - length(len, message) { - return this.min(len, message).max(len, message); + return this._addCheck({ + kind: "length", + value: len, + ...errorUtil_1.errorUtil.errToObj(message) + }); + } + get isDatetime() { + return !!this._def.checks.find(ch => ch.kind === "datetime"); } - get isEmail() { return !!this._def.checks.find(ch => ch.kind === "email"); } - get isURL() { return !!this._def.checks.find(ch => ch.kind === "url"); } - + get isEmoji() { + return !!this._def.checks.find(ch => ch.kind === "emoji"); + } get isUUID() { return !!this._def.checks.find(ch => ch.kind === "uuid"); } - get isCUID() { return !!this._def.checks.find(ch => ch.kind === "cuid"); } - + get isCUID2() { + return !!this._def.checks.find(ch => ch.kind === "cuid2"); + } + get isULID() { + return !!this._def.checks.find(ch => ch.kind === "ulid"); + } + get isIP() { + return !!this._def.checks.find(ch => ch.kind === "ip"); + } get minLength() { - let min = -Infinity; - - this._def.checks.map(ch => { + let min = null; + for (const ch of this._def.checks) { if (ch.kind === "min") { - if (min === null || ch.value > min) { - min = ch.value; - } + if (min === null || ch.value > min) min = ch.value; } - }); - + } return min; } - get maxLength() { let max = null; - - this._def.checks.map(ch => { + for (const ch of this._def.checks) { if (ch.kind === "max") { - if (max === null || ch.value < max) { - max = ch.value; - } + if (max === null || ch.value < max) max = ch.value; } - }); - + } return max; } - } - exports.ZodString = ZodString; - ZodString.create = params => { + var _a; return new ZodString({ checks: [], typeName: ZodFirstPartyTypeKind.ZodString, + coerce: (_a = params === null || params === void 0 ? void 0 : params.coerce) !== null && _a !== void 0 ? _a : false, ...processCreateParams(params) }); -}; // https://stackoverflow.com/questions/3966484/why-does-modulus-operator-return-fractional-number-in-javascript/31711034#31711034 - - +}; function floatSafeRemainder(val, step) { const valDecCount = (val.toString().split(".")[1] || "").length; const stepDecCount = (step.toString().split(".")[1] || "").length; @@ -1325,7 +1440,6 @@ function floatSafeRemainder(val, step) { const stepInt = parseInt(step.toFixed(decCount).replace(".", "")); return valInt % stepInt / Math.pow(10, decCount); } - class ZodNumber extends ZodType { constructor() { super(...arguments); @@ -1333,24 +1447,22 @@ class ZodNumber extends ZodType { this.max = this.lte; this.step = this.multipleOf; } - _parse(input) { + if (this._def.coerce) { + input.data = Number(input.data); + } const parsedType = this._getType(input); - - if (parsedType !== parseUtil_1.ZodParsedType.number) { + if (parsedType !== util_1.ZodParsedType.number) { const ctx = this._getOrReturnCtx(input); - (0, parseUtil_1.addIssueToContext)(ctx, { code: ZodError_1.ZodIssueCode.invalid_type, - expected: parseUtil_1.ZodParsedType.number, + expected: util_1.ZodParsedType.number, received: ctx.parsedType }); return parseUtil_1.INVALID; } - let ctx = undefined; const status = new parseUtil_1.ParseStatus(); - for (const check of this._def.checks) { if (check.kind === "int") { if (!util_1.util.isInteger(input.data)) { @@ -1365,7 +1477,6 @@ class ZodNumber extends ZodType { } } else if (check.kind === "min") { const tooSmall = check.inclusive ? input.data < check.value : input.data <= check.value; - if (tooSmall) { ctx = this._getOrReturnCtx(input, ctx); (0, parseUtil_1.addIssueToContext)(ctx, { @@ -1373,13 +1484,13 @@ class ZodNumber extends ZodType { minimum: check.value, type: "number", inclusive: check.inclusive, + exact: false, message: check.message }); status.dirty(); } } else if (check.kind === "max") { const tooBig = check.inclusive ? input.data > check.value : input.data >= check.value; - if (tooBig) { ctx = this._getOrReturnCtx(input, ctx); (0, parseUtil_1.addIssueToContext)(ctx, { @@ -1387,6 +1498,7 @@ class ZodNumber extends ZodType { maximum: check.value, type: "number", inclusive: check.inclusive, + exact: false, message: check.message }); status.dirty(); @@ -1401,35 +1513,39 @@ class ZodNumber extends ZodType { }); status.dirty(); } + } else if (check.kind === "finite") { + if (!Number.isFinite(input.data)) { + ctx = this._getOrReturnCtx(input, ctx); + (0, parseUtil_1.addIssueToContext)(ctx, { + code: ZodError_1.ZodIssueCode.not_finite, + message: check.message + }); + status.dirty(); + } } else { util_1.util.assertNever(check); } } - return { status: status.value, value: input.data }; } - gte(value, message) { return this.setLimit("min", value, true, errorUtil_1.errorUtil.toString(message)); } - gt(value, message) { return this.setLimit("min", value, false, errorUtil_1.errorUtil.toString(message)); } - lte(value, message) { return this.setLimit("max", value, true, errorUtil_1.errorUtil.toString(message)); } - lt(value, message) { return this.setLimit("max", value, false, errorUtil_1.errorUtil.toString(message)); } - setLimit(kind, value, inclusive, message) { - return new ZodNumber({ ...this._def, + return new ZodNumber({ + ...this._def, checks: [...this._def.checks, { kind, value, @@ -1438,20 +1554,18 @@ class ZodNumber extends ZodType { }] }); } - _addCheck(check) { - return new ZodNumber({ ...this._def, + return new ZodNumber({ + ...this._def, checks: [...this._def.checks, check] }); } - int(message) { return this._addCheck({ kind: "int", message: errorUtil_1.errorUtil.toString(message) }); } - positive(message) { return this._addCheck({ kind: "min", @@ -1460,7 +1574,6 @@ class ZodNumber extends ZodType { message: errorUtil_1.errorUtil.toString(message) }); } - negative(message) { return this._addCheck({ kind: "max", @@ -1469,7 +1582,6 @@ class ZodNumber extends ZodType { message: errorUtil_1.errorUtil.toString(message) }); } - nonpositive(message) { return this._addCheck({ kind: "max", @@ -1478,7 +1590,6 @@ class ZodNumber extends ZodType { message: errorUtil_1.errorUtil.toString(message) }); } - nonnegative(message) { return this._addCheck({ kind: "min", @@ -1487,7 +1598,6 @@ class ZodNumber extends ZodType { message: errorUtil_1.errorUtil.toString(message) }); } - multipleOf(value, message) { return this._addCheck({ kind: "multipleOf", @@ -1495,318 +1605,538 @@ class ZodNumber extends ZodType { message: errorUtil_1.errorUtil.toString(message) }); } - + finite(message) { + return this._addCheck({ + kind: "finite", + message: errorUtil_1.errorUtil.toString(message) + }); + } + safe(message) { + return this._addCheck({ + kind: "min", + inclusive: true, + value: Number.MIN_SAFE_INTEGER, + message: errorUtil_1.errorUtil.toString(message) + })._addCheck({ + kind: "max", + inclusive: true, + value: Number.MAX_SAFE_INTEGER, + message: errorUtil_1.errorUtil.toString(message) + }); + } get minValue() { let min = null; - for (const ch of this._def.checks) { if (ch.kind === "min") { if (min === null || ch.value > min) min = ch.value; } } - return min; } - get maxValue() { let max = null; - for (const ch of this._def.checks) { if (ch.kind === "max") { if (max === null || ch.value < max) max = ch.value; } } - return max; } - get isInt() { - return !!this._def.checks.find(ch => ch.kind === "int"); + return !!this._def.checks.find(ch => ch.kind === "int" || ch.kind === "multipleOf" && util_1.util.isInteger(ch.value)); + } + get isFinite() { + let max = null, + min = null; + for (const ch of this._def.checks) { + if (ch.kind === "finite" || ch.kind === "int" || ch.kind === "multipleOf") { + return true; + } else if (ch.kind === "min") { + if (min === null || ch.value > min) min = ch.value; + } else if (ch.kind === "max") { + if (max === null || ch.value < max) max = ch.value; + } + } + return Number.isFinite(min) && Number.isFinite(max); } - } - exports.ZodNumber = ZodNumber; - ZodNumber.create = params => { return new ZodNumber({ checks: [], typeName: ZodFirstPartyTypeKind.ZodNumber, + coerce: (params === null || params === void 0 ? void 0 : params.coerce) || false, ...processCreateParams(params) }); }; - class ZodBigInt extends ZodType { - _parse(input) { - const parsedType = this._getType(input); - - if (parsedType !== parseUtil_1.ZodParsedType.bigint) { - const ctx = this._getOrReturnCtx(input); - - (0, parseUtil_1.addIssueToContext)(ctx, { - code: ZodError_1.ZodIssueCode.invalid_type, - expected: parseUtil_1.ZodParsedType.bigint, - received: ctx.parsedType - }); - return parseUtil_1.INVALID; - } - - return (0, parseUtil_1.OK)(input.data); + constructor() { + super(...arguments); + this.min = this.gte; + this.max = this.lte; } - -} - -exports.ZodBigInt = ZodBigInt; - -ZodBigInt.create = params => { - return new ZodBigInt({ - typeName: ZodFirstPartyTypeKind.ZodBigInt, - ...processCreateParams(params) - }); -}; - -class ZodBoolean extends ZodType { _parse(input) { - const parsedType = this._getType(input); - - if (parsedType !== parseUtil_1.ZodParsedType.boolean) { - const ctx = this._getOrReturnCtx(input); - - (0, parseUtil_1.addIssueToContext)(ctx, { - code: ZodError_1.ZodIssueCode.invalid_type, - expected: parseUtil_1.ZodParsedType.boolean, - received: ctx.parsedType - }); - return parseUtil_1.INVALID; + if (this._def.coerce) { + input.data = BigInt(input.data); } - - return (0, parseUtil_1.OK)(input.data); - } - -} - -exports.ZodBoolean = ZodBoolean; - -ZodBoolean.create = params => { - return new ZodBoolean({ - typeName: ZodFirstPartyTypeKind.ZodBoolean, - ...processCreateParams(params) - }); -}; - -class ZodDate extends ZodType { - _parse(input) { const parsedType = this._getType(input); - - if (parsedType !== parseUtil_1.ZodParsedType.date) { + if (parsedType !== util_1.ZodParsedType.bigint) { const ctx = this._getOrReturnCtx(input); - (0, parseUtil_1.addIssueToContext)(ctx, { code: ZodError_1.ZodIssueCode.invalid_type, - expected: parseUtil_1.ZodParsedType.date, + expected: util_1.ZodParsedType.bigint, received: ctx.parsedType }); return parseUtil_1.INVALID; } - - if (isNaN(input.data.getTime())) { - const ctx = this._getOrReturnCtx(input); - - (0, parseUtil_1.addIssueToContext)(ctx, { - code: ZodError_1.ZodIssueCode.invalid_date - }); - return parseUtil_1.INVALID; - } - - return { - status: "valid", - value: new Date(input.data.getTime()) - }; - } - + let ctx = undefined; + const status = new parseUtil_1.ParseStatus(); + for (const check of this._def.checks) { + if (check.kind === "min") { + const tooSmall = check.inclusive ? input.data < check.value : input.data <= check.value; + if (tooSmall) { + ctx = this._getOrReturnCtx(input, ctx); + (0, parseUtil_1.addIssueToContext)(ctx, { + code: ZodError_1.ZodIssueCode.too_small, + type: "bigint", + minimum: check.value, + inclusive: check.inclusive, + message: check.message + }); + status.dirty(); + } + } else if (check.kind === "max") { + const tooBig = check.inclusive ? input.data > check.value : input.data >= check.value; + if (tooBig) { + ctx = this._getOrReturnCtx(input, ctx); + (0, parseUtil_1.addIssueToContext)(ctx, { + code: ZodError_1.ZodIssueCode.too_big, + type: "bigint", + maximum: check.value, + inclusive: check.inclusive, + message: check.message + }); + status.dirty(); + } + } else if (check.kind === "multipleOf") { + if (input.data % check.value !== BigInt(0)) { + ctx = this._getOrReturnCtx(input, ctx); + (0, parseUtil_1.addIssueToContext)(ctx, { + code: ZodError_1.ZodIssueCode.not_multiple_of, + multipleOf: check.value, + message: check.message + }); + status.dirty(); + } + } else { + util_1.util.assertNever(check); + } + } + return { + status: status.value, + value: input.data + }; + } + gte(value, message) { + return this.setLimit("min", value, true, errorUtil_1.errorUtil.toString(message)); + } + gt(value, message) { + return this.setLimit("min", value, false, errorUtil_1.errorUtil.toString(message)); + } + lte(value, message) { + return this.setLimit("max", value, true, errorUtil_1.errorUtil.toString(message)); + } + lt(value, message) { + return this.setLimit("max", value, false, errorUtil_1.errorUtil.toString(message)); + } + setLimit(kind, value, inclusive, message) { + return new ZodBigInt({ + ...this._def, + checks: [...this._def.checks, { + kind, + value, + inclusive, + message: errorUtil_1.errorUtil.toString(message) + }] + }); + } + _addCheck(check) { + return new ZodBigInt({ + ...this._def, + checks: [...this._def.checks, check] + }); + } + positive(message) { + return this._addCheck({ + kind: "min", + value: BigInt(0), + inclusive: false, + message: errorUtil_1.errorUtil.toString(message) + }); + } + negative(message) { + return this._addCheck({ + kind: "max", + value: BigInt(0), + inclusive: false, + message: errorUtil_1.errorUtil.toString(message) + }); + } + nonpositive(message) { + return this._addCheck({ + kind: "max", + value: BigInt(0), + inclusive: true, + message: errorUtil_1.errorUtil.toString(message) + }); + } + nonnegative(message) { + return this._addCheck({ + kind: "min", + value: BigInt(0), + inclusive: true, + message: errorUtil_1.errorUtil.toString(message) + }); + } + multipleOf(value, message) { + return this._addCheck({ + kind: "multipleOf", + value, + message: errorUtil_1.errorUtil.toString(message) + }); + } + get minValue() { + let min = null; + for (const ch of this._def.checks) { + if (ch.kind === "min") { + if (min === null || ch.value > min) min = ch.value; + } + } + return min; + } + get maxValue() { + let max = null; + for (const ch of this._def.checks) { + if (ch.kind === "max") { + if (max === null || ch.value < max) max = ch.value; + } + } + return max; + } +} +exports.ZodBigInt = ZodBigInt; +ZodBigInt.create = params => { + var _a; + return new ZodBigInt({ + checks: [], + typeName: ZodFirstPartyTypeKind.ZodBigInt, + coerce: (_a = params === null || params === void 0 ? void 0 : params.coerce) !== null && _a !== void 0 ? _a : false, + ...processCreateParams(params) + }); +}; +class ZodBoolean extends ZodType { + _parse(input) { + if (this._def.coerce) { + input.data = Boolean(input.data); + } + const parsedType = this._getType(input); + if (parsedType !== util_1.ZodParsedType.boolean) { + const ctx = this._getOrReturnCtx(input); + (0, parseUtil_1.addIssueToContext)(ctx, { + code: ZodError_1.ZodIssueCode.invalid_type, + expected: util_1.ZodParsedType.boolean, + received: ctx.parsedType + }); + return parseUtil_1.INVALID; + } + return (0, parseUtil_1.OK)(input.data); + } +} +exports.ZodBoolean = ZodBoolean; +ZodBoolean.create = params => { + return new ZodBoolean({ + typeName: ZodFirstPartyTypeKind.ZodBoolean, + coerce: (params === null || params === void 0 ? void 0 : params.coerce) || false, + ...processCreateParams(params) + }); +}; +class ZodDate extends ZodType { + _parse(input) { + if (this._def.coerce) { + input.data = new Date(input.data); + } + const parsedType = this._getType(input); + if (parsedType !== util_1.ZodParsedType.date) { + const ctx = this._getOrReturnCtx(input); + (0, parseUtil_1.addIssueToContext)(ctx, { + code: ZodError_1.ZodIssueCode.invalid_type, + expected: util_1.ZodParsedType.date, + received: ctx.parsedType + }); + return parseUtil_1.INVALID; + } + if (isNaN(input.data.getTime())) { + const ctx = this._getOrReturnCtx(input); + (0, parseUtil_1.addIssueToContext)(ctx, { + code: ZodError_1.ZodIssueCode.invalid_date + }); + return parseUtil_1.INVALID; + } + const status = new parseUtil_1.ParseStatus(); + let ctx = undefined; + for (const check of this._def.checks) { + if (check.kind === "min") { + if (input.data.getTime() < check.value) { + ctx = this._getOrReturnCtx(input, ctx); + (0, parseUtil_1.addIssueToContext)(ctx, { + code: ZodError_1.ZodIssueCode.too_small, + message: check.message, + inclusive: true, + exact: false, + minimum: check.value, + type: "date" + }); + status.dirty(); + } + } else if (check.kind === "max") { + if (input.data.getTime() > check.value) { + ctx = this._getOrReturnCtx(input, ctx); + (0, parseUtil_1.addIssueToContext)(ctx, { + code: ZodError_1.ZodIssueCode.too_big, + message: check.message, + inclusive: true, + exact: false, + maximum: check.value, + type: "date" + }); + status.dirty(); + } + } else { + util_1.util.assertNever(check); + } + } + return { + status: status.value, + value: new Date(input.data.getTime()) + }; + } + _addCheck(check) { + return new ZodDate({ + ...this._def, + checks: [...this._def.checks, check] + }); + } + min(minDate, message) { + return this._addCheck({ + kind: "min", + value: minDate.getTime(), + message: errorUtil_1.errorUtil.toString(message) + }); + } + max(maxDate, message) { + return this._addCheck({ + kind: "max", + value: maxDate.getTime(), + message: errorUtil_1.errorUtil.toString(message) + }); + } + get minDate() { + let min = null; + for (const ch of this._def.checks) { + if (ch.kind === "min") { + if (min === null || ch.value > min) min = ch.value; + } + } + return min != null ? new Date(min) : null; + } + get maxDate() { + let max = null; + for (const ch of this._def.checks) { + if (ch.kind === "max") { + if (max === null || ch.value < max) max = ch.value; + } + } + return max != null ? new Date(max) : null; + } } - exports.ZodDate = ZodDate; - ZodDate.create = params => { return new ZodDate({ + checks: [], + coerce: (params === null || params === void 0 ? void 0 : params.coerce) || false, typeName: ZodFirstPartyTypeKind.ZodDate, ...processCreateParams(params) }); }; - +class ZodSymbol extends ZodType { + _parse(input) { + const parsedType = this._getType(input); + if (parsedType !== util_1.ZodParsedType.symbol) { + const ctx = this._getOrReturnCtx(input); + (0, parseUtil_1.addIssueToContext)(ctx, { + code: ZodError_1.ZodIssueCode.invalid_type, + expected: util_1.ZodParsedType.symbol, + received: ctx.parsedType + }); + return parseUtil_1.INVALID; + } + return (0, parseUtil_1.OK)(input.data); + } +} +exports.ZodSymbol = ZodSymbol; +ZodSymbol.create = params => { + return new ZodSymbol({ + typeName: ZodFirstPartyTypeKind.ZodSymbol, + ...processCreateParams(params) + }); +}; class ZodUndefined extends ZodType { _parse(input) { const parsedType = this._getType(input); - - if (parsedType !== parseUtil_1.ZodParsedType.undefined) { + if (parsedType !== util_1.ZodParsedType.undefined) { const ctx = this._getOrReturnCtx(input); - (0, parseUtil_1.addIssueToContext)(ctx, { code: ZodError_1.ZodIssueCode.invalid_type, - expected: parseUtil_1.ZodParsedType.undefined, + expected: util_1.ZodParsedType.undefined, received: ctx.parsedType }); return parseUtil_1.INVALID; } - return (0, parseUtil_1.OK)(input.data); } - } - exports.ZodUndefined = ZodUndefined; - ZodUndefined.create = params => { return new ZodUndefined({ typeName: ZodFirstPartyTypeKind.ZodUndefined, ...processCreateParams(params) }); }; - class ZodNull extends ZodType { _parse(input) { const parsedType = this._getType(input); - - if (parsedType !== parseUtil_1.ZodParsedType.null) { + if (parsedType !== util_1.ZodParsedType.null) { const ctx = this._getOrReturnCtx(input); - (0, parseUtil_1.addIssueToContext)(ctx, { code: ZodError_1.ZodIssueCode.invalid_type, - expected: parseUtil_1.ZodParsedType.null, + expected: util_1.ZodParsedType.null, received: ctx.parsedType }); return parseUtil_1.INVALID; } - return (0, parseUtil_1.OK)(input.data); } - } - exports.ZodNull = ZodNull; - ZodNull.create = params => { return new ZodNull({ typeName: ZodFirstPartyTypeKind.ZodNull, ...processCreateParams(params) }); }; - class ZodAny extends ZodType { constructor() { - super(...arguments); // to prevent instances of other classes from extending ZodAny. this causes issues with catchall in ZodObject. - + super(...arguments); this._any = true; } - _parse(input) { return (0, parseUtil_1.OK)(input.data); } - } - exports.ZodAny = ZodAny; - ZodAny.create = params => { return new ZodAny({ typeName: ZodFirstPartyTypeKind.ZodAny, ...processCreateParams(params) }); }; - class ZodUnknown extends ZodType { constructor() { - super(...arguments); // required - + super(...arguments); this._unknown = true; } - _parse(input) { return (0, parseUtil_1.OK)(input.data); } - } - exports.ZodUnknown = ZodUnknown; - ZodUnknown.create = params => { return new ZodUnknown({ typeName: ZodFirstPartyTypeKind.ZodUnknown, ...processCreateParams(params) }); }; - class ZodNever extends ZodType { _parse(input) { const ctx = this._getOrReturnCtx(input); - (0, parseUtil_1.addIssueToContext)(ctx, { code: ZodError_1.ZodIssueCode.invalid_type, - expected: parseUtil_1.ZodParsedType.never, + expected: util_1.ZodParsedType.never, received: ctx.parsedType }); return parseUtil_1.INVALID; } - } - exports.ZodNever = ZodNever; - ZodNever.create = params => { return new ZodNever({ typeName: ZodFirstPartyTypeKind.ZodNever, ...processCreateParams(params) }); }; - class ZodVoid extends ZodType { _parse(input) { const parsedType = this._getType(input); - - if (parsedType !== parseUtil_1.ZodParsedType.undefined) { + if (parsedType !== util_1.ZodParsedType.undefined) { const ctx = this._getOrReturnCtx(input); - (0, parseUtil_1.addIssueToContext)(ctx, { code: ZodError_1.ZodIssueCode.invalid_type, - expected: parseUtil_1.ZodParsedType.void, + expected: util_1.ZodParsedType.void, received: ctx.parsedType }); return parseUtil_1.INVALID; } - return (0, parseUtil_1.OK)(input.data); } - } - exports.ZodVoid = ZodVoid; - ZodVoid.create = params => { return new ZodVoid({ typeName: ZodFirstPartyTypeKind.ZodVoid, ...processCreateParams(params) }); }; - class ZodArray extends ZodType { _parse(input) { const { ctx, status } = this._processInputParams(input); - const def = this._def; - - if (ctx.parsedType !== parseUtil_1.ZodParsedType.array) { + if (ctx.parsedType !== util_1.ZodParsedType.array) { (0, parseUtil_1.addIssueToContext)(ctx, { code: ZodError_1.ZodIssueCode.invalid_type, - expected: parseUtil_1.ZodParsedType.array, + expected: util_1.ZodParsedType.array, received: ctx.parsedType }); return parseUtil_1.INVALID; } - + if (def.exactLength !== null) { + const tooBig = ctx.data.length > def.exactLength.value; + const tooSmall = ctx.data.length < def.exactLength.value; + if (tooBig || tooSmall) { + (0, parseUtil_1.addIssueToContext)(ctx, { + code: tooBig ? ZodError_1.ZodIssueCode.too_big : ZodError_1.ZodIssueCode.too_small, + minimum: tooSmall ? def.exactLength.value : undefined, + maximum: tooBig ? def.exactLength.value : undefined, + type: "array", + inclusive: true, + exact: true, + message: def.exactLength.message + }); + status.dirty(); + } + } if (def.minLength !== null) { if (ctx.data.length < def.minLength.value) { (0, parseUtil_1.addIssueToContext)(ctx, { @@ -1814,12 +2144,12 @@ class ZodArray extends ZodType { minimum: def.minLength.value, type: "array", inclusive: true, + exact: false, message: def.minLength.message }); status.dirty(); } } - if (def.maxLength !== null) { if (ctx.data.length > def.maxLength.value) { (0, parseUtil_1.addIssueToContext)(ctx, { @@ -1827,110 +2157,85 @@ class ZodArray extends ZodType { maximum: def.maxLength.value, type: "array", inclusive: true, + exact: false, message: def.maxLength.message }); status.dirty(); } } - if (ctx.common.async) { - return Promise.all(ctx.data.map((item, i) => { + return Promise.all([...ctx.data].map((item, i) => { return def.type._parseAsync(new ParseInputLazyPath(ctx, item, ctx.path, i)); })).then(result => { return parseUtil_1.ParseStatus.mergeArray(status, result); }); } - - const result = ctx.data.map((item, i) => { + const result = [...ctx.data].map((item, i) => { return def.type._parseSync(new ParseInputLazyPath(ctx, item, ctx.path, i)); }); return parseUtil_1.ParseStatus.mergeArray(status, result); } - get element() { return this._def.type; } - min(minLength, message) { - return new ZodArray({ ...this._def, + return new ZodArray({ + ...this._def, minLength: { value: minLength, message: errorUtil_1.errorUtil.toString(message) } }); } - max(maxLength, message) { - return new ZodArray({ ...this._def, + return new ZodArray({ + ...this._def, maxLength: { value: maxLength, message: errorUtil_1.errorUtil.toString(message) } }); } - length(len, message) { - return this.min(len, message).max(len, message); + return new ZodArray({ + ...this._def, + exactLength: { + value: len, + message: errorUtil_1.errorUtil.toString(message) + } + }); } - nonempty(message) { return this.min(1, message); } - } - exports.ZodArray = ZodArray; - ZodArray.create = (schema, params) => { return new ZodArray({ type: schema, minLength: null, maxLength: null, + exactLength: null, typeName: ZodFirstPartyTypeKind.ZodArray, ...processCreateParams(params) }); -}; ///////////////////////////////////////// -///////////////////////////////////////// -////////// ////////// -////////// ZodObject ////////// -////////// ////////// -///////////////////////////////////////// -///////////////////////////////////////// - - -var objectUtil; - -(function (objectUtil) { - objectUtil.mergeShapes = (first, second) => { - return { ...first, - ...second // second overwrites first - - }; - }; -})(objectUtil = exports.objectUtil || (exports.objectUtil = {})); - -const AugmentFactory = def => augmentation => { - return new ZodObject({ ...def, - shape: () => ({ ...def.shape(), - ...augmentation - }) - }); }; - function deepPartialify(schema) { if (schema instanceof ZodObject) { const newShape = {}; - for (const key in schema.shape) { const fieldSchema = schema.shape[key]; newShape[key] = ZodOptional.create(deepPartialify(fieldSchema)); } - - return new ZodObject({ ...schema._def, + return new ZodObject({ + ...schema._def, shape: () => newShape }); } else if (schema instanceof ZodArray) { - return ZodArray.create(deepPartialify(schema.element)); + return new ZodArray({ + ...schema._def, + type: deepPartialify(schema.element) + }); } else if (schema instanceof ZodOptional) { return ZodOptional.create(deepPartialify(schema.unwrap())); } else if (schema instanceof ZodNullable) { @@ -1941,67 +2246,50 @@ function deepPartialify(schema) { return schema; } } - class ZodObject extends ZodType { constructor() { super(...arguments); this._cached = null; - /** - * @deprecated In most cases, this is no longer needed - unknown properties are now silently stripped. - * If you want to pass through unknown properties, use `.passthrough()` instead. - */ - this.nonstrict = this.passthrough; - this.augment = AugmentFactory(this._def); - this.extend = AugmentFactory(this._def); + this.augment = this.extend; } - _getCached() { if (this._cached !== null) return this._cached; - const shape = this._def.shape(); - const keys = util_1.util.objectKeys(shape); return this._cached = { shape, keys }; } - _parse(input) { const parsedType = this._getType(input); - - if (parsedType !== parseUtil_1.ZodParsedType.object) { + if (parsedType !== util_1.ZodParsedType.object) { const ctx = this._getOrReturnCtx(input); - (0, parseUtil_1.addIssueToContext)(ctx, { code: ZodError_1.ZodIssueCode.invalid_type, - expected: parseUtil_1.ZodParsedType.object, + expected: util_1.ZodParsedType.object, received: ctx.parsedType }); return parseUtil_1.INVALID; } - const { status, ctx } = this._processInputParams(input); - const { shape, keys: shapeKeys } = this._getCached(); - const extraKeys = []; - - for (const key in ctx.data) { - if (!shapeKeys.includes(key)) { - extraKeys.push(key); + if (!(this._def.catchall instanceof ZodNever && this._def.unknownKeys === "strip")) { + for (const key in ctx.data) { + if (!shapeKeys.includes(key)) { + extraKeys.push(key); + } } } - const pairs = []; - for (const key of shapeKeys) { const keyValidator = shape[key]; const value = ctx.data[key]; @@ -2014,10 +2302,8 @@ class ZodObject extends ZodType { alwaysSet: key in ctx.data }); } - if (this._def.catchall instanceof ZodNever) { const unknownKeys = this._def.unknownKeys; - if (unknownKeys === "passthrough") { for (const key of extraKeys) { pairs.push({ @@ -2040,12 +2326,10 @@ class ZodObject extends ZodType { status.dirty(); } } else if (unknownKeys === "strip") {} else { - throw new Error("Internal ZodObject error: invalid unknownKeys value."); + throw new Error(`Internal ZodObject error: invalid unknownKeys value.`); } } else { - // run catchall validation const catchall = this._def.catchall; - for (const key of extraKeys) { const value = ctx.data[key]; pairs.push({ @@ -2053,17 +2337,14 @@ class ZodObject extends ZodType { status: "valid", value: key }, - value: catchall._parse(new ParseInputLazyPath(ctx, value, ctx.path, key) //, ctx.child(key), value, getParsedType(value) - ), + value: catchall._parse(new ParseInputLazyPath(ctx, value, ctx.path, key)), alwaysSet: key in ctx.data }); } } - if (ctx.common.async) { return Promise.resolve().then(async () => { const syncPairs = []; - for (const pair of pairs) { const key = await pair.key; syncPairs.push({ @@ -2072,7 +2353,6 @@ class ZodObject extends ZodType { alwaysSet: pair.alwaysSet }); } - return syncPairs; }).then(syncPairs => { return parseUtil_1.ParseStatus.mergeObjectSync(status, syncPairs); @@ -2081,19 +2361,17 @@ class ZodObject extends ZodType { return parseUtil_1.ParseStatus.mergeObjectSync(status, pairs); } } - get shape() { return this._def.shape(); } - strict(message) { errorUtil_1.errorUtil.errToObj; - return new ZodObject({ ...this._def, + return new ZodObject({ + ...this._def, unknownKeys: "strict", ...(message !== undefined ? { errorMap: (issue, ctx) => { var _a, _b, _c, _d; - const defaultError = (_c = (_b = (_a = this._def).errorMap) === null || _b === void 0 ? void 0 : _b.call(_a, issue, ctx).message) !== null && _c !== void 0 ? _c : ctx.defaultError; if (issue.code === "unrecognized_keys") return { message: (_d = errorUtil_1.errorUtil.errToObj(message).message) !== null && _d !== void 0 ? _d : defaultError @@ -2105,126 +2383,116 @@ class ZodObject extends ZodType { } : {}) }); } - strip() { - return new ZodObject({ ...this._def, + return new ZodObject({ + ...this._def, unknownKeys: "strip" }); } - passthrough() { - return new ZodObject({ ...this._def, + return new ZodObject({ + ...this._def, unknownKeys: "passthrough" }); } - - setKey(key, schema) { - return this.augment({ - [key]: schema + extend(augmentation) { + return new ZodObject({ + ...this._def, + shape: () => ({ + ...this._def.shape(), + ...augmentation + }) }); } - /** - * Prior to zod@1.0.12 there was a bug in the - * inferred type of merged objects. Please - * upgrade if you are experiencing issues. - */ - - merge(merging) { - // const mergedShape = objectUtil.mergeShapes( - // this._def.shape(), - // merging._def.shape() - // ); const merged = new ZodObject({ unknownKeys: merging._def.unknownKeys, catchall: merging._def.catchall, - shape: () => objectUtil.mergeShapes(this._def.shape(), merging._def.shape()), + shape: () => ({ + ...this._def.shape(), + ...merging._def.shape() + }), typeName: ZodFirstPartyTypeKind.ZodObject }); - return merged; + return merged; + } + setKey(key, schema) { + return this.augment({ + [key]: schema + }); } - catchall(index) { - return new ZodObject({ ...this._def, + return new ZodObject({ + ...this._def, catchall: index }); } - pick(mask) { const shape = {}; - util_1.util.objectKeys(mask).map(key => { - shape[key] = this.shape[key]; + util_1.util.objectKeys(mask).forEach(key => { + if (mask[key] && this.shape[key]) { + shape[key] = this.shape[key]; + } }); - return new ZodObject({ ...this._def, + return new ZodObject({ + ...this._def, shape: () => shape }); } - omit(mask) { const shape = {}; - util_1.util.objectKeys(this.shape).map(key => { - if (util_1.util.objectKeys(mask).indexOf(key) === -1) { + util_1.util.objectKeys(this.shape).forEach(key => { + if (!mask[key]) { shape[key] = this.shape[key]; } }); - return new ZodObject({ ...this._def, + return new ZodObject({ + ...this._def, shape: () => shape }); } - deepPartial() { return deepPartialify(this); } - partial(mask) { const newShape = {}; - - if (mask) { - util_1.util.objectKeys(this.shape).map(key => { - if (util_1.util.objectKeys(mask).indexOf(key) === -1) { - newShape[key] = this.shape[key]; - } else { - newShape[key] = this.shape[key].optional(); - } - }); - return new ZodObject({ ...this._def, - shape: () => newShape - }); - } else { - for (const key in this.shape) { - const fieldSchema = this.shape[key]; + util_1.util.objectKeys(this.shape).forEach(key => { + const fieldSchema = this.shape[key]; + if (mask && !mask[key]) { + newShape[key] = fieldSchema; + } else { newShape[key] = fieldSchema.optional(); } - } - - return new ZodObject({ ...this._def, + }); + return new ZodObject({ + ...this._def, shape: () => newShape }); } - - required() { + required(mask) { const newShape = {}; - - for (const key in this.shape) { - const fieldSchema = this.shape[key]; - let newField = fieldSchema; - - while (newField instanceof ZodOptional) { - newField = newField._def.innerType; + util_1.util.objectKeys(this.shape).forEach(key => { + if (mask && !mask[key]) { + newShape[key] = this.shape[key]; + } else { + const fieldSchema = this.shape[key]; + let newField = fieldSchema; + while (newField instanceof ZodOptional) { + newField = newField._def.innerType; + } + newShape[key] = newField; } - - newShape[key] = newField; - } - - return new ZodObject({ ...this._def, + }); + return new ZodObject({ + ...this._def, shape: () => newShape }); } - + keyof() { + return createZodEnum(util_1.util.objectKeys(this.shape)); + } } - exports.ZodObject = ZodObject; - ZodObject.create = (shape, params) => { return new ZodObject({ shape: () => shape, @@ -2234,7 +2502,6 @@ ZodObject.create = (shape, params) => { ...processCreateParams(params) }); }; - ZodObject.strictCreate = (shape, params) => { return new ZodObject({ shape: () => shape, @@ -2244,7 +2511,6 @@ ZodObject.strictCreate = (shape, params) => { ...processCreateParams(params) }); }; - ZodObject.lazycreate = (shape, params) => { return new ZodObject({ shape, @@ -2254,32 +2520,24 @@ ZodObject.lazycreate = (shape, params) => { ...processCreateParams(params) }); }; - class ZodUnion extends ZodType { _parse(input) { const { ctx } = this._processInputParams(input); - const options = this._def.options; - function handleResults(results) { - // return first issue-free validation if it exists for (const result of results) { if (result.result.status === "valid") { return result.result; } } - for (const result of results) { if (result.result.status === "dirty") { - // add issues from dirty option ctx.common.issues.push(...result.ctx.common.issues); return result.result; } - } // return invalid - - + } const unionErrors = results.map(result => new ZodError_1.ZodError(result.ctx.common.issues)); (0, parseUtil_1.addIssueToContext)(ctx, { code: ZodError_1.ZodIssueCode.invalid_union, @@ -2287,11 +2545,12 @@ class ZodUnion extends ZodType { }); return parseUtil_1.INVALID; } - if (ctx.common.async) { return Promise.all(options.map(async option => { - const childCtx = { ...ctx, - common: { ...ctx.common, + const childCtx = { + ...ctx, + common: { + ...ctx.common, issues: [] }, parent: null @@ -2308,21 +2567,20 @@ class ZodUnion extends ZodType { } else { let dirty = undefined; const issues = []; - for (const option of options) { - const childCtx = { ...ctx, - common: { ...ctx.common, + const childCtx = { + ...ctx, + common: { + ...ctx.common, issues: [] }, parent: null }; - const result = option._parseSync({ data: ctx.data, path: ctx.path, parent: childCtx }); - if (result.status === "valid") { return result; } else if (result.status === "dirty" && !dirty) { @@ -2331,17 +2589,14 @@ class ZodUnion extends ZodType { ctx: childCtx }; } - if (childCtx.common.issues.length) { issues.push(childCtx.common.issues); } } - if (dirty) { ctx.common.issues.push(...dirty.ctx.common.issues); return dirty.result; } - const unionErrors = issues.map(issues => new ZodError_1.ZodError(issues)); (0, parseUtil_1.addIssueToContext)(ctx, { code: ZodError_1.ZodIssueCode.invalid_union, @@ -2350,15 +2605,11 @@ class ZodUnion extends ZodType { return parseUtil_1.INVALID; } } - get options() { return this._def.options; } - } - exports.ZodUnion = ZodUnion; - ZodUnion.create = (types, params) => { return new ZodUnion({ options: types, @@ -2366,35 +2617,51 @@ ZodUnion.create = (types, params) => { ...processCreateParams(params) }); }; - +const getDiscriminator = type => { + if (type instanceof ZodLazy) { + return getDiscriminator(type.schema); + } else if (type instanceof ZodEffects) { + return getDiscriminator(type.innerType()); + } else if (type instanceof ZodLiteral) { + return [type.value]; + } else if (type instanceof ZodEnum) { + return type.options; + } else if (type instanceof ZodNativeEnum) { + return Object.keys(type.enum); + } else if (type instanceof ZodDefault) { + return getDiscriminator(type._def.innerType); + } else if (type instanceof ZodUndefined) { + return [undefined]; + } else if (type instanceof ZodNull) { + return [null]; + } else { + return null; + } +}; class ZodDiscriminatedUnion extends ZodType { _parse(input) { const { ctx } = this._processInputParams(input); - - if (ctx.parsedType !== parseUtil_1.ZodParsedType.object) { + if (ctx.parsedType !== util_1.ZodParsedType.object) { (0, parseUtil_1.addIssueToContext)(ctx, { code: ZodError_1.ZodIssueCode.invalid_type, - expected: parseUtil_1.ZodParsedType.object, + expected: util_1.ZodParsedType.object, received: ctx.parsedType }); return parseUtil_1.INVALID; } - const discriminator = this.discriminator; const discriminatorValue = ctx.data[discriminator]; - const option = this.options.get(discriminatorValue); - + const option = this.optionsMap.get(discriminatorValue); if (!option) { (0, parseUtil_1.addIssueToContext)(ctx, { code: ZodError_1.ZodIssueCode.invalid_union_discriminator, - options: this.validDiscriminatorValues, + options: Array.from(this.optionsMap.keys()), path: [discriminator] }); return parseUtil_1.INVALID; } - if (ctx.common.async) { return option._parseAsync({ data: ctx.data, @@ -2409,118 +2676,90 @@ class ZodDiscriminatedUnion extends ZodType { }); } } - get discriminator() { return this._def.discriminator; } - - get validDiscriminatorValues() { - return Array.from(this.options.keys()); - } - get options() { return this._def.options; } - /** - * The constructor of the discriminated union schema. Its behaviour is very similar to that of the normal z.union() constructor. - * However, it only allows a union of objects, all of which need to share a discriminator property. This property must - * have a different value for each object in the union. - * @param discriminator the name of the discriminator property - * @param types an array of object schemas - * @param params - */ - - - static create(discriminator, types, params) { - // Get all the valid discriminator values - const options = new Map(); - - try { - types.forEach(type => { - const discriminatorValue = type.shape[discriminator].value; - options.set(discriminatorValue, type); - }); - } catch (e) { - throw new Error("The discriminator value could not be extracted from all the provided schemas"); - } // Assert that all the discriminator values are unique - - - if (options.size !== types.length) { - throw new Error("Some of the discriminator values are not unique"); + get optionsMap() { + return this._def.optionsMap; + } + static create(discriminator, options, params) { + const optionsMap = new Map(); + for (const type of options) { + const discriminatorValues = getDiscriminator(type.shape[discriminator]); + if (!discriminatorValues) { + throw new Error(`A discriminator value for key \`${discriminator}\` could not be extracted from all schema options`); + } + for (const value of discriminatorValues) { + if (optionsMap.has(value)) { + throw new Error(`Discriminator property ${String(discriminator)} has duplicate value ${String(value)}`); + } + optionsMap.set(value, type); + } } - return new ZodDiscriminatedUnion({ typeName: ZodFirstPartyTypeKind.ZodDiscriminatedUnion, discriminator, options, + optionsMap, ...processCreateParams(params) }); } - } - exports.ZodDiscriminatedUnion = ZodDiscriminatedUnion; - function mergeValues(a, b) { - const aType = (0, parseUtil_1.getParsedType)(a); - const bType = (0, parseUtil_1.getParsedType)(b); - + const aType = (0, util_1.getParsedType)(a); + const bType = (0, util_1.getParsedType)(b); if (a === b) { return { valid: true, data: a }; - } else if (aType === parseUtil_1.ZodParsedType.object && bType === parseUtil_1.ZodParsedType.object) { + } else if (aType === util_1.ZodParsedType.object && bType === util_1.ZodParsedType.object) { const bKeys = util_1.util.objectKeys(b); const sharedKeys = util_1.util.objectKeys(a).filter(key => bKeys.indexOf(key) !== -1); - const newObj = { ...a, + const newObj = { + ...a, ...b }; - for (const key of sharedKeys) { const sharedValue = mergeValues(a[key], b[key]); - if (!sharedValue.valid) { return { valid: false }; } - newObj[key] = sharedValue.data; } - return { valid: true, data: newObj }; - } else if (aType === parseUtil_1.ZodParsedType.array && bType === parseUtil_1.ZodParsedType.array) { + } else if (aType === util_1.ZodParsedType.array && bType === util_1.ZodParsedType.array) { if (a.length !== b.length) { return { valid: false }; } - const newArray = []; - for (let index = 0; index < a.length; index++) { const itemA = a[index]; const itemB = b[index]; const sharedValue = mergeValues(itemA, itemB); - if (!sharedValue.valid) { return { valid: false }; } - newArray.push(sharedValue.data); } - return { valid: true, data: newArray }; - } else if (aType === parseUtil_1.ZodParsedType.date && bType === parseUtil_1.ZodParsedType.date && +a === +b) { + } else if (aType === util_1.ZodParsedType.date && bType === util_1.ZodParsedType.date && +a === +b) { return { valid: true, data: a @@ -2531,38 +2770,31 @@ function mergeValues(a, b) { }; } } - class ZodIntersection extends ZodType { _parse(input) { const { status, ctx } = this._processInputParams(input); - const handleParsed = (parsedLeft, parsedRight) => { if ((0, parseUtil_1.isAborted)(parsedLeft) || (0, parseUtil_1.isAborted)(parsedRight)) { return parseUtil_1.INVALID; } - const merged = mergeValues(parsedLeft.value, parsedRight.value); - if (!merged.valid) { (0, parseUtil_1.addIssueToContext)(ctx, { code: ZodError_1.ZodIssueCode.invalid_intersection_types }); return parseUtil_1.INVALID; } - if ((0, parseUtil_1.isDirty)(parsedLeft) || (0, parseUtil_1.isDirty)(parsedRight)) { status.dirty(); } - return { status: status.value, value: merged.data }; }; - if (ctx.common.async) { return Promise.all([this._def.left._parseAsync({ data: ctx.data, @@ -2588,11 +2820,8 @@ class ZodIntersection extends ZodType { })); } } - } - exports.ZodIntersection = ZodIntersection; - ZodIntersection.create = (left, right, params) => { return new ZodIntersection({ left: left, @@ -2601,51 +2830,46 @@ ZodIntersection.create = (left, right, params) => { ...processCreateParams(params) }); }; - class ZodTuple extends ZodType { _parse(input) { const { status, ctx } = this._processInputParams(input); - - if (ctx.parsedType !== parseUtil_1.ZodParsedType.array) { + if (ctx.parsedType !== util_1.ZodParsedType.array) { (0, parseUtil_1.addIssueToContext)(ctx, { code: ZodError_1.ZodIssueCode.invalid_type, - expected: parseUtil_1.ZodParsedType.array, + expected: util_1.ZodParsedType.array, received: ctx.parsedType }); return parseUtil_1.INVALID; } - if (ctx.data.length < this._def.items.length) { (0, parseUtil_1.addIssueToContext)(ctx, { code: ZodError_1.ZodIssueCode.too_small, minimum: this._def.items.length, inclusive: true, + exact: false, type: "array" }); return parseUtil_1.INVALID; } - const rest = this._def.rest; - if (!rest && ctx.data.length > this._def.items.length) { (0, parseUtil_1.addIssueToContext)(ctx, { code: ZodError_1.ZodIssueCode.too_big, maximum: this._def.items.length, inclusive: true, + exact: false, type: "array" }); status.dirty(); } - - const items = ctx.data.map((item, itemIndex) => { + const items = [...ctx.data].map((item, itemIndex) => { const schema = this._def.items[itemIndex] || this._def.rest; if (!schema) return null; return schema._parse(new ParseInputLazyPath(ctx, item, ctx.path, itemIndex)); - }).filter(x => !!x); // filter nulls - + }).filter(x => !!x); if (ctx.common.async) { return Promise.all(items).then(results => { return parseUtil_1.ParseStatus.mergeArray(status, results); @@ -2654,22 +2878,21 @@ class ZodTuple extends ZodType { return parseUtil_1.ParseStatus.mergeArray(status, items); } } - get items() { return this._def.items; } - rest(rest) { - return new ZodTuple({ ...this._def, + return new ZodTuple({ + ...this._def, rest }); } - } - exports.ZodTuple = ZodTuple; - ZodTuple.create = (schemas, params) => { + if (!Array.isArray(schemas)) { + throw new Error("You must pass an array of schemas to z.tuple([ ... ])"); + } return new ZodTuple({ items: schemas, typeName: ZodFirstPartyTypeKind.ZodTuple, @@ -2677,53 +2900,44 @@ ZodTuple.create = (schemas, params) => { ...processCreateParams(params) }); }; - class ZodRecord extends ZodType { get keySchema() { return this._def.keyType; } - get valueSchema() { return this._def.valueType; } - _parse(input) { const { status, ctx } = this._processInputParams(input); - - if (ctx.parsedType !== parseUtil_1.ZodParsedType.object) { + if (ctx.parsedType !== util_1.ZodParsedType.object) { (0, parseUtil_1.addIssueToContext)(ctx, { code: ZodError_1.ZodIssueCode.invalid_type, - expected: parseUtil_1.ZodParsedType.object, + expected: util_1.ZodParsedType.object, received: ctx.parsedType }); return parseUtil_1.INVALID; } - const pairs = []; const keyType = this._def.keyType; const valueType = this._def.valueType; - for (const key in ctx.data) { pairs.push({ key: keyType._parse(new ParseInputLazyPath(ctx, key, ctx.path, key)), value: valueType._parse(new ParseInputLazyPath(ctx, ctx.data[key], ctx.path, key)) }); } - if (ctx.common.async) { return parseUtil_1.ParseStatus.mergeObjectAsync(status, pairs); } else { return parseUtil_1.ParseStatus.mergeObjectSync(status, pairs); } } - get element() { return this._def.valueType; } - static create(first, second, third) { if (second instanceof ZodType) { return new ZodRecord({ @@ -2733,7 +2947,6 @@ class ZodRecord extends ZodType { ...processCreateParams(third) }); } - return new ZodRecord({ keyType: ZodString.create(), valueType: first, @@ -2741,27 +2954,28 @@ class ZodRecord extends ZodType { ...processCreateParams(second) }); } - } - exports.ZodRecord = ZodRecord; - class ZodMap extends ZodType { + get keySchema() { + return this._def.keyType; + } + get valueSchema() { + return this._def.valueType; + } _parse(input) { const { status, ctx } = this._processInputParams(input); - - if (ctx.parsedType !== parseUtil_1.ZodParsedType.map) { + if (ctx.parsedType !== util_1.ZodParsedType.map) { (0, parseUtil_1.addIssueToContext)(ctx, { code: ZodError_1.ZodIssueCode.invalid_type, - expected: parseUtil_1.ZodParsedType.map, + expected: util_1.ZodParsedType.map, received: ctx.parsedType }); return parseUtil_1.INVALID; } - const keyType = this._def.keyType; const valueType = this._def.valueType; const pairs = [...ctx.data.entries()].map((_ref2, index) => { @@ -2771,25 +2985,20 @@ class ZodMap extends ZodType { value: valueType._parse(new ParseInputLazyPath(ctx, value, ctx.path, [index, "value"])) }; }); - if (ctx.common.async) { const finalMap = new Map(); return Promise.resolve().then(async () => { for (const pair of pairs) { const key = await pair.key; const value = await pair.value; - if (key.status === "aborted" || value.status === "aborted") { return parseUtil_1.INVALID; } - if (key.status === "dirty" || value.status === "dirty") { status.dirty(); } - finalMap.set(key.value, value.value); } - return { status: status.value, value: finalMap @@ -2797,33 +3006,25 @@ class ZodMap extends ZodType { }); } else { const finalMap = new Map(); - for (const pair of pairs) { const key = pair.key; const value = pair.value; - if (key.status === "aborted" || value.status === "aborted") { return parseUtil_1.INVALID; } - if (key.status === "dirty" || value.status === "dirty") { status.dirty(); } - finalMap.set(key.value, value.value); } - return { status: status.value, value: finalMap }; } } - } - exports.ZodMap = ZodMap; - ZodMap.create = (keyType, valueType, params) => { return new ZodMap({ valueType, @@ -2832,25 +3033,21 @@ ZodMap.create = (keyType, valueType, params) => { ...processCreateParams(params) }); }; - class ZodSet extends ZodType { _parse(input) { const { status, ctx } = this._processInputParams(input); - - if (ctx.parsedType !== parseUtil_1.ZodParsedType.set) { + if (ctx.parsedType !== util_1.ZodParsedType.set) { (0, parseUtil_1.addIssueToContext)(ctx, { code: ZodError_1.ZodIssueCode.invalid_type, - expected: parseUtil_1.ZodParsedType.set, + expected: util_1.ZodParsedType.set, received: ctx.parsedType }); return parseUtil_1.INVALID; } - const def = this._def; - if (def.minSize !== null) { if (ctx.data.size < def.minSize.value) { (0, parseUtil_1.addIssueToContext)(ctx, { @@ -2858,12 +3055,12 @@ class ZodSet extends ZodType { minimum: def.minSize.value, type: "set", inclusive: true, + exact: false, message: def.minSize.message }); status.dirty(); } } - if (def.maxSize !== null) { if (ctx.data.size > def.maxSize.value) { (0, parseUtil_1.addIssueToContext)(ctx, { @@ -2871,68 +3068,58 @@ class ZodSet extends ZodType { maximum: def.maxSize.value, type: "set", inclusive: true, + exact: false, message: def.maxSize.message }); status.dirty(); } } - const valueType = this._def.valueType; - function finalizeSet(elements) { const parsedSet = new Set(); - for (const element of elements) { if (element.status === "aborted") return parseUtil_1.INVALID; if (element.status === "dirty") status.dirty(); parsedSet.add(element.value); } - return { status: status.value, value: parsedSet }; } - const elements = [...ctx.data.values()].map((item, i) => valueType._parse(new ParseInputLazyPath(ctx, item, ctx.path, i))); - if (ctx.common.async) { return Promise.all(elements).then(elements => finalizeSet(elements)); } else { return finalizeSet(elements); } } - min(minSize, message) { - return new ZodSet({ ...this._def, + return new ZodSet({ + ...this._def, minSize: { value: minSize, message: errorUtil_1.errorUtil.toString(message) } }); } - max(maxSize, message) { - return new ZodSet({ ...this._def, + return new ZodSet({ + ...this._def, maxSize: { value: maxSize, message: errorUtil_1.errorUtil.toString(message) } }); } - size(size, message) { return this.min(size, message).max(size, message); } - nonempty(message) { return this.min(1, message); } - } - exports.ZodSet = ZodSet; - ZodSet.create = (valueType, params) => { return new ZodSet({ valueType, @@ -2942,171 +3129,142 @@ ZodSet.create = (valueType, params) => { ...processCreateParams(params) }); }; - class ZodFunction extends ZodType { constructor() { super(...arguments); this.validate = this.implement; } - _parse(input) { - var _this = this; - const { ctx } = this._processInputParams(input); - - if (ctx.parsedType !== parseUtil_1.ZodParsedType.function) { + if (ctx.parsedType !== util_1.ZodParsedType.function) { (0, parseUtil_1.addIssueToContext)(ctx, { code: ZodError_1.ZodIssueCode.invalid_type, - expected: parseUtil_1.ZodParsedType.function, + expected: util_1.ZodParsedType.function, received: ctx.parsedType }); return parseUtil_1.INVALID; } - function makeArgsIssue(args, error) { return (0, parseUtil_1.makeIssue)({ data: args, path: ctx.path, - errorMaps: [ctx.common.contextualErrorMap, ctx.schemaErrorMap, ZodError_1.overrideErrorMap, ZodError_1.defaultErrorMap].filter(x => !!x), + errorMaps: [ctx.common.contextualErrorMap, ctx.schemaErrorMap, (0, errors_1.getErrorMap)(), errors_1.defaultErrorMap].filter(x => !!x), issueData: { code: ZodError_1.ZodIssueCode.invalid_arguments, argumentsError: error } }); } - function makeReturnsIssue(returns, error) { return (0, parseUtil_1.makeIssue)({ data: returns, path: ctx.path, - errorMaps: [ctx.common.contextualErrorMap, ctx.schemaErrorMap, ZodError_1.overrideErrorMap, ZodError_1.defaultErrorMap].filter(x => !!x), + errorMaps: [ctx.common.contextualErrorMap, ctx.schemaErrorMap, (0, errors_1.getErrorMap)(), errors_1.defaultErrorMap].filter(x => !!x), issueData: { code: ZodError_1.ZodIssueCode.invalid_return_type, returnTypeError: error } }); } - const params = { errorMap: ctx.common.contextualErrorMap }; const fn = ctx.data; - if (this._def.returns instanceof ZodPromise) { + const me = this; return (0, parseUtil_1.OK)(async function () { for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } - const error = new ZodError_1.ZodError([]); - const parsedArgs = await _this._def.args.parseAsync(args, params).catch(e => { + const parsedArgs = await me._def.args.parseAsync(args, params).catch(e => { error.addIssue(makeArgsIssue(args, e)); throw error; }); - const result = await fn(...parsedArgs); - const parsedReturns = await _this._def.returns._def.type.parseAsync(result, params).catch(e => { + const result = await Reflect.apply(fn, this, parsedArgs); + const parsedReturns = await me._def.returns._def.type.parseAsync(result, params).catch(e => { error.addIssue(makeReturnsIssue(result, e)); throw error; }); return parsedReturns; }); } else { + const me = this; return (0, parseUtil_1.OK)(function () { for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { args[_key2] = arguments[_key2]; } - - const parsedArgs = _this._def.args.safeParse(args, params); - + const parsedArgs = me._def.args.safeParse(args, params); if (!parsedArgs.success) { throw new ZodError_1.ZodError([makeArgsIssue(args, parsedArgs.error)]); } - - const result = fn(...parsedArgs.data); - - const parsedReturns = _this._def.returns.safeParse(result, params); - + const result = Reflect.apply(fn, this, parsedArgs.data); + const parsedReturns = me._def.returns.safeParse(result, params); if (!parsedReturns.success) { throw new ZodError_1.ZodError([makeReturnsIssue(result, parsedReturns.error)]); } - return parsedReturns.data; }); } } - parameters() { return this._def.args; } - returnType() { return this._def.returns; } - args() { for (var _len3 = arguments.length, items = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { items[_key3] = arguments[_key3]; } - - return new ZodFunction({ ...this._def, + return new ZodFunction({ + ...this._def, args: ZodTuple.create(items).rest(ZodUnknown.create()) }); } - returns(returnType) { - return new ZodFunction({ ...this._def, + return new ZodFunction({ + ...this._def, returns: returnType }); } - implement(func) { const validatedFunc = this.parse(func); return validatedFunc; } - strictImplement(func) { const validatedFunc = this.parse(func); return validatedFunc; } - + static create(args, returns, params) { + return new ZodFunction({ + args: args ? args : ZodTuple.create([]).rest(ZodUnknown.create()), + returns: returns || ZodUnknown.create(), + typeName: ZodFirstPartyTypeKind.ZodFunction, + ...processCreateParams(params) + }); + } } - exports.ZodFunction = ZodFunction; - -ZodFunction.create = (args, returns, params) => { - return new ZodFunction({ - args: args ? args.rest(ZodUnknown.create()) : ZodTuple.create([]).rest(ZodUnknown.create()), - returns: returns || ZodUnknown.create(), - typeName: ZodFirstPartyTypeKind.ZodFunction, - ...processCreateParams(params) - }); -}; - class ZodLazy extends ZodType { get schema() { return this._def.getter(); } - _parse(input) { const { ctx } = this._processInputParams(input); - const lazySchema = this._def.getter(); - return lazySchema._parse({ data: ctx.data, path: ctx.path, parent: ctx }); } - } - exports.ZodLazy = ZodLazy; - ZodLazy.create = (getter, params) => { return new ZodLazy({ getter: getter, @@ -3114,33 +3272,27 @@ ZodLazy.create = (getter, params) => { ...processCreateParams(params) }); }; - class ZodLiteral extends ZodType { _parse(input) { if (input.data !== this._def.value) { const ctx = this._getOrReturnCtx(input); - (0, parseUtil_1.addIssueToContext)(ctx, { + received: ctx.data, code: ZodError_1.ZodIssueCode.invalid_literal, expected: this._def.value }); return parseUtil_1.INVALID; } - return { status: "valid", value: input.data }; } - get value() { return this._def.value; } - } - exports.ZodLiteral = ZodLiteral; - ZodLiteral.create = (value, params) => { return new ZodLiteral({ value: value, @@ -3148,19 +3300,17 @@ ZodLiteral.create = (value, params) => { ...processCreateParams(params) }); }; - -function createZodEnum(values) { +function createZodEnum(values, params) { return new ZodEnum({ - values: values, - typeName: ZodFirstPartyTypeKind.ZodEnum + values, + typeName: ZodFirstPartyTypeKind.ZodEnum, + ...processCreateParams(params) }); } - class ZodEnum extends ZodType { _parse(input) { if (typeof input.data !== "string") { const ctx = this._getOrReturnCtx(input); - const expectedValues = this._def.values; (0, parseUtil_1.addIssueToContext)(ctx, { expected: util_1.util.joinValues(expectedValues), @@ -3169,10 +3319,8 @@ class ZodEnum extends ZodType { }); return parseUtil_1.INVALID; } - if (this._def.values.indexOf(input.data) === -1) { const ctx = this._getOrReturnCtx(input); - const expectedValues = this._def.values; (0, parseUtil_1.addIssueToContext)(ctx, { received: ctx.data, @@ -3181,56 +3329,46 @@ class ZodEnum extends ZodType { }); return parseUtil_1.INVALID; } - return (0, parseUtil_1.OK)(input.data); } - get options() { return this._def.values; } - get enum() { const enumValues = {}; - for (const val of this._def.values) { enumValues[val] = val; } - return enumValues; } - get Values() { const enumValues = {}; - for (const val of this._def.values) { enumValues[val] = val; } - return enumValues; } - get Enum() { const enumValues = {}; - for (const val of this._def.values) { enumValues[val] = val; } - return enumValues; } - + extract(values) { + return ZodEnum.create(values); + } + exclude(values) { + return ZodEnum.create(this.options.filter(opt => !values.includes(opt))); + } } - exports.ZodEnum = ZodEnum; ZodEnum.create = createZodEnum; - class ZodNativeEnum extends ZodType { _parse(input) { const nativeEnumValues = util_1.util.getValidEnumValues(this._def.values); - const ctx = this._getOrReturnCtx(input); - - if (ctx.parsedType !== parseUtil_1.ZodParsedType.string && ctx.parsedType !== parseUtil_1.ZodParsedType.number) { + if (ctx.parsedType !== util_1.ZodParsedType.string && ctx.parsedType !== util_1.ZodParsedType.number) { const expectedValues = util_1.util.objectValues(nativeEnumValues); (0, parseUtil_1.addIssueToContext)(ctx, { expected: util_1.util.joinValues(expectedValues), @@ -3239,7 +3377,6 @@ class ZodNativeEnum extends ZodType { }); return parseUtil_1.INVALID; } - if (nativeEnumValues.indexOf(input.data) === -1) { const expectedValues = util_1.util.objectValues(nativeEnumValues); (0, parseUtil_1.addIssueToContext)(ctx, { @@ -3249,18 +3386,13 @@ class ZodNativeEnum extends ZodType { }); return parseUtil_1.INVALID; } - return (0, parseUtil_1.OK)(input.data); } - get enum() { return this._def.values; } - } - exports.ZodNativeEnum = ZodNativeEnum; - ZodNativeEnum.create = (values, params) => { return new ZodNativeEnum({ values: values, @@ -3268,23 +3400,23 @@ ZodNativeEnum.create = (values, params) => { ...processCreateParams(params) }); }; - class ZodPromise extends ZodType { + unwrap() { + return this._def.type; + } _parse(input) { const { ctx } = this._processInputParams(input); - - if (ctx.parsedType !== parseUtil_1.ZodParsedType.promise && ctx.common.async === false) { + if (ctx.parsedType !== util_1.ZodParsedType.promise && ctx.common.async === false) { (0, parseUtil_1.addIssueToContext)(ctx, { code: ZodError_1.ZodIssueCode.invalid_type, - expected: parseUtil_1.ZodParsedType.promise, + expected: util_1.ZodParsedType.promise, received: ctx.parsedType }); return parseUtil_1.INVALID; } - - const promisified = ctx.parsedType === parseUtil_1.ZodParsedType.promise ? ctx.data : Promise.resolve(ctx.data); + const promisified = ctx.parsedType === util_1.ZodParsedType.promise ? ctx.data : Promise.resolve(ctx.data); return (0, parseUtil_1.OK)(promisified.then(data => { return this._def.type.parseAsync(data, { path: ctx.path, @@ -3292,11 +3424,8 @@ class ZodPromise extends ZodType { }); })); } - } - exports.ZodPromise = ZodPromise; - ZodPromise.create = (schema, params) => { return new ZodPromise({ type: schema, @@ -3304,23 +3433,41 @@ ZodPromise.create = (schema, params) => { ...processCreateParams(params) }); }; - class ZodEffects extends ZodType { innerType() { return this._def.schema; } - + sourceType() { + return this._def.schema._def.typeName === ZodFirstPartyTypeKind.ZodEffects ? this._def.schema.sourceType() : this._def.schema; + } _parse(input) { const { status, ctx } = this._processInputParams(input); - const effect = this._def.effect || null; - + const checkCtx = { + addIssue: arg => { + (0, parseUtil_1.addIssueToContext)(ctx, arg); + if (arg.fatal) { + status.abort(); + } else { + status.dirty(); + } + }, + get path() { + return ctx.path; + } + }; + checkCtx.addIssue = checkCtx.addIssue.bind(checkCtx); if (effect.type === "preprocess") { - const processed = effect.transform(ctx.data); - + const processed = effect.transform(ctx.data, checkCtx); + if (ctx.common.issues.length) { + return { + status: "dirty", + value: ctx.data + }; + } if (ctx.common.async) { return Promise.resolve(processed).then(processed => { return this._def.schema._parseAsync({ @@ -3337,51 +3484,25 @@ class ZodEffects extends ZodType { }); } } - - const checkCtx = { - addIssue: arg => { - (0, parseUtil_1.addIssueToContext)(ctx, arg); - - if (arg.fatal) { - status.abort(); - } else { - status.dirty(); - } - }, - - get path() { - return ctx.path; - } - - }; - checkCtx.addIssue = checkCtx.addIssue.bind(checkCtx); - if (effect.type === "refinement") { - const executeRefinement = (acc // effect: RefinementEffect - ) => { + const executeRefinement = acc => { const result = effect.refinement(acc, checkCtx); - if (ctx.common.async) { return Promise.resolve(result); } - if (result instanceof Promise) { throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead."); } - return acc; }; - if (ctx.common.async === false) { const inner = this._def.schema._parseSync({ data: ctx.data, path: ctx.path, parent: ctx }); - if (inner.status === "aborted") return parseUtil_1.INVALID; - if (inner.status === "dirty") status.dirty(); // return value is ignored - + if (inner.status === "dirty") status.dirty(); executeRefinement(inner.value); return { status: status.value, @@ -3404,26 +3525,18 @@ class ZodEffects extends ZodType { }); } } - if (effect.type === "transform") { if (ctx.common.async === false) { const base = this._def.schema._parseSync({ data: ctx.data, path: ctx.path, parent: ctx - }); // if (base.status === "aborted") return INVALID; - // if (base.status === "dirty") { - // return { status: "dirty", value: base.value }; - // } - - + }); if (!(0, parseUtil_1.isValid)(base)) return base; const result = effect.transform(base.value, checkCtx); - if (result instanceof Promise) { - throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead."); + throw new Error(`Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.`); } - return { status: status.value, value: result @@ -3434,11 +3547,7 @@ class ZodEffects extends ZodType { path: ctx.path, parent: ctx }).then(base => { - if (!(0, parseUtil_1.isValid)(base)) return base; // if (base.status === "aborted") return INVALID; - // if (base.status === "dirty") { - // return { status: "dirty", value: base.value }; - // } - + if (!(0, parseUtil_1.isValid)(base)) return base; return Promise.resolve(effect.transform(base.value, checkCtx)).then(result => ({ status: status.value, value: result @@ -3446,15 +3555,11 @@ class ZodEffects extends ZodType { }); } } - util_1.util.assertNever(effect); } - } - exports.ZodEffects = ZodEffects; exports.ZodTransformer = ZodEffects; - ZodEffects.create = (schema, effect, params) => { return new ZodEffects({ schema, @@ -3463,7 +3568,6 @@ ZodEffects.create = (schema, effect, params) => { ...processCreateParams(params) }); }; - ZodEffects.createWithPreprocess = (preprocess, schema, params) => { return new ZodEffects({ schema, @@ -3475,26 +3579,19 @@ ZodEffects.createWithPreprocess = (preprocess, schema, params) => { ...processCreateParams(params) }); }; - class ZodOptional extends ZodType { _parse(input) { const parsedType = this._getType(input); - - if (parsedType === parseUtil_1.ZodParsedType.undefined) { + if (parsedType === util_1.ZodParsedType.undefined) { return (0, parseUtil_1.OK)(undefined); } - return this._def.innerType._parse(input); } - unwrap() { return this._def.innerType; } - } - exports.ZodOptional = ZodOptional; - ZodOptional.create = (type, params) => { return new ZodOptional({ innerType: type, @@ -3502,26 +3599,19 @@ ZodOptional.create = (type, params) => { ...processCreateParams(params) }); }; - class ZodNullable extends ZodType { _parse(input) { const parsedType = this._getType(input); - - if (parsedType === parseUtil_1.ZodParsedType.null) { + if (parsedType === util_1.ZodParsedType.null) { return (0, parseUtil_1.OK)(null); } - return this._def.innerType._parse(input); } - unwrap() { return this._def.innerType; } - } - exports.ZodNullable = ZodNullable; - ZodNullable.create = (type, params) => { return new ZodNullable({ innerType: type, @@ -3529,85 +3619,234 @@ ZodNullable.create = (type, params) => { ...processCreateParams(params) }); }; - class ZodDefault extends ZodType { _parse(input) { const { ctx } = this._processInputParams(input); - let data = ctx.data; - - if (ctx.parsedType === parseUtil_1.ZodParsedType.undefined) { + if (ctx.parsedType === util_1.ZodParsedType.undefined) { data = this._def.defaultValue(); } - return this._def.innerType._parse({ data, path: ctx.path, parent: ctx }); } - removeDefault() { return this._def.innerType; } - } - exports.ZodDefault = ZodDefault; - ZodDefault.create = (type, params) => { - return new ZodOptional({ + return new ZodDefault({ innerType: type, - typeName: ZodFirstPartyTypeKind.ZodOptional, + typeName: ZodFirstPartyTypeKind.ZodDefault, + defaultValue: typeof params.default === "function" ? params.default : () => params.default, + ...processCreateParams(params) + }); +}; +class ZodCatch extends ZodType { + _parse(input) { + const { + ctx + } = this._processInputParams(input); + const newCtx = { + ...ctx, + common: { + ...ctx.common, + issues: [] + } + }; + const result = this._def.innerType._parse({ + data: newCtx.data, + path: newCtx.path, + parent: { + ...newCtx + } + }); + if ((0, parseUtil_1.isAsync)(result)) { + return result.then(result => { + return { + status: "valid", + value: result.status === "valid" ? result.value : this._def.catchValue({ + get error() { + return new ZodError_1.ZodError(newCtx.common.issues); + }, + input: newCtx.data + }) + }; + }); + } else { + return { + status: "valid", + value: result.status === "valid" ? result.value : this._def.catchValue({ + get error() { + return new ZodError_1.ZodError(newCtx.common.issues); + }, + input: newCtx.data + }) + }; + } + } + removeCatch() { + return this._def.innerType; + } +} +exports.ZodCatch = ZodCatch; +ZodCatch.create = (type, params) => { + return new ZodCatch({ + innerType: type, + typeName: ZodFirstPartyTypeKind.ZodCatch, + catchValue: typeof params.catch === "function" ? params.catch : () => params.catch, ...processCreateParams(params) }); }; - class ZodNaN extends ZodType { _parse(input) { const parsedType = this._getType(input); - - if (parsedType !== parseUtil_1.ZodParsedType.nan) { + if (parsedType !== util_1.ZodParsedType.nan) { const ctx = this._getOrReturnCtx(input); - (0, parseUtil_1.addIssueToContext)(ctx, { code: ZodError_1.ZodIssueCode.invalid_type, - expected: parseUtil_1.ZodParsedType.nan, + expected: util_1.ZodParsedType.nan, received: ctx.parsedType }); return parseUtil_1.INVALID; } - return { status: "valid", value: input.data }; } - } - exports.ZodNaN = ZodNaN; - ZodNaN.create = params => { return new ZodNaN({ typeName: ZodFirstPartyTypeKind.ZodNaN, ...processCreateParams(params) }); }; - -const custom = (check, params) => { - if (check) return ZodAny.create().refine(check, params); +exports.BRAND = Symbol("zod_brand"); +class ZodBranded extends ZodType { + _parse(input) { + const { + ctx + } = this._processInputParams(input); + const data = ctx.data; + return this._def.type._parse({ + data, + path: ctx.path, + parent: ctx + }); + } + unwrap() { + return this._def.type; + } +} +exports.ZodBranded = ZodBranded; +class ZodPipeline extends ZodType { + _parse(input) { + const { + status, + ctx + } = this._processInputParams(input); + if (ctx.common.async) { + const handleAsync = async () => { + const inResult = await this._def.in._parseAsync({ + data: ctx.data, + path: ctx.path, + parent: ctx + }); + if (inResult.status === "aborted") return parseUtil_1.INVALID; + if (inResult.status === "dirty") { + status.dirty(); + return (0, parseUtil_1.DIRTY)(inResult.value); + } else { + return this._def.out._parseAsync({ + data: inResult.value, + path: ctx.path, + parent: ctx + }); + } + }; + return handleAsync(); + } else { + const inResult = this._def.in._parseSync({ + data: ctx.data, + path: ctx.path, + parent: ctx + }); + if (inResult.status === "aborted") return parseUtil_1.INVALID; + if (inResult.status === "dirty") { + status.dirty(); + return { + status: "dirty", + value: inResult.value + }; + } else { + return this._def.out._parseSync({ + data: inResult.value, + path: ctx.path, + parent: ctx + }); + } + } + } + static create(a, b) { + return new ZodPipeline({ + in: a, + out: b, + typeName: ZodFirstPartyTypeKind.ZodPipeline + }); + } +} +exports.ZodPipeline = ZodPipeline; +class ZodReadonly extends ZodType { + _parse(input) { + const result = this._def.innerType._parse(input); + if ((0, parseUtil_1.isValid)(result)) { + result.value = Object.freeze(result.value); + } + return result; + } +} +exports.ZodReadonly = ZodReadonly; +ZodReadonly.create = (type, params) => { + return new ZodReadonly({ + innerType: type, + typeName: ZodFirstPartyTypeKind.ZodReadonly, + ...processCreateParams(params) + }); +}; +const custom = function (check) { + let params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + let fatal = arguments.length > 2 ? arguments[2] : undefined; + if (check) return ZodAny.create().superRefine((data, ctx) => { + var _a, _b; + if (!check(data)) { + const p = typeof params === "function" ? params(data) : typeof params === "string" ? { + message: params + } : params; + const _fatal = (_b = (_a = p.fatal) !== null && _a !== void 0 ? _a : fatal) !== null && _b !== void 0 ? _b : true; + const p2 = typeof p === "string" ? { + message: p + } : p; + ctx.addIssue({ + code: "custom", + ...p2, + fatal: _fatal + }); + } + }); return ZodAny.create(); }; - exports.custom = custom; exports.late = { object: ZodObject.lazycreate }; var ZodFirstPartyTypeKind; - (function (ZodFirstPartyTypeKind) { ZodFirstPartyTypeKind["ZodString"] = "ZodString"; ZodFirstPartyTypeKind["ZodNumber"] = "ZodNumber"; @@ -3615,6 +3854,7 @@ var ZodFirstPartyTypeKind; ZodFirstPartyTypeKind["ZodBigInt"] = "ZodBigInt"; ZodFirstPartyTypeKind["ZodBoolean"] = "ZodBoolean"; ZodFirstPartyTypeKind["ZodDate"] = "ZodDate"; + ZodFirstPartyTypeKind["ZodSymbol"] = "ZodSymbol"; ZodFirstPartyTypeKind["ZodUndefined"] = "ZodUndefined"; ZodFirstPartyTypeKind["ZodNull"] = "ZodNull"; ZodFirstPartyTypeKind["ZodAny"] = "ZodAny"; @@ -3639,16 +3879,21 @@ var ZodFirstPartyTypeKind; ZodFirstPartyTypeKind["ZodOptional"] = "ZodOptional"; ZodFirstPartyTypeKind["ZodNullable"] = "ZodNullable"; ZodFirstPartyTypeKind["ZodDefault"] = "ZodDefault"; + ZodFirstPartyTypeKind["ZodCatch"] = "ZodCatch"; ZodFirstPartyTypeKind["ZodPromise"] = "ZodPromise"; + ZodFirstPartyTypeKind["ZodBranded"] = "ZodBranded"; + ZodFirstPartyTypeKind["ZodPipeline"] = "ZodPipeline"; + ZodFirstPartyTypeKind["ZodReadonly"] = "ZodReadonly"; })(ZodFirstPartyTypeKind = exports.ZodFirstPartyTypeKind || (exports.ZodFirstPartyTypeKind = {})); - +class Class { + constructor() {} +} const instanceOfType = function (cls) { let params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : { - message: "Input not instance of ".concat(cls.name) + message: `Input not instance of ${cls.name}` }; return (0, exports.custom)(data => data instanceof cls, params); }; - exports.instanceof = instanceOfType; const stringType = ZodString.create; exports.string = stringType; @@ -3662,6 +3907,8 @@ const booleanType = ZodBoolean.create; exports.boolean = booleanType; const dateType = ZodDate.create; exports.date = dateType; +const symbolType = ZodSymbol.create; +exports.symbol = symbolType; const undefinedType = ZodUndefined.create; exports.undefined = undefinedType; const nullType = ZodNull.create; @@ -3715,20 +3962,39 @@ const nullableType = ZodNullable.create; exports.nullable = nullableType; const preprocessType = ZodEffects.createWithPreprocess; exports.preprocess = preprocessType; - +const pipelineType = ZodPipeline.create; +exports.pipeline = pipelineType; const ostring = () => stringType().optional(); - exports.ostring = ostring; - const onumber = () => numberType().optional(); - exports.onumber = onumber; - const oboolean = () => booleanType().optional(); - exports.oboolean = oboolean; +exports.coerce = { + string: arg => ZodString.create({ + ...arg, + coerce: true + }), + number: arg => ZodNumber.create({ + ...arg, + coerce: true + }), + boolean: arg => ZodBoolean.create({ + ...arg, + coerce: true + }), + bigint: arg => ZodBigInt.create({ + ...arg, + coerce: true + }), + date: arg => ZodDate.create({ + ...arg, + coerce: true + }) +}; +exports.NEVER = parseUtil_1.INVALID; -},{"./ZodError":2,"./helpers/errorUtil":4,"./helpers/parseUtil":5,"./helpers/util":7}],10:[function(require,module,exports){ +},{"./ZodError":2,"./errors":3,"./helpers/errorUtil":5,"./helpers/parseUtil":6,"./helpers/util":8}],12:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { @@ -3770,12 +4036,10 @@ Object.defineProperty(exports, "validate", { return _deviceApiCall.validate; } }); - var _deviceApiCall = require("./lib/device-api-call.js"); - var _deviceApi = require("./lib/device-api.js"); -},{"./lib/device-api-call.js":11,"./lib/device-api.js":12}],11:[function(require,module,exports){ +},{"./lib/device-api-call.js":13,"./lib/device-api.js":14}],13:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { @@ -3786,9 +4050,6 @@ exports.createDeviceApiCall = createDeviceApiCall; exports.createNotification = void 0; exports.createRequest = createRequest; exports.validate = validate; - -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - /** * This roughly follows https://www.jsonrpc.org/specification * @template {import("zod").ZodType} Params=import("zod").ZodType @@ -3796,18 +4057,18 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope */ class DeviceApiCall { /** @type {string} */ - + method = 'unknown'; /** * An optional 'id' - used to indicate if a request requires a response. * @type {string|null} */ - + id = null; /** @type {Params | null | undefined} */ - + paramsValidator = null; /** @type {Result | null | undefined} */ - + resultValidator = null; /** @type {import("zod").infer} */ - + params; /** * This is a carve-out for legacy messages that are not typed yet. * If you set this to 'true', then the response will not be checked to conform @@ -3815,7 +4076,7 @@ class DeviceApiCall { * @deprecated this is here to aid migration, should be removed ASAP * @type {boolean} */ - + throwOnResultKeysMissing = true; /** * New messages should be in a particular format, eg: { success: T }, * but you can set this to false if you want to access the result as-is, @@ -3823,96 +4084,67 @@ class DeviceApiCall { * @deprecated this is here to aid migration, should be removed ASAP * @type {boolean} */ - + unwrapResult = true; /** * @param {import("zod").infer} data */ constructor(data) { - _defineProperty(this, "method", 'unknown'); - - _defineProperty(this, "id", null); - - _defineProperty(this, "paramsValidator", null); - - _defineProperty(this, "resultValidator", null); - - _defineProperty(this, "params", void 0); - - _defineProperty(this, "throwOnResultKeysMissing", true); - - _defineProperty(this, "unwrapResult", true); - this.params = data; } + /** * @returns {import("zod").infer|undefined} */ - - validateParams() { if (this.params === undefined) { return undefined; } - this._validate(this.params, this.paramsValidator); - return this.params; } + /** * @param {any|null} incoming * @returns {import("zod").infer} */ - - validateResult(incoming) { this._validate(incoming, this.resultValidator); - if (!incoming) { return incoming; } - if (!this.unwrapResult) { return incoming; } - if ('data' in incoming) { console.warn('response had `data` property. Please migrate to `success`'); return incoming.data; } - if ('success' in incoming) { return incoming.success; } - if ('error' in incoming) { if (typeof incoming.error.message === 'string') { - throw new DeviceApiCallError("".concat(this.method, ": ").concat(incoming.error.message)); + throw new DeviceApiCallError(`${this.method}: ${incoming.error.message}`); } } - if (this.throwOnResultKeysMissing) { throw new Error('unreachable. Response did not contain `success` or `data`'); } - return incoming; } + /** * @param {any} data * @param {import("zod").ZodType|undefined|null} [validator] * @private */ - - _validate(data, validator) { if (!validator) return data; - if (validator) { - const result = validator === null || validator === void 0 ? void 0 : validator.safeParse(data); - + const result = validator?.safeParse(data); if (!result) { throw new Error('unreachable, data failure', data); } - if (!result.success) { if ('error' in result) { this.throwError(result.error.issues); @@ -3922,15 +4154,15 @@ class DeviceApiCall { } } } + /** * @param {import('zod').ZodIssue[]} errors */ - - throwError(errors) { const error = SchemaValidationError.fromZodErrors(errors, this.constructor.name); throw error; } + /** * Use this helper for creating stand-in response messages that are typed correctly. * @@ -3944,38 +4176,26 @@ class DeviceApiCall { * @param {import("zod").infer} response * @returns {import("zod").infer} */ - - result(response) { return response; } /** * @returns {import("zod").infer} */ - - preResultValidation(response) { return response; } - } - exports.DeviceApiCall = DeviceApiCall; - class DeviceApiCallError extends Error {} + /** * Check for this error if you'd like to */ - - exports.DeviceApiCallError = DeviceApiCallError; - class SchemaValidationError extends Error { - constructor() { - super(...arguments); - - _defineProperty(this, "validationErrors", []); - } + /** @type {import("zod").ZodIssue[]} */ + validationErrors = []; /** * @param {import("zod").ZodIssue[]} errors @@ -3983,17 +4203,15 @@ class SchemaValidationError extends Error { * @returns {SchemaValidationError} */ static fromZodErrors(errors, name) { - const heading = "".concat(errors.length, " SchemaValidationError(s) errors for ") + name; - + const heading = `${errors.length} SchemaValidationError(s) errors for ` + name; function log(issue) { switch (issue.code) { case 'invalid_literal': case 'invalid_type': { - console.log("".concat(name, ". Path: '").concat(issue.path.join('.'), "', Error: '").concat(issue.message, "'")); + console.log(`${name}. Path: '${issue.path.join('.')}', Error: '${issue.message}'`); break; } - case 'invalid_union': { for (let unionError of issue.unionErrors) { @@ -4001,28 +4219,24 @@ class SchemaValidationError extends Error { log(issue1); } } - break; } - default: { console.log(name, 'other issue:', issue); } } } - for (let error of errors) { log(error); } - const message = [heading, 'please see the details above'].join('\n '); const error = new SchemaValidationError(message); error.validationErrors = errors; return error; } - } + /** * Creates an instance of `DeviceApiCall` from only a name and 'params' * and optional validators. Use this to help migrate existing messages. @@ -4035,14 +4249,10 @@ class SchemaValidationError extends Error { * @param {Result|null} [resultValidator] * @returns {DeviceApiCall} */ - - exports.SchemaValidationError = SchemaValidationError; - function createDeviceApiCall(method, params) { let paramsValidator = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null; let resultValidator = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null; - /** @type {DeviceApiCall} */ const deviceApiCall = new DeviceApiCall(params); deviceApiCall.paramsValidator = paramsValidator; @@ -4052,6 +4262,7 @@ function createDeviceApiCall(method, params) { deviceApiCall.unwrapResult = false; return deviceApiCall; } + /** * Creates an instance of `DeviceApiCall` from only a name and 'params' * and optional validators. Use this to help migrate existing messages. @@ -4068,8 +4279,6 @@ function createDeviceApiCall(method, params) { * @param {Result|null} [resultValidator] * @returns {DeviceApiCall} */ - - function createRequest(method, params) { let id = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'n/a'; let paramsValidator = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null; @@ -4078,8 +4287,8 @@ function createRequest(method, params) { call.id = id; return call; } +const createNotification = exports.createNotification = createDeviceApiCall; -const createNotification = createDeviceApiCall; /** * Validate any arbitrary data with any Zod validator * @@ -4088,29 +4297,21 @@ const createNotification = createDeviceApiCall; * @param {Validator | null} [validator] * @returns {import("zod").infer} */ - -exports.createNotification = createNotification; - function validate(data) { let validator = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; - if (validator) { return validator.parse(data); } - return data; } -},{}],12:[function(require,module,exports){ +},{}],14:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.DeviceApiTransport = exports.DeviceApi = void 0; - -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - /** * Platforms should only need to implement this `send` method */ @@ -4123,8 +4324,8 @@ class DeviceApiTransport { async send(_deviceApiCall, _options) { return undefined; } - } + /** * This is the base Sender class that platforms can will implement. * @@ -4133,17 +4334,12 @@ class DeviceApiTransport { * @typedef CallOptions * @property {AbortSignal} [signal] */ - - exports.DeviceApiTransport = DeviceApiTransport; - class DeviceApi { /** @type {DeviceApiTransport} */ - + transport; /** @param {DeviceApiTransport} transport */ constructor(transport) { - _defineProperty(this, "transport", void 0); - this.transport = transport; } /** @@ -4152,8 +4348,6 @@ class DeviceApi { * @param {CallOptions} [options] * @returns {Promise['success']>>} */ - - async request(deviceApiCall, options) { deviceApiCall.validateParams(); let result = await this.transport.send(deviceApiCall, options); @@ -4166,18 +4360,14 @@ class DeviceApi { * @param {CallOptions} [options] * @returns {Promise} */ - - async notify(deviceApiCall, options) { deviceApiCall.validateParams(); return this.transport.send(deviceApiCall, options); } - } - exports.DeviceApi = DeviceApi; -},{}],13:[function(require,module,exports){ +},{}],15:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { @@ -4190,9 +4380,7 @@ Object.defineProperty(exports, "WebkitMessagingConfig", { return _webkit.WebkitMessagingConfig; } }); - var _webkit = require("./webkit.js"); - /** * @module Messaging * @@ -4270,8 +4458,6 @@ class Messaging { * @param {string} name * @param {Record} [data] */ - - notify(name) { let data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; this.transport.notify(name, data); @@ -4291,21 +4477,16 @@ class Messaging { * @param {Record} [data] * @return {Promise} */ - - request(name) { let data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; return this.transport.request(name, data); } - } + /** * @interface */ - - exports.Messaging = Messaging; - class MessagingTransport { /** * @param {string} name @@ -4323,34 +4504,27 @@ class MessagingTransport { * @return {Promise} */ // @ts-ignore - ignoring a no-unused ts error, this is only an interface. - - request(name) { let data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; throw new Error('must implement'); } - } + /** * @param {WebkitMessagingConfig} config * @returns {MessagingTransport} */ - - exports.MessagingTransport = MessagingTransport; - function getTransport(config) { if (config instanceof _webkit.WebkitMessagingConfig) { return new _webkit.WebkitMessagingTransport(config); } - throw new Error('unreachable'); } + /** * Thrown when a handler cannot be found */ - - class MissingHandler extends Error { /** * @param {string} message @@ -4360,26 +4534,51 @@ class MissingHandler extends Error { super(message); this.handlerName = handlerName; } - } + /** * Some re-exports for convenience */ - - exports.MissingHandler = MissingHandler; -},{"./webkit.js":14}],14:[function(require,module,exports){ +},{"./webkit.js":16}],16:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.WebkitMessagingTransport = exports.WebkitMessagingConfig = exports.SecureMessagingParams = void 0; - var _messaging = require("./messaging.js"); - -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } +/** + * @module Webkit Messaging + * + * @description + * + * A wrapper for messaging on WebKit platforms. It supports modern WebKit messageHandlers + * along with encryption for older versions (like macOS Catalina) + * + * Note: If you wish to support Catalina then you'll need to implement the native + * part of the message handling, see {@link WebkitMessagingTransport} for details. + * + * ```js + * import { Messaging, WebkitMessagingConfig } from "@duckduckgo/content-scope-scripts/lib/messaging.js" + * + * // This config would be injected into the UserScript + * const injectedConfig = { + * hasModernWebkitAPI: true, + * webkitMessageHandlerNames: ["foo", "bar", "baz"], + * secret: "dax", + * }; + * + * // Then use that config to construct platform-specific configuration + * const config = new WebkitMessagingConfig(injectedConfig); + * + * // finally, get an instance of Messaging and start sending messages in a unified way 🚀 + * const messaging = new Messaging(config); + * messaging.notify("hello world!", {foo: "bar"}) + * + * ``` + */ /** * @typedef {import("./messaging").MessagingTransport} MessagingTransport @@ -4433,77 +4632,59 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope */ class WebkitMessagingTransport { /** @type {WebkitMessagingConfig} */ - + config; + globals; /** - * @param {WebkitMessagingConfig} config - */ + * @param {WebkitMessagingConfig} config + */ constructor(config) { - _defineProperty(this, "config", void 0); - - _defineProperty(this, "globals", void 0); - - _defineProperty(this, "algoObj", { - name: 'AES-GCM', - length: 256 - }); - this.config = config; this.globals = captureGlobals(); - if (!this.config.hasModernWebkitAPI) { this.captureWebkitHandlers(this.config.webkitMessageHandlerNames); } } /** - * Sends message to the webkit layer (fire and forget) - * @param {String} handler - * @param {*} data - * @internal - */ - - + * Sends message to the webkit layer (fire and forget) + * @param {String} handler + * @param {*} data + * @internal + */ wkSend(handler) { - var _this$globals$window$, _this$globals$window$2; - let data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - if (!(handler in this.globals.window.webkit.messageHandlers)) { - throw new _messaging.MissingHandler("Missing webkit handler: '".concat(handler, "'"), handler); + throw new _messaging.MissingHandler(`Missing webkit handler: '${handler}'`, handler); } - - const outgoing = { ...data, - messageHandling: { ...data.messageHandling, + const outgoing = { + ...data, + messageHandling: { + ...data.messageHandling, secret: this.config.secret } }; - if (!this.config.hasModernWebkitAPI) { if (!(handler in this.globals.capturedWebkitHandlers)) { - throw new _messaging.MissingHandler("cannot continue, method ".concat(handler, " not captured on macos < 11"), handler); + throw new _messaging.MissingHandler(`cannot continue, method ${handler} not captured on macos < 11`, handler); } else { return this.globals.capturedWebkitHandlers[handler](outgoing); } } - - return (_this$globals$window$ = (_this$globals$window$2 = this.globals.window.webkit.messageHandlers[handler]).postMessage) === null || _this$globals$window$ === void 0 ? void 0 : _this$globals$window$.call(_this$globals$window$2, outgoing); + return this.globals.window.webkit.messageHandlers[handler].postMessage?.(outgoing); } - /** - * Sends message to the webkit layer and waits for the specified response - * @param {String} handler - * @param {*} data - * @returns {Promise<*>} - * @internal - */ - + /** + * Sends message to the webkit layer and waits for the specified response + * @param {String} handler + * @param {*} data + * @returns {Promise<*>} + * @internal + */ async wkSendAndWait(handler) { let data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - if (this.config.hasModernWebkitAPI) { const response = await this.wkSend(handler, data); return this.globals.JSONparse(response || '{}'); } - try { const randMethodName = this.createRandMethodName(); const key = await this.createRandKey(); @@ -4511,9 +4692,7 @@ class WebkitMessagingTransport { const { ciphertext, tag - } = await new this.globals.Promise(( - /** @type {any} */ - resolve) => { + } = await new this.globals.Promise(( /** @type {any} */resolve) => { this.generateRandomMethod(randMethodName, resolve); data.messageHandling = new SecureMessagingParams({ methodName: randMethodName, @@ -4540,89 +4719,81 @@ class WebkitMessagingTransport { } } /** - * @param {string} name - * @param {Record} [data] - */ - - + * @param {string} name + * @param {Record} [data] + */ notify(name) { let data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; this.wkSend(name, data); } /** - * @param {string} name - * @param {Record} [data] - */ - - + * @param {string} name + * @param {Record} [data] + */ request(name) { let data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; return this.wkSendAndWait(name, data); } /** - * Generate a random method name and adds it to the global scope - * The native layer will use this method to send the response - * @param {string | number} randomMethodName - * @param {Function} callback - */ - - + * Generate a random method name and adds it to the global scope + * The native layer will use this method to send the response + * @param {string | number} randomMethodName + * @param {Function} callback + */ generateRandomMethod(randomMethodName, callback) { var _this = this; - this.globals.ObjectDefineProperty(this.globals.window, randomMethodName, { enumerable: false, // configurable, To allow for deletion later configurable: true, writable: false, - /** * @param {any[]} args */ value: function () { - callback(...arguments); // @ts-ignore - we want this to throw if it fails as it would indicate a fatal error. - + callback(...arguments); + // @ts-ignore - we want this to throw if it fails as it would indicate a fatal error. delete _this.globals.window[randomMethodName]; } }); } - randomString() { return '' + this.globals.getRandomValues(new this.globals.Uint32Array(1))[0]; } - createRandMethodName() { return '_' + this.randomString(); } - /** - * @type {{name: string, length: number}} - */ + /** + * @type {{name: string, length: number}} + */ + algoObj = { + name: 'AES-GCM', + length: 256 + }; /** - * @returns {Promise} - */ + * @returns {Promise} + */ async createRandKey() { const key = await this.globals.generateKey(this.algoObj, true, ['encrypt', 'decrypt']); const exportedKey = await this.globals.exportKey('raw', key); return new this.globals.Uint8Array(exportedKey); } - /** - * @returns {Uint8Array} - */ - + /** + * @returns {Uint8Array} + */ createRandIv() { return this.globals.getRandomValues(new this.globals.Uint8Array(12)); } - /** - * @param {BufferSource} ciphertext - * @param {BufferSource} key - * @param {Uint8Array} iv - * @returns {Promise} - */ - + /** + * @param {BufferSource} ciphertext + * @param {BufferSource} key + * @param {Uint8Array} iv + * @returns {Promise} + */ async decrypt(ciphertext, key, iv) { const cryptoKey = await this.globals.importKey('raw', key, 'AES-GCM', false, ['decrypt']); const algo = { @@ -4633,37 +4804,31 @@ class WebkitMessagingTransport { let dec = new this.globals.TextDecoder(); return dec.decode(decrypted); } - /** - * When required (such as on macos 10.x), capture the `postMessage` method on - * each webkit messageHandler - * - * @param {string[]} handlerNames - */ - + /** + * When required (such as on macos 10.x), capture the `postMessage` method on + * each webkit messageHandler + * + * @param {string[]} handlerNames + */ captureWebkitHandlers(handlerNames) { const handlers = window.webkit.messageHandlers; if (!handlers) throw new _messaging.MissingHandler('window.webkit.messageHandlers was absent', 'all'); - for (let webkitMessageHandlerName of handlerNames) { - var _handlers$webkitMessa; - - if (typeof ((_handlers$webkitMessa = handlers[webkitMessageHandlerName]) === null || _handlers$webkitMessa === void 0 ? void 0 : _handlers$webkitMessa.postMessage) === 'function') { - var _handlers$webkitMessa2; - + if (typeof handlers[webkitMessageHandlerName]?.postMessage === 'function') { /** * `bind` is used here to ensure future calls to the captured * `postMessage` have the correct `this` context */ const original = handlers[webkitMessageHandlerName]; - const bound = (_handlers$webkitMessa2 = handlers[webkitMessageHandlerName].postMessage) === null || _handlers$webkitMessa2 === void 0 ? void 0 : _handlers$webkitMessa2.bind(original); + const bound = handlers[webkitMessageHandlerName].postMessage?.bind(original); this.globals.capturedWebkitHandlers[webkitMessageHandlerName] = bound; delete handlers[webkitMessageHandlerName].postMessage; } } } - } + /** * Use this configuration to create an instance of {@link Messaging} for WebKit * @@ -4680,10 +4845,7 @@ class WebkitMessagingTransport { * const resp = await messaging.request("debugConfig") * ``` */ - - exports.WebkitMessagingTransport = WebkitMessagingTransport; - class WebkitMessagingConfig { /** * @param {object} params @@ -4700,25 +4862,20 @@ class WebkitMessagingConfig { /** * A list of WebKit message handler names that a user script can send */ - this.webkitMessageHandlerNames = params.webkitMessageHandlerNames; /** * A string provided by native platforms to be sent with future outgoing * messages */ - this.secret = params.secret; } - } + /** * This is the additional payload that gets appended to outgoing messages. * It's used in the Swift side to encrypt the response that comes back */ - - exports.WebkitMessagingConfig = WebkitMessagingConfig; - class SecureMessagingParams { /** * @param {object} params @@ -4735,29 +4892,23 @@ class SecureMessagingParams { /** * The secret used to ensure message sender validity */ - this.secret = params.secret; /** * The CipherKey as number[] */ - this.key = params.key; /** * The Initial Vector as number[] */ - this.iv = params.iv; } - } + /** * Capture some globals used for messaging handling to prevent page * scripts from tampering with this */ - - exports.SecureMessagingParams = SecureMessagingParams; - function captureGlobals() { // Creat base with null prototype return { @@ -4780,13 +4931,12 @@ function captureGlobals() { Promise: window.Promise, ObjectDefineProperty: window.Object.defineProperty, addEventListener: window.addEventListener.bind(window), - /** @type {Record} */ capturedWebkitHandlers: {} }; } -},{"./messaging.js":13}],15:[function(require,module,exports){ +},{"./messaging.js":15}],17:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { @@ -4807,13 +4957,9 @@ Object.defineProperty(exports, "constants", { } }); exports.generate = generate; - var _applePassword = require("./lib/apple.password.js"); - var _rulesParser = require("./lib/rules-parser.js"); - var _constants = require("./lib/constants.js"); - /** * @typedef {{ * domain?: string | null | undefined; @@ -4822,7 +4968,6 @@ var _constants = require("./lib/constants.js"); * onError?: ((error: unknown) => void) | null | undefined; * }} GenerateOptions */ - /** * Generate a random password based on the following attempts * @@ -4837,16 +4982,13 @@ var _constants = require("./lib/constants.js"); */ function generate() { let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - try { - if (typeof (options === null || options === void 0 ? void 0 : options.input) === 'string') { + if (typeof options?.input === 'string') { return _applePassword.Password.generateOrThrow(options.input); } - - if (typeof (options === null || options === void 0 ? void 0 : options.domain) === 'string') { - if (options !== null && options !== void 0 && options.rules) { + if (typeof options?.domain === 'string') { + if (options?.rules) { const rules = _selectPasswordRules(options.domain, options.rules); - if (rules) { return _applePassword.Password.generateOrThrow(rules); } @@ -4854,25 +4996,25 @@ function generate() { } } catch (e) { // if an 'onError' callback was provided, forward all errors - if (options !== null && options !== void 0 && options.onError && typeof (options === null || options === void 0 ? void 0 : options.onError) === 'function') { + if (options?.onError && typeof options?.onError === 'function') { options.onError(e); } else { // otherwise, only console.error unknown errors (which could be implementation bugs) const isKnownError = e instanceof _rulesParser.ParserError || e instanceof HostnameInputError; - if (!isKnownError) { console.error(e); } } - } // At this point, we have to trust the generation will not throw - // as it is NOT using any user/page-provided data - + } + // At this point, we have to trust the generation will not throw + // as it is NOT using any user/page-provided data return _applePassword.Password.generateDefault(); -} // An extension type to differentiate between known errors - +} +// An extension type to differentiate between known errors class HostnameInputError extends Error {} + /** * @typedef {Record} RulesFormat */ @@ -4884,74 +5026,71 @@ class HostnameInputError extends Error {} * @returns {string | undefined} * @throws {HostnameInputError} */ - - exports.HostnameInputError = HostnameInputError; - function _selectPasswordRules(inputHostname, rules) { - const hostname = _safeHostname(inputHostname); // direct match - - + const hostname = _safeHostname(inputHostname); + // direct match if (rules[hostname]) { return rules[hostname]['password-rules']; - } // otherwise, start chopping off subdomains and re-joining to compare - + } + // otherwise, start chopping off subdomains and re-joining to compare const pieces = hostname.split('.'); - while (pieces.length > 1) { pieces.shift(); const joined = pieces.join('.'); - if (rules[joined]) { return rules[joined]['password-rules']; } } - return undefined; } + /** * @private * @param {string} inputHostname; * @throws {HostnameInputError} * @returns {string} */ - - function _safeHostname(inputHostname) { if (inputHostname.startsWith('http:') || inputHostname.startsWith('https:')) { throw new HostnameInputError('invalid input, you can only provide a hostname but you gave a scheme'); } - if (inputHostname.includes(':')) { throw new HostnameInputError('invalid input, you can only provide a hostname but you gave a :port'); } - try { const asUrl = new URL('https://' + inputHostname); return asUrl.hostname; } catch (e) { - throw new HostnameInputError("could not instantiate a URL from that hostname ".concat(inputHostname)); + throw new HostnameInputError(`could not instantiate a URL from that hostname ${inputHostname}`); } } -},{"./lib/apple.password.js":16,"./lib/constants.js":17,"./lib/rules-parser.js":18}],16:[function(require,module,exports){ +},{"./lib/apple.password.js":18,"./lib/constants.js":19,"./lib/rules-parser.js":20}],18:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Password = void 0; - var parser = _interopRequireWildcard(require("./rules-parser.js")); - var _constants = require("./constants.js"); - function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } - function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } - -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } +/* + * + * NOTE: + * + * This file was created with inspiration from https://developer.apple.com/password-rules + * + * * The changes made by DuckDuckGo employees are: + * + * 1) removed all logic relating to 'more typeable passwords' + * 2) reduced the number of password styles from 4 to only the 1 which suits our needs + * 2) added JSDoc comments (for Typescript checking) + * + */ /** * @typedef {{ @@ -4963,7 +5102,6 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope * PasswordMaxLength?: number, * }} Requirements */ - /** * @typedef {{ * NumberOfRequiredRandomCharacters: number, @@ -4977,12 +5115,12 @@ const defaults = Object.freeze({ defaultPasswordLength: _constants.constants.DEFAULT_MIN_LENGTH, defaultPasswordRules: _constants.constants.DEFAULT_PASSWORD_RULES, defaultRequiredCharacterSets: ['abcdefghijklmnopqrstuvwxyz', 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', '0123456789'], - /** * @type {typeof window.crypto.getRandomValues | null} */ getRandomValues: null }); + /** * This is added here to ensure: * @@ -4992,37 +5130,28 @@ const defaults = Object.freeze({ * * @type {{ getRandomValues: typeof window.crypto.getRandomValues }} */ - const safeGlobals = {}; - if (typeof window !== 'undefined') { safeGlobals.getRandomValues = window.crypto.getRandomValues.bind(window.crypto); } - class Password { - /** - * @type {typeof defaults} - */ - /** * @param {Partial} [options] */ constructor() { let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - - _defineProperty(this, "options", void 0); - - this.options = { ...defaults, + /** + * @type {typeof defaults} + */ + this.options = { + ...defaults, ...options }; return this; } - /** - * This is here to provide external access to un-modified defaults - * in case they are needed for tests/verifications - * @type {typeof defaults} - */ - + static get defaults() { + return defaults; + } /** * Generates a password from the given input. @@ -5057,12 +5186,11 @@ class Password { * @param {Partial} [options] * @returns {string} */ - - static generateDefault() { let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; return new Password(options).parse(Password.defaults.defaultPasswordRules).generate(); } + /** * Convert a ruleset into it's internally-used component pieces. * @@ -5076,59 +5204,44 @@ class Password { * generate: () => string; * }} */ - - parse(inputString) { const rules = parser.parsePasswordRules(inputString); - const requirements = this._requirementsFromRules(rules); - if (!requirements) throw new Error('could not generate requirements for ' + JSON.stringify(inputString)); - const parameters = this._passwordGenerationParametersDictionary(requirements); - return { requirements, parameters, rules, - get entropy() { return Math.log2(parameters.PasswordAllowedCharacters.length ** parameters.NumberOfRequiredRandomCharacters); }, - generate: () => { const password = this._generatedPasswordMatchingRequirements(requirements, parameters); /** * The following is unreachable because if user input was incorrect then * the parsing phase would throw. The following lines is to satisfy Typescript */ - - if (password === '') throw new Error('unreachable'); return password; } }; } + /** * Given an array of `Rule's`, convert into `Requirements` * * @param {parser.Rule[]} passwordRules * @returns {Requirements | null} */ - - _requirementsFromRules(passwordRules) { /** @type {Requirements} */ const requirements = {}; - for (let rule of passwordRules) { if (rule.name === parser.RuleName.ALLOWED) { console.assert(!('PasswordAllowedCharacters' in requirements)); - const chars = this._charactersFromCharactersClasses(rule.value); - const scanSet = this._canonicalizedScanSetFromCharacters(chars); - if (scanSet) { requirements.PasswordAllowedCharacters = scanSet; } @@ -5137,108 +5250,94 @@ class Password { requirements.PasswordRepeatedCharacterLimit = rule.value; } else if (rule.name === parser.RuleName.REQUIRED) { let requiredCharacters = requirements.PasswordRequiredCharacters; - if (!requiredCharacters) { requiredCharacters = requirements.PasswordRequiredCharacters = []; } - requiredCharacters.push(this._canonicalizedScanSetFromCharacters(this._charactersFromCharactersClasses(rule.value))); } else if (rule.name === parser.RuleName.MIN_LENGTH) { requirements.PasswordMinLength = rule.value; } else if (rule.name === parser.RuleName.MAX_LENGTH) { requirements.PasswordMaxLength = rule.value; } - } // Only include an allowed rule matching SCAN_SET_ORDER (all characters) when a required rule is also present. - + } + // Only include an allowed rule matching SCAN_SET_ORDER (all characters) when a required rule is also present. if (requirements.PasswordAllowedCharacters === this.options.SCAN_SET_ORDER && !requirements.PasswordRequiredCharacters) { delete requirements.PasswordAllowedCharacters; - } // Fix up PasswordRequiredCharacters, if needed. - + } + // Fix up PasswordRequiredCharacters, if needed. if (requirements.PasswordRequiredCharacters && requirements.PasswordRequiredCharacters.length === 1 && requirements.PasswordRequiredCharacters[0] === this.options.SCAN_SET_ORDER) { delete requirements.PasswordRequiredCharacters; } - return Object.keys(requirements).length ? requirements : null; } + /** * @param {number} range * @returns {number} */ - - _randomNumberWithUniformDistribution(range) { - const getRandomValues = this.options.getRandomValues || safeGlobals.getRandomValues; // Based on the algorithm described in https://pthree.org/2018/06/13/why-the-multiply-and-floor-rng-method-is-biased/ - + const getRandomValues = this.options.getRandomValues || safeGlobals.getRandomValues; + // Based on the algorithm described in https://pthree.org/2018/06/13/why-the-multiply-and-floor-rng-method-is-biased/ const max = Math.floor(2 ** 32 / range) * range; let x; - do { x = getRandomValues(new Uint32Array(1))[0]; } while (x >= max); - return x % range; } + /** * @param {number} numberOfRequiredRandomCharacters * @param {string} allowedCharacters */ - - _classicPassword(numberOfRequiredRandomCharacters, allowedCharacters) { const length = allowedCharacters.length; const randomCharArray = Array(numberOfRequiredRandomCharacters); - for (let i = 0; i < numberOfRequiredRandomCharacters; i++) { const index = this._randomNumberWithUniformDistribution(length); - randomCharArray[i] = allowedCharacters[index]; } - return randomCharArray.join(''); } + /** * @param {string} password * @param {number} consecutiveCharLimit * @returns {boolean} */ - - _passwordHasNotExceededConsecutiveCharLimit(password, consecutiveCharLimit) { let longestConsecutiveCharLength = 1; - let firstConsecutiveCharIndex = 0; // Both "123" or "abc" and "321" or "cba" are considered consecutive. - + let firstConsecutiveCharIndex = 0; + // Both "123" or "abc" and "321" or "cba" are considered consecutive. let isSequenceAscending; - for (let i = 1; i < password.length; i++) { const currCharCode = password.charCodeAt(i); const prevCharCode = password.charCodeAt(i - 1); - if (isSequenceAscending) { // If `isSequenceAscending` is defined, then we know that we are in the middle of an existing // pattern. Check if the pattern continues based on whether the previous pattern was // ascending or descending. if (isSequenceAscending.valueOf() && currCharCode === prevCharCode + 1 || !isSequenceAscending.valueOf() && currCharCode === prevCharCode - 1) { continue; - } // Take into account the case when the sequence transitions from descending - // to ascending. - + } + // Take into account the case when the sequence transitions from descending + // to ascending. if (currCharCode === prevCharCode + 1) { firstConsecutiveCharIndex = i - 1; isSequenceAscending = Boolean(true); continue; - } // Take into account the case when the sequence transitions from ascending - // to descending. - + } + // Take into account the case when the sequence transitions from ascending + // to descending. if (currCharCode === prevCharCode - 1) { firstConsecutiveCharIndex = i - 1; isSequenceAscending = Boolean(false); continue; } - isSequenceAscending = null; } else if (currCharCode === prevCharCode + 1) { isSequenceAscending = Boolean(true); @@ -5247,192 +5346,157 @@ class Password { isSequenceAscending = Boolean(false); continue; } - const currConsecutiveCharLength = i - firstConsecutiveCharIndex; - if (currConsecutiveCharLength > longestConsecutiveCharLength) { longestConsecutiveCharLength = currConsecutiveCharLength; } - firstConsecutiveCharIndex = i; } - if (isSequenceAscending) { const currConsecutiveCharLength = password.length - firstConsecutiveCharIndex; - if (currConsecutiveCharLength > longestConsecutiveCharLength) { longestConsecutiveCharLength = currConsecutiveCharLength; } } - return longestConsecutiveCharLength <= consecutiveCharLimit; } + /** * @param {string} password * @param {number} repeatedCharLimit * @returns {boolean} */ - - _passwordHasNotExceededRepeatedCharLimit(password, repeatedCharLimit) { let longestRepeatedCharLength = 1; let lastRepeatedChar = password.charAt(0); let lastRepeatedCharIndex = 0; - for (let i = 1; i < password.length; i++) { const currChar = password.charAt(i); - if (currChar === lastRepeatedChar) { continue; } - const currRepeatedCharLength = i - lastRepeatedCharIndex; - if (currRepeatedCharLength > longestRepeatedCharLength) { longestRepeatedCharLength = currRepeatedCharLength; } - lastRepeatedChar = currChar; lastRepeatedCharIndex = i; } - return longestRepeatedCharLength <= repeatedCharLimit; } + /** * @param {string} password * @param {string[]} requiredCharacterSets * @returns {boolean} */ - - _passwordContainsRequiredCharacters(password, requiredCharacterSets) { const requiredCharacterSetsLength = requiredCharacterSets.length; const passwordLength = password.length; - for (let i = 0; i < requiredCharacterSetsLength; i++) { const requiredCharacterSet = requiredCharacterSets[i]; let hasRequiredChar = false; - for (let j = 0; j < passwordLength; j++) { const char = password.charAt(j); - if (requiredCharacterSet.indexOf(char) !== -1) { hasRequiredChar = true; break; } } - if (!hasRequiredChar) { return false; } } - return true; } + /** * @param {string} string1 * @param {string} string2 * @returns {boolean} */ - - _stringsHaveAtLeastOneCommonCharacter(string1, string2) { const string2Length = string2.length; - for (let i = 0; i < string2Length; i++) { const char = string2.charAt(i); - if (string1.indexOf(char) !== -1) { return true; } } - return false; } + /** * @param {Requirements} requirements * @returns {PasswordParameters} */ - - _passwordGenerationParametersDictionary(requirements) { let minPasswordLength = requirements.PasswordMinLength; - const maxPasswordLength = requirements.PasswordMaxLength; // @ts-ignore + const maxPasswordLength = requirements.PasswordMaxLength; + // @ts-ignore if (minPasswordLength > maxPasswordLength) { // Resetting invalid value of min length to zero means "ignore min length parameter in password generation". minPasswordLength = 0; } - const requiredCharacterArray = requirements.PasswordRequiredCharacters; let allowedCharacters = requirements.PasswordAllowedCharacters; let requiredCharacterSets = this.options.defaultRequiredCharacterSets; - if (requiredCharacterArray) { const mutatedRequiredCharacterSets = []; const requiredCharacterArrayLength = requiredCharacterArray.length; - for (let i = 0; i < requiredCharacterArrayLength; i++) { const requiredCharacters = requiredCharacterArray[i]; - if (allowedCharacters && this._stringsHaveAtLeastOneCommonCharacter(requiredCharacters, allowedCharacters)) { mutatedRequiredCharacterSets.push(requiredCharacters); } } - requiredCharacterSets = mutatedRequiredCharacterSets; - } // If requirements allow, we will generateOrThrow the password in default format: "xxx-xxx-xxx-xxx". - + } + // If requirements allow, we will generateOrThrow the password in default format: "xxx-xxx-xxx-xxx". let numberOfRequiredRandomCharacters = this.options.defaultPasswordLength; - if (minPasswordLength && minPasswordLength > numberOfRequiredRandomCharacters) { numberOfRequiredRandomCharacters = minPasswordLength; } - if (maxPasswordLength && maxPasswordLength < numberOfRequiredRandomCharacters) { numberOfRequiredRandomCharacters = maxPasswordLength; } - if (!allowedCharacters) { allowedCharacters = this.options.defaultUnambiguousCharacters; - } // In default password format, we use dashes only as separators, not as symbols you can encounter at a random position. + } + // In default password format, we use dashes only as separators, not as symbols you can encounter at a random position. if (!requiredCharacterSets) { requiredCharacterSets = this.options.defaultRequiredCharacterSets; - } // If we have more requirements of the type "need a character from set" than the length of the password we want to generateOrThrow, then + } + + // If we have more requirements of the type "need a character from set" than the length of the password we want to generateOrThrow, then // we will never be able to meet these requirements, and we'll end up in an infinite loop generating passwords. To avoid this, // reset required character sets if the requirements are impossible to meet. - - if (requiredCharacterSets.length > numberOfRequiredRandomCharacters) { requiredCharacterSets = []; - } // Do not require any character sets that do not contain allowed characters. - + } + // Do not require any character sets that do not contain allowed characters. const requiredCharacterSetsLength = requiredCharacterSets.length; const mutatedRequiredCharacterSets = []; const allowedCharactersLength = allowedCharacters.length; - for (let i = 0; i < requiredCharacterSetsLength; i++) { const requiredCharacterSet = requiredCharacterSets[i]; let requiredCharacterSetContainsAllowedCharacters = false; - for (let j = 0; j < allowedCharactersLength; j++) { const character = allowedCharacters.charAt(j); - if (requiredCharacterSet.indexOf(character) !== -1) { requiredCharacterSetContainsAllowedCharacters = true; break; } } - if (requiredCharacterSetContainsAllowedCharacters) { mutatedRequiredCharacterSets.push(requiredCharacterSet); } } - requiredCharacterSets = mutatedRequiredCharacterSets; return { NumberOfRequiredRandomCharacters: numberOfRequiredRandomCharacters, @@ -5440,13 +5504,12 @@ class Password { RequiredCharacterSets: requiredCharacterSets }; } + /** * @param {Requirements | null} requirements * @param {PasswordParameters} [parameters] * @returns {string} */ - - _generatedPasswordMatchingRequirements(requirements, parameters) { requirements = requirements || {}; parameters = parameters || this._passwordGenerationParametersDictionary(requirements); @@ -5454,112 +5517,86 @@ class Password { const repeatedCharLimit = requirements.PasswordRepeatedCharacterLimit; const allowedCharacters = parameters.PasswordAllowedCharacters; const shouldCheckRepeatedCharRequirement = !!repeatedCharLimit; - while (true) { const password = this._classicPassword(numberOfRequiredRandomCharacters, allowedCharacters); - if (!this._passwordContainsRequiredCharacters(password, parameters.RequiredCharacterSets)) { continue; } - if (shouldCheckRepeatedCharRequirement) { if (repeatedCharLimit !== undefined && repeatedCharLimit >= 1 && !this._passwordHasNotExceededRepeatedCharLimit(password, repeatedCharLimit)) { continue; } } - const consecutiveCharLimit = requirements.PasswordConsecutiveCharacterLimit; - if (consecutiveCharLimit && consecutiveCharLimit >= 1) { if (!this._passwordHasNotExceededConsecutiveCharLimit(password, consecutiveCharLimit)) { continue; } } - return password || ''; } } + /** * @param {parser.CustomCharacterClass | parser.NamedCharacterClass} characterClass * @returns {string[]} */ - - _scanSetFromCharacterClass(characterClass) { if (characterClass instanceof parser.CustomCharacterClass) { return characterClass.characters; } - console.assert(characterClass instanceof parser.NamedCharacterClass); - switch (characterClass.name) { case parser.Identifier.ASCII_PRINTABLE: case parser.Identifier.UNICODE: return this.options.SCAN_SET_ORDER.split(''); - case parser.Identifier.DIGIT: return this.options.SCAN_SET_ORDER.substring(this.options.SCAN_SET_ORDER.indexOf('0'), this.options.SCAN_SET_ORDER.indexOf('9') + 1).split(''); - case parser.Identifier.LOWER: return this.options.SCAN_SET_ORDER.substring(this.options.SCAN_SET_ORDER.indexOf('a'), this.options.SCAN_SET_ORDER.indexOf('z') + 1).split(''); - case parser.Identifier.SPECIAL: return this.options.SCAN_SET_ORDER.substring(this.options.SCAN_SET_ORDER.indexOf('-'), this.options.SCAN_SET_ORDER.indexOf(']') + 1).split(''); - case parser.Identifier.UPPER: return this.options.SCAN_SET_ORDER.substring(this.options.SCAN_SET_ORDER.indexOf('A'), this.options.SCAN_SET_ORDER.indexOf('Z') + 1).split(''); } - console.assert(false, parser.SHOULD_NOT_BE_REACHED); return []; } + /** * @param {(parser.CustomCharacterClass | parser.NamedCharacterClass)[]} characterClasses */ - - _charactersFromCharactersClasses(characterClasses) { const output = []; - for (let characterClass of characterClasses) { output.push(...this._scanSetFromCharacterClass(characterClass)); } - return output; } + /** * @param {string[]} characters * @returns {string} */ - - _canonicalizedScanSetFromCharacters(characters) { if (!characters.length) { return ''; } - let shadowCharacters = Array.prototype.slice.call(characters); shadowCharacters.sort((a, b) => this.options.SCAN_SET_ORDER.indexOf(a) - this.options.SCAN_SET_ORDER.indexOf(b)); let uniqueCharacters = [shadowCharacters[0]]; - for (let i = 1, length = shadowCharacters.length; i < length; ++i) { if (shadowCharacters[i] === shadowCharacters[i - 1]) { continue; } - uniqueCharacters.push(shadowCharacters[i]); } - return uniqueCharacters.join(''); } - } - exports.Password = Password; -_defineProperty(Password, "defaults", defaults); - -},{"./constants.js":17,"./rules-parser.js":18}],17:[function(require,module,exports){ +},{"./constants.js":19,"./rules-parser.js":20}],19:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { @@ -5570,17 +5607,16 @@ const DEFAULT_MIN_LENGTH = 20; const DEFAULT_MAX_LENGTH = 30; const DEFAULT_REQUIRED_CHARS = '-!?$&#%'; const DEFAULT_UNAMBIGUOUS_CHARS = 'abcdefghijkmnopqrstuvwxyzABCDEFGHIJKLMNPQRSTUVWXYZ0123456789'; -const DEFAULT_PASSWORD_RULES = ["minlength: ".concat(DEFAULT_MIN_LENGTH), "maxlength: ".concat(DEFAULT_MAX_LENGTH), "required: [".concat(DEFAULT_REQUIRED_CHARS, "]"), "allowed: [".concat(DEFAULT_UNAMBIGUOUS_CHARS, "]")].join('; '); -const constants = { +const DEFAULT_PASSWORD_RULES = [`minlength: ${DEFAULT_MIN_LENGTH}`, `maxlength: ${DEFAULT_MAX_LENGTH}`, `required: [${DEFAULT_REQUIRED_CHARS}]`, `allowed: [${DEFAULT_UNAMBIGUOUS_CHARS}]`].join('; '); +const constants = exports.constants = { DEFAULT_MIN_LENGTH, DEFAULT_MAX_LENGTH, DEFAULT_PASSWORD_RULES, DEFAULT_REQUIRED_CHARS, DEFAULT_UNAMBIGUOUS_CHARS }; -exports.constants = constants; -},{}],18:[function(require,module,exports){ +},{}],20:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { @@ -5604,7 +5640,8 @@ exports.parsePasswordRules = parsePasswordRules; * ^ the default implementation still returns a base-line ruleset, which we didn't want. * */ -const Identifier = { + +const Identifier = exports.Identifier = { ASCII_PRINTABLE: 'ascii-printable', DIGIT: 'digit', LOWER: 'lower', @@ -5612,131 +5649,106 @@ const Identifier = { UNICODE: 'unicode', UPPER: 'upper' }; -exports.Identifier = Identifier; -const RuleName = { +const RuleName = exports.RuleName = { ALLOWED: 'allowed', MAX_CONSECUTIVE: 'max-consecutive', REQUIRED: 'required', MIN_LENGTH: 'minlength', MAX_LENGTH: 'maxlength' }; -exports.RuleName = RuleName; const CHARACTER_CLASS_START_SENTINEL = '['; const CHARACTER_CLASS_END_SENTINEL = ']'; const PROPERTY_VALUE_SEPARATOR = ','; const PROPERTY_SEPARATOR = ';'; const PROPERTY_VALUE_START_SENTINEL = ':'; const SPACE_CODE_POINT = ' '.codePointAt(0); -const SHOULD_NOT_BE_REACHED = 'Should not be reached'; -exports.SHOULD_NOT_BE_REACHED = SHOULD_NOT_BE_REACHED; - +const SHOULD_NOT_BE_REACHED = exports.SHOULD_NOT_BE_REACHED = 'Should not be reached'; class Rule { constructor(name, value) { this._name = name; this.value = value; } - get name() { return this._name; } - toString() { return JSON.stringify(this); } - } - exports.Rule = Rule; ; - class NamedCharacterClass { constructor(name) { console.assert(_isValidRequiredOrAllowedPropertyValueIdentifier(name)); this._name = name; } - get name() { return this._name.toLowerCase(); } - toString() { return this._name; } - toHTMLString() { return this._name; } - } - exports.NamedCharacterClass = NamedCharacterClass; ; - class ParserError extends Error {} - exports.ParserError = ParserError; ; - class CustomCharacterClass { constructor(characters) { console.assert(characters instanceof Array); this._characters = characters; } - get characters() { return this._characters; } - toString() { - return "[".concat(this._characters.join(''), "]"); + return `[${this._characters.join('')}]`; } - toHTMLString() { - return "[".concat(this._characters.join('').replace('"', '"'), "]"); + return `[${this._characters.join('').replace('"', '"')}]`; } - } - exports.CustomCharacterClass = CustomCharacterClass; -; // MARK: Lexer functions +; -function _isIdentifierCharacter(c) { - console.assert(c.length === 1); // eslint-disable-next-line no-mixed-operators +// MARK: Lexer functions +function _isIdentifierCharacter(c) { + console.assert(c.length === 1); + // eslint-disable-next-line no-mixed-operators return c >= 'a' && c <= 'z' || c >= 'A' && c <= 'Z' || c === '-'; } - function _isASCIIDigit(c) { console.assert(c.length === 1); return c >= '0' && c <= '9'; } - function _isASCIIPrintableCharacter(c) { console.assert(c.length === 1); return c >= ' ' && c <= '~'; } - function _isASCIIWhitespace(c) { console.assert(c.length === 1); return c === ' ' || c === '\f' || c === '\n' || c === '\r' || c === '\t'; -} // MARK: ASCII printable character bit set and canonicalization functions +} +// MARK: ASCII printable character bit set and canonicalization functions function _bitSetIndexForCharacter(c) { - console.assert(c.length === 1); // @ts-ignore - + console.assert(c.length === 1); + // @ts-ignore return c.codePointAt(0) - SPACE_CODE_POINT; } - function _characterAtBitSetIndex(index) { return String.fromCodePoint(index + SPACE_CODE_POINT); } - function _markBitsForNamedCharacterClass(bitSet, namedCharacterClass) { console.assert(bitSet instanceof Array); console.assert(namedCharacterClass.name !== Identifier.UNICODE); console.assert(namedCharacterClass.name !== Identifier.ASCII_PRINTABLE); - if (namedCharacterClass.name === Identifier.UPPER) { bitSet.fill(true, _bitSetIndexForCharacter('A'), _bitSetIndexForCharacter('Z') + 1); } else if (namedCharacterClass.name === Identifier.LOWER) { @@ -5752,223 +5764,176 @@ function _markBitsForNamedCharacterClass(bitSet, namedCharacterClass) { console.assert(false, SHOULD_NOT_BE_REACHED, namedCharacterClass); } } - function _markBitsForCustomCharacterClass(bitSet, customCharacterClass) { for (let character of customCharacterClass.characters) { bitSet[_bitSetIndexForCharacter(character)] = true; } } - function _canonicalizedPropertyValues(propertyValues, keepCustomCharacterClassFormatCompliant) { // @ts-ignore let asciiPrintableBitSet = new Array('~'.codePointAt(0) - ' '.codePointAt(0) + 1); - for (let propertyValue of propertyValues) { if (propertyValue instanceof NamedCharacterClass) { if (propertyValue.name === Identifier.UNICODE) { return [new NamedCharacterClass(Identifier.UNICODE)]; } - if (propertyValue.name === Identifier.ASCII_PRINTABLE) { return [new NamedCharacterClass(Identifier.ASCII_PRINTABLE)]; } - _markBitsForNamedCharacterClass(asciiPrintableBitSet, propertyValue); } else if (propertyValue instanceof CustomCharacterClass) { _markBitsForCustomCharacterClass(asciiPrintableBitSet, propertyValue); } } - let charactersSeen = []; - function checkRange(start, end) { let temp = []; - for (let i = _bitSetIndexForCharacter(start); i <= _bitSetIndexForCharacter(end); ++i) { if (asciiPrintableBitSet[i]) { temp.push(_characterAtBitSetIndex(i)); } } - let result = temp.length === _bitSetIndexForCharacter(end) - _bitSetIndexForCharacter(start) + 1; - if (!result) { charactersSeen = charactersSeen.concat(temp); } - return result; } - let hasAllUpper = checkRange('A', 'Z'); let hasAllLower = checkRange('a', 'z'); - let hasAllDigits = checkRange('0', '9'); // Check for special characters, accounting for characters that are given special treatment (i.e. '-' and ']') + let hasAllDigits = checkRange('0', '9'); + // Check for special characters, accounting for characters that are given special treatment (i.e. '-' and ']') let hasAllSpecial = false; let hasDash = false; let hasRightSquareBracket = false; let temp = []; - for (let i = _bitSetIndexForCharacter(' '); i <= _bitSetIndexForCharacter('/'); ++i) { if (!asciiPrintableBitSet[i]) { continue; } - let character = _characterAtBitSetIndex(i); - if (keepCustomCharacterClassFormatCompliant && character === '-') { hasDash = true; } else { temp.push(character); } } - for (let i = _bitSetIndexForCharacter(':'); i <= _bitSetIndexForCharacter('@'); ++i) { if (asciiPrintableBitSet[i]) { temp.push(_characterAtBitSetIndex(i)); } } - for (let i = _bitSetIndexForCharacter('['); i <= _bitSetIndexForCharacter('`'); ++i) { if (!asciiPrintableBitSet[i]) { continue; } - let character = _characterAtBitSetIndex(i); - if (keepCustomCharacterClassFormatCompliant && character === ']') { hasRightSquareBracket = true; } else { temp.push(character); } } - for (let i = _bitSetIndexForCharacter('{'); i <= _bitSetIndexForCharacter('~'); ++i) { if (asciiPrintableBitSet[i]) { temp.push(_characterAtBitSetIndex(i)); } } - if (hasDash) { temp.unshift('-'); } - if (hasRightSquareBracket) { temp.push(']'); } - let numberOfSpecialCharacters = _bitSetIndexForCharacter('/') - _bitSetIndexForCharacter(' ') + 1 + (_bitSetIndexForCharacter('@') - _bitSetIndexForCharacter(':') + 1) + (_bitSetIndexForCharacter('`') - _bitSetIndexForCharacter('[') + 1) + (_bitSetIndexForCharacter('~') - _bitSetIndexForCharacter('{') + 1); hasAllSpecial = temp.length === numberOfSpecialCharacters; - if (!hasAllSpecial) { charactersSeen = charactersSeen.concat(temp); } - let result = []; - if (hasAllUpper && hasAllLower && hasAllDigits && hasAllSpecial) { return [new NamedCharacterClass(Identifier.ASCII_PRINTABLE)]; } - if (hasAllUpper) { result.push(new NamedCharacterClass(Identifier.UPPER)); } - if (hasAllLower) { result.push(new NamedCharacterClass(Identifier.LOWER)); } - if (hasAllDigits) { result.push(new NamedCharacterClass(Identifier.DIGIT)); } - if (hasAllSpecial) { result.push(new NamedCharacterClass(Identifier.SPECIAL)); } - if (charactersSeen.length) { result.push(new CustomCharacterClass(charactersSeen)); } - return result; -} // MARK: Parser functions +} +// MARK: Parser functions function _indexOfNonWhitespaceCharacter(input) { let position = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; console.assert(position >= 0); console.assert(position <= input.length); let length = input.length; - while (position < length && _isASCIIWhitespace(input[position])) { ++position; } - return position; } - function _parseIdentifier(input, position) { console.assert(position >= 0); console.assert(position < input.length); console.assert(_isIdentifierCharacter(input[position])); let length = input.length; let seenIdentifiers = []; - do { let c = input[position]; - if (!_isIdentifierCharacter(c)) { break; } - seenIdentifiers.push(c); ++position; } while (position < length); - return [seenIdentifiers.join(''), position]; } - function _isValidRequiredOrAllowedPropertyValueIdentifier(identifier) { return identifier && Object.values(Identifier).includes(identifier.toLowerCase()); } - function _parseCustomCharacterClass(input, position) { console.assert(position >= 0); console.assert(position < input.length); console.assert(input[position] === CHARACTER_CLASS_START_SENTINEL); let length = input.length; ++position; - if (position >= length) { // console.error('Found end-of-line instead of character class character') return [null, position]; } - let initialPosition = position; let result = []; - do { let c = input[position]; - if (!_isASCIIPrintableCharacter(c)) { ++position; continue; } - if (c === '-' && position - initialPosition > 0) { // FIXME: Should this be an error? console.warn("Ignoring '-'; a '-' may only appear as the first character in a character class"); ++position; continue; } - result.push(c); ++position; - if (c === CHARACTER_CLASS_END_SENTINEL) { break; } } while (position < length); - if (position < length && input[position] !== CHARACTER_CLASS_END_SENTINEL) { // Fix up result; we over consumed. result.pop(); @@ -5978,37 +5943,31 @@ function _parseCustomCharacterClass(input, position) { result.pop(); return [result, position]; } - if (position < length && input[position] === CHARACTER_CLASS_END_SENTINEL) { return [result, position + 1]; - } // console.error('Found end-of-line instead of end of character class') - + } + // console.error('Found end-of-line instead of end of character class') return [null, position]; } - function _parsePasswordRequiredOrAllowedPropertyValue(input, position) { console.assert(position >= 0); console.assert(position < input.length); let length = input.length; let propertyValues = []; - while (true) { if (_isIdentifierCharacter(input[position])) { - let identifierStartPosition = position; // eslint-disable-next-line no-redeclare - + let identifierStartPosition = position; + // eslint-disable-next-line no-redeclare var [propertyValue, position] = _parseIdentifier(input, position); - if (!_isValidRequiredOrAllowedPropertyValueIdentifier(propertyValue)) { // console.error('Unrecognized property value identifier: ' + propertyValue) return [null, identifierStartPosition]; } - propertyValues.push(new NamedCharacterClass(propertyValue)); } else if (input[position] === CHARACTER_CLASS_START_SENTINEL) { // eslint-disable-next-line no-redeclare var [propertyValue, position] = _parseCustomCharacterClass(input, position); - if (propertyValue && propertyValue.length) { propertyValues.push(new CustomCharacterClass(propertyValue)); } @@ -6016,304 +5975,244 @@ function _parsePasswordRequiredOrAllowedPropertyValue(input, position) { // console.error('Failed to find start of property value: ' + input.substr(position)) return [null, position]; } - position = _indexOfNonWhitespaceCharacter(input, position); - if (position >= length || input[position] === PROPERTY_SEPARATOR) { break; } - if (input[position] === PROPERTY_VALUE_SEPARATOR) { position = _indexOfNonWhitespaceCharacter(input, position + 1); - if (position >= length) { // console.error('Found end-of-line instead of start of next property value') return [null, position]; } - continue; - } // console.error('Failed to find start of next property or property value: ' + input.substr(position)) - + } + // console.error('Failed to find start of next property or property value: ' + input.substr(position)) return [null, position]; } - return [propertyValues, position]; } + /** * @param input * @param position * @returns {[Rule|null, number, string|undefined]} * @private */ - - function _parsePasswordRule(input, position) { console.assert(position >= 0); console.assert(position < input.length); console.assert(_isIdentifierCharacter(input[position])); let length = input.length; - var mayBeIdentifierStartPosition = position; // eslint-disable-next-line no-redeclare - + var mayBeIdentifierStartPosition = position; + // eslint-disable-next-line no-redeclare var [identifier, position] = _parseIdentifier(input, position); - if (!Object.values(RuleName).includes(identifier)) { // console.error('Unrecognized property name: ' + identifier) return [null, mayBeIdentifierStartPosition, undefined]; } - if (position >= length) { // console.error('Found end-of-line instead of start of property value') return [null, position, undefined]; } - if (input[position] !== PROPERTY_VALUE_START_SENTINEL) { // console.error('Failed to find start of property value: ' + input.substr(position)) return [null, position, undefined]; } - let property = { name: identifier, value: null }; - position = _indexOfNonWhitespaceCharacter(input, position + 1); // Empty value - + position = _indexOfNonWhitespaceCharacter(input, position + 1); + // Empty value if (position >= length || input[position] === PROPERTY_SEPARATOR) { return [new Rule(property.name, property.value), position, undefined]; } - switch (identifier) { case RuleName.ALLOWED: case RuleName.REQUIRED: { // eslint-disable-next-line no-redeclare var [propertyValue, position] = _parsePasswordRequiredOrAllowedPropertyValue(input, position); - if (propertyValue) { property.value = propertyValue; } - return [new Rule(property.name, property.value), position, undefined]; } - case RuleName.MAX_CONSECUTIVE: { // eslint-disable-next-line no-redeclare var [propertyValue, position] = _parseMaxConsecutivePropertyValue(input, position); - if (propertyValue) { property.value = propertyValue; } - return [new Rule(property.name, property.value), position, undefined]; } - case RuleName.MIN_LENGTH: case RuleName.MAX_LENGTH: { // eslint-disable-next-line no-redeclare var [propertyValue, position] = _parseMinLengthMaxLengthPropertyValue(input, position); - if (propertyValue) { property.value = propertyValue; } - return [new Rule(property.name, property.value), position, undefined]; } } - console.assert(false, SHOULD_NOT_BE_REACHED); return [null, -1, undefined]; } - function _parseMinLengthMaxLengthPropertyValue(input, position) { return _parseInteger(input, position); } - function _parseMaxConsecutivePropertyValue(input, position) { return _parseInteger(input, position); } - function _parseInteger(input, position) { console.assert(position >= 0); console.assert(position < input.length); - if (!_isASCIIDigit(input[position])) { // console.error('Failed to parse value of type integer; not a number: ' + input.substr(position)) return [null, position]; } - - let length = input.length; // let initialPosition = position - + let length = input.length; + // let initialPosition = position let result = 0; - do { result = 10 * result + parseInt(input[position], 10); ++position; } while (position < length && input[position] !== PROPERTY_SEPARATOR && _isASCIIDigit(input[position])); - if (position >= length || input[position] === PROPERTY_SEPARATOR) { return [result, position]; - } // console.error('Failed to parse value of type integer; not a number: ' + input.substr(initialPosition)) - + } + // console.error('Failed to parse value of type integer; not a number: ' + input.substr(initialPosition)) return [null, position]; } + /** * @param input * @returns {[Rule[]|null, string|undefined]} * @private */ - - function _parsePasswordRulesInternal(input) { let parsedProperties = []; let length = input.length; - var position = _indexOfNonWhitespaceCharacter(input); - while (position < length) { if (!_isIdentifierCharacter(input[position])) { // console.warn('Failed to find start of property: ' + input.substr(position)) return [parsedProperties, undefined]; - } // eslint-disable-next-line no-redeclare - + } + // eslint-disable-next-line no-redeclare var [parsedProperty, position, message] = _parsePasswordRule(input, position); - if (parsedProperty && parsedProperty.value) { parsedProperties.push(parsedProperty); } - position = _indexOfNonWhitespaceCharacter(input, position); - if (position >= length) { break; } - if (input[position] === PROPERTY_SEPARATOR) { position = _indexOfNonWhitespaceCharacter(input, position + 1); - if (position >= length) { return [parsedProperties, undefined]; } - continue; - } // console.error('Failed to find start of next property: ' + input.substr(position)) - + } + // console.error('Failed to find start of next property: ' + input.substr(position)) return [null, message || 'Failed to find start of next property: ' + input.substr(position)]; } - return [parsedProperties, undefined]; } + /** * @param {string} input * @param {boolean} [formatRulesForMinifiedVersion] * @returns {Rule[]} */ - - function parsePasswordRules(input, formatRulesForMinifiedVersion) { let [passwordRules, maybeMessage] = _parsePasswordRulesInternal(input); - if (!passwordRules) { throw new ParserError(maybeMessage); } - if (passwordRules.length === 0) { throw new ParserError('No valid rules were provided'); - } // When formatting rules for minified version, we should keep the formatted rules - // as similar to the input as possible. Avoid copying required rules to allowed rules. - + } + // When formatting rules for minified version, we should keep the formatted rules + // as similar to the input as possible. Avoid copying required rules to allowed rules. let suppressCopyingRequiredToAllowed = formatRulesForMinifiedVersion; let requiredRules = []; let newAllowedValues = []; let minimumMaximumConsecutiveCharacters = null; let maximumMinLength = 0; let minimumMaxLength = null; - for (let rule of passwordRules) { switch (rule.name) { case RuleName.MAX_CONSECUTIVE: minimumMaximumConsecutiveCharacters = minimumMaximumConsecutiveCharacters ? Math.min(rule.value, minimumMaximumConsecutiveCharacters) : rule.value; break; - case RuleName.MIN_LENGTH: maximumMinLength = Math.max(rule.value, maximumMinLength); break; - case RuleName.MAX_LENGTH: minimumMaxLength = minimumMaxLength ? Math.min(rule.value, minimumMaxLength) : rule.value; break; - case RuleName.REQUIRED: rule.value = _canonicalizedPropertyValues(rule.value, formatRulesForMinifiedVersion); requiredRules.push(rule); - if (!suppressCopyingRequiredToAllowed) { newAllowedValues = newAllowedValues.concat(rule.value); } - break; - case RuleName.ALLOWED: newAllowedValues = newAllowedValues.concat(rule.value); break; } } - let newPasswordRules = []; - if (maximumMinLength > 0) { newPasswordRules.push(new Rule(RuleName.MIN_LENGTH, maximumMinLength)); } - if (minimumMaxLength !== null) { newPasswordRules.push(new Rule(RuleName.MAX_LENGTH, minimumMaxLength)); } - if (minimumMaximumConsecutiveCharacters !== null) { newPasswordRules.push(new Rule(RuleName.MAX_CONSECUTIVE, minimumMaximumConsecutiveCharacters)); } - let sortedRequiredRules = requiredRules.sort(function (a, b) { const namedCharacterClassOrder = [Identifier.LOWER, Identifier.UPPER, Identifier.DIGIT, Identifier.SPECIAL, Identifier.ASCII_PRINTABLE, Identifier.UNICODE]; let aIsJustOneNamedCharacterClass = a.value.length === 1 && a.value[0] instanceof NamedCharacterClass; let bIsJustOneNamedCharacterClass = b.value.length === 1 && b.value[0] instanceof NamedCharacterClass; - if (aIsJustOneNamedCharacterClass && !bIsJustOneNamedCharacterClass) { return -1; } - if (!aIsJustOneNamedCharacterClass && bIsJustOneNamedCharacterClass) { return 1; } - if (aIsJustOneNamedCharacterClass && bIsJustOneNamedCharacterClass) { let aIndex = namedCharacterClassOrder.indexOf(a.value[0].name); let bIndex = namedCharacterClassOrder.indexOf(b.value[0].name); return aIndex - bIndex; } - return 0; }); newPasswordRules = newPasswordRules.concat(sortedRequiredRules); newAllowedValues = _canonicalizedPropertyValues(newAllowedValues, suppressCopyingRequiredToAllowed); - if (!suppressCopyingRequiredToAllowed && !newAllowedValues.length) { newAllowedValues = [new NamedCharacterClass(Identifier.ASCII_PRINTABLE)]; } - if (newAllowedValues.length) { newPasswordRules.push(new Rule(RuleName.ALLOWED, newAllowedValues)); } - return newPasswordRules; } -},{}],19:[function(require,module,exports){ +},{}],21:[function(require,module,exports){ module.exports={ "163.com": { "password-rules": "minlength: 6; maxlength: 16;" @@ -7144,42 +7043,31 @@ module.exports={ "password-rules": "minlength: 8; maxlength: 32; max-consecutive: 6; required: lower; required: upper; required: digit;" } } -},{}],20:[function(require,module,exports){ +},{}],22:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.createDevice = createDevice; - var _config = require("./config.js"); - var _AndroidInterface = require("./DeviceInterface/AndroidInterface.js"); - var _ExtensionInterface = require("./DeviceInterface/ExtensionInterface.js"); - var _AppleDeviceInterface = require("./DeviceInterface/AppleDeviceInterface.js"); - var _AppleOverlayDeviceInterface = require("./DeviceInterface/AppleOverlayDeviceInterface.js"); - var _transports = require("./deviceApiCalls/transports/transports.js"); - var _index = require("../packages/device-api/index.js"); - var _Settings = require("./Settings.js"); - var _WindowsInterface = require("./DeviceInterface/WindowsInterface.js"); - var _WindowsOverlayDeviceInterface = require("./DeviceInterface/WindowsOverlayDeviceInterface.js"); - function createDevice() { const globalConfig = (0, _config.createGlobalConfig)(); const transport = (0, _transports.createTransport)(globalConfig); + /** * A wrapper around transports to assist in debugging/integrations * @type {import("../packages/device-api").DeviceApiTransport} */ - const loggingTransport = { async send(deviceApiCall) { console.log('[->outgoing]', 'id:', deviceApiCall.method, deviceApiCall.params || null); @@ -7187,63 +7075,50 @@ function createDevice() { console.log('[<-incoming]', 'id:', deviceApiCall.method, result || null); return result; } + }; - }; // Create the DeviceAPI + Setting - + // Create the DeviceAPI + Setting let deviceApi = new _index.DeviceApi(globalConfig.isDDGTestMode ? loggingTransport : transport); const settings = new _Settings.Settings(globalConfig, deviceApi); - if (globalConfig.isWindows) { if (globalConfig.isTopFrame) { return new _WindowsOverlayDeviceInterface.WindowsOverlayDeviceInterface(globalConfig, deviceApi, settings); } - return new _WindowsInterface.WindowsInterface(globalConfig, deviceApi, settings); } - if (globalConfig.isDDGApp) { if (globalConfig.isAndroid) { return new _AndroidInterface.AndroidInterface(globalConfig, deviceApi, settings); } - if (globalConfig.isTopFrame) { return new _AppleOverlayDeviceInterface.AppleOverlayDeviceInterface(globalConfig, deviceApi, settings); } - return new _AppleDeviceInterface.AppleDeviceInterface(globalConfig, deviceApi, settings); } - globalConfig.isExtension = true; return new _ExtensionInterface.ExtensionInterface(globalConfig, deviceApi, settings); } -},{"../packages/device-api/index.js":10,"./DeviceInterface/AndroidInterface.js":21,"./DeviceInterface/AppleDeviceInterface.js":22,"./DeviceInterface/AppleOverlayDeviceInterface.js":23,"./DeviceInterface/ExtensionInterface.js":24,"./DeviceInterface/WindowsInterface.js":26,"./DeviceInterface/WindowsOverlayDeviceInterface.js":27,"./Settings.js":48,"./config.js":61,"./deviceApiCalls/transports/transports.js":69}],21:[function(require,module,exports){ +},{"../packages/device-api/index.js":12,"./DeviceInterface/AndroidInterface.js":23,"./DeviceInterface/AppleDeviceInterface.js":24,"./DeviceInterface/AppleOverlayDeviceInterface.js":25,"./DeviceInterface/ExtensionInterface.js":26,"./DeviceInterface/WindowsInterface.js":28,"./DeviceInterface/WindowsOverlayDeviceInterface.js":29,"./Settings.js":50,"./config.js":63,"./deviceApiCalls/transports/transports.js":71}],23:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.AndroidInterface = void 0; - var _InterfacePrototype = _interopRequireDefault(require("./InterfacePrototype.js")); - var _autofillUtils = require("../autofill-utils.js"); - var _NativeUIController = require("../UI/controllers/NativeUIController.js"); - var _appleUtils = require("@duckduckgo/content-scope-scripts/src/apple-utils"); - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - class AndroidInterface extends _InterfacePrototype.default { async isEnabled() { return (0, _autofillUtils.autofillEnabled)(this.globalConfig, _appleUtils.processConfig); } + /** * @returns {Promise} */ - - async getAlias() { const { alias @@ -7252,47 +7127,40 @@ class AndroidInterface extends _InterfacePrototype.default { }, 'getAliasResponse'); return alias; } + /** * @override */ - - createUIController() { return new _NativeUIController.NativeUIController(); } + /** * @deprecated use `this.settings.availableInputTypes.email` in the future * @returns {boolean} */ - - isDeviceSignedIn() { - var _this$globalConfig$av; - // on DDG domains, always check via `window.EmailInterface.isSignedIn()` if (this.globalConfig.isDDGDomain) { return window.EmailInterface.isSignedIn() === 'true'; - } // on non-DDG domains, where `availableInputTypes.email` is present, use it - + } - if (typeof ((_this$globalConfig$av = this.globalConfig.availableInputTypes) === null || _this$globalConfig$av === void 0 ? void 0 : _this$globalConfig$av.email) === 'boolean') { + // on non-DDG domains, where `availableInputTypes.email` is present, use it + if (typeof this.globalConfig.availableInputTypes?.email === 'boolean') { return this.globalConfig.availableInputTypes.email; - } // ...on other domains we assume true because the script wouldn't exist otherwise - + } + // ...on other domains we assume true because the script wouldn't exist otherwise return true; } - async setupAutofill() {} + /** * Used by the email web app * Settings page displays data of the logged in user data */ - - getUserData() { let userData = null; - try { userData = JSON.parse(window.EmailInterface.getUserData()); } catch (e) { @@ -7300,18 +7168,15 @@ class AndroidInterface extends _InterfacePrototype.default { console.error(e); } } - return Promise.resolve(userData); } + /** * Used by the email web app * Device capabilities determine which functionality is available to the user */ - - getEmailProtectionCapabilities() { let deviceCapabilities = null; - try { deviceCapabilities = JSON.parse(window.EmailInterface.getDeviceCapabilities()); } catch (e) { @@ -7319,10 +7184,8 @@ class AndroidInterface extends _InterfacePrototype.default { console.error(e); } } - return Promise.resolve(deviceCapabilities); } - storeUserData(_ref) { let { addUserData: { @@ -7333,12 +7196,11 @@ class AndroidInterface extends _InterfacePrototype.default { } = _ref; return window.EmailInterface.storeCredentials(token, userName, cohort); } + /** * Used by the email web app * Provides functionality to log the user out */ - - removeUserData() { try { return window.EmailInterface.removeCredentials(); @@ -7348,7 +7210,6 @@ class AndroidInterface extends _InterfacePrototype.default { } } } - addLogoutListener(handler) { // Only deal with logging out if we're in the email web app if (!this.globalConfig.isDDGDomain) return; @@ -7358,68 +7219,45 @@ class AndroidInterface extends _InterfacePrototype.default { } }); } - /** Noop */ - + /** Noop */ firePixel(_pixelParam) {} - } - exports.AndroidInterface = AndroidInterface; -},{"../UI/controllers/NativeUIController.js":54,"../autofill-utils.js":59,"./InterfacePrototype.js":25,"@duckduckgo/content-scope-scripts/src/apple-utils":1}],22:[function(require,module,exports){ +},{"../UI/controllers/NativeUIController.js":56,"../autofill-utils.js":61,"./InterfacePrototype.js":27,"@duckduckgo/content-scope-scripts/src/apple-utils":1}],24:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.AppleDeviceInterface = void 0; - var _InterfacePrototype = _interopRequireDefault(require("./InterfacePrototype.js")); - var _autofillUtils = require("../autofill-utils.js"); - var _appleUtils = require("@duckduckgo/content-scope-scripts/src/apple-utils"); - var _HTMLTooltip = require("../UI/HTMLTooltip.js"); - var _HTMLTooltipUIController = require("../UI/controllers/HTMLTooltipUIController.js"); - var _OverlayUIController = require("../UI/controllers/OverlayUIController.js"); - var _index = require("../../packages/device-api/index.js"); - var _additionalDeviceApiCalls = require("../deviceApiCalls/additionalDeviceApiCalls.js"); - var _NativeUIController = require("../UI/controllers/NativeUIController.js"); - var _deviceApiCalls = require("../deviceApiCalls/__generated__/deviceApiCalls.js"); - var _matching = require("../Form/matching.js"); - var _InContextSignup = require("../InContextSignup.js"); - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - /** * @typedef {import('../deviceApiCalls/__generated__/validators-ts').GetAutofillDataRequest} GetAutofillDataRequest */ -class AppleDeviceInterface extends _InterfacePrototype.default { - constructor() { - super(...arguments); - - _defineProperty(this, "inContextSignup", new _InContextSignup.InContextSignup(this)); - - _defineProperty(this, "initialSetupDelayMs", 300); - _defineProperty(this, "pollingTimeout", null); - } +class AppleDeviceInterface extends _InterfacePrototype.default { + inContextSignup = new _InContextSignup.InContextSignup(this); + /** @override */ + initialSetupDelayMs = 300; async isEnabled() { return (0, _autofillUtils.autofillEnabled)(this.globalConfig, _appleUtils.processConfig); } + /** * The default functionality of this class is to operate as an 'overlay controller' - * which means it's purpose is to message the native layer about when to open/close the overlay. @@ -7431,17 +7269,13 @@ class AppleDeviceInterface extends _InterfacePrototype.default { * @override * @returns {import("../UI/controllers/UIController.js").UIController} */ - - createUIController() { - var _this$globalConfig$us, _this$globalConfig$us2; - - if (((_this$globalConfig$us = this.globalConfig.userPreferences) === null || _this$globalConfig$us === void 0 ? void 0 : (_this$globalConfig$us2 = _this$globalConfig$us.platform) === null || _this$globalConfig$us2 === void 0 ? void 0 : _this$globalConfig$us2.name) === 'ios') { + if (this.globalConfig.userPreferences?.platform?.name === 'ios') { return new _NativeUIController.NativeUIController(); } - if (!this.globalConfig.supportsTopFrame) { - const options = { ..._HTMLTooltip.defaultOptions, + const options = { + ..._HTMLTooltip.defaultOptions, testMode: this.isTestMode() }; return new _HTMLTooltipUIController.HTMLTooltipUIController({ @@ -7449,16 +7283,16 @@ class AppleDeviceInterface extends _InterfacePrototype.default { tooltipKind: 'modern' }, options); } + /** * If we get here, we're just a controller for an overlay */ - - return new _OverlayUIController.OverlayUIController({ remove: async () => this._closeAutofillParent(), show: async details => this._show(details) }); } + /** * For now, this could be running * 1) on iOS @@ -7468,78 +7302,67 @@ class AppleDeviceInterface extends _InterfacePrototype.default { * @override * @returns {Promise} */ - - async setupAutofill() { if (!this.globalConfig.supportsTopFrame) { await this._getAutofillInitData(); } - await this.inContextSignup.init(); const signedIn = await this._checkDeviceSignedIn(); - if (signedIn) { if (this.globalConfig.isApp) { await this.getAddresses(); } } } + /** * Used by the email web app * Settings page displays data of the logged in user data */ - - getUserData() { return this.deviceApi.request((0, _index.createRequest)('emailHandlerGetUserData')); } + /** * Used by the email web app * Device capabilities determine which functionality is available to the user */ - - getEmailProtectionCapabilities() { return this.deviceApi.request((0, _index.createRequest)('emailHandlerGetCapabilities')); } + /** */ - - async getSelectedCredentials() { return this.deviceApi.request((0, _index.createRequest)('getSelectedCredentials')); } + /** * The data format provided here for `parentArgs` matches Window now. * @param {GetAutofillDataRequest} parentArgs */ - - async _showAutofillParent(parentArgs) { - const applePayload = { ...parentArgs.triggerContext, + const applePayload = { + ...parentArgs.triggerContext, serializedInputContext: parentArgs.serializedInputContext }; return this.deviceApi.notify((0, _index.createNotification)('showAutofillParent', applePayload)); } + /** * @returns {Promise} */ - - async _closeAutofillParent() { return this.deviceApi.notify((0, _index.createNotification)('closeAutofillParent', {})); } + /** * @param {GetAutofillDataRequest} details */ - - async _show(details) { await this._showAutofillParent(details); - this._listenForSelectedCredential(async response => { if (!response) return; - if ('configType' in response) { this.selectedDetail(response.data, response.configType); } else if ('stop' in response) { @@ -7549,12 +7372,10 @@ class AppleDeviceInterface extends _InterfacePrototype.default { } }); } - async refreshData() { await super.refreshData(); await this._checkDeviceSignedIn(); } - async getAddresses() { if (!this.globalConfig.isApp) return this.getAlias(); const { @@ -7563,23 +7384,18 @@ class AppleDeviceInterface extends _InterfacePrototype.default { this.storeLocalAddresses(addresses); return addresses; } - async refreshAlias() { - await this.deviceApi.notify((0, _index.createNotification)('emailHandlerRefreshAlias')); // On macOS we also update the addresses stored locally - + await this.deviceApi.notify((0, _index.createNotification)('emailHandlerRefreshAlias')); + // On macOS we also update the addresses stored locally if (this.globalConfig.isApp) this.getAddresses(); } - async _checkDeviceSignedIn() { const { isAppSignedIn } = await this.deviceApi.request((0, _index.createRequest)('emailHandlerCheckAppSignedInStatus')); - this.isDeviceSignedIn = () => !!isAppSignedIn; - return !!isAppSignedIn; } - storeUserData(_ref) { let { addUserData: { @@ -7594,24 +7410,23 @@ class AppleDeviceInterface extends _InterfacePrototype.default { cohort })); } + /** * Used by the email web app * Provides functionality to log the user out */ - - removeUserData() { this.deviceApi.notify((0, _index.createNotification)('emailHandlerRemoveToken')); } + /** * Used by the email web app * Provides functionality to close the window after in-context sign-up or sign-in */ - - closeEmailProtection() { this.deviceApi.request(new _deviceApiCalls.CloseEmailProtectionTabCall(null)); } + /** * PM endpoints */ @@ -7620,91 +7435,79 @@ class AppleDeviceInterface extends _InterfacePrototype.default { * Gets the init data from the device * @returns {APIResponse} */ - - async _getAutofillInitData() { const response = await this.deviceApi.request((0, _index.createRequest)('pmHandlerGetAutofillInitData')); this.storeLocalData(response.success); return response; } + /** * Gets credentials ready for autofill * @param {CredentialsObject['id']} id - the credential id * @returns {APIResponseSingle} */ - - getAutofillCredentials(id) { return this.deviceApi.request((0, _index.createRequest)('pmHandlerGetAutofillCredentials', { id })); } + /** * Opens the native UI for managing passwords */ - - openManagePasswords() { return this.deviceApi.notify((0, _index.createNotification)('pmHandlerOpenManagePasswords')); } + /** * Opens the native UI for managing identities */ - - openManageIdentities() { return this.deviceApi.notify((0, _index.createNotification)('pmHandlerOpenManageIdentities')); } + /** * Opens the native UI for managing credit cards */ - - openManageCreditCards() { return this.deviceApi.notify((0, _index.createNotification)('pmHandlerOpenManageCreditCards')); } + /** * Gets a single identity obj once the user requests it * @param {IdentityObject['id']} id * @returns {Promise<{success: IdentityObject|undefined}>} */ - - getAutofillIdentity(id) { const identity = this.getLocalIdentities().find(_ref2 => { let { id: identityId } = _ref2; - return "".concat(identityId) === "".concat(id); + return `${identityId}` === `${id}`; }); return Promise.resolve({ success: identity }); } + /** * Gets a single complete credit card obj once the user requests it * @param {CreditCardObject['id']} id * @returns {APIResponse} */ - - getAutofillCreditCard(id) { return this.deviceApi.request((0, _index.createRequest)('pmHandlerGetCreditCard', { id })); } - getCurrentInputType() { - var _this$activeForm; - const topContextData = this.getTopContextData(); - return topContextData !== null && topContextData !== void 0 && topContextData.inputType ? topContextData.inputType : (0, _matching.getInputType)((_this$activeForm = this.activeForm) === null || _this$activeForm === void 0 ? void 0 : _this$activeForm.activeInput); + return topContextData?.inputType ? topContextData.inputType : (0, _matching.getInputType)(this.activeForm?.activeInput); } + /** * @returns {Promise} */ - - async getAlias() { const { alias @@ -7715,7 +7518,6 @@ class AppleDeviceInterface extends _InterfacePrototype.default { })); return alias ? (0, _autofillUtils.formatDuckAddress)(alias) : alias; } - addLogoutListener(handler) { // Only deal with logging out if we're in the email web app if (!this.globalConfig.isDDGDomain) return; @@ -7725,7 +7527,6 @@ class AppleDeviceInterface extends _InterfacePrototype.default { } }); } - async addDeviceListeners() { if (this.settings.featureToggles.third_party_credentials_provider) { if (this.globalConfig.hasModernWebkitAPI) { @@ -7742,17 +7543,15 @@ class AppleDeviceInterface extends _InterfacePrototype.default { setTimeout(() => this._pollForUpdatesToCredentialsProvider(), 2000); } } - } // Only used on Catalina - + } + // Only used on Catalina async _pollForUpdatesToCredentialsProvider() { try { const response = await this.deviceApi.request(new _deviceApiCalls.CheckCredentialsProviderStatusCall(null)); - if (response.availableInputTypes.credentialsProviderStatus !== this.settings.availableInputTypes.credentialsProviderStatus) { this.providerStatusUpdated(response); } - setTimeout(() => this._pollForUpdatesToCredentialsProvider(), 2000); } catch (e) { if (this.globalConfig.isDDGTestMode) { @@ -7760,9 +7559,9 @@ class AppleDeviceInterface extends _InterfacePrototype.default { } } } - /** @type {any} */ - + /** @type {any} */ + pollingTimeout = null; /** * Poll the native listener until the user has selected a credential. * Message return types are: @@ -7777,13 +7576,11 @@ class AppleDeviceInterface extends _InterfacePrototype.default { const poll = async () => { clearTimeout(this.pollingTimeout); const response = await this.getSelectedCredentials(); - switch (response.type) { case 'none': // Parent hasn't got a selected credential yet this.pollingTimeout = setTimeout(() => poll(), 100); return; - case 'ok': { await callback({ @@ -7792,7 +7589,6 @@ class AppleDeviceInterface extends _InterfacePrototype.default { }); return; } - case 'state': { // Inform that state has changed, but continue polling @@ -7803,7 +7599,6 @@ class AppleDeviceInterface extends _InterfacePrototype.default { this.pollingTimeout = setTimeout(() => poll(), 100); return; } - case 'stop': // Parent wants us to stop polling await callback({ @@ -7811,36 +7606,24 @@ class AppleDeviceInterface extends _InterfacePrototype.default { }); } }; - poll(); } - } - exports.AppleDeviceInterface = AppleDeviceInterface; -},{"../../packages/device-api/index.js":10,"../Form/matching.js":41,"../InContextSignup.js":42,"../UI/HTMLTooltip.js":52,"../UI/controllers/HTMLTooltipUIController.js":53,"../UI/controllers/NativeUIController.js":54,"../UI/controllers/OverlayUIController.js":55,"../autofill-utils.js":59,"../deviceApiCalls/__generated__/deviceApiCalls.js":63,"../deviceApiCalls/additionalDeviceApiCalls.js":65,"./InterfacePrototype.js":25,"@duckduckgo/content-scope-scripts/src/apple-utils":1}],23:[function(require,module,exports){ +},{"../../packages/device-api/index.js":12,"../Form/matching.js":43,"../InContextSignup.js":44,"../UI/HTMLTooltip.js":54,"../UI/controllers/HTMLTooltipUIController.js":55,"../UI/controllers/NativeUIController.js":56,"../UI/controllers/OverlayUIController.js":57,"../autofill-utils.js":61,"../deviceApiCalls/__generated__/deviceApiCalls.js":65,"../deviceApiCalls/additionalDeviceApiCalls.js":67,"./InterfacePrototype.js":27,"@duckduckgo/content-scope-scripts/src/apple-utils":1}],25:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.AppleOverlayDeviceInterface = void 0; - var _AppleDeviceInterface = require("./AppleDeviceInterface.js"); - var _HTMLTooltipUIController = require("../UI/controllers/HTMLTooltipUIController.js"); - var _overlayApi = require("./overlayApi.js"); - var _index = require("../../packages/device-api/index.js"); - var _deviceApiCalls = require("../deviceApiCalls/__generated__/deviceApiCalls.js"); - var _validatorsZod = require("../deviceApiCalls/__generated__/validators.zod.js"); - -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - /** * This subclass is designed to separate code that *only* runs inside the * Overlay into a single place. @@ -7849,17 +7632,18 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope * can be viewed as *not* executing within a regular page context. */ class AppleOverlayDeviceInterface extends _AppleDeviceInterface.AppleDeviceInterface { - constructor() { - super(...arguments); - - _defineProperty(this, "stripCredentials", false); - - _defineProperty(this, "overlay", (0, _overlayApi.overlayApi)(this)); - - _defineProperty(this, "previousX", 0); + /** + * Mark top frame as not stripping credential data + * @type {boolean} + */ + stripCredentials = false; - _defineProperty(this, "previousY", 0); - } + /** + * overlay API helpers + */ + overlay = (0, _overlayApi.overlayApi)(this); + previousX = 0; + previousY = 0; /** * Because we're running inside the Overlay, we always create the HTML @@ -7870,9 +7654,7 @@ class AppleOverlayDeviceInterface extends _AppleDeviceInterface.AppleDeviceInter */ createUIController() { return new _HTMLTooltipUIController.HTMLTooltipUIController({ - tooltipKind: - /** @type {const} */ - 'modern', + tooltipKind: /** @type {const} */'modern', device: this }, { wrapperClass: 'top-autofill', @@ -7882,7 +7664,6 @@ class AppleOverlayDeviceInterface extends _AppleDeviceInterface.AppleDeviceInter testMode: this.isTestMode() }); } - addDeviceListeners() { /** * The native side will send a custom event 'mouseMove' to indicate @@ -7892,26 +7673,25 @@ class AppleOverlayDeviceInterface extends _AppleDeviceInterface.AppleDeviceInter * page load every time it's opened. */ window.addEventListener('mouseMove', event => { - var _this$uiController, _this$uiController$ge; - // Don't set focus if the mouse hasn't moved ever // This is to avoid clickjacking where an attacker puts the pulldown under the cursor // and tricks the user into clicking - if (!this.previousX && !this.previousY || // if no previous coords + if (!this.previousX && !this.previousY || + // if no previous coords this.previousX === event.detail.x && this.previousY === event.detail.y // or the mouse hasn't moved ) { this.previousX = event.detail.x; this.previousY = event.detail.y; return; } - - const activeTooltip = (_this$uiController = this.uiController) === null || _this$uiController === void 0 ? void 0 : (_this$uiController$ge = _this$uiController.getActiveTooltip) === null || _this$uiController$ge === void 0 ? void 0 : _this$uiController$ge.call(_this$uiController); - activeTooltip === null || activeTooltip === void 0 ? void 0 : activeTooltip.focus(event.detail.x, event.detail.y); + const activeTooltip = this.uiController?.getActiveTooltip?.(); + activeTooltip?.focus(event.detail.x, event.detail.y); this.previousX = event.detail.x; this.previousY = event.detail.y; }); return super.addDeviceListeners(); } + /** * Since we're running inside the Overlay we can limit what happens here to * be only things that are needed to power the HTML Tooltip @@ -7919,23 +7699,20 @@ class AppleOverlayDeviceInterface extends _AppleDeviceInterface.AppleDeviceInter * @override * @returns {Promise} */ - - async setupAutofill() { await this._getAutofillInitData(); await this.inContextSignup.init(); const signedIn = await this._checkDeviceSignedIn(); - if (signedIn) { await this.getAddresses(); } } - async postInit() { // setup overlay API pieces this.overlay.showImmediately(); super.postInit(); } + /** * In the top-frame scenario we override the base 'selectedDetail'. * @@ -7945,78 +7722,61 @@ class AppleOverlayDeviceInterface extends _AppleDeviceInterface.AppleDeviceInter * @param {IdentityObject|CreditCardObject|CredentialsObject|{email:string, id: string}} data * @param {string} type */ - - async selectedDetail(data, type) { return this.overlay.selectedDetail(data, type); } - async askToUnlockProvider() { const response = await this.deviceApi.request(new _deviceApiCalls.AskToUnlockProviderCall(null)); this.providerStatusUpdated(response); } - providerStatusUpdated(data) { - var _this$uiController2; - const { credentials, availableInputTypes - } = (0, _index.validate)(data, _validatorsZod.providerStatusUpdatedSchema); // Update local settings and data + } = (0, _index.validate)(data, _validatorsZod.providerStatusUpdatedSchema); + // Update local settings and data this.settings.setAvailableInputTypes(availableInputTypes); - this.storeLocalCredentials(credentials); // rerender the tooltip + this.storeLocalCredentials(credentials); - (_this$uiController2 = this.uiController) === null || _this$uiController2 === void 0 ? void 0 : _this$uiController2.updateItems(credentials); + // rerender the tooltip + this.uiController?.updateItems(credentials); } - } - exports.AppleOverlayDeviceInterface = AppleOverlayDeviceInterface; -},{"../../packages/device-api/index.js":10,"../UI/controllers/HTMLTooltipUIController.js":53,"../deviceApiCalls/__generated__/deviceApiCalls.js":63,"../deviceApiCalls/__generated__/validators.zod.js":64,"./AppleDeviceInterface.js":22,"./overlayApi.js":29}],24:[function(require,module,exports){ +},{"../../packages/device-api/index.js":12,"../UI/controllers/HTMLTooltipUIController.js":55,"../deviceApiCalls/__generated__/deviceApiCalls.js":65,"../deviceApiCalls/__generated__/validators.zod.js":66,"./AppleDeviceInterface.js":24,"./overlayApi.js":31}],26:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ExtensionInterface = void 0; - var _InterfacePrototype = _interopRequireDefault(require("./InterfacePrototype.js")); - var _autofillUtils = require("../autofill-utils.js"); - var _HTMLTooltipUIController = require("../UI/controllers/HTMLTooltipUIController.js"); - var _HTMLTooltip = require("../UI/HTMLTooltip.js"); - var _InContextSignup = require("../InContextSignup.js"); - var _matching = require("../Form/matching.js"); - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - const TOOLTIP_TYPES = { EmailProtection: 'EmailProtection', EmailSignup: 'EmailSignup' }; - class ExtensionInterface extends _InterfacePrototype.default { - constructor() { - super(...arguments); - - _defineProperty(this, "inContextSignup", new _InContextSignup.InContextSignup(this)); - } + /** + * Adding this here since only the extension currently supports this + */ + inContextSignup = new _InContextSignup.InContextSignup(this); /** * @override */ createUIController() { /** @type {import('../UI/HTMLTooltip.js').HTMLTooltipOptions} */ - const htmlTooltipOptions = { ..._HTMLTooltip.defaultOptions, - css: ""), + const htmlTooltipOptions = { + ..._HTMLTooltip.defaultOptions, + css: ``, testMode: this.isTestMode(), hasCaret: true }; @@ -8030,23 +7790,16 @@ class ExtensionInterface extends _InterfacePrototype.default { device: this }, htmlTooltipOptions); } - getActiveTooltipType() { - var _this$activeForm, _this$inContextSignup; - if (this.hasLocalAddresses) { return TOOLTIP_TYPES.EmailProtection; } - - const inputType = (_this$activeForm = this.activeForm) !== null && _this$activeForm !== void 0 && _this$activeForm.activeInput ? (0, _matching.getInputSubtype)(this.activeForm.activeInput) : undefined; - - if ((_this$inContextSignup = this.inContextSignup) !== null && _this$inContextSignup !== void 0 && _this$inContextSignup.isAvailable(inputType)) { + const inputType = this.activeForm?.activeInput ? (0, _matching.getInputSubtype)(this.activeForm.activeInput) : undefined; + if (this.inContextSignup?.isAvailable(inputType)) { return TOOLTIP_TYPES.EmailSignup; } - return null; } - async resetAutofillUI(callback) { this.removeAutofillUIFromPage('Resetting autofill.'); await this.setupAutofill(); @@ -8054,12 +7807,9 @@ class ExtensionInterface extends _InterfacePrototype.default { this.uiController = this.createUIController(); await this.postInit(); } - async isEnabled() { return new Promise(resolve => { - var _chrome, _chrome$runtime; - - (_chrome = chrome) === null || _chrome === void 0 ? void 0 : (_chrome$runtime = _chrome.runtime) === null || _chrome$runtime === void 0 ? void 0 : _chrome$runtime.sendMessage({ + chrome?.runtime?.sendMessage({ registeredTempAutofillContentScript: true, documentUrl: window.location.href }, response => { @@ -8069,11 +7819,9 @@ class ExtensionInterface extends _InterfacePrototype.default { }); }); } - isDeviceSignedIn() { return this.hasLocalAddresses; } - async setupAutofill() { /** * In the extension, we must resolve `inContextSignup` data as part of setup @@ -8081,17 +7829,13 @@ class ExtensionInterface extends _InterfacePrototype.default { await this.inContextSignup.init(); return this.getAddresses(); } - postInit() { switch (this.getActiveTooltipType()) { case TOOLTIP_TYPES.EmailProtection: { - var _this$activeForm2; - this._scannerCleanup = this.scanner.init(); this.addLogoutListener(() => { this.resetAutofillUI(); - if (this.globalConfig.isDDGDomain) { (0, _autofillUtils.notifyWebApp)({ deviceSignedIn: { @@ -8100,13 +7844,10 @@ class ExtensionInterface extends _InterfacePrototype.default { }); } }); - - if ((_this$activeForm2 = this.activeForm) !== null && _this$activeForm2 !== void 0 && _this$activeForm2.activeInput) { - var _this$activeForm3; - + if (this.activeForm?.activeInput) { this.attachTooltip({ form: this.activeForm, - input: (_this$activeForm3 = this.activeForm) === null || _this$activeForm3 === void 0 ? void 0 : _this$activeForm3.activeInput, + input: this.activeForm?.activeInput, click: null, trigger: 'postSignup', triggerMetaData: { @@ -8114,16 +7855,13 @@ class ExtensionInterface extends _InterfacePrototype.default { } }); } - break; } - case TOOLTIP_TYPES.EmailSignup: { this._scannerCleanup = this.scanner.init(); break; } - default: { // Don't do anyhing if we don't have a tooltip to show @@ -8131,7 +7869,6 @@ class ExtensionInterface extends _InterfacePrototype.default { } } } - getAddresses() { return new Promise(resolve => chrome.runtime.sendMessage({ getAddresses: true @@ -8140,41 +7877,38 @@ class ExtensionInterface extends _InterfacePrototype.default { return resolve(data); })); } + /** * Used by the email web app * Settings page displays data of the logged in user data */ - - getUserData() { return new Promise(resolve => chrome.runtime.sendMessage({ getUserData: true }, data => resolve(data))); } + /** * Used by the email web app * Device capabilities determine which functionality is available to the user */ - - getEmailProtectionCapabilities() { return new Promise(resolve => chrome.runtime.sendMessage({ getEmailProtectionCapabilities: true }, data => resolve(data))); } - refreshAlias() { return chrome.runtime.sendMessage({ refreshAlias: true }, addresses => this.storeLocalAddresses(addresses)); } - async trySigningIn() { if (this.globalConfig.isDDGDomain) { const data = await (0, _autofillUtils.sendAndWaitForAnswer)(_autofillUtils.SIGN_IN_MSG, 'addUserData'); this.storeUserData(data); } } + /** * @param {object} message * @param {object} message.addUserData @@ -8182,23 +7916,19 @@ class ExtensionInterface extends _InterfacePrototype.default { * @param {string} message.addUserData.userName * @param {string} message.addUserData.cohort */ - - storeUserData(message) { return chrome.runtime.sendMessage(message); } + /** * Used by the email web app * Provides functionality to log the user out */ - - removeUserData() { return chrome.runtime.sendMessage({ removeUserData: true }); } - addDeviceListeners() { // Add contextual menu listeners let activeEl = null; @@ -8207,142 +7937,115 @@ class ExtensionInterface extends _InterfacePrototype.default { }); chrome.runtime.onMessage.addListener((message, sender) => { if (sender.id !== chrome.runtime.id) return; - switch (message.type) { case 'ddgUserReady': this.resetAutofillUI(() => this.setupSettingsPage({ shouldLog: true })); break; - case 'contextualAutofill': (0, _autofillUtils.setValue)(activeEl, (0, _autofillUtils.formatDuckAddress)(message.alias), this.globalConfig); activeEl.classList.add('ddg-autofilled'); - this.refreshAlias(); // If the user changes the alias, remove the decoration + this.refreshAlias(); + // If the user changes the alias, remove the decoration activeEl.addEventListener('input', e => e.target.classList.remove('ddg-autofilled'), { once: true }); break; - default: break; } }); } - addLogoutListener(handler) { // Make sure there's only one log out listener attached by removing the // previous logout listener first, if it exists. if (this._logoutListenerHandler) { chrome.runtime.onMessage.removeListener(this._logoutListenerHandler); - } // Cleanup on logout events - + } + // Cleanup on logout events this._logoutListenerHandler = (message, sender) => { if (sender.id === chrome.runtime.id && message.type === 'logout') { handler(); } }; - chrome.runtime.onMessage.addListener(this._logoutListenerHandler); } - } - exports.ExtensionInterface = ExtensionInterface; -},{"../Form/matching.js":41,"../InContextSignup.js":42,"../UI/HTMLTooltip.js":52,"../UI/controllers/HTMLTooltipUIController.js":53,"../autofill-utils.js":59,"./InterfacePrototype.js":25}],25:[function(require,module,exports){ +},{"../Form/matching.js":43,"../InContextSignup.js":44,"../UI/HTMLTooltip.js":54,"../UI/controllers/HTMLTooltipUIController.js":55,"../autofill-utils.js":61,"./InterfacePrototype.js":27}],27:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; - var _autofillUtils = require("../autofill-utils.js"); - var _matching = require("../Form/matching.js"); - var _formatters = require("../Form/formatters.js"); - var _Credentials = require("../InputTypes/Credentials.js"); - var _PasswordGenerator = require("../PasswordGenerator.js"); - var _Scanner = require("../Scanner.js"); - var _config = require("../config.js"); - var _NativeUIController = require("../UI/controllers/NativeUIController.js"); - var _transports = require("../deviceApiCalls/transports/transports.js"); - var _Settings = require("../Settings.js"); - var _index = require("../../packages/device-api/index.js"); - var _deviceApiCalls = require("../deviceApiCalls/__generated__/deviceApiCalls.js"); - var _initFormSubmissionsApi = require("./initFormSubmissionsApi.js"); - var _validatorsZod = require("../deviceApiCalls/__generated__/validators.zod.js"); - var _EmailProtection = require("../EmailProtection.js"); - -function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); } - -function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } } - -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - -function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; } - -function _classApplyDescriptorSet(receiver, descriptor, value) { if (descriptor.set) { descriptor.set.call(receiver, value); } else { if (!descriptor.writable) { throw new TypeError("attempted to set read only private field"); } descriptor.value = value; } } - -function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); } - -function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); } - -function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; } - -var _addresses = /*#__PURE__*/new WeakMap(); - -var _data2 = /*#__PURE__*/new WeakMap(); - /** * @typedef {import('../deviceApiCalls/__generated__/validators-ts').StoreFormData} StoreFormData */ - /** * @implements {GlobalConfigImpl} * @implements {FormExtensionPoints} * @implements {DeviceExtensionPoints} */ class InterfacePrototype { + attempts = 0; /** @type {import("../Form/Form").Form | null} */ - + activeForm = null; /** @type {import("../UI/HTMLTooltip.js").default | null} */ - + currentTooltip = null; /** @type {number} */ + initialSetupDelayMs = 0; + autopromptFired = false; /** @type {PasswordGenerator} */ + passwordGenerator = new _PasswordGenerator.PasswordGenerator(); + emailProtection = new _EmailProtection.EmailProtection(this); /** @type {import("../InContextSignup.js").InContextSignup | null} */ + inContextSignup = null; /** @type {{privateAddress: string, personalAddress: string}} */ + #addresses = { + privateAddress: '', + personalAddress: '' + }; /** @type {GlobalConfig} */ + globalConfig; /** @type {import('../Scanner').Scanner} */ + scanner; /** @type {import("../UI/controllers/UIController.js").UIController | null} */ + uiController; /** @type {import("../../packages/device-api").DeviceApi} */ + deviceApi; /** @type {boolean} */ + isInitializationStarted; /** @type {((reason, ...rest) => void) | null} */ + _scannerCleanup = null; /** * @param {GlobalConfig} config @@ -8350,52 +8053,6 @@ class InterfacePrototype { * @param {Settings} settings */ constructor(config, deviceApi, settings) { - _defineProperty(this, "attempts", 0); - - _defineProperty(this, "activeForm", null); - - _defineProperty(this, "currentTooltip", null); - - _defineProperty(this, "initialSetupDelayMs", 0); - - _defineProperty(this, "autopromptFired", false); - - _defineProperty(this, "passwordGenerator", new _PasswordGenerator.PasswordGenerator()); - - _defineProperty(this, "emailProtection", new _EmailProtection.EmailProtection(this)); - - _defineProperty(this, "inContextSignup", null); - - _classPrivateFieldInitSpec(this, _addresses, { - writable: true, - value: { - privateAddress: '', - personalAddress: '' - } - }); - - _defineProperty(this, "globalConfig", void 0); - - _defineProperty(this, "scanner", void 0); - - _defineProperty(this, "uiController", void 0); - - _defineProperty(this, "deviceApi", void 0); - - _defineProperty(this, "isInitializationStarted", void 0); - - _defineProperty(this, "_scannerCleanup", null); - - _classPrivateFieldInitSpec(this, _data2, { - writable: true, - value: { - credentials: [], - creditCards: [], - identities: [], - topContextData: undefined - } - }); - this.globalConfig = config; this.deviceApi = deviceApi; this.settings = settings; @@ -8405,60 +8062,56 @@ class InterfacePrototype { }); this.isInitializationStarted = false; } + /** * Implementors should override this with a UI controller that suits * their platform. * * @returns {import("../UI/controllers/UIController.js").UIController} */ - - createUIController() { return new _NativeUIController.NativeUIController(); } + /** * @param {string} reason */ - - removeAutofillUIFromPage(reason) { - var _this$uiController, _this$_scannerCleanup; - - (_this$uiController = this.uiController) === null || _this$uiController === void 0 ? void 0 : _this$uiController.destroy(); - (_this$_scannerCleanup = this._scannerCleanup) === null || _this$_scannerCleanup === void 0 ? void 0 : _this$_scannerCleanup.call(this, reason); + this.uiController?.destroy(); + this._scannerCleanup?.(reason); } - get hasLocalAddresses() { - var _classPrivateFieldGet2, _classPrivateFieldGet3; - - return !!((_classPrivateFieldGet2 = _classPrivateFieldGet(this, _addresses)) !== null && _classPrivateFieldGet2 !== void 0 && _classPrivateFieldGet2.privateAddress && (_classPrivateFieldGet3 = _classPrivateFieldGet(this, _addresses)) !== null && _classPrivateFieldGet3 !== void 0 && _classPrivateFieldGet3.personalAddress); + return !!(this.#addresses?.privateAddress && this.#addresses?.personalAddress); } - getLocalAddresses() { - return _classPrivateFieldGet(this, _addresses); + return this.#addresses; } - storeLocalAddresses(addresses) { - _classPrivateFieldSet(this, _addresses, addresses); // When we get new duck addresses, add them to the identities list - - + this.#addresses = addresses; + // When we get new duck addresses, add them to the identities list const identities = this.getLocalIdentities(); const privateAddressIdentity = identities.find(_ref => { let { id } = _ref; return id === 'privateAddress'; - }); // If we had previously stored them, just update the private address - + }); + // If we had previously stored them, just update the private address if (privateAddressIdentity) { privateAddressIdentity.emailAddress = (0, _autofillUtils.formatDuckAddress)(addresses.privateAddress); } else { // Otherwise, add both addresses - _classPrivateFieldGet(this, _data2).identities = this.addDuckAddressesToIdentities(identities); + this.#data.identities = this.addDuckAddressesToIdentities(identities); } } - /** @type { PMData } */ + /** @type { PMData } */ + #data = { + credentials: [], + creditCards: [], + identities: [], + topContextData: undefined + }; /** * @returns {import('../Form/matching').SupportedTypes} @@ -8466,7 +8119,6 @@ class InterfacePrototype { getCurrentInputType() { throw new Error('Not implemented'); } - addDuckAddressesToIdentities(identities) { if (!this.hasLocalAddresses) return identities; const newIdentities = []; @@ -8475,16 +8127,18 @@ class InterfacePrototype { personalAddress } = this.getLocalAddresses(); privateAddress = (0, _autofillUtils.formatDuckAddress)(privateAddress); - personalAddress = (0, _autofillUtils.formatDuckAddress)(personalAddress); // Get the duck addresses in identities + personalAddress = (0, _autofillUtils.formatDuckAddress)(personalAddress); + // Get the duck addresses in identities const duckEmailsInIdentities = identities.reduce((duckEmails, _ref2) => { let { emailAddress: email } = _ref2; - return email !== null && email !== void 0 && email.includes(_autofillUtils.ADDRESS_DOMAIN) ? duckEmails.concat(email) : duckEmails; - }, []); // Only add the personal duck address to identities if the user hasn't - // already manually added it + return email?.includes(_autofillUtils.ADDRESS_DOMAIN) ? duckEmails.concat(email) : duckEmails; + }, []); + // Only add the personal duck address to identities if the user hasn't + // already manually added it if (!duckEmailsInIdentities.includes(personalAddress)) { newIdentities.push({ id: 'personalAddress', @@ -8492,7 +8146,6 @@ class InterfacePrototype { title: 'Block email trackers' }); } - newIdentities.push({ id: 'privateAddress', emailAddress: privateAddress, @@ -8500,58 +8153,55 @@ class InterfacePrototype { }); return [...identities, ...newIdentities]; } + /** * Stores init data coming from the tooltipHandler * @param { InboundPMData } data */ - - storeLocalData(data) { this.storeLocalCredentials(data.credentials); - data.creditCards.forEach(cc => delete cc.cardNumber && delete cc.cardSecurityCode); // Store the full name as a separate field to simplify autocomplete - - const updatedIdentities = data.identities.map(identity => ({ ...identity, + data.creditCards.forEach(cc => delete cc.cardNumber && delete cc.cardSecurityCode); + // Store the full name as a separate field to simplify autocomplete + const updatedIdentities = data.identities.map(identity => ({ + ...identity, fullName: (0, _formatters.formatFullName)(identity) - })); // Add addresses - - _classPrivateFieldGet(this, _data2).identities = this.addDuckAddressesToIdentities(updatedIdentities); - _classPrivateFieldGet(this, _data2).creditCards = data.creditCards; // Top autofill only + })); + // Add addresses + this.#data.identities = this.addDuckAddressesToIdentities(updatedIdentities); + this.#data.creditCards = data.creditCards; + // Top autofill only if (data.serializedInputContext) { try { - _classPrivateFieldGet(this, _data2).topContextData = JSON.parse(data.serializedInputContext); + this.#data.topContextData = JSON.parse(data.serializedInputContext); } catch (e) { console.error(e); this.removeTooltip(); } } } + /** * Stores credentials locally * @param {CredentialsObject[]} credentials */ - - storeLocalCredentials(credentials) { credentials.forEach(cred => delete cred.password); - _classPrivateFieldGet(this, _data2).credentials = credentials; + this.#data.credentials = credentials; } - getTopContextData() { - return _classPrivateFieldGet(this, _data2).topContextData; + return this.#data.topContextData; } + /** * @deprecated use `availableInputTypes.credentials` directly instead * @returns {boolean} */ - - get hasLocalCredentials() { - return _classPrivateFieldGet(this, _data2).credentials.length > 0; + return this.#data.credentials.length > 0; } - getLocalCredentials() { - return _classPrivateFieldGet(this, _data2).credentials.map(cred => { + return this.#data.credentials.map(cred => { const { password, ...rest @@ -8563,51 +8213,44 @@ class InterfacePrototype { * @deprecated use `availableInputTypes.identities` directly instead * @returns {boolean} */ - - get hasLocalIdentities() { - return _classPrivateFieldGet(this, _data2).identities.length > 0; + return this.#data.identities.length > 0; } - getLocalIdentities() { - return _classPrivateFieldGet(this, _data2).identities; + return this.#data.identities; } + /** * @deprecated use `availableInputTypes.creditCards` directly instead * @returns {boolean} */ - - get hasLocalCreditCards() { - return _classPrivateFieldGet(this, _data2).creditCards.length > 0; + return this.#data.creditCards.length > 0; } /** @return {CreditCardObject[]} */ - - getLocalCreditCards() { - return _classPrivateFieldGet(this, _data2).creditCards; + return this.#data.creditCards; } - async startInit() { if (this.isInitializationStarted) return; this.alreadyInitialized = true; await this.refreshSettings(); this.addDeviceListeners(); await this.setupAutofill(); - this.uiController = this.createUIController(); // this is the temporary measure to support windows whilst we still have 'setupAutofill' - // eventually all interfaces will use this + this.uiController = this.createUIController(); + // this is the temporary measure to support windows whilst we still have 'setupAutofill' + // eventually all interfaces will use this if (!this.isEnabledViaSettings()) { return; } - await this.setupSettingsPage(); await this.postInit(); - if (this.settings.featureToggles.credentials_saving) { (0, _initFormSubmissionsApi.initFormSubmissionsApi)(this.scanner.forms, this.scanner.matching); } } + /** * This is to aid the migration to all platforms using Settings.enabled. * @@ -8619,11 +8262,10 @@ class InterfacePrototype { * * @returns {boolean} */ - - isEnabledViaSettings() { return true; } + /** * This is a fall-back situation for macOS since it was the only * platform to support anything none-email based in the past. @@ -8632,20 +8274,15 @@ class InterfacePrototype { * * @returns {Promise} */ - - async refreshSettings() { await this.settings.refresh(); } - async isEnabled() { return (0, _autofillUtils.autofillEnabled)(this.globalConfig); } - async init() { const isEnabled = await this.isEnabled(); if (!isEnabled) return; - const handler = async () => { if (document.readyState === 'complete') { window.removeEventListener('load', handler); @@ -8653,7 +8290,6 @@ class InterfacePrototype { await this.startInit(); } }; - if (document.readyState === 'complete') { await this.startInit(); } else { @@ -8661,12 +8297,10 @@ class InterfacePrototype { document.addEventListener('readystatechange', handler); } } - postInit() { const cleanup = this.scanner.init(); this.addLogoutListener(() => { cleanup('Logged out'); - if (this.globalConfig.isDDGDomain) { (0, _autofillUtils.notifyWebApp)({ deviceSignedIn: { @@ -8676,19 +8310,18 @@ class InterfacePrototype { } }); } + /** * @deprecated This was a port from the macOS implementation so the API may not be suitable for all * @returns {Promise} */ - - async getSelectedCredentials() { throw new Error('`getSelectedCredentials` not implemented'); } - isTestMode() { return this.globalConfig.isDDGTestMode; } + /** * This indicates an item was selected on Desktop, and we should try to autofill * @@ -8698,35 +8331,30 @@ class InterfacePrototype { * @param {IdentityObject|CreditCardObject|CredentialsObject|{email:string, id: string}} data * @param {string} type */ - - async selectedDetail(data, type) { const form = this.activeForm; - if (!form) { return; - } // are we autofilling email? - + } + // are we autofilling email? if (type === 'email' && 'email' in data) { form.autofillEmail(data.email); } else { form.autofillData(data, type); } - const isPrivateAddress = data.id === 'privateAddress'; + /** * This is desktop only: was it a private address? if so, save it with * the trigger 'emailProtection' so that native sides can use it */ - if (isPrivateAddress) { this.refreshAlias(); - if ('emailAddress' in data && data.emailAddress) { this.emailProtection.storeReceived(data.emailAddress); - /** @type {DataStorageObject} */ + /** @type {DataStorageObject} */ const formValues = { credentials: { username: data.emailAddress, @@ -8736,9 +8364,9 @@ class InterfacePrototype { this.storeFormData(formValues, 'emailProtection'); } } - await this.removeTooltip(); } + /** * Before the DataWebTooltip opens, we collect the data based on the config.type * @param {InputTypeConfigs} config @@ -8746,19 +8374,14 @@ class InterfacePrototype { * @param {TopContextData} [data] * @returns {(CredentialsObject|CreditCardObject|IdentityObject)[]} */ - - dataForAutofill(config, inputType, data) { const subtype = (0, _matching.getSubtypeFromType)(inputType); - if (config.type === 'identities') { return this.getLocalIdentities().filter(identity => !!identity[subtype]); } - if (config.type === 'creditCards') { return this.getLocalCreditCards(); } - if (config.type === 'credentials') { if (data) { if (Array.isArray(data.credentials) && data.credentials.length > 0) { @@ -8768,9 +8391,9 @@ class InterfacePrototype { } } } - return []; } + /** * @param {object} params * @param {import("../Form/Form").Form} params.form @@ -8779,35 +8402,31 @@ class InterfacePrototype { * @param {import('../deviceApiCalls/__generated__/validators-ts').GetAutofillDataRequest['trigger']} params.trigger * @param {import('../UI/controllers/UIController.js').AttachArgs["triggerMetaData"]} params.triggerMetaData */ - - attachTooltip(params) { - var _this$uiController2; - const { form, input, click, trigger - } = params; // Avoid flashing tooltip from background tabs on macOS - - if (document.visibilityState !== 'visible' && trigger !== 'postSignup') return; // Only autoprompt on mobile devices - - if (trigger === 'autoprompt' && !this.globalConfig.isMobileApp) return; // Only fire autoprompt once - + } = params; + // Avoid flashing tooltip from background tabs on macOS + if (document.visibilityState !== 'visible' && trigger !== 'postSignup') return; + // Only autoprompt on mobile devices + if (trigger === 'autoprompt' && !this.globalConfig.isMobileApp) return; + // Only fire autoprompt once if (trigger === 'autoprompt' && this.autopromptFired) return; form.activeInput = input; this.activeForm = form; const inputType = (0, _matching.getInputType)(input); - /** @type {PosFn} */ + /** @type {PosFn} */ const getPosition = () => { // In extensions, the tooltip is centered on the Dax icon const alignLeft = this.globalConfig.isApp || this.globalConfig.isWindows; return alignLeft ? input.getBoundingClientRect() : (0, _autofillUtils.getDaxBoundingBox)(input); - }; // todo: this will be migrated to use NativeUIController soon - + }; + // todo: this will be migrated to use NativeUIController soon if (this.globalConfig.isMobileApp && inputType === 'identities.emailAddress') { this.getAlias().then(alias => { if (alias) { @@ -8816,31 +8435,28 @@ class InterfacePrototype { * We're on mobile here, so we just record the email received. * Then later in the form submission we can compare the values */ - this.emailProtection.storeReceived(alias); } else { - var _form$activeInput; + form.activeInput?.focus(); + } - (_form$activeInput = form.activeInput) === null || _form$activeInput === void 0 ? void 0 : _form$activeInput.focus(); - } // Update data from native-side in case the `getAlias` call + // Update data from native-side in case the `getAlias` call // has included a successful in-context signup - - this.updateForStateChange(); this.onFinishedAutofill(); }); return; } - /** @type {TopContextData} */ - + /** @type {TopContextData} */ const topContextData = { inputType - }; // Allow features to append/change top context data - // for example, generated passwords may get appended here + }; + // Allow features to append/change top context data + // for example, generated passwords may get appended here const processedTopContext = this.preAttachTooltip(topContextData, input, form); - (_this$uiController2 = this.uiController) === null || _this$uiController2 === void 0 ? void 0 : _this$uiController2.attach({ + this.uiController?.attach({ input, form, click, @@ -8850,11 +8466,11 @@ class InterfacePrototype { trigger, triggerMetaData: params.triggerMetaData }); - if (trigger === 'autoprompt') { this.autopromptFired = true; } } + /** * When an item was selected, we then call back to the device * to fetch the full suite of data needed to complete the autofill @@ -8863,52 +8479,43 @@ class InterfacePrototype { * @param {(CreditCardObject|IdentityObject|CredentialsObject)[]} items * @param {CreditCardObject['id']|IdentityObject['id']|CredentialsObject['id']} id */ - - onSelect(inputType, items, id) { id = String(id); const mainType = (0, _matching.getMainTypeFromType)(inputType); const subtype = (0, _matching.getSubtypeFromType)(inputType); - if (id === _Credentials.PROVIDER_LOCKED) { return this.askToUnlockProvider(); } - const matchingData = items.find(item => String(item.id) === id); if (!matchingData) throw new Error('unreachable (fatal)'); - const dataPromise = (() => { switch (mainType) { case 'creditCards': return this.getAutofillCreditCard(id); - case 'identities': return this.getAutofillIdentity(id); - case 'credentials': { if (_Credentials.AUTOGENERATED_KEY in matchingData) { - const autogeneratedPayload = { ...matchingData, + const autogeneratedPayload = { + ...matchingData, username: '' }; return Promise.resolve({ success: autogeneratedPayload }); } - return this.getAutofillCredentials(id); } - default: throw new Error('unreachable!'); } - })(); // wait for the data back from the device - + })(); + // wait for the data back from the device dataPromise.then(response => { if (response) { const data = response.success || response; - if (mainType === 'identities') { this.firePixel({ pixelName: 'autofill_identity', @@ -8916,35 +8523,29 @@ class InterfacePrototype { fieldType: subtype } }); - switch (id) { case 'personalAddress': this.firePixel({ pixelName: 'autofill_personal_address' }); break; - case 'privateAddress': this.firePixel({ pixelName: 'autofill_private_address' }); break; - default: // Also fire pixel when filling an identity with the personal duck address from an email field - const checks = [subtype === 'emailAddress', this.hasLocalAddresses, (data === null || data === void 0 ? void 0 : data.emailAddress) === (0, _autofillUtils.formatDuckAddress)(_classPrivateFieldGet(this, _addresses).personalAddress)]; - + const checks = [subtype === 'emailAddress', this.hasLocalAddresses, data?.emailAddress === (0, _autofillUtils.formatDuckAddress)(this.#addresses.personalAddress)]; if (checks.every(Boolean)) { this.firePixel({ pixelName: 'autofill_personal_address' }); } - break; } - } // some platforms do not include a `success` object, why? - - + } + // some platforms do not include a `success` object, why? return this.selectedDetail(data, mainType); } else { return Promise.reject(new Error('none-success response')); @@ -8954,91 +8555,68 @@ class InterfacePrototype { return this.removeTooltip(); }); } - async askToUnlockProvider() { const response = await this.deviceApi.request(new _deviceApiCalls.AskToUnlockProviderCall(null)); this.providerStatusUpdated(response); } - isTooltipActive() { - var _this$uiController$is, _this$uiController3, _this$uiController3$i; - - return (_this$uiController$is = (_this$uiController3 = this.uiController) === null || _this$uiController3 === void 0 ? void 0 : (_this$uiController3$i = _this$uiController3.isActive) === null || _this$uiController3$i === void 0 ? void 0 : _this$uiController3$i.call(_this$uiController3)) !== null && _this$uiController$is !== void 0 ? _this$uiController$is : false; + return this.uiController?.isActive?.() ?? false; } - removeTooltip() { - var _this$uiController4, _this$uiController4$r; - - return (_this$uiController4 = this.uiController) === null || _this$uiController4 === void 0 ? void 0 : (_this$uiController4$r = _this$uiController4.removeTooltip) === null || _this$uiController4$r === void 0 ? void 0 : _this$uiController4$r.call(_this$uiController4, 'interface'); + return this.uiController?.removeTooltip?.('interface'); } - onFinishedAutofill() { - var _this$activeForm, _this$activeForm$acti; - // Let input handlers know we've stopped autofilling - (_this$activeForm = this.activeForm) === null || _this$activeForm === void 0 ? void 0 : (_this$activeForm$acti = _this$activeForm.activeInput) === null || _this$activeForm$acti === void 0 ? void 0 : _this$activeForm$acti.dispatchEvent(new Event('mouseleave')); + this.activeForm?.activeInput?.dispatchEvent(new Event('mouseleave')); } - async updateForStateChange() { - var _this$activeForm2, _this$activeForm3; - // Remove decorations before refreshing data to make sure we // remove the currently set icons - (_this$activeForm2 = this.activeForm) === null || _this$activeForm2 === void 0 ? void 0 : _this$activeForm2.removeAllDecorations(); // Update for any state that may have changed + this.activeForm?.removeAllDecorations(); - await this.refreshData(); // Add correct icons and behaviour + // Update for any state that may have changed + await this.refreshData(); - (_this$activeForm3 = this.activeForm) === null || _this$activeForm3 === void 0 ? void 0 : _this$activeForm3.recategorizeAllInputs(); + // Add correct icons and behaviour + this.activeForm?.recategorizeAllInputs(); } - async refreshData() { - var _this$inContextSignup; - - await ((_this$inContextSignup = this.inContextSignup) === null || _this$inContextSignup === void 0 ? void 0 : _this$inContextSignup.refreshData()); + await this.inContextSignup?.refreshData(); await this.settings.populateData(); } - async setupSettingsPage() { let { shouldLog } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : { shouldLog: false }; - if (!this.globalConfig.isDDGDomain) { return; } - (0, _autofillUtils.notifyWebApp)({ isApp: this.globalConfig.isApp }); - if (this.isDeviceSignedIn()) { let userData; - try { userData = await this.getUserData(); } catch (e) {} - let capabilities; - try { capabilities = await this.getEmailProtectionCapabilities(); - } catch (e) {} // Set up listener for web app actions - + } catch (e) {} + // Set up listener for web app actions if (this.globalConfig.isDDGDomain) { window.addEventListener('message', e => { if (e.data.removeUserData) { this.removeUserData(); } - if (e.data.closeEmailProtection) { this.closeEmailProtection(); } }); } - const hasUserData = userData && !userData.error && Object.entries(userData).length > 0; (0, _autofillUtils.notifyWebApp)({ deviceSignedIn: { @@ -9052,43 +8630,35 @@ class InterfacePrototype { this.trySigningIn(); } } - async setupAutofill() {} - /** @returns {Promise} */ - + /** @returns {Promise} */ async getAddresses() { throw new Error('unimplemented'); } - /** @returns {Promise>} */ - + /** @returns {Promise>} */ getUserData() { return Promise.resolve(null); } - /** @returns {void} */ - - removeUserData() {} /** @returns {void} */ + removeUserData() {} - + /** @returns {void} */ closeEmailProtection() {} - /** @returns {Promise>} */ - + /** @returns {Promise>} */ getEmailProtectionCapabilities() { throw new Error('unimplemented'); } - refreshAlias() {} - async trySigningIn() { if (this.globalConfig.isDDGDomain) { if (this.attempts < 10) { this.attempts++; - const data = await (0, _autofillUtils.sendAndWaitForAnswer)(_autofillUtils.SIGN_IN_MSG, 'addUserData'); // This call doesn't send a response, so we can't know if it succeeded - + const data = await (0, _autofillUtils.sendAndWaitForAnswer)(_autofillUtils.SIGN_IN_MSG, 'addUserData'); + // This call doesn't send a response, so we can't know if it succeeded this.storeUserData(data); await this.setupAutofill(); await this.refreshSettings(); @@ -9101,37 +8671,32 @@ class InterfacePrototype { } } } - storeUserData(_data) {} - addDeviceListeners() {} + /** * Called by the native layer on all tabs when the provider status is updated * @param {import("../deviceApiCalls/__generated__/validators-ts").ProviderStatusUpdated} data */ - - providerStatusUpdated(data) { try { - var _this$uiController5, _availableInputTypes$; - const { credentials, availableInputTypes - } = (0, _index.validate)(data, _validatorsZod.providerStatusUpdatedSchema); // Update local settings and data + } = (0, _index.validate)(data, _validatorsZod.providerStatusUpdatedSchema); + // Update local settings and data this.settings.setAvailableInputTypes(availableInputTypes); - this.storeLocalCredentials(credentials); // rerender the tooltip - - (_this$uiController5 = this.uiController) === null || _this$uiController5 === void 0 ? void 0 : _this$uiController5.updateItems(credentials); // If the tooltip is open on an autofill type that's not available, close it + this.storeLocalCredentials(credentials); + // rerender the tooltip + this.uiController?.updateItems(credentials); + // If the tooltip is open on an autofill type that's not available, close it const currentInputSubtype = (0, _matching.getSubtypeFromType)(this.getCurrentInputType()); - - if (!((_availableInputTypes$ = availableInputTypes.credentials) !== null && _availableInputTypes$ !== void 0 && _availableInputTypes$[currentInputSubtype])) { + if (!availableInputTypes.credentials?.[currentInputSubtype]) { this.removeTooltip(); - } // Redecorate fields according to the new types - - + } + // Redecorate fields according to the new types this.scanner.forms.forEach(form => form.recategorizeAllInputs()); } catch (e) { if (this.globalConfig.isDDGTestMode) { @@ -9139,66 +8704,53 @@ class InterfacePrototype { } } } - /** @param {() => void} _fn */ - + /** @param {() => void} _fn */ addLogoutListener(_fn) {} - isDeviceSignedIn() { return false; } /** * @returns {Promise} */ - - async getAlias() { return undefined; - } // PM endpoints - - + } + // PM endpoints getAccounts() {} /** * Gets credentials ready for autofill * @param {CredentialsObject['id']} id - the credential id * @returns {Promise} */ - - async getAutofillCredentials(id) { return this.deviceApi.request(new _deviceApiCalls.GetAutofillCredentialsCall({ id: String(id) })); } /** @returns {APIResponse} */ - - async getAutofillCreditCard(_id) { throw new Error('getAutofillCreditCard unimplemented'); } /** @returns {Promise<{success: IdentityObject|undefined}>} */ - - async getAutofillIdentity(_id) { throw new Error('getAutofillIdentity unimplemented'); } - openManagePasswords() {} - openManageCreditCards() {} - openManageIdentities() {} + /** * @param {StoreFormData} values * @param {StoreFormData['trigger']} trigger */ - - storeFormData(values, trigger) { - this.deviceApi.notify(new _deviceApiCalls.StoreFormDataCall({ ...values, + this.deviceApi.notify(new _deviceApiCalls.StoreFormDataCall({ + ...values, trigger })); } + /** * `preAttachTooltip` happens just before a tooltip is show - features may want to append some data * at this point. @@ -9210,27 +8762,25 @@ class InterfacePrototype { * @param {HTMLInputElement} input * @param {import("../Form/Form").Form} form */ - - preAttachTooltip(topContextData, input, form) { // A list of checks to determine if we need to generate a password - const checks = [topContextData.inputType === 'credentials.password', this.settings.featureToggles.password_generation, form.isSignup]; // if all checks pass, generate and save a password + const checks = [topContextData.inputType === 'credentials.password', this.settings.featureToggles.password_generation, form.isSignup]; + // if all checks pass, generate and save a password if (checks.every(Boolean)) { - var _rawValues$credential, _rawValues$identities; - const password = this.passwordGenerator.generate({ input: input.getAttribute('passwordrules'), domain: window.location.hostname }); const rawValues = form.getRawValues(); - const username = ((_rawValues$credential = rawValues.credentials) === null || _rawValues$credential === void 0 ? void 0 : _rawValues$credential.username) || ((_rawValues$identities = rawValues.identities) === null || _rawValues$identities === void 0 ? void 0 : _rawValues$identities.emailAddress) || ''; // append the new credential to the topContextData so that the top autofill can display it + const username = rawValues.credentials?.username || rawValues.identities?.emailAddress || ''; + // append the new credential to the topContextData so that the top autofill can display it topContextData.credentials = [(0, _Credentials.fromPassword)(password, username)]; } - return topContextData; } + /** * `postAutofill` gives features an opportunity to perform an action directly * following an autofill. @@ -9241,17 +8791,13 @@ class InterfacePrototype { * @param {SupportedMainTypes} dataType * @param {import("../Form/Form").Form} formObj */ - - postAutofill(data, dataType, formObj) { // If there's an autogenerated password, prompt to save - if (_Credentials.AUTOGENERATED_KEY in data && 'password' in data && // Don't send message on Android to avoid potential abuse. Data is saved on native confirmation instead. + if (_Credentials.AUTOGENERATED_KEY in data && 'password' in data && + // Don't send message on Android to avoid potential abuse. Data is saved on native confirmation instead. !this.globalConfig.isAndroid) { - var _formValues$credentia; - const formValues = formObj.getValuesReadyForStorage(); - - if (((_formValues$credentia = formValues.credentials) === null || _formValues$credentia === void 0 ? void 0 : _formValues$credentia.password) === data.password) { + if (formValues.credentials?.password === data.password) { /** @type {StoreFormData} */ const formData = (0, _Credentials.appendGeneratedKey)(formValues, { password: data.password @@ -9259,11 +8805,11 @@ class InterfacePrototype { this.storeFormData(formData, 'passwordGeneration'); } } - if (dataType === 'credentials' && formObj.shouldAutoSubmit) { formObj.attemptSubmissionIfNeeded(); } } + /** * `postSubmit` gives features a one-time-only opportunity to perform an * action directly after a form submission was observed. @@ -9275,13 +8821,10 @@ class InterfacePrototype { * @param {DataStorageObject} values * @param {import("../Form/Form").Form} form */ - - postSubmit(values, form) { if (!form.form) return; if (!form.hasValues(values)) return; const checks = [form.shouldPromptToStoreData, this.passwordGenerator.generated]; - if (checks.some(Boolean)) { const formData = (0, _Credentials.appendGeneratedKey)(values, { password: this.passwordGenerator.password, @@ -9290,69 +8833,50 @@ class InterfacePrototype { this.storeFormData(formData, 'formSubmission'); } } + /** * Sends a pixel to be fired on the client side * @param {import('../deviceApiCalls/__generated__/validators-ts').SendJSPixelParams} pixelParams */ - - firePixel(pixelParams) { this.deviceApi.notify(new _deviceApiCalls.SendJSPixelCall(pixelParams)); } + /** * This serves as a single place to create a default instance * of InterfacePrototype that can be useful in testing scenarios * @returns {InterfacePrototype} */ - - static default() { const globalConfig = (0, _config.createGlobalConfig)(); const transport = (0, _transports.createTransport)(globalConfig); const deviceApi = new _index.DeviceApi(transport); - const settings = _Settings.Settings.default(globalConfig, deviceApi); - return new InterfacePrototype(globalConfig, deviceApi, settings); } - } +var _default = exports.default = InterfacePrototype; -var _default = InterfacePrototype; -exports.default = _default; - -},{"../../packages/device-api/index.js":10,"../EmailProtection.js":30,"../Form/formatters.js":34,"../Form/matching.js":41,"../InputTypes/Credentials.js":43,"../PasswordGenerator.js":46,"../Scanner.js":47,"../Settings.js":48,"../UI/controllers/NativeUIController.js":54,"../autofill-utils.js":59,"../config.js":61,"../deviceApiCalls/__generated__/deviceApiCalls.js":63,"../deviceApiCalls/__generated__/validators.zod.js":64,"../deviceApiCalls/transports/transports.js":69,"./initFormSubmissionsApi.js":28}],26:[function(require,module,exports){ +},{"../../packages/device-api/index.js":12,"../EmailProtection.js":32,"../Form/formatters.js":36,"../Form/matching.js":43,"../InputTypes/Credentials.js":45,"../PasswordGenerator.js":48,"../Scanner.js":49,"../Settings.js":50,"../UI/controllers/NativeUIController.js":56,"../autofill-utils.js":61,"../config.js":63,"../deviceApiCalls/__generated__/deviceApiCalls.js":65,"../deviceApiCalls/__generated__/validators.zod.js":66,"../deviceApiCalls/transports/transports.js":71,"./initFormSubmissionsApi.js":30}],28:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.WindowsInterface = void 0; - var _InterfacePrototype = _interopRequireDefault(require("./InterfacePrototype.js")); - var _OverlayUIController = require("../UI/controllers/OverlayUIController.js"); - var _deviceApiCalls = require("../deviceApiCalls/__generated__/deviceApiCalls.js"); - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - /** * @typedef {import('../deviceApiCalls/__generated__/validators-ts').GetAutofillDataRequest} GetAutofillDataRequest */ -const EMAIL_PROTECTION_LOGOUT_MESSAGE = 'EMAIL_PROTECTION_LOGOUT'; +const EMAIL_PROTECTION_LOGOUT_MESSAGE = 'EMAIL_PROTECTION_LOGOUT'; class WindowsInterface extends _InterfacePrototype.default { - constructor() { - super(...arguments); - - _defineProperty(this, "ready", false); - - _defineProperty(this, "_abortController", null); - } - + ready = false; + /** @type {AbortController|null} */ + _abortController = null; /** * @deprecated This runs too early, and will be removed eventually. * @returns {Promise} @@ -9360,24 +8884,19 @@ class WindowsInterface extends _InterfacePrototype.default { async isEnabled() { return true; } - async setupAutofill() { const loggedIn = await this._getIsLoggedIn(); - if (loggedIn) { await this.getAddresses(); } } - isEnabledViaSettings() { return Boolean(this.settings.enabled); } - postInit() { super.postInit(); this.ready = true; } - createUIController() { /** * If we get here, we're just a controller for an overlay @@ -9387,20 +8906,18 @@ class WindowsInterface extends _InterfacePrototype.default { show: async details => this._show(details) }); } + /** * @param {GetAutofillDataRequest} details */ - - async _show(details) { const { mainType - } = details; // prevent overlapping listeners - + } = details; + // prevent overlapping listeners if (this._abortController && !this._abortController.signal.aborted) { this._abortController.abort(); } - this._abortController = new AbortController(); this.deviceApi.request(new _deviceApiCalls.GetAutofillDataCall(details), { signal: this._abortController.signal @@ -9408,35 +8925,26 @@ class WindowsInterface extends _InterfacePrototype.default { if (!this.activeForm) { throw new Error('this.currentAttached was absent'); } - switch (resp.action) { case 'fill': { if (mainType in resp) { - var _this$activeForm; - - (_this$activeForm = this.activeForm) === null || _this$activeForm === void 0 ? void 0 : _this$activeForm.autofillData(resp[mainType], mainType); + this.activeForm?.autofillData(resp[mainType], mainType); } else { - throw new Error("action: \"fill\" cannot occur because \"".concat(mainType, "\" was missing")); + throw new Error(`action: "fill" cannot occur because "${mainType}" was missing`); } - break; } - case 'focus': { - var _this$activeForm2, _this$activeForm2$act; - - (_this$activeForm2 = this.activeForm) === null || _this$activeForm2 === void 0 ? void 0 : (_this$activeForm2$act = _this$activeForm2.activeInput) === null || _this$activeForm2$act === void 0 ? void 0 : _this$activeForm2$act.focus(); + this.activeForm?.activeInput?.focus(); break; } - case 'none': { // do nothing break; } - default: { if (this.globalConfig.isDDGTestMode) { @@ -9444,7 +8952,6 @@ class WindowsInterface extends _InterfacePrototype.default { } } } - return this._closeAutofillParent(); }).catch(e => { if (this.globalConfig.isDDGTestMode) { @@ -9456,14 +8963,14 @@ class WindowsInterface extends _InterfacePrototype.default { } }); } + /** * @returns {Promise} */ - - async _closeAutofillParent() { return this.deviceApi.notify(new _deviceApiCalls.CloseAutofillParentCall(null)); } + /** * Email Protection calls */ @@ -9471,20 +8978,14 @@ class WindowsInterface extends _InterfacePrototype.default { /** * @returns {Promise} */ - - getEmailProtectionCapabilities() { return this.deviceApi.request(new _deviceApiCalls.EmailProtectionGetCapabilitiesCall({})); } - async _getIsLoggedIn() { const isLoggedIn = await this.deviceApi.request(new _deviceApiCalls.EmailProtectionGetIsLoggedInCall({})); - this.isDeviceSignedIn = () => isLoggedIn; - return isLoggedIn; } - addLogoutListener(handler) { // Only deal with logging out if we're in the email web app if (!this.globalConfig.isDDGDomain) return; @@ -9494,11 +8995,10 @@ class WindowsInterface extends _InterfacePrototype.default { } }); } + /** * @returns {Promise} */ - - storeUserData(_ref) { let { addUserData @@ -9508,55 +9008,39 @@ class WindowsInterface extends _InterfacePrototype.default { /** * @returns {Promise} */ - - removeUserData() { return this.deviceApi.request(new _deviceApiCalls.EmailProtectionRemoveUserDataCall({})); } /** * @returns {Promise} */ - - getUserData() { return this.deviceApi.request(new _deviceApiCalls.EmailProtectionGetUserDataCall({})); } - async refreshAlias() { const addresses = await this.deviceApi.request(new _deviceApiCalls.EmailProtectionRefreshPrivateAddressCall({})); this.storeLocalAddresses(addresses); } - async getAddresses() { const addresses = await this.deviceApi.request(new _deviceApiCalls.EmailProtectionGetAddressesCall({})); this.storeLocalAddresses(addresses); return addresses; } - } - exports.WindowsInterface = WindowsInterface; -},{"../UI/controllers/OverlayUIController.js":55,"../deviceApiCalls/__generated__/deviceApiCalls.js":63,"./InterfacePrototype.js":25}],27:[function(require,module,exports){ +},{"../UI/controllers/OverlayUIController.js":57,"../deviceApiCalls/__generated__/deviceApiCalls.js":65,"./InterfacePrototype.js":27}],29:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.WindowsOverlayDeviceInterface = void 0; - var _InterfacePrototype = _interopRequireDefault(require("./InterfacePrototype.js")); - var _HTMLTooltipUIController = require("../UI/controllers/HTMLTooltipUIController.js"); - var _deviceApiCalls = require("../deviceApiCalls/__generated__/deviceApiCalls.js"); - var _overlayApi = require("./overlayApi.js"); - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - /** * This subclass is designed to separate code that *only* runs inside the * Windows Overlay into a single place. @@ -9565,17 +9049,18 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope * this is another DeviceInterface */ class WindowsOverlayDeviceInterface extends _InterfacePrototype.default { - constructor() { - super(...arguments); - - _defineProperty(this, "stripCredentials", false); - - _defineProperty(this, "overlay", (0, _overlayApi.overlayApi)(this)); - - _defineProperty(this, "previousScreenX", 0); + /** + * Mark top frame as not stripping credential data + * @type {boolean} + */ + stripCredentials = false; - _defineProperty(this, "previousScreenY", 0); - } + /** + * overlay API helpers + */ + overlay = (0, _overlayApi.overlayApi)(this); + previousScreenX = 0; + previousScreenY = 0; /** * Because we're running inside the Overlay, we always create the HTML @@ -9586,9 +9071,7 @@ class WindowsOverlayDeviceInterface extends _InterfacePrototype.default { */ createUIController() { return new _HTMLTooltipUIController.HTMLTooltipUIController({ - tooltipKind: - /** @type {const} */ - 'modern', + tooltipKind: /** @type {const} */'modern', device: this }, { wrapperClass: 'top-autofill', @@ -9596,14 +9079,12 @@ class WindowsOverlayDeviceInterface extends _InterfacePrototype.default { setSize: details => this.deviceApi.notify(new _deviceApiCalls.SetSizeCall(details)), remove: async () => this._closeAutofillParent(), testMode: this.isTestMode(), - /** * Note: This is needed because Mutation observer didn't support visibility checks on Windows */ checkVisibility: false }); } - addDeviceListeners() { /** * On Windows (vs. MacOS) we can use the built-in `mousemove` @@ -9613,58 +9094,51 @@ class WindowsOverlayDeviceInterface extends _InterfacePrototype.default { * page load every time it's opened. */ window.addEventListener('mousemove', event => { - var _this$uiController, _this$uiController$ge; - // Don't set focus if the mouse hasn't moved ever // This is to avoid clickjacking where an attacker puts the pulldown under the cursor // and tricks the user into clicking - if (!this.previousScreenX && !this.previousScreenY || // if no previous coords + if (!this.previousScreenX && !this.previousScreenY || + // if no previous coords this.previousScreenX === event.screenX && this.previousScreenY === event.screenY // or the mouse hasn't moved ) { this.previousScreenX = event.screenX; this.previousScreenY = event.screenY; return; } - - const activeTooltip = (_this$uiController = this.uiController) === null || _this$uiController === void 0 ? void 0 : (_this$uiController$ge = _this$uiController.getActiveTooltip) === null || _this$uiController$ge === void 0 ? void 0 : _this$uiController$ge.call(_this$uiController); - activeTooltip === null || activeTooltip === void 0 ? void 0 : activeTooltip.focus(event.x, event.y); + const activeTooltip = this.uiController?.getActiveTooltip?.(); + activeTooltip?.focus(event.x, event.y); this.previousScreenX = event.screenX; this.previousScreenY = event.screenY; }); return super.addDeviceListeners(); } + /** * @returns {Promise} */ - - async _closeAutofillParent() { return this.deviceApi.notify(new _deviceApiCalls.CloseAutofillParentCall(null)); } + /** * @returns {Promise} */ - - openManagePasswords() { return this.deviceApi.notify(new _deviceApiCalls.OpenManagePasswordsCall({})); } /** * @returns {Promise} */ - - openManageCreditCards() { return this.deviceApi.notify(new _deviceApiCalls.OpenManageCreditCardsCall({})); } /** * @returns {Promise} */ - - openManageIdentities() { return this.deviceApi.notify(new _deviceApiCalls.OpenManageIdentitiesCall({})); } + /** * Since we're running inside the Overlay we can limit what happens here to * be only things that are needed to power the HTML Tooltip @@ -9672,25 +9146,21 @@ class WindowsOverlayDeviceInterface extends _InterfacePrototype.default { * @override * @returns {Promise} */ - - async setupAutofill() { const loggedIn = await this._getIsLoggedIn(); - if (loggedIn) { await this.getAddresses(); } - - const response = await this.deviceApi.request(new _deviceApiCalls.GetAutofillInitDataCall(null)); // @ts-ignore - + const response = await this.deviceApi.request(new _deviceApiCalls.GetAutofillInitDataCall(null)); + // @ts-ignore this.storeLocalData(response); } - async postInit() { // setup overlay API pieces this.overlay.showImmediately(); super.postInit(); } + /** * In the top-frame scenario, we send a message to the native * side to indicate a selection. Once received, the native side will store that selection so that a @@ -9700,64 +9170,53 @@ class WindowsOverlayDeviceInterface extends _InterfacePrototype.default { * @param {IdentityObject|CreditCardObject|CredentialsObject|{email:string, id: string}} data * @param {string} type */ - - async selectedDetail(data, type) { return this.overlay.selectedDetail(data, type); } + /** * Email Protection calls */ - async _getIsLoggedIn() { const isLoggedIn = await this.deviceApi.request(new _deviceApiCalls.EmailProtectionGetIsLoggedInCall({})); - this.isDeviceSignedIn = () => isLoggedIn; - return isLoggedIn; } - async getAddresses() { const addresses = await this.deviceApi.request(new _deviceApiCalls.EmailProtectionGetAddressesCall({})); this.storeLocalAddresses(addresses); return addresses; } + /** * Gets a single identity obj once the user requests it * @param {Number} id * @returns {Promise<{success: IdentityObject|undefined}>} */ - - getAutofillIdentity(id) { const identity = this.getLocalIdentities().find(_ref => { let { id: identityId } = _ref; - return "".concat(identityId) === "".concat(id); + return `${identityId}` === `${id}`; }); return Promise.resolve({ success: identity }); } - } - exports.WindowsOverlayDeviceInterface = WindowsOverlayDeviceInterface; -},{"../UI/controllers/HTMLTooltipUIController.js":53,"../deviceApiCalls/__generated__/deviceApiCalls.js":63,"./InterfacePrototype.js":25,"./overlayApi.js":29}],28:[function(require,module,exports){ +},{"../UI/controllers/HTMLTooltipUIController.js":55,"../deviceApiCalls/__generated__/deviceApiCalls.js":65,"./InterfacePrototype.js":27,"./overlayApi.js":31}],30:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.initFormSubmissionsApi = initFormSubmissionsApi; - var _autofillUtils = require("../autofill-utils.js"); - var _labelUtil = require("../Form/label-util.js"); - /** * This is a single place to contain all functionality relating to form submission detection * @@ -9769,99 +9228,86 @@ function initFormSubmissionsApi(forms, matching) { * Global submit events */ window.addEventListener('submit', e => { - var _forms$get; - // @ts-ignore - return (_forms$get = forms.get(e.target)) === null || _forms$get === void 0 ? void 0 : _forms$get.submitHandler('global submit event'); + return forms.get(e.target)?.submitHandler('global submit event'); }, true); + /** * Global keydown events */ - window.addEventListener('keydown', e => { if (e.key === 'Enter') { const focusedForm = [...forms.values()].find(form => form.hasFocus(e)); - focusedForm === null || focusedForm === void 0 ? void 0 : focusedForm.submitHandler('global keydown + Enter'); + focusedForm?.submitHandler('global keydown + Enter'); } }); + /** * Global pointer down events * @param {PointerEvent} event */ - window.addEventListener('pointerdown', event => { const matchingForm = [...forms.values()].find(form => { - const btns = [...form.submitButtons]; // @ts-ignore - - if (btns.includes(event.target)) return true; // @ts-ignore + const btns = [...form.submitButtons]; + // @ts-ignore + if (btns.includes(event.target)) return true; + // @ts-ignore if (btns.find(btn => btn.contains(event.target))) return true; }); - matchingForm === null || matchingForm === void 0 ? void 0 : matchingForm.submitHandler('global pointerdown event + matching form'); - + matchingForm?.submitHandler('global pointerdown event + matching form'); if (!matchingForm) { - var _event$target, _matching$getDDGMatch, _event$target2; - - const selector = matching.cssSelector('submitButtonSelector') + ', a[href="#"], a[href^=javascript], *[onclick], [class*=button i]'; // check if the click happened on a button - - const button = - /** @type HTMLElement */ - (_event$target = event.target) === null || _event$target === void 0 ? void 0 : _event$target.closest(selector); + const selector = matching.cssSelector('submitButtonSelector') + ', a[href="#"], a[href^=javascript], *[onclick], [class*=button i]'; + // check if the click happened on a button + const button = /** @type HTMLElement */event.target?.closest(selector); if (!button) return; const text = (0, _autofillUtils.getTextShallow)(button) || (0, _labelUtil.extractElementStrings)(button).join(' '); - const hasRelevantText = (_matching$getDDGMatch = matching.getDDGMatcherRegex('submitButtonRegex')) === null || _matching$getDDGMatch === void 0 ? void 0 : _matching$getDDGMatch.test(text); - + const hasRelevantText = matching.getDDGMatcherRegex('submitButtonRegex')?.test(text); if (hasRelevantText && text.length < 25) { // check if there's a form with values const filledForm = [...forms.values()].find(form => form.hasValues()); - - if (filledForm && (0, _autofillUtils.buttonMatchesFormType)( - /** @type HTMLElement */ - button, filledForm)) { - filledForm === null || filledForm === void 0 ? void 0 : filledForm.submitHandler('global pointerdown event + filled form'); + if (filledForm && (0, _autofillUtils.buttonMatchesFormType)( /** @type HTMLElement */button, filledForm)) { + filledForm?.submitHandler('global pointerdown event + filled form'); } - } // TODO: Temporary hack to support Google signin in different languages - // https://app.asana.com/0/1198964220583541/1201650539303898/f - + } - if ( - /** @type HTMLElement */ - (_event$target2 = event.target) !== null && _event$target2 !== void 0 && _event$target2.closest('#passwordNext button, #identifierNext button')) { + // TODO: Temporary hack to support Google signin in different languages + // https://app.asana.com/0/1198964220583541/1201650539303898/f + if ( /** @type HTMLElement */event.target?.closest('#passwordNext button, #identifierNext button')) { // check if there's a form with values const filledForm = [...forms.values()].find(form => form.hasValues()); - filledForm === null || filledForm === void 0 ? void 0 : filledForm.submitHandler('global pointerdown event + google escape hatch'); + filledForm?.submitHandler('global pointerdown event + google escape hatch'); } } }, true); + /** * @type {PerformanceObserver} */ - const observer = new PerformanceObserver(list => { - const entries = list.getEntries().filter(entry => // @ts-ignore why does TS not know about `entry.initiatorType`? + const entries = list.getEntries().filter(entry => + // @ts-ignore why does TS not know about `entry.initiatorType`? ['fetch', 'xmlhttprequest'].includes(entry.initiatorType) && /login|sign-in|signin/.test(entry.name)); if (!entries.length) return; const filledForm = [...forms.values()].find(form => form.hasValues()); - const focusedForm = [...forms.values()].find(form => form.hasFocus()); // If a form is still focused the user is still typing: do nothing - + const focusedForm = [...forms.values()].find(form => form.hasFocus()); + // If a form is still focused the user is still typing: do nothing if (focusedForm) return; - filledForm === null || filledForm === void 0 ? void 0 : filledForm.submitHandler('performance observer'); + filledForm?.submitHandler('performance observer'); }); observer.observe({ entryTypes: ['resource'] }); } -},{"../Form/label-util.js":37,"../autofill-utils.js":59}],29:[function(require,module,exports){ +},{"../Form/label-util.js":39,"../autofill-utils.js":61}],31:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.overlayApi = overlayApi; - var _deviceApiCalls = require("../deviceApiCalls/__generated__/deviceApiCalls.js"); - /** * These are some re-usable parts for handling 'overlays' (like on macOS + Windows) * @@ -9873,11 +9319,10 @@ function overlayApi(device) { * When we are inside an 'overlay' - the HTML tooltip will be opened immediately */ showImmediately() { - var _device$uiController, _device$uiController$; - const topContextData = device.getTopContextData(); - if (!topContextData) throw new Error('unreachable, topContextData should be available'); // Provide dummy values + if (!topContextData) throw new Error('unreachable, topContextData should be available'); + // Provide dummy values const getPosition = () => { return { x: 0, @@ -9885,18 +9330,14 @@ function overlayApi(device) { height: 50, width: 50 }; - }; // Create the tooltip, and set it as active - - - const tooltip = (_device$uiController = device.uiController) === null || _device$uiController === void 0 ? void 0 : (_device$uiController$ = _device$uiController.createTooltip) === null || _device$uiController$ === void 0 ? void 0 : _device$uiController$.call(_device$uiController, getPosition, topContextData); + }; + // Create the tooltip, and set it as active + const tooltip = device.uiController?.createTooltip?.(getPosition, topContextData); if (tooltip) { - var _device$uiController2, _device$uiController3; - - (_device$uiController2 = device.uiController) === null || _device$uiController2 === void 0 ? void 0 : (_device$uiController3 = _device$uiController2.setActiveTooltip) === null || _device$uiController3 === void 0 ? void 0 : _device$uiController3.call(_device$uiController2, tooltip); + device.uiController?.setActiveTooltip?.(tooltip); } }, - /** * @param {IdentityObject|CreditCardObject|CredentialsObject|{email:string, id: string}} data * @param {string} type @@ -9909,117 +9350,77 @@ function overlayApi(device) { }); const entries = Object.fromEntries(detailsEntries); /** @link {import("../deviceApiCalls/schemas/getAutofillData.result.json")} */ - await device.deviceApi.notify(new _deviceApiCalls.SelectedDetailCall({ data: entries, configType: type })); } - }; } -},{"../deviceApiCalls/__generated__/deviceApiCalls.js":63}],30:[function(require,module,exports){ +},{"../deviceApiCalls/__generated__/deviceApiCalls.js":65}],32:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.EmailProtection = void 0; - -function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); } - -function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } } - -function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; } - -function _classApplyDescriptorSet(receiver, descriptor, value) { if (descriptor.set) { descriptor.set.call(receiver, value); } else { if (!descriptor.writable) { throw new TypeError("attempted to set read only private field"); } descriptor.value = value; } } - -function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); } - -function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); } - -function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; } - -var _previous = /*#__PURE__*/new WeakMap(); - /** * Use this as place to store any state or functionality related to Email Protection */ class EmailProtection { /** @type {string|null} */ + #previous = null; /** @param {import("./DeviceInterface/InterfacePrototype").default} device */ constructor(device) { - _classPrivateFieldInitSpec(this, _previous, { - writable: true, - value: null - }); - this.device = device; } - /** @returns {string|null} */ - + /** @returns {string|null} */ get lastGenerated() { - return _classPrivateFieldGet(this, _previous); + return this.#previous; } + /** * Store the last received email address * @param {string} emailAddress */ - - storeReceived(emailAddress) { - _classPrivateFieldSet(this, _previous, emailAddress); - + this.#previous = emailAddress; return emailAddress; } - } - exports.EmailProtection = EmailProtection; -},{}],31:[function(require,module,exports){ +},{}],33:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Form = void 0; - var _FormAnalyzer = _interopRequireDefault(require("./FormAnalyzer.js")); - var _autofillUtils = require("../autofill-utils.js"); - var _matching = require("./matching.js"); - var _inputStyles = require("./inputStyles.js"); - var _inputTypeConfig = require("./inputTypeConfig.js"); - var _formatters = require("./formatters.js"); - var _constants = require("../constants.js"); - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - const { ATTR_AUTOFILL, ATTR_INPUT_TYPE, MAX_FORM_MUT_OBS_COUNT, MAX_INPUTS_PER_FORM } = _constants.constants; - class Form { /** @type {import("../Form/matching").Matching} */ - + matching; /** @type {HTMLElement} */ - + form; /** @type {HTMLInputElement | null} */ - + activeInput; /** * @param {HTMLElement} form * @param {HTMLInputElement|HTMLSelectElement} input @@ -10029,19 +9430,12 @@ class Form { */ constructor(form, input, deviceInterface, matching) { let shouldAutoprompt = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false; - - _defineProperty(this, "matching", void 0); - - _defineProperty(this, "form", void 0); - - _defineProperty(this, "activeInput", void 0); - this.form = form; this.matching = matching || (0, _matching.createMatching)(); this.formAnalyzer = new _FormAnalyzer.default(form, input, matching); this.device = deviceInterface; - /** @type Record<'all' | SupportedMainTypes, Set> */ + /** @type Record<'all' | SupportedMainTypes, Set> */ this.inputs = { all: new Set(), credentials: new Set(), @@ -10051,16 +9445,16 @@ class Form { }; this.touched = new Set(); this.listeners = new Set(); - this.activeInput = null; // We set this to true to skip event listeners while we're autofilling - + this.activeInput = null; + // We set this to true to skip event listeners while we're autofilling this.isAutofilling = false; this.handlerExecuted = false; this.shouldPromptToStoreData = true; this.shouldAutoSubmit = this.device.globalConfig.isMobileApp; + /** * @type {IntersectionObserver | null} */ - this.intObs = new IntersectionObserver(entries => { for (const entry of entries) { if (!entry.isIntersecting) this.removeTooltip(); @@ -10073,7 +9467,6 @@ class Form { }; this.mutObs = new MutationObserver(records => { const anythingRemoved = records.some(record => record.removedNodes.length > 0); - if (anythingRemoved) { // Must check for inputs because a parent may be removed and not show up in record.removedNodes if ([...this.inputs.all].some(input => !input.isConnected)) { @@ -10082,15 +9475,16 @@ class Form { this.formAnalyzer = new _FormAnalyzer.default(this.form, input, this.matching); this.recategorizeAllInputs(); }); - this.mutObsCount++; // If the form mutates too much, disconnect to avoid performance issues - + this.mutObsCount++; + // If the form mutates too much, disconnect to avoid performance issues if (this.mutObsCount >= MAX_FORM_MUT_OBS_COUNT) { this.mutObs.disconnect(); } } } - }); // This ensures we fire the handler again if the form is changed + }); + // This ensures we fire the handler again if the form is changed this.addListener(form, 'input', () => { if (!this.isAutofilling) { this.handlerExecuted = false; @@ -10100,160 +9494,129 @@ class Form { this.categorizeInputs(); this.mutObs.observe(this.form, this.mutObsConfig); this.logFormInfo(); - if (shouldAutoprompt) { this.promptLoginIfNeeded(); } } - get isLogin() { return this.formAnalyzer.isLogin; } - get isSignup() { return this.formAnalyzer.isSignup; } - get isHybrid() { return this.formAnalyzer.isHybrid; } - get isCCForm() { return this.formAnalyzer.isCCForm(); } - logFormInfo() { if (!(0, _autofillUtils.shouldLog)()) return; - console.log("Form type: %c".concat(this.getFormType()), 'font-weight: bold'); + console.log(`Form type: %c${this.getFormType()}`, 'font-weight: bold'); console.log('Signals: ', this.formAnalyzer.signals); console.log('Wrapping element: ', this.form); console.log('Inputs: ', this.inputs); console.log('Submit Buttons: ', this.submitButtons); } - getFormType() { - if (this.isHybrid) return "hybrid (hybrid score: ".concat(this.formAnalyzer.hybridSignal, ", score: ").concat(this.formAnalyzer.autofillSignal, ")"); - if (this.isLogin) return "login (score: ".concat(this.formAnalyzer.autofillSignal, ", hybrid score: ").concat(this.formAnalyzer.hybridSignal, ")"); - if (this.isSignup) return "signup (score: ".concat(this.formAnalyzer.autofillSignal, ", hybrid score: ").concat(this.formAnalyzer.hybridSignal, ")"); + if (this.isHybrid) return `hybrid (hybrid score: ${this.formAnalyzer.hybridSignal}, score: ${this.formAnalyzer.autofillSignal})`; + if (this.isLogin) return `login (score: ${this.formAnalyzer.autofillSignal}, hybrid score: ${this.formAnalyzer.hybridSignal})`; + if (this.isSignup) return `signup (score: ${this.formAnalyzer.autofillSignal}, hybrid score: ${this.formAnalyzer.hybridSignal})`; return 'something went wrong'; } + /** * Checks if the form element contains the activeElement or the event target * @return {boolean} * @param {KeyboardEvent | null} [e] */ - - hasFocus(e) { - return this.form.contains(document.activeElement) || this.form.contains( - /** @type HTMLElement */ - e === null || e === void 0 ? void 0 : e.target); + return this.form.contains(document.activeElement) || this.form.contains( /** @type HTMLElement */e?.target); } - submitHandler() { - var _this$device$postSubm, _this$device; - let via = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'unknown'; - if (this.device.globalConfig.isDDGTestMode) { console.log('Form.submitHandler via:', via, this); } - if (this.handlerExecuted) return; const values = this.getValuesReadyForStorage(); - (_this$device$postSubm = (_this$device = this.device).postSubmit) === null || _this$device$postSubm === void 0 ? void 0 : _this$device$postSubm.call(_this$device, values, this); // mark this form as being handled + this.device.postSubmit?.(values, this); + // mark this form as being handled this.handlerExecuted = true; } + /** * Reads the values from the form without preparing to store them * @return {InternalDataStorageObject} */ - - getRawValues() { const formValues = [...this.inputs.credentials, ...this.inputs.identities, ...this.inputs.creditCards].reduce((output, inputEl) => { - var _output$mainType, _value; - const mainType = (0, _matching.getInputMainType)(inputEl); const subtype = (0, _matching.getInputSubtype)(inputEl); - let value = inputEl.value || ((_output$mainType = output[mainType]) === null || _output$mainType === void 0 ? void 0 : _output$mainType[subtype]); - + let value = inputEl.value || output[mainType]?.[subtype]; if (subtype === 'addressCountryCode') { value = (0, _formatters.inferCountryCodeFromElement)(inputEl); - } // Discard passwords that are shorter than 4 characters - - - if (subtype === 'password' && ((_value = value) === null || _value === void 0 ? void 0 : _value.length) <= 3) { + } + // Discard passwords that are shorter than 4 characters + if (subtype === 'password' && value?.length <= 3) { value = undefined; } - if (value) { output[mainType][subtype] = value; } - return output; }, { credentials: {}, creditCards: {}, identities: {} }); - if (formValues.credentials.password && !formValues.credentials.username && !formValues.identities.emailAddress) { // If we have a password but no username, let's search further - const hiddenFields = - /** @type [HTMLInputElement] */ - [...this.form.querySelectorAll('input[type=hidden]')]; + const hiddenFields = /** @type [HTMLInputElement] */[...this.form.querySelectorAll('input[type=hidden]')]; const probableField = hiddenFields.find(field => { - var _this$matching$getDDG; - - const regex = new RegExp('email|' + ((_this$matching$getDDG = this.matching.getDDGMatcherRegex('username')) === null || _this$matching$getDDG === void 0 ? void 0 : _this$matching$getDDG.source)); + const regex = new RegExp('email|' + this.matching.getDDGMatcherRegex('username')?.source); const attributeText = field.id + ' ' + field.name; - return regex === null || regex === void 0 ? void 0 : regex.test(attributeText); + return regex?.test(attributeText); }); - - if (probableField !== null && probableField !== void 0 && probableField.value) { + if (probableField?.value) { formValues.credentials.username = probableField.value; - } else if ( // If a form has phone + password(s) fields, save the phone as username + } else if ( + // If a form has phone + password(s) fields, save the phone as username formValues.identities.phone && this.inputs.all.size - this.inputs.unknown.size < 4) { formValues.credentials.username = formValues.identities.phone; } else { // If we still don't have a username, try scanning the form's text for an email address this.form.querySelectorAll(this.matching.cssSelector('safeUniversalSelector')).forEach(el => { - var _elText$match; - - const elText = (0, _autofillUtils.getTextShallow)(el); // Ignore long texts to avoid false positives - + const elText = (0, _autofillUtils.getTextShallow)(el); + // Ignore long texts to avoid false positives if (elText.length > 70) return; - const emailOrUsername = (_elText$match = elText.match( // https://www.emailregex.com/ - /[a-zA-Z\d.!#$%&’*+/=?^_`{|}~-]+@[a-zA-Z\d-]+(?:\.[a-zA-Z\d-]+)*/)) === null || _elText$match === void 0 ? void 0 : _elText$match[0]; - + const emailOrUsername = elText.match( + // https://www.emailregex.com/ + /[a-zA-Z\d.!#$%&’*+/=?^_`{|}~-]+@[a-zA-Z\d-]+(?:\.[a-zA-Z\d-]+)*/)?.[0]; if (emailOrUsername) { formValues.credentials.username = emailOrUsername; } }); } } - return formValues; } + /** * Return form values ready for storage * @returns {DataStorageObject} */ - - getValuesReadyForStorage() { const formValues = this.getRawValues(); return (0, _formatters.prepareFormValuesForStorage)(formValues); } + /** * Determine if the form has values we want to store in the device * @param {DataStorageObject} [values] * @return {boolean} */ - - hasValues(values) { const { credentials, @@ -10262,26 +9625,17 @@ class Form { } = values || this.getValuesReadyForStorage(); return Boolean(credentials || creditCards || identities); } - async removeTooltip() { - var _this$intObs; - const tooltip = this.device.isTooltipActive(); - if (this.isAutofilling || !tooltip) { return; } - await this.device.removeTooltip(); - (_this$intObs = this.intObs) === null || _this$intObs === void 0 ? void 0 : _this$intObs.disconnect(); + this.intObs?.disconnect(); } - showingTooltip(input) { - var _this$intObs2; - - (_this$intObs2 = this.intObs) === null || _this$intObs2 === void 0 ? void 0 : _this$intObs2.observe(input); + this.intObs?.observe(input); } - removeInputHighlight(input) { if (!input.classList.contains('ddg-autofilled')) return; (0, _autofillUtils.removeInlineStyles)(input, (0, _inputStyles.getIconStylesAutofilled)(input, this)); @@ -10291,31 +9645,27 @@ class Form { input.classList.remove('ddg-autofilled'); this.addAutofillStyles(input); } - resetIconStylesToInitial() { const input = this.activeInput; - if (input) { const initialStyles = (0, _inputStyles.getIconStylesBase)(input, this); (0, _autofillUtils.addInlineStyles)(input, initialStyles); } } - removeAllHighlights(e, dataType) { // This ensures we are not removing the highlight ourselves when autofilling more than once - if (e && !e.isTrusted) return; // If the user has changed the value, we prompt to update the stored data + if (e && !e.isTrusted) return; + // If the user has changed the value, we prompt to update the stored data this.shouldPromptToStoreData = true; this.execOnInputs(input => this.removeInputHighlight(input), dataType); } - removeInputDecoration(input) { (0, _autofillUtils.removeInlineStyles)(input, (0, _inputStyles.getIconStylesBase)(input, this)); (0, _autofillUtils.removeInlineStyles)(input, (0, _inputStyles.getIconStylesAlternate)(input, this)); input.removeAttribute(ATTR_AUTOFILL); input.removeAttribute(ATTR_INPUT_TYPE); } - removeAllDecorations() { this.execOnInputs(input => this.removeInputDecoration(input)); this.listeners.forEach(_ref => { @@ -10328,7 +9678,6 @@ class Form { return el.removeEventListener(type, fn, opts); }); } - redecorateAllInputs() { this.removeAllDecorations(); this.execOnInputs(input => { @@ -10337,11 +9686,10 @@ class Form { } }); } + /** * Removes all scoring attributes from the inputs and deletes them from memory */ - - forgetAllInputs() { this.execOnInputs(input => { input.removeAttribute(ATTR_AUTOFILL); @@ -10349,18 +9697,16 @@ class Form { }); Object.values(this.inputs).forEach(inputSet => inputSet.clear()); } + /** * Resets our input scoring and starts from scratch */ - - recategorizeAllInputs() { this.initialScanComplete = false; this.removeAllDecorations(); this.forgetAllInputs(); this.categorizeInputs(); } - resetAllInputs() { this.execOnInputs(input => { (0, _autofillUtils.setValue)(input, '', this.device.globalConfig); @@ -10369,12 +9715,10 @@ class Form { if (this.activeInput) this.activeInput.focus(); this.matching.clear(); } - dismissTooltip() { this.removeTooltip(); - } // This removes all listeners to avoid memory leaks and weird behaviours - - + } + // This removes all listeners to avoid memory leaks and weird behaviours destroy() { this.removeAllDecorations(); this.removeTooltip(); @@ -10383,21 +9727,16 @@ class Form { this.matching.clear(); this.intObs = null; } - categorizeInputs() { const selector = this.matching.cssSelector('formInputsSelector'); - if (this.form.matches(selector)) { this.addInput(this.form); } else { - let foundInputs = this.form.querySelectorAll(selector); // If the markup is broken form.querySelectorAll may not return the fields, so we select from the parent - + let foundInputs = this.form.querySelectorAll(selector); + // If the markup is broken form.querySelectorAll may not return the fields, so we select from the parent if (foundInputs.length === 0 && this.form instanceof HTMLFormElement && this.form.length > 0) { - var _this$form$parentElem; - - foundInputs = ((_this$form$parentElem = this.form.parentElement) === null || _this$form$parentElem === void 0 ? void 0 : _this$form$parentElem.querySelectorAll(selector)) || foundInputs; + foundInputs = this.form.parentElement?.querySelectorAll(selector) || foundInputs; } - if (foundInputs.length < MAX_INPUTS_PER_FORM) { foundInputs.forEach(input => this.addInput(input)); } else { @@ -10406,89 +9745,81 @@ class Form { } } } - this.initialScanComplete = true; } - get submitButtons() { const selector = this.matching.cssSelector('submitButtonSelector'); - const allButtons = - /** @type {HTMLElement[]} */ - [...this.form.querySelectorAll(selector)]; + const allButtons = /** @type {HTMLElement[]} */[...this.form.querySelectorAll(selector)]; return allButtons.filter(btn => (0, _autofillUtils.isPotentiallyViewable)(btn) && (0, _autofillUtils.isLikelyASubmitButton)(btn, this.matching) && (0, _autofillUtils.buttonMatchesFormType)(btn, this)); } - attemptSubmissionIfNeeded() { - if (!this.isLogin || // Only submit login forms + if (!this.isLogin || + // Only submit login forms this.submitButtons.length > 1 // Do not submit if we're unsure about the submit button - ) return; // check for visible empty fields before attemtping submission - // this is to avoid loops where a captcha keeps failing for the user + ) return; + // check for visible empty fields before attemtping submission + // this is to avoid loops where a captcha keeps failing for the user let isThereAnEmptyVisibleField = false; this.execOnInputs(input => { if (input.value === '' && (0, _autofillUtils.isPotentiallyViewable)(input)) isThereAnEmptyVisibleField = true; }, 'all', false); - if (isThereAnEmptyVisibleField) return; // We're not using .submit() to minimise breakage with client-side forms + if (isThereAnEmptyVisibleField) return; + // We're not using .submit() to minimise breakage with client-side forms this.submitButtons.forEach(button => { if ((0, _autofillUtils.isPotentiallyViewable)(button)) { button.click(); } }); } + /** * Executes a function on input elements. Can be limited to certain element types * @param {(input: HTMLInputElement|HTMLSelectElement) => void} fn * @param {'all' | SupportedMainTypes} inputType * @param {boolean} shouldCheckForDecorate */ - - execOnInputs(fn) { let inputType = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'all'; let shouldCheckForDecorate = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true; const inputs = this.inputs[inputType]; - for (const input of inputs) { - let canExecute = true; // sometimes we want to execute even if we didn't decorate - + let canExecute = true; + // sometimes we want to execute even if we didn't decorate if (shouldCheckForDecorate) { canExecute = (0, _inputTypeConfig.isFieldDecorated)(input); } - if (canExecute) fn(input); } } - addInput(input) { - var _this$device$settings; - - if (this.inputs.all.has(input)) return this; // If the form has too many inputs, destroy everything to avoid performance issues + if (this.inputs.all.has(input)) return this; + // If the form has too many inputs, destroy everything to avoid performance issues if (this.inputs.all.size > MAX_INPUTS_PER_FORM) { if ((0, _autofillUtils.shouldLog)()) { console.log('The form has too many inputs, destroying.'); } - this.destroy(); return this; - } // When new inputs are added after the initial scan, reanalyze the whole form - + } + // When new inputs are added after the initial scan, reanalyze the whole form if (this.initialScanComplete) { this.formAnalyzer = new _FormAnalyzer.default(this.form, input, this.matching); this.recategorizeAllInputs(); return this; - } // Nothing to do with 1-character fields - + } + // Nothing to do with 1-character fields if (input.maxLength === 1) return this; this.inputs.all.add(input); const opts = { isLogin: this.isLogin, isHybrid: this.isHybrid, isCCForm: this.isCCForm, - hasCredentials: Boolean((_this$device$settings = this.device.settings.availableInputTypes.credentials) === null || _this$device$settings === void 0 ? void 0 : _this$device$settings.username), + hasCredentials: Boolean(this.device.settings.availableInputTypes.credentials?.username), supportsIdentitiesAutofill: this.device.settings.featureToggles.inputType_identities }; this.matching.setInputType(input, this.form, opts); @@ -10497,6 +9828,7 @@ class Form { this.decorateInput(input); return this; } + /** * Adds event listeners and keeps track of them for subsequent removal * @param {HTMLElement} el @@ -10504,8 +9836,6 @@ class Form { * @param {(Event) => void} fn * @param {AddEventListenerOptions} [opts] */ - - addListener(el, type, fn, opts) { el.addEventListener(type, fn, opts); this.listeners.add({ @@ -10515,7 +9845,6 @@ class Form { opts }); } - addAutofillStyles(input) { const initialStyles = (0, _inputStyles.getIconStylesBase)(input, this); const activeStyles = (0, _inputStyles.getIconStylesAlternate)(input, this); @@ -10525,20 +9854,18 @@ class Form { onMouseLeave: initialStyles }; } + /** * Decorate here means adding listeners and an optional icon * @param {HTMLInputElement} input * @returns {Promise
} */ - - async decorateInput(input) { const config = (0, _inputTypeConfig.getInputConfig)(input); const shouldDecorate = await config.shouldDecorate(input, this); if (!shouldDecorate) return this; input.setAttribute(ATTR_AUTOFILL, 'true'); const hasIcon = !!config.getIconBase(input, this); - if (hasIcon) { const { onMouseMove, @@ -10546,7 +9873,6 @@ class Form { } = this.addAutofillStyles(input); this.addListener(input, 'mousemove', e => { if ((0, _autofillUtils.wasAutofilledByChrome)(input)) return; - if ((0, _autofillUtils.isEventWithinDax)(e, e.target)) { (0, _autofillUtils.addInlineStyles)(e.target, { 'cursor': 'pointer', @@ -10555,10 +9881,11 @@ class Form { } else { (0, _autofillUtils.removeInlineStyles)(e.target, { 'cursor': 'pointer' - }); // Only overwrite active icon styles if tooltip is closed - + }); + // Only overwrite active icon styles if tooltip is closed if (!this.device.isTooltipActive()) { - (0, _autofillUtils.addInlineStyles)(e.target, { ...onMouseLeave + (0, _autofillUtils.addInlineStyles)(e.target, { + ...onMouseLeave }); } } @@ -10566,20 +9893,20 @@ class Form { this.addListener(input, 'mouseleave', e => { (0, _autofillUtils.removeInlineStyles)(e.target, { 'cursor': 'pointer' - }); // Only overwrite active icon styles if tooltip is closed - + }); + // Only overwrite active icon styles if tooltip is closed if (!this.device.isTooltipActive()) { - (0, _autofillUtils.addInlineStyles)(e.target, { ...onMouseLeave + (0, _autofillUtils.addInlineStyles)(e.target, { + ...onMouseLeave }); } }); } + /** * @param {PointerEvent} e * @returns {{ x: number; y: number; } | undefined} */ - - function getMainClickCoords(e) { if (!e.isTrusted) return; const isMainMouseButton = e.button === 0; @@ -10589,86 +9916,74 @@ class Form { y: e.clientY }; } + /** * @param {Event} e * @param {WeakMap} storedClickCoords * @returns {{ x: number; y: number; } | null} */ - - function getClickCoords(e, storedClickCoords) { // Get click co-ordinates for pointer events // We need click coordinates to position the tooltip when the field is in an iframe if (e.type === 'pointerdown') { - return getMainClickCoords( - /** @type {PointerEvent} */ - e) || null; - } // Reuse a previous click co-ordinates if they exist for this element - + return getMainClickCoords( /** @type {PointerEvent} */e) || null; + } + // Reuse a previous click co-ordinates if they exist for this element const click = storedClickCoords.get(input); storedClickCoords.delete(input); return click || null; - } // Store the click to a label so we can use the click when the field is focused - // Needed to handle label clicks when the form is in an iframe - + } + // Store the click to a label so we can use the click when the field is focused + // Needed to handle label clicks when the form is in an iframe let storedClickCoords = new WeakMap(); let timeout = null; + /** * @param {PointerEvent} e */ - const handlerLabel = e => { - var _e$target, _e$target$closest; - // Look for e.target OR it's closest parent to be a HTMLLabelElement - const control = - /** @type HTMLElement */ - (_e$target = e.target) === null || _e$target === void 0 ? void 0 : (_e$target$closest = _e$target.closest('label')) === null || _e$target$closest === void 0 ? void 0 : _e$target$closest.control; + const control = /** @type HTMLElement */e.target?.closest('label')?.control; if (!control) return; - if (e.isTrusted) { storedClickCoords.set(control, getMainClickCoords(e)); } - - clearTimeout(timeout); // Remove the stored click if the timer expires - + clearTimeout(timeout); + // Remove the stored click if the timer expires timeout = setTimeout(() => { storedClickCoords = new WeakMap(); }, 1000); }; - const handler = e => { // Avoid firing multiple times if (this.isAutofilling || this.device.isTooltipActive()) { return; - } // On mobile, we don't trigger on focus, so here we get the target control on label click - + } + // On mobile, we don't trigger on focus, so here we get the target control on label click const isLabel = e.target instanceof HTMLLabelElement; const input = isLabel ? e.target.control : e.target; if (!input || !this.inputs.all.has(input)) return; if ((0, _autofillUtils.wasAutofilledByChrome)(input)) return; if (!(0, _inputTypeConfig.canBeInteractedWith)(input)) return; const clickCoords = getClickCoords(e, storedClickCoords); - if (e.type === 'pointerdown') { // Only allow real user clicks with co-ordinates through if (!e.isTrusted || !clickCoords) return; } - if (this.shouldOpenTooltip(e, input)) { - const iconClicked = (0, _autofillUtils.isEventWithinDax)(e, input); // On mobile and extensions we don't trigger the focus event to avoid + const iconClicked = (0, _autofillUtils.isEventWithinDax)(e, input); + // On mobile and extensions we don't trigger the focus event to avoid // keyboard flashing and conflicts with browsers' own tooltips - - if ((this.device.globalConfig.isMobileApp || this.device.globalConfig.isExtension) && // Avoid the icon capturing clicks on small fields making it impossible to focus + if ((this.device.globalConfig.isMobileApp || this.device.globalConfig.isExtension) && + // Avoid the icon capturing clicks on small fields making it impossible to focus input.offsetWidth > 50 && iconClicked) { e.preventDefault(); e.stopImmediatePropagation(); input.blur(); } - this.touched.add(input); this.device.attachTooltip({ form: this, @@ -10685,13 +10000,10 @@ class Form { (0, _autofillUtils.addInlineStyles)(input, activeStyles); } }; - if (!(input instanceof HTMLSelectElement)) { - var _input$labels; - const events = ['pointerdown']; if (!this.device.globalConfig.isMobileApp) events.push('focus'); - (_input$labels = input.labels) === null || _input$labels === void 0 ? void 0 : _input$labels.forEach(label => { + input.labels?.forEach(label => { if (this.device.globalConfig.isMobileApp) { // On mobile devices we don't trigger on focus, so we use the click handler here this.addListener(label, 'pointerdown', handler); @@ -10702,83 +10014,81 @@ class Form { }); events.forEach(ev => this.addListener(input, ev, handler)); } - return this; } - shouldOpenTooltip(e, input) { - var _this$device$inContex; - - if (!(0, _autofillUtils.isPotentiallyViewable)(input)) return false; // Always open if the user has clicked on the Dax icon + if (!(0, _autofillUtils.isPotentiallyViewable)(input)) return false; + // Always open if the user has clicked on the Dax icon if ((0, _autofillUtils.isEventWithinDax)(e, input)) return true; if (this.device.globalConfig.isWindows) return true; const subtype = (0, _matching.getInputSubtype)(input); - const isIncontextSignupAvailable = (_this$device$inContex = this.device.inContextSignup) === null || _this$device$inContex === void 0 ? void 0 : _this$device$inContex.isAvailable(subtype); - + const isIncontextSignupAvailable = this.device.inContextSignup?.isAvailable(subtype); if (this.device.globalConfig.isApp) { - const mainType = (0, _matching.getInputMainType)(input); // Check if, without in-context signup (passed as `null` below), + const mainType = (0, _matching.getInputMainType)(input); + // Check if, without in-context signup (passed as `null` below), // we'd have any other items to show. This lets us know if we're // just showing in-context signup, or with other autofill items. - const hasSavedDetails = this.device.settings.canAutofillType({ mainType, subtype - }, null); // Don't open the tooltip on input focus whenever it'll only show in-context signup + }, null); + // Don't open the tooltip on input focus whenever it'll only show in-context signup if (!hasSavedDetails && isIncontextSignupAvailable) return false; return true; } - if (this.device.globalConfig.isExtension || this.device.globalConfig.isMobileApp) { // Don't open the tooltip on input focus whenever it's showing in-context signup if (isIncontextSignupAvailable) return false; } - return !this.touched.has(input) && !input.classList.contains('ddg-autofilled'); } - autofillInput(input, string, dataType) { // Do not autofill if it's invisible (select elements can be hidden because of custom implementations) - if (input instanceof HTMLInputElement && !(0, _autofillUtils.isPotentiallyViewable)(input)) return; // Do not autofill if it's disabled or readonly to avoid potential breakage - - if (!(0, _inputTypeConfig.canBeInteractedWith)(input)) return; // @ts-ignore + if (input instanceof HTMLInputElement && !(0, _autofillUtils.isPotentiallyViewable)(input)) return; + // Do not autofill if it's disabled or readonly to avoid potential breakage + if (!(0, _inputTypeConfig.canBeInteractedWith)(input)) return; + // @ts-ignore const activeInputSubtype = (0, _matching.getInputSubtype)(this.activeInput); const inputSubtype = (0, _matching.getInputSubtype)(input); - const isEmailAutofill = activeInputSubtype === 'emailAddress' && inputSubtype === 'emailAddress'; // Don't override values for identities, unless it's the current input or we're autofilling email - - if (dataType === 'identities' && // only for identities - input.nodeName !== 'SELECT' && input.value !== '' && // if the input is not empty - this.activeInput !== input && // and this is not the active input + const isEmailAutofill = activeInputSubtype === 'emailAddress' && inputSubtype === 'emailAddress'; + + // Don't override values for identities, unless it's the current input or we're autofilling email + if (dataType === 'identities' && + // only for identities + input.nodeName !== 'SELECT' && input.value !== '' && + // if the input is not empty + this.activeInput !== input && + // and this is not the active input !isEmailAutofill // and we're not auto-filling email ) return; // do not overwrite the value - // If the value is already there, just return + // If the value is already there, just return if (input.value === string) return; const successful = (0, _autofillUtils.setValue)(input, string, this.device.globalConfig); if (!successful) return; input.classList.add('ddg-autofilled'); (0, _autofillUtils.addInlineStyles)(input, (0, _inputStyles.getIconStylesAutofilled)(input, this)); - this.touched.add(input); // If the user changes the value, remove the decoration + this.touched.add(input); + // If the user changes the value, remove the decoration input.addEventListener('input', e => this.removeAllHighlights(e, dataType), { once: true }); } + /** * Autofill method for email protection only * @param {string} alias * @param {'all' | SupportedMainTypes} dataType */ - - autofillEmail(alias) { let dataType = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'identities'; this.isAutofilling = true; this.execOnInputs(input => { const inputSubtype = (0, _matching.getInputSubtype)(input); - if (inputSubtype === 'emailAddress') { this.autofillInput(input, alias, dataType); } @@ -10786,64 +10096,53 @@ class Form { this.isAutofilling = false; this.removeTooltip(); } - autofillData(data, dataType) { - var _this$device$postAuto, _this$device2; - this.isAutofilling = true; this.execOnInputs(input => { const inputSubtype = (0, _matching.getInputSubtype)(input); let autofillData = data[inputSubtype]; - if (inputSubtype === 'expiration' && input instanceof HTMLInputElement) { autofillData = (0, _formatters.getUnifiedExpiryDate)(input, data.expirationMonth, data.expirationYear, this); } - if (inputSubtype === 'expirationYear' && input instanceof HTMLInputElement) { autofillData = (0, _formatters.formatCCYear)(input, autofillData, this); } - if (inputSubtype === 'addressCountryCode') { autofillData = (0, _formatters.getCountryName)(input, data); } - if (autofillData) { this.autofillInput(input, autofillData, dataType); } }, dataType); - this.isAutofilling = false; // After autofill we check if form values match the data provided… + this.isAutofilling = false; + // After autofill we check if form values match the data provided… const formValues = this.getValuesReadyForStorage(); const areAllFormValuesKnown = Object.keys(formValues[dataType] || {}).every(subtype => formValues[dataType][subtype] === data[subtype]); - if (areAllFormValuesKnown) { // …if we know all the values do not prompt to store data - this.shouldPromptToStoreData = false; // reset this to its initial value - + this.shouldPromptToStoreData = false; + // reset this to its initial value this.shouldAutoSubmit = this.device.globalConfig.isMobileApp; } else { // …otherwise we will prompt and do not want to autosubmit because the experience is jarring this.shouldAutoSubmit = false; } - - (_this$device$postAuto = (_this$device2 = this.device).postAutofill) === null || _this$device$postAuto === void 0 ? void 0 : _this$device$postAuto.call(_this$device2, data, dataType, this); + this.device.postAutofill?.(data, dataType, this); this.removeTooltip(); } + /** * Set all inputs of the data type to "touched" * @param {'all' | SupportedMainTypes} dataType */ - - touchAllInputs() { let dataType = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'all'; this.execOnInputs(input => this.touched.add(input), dataType); } - getFirstViableCredentialsInput() { return [...this.inputs.credentials].find(input => (0, _inputTypeConfig.canBeInteractedWith)(input) && (0, _autofillUtils.isPotentiallyViewable)(input)); } - async promptLoginIfNeeded() { if (document.visibilityState !== 'visible' || !this.isLogin) return; const firstCredentialInput = this.getFirstViableCredentialsInput(); @@ -10855,7 +10154,6 @@ class Form { mainType, subtype }); - if (this.device.settings.canAutofillType({ mainType, subtype @@ -10871,10 +10169,9 @@ class Form { height } = this.form.getBoundingClientRect(); const elHCenter = x + width / 2; - const elVCenter = y + height / 2; // This checks that the form is not covered by anything else - + const elVCenter = y + height / 2; + // This checks that the form is not covered by anything else const topMostElementFromPoint = document.elementFromPoint(elHCenter, elVCenter); - if (this.form.contains(topMostElementFromPoint)) { this.execOnInputs(input => { if ((0, _autofillUtils.isPotentiallyViewable)(input)) { @@ -10895,130 +10192,109 @@ class Form { }, 200); } } - } - exports.Form = Form; -},{"../autofill-utils.js":59,"../constants.js":62,"./FormAnalyzer.js":32,"./formatters.js":34,"./inputStyles.js":35,"./inputTypeConfig.js":36,"./matching.js":41}],32:[function(require,module,exports){ +},{"../autofill-utils.js":61,"../constants.js":64,"./FormAnalyzer.js":34,"./formatters.js":36,"./inputStyles.js":37,"./inputTypeConfig.js":38,"./matching.js":43}],34:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; - var _matching = require("./matching.js"); - var _constants = require("../constants.js"); - var _compiledMatchingConfig = require("./matching-config/__generated__/compiled-matching-config.js"); - var _autofillUtils = require("../autofill-utils.js"); - -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - class FormAnalyzer { /** @type HTMLElement */ - + form; /** @type Matching */ - + matching; /** * @param {HTMLElement} form * @param {HTMLInputElement|HTMLSelectElement} input * @param {Matching} [matching] */ constructor(form, input, matching) { - _defineProperty(this, "form", void 0); - - _defineProperty(this, "matching", void 0); - - _defineProperty(this, "_isCCForm", undefined); - this.form = form; this.matching = matching || new _matching.Matching(_compiledMatchingConfig.matchingConfiguration); + /** * The signal is a continuum where negative values imply login and positive imply signup * @type {number} */ - this.autofillSignal = 0; /** * A hybrid form can be either a login or a signup, the site uses a single form for both * @type {number} */ - this.hybridSignal = 0; + /** * Collects the signals for debugging purposes * @type {string[]} */ - this.signals = []; this.evaluateElAttributes(input, 1, true); form ? this.evaluateForm() : this.evaluatePage(); return this; } + /** * Hybrid forms can be used for both login and signup * @returns {boolean} */ - - get isHybrid() { // When marking for hybrid we also want to ensure other signals are weak const areOtherSignalsWeak = Math.abs(this.autofillSignal) < 10; return this.hybridSignal > 0 && areOtherSignalsWeak; } - get isLogin() { if (this.isHybrid) return false; return this.autofillSignal < 0; } - get isSignup() { if (this.isHybrid) return false; return this.autofillSignal >= 0; } + /** * Tilts the scoring towards Signup * @param {number} strength * @param {string} signal * @returns {FormAnalyzer} */ - - increaseSignalBy(strength, signal) { this.autofillSignal += strength; - this.signals.push("".concat(signal, ": +").concat(strength)); + this.signals.push(`${signal}: +${strength}`); return this; } + /** * Tilts the scoring towards Login * @param {number} strength * @param {string} signal * @returns {FormAnalyzer} */ - - decreaseSignalBy(strength, signal) { this.autofillSignal -= strength; - this.signals.push("".concat(signal, ": -").concat(strength)); + this.signals.push(`${signal}: -${strength}`); return this; } + /** * Increases the probability that this is a hybrid form (can be either login or signup) * @param {number} strength * @param {string} signal * @returns {FormAnalyzer} */ - - increaseHybridSignal(strength, signal) { this.hybridSignal += strength; - this.signals.push("".concat(signal, " (hybrid): +").concat(strength)); + this.signals.push(`${signal} (hybrid): +${strength}`); return this; } + /** * Updates the Login<->Signup signal according to the provided parameters * @param {object} p @@ -11030,11 +10306,7 @@ class FormAnalyzer { * @param {boolean} [p.shouldBeConservative] - Should use the conservative signup regex * @returns {FormAnalyzer} */ - - updateSignal(_ref) { - var _this$matching$getDDG, _this$matching$getDDG2, _this$matching$getDDG3; - let { string, strength, @@ -11043,16 +10315,17 @@ class FormAnalyzer { shouldCheckUnifiedForm = false, shouldBeConservative = false } = _ref; - const matchesLogin = /current.?password/i.test(string) || ((_this$matching$getDDG = this.matching.getDDGMatcherRegex('loginRegex')) === null || _this$matching$getDDG === void 0 ? void 0 : _this$matching$getDDG.test(string)) || ((_this$matching$getDDG2 = this.matching.getDDGMatcherRegex('resetPasswordLink')) === null || _this$matching$getDDG2 === void 0 ? void 0 : _this$matching$getDDG2.test(string)); // Check explicitly for unified login/signup forms + const matchesLogin = /current.?password/i.test(string) || this.matching.getDDGMatcherRegex('loginRegex')?.test(string) || this.matching.getDDGMatcherRegex('resetPasswordLink')?.test(string); - if (shouldCheckUnifiedForm && matchesLogin && (_this$matching$getDDG3 = this.matching.getDDGMatcherRegex('conservativeSignupRegex')) !== null && _this$matching$getDDG3 !== void 0 && _this$matching$getDDG3.test(string)) { + // Check explicitly for unified login/signup forms + if (shouldCheckUnifiedForm && matchesLogin && this.matching.getDDGMatcherRegex('conservativeSignupRegex')?.test(string)) { this.increaseHybridSignal(strength, signalType); return this; } - const signupRegexToUse = this.matching.getDDGMatcherRegex(shouldBeConservative ? 'conservativeSignupRegex' : 'signupRegex'); - const matchesSignup = /new.?password/i.test(string) || (signupRegexToUse === null || signupRegexToUse === void 0 ? void 0 : signupRegexToUse.test(string)); // In some cases a login match means the login is somewhere else, i.e. when a link points outside + const matchesSignup = /new.?password/i.test(string) || signupRegexToUse?.test(string); + // In some cases a login match means the login is somewhere else, i.e. when a link points outside if (shouldFlip) { if (matchesLogin) this.increaseSignalBy(strength, signalType); if (matchesSignup) this.decreaseSignalBy(strength, signalType); @@ -11060,53 +10333,45 @@ class FormAnalyzer { if (matchesLogin) this.decreaseSignalBy(strength, signalType); if (matchesSignup) this.increaseSignalBy(strength, signalType); } - return this; } - evaluateElAttributes(el) { let signalStrength = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 3; let isInput = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; Array.from(el.attributes).forEach(attr => { if (attr.name === 'style') return; - const attributeString = "".concat(attr.name, "=").concat(attr.value); + const attributeString = `${attr.name}=${attr.value}`; this.updateSignal({ string: attributeString, strength: signalStrength, - signalType: "".concat(el.name, " attr: ").concat(attributeString), + signalType: `${el.name} attr: ${attributeString}`, shouldCheckUnifiedForm: isInput }); }); } - evaluateUrl() { - var _this$matching$getDDG4, _this$matching$getDDG5; - const path = window.location.pathname; - const matchesLogin = (_this$matching$getDDG4 = this.matching.getDDGMatcherRegex('loginRegex')) === null || _this$matching$getDDG4 === void 0 ? void 0 : _this$matching$getDDG4.test(path); - const matchesSignup = (_this$matching$getDDG5 = this.matching.getDDGMatcherRegex('conservativeSignupRegex')) === null || _this$matching$getDDG5 === void 0 ? void 0 : _this$matching$getDDG5.test(path); // If the url matches both, do nothing: the signal is probably confounding + const matchesLogin = this.matching.getDDGMatcherRegex('loginRegex')?.test(path); + const matchesSignup = this.matching.getDDGMatcherRegex('conservativeSignupRegex')?.test(path); + // If the url matches both, do nothing: the signal is probably confounding if (matchesLogin && matchesSignup) return; - if (matchesLogin) { this.decreaseSignalBy(1, 'url matches login'); } - if (matchesSignup) { this.increaseSignalBy(1, 'url matches signup'); } } - evaluatePageTitle() { const pageTitle = document.title; this.updateSignal({ string: pageTitle, strength: 2, - signalType: "page title: ".concat(pageTitle), + signalType: `page title: ${pageTitle}`, shouldCheckUnifiedForm: true }); } - evaluatePageHeadings() { const headings = document.querySelectorAll('h1, h2, h3, [class*="title"], [id*="title"]'); headings.forEach(_ref2 => { @@ -11117,17 +10382,16 @@ class FormAnalyzer { this.updateSignal({ string: textContent, strength: 0.5, - signalType: "heading: ".concat(textContent), + signalType: `heading: ${textContent}`, shouldCheckUnifiedForm: true, shouldBeConservative: true }); }); } - evaluatePage() { this.evaluatePageTitle(); - this.evaluatePageHeadings(); // Check for submit buttons - + this.evaluatePageHeadings(); + // Check for submit buttons const buttons = document.querySelectorAll(this.matching.cssSelector('submitButtonSelector')); buttons.forEach(button => { // if the button has a form, it's not related to our input, because our input has no form here @@ -11139,25 +10403,22 @@ class FormAnalyzer { } }); } - evaluateElement(el) { const string = (0, _autofillUtils.getTextShallow)(el); - if (el.matches(this.matching.cssSelector('password'))) { // These are explicit signals by the web author, so we weigh them heavily this.updateSignal({ string: el.getAttribute('autocomplete') || el.getAttribute('name') || '', strength: 5, - signalType: "explicit: ".concat(el.getAttribute('autocomplete')) + signalType: `explicit: ${el.getAttribute('autocomplete')}` }); return; - } // check button contents - + } + // check button contents if (el.matches(this.matching.cssSelector('submitButtonSelector') + ', *[class*=button]')) { // If we're confident this is the submit button, it's a stronger signal let likelyASubmit = (0, _autofillUtils.isLikelyASubmitButton)(el, this.matching); - if (likelyASubmit) { this.form.querySelectorAll('input[type=submit], button[type=submit]').forEach(submit => { // If there is another element marked as submit and this is not, flip back to false @@ -11166,148 +10427,134 @@ class FormAnalyzer { } }); } - const strength = likelyASubmit ? 20 : 2; this.updateSignal({ string, strength, - signalType: "submit: ".concat(string) + signalType: `submit: ${string}` }); return; - } // if an external link matches one of the regexes, we assume the match is not pertinent to the current form - - + } + // if an external link matches one of the regexes, we assume the match is not pertinent to the current form if (el instanceof HTMLAnchorElement && el.href && el.getAttribute('href') !== '#' || (el.getAttribute('role') || '').toUpperCase() === 'LINK' || el.matches('button[class*=secondary]')) { - var _this$matching$getDDG6, _this$matching$getDDG7; - let shouldFlip = true; - let strength = 1; // Don't flip forgotten password links - - if ((_this$matching$getDDG6 = this.matching.getDDGMatcherRegex('resetPasswordLink')) !== null && _this$matching$getDDG6 !== void 0 && _this$matching$getDDG6.test(string)) { + let strength = 1; + // Don't flip forgotten password links + if (this.matching.getDDGMatcherRegex('resetPasswordLink')?.test(string)) { shouldFlip = false; strength = 3; - } else if ((_this$matching$getDDG7 = this.matching.getDDGMatcherRegex('loginProvidersRegex')) !== null && _this$matching$getDDG7 !== void 0 && _this$matching$getDDG7.test(string)) { + } else if (this.matching.getDDGMatcherRegex('loginProvidersRegex')?.test(string)) { // Don't flip login providers links shouldFlip = false; } - this.updateSignal({ string, strength, - signalType: "external link: ".concat(string), + signalType: `external link: ${string}`, shouldFlip }); } else { - var _removeExcessWhitespa; - // any other case // only consider the el if it's a small text to avoid noisy disclaimers - if (((_removeExcessWhitespa = (0, _matching.removeExcessWhitespace)(el.textContent)) === null || _removeExcessWhitespa === void 0 ? void 0 : _removeExcessWhitespa.length) < _constants.constants.TEXT_LENGTH_CUTOFF) { + if ((0, _matching.removeExcessWhitespace)(el.textContent)?.length < _constants.constants.TEXT_LENGTH_CUTOFF) { this.updateSignal({ string, strength: 1, - signalType: "generic: ".concat(string), + signalType: `generic: ${string}`, shouldCheckUnifiedForm: true }); } } } - evaluateForm() { // Check page url - this.evaluateUrl(); // Check page title + this.evaluateUrl(); - this.evaluatePageTitle(); // Check form attributes + // Check page title + this.evaluatePageTitle(); - this.evaluateElAttributes(this.form); // Check form contents (noisy elements are skipped with the safeUniversalSelector) + // Check form attributes + this.evaluateElAttributes(this.form); + // Check form contents (noisy elements are skipped with the safeUniversalSelector) this.form.querySelectorAll(this.matching.cssSelector('safeUniversalSelector')).forEach(el => { // Check if element is not hidden. Note that we can't use offsetHeight // nor intersectionObserver, because the element could be outside the // viewport or its parent hidden const displayValue = window.getComputedStyle(el, null).getPropertyValue('display'); if (displayValue !== 'none') this.evaluateElement(el); - }); // A form with many fields is unlikely to be a login form + }); + // A form with many fields is unlikely to be a login form const relevantFields = this.form.querySelectorAll(this.matching.cssSelector('genericTextField')); - if (relevantFields.length >= 4) { this.increaseSignalBy(relevantFields.length * 1.5, 'many fields: it is probably not a login'); - } // If we can't decide at this point, try reading page headings - + } + // If we can't decide at this point, try reading page headings if (this.autofillSignal === 0) { this.evaluatePageHeadings(); } - return this; } - /** @type {undefined|boolean} */ - + /** @type {undefined|boolean} */ + _isCCForm = undefined; /** * Tries to infer if it's a credit card form * @returns {boolean} */ isCCForm() { - var _formEl$textContent; - if (this._isCCForm !== undefined) return this._isCCForm; const formEl = this.form; const ccFieldSelector = this.matching.joinCssSelectors('cc'); - if (!ccFieldSelector) { this._isCCForm = false; return this._isCCForm; } - - const hasCCSelectorChild = formEl.matches(ccFieldSelector) || formEl.querySelector(ccFieldSelector); // If the form contains one of the specific selectors, we have high confidence - + const hasCCSelectorChild = formEl.matches(ccFieldSelector) || formEl.querySelector(ccFieldSelector); + // If the form contains one of the specific selectors, we have high confidence if (hasCCSelectorChild) { this._isCCForm = true; return this._isCCForm; - } // Read form attributes to find a signal - + } + // Read form attributes to find a signal const hasCCAttribute = [...formEl.attributes].some(_ref3 => { let { name, value } = _ref3; - return /(credit|payment).?card/i.test("".concat(name, "=").concat(value)); + return /(credit|payment).?card/i.test(`${name}=${value}`); }); - if (hasCCAttribute) { this._isCCForm = true; return this._isCCForm; - } // Match form textContent against common cc fields (includes hidden labels) - + } - const textMatches = (_formEl$textContent = formEl.textContent) === null || _formEl$textContent === void 0 ? void 0 : _formEl$textContent.match(/(credit|payment).?card(.?number)?|ccv|security.?code|cvv|cvc|csc/ig); // We check for more than one to minimise false positives + // Match form textContent against common cc fields (includes hidden labels) + const textMatches = formEl.textContent?.match(/(credit|payment).?card(.?number)?|ccv|security.?code|cvv|cvc|csc/ig); + // We check for more than one to minimise false positives this._isCCForm = Boolean(textMatches && textMatches.length > 1); return this._isCCForm; } - } +var _default = exports.default = FormAnalyzer; -var _default = FormAnalyzer; -exports.default = _default; - -},{"../autofill-utils.js":59,"../constants.js":62,"./matching-config/__generated__/compiled-matching-config.js":39,"./matching.js":41}],33:[function(require,module,exports){ +},{"../autofill-utils.js":61,"../constants.js":64,"./matching-config/__generated__/compiled-matching-config.js":41,"./matching.js":43}],35:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.COUNTRY_NAMES_TO_CODES = exports.COUNTRY_CODES_TO_NAMES = void 0; - /** * Country names object using 2-letter country codes to reference country name * Derived from the Intl.DisplayNames implementation * @source https://stackoverflow.com/a/70517921/1948947 */ -const COUNTRY_CODES_TO_NAMES = { +const COUNTRY_CODES_TO_NAMES = exports.COUNTRY_CODES_TO_NAMES = { AC: 'Ascension Island', AD: 'Andorra', AE: 'United Arab Emirates', @@ -11588,14 +10835,13 @@ const COUNTRY_CODES_TO_NAMES = { ZW: 'Zimbabwe', ZZ: 'Unknown Region' }; + /** * Country names object using country name to reference 2-letter country codes * Derived from the solution above with * Object.fromEntries(Object.entries(COUNTRY_CODES_TO_NAMES).map(entry => [entry[1], entry[0]])) */ - -exports.COUNTRY_CODES_TO_NAMES = COUNTRY_CODES_TO_NAMES; -const COUNTRY_NAMES_TO_CODES = { +const COUNTRY_NAMES_TO_CODES = exports.COUNTRY_NAMES_TO_CODES = { 'Ascension Island': 'AC', Andorra: 'AD', 'United Arab Emirates': 'AE', @@ -11860,28 +11106,21 @@ const COUNTRY_NAMES_TO_CODES = { Zambia: 'ZM', 'Unknown Region': 'ZZ' }; -exports.COUNTRY_NAMES_TO_CODES = COUNTRY_NAMES_TO_CODES; -},{}],34:[function(require,module,exports){ +},{}],36:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.prepareFormValuesForStorage = exports.inferCountryCodeFromElement = exports.getUnifiedExpiryDate = exports.getMMAndYYYYFromString = exports.getCountryName = exports.getCountryDisplayName = exports.formatPhoneNumber = exports.formatFullName = exports.formatCCYear = void 0; - var _matching = require("./matching.js"); - var _countryNames = require("./countryNames.js"); - -var _templateObject, _templateObject2; - -function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); } - // Matches strings like mm/yy, mm-yyyy, mm-aa, 12 / 2024 -const DATE_SEPARATOR_REGEX = /\b((.)\2{1,3}|\d+)(?\s?[/\s.\-_—–]\s?)((.)\5{1,3}|\d+)\b/i; // Matches 4 non-digit repeated characters (YYYY or AAAA) or 4 digits (2022) - +const DATE_SEPARATOR_REGEX = /\b((.)\2{1,3}|\d+)(?\s?[/\s.\-_—–]\s?)((.)\5{1,3}|\d+)\b/i; +// Matches 4 non-digit repeated characters (YYYY or AAAA) or 4 digits (2022) const FOUR_DIGIT_YEAR_REGEX = /(\D)\1{3}|\d{4}/i; + /** * Format the cc year to best adapt to the input requirements (YY vs YYYY) * @param {HTMLInputElement} input @@ -11889,12 +11128,12 @@ const FOUR_DIGIT_YEAR_REGEX = /(\D)\1{3}|\d{4}/i; * @param {import("./Form").Form} form * @returns {string} */ - const formatCCYear = (input, year, form) => { const selector = form.matching.cssSelector('formInputsSelector'); if (input.maxLength === 4 || (0, _matching.checkPlaceholderAndLabels)(input, FOUR_DIGIT_YEAR_REGEX, form.form, selector)) return year; - return "".concat(Number(year) - 2000); + return `${Number(year) - 2000}`; }; + /** * Get a unified expiry date with separator * @param {HTMLInputElement} input @@ -11903,250 +11142,215 @@ const formatCCYear = (input, year, form) => { * @param {import("./Form").Form} form * @returns {string} */ - - exports.formatCCYear = formatCCYear; - const getUnifiedExpiryDate = (input, month, year, form) => { - var _matchInPlaceholderAn, _matchInPlaceholderAn2; - const formattedYear = formatCCYear(input, year, form); - const paddedMonth = "".concat(month).padStart(2, '0'); + const paddedMonth = `${month}`.padStart(2, '0'); const cssSelector = form.matching.cssSelector('formInputsSelector'); - const separator = ((_matchInPlaceholderAn = (0, _matching.matchInPlaceholderAndLabels)(input, DATE_SEPARATOR_REGEX, form.form, cssSelector)) === null || _matchInPlaceholderAn === void 0 ? void 0 : (_matchInPlaceholderAn2 = _matchInPlaceholderAn.groups) === null || _matchInPlaceholderAn2 === void 0 ? void 0 : _matchInPlaceholderAn2.separator) || '/'; - return "".concat(paddedMonth).concat(separator).concat(formattedYear); + const separator = (0, _matching.matchInPlaceholderAndLabels)(input, DATE_SEPARATOR_REGEX, form.form, cssSelector)?.groups?.separator || '/'; + return `${paddedMonth}${separator}${formattedYear}`; }; - exports.getUnifiedExpiryDate = getUnifiedExpiryDate; - const formatFullName = _ref => { let { firstName = '', middleName = '', lastName = '' } = _ref; - return "".concat(firstName, " ").concat(middleName ? middleName + ' ' : '').concat(lastName).trim(); + return `${firstName} ${middleName ? middleName + ' ' : ''}${lastName}`.trim(); }; + /** * Tries to look up a human-readable country name from the country code * @param {string} locale * @param {string} addressCountryCode * @return {string} - Returns the country code if we can't find a name */ - - exports.formatFullName = formatFullName; - const getCountryDisplayName = (locale, addressCountryCode) => { try { const regionNames = new Intl.DisplayNames([locale], { type: 'region' - }); // Adding this ts-ignore to prevent having to change this implementation. + }); + // Adding this ts-ignore to prevent having to change this implementation. // @ts-ignore - return regionNames.of(addressCountryCode); } catch (e) { return _countryNames.COUNTRY_CODES_TO_NAMES[addressCountryCode] || addressCountryCode; } }; + /** * Tries to infer the element locale or returns 'en' * @param {HTMLInputElement | HTMLSelectElement} el * @return {string | 'en'} */ - - exports.getCountryDisplayName = getCountryDisplayName; +const inferElementLocale = el => el.lang || el.form?.lang || document.body.lang || document.documentElement.lang || 'en'; -const inferElementLocale = el => { - var _el$form; - - return el.lang || ((_el$form = el.form) === null || _el$form === void 0 ? void 0 : _el$form.lang) || document.body.lang || document.documentElement.lang || 'en'; -}; /** * Tries to format the country code into a localised country name * @param {HTMLInputElement | HTMLSelectElement} el * @param {{addressCountryCode?: string}} options */ - - const getCountryName = function (el) { let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; const { addressCountryCode } = options; - if (!addressCountryCode) return ''; // Try to infer the field language or fallback to en + if (!addressCountryCode) return ''; + // Try to infer the field language or fallback to en const elLocale = inferElementLocale(el); - const localisedCountryName = getCountryDisplayName(elLocale, addressCountryCode); // If it's a select el we try to find a suitable match to autofill + const localisedCountryName = getCountryDisplayName(elLocale, addressCountryCode); + // If it's a select el we try to find a suitable match to autofill if (el.nodeName === 'SELECT') { - const englishCountryName = getCountryDisplayName('en', addressCountryCode); // This regex matches both the localised and English country names - - const countryNameRegex = new RegExp(String.raw(_templateObject || (_templateObject = _taggedTemplateLiteral(["", "|", ""])), localisedCountryName.replace(/ /g, '.?'), englishCountryName.replace(/ /g, '.?')), 'i'); - const countryCodeRegex = new RegExp(String.raw(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\b", "\b"], ["\\b", "\\b"])), addressCountryCode), 'i'); // We check the country code first because it's more accurate + const englishCountryName = getCountryDisplayName('en', addressCountryCode); + // This regex matches both the localised and English country names + const countryNameRegex = new RegExp(String.raw`${localisedCountryName.replace(/ /g, '.?')}|${englishCountryName.replace(/ /g, '.?')}`, 'i'); + const countryCodeRegex = new RegExp(String.raw`\b${addressCountryCode}\b`, 'i'); + // We check the country code first because it's more accurate if (el instanceof HTMLSelectElement) { for (const option of el.options) { if (countryCodeRegex.test(option.value)) { return option.value; } } - for (const option of el.options) { if (countryNameRegex.test(option.value) || countryNameRegex.test(option.innerText)) return option.value; } } } - return localisedCountryName; }; + /** * Try to get a map of localised country names to code, or falls back to the English map * @param {HTMLInputElement | HTMLSelectElement} el */ - - exports.getCountryName = getCountryName; - const getLocalisedCountryNamesToCodes = el => { - if (typeof Intl.DisplayNames !== 'function') return _countryNames.COUNTRY_NAMES_TO_CODES; // Try to infer the field language or fallback to en + if (typeof Intl.DisplayNames !== 'function') return _countryNames.COUNTRY_NAMES_TO_CODES; + // Try to infer the field language or fallback to en const elLocale = inferElementLocale(el); return Object.fromEntries(Object.entries(_countryNames.COUNTRY_CODES_TO_NAMES).map(_ref2 => { let [code] = _ref2; return [getCountryDisplayName(elLocale, code), code]; })); }; + /** * Try to infer a country code from an element we identified as identities.addressCountryCode * @param {HTMLInputElement | HTMLSelectElement} el * @return {string} */ - - const inferCountryCodeFromElement = el => { if (_countryNames.COUNTRY_CODES_TO_NAMES[el.value]) return el.value; if (_countryNames.COUNTRY_NAMES_TO_CODES[el.value]) return _countryNames.COUNTRY_NAMES_TO_CODES[el.value]; const localisedCountryNamesToCodes = getLocalisedCountryNamesToCodes(el); if (localisedCountryNamesToCodes[el.value]) return localisedCountryNamesToCodes[el.value]; - if (el instanceof HTMLSelectElement) { - var _el$selectedOptions$; - - const selectedText = (_el$selectedOptions$ = el.selectedOptions[0]) === null || _el$selectedOptions$ === void 0 ? void 0 : _el$selectedOptions$.text; + const selectedText = el.selectedOptions[0]?.text; if (_countryNames.COUNTRY_CODES_TO_NAMES[selectedText]) return selectedText; if (_countryNames.COUNTRY_NAMES_TO_CODES[selectedText]) return localisedCountryNamesToCodes[selectedText]; if (localisedCountryNamesToCodes[selectedText]) return localisedCountryNamesToCodes[selectedText]; } - return ''; }; + /** * Gets separate expiration month and year from a single string * @param {string} expiration * @return {{expirationYear: string, expirationMonth: string}} */ - - exports.inferCountryCodeFromElement = inferCountryCodeFromElement; - const getMMAndYYYYFromString = expiration => { /** @type {string[]} */ const values = expiration.match(/(\d+)/g) || []; - return values === null || values === void 0 ? void 0 : values.reduce((output, current) => { + return values?.reduce((output, current) => { if (Number(current) > 12) { output.expirationYear = current.padStart(4, '20'); } else { output.expirationMonth = current.padStart(2, '0'); } - return output; }, { expirationYear: '', expirationMonth: '' }); }; + /** * @param {InternalDataStorageObject} credentials * @return {boolean} */ - - exports.getMMAndYYYYFromString = getMMAndYYYYFromString; - const shouldStoreCredentials = _ref3 => { let { credentials } = _ref3; return Boolean(credentials.password); }; + /** * @param {InternalDataStorageObject} credentials * @return {boolean} */ - - const shouldStoreIdentities = _ref4 => { let { identities } = _ref4; return Boolean((identities.firstName || identities.fullName) && identities.addressStreet && identities.addressCity); }; + /** * @param {InternalDataStorageObject} credentials * @return {boolean} */ - - const shouldStoreCreditCards = _ref5 => { let { creditCards } = _ref5; if (!creditCards.cardNumber) return false; - if (creditCards.cardSecurityCode) return true; // Some forms (Amazon) don't have the cvv, so we still save if there's the expiration - - if (creditCards.expiration) return true; // Expiration can also be two separate values - + if (creditCards.cardSecurityCode) return true; + // Some forms (Amazon) don't have the cvv, so we still save if there's the expiration + if (creditCards.expiration) return true; + // Expiration can also be two separate values return Boolean(creditCards.expirationYear && creditCards.expirationMonth); }; + /** * Removes formatting characters from phone numbers, only leaves digits and the + sign * @param {String} phone * @returns {String} */ - - const formatPhoneNumber = phone => phone.replaceAll(/[^0-9|+]/g, ''); + /** * Formats form data into an object to send to the device for storage * If values are insufficient for a complete entry, they are discarded * @param {InternalDataStorageObject} formValues * @return {DataStorageObject} */ - - exports.formatPhoneNumber = formatPhoneNumber; - const prepareFormValuesForStorage = formValues => { - var _identities, _identities2; - /** @type {Partial} */ let { credentials, identities, creditCards - } = formValues; // If we have an identity name but not a card name, copy it over there + } = formValues; - if (!creditCards.cardName && ((_identities = identities) !== null && _identities !== void 0 && _identities.fullName || (_identities2 = identities) !== null && _identities2 !== void 0 && _identities2.firstName)) { - var _identities3; - - creditCards.cardName = ((_identities3 = identities) === null || _identities3 === void 0 ? void 0 : _identities3.fullName) || formatFullName(identities); + // If we have an identity name but not a card name, copy it over there + if (!creditCards.cardName && (identities?.fullName || identities?.firstName)) { + creditCards.cardName = identities?.fullName || formatFullName(identities); } + /** Fixes for credentials **/ // Don't store if there isn't enough data - - if (shouldStoreCredentials(formValues)) { // If we don't have a username to match a password, let's see if the email is available if (credentials.password && !credentials.username && identities.emailAddress) { @@ -12155,17 +11359,15 @@ const prepareFormValuesForStorage = formValues => { } else { credentials = undefined; } + /** Fixes for identities **/ // Don't store if there isn't enough data - - if (shouldStoreIdentities(formValues)) { if (identities.fullName) { // when forms have both first/last and fullName we keep the individual values and drop the fullName if (!(identities.firstName && identities.lastName)) { // If the fullname can be easily split into two, we'll store it as first and last const nameParts = identities.fullName.trim().split(/\s+/); - if (nameParts.length === 2) { identities.firstName = nameParts[0]; identities.lastName = nameParts[1]; @@ -12174,23 +11376,18 @@ const prepareFormValuesForStorage = formValues => { identities.firstName = identities.fullName; } } - delete identities.fullName; } - if (identities.phone) { identities.phone = formatPhoneNumber(identities.phone); } } else { identities = undefined; } + /** Fixes for credit cards **/ // Don't store if there isn't enough data - - if (shouldStoreCreditCards(formValues)) { - var _creditCards$expirati; - if (creditCards.expiration) { const { expirationMonth, @@ -12200,35 +11397,29 @@ const prepareFormValuesForStorage = formValues => { creditCards.expirationYear = expirationYear; delete creditCards.expiration; } - - creditCards.expirationYear = (_creditCards$expirati = creditCards.expirationYear) === null || _creditCards$expirati === void 0 ? void 0 : _creditCards$expirati.padStart(4, '20'); - + creditCards.expirationYear = creditCards.expirationYear?.padStart(4, '20'); if (creditCards.cardNumber) { creditCards.cardNumber = creditCards.cardNumber.replace(/\D/g, ''); } } else { creditCards = undefined; } - return { credentials, identities, creditCards }; }; - exports.prepareFormValuesForStorage = prepareFormValuesForStorage; -},{"./countryNames.js":33,"./matching.js":41}],35:[function(require,module,exports){ +},{"./countryNames.js":35,"./matching.js":43}],37:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getIconStylesBase = exports.getIconStylesAutofilled = exports.getIconStylesAlternate = void 0; - var _inputTypeConfig = require("./inputTypeConfig.js"); - /** * Returns the css-ready base64 encoding of the icon for the given input * @param {HTMLInputElement} input @@ -12239,114 +11430,95 @@ var _inputTypeConfig = require("./inputTypeConfig.js"); const getIcon = function (input, form) { let type = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'base'; const config = (0, _inputTypeConfig.getInputConfig)(input); - if (type === 'base') { return config.getIconBase(input, form); } - if (type === 'filled') { return config.getIconFilled(input, form); } - if (type === 'alternate') { return config.getIconAlternate(input, form); } - return ''; }; + /** * Returns an object with styles to be applied inline * @param {HTMLInputElement} input * @param {String} icon * @return {Object} */ - - const getBasicStyles = (input, icon) => ({ // Height must be > 0 to account for fields initially hidden - 'background-size': "auto ".concat(input.offsetHeight <= 30 && input.offsetHeight > 0 ? '100%' : '24px'), + 'background-size': `auto ${input.offsetHeight <= 30 && input.offsetHeight > 0 ? '100%' : '24px'}`, 'background-position': 'center right', 'background-repeat': 'no-repeat', 'background-origin': 'content-box', - 'background-image': "url(".concat(icon, ")"), + 'background-image': `url(${icon})`, 'transition': 'background 0s' }); + /** * Get inline styles for the injected icon, base state * @param {HTMLInputElement} input * @param {import("./Form").Form} form * @return {Object} */ - - const getIconStylesBase = (input, form) => { const icon = getIcon(input, form); if (!icon) return {}; return getBasicStyles(input, icon); }; + /** * Get inline styles for the injected icon, alternate state * @param {HTMLInputElement} input * @param {import("./Form").Form} form * @return {Object} */ - - exports.getIconStylesBase = getIconStylesBase; - const getIconStylesAlternate = (input, form) => { const icon = getIcon(input, form, 'alternate'); if (!icon) return {}; - return { ...getBasicStyles(input, icon) + return { + ...getBasicStyles(input, icon) }; }; + /** * Get inline styles for the injected icon, autofilled state * @param {HTMLInputElement} input * @param {import("./Form").Form} form * @return {Object} */ - - exports.getIconStylesAlternate = getIconStylesAlternate; - const getIconStylesAutofilled = (input, form) => { const icon = getIcon(input, form, 'filled'); const iconStyle = icon ? getBasicStyles(input, icon) : {}; - return { ...iconStyle, + return { + ...iconStyle, 'background-color': '#F8F498', 'color': '#333333' }; }; - exports.getIconStylesAutofilled = getIconStylesAutofilled; -},{"./inputTypeConfig.js":36}],36:[function(require,module,exports){ +},{"./inputTypeConfig.js":38}],38:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.isFieldDecorated = exports.getInputConfigFromType = exports.getInputConfig = exports.canBeInteractedWith = void 0; - var _logoSvg = require("./logo-svg.js"); - var ddgPasswordIcons = _interopRequireWildcard(require("../UI/img/ddgPasswordIcon.js")); - var _matching = require("./matching.js"); - var _Credentials = require("../InputTypes/Credentials.js"); - var _CreditCard = require("../InputTypes/CreditCard.js"); - var _Identity = require("../InputTypes/Identity.js"); - var _constants = require("../constants.js"); - function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } - function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } - /** * Get the icon for the identities (currently only Dax for emails) * @param {HTMLInputElement} input @@ -12354,28 +11526,25 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && * @return {string} */ const getIdentitiesIcon = (input, _ref) => { - var _device$inContextSign; - let { device } = _ref; - if (!canBeInteractedWith(input)) return ''; // In Firefox web_accessible_resources could leak a unique user identifier, so we avoid it here + if (!canBeInteractedWith(input)) return ''; + // In Firefox web_accessible_resources could leak a unique user identifier, so we avoid it here const { isDDGApp, isFirefox, isExtension } = device.globalConfig; const subtype = (0, _matching.getInputSubtype)(input); - - if ((_device$inContextSign = device.inContextSignup) !== null && _device$inContextSign !== void 0 && _device$inContextSign.isAvailable(subtype)) { + if (device.inContextSignup?.isAvailable(subtype)) { if (isDDGApp || isFirefox) { return _logoSvg.daxGrayscaleBase64; } else if (isExtension) { return chrome.runtime.getURL('img/logo-small-grayscale.svg'); } } - if (subtype === 'emailAddress' && device.isDeviceSignedIn()) { if (isDDGApp || isFirefox) { return _logoSvg.daxBase64; @@ -12383,34 +11552,30 @@ const getIdentitiesIcon = (input, _ref) => { return chrome.runtime.getURL('img/logo-small.svg'); } } - return ''; }; + /** * Get the alternate icon for the identities (currently only Dax for emails) * @param {HTMLInputElement} input * @param {import("./Form").Form} form * @return {string} */ - - const getIdentitiesAlternateIcon = (input, _ref2) => { - var _device$inContextSign2; - let { device } = _ref2; - if (!canBeInteractedWith(input)) return ''; // In Firefox web_accessible_resources could leak a unique user identifier, so we avoid it here + if (!canBeInteractedWith(input)) return ''; + // In Firefox web_accessible_resources could leak a unique user identifier, so we avoid it here const { isDDGApp, isFirefox, isExtension } = device.globalConfig; const subtype = (0, _matching.getInputSubtype)(input); - const isIncontext = (_device$inContextSign2 = device.inContextSignup) === null || _device$inContextSign2 === void 0 ? void 0 : _device$inContextSign2.isAvailable(subtype); + const isIncontext = device.inContextSignup?.isAvailable(subtype); const isEmailProtection = subtype === 'emailAddress' && device.isDeviceSignedIn(); - if (isIncontext || isEmailProtection) { if (isDDGApp || isFirefox) { return _logoSvg.daxBase64; @@ -12418,27 +11583,23 @@ const getIdentitiesAlternateIcon = (input, _ref2) => { return chrome.runtime.getURL('img/logo-small.svg'); } } - return ''; }; + /** * Checks whether a field is readonly or disabled * @param {HTMLInputElement} input * @return {boolean} */ - - const canBeInteractedWith = input => !input.readOnly && !input.disabled; + /** * Checks if the input can be decorated and we have the needed data * @param {HTMLInputElement} input * @param {import("../DeviceInterface/InterfacePrototype").default} device * @returns {Promise} */ - - exports.canBeInteractedWith = canBeInteractedWith; - const canBeAutofilled = async (input, device) => { if (!canBeInteractedWith(input)) return false; const mainType = (0, _matching.getInputMainType)(input); @@ -12453,12 +11614,11 @@ const canBeAutofilled = async (input, device) => { }, device.inContextSignup); return Boolean(canAutofill); }; + /** * A map of config objects. These help by centralising here some complexity * @type {InputTypeConfig} */ - - const inputTypeConfig = { /** @type {CredentialsInputTypeConfig} */ credentials: { @@ -12469,22 +11629,18 @@ const inputTypeConfig = { device } = _ref3; if (!canBeInteractedWith(input)) return ''; - if (device.settings.featureToggles.inlineIcon_credentials) { return ddgPasswordIcons.ddgPasswordIconBase; } - return ''; }, getIconFilled: (_input, _ref4) => { let { device } = _ref4; - if (device.settings.featureToggles.inlineIcon_credentials) { return ddgPasswordIcons.ddgPasswordIconFilled; } - return ''; }, getIconAlternate: () => '', @@ -12494,27 +11650,23 @@ const inputTypeConfig = { isHybrid, device } = _ref5; - // if we are on a 'login' page, check if we have data to autofill the field if (isLogin || isHybrid) { return canBeAutofilled(input, device); - } // at this point, it's not a 'login' form, so we could offer to provide a password - + } + // at this point, it's not a 'login' form, so we could offer to provide a password if (device.settings.featureToggles.password_generation) { const subtype = (0, _matching.getInputSubtype)(input); - if (subtype === 'password') { return canBeInteractedWith(input); } } - return false; }, dataType: 'Credentials', tooltipItem: data => (0, _Credentials.createCredentialsTooltipItem)(data) }, - /** @type {CreditCardsInputTypeConfig} */ creditCards: { type: 'creditCards', @@ -12531,7 +11683,6 @@ const inputTypeConfig = { dataType: 'CreditCards', tooltipItem: data => new _CreditCard.CreditCardTooltipItem(data) }, - /** @type {IdentitiesInputTypeConfig} */ identities: { type: 'identities', @@ -12548,7 +11699,6 @@ const inputTypeConfig = { dataType: 'Identities', tooltipItem: data => new _Identity.IdentityTooltipItem(data) }, - /** @type {UnknownInputTypeConfig} */ unknown: { type: 'unknown', @@ -12563,55 +11713,49 @@ const inputTypeConfig = { } } }; + /** * Retrieves configs from an input el * @param {HTMLInputElement} input * @returns {InputTypeConfigs} */ - const getInputConfig = input => { const inputType = (0, _matching.getInputType)(input); return getInputConfigFromType(inputType); }; + /** * Retrieves configs from an input type * @param {import('./matching').SupportedTypes} inputType * @returns {InputTypeConfigs} */ - - exports.getInputConfig = getInputConfig; - const getInputConfigFromType = inputType => { const inputMainType = (0, _matching.getMainTypeFromType)(inputType); return inputTypeConfig[inputMainType]; }; + /** * Given an input field checks wheter it was previously decorated * @param {HTMLInputElement} input * @returns {Boolean} */ - - exports.getInputConfigFromType = getInputConfigFromType; - const isFieldDecorated = input => { return input.hasAttribute(_constants.constants.ATTR_INPUT_TYPE); }; - exports.isFieldDecorated = isFieldDecorated; -},{"../InputTypes/Credentials.js":43,"../InputTypes/CreditCard.js":44,"../InputTypes/Identity.js":45,"../UI/img/ddgPasswordIcon.js":57,"../constants.js":62,"./logo-svg.js":38,"./matching.js":41}],37:[function(require,module,exports){ +},{"../InputTypes/Credentials.js":45,"../InputTypes/CreditCard.js":46,"../InputTypes/Identity.js":47,"../UI/img/ddgPasswordIcon.js":59,"../constants.js":64,"./logo-svg.js":40,"./matching.js":43}],39:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.extractElementStrings = exports.EXCLUDED_TAGS = void 0; - var _matching = require("./matching.js"); +const EXCLUDED_TAGS = exports.EXCLUDED_TAGS = ['BR', 'SCRIPT', 'NOSCRIPT', 'OPTION', 'STYLE']; -const EXCLUDED_TAGS = ['BR', 'SCRIPT', 'NOSCRIPT', 'OPTION', 'STYLE']; /** * Extract all strings of an element's children to an array. * "element.textContent" is a string which is merged of all children nodes, @@ -12622,72 +11766,78 @@ const EXCLUDED_TAGS = ['BR', 'SCRIPT', 'NOSCRIPT', 'OPTION', 'STYLE']; * @returns {string[]} * All strings in an element. */ - -exports.EXCLUDED_TAGS = EXCLUDED_TAGS; - const extractElementStrings = element => { const strings = new Set(); - const _extractElementStrings = el => { if (EXCLUDED_TAGS.includes(el.tagName)) { return; - } // only take the string when it's an explicit text node - + } + // only take the string when it's an explicit text node if (el.nodeType === el.TEXT_NODE || !el.childNodes.length) { let trimmedText = (0, _matching.removeExcessWhitespace)(el.textContent); - if (trimmedText) { strings.add(trimmedText); } - return; } - for (let node of el.childNodes) { let nodeType = node.nodeType; - if (nodeType !== node.ELEMENT_NODE && nodeType !== node.TEXT_NODE) { continue; } - _extractElementStrings(node); } }; - _extractElementStrings(element); - return [...strings]; }; - exports.extractElementStrings = extractElementStrings; -},{"./matching.js":41}],38:[function(require,module,exports){ +},{"./matching.js":43}],40:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.daxGrayscaleBase64 = exports.daxBase64 = void 0; -const daxSvg = "\n\n \n \n \n \n \n \n \n \n \n \n \n\n".trim(); -const daxBase64 = "data:image/svg+xml;base64,".concat(window.btoa(daxSvg)); -exports.daxBase64 = daxBase64; -const daxGrayscaleSvg = "\n\n \n \n \n \n\n".trim(); -const daxGrayscaleBase64 = "data:image/svg+xml;base64,".concat(window.btoa(daxGrayscaleSvg)); -exports.daxGrayscaleBase64 = daxGrayscaleBase64; - -},{}],39:[function(require,module,exports){ +const daxSvg = ` + + + + + + + + + + + + + +`.trim(); +const daxBase64 = exports.daxBase64 = `data:image/svg+xml;base64,${window.btoa(daxSvg)}`; +const daxGrayscaleSvg = ` + + + + + + +`.trim(); +const daxGrayscaleBase64 = exports.daxGrayscaleBase64 = `data:image/svg+xml;base64,${window.btoa(daxGrayscaleSvg)}`; + +},{}],41:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.matchingConfiguration = void 0; - /* DO NOT EDIT, this file was generated by scripts/precompile-regexes.js */ /** @type {MatchingConfiguration} */ -const matchingConfiguration = { +const matchingConfiguration = exports.matchingConfiguration = { matchers: { fields: { unknown: { @@ -13122,9 +12272,8 @@ const matchingConfiguration = { } } }; -exports.matchingConfiguration = matchingConfiguration; -},{}],40:[function(require,module,exports){ +},{}],42:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { @@ -13132,11 +12281,8 @@ Object.defineProperty(exports, "__esModule", { }); exports.logMatching = logMatching; exports.logUnmatched = logUnmatched; - var _autofillUtils = require("../autofill-utils.js"); - var _matching = require("./matching.js"); - /** * Logs out matching details when debug flag is active * @param {HTMLInputElement | HTMLSelectElement} el @@ -13154,49 +12300,44 @@ function logMatching(el, matchingResult) { matcherType } = matchingResult; const verb = getVerb(matchingResult); - let stringToLog = "".concat(verb, " for \"").concat(matcherType, "\" with \"").concat(strategyName, "\""); - + let stringToLog = `${verb} for "${matcherType}" with "${strategyName}"`; if (matchedString && matchedFrom) { - stringToLog += "\nString: \"".concat(matchedString, "\"\nSource: \"").concat(matchedFrom, "\""); + stringToLog += `\nString: "${matchedString}"\nSource: "${matchedFrom}"`; } - console.log(stringToLog); console.groupEnd(); } + /** * Helper to form the correct string based on matching result type * @param {MatchingResult} matchingResult * @return {string} */ - - function getVerb(matchingResult) { if (matchingResult.matched) return 'Matched'; if (matchingResult.proceed === false) return 'Matched forceUnknown'; if (matchingResult.skip) return 'Skipped'; return ''; } + /** * Returns a human-friendly name to identify a single input field * @param {HTMLInputElement | HTMLSelectElement} el * @returns {string} */ - - function getInputIdentifier(el) { const label = (0, _matching.getExplicitLabelsText)(el); - const placeholder = el instanceof HTMLInputElement && el.placeholder ? "".concat(el.placeholder) : ''; - const name = el.name ? "".concat(el.name) : ''; - const id = el.id ? "#".concat(el.id) : ''; + const placeholder = el instanceof HTMLInputElement && el.placeholder ? `${el.placeholder}` : ''; + const name = el.name ? `${el.name}` : ''; + const id = el.id ? `#${el.id}` : ''; return 'Field: ' + (label || placeholder || name || id); } + /** * Logs info when a field was not matched by the algo * @param el * @param allStrings */ - - function logUnmatched(el, allStrings) { if (!(0, _autofillUtils.shouldLog)()) return; const fieldIdentifier = getInputIdentifier(el); @@ -13207,7 +12348,7 @@ function logUnmatched(el, allStrings) { console.groupEnd(); } -},{"../autofill-utils.js":59,"./matching.js":41}],41:[function(require,module,exports){ +},{"../autofill-utils.js":61,"./matching.js":43}],43:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { @@ -13222,140 +12363,76 @@ exports.getMainTypeFromType = getMainTypeFromType; exports.getRelatedText = void 0; exports.getSubtypeFromType = getSubtypeFromType; exports.removeExcessWhitespace = exports.matchInPlaceholderAndLabels = void 0; - var _constants = require("../constants.js"); - var _labelUtil = require("./label-util.js"); - var _compiledMatchingConfig = require("./matching-config/__generated__/compiled-matching-config.js"); - var _matchingUtils = require("./matching-utils.js"); - var _autofillUtils = require("../autofill-utils.js"); - -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - -function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); } - -function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } } - -function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); } - -function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; } - -function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; } - -function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); } - -function _classApplyDescriptorSet(receiver, descriptor, value) { if (descriptor.set) { descriptor.set.call(receiver, value); } else { if (!descriptor.writable) { throw new TypeError("attempted to set read only private field"); } descriptor.value = value; } } - const { TEXT_LENGTH_CUTOFF, ATTR_INPUT_TYPE } = _constants.constants; -/** @type {{[K in keyof MatcherLists]?: { minWidth: number }} } */ +/** @type {{[K in keyof MatcherLists]?: { minWidth: number }} } */ const dimensionBounds = { emailAddress: { minWidth: 35 } }; + /** * An abstraction around the concept of classifying input fields. * * The only state this class keeps is derived from the passed-in MatchingConfiguration. */ - -var _config = /*#__PURE__*/new WeakMap(); - -var _cssSelectors = /*#__PURE__*/new WeakMap(); - -var _ddgMatchers = /*#__PURE__*/new WeakMap(); - -var _vendorRegexRules = /*#__PURE__*/new WeakMap(); - -var _matcherLists = /*#__PURE__*/new WeakMap(); - -var _defaultStrategyOrder = /*#__PURE__*/new WeakMap(); - class Matching { /** @type {MatchingConfiguration} */ + #config; /** @type {CssSelectorConfiguration['selectors']} */ + #cssSelectors; /** @type {Record} */ + #ddgMatchers; /** * This acts as an internal cache for the larger vendorRegexes * @type {VendorRegexConfiguration['rules']} */ + #vendorRegexRules; /** @type {MatcherLists} */ + #matcherLists; /** @type {Array} */ + #defaultStrategyOrder = ['cssSelector', 'ddgMatcher', 'vendorRegex']; /** @type {Record} */ + activeElementStrings = { + nameAttr: '', + labelText: '', + placeholderAttr: '', + relatedText: '', + id: '' + }; /** * @param {MatchingConfiguration} config */ constructor(config) { - _classPrivateFieldInitSpec(this, _config, { - writable: true, - value: void 0 - }); - - _classPrivateFieldInitSpec(this, _cssSelectors, { - writable: true, - value: void 0 - }); - - _classPrivateFieldInitSpec(this, _ddgMatchers, { - writable: true, - value: void 0 - }); - - _classPrivateFieldInitSpec(this, _vendorRegexRules, { - writable: true, - value: void 0 - }); - - _classPrivateFieldInitSpec(this, _matcherLists, { - writable: true, - value: void 0 - }); - - _classPrivateFieldInitSpec(this, _defaultStrategyOrder, { - writable: true, - value: ['cssSelector', 'ddgMatcher', 'vendorRegex'] - }); - - _defineProperty(this, "activeElementStrings", { - nameAttr: '', - labelText: '', - placeholderAttr: '', - relatedText: '', - id: '' - }); - - _defineProperty(this, "_elementStringCache", new WeakMap()); - - _classPrivateFieldSet(this, _config, config); - - _classPrivateFieldSet(this, _vendorRegexRules, _classPrivateFieldGet(this, _config).strategies.vendorRegex.rules); - - _classPrivateFieldSet(this, _cssSelectors, _classPrivateFieldGet(this, _config).strategies.cssSelector.selectors); - - _classPrivateFieldSet(this, _ddgMatchers, _classPrivateFieldGet(this, _config).strategies.ddgMatcher.matchers); - - _classPrivateFieldSet(this, _matcherLists, { + this.#config = config; + this.#vendorRegexRules = this.#config.strategies.vendorRegex.rules; + this.#cssSelectors = this.#config.strategies.cssSelector.selectors; + this.#ddgMatchers = this.#config.strategies.ddgMatcher.matchers; + this.#matcherLists = { unknown: [], cc: [], id: [], password: [], username: [], emailAddress: [] - }); + }; + /** * Convert the raw config data into actual references. * @@ -13363,125 +12440,104 @@ class Matching { * * `email: [{type: "email", strategies: {cssSelector: "email", ... etc}]` */ - - - for (let [listName, matcherNames] of Object.entries(_classPrivateFieldGet(this, _config).matchers.lists)) { + for (let [listName, matcherNames] of Object.entries(this.#config.matchers.lists)) { for (let fieldName of matcherNames) { - if (!_classPrivateFieldGet(this, _matcherLists)[listName]) { - _classPrivateFieldGet(this, _matcherLists)[listName] = []; + if (!this.#matcherLists[listName]) { + this.#matcherLists[listName] = []; } - - _classPrivateFieldGet(this, _matcherLists)[listName].push(_classPrivateFieldGet(this, _config).matchers.fields[fieldName]); + this.#matcherLists[listName].push(this.#config.matchers.fields[fieldName]); } } } + /** * @param {HTMLInputElement|HTMLSelectElement} input * @param {HTMLElement} formEl */ - - setActiveElementStrings(input, formEl) { this.activeElementStrings = this.getElementStrings(input, formEl); } + /** * Try to access a 'vendor regex' by name * @param {string} regexName * @returns {RegExp | undefined} */ - - vendorRegex(regexName) { - const match = _classPrivateFieldGet(this, _vendorRegexRules)[regexName]; - + const match = this.#vendorRegexRules[regexName]; if (!match) { console.warn('Vendor Regex not found for', regexName); return undefined; } - return match; } + /** * Strategies can have different lookup names. This returns the correct one * @param {MatcherTypeNames} matcherName * @param {StrategyNames} vendorRegex * @returns {MatcherTypeNames} */ - - getStrategyLookupByType(matcherName, vendorRegex) { - var _classPrivateFieldGet2; - - return (_classPrivateFieldGet2 = _classPrivateFieldGet(this, _config).matchers.fields[matcherName]) === null || _classPrivateFieldGet2 === void 0 ? void 0 : _classPrivateFieldGet2.strategies[vendorRegex]; + return this.#config.matchers.fields[matcherName]?.strategies[vendorRegex]; } + /** * Try to access a 'css selector' by name from configuration * @param {RequiredCssSelectors | string} selectorName * @returns {string}; */ - - cssSelector(selectorName) { - const match = _classPrivateFieldGet(this, _cssSelectors)[selectorName]; - + const match = this.#cssSelectors[selectorName]; if (!match) { console.warn('CSS selector not found for %s, using a default value', selectorName); return ''; } - return match; } + /** * Try to access a 'ddg matcher' by name from configuration * @param {MatcherTypeNames | string} matcherName * @returns {DDGMatcher | undefined} */ - - ddgMatcher(matcherName) { - const match = _classPrivateFieldGet(this, _ddgMatchers)[matcherName]; - + const match = this.#ddgMatchers[matcherName]; if (!match) { console.warn('DDG matcher not found for', matcherName); return undefined; } - return match; } + /** * Returns the RegExp for the given matcherName, with proper flags * @param {AllDDGMatcherNames} matcherName * @returns {RegExp|undefined} */ - - getDDGMatcherRegex(matcherName) { const matcher = this.ddgMatcher(matcherName); - if (!matcher || !matcher.match) { console.warn('DDG matcher has unexpected format'); return undefined; } - - return matcher === null || matcher === void 0 ? void 0 : matcher.match; + return matcher?.match; } + /** * Try to access a list of matchers by name - these are the ones collected in the constructor * @param {keyof MatcherLists} listName * @return {Matcher[]} */ - - matcherList(listName) { - const matcherList = _classPrivateFieldGet(this, _matcherLists)[listName]; - + const matcherList = this.#matcherLists[listName]; if (!matcherList) { console.warn('MatcherList not found for ', listName); return []; } - return matcherList; } + /** * Convert a list of matchers into a single CSS selector. * @@ -13491,52 +12547,46 @@ class Matching { * @param {keyof MatcherLists} listName * @returns {string | undefined} */ - - joinCssSelectors(listName) { const matcherList = this.matcherList(listName); - if (!matcherList) { console.warn('Matcher list not found for', listName); return undefined; } + /** * @type {string[]} */ - - const selectors = []; - for (let matcher of matcherList) { if (matcher.strategies.cssSelector) { const css = this.cssSelector(matcher.strategies.cssSelector); - if (css) { selectors.push(css); } } } - return selectors.join(', '); } + /** * Returns true if the field is visible and large enough * @param {keyof MatcherLists} matchedType * @param {HTMLInputElement} input * @returns {boolean} */ - - isInputLargeEnough(matchedType, input) { const expectedDimensionBounds = dimensionBounds[matchedType]; if (!expectedDimensionBounds) return true; const width = input.offsetWidth; - const height = input.offsetHeight; // Ignore hidden elements as we can't determine their dimensions + const height = input.offsetHeight; + // Ignore hidden elements as we can't determine their dimensions const isHidden = height === 0 && width === 0; if (isHidden) return true; return width >= expectedDimensionBounds.minWidth; } + /** * Tries to infer the input type for an input * @@ -13545,28 +12595,23 @@ class Matching { * @param {SetInputTypeOpts} [opts] * @returns {SupportedTypes} */ - - inferInputType(input, formEl) { let opts = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; const presetType = getInputType(input); - if (presetType !== 'unknown') { return presetType; } - this.setActiveElementStrings(input, formEl); - if (this.subtypeFromMatchers('unknown', input)) return 'unknown'; // For CC forms we run aggressive matches, so we want to make sure we only - // run them on actual CC forms to avoid false positives and expensive loops + if (this.subtypeFromMatchers('unknown', input)) return 'unknown'; + // For CC forms we run aggressive matches, so we want to make sure we only + // run them on actual CC forms to avoid false positives and expensive loops if (opts.isCCForm) { const subtype = this.subtypeFromMatchers('cc', input); - if (subtype && isValidCreditCardSubtype(subtype)) { - return "creditCards.".concat(subtype); + return `creditCards.${subtype}`; } } - if (input instanceof HTMLInputElement) { if (this.subtypeFromMatchers('password', input)) { // Any other input type is likely a false match @@ -13575,7 +12620,6 @@ class Matching { return 'credentials.password'; } } - if (this.subtypeFromMatchers('emailAddress', input) && this.isInputLargeEnough('emailAddress', input)) { if (opts.isLogin || opts.isHybrid) { // TODO: Being this support back in the future @@ -13584,32 +12628,29 @@ class Matching { // if (opts.supportsIdentitiesAutofill && !opts.hasCredentials) { // return 'identities.emailAddress' // } - return 'credentials.username'; - } // TODO: Temporary hack to support Google signin in different languages - // https://app.asana.com/0/1198964220583541/1201650539303898/f + return 'credentials.username'; + } + // TODO: Temporary hack to support Google signin in different languages + // https://app.asana.com/0/1198964220583541/1201650539303898/f if (window.location.href.includes('https://accounts.google.com/v3/signin/identifier') && input.matches('[type=email][autocomplete=username]')) { return 'credentials.username'; } - return 'identities.emailAddress'; } - if (this.subtypeFromMatchers('username', input)) { return 'credentials.username'; } } - const idSubtype = this.subtypeFromMatchers('id', input); - if (idSubtype && isValidIdentitiesSubtype(idSubtype)) { - return "identities.".concat(idSubtype); + return `identities.${idSubtype}`; } - (0, _matchingUtils.logUnmatched)(input, this.activeElementStrings); return 'unknown'; } + /** * @typedef {{ * isLogin?: boolean, @@ -13627,39 +12668,31 @@ class Matching { * @param {SetInputTypeOpts} [opts] * @returns {SupportedSubTypes | string} */ - - setInputType(input, formEl) { let opts = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; const type = this.inferInputType(input, formEl, opts); input.setAttribute(ATTR_INPUT_TYPE, type); return type; } + /** * Tries to infer input subtype, with checks in decreasing order of reliability * @param {keyof MatcherLists} listName * @param {HTMLInputElement|HTMLSelectElement} el * @return {MatcherTypeNames|undefined} */ - - subtypeFromMatchers(listName, el) { const matchers = this.matcherList(listName); + /** * Loop through each strategy in order */ - - for (let strategyName of _classPrivateFieldGet(this, _defaultStrategyOrder)) { - var _result4; - + for (let strategyName of this.#defaultStrategyOrder) { let result; /** * Now loop through each matcher in the list. */ - for (let matcher of matchers) { - var _result, _result2, _result3; - /** * for each `strategyName` (such as cssSelector), check * if the current matcher implements it. @@ -13669,56 +12702,50 @@ class Matching { * Sometimes a matcher may not implement the current strategy, * so we skip it */ - if (!lookup) continue; + /** * Now perform the matching */ - if (strategyName === 'cssSelector') { result = this.execCssSelector(lookup, el); } - if (strategyName === 'ddgMatcher') { result = this.execDDGMatcher(lookup); } - if (strategyName === 'vendorRegex') { result = this.execVendorRegex(lookup); } + /** * If there's a match, return the matcher type. * * So, for example if 'username' had a `cssSelector` implemented, and * it matched the current element, then we'd return 'username' */ - - - if ((_result = result) !== null && _result !== void 0 && _result.matched) { + if (result?.matched) { (0, _matchingUtils.logMatching)(el, result); return matcher.type; } + /** * If a matcher wants to prevent all future matching on this element, * it would return { matched: false, proceed: false } */ - - - if (!((_result2 = result) !== null && _result2 !== void 0 && _result2.matched) && ((_result3 = result) === null || _result3 === void 0 ? void 0 : _result3.proceed) === false) { - (0, _matchingUtils.logMatching)(el, result); // If we get here, do not allow subsequent strategies to continue - + if (!result?.matched && result?.proceed === false) { + (0, _matchingUtils.logMatching)(el, result); + // If we get here, do not allow subsequent strategies to continue return undefined; } } - - if ((_result4 = result) !== null && _result4 !== void 0 && _result4.skip) { + if (result?.skip) { (0, _matchingUtils.logMatching)(el, result); break; } } - return undefined; } + /** * CSS selector matching just leverages the `.matches` method on elements * @@ -13726,8 +12753,6 @@ class Matching { * @param {HTMLInputElement|HTMLSelectElement} el * @returns {MatchingResult} */ - - execCssSelector(lookup, el) { const selector = this.cssSelector(lookup); return { @@ -13736,6 +12761,7 @@ class Matching { matcherType: lookup }; } + /** * A DDG Matcher can have a `match` regex along with a `not` regex. This is done * to allow it to be driven by configuration as it avoids needing to invoke custom functions. @@ -13746,8 +12772,6 @@ class Matching { * @param {MatcherTypeNames} lookup * @returns {MatchingResult} */ - - execDDGMatcher(lookup) { /** @type {MatchingResult} */ const defaultResult = { @@ -13756,46 +12780,44 @@ class Matching { matcherType: lookup }; const ddgMatcher = this.ddgMatcher(lookup); - if (!ddgMatcher || !ddgMatcher.match) { return defaultResult; } - let matchRexExp = this.getDDGMatcherRegex(lookup); - if (!matchRexExp) { return defaultResult; } - let requiredScore = ['match', 'forceUnknown', 'maxDigits'].filter(ddgMatcherProp => ddgMatcherProp in ddgMatcher).length; - /** @type {MatchableStrings[]} */ + /** @type {MatchableStrings[]} */ const matchableStrings = ddgMatcher.matchableStrings || ['labelText', 'placeholderAttr', 'relatedText']; - for (let stringName of matchableStrings) { let elementString = this.activeElementStrings[stringName]; - if (!elementString) continue; // Scoring to ensure all DDG tests are valid + if (!elementString) continue; + // Scoring to ensure all DDG tests are valid let score = 0; - /** @type {MatchingResult} */ - const result = { ...defaultResult, + /** @type {MatchingResult} */ + const result = { + ...defaultResult, matchedString: elementString, matchedFrom: stringName - }; // If a negated regex was provided, ensure it does not match - // If it DOES match - then we need to prevent any future strategies from continuing + }; + // If a negated regex was provided, ensure it does not match + // If it DOES match - then we need to prevent any future strategies from continuing if (ddgMatcher.forceUnknown) { let notRegex = ddgMatcher.forceUnknown; - if (!notRegex) { - return { ...result, + return { + ...result, matched: false }; } - if (notRegex.test(elementString)) { - return { ...result, + return { + ...result, matched: false, proceed: false }; @@ -13804,61 +12826,59 @@ class Matching { score++; } } - if (ddgMatcher.skip) { let skipRegex = ddgMatcher.skip; - if (!skipRegex) { - return { ...result, + return { + ...result, matched: false }; } - if (skipRegex.test(elementString)) { - return { ...result, + return { + ...result, matched: false, skip: true }; } - } // if the `match` regex fails, moves onto the next string - + } + // if the `match` regex fails, moves onto the next string if (!matchRexExp.test(elementString)) { continue; - } // Otherwise, increment the score - + } - score++; // If a 'maxDigits' rule was provided, validate it + // Otherwise, increment the score + score++; + // If a 'maxDigits' rule was provided, validate it if (ddgMatcher.maxDigits) { const digitLength = elementString.replace(/[^0-9]/g, '').length; - if (digitLength > ddgMatcher.maxDigits) { - return { ...result, + return { + ...result, matched: false }; } else { score++; } } - if (score === requiredScore) { - return { ...result, + return { + ...result, matched: true }; } } - return defaultResult; } + /** * If we get here, a firefox/vendor regex was given and we can execute it on the element * strings * @param {MatcherTypeNames} lookup * @return {MatchingResult} */ - - execVendorRegex(lookup) { /** @type {MatchingResult} */ const defaultResult = { @@ -13867,30 +12887,26 @@ class Matching { matcherType: lookup }; const regex = this.vendorRegex(lookup); - if (!regex) { return defaultResult; } /** @type {MatchableStrings[]} */ - - const stringsToMatch = ['placeholderAttr', 'nameAttr', 'labelText', 'id', 'relatedText']; - for (let stringName of stringsToMatch) { let elementString = this.activeElementStrings[stringName]; if (!elementString) continue; - if (regex.test(elementString)) { - return { ...defaultResult, + return { + ...defaultResult, matched: true, matchedString: elementString, matchedFrom: stringName }; } } - return defaultResult; } + /** * Yield strings in the order in which they should be checked against. * @@ -13909,16 +12925,14 @@ class Matching { * @param {HTMLElement} form * @returns {Record} */ - - + _elementStringCache = new WeakMap(); getElementStrings(el, form) { if (this._elementStringCache.has(el)) { return this._elementStringCache.get(el); } - const explicitLabelsText = getExplicitLabelsText(el); - /** @type {Record} */ + /** @type {Record} */ const next = { nameAttr: el.name, labelText: explicitLabelsText, @@ -13926,254 +12940,217 @@ class Matching { id: el.id, relatedText: explicitLabelsText ? '' : getRelatedText(el, form, this.cssSelector('formInputsSelector')) }; - this._elementStringCache.set(el, next); - return next; } - clear() { this._elementStringCache = new WeakMap(); } + /** * @param {HTMLInputElement|HTMLSelectElement} input * @param {HTMLElement} form * @returns {Matching} */ - - forInput(input, form) { this.setActiveElementStrings(input, form); return this; } + /** * @type {MatchingConfiguration} */ - - + static emptyConfig = { + matchers: { + lists: {}, + fields: {} + }, + strategies: { + 'vendorRegex': { + rules: {}, + ruleSets: [] + }, + 'ddgMatcher': { + matchers: {} + }, + 'cssSelector': { + selectors: {} + } + } + }; } + /** * @returns {SupportedTypes} */ - - exports.Matching = Matching; - -_defineProperty(Matching, "emptyConfig", { - matchers: { - lists: {}, - fields: {} - }, - strategies: { - 'vendorRegex': { - rules: {}, - ruleSets: [] - }, - 'ddgMatcher': { - matchers: {} - }, - 'cssSelector': { - selectors: {} - } - } -}); - function getInputType(input) { - const attr = input === null || input === void 0 ? void 0 : input.getAttribute(ATTR_INPUT_TYPE); - + const attr = input?.getAttribute(ATTR_INPUT_TYPE); if (isValidSupportedType(attr)) { return attr; } - return 'unknown'; } + /** * Retrieves the main type * @param {SupportedTypes | string} type * @returns {SupportedMainTypes} */ - - function getMainTypeFromType(type) { const mainType = type.split('.')[0]; - switch (mainType) { case 'credentials': case 'creditCards': case 'identities': return mainType; } - return 'unknown'; } + /** * Retrieves the input main type * @param {HTMLInputElement} input * @returns {SupportedMainTypes} */ - - const getInputMainType = input => getMainTypeFromType(getInputType(input)); -/** @typedef {supportedIdentitiesSubtypes[number]} SupportedIdentitiesSubTypes */ - +/** @typedef {supportedIdentitiesSubtypes[number]} SupportedIdentitiesSubTypes */ exports.getInputMainType = getInputMainType; -const supportedIdentitiesSubtypes = -/** @type {const} */ -['emailAddress', 'firstName', 'middleName', 'lastName', 'fullName', 'phone', 'addressStreet', 'addressStreet2', 'addressCity', 'addressProvince', 'addressPostalCode', 'addressCountryCode', 'birthdayDay', 'birthdayMonth', 'birthdayYear']; +const supportedIdentitiesSubtypes = /** @type {const} */['emailAddress', 'firstName', 'middleName', 'lastName', 'fullName', 'phone', 'addressStreet', 'addressStreet2', 'addressCity', 'addressProvince', 'addressPostalCode', 'addressCountryCode', 'birthdayDay', 'birthdayMonth', 'birthdayYear']; + /** * @param {SupportedTypes | any} supportedType * @returns {supportedType is SupportedIdentitiesSubTypes} */ - function isValidIdentitiesSubtype(supportedType) { return supportedIdentitiesSubtypes.includes(supportedType); } -/** @typedef {supportedCreditCardSubtypes[number]} SupportedCreditCardSubTypes */ +/** @typedef {supportedCreditCardSubtypes[number]} SupportedCreditCardSubTypes */ +const supportedCreditCardSubtypes = /** @type {const} */['cardName', 'cardNumber', 'cardSecurityCode', 'expirationMonth', 'expirationYear', 'expiration']; -const supportedCreditCardSubtypes = -/** @type {const} */ -['cardName', 'cardNumber', 'cardSecurityCode', 'expirationMonth', 'expirationYear', 'expiration']; /** * @param {SupportedTypes | any} supportedType * @returns {supportedType is SupportedCreditCardSubTypes} */ - function isValidCreditCardSubtype(supportedType) { return supportedCreditCardSubtypes.includes(supportedType); } -/** @typedef {supportedCredentialsSubtypes[number]} SupportedCredentialsSubTypes */ +/** @typedef {supportedCredentialsSubtypes[number]} SupportedCredentialsSubTypes */ +const supportedCredentialsSubtypes = /** @type {const} */['password', 'username']; -const supportedCredentialsSubtypes = -/** @type {const} */ -['password', 'username']; /** * @param {SupportedTypes | any} supportedType * @returns {supportedType is SupportedCredentialsSubTypes} */ - function isValidCredentialsSubtype(supportedType) { return supportedCredentialsSubtypes.includes(supportedType); } + /** @typedef {SupportedIdentitiesSubTypes | SupportedCreditCardSubTypes | SupportedCredentialsSubTypes} SupportedSubTypes */ /** @typedef {`identities.${SupportedIdentitiesSubTypes}` | `creditCards.${SupportedCreditCardSubTypes}` | `credentials.${SupportedCredentialsSubTypes}` | 'unknown'} SupportedTypes */ +const supportedTypes = [...supportedIdentitiesSubtypes.map(type => `identities.${type}`), ...supportedCreditCardSubtypes.map(type => `creditCards.${type}`), ...supportedCredentialsSubtypes.map(type => `credentials.${type}`)]; - -const supportedTypes = [...supportedIdentitiesSubtypes.map(type => "identities.".concat(type)), ...supportedCreditCardSubtypes.map(type => "creditCards.".concat(type)), ...supportedCredentialsSubtypes.map(type => "credentials.".concat(type))]; /** * Retrieves the subtype * @param {SupportedTypes | string} type * @returns {SupportedSubTypes | 'unknown'} */ - function getSubtypeFromType(type) { - const subType = type === null || type === void 0 ? void 0 : type.split('.')[1]; + const subType = type?.split('.')[1]; const validType = isValidSubtype(subType); return validType ? subType : 'unknown'; } + /** * @param {SupportedSubTypes | any} supportedSubType * @returns {supportedSubType is SupportedSubTypes} */ - - function isValidSubtype(supportedSubType) { return isValidIdentitiesSubtype(supportedSubType) || isValidCreditCardSubtype(supportedSubType) || isValidCredentialsSubtype(supportedSubType); } + /** * @param {SupportedTypes | any} supportedType * @returns {supportedType is SupportedTypes} */ - - function isValidSupportedType(supportedType) { return supportedTypes.includes(supportedType); } + /** * Retrieves the input subtype * @param {HTMLInputElement|Element} input * @returns {SupportedSubTypes | 'unknown'} */ - - function getInputSubtype(input) { const type = getInputType(input); return getSubtypeFromType(type); } + /** * Remove whitespace of more than 2 in a row and trim the string * @param {string | null} string * @return {string} */ - - const removeExcessWhitespace = function () { let string = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; if (!string) return ''; return string.replace(/\n/g, ' ').replace(/\s{2,}/g, ' ').trim(); }; + /** * Get text from all explicit labels * @param {HTMLInputElement|HTMLSelectElement} el * @return {string} */ - - exports.removeExcessWhitespace = removeExcessWhitespace; - const getExplicitLabelsText = el => { const labelTextCandidates = []; - for (let label of el.labels || []) { labelTextCandidates.push(...(0, _labelUtil.extractElementStrings)(label)); } - if (el.hasAttribute('aria-label')) { labelTextCandidates.push(removeExcessWhitespace(el.getAttribute('aria-label'))); - } // Try to access another element if it was marked as the label for this input/select - + } + // Try to access another element if it was marked as the label for this input/select const ariaLabelAttr = removeExcessWhitespace(el.getAttribute('aria-labelled') || el.getAttribute('aria-labelledby')); - if (ariaLabelAttr) { const labelledByElement = document.getElementById(ariaLabelAttr); - if (labelledByElement) { labelTextCandidates.push(...(0, _labelUtil.extractElementStrings)(labelledByElement)); } - } // Labels with long text are likely to be noisy and lead to false positives - + } + // Labels with long text are likely to be noisy and lead to false positives const filteredLabels = labelTextCandidates.filter(string => string.length < 65); - if (filteredLabels.length > 0) { return filteredLabels.join(' '); } - return ''; }; + /** * Tries to get a relevant previous Element sibling, excluding certain tags * @param {Element} el * @returns {Element|null} */ - - exports.getExplicitLabelsText = getExplicitLabelsText; - const recursiveGetPreviousElSibling = el => { const previousEl = el.previousElementSibling; - if (!previousEl) return null; // Skip elements with no childNodes + if (!previousEl) return null; + // Skip elements with no childNodes if (_labelUtil.EXCLUDED_TAGS.includes(previousEl.tagName)) { return recursiveGetPreviousElSibling(previousEl); } - return previousEl; }; + /** * Get all text close to the input (useful when no labels are defined) * @param {HTMLInputElement|HTMLSelectElement} el @@ -14181,52 +13158,46 @@ const recursiveGetPreviousElSibling = el => { * @param {string} cssSelector * @return {string} */ - - const getRelatedText = (el, form, cssSelector) => { - let scope = getLargestMeaningfulContainer(el, form, cssSelector); // If we didn't find a container, try looking for an adjacent label + let scope = getLargestMeaningfulContainer(el, form, cssSelector); + // If we didn't find a container, try looking for an adjacent label if (scope === el) { let previousEl = recursiveGetPreviousElSibling(el); - if (previousEl instanceof HTMLElement) { scope = previousEl; - } // If there is still no meaningful container return empty string - - + } + // If there is still no meaningful container return empty string if (scope === el || scope instanceof HTMLSelectElement) { if (el.previousSibling instanceof Text) { return removeExcessWhitespace(el.previousSibling.textContent); } - return ''; } - } // If there is still no meaningful container return empty string - + } + // If there is still no meaningful container return empty string if (scope === el || scope instanceof HTMLSelectElement) { if (el.previousSibling instanceof Text) { return removeExcessWhitespace(el.previousSibling.textContent); } - return ''; } - let trimmedText = ''; const label = scope.querySelector('label'); - if (label) { // Try searching for a label first trimmedText = (0, _autofillUtils.getTextShallow)(label); } else { // If the container has a select element, remove its contents to avoid noise trimmedText = (0, _labelUtil.extractElementStrings)(scope).join(' '); - } // If the text is longer than n chars it's too noisy and likely to yield false positives, so return '' - + } + // If the text is longer than n chars it's too noisy and likely to yield false positives, so return '' if (trimmedText.length < TEXT_LENGTH_CUTOFF) return trimmedText; return ''; }; + /** * Find a container for the input field that won't contain other inputs (useful to get elements related to the field) * @param {HTMLElement} el @@ -14234,23 +13205,20 @@ const getRelatedText = (el, form, cssSelector) => { * @param {string} cssSelector * @return {HTMLElement} */ - - exports.getRelatedText = getRelatedText; - const getLargestMeaningfulContainer = (el, form, cssSelector) => { /* TODO: there could be more than one select el for the same label, in that case we should change how we compute the container */ const parentElement = el.parentElement; if (!parentElement || el === form || !cssSelector) return el; - const inputsInParentsScope = parentElement.querySelectorAll(cssSelector); // To avoid noise, ensure that our input is the only in scope - + const inputsInParentsScope = parentElement.querySelectorAll(cssSelector); + // To avoid noise, ensure that our input is the only in scope if (inputsInParentsScope.length === 1) { return getLargestMeaningfulContainer(parentElement, form, cssSelector); } - return el; }; + /** * Find a regex match for a given input * @param {HTMLInputElement} input @@ -14259,13 +13227,10 @@ const getLargestMeaningfulContainer = (el, form, cssSelector) => { * @param {string} cssSelector * @returns {RegExpMatchArray|null} */ - - const matchInPlaceholderAndLabels = (input, regex, form, cssSelector) => { - var _input$placeholder; - - return ((_input$placeholder = input.placeholder) === null || _input$placeholder === void 0 ? void 0 : _input$placeholder.match(regex)) || getExplicitLabelsText(input).match(regex) || getRelatedText(input, form, cssSelector).match(regex); + return input.placeholder?.match(regex) || getExplicitLabelsText(input).match(regex) || getRelatedText(input, form, cssSelector).match(regex); }; + /** * Check if a given input matches a regex * @param {HTMLInputElement} input @@ -14274,38 +13239,30 @@ const matchInPlaceholderAndLabels = (input, regex, form, cssSelector) => { * @param {string} cssSelector * @returns {boolean} */ - - exports.matchInPlaceholderAndLabels = matchInPlaceholderAndLabels; - const checkPlaceholderAndLabels = (input, regex, form, cssSelector) => { return !!matchInPlaceholderAndLabels(input, regex, form, cssSelector); }; + /** * Factory for instances of Matching * * @return {Matching} */ - - exports.checkPlaceholderAndLabels = checkPlaceholderAndLabels; - function createMatching() { return new Matching(_compiledMatchingConfig.matchingConfiguration); } -},{"../autofill-utils.js":59,"../constants.js":62,"./label-util.js":37,"./matching-config/__generated__/compiled-matching-config.js":39,"./matching-utils.js":40}],42:[function(require,module,exports){ +},{"../autofill-utils.js":61,"../constants.js":64,"./label-util.js":39,"./matching-config/__generated__/compiled-matching-config.js":41,"./matching-utils.js":42}],44:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.InContextSignup = void 0; - var _deviceApiCalls = require("./deviceApiCalls/__generated__/deviceApiCalls.js"); - var _autofillUtils = require("./autofill-utils.js"); - class InContextSignup { /** * @param {import("./DeviceInterface/InterfacePrototype").default} device @@ -14313,15 +13270,12 @@ class InContextSignup { constructor(device) { this.device = device; } - async init() { await this.refreshData(); this.addNativeAccessibleGlobalFunctions(); } - addNativeAccessibleGlobalFunctions() { if (!this.device.globalConfig.hasModernWebkitAPI) return; - try { // Set up a function which can be called from the native layer after completed sign-up or sign-in. Object.defineProperty(window, 'openAutofillAfterClosingEmailProtectionTab', { @@ -14332,31 +13286,30 @@ class InContextSignup { this.openAutofillTooltip(); } }); - } catch (e) {// Ignore if function can't be set up, it's a UX enhancement not a critical flow + } catch (e) { + // Ignore if function can't be set up, it's a UX enhancement not a critical flow } } - async refreshData() { const incontextSignupDismissedAt = await this.device.deviceApi.request(new _deviceApiCalls.GetIncontextSignupDismissedAtCall(null)); this.permanentlyDismissedAt = incontextSignupDismissedAt.permanentlyDismissedAt; this.isInstalledRecently = incontextSignupDismissedAt.isInstalledRecently; } - async openAutofillTooltip() { - var _this$device$uiContro, _this$device$activeFo; - // Make sure we're working with the latest data - await this.device.refreshData(); // Make sure the tooltip is closed before we try to open it + await this.device.refreshData(); - await ((_this$device$uiContro = this.device.uiController) === null || _this$device$uiContro === void 0 ? void 0 : _this$device$uiContro.removeTooltip('stateChange')); // Make sure the input doesn't have focus so we can focus on it again + // Make sure the tooltip is closed before we try to open it + await this.device.uiController?.removeTooltip('stateChange'); - const activeInput = (_this$device$activeFo = this.device.activeForm) === null || _this$device$activeFo === void 0 ? void 0 : _this$device$activeFo.activeInput; - activeInput === null || activeInput === void 0 ? void 0 : activeInput.blur(); // Select the active input to open the tooltip + // Make sure the input doesn't have focus so we can focus on it again + const activeInput = this.device.activeForm?.activeInput; + activeInput?.blur(); + // Select the active input to open the tooltip const selectActiveInput = () => { - activeInput === null || activeInput === void 0 ? void 0 : activeInput.focus(); + activeInput?.focus(); }; - if (document.hasFocus()) { selectActiveInput(); } else { @@ -14367,17 +13320,14 @@ class InContextSignup { }); } } - isPermanentlyDismissed() { return Boolean(this.permanentlyDismissedAt); } - isOnValidDomain() { // Only show in-context signup if we've high confidence that the page is // not internally hosted or an intranet return (0, _autofillUtils.isValidTLD)() && !(0, _autofillUtils.isLocalNetwork)(); } - isAllowedByDevice() { if (typeof this.isInstalledRecently === 'boolean') { return this.isInstalledRecently; @@ -14387,43 +13337,36 @@ class InContextSignup { return true; } } + /** * @param {import('./Form/matching.js').SupportedSubTypes | "unknown"} [inputType] * @returns {boolean} */ - - isAvailable() { - var _this$device$settings, _this$device$settings2; - let inputType = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'emailAddress'; const isEmailInput = inputType === 'emailAddress'; - const isEmailProtectionEnabled = !!((_this$device$settings = this.device.settings) !== null && _this$device$settings !== void 0 && _this$device$settings.featureToggles.emailProtection); - const isIncontextSignupEnabled = !!((_this$device$settings2 = this.device.settings) !== null && _this$device$settings2 !== void 0 && _this$device$settings2.featureToggles.emailProtection_incontext_signup); + const isEmailProtectionEnabled = !!this.device.settings?.featureToggles.emailProtection; + const isIncontextSignupEnabled = !!this.device.settings?.featureToggles.emailProtection_incontext_signup; const isNotAlreadyLoggedIn = !this.device.isDeviceSignedIn(); const isNotDismissed = !this.isPermanentlyDismissed(); const isOnExpectedPage = this.device.globalConfig.isTopFrame || this.isOnValidDomain(); const isAllowedByDevice = this.isAllowedByDevice(); return isEmailInput && isEmailProtectionEnabled && isIncontextSignupEnabled && isNotAlreadyLoggedIn && isNotDismissed && isOnExpectedPage && isAllowedByDevice; } - onIncontextSignup() { this.device.deviceApi.notify(new _deviceApiCalls.StartEmailProtectionSignupCall({})); this.device.firePixel({ pixelName: 'incontext_primary_cta' }); } - onIncontextSignupDismissed() { let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : { shouldHideTooltip: true }; - if (options.shouldHideTooltip) { this.device.removeAutofillUIFromPage('Email Protection in-context signup dismissed.'); this.device.deviceApi.notify(new _deviceApiCalls.CloseAutofillParentCall(null)); } - this.permanentlyDismissedAt = new Date().getTime(); this.device.deviceApi.notify(new _deviceApiCalls.SetIncontextSignupPermanentlyDismissedAtCall({ value: this.permanentlyDismissedAt @@ -14431,23 +13374,19 @@ class InContextSignup { this.device.firePixel({ pixelName: 'incontext_dismiss_persisted' }); - } // In-context signup can be closed when displayed as a stand-alone tooltip, e.g. extension - + } + // In-context signup can be closed when displayed as a stand-alone tooltip, e.g. extension onIncontextSignupClosed() { - var _this$device$activeFo2; - - (_this$device$activeFo2 = this.device.activeForm) === null || _this$device$activeFo2 === void 0 ? void 0 : _this$device$activeFo2.dismissTooltip(); + this.device.activeForm?.dismissTooltip(); this.device.firePixel({ pixelName: 'incontext_close_x' }); } - } - exports.InContextSignup = InContextSignup; -},{"./autofill-utils.js":59,"./deviceApiCalls/__generated__/deviceApiCalls.js":63}],43:[function(require,module,exports){ +},{"./autofill-utils.js":61,"./deviceApiCalls/__generated__/deviceApiCalls.js":65}],45:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { @@ -14457,107 +13396,55 @@ exports.PROVIDER_LOCKED = exports.AUTOGENERATED_KEY = void 0; exports.appendGeneratedKey = appendGeneratedKey; exports.createCredentialsTooltipItem = createCredentialsTooltipItem; exports.fromPassword = fromPassword; - var _autofillUtils = require("../autofill-utils.js"); +const AUTOGENERATED_KEY = exports.AUTOGENERATED_KEY = 'autogenerated'; +const PROVIDER_LOCKED = exports.PROVIDER_LOCKED = 'provider_locked'; -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - -function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); } - -function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } } - -function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); } - -function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; } - -function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; } - -function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); } - -function _classApplyDescriptorSet(receiver, descriptor, value) { if (descriptor.set) { descriptor.set.call(receiver, value); } else { if (!descriptor.writable) { throw new TypeError("attempted to set read only private field"); } descriptor.value = value; } } - -const AUTOGENERATED_KEY = 'autogenerated'; -exports.AUTOGENERATED_KEY = AUTOGENERATED_KEY; -const PROVIDER_LOCKED = 'provider_locked'; /** * @implements {TooltipItemRenderer} */ - -exports.PROVIDER_LOCKED = PROVIDER_LOCKED; - -var _data = /*#__PURE__*/new WeakMap(); - class CredentialsTooltipItem { /** @type {CredentialsObject} */ - + #data; /** @param {CredentialsObject} data */ constructor(data) { - _classPrivateFieldInitSpec(this, _data, { - writable: true, - value: void 0 - }); - - _defineProperty(this, "id", () => String(_classPrivateFieldGet(this, _data).id)); - - _defineProperty(this, "labelMedium", _subtype => { - var _classPrivateFieldGet2; - - if (_classPrivateFieldGet(this, _data).username) { - return _classPrivateFieldGet(this, _data).username; - } - - if ((_classPrivateFieldGet2 = _classPrivateFieldGet(this, _data).origin) !== null && _classPrivateFieldGet2 !== void 0 && _classPrivateFieldGet2.url) { - return "Password for ".concat((0, _autofillUtils.truncateFromMiddle)(_classPrivateFieldGet(this, _data).origin.url)); - } - - return ''; - }); - - _defineProperty(this, "labelSmall", _subtype => { - var _classPrivateFieldGet3; - - if ((_classPrivateFieldGet3 = _classPrivateFieldGet(this, _data).origin) !== null && _classPrivateFieldGet3 !== void 0 && _classPrivateFieldGet3.url) { - return (0, _autofillUtils.truncateFromMiddle)(_classPrivateFieldGet(this, _data).origin.url); - } - - return '•••••••••••••••'; - }); - - _defineProperty(this, "credentialsProvider", () => _classPrivateFieldGet(this, _data).credentialsProvider); - - _classPrivateFieldSet(this, _data, data); + this.#data = data; } - + id = () => String(this.#data.id); + labelMedium = _subtype => { + if (this.#data.username) { + return this.#data.username; + } + if (this.#data.origin?.url) { + return `Password for ${(0, _autofillUtils.truncateFromMiddle)(this.#data.origin.url)}`; + } + return ''; + }; + labelSmall = _subtype => { + if (this.#data.origin?.url) { + return (0, _autofillUtils.truncateFromMiddle)(this.#data.origin.url); + } + return '•••••••••••••••'; + }; + credentialsProvider = () => this.#data.credentialsProvider; } + /** * @implements {TooltipItemRenderer} */ - - -var _data2 = /*#__PURE__*/new WeakMap(); - class AutoGeneratedCredential { /** @type {CredentialsObject} */ - + #data; /** @param {CredentialsObject} data */ constructor(data) { - _classPrivateFieldInitSpec(this, _data2, { - writable: true, - value: void 0 - }); - - _defineProperty(this, "id", () => String(_classPrivateFieldGet(this, _data2).id)); - - _defineProperty(this, "label", _subtype => _classPrivateFieldGet(this, _data2).password); - - _defineProperty(this, "labelMedium", _subtype => 'Generated password'); - - _defineProperty(this, "labelSmall", _subtype => 'Login information will be saved for this website'); - - _classPrivateFieldSet(this, _data2, data); + this.#data = data; } - + id = () => String(this.#data.id); + label = _subtype => this.#data.password; + labelMedium = _subtype => 'Generated password'; + labelSmall = _subtype => 'Login information will be saved for this website'; } + /** * Generate a stand-in 'CredentialsObject' from a * given (generated) password. @@ -14566,8 +13453,6 @@ class AutoGeneratedCredential { * @param {string} username * @returns {CredentialsObject} */ - - function fromPassword(password, username) { return { [AUTOGENERATED_KEY]: true, @@ -14575,35 +13460,23 @@ function fromPassword(password, username) { username }; } + /** * @implements TooltipItemRenderer */ - - -var _data3 = /*#__PURE__*/new WeakMap(); - class ProviderLockedItem { /** @type {CredentialsObject} */ - + #data; /** @param {CredentialsObject} data */ constructor(data) { - _classPrivateFieldInitSpec(this, _data3, { - writable: true, - value: void 0 - }); - - _defineProperty(this, "id", () => String(_classPrivateFieldGet(this, _data3).id)); - - _defineProperty(this, "labelMedium", _subtype => 'Bitwarden is locked'); - - _defineProperty(this, "labelSmall", _subtype => 'Unlock your vault to access credentials or generate passwords'); - - _defineProperty(this, "credentialsProvider", () => _classPrivateFieldGet(this, _data3).credentialsProvider); - - _classPrivateFieldSet(this, _data3, data); + this.#data = data; } - + id = () => String(this.#data.id); + labelMedium = _subtype => 'Bitwarden is locked'; + labelSmall = _subtype => 'Unlock your vault to access credentials or generate passwords'; + credentialsProvider = () => this.#data.credentialsProvider; } + /** * If the locally generated/stored password or username ends up being the same * as submitted in a subsequent form submission - then we mark the @@ -14616,276 +13489,173 @@ class ProviderLockedItem { * @param {string|null|undefined} [autofilledFields.password] - if present, it's the last generated password * */ - - function appendGeneratedKey(data) { - var _data$credentials, _data$credentials2; - let autofilledFields = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - let autogenerated = false; // does the current password match the most recently generated one? + let autogenerated = false; - if (autofilledFields.password && ((_data$credentials = data.credentials) === null || _data$credentials === void 0 ? void 0 : _data$credentials.password) === autofilledFields.password) { + // does the current password match the most recently generated one? + if (autofilledFields.password && data.credentials?.password === autofilledFields.password) { autogenerated = true; - } // does the current username match a recently generated one? (eg: email protection) - + } - if (autofilledFields.username && ((_data$credentials2 = data.credentials) === null || _data$credentials2 === void 0 ? void 0 : _data$credentials2.username) === autofilledFields.username) { + // does the current username match a recently generated one? (eg: email protection) + if (autofilledFields.username && data.credentials?.username === autofilledFields.username) { autogenerated = true; - } // if neither username nor password were generated, don't alter the outgoing data + } + // if neither username nor password were generated, don't alter the outgoing data + if (!autogenerated) return data; - if (!autogenerated) return data; // if we get here, we're confident that something was generated + filled + // if we get here, we're confident that something was generated + filled // so we mark the credential as 'autogenerated' for the benefit of native implementations - - return { ...data, - credentials: { ...data.credentials, + return { + ...data, + credentials: { + ...data.credentials, [AUTOGENERATED_KEY]: true } }; } + /** * Factory for creating a TooltipItemRenderer * * @param {CredentialsObject} data * @returns {TooltipItemRenderer} */ - - function createCredentialsTooltipItem(data) { if (data.id === PROVIDER_LOCKED) { return new ProviderLockedItem(data); } - if (AUTOGENERATED_KEY in data && data.password) { return new AutoGeneratedCredential(data); } - return new CredentialsTooltipItem(data); } -},{"../autofill-utils.js":59}],44:[function(require,module,exports){ +},{"../autofill-utils.js":61}],46:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.CreditCardTooltipItem = void 0; - -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - -function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); } - -function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } } - -function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); } - -function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; } - -function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; } - -function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); } - -function _classApplyDescriptorSet(receiver, descriptor, value) { if (descriptor.set) { descriptor.set.call(receiver, value); } else { if (!descriptor.writable) { throw new TypeError("attempted to set read only private field"); } descriptor.value = value; } } - -var _data = /*#__PURE__*/new WeakMap(); - /** * @implements {TooltipItemRenderer} */ class CreditCardTooltipItem { /** @type {CreditCardObject} */ - + #data; /** @param {CreditCardObject} data */ constructor(data) { - _classPrivateFieldInitSpec(this, _data, { - writable: true, - value: void 0 - }); - - _defineProperty(this, "id", () => String(_classPrivateFieldGet(this, _data).id)); - - _defineProperty(this, "labelMedium", _ => _classPrivateFieldGet(this, _data).title); - - _defineProperty(this, "labelSmall", _ => _classPrivateFieldGet(this, _data).displayNumber); - - _classPrivateFieldSet(this, _data, data); + this.#data = data; } - + id = () => String(this.#data.id); + labelMedium = _ => this.#data.title; + labelSmall = _ => this.#data.displayNumber; } - exports.CreditCardTooltipItem = CreditCardTooltipItem; -},{}],45:[function(require,module,exports){ +},{}],47:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.IdentityTooltipItem = void 0; - var _formatters = require("../Form/formatters.js"); - -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - -function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); } - -function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } } - -function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); } - -function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; } - -function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; } - -function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); } - -function _classApplyDescriptorSet(receiver, descriptor, value) { if (descriptor.set) { descriptor.set.call(receiver, value); } else { if (!descriptor.writable) { throw new TypeError("attempted to set read only private field"); } descriptor.value = value; } } - -var _data = /*#__PURE__*/new WeakMap(); - /** * @implements {TooltipItemRenderer} */ class IdentityTooltipItem { /** @type {IdentityObject} */ - + #data; /** @param {IdentityObject} data */ constructor(data) { - _classPrivateFieldInitSpec(this, _data, { - writable: true, - value: void 0 - }); - - _defineProperty(this, "id", () => String(_classPrivateFieldGet(this, _data).id)); - - _defineProperty(this, "labelMedium", subtype => { - if (subtype === 'addressCountryCode') { - return (0, _formatters.getCountryDisplayName)('en', _classPrivateFieldGet(this, _data).addressCountryCode || ''); - } - - if (_classPrivateFieldGet(this, _data).id === 'privateAddress') { - return 'Generate Private Duck Address'; - } - - return _classPrivateFieldGet(this, _data)[subtype]; - }); - - _defineProperty(this, "labelSmall", _ => { - return _classPrivateFieldGet(this, _data).title; - }); - - _classPrivateFieldSet(this, _data, data); + this.#data = data; } - + id = () => String(this.#data.id); + labelMedium = subtype => { + if (subtype === 'addressCountryCode') { + return (0, _formatters.getCountryDisplayName)('en', this.#data.addressCountryCode || ''); + } + if (this.#data.id === 'privateAddress') { + return 'Generate Private Duck Address'; + } + return this.#data[subtype]; + }; label(subtype) { - if (_classPrivateFieldGet(this, _data).id === 'privateAddress') { - return _classPrivateFieldGet(this, _data)[subtype]; + if (this.#data.id === 'privateAddress') { + return this.#data[subtype]; } - return null; } - + labelSmall = _ => { + return this.#data.title; + }; } - exports.IdentityTooltipItem = IdentityTooltipItem; -},{"../Form/formatters.js":34}],46:[function(require,module,exports){ +},{"../Form/formatters.js":36}],48:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.PasswordGenerator = void 0; - var _index = require("../packages/password/index.js"); - var _rules = _interopRequireDefault(require("../packages/password/rules.json")); - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); } - -function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } } - -function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; } - -function _classApplyDescriptorSet(receiver, descriptor, value) { if (descriptor.set) { descriptor.set.call(receiver, value); } else { if (!descriptor.writable) { throw new TypeError("attempted to set read only private field"); } descriptor.value = value; } } - -function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); } - -function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); } - -function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; } - -var _previous = /*#__PURE__*/new WeakMap(); - /** * Create a password once and reuse it. */ class PasswordGenerator { - constructor() { - _classPrivateFieldInitSpec(this, _previous, { - writable: true, - value: null - }); - } + /** @type {string|null} */ + #previous = null; /** @returns {boolean} */ get generated() { - return _classPrivateFieldGet(this, _previous) !== null; + return this.#previous !== null; } - /** @returns {string|null} */ - + /** @returns {string|null} */ get password() { - return _classPrivateFieldGet(this, _previous); + return this.#previous; } - /** @param {import('../packages/password').GenerateOptions} [params] */ - + /** @param {import('../packages/password').GenerateOptions} [params] */ generate() { let params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - - if (_classPrivateFieldGet(this, _previous)) { - return _classPrivateFieldGet(this, _previous); + if (this.#previous) { + return this.#previous; } - - _classPrivateFieldSet(this, _previous, (0, _index.generate)({ ...params, + this.#previous = (0, _index.generate)({ + ...params, rules: _rules.default - })); - - return _classPrivateFieldGet(this, _previous); + }); + return this.#previous; } - } - exports.PasswordGenerator = PasswordGenerator; -},{"../packages/password/index.js":15,"../packages/password/rules.json":19}],47:[function(require,module,exports){ +},{"../packages/password/index.js":17,"../packages/password/rules.json":21}],49:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.createScanner = createScanner; - var _Form = require("./Form/Form.js"); - var _constants = require("./constants.js"); - var _matching = require("./Form/matching.js"); - var _autofillUtils = require("./autofill-utils.js"); - var _deviceApiCalls = require("./deviceApiCalls/__generated__/deviceApiCalls.js"); - -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - const { MAX_INPUTS_PER_PAGE, MAX_FORMS_PER_PAGE, MAX_INPUTS_PER_FORM } = _constants.constants; + /** * @typedef {{ * forms: Map; @@ -14907,7 +13677,6 @@ const { */ /** @type {ScannerOptions} */ - const defaultScannerOptions = { // This buffer size is very large because it's an unexpected edge-case that // a DOM will be continually modified over and over without ever stopping. If we do see 1000 unique @@ -14924,302 +13693,225 @@ const defaultScannerOptions = { maxFormsPerPage: MAX_FORMS_PER_PAGE, maxInputsPerForm: MAX_INPUTS_PER_FORM }; + /** * This allows: * 1) synchronous DOM scanning + mutations - via `createScanner(device).findEligibleInputs(document)` * 2) or, as above + a debounced mutation observer to re-run the scan after the given time */ - class DefaultScanner { /** @type Map */ - + forms = new Map(); /** @type {any|undefined} the timer to reset */ - + debounceTimer; /** @type {Set} stored changed elements until they can be processed */ - + changedElements = new Set(); /** @type {ScannerOptions} */ - + options; /** @type {HTMLInputElement | null} */ - + activeInput = null; /** @type {boolean} A flag to indicate the whole page will be re-scanned */ - + rescanAll = false; /** @type {boolean} Indicates whether we called stopScanning */ - + stopped = false; /** @type {import("./Form/matching").Matching} matching */ + matching; /** * @param {import("./DeviceInterface/InterfacePrototype").default} device * @param {ScannerOptions} options */ constructor(device, options) { - _defineProperty(this, "forms", new Map()); - - _defineProperty(this, "debounceTimer", void 0); - - _defineProperty(this, "changedElements", new Set()); - - _defineProperty(this, "options", void 0); - - _defineProperty(this, "activeInput", null); - - _defineProperty(this, "rescanAll", false); - - _defineProperty(this, "stopped", false); - - _defineProperty(this, "matching", void 0); - - _defineProperty(this, "mutObs", new MutationObserver(mutationList => { - /** @type {HTMLElement[]} */ - if (this.rescanAll) { - // quick version if buffer full - this.enqueue([]); - return; - } - - const outgoing = []; - - for (const mutationRecord of mutationList) { - if (mutationRecord.type === 'childList') { - for (let addedNode of mutationRecord.addedNodes) { - if (!(addedNode instanceof HTMLElement)) continue; - if (addedNode.nodeName === 'DDG-AUTOFILL') continue; - outgoing.push(addedNode); - } - } - } - - this.enqueue(outgoing); - })); - this.device = device; this.matching = (0, _matching.createMatching)(); this.options = options; /** @type {number} A timestamp of the */ - this.initTimeStamp = Date.now(); } + /** * Determine whether we should fire the credentials autoprompt. This is needed because some sites are blank * on page load and load scripts asynchronously, so our initial scan didn't set the autoprompt correctly * @returns {boolean} */ - - get shouldAutoprompt() { return Date.now() - this.initTimeStamp <= 1500; } + /** * Call this to scan once and then watch for changes. * * Call the returned function to remove listeners. * @returns {(reason: string, ...rest) => void} */ - - init() { var _this = this; - if (this.device.globalConfig.isExtension) { this.device.deviceApi.notify(new _deviceApiCalls.AddDebugFlagCall({ flag: 'autofill' })); } - - const delay = this.options.initialDelay; // if the delay is zero, (chrome/firefox etc) then use `requestIdleCallback` - + const delay = this.options.initialDelay; + // if the delay is zero, (chrome/firefox etc) then use `requestIdleCallback` if (delay === 0) { window.requestIdleCallback(() => this.scanAndObserve()); } else { // otherwise, use the delay time to defer the initial scan setTimeout(() => this.scanAndObserve(), delay); } - return function (reason) { for (var _len = arguments.length, rest = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { rest[_key - 1] = arguments[_key]; } - _this.stopScanner(reason, ...rest); }; } + /** * Scan the page and begin observing changes */ - - scanAndObserve() { - var _window$performance, _window$performance$m, _window$performance2, _window$performance2$; - - (_window$performance = window.performance) === null || _window$performance === void 0 ? void 0 : (_window$performance$m = _window$performance.mark) === null || _window$performance$m === void 0 ? void 0 : _window$performance$m.call(_window$performance, 'initial_scanner:init:start'); + window.performance?.mark?.('initial_scanner:init:start'); this.findEligibleInputs(document); - (_window$performance2 = window.performance) === null || _window$performance2 === void 0 ? void 0 : (_window$performance2$ = _window$performance2.mark) === null || _window$performance2$ === void 0 ? void 0 : _window$performance2$.call(_window$performance2, 'initial_scanner:init:end'); + window.performance?.mark?.('initial_scanner:init:end'); (0, _autofillUtils.logPerformance)('initial_scanner'); this.mutObs.observe(document.documentElement, { childList: true, subtree: true }); } + /** * @param context */ - - findEligibleInputs(context) { - var _context$matches; - // Avoid autofill on Email Protection web app if (this.device.globalConfig.isDDGDomain) { return this; } - - if ('matches' in context && (_context$matches = context.matches) !== null && _context$matches !== void 0 && _context$matches.call(context, this.matching.cssSelector('formInputsSelector'))) { + if ('matches' in context && context.matches?.(this.matching.cssSelector('formInputsSelector'))) { this.addInput(context); } else { const inputs = context.querySelectorAll(this.matching.cssSelector('formInputsSelector')); - if (inputs.length > this.options.maxInputsPerPage) { this.stopScanner('Too many input fields in the given context, stop scanning', context); return this; } - inputs.forEach(input => this.addInput(input)); } - return this; } + /** * Stops scanning, switches off the mutation observer and clears all forms * @param {string} reason * @param {...any} rest */ - - stopScanner(reason) { - var _this$device$activeFo; - this.stopped = true; - if ((0, _autofillUtils.shouldLog)()) { for (var _len2 = arguments.length, rest = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { rest[_key2 - 1] = arguments[_key2]; } - console.log(reason, ...rest); } + const activeInput = this.device.activeForm?.activeInput; - const activeInput = (_this$device$activeFo = this.device.activeForm) === null || _this$device$activeFo === void 0 ? void 0 : _this$device$activeFo.activeInput; // remove Dax, listeners, timers, and observers - + // remove Dax, listeners, timers, and observers clearTimeout(this.debounceTimer); this.changedElements.clear(); this.mutObs.disconnect(); this.forms.forEach(form => { form.destroy(); }); - this.forms.clear(); // Bring the user back to the input they were interacting with + this.forms.clear(); - activeInput === null || activeInput === void 0 ? void 0 : activeInput.focus(); + // Bring the user back to the input they were interacting with + activeInput?.focus(); } + /** * @param {HTMLElement|HTMLInputElement|HTMLSelectElement} input * @returns {HTMLFormElement|HTMLElement} */ - - getParentForm(input) { if (input instanceof HTMLInputElement || input instanceof HTMLSelectElement) { if (input.form) { // Use input.form unless it encloses most of the DOM // In that case we proceed to identify more precise wrappers - if (this.forms.has(input.form) || // If we've added the form we've already checked that it's not a page wrapper + if (this.forms.has(input.form) || + // If we've added the form we've already checked that it's not a page wrapper !(0, _autofillUtils.isFormLikelyToBeUsedAsPageWrapper)(input.form)) { return input.form; } } } - - let element = input; // traverse the DOM to search for related inputs - + let element = input; + // traverse the DOM to search for related inputs while (element.parentElement && element.parentElement !== document.documentElement) { - var _element$parentElemen; - // Avoid overlapping containers or forms - const siblingForm = (_element$parentElemen = element.parentElement) === null || _element$parentElemen === void 0 ? void 0 : _element$parentElemen.querySelector('form'); - + const siblingForm = element.parentElement?.querySelector('form'); if (siblingForm && siblingForm !== element) { return element; } - element = element.parentElement; const inputs = element.querySelectorAll(this.matching.cssSelector('formInputsSelector')); - const buttons = element.querySelectorAll(this.matching.cssSelector('submitButtonSelector')); // If we find a button or another input, we assume that's our form - + const buttons = element.querySelectorAll(this.matching.cssSelector('submitButtonSelector')); + // If we find a button or another input, we assume that's our form if (inputs.length > 1 || buttons.length) { // found related input, return common ancestor return element; } } - return input; } + /** * @param {HTMLInputElement|HTMLSelectElement} input */ - - addInput(input) { if (this.stopped) return; const parentForm = this.getParentForm(input); - if (parentForm instanceof HTMLFormElement && this.forms.has(parentForm)) { - var _this$forms$get; - // We've met the form, add the input - (_this$forms$get = this.forms.get(parentForm)) === null || _this$forms$get === void 0 ? void 0 : _this$forms$get.addInput(input); + this.forms.get(parentForm)?.addInput(input); return; - } // Check if the forms we've seen are either disconnected, - // or are parent/child of the currently-found form - + } + // Check if the forms we've seen are either disconnected, + // or are parent/child of the currently-found form let previouslyFoundParent, childForm; - for (const [formEl] of this.forms) { // Remove disconnected forms to avoid leaks if (!formEl.isConnected) { this.forms.delete(formEl); continue; } - if (formEl.contains(parentForm)) { previouslyFoundParent = formEl; break; } - if (parentForm.contains(formEl)) { childForm = formEl; break; } } - if (previouslyFoundParent) { if (parentForm instanceof HTMLFormElement && parentForm !== previouslyFoundParent) { // If we had a prior parent but this is an explicit form, the previous was a false positive this.forms.delete(previouslyFoundParent); } else { - var _this$forms$get2; - // If we've already met the form or a descendant, add the input - (_this$forms$get2 = this.forms.get(previouslyFoundParent)) === null || _this$forms$get2 === void 0 ? void 0 : _this$forms$get2.addInput(input); + this.forms.get(previouslyFoundParent)?.addInput(input); } } else { // if this form is an ancestor of an existing form, remove that before adding this if (childForm) { - var _this$forms$get3; - - (_this$forms$get3 = this.forms.get(childForm)) === null || _this$forms$get3 === void 0 ? void 0 : _this$forms$get3.destroy(); + this.forms.get(childForm)?.destroy(); this.forms.delete(childForm); - } // Only add the form if below the limit of forms per page - + } + // Only add the form if below the limit of forms per page if (this.forms.size < this.options.maxFormsPerPage) { this.forms.set(parentForm, new _Form.Form(parentForm, input, this.device, this.matching, this.shouldAutoprompt)); } else { @@ -15227,14 +13919,13 @@ class DefaultScanner { } } } + /** * enqueue elements to be re-scanned after the given * amount of time has elapsed. * * @param {(HTMLElement|Document)[]} htmlElements */ - - enqueue(htmlElements) { // if the buffer limit is reached, stop trying to track elements and process body instead. if (this.changedElements.size >= this.options.bufferSize) { @@ -15246,77 +13937,82 @@ class DefaultScanner { this.changedElements.add(element); } } - clearTimeout(this.debounceTimer); this.debounceTimer = setTimeout(() => { - var _window$performance3, _window$performance3$, _window$performance4, _window$performance4$; - - (_window$performance3 = window.performance) === null || _window$performance3 === void 0 ? void 0 : (_window$performance3$ = _window$performance3.mark) === null || _window$performance3$ === void 0 ? void 0 : _window$performance3$.call(_window$performance3, 'scanner:init:start'); + window.performance?.mark?.('scanner:init:start'); this.processChangedElements(); this.changedElements.clear(); this.rescanAll = false; - (_window$performance4 = window.performance) === null || _window$performance4 === void 0 ? void 0 : (_window$performance4$ = _window$performance4.mark) === null || _window$performance4$ === void 0 ? void 0 : _window$performance4$.call(_window$performance4, 'scanner:init:end'); + window.performance?.mark?.('scanner:init:end'); (0, _autofillUtils.logPerformance)('scanner'); }, this.options.debounceTimePeriod); } + /** * re-scan the changed elements, but only if they * are still present in the DOM */ - - processChangedElements() { if (this.rescanAll) { this.findEligibleInputs(document); return; } - for (let element of this.changedElements) { if (element.isConnected) { this.findEligibleInputs(element); } } } + /** * Watch for changes in the DOM, and enqueue elements to be scanned * @type {MutationObserver} */ - - + mutObs = new MutationObserver(mutationList => { + /** @type {HTMLElement[]} */ + if (this.rescanAll) { + // quick version if buffer full + this.enqueue([]); + return; + } + const outgoing = []; + for (const mutationRecord of mutationList) { + if (mutationRecord.type === 'childList') { + for (let addedNode of mutationRecord.addedNodes) { + if (!(addedNode instanceof HTMLElement)) continue; + if (addedNode.nodeName === 'DDG-AUTOFILL') continue; + outgoing.push(addedNode); + } + } + } + this.enqueue(outgoing); + }); } + /** * @param {import("./DeviceInterface/InterfacePrototype").default} device * @param {Partial} [scannerOptions] * @returns {Scanner} */ - - function createScanner(device, scannerOptions) { - return new DefaultScanner(device, { ...defaultScannerOptions, + return new DefaultScanner(device, { + ...defaultScannerOptions, ...scannerOptions }); } -},{"./Form/Form.js":31,"./Form/matching.js":41,"./autofill-utils.js":59,"./constants.js":62,"./deviceApiCalls/__generated__/deviceApiCalls.js":63}],48:[function(require,module,exports){ +},{"./Form/Form.js":33,"./Form/matching.js":43,"./autofill-utils.js":61,"./constants.js":64,"./deviceApiCalls/__generated__/deviceApiCalls.js":65}],50:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Settings = void 0; - var _index = require("../packages/device-api/index.js"); - var _deviceApiCalls = require("./deviceApiCalls/__generated__/deviceApiCalls.js"); - var _validatorsZod = require("./deviceApiCalls/__generated__/validators.zod.js"); - var _autofillUtils = require("./autofill-utils.js"); - var _appleUtils = require("@duckduckgo/content-scope-scripts/src/apple-utils"); - -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - /** * Some Type helpers to prevent duplication * @typedef {import("./deviceApiCalls/__generated__/validators-ts").AutofillFeatureToggles} AutofillFeatureToggles @@ -15337,37 +14033,27 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope */ class Settings { /** @type {GlobalConfig} */ - + globalConfig; /** @type {DeviceApi} */ - + deviceApi; /** @type {AutofillFeatureToggles | null} */ - + _featureToggles = null; /** @type {AvailableInputTypes | null} */ - + _availableInputTypes = null; /** @type {RuntimeConfiguration | null | undefined} */ - + _runtimeConfiguration = null; /** @type {boolean | null} */ + _enabled = null; /** * @param {GlobalConfig} config * @param {DeviceApi} deviceApi */ constructor(config, deviceApi) { - _defineProperty(this, "globalConfig", void 0); - - _defineProperty(this, "deviceApi", void 0); - - _defineProperty(this, "_featureToggles", null); - - _defineProperty(this, "_availableInputTypes", null); - - _defineProperty(this, "_runtimeConfiguration", null); - - _defineProperty(this, "_enabled", null); - this.deviceApi = deviceApi; this.globalConfig = config; } + /** * Feature toggles are delivered as part of the Runtime Configuration - a flexible design that * allows data per user + remote config to be accessed together. @@ -15380,32 +14066,26 @@ class Settings { * * @returns {Promise} */ - - async getFeatureToggles() { try { - var _runtimeConfig$userPr, _runtimeConfig$userPr2, _runtimeConfig$userPr3; - const runtimeConfig = await this._getRuntimeConfiguration(); - const autofillSettings = (0, _index.validate)((_runtimeConfig$userPr = runtimeConfig.userPreferences) === null || _runtimeConfig$userPr === void 0 ? void 0 : (_runtimeConfig$userPr2 = _runtimeConfig$userPr.features) === null || _runtimeConfig$userPr2 === void 0 ? void 0 : (_runtimeConfig$userPr3 = _runtimeConfig$userPr2.autofill) === null || _runtimeConfig$userPr3 === void 0 ? void 0 : _runtimeConfig$userPr3.settings, _validatorsZod.autofillSettingsSchema); + const autofillSettings = (0, _index.validate)(runtimeConfig.userPreferences?.features?.autofill?.settings, _validatorsZod.autofillSettingsSchema); return autofillSettings.featureToggles; } catch (e) { // these are the fallbacks for when a platform hasn't implemented the calls above. if (this.globalConfig.isDDGTestMode) { console.log('isDDGTestMode: getFeatureToggles: ❌', e); } - return Settings.defaults.featureToggles; } } + /** * If the platform in question is happy to derive it's 'enabled' state from the RuntimeConfiguration, * then they should use this. Currently only Windows supports this, but we aim to move all platforms to * support this going forward. * @returns {Promise} */ - - async getEnabled() { try { const runtimeConfig = await this._getRuntimeConfiguration(); @@ -15416,10 +14096,10 @@ class Settings { if (this.globalConfig.isDDGTestMode) { console.log('isDDGTestMode: getFeatureToggles: ❌', e); } - return null; } } + /** * Get runtime configuration, but only once. * @@ -15433,22 +14113,19 @@ class Settings { * @throws * @private */ - - async _getRuntimeConfiguration() { if (this._runtimeConfiguration) return this._runtimeConfiguration; const runtimeConfig = await this.deviceApi.request(new _deviceApiCalls.GetRuntimeConfigurationCall(null)); this._runtimeConfiguration = runtimeConfig; return this._runtimeConfiguration; } + /** * Available Input Types are boolean indicators to represent which input types the * current **user** has data available for. * * @returns {Promise} */ - - async getAvailableInputTypes() { try { return await this.deviceApi.request(new _deviceApiCalls.GetAvailableInputTypesCall(null)); @@ -15456,10 +14133,10 @@ class Settings { if (this.globalConfig.isDDGTestMode) { console.log('isDDGTestMode: getAvailableInputTypes: ❌', e); } - return Settings.defaults.availableInputTypes; } } + /** * To 'refresh' settings means to re-call APIs to determine new state. This may * only occur once per page, but it must be done before any page scanning/decorating can happen @@ -15470,25 +14147,24 @@ class Settings { * enabled: boolean | null * }>} */ - - async refresh() { this.setEnabled(await this.getEnabled()); this.setFeatureToggles(await this.getFeatureToggles()); - this.setAvailableInputTypes(await this.getAvailableInputTypes()); // If 'this.enabled' is a boolean it means we were able to set it correctly and therefor respect its value + this.setAvailableInputTypes(await this.getAvailableInputTypes()); + // If 'this.enabled' is a boolean it means we were able to set it correctly and therefor respect its value if (typeof this.enabled === 'boolean') { if (!this.enabled) { return Settings.defaults; } } - return { featureToggles: this.featureToggles, availableInputTypes: this.availableInputTypes, enabled: this.enabled }; } + /** * Checks if input type is one which we can't autofill * @param {{ @@ -15497,31 +14173,27 @@ class Settings { * }} types * @returns {boolean} */ - - isTypeUnavailable(_ref) { let { mainType, subtype } = _ref; if (mainType === 'unknown') return true; - - if (!this.featureToggles["inputType_".concat(mainType)] && subtype !== 'emailAddress') { + if (!this.featureToggles[`inputType_${mainType}`] && subtype !== 'emailAddress') { return true; } - return false; } + /** * Requests data from remote * @returns {Promise<>} */ - - async populateData() { const availableInputTypesFromRemote = await this.getAvailableInputTypes(); this.setAvailableInputTypes(availableInputTypesFromRemote); } + /** * Requests data from remote if not available * @param {{ @@ -15530,11 +14202,7 @@ class Settings { * }} types * @returns {Promise} */ - - async populateDataIfNeeded(_ref2) { - var _this$availableInputT; - let { mainType, subtype @@ -15543,14 +14211,13 @@ class Settings { mainType, subtype })) return false; - - if (((_this$availableInputT = this.availableInputTypes) === null || _this$availableInputT === void 0 ? void 0 : _this$availableInputT[mainType]) === undefined) { + if (this.availableInputTypes?.[mainType] === undefined) { await this.populateData(); return true; } - return false; } + /** * Checks if items will show in the autofill menu, including in-context signup. * Triggers side-effect if input types is not already available. @@ -15561,11 +14228,7 @@ class Settings { * @param {import("./InContextSignup.js").InContextSignup?} inContextSignup * @returns {boolean} */ - - canAutofillType(_ref3, inContextSignup) { - var _this$availableInputT6; - let { mainType, subtype @@ -15573,157 +14236,146 @@ class Settings { if (this.isTypeUnavailable({ mainType, subtype - })) return false; // If it's an email field and Email Protection is enabled, return true regardless of other options + })) return false; + // If it's an email field and Email Protection is enabled, return true regardless of other options const isEmailProtectionEnabled = this.featureToggles.emailProtection && this.availableInputTypes.email; - if (subtype === 'emailAddress' && isEmailProtectionEnabled) { return true; } - - if (inContextSignup !== null && inContextSignup !== void 0 && inContextSignup.isAvailable(subtype)) { + if (inContextSignup?.isAvailable(subtype)) { return true; } - if (subtype === 'fullName') { - var _this$availableInputT2, _this$availableInputT3; - - return Boolean(((_this$availableInputT2 = this.availableInputTypes.identities) === null || _this$availableInputT2 === void 0 ? void 0 : _this$availableInputT2.firstName) || ((_this$availableInputT3 = this.availableInputTypes.identities) === null || _this$availableInputT3 === void 0 ? void 0 : _this$availableInputT3.lastName)); + return Boolean(this.availableInputTypes.identities?.firstName || this.availableInputTypes.identities?.lastName); } - if (subtype === 'expiration') { - var _this$availableInputT4, _this$availableInputT5; - - return Boolean(((_this$availableInputT4 = this.availableInputTypes.creditCards) === null || _this$availableInputT4 === void 0 ? void 0 : _this$availableInputT4.expirationMonth) || ((_this$availableInputT5 = this.availableInputTypes.creditCards) === null || _this$availableInputT5 === void 0 ? void 0 : _this$availableInputT5.expirationYear)); + return Boolean(this.availableInputTypes.creditCards?.expirationMonth || this.availableInputTypes.creditCards?.expirationYear); } - - return Boolean((_this$availableInputT6 = this.availableInputTypes[mainType]) === null || _this$availableInputT6 === void 0 ? void 0 : _this$availableInputT6[subtype]); + return Boolean(this.availableInputTypes[mainType]?.[subtype]); } - /** @returns {AutofillFeatureToggles} */ - + /** @returns {AutofillFeatureToggles} */ get featureToggles() { if (this._featureToggles === null) throw new Error('feature toggles accessed before being set'); return this._featureToggles; } - /** @param {AutofillFeatureToggles} input */ - + /** @param {AutofillFeatureToggles} input */ setFeatureToggles(input) { this._featureToggles = input; } - /** @returns {AvailableInputTypes} */ - + /** @returns {AvailableInputTypes} */ get availableInputTypes() { if (this._availableInputTypes === null) throw new Error('available input types accessed before being set'); return this._availableInputTypes; } - /** @param {AvailableInputTypes} value */ - + /** @param {AvailableInputTypes} value */ setAvailableInputTypes(value) { - this._availableInputTypes = { ...this._availableInputTypes, + this._availableInputTypes = { + ...this._availableInputTypes, ...value }; } - + static defaults = { + /** @type {AutofillFeatureToggles} */ + featureToggles: { + credentials_saving: false, + password_generation: false, + emailProtection: false, + emailProtection_incontext_signup: false, + inputType_identities: false, + inputType_credentials: false, + inputType_creditCards: false, + inlineIcon_credentials: false + }, + /** @type {AvailableInputTypes} */ + availableInputTypes: { + credentials: { + username: false, + password: false + }, + identities: { + firstName: false, + middleName: false, + lastName: false, + birthdayDay: false, + birthdayMonth: false, + birthdayYear: false, + addressStreet: false, + addressStreet2: false, + addressCity: false, + addressProvince: false, + addressPostalCode: false, + addressCountryCode: false, + phone: false, + emailAddress: false + }, + creditCards: { + cardName: false, + cardSecurityCode: false, + expirationMonth: false, + expirationYear: false, + cardNumber: false + }, + email: false + }, + /** @type {boolean | null} */ + enabled: null + }; static default(globalConfig, deviceApi) { const settings = new Settings(globalConfig, deviceApi); settings.setFeatureToggles(Settings.defaults.featureToggles); settings.setAvailableInputTypes(Settings.defaults.availableInputTypes); return settings; } - /** @returns {boolean|null} */ - + /** @returns {boolean|null} */ get enabled() { return this._enabled; } + /** * @param {boolean|null} enabled */ - - setEnabled(enabled) { this._enabled = enabled; } - } - exports.Settings = Settings; -_defineProperty(Settings, "defaults", { - /** @type {AutofillFeatureToggles} */ - featureToggles: { - credentials_saving: false, - password_generation: false, - emailProtection: false, - emailProtection_incontext_signup: false, - inputType_identities: false, - inputType_credentials: false, - inputType_creditCards: false, - inlineIcon_credentials: false - }, - - /** @type {AvailableInputTypes} */ - availableInputTypes: { - credentials: { - username: false, - password: false - }, - identities: { - firstName: false, - middleName: false, - lastName: false, - birthdayDay: false, - birthdayMonth: false, - birthdayYear: false, - addressStreet: false, - addressStreet2: false, - addressCity: false, - addressProvince: false, - addressPostalCode: false, - addressCountryCode: false, - phone: false, - emailAddress: false - }, - creditCards: { - cardName: false, - cardSecurityCode: false, - expirationMonth: false, - expirationYear: false, - cardNumber: false - }, - email: false - }, - - /** @type {boolean | null} */ - enabled: null -}); - -},{"../packages/device-api/index.js":10,"./autofill-utils.js":59,"./deviceApiCalls/__generated__/deviceApiCalls.js":63,"./deviceApiCalls/__generated__/validators.zod.js":64,"@duckduckgo/content-scope-scripts/src/apple-utils":1}],49:[function(require,module,exports){ +},{"../packages/device-api/index.js":12,"./autofill-utils.js":61,"./deviceApiCalls/__generated__/deviceApiCalls.js":65,"./deviceApiCalls/__generated__/validators.zod.js":66,"@duckduckgo/content-scope-scripts/src/apple-utils":1}],51:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; - var _autofillUtils = require("../autofill-utils.js"); - var _HTMLTooltip = _interopRequireDefault(require("./HTMLTooltip.js")); - var _Credentials = require("../InputTypes/Credentials.js"); - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - class DataHTMLTooltip extends _HTMLTooltip.default { renderEmailProtectionIncontextSignup(isOtherItems) { - const dataTypeClass = "tooltip__button--data--identities"; + const dataTypeClass = `tooltip__button--data--identities`; const providerIconClass = 'tooltip__button--data--duckduckgo'; - return "\n ".concat(isOtherItems ? '
' : '', "\n \n "); + return ` + ${isOtherItems ? '
' : ''} + + `; } + /** * @param {InputTypeConfigs} config * @param {TooltipItemRenderer[]} items @@ -15736,38 +14388,58 @@ class DataHTMLTooltip extends _HTMLTooltip.default { * onIncontextSignup?(): void * }} callbacks */ - - render(config, items, callbacks) { const { wrapperClass, css } = this.options; - const isTopAutofill = wrapperClass === null || wrapperClass === void 0 ? void 0 : wrapperClass.includes('top-autofill'); - let hasAddedSeparator = false; // Only show an hr above the first duck address button, but it can be either personal or private - + const isTopAutofill = wrapperClass?.includes('top-autofill'); + let hasAddedSeparator = false; + // Only show an hr above the first duck address button, but it can be either personal or private const shouldShowSeparator = (dataId, index) => { const shouldShow = ['personalAddress', 'privateAddress'].includes(dataId) && !hasAddedSeparator; - if (shouldShow) hasAddedSeparator = true; // Don't show the separator if we want to show it, but it's unnecessary as the first item in the menu + if (shouldShow) hasAddedSeparator = true; + // Don't show the separator if we want to show it, but it's unnecessary as the first item in the menu const isFirst = index === 0; return shouldShow && !isFirst; - }; // Only show manage Manage… when it's topAutofill, the provider is unlocked, and it's not just EmailProtection - + }; + // Only show manage Manage… when it's topAutofill, the provider is unlocked, and it's not just EmailProtection const shouldShowManageButton = isTopAutofill && items.some(item => !['personalAddress', 'privateAddress', _Credentials.PROVIDER_LOCKED].includes(item.id())); const topClass = wrapperClass || ''; - const dataTypeClass = "tooltip__button--data--".concat(config.type); - this.shadow.innerHTML = "\n".concat(css, "\n"); + const dataTypeClass = `tooltip__button--data--${config.type}`; + this.shadow.innerHTML = ` +${css} +`; this.wrapper = this.shadow.querySelector('.wrapper'); this.tooltip = this.shadow.querySelector('.tooltip'); this.autofillButtons = this.shadow.querySelectorAll('.js-autofill-button'); @@ -15782,49 +14454,36 @@ class DataHTMLTooltip extends _HTMLTooltip.default { }); }); this.manageButton = this.shadow.getElementById('manage-button'); - if (this.manageButton) { this.registerClickableButton(this.manageButton, () => { callbacks.onManage(config.type); }); } - const getIncontextSignup = this.shadow.querySelector('.js-get-email-signup'); - if (getIncontextSignup) { this.registerClickableButton(getIncontextSignup, () => { - var _callbacks$onIncontex, _callbacks$onIncontex2; - - (_callbacks$onIncontex = callbacks.onIncontextSignupDismissed) === null || _callbacks$onIncontex === void 0 ? void 0 : _callbacks$onIncontex.call(callbacks, { + callbacks.onIncontextSignupDismissed?.({ hasOtherOptions: items.length > 0 }); - (_callbacks$onIncontex2 = callbacks.onIncontextSignup) === null || _callbacks$onIncontex2 === void 0 ? void 0 : _callbacks$onIncontex2.call(callbacks); + callbacks.onIncontextSignup?.(); }); } - this.init(); return this; } - } +var _default = exports.default = DataHTMLTooltip; -var _default = DataHTMLTooltip; -exports.default = _default; - -},{"../InputTypes/Credentials.js":43,"../autofill-utils.js":59,"./HTMLTooltip.js":52}],50:[function(require,module,exports){ +},{"../InputTypes/Credentials.js":45,"../autofill-utils.js":61,"./HTMLTooltip.js":54}],52:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; - var _autofillUtils = require("../autofill-utils.js"); - var _HTMLTooltip = _interopRequireDefault(require("./HTMLTooltip.js")); - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - class EmailHTMLTooltip extends _HTMLTooltip.default { /** * @param {import("../DeviceInterface/InterfacePrototype").default} device @@ -15832,20 +14491,34 @@ class EmailHTMLTooltip extends _HTMLTooltip.default { render(device) { this.device = device; this.addresses = device.getLocalAddresses(); - this.shadow.innerHTML = "\n".concat(this.options.css, "\n"); + this.shadow.innerHTML = ` +${this.options.css} +`; this.wrapper = this.shadow.querySelector('.wrapper'); this.tooltip = this.shadow.querySelector('.tooltip'); this.usePersonalButton = this.shadow.querySelector('.js-use-personal'); this.usePrivateButton = this.shadow.querySelector('.js-use-private'); this.addressEl = this.shadow.querySelector('.js-address'); - this.updateAddresses = addresses => { if (addresses && this.addressEl) { this.addresses = addresses; this.addressEl.textContent = (0, _autofillUtils.formatDuckAddress)(addresses.personalAddress); } }; - const firePixel = this.device.firePixel.bind(this.device); this.registerClickableButton(this.usePersonalButton, () => { this.fillForm('personalAddress'); @@ -15858,8 +14531,9 @@ class EmailHTMLTooltip extends _HTMLTooltip.default { firePixel({ pixelName: 'autofill_private_address' }); - }); // Get the alias from the extension + }); + // Get the alias from the extension this.device.getAddresses().then(this.updateAddresses); this.init(); return this; @@ -15867,87 +14541,83 @@ class EmailHTMLTooltip extends _HTMLTooltip.default { /** * @param {'personalAddress' | 'privateAddress'} id */ - - async fillForm(id) { - var _this$device; - const address = this.addresses[id]; const formattedAddress = (0, _autofillUtils.formatDuckAddress)(address); - (_this$device = this.device) === null || _this$device === void 0 ? void 0 : _this$device.selectedDetail({ + this.device?.selectedDetail({ email: formattedAddress, id }, 'email'); } - } +var _default = exports.default = EmailHTMLTooltip; -var _default = EmailHTMLTooltip; -exports.default = _default; - -},{"../autofill-utils.js":59,"./HTMLTooltip.js":52}],51:[function(require,module,exports){ +},{"../autofill-utils.js":61,"./HTMLTooltip.js":54}],53:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; - var _HTMLTooltip = _interopRequireDefault(require("./HTMLTooltip.js")); - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - class EmailSignupHTMLTooltip extends _HTMLTooltip.default { /** * @param {import("../DeviceInterface/InterfacePrototype").default} device */ render(device) { this.device = device; - this.shadow.innerHTML = "\n".concat(this.options.css, "\n"); + this.shadow.innerHTML = ` +${this.options.css} +`; this.tooltip = this.shadow.querySelector('.tooltip'); this.closeEmailSignup = this.shadow.querySelector('.js-close-email-signup'); this.registerClickableButton(this.closeEmailSignup, () => { - var _device$inContextSign; - - (_device$inContextSign = device.inContextSignup) === null || _device$inContextSign === void 0 ? void 0 : _device$inContextSign.onIncontextSignupClosed(); + device.inContextSignup?.onIncontextSignupClosed(); }); this.dismissEmailSignup = this.shadow.querySelector('.js-dismiss-email-signup'); this.registerClickableButton(this.dismissEmailSignup, () => { - var _device$inContextSign2; - - (_device$inContextSign2 = device.inContextSignup) === null || _device$inContextSign2 === void 0 ? void 0 : _device$inContextSign2.onIncontextSignupDismissed(); + device.inContextSignup?.onIncontextSignupDismissed(); }); this.getEmailSignup = this.shadow.querySelector('.js-get-email-signup'); this.registerClickableButton(this.getEmailSignup, () => { - var _device$inContextSign3; - - (_device$inContextSign3 = device.inContextSignup) === null || _device$inContextSign3 === void 0 ? void 0 : _device$inContextSign3.onIncontextSignup(); + device.inContextSignup?.onIncontextSignup(); }); this.init(); return this; } - } +var _default = exports.default = EmailSignupHTMLTooltip; -var _default = EmailSignupHTMLTooltip; -exports.default = _default; - -},{"./HTMLTooltip.js":52}],52:[function(require,module,exports){ +},{"./HTMLTooltip.js":54}],54:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.defaultOptions = exports.default = exports.HTMLTooltip = void 0; - var _autofillUtils = require("../autofill-utils.js"); - var _matching = require("../Form/matching.js"); - var _styles = require("./styles/styles.js"); - -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - /** * @typedef {object} HTMLTooltipOptions * @property {boolean} testMode @@ -15969,25 +14639,29 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope */ /** @type {HTMLTooltipOptions} */ -const defaultOptions = { +const defaultOptions = exports.defaultOptions = { wrapperClass: '', - tooltipPositionClass: (top, left) => "\n .tooltip {\n transform: translate(".concat(Math.floor(left), "px, ").concat(Math.floor(top), "px) !important;\n }\n "), - caretPositionClass: (top, left, isAboveInput) => "\n .tooltip--email__caret {\n ".concat(isAboveInput ? "transform: translate(".concat(Math.floor(left), "px, ").concat(Math.floor(top), "px) rotate(180deg); transform-origin: 18px !important;") : "transform: translate(".concat(Math.floor(left), "px, ").concat(Math.floor(top), "px) !important;"), "\n }"), - css: ""), + tooltipPositionClass: (top, left) => ` + .tooltip { + transform: translate(${Math.floor(left)}px, ${Math.floor(top)}px) !important; + } + `, + caretPositionClass: (top, left, isAboveInput) => ` + .tooltip--email__caret { + ${isAboveInput ? `transform: translate(${Math.floor(left)}px, ${Math.floor(top)}px) rotate(180deg); transform-origin: 18px !important;` : `transform: translate(${Math.floor(left)}px, ${Math.floor(top)}px) !important;`} + }`, + css: ``, setSize: undefined, - remove: () => { - /** noop */ - }, + remove: () => {/** noop */}, testMode: false, checkVisibility: true, hasCaret: false, isIncontextSignupAvailable: () => false }; -exports.defaultOptions = defaultOptions; - class HTMLTooltip { + isAboveInput = false; /** @type {HTMLTooltipOptions} */ - + options; /** * @param config * @param inputType @@ -15995,30 +14669,6 @@ class HTMLTooltip { * @param {HTMLTooltipOptions} options */ constructor(config, inputType, getPosition, options) { - _defineProperty(this, "isAboveInput", false); - - _defineProperty(this, "options", void 0); - - _defineProperty(this, "resObs", new ResizeObserver(entries => entries.forEach(() => this.checkPosition()))); - - _defineProperty(this, "mutObsCheckPositionWhenIdle", _autofillUtils.whenIdle.call(this, this.checkPosition)); - - _defineProperty(this, "mutObs", new MutationObserver(mutationList => { - for (const mutationRecord of mutationList) { - if (mutationRecord.type === 'childList') { - // Only check added nodes - mutationRecord.addedNodes.forEach(el => { - if (el.nodeName === 'DDG-AUTOFILL') return; - this.ensureIsLastInDOM(); - }); - } - } - - this.mutObsCheckPositionWhenIdle(); - })); - - _defineProperty(this, "clickableButtons", new Map()); - this.options = options; this.shadow = document.createElement('ddg-autofill').attachShadow({ mode: options.testMode ? 'open' : 'closed' @@ -16032,8 +14682,8 @@ class HTMLTooltip { 'display': 'block', 'visibility': 'visible', 'opacity': '1' - }; // @ts-ignore how to narrow this.host to HTMLElement? - + }; + // @ts-ignore how to narrow this.host to HTMLElement? (0, _autofillUtils.addInlineStyles)(this.host, forcedVisibilityStyles); this.count = 0; this.device = null; @@ -16043,7 +14693,6 @@ class HTMLTooltip { * 'caret': TransformRuleObj * }} */ - this.transformRules = { caret: { getRuleString: this.options.caretPositionClass, @@ -16055,19 +14704,14 @@ class HTMLTooltip { } }; } - get isHidden() { return this.tooltip.parentNode.hidden; } - append() { document.body.appendChild(this.host); } - remove() { - var _this$device; - - (_this$device = this.device) === null || _this$device === void 0 ? void 0 : _this$device.activeForm.resetIconStylesToInitial(); + this.device?.activeForm.resetIconStylesToInitial(); window.removeEventListener('scroll', this, { capture: true }); @@ -16075,13 +14719,11 @@ class HTMLTooltip { this.mutObs.disconnect(); this.lift(); } - lift() { this.left = null; this.top = null; document.body.removeChild(this.host); } - handleEvent(event) { switch (event.type) { case 'scroll': @@ -16089,24 +14731,19 @@ class HTMLTooltip { break; } } - focus(x, y) { - var _this$shadow$elementF, _this$shadow$elementF2; - const focusableElements = 'button'; const currentFocusClassName = 'currentFocus'; - const currentFocused = this.shadow.querySelectorAll(".".concat(currentFocusClassName)); + const currentFocused = this.shadow.querySelectorAll(`.${currentFocusClassName}`); [...currentFocused].forEach(el => { el.classList.remove(currentFocusClassName); }); - (_this$shadow$elementF = this.shadow.elementFromPoint(x, y)) === null || _this$shadow$elementF === void 0 ? void 0 : (_this$shadow$elementF2 = _this$shadow$elementF.closest(focusableElements)) === null || _this$shadow$elementF2 === void 0 ? void 0 : _this$shadow$elementF2.classList.add(currentFocusClassName); + this.shadow.elementFromPoint(x, y)?.closest(focusableElements)?.classList.add(currentFocusClassName); } - checkPosition() { if (this.animationFrame) { window.cancelAnimationFrame(this.animationFrame); } - this.animationFrame = window.requestAnimationFrame(() => { if (this.isHidden) return; const { @@ -16115,14 +14752,12 @@ class HTMLTooltip { height, top } = this.getPosition(); - if (left !== this.left || bottom !== this.top) { const coords = { left, top: bottom }; this.updatePosition('tooltip', coords); - if (this.options.hasCaret) { // Recalculate tooltip top as it may have changed after update potition above const { @@ -16131,16 +14766,15 @@ class HTMLTooltip { this.isAboveInput = top > tooltipTop; const borderWidth = 2; const caretTop = this.isAboveInput ? coords.top - height - borderWidth : coords.top; - this.updatePosition('caret', { ...coords, + this.updatePosition('caret', { + ...coords, top: caretTop }); } } - this.animationFrame = null; }); } - getOverridePosition(_ref) { let { left, @@ -16148,8 +14782,9 @@ class HTMLTooltip { } = _ref; const tooltipBoundingBox = this.tooltip.getBoundingClientRect(); const smallScreenWidth = tooltipBoundingBox.width * 2; - const spacing = 5; // If overflowing from the bottom, move to above the input + const spacing = 5; + // If overflowing from the bottom, move to above the input if (tooltipBoundingBox.bottom > window.innerHeight) { const inputPosition = this.getPosition(); const caretHeight = 14; @@ -16158,9 +14793,9 @@ class HTMLTooltip { left, top: overriddenTopPosition }; - } // If overflowing from the left on smaller screen, center in the window - + } + // If overflowing from the left on smaller screen, center in the window if (tooltipBoundingBox.left < 0 && window.innerWidth <= smallScreenWidth) { const leftOverflow = Math.abs(tooltipBoundingBox.left); const leftPosWhenCentered = (window.innerWidth - tooltipBoundingBox.width) / 2; @@ -16169,9 +14804,9 @@ class HTMLTooltip { left: overriddenLeftPosition, top }; - } // If overflowing from the left on larger screen, move so it's just on screen on the left - + } + // If overflowing from the left on larger screen, move so it's just on screen on the left if (tooltipBoundingBox.left < 0 && window.innerWidth > smallScreenWidth) { const leftOverflow = Math.abs(tooltipBoundingBox.left); const overriddenLeftPosition = left + leftOverflow + spacing; @@ -16179,9 +14814,9 @@ class HTMLTooltip { left: overriddenLeftPosition, top }; - } // If overflowing from the right, move so it's just on screen on the right - + } + // If overflowing from the right, move so it's just on screen on the right if (tooltipBoundingBox.right > window.innerWidth) { const rightOverflow = tooltipBoundingBox.right - window.innerWidth; const overriddenLeftPosition = left - rightOverflow - spacing; @@ -16191,6 +14826,7 @@ class HTMLTooltip { }; } } + /** * @param {'tooltip' | 'caret'} element * @param {{ @@ -16198,18 +14834,13 @@ class HTMLTooltip { * top: number * }} coords */ - - applyPositionalStyles(element, _ref2) { - var _ruleObj$getRuleStrin; - let { left, top } = _ref2; const shadow = this.shadow; const ruleObj = this.transformRules[element]; - if (ruleObj.index) { if (shadow.styleSheets[0].rules[ruleObj.index]) { // If we have already set the rule, remove it… @@ -16219,13 +14850,12 @@ class HTMLTooltip { // …otherwise, set the index as the very last rule ruleObj.index = shadow.styleSheets[0].rules.length; } - - const cssRule = (_ruleObj$getRuleStrin = ruleObj.getRuleString) === null || _ruleObj$getRuleStrin === void 0 ? void 0 : _ruleObj$getRuleStrin.call(ruleObj, top, left, this.isAboveInput); - + const cssRule = ruleObj.getRuleString?.(top, left, this.isAboveInput); if (typeof cssRule === 'string') { shadow.styleSheets[0].insertRule(cssRule, ruleObj.index); } } + /** * @param {'tooltip' | 'caret'} element * @param {{ @@ -16233,29 +14863,22 @@ class HTMLTooltip { * top: number * }} coords */ - - updatePosition(element, _ref3) { let { left, top } = _ref3; - // If the stylesheet is not loaded wait for load (Chrome bug) if (!this.shadow.styleSheets.length) { - var _this$stylesheet; - - (_this$stylesheet = this.stylesheet) === null || _this$stylesheet === void 0 ? void 0 : _this$stylesheet.addEventListener('load', () => this.checkPosition()); + this.stylesheet?.addEventListener('load', () => this.checkPosition()); return; } - this.left = left; this.top = top; this.applyPositionalStyles(element, { left, top }); - if (this.options.hasCaret) { const overridePosition = this.getOverridePosition({ left, @@ -16264,10 +14887,9 @@ class HTMLTooltip { if (overridePosition) this.updatePosition(element, overridePosition); } } - ensureIsLastInDOM() { - this.count = this.count || 0; // If DDG el is not the last in the doc, move it there - + this.count = this.count || 0; + // If DDG el is not the last in the doc, move it there if (document.body.lastElementChild !== this.host) { // Try up to 15 times to avoid infinite loop in case someone is doing the same if (this.count < 15) { @@ -16278,29 +14900,39 @@ class HTMLTooltip { } else { // Remove the tooltip from the form to cleanup listeners and observers this.options.remove(); - console.info("DDG autofill bailing out"); + console.info(`DDG autofill bailing out`); } } } - + resObs = new ResizeObserver(entries => entries.forEach(() => this.checkPosition())); + mutObsCheckPositionWhenIdle = _autofillUtils.whenIdle.call(this, this.checkPosition); + mutObs = new MutationObserver(mutationList => { + for (const mutationRecord of mutationList) { + if (mutationRecord.type === 'childList') { + // Only check added nodes + mutationRecord.addedNodes.forEach(el => { + if (el.nodeName === 'DDG-AUTOFILL') return; + this.ensureIsLastInDOM(); + }); + } + } + this.mutObsCheckPositionWhenIdle(); + }); setActiveButton(e) { this.activeButton = e.target; } - unsetActiveButton() { this.activeButton = null; } - + clickableButtons = new Map(); registerClickableButton(btn, handler) { - this.clickableButtons.set(btn, handler); // Needed because clicks within the shadow dom don't provide this info to the outside - + this.clickableButtons.set(btn, handler); + // Needed because clicks within the shadow dom don't provide this info to the outside btn.addEventListener('mouseenter', e => this.setActiveButton(e)); btn.addEventListener('mouseleave', () => this.unsetActiveButton()); } - dispatchClick() { const handler = this.clickableButtons.get(this.activeButton); - if (handler) { if (this.activeButton.matches('.wrapper:not(.top-autofill) button:hover, .wrapper:not(.top-autofill) a:hover, .currentFocus')) { (0, _autofillUtils.safeExecute)(this.activeButton, handler, { @@ -16311,7 +14943,6 @@ class HTMLTooltip { } } } - setupSizeListener() { // Listen to layout and paint changes to register the size const observer = new PerformanceObserver(() => { @@ -16321,31 +14952,25 @@ class HTMLTooltip { entryTypes: ['layout-shift', 'paint'] }); } - setSize() { - var _this$options$setSize, _this$options; - - const innerNode = this.shadow.querySelector('.wrapper--data'); // Shouldn't be possible - + const innerNode = this.shadow.querySelector('.wrapper--data'); + // Shouldn't be possible if (!innerNode) return; const details = { height: innerNode.clientHeight, width: innerNode.clientWidth }; - (_this$options$setSize = (_this$options = this.options).setSize) === null || _this$options$setSize === void 0 ? void 0 : _this$options$setSize.call(_this$options, details); + this.options.setSize?.(details); } - init() { - var _this$stylesheet2; - this.animationFrame = null; this.top = 0; this.left = 0; this.transformRuleIndex = null; - this.stylesheet = this.shadow.querySelector('link, style'); // Un-hide once the style and web fonts have loaded, to avoid flashing + this.stylesheet = this.shadow.querySelector('link, style'); + // Un-hide once the style and web fonts have loaded, to avoid flashing // unstyled content and layout shifts - - (_this$stylesheet2 = this.stylesheet) === null || _this$stylesheet2 === void 0 ? void 0 : _this$stylesheet2.addEventListener('load', () => { + this.stylesheet?.addEventListener('load', () => { Promise.allSettled([document.fonts.load("normal 13px 'DDG_ProximaNova'"), document.fonts.load("bold 13px 'DDG_ProximaNova'")]).then(() => { this.tooltip.parentNode.removeAttribute('hidden'); this.checkPosition(); @@ -16362,46 +14987,30 @@ class HTMLTooltip { capture: true }); this.setSize(); - if (typeof this.options.setSize === 'function') { this.setupSizeListener(); } } - } - exports.HTMLTooltip = HTMLTooltip; -var _default = HTMLTooltip; -exports.default = _default; +var _default = exports.default = HTMLTooltip; -},{"../Form/matching.js":41,"../autofill-utils.js":59,"./styles/styles.js":58}],53:[function(require,module,exports){ +},{"../Form/matching.js":43,"../autofill-utils.js":61,"./styles/styles.js":60}],55:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.HTMLTooltipUIController = void 0; - var _autofillUtils = require("../../autofill-utils.js"); - var _inputTypeConfig = require("../../Form/inputTypeConfig.js"); - var _matching = require("../../Form/matching.js"); - var _DataHTMLTooltip = _interopRequireDefault(require("../DataHTMLTooltip.js")); - var _EmailHTMLTooltip = _interopRequireDefault(require("../EmailHTMLTooltip.js")); - var _EmailSignupHTMLTooltip = _interopRequireDefault(require("../EmailSignupHTMLTooltip.js")); - var _HTMLTooltip = require("../HTMLTooltip.js"); - var _UIController = require("./UIController.js"); - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - /** * @typedef HTMLTooltipControllerOptions * @property {"modern" | "legacy" | "emailsignup"} tooltipKind - A choice between the newer Autofill UI vs the older ones used in the extension @@ -16417,15 +15026,19 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope */ class HTMLTooltipUIController extends _UIController.UIController { /** @type {import("../HTMLTooltip.js").HTMLTooltip | null} */ + _activeTooltip = null; /** @type {HTMLTooltipControllerOptions} */ + _options; /** @type {import('../HTMLTooltip.js').HTMLTooltipOptions} */ + _htmlTooltipOptions; /** * Overwritten when calling createTooltip * @type {import('../../Form/matching').SupportedTypes} */ + _activeInputType = 'unknown'; /** * @param {HTMLTooltipControllerOptions} options @@ -16434,24 +15047,13 @@ class HTMLTooltipUIController extends _UIController.UIController { constructor(options) { let htmlTooltipOptions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _HTMLTooltip.defaultOptions; super(); - - _defineProperty(this, "_activeTooltip", null); - - _defineProperty(this, "_options", void 0); - - _defineProperty(this, "_htmlTooltipOptions", void 0); - - _defineProperty(this, "_activeInputType", 'unknown'); - - _defineProperty(this, "_activeInput", void 0); - - _defineProperty(this, "_activeInputOriginalAutocomplete", void 0); - this._options = options; this._htmlTooltipOptions = Object.assign({}, _HTMLTooltip.defaultOptions, htmlTooltipOptions); window.addEventListener('pointerdown', this, true); window.addEventListener('pointerup', this, true); } + _activeInput; + _activeInputOriginalAutocomplete; /** * Cleans up after this UI controller by removing the tooltip and all @@ -16462,16 +15064,14 @@ class HTMLTooltipUIController extends _UIController.UIController { window.removeEventListener('pointerdown', this, true); window.removeEventListener('pointerup', this, true); } + /** * @param {import('./UIController').AttachArgs} args */ - - attach(args) { if (this.getActiveTooltip()) { return; } - const { topContextData, getPosition, @@ -16485,55 +15085,49 @@ class HTMLTooltipUIController extends _UIController.UIController { this._activeInputOriginalAutocomplete = input.getAttribute('autocomplete'); input.setAttribute('autocomplete', 'off'); } + /** * Actually create the HTML Tooltip * @param {PosFn} getPosition * @param {TopContextData} topContextData * @return {import("../HTMLTooltip").HTMLTooltip} */ - - createTooltip(getPosition, topContextData) { this._attachListeners(); - const config = (0, _inputTypeConfig.getInputConfigFromType)(topContextData.inputType); this._activeInputType = topContextData.inputType; + /** * @type {import('../HTMLTooltip').HTMLTooltipOptions} */ - - const tooltipOptions = { ...this._htmlTooltipOptions, + const tooltipOptions = { + ...this._htmlTooltipOptions, remove: () => this.removeTooltip(), isIncontextSignupAvailable: () => { - var _this$_options$device; - const subtype = (0, _matching.getSubtypeFromType)(topContextData.inputType); - return !!((_this$_options$device = this._options.device.inContextSignup) !== null && _this$_options$device !== void 0 && _this$_options$device.isAvailable(subtype)); + return !!this._options.device.inContextSignup?.isAvailable(subtype); } }; - if (this._options.tooltipKind === 'legacy') { this._options.device.firePixel({ pixelName: 'autofill_show' }); - return new _EmailHTMLTooltip.default(config, topContextData.inputType, getPosition, tooltipOptions).render(this._options.device); } - if (this._options.tooltipKind === 'emailsignup') { this._options.device.firePixel({ pixelName: 'incontext_show' }); - return new _EmailSignupHTMLTooltip.default(config, topContextData.inputType, getPosition, tooltipOptions).render(this._options.device); - } // collect the data for each item to display - - - const data = this._dataForAutofill(config, topContextData.inputType, topContextData); // convert the data into tool tip item renderers + } + // collect the data for each item to display + const data = this._dataForAutofill(config, topContextData.inputType, topContextData); - const asRenderers = data.map(d => config.tooltipItem(d)); // construct the autofill + // convert the data into tool tip item renderers + const asRenderers = data.map(d => config.tooltipItem(d)); + // construct the autofill return new _DataHTMLTooltip.default(config, topContextData.inputType, getPosition, tooltipOptions).render(config, asRenderers, { onSelect: id => { this._onSelect(topContextData.inputType, data, id); @@ -16549,16 +15143,15 @@ class HTMLTooltipUIController extends _UIController.UIController { } }); } - updateItems(data) { if (this._activeInputType === 'unknown') return; - const config = (0, _inputTypeConfig.getInputConfigFromType)(this._activeInputType); // convert the data into tool tip item renderers + const config = (0, _inputTypeConfig.getInputConfigFromType)(this._activeInputType); + // convert the data into tool tip item renderers const asRenderers = data.map(d => config.tooltipItem(d)); const activeTooltip = this.getActiveTooltip(); - if (activeTooltip instanceof _DataHTMLTooltip.default) { - activeTooltip === null || activeTooltip === void 0 ? void 0 : activeTooltip.render(config, asRenderers, { + activeTooltip?.render(config, asRenderers, { onSelect: id => { this._onSelect(this._activeInputType, data, id); }, @@ -16572,27 +15165,21 @@ class HTMLTooltipUIController extends _UIController.UIController { this._onIncontextSignup(); } }); - } // TODO: can we remove this timeout once implemented with real APIs? + } + // TODO: can we remove this timeout once implemented with real APIs? // The timeout is needed because clientHeight and clientWidth were returning 0 - - setTimeout(() => { - var _this$getActiveToolti; - - (_this$getActiveToolti = this.getActiveTooltip()) === null || _this$getActiveToolti === void 0 ? void 0 : _this$getActiveToolti.setSize(); + this.getActiveTooltip()?.setSize(); }, 10); } - _attachListeners() { window.addEventListener('input', this); window.addEventListener('keydown', this, true); } - _removeListeners() { window.removeEventListener('input', this); window.removeEventListener('keydown', this, true); } - handleEvent(event) { switch (event.type) { case 'keydown': @@ -16601,102 +15188,91 @@ class HTMLTooltipUIController extends _UIController.UIController { event.preventDefault(); event.stopImmediatePropagation(); } - this.removeTooltip(); } - break; - case 'input': this.removeTooltip(); break; - case 'pointerdown': { this._pointerDownListener(event); - break; } - case 'pointerup': { this._pointerUpListener(event); - break; } } - } // Global listener for event delegation - + } + // Global listener for event delegation _pointerDownListener(e) { - if (!e.isTrusted) return; // Ignore events on the Dax icon, we handle those elsewhere - - if ((0, _autofillUtils.isEventWithinDax)(e, e.target)) return; // @ts-ignore + if (!e.isTrusted) return; + // Ignore events on the Dax icon, we handle those elsewhere + if ((0, _autofillUtils.isEventWithinDax)(e, e.target)) return; + // @ts-ignore if (e.target.nodeName === 'DDG-AUTOFILL') { e.preventDefault(); - e.stopImmediatePropagation(); // Ignore pointer down events, we'll handle them on pointer up + e.stopImmediatePropagation(); + // Ignore pointer down events, we'll handle them on pointer up } else { this.removeTooltip().catch(e => { console.error('error removing tooltip', e); }); } - } // Global listener for event delegation - + } + // Global listener for event delegation _pointerUpListener(e) { - if (!e.isTrusted) return; // Ignore events on the Dax icon, we handle those elsewhere - - if ((0, _autofillUtils.isEventWithinDax)(e, e.target)) return; // @ts-ignore + if (!e.isTrusted) return; + // Ignore events on the Dax icon, we handle those elsewhere + if ((0, _autofillUtils.isEventWithinDax)(e, e.target)) return; + // @ts-ignore if (e.target.nodeName === 'DDG-AUTOFILL') { e.preventDefault(); e.stopImmediatePropagation(); const isMainMouseButton = e.button === 0; if (!isMainMouseButton) return; const activeTooltip = this.getActiveTooltip(); - activeTooltip === null || activeTooltip === void 0 ? void 0 : activeTooltip.dispatchClick(); + activeTooltip?.dispatchClick(); } } - async removeTooltip(_via) { this._htmlTooltipOptions.remove(); - if (this._activeTooltip) { this._removeListeners(); - this._activeTooltip.remove(); - this._activeTooltip = null; } - if (this._activeInput) { if (this._activeInputOriginalAutocomplete) { this._activeInput.setAttribute('autocomplete', this._activeInputOriginalAutocomplete); } else { this._activeInput.removeAttribute('autocomplete'); } - this._activeInput = null; this._activeInputOriginalAutocomplete = null; } } + /** * @returns {import("../HTMLTooltip.js").HTMLTooltip|null} */ - - getActiveTooltip() { return this._activeTooltip; } + /** * @param {import("../HTMLTooltip.js").HTMLTooltip} value */ - - setActiveTooltip(value) { this._activeTooltip = value; } + /** * Collect the data that's needed to populate the Autofill UI. * @@ -16706,11 +15282,10 @@ class HTMLTooltipUIController extends _UIController.UIController { * @param {import('../../Form/matching').SupportedTypes} inputType - The input type for the current field * @param {TopContextData} topContextData */ - - _dataForAutofill(config, inputType, topContextData) { return this._options.device.dataForAutofill(config, inputType, topContextData); } + /** * When a field is selected, call the `onSelect` method from the device. * @@ -16720,11 +15295,10 @@ class HTMLTooltipUIController extends _UIController.UIController { * @param {(CreditCardObject | IdentityObject | CredentialsObject)[]} data * @param {CreditCardObject['id']|IdentityObject['id']|CredentialsObject['id']} id */ - - _onSelect(inputType, data, id) { return this._options.device.onSelect(inputType, data, id); } + /** * Called when clicking on the Manage… button in the html tooltip * @@ -16732,94 +15306,57 @@ class HTMLTooltipUIController extends _UIController.UIController { * @returns {*} * @private */ - - _onManage(type) { this.removeTooltip(); - switch (type) { case 'credentials': return this._options.device.openManagePasswords(); - case 'creditCards': return this._options.device.openManageCreditCards(); - case 'identities': return this._options.device.openManageIdentities(); - - default: // noop - + default: + // noop } } _onIncontextSignupDismissed(_ref) { - var _this$_options$device2; - let { hasOtherOptions } = _ref; - (_this$_options$device2 = this._options.device.inContextSignup) === null || _this$_options$device2 === void 0 ? void 0 : _this$_options$device2.onIncontextSignupDismissed({ + this._options.device.inContextSignup?.onIncontextSignupDismissed({ shouldHideTooltip: !hasOtherOptions - }); // If there are other options available, just force a re-render + }); + // If there are other options available, just force a re-render if (hasOtherOptions) { const topContextData = this._options.device.getTopContextData(); - if (!topContextData) return; const config = (0, _inputTypeConfig.getInputConfigFromType)(topContextData.inputType); - const data = this._dataForAutofill(config, topContextData.inputType, topContextData); - this.updateItems(data); } } - _onIncontextSignup() { - var _this$_options$device3; - - (_this$_options$device3 = this._options.device.inContextSignup) === null || _this$_options$device3 === void 0 ? void 0 : _this$_options$device3.onIncontextSignup(); + this._options.device.inContextSignup?.onIncontextSignup(); } - isActive() { return Boolean(this.getActiveTooltip()); } - } - exports.HTMLTooltipUIController = HTMLTooltipUIController; -},{"../../Form/inputTypeConfig.js":36,"../../Form/matching.js":41,"../../autofill-utils.js":59,"../DataHTMLTooltip.js":49,"../EmailHTMLTooltip.js":50,"../EmailSignupHTMLTooltip.js":51,"../HTMLTooltip.js":52,"./UIController.js":56}],54:[function(require,module,exports){ +},{"../../Form/inputTypeConfig.js":38,"../../Form/matching.js":43,"../../autofill-utils.js":61,"../DataHTMLTooltip.js":51,"../EmailHTMLTooltip.js":52,"../EmailSignupHTMLTooltip.js":53,"../HTMLTooltip.js":54,"./UIController.js":58}],56:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.NativeUIController = void 0; - var _UIController = require("./UIController.js"); - var _matching = require("../../Form/matching.js"); - var _deviceApiCalls = require("../../deviceApiCalls/__generated__/deviceApiCalls.js"); - var _Credentials = require("../../InputTypes/Credentials.js"); - -function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); } - -function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } } - -function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); } - -function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; } - -function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; } - -function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); } - -function _classApplyDescriptorSet(receiver, descriptor, value) { if (descriptor.set) { descriptor.set.call(receiver, value); } else { if (!descriptor.writable) { throw new TypeError("attempted to set read only private field"); } descriptor.value = value; } } - -var _passwordStatus = /*#__PURE__*/new WeakMap(); - /** * `NativeController` should be used in situations where you DO NOT * want any Autofill-controlled user interface. @@ -16835,14 +15372,13 @@ var _passwordStatus = /*#__PURE__*/new WeakMap(); * ``` */ class NativeUIController extends _UIController.UIController { - constructor() { - super(...arguments); - - _classPrivateFieldInitSpec(this, _passwordStatus, { - writable: true, - value: 'default' - }); - } + /** + * Keep track of when passwords were suggested/rejected/accepted etc + * State is kept here because it's specific to the interactions on mobile (eg: NativeUIController) + * + * @type {"default" | "rejected"} + */ + #passwordStatus = 'default'; /** * @param {import('./UIController').AttachArgs} args @@ -16859,31 +15395,28 @@ class NativeUIController extends _UIController.UIController { const inputType = (0, _matching.getInputType)(input); const mainType = (0, _matching.getMainTypeFromType)(inputType); const subType = (0, _matching.getSubtypeFromType)(inputType); - if (mainType === 'unknown') { throw new Error('unreachable, should not be here if (mainType === "unknown")'); } - if (trigger === 'autoprompt') { window.scrollTo({ behavior: 'smooth', top: form.form.getBoundingClientRect().top - document.body.getBoundingClientRect().top - 50 }); } - /** @type {import('../../deviceApiCalls/__generated__/validators-ts').GetAutofillDataRequest} */ - + /** @type {import('../../deviceApiCalls/__generated__/validators-ts').GetAutofillDataRequest} */ let payload = { inputType, mainType, subType, trigger - }; // append generated password if enabled + }; + // append generated password if enabled if (device.settings.featureToggles.password_generation) { payload = this.appendGeneratedPassword(topContextData, payload, triggerMetaData); } - device.deviceApi.request(new _deviceApiCalls.GetAutofillDataCall(payload)).then(resp => { switch (resp.action) { case 'fill': @@ -16891,42 +15424,30 @@ class NativeUIController extends _UIController.UIController { if (mainType in resp) { form.autofillData(resp[mainType], mainType); } else { - throw new Error("action: \"fill\" cannot occur because \"".concat(mainType, "\" was missing")); + throw new Error(`action: "fill" cannot occur because "${mainType}" was missing`); } - break; } - case 'focus': { - var _form$activeInput; - - (_form$activeInput = form.activeInput) === null || _form$activeInput === void 0 ? void 0 : _form$activeInput.focus(); + form.activeInput?.focus(); break; } - case 'acceptGeneratedPassword': { - var _topContextData$crede; - form.autofillData({ - password: (_topContextData$crede = topContextData.credentials) === null || _topContextData$crede === void 0 ? void 0 : _topContextData$crede[0].password, + password: topContextData.credentials?.[0].password, [_Credentials.AUTOGENERATED_KEY]: true }, mainType); break; } - case 'rejectGeneratedPassword': { - var _form$activeInput2; - - _classPrivateFieldSet(this, _passwordStatus, 'rejected'); - + this.#passwordStatus = 'rejected'; form.touchAllInputs('credentials'); - (_form$activeInput2 = form.activeInput) === null || _form$activeInput2 === void 0 ? void 0 : _form$activeInput2.focus(); + form.activeInput?.focus(); break; } - default: { if (args.device.isTestMode()) { @@ -16939,6 +15460,7 @@ class NativeUIController extends _UIController.UIController { console.error(e); }); } + /** * If a password exists in `topContextData`, we can append it to the outgoing data * in a way that native platforms can easily understand. @@ -16948,79 +15470,53 @@ class NativeUIController extends _UIController.UIController { * @param {import('../../UI/controllers/UIController.js').AttachArgs['triggerMetaData']} triggerMetaData * @return {import('../../deviceApiCalls/__generated__/validators-ts.js').GetAutofillDataRequest} */ - - appendGeneratedPassword(topContextData, outgoingData, triggerMetaData) { - var _topContextData$crede2; - - const autoGeneratedCredential = (_topContextData$crede2 = topContextData.credentials) === null || _topContextData$crede2 === void 0 ? void 0 : _topContextData$crede2.find(credential => credential.autogenerated); // if there's no generated password, we don't need to do anything + const autoGeneratedCredential = topContextData.credentials?.find(credential => credential.autogenerated); - if (!(autoGeneratedCredential !== null && autoGeneratedCredential !== void 0 && autoGeneratedCredential.password)) { + // if there's no generated password, we don't need to do anything + if (!autoGeneratedCredential?.password) { return outgoingData; } - function suggestPassword() { - if (!(autoGeneratedCredential !== null && autoGeneratedCredential !== void 0 && autoGeneratedCredential.password)) throw new Error('unreachable'); - return { ...outgoingData, + if (!autoGeneratedCredential?.password) throw new Error('unreachable'); + return { + ...outgoingData, generatedPassword: { value: autoGeneratedCredential.password, username: autoGeneratedCredential.username } }; - } // for explicit opt-in, we should *always* append the password + } + + // for explicit opt-in, we should *always* append the password // this can occur when the user clicks icon directly - in that instance we ignore // any internal state and just append the password to the outgoing data - - if (triggerMetaData.type === 'explicit-opt-in') { return suggestPassword(); - } // When the opt-in is 'implicit' though we only append the password if the user has not previously rejected it. + } + + // When the opt-in is 'implicit' though we only append the password if the user has not previously rejected it. // This helps the situation where the user has rejected a password for the username field, but then // taps into the confirm password field - - - if (triggerMetaData.type === 'implicit-opt-in' && _classPrivateFieldGet(this, _passwordStatus) !== 'rejected') { + if (triggerMetaData.type === 'implicit-opt-in' && this.#passwordStatus !== 'rejected') { return suggestPassword(); - } // if we get here there's nothing to do - + } + // if we get here there's nothing to do return outgoingData; } - } - exports.NativeUIController = NativeUIController; -},{"../../Form/matching.js":41,"../../InputTypes/Credentials.js":43,"../../deviceApiCalls/__generated__/deviceApiCalls.js":63,"./UIController.js":56}],55:[function(require,module,exports){ +},{"../../Form/matching.js":43,"../../InputTypes/Credentials.js":45,"../../deviceApiCalls/__generated__/deviceApiCalls.js":65,"./UIController.js":58}],57:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.OverlayUIController = void 0; - var _UIController = require("./UIController.js"); - var _matching = require("../../Form/matching.js"); - -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - -function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); } - -function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } } - -function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); } - -function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; } - -function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; } - -function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); } - -function _classApplyDescriptorSet(receiver, descriptor, value) { if (descriptor.set) { descriptor.set.call(receiver, value); } else { if (!descriptor.writable) { throw new TypeError("attempted to set read only private field"); } descriptor.value = value; } } - -var _state = /*#__PURE__*/new WeakMap(); - /** * @typedef {import('../../deviceApiCalls/__generated__/validators-ts').GetAutofillDataRequest} GetAutofillDataRequest * @typedef {import('../../deviceApiCalls/__generated__/validators-ts').TriggerContext} TriggerContext @@ -17051,49 +15547,44 @@ var _state = /*#__PURE__*/new WeakMap(); */ class OverlayUIController extends _UIController.UIController { /** @type {"idle" | "parentShown"} */ + #state = 'idle'; /** @type {import('../HTMLTooltip.js').HTMLTooltip | null} */ + _activeTooltip = null; /** * @type {OverlayControllerOptions} */ + _options; /** * @param {OverlayControllerOptions} options */ constructor(options) { super(); + this._options = options; - _classPrivateFieldInitSpec(this, _state, { - writable: true, - value: 'idle' - }); - - _defineProperty(this, "_activeTooltip", null); - - _defineProperty(this, "_options", void 0); - - this._options = options; // We always register this 'pointerdown' event, regardless of + // We always register this 'pointerdown' event, regardless of // whether we have a tooltip currently open or not. This is to ensure // we can clear out any existing state before opening a new one. - window.addEventListener('pointerdown', this, true); } + /** * @param {import('./UIController').AttachArgs} args */ - - attach(args) { const { getPosition, topContextData, click, input - } = args; // Do not attach the tooltip if the input is not in the DOM + } = args; - if (!input.parentNode) return; // If the input is removed from the DOM while the tooltip is attached, remove it + // Do not attach the tooltip if the input is not in the DOM + if (!input.parentNode) return; + // If the input is removed from the DOM while the tooltip is attached, remove it this._mutObs = new MutationObserver(mutationList => { for (const mutationRecord of mutationList) { mutationRecord.removedNodes.forEach(el => { @@ -17103,63 +15594,51 @@ class OverlayUIController extends _UIController.UIController { }); } }); - this._mutObs.observe(document.body, { childList: true, subtree: true }); + const position = getPosition(); - const position = getPosition(); // If the element is not in viewport, scroll there and recurse. 50ms is arbitrary - + // If the element is not in viewport, scroll there and recurse. 50ms is arbitrary if (!click && !this.elementIsInViewport(position)) { - var _this$_mutObs; - input.scrollIntoView(true); - (_this$_mutObs = this._mutObs) === null || _this$_mutObs === void 0 ? void 0 : _this$_mutObs.disconnect(); + this._mutObs?.disconnect(); setTimeout(() => { this.attach(args); }, 50); return; } - - _classPrivateFieldSet(this, _state, 'parentShown'); - + this.#state = 'parentShown'; this.showTopTooltip(click, position, topContextData).catch(e => { console.error('error from showTopTooltip', e); - - _classPrivateFieldSet(this, _state, 'idle'); + this.#state = 'idle'; }); } + /** * @param {{ x: number; y: number; height: number; width: number; }} inputDimensions * @returns {boolean} */ - - elementIsInViewport(inputDimensions) { if (inputDimensions.x < 0 || inputDimensions.y < 0 || inputDimensions.x + inputDimensions.width > document.documentElement.clientWidth || inputDimensions.y + inputDimensions.height > document.documentElement.clientHeight) { return false; } - const viewport = document.documentElement; - if (inputDimensions.x + inputDimensions.width > viewport.clientWidth || inputDimensions.y + inputDimensions.height > viewport.clientHeight) { return false; } - return true; } + /** * @param {{ x: number; y: number; } | null} click * @param {{ x: number; y: number; height: number; width: number; }} inputDimensions * @param {TopContextData} data */ - - async showTopTooltip(click, inputDimensions, data) { let diffX = inputDimensions.x; let diffY = inputDimensions.y; - if (click) { diffX -= click.x; diffY -= click.y; @@ -17167,20 +15646,16 @@ class OverlayUIController extends _UIController.UIController { // If the focus event is outside the viewport ignore, we've already tried to scroll to it return; } - if (!data.inputType) { throw new Error('No input type found'); } - const mainType = (0, _matching.getMainTypeFromType)(data.inputType); const subType = (0, _matching.getSubtypeFromType)(data.inputType); - if (mainType === 'unknown') { throw new Error('unreachable, should not be here if (mainType === "unknown")'); } - /** @type {GetAutofillDataRequest} */ - + /** @type {GetAutofillDataRequest} */ const details = { inputType: data.inputType, mainType, @@ -17194,32 +15669,25 @@ class OverlayUIController extends _UIController.UIController { inputWidth: Math.floor(inputDimensions.width) } }; - try { - _classPrivateFieldSet(this, _state, 'parentShown'); - + this.#state = 'parentShown'; this._attachListeners(); - await this._options.show(details); } catch (e) { console.error('could not show parent', e); - - _classPrivateFieldSet(this, _state, 'idle'); + this.#state = 'idle'; } } - _attachListeners() { window.addEventListener('scroll', this); window.addEventListener('keydown', this, true); window.addEventListener('input', this); } - _removeListeners() { window.removeEventListener('scroll', this); window.removeEventListener('keydown', this, true); window.removeEventListener('input', this); } - handleEvent(event) { switch (event.type) { case 'scroll': @@ -17227,7 +15695,6 @@ class OverlayUIController extends _UIController.UIController { this.removeTooltip(event.type); break; } - case 'keydown': { if (['Escape', 'Tab', 'Enter'].includes(event.code)) { @@ -17235,19 +15702,15 @@ class OverlayUIController extends _UIController.UIController { event.preventDefault(); event.stopImmediatePropagation(); } - this.removeTooltip(event.type); } - break; } - case 'input': { this.removeTooltip(event.type); break; } - case 'pointerdown': { this.removeTooltip(event.type); @@ -17255,51 +15718,40 @@ class OverlayUIController extends _UIController.UIController { } } } + /** * @param {string} trigger * @returns {Promise} */ - - async removeTooltip(trigger) { - var _this$_mutObs2; - // for none pointer events, check to see if the tooltip is open before trying to close it if (trigger !== 'pointerdown') { - if (_classPrivateFieldGet(this, _state) !== 'parentShown') { + if (this.#state !== 'parentShown') { return; } } - try { await this._options.remove(); } catch (e) { console.error('Could not close parent', e); } - - _classPrivateFieldSet(this, _state, 'idle'); - + this.#state = 'idle'; this._removeListeners(); - - (_this$_mutObs2 = this._mutObs) === null || _this$_mutObs2 === void 0 ? void 0 : _this$_mutObs2.disconnect(); + this._mutObs?.disconnect(); } - isActive() { - return _classPrivateFieldGet(this, _state) === 'parentShown'; + return this.#state === 'parentShown'; } - } - exports.OverlayUIController = OverlayUIController; -},{"../../Form/matching.js":41,"./UIController.js":56}],56:[function(require,module,exports){ +},{"../../Form/matching.js":43,"./UIController.js":58}],58:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.UIController = void 0; - /** * @typedef AttachArgs The argument required to 'attach' a tooltip * @property {import("../../Form/Form").Form} form the Form that triggered this 'attach' call @@ -17337,90 +15789,71 @@ class UIController { * @param {TopContextData} _topContextData * @returns {any | null} */ - - createTooltip(_pos, _topContextData) {} /** * @param {string} _via */ - - removeTooltip(_via) {} + /** * Set the currently open HTMLTooltip instance * * @param {import("../HTMLTooltip.js").HTMLTooltip} _tooltip */ - - setActiveTooltip(_tooltip) {} + /** * Get the currently open HTMLTooltip instance, if one exists * * @returns {import("../HTMLTooltip.js").HTMLTooltip | null} */ - - getActiveTooltip() { return null; } + /** * Indicate whether the controller deems itself 'active' * * @returns {boolean} */ - - isActive() { return false; } + /** * Updates the items in the tooltip based on new data. Currently only supporting credentials. * @param {CredentialsObject[]} _data */ - - updateItems(_data) {} - destroy() {} - } - exports.UIController = UIController; -},{}],57:[function(require,module,exports){ +},{}],59:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ddgPasswordIconFocused = exports.ddgPasswordIconFilled = exports.ddgPasswordIconBaseWhite = exports.ddgPasswordIconBase = exports.ddgIdentityIconBase = exports.ddgCcIconFilled = exports.ddgCcIconBase = void 0; -const ddgPasswordIconBase = 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iMjRweCIgaGVpZ2h0PSIyNHB4IiB2aWV3Qm94PSIwIDAgMjQgMjQiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8dGl0bGU+ZGRnLXBhc3N3b3JkLWljb24tYmFzZTwvdGl0bGU+CiAgICA8ZyBpZD0iZGRnLXBhc3N3b3JkLWljb24tYmFzZSIgc3Ryb2tlPSJub25lIiBzdHJva2Utd2lkdGg9IjEiIGZpbGw9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCI+CiAgICAgICAgPGcgaWQ9IlVuaW9uIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSg0LjAwMDAwMCwgNC4wMDAwMDApIiBmaWxsPSIjMDAwMDAwIj4KICAgICAgICAgICAgPHBhdGggZD0iTTExLjMzMzMsMi42NjY2NyBDMTAuMjI4OCwyLjY2NjY3IDkuMzMzMzMsMy41NjIxIDkuMzMzMzMsNC42Nj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NnptNC0yYy0xLjEwNSAwLTIgLjg5NS0yIDJ2OWgxOFY2YzAtMS4xMDUtLjg5NS0yLTItMkg1em0wIDE2Yy0xLjEwNSAwLTItLjg5NS0yLTJoMThjMCAxLjEwNS0uODk1IDItMiAySDV6IiBmaWxsPSIjMDAwIi8+Cjwvc3ZnPgo='; -exports.ddgCcIconBase = ddgCcIconBase; -const ddgCcIconFilled = 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgZmlsbD0ibm9uZSI+CiAgICA8cGF0aCBkPSJNNSA5Yy0uNTUyIDAtMSAuNDQ4LTEgMXYyYzAgLjU1Mi40NDggMSAxIDFoM2MuNTUyIDAgMS0uNDQ4IDEtMXYtMmMwLS41NTItLjQ0OC0xLTEtMUg1eiIgZmlsbD0iIzc2NDMxMCIvPgogICAgPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xIDZjMC0yLjIxIDEuNzktNCA0LTRoMTRjMi4yMSAwIDQgMS43OSA0IDR2MTJjMCAyLjIxLTEuNzkgNC00IDRINWMtMi4yMSAwLTQtMS43OS00LTRWNnptNC0yYy0xLjEwNSAwLTIgLjg5NS0yIDJ2OWgxOFY2YzAtMS4xMDUtLjg5NS0yLTItMkg1em0wIDE2Yy0xLjEwNSAwLTItLjg5NS0yLTJoMThjMCAxLjEwNS0uODk1IDItMiAySDV6IiBmaWxsPSIjNzY0MzEwIi8+Cjwvc3ZnPgo='; -exports.ddgCcIconFilled = ddgCcIconFilled; -const ddgIdentityIconBase = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgZmlsbD0ibm9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tMy40ODYtLjc1LTEuMi0uMDE0LTIuMzkyLjIxMS0zLjUwNC42NjQtLjgxNy4zMzMtMS41OC43ODMtMi4yNjQgMS4zMzYgMS41NDYgMS4yNSAzLjUxNCAyIDUuNjU3IDJ6bTQuMzk3LTUuMDgzYy45NjcuNDIyIDEuODY2Ljk4IDIuNjcyIDEuNjU1QzIwLjI3OSAxNi4wMzkgMjEgMTQuMTA0IDIxIDEyYzAtNC45Ny00LjAzLTktOS05cy05IDQuMDMtOSA5YzAgMi4xMDQuNzIyIDQuMDQgMS45MzIgNS41NzIuODc0LS43MzQgMS44Ni0xLjMyOCAyLjkyMS0xLjc2IDEuMzYtLjU1NCAyLjgxNi0uODMgNC4yODMtLjgxMSAxLjQ2Ny4wMTggMi45MTYuMzMgNC4yNi45MTZ6TTEyIDIzYzYuMDc1IDAgMTEtNC45MjUgMTEtMTFTMTguMDc1IDEgMTIgMSAxIDUuOTI1IDEgMTJzNC45MjUgMTEgMTEgMTF6bTMtMTNjMCAxLjY1Ny0xLjM0MyAzLTMgM3MtMy0xLjM0My0zLTMgMS4zNDMtMyAzLTMgMyAxLjM0MyAzIDN6bTIgMGMwIDIuNzYxLTIuMjM5IDUtNSA1cy01LTIuMjM5LTUtNSAyLjIzOS01IDUtNSA1IDIuMjM5IDUgNXoiIGZpbGw9IiMwMDAiLz4KPC9zdmc+Cg=="; -exports.ddgIdentityIconBase = ddgIdentityIconBase; - -},{}],58:[function(require,module,exports){ +const ddgPasswordIconBase = exports.ddgPasswordIconBase = 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iMjRweCIgaGVpZ2h0PSIyNHB4IiB2aWV3Qm94PSIwIDAgMjQgMjQiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluay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require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.CSS_STYLES = void 0; -const CSS_STYLES = ":root {\n color-scheme: light dark;\n}\n\n.wrapper *, .wrapper *::before, .wrapper *::after {\n box-sizing: border-box;\n}\n.wrapper {\n position: fixed;\n top: 0;\n left: 0;\n padding: 0;\n font-family: 'DDG_ProximaNova', 'Proxima Nova', system-ui, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu',\n 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;\n -webkit-font-smoothing: antialiased;\n z-index: 2147483647;\n}\n.wrapper--data {\n font-family: 'SF Pro Text', system-ui, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu',\n 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;\n}\n:not(.top-autofill) .tooltip {\n position: absolute;\n width: 300px;\n max-width: calc(100vw - 25px);\n transform: translate(-1000px, -1000px);\n z-index: 2147483647;\n}\n.tooltip--data, #topAutofill {\n background-color: rgba(242, 240, 240, 1);\n -webkit-backdrop-filter: blur(40px);\n backdrop-filter: blur(40px);\n}\n@media (prefers-color-scheme: dark) {\n .tooltip--data, #topAutofill {\n background: rgb(100, 98, 102, .9);\n }\n}\n.tooltip--data {\n padding: 6px;\n font-size: 13px;\n line-height: 14px;\n width: 315px;\n max-height: 290px;\n overflow-y: auto;\n}\n.top-autofill .tooltip--data {\n min-height: 100vh;\n}\n.tooltip--data.tooltip--incontext-signup {\n width: 360px;\n}\n:not(.top-autofill) .tooltip--data {\n top: 100%;\n left: 100%;\n border: 0.5px solid rgba(255, 255, 255, 0.2);\n border-radius: 6px;\n box-shadow: 0 10px 20px rgba(0, 0, 0, 0.32);\n}\n@media (prefers-color-scheme: dark) {\n :not(.top-autofill) .tooltip--data {\n border: 1px solid rgba(255, 255, 255, 0.2);\n }\n}\n:not(.top-autofill) .tooltip--email {\n top: calc(100% + 6px);\n right: calc(100% - 48px);\n padding: 8px;\n border: 1px solid #D0D0D0;\n border-radius: 10px;\n background-color: #FFFFFF;\n font-size: 14px;\n line-height: 1.3;\n color: #333333;\n box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);\n}\n.tooltip--email__caret {\n position: absolute;\n transform: translate(-1000px, -1000px);\n z-index: 2147483647;\n}\n.tooltip--email__caret::before,\n.tooltip--email__caret::after {\n content: \"\";\n width: 0;\n height: 0;\n border-left: 10px solid transparent;\n border-right: 10px solid transparent;\n display: block;\n border-bottom: 8px solid #D0D0D0;\n position: absolute;\n right: -28px;\n}\n.tooltip--email__caret::before {\n border-bottom-color: #D0D0D0;\n top: -1px;\n}\n.tooltip--email__caret::after {\n border-bottom-color: #FFFFFF;\n top: 0px;\n}\n\n/* Buttons */\n.tooltip__button {\n display: flex;\n width: 100%;\n padding: 8px 8px 8px 0px;\n font-family: inherit;\n color: inherit;\n background: transparent;\n border: none;\n border-radius: 6px;\n}\n.tooltip__button.currentFocus,\n.wrapper:not(.top-autofill) .tooltip__button:hover {\n background-color: #3969EF;\n color: #FFFFFF;\n}\n\n/* Data autofill tooltip specific */\n.tooltip__button--data {\n position: relative;\n min-height: 48px;\n flex-direction: row;\n justify-content: flex-start;\n font-size: inherit;\n font-weight: 500;\n line-height: 16px;\n text-align: left;\n border-radius: 3px;\n}\n.tooltip--data__item-container {\n max-height: 220px;\n overflow: auto;\n}\n.tooltip__button--data:first-child {\n margin-top: 0;\n}\n.tooltip__button--data:last-child {\n margin-bottom: 0;\n}\n.tooltip__button--data::before {\n content: '';\n flex-shrink: 0;\n display: block;\n width: 32px;\n height: 32px;\n margin: 0 8px;\n background-size: 20px 20px;\n background-repeat: no-repeat;\n background-position: center 6px;\n}\n#provider_locked::after {\n position: absolute;\n content: '';\n flex-shrink: 0;\n display: block;\n width: 32px;\n height: 32px;\n margin: 0 8px;\n background-size: 11px 13px;\n background-repeat: no-repeat;\n background-position: right bottom;\n}\n.tooltip__button--data.currentFocus:not(.tooltip__button--data--bitwarden)::before,\n.wrapper:not(.top-autofill) .tooltip__button--data:not(.tooltip__button--data--bitwarden):hover::before {\n filter: invert(100%);\n}\n@media (prefers-color-scheme: dark) {\n .tooltip__button--data:not(.tooltip__button--data--bitwarden)::before,\n .tooltip__button--data:not(.tooltip__button--data--bitwarden)::before {\n filter: invert(100%);\n opacity: .9;\n }\n}\n.tooltip__button__text-container {\n margin: auto 0;\n}\n.label {\n display: block;\n font-weight: 400;\n letter-spacing: -0.25px;\n color: rgba(0,0,0,.8);\n font-size: 13px;\n line-height: 1;\n}\n.label + .label {\n margin-top: 2px;\n}\n.label.label--medium {\n font-weight: 500;\n letter-spacing: -0.25px;\n color: rgba(0,0,0,.9);\n}\n.label.label--small {\n font-size: 11px;\n font-weight: 400;\n letter-spacing: 0.06px;\n color: rgba(0,0,0,0.6);\n}\n@media (prefers-color-scheme: dark) {\n .tooltip--data .label {\n color: #ffffff;\n }\n .tooltip--data .label--medium {\n color: #ffffff;\n }\n .tooltip--data .label--small {\n color: #cdcdcd;\n }\n}\n.tooltip__button.currentFocus .label,\n.wrapper:not(.top-autofill) .tooltip__button:hover .label {\n color: #FFFFFF;\n}\n\n.tooltip__button--manage {\n font-size: 13px;\n padding: 5px 9px;\n border-radius: 3px;\n margin: 0;\n}\n\n/* Icons */\n.tooltip__button--data--credentials::before {\n background-image: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik05LjYzNiA4LjY4MkM5LjYzNiA1LjU0NCAxMi4xOCAzIDE1LjMxOCAzIDE4LjQ1NiAzIDIxIDUuNTQ0IDIxIDguNjgyYzAgMy4xMzgtMi41NDQgNS42ODItNS42ODIgNS42ODItLjY5MiAwLTEuMzUzLS4xMjQtMS45NjQtLjM0OS0u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1TDkuMzc1IDcuNjAwNTdDOS4zNzQxNSA3LjE2MTMxIDkuMjM1NzQgNi43MzMzNSA4Ljk3OTIyIDYuMzc2NzhDOC44NzY4MyA2LjIzNDQ2IDguNzU3NjggNi4xMDYzNyA4LjYyNSA1Ljk5NDg5VjUuMTg3NUM4LjYyNSA0LjI3NTgyIDguMjYyODQgMy40MDE0OCA3LjYxODE4IDIuNzU2ODJDNi45NzM1MiAyLjExMjE2IDYuMDk5MTggMS43NSA1LjE4NzUgMS43NUM0LjI3NTgyIDEuNzUgMy40MDE0OCAyLjExMjE2IDIuNzU2ODIgMi43NTY4MkMyLjExMjE2IDMuNDAxNDggMS43NSA0LjI3NTgyIDEuNzUgNS4xODc1VjUuOTk0ODlDMS42MTczMiA2LjEwNjM3IDEuNDk4MTcgNi4yMzQ0NiAxLjM5NTc4IDYuMzc2NzhDMS4xMzkyNiA2LjczMzM1IDEuMDAwODUgNy4xNjEzMSAxIDcuNjAwNTdaTTQuOTY4NyA0Ljk2ODdDNS4wMjY5NCA0LjkxMDQ3IDUuMTA1MzIgNC44NzY5OSA1LjE4NzUgNC44NzUwN0M1LjI2OTY4IDQuODc2OTkgNS4zNDgwNiA0LjkxMDQ3IDUuNDA2MyA0Ljk2ODdDNS40NjU0MiA1LjAyNzgzIDUuNDk5MDQgNS4xMDc3NCA1LjUgNS4xOTEzVjUuNUg0Ljg3NVY1LjE5MTNDNC44NzU5NiA1LjEwNzc0IDQuOTA5NTggNS4wMjc4MyA0Ljk2ODcgNC45Njg3WiIgZmlsbD0iIzIyMjIyMiIgc3Ryb2tlPSJ3aGl0ZSIgc3Ryb2tlLXdpZHRoPSIyIi8+Cjwvc3ZnPgo=');\n}\n\nhr {\n display: block;\n margin: 5px 9px;\n border: none; /* reset the border */\n border-top: 1px solid rgba(0,0,0,.1);\n}\n\nhr:first-child {\n display: none;\n}\n\n@media (prefers-color-scheme: dark) {\n hr {\n border-top: 1px solid rgba(255,255,255,.2);\n }\n}\n\n#privateAddress {\n align-items: flex-start;\n}\n#personalAddress::before,\n#privateAddress::before,\n#incontextSignup::before,\n#personalAddress.currentFocus::before,\n#personalAddress:hover::before,\n#privateAddress.currentFocus::before,\n#privateAddress:hover::before {\n filter: none;\n /* This is the same icon as `daxBase64` in `src/Form/logo-svg.js` */\n background-image: url('data:image/svg+xml;base64,PHN2ZyBmaWxsPSJub25lIiB2aWV3Qm94PSIwIDAgMTI4IDEyOCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICAgIDxwYXRoIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0ibTY0IDEyOGMzNS4zNDYgMCA2NC0yOC42NTQgNjQtNjRzLTI4LjY1NC02NC02NC02NC02NCAyOC42NTQtNjQgNjQgMjguNjU0IDY0IDY0IDY0eiIgZmlsbD0iI2RlNTgzMyIgZmlsbC1ydWxlPSJldmVub2RkIi8+CiAgICA8cGF0aCBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Im03MyAxMTEuNzVjMC0uNS4xMjMtLjYxNC0xLjQ2Ni0zLjc4Mi00LjIyNC04LjQ1OS04LjQ3LTIwLjM4NC02LjU0LTI4LjA3NS4zNTMtMS4zOTctMy45NzgtNTEuNzQ0LTcuMDQtNTMuMzY1LTMuNDAyLTEuODEzLTcuNTg4LTQuNjktMTEuNDE4LTUuMzMtMS45NDMtLjMxLTQuNDktLjE2NC02LjQ4Mi4xMDUtLjM1My4wNDctLjM2OC42ODMtLjAzLjc5OCAxLjMwOC40NDMgMi44OTUgMS4yMTIgMy44MyAyLjM3NS4xNzguMjItLjA2LjU2Ni0uMzQyLjU3Ny0uODgyLjAzMi0yLjQ4Mi40MDItNC41OTMgMi4xOTUtLjI0NC4yMDctLjA0MS41OTIuMjczLjUzIDQuNTM2LS44OTcgOS4xNy0uNDU1IDExLjkgMi4wMjcuMTc3LjE2LjA4NC40NS0uMTQ3LjUxMi0yMy42OTQgNi40NC0xOS4wMDMgMjcuMDUtMTIuNjk2IDU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GF0aCBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Im02NCAxMTcuNzVjMjkuNjg1IDAgNTMuNzUtMjQuMDY1IDUzLjc1LTUzLjc1cy0yNC4wNjUtNTMuNzUtNTMuNzUtNTMuNzUtNTMuNzUgMjQuMDY1LTUzLjc1IDUzLjc1IDI0LjA2NSA1My43NSA1My43NSA1My43NXptMCA1YzMyLjQ0NyAwIDU4Ljc1LTI2LjMwMyA1OC43NS01OC43NXMtMjYuMzAzLTU4Ljc1LTU4Ljc1LTU4Ljc1LTU4Ljc1IDI2LjMwMy01OC43NSA1OC43NSAyNi4zMDMgNTguNzUgNTguNzUgNTguNzV6IiBmaWxsPSIjZmZmIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiLz4KPC9zdmc+');\n}\n\n/* Email tooltip specific */\n.tooltip__button--email {\n flex-direction: column;\n justify-content: center;\n align-items: flex-start;\n font-size: 14px;\n padding: 4px 8px;\n}\n.tooltip__button--email__primary-text {\n font-weight: bold;\n}\n.tooltip__button--email__secondary-text {\n font-size: 12px;\n}\n\n/* Email Protection signup notice */\n:not(.top-autofill) .tooltip--email-signup {\n text-align: left;\n color: #222222;\n padding: 16px 20px;\n width: 380px;\n}\n\n.tooltip--email-signup h1 {\n font-weight: 700;\n font-size: 16px;\n line-height: 1.5;\n margin: 0;\n}\n\n.tooltip--email-signup p {\n font-weight: 400;\n font-size: 14px;\n line-height: 1.4;\n}\n\n.notice-controls {\n display: flex;\n}\n\n.tooltip--email-signup .notice-controls > * {\n border-radius: 8px;\n border: 0;\n cursor: pointer;\n display: inline-block;\n font-family: inherit;\n font-style: normal;\n font-weight: bold;\n padding: 8px 12px;\n text-decoration: none;\n}\n\n.notice-controls .ghost {\n margin-left: 1rem;\n}\n\n.tooltip--email-signup a.primary {\n background: #3969EF;\n color: #fff;\n}\n\n.tooltip--email-signup a.primary:hover,\n.tooltip--email-signup a.primary:focus {\n background: #2b55ca;\n}\n\n.tooltip--email-signup a.primary:active {\n background: #1e42a4;\n}\n\n.tooltip--email-signup button.ghost {\n background: transparent;\n color: #3969EF;\n}\n\n.tooltip--email-signup button.ghost:hover,\n.tooltip--email-signup button.ghost:focus {\n background-color: rgba(0, 0, 0, 0.06);\n color: #2b55ca;\n}\n\n.tooltip--email-signup button.ghost:active {\n background-color: rgba(0, 0, 0, 0.12);\n color: #1e42a4;\n}\n\n.tooltip--email-signup button.close-tooltip {\n background-color: transparent;\n background-image: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iMTMiIHZpZXdCb3g9IjAgMCAxMiAxMyIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0wLjI5Mjg5NCAwLjY1NjkwN0MwLjY4MzQxOCAwLjI2NjM4MyAxLjMxNjU4IDAuMjY2MzgzIDEuNzA3MTEgMC42NTY5MDdMNiA0Ljk0OThMMTAuMjkyOSAwLjY1NjkwN0MxMC42ODM0IDAuMjY2MzgzIDExLjMxNjYgMC4yNjYzODMgMTEuNzA3MSAwLjY1NjkwN0MxMi4wOTc2IDEuMDQ3NDMgMTIuMDk3NiAxLjY4MDYgMTEuNzA3MSAyLjA3MTEyTDcuNDE0MjEgNi4zNjQwMUwxMS43MDcxIDEwLjY1NjlDMTIuMDk3NiAxMS4wNDc0IDEyLjA5NzYgMTEuNjgwNiAxMS43MDcxIDEyLjA3MTFDMTEuMzE2NiAxMi40NjE2IDEwLjY4MzQgMTIuNDYxNiAxMC4yOTI5IDEyLjA3MTFMNiA3Ljc3ODIzTDEuNzA3MTEgMTIuMDcxMUMxLjMxNjU4IDEyLjQ2MTYgMC42ODM0MTcgMTIuNDYxNiAwLjI5Mjg5MyAxMi4wNzExQy0wLjA5NzYzMTEgMTEuNjgwNiAtMC4wOTc2MzExIDExLjA0NzQgMC4yOTI4OTMgMTAuNjU2OUw0LjU4NTc5IDYuMzY0MDFMMC4yOTI4OTQgMi4wNzExMkMtMC4wOTc2MzA2IDEuNjgwNiAtMC4wOTc2MzA2IDEuMDQ3NDMgMC4yOTI4OTQgMC42NTY5MDdaIiBmaWxsPSJibGFjayIgZmlsbC1vcGFjaXR5PSIwLjg0Ii8+Cjwvc3ZnPgo=);\n background-position: center center;\n background-repeat: no-repeat;\n border: 0;\n cursor: pointer;\n padding: 16px;\n position: absolute;\n right: 12px;\n top: 12px;\n}\n"; -exports.CSS_STYLES = CSS_STYLES; +const CSS_STYLES = exports.CSS_STYLES = ":root {\n color-scheme: light dark;\n}\n\n.wrapper *, .wrapper *::before, .wrapper *::after {\n box-sizing: border-box;\n}\n.wrapper {\n position: fixed;\n top: 0;\n left: 0;\n padding: 0;\n font-family: 'DDG_ProximaNova', 'Proxima Nova', system-ui, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu',\n 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;\n -webkit-font-smoothing: antialiased;\n z-index: 2147483647;\n}\n.wrapper--data {\n font-family: 'SF Pro Text', system-ui, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu',\n 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;\n}\n:not(.top-autofill) .tooltip {\n position: absolute;\n width: 300px;\n max-width: calc(100vw - 25px);\n transform: translate(-1000px, -1000px);\n z-index: 2147483647;\n}\n.tooltip--data, #topAutofill {\n background-color: rgba(242, 240, 240, 1);\n -webkit-backdrop-filter: blur(40px);\n backdrop-filter: blur(40px);\n}\n@media (prefers-color-scheme: dark) {\n .tooltip--data, #topAutofill {\n background: rgb(100, 98, 102, .9);\n }\n}\n.tooltip--data {\n padding: 6px;\n font-size: 13px;\n line-height: 14px;\n width: 315px;\n max-height: 290px;\n overflow-y: auto;\n}\n.top-autofill .tooltip--data {\n min-height: 100vh;\n}\n.tooltip--data.tooltip--incontext-signup {\n width: 360px;\n}\n:not(.top-autofill) .tooltip--data {\n top: 100%;\n left: 100%;\n border: 0.5px solid rgba(255, 255, 255, 0.2);\n border-radius: 6px;\n box-shadow: 0 10px 20px rgba(0, 0, 0, 0.32);\n}\n@media (prefers-color-scheme: dark) {\n :not(.top-autofill) .tooltip--data {\n border: 1px solid rgba(255, 255, 255, 0.2);\n }\n}\n:not(.top-autofill) .tooltip--email {\n top: calc(100% + 6px);\n right: calc(100% - 48px);\n padding: 8px;\n border: 1px solid #D0D0D0;\n border-radius: 10px;\n background-color: #FFFFFF;\n font-size: 14px;\n line-height: 1.3;\n color: #333333;\n box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);\n}\n.tooltip--email__caret {\n position: absolute;\n transform: translate(-1000px, -1000px);\n z-index: 2147483647;\n}\n.tooltip--email__caret::before,\n.tooltip--email__caret::after {\n content: \"\";\n width: 0;\n height: 0;\n border-left: 10px solid transparent;\n border-right: 10px solid transparent;\n display: block;\n border-bottom: 8px solid #D0D0D0;\n position: absolute;\n right: -28px;\n}\n.tooltip--email__caret::before {\n border-bottom-color: #D0D0D0;\n top: -1px;\n}\n.tooltip--email__caret::after {\n border-bottom-color: #FFFFFF;\n top: 0px;\n}\n\n/* Buttons */\n.tooltip__button {\n display: flex;\n width: 100%;\n padding: 8px 8px 8px 0px;\n font-family: inherit;\n color: inherit;\n background: transparent;\n border: none;\n border-radius: 6px;\n}\n.tooltip__button.currentFocus,\n.wrapper:not(.top-autofill) .tooltip__button:hover {\n background-color: #3969EF;\n color: #FFFFFF;\n}\n\n/* Data autofill tooltip specific */\n.tooltip__button--data {\n position: relative;\n min-height: 48px;\n flex-direction: row;\n justify-content: flex-start;\n font-size: inherit;\n font-weight: 500;\n line-height: 16px;\n text-align: left;\n border-radius: 3px;\n}\n.tooltip--data__item-container {\n max-height: 220px;\n overflow: auto;\n}\n.tooltip__button--data:first-child {\n margin-top: 0;\n}\n.tooltip__button--data:last-child {\n margin-bottom: 0;\n}\n.tooltip__button--data::before {\n content: '';\n flex-shrink: 0;\n display: block;\n width: 32px;\n height: 32px;\n margin: 0 8px;\n background-size: 20px 20px;\n background-repeat: no-repeat;\n background-position: center 6px;\n}\n#provider_locked::after {\n position: absolute;\n content: '';\n flex-shrink: 0;\n display: block;\n width: 32px;\n height: 32px;\n margin: 0 8px;\n background-size: 11px 13px;\n background-repeat: no-repeat;\n background-position: right bottom;\n}\n.tooltip__button--data.currentFocus:not(.tooltip__button--data--bitwarden)::before,\n.wrapper:not(.top-autofill) .tooltip__button--data:not(.tooltip__button--data--bitwarden):hover::before {\n filter: invert(100%);\n}\n@media (prefers-color-scheme: dark) {\n .tooltip__button--data:not(.tooltip__button--data--bitwarden)::before,\n .tooltip__button--data:not(.tooltip__button--data--bitwarden)::before {\n filter: invert(100%);\n opacity: .9;\n }\n}\n.tooltip__button__text-container {\n margin: auto 0;\n}\n.label {\n display: block;\n font-weight: 400;\n letter-spacing: -0.25px;\n color: rgba(0,0,0,.8);\n font-size: 13px;\n line-height: 1;\n}\n.label + .label {\n margin-top: 2px;\n}\n.label.label--medium {\n font-weight: 500;\n letter-spacing: -0.25px;\n color: rgba(0,0,0,.9);\n}\n.label.label--small {\n font-size: 11px;\n font-weight: 400;\n letter-spacing: 0.06px;\n color: rgba(0,0,0,0.6);\n}\n@media (prefers-color-scheme: dark) {\n .tooltip--data .label {\n color: #ffffff;\n }\n .tooltip--data .label--medium {\n color: #ffffff;\n }\n .tooltip--data .label--small {\n color: #cdcdcd;\n }\n}\n.tooltip__button.currentFocus .label,\n.wrapper:not(.top-autofill) .tooltip__button:hover .label {\n color: #FFFFFF;\n}\n\n.tooltip__button--manage {\n font-size: 13px;\n padding: 5px 9px;\n border-radius: 3px;\n margin: 0;\n}\n\n/* Icons */\n.tooltip__button--data--credentials::before {\n background-image: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yM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My0xLjM0My0zLTMtM3oiIGZpbGw9IiMwMDAiIGZpbGwtb3BhY2l0eT0iLjkiLz4KPC9zdmc+');\n}\n.tooltip__button--data--creditCards::before {\n background-image: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgZmlsbD0ibm9uZSI+CiAgICA8cGF0aCBkPSJNNSA5Yy0uNTUyIDAtMSAuNDQ4LTEgMXYyYzAgLjU1Mi40NDggMSAxIDFoM2MuNTUyIDAgMS0uNDQ4IDEtMXYtMmMwLS41NTItLjQ0OC0xLTEtMUg1eiIgZmlsbD0iIzAwMCIvPgogICAgPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xIDZjMC0yLjIxIDEuNzktNCA0LTRoMTRjMi4yMSAwIDQgMS43OSA0IDR2MTJjMCAyLjIxLTEuNzkgNC00IDRINWMtMi4yMSAwLTQtMS43OS00LTRWNnptNC0yYy0xLjEwNSAwLTIgLjg5NS0yIDJ2OWgxOFY2YzAtMS4xMDUtLjg5NS0yLTItMkg1em0wIDE2Yy0xLjEwNSAwLTItLjg5NS0yLTJoMThjMCAxLjEwNS0uODk1IDItMiAySDV6IiBmaWxsPSIjMDAwIi8+Cjwvc3ZnPgo=');\n}\n.tooltip__button--data--identities::before {\n background-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgZmlsbD0ibm9uZSI+CiAgICA8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTEyIDIxYzIuMTQzIDAgNC4xMTEtLjc1IDUuNjU3LTItLjYyNi0uNTA2LTEuMzE4LS45MjctMi4wNi0xLjI1LTEuMS0uNDgtMi4yODUtLjczNS0zLjQ4Ni0uNzUtMS4yLS4wMTQtMi4zOTIuMjExLTMuNTA0LjY2NC0uODE3LjMzMy0xLjU4Ljc4My0yLjI2NCAxLjMzNiAxLjU0NiAxLjI1IDMuNTE0IDIgNS42NTcgMnptNC4zOTctNS4wODNjLjk2Ny40MjIgMS44NjYuOTggMi42NzIgMS42NTVDMjAuMjc5IDE2LjAzOSAyMSAxNC4xMDQgMjEgMTJjMC00Ljk3LTQuMDMtOS05LTlzLTkgNC4wMy05IDljMCAyLjEwNC43MjIgNC4wNCAxLjkzMiA1LjU3Mi44NzQtLjczNCAxLjg2LTEuMzI4IDIuOTIxLTEuNzYgMS4zNi0uNTU0IDIuODE2LS44MyA0LjI4My0uODExIDEuNDY3LjAxOCAyLjkxNi4zMyA0LjI2LjkxNnpNMTIgMjNjNi4wNzUgMCAxMS00LjkyNSAxMS0xMVMxOC4wNzUgMSAxMiAxIDEgNS45MjUgMSAxMnM0LjkyNSAxMSAxMSAxMXptMy0xM2MwIDEuNjU3LTEuMzQzIDMtMyAzcy0zLTEuMzQzLTMtMyAxLjM0My0zIDMtMyAzIDEuMzQzIDMgM3ptMiAwYzAgMi43NjEtMi4yMzkgNS01IDVzLTUtMi4yMzktNS01IDIuMjM5LTUgNS01IDUgMi4yMzkgNSA1eiIgZmlsbD0iIzAwMCIvPgo8L3N2Zz4=');\n}\n.tooltip__button--data--credentials.tooltip__button--data--bitwarden::before {\n background-image: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHJlY3Qgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0IiByeD0iOCIgZmlsbD0iIzE3NUREQyIvPgo8cGF0aCBmaWxsLXJ1bG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C45Njg3WiIgZmlsbD0iIzIyMjIyMiIgc3Ryb2tlPSJ3aGl0ZSIgc3Ryb2tlLXdpZHRoPSIyIi8+Cjwvc3ZnPgo=');\n}\n\nhr {\n display: block;\n margin: 5px 9px;\n border: none; /* reset the border */\n border-top: 1px solid rgba(0,0,0,.1);\n}\n\nhr:first-child {\n display: none;\n}\n\n@media (prefers-color-scheme: dark) {\n hr {\n border-top: 1px solid rgba(255,255,255,.2);\n }\n}\n\n#privateAddress {\n align-items: flex-start;\n}\n#personalAddress::before,\n#privateAddress::before,\n#incontextSignup::before,\n#personalAddress.currentFocus::before,\n#personalAddress:hover::before,\n#privateAddress.currentFocus::before,\n#privateAddress:hover::before {\n filter: none;\n /* This is the same icon as `daxBase64` in `src/Form/logo-svg.js` */\n background-image: url('data:image/svg+xml;base64,PHN2ZyBmaWxsPSJub25lIiB2aWV3Qm94PSIwIDAgMTI4IDEyOCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICAgIDxwYXRoIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0ibTY0IDEyOGMzNS4zNDYgMCA2NC0yOC42NTQgNjQtNjRzLTI4LjY1NC02NC02NC02NC02NCAyOC42NTQtNjQgNjQgMjguNjU0IDY0IDY0IDY0eiIgZmlsbD0iI2RlNTgzMyIgZmlsbC1ydWxlPSJldmVub2RkIi8+CiAgICA8cGF0aCBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Im03MyAxMTEuNzVjMC0uNS4xMjMtLjYxNC0xLjQ2Ni0zLjc4Mi00LjIyNC04LjQ1OS04LjQ3LTIwLjM4NC02LjU0LTI4LjA3NS4zNTMtMS4zOTctMy45NzgtNTEuNzQ0LTcuMDQtNTMuMzY1LTMuNDAyLTEuODEzLTcuNTg4LTQuNjktMTEuNDE4LTUuMzMtMS45NDMtLjMxLTQuNDktLjE2NC02LjQ4Mi4xMDUtLjM1My4wNDctLjM2OC42ODMtLjAzLjc5OCAxLjMwO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DQ1IDQuMDQ1IDAgMCAxIC00LjA1LTQuMDM3IDQuMDQ1IDQuMDQ1IDAgMCAxIDQuMDUtNC4wMzcgNC4wNDUgNC4wNDUgMCAwIDEgNC4wNSA0LjAzN3ptLTEuMTkzLTEuMzM4YTEuMDUgMS4wNSAwIDAgMCAtMi4wOTcgMCAxLjA0OCAxLjA0OCAwIDAgMCAyLjA5NyAweiIgZmlsbC1ydWxlPSJldmVub2RkIi8+CiAgICA8L2c+CiAgICA8cGF0aCBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Im02NCAxMTcuNzVjMjkuNjg1IDAgNTMuNzUtMjQuMDY1IDUzLjc1LTUzLjc1cy0yNC4wNjUtNTMuNzUtNTMuNzUtNTMuNzUtNTMuNzUgMjQuMDY1LTUzLjc1IDUzLjc1IDI0LjA2NSA1My43NSA1My43NSA1My43NXptMCA1YzMyLjQ0NyAwIDU4Ljc1LTI2LjMwMyA1OC43NS01OC43NXMtMjYuMzAzLTU4Ljc1LTU4Ljc1LTU4Ljc1LTU4Ljc1IDI2LjMwMy01OC43NSA1OC43NSAyNi4zMDMgNTguNzUgNTguNzUgNTguNzV6IiBmaWxsPSIjZmZmIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiLz4KPC9zdmc+');\n}\n\n/* Email tooltip specific */\n.tooltip__button--email {\n flex-direction: column;\n justify-content: center;\n align-items: flex-start;\n font-size: 14px;\n padding: 4px 8px;\n}\n.tooltip__button--email__primary-text {\n font-weight: bold;\n}\n.tooltip__button--email__secondary-text {\n font-size: 12px;\n}\n\n/* Email Protection signup notice */\n:not(.top-autofill) .tooltip--email-signup {\n text-align: left;\n color: #222222;\n padding: 16px 20px;\n width: 380px;\n}\n\n.tooltip--email-signup h1 {\n font-weight: 700;\n font-size: 16px;\n line-height: 1.5;\n margin: 0;\n}\n\n.tooltip--email-signup p {\n font-weight: 400;\n font-size: 14px;\n line-height: 1.4;\n}\n\n.notice-controls {\n display: flex;\n}\n\n.tooltip--email-signup .notice-controls > * {\n border-radius: 8px;\n border: 0;\n cursor: pointer;\n display: inline-block;\n font-family: inherit;\n font-style: normal;\n font-weight: bold;\n padding: 8px 12px;\n text-decoration: none;\n}\n\n.notice-controls .ghost {\n margin-left: 1rem;\n}\n\n.tooltip--email-signup a.primary {\n background: #3969EF;\n color: #fff;\n}\n\n.tooltip--email-signup a.primary:hover,\n.tooltip--email-signup a.primary:focus {\n background: #2b55ca;\n}\n\n.tooltip--email-signup a.primary:active {\n background: #1e42a4;\n}\n\n.tooltip--email-signup button.ghost {\n background: transparent;\n color: #3969EF;\n}\n\n.tooltip--email-signup button.ghost:hover,\n.tooltip--email-signup button.ghost:focus {\n background-color: rgba(0, 0, 0, 0.06);\n color: #2b55ca;\n}\n\n.tooltip--email-signup button.ghost:active {\n background-color: rgba(0, 0, 0, 0.12);\n color: #1e42a4;\n}\n\n.tooltip--email-signup button.close-tooltip {\n background-color: transparent;\n background-image: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iMTMiIHZpZXdCb3g9IjAgMCAxMiAxMyIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0wLjI5Mjg5NCAwLjY1NjkwN0MwLjY4MzQxOCAwLjI2NjM4MyAxLjMxNjU4IDAuMjY2MzgzIDEuNzA3MTEgMC42NTY5MDdMNiA0Ljk0OThMMTAuMjkyOSAwLjY1NjkwN0MxMC42ODM0IDAuMjY2MzgzIDExLjMxNjYgMC4yNjYzODMgMTEuNzA3MSAwLjY1NjkwN0MxMi4wOTc2IDEuMDQ3NDMgMTIuMDk3NiAxLjY4MDYgMTEuNzA3MSAyLjA3MTEyTDcuNDE0MjEgNi4zNjQwMUwxMS43MDcxIDEwLjY1NjlDMTIuMDk3NiAxMS4wNDc0IDEyLjA5NzYgMTEuNjgwNiAxMS43MDcxIDEyLjA3MTFDMTEuMzE2NiAxMi40NjE2IDEwLjY4MzQgMTIuNDYxNiAxMC4yOTI5IDEyLjA3MTFMNiA3Ljc3ODIzTDEuNzA3MTEgMTIuMDcxMUMxLjMxNjU4IDEyLjQ2MTYgMC42ODM0MTcgMTIuNDYxNiAwLjI5Mjg5MyAxMi4wNzExQy0wLjA5NzYzMTEgMTEuNjgwNiAtMC4wOTc2MzExIDExLjA0NzQgMC4yOTI4OTMgMTAuNjU2OUw0LjU4NTc5IDYuMzY0MDFMMC4yOTI4OTQgMi4wNzExMkMtMC4wOTc2MzA2IDEuNjgwNiAtMC4wOTc2MzA2IDEuMDQ3NDMgMC4yOTI4OTQgMC42NTY5MDdaIiBmaWxsPSJibGFjayIgZmlsbC1vcGFjaXR5PSIwLjg0Ii8+Cjwvc3ZnPgo=);\n background-position: center center;\n background-repeat: no-repeat;\n border: 0;\n cursor: pointer;\n padding: 16px;\n position: absolute;\n right: 12px;\n top: 12px;\n}\n"; -},{}],59:[function(require,module,exports){ +},{}],61:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { @@ -17441,15 +15874,12 @@ exports.shouldLogPerformance = shouldLogPerformance; exports.truncateFromMiddle = truncateFromMiddle; exports.wasAutofilledByChrome = void 0; exports.whenIdle = whenIdle; - var _matching = require("./Form/matching.js"); - -const SIGN_IN_MSG = { +const SIGN_IN_MSG = exports.SIGN_IN_MSG = { signMeIn: true -}; // Send a message to the web app (only on DDG domains) - -exports.SIGN_IN_MSG = SIGN_IN_MSG; +}; +// Send a message to the web app (only on DDG domains) const notifyWebApp = message => { window.postMessage(message, window.origin); }; @@ -17459,17 +15889,13 @@ const notifyWebApp = message => { * @param {String} expectedResponse - the name of the response * @returns {Promise<*>} */ - - exports.notifyWebApp = notifyWebApp; - const sendAndWaitForAnswer = (msgOrFn, expectedResponse) => { if (typeof msgOrFn === 'function') { msgOrFn(); } else { window.postMessage(msgOrFn, window.origin); } - return new Promise(resolve => { const handler = e => { if (e.origin !== window.origin) return; @@ -17477,71 +15903,59 @@ const sendAndWaitForAnswer = (msgOrFn, expectedResponse) => { resolve(e.data); window.removeEventListener('message', handler); }; - window.addEventListener('message', handler); }); }; + /** * @param {Pick} globalConfig * @param [processConfig] * @return {boolean} */ - - exports.sendAndWaitForAnswer = sendAndWaitForAnswer; - const autofillEnabled = (globalConfig, processConfig) => { if (!globalConfig.contentScope) { // Return enabled for platforms that haven't implemented the config yet return true; } - const { contentScope, userUnprotectedDomains, userPreferences - } = globalConfig; // Check config on Apple platforms + } = globalConfig; + // Check config on Apple platforms const processedConfig = processConfig(contentScope, userUnprotectedDomains, userPreferences); return isAutofillEnabledFromProcessedConfig(processedConfig); }; - exports.autofillEnabled = autofillEnabled; - const isAutofillEnabledFromProcessedConfig = processedConfig => { const site = processedConfig.site; - if (site.isBroken || !site.enabledFeatures.includes('autofill')) { if (shouldLog()) { console.log('⚠️ Autofill disabled by remote config'); } - return false; } - return true; }; - exports.isAutofillEnabledFromProcessedConfig = isAutofillEnabledFromProcessedConfig; - const isIncontextSignupEnabledFromProcessedConfig = processedConfig => { const site = processedConfig.site; - if (site.isBroken || !site.enabledFeatures.includes('incontextSignup')) { if (shouldLog()) { console.log('⚠️ In-context signup disabled by remote config'); } - return false; } - return true; -}; // Access the original setter (needed to bypass React's implementation on mobile) -// @ts-ignore - +}; +// Access the original setter (needed to bypass React's implementation on mobile) +// @ts-ignore exports.isIncontextSignupEnabledFromProcessedConfig = isIncontextSignupEnabledFromProcessedConfig; const originalSet = Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype, 'value').set; + /** * Ensures the value is set properly and dispatches events to simulate real user action * @param {HTMLInputElement} el @@ -17549,39 +15963,38 @@ const originalSet = Object.getOwnPropertyDescriptor(window.HTMLInputElement.prot * @param {GlobalConfig} [config] * @return {boolean} */ - const setValueForInput = (el, val, config) => { // Avoid keyboard flashing on Android - if (!(config !== null && config !== void 0 && config.isAndroid)) { + if (!config?.isAndroid) { el.focus(); - } // todo(Shane): Not sending a 'key' property on these events can cause exceptions on 3rd party listeners that expect it - + } + // todo(Shane): Not sending a 'key' property on these events can cause exceptions on 3rd party listeners that expect it el.dispatchEvent(new Event('keydown', { bubbles: true })); - originalSet === null || originalSet === void 0 ? void 0 : originalSet.call(el, val); + originalSet?.call(el, val); const events = [new Event('input', { bubbles: true - }), // todo(Shane): Not sending a 'key' property on these events can cause exceptions on 3rd party listeners that expect it + }), + // todo(Shane): Not sending a 'key' property on these events can cause exceptions on 3rd party listeners that expect it new Event('keyup', { bubbles: true }), new Event('change', { bubbles: true })]; - events.forEach(ev => el.dispatchEvent(ev)); // We call this again to make sure all forms are happy - - originalSet === null || originalSet === void 0 ? void 0 : originalSet.call(el, val); + events.forEach(ev => el.dispatchEvent(ev)); + // We call this again to make sure all forms are happy + originalSet?.call(el, val); events.forEach(ev => el.dispatchEvent(ev)); el.blur(); return true; }; + /** * Fires events on a select element to simulate user interaction * @param {HTMLSelectElement} el */ - - const fireEventsOnSelect = el => { /** @type {Event[]} */ const events = [new Event('mousedown', { @@ -17592,12 +16005,14 @@ const fireEventsOnSelect = el => { bubbles: true }), new Event('change', { bubbles: true - })]; // Events fire on the select el, not option + })]; + // Events fire on the select el, not option events.forEach(ev => el.dispatchEvent(ev)); events.forEach(ev => el.dispatchEvent(ev)); el.blur(); }; + /** * Selects an option of a select element * We assume Select is only used for dates, i.e. in the credit card @@ -17605,25 +16020,22 @@ const fireEventsOnSelect = el => { * @param {string} val * @return {boolean} */ - - const setValueForSelect = (el, val) => { const subtype = (0, _matching.getInputSubtype)(el); const isMonth = subtype.includes('Month'); const isZeroBasedNumber = isMonth && el.options[0].value === '0' && el.options.length === 12; const stringVal = String(val); - const numberVal = Number(val); // Loop first through all values because they tend to be more precise + const numberVal = Number(val); + // Loop first through all values because they tend to be more precise for (const option of el.options) { // If values for months are zero-based (Jan === 0), add one to match our data type let value = option.value; - if (isZeroBasedNumber) { - value = "".concat(Number(value) + 1); - } // TODO: try to match localised month names + value = `${Number(value) + 1}`; + } + // TODO: try to match localised month names // TODO: implement alternative versions of values (abbreviations for States/Provinces or variations like USA, US, United States, etc.) - - if (value === stringVal || Number(value) === numberVal) { if (option.selected) return false; option.selected = true; @@ -17631,7 +16043,6 @@ const setValueForSelect = (el, val) => { return true; } } - for (const option of el.options) { if (option.innerText === stringVal || Number(option.innerText) === numberVal) { if (option.selected) return false; @@ -17639,11 +16050,11 @@ const setValueForSelect = (el, val) => { fireEventsOnSelect(el); return true; } - } // If we didn't find a matching option return false - - + } + // If we didn't find a matching option return false return false; }; + /** * Sets or selects a value to a form element * @param {HTMLInputElement | HTMLSelectElement} el @@ -17651,24 +16062,19 @@ const setValueForSelect = (el, val) => { * @param {GlobalConfig} [config] * @return {boolean} */ - - const setValue = (el, val, config) => { if (el instanceof HTMLInputElement) return setValueForInput(el, val, config); if (el instanceof HTMLSelectElement) return setValueForSelect(el, val); return false; }; + /** * Use IntersectionObserver v2 to make sure the element is visible when clicked * https://developers.google.com/web/updates/2019/02/intersectionobserver-v2 */ - - exports.setValue = setValue; - const safeExecute = function (el, fn) { let _opts = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; - // TODO: temporary fix to misterious bug in Chrome // const {checkVisibility = true} = opts const intObs = new IntersectionObserver(changes => { @@ -17678,7 +16084,6 @@ const safeExecute = function (el, fn) { // The browser doesn't support Intersection Observer v2, falling back to v1 behavior. change.isVisible = true; } - if (change.isIntersecting) { /** * If 'checkVisibility' is 'false' (like on Windows), then we always execute the function @@ -17691,7 +16096,6 @@ const safeExecute = function (el, fn) { fn(); } } - intObs.disconnect(); }, { trackVisibility: true, @@ -17699,15 +16103,13 @@ const safeExecute = function (el, fn) { }); intObs.observe(el); }; + /** * Checks that an element is potentially viewable (even if off-screen) * @param {HTMLElement} el * @return {boolean} */ - - exports.safeExecute = safeExecute; - const isPotentiallyViewable = el => { const computedStyle = window.getComputedStyle(el); const opacity = parseFloat(computedStyle.getPropertyValue('opacity') || '1'); @@ -17715,15 +16117,13 @@ const isPotentiallyViewable = el => { const opacityThreshold = 0.6; return el.clientWidth !== 0 && el.clientHeight !== 0 && opacity > opacityThreshold && visibility !== 'hidden'; }; + /** * Gets the bounding box of the icon * @param {HTMLInputElement} input * @returns {{top: number, left: number, bottom: number, width: number, x: number, y: number, right: number, height: number}} */ - - exports.isPotentiallyViewable = isPotentiallyViewable; - const getDaxBoundingBox = input => { const { right: inputRight, @@ -17748,16 +16148,14 @@ const getDaxBoundingBox = input => { y: top }; }; + /** * Check if a mouse event is within the icon * @param {MouseEvent} e * @param {HTMLInputElement} input * @returns {boolean} */ - - exports.getDaxBoundingBox = getDaxBoundingBox; - const isEventWithinDax = (e, input) => { const { left, @@ -17769,50 +16167,40 @@ const isEventWithinDax = (e, input) => { const withinY = e.clientY >= top && e.clientY <= bottom; return withinX && withinY; }; + /** * Adds inline styles from a prop:value object * @param {HTMLElement} el * @param {Object} styles */ - - exports.isEventWithinDax = isEventWithinDax; - const addInlineStyles = (el, styles) => Object.entries(styles).forEach(_ref => { let [property, val] = _ref; return el.style.setProperty(property, val, 'important'); }); + /** * Removes inline styles from a prop:value object * @param {HTMLElement} el * @param {Object} styles */ - - exports.addInlineStyles = addInlineStyles; - const removeInlineStyles = (el, styles) => Object.keys(styles).forEach(property => el.style.removeProperty(property)); - exports.removeInlineStyles = removeInlineStyles; -const ADDRESS_DOMAIN = '@duck.com'; +const ADDRESS_DOMAIN = exports.ADDRESS_DOMAIN = '@duck.com'; /** * Given a username, returns the full email address * @param {string} address * @returns {string} */ - -exports.ADDRESS_DOMAIN = ADDRESS_DOMAIN; - const formatDuckAddress = address => address + ADDRESS_DOMAIN; + /** * Escapes any occurrences of &, ", <, > or / with XML entities. * @param {string} str The string to escape. * @return {string} The escaped string. */ - - exports.formatDuckAddress = formatDuckAddress; - function escapeXML(str) { const replacements = { '&': '&', @@ -17824,38 +16212,38 @@ function escapeXML(str) { }; return String(str).replace(/[&"'<>/]/g, m => replacements[m]); } + /** * Determines if an element is likely to be a submit button * @param {HTMLElement} el A button, input, anchor or other element with role=button * @param {import("./Form/matching").Matching} matching * @return {boolean} */ - - const isLikelyASubmitButton = (el, matching) => { - var _matching$getDDGMatch, _matching$getDDGMatch2, _matching$getDDGMatch3; - const text = getTextShallow(el); const ariaLabel = el.getAttribute('aria-label') || ''; const dataTestId = el.getAttribute('data-test-id') || ''; - if ((el.getAttribute('type') === 'submit' || // is explicitly set as "submit" - el.getAttribute('name') === 'submit') && // is called "submit" - !((_matching$getDDGMatch = matching.getDDGMatcherRegex('submitButtonUnlikelyRegex')) !== null && _matching$getDDGMatch !== void 0 && _matching$getDDGMatch.test(text + ' ' + ariaLabel))) return true; - return (/primary|submit/i.test(el.className) || // has high-signal submit classes - /submit/i.test(dataTestId) || ((_matching$getDDGMatch2 = matching.getDDGMatcherRegex('submitButtonRegex')) === null || _matching$getDDGMatch2 === void 0 ? void 0 : _matching$getDDGMatch2.test(text)) || // has high-signal text + if ((el.getAttribute('type') === 'submit' || + // is explicitly set as "submit" + el.getAttribute('name') === 'submit') && + // is called "submit" + !matching.getDDGMatcherRegex('submitButtonUnlikelyRegex')?.test(text + ' ' + ariaLabel)) return true; + return (/primary|submit/i.test(el.className) || + // has high-signal submit classes + /submit/i.test(dataTestId) || matching.getDDGMatcherRegex('submitButtonRegex')?.test(text) || + // has high-signal text el.offsetHeight * el.offsetWidth >= 10000 && !/secondary/i.test(el.className) // it's a large element 250x40px - ) && el.offsetHeight * el.offsetWidth >= 2000 && // it's not a very small button like inline links and such - !((_matching$getDDGMatch3 = matching.getDDGMatcherRegex('submitButtonUnlikelyRegex')) !== null && _matching$getDDGMatch3 !== void 0 && _matching$getDDGMatch3.test(text + ' ' + ariaLabel)); + ) && el.offsetHeight * el.offsetWidth >= 2000 && + // it's not a very small button like inline links and such + !matching.getDDGMatcherRegex('submitButtonUnlikelyRegex')?.test(text + ' ' + ariaLabel); }; + /** * Check that a button matches the form type - login buttons on a login form, signup buttons on a signup form * @param {HTMLElement} el * @param {import('./Form/Form').Form} formObj */ - - exports.isLikelyASubmitButton = isLikelyASubmitButton; - const buttonMatchesFormType = (el, formObj) => { if (formObj.isLogin) { return !/sign.?up|register|join/i.test(el.textContent || ''); @@ -17865,7 +16253,6 @@ const buttonMatchesFormType = (el, formObj) => { return true; } }; - exports.buttonMatchesFormType = buttonMatchesFormType; const buttonInputTypes = ['submit', 'button']; /** @@ -17873,65 +16260,55 @@ const buttonInputTypes = ['submit', 'button']; * @param {Node} el * @returns {string} */ - const getTextShallow = el => { // for buttons, we don't care about descendants, just get the whole text as is // this is important in order to give proper attribution of the text to the button if (el instanceof HTMLButtonElement) return (0, _matching.removeExcessWhitespace)(el.textContent); - if (el instanceof HTMLInputElement) { if (buttonInputTypes.includes(el.type)) { return el.value; } - if (el.type === 'image') { return (0, _matching.removeExcessWhitespace)(el.alt || el.value || el.title || el.name); } } - let text = ''; - for (const childNode of el.childNodes) { if (childNode instanceof Text) { text += ' ' + childNode.textContent; } } - return (0, _matching.removeExcessWhitespace)(text); }; + /** * Check if hostname is a local address * @param {string} [hostname] * @returns {boolean} */ - - exports.getTextShallow = getTextShallow; - function isLocalNetwork() { let hostname = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : window.location.hostname; return ['localhost', '', '::1'].includes(hostname) || hostname.includes('127.0.0.1') || hostname.includes('192.168.') || hostname.startsWith('10.0.') || hostname.endsWith('.local') || hostname.endsWith('.internal'); -} // Extracted from lib/DDG/Util/Constants.pm - +} +// Extracted from lib/DDG/Util/Constants.pm const tldrs = /\.(?:c(?:o(?:m|op)?|at?|[iykgdmnxruhcfzvl])|o(?:rg|m)|n(?:et?|a(?:me)?|[ucgozrfpil])|e(?:d?u|[gechstr])|i(?:n(?:t|fo)?|[stqldroem])|m(?:o(?:bi)?|u(?:seum)?|i?l|[mcyvtsqhaerngxzfpwkd])|g(?:ov|[glqeriabtshdfmuywnp])|b(?:iz?|[drovfhtaywmzjsgbenl])|t(?:r(?:avel)?|[ncmfzdvkopthjwg]|e?l)|k[iemygznhwrp]|s[jtvberindlucygkhaozm]|u[gymszka]|h[nmutkr]|r[owesu]|d[kmzoej]|a(?:e(?:ro)?|r(?:pa)?|[qofiumsgzlwcnxdt])|p(?:ro?|[sgnthfymakwle])|v[aegiucn]|l[sayuvikcbrt]|j(?:o(?:bs)?|[mep])|w[fs]|z[amw]|f[rijkom]|y[eut]|qa)$/i; /** * Check if hostname is a valid top-level domain * @param {string} [hostname] * @returns {boolean} */ - function isValidTLD() { let hostname = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : window.location.hostname; return tldrs.test(hostname) || hostname === 'fill.dev'; } + /** * Chrome's UA adds styles using this selector when using the built-in autofill * @param {HTMLInputElement} input * @returns {boolean} */ - - const wasAutofilledByChrome = input => { try { // Other browsers throw because the selector is invalid @@ -17940,131 +16317,111 @@ const wasAutofilledByChrome = input => { return false; } }; + /** * Checks if we should log form analysis debug info to the console * @returns {boolean} */ - - exports.wasAutofilledByChrome = wasAutofilledByChrome; - function shouldLog() { return readDebugSetting('ddg-autofill-debug'); } + /** * Checks if we should log performance info to the console * @returns {boolean} */ - - function shouldLogPerformance() { return readDebugSetting('ddg-autofill-perf'); } + /** * Check if a sessionStorage item is set to 'true' * @param setting * @returns {boolean} */ - - function readDebugSetting(setting) { // sessionStorage throws in invalid schemes like data: and file: try { - var _window$sessionStorag; - - return ((_window$sessionStorag = window.sessionStorage) === null || _window$sessionStorag === void 0 ? void 0 : _window$sessionStorag.getItem(setting)) === 'true'; + return window.sessionStorage?.getItem(setting) === 'true'; } catch (e) { return false; } } - function logPerformance(markName) { if (shouldLogPerformance()) { - var _window$performance, _window$performance2; - - const measurement = (_window$performance = window.performance) === null || _window$performance === void 0 ? void 0 : _window$performance.measure("".concat(markName, ":init"), "".concat(markName, ":init:start"), "".concat(markName, ":init:end")); - console.log("".concat(markName, " took ").concat(Math.round(measurement === null || measurement === void 0 ? void 0 : measurement.duration), "ms")); - (_window$performance2 = window.performance) === null || _window$performance2 === void 0 ? void 0 : _window$performance2.clearMarks(); + const measurement = window.performance?.measure(`${markName}:init`, `${markName}:init:start`, `${markName}:init:end`); + console.log(`${markName} took ${Math.round(measurement?.duration)}ms`); + window.performance?.clearMarks(); } } + /** * * @param {Function} callback * @returns {Function} */ - - function whenIdle(callback) { var _this = this; - let timer; return function () { for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } - cancelIdleCallback(timer); timer = requestIdleCallback(() => callback.apply(_this, args)); }; } + /** * Truncate string from the middle if exceeds the totalLength (default: 30) * @param {string} string * @param {number} totalLength * @returns {string} */ - - function truncateFromMiddle(string) { let totalLength = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 30; - if (totalLength < 4) { throw new Error('Do not use with strings shorter than 4'); } - if (string.length <= totalLength) return string; const truncated = string.slice(0, totalLength / 2).concat('…', string.slice(totalLength / -2)); return truncated; } + /** * Determines if the form is likely to be enclosing most of the DOM * @param {HTMLFormElement} form * @returns {boolean} */ - - function isFormLikelyToBeUsedAsPageWrapper(form) { if (form.parentElement !== document.body) return false; - const formChildren = form.querySelectorAll('*').length; // If the form has few content elements, it's unlikely to cause issues anyway - + const formChildren = form.querySelectorAll('*').length; + // If the form has few content elements, it's unlikely to cause issues anyway if (formChildren < 100) return false; const bodyChildren = document.body.querySelectorAll('*').length; + /** * Percentage of the formChildren on the total body elements * form * 100 / body = x */ - const formChildrenPercentage = formChildren * 100 / bodyChildren; return formChildrenPercentage > 50; } -},{"./Form/matching.js":41}],60:[function(require,module,exports){ +},{"./Form/matching.js":43}],62:[function(require,module,exports){ "use strict"; require("./requestIdleCallback.js"); - var _DeviceInterface = require("./DeviceInterface.js"); - var _autofillUtils = require("./autofill-utils.js"); - // Polyfills/shims + (() => { if ((0, _autofillUtils.shouldLog)()) { console.log('DuckDuckGo Autofill Active'); } - if (!window.isSecureContext) return false; - try { const startupAutofill = () => { if (document.visibilityState === 'visible') { @@ -18076,14 +16433,14 @@ var _autofillUtils = require("./autofill-utils.js"); }); } }; - startupAutofill(); } catch (e) { - console.error(e); // Noop, we errored + console.error(e); + // Noop, we errored } })(); -},{"./DeviceInterface.js":20,"./autofill-utils.js":59,"./requestIdleCallback.js":71}],61:[function(require,module,exports){ +},{"./DeviceInterface.js":22,"./autofill-utils.js":61,"./requestIdleCallback.js":73}],63:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { @@ -18091,59 +16448,60 @@ Object.defineProperty(exports, "__esModule", { }); exports.DDG_DOMAIN_REGEX = void 0; exports.createGlobalConfig = createGlobalConfig; -const DDG_DOMAIN_REGEX = new RegExp(/^https:\/\/(([a-z0-9-_]+?)\.)?duckduckgo\.com\/email/); +const DDG_DOMAIN_REGEX = exports.DDG_DOMAIN_REGEX = new RegExp(/^https:\/\/(([a-z0-9-_]+?)\.)?duckduckgo\.com\/email/); + /** * This is a centralised place to contain all string/variable replacements * * @param {Partial} [overrides] * @returns {GlobalConfig} */ - -exports.DDG_DOMAIN_REGEX = DDG_DOMAIN_REGEX; - function createGlobalConfig(overrides) { let isApp = false; let isTopFrame = false; - let supportsTopFrame = false; // Do not remove -- Apple devices change this when they support modern webkit messaging - - let hasModernWebkitAPI = false; // INJECT isApp HERE + let supportsTopFrame = false; + // Do not remove -- Apple devices change this when they support modern webkit messaging + let hasModernWebkitAPI = false; + // INJECT isApp HERE // INJECT isTopFrame HERE // INJECT supportsTopFrame HERE // INJECT hasModernWebkitAPI HERE - let isWindows = false; // INJECT isWindows HERE - // This will be used when 'hasModernWebkitAPI' is false + let isWindows = false; + // INJECT isWindows HERE + // This will be used when 'hasModernWebkitAPI' is false /** @type {string[]} */ + let webkitMessageHandlerNames = []; + // INJECT webkitMessageHandlerNames HERE - let webkitMessageHandlerNames = []; // INJECT webkitMessageHandlerNames HERE - - let isDDGTestMode = false; isDDGTestMode = true; + let isDDGTestMode = false; + isDDGTestMode = true; let contentScope = null; let userUnprotectedDomains = null; /** @type {Record | null} */ - - let userPreferences = null; // INJECT contentScope HERE + let userPreferences = null; + // INJECT contentScope HERE // INJECT userUnprotectedDomains HERE // INJECT userPreferences HERE /** @type {Record | null} */ + let availableInputTypes = null; + // INJECT availableInputTypes HERE - let availableInputTypes = null; // INJECT availableInputTypes HERE // The native layer will inject a randomised secret here and use it to verify the origin - let secret = 'PLACEHOLDER_SECRET'; + /** * The user agent check will not be needed here once `android` supports `userPreferences?.platform.name` */ // @ts-ignore - - const isAndroid = (userPreferences === null || userPreferences === void 0 ? void 0 : userPreferences.platform.name) === 'android' || /Android.*DuckDuckGo\/\d/i.test(window.navigator.userAgent); // @ts-ignore - - const isDDGApp = ['ios', 'android', 'macos', 'windows'].includes(userPreferences === null || userPreferences === void 0 ? void 0 : userPreferences.platform.name) || isAndroid || isWindows; // @ts-ignore - - const isMobileApp = ['ios', 'android'].includes(userPreferences === null || userPreferences === void 0 ? void 0 : userPreferences.platform.name) || isAndroid; + const isAndroid = userPreferences?.platform.name === 'android' || /Android.*DuckDuckGo\/\d/i.test(window.navigator.userAgent); + // @ts-ignore + const isDDGApp = ['ios', 'android', 'macos', 'windows'].includes(userPreferences?.platform.name) || isAndroid || isWindows; + // @ts-ignore + const isMobileApp = ['ios', 'android'].includes(userPreferences?.platform.name) || isAndroid; const isFirefox = navigator.userAgent.includes('Firefox'); const isDDGDomain = Boolean(window.location.href.match(DDG_DOMAIN_REGEX)); const isExtension = false; @@ -18171,14 +16529,14 @@ function createGlobalConfig(overrides) { return config; } -},{}],62:[function(require,module,exports){ +},{}],64:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.constants = void 0; -const constants = { +const constants = exports.constants = { ATTR_INPUT_TYPE: 'data-ddg-inputType', ATTR_AUTOFILL: 'data-ddg-autofill', TEXT_LENGTH_CUTOFF: 100, @@ -18187,511 +16545,256 @@ const constants = { MAX_INPUTS_PER_FORM: 80, MAX_FORM_MUT_OBS_COUNT: 50 }; -exports.constants = constants; -},{}],63:[function(require,module,exports){ +},{}],65:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.StoreFormDataCall = exports.StartEmailProtectionSignupCall = exports.SetSizeCall = exports.SetIncontextSignupPermanentlyDismissedAtCall = exports.SendJSPixelCall = exports.SelectedDetailCall = exports.OpenManagePasswordsCall = exports.OpenManageIdentitiesCall = exports.OpenManageCreditCardsCall = exports.GetRuntimeConfigurationCall = exports.GetIncontextSignupDismissedAtCall = exports.GetAvailableInputTypesCall = exports.GetAutofillInitDataCall = exports.GetAutofillDataCall = exports.GetAutofillCredentialsCall = exports.EmailProtectionStoreUserDataCall = exports.EmailProtectionRemoveUserDataCall = exports.EmailProtectionRefreshPrivateAddressCall = exports.EmailProtectionGetUserDataCall = exports.EmailProtectionGetIsLoggedInCall = exports.EmailProtectionGetCapabilitiesCall = exports.EmailProtectionGetAddressesCall = exports.CloseEmailProtectionTabCall = exports.CloseAutofillParentCall = exports.CheckCredentialsProviderStatusCall = exports.AskToUnlockProviderCall = exports.AddDebugFlagCall = void 0; - var _validatorsZod = require("./validators.zod.js"); - var _deviceApi = require("../../../packages/device-api"); - -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } +/* DO NOT EDIT, this file was generated by scripts/api-call-generator.js */ /** * @extends {DeviceApiCall} */ class AddDebugFlagCall extends _deviceApi.DeviceApiCall { - constructor() { - super(...arguments); - - _defineProperty(this, "method", "addDebugFlag"); - - _defineProperty(this, "paramsValidator", _validatorsZod.addDebugFlagParamsSchema); - } - + method = "addDebugFlag"; + paramsValidator = _validatorsZod.addDebugFlagParamsSchema; } /** * @extends {DeviceApiCall} */ - - exports.AddDebugFlagCall = AddDebugFlagCall; - class GetAutofillDataCall extends _deviceApi.DeviceApiCall { - constructor() { - super(...arguments); - - _defineProperty(this, "method", "getAutofillData"); - - _defineProperty(this, "id", "getAutofillDataResponse"); - - _defineProperty(this, "paramsValidator", _validatorsZod.getAutofillDataRequestSchema); - - _defineProperty(this, "resultValidator", _validatorsZod.getAutofillDataResponseSchema); - } - + method = "getAutofillData"; + id = "getAutofillDataResponse"; + paramsValidator = _validatorsZod.getAutofillDataRequestSchema; + resultValidator = _validatorsZod.getAutofillDataResponseSchema; } /** * @extends {DeviceApiCall} */ - - exports.GetAutofillDataCall = GetAutofillDataCall; - class GetRuntimeConfigurationCall extends _deviceApi.DeviceApiCall { - constructor() { - super(...arguments); - - _defineProperty(this, "method", "getRuntimeConfiguration"); - - _defineProperty(this, "id", "getRuntimeConfigurationResponse"); - - _defineProperty(this, "resultValidator", _validatorsZod.getRuntimeConfigurationResponseSchema); - } - + method = "getRuntimeConfiguration"; + id = "getRuntimeConfigurationResponse"; + resultValidator = _validatorsZod.getRuntimeConfigurationResponseSchema; } /** * @extends {DeviceApiCall} */ - - exports.GetRuntimeConfigurationCall = GetRuntimeConfigurationCall; - class StoreFormDataCall extends _deviceApi.DeviceApiCall { - constructor() { - super(...arguments); - - _defineProperty(this, "method", "storeFormData"); - - _defineProperty(this, "paramsValidator", _validatorsZod.storeFormDataSchema); - } - + method = "storeFormData"; + paramsValidator = _validatorsZod.storeFormDataSchema; } /** * @extends {DeviceApiCall} */ - - exports.StoreFormDataCall = StoreFormDataCall; - class GetAvailableInputTypesCall extends _deviceApi.DeviceApiCall { - constructor() { - super(...arguments); - - _defineProperty(this, "method", "getAvailableInputTypes"); - - _defineProperty(this, "id", "getAvailableInputTypesResponse"); - - _defineProperty(this, "resultValidator", _validatorsZod.getAvailableInputTypesResultSchema); - } - + method = "getAvailableInputTypes"; + id = "getAvailableInputTypesResponse"; + resultValidator = _validatorsZod.getAvailableInputTypesResultSchema; } /** * @extends {DeviceApiCall} */ - - exports.GetAvailableInputTypesCall = GetAvailableInputTypesCall; - class GetAutofillInitDataCall extends _deviceApi.DeviceApiCall { - constructor() { - super(...arguments); - - _defineProperty(this, "method", "getAutofillInitData"); - - _defineProperty(this, "id", "getAutofillInitDataResponse"); - - _defineProperty(this, "resultValidator", _validatorsZod.getAutofillInitDataResponseSchema); - } - + method = "getAutofillInitData"; + id = "getAutofillInitDataResponse"; + resultValidator = _validatorsZod.getAutofillInitDataResponseSchema; } /** * @extends {DeviceApiCall} */ - - exports.GetAutofillInitDataCall = GetAutofillInitDataCall; - class GetAutofillCredentialsCall extends _deviceApi.DeviceApiCall { - constructor() { - super(...arguments); - - _defineProperty(this, "method", "getAutofillCredentials"); - - _defineProperty(this, "id", "getAutofillCredentialsResponse"); - - _defineProperty(this, "paramsValidator", _validatorsZod.getAutofillCredentialsParamsSchema); - - _defineProperty(this, "resultValidator", _validatorsZod.getAutofillCredentialsResultSchema); - } - + method = "getAutofillCredentials"; + id = "getAutofillCredentialsResponse"; + paramsValidator = _validatorsZod.getAutofillCredentialsParamsSchema; + resultValidator = _validatorsZod.getAutofillCredentialsResultSchema; } /** * @extends {DeviceApiCall} */ - - exports.GetAutofillCredentialsCall = GetAutofillCredentialsCall; - class SetSizeCall extends _deviceApi.DeviceApiCall { - constructor() { - super(...arguments); - - _defineProperty(this, "method", "setSize"); - - _defineProperty(this, "paramsValidator", _validatorsZod.setSizeParamsSchema); - } - + method = "setSize"; + paramsValidator = _validatorsZod.setSizeParamsSchema; } /** * @extends {DeviceApiCall} */ - - exports.SetSizeCall = SetSizeCall; - class SelectedDetailCall extends _deviceApi.DeviceApiCall { - constructor() { - super(...arguments); - - _defineProperty(this, "method", "selectedDetail"); - - _defineProperty(this, "paramsValidator", _validatorsZod.selectedDetailParamsSchema); - } - + method = "selectedDetail"; + paramsValidator = _validatorsZod.selectedDetailParamsSchema; } /** * @extends {DeviceApiCall} */ - - exports.SelectedDetailCall = SelectedDetailCall; - class CloseAutofillParentCall extends _deviceApi.DeviceApiCall { - constructor() { - super(...arguments); - - _defineProperty(this, "method", "closeAutofillParent"); - } - + method = "closeAutofillParent"; } /** * @extends {DeviceApiCall} - */ - - + */ exports.CloseAutofillParentCall = CloseAutofillParentCall; - class AskToUnlockProviderCall extends _deviceApi.DeviceApiCall { - constructor() { - super(...arguments); - - _defineProperty(this, "method", "askToUnlockProvider"); - - _defineProperty(this, "id", "askToUnlockProviderResponse"); - - _defineProperty(this, "resultValidator", _validatorsZod.askToUnlockProviderResultSchema); - } - + method = "askToUnlockProvider"; + id = "askToUnlockProviderResponse"; + resultValidator = _validatorsZod.askToUnlockProviderResultSchema; } /** * @extends {DeviceApiCall} */ - - exports.AskToUnlockProviderCall = AskToUnlockProviderCall; - class CheckCredentialsProviderStatusCall extends _deviceApi.DeviceApiCall { - constructor() { - super(...arguments); - - _defineProperty(this, "method", "checkCredentialsProviderStatus"); - - _defineProperty(this, "id", "checkCredentialsProviderStatusResponse"); - - _defineProperty(this, "resultValidator", _validatorsZod.checkCredentialsProviderStatusResultSchema); - } - + method = "checkCredentialsProviderStatus"; + id = "checkCredentialsProviderStatusResponse"; + resultValidator = _validatorsZod.checkCredentialsProviderStatusResultSchema; } /** * @extends {DeviceApiCall} */ - - exports.CheckCredentialsProviderStatusCall = CheckCredentialsProviderStatusCall; - class SendJSPixelCall extends _deviceApi.DeviceApiCall { - constructor() { - super(...arguments); - - _defineProperty(this, "method", "sendJSPixel"); - - _defineProperty(this, "paramsValidator", _validatorsZod.sendJSPixelParamsSchema); - } - + method = "sendJSPixel"; + paramsValidator = _validatorsZod.sendJSPixelParamsSchema; } /** * @extends {DeviceApiCall} */ - - exports.SendJSPixelCall = SendJSPixelCall; - class SetIncontextSignupPermanentlyDismissedAtCall extends _deviceApi.DeviceApiCall { - constructor() { - super(...arguments); - - _defineProperty(this, "method", "setIncontextSignupPermanentlyDismissedAt"); - - _defineProperty(this, "paramsValidator", _validatorsZod.setIncontextSignupPermanentlyDismissedAtSchema); - } - + method = "setIncontextSignupPermanentlyDismissedAt"; + paramsValidator = _validatorsZod.setIncontextSignupPermanentlyDismissedAtSchema; } /** * @extends {DeviceApiCall} */ - - exports.SetIncontextSignupPermanentlyDismissedAtCall = SetIncontextSignupPermanentlyDismissedAtCall; - class GetIncontextSignupDismissedAtCall extends _deviceApi.DeviceApiCall { - constructor() { - super(...arguments); - - _defineProperty(this, "method", "getIncontextSignupDismissedAt"); - - _defineProperty(this, "id", "getIncontextSignupDismissedAt"); - - _defineProperty(this, "resultValidator", _validatorsZod.getIncontextSignupDismissedAtSchema); - } - + method = "getIncontextSignupDismissedAt"; + id = "getIncontextSignupDismissedAt"; + resultValidator = _validatorsZod.getIncontextSignupDismissedAtSchema; } /** * @extends {DeviceApiCall} */ - - exports.GetIncontextSignupDismissedAtCall = GetIncontextSignupDismissedAtCall; - class OpenManagePasswordsCall extends _deviceApi.DeviceApiCall { - constructor() { - super(...arguments); - - _defineProperty(this, "method", "openManagePasswords"); - } - + method = "openManagePasswords"; } /** * @extends {DeviceApiCall} */ - - exports.OpenManagePasswordsCall = OpenManagePasswordsCall; - class OpenManageCreditCardsCall extends _deviceApi.DeviceApiCall { - constructor() { - super(...arguments); - - _defineProperty(this, "method", "openManageCreditCards"); - } - + method = "openManageCreditCards"; } /** * @extends {DeviceApiCall} */ - - exports.OpenManageCreditCardsCall = OpenManageCreditCardsCall; - class OpenManageIdentitiesCall extends _deviceApi.DeviceApiCall { - constructor() { - super(...arguments); - - _defineProperty(this, "method", "openManageIdentities"); - } - + method = "openManageIdentities"; } /** * @extends {DeviceApiCall} */ - - exports.OpenManageIdentitiesCall = OpenManageIdentitiesCall; - class EmailProtectionStoreUserDataCall extends _deviceApi.DeviceApiCall { - constructor() { - super(...arguments); - - _defineProperty(this, "method", "emailProtectionStoreUserData"); - - _defineProperty(this, "id", "emailProtectionStoreUserDataResponse"); - - _defineProperty(this, "paramsValidator", _validatorsZod.emailProtectionStoreUserDataParamsSchema); - } - + method = "emailProtectionStoreUserData"; + id = "emailProtectionStoreUserDataResponse"; + paramsValidator = _validatorsZod.emailProtectionStoreUserDataParamsSchema; } /** * @extends {DeviceApiCall} */ - - exports.EmailProtectionStoreUserDataCall = EmailProtectionStoreUserDataCall; - class EmailProtectionRemoveUserDataCall extends _deviceApi.DeviceApiCall { - constructor() { - super(...arguments); - - _defineProperty(this, "method", "emailProtectionRemoveUserData"); - } - + method = "emailProtectionRemoveUserData"; } /** * @extends {DeviceApiCall} */ - - exports.EmailProtectionRemoveUserDataCall = EmailProtectionRemoveUserDataCall; - class EmailProtectionGetIsLoggedInCall extends _deviceApi.DeviceApiCall { - constructor() { - super(...arguments); - - _defineProperty(this, "method", "emailProtectionGetIsLoggedIn"); - - _defineProperty(this, "id", "emailProtectionGetIsLoggedInResponse"); - - _defineProperty(this, "resultValidator", _validatorsZod.emailProtectionGetIsLoggedInResultSchema); - } - + method = "emailProtectionGetIsLoggedIn"; + id = "emailProtectionGetIsLoggedInResponse"; + resultValidator = _validatorsZod.emailProtectionGetIsLoggedInResultSchema; } /** * @extends {DeviceApiCall} */ - - exports.EmailProtectionGetIsLoggedInCall = EmailProtectionGetIsLoggedInCall; - class EmailProtectionGetUserDataCall extends _deviceApi.DeviceApiCall { - constructor() { - super(...arguments); - - _defineProperty(this, "method", "emailProtectionGetUserData"); - - _defineProperty(this, "id", "emailProtectionGetUserDataResponse"); - - _defineProperty(this, "resultValidator", _validatorsZod.emailProtectionGetUserDataResultSchema); - } - + method = "emailProtectionGetUserData"; + id = "emailProtectionGetUserDataResponse"; + resultValidator = _validatorsZod.emailProtectionGetUserDataResultSchema; } /** * @extends {DeviceApiCall} */ - - exports.EmailProtectionGetUserDataCall = EmailProtectionGetUserDataCall; - class EmailProtectionGetCapabilitiesCall extends _deviceApi.DeviceApiCall { - constructor() { - super(...arguments); - - _defineProperty(this, "method", "emailProtectionGetCapabilities"); - - _defineProperty(this, "id", "emailProtectionGetCapabilitiesResponse"); - - _defineProperty(this, "resultValidator", _validatorsZod.emailProtectionGetCapabilitiesResultSchema); - } - + method = "emailProtectionGetCapabilities"; + id = "emailProtectionGetCapabilitiesResponse"; + resultValidator = _validatorsZod.emailProtectionGetCapabilitiesResultSchema; } /** * @extends {DeviceApiCall} */ - - exports.EmailProtectionGetCapabilitiesCall = EmailProtectionGetCapabilitiesCall; - class EmailProtectionGetAddressesCall extends _deviceApi.DeviceApiCall { - constructor() { - super(...arguments); - - _defineProperty(this, "method", "emailProtectionGetAddresses"); - - _defineProperty(this, "id", "emailProtectionGetAddressesResponse"); - - _defineProperty(this, "resultValidator", _validatorsZod.emailProtectionGetAddressesResultSchema); - } - + method = "emailProtectionGetAddresses"; + id = "emailProtectionGetAddressesResponse"; + resultValidator = _validatorsZod.emailProtectionGetAddressesResultSchema; } /** * @extends {DeviceApiCall} */ - - exports.EmailProtectionGetAddressesCall = EmailProtectionGetAddressesCall; - class EmailProtectionRefreshPrivateAddressCall extends _deviceApi.DeviceApiCall { - constructor() { - super(...arguments); - - _defineProperty(this, "method", "emailProtectionRefreshPrivateAddress"); - - _defineProperty(this, "id", "emailProtectionRefreshPrivateAddressResponse"); - - _defineProperty(this, "resultValidator", _validatorsZod.emailProtectionRefreshPrivateAddressResultSchema); - } - + method = "emailProtectionRefreshPrivateAddress"; + id = "emailProtectionRefreshPrivateAddressResponse"; + resultValidator = _validatorsZod.emailProtectionRefreshPrivateAddressResultSchema; } /** * @extends {DeviceApiCall} */ - - exports.EmailProtectionRefreshPrivateAddressCall = EmailProtectionRefreshPrivateAddressCall; - class StartEmailProtectionSignupCall extends _deviceApi.DeviceApiCall { - constructor() { - super(...arguments); - - _defineProperty(this, "method", "startEmailProtectionSignup"); - } - + method = "startEmailProtectionSignup"; } /** * @extends {DeviceApiCall} */ - - exports.StartEmailProtectionSignupCall = StartEmailProtectionSignupCall; - class CloseEmailProtectionTabCall extends _deviceApi.DeviceApiCall { - constructor() { - super(...arguments); - - _defineProperty(this, "method", "closeEmailProtectionTab"); - } - + method = "closeEmailProtectionTab"; } - exports.CloseEmailProtectionTabCall = CloseEmailProtectionTabCall; -},{"../../../packages/device-api":10,"./validators.zod.js":64}],64:[function(require,module,exports){ +},{"../../../packages/device-api":12,"./validators.zod.js":66}],66:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.userPreferencesSchema = exports.triggerContextSchema = exports.storeFormDataSchema = exports.setSizeParamsSchema = exports.setIncontextSignupPermanentlyDismissedAtSchema = exports.sendJSPixelParamsSchema = exports.selectedDetailParamsSchema = exports.runtimeConfigurationSchema = exports.providerStatusUpdatedSchema = exports.outgoingCredentialsSchema = exports.getRuntimeConfigurationResponseSchema = exports.getIncontextSignupDismissedAtSchema = exports.getAvailableInputTypesResultSchema = exports.getAutofillInitDataResponseSchema = exports.getAutofillDataResponseSchema = exports.getAutofillDataRequestSchema = exports.getAutofillCredentialsResultSchema = exports.getAutofillCredentialsParamsSchema = exports.getAliasResultSchema = exports.getAliasParamsSchema = exports.genericErrorSchema = exports.generatedPasswordSchema = exports.emailProtectionStoreUserDataParamsSchema = exports.emailProtectionRefreshPrivateAddressResultSchema = exports.emailProtectionGetUserDataResultSchema = exports.emailProtectionGetIsLoggedInResultSchema = exports.emailProtectionGetCapabilitiesResultSchema = exports.emailProtectionGetAddressesResultSchema = exports.credentialsSchema = exports.contentScopeSchema = exports.checkCredentialsProviderStatusResultSchema = exports.availableInputTypesSchema = exports.availableInputTypes1Schema = exports.autofillSettingsSchema = exports.autofillFeatureTogglesSchema = exports.askToUnlockProviderResultSchema = exports.apiSchema = exports.addDebugFlagParamsSchema = void 0; - var _zod = require("zod"); - /* DO NOT EDIT, this file was generated by scripts/api-call-generator.js */ // Generated by ts-to-zod -const sendJSPixelParamsSchema = _zod.z.union([_zod.z.object({ + +const sendJSPixelParamsSchema = exports.sendJSPixelParamsSchema = _zod.z.union([_zod.z.object({ pixelName: _zod.z.literal("autofill_identity"), params: _zod.z.object({ fieldType: _zod.z.string().optional() @@ -18711,33 +16814,56 @@ const sendJSPixelParamsSchema = _zod.z.union([_zod.z.object({ }), _zod.z.object({ pixelName: _zod.z.literal("incontext_close_x") })]); - -exports.sendJSPixelParamsSchema = sendJSPixelParamsSchema; - -const addDebugFlagParamsSchema = _zod.z.object({ +const addDebugFlagParamsSchema = exports.addDebugFlagParamsSchema = _zod.z.object({ flag: _zod.z.string() }); - -exports.addDebugFlagParamsSchema = addDebugFlagParamsSchema; - -const generatedPasswordSchema = _zod.z.object({ +const getAutofillCredentialsParamsSchema = exports.getAutofillCredentialsParamsSchema = _zod.z.object({ + id: _zod.z.string() +}); +const setSizeParamsSchema = exports.setSizeParamsSchema = _zod.z.object({ + height: _zod.z.number(), + width: _zod.z.number() +}); +const selectedDetailParamsSchema = exports.selectedDetailParamsSchema = _zod.z.object({ + data: _zod.z.record(_zod.z.unknown()), + configType: _zod.z.string() +}); +const setIncontextSignupPermanentlyDismissedAtSchema = exports.setIncontextSignupPermanentlyDismissedAtSchema = _zod.z.object({ + value: _zod.z.number().optional() +}); +const getIncontextSignupDismissedAtSchema = exports.getIncontextSignupDismissedAtSchema = _zod.z.object({ + success: _zod.z.object({ + permanentlyDismissedAt: _zod.z.number().optional(), + isInstalledRecently: _zod.z.boolean().optional() + }) +}); +const getAliasParamsSchema = exports.getAliasParamsSchema = _zod.z.object({ + requiresUserPermission: _zod.z.boolean(), + shouldConsumeAliasIfProvided: _zod.z.boolean(), + isIncontextSignupAvailable: _zod.z.boolean().optional() +}); +const getAliasResultSchema = exports.getAliasResultSchema = _zod.z.object({ + success: _zod.z.object({ + alias: _zod.z.string().optional() + }) +}); +const emailProtectionStoreUserDataParamsSchema = exports.emailProtectionStoreUserDataParamsSchema = _zod.z.object({ + token: _zod.z.string(), + userName: _zod.z.string(), + cohort: _zod.z.string() +}); +const generatedPasswordSchema = exports.generatedPasswordSchema = _zod.z.object({ value: _zod.z.string(), username: _zod.z.string() }); - -exports.generatedPasswordSchema = generatedPasswordSchema; - -const triggerContextSchema = _zod.z.object({ +const triggerContextSchema = exports.triggerContextSchema = _zod.z.object({ inputTop: _zod.z.number(), inputLeft: _zod.z.number(), inputHeight: _zod.z.number(), inputWidth: _zod.z.number(), wasFromClick: _zod.z.boolean() }); - -exports.triggerContextSchema = triggerContextSchema; - -const credentialsSchema = _zod.z.object({ +const credentialsSchema = exports.credentialsSchema = _zod.z.object({ id: _zod.z.string().optional(), username: _zod.z.string(), password: _zod.z.string(), @@ -18747,16 +16873,10 @@ const credentialsSchema = _zod.z.object({ credentialsProvider: _zod.z.union([_zod.z.literal("duckduckgo"), _zod.z.literal("bitwarden")]).optional(), providerStatus: _zod.z.union([_zod.z.literal("locked"), _zod.z.literal("unlocked")]).optional() }); - -exports.credentialsSchema = credentialsSchema; - -const genericErrorSchema = _zod.z.object({ +const genericErrorSchema = exports.genericErrorSchema = _zod.z.object({ message: _zod.z.string() }); - -exports.genericErrorSchema = genericErrorSchema; - -const contentScopeSchema = _zod.z.object({ +const contentScopeSchema = exports.contentScopeSchema = _zod.z.object({ features: _zod.z.record(_zod.z.object({ exceptions: _zod.z.array(_zod.z.unknown()), state: _zod.z.union([_zod.z.literal("enabled"), _zod.z.literal("disabled")]), @@ -18764,10 +16884,7 @@ const contentScopeSchema = _zod.z.object({ })), unprotectedTemporary: _zod.z.array(_zod.z.unknown()) }); - -exports.contentScopeSchema = contentScopeSchema; - -const userPreferencesSchema = _zod.z.object({ +const userPreferencesSchema = exports.userPreferencesSchema = _zod.z.object({ globalPrivacyControlValue: _zod.z.boolean().optional(), sessionKey: _zod.z.string().optional(), debug: _zod.z.boolean(), @@ -18778,17 +16895,11 @@ const userPreferencesSchema = _zod.z.object({ settings: _zod.z.record(_zod.z.unknown()) })) }); - -exports.userPreferencesSchema = userPreferencesSchema; - -const outgoingCredentialsSchema = _zod.z.object({ +const outgoingCredentialsSchema = exports.outgoingCredentialsSchema = _zod.z.object({ username: _zod.z.string().optional(), password: _zod.z.string().optional() }); - -exports.outgoingCredentialsSchema = outgoingCredentialsSchema; - -const availableInputTypesSchema = _zod.z.object({ +const availableInputTypesSchema = exports.availableInputTypesSchema = _zod.z.object({ credentials: _zod.z.object({ username: _zod.z.boolean().optional(), password: _zod.z.boolean().optional() @@ -18819,56 +16930,7 @@ const availableInputTypesSchema = _zod.z.object({ email: _zod.z.boolean().optional(), credentialsProviderStatus: _zod.z.union([_zod.z.literal("locked"), _zod.z.literal("unlocked")]).optional() }); - -exports.availableInputTypesSchema = availableInputTypesSchema; - -const getAutofillInitDataResponseSchema = _zod.z.object({ - type: _zod.z.literal("getAutofillInitDataResponse").optional(), - success: _zod.z.object({ - credentials: _zod.z.array(credentialsSchema), - identities: _zod.z.array(_zod.z.record(_zod.z.unknown())), - creditCards: _zod.z.array(_zod.z.record(_zod.z.unknown())), - serializedInputContext: _zod.z.string() - }).optional(), - error: genericErrorSchema.optional() -}); - -exports.getAutofillInitDataResponseSchema = getAutofillInitDataResponseSchema; - -const getAutofillCredentialsParamsSchema = _zod.z.object({ - id: _zod.z.string() -}); - -exports.getAutofillCredentialsParamsSchema = getAutofillCredentialsParamsSchema; - -const getAutofillCredentialsResultSchema = _zod.z.object({ - type: _zod.z.literal("getAutofillCredentialsResponse").optional(), - success: _zod.z.object({ - id: _zod.z.string().optional(), - autogenerated: _zod.z.boolean().optional(), - username: _zod.z.string(), - password: _zod.z.string().optional() - }).optional(), - error: genericErrorSchema.optional() -}); - -exports.getAutofillCredentialsResultSchema = getAutofillCredentialsResultSchema; - -const setSizeParamsSchema = _zod.z.object({ - height: _zod.z.number(), - width: _zod.z.number() -}); - -exports.setSizeParamsSchema = setSizeParamsSchema; - -const selectedDetailParamsSchema = _zod.z.object({ - data: _zod.z.record(_zod.z.unknown()), - configType: _zod.z.string() -}); - -exports.selectedDetailParamsSchema = selectedDetailParamsSchema; - -const availableInputTypes1Schema = _zod.z.object({ +const availableInputTypes1Schema = exports.availableInputTypes1Schema = _zod.z.object({ credentials: _zod.z.object({ username: _zod.z.boolean().optional(), password: _zod.z.boolean().optional() @@ -18895,29 +16957,11 @@ const availableInputTypes1Schema = _zod.z.object({ expirationMonth: _zod.z.boolean().optional(), expirationYear: _zod.z.boolean().optional(), cardNumber: _zod.z.boolean().optional() - }).optional(), - email: _zod.z.boolean().optional(), - credentialsProviderStatus: _zod.z.union([_zod.z.literal("locked"), _zod.z.literal("unlocked")]).optional() -}); - -exports.availableInputTypes1Schema = availableInputTypes1Schema; - -const setIncontextSignupPermanentlyDismissedAtSchema = _zod.z.object({ - value: _zod.z.number().optional() -}); - -exports.setIncontextSignupPermanentlyDismissedAtSchema = setIncontextSignupPermanentlyDismissedAtSchema; - -const getIncontextSignupDismissedAtSchema = _zod.z.object({ - success: _zod.z.object({ - permanentlyDismissedAt: _zod.z.number().optional(), - isInstalledRecently: _zod.z.boolean().optional() - }) + }).optional(), + email: _zod.z.boolean().optional(), + credentialsProviderStatus: _zod.z.union([_zod.z.literal("locked"), _zod.z.literal("unlocked")]).optional() }); - -exports.getIncontextSignupDismissedAtSchema = getIncontextSignupDismissedAtSchema; - -const autofillFeatureTogglesSchema = _zod.z.object({ +const autofillFeatureTogglesSchema = exports.autofillFeatureTogglesSchema = _zod.z.object({ inputType_credentials: _zod.z.boolean().optional(), inputType_identities: _zod.z.boolean().optional(), inputType_creditCards: _zod.z.boolean().optional(), @@ -18928,41 +16972,60 @@ const autofillFeatureTogglesSchema = _zod.z.object({ inlineIcon_credentials: _zod.z.boolean().optional(), third_party_credentials_provider: _zod.z.boolean().optional() }); - -exports.autofillFeatureTogglesSchema = autofillFeatureTogglesSchema; - -const getAliasParamsSchema = _zod.z.object({ - requiresUserPermission: _zod.z.boolean(), - shouldConsumeAliasIfProvided: _zod.z.boolean(), - isIncontextSignupAvailable: _zod.z.boolean().optional() +const getAutofillDataRequestSchema = exports.getAutofillDataRequestSchema = _zod.z.object({ + generatedPassword: generatedPasswordSchema.optional(), + inputType: _zod.z.string(), + mainType: _zod.z.union([_zod.z.literal("credentials"), _zod.z.literal("identities"), _zod.z.literal("creditCards")]), + subType: _zod.z.string(), + trigger: _zod.z.union([_zod.z.literal("userInitiated"), _zod.z.literal("autoprompt"), _zod.z.literal("postSignup")]).optional(), + serializedInputContext: _zod.z.string().optional(), + triggerContext: triggerContextSchema.optional() }); - -exports.getAliasParamsSchema = getAliasParamsSchema; - -const getAliasResultSchema = _zod.z.object({ +const getAutofillDataResponseSchema = exports.getAutofillDataResponseSchema = _zod.z.object({ + type: _zod.z.literal("getAutofillDataResponse").optional(), success: _zod.z.object({ - alias: _zod.z.string().optional() - }) + credentials: credentialsSchema.optional(), + action: _zod.z.union([_zod.z.literal("fill"), _zod.z.literal("focus"), _zod.z.literal("none"), _zod.z.literal("acceptGeneratedPassword"), _zod.z.literal("rejectGeneratedPassword")]) + }).optional(), + error: genericErrorSchema.optional() }); - -exports.getAliasResultSchema = getAliasResultSchema; - -const emailProtectionStoreUserDataParamsSchema = _zod.z.object({ - token: _zod.z.string(), - userName: _zod.z.string(), - cohort: _zod.z.string() +const storeFormDataSchema = exports.storeFormDataSchema = _zod.z.object({ + credentials: outgoingCredentialsSchema.optional(), + trigger: _zod.z.union([_zod.z.literal("formSubmission"), _zod.z.literal("passwordGeneration"), _zod.z.literal("emailProtection")]).optional() }); - -exports.emailProtectionStoreUserDataParamsSchema = emailProtectionStoreUserDataParamsSchema; - -const emailProtectionGetIsLoggedInResultSchema = _zod.z.object({ +const getAvailableInputTypesResultSchema = exports.getAvailableInputTypesResultSchema = _zod.z.object({ + type: _zod.z.literal("getAvailableInputTypesResponse").optional(), + success: availableInputTypesSchema, + error: genericErrorSchema.optional() +}); +const getAutofillInitDataResponseSchema = exports.getAutofillInitDataResponseSchema = _zod.z.object({ + type: _zod.z.literal("getAutofillInitDataResponse").optional(), + success: _zod.z.object({ + credentials: _zod.z.array(credentialsSchema), + identities: _zod.z.array(_zod.z.record(_zod.z.unknown())), + creditCards: _zod.z.array(_zod.z.record(_zod.z.unknown())), + serializedInputContext: _zod.z.string() + }).optional(), + error: genericErrorSchema.optional() +}); +const getAutofillCredentialsResultSchema = exports.getAutofillCredentialsResultSchema = _zod.z.object({ + type: _zod.z.literal("getAutofillCredentialsResponse").optional(), + success: _zod.z.object({ + id: _zod.z.string().optional(), + autogenerated: _zod.z.boolean().optional(), + username: _zod.z.string(), + password: _zod.z.string().optional() + }).optional(), + error: genericErrorSchema.optional() +}); +const autofillSettingsSchema = exports.autofillSettingsSchema = _zod.z.object({ + featureToggles: autofillFeatureTogglesSchema +}); +const emailProtectionGetIsLoggedInResultSchema = exports.emailProtectionGetIsLoggedInResultSchema = _zod.z.object({ success: _zod.z.boolean().optional(), error: genericErrorSchema.optional() }); - -exports.emailProtectionGetIsLoggedInResultSchema = emailProtectionGetIsLoggedInResultSchema; - -const emailProtectionGetUserDataResultSchema = _zod.z.object({ +const emailProtectionGetUserDataResultSchema = exports.emailProtectionGetUserDataResultSchema = _zod.z.object({ success: _zod.z.object({ userName: _zod.z.string(), nextAlias: _zod.z.string(), @@ -18970,10 +17033,7 @@ const emailProtectionGetUserDataResultSchema = _zod.z.object({ }).optional(), error: genericErrorSchema.optional() }); - -exports.emailProtectionGetUserDataResultSchema = emailProtectionGetUserDataResultSchema; - -const emailProtectionGetCapabilitiesResultSchema = _zod.z.object({ +const emailProtectionGetCapabilitiesResultSchema = exports.emailProtectionGetCapabilitiesResultSchema = _zod.z.object({ success: _zod.z.object({ addUserData: _zod.z.boolean().optional(), getUserData: _zod.z.boolean().optional(), @@ -18981,114 +17041,46 @@ const emailProtectionGetCapabilitiesResultSchema = _zod.z.object({ }).optional(), error: genericErrorSchema.optional() }); - -exports.emailProtectionGetCapabilitiesResultSchema = emailProtectionGetCapabilitiesResultSchema; - -const emailProtectionGetAddressesResultSchema = _zod.z.object({ +const emailProtectionGetAddressesResultSchema = exports.emailProtectionGetAddressesResultSchema = _zod.z.object({ success: _zod.z.object({ personalAddress: _zod.z.string(), privateAddress: _zod.z.string() }).optional(), error: genericErrorSchema.optional() }); - -exports.emailProtectionGetAddressesResultSchema = emailProtectionGetAddressesResultSchema; - -const emailProtectionRefreshPrivateAddressResultSchema = _zod.z.object({ +const emailProtectionRefreshPrivateAddressResultSchema = exports.emailProtectionRefreshPrivateAddressResultSchema = _zod.z.object({ success: _zod.z.object({ personalAddress: _zod.z.string(), privateAddress: _zod.z.string() }).optional(), error: genericErrorSchema.optional() }); - -exports.emailProtectionRefreshPrivateAddressResultSchema = emailProtectionRefreshPrivateAddressResultSchema; - -const getAutofillDataRequestSchema = _zod.z.object({ - generatedPassword: generatedPasswordSchema.optional(), - inputType: _zod.z.string(), - mainType: _zod.z.union([_zod.z.literal("credentials"), _zod.z.literal("identities"), _zod.z.literal("creditCards")]), - subType: _zod.z.string(), - trigger: _zod.z.union([_zod.z.literal("userInitiated"), _zod.z.literal("autoprompt"), _zod.z.literal("postSignup")]).optional(), - serializedInputContext: _zod.z.string().optional(), - triggerContext: triggerContextSchema.optional() -}); - -exports.getAutofillDataRequestSchema = getAutofillDataRequestSchema; - -const getAutofillDataResponseSchema = _zod.z.object({ - type: _zod.z.literal("getAutofillDataResponse").optional(), - success: _zod.z.object({ - credentials: credentialsSchema.optional(), - action: _zod.z.union([_zod.z.literal("fill"), _zod.z.literal("focus"), _zod.z.literal("none"), _zod.z.literal("acceptGeneratedPassword"), _zod.z.literal("rejectGeneratedPassword")]) - }).optional(), - error: genericErrorSchema.optional() -}); - -exports.getAutofillDataResponseSchema = getAutofillDataResponseSchema; - -const runtimeConfigurationSchema = _zod.z.object({ +const runtimeConfigurationSchema = exports.runtimeConfigurationSchema = _zod.z.object({ contentScope: contentScopeSchema, userUnprotectedDomains: _zod.z.array(_zod.z.string()), userPreferences: userPreferencesSchema }); - -exports.runtimeConfigurationSchema = runtimeConfigurationSchema; - -const storeFormDataSchema = _zod.z.object({ - credentials: outgoingCredentialsSchema.optional(), - trigger: _zod.z.union([_zod.z.literal("formSubmission"), _zod.z.literal("passwordGeneration"), _zod.z.literal("emailProtection")]).optional() -}); - -exports.storeFormDataSchema = storeFormDataSchema; - -const getAvailableInputTypesResultSchema = _zod.z.object({ - type: _zod.z.literal("getAvailableInputTypesResponse").optional(), - success: availableInputTypesSchema, - error: genericErrorSchema.optional() -}); - -exports.getAvailableInputTypesResultSchema = getAvailableInputTypesResultSchema; - -const providerStatusUpdatedSchema = _zod.z.object({ +const providerStatusUpdatedSchema = exports.providerStatusUpdatedSchema = _zod.z.object({ status: _zod.z.union([_zod.z.literal("locked"), _zod.z.literal("unlocked")]), credentials: _zod.z.array(credentialsSchema), availableInputTypes: availableInputTypes1Schema }); - -exports.providerStatusUpdatedSchema = providerStatusUpdatedSchema; - -const checkCredentialsProviderStatusResultSchema = _zod.z.object({ - type: _zod.z.literal("checkCredentialsProviderStatusResponse").optional(), - success: providerStatusUpdatedSchema, - error: genericErrorSchema.optional() -}); - -exports.checkCredentialsProviderStatusResultSchema = checkCredentialsProviderStatusResultSchema; - -const autofillSettingsSchema = _zod.z.object({ - featureToggles: autofillFeatureTogglesSchema -}); - -exports.autofillSettingsSchema = autofillSettingsSchema; - -const getRuntimeConfigurationResponseSchema = _zod.z.object({ +const getRuntimeConfigurationResponseSchema = exports.getRuntimeConfigurationResponseSchema = _zod.z.object({ type: _zod.z.literal("getRuntimeConfigurationResponse").optional(), success: runtimeConfigurationSchema.optional(), error: genericErrorSchema.optional() }); - -exports.getRuntimeConfigurationResponseSchema = getRuntimeConfigurationResponseSchema; - -const askToUnlockProviderResultSchema = _zod.z.object({ +const askToUnlockProviderResultSchema = exports.askToUnlockProviderResultSchema = _zod.z.object({ type: _zod.z.literal("askToUnlockProviderResponse").optional(), success: providerStatusUpdatedSchema, error: genericErrorSchema.optional() }); - -exports.askToUnlockProviderResultSchema = askToUnlockProviderResultSchema; - -const apiSchema = _zod.z.object({ +const checkCredentialsProviderStatusResultSchema = exports.checkCredentialsProviderStatusResultSchema = _zod.z.object({ + type: _zod.z.literal("checkCredentialsProviderStatusResponse").optional(), + success: providerStatusUpdatedSchema, + error: genericErrorSchema.optional() +}); +const apiSchema = exports.apiSchema = _zod.z.object({ addDebugFlag: _zod.z.record(_zod.z.unknown()).and(_zod.z.object({ paramsValidator: addDebugFlagParamsSchema.optional() })).optional(), @@ -19183,82 +17175,54 @@ const apiSchema = _zod.z.object({ closeEmailProtectionTab: _zod.z.record(_zod.z.unknown()).optional() }); -exports.apiSchema = apiSchema; - -},{"zod":8}],65:[function(require,module,exports){ +},{"zod":9}],67:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.GetAlias = void 0; - var _index = require("../../packages/device-api/index.js"); - var _validatorsZod = require("./__generated__/validators.zod.js"); - -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - /** * @extends {DeviceApiCall} */ class GetAlias extends _index.DeviceApiCall { - constructor() { - super(...arguments); - - _defineProperty(this, "method", 'emailHandlerGetAlias'); - - _defineProperty(this, "id", 'n/a'); - - _defineProperty(this, "paramsValidator", _validatorsZod.getAliasParamsSchema); - - _defineProperty(this, "resultValidator", _validatorsZod.getAliasResultSchema); - } - + method = 'emailHandlerGetAlias'; + id = 'n/a'; + paramsValidator = _validatorsZod.getAliasParamsSchema; + resultValidator = _validatorsZod.getAliasResultSchema; preResultValidation(response) { // convert to the correct format, because this is a legacy API return { success: response }; } - } - exports.GetAlias = GetAlias; -},{"../../packages/device-api/index.js":10,"./__generated__/validators.zod.js":64}],66:[function(require,module,exports){ +},{"../../packages/device-api/index.js":12,"./__generated__/validators.zod.js":66}],68:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.AndroidTransport = void 0; - var _index = require("../../../packages/device-api/index.js"); - var _deviceApiCalls = require("../__generated__/deviceApiCalls.js"); - -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - class AndroidTransport extends _index.DeviceApiTransport { /** @type {GlobalConfig} */ + config; /** @param {GlobalConfig} globalConfig */ constructor(globalConfig) { super(); - - _defineProperty(this, "config", void 0); - this.config = globalConfig; - if (this.config.isDDGTestMode) { - var _window$BrowserAutofi, _window$BrowserAutofi2; - - if (typeof ((_window$BrowserAutofi = window.BrowserAutofill) === null || _window$BrowserAutofi === void 0 ? void 0 : _window$BrowserAutofi.getAutofillData) !== 'function') { + if (typeof window.BrowserAutofill?.getAutofillData !== 'function') { console.warn('window.BrowserAutofill.getAutofillData missing'); } - - if (typeof ((_window$BrowserAutofi2 = window.BrowserAutofill) === null || _window$BrowserAutofi2 === void 0 ? void 0 : _window$BrowserAutofi2.storeFormData) !== 'function') { + if (typeof window.BrowserAutofill?.storeFormData !== 'function') { console.warn('window.BrowserAutofill.storeFormData missing'); } } @@ -19267,39 +17231,30 @@ class AndroidTransport extends _index.DeviceApiTransport { * @param {import("../../../packages/device-api").DeviceApiCall} deviceApiCall * @returns {Promise} */ - - async send(deviceApiCall) { if (deviceApiCall instanceof _deviceApiCalls.GetRuntimeConfigurationCall) { return androidSpecificRuntimeConfiguration(this.config); } - if (deviceApiCall instanceof _deviceApiCalls.GetAvailableInputTypesCall) { return androidSpecificAvailableInputTypes(this.config); } - if (deviceApiCall instanceof _deviceApiCalls.GetAutofillDataCall) { window.BrowserAutofill.getAutofillData(JSON.stringify(deviceApiCall.params)); return waitForResponse(deviceApiCall.id, this.config); } - if (deviceApiCall instanceof _deviceApiCalls.StoreFormDataCall) { return window.BrowserAutofill.storeFormData(JSON.stringify(deviceApiCall.params)); } - throw new Error('android: not implemented: ' + deviceApiCall.method); } - } + /** * @param {string} expectedResponse - the name/id of the response * @param {GlobalConfig} config * @returns {Promise<*>} */ - - exports.AndroidTransport = AndroidTransport; - function waitForResponse(expectedResponse, config) { return new Promise(resolve => { const handler = e => { @@ -19308,53 +17263,43 @@ function waitForResponse(expectedResponse, config) { return; } } - if (!e.data) { return; } - if (typeof e.data !== 'string') { if (config.isDDGTestMode) { console.log('❌ event.data was not a string. Expected a string so that it can be JSON parsed'); } - return; } - try { let data = JSON.parse(e.data); - if (data.type === expectedResponse) { window.removeEventListener('message', handler); return resolve(data); } - if (config.isDDGTestMode) { - console.log("\u274C event.data.type was '".concat(data.type, "', which didnt match '").concat(expectedResponse, "'"), JSON.stringify(data)); + console.log(`❌ event.data.type was '${data.type}', which didnt match '${expectedResponse}'`, JSON.stringify(data)); } } catch (e) { window.removeEventListener('message', handler); - if (config.isDDGTestMode) { console.log('❌ Could not JSON.parse the response'); } } }; - window.addEventListener('message', handler); }); } + /** * @param {GlobalConfig} globalConfig * @returns {{success: import('../__generated__/validators-ts').RuntimeConfiguration}} */ - - function androidSpecificRuntimeConfiguration(globalConfig) { if (!globalConfig.userPreferences) { throw new Error('globalConfig.userPreferences not supported yet on Android'); } - return { success: { // @ts-ignore @@ -19368,36 +17313,30 @@ function androidSpecificRuntimeConfiguration(globalConfig) { } }; } + /** * @param {GlobalConfig} globalConfig * @returns {{success: import('../__generated__/validators-ts').AvailableInputTypes}} */ - - function androidSpecificAvailableInputTypes(globalConfig) { if (!globalConfig.availableInputTypes) { throw new Error('globalConfig.availableInputTypes not supported yet on Android'); } - return { success: globalConfig.availableInputTypes }; } -},{"../../../packages/device-api/index.js":10,"../__generated__/deviceApiCalls.js":63}],67:[function(require,module,exports){ +},{"../../../packages/device-api/index.js":12,"../__generated__/deviceApiCalls.js":65}],69:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.AppleTransport = void 0; - var _messaging = require("../../../packages/messaging/messaging.js"); - var _index = require("../../../packages/device-api/index.js"); - var _deviceApiCalls = require("../__generated__/deviceApiCalls.js"); - class AppleTransport extends _index.DeviceApiTransport { /** @param {GlobalConfig} globalConfig */ constructor(globalConfig) { @@ -19410,7 +17349,6 @@ class AppleTransport extends _index.DeviceApiTransport { }); this.messaging = new _messaging.Messaging(webkitConfig); } - async send(deviceApiCall) { try { // if the call has an `id`, it means that it expects a response @@ -19424,27 +17362,22 @@ class AppleTransport extends _index.DeviceApiTransport { if (this.config.isDDGTestMode) { console.log('MissingWebkitHandler error for:', deviceApiCall.method); } - if (deviceApiCall instanceof _deviceApiCalls.GetRuntimeConfigurationCall) { return deviceApiCall.result(appleSpecificRuntimeConfiguration(this.config)); } - throw new Error('unimplemented handler: ' + deviceApiCall.method); } else { throw e; } } } - } + /** * @param {GlobalConfig} globalConfig * @returns {ReturnType} */ - - exports.AppleTransport = AppleTransport; - function appleSpecificRuntimeConfiguration(globalConfig) { return { success: { @@ -19460,74 +17393,58 @@ function appleSpecificRuntimeConfiguration(globalConfig) { }; } -},{"../../../packages/device-api/index.js":10,"../../../packages/messaging/messaging.js":13,"../__generated__/deviceApiCalls.js":63}],68:[function(require,module,exports){ +},{"../../../packages/device-api/index.js":12,"../../../packages/messaging/messaging.js":15,"../__generated__/deviceApiCalls.js":65}],70:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ExtensionTransport = void 0; - var _index = require("../../../packages/device-api/index.js"); - var _deviceApiCalls = require("../__generated__/deviceApiCalls.js"); - var _autofillUtils = require("../../autofill-utils.js"); - var _Settings = require("../../Settings.js"); - class ExtensionTransport extends _index.DeviceApiTransport { /** @param {GlobalConfig} globalConfig */ constructor(globalConfig) { super(); this.config = globalConfig; } - async send(deviceApiCall) { if (deviceApiCall instanceof _deviceApiCalls.GetRuntimeConfigurationCall) { return deviceApiCall.result(await extensionSpecificRuntimeConfiguration(this)); } - if (deviceApiCall instanceof _deviceApiCalls.GetAvailableInputTypesCall) { return deviceApiCall.result(await extensionSpecificGetAvailableInputTypes()); } - if (deviceApiCall instanceof _deviceApiCalls.SetIncontextSignupPermanentlyDismissedAtCall) { return deviceApiCall.result(await extensionSpecificSetIncontextSignupPermanentlyDismissedAtCall(deviceApiCall.params)); } - if (deviceApiCall instanceof _deviceApiCalls.GetIncontextSignupDismissedAtCall) { return deviceApiCall.result(await extensionSpecificGetIncontextSignupDismissedAt()); - } // TODO: unify all calls to use deviceApiCall.method instead of all these if blocks - + } + // TODO: unify all calls to use deviceApiCall.method instead of all these if blocks if (deviceApiCall instanceof _deviceApiCalls.SendJSPixelCall) { return deviceApiCall.result(await extensionSpecificSendPixel(deviceApiCall.params)); } - if (deviceApiCall instanceof _deviceApiCalls.AddDebugFlagCall) { return deviceApiCall.result(await extensionSpecificAddDebugFlag(deviceApiCall.params)); } - if (deviceApiCall instanceof _deviceApiCalls.CloseAutofillParentCall || deviceApiCall instanceof _deviceApiCalls.StartEmailProtectionSignupCall) { return; // noop } console.error('Send not implemented for ' + deviceApiCall.method); } - } + /** * @param {ExtensionTransport} deviceApi * @returns {Promise>} */ - - exports.ExtensionTransport = ExtensionTransport; - async function extensionSpecificRuntimeConfiguration(deviceApi) { - var _deviceApi$config; - const contentScope = await getContentScopeConfig(); const emailProtectionEnabled = (0, _autofillUtils.isAutofillEnabledFromProcessedConfig)(contentScope); const incontextSignupEnabled = (0, _autofillUtils.isIncontextSignupEnabledFromProcessedConfig)(contentScope); @@ -19540,7 +17457,8 @@ async function extensionSpecificRuntimeConfiguration(deviceApi) { features: { autofill: { settings: { - featureToggles: { ..._Settings.Settings.defaults.featureToggles, + featureToggles: { + ..._Settings.Settings.defaults.featureToggles, emailProtection: emailProtectionEnabled, emailProtection_incontext_signup: incontextSignupEnabled } @@ -19549,21 +17467,20 @@ async function extensionSpecificRuntimeConfiguration(deviceApi) { } }, // @ts-ignore - userUnprotectedDomains: (_deviceApi$config = deviceApi.config) === null || _deviceApi$config === void 0 ? void 0 : _deviceApi$config.userUnprotectedDomains + userUnprotectedDomains: deviceApi.config?.userUnprotectedDomains } }; } - async function extensionSpecificGetAvailableInputTypes() { const contentScope = await getContentScopeConfig(); const emailProtectionEnabled = (0, _autofillUtils.isAutofillEnabledFromProcessedConfig)(contentScope); return { - success: { ..._Settings.Settings.defaults.availableInputTypes, + success: { + ..._Settings.Settings.defaults.availableInputTypes, email: emailProtectionEnabled } }; } - async function getContentScopeConfig() { return new Promise(resolve => { chrome.runtime.sendMessage({ @@ -19576,11 +17493,10 @@ async function getContentScopeConfig() { }); }); } + /** * @param {import('../__generated__/validators-ts').SendJSPixelParams} params */ - - async function extensionSpecificSendPixel(params) { return new Promise(resolve => { chrome.runtime.sendMessage({ @@ -19591,11 +17507,10 @@ async function extensionSpecificSendPixel(params) { }); }); } + /** * @param {import('../__generated__/validators-ts').AddDebugFlagParams} params */ - - async function extensionSpecificAddDebugFlag(params) { return new Promise(resolve => { chrome.runtime.sendMessage({ @@ -19606,7 +17521,6 @@ async function extensionSpecificAddDebugFlag(params) { }); }); } - async function extensionSpecificGetIncontextSignupDismissedAt() { return new Promise(resolve => { chrome.runtime.sendMessage({ @@ -19616,11 +17530,10 @@ async function extensionSpecificGetIncontextSignupDismissedAt() { }); }); } + /** * @param {import('../__generated__/validators-ts').SetIncontextSignupPermanentlyDismissedAt} params */ - - async function extensionSpecificSetIncontextSignupPermanentlyDismissedAtCall(params) { return new Promise(resolve => { chrome.runtime.sendMessage({ @@ -19632,70 +17545,58 @@ async function extensionSpecificSetIncontextSignupPermanentlyDismissedAtCall(par }); } -},{"../../../packages/device-api/index.js":10,"../../Settings.js":48,"../../autofill-utils.js":59,"../__generated__/deviceApiCalls.js":63}],69:[function(require,module,exports){ +},{"../../../packages/device-api/index.js":12,"../../Settings.js":50,"../../autofill-utils.js":61,"../__generated__/deviceApiCalls.js":65}],71:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.createTransport = createTransport; - var _appleTransport = require("./apple.transport.js"); - var _androidTransport = require("./android.transport.js"); - var _extensionTransport = require("./extension.transport.js"); - var _windowsTransport = require("./windows.transport.js"); - /** * @param {GlobalConfig} globalConfig * @returns {import("../../../packages/device-api").DeviceApiTransport} */ -function createTransport(globalConfig) { - var _globalConfig$userPre, _globalConfig$userPre2, _globalConfig$userPre3, _globalConfig$userPre4; - if (typeof ((_globalConfig$userPre = globalConfig.userPreferences) === null || _globalConfig$userPre === void 0 ? void 0 : (_globalConfig$userPre2 = _globalConfig$userPre.platform) === null || _globalConfig$userPre2 === void 0 ? void 0 : _globalConfig$userPre2.name) === 'string') { - switch ((_globalConfig$userPre3 = globalConfig.userPreferences) === null || _globalConfig$userPre3 === void 0 ? void 0 : (_globalConfig$userPre4 = _globalConfig$userPre3.platform) === null || _globalConfig$userPre4 === void 0 ? void 0 : _globalConfig$userPre4.name) { +function createTransport(globalConfig) { + if (typeof globalConfig.userPreferences?.platform?.name === 'string') { + switch (globalConfig.userPreferences?.platform?.name) { case 'ios': case 'macos': return new _appleTransport.AppleTransport(globalConfig); - case 'android': return new _androidTransport.AndroidTransport(globalConfig); - default: throw new Error('selectSender unimplemented!'); } } - if (globalConfig.isWindows) { return new _windowsTransport.WindowsTransport(); - } // fallback for when `globalConfig.userPreferences.platform.name` is absent - + } + // fallback for when `globalConfig.userPreferences.platform.name` is absent if (globalConfig.isDDGApp) { if (globalConfig.isAndroid) { return new _androidTransport.AndroidTransport(globalConfig); } - throw new Error('unreachable, createTransport'); - } // falls back to extension... is this still the best way to determine this? - + } + // falls back to extension... is this still the best way to determine this? return new _extensionTransport.ExtensionTransport(globalConfig); } -},{"./android.transport.js":66,"./apple.transport.js":67,"./extension.transport.js":68,"./windows.transport.js":70}],70:[function(require,module,exports){ +},{"./android.transport.js":68,"./apple.transport.js":69,"./extension.transport.js":70,"./windows.transport.js":72}],72:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.WindowsTransport = void 0; - var _index = require("../../../packages/device-api/index.js"); - /** * @typedef {import('../../../packages/device-api/lib/device-api').CallOptions} CallOptions * @typedef {import("../../../packages/device-api").DeviceApiCall} DeviceApiCall @@ -19705,19 +17606,15 @@ class WindowsTransport extends _index.DeviceApiTransport { if (deviceApiCall.id) { return windowsTransport(deviceApiCall, options).withResponse(deviceApiCall.id); } - return windowsTransport(deviceApiCall, options); } - } + /** * @param {DeviceApiCall} deviceApiCall * @param {CallOptions} [options] */ - - exports.WindowsTransport = WindowsTransport; - function windowsTransport(deviceApiCall, options) { windowsInteropPostMessage({ Feature: 'Autofill', @@ -19733,7 +17630,6 @@ function windowsTransport(deviceApiCall, options) { withResponse(responseId) { return waitForWindowsResponse(responseId, options); } - }; } /** @@ -19741,59 +17637,50 @@ function windowsTransport(deviceApiCall, options) { * @param {CallOptions} [options] * @returns {Promise} */ - - function waitForWindowsResponse(responseId, options) { return new Promise((resolve, reject) => { - var _options$signal, _options$signal2; - // if already aborted, reject immediately - if (options !== null && options !== void 0 && (_options$signal = options.signal) !== null && _options$signal !== void 0 && _options$signal.aborted) { + if (options?.signal?.aborted) { return reject(new DOMException('Aborted', 'AbortError')); } + let teardown; - let teardown; // The event handler - + // The event handler const handler = event => { // console.log(`📩 windows, ${window.location.href}`, [event.origin, JSON.stringify(event.data)]) if (!event.data) { console.warn('data absent from message'); return; } - if (event.data.type === responseId) { teardown(); resolve(event.data); } - }; // what to do if this promise is aborted - + }; + // what to do if this promise is aborted const abortHandler = () => { teardown(); reject(new DOMException('Aborted', 'AbortError')); - }; // setup - + }; + // setup windowsInteropAddEventListener('message', handler); - options === null || options === void 0 ? void 0 : (_options$signal2 = options.signal) === null || _options$signal2 === void 0 ? void 0 : _options$signal2.addEventListener('abort', abortHandler); - + options?.signal?.addEventListener('abort', abortHandler); teardown = () => { - var _options$signal3; - windowsInteropRemoveEventListener('message', handler); - options === null || options === void 0 ? void 0 : (_options$signal3 = options.signal) === null || _options$signal3 === void 0 ? void 0 : _options$signal3.removeEventListener('abort', abortHandler); + options?.signal?.removeEventListener('abort', abortHandler); }; }); } -},{"../../../packages/device-api/index.js":10}],71:[function(require,module,exports){ +},{"../../../packages/device-api/index.js":12}],73:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; - /*! * Copyright 2015 Google Inc. All rights reserved. * @@ -19809,15 +17696,14 @@ exports.default = void 0; * or implied. See the License for the specific language governing * permissions and limitations under the License. */ - /* * @see https://developers.google.com/web/updates/2015/08/using-requestidlecallback */ // @ts-ignore window.requestIdleCallback = window.requestIdleCallback || function (cb) { return setTimeout(function () { - const start = Date.now(); // eslint-disable-next-line standard/no-callback-literal - + const start = Date.now(); + // eslint-disable-next-line standard/no-callback-literal cb({ didTimeout: false, timeRemaining: function () { @@ -19826,12 +17712,9 @@ window.requestIdleCallback = window.requestIdleCallback || function (cb) { }); }, 1); }; - window.cancelIdleCallback = window.cancelIdleCallback || function (id) { clearTimeout(id); }; +var _default = exports.default = {}; -var _default = {}; -exports.default = _default; - -},{}]},{},[60]); +},{}]},{},[62]); diff --git a/dist/autofill.js b/dist/autofill.js index 591e41063..2371f2b2b 100644 --- a/dist/autofill.js +++ b/dist/autofill.js @@ -5,7 +5,6 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.processConfig = processConfig; - function getTopLevelURL() { try { // FROM: https://stackoverflow.com/a/7739035/73479 @@ -19,20 +18,18 @@ function getTopLevelURL() { return new URL(location.href); } } - function isUnprotectedDomain(topLevelUrl, featureList) { let unprotectedDomain = false; - const domainParts = topLevelUrl && topLevelUrl.host ? topLevelUrl.host.split('.') : []; // walk up the domain to see if it's unprotected + const domainParts = topLevelUrl && topLevelUrl.host ? topLevelUrl.host.split('.') : []; + // walk up the domain to see if it's unprotected while (domainParts.length > 1 && !unprotectedDomain) { const partialDomain = domainParts.join('.'); unprotectedDomain = featureList.filter(domain => domain.domain === partialDomain).length > 0; domainParts.shift(); } - return unprotectedDomain; } - function processConfig(data, userList, preferences) { const topLevelUrl = getTopLevelURL(); const allowlisted = userList.filter(domain => domain === topLevelUrl.host).length > 0; @@ -46,8 +43,8 @@ function processConfig(data, userList, preferences) { isBroken, allowlisted, enabledFeatures - }; // TODO - + }; + // TODO preferences.cookie = {}; return preferences; } @@ -94,9 +91,7 @@ Object.defineProperty(exports, "validate", { return _deviceApiCall.validate; } }); - var _deviceApiCall = require("./lib/device-api-call.js"); - var _deviceApi = require("./lib/device-api.js"); },{"./lib/device-api-call.js":3,"./lib/device-api.js":4}],3:[function(require,module,exports){ @@ -110,9 +105,6 @@ exports.createDeviceApiCall = createDeviceApiCall; exports.createNotification = void 0; exports.createRequest = createRequest; exports.validate = validate; - -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - /** * This roughly follows https://www.jsonrpc.org/specification * @template {import("zod").ZodType} Params=import("zod").ZodType @@ -120,18 +112,18 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope */ class DeviceApiCall { /** @type {string} */ - + method = 'unknown'; /** * An optional 'id' - used to indicate if a request requires a response. * @type {string|null} */ - + id = null; /** @type {Params | null | undefined} */ - + paramsValidator = null; /** @type {Result | null | undefined} */ - + resultValidator = null; /** @type {import("zod").infer} */ - + params; /** * This is a carve-out for legacy messages that are not typed yet. * If you set this to 'true', then the response will not be checked to conform @@ -139,7 +131,7 @@ class DeviceApiCall { * @deprecated this is here to aid migration, should be removed ASAP * @type {boolean} */ - + throwOnResultKeysMissing = true; /** * New messages should be in a particular format, eg: { success: T }, * but you can set this to false if you want to access the result as-is, @@ -147,96 +139,67 @@ class DeviceApiCall { * @deprecated this is here to aid migration, should be removed ASAP * @type {boolean} */ - + unwrapResult = true; /** * @param {import("zod").infer} data */ constructor(data) { - _defineProperty(this, "method", 'unknown'); - - _defineProperty(this, "id", null); - - _defineProperty(this, "paramsValidator", null); - - _defineProperty(this, "resultValidator", null); - - _defineProperty(this, "params", void 0); - - _defineProperty(this, "throwOnResultKeysMissing", true); - - _defineProperty(this, "unwrapResult", true); - this.params = data; } + /** * @returns {import("zod").infer|undefined} */ - - validateParams() { if (this.params === undefined) { return undefined; } - this._validate(this.params, this.paramsValidator); - return this.params; } + /** * @param {any|null} incoming * @returns {import("zod").infer} */ - - validateResult(incoming) { this._validate(incoming, this.resultValidator); - if (!incoming) { return incoming; } - if (!this.unwrapResult) { return incoming; } - if ('data' in incoming) { console.warn('response had `data` property. Please migrate to `success`'); return incoming.data; } - if ('success' in incoming) { return incoming.success; } - if ('error' in incoming) { if (typeof incoming.error.message === 'string') { - throw new DeviceApiCallError("".concat(this.method, ": ").concat(incoming.error.message)); + throw new DeviceApiCallError(`${this.method}: ${incoming.error.message}`); } } - if (this.throwOnResultKeysMissing) { throw new Error('unreachable. Response did not contain `success` or `data`'); } - return incoming; } + /** * @param {any} data * @param {import("zod").ZodType|undefined|null} [validator] * @private */ - - _validate(data, validator) { if (!validator) return data; - if (validator) { - const result = validator === null || validator === void 0 ? void 0 : validator.safeParse(data); - + const result = validator?.safeParse(data); if (!result) { throw new Error('unreachable, data failure', data); } - if (!result.success) { if ('error' in result) { this.throwError(result.error.issues); @@ -246,15 +209,15 @@ class DeviceApiCall { } } } + /** * @param {import('zod').ZodIssue[]} errors */ - - throwError(errors) { const error = SchemaValidationError.fromZodErrors(errors, this.constructor.name); throw error; } + /** * Use this helper for creating stand-in response messages that are typed correctly. * @@ -268,38 +231,26 @@ class DeviceApiCall { * @param {import("zod").infer} response * @returns {import("zod").infer} */ - - result(response) { return response; } /** * @returns {import("zod").infer} */ - - preResultValidation(response) { return response; } - } - exports.DeviceApiCall = DeviceApiCall; - class DeviceApiCallError extends Error {} + /** * Check for this error if you'd like to */ - - exports.DeviceApiCallError = DeviceApiCallError; - class SchemaValidationError extends Error { - constructor() { - super(...arguments); - - _defineProperty(this, "validationErrors", []); - } + /** @type {import("zod").ZodIssue[]} */ + validationErrors = []; /** * @param {import("zod").ZodIssue[]} errors @@ -307,17 +258,15 @@ class SchemaValidationError extends Error { * @returns {SchemaValidationError} */ static fromZodErrors(errors, name) { - const heading = "".concat(errors.length, " SchemaValidationError(s) errors for ") + name; - + const heading = `${errors.length} SchemaValidationError(s) errors for ` + name; function log(issue) { switch (issue.code) { case 'invalid_literal': case 'invalid_type': { - console.log("".concat(name, ". Path: '").concat(issue.path.join('.'), "', Error: '").concat(issue.message, "'")); + console.log(`${name}. Path: '${issue.path.join('.')}', Error: '${issue.message}'`); break; } - case 'invalid_union': { for (let unionError of issue.unionErrors) { @@ -325,28 +274,24 @@ class SchemaValidationError extends Error { log(issue1); } } - break; } - default: { console.log(name, 'other issue:', issue); } } } - for (let error of errors) { log(error); } - const message = [heading, 'please see the details above'].join('\n '); const error = new SchemaValidationError(message); error.validationErrors = errors; return error; } - } + /** * Creates an instance of `DeviceApiCall` from only a name and 'params' * and optional validators. Use this to help migrate existing messages. @@ -359,14 +304,10 @@ class SchemaValidationError extends Error { * @param {Result|null} [resultValidator] * @returns {DeviceApiCall} */ - - exports.SchemaValidationError = SchemaValidationError; - function createDeviceApiCall(method, params) { let paramsValidator = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null; let resultValidator = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null; - /** @type {DeviceApiCall} */ const deviceApiCall = new DeviceApiCall(params); deviceApiCall.paramsValidator = paramsValidator; @@ -376,6 +317,7 @@ function createDeviceApiCall(method, params) { deviceApiCall.unwrapResult = false; return deviceApiCall; } + /** * Creates an instance of `DeviceApiCall` from only a name and 'params' * and optional validators. Use this to help migrate existing messages. @@ -392,8 +334,6 @@ function createDeviceApiCall(method, params) { * @param {Result|null} [resultValidator] * @returns {DeviceApiCall} */ - - function createRequest(method, params) { let id = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'n/a'; let paramsValidator = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null; @@ -402,8 +342,8 @@ function createRequest(method, params) { call.id = id; return call; } +const createNotification = exports.createNotification = createDeviceApiCall; -const createNotification = createDeviceApiCall; /** * Validate any arbitrary data with any Zod validator * @@ -412,16 +352,11 @@ const createNotification = createDeviceApiCall; * @param {Validator | null} [validator] * @returns {import("zod").infer} */ - -exports.createNotification = createNotification; - function validate(data) { let validator = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; - if (validator) { return validator.parse(data); } - return data; } @@ -432,9 +367,6 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.DeviceApiTransport = exports.DeviceApi = void 0; - -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - /** * Platforms should only need to implement this `send` method */ @@ -447,8 +379,8 @@ class DeviceApiTransport { async send(_deviceApiCall, _options) { return undefined; } - } + /** * This is the base Sender class that platforms can will implement. * @@ -457,17 +389,12 @@ class DeviceApiTransport { * @typedef CallOptions * @property {AbortSignal} [signal] */ - - exports.DeviceApiTransport = DeviceApiTransport; - class DeviceApi { /** @type {DeviceApiTransport} */ - + transport; /** @param {DeviceApiTransport} transport */ constructor(transport) { - _defineProperty(this, "transport", void 0); - this.transport = transport; } /** @@ -476,8 +403,6 @@ class DeviceApi { * @param {CallOptions} [options] * @returns {Promise['success']>>} */ - - async request(deviceApiCall, options) { deviceApiCall.validateParams(); let result = await this.transport.send(deviceApiCall, options); @@ -490,15 +415,11 @@ class DeviceApi { * @param {CallOptions} [options] * @returns {Promise} */ - - async notify(deviceApiCall, options) { deviceApiCall.validateParams(); return this.transport.send(deviceApiCall, options); } - } - exports.DeviceApi = DeviceApi; },{}],5:[function(require,module,exports){ @@ -514,9 +435,7 @@ Object.defineProperty(exports, "WebkitMessagingConfig", { return _webkit.WebkitMessagingConfig; } }); - var _webkit = require("./webkit.js"); - /** * @module Messaging * @@ -594,8 +513,6 @@ class Messaging { * @param {string} name * @param {Record} [data] */ - - notify(name) { let data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; this.transport.notify(name, data); @@ -615,21 +532,16 @@ class Messaging { * @param {Record} [data] * @return {Promise} */ - - request(name) { let data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; return this.transport.request(name, data); } - } + /** * @interface */ - - exports.Messaging = Messaging; - class MessagingTransport { /** * @param {string} name @@ -647,34 +559,27 @@ class MessagingTransport { * @return {Promise} */ // @ts-ignore - ignoring a no-unused ts error, this is only an interface. - - request(name) { let data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; throw new Error('must implement'); } - } + /** * @param {WebkitMessagingConfig} config * @returns {MessagingTransport} */ - - exports.MessagingTransport = MessagingTransport; - function getTransport(config) { if (config instanceof _webkit.WebkitMessagingConfig) { return new _webkit.WebkitMessagingTransport(config); } - throw new Error('unreachable'); } + /** * Thrown when a handler cannot be found */ - - class MissingHandler extends Error { /** * @param {string} message @@ -684,13 +589,11 @@ class MissingHandler extends Error { super(message); this.handlerName = handlerName; } - } + /** * Some re-exports for convenience */ - - exports.MissingHandler = MissingHandler; },{"./webkit.js":6}],6:[function(require,module,exports){ @@ -700,10 +603,37 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.WebkitMessagingTransport = exports.WebkitMessagingConfig = exports.SecureMessagingParams = void 0; - var _messaging = require("./messaging.js"); - -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } +/** + * @module Webkit Messaging + * + * @description + * + * A wrapper for messaging on WebKit platforms. It supports modern WebKit messageHandlers + * along with encryption for older versions (like macOS Catalina) + * + * Note: If you wish to support Catalina then you'll need to implement the native + * part of the message handling, see {@link WebkitMessagingTransport} for details. + * + * ```js + * import { Messaging, WebkitMessagingConfig } from "@duckduckgo/content-scope-scripts/lib/messaging.js" + * + * // This config would be injected into the UserScript + * const injectedConfig = { + * hasModernWebkitAPI: true, + * webkitMessageHandlerNames: ["foo", "bar", "baz"], + * secret: "dax", + * }; + * + * // Then use that config to construct platform-specific configuration + * const config = new WebkitMessagingConfig(injectedConfig); + * + * // finally, get an instance of Messaging and start sending messages in a unified way 🚀 + * const messaging = new Messaging(config); + * messaging.notify("hello world!", {foo: "bar"}) + * + * ``` + */ /** * @typedef {import("./messaging").MessagingTransport} MessagingTransport @@ -757,77 +687,59 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope */ class WebkitMessagingTransport { /** @type {WebkitMessagingConfig} */ - + config; + globals; /** - * @param {WebkitMessagingConfig} config - */ + * @param {WebkitMessagingConfig} config + */ constructor(config) { - _defineProperty(this, "config", void 0); - - _defineProperty(this, "globals", void 0); - - _defineProperty(this, "algoObj", { - name: 'AES-GCM', - length: 256 - }); - this.config = config; this.globals = captureGlobals(); - if (!this.config.hasModernWebkitAPI) { this.captureWebkitHandlers(this.config.webkitMessageHandlerNames); } } /** - * Sends message to the webkit layer (fire and forget) - * @param {String} handler - * @param {*} data - * @internal - */ - - + * Sends message to the webkit layer (fire and forget) + * @param {String} handler + * @param {*} data + * @internal + */ wkSend(handler) { - var _this$globals$window$, _this$globals$window$2; - let data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - if (!(handler in this.globals.window.webkit.messageHandlers)) { - throw new _messaging.MissingHandler("Missing webkit handler: '".concat(handler, "'"), handler); + throw new _messaging.MissingHandler(`Missing webkit handler: '${handler}'`, handler); } - - const outgoing = { ...data, - messageHandling: { ...data.messageHandling, + const outgoing = { + ...data, + messageHandling: { + ...data.messageHandling, secret: this.config.secret } }; - if (!this.config.hasModernWebkitAPI) { if (!(handler in this.globals.capturedWebkitHandlers)) { - throw new _messaging.MissingHandler("cannot continue, method ".concat(handler, " not captured on macos < 11"), handler); + throw new _messaging.MissingHandler(`cannot continue, method ${handler} not captured on macos < 11`, handler); } else { return this.globals.capturedWebkitHandlers[handler](outgoing); } } - - return (_this$globals$window$ = (_this$globals$window$2 = this.globals.window.webkit.messageHandlers[handler]).postMessage) === null || _this$globals$window$ === void 0 ? void 0 : _this$globals$window$.call(_this$globals$window$2, outgoing); + return this.globals.window.webkit.messageHandlers[handler].postMessage?.(outgoing); } - /** - * Sends message to the webkit layer and waits for the specified response - * @param {String} handler - * @param {*} data - * @returns {Promise<*>} - * @internal - */ - + /** + * Sends message to the webkit layer and waits for the specified response + * @param {String} handler + * @param {*} data + * @returns {Promise<*>} + * @internal + */ async wkSendAndWait(handler) { let data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - if (this.config.hasModernWebkitAPI) { const response = await this.wkSend(handler, data); return this.globals.JSONparse(response || '{}'); } - try { const randMethodName = this.createRandMethodName(); const key = await this.createRandKey(); @@ -835,9 +747,7 @@ class WebkitMessagingTransport { const { ciphertext, tag - } = await new this.globals.Promise(( - /** @type {any} */ - resolve) => { + } = await new this.globals.Promise(( /** @type {any} */resolve) => { this.generateRandomMethod(randMethodName, resolve); data.messageHandling = new SecureMessagingParams({ methodName: randMethodName, @@ -864,89 +774,81 @@ class WebkitMessagingTransport { } } /** - * @param {string} name - * @param {Record} [data] - */ - - + * @param {string} name + * @param {Record} [data] + */ notify(name) { let data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; this.wkSend(name, data); } /** - * @param {string} name - * @param {Record} [data] - */ - - + * @param {string} name + * @param {Record} [data] + */ request(name) { let data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; return this.wkSendAndWait(name, data); } /** - * Generate a random method name and adds it to the global scope - * The native layer will use this method to send the response - * @param {string | number} randomMethodName - * @param {Function} callback - */ - - + * Generate a random method name and adds it to the global scope + * The native layer will use this method to send the response + * @param {string | number} randomMethodName + * @param {Function} callback + */ generateRandomMethod(randomMethodName, callback) { var _this = this; - this.globals.ObjectDefineProperty(this.globals.window, randomMethodName, { enumerable: false, // configurable, To allow for deletion later configurable: true, writable: false, - /** * @param {any[]} args */ value: function () { - callback(...arguments); // @ts-ignore - we want this to throw if it fails as it would indicate a fatal error. - + callback(...arguments); + // @ts-ignore - we want this to throw if it fails as it would indicate a fatal error. delete _this.globals.window[randomMethodName]; } }); } - randomString() { return '' + this.globals.getRandomValues(new this.globals.Uint32Array(1))[0]; } - createRandMethodName() { return '_' + this.randomString(); } - /** - * @type {{name: string, length: number}} - */ + /** + * @type {{name: string, length: number}} + */ + algoObj = { + name: 'AES-GCM', + length: 256 + }; /** - * @returns {Promise} - */ + * @returns {Promise} + */ async createRandKey() { const key = await this.globals.generateKey(this.algoObj, true, ['encrypt', 'decrypt']); const exportedKey = await this.globals.exportKey('raw', key); return new this.globals.Uint8Array(exportedKey); } - /** - * @returns {Uint8Array} - */ - + /** + * @returns {Uint8Array} + */ createRandIv() { return this.globals.getRandomValues(new this.globals.Uint8Array(12)); } - /** - * @param {BufferSource} ciphertext - * @param {BufferSource} key - * @param {Uint8Array} iv - * @returns {Promise} - */ - + /** + * @param {BufferSource} ciphertext + * @param {BufferSource} key + * @param {Uint8Array} iv + * @returns {Promise} + */ async decrypt(ciphertext, key, iv) { const cryptoKey = await this.globals.importKey('raw', key, 'AES-GCM', false, ['decrypt']); const algo = { @@ -957,37 +859,31 @@ class WebkitMessagingTransport { let dec = new this.globals.TextDecoder(); return dec.decode(decrypted); } - /** - * When required (such as on macos 10.x), capture the `postMessage` method on - * each webkit messageHandler - * - * @param {string[]} handlerNames - */ - + /** + * When required (such as on macos 10.x), capture the `postMessage` method on + * each webkit messageHandler + * + * @param {string[]} handlerNames + */ captureWebkitHandlers(handlerNames) { const handlers = window.webkit.messageHandlers; if (!handlers) throw new _messaging.MissingHandler('window.webkit.messageHandlers was absent', 'all'); - for (let webkitMessageHandlerName of handlerNames) { - var _handlers$webkitMessa; - - if (typeof ((_handlers$webkitMessa = handlers[webkitMessageHandlerName]) === null || _handlers$webkitMessa === void 0 ? void 0 : _handlers$webkitMessa.postMessage) === 'function') { - var _handlers$webkitMessa2; - + if (typeof handlers[webkitMessageHandlerName]?.postMessage === 'function') { /** * `bind` is used here to ensure future calls to the captured * `postMessage` have the correct `this` context */ const original = handlers[webkitMessageHandlerName]; - const bound = (_handlers$webkitMessa2 = handlers[webkitMessageHandlerName].postMessage) === null || _handlers$webkitMessa2 === void 0 ? void 0 : _handlers$webkitMessa2.bind(original); + const bound = handlers[webkitMessageHandlerName].postMessage?.bind(original); this.globals.capturedWebkitHandlers[webkitMessageHandlerName] = bound; delete handlers[webkitMessageHandlerName].postMessage; } } } - } + /** * Use this configuration to create an instance of {@link Messaging} for WebKit * @@ -1004,10 +900,7 @@ class WebkitMessagingTransport { * const resp = await messaging.request("debugConfig") * ``` */ - - exports.WebkitMessagingTransport = WebkitMessagingTransport; - class WebkitMessagingConfig { /** * @param {object} params @@ -1024,25 +917,20 @@ class WebkitMessagingConfig { /** * A list of WebKit message handler names that a user script can send */ - this.webkitMessageHandlerNames = params.webkitMessageHandlerNames; /** * A string provided by native platforms to be sent with future outgoing * messages */ - this.secret = params.secret; } - } + /** * This is the additional payload that gets appended to outgoing messages. * It's used in the Swift side to encrypt the response that comes back */ - - exports.WebkitMessagingConfig = WebkitMessagingConfig; - class SecureMessagingParams { /** * @param {object} params @@ -1059,29 +947,23 @@ class SecureMessagingParams { /** * The secret used to ensure message sender validity */ - this.secret = params.secret; /** * The CipherKey as number[] */ - this.key = params.key; /** * The Initial Vector as number[] */ - this.iv = params.iv; } - } + /** * Capture some globals used for messaging handling to prevent page * scripts from tampering with this */ - - exports.SecureMessagingParams = SecureMessagingParams; - function captureGlobals() { // Creat base with null prototype return { @@ -1104,7 +986,6 @@ function captureGlobals() { Promise: window.Promise, ObjectDefineProperty: window.Object.defineProperty, addEventListener: window.addEventListener.bind(window), - /** @type {Record} */ capturedWebkitHandlers: {} }; @@ -1131,13 +1012,9 @@ Object.defineProperty(exports, "constants", { } }); exports.generate = generate; - var _applePassword = require("./lib/apple.password.js"); - var _rulesParser = require("./lib/rules-parser.js"); - var _constants = require("./lib/constants.js"); - /** * @typedef {{ * domain?: string | null | undefined; @@ -1146,7 +1023,6 @@ var _constants = require("./lib/constants.js"); * onError?: ((error: unknown) => void) | null | undefined; * }} GenerateOptions */ - /** * Generate a random password based on the following attempts * @@ -1161,16 +1037,13 @@ var _constants = require("./lib/constants.js"); */ function generate() { let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - try { - if (typeof (options === null || options === void 0 ? void 0 : options.input) === 'string') { + if (typeof options?.input === 'string') { return _applePassword.Password.generateOrThrow(options.input); } - - if (typeof (options === null || options === void 0 ? void 0 : options.domain) === 'string') { - if (options !== null && options !== void 0 && options.rules) { + if (typeof options?.domain === 'string') { + if (options?.rules) { const rules = _selectPasswordRules(options.domain, options.rules); - if (rules) { return _applePassword.Password.generateOrThrow(rules); } @@ -1178,25 +1051,25 @@ function generate() { } } catch (e) { // if an 'onError' callback was provided, forward all errors - if (options !== null && options !== void 0 && options.onError && typeof (options === null || options === void 0 ? void 0 : options.onError) === 'function') { + if (options?.onError && typeof options?.onError === 'function') { options.onError(e); } else { // otherwise, only console.error unknown errors (which could be implementation bugs) const isKnownError = e instanceof _rulesParser.ParserError || e instanceof HostnameInputError; - if (!isKnownError) { console.error(e); } } - } // At this point, we have to trust the generation will not throw - // as it is NOT using any user/page-provided data - + } + // At this point, we have to trust the generation will not throw + // as it is NOT using any user/page-provided data return _applePassword.Password.generateDefault(); -} // An extension type to differentiate between known errors - +} +// An extension type to differentiate between known errors class HostnameInputError extends Error {} + /** * @typedef {Record} RulesFormat */ @@ -1208,54 +1081,44 @@ class HostnameInputError extends Error {} * @returns {string | undefined} * @throws {HostnameInputError} */ - - exports.HostnameInputError = HostnameInputError; - function _selectPasswordRules(inputHostname, rules) { - const hostname = _safeHostname(inputHostname); // direct match - - + const hostname = _safeHostname(inputHostname); + // direct match if (rules[hostname]) { return rules[hostname]['password-rules']; - } // otherwise, start chopping off subdomains and re-joining to compare - + } + // otherwise, start chopping off subdomains and re-joining to compare const pieces = hostname.split('.'); - while (pieces.length > 1) { pieces.shift(); const joined = pieces.join('.'); - if (rules[joined]) { return rules[joined]['password-rules']; } } - return undefined; } + /** * @private * @param {string} inputHostname; * @throws {HostnameInputError} * @returns {string} */ - - function _safeHostname(inputHostname) { if (inputHostname.startsWith('http:') || inputHostname.startsWith('https:')) { throw new HostnameInputError('invalid input, you can only provide a hostname but you gave a scheme'); } - if (inputHostname.includes(':')) { throw new HostnameInputError('invalid input, you can only provide a hostname but you gave a :port'); } - try { const asUrl = new URL('https://' + inputHostname); return asUrl.hostname; } catch (e) { - throw new HostnameInputError("could not instantiate a URL from that hostname ".concat(inputHostname)); + throw new HostnameInputError(`could not instantiate a URL from that hostname ${inputHostname}`); } } @@ -1266,16 +1129,23 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.Password = void 0; - var parser = _interopRequireWildcard(require("./rules-parser.js")); - var _constants = require("./constants.js"); - function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } - function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } - -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } +/* + * + * NOTE: + * + * This file was created with inspiration from https://developer.apple.com/password-rules + * + * * The changes made by DuckDuckGo employees are: + * + * 1) removed all logic relating to 'more typeable passwords' + * 2) reduced the number of password styles from 4 to only the 1 which suits our needs + * 2) added JSDoc comments (for Typescript checking) + * + */ /** * @typedef {{ @@ -1287,7 +1157,6 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope * PasswordMaxLength?: number, * }} Requirements */ - /** * @typedef {{ * NumberOfRequiredRandomCharacters: number, @@ -1301,12 +1170,12 @@ const defaults = Object.freeze({ defaultPasswordLength: _constants.constants.DEFAULT_MIN_LENGTH, defaultPasswordRules: _constants.constants.DEFAULT_PASSWORD_RULES, defaultRequiredCharacterSets: ['abcdefghijklmnopqrstuvwxyz', 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', '0123456789'], - /** * @type {typeof window.crypto.getRandomValues | null} */ getRandomValues: null }); + /** * This is added here to ensure: * @@ -1316,37 +1185,28 @@ const defaults = Object.freeze({ * * @type {{ getRandomValues: typeof window.crypto.getRandomValues }} */ - const safeGlobals = {}; - if (typeof window !== 'undefined') { safeGlobals.getRandomValues = window.crypto.getRandomValues.bind(window.crypto); } - class Password { - /** - * @type {typeof defaults} - */ - /** * @param {Partial} [options] */ constructor() { let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - - _defineProperty(this, "options", void 0); - - this.options = { ...defaults, + /** + * @type {typeof defaults} + */ + this.options = { + ...defaults, ...options }; return this; } - /** - * This is here to provide external access to un-modified defaults - * in case they are needed for tests/verifications - * @type {typeof defaults} - */ - + static get defaults() { + return defaults; + } /** * Generates a password from the given input. @@ -1381,12 +1241,11 @@ class Password { * @param {Partial} [options] * @returns {string} */ - - static generateDefault() { let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; return new Password(options).parse(Password.defaults.defaultPasswordRules).generate(); } + /** * Convert a ruleset into it's internally-used component pieces. * @@ -1400,59 +1259,44 @@ class Password { * generate: () => string; * }} */ - - parse(inputString) { const rules = parser.parsePasswordRules(inputString); - const requirements = this._requirementsFromRules(rules); - if (!requirements) throw new Error('could not generate requirements for ' + JSON.stringify(inputString)); - const parameters = this._passwordGenerationParametersDictionary(requirements); - return { requirements, parameters, rules, - get entropy() { return Math.log2(parameters.PasswordAllowedCharacters.length ** parameters.NumberOfRequiredRandomCharacters); }, - generate: () => { const password = this._generatedPasswordMatchingRequirements(requirements, parameters); /** * The following is unreachable because if user input was incorrect then * the parsing phase would throw. The following lines is to satisfy Typescript */ - - if (password === '') throw new Error('unreachable'); return password; } }; } + /** * Given an array of `Rule's`, convert into `Requirements` * * @param {parser.Rule[]} passwordRules * @returns {Requirements | null} */ - - _requirementsFromRules(passwordRules) { /** @type {Requirements} */ const requirements = {}; - for (let rule of passwordRules) { if (rule.name === parser.RuleName.ALLOWED) { console.assert(!('PasswordAllowedCharacters' in requirements)); - const chars = this._charactersFromCharactersClasses(rule.value); - const scanSet = this._canonicalizedScanSetFromCharacters(chars); - if (scanSet) { requirements.PasswordAllowedCharacters = scanSet; } @@ -1461,108 +1305,94 @@ class Password { requirements.PasswordRepeatedCharacterLimit = rule.value; } else if (rule.name === parser.RuleName.REQUIRED) { let requiredCharacters = requirements.PasswordRequiredCharacters; - if (!requiredCharacters) { requiredCharacters = requirements.PasswordRequiredCharacters = []; } - requiredCharacters.push(this._canonicalizedScanSetFromCharacters(this._charactersFromCharactersClasses(rule.value))); } else if (rule.name === parser.RuleName.MIN_LENGTH) { requirements.PasswordMinLength = rule.value; } else if (rule.name === parser.RuleName.MAX_LENGTH) { requirements.PasswordMaxLength = rule.value; } - } // Only include an allowed rule matching SCAN_SET_ORDER (all characters) when a required rule is also present. - + } + // Only include an allowed rule matching SCAN_SET_ORDER (all characters) when a required rule is also present. if (requirements.PasswordAllowedCharacters === this.options.SCAN_SET_ORDER && !requirements.PasswordRequiredCharacters) { delete requirements.PasswordAllowedCharacters; - } // Fix up PasswordRequiredCharacters, if needed. - + } + // Fix up PasswordRequiredCharacters, if needed. if (requirements.PasswordRequiredCharacters && requirements.PasswordRequiredCharacters.length === 1 && requirements.PasswordRequiredCharacters[0] === this.options.SCAN_SET_ORDER) { delete requirements.PasswordRequiredCharacters; } - return Object.keys(requirements).length ? requirements : null; } + /** * @param {number} range * @returns {number} */ - - _randomNumberWithUniformDistribution(range) { - const getRandomValues = this.options.getRandomValues || safeGlobals.getRandomValues; // Based on the algorithm described in https://pthree.org/2018/06/13/why-the-multiply-and-floor-rng-method-is-biased/ - + const getRandomValues = this.options.getRandomValues || safeGlobals.getRandomValues; + // Based on the algorithm described in https://pthree.org/2018/06/13/why-the-multiply-and-floor-rng-method-is-biased/ const max = Math.floor(2 ** 32 / range) * range; let x; - do { x = getRandomValues(new Uint32Array(1))[0]; } while (x >= max); - return x % range; } + /** * @param {number} numberOfRequiredRandomCharacters * @param {string} allowedCharacters */ - - _classicPassword(numberOfRequiredRandomCharacters, allowedCharacters) { const length = allowedCharacters.length; const randomCharArray = Array(numberOfRequiredRandomCharacters); - for (let i = 0; i < numberOfRequiredRandomCharacters; i++) { const index = this._randomNumberWithUniformDistribution(length); - randomCharArray[i] = allowedCharacters[index]; } - return randomCharArray.join(''); } + /** * @param {string} password * @param {number} consecutiveCharLimit * @returns {boolean} */ - - _passwordHasNotExceededConsecutiveCharLimit(password, consecutiveCharLimit) { let longestConsecutiveCharLength = 1; - let firstConsecutiveCharIndex = 0; // Both "123" or "abc" and "321" or "cba" are considered consecutive. - + let firstConsecutiveCharIndex = 0; + // Both "123" or "abc" and "321" or "cba" are considered consecutive. let isSequenceAscending; - for (let i = 1; i < password.length; i++) { const currCharCode = password.charCodeAt(i); const prevCharCode = password.charCodeAt(i - 1); - if (isSequenceAscending) { // If `isSequenceAscending` is defined, then we know that we are in the middle of an existing // pattern. Check if the pattern continues based on whether the previous pattern was // ascending or descending. if (isSequenceAscending.valueOf() && currCharCode === prevCharCode + 1 || !isSequenceAscending.valueOf() && currCharCode === prevCharCode - 1) { continue; - } // Take into account the case when the sequence transitions from descending - // to ascending. - + } + // Take into account the case when the sequence transitions from descending + // to ascending. if (currCharCode === prevCharCode + 1) { firstConsecutiveCharIndex = i - 1; isSequenceAscending = Boolean(true); continue; - } // Take into account the case when the sequence transitions from ascending - // to descending. - + } + // Take into account the case when the sequence transitions from ascending + // to descending. if (currCharCode === prevCharCode - 1) { firstConsecutiveCharIndex = i - 1; isSequenceAscending = Boolean(false); continue; } - isSequenceAscending = null; } else if (currCharCode === prevCharCode + 1) { isSequenceAscending = Boolean(true); @@ -1571,192 +1401,157 @@ class Password { isSequenceAscending = Boolean(false); continue; } - const currConsecutiveCharLength = i - firstConsecutiveCharIndex; - if (currConsecutiveCharLength > longestConsecutiveCharLength) { longestConsecutiveCharLength = currConsecutiveCharLength; } - firstConsecutiveCharIndex = i; } - if (isSequenceAscending) { const currConsecutiveCharLength = password.length - firstConsecutiveCharIndex; - if (currConsecutiveCharLength > longestConsecutiveCharLength) { longestConsecutiveCharLength = currConsecutiveCharLength; } } - return longestConsecutiveCharLength <= consecutiveCharLimit; } + /** * @param {string} password * @param {number} repeatedCharLimit * @returns {boolean} */ - - _passwordHasNotExceededRepeatedCharLimit(password, repeatedCharLimit) { let longestRepeatedCharLength = 1; let lastRepeatedChar = password.charAt(0); let lastRepeatedCharIndex = 0; - for (let i = 1; i < password.length; i++) { const currChar = password.charAt(i); - if (currChar === lastRepeatedChar) { continue; } - const currRepeatedCharLength = i - lastRepeatedCharIndex; - if (currRepeatedCharLength > longestRepeatedCharLength) { longestRepeatedCharLength = currRepeatedCharLength; } - lastRepeatedChar = currChar; lastRepeatedCharIndex = i; } - return longestRepeatedCharLength <= repeatedCharLimit; } + /** * @param {string} password * @param {string[]} requiredCharacterSets * @returns {boolean} */ - - _passwordContainsRequiredCharacters(password, requiredCharacterSets) { const requiredCharacterSetsLength = requiredCharacterSets.length; const passwordLength = password.length; - for (let i = 0; i < requiredCharacterSetsLength; i++) { const requiredCharacterSet = requiredCharacterSets[i]; let hasRequiredChar = false; - for (let j = 0; j < passwordLength; j++) { const char = password.charAt(j); - if (requiredCharacterSet.indexOf(char) !== -1) { hasRequiredChar = true; break; } } - if (!hasRequiredChar) { return false; } } - return true; } + /** * @param {string} string1 * @param {string} string2 * @returns {boolean} */ - - _stringsHaveAtLeastOneCommonCharacter(string1, string2) { const string2Length = string2.length; - for (let i = 0; i < string2Length; i++) { const char = string2.charAt(i); - if (string1.indexOf(char) !== -1) { return true; } } - return false; } + /** * @param {Requirements} requirements * @returns {PasswordParameters} */ - - _passwordGenerationParametersDictionary(requirements) { let minPasswordLength = requirements.PasswordMinLength; - const maxPasswordLength = requirements.PasswordMaxLength; // @ts-ignore + const maxPasswordLength = requirements.PasswordMaxLength; + // @ts-ignore if (minPasswordLength > maxPasswordLength) { // Resetting invalid value of min length to zero means "ignore min length parameter in password generation". minPasswordLength = 0; } - const requiredCharacterArray = requirements.PasswordRequiredCharacters; let allowedCharacters = requirements.PasswordAllowedCharacters; let requiredCharacterSets = this.options.defaultRequiredCharacterSets; - if (requiredCharacterArray) { const mutatedRequiredCharacterSets = []; const requiredCharacterArrayLength = requiredCharacterArray.length; - for (let i = 0; i < requiredCharacterArrayLength; i++) { const requiredCharacters = requiredCharacterArray[i]; - if (allowedCharacters && this._stringsHaveAtLeastOneCommonCharacter(requiredCharacters, allowedCharacters)) { mutatedRequiredCharacterSets.push(requiredCharacters); } } - requiredCharacterSets = mutatedRequiredCharacterSets; - } // If requirements allow, we will generateOrThrow the password in default format: "xxx-xxx-xxx-xxx". - + } + // If requirements allow, we will generateOrThrow the password in default format: "xxx-xxx-xxx-xxx". let numberOfRequiredRandomCharacters = this.options.defaultPasswordLength; - if (minPasswordLength && minPasswordLength > numberOfRequiredRandomCharacters) { numberOfRequiredRandomCharacters = minPasswordLength; } - if (maxPasswordLength && maxPasswordLength < numberOfRequiredRandomCharacters) { numberOfRequiredRandomCharacters = maxPasswordLength; } - if (!allowedCharacters) { allowedCharacters = this.options.defaultUnambiguousCharacters; - } // In default password format, we use dashes only as separators, not as symbols you can encounter at a random position. + } + // In default password format, we use dashes only as separators, not as symbols you can encounter at a random position. if (!requiredCharacterSets) { requiredCharacterSets = this.options.defaultRequiredCharacterSets; - } // If we have more requirements of the type "need a character from set" than the length of the password we want to generateOrThrow, then + } + + // If we have more requirements of the type "need a character from set" than the length of the password we want to generateOrThrow, then // we will never be able to meet these requirements, and we'll end up in an infinite loop generating passwords. To avoid this, // reset required character sets if the requirements are impossible to meet. - - if (requiredCharacterSets.length > numberOfRequiredRandomCharacters) { requiredCharacterSets = []; - } // Do not require any character sets that do not contain allowed characters. - + } + // Do not require any character sets that do not contain allowed characters. const requiredCharacterSetsLength = requiredCharacterSets.length; const mutatedRequiredCharacterSets = []; const allowedCharactersLength = allowedCharacters.length; - for (let i = 0; i < requiredCharacterSetsLength; i++) { const requiredCharacterSet = requiredCharacterSets[i]; let requiredCharacterSetContainsAllowedCharacters = false; - for (let j = 0; j < allowedCharactersLength; j++) { const character = allowedCharacters.charAt(j); - if (requiredCharacterSet.indexOf(character) !== -1) { requiredCharacterSetContainsAllowedCharacters = true; break; } } - if (requiredCharacterSetContainsAllowedCharacters) { mutatedRequiredCharacterSets.push(requiredCharacterSet); } } - requiredCharacterSets = mutatedRequiredCharacterSets; return { NumberOfRequiredRandomCharacters: numberOfRequiredRandomCharacters, @@ -1764,13 +1559,12 @@ class Password { RequiredCharacterSets: requiredCharacterSets }; } + /** * @param {Requirements | null} requirements * @param {PasswordParameters} [parameters] * @returns {string} */ - - _generatedPasswordMatchingRequirements(requirements, parameters) { requirements = requirements || {}; parameters = parameters || this._passwordGenerationParametersDictionary(requirements); @@ -1778,111 +1572,85 @@ class Password { const repeatedCharLimit = requirements.PasswordRepeatedCharacterLimit; const allowedCharacters = parameters.PasswordAllowedCharacters; const shouldCheckRepeatedCharRequirement = !!repeatedCharLimit; - while (true) { const password = this._classicPassword(numberOfRequiredRandomCharacters, allowedCharacters); - if (!this._passwordContainsRequiredCharacters(password, parameters.RequiredCharacterSets)) { continue; } - if (shouldCheckRepeatedCharRequirement) { if (repeatedCharLimit !== undefined && repeatedCharLimit >= 1 && !this._passwordHasNotExceededRepeatedCharLimit(password, repeatedCharLimit)) { continue; } } - const consecutiveCharLimit = requirements.PasswordConsecutiveCharacterLimit; - if (consecutiveCharLimit && consecutiveCharLimit >= 1) { if (!this._passwordHasNotExceededConsecutiveCharLimit(password, consecutiveCharLimit)) { continue; } } - return password || ''; } } + /** * @param {parser.CustomCharacterClass | parser.NamedCharacterClass} characterClass * @returns {string[]} */ - - _scanSetFromCharacterClass(characterClass) { if (characterClass instanceof parser.CustomCharacterClass) { return characterClass.characters; } - console.assert(characterClass instanceof parser.NamedCharacterClass); - switch (characterClass.name) { case parser.Identifier.ASCII_PRINTABLE: case parser.Identifier.UNICODE: return this.options.SCAN_SET_ORDER.split(''); - case parser.Identifier.DIGIT: return this.options.SCAN_SET_ORDER.substring(this.options.SCAN_SET_ORDER.indexOf('0'), this.options.SCAN_SET_ORDER.indexOf('9') + 1).split(''); - case parser.Identifier.LOWER: return this.options.SCAN_SET_ORDER.substring(this.options.SCAN_SET_ORDER.indexOf('a'), this.options.SCAN_SET_ORDER.indexOf('z') + 1).split(''); - case parser.Identifier.SPECIAL: return this.options.SCAN_SET_ORDER.substring(this.options.SCAN_SET_ORDER.indexOf('-'), this.options.SCAN_SET_ORDER.indexOf(']') + 1).split(''); - case parser.Identifier.UPPER: return this.options.SCAN_SET_ORDER.substring(this.options.SCAN_SET_ORDER.indexOf('A'), this.options.SCAN_SET_ORDER.indexOf('Z') + 1).split(''); } - console.assert(false, parser.SHOULD_NOT_BE_REACHED); return []; } + /** * @param {(parser.CustomCharacterClass | parser.NamedCharacterClass)[]} characterClasses */ - - _charactersFromCharactersClasses(characterClasses) { const output = []; - for (let characterClass of characterClasses) { output.push(...this._scanSetFromCharacterClass(characterClass)); } - return output; } + /** * @param {string[]} characters * @returns {string} */ - - _canonicalizedScanSetFromCharacters(characters) { if (!characters.length) { return ''; } - let shadowCharacters = Array.prototype.slice.call(characters); shadowCharacters.sort((a, b) => this.options.SCAN_SET_ORDER.indexOf(a) - this.options.SCAN_SET_ORDER.indexOf(b)); let uniqueCharacters = [shadowCharacters[0]]; - for (let i = 1, length = shadowCharacters.length; i < length; ++i) { if (shadowCharacters[i] === shadowCharacters[i - 1]) { continue; } - uniqueCharacters.push(shadowCharacters[i]); } - return uniqueCharacters.join(''); } - } - exports.Password = Password; -_defineProperty(Password, "defaults", defaults); - },{"./constants.js":9,"./rules-parser.js":10}],9:[function(require,module,exports){ "use strict"; @@ -1894,15 +1662,14 @@ const DEFAULT_MIN_LENGTH = 20; const DEFAULT_MAX_LENGTH = 30; const DEFAULT_REQUIRED_CHARS = '-!?$&#%'; const DEFAULT_UNAMBIGUOUS_CHARS = 'abcdefghijkmnopqrstuvwxyzABCDEFGHIJKLMNPQRSTUVWXYZ0123456789'; -const DEFAULT_PASSWORD_RULES = ["minlength: ".concat(DEFAULT_MIN_LENGTH), "maxlength: ".concat(DEFAULT_MAX_LENGTH), "required: [".concat(DEFAULT_REQUIRED_CHARS, "]"), "allowed: [".concat(DEFAULT_UNAMBIGUOUS_CHARS, "]")].join('; '); -const constants = { +const DEFAULT_PASSWORD_RULES = [`minlength: ${DEFAULT_MIN_LENGTH}`, `maxlength: ${DEFAULT_MAX_LENGTH}`, `required: [${DEFAULT_REQUIRED_CHARS}]`, `allowed: [${DEFAULT_UNAMBIGUOUS_CHARS}]`].join('; '); +const constants = exports.constants = { DEFAULT_MIN_LENGTH, DEFAULT_MAX_LENGTH, DEFAULT_PASSWORD_RULES, DEFAULT_REQUIRED_CHARS, DEFAULT_UNAMBIGUOUS_CHARS }; -exports.constants = constants; },{}],10:[function(require,module,exports){ "use strict"; @@ -1928,7 +1695,8 @@ exports.parsePasswordRules = parsePasswordRules; * ^ the default implementation still returns a base-line ruleset, which we didn't want. * */ -const Identifier = { + +const Identifier = exports.Identifier = { ASCII_PRINTABLE: 'ascii-printable', DIGIT: 'digit', LOWER: 'lower', @@ -1936,131 +1704,106 @@ const Identifier = { UNICODE: 'unicode', UPPER: 'upper' }; -exports.Identifier = Identifier; -const RuleName = { +const RuleName = exports.RuleName = { ALLOWED: 'allowed', MAX_CONSECUTIVE: 'max-consecutive', REQUIRED: 'required', MIN_LENGTH: 'minlength', MAX_LENGTH: 'maxlength' }; -exports.RuleName = RuleName; const CHARACTER_CLASS_START_SENTINEL = '['; const CHARACTER_CLASS_END_SENTINEL = ']'; const PROPERTY_VALUE_SEPARATOR = ','; const PROPERTY_SEPARATOR = ';'; const PROPERTY_VALUE_START_SENTINEL = ':'; const SPACE_CODE_POINT = ' '.codePointAt(0); -const SHOULD_NOT_BE_REACHED = 'Should not be reached'; -exports.SHOULD_NOT_BE_REACHED = SHOULD_NOT_BE_REACHED; - +const SHOULD_NOT_BE_REACHED = exports.SHOULD_NOT_BE_REACHED = 'Should not be reached'; class Rule { constructor(name, value) { this._name = name; this.value = value; } - get name() { return this._name; } - toString() { return JSON.stringify(this); } - } - exports.Rule = Rule; ; - class NamedCharacterClass { constructor(name) { console.assert(_isValidRequiredOrAllowedPropertyValueIdentifier(name)); this._name = name; } - get name() { return this._name.toLowerCase(); } - toString() { return this._name; } - toHTMLString() { return this._name; } - } - exports.NamedCharacterClass = NamedCharacterClass; ; - class ParserError extends Error {} - exports.ParserError = ParserError; ; - class CustomCharacterClass { constructor(characters) { console.assert(characters instanceof Array); this._characters = characters; } - get characters() { return this._characters; } - toString() { - return "[".concat(this._characters.join(''), "]"); + return `[${this._characters.join('')}]`; } - toHTMLString() { - return "[".concat(this._characters.join('').replace('"', '"'), "]"); + return `[${this._characters.join('').replace('"', '"')}]`; } - } - exports.CustomCharacterClass = CustomCharacterClass; -; // MARK: Lexer functions +; -function _isIdentifierCharacter(c) { - console.assert(c.length === 1); // eslint-disable-next-line no-mixed-operators +// MARK: Lexer functions +function _isIdentifierCharacter(c) { + console.assert(c.length === 1); + // eslint-disable-next-line no-mixed-operators return c >= 'a' && c <= 'z' || c >= 'A' && c <= 'Z' || c === '-'; } - function _isASCIIDigit(c) { console.assert(c.length === 1); return c >= '0' && c <= '9'; } - function _isASCIIPrintableCharacter(c) { console.assert(c.length === 1); return c >= ' ' && c <= '~'; } - function _isASCIIWhitespace(c) { console.assert(c.length === 1); return c === ' ' || c === '\f' || c === '\n' || c === '\r' || c === '\t'; -} // MARK: ASCII printable character bit set and canonicalization functions +} +// MARK: ASCII printable character bit set and canonicalization functions function _bitSetIndexForCharacter(c) { - console.assert(c.length === 1); // @ts-ignore - + console.assert(c.length === 1); + // @ts-ignore return c.codePointAt(0) - SPACE_CODE_POINT; } - function _characterAtBitSetIndex(index) { return String.fromCodePoint(index + SPACE_CODE_POINT); } - function _markBitsForNamedCharacterClass(bitSet, namedCharacterClass) { console.assert(bitSet instanceof Array); console.assert(namedCharacterClass.name !== Identifier.UNICODE); console.assert(namedCharacterClass.name !== Identifier.ASCII_PRINTABLE); - if (namedCharacterClass.name === Identifier.UPPER) { bitSet.fill(true, _bitSetIndexForCharacter('A'), _bitSetIndexForCharacter('Z') + 1); } else if (namedCharacterClass.name === Identifier.LOWER) { @@ -2076,223 +1819,176 @@ function _markBitsForNamedCharacterClass(bitSet, namedCharacterClass) { console.assert(false, SHOULD_NOT_BE_REACHED, namedCharacterClass); } } - function _markBitsForCustomCharacterClass(bitSet, customCharacterClass) { for (let character of customCharacterClass.characters) { bitSet[_bitSetIndexForCharacter(character)] = true; } } - function _canonicalizedPropertyValues(propertyValues, keepCustomCharacterClassFormatCompliant) { // @ts-ignore let asciiPrintableBitSet = new Array('~'.codePointAt(0) - ' '.codePointAt(0) + 1); - for (let propertyValue of propertyValues) { if (propertyValue instanceof NamedCharacterClass) { if (propertyValue.name === Identifier.UNICODE) { return [new NamedCharacterClass(Identifier.UNICODE)]; } - if (propertyValue.name === Identifier.ASCII_PRINTABLE) { return [new NamedCharacterClass(Identifier.ASCII_PRINTABLE)]; } - _markBitsForNamedCharacterClass(asciiPrintableBitSet, propertyValue); } else if (propertyValue instanceof CustomCharacterClass) { _markBitsForCustomCharacterClass(asciiPrintableBitSet, propertyValue); } } - let charactersSeen = []; - function checkRange(start, end) { let temp = []; - for (let i = _bitSetIndexForCharacter(start); i <= _bitSetIndexForCharacter(end); ++i) { if (asciiPrintableBitSet[i]) { temp.push(_characterAtBitSetIndex(i)); } } - let result = temp.length === _bitSetIndexForCharacter(end) - _bitSetIndexForCharacter(start) + 1; - if (!result) { charactersSeen = charactersSeen.concat(temp); } - return result; } - let hasAllUpper = checkRange('A', 'Z'); let hasAllLower = checkRange('a', 'z'); - let hasAllDigits = checkRange('0', '9'); // Check for special characters, accounting for characters that are given special treatment (i.e. '-' and ']') + let hasAllDigits = checkRange('0', '9'); + // Check for special characters, accounting for characters that are given special treatment (i.e. '-' and ']') let hasAllSpecial = false; let hasDash = false; let hasRightSquareBracket = false; let temp = []; - for (let i = _bitSetIndexForCharacter(' '); i <= _bitSetIndexForCharacter('/'); ++i) { if (!asciiPrintableBitSet[i]) { continue; } - let character = _characterAtBitSetIndex(i); - if (keepCustomCharacterClassFormatCompliant && character === '-') { hasDash = true; } else { temp.push(character); } } - for (let i = _bitSetIndexForCharacter(':'); i <= _bitSetIndexForCharacter('@'); ++i) { if (asciiPrintableBitSet[i]) { temp.push(_characterAtBitSetIndex(i)); } } - for (let i = _bitSetIndexForCharacter('['); i <= _bitSetIndexForCharacter('`'); ++i) { if (!asciiPrintableBitSet[i]) { continue; } - let character = _characterAtBitSetIndex(i); - if (keepCustomCharacterClassFormatCompliant && character === ']') { hasRightSquareBracket = true; } else { temp.push(character); } } - for (let i = _bitSetIndexForCharacter('{'); i <= _bitSetIndexForCharacter('~'); ++i) { if (asciiPrintableBitSet[i]) { temp.push(_characterAtBitSetIndex(i)); } } - if (hasDash) { temp.unshift('-'); } - if (hasRightSquareBracket) { temp.push(']'); } - let numberOfSpecialCharacters = _bitSetIndexForCharacter('/') - _bitSetIndexForCharacter(' ') + 1 + (_bitSetIndexForCharacter('@') - _bitSetIndexForCharacter(':') + 1) + (_bitSetIndexForCharacter('`') - _bitSetIndexForCharacter('[') + 1) + (_bitSetIndexForCharacter('~') - _bitSetIndexForCharacter('{') + 1); hasAllSpecial = temp.length === numberOfSpecialCharacters; - if (!hasAllSpecial) { charactersSeen = charactersSeen.concat(temp); } - let result = []; - if (hasAllUpper && hasAllLower && hasAllDigits && hasAllSpecial) { return [new NamedCharacterClass(Identifier.ASCII_PRINTABLE)]; } - if (hasAllUpper) { result.push(new NamedCharacterClass(Identifier.UPPER)); } - if (hasAllLower) { result.push(new NamedCharacterClass(Identifier.LOWER)); } - if (hasAllDigits) { result.push(new NamedCharacterClass(Identifier.DIGIT)); } - if (hasAllSpecial) { result.push(new NamedCharacterClass(Identifier.SPECIAL)); } - if (charactersSeen.length) { result.push(new CustomCharacterClass(charactersSeen)); } - return result; -} // MARK: Parser functions +} +// MARK: Parser functions function _indexOfNonWhitespaceCharacter(input) { let position = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; console.assert(position >= 0); console.assert(position <= input.length); let length = input.length; - while (position < length && _isASCIIWhitespace(input[position])) { ++position; } - return position; } - function _parseIdentifier(input, position) { console.assert(position >= 0); console.assert(position < input.length); console.assert(_isIdentifierCharacter(input[position])); let length = input.length; let seenIdentifiers = []; - do { let c = input[position]; - if (!_isIdentifierCharacter(c)) { break; } - seenIdentifiers.push(c); ++position; } while (position < length); - return [seenIdentifiers.join(''), position]; } - function _isValidRequiredOrAllowedPropertyValueIdentifier(identifier) { return identifier && Object.values(Identifier).includes(identifier.toLowerCase()); } - function _parseCustomCharacterClass(input, position) { console.assert(position >= 0); console.assert(position < input.length); console.assert(input[position] === CHARACTER_CLASS_START_SENTINEL); let length = input.length; ++position; - if (position >= length) { // console.error('Found end-of-line instead of character class character') return [null, position]; } - let initialPosition = position; let result = []; - do { let c = input[position]; - if (!_isASCIIPrintableCharacter(c)) { ++position; continue; } - if (c === '-' && position - initialPosition > 0) { // FIXME: Should this be an error? console.warn("Ignoring '-'; a '-' may only appear as the first character in a character class"); ++position; continue; } - result.push(c); ++position; - if (c === CHARACTER_CLASS_END_SENTINEL) { break; } } while (position < length); - if (position < length && input[position] !== CHARACTER_CLASS_END_SENTINEL) { // Fix up result; we over consumed. result.pop(); @@ -2302,37 +1998,31 @@ function _parseCustomCharacterClass(input, position) { result.pop(); return [result, position]; } - if (position < length && input[position] === CHARACTER_CLASS_END_SENTINEL) { return [result, position + 1]; - } // console.error('Found end-of-line instead of end of character class') - + } + // console.error('Found end-of-line instead of end of character class') return [null, position]; } - function _parsePasswordRequiredOrAllowedPropertyValue(input, position) { console.assert(position >= 0); console.assert(position < input.length); let length = input.length; let propertyValues = []; - while (true) { if (_isIdentifierCharacter(input[position])) { - let identifierStartPosition = position; // eslint-disable-next-line no-redeclare - + let identifierStartPosition = position; + // eslint-disable-next-line no-redeclare var [propertyValue, position] = _parseIdentifier(input, position); - if (!_isValidRequiredOrAllowedPropertyValueIdentifier(propertyValue)) { // console.error('Unrecognized property value identifier: ' + propertyValue) return [null, identifierStartPosition]; } - propertyValues.push(new NamedCharacterClass(propertyValue)); } else if (input[position] === CHARACTER_CLASS_START_SENTINEL) { // eslint-disable-next-line no-redeclare var [propertyValue, position] = _parseCustomCharacterClass(input, position); - if (propertyValue && propertyValue.length) { propertyValues.push(new CustomCharacterClass(propertyValue)); } @@ -2340,300 +2030,240 @@ function _parsePasswordRequiredOrAllowedPropertyValue(input, position) { // console.error('Failed to find start of property value: ' + input.substr(position)) return [null, position]; } - position = _indexOfNonWhitespaceCharacter(input, position); - if (position >= length || input[position] === PROPERTY_SEPARATOR) { break; } - if (input[position] === PROPERTY_VALUE_SEPARATOR) { position = _indexOfNonWhitespaceCharacter(input, position + 1); - if (position >= length) { // console.error('Found end-of-line instead of start of next property value') return [null, position]; } - continue; - } // console.error('Failed to find start of next property or property value: ' + input.substr(position)) - + } + // console.error('Failed to find start of next property or property value: ' + input.substr(position)) return [null, position]; } - return [propertyValues, position]; } + /** * @param input * @param position * @returns {[Rule|null, number, string|undefined]} * @private */ - - function _parsePasswordRule(input, position) { console.assert(position >= 0); console.assert(position < input.length); console.assert(_isIdentifierCharacter(input[position])); let length = input.length; - var mayBeIdentifierStartPosition = position; // eslint-disable-next-line no-redeclare - + var mayBeIdentifierStartPosition = position; + // eslint-disable-next-line no-redeclare var [identifier, position] = _parseIdentifier(input, position); - if (!Object.values(RuleName).includes(identifier)) { // console.error('Unrecognized property name: ' + identifier) return [null, mayBeIdentifierStartPosition, undefined]; } - if (position >= length) { // console.error('Found end-of-line instead of start of property value') return [null, position, undefined]; } - if (input[position] !== PROPERTY_VALUE_START_SENTINEL) { // console.error('Failed to find start of property value: ' + input.substr(position)) return [null, position, undefined]; } - let property = { name: identifier, value: null }; - position = _indexOfNonWhitespaceCharacter(input, position + 1); // Empty value - + position = _indexOfNonWhitespaceCharacter(input, position + 1); + // Empty value if (position >= length || input[position] === PROPERTY_SEPARATOR) { return [new Rule(property.name, property.value), position, undefined]; } - switch (identifier) { case RuleName.ALLOWED: case RuleName.REQUIRED: { // eslint-disable-next-line no-redeclare var [propertyValue, position] = _parsePasswordRequiredOrAllowedPropertyValue(input, position); - if (propertyValue) { property.value = propertyValue; } - return [new Rule(property.name, property.value), position, undefined]; } - case RuleName.MAX_CONSECUTIVE: { // eslint-disable-next-line no-redeclare var [propertyValue, position] = _parseMaxConsecutivePropertyValue(input, position); - if (propertyValue) { property.value = propertyValue; } - return [new Rule(property.name, property.value), position, undefined]; } - case RuleName.MIN_LENGTH: case RuleName.MAX_LENGTH: { // eslint-disable-next-line no-redeclare var [propertyValue, position] = _parseMinLengthMaxLengthPropertyValue(input, position); - if (propertyValue) { property.value = propertyValue; } - return [new Rule(property.name, property.value), position, undefined]; } } - console.assert(false, SHOULD_NOT_BE_REACHED); return [null, -1, undefined]; } - function _parseMinLengthMaxLengthPropertyValue(input, position) { return _parseInteger(input, position); } - function _parseMaxConsecutivePropertyValue(input, position) { return _parseInteger(input, position); } - function _parseInteger(input, position) { console.assert(position >= 0); console.assert(position < input.length); - if (!_isASCIIDigit(input[position])) { // console.error('Failed to parse value of type integer; not a number: ' + input.substr(position)) return [null, position]; } - - let length = input.length; // let initialPosition = position - + let length = input.length; + // let initialPosition = position let result = 0; - do { result = 10 * result + parseInt(input[position], 10); ++position; } while (position < length && input[position] !== PROPERTY_SEPARATOR && _isASCIIDigit(input[position])); - if (position >= length || input[position] === PROPERTY_SEPARATOR) { return [result, position]; - } // console.error('Failed to parse value of type integer; not a number: ' + input.substr(initialPosition)) - + } + // console.error('Failed to parse value of type integer; not a number: ' + input.substr(initialPosition)) return [null, position]; } + /** * @param input * @returns {[Rule[]|null, string|undefined]} * @private */ - - function _parsePasswordRulesInternal(input) { let parsedProperties = []; let length = input.length; - var position = _indexOfNonWhitespaceCharacter(input); - while (position < length) { if (!_isIdentifierCharacter(input[position])) { // console.warn('Failed to find start of property: ' + input.substr(position)) return [parsedProperties, undefined]; - } // eslint-disable-next-line no-redeclare - + } + // eslint-disable-next-line no-redeclare var [parsedProperty, position, message] = _parsePasswordRule(input, position); - if (parsedProperty && parsedProperty.value) { parsedProperties.push(parsedProperty); } - position = _indexOfNonWhitespaceCharacter(input, position); - if (position >= length) { break; } - if (input[position] === PROPERTY_SEPARATOR) { position = _indexOfNonWhitespaceCharacter(input, position + 1); - if (position >= length) { return [parsedProperties, undefined]; } - continue; - } // console.error('Failed to find start of next property: ' + input.substr(position)) - + } + // console.error('Failed to find start of next property: ' + input.substr(position)) return [null, message || 'Failed to find start of next property: ' + input.substr(position)]; } - return [parsedProperties, undefined]; } + /** * @param {string} input * @param {boolean} [formatRulesForMinifiedVersion] * @returns {Rule[]} */ - - function parsePasswordRules(input, formatRulesForMinifiedVersion) { let [passwordRules, maybeMessage] = _parsePasswordRulesInternal(input); - if (!passwordRules) { throw new ParserError(maybeMessage); } - if (passwordRules.length === 0) { throw new ParserError('No valid rules were provided'); - } // When formatting rules for minified version, we should keep the formatted rules - // as similar to the input as possible. Avoid copying required rules to allowed rules. - + } + // When formatting rules for minified version, we should keep the formatted rules + // as similar to the input as possible. Avoid copying required rules to allowed rules. let suppressCopyingRequiredToAllowed = formatRulesForMinifiedVersion; let requiredRules = []; let newAllowedValues = []; let minimumMaximumConsecutiveCharacters = null; let maximumMinLength = 0; let minimumMaxLength = null; - for (let rule of passwordRules) { switch (rule.name) { case RuleName.MAX_CONSECUTIVE: minimumMaximumConsecutiveCharacters = minimumMaximumConsecutiveCharacters ? Math.min(rule.value, minimumMaximumConsecutiveCharacters) : rule.value; break; - case RuleName.MIN_LENGTH: maximumMinLength = Math.max(rule.value, maximumMinLength); break; - case RuleName.MAX_LENGTH: minimumMaxLength = minimumMaxLength ? Math.min(rule.value, minimumMaxLength) : rule.value; break; - case RuleName.REQUIRED: rule.value = _canonicalizedPropertyValues(rule.value, formatRulesForMinifiedVersion); requiredRules.push(rule); - if (!suppressCopyingRequiredToAllowed) { newAllowedValues = newAllowedValues.concat(rule.value); } - break; - case RuleName.ALLOWED: newAllowedValues = newAllowedValues.concat(rule.value); break; } } - let newPasswordRules = []; - if (maximumMinLength > 0) { newPasswordRules.push(new Rule(RuleName.MIN_LENGTH, maximumMinLength)); } - if (minimumMaxLength !== null) { newPasswordRules.push(new Rule(RuleName.MAX_LENGTH, minimumMaxLength)); } - if (minimumMaximumConsecutiveCharacters !== null) { newPasswordRules.push(new Rule(RuleName.MAX_CONSECUTIVE, minimumMaximumConsecutiveCharacters)); } - let sortedRequiredRules = requiredRules.sort(function (a, b) { const namedCharacterClassOrder = [Identifier.LOWER, Identifier.UPPER, Identifier.DIGIT, Identifier.SPECIAL, Identifier.ASCII_PRINTABLE, Identifier.UNICODE]; let aIsJustOneNamedCharacterClass = a.value.length === 1 && a.value[0] instanceof NamedCharacterClass; let bIsJustOneNamedCharacterClass = b.value.length === 1 && b.value[0] instanceof NamedCharacterClass; - if (aIsJustOneNamedCharacterClass && !bIsJustOneNamedCharacterClass) { return -1; } - if (!aIsJustOneNamedCharacterClass && bIsJustOneNamedCharacterClass) { return 1; } - if (aIsJustOneNamedCharacterClass && bIsJustOneNamedCharacterClass) { let aIndex = namedCharacterClassOrder.indexOf(a.value[0].name); let bIndex = namedCharacterClassOrder.indexOf(b.value[0].name); return aIndex - bIndex; } - return 0; }); newPasswordRules = newPasswordRules.concat(sortedRequiredRules); newAllowedValues = _canonicalizedPropertyValues(newAllowedValues, suppressCopyingRequiredToAllowed); - if (!suppressCopyingRequiredToAllowed && !newAllowedValues.length) { newAllowedValues = [new NamedCharacterClass(Identifier.ASCII_PRINTABLE)]; } - if (newAllowedValues.length) { newPasswordRules.push(new Rule(RuleName.ALLOWED, newAllowedValues)); } - return newPasswordRules; } @@ -3475,35 +3105,24 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.createDevice = createDevice; - var _config = require("./config.js"); - var _AndroidInterface = require("./DeviceInterface/AndroidInterface.js"); - var _ExtensionInterface = require("./DeviceInterface/ExtensionInterface.js"); - var _AppleDeviceInterface = require("./DeviceInterface/AppleDeviceInterface.js"); - var _AppleOverlayDeviceInterface = require("./DeviceInterface/AppleOverlayDeviceInterface.js"); - var _transports = require("./deviceApiCalls/transports/transports.js"); - var _index = require("../packages/device-api/index.js"); - var _Settings = require("./Settings.js"); - var _WindowsInterface = require("./DeviceInterface/WindowsInterface.js"); - var _WindowsOverlayDeviceInterface = require("./DeviceInterface/WindowsOverlayDeviceInterface.js"); - function createDevice() { const globalConfig = (0, _config.createGlobalConfig)(); const transport = (0, _transports.createTransport)(globalConfig); + /** * A wrapper around transports to assist in debugging/integrations * @type {import("../packages/device-api").DeviceApiTransport} */ - const loggingTransport = { async send(deviceApiCall) { console.log('[->outgoing]', 'id:', deviceApiCall.method, deviceApiCall.params || null); @@ -3511,32 +3130,26 @@ function createDevice() { console.log('[<-incoming]', 'id:', deviceApiCall.method, result || null); return result; } + }; - }; // Create the DeviceAPI + Setting - + // Create the DeviceAPI + Setting let deviceApi = new _index.DeviceApi(globalConfig.isDDGTestMode ? loggingTransport : transport); const settings = new _Settings.Settings(globalConfig, deviceApi); - if (globalConfig.isWindows) { if (globalConfig.isTopFrame) { return new _WindowsOverlayDeviceInterface.WindowsOverlayDeviceInterface(globalConfig, deviceApi, settings); } - return new _WindowsInterface.WindowsInterface(globalConfig, deviceApi, settings); } - if (globalConfig.isDDGApp) { if (globalConfig.isAndroid) { return new _AndroidInterface.AndroidInterface(globalConfig, deviceApi, settings); } - if (globalConfig.isTopFrame) { return new _AppleOverlayDeviceInterface.AppleOverlayDeviceInterface(globalConfig, deviceApi, settings); } - return new _AppleDeviceInterface.AppleDeviceInterface(globalConfig, deviceApi, settings); } - globalConfig.isExtension = true; return new _ExtensionInterface.ExtensionInterface(globalConfig, deviceApi, settings); } @@ -3548,26 +3161,19 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.AndroidInterface = void 0; - var _InterfacePrototype = _interopRequireDefault(require("./InterfacePrototype.js")); - var _autofillUtils = require("../autofill-utils.js"); - var _NativeUIController = require("../UI/controllers/NativeUIController.js"); - var _appleUtils = require("@duckduckgo/content-scope-scripts/src/apple-utils"); - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - class AndroidInterface extends _InterfacePrototype.default { async isEnabled() { return (0, _autofillUtils.autofillEnabled)(this.globalConfig, _appleUtils.processConfig); } + /** * @returns {Promise} */ - - async getAlias() { const { alias @@ -3576,47 +3182,40 @@ class AndroidInterface extends _InterfacePrototype.default { }, 'getAliasResponse'); return alias; } + /** * @override */ - - createUIController() { return new _NativeUIController.NativeUIController(); } + /** * @deprecated use `this.settings.availableInputTypes.email` in the future * @returns {boolean} */ - - isDeviceSignedIn() { - var _this$globalConfig$av; - // on DDG domains, always check via `window.EmailInterface.isSignedIn()` if (this.globalConfig.isDDGDomain) { return window.EmailInterface.isSignedIn() === 'true'; - } // on non-DDG domains, where `availableInputTypes.email` is present, use it - + } - if (typeof ((_this$globalConfig$av = this.globalConfig.availableInputTypes) === null || _this$globalConfig$av === void 0 ? void 0 : _this$globalConfig$av.email) === 'boolean') { + // on non-DDG domains, where `availableInputTypes.email` is present, use it + if (typeof this.globalConfig.availableInputTypes?.email === 'boolean') { return this.globalConfig.availableInputTypes.email; - } // ...on other domains we assume true because the script wouldn't exist otherwise - + } + // ...on other domains we assume true because the script wouldn't exist otherwise return true; } - async setupAutofill() {} + /** * Used by the email web app * Settings page displays data of the logged in user data */ - - getUserData() { let userData = null; - try { userData = JSON.parse(window.EmailInterface.getUserData()); } catch (e) { @@ -3624,18 +3223,15 @@ class AndroidInterface extends _InterfacePrototype.default { console.error(e); } } - return Promise.resolve(userData); } + /** * Used by the email web app * Device capabilities determine which functionality is available to the user */ - - getEmailProtectionCapabilities() { let deviceCapabilities = null; - try { deviceCapabilities = JSON.parse(window.EmailInterface.getDeviceCapabilities()); } catch (e) { @@ -3643,10 +3239,8 @@ class AndroidInterface extends _InterfacePrototype.default { console.error(e); } } - return Promise.resolve(deviceCapabilities); } - storeUserData(_ref) { let { addUserData: { @@ -3657,12 +3251,11 @@ class AndroidInterface extends _InterfacePrototype.default { } = _ref; return window.EmailInterface.storeCredentials(token, userName, cohort); } + /** * Used by the email web app * Provides functionality to log the user out */ - - removeUserData() { try { return window.EmailInterface.removeCredentials(); @@ -3672,7 +3265,6 @@ class AndroidInterface extends _InterfacePrototype.default { } } } - addLogoutListener(handler) { // Only deal with logging out if we're in the email web app if (!this.globalConfig.isDDGDomain) return; @@ -3682,13 +3274,10 @@ class AndroidInterface extends _InterfacePrototype.default { } }); } - /** Noop */ - + /** Noop */ firePixel(_pixelParam) {} - } - exports.AndroidInterface = AndroidInterface; },{"../UI/controllers/NativeUIController.js":46,"../autofill-utils.js":51,"./InterfacePrototype.js":17,"@duckduckgo/content-scope-scripts/src/apple-utils":1}],14:[function(require,module,exports){ @@ -3698,52 +3287,32 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.AppleDeviceInterface = void 0; - var _InterfacePrototype = _interopRequireDefault(require("./InterfacePrototype.js")); - var _autofillUtils = require("../autofill-utils.js"); - var _appleUtils = require("@duckduckgo/content-scope-scripts/src/apple-utils"); - var _HTMLTooltip = require("../UI/HTMLTooltip.js"); - var _HTMLTooltipUIController = require("../UI/controllers/HTMLTooltipUIController.js"); - var _OverlayUIController = require("../UI/controllers/OverlayUIController.js"); - var _index = require("../../packages/device-api/index.js"); - var _additionalDeviceApiCalls = require("../deviceApiCalls/additionalDeviceApiCalls.js"); - var _NativeUIController = require("../UI/controllers/NativeUIController.js"); - var _deviceApiCalls = require("../deviceApiCalls/__generated__/deviceApiCalls.js"); - var _matching = require("../Form/matching.js"); - var _InContextSignup = require("../InContextSignup.js"); - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - /** * @typedef {import('../deviceApiCalls/__generated__/validators-ts').GetAutofillDataRequest} GetAutofillDataRequest */ -class AppleDeviceInterface extends _InterfacePrototype.default { - constructor() { - super(...arguments); - - _defineProperty(this, "inContextSignup", new _InContextSignup.InContextSignup(this)); - - _defineProperty(this, "initialSetupDelayMs", 300); - _defineProperty(this, "pollingTimeout", null); - } +class AppleDeviceInterface extends _InterfacePrototype.default { + inContextSignup = new _InContextSignup.InContextSignup(this); + /** @override */ + initialSetupDelayMs = 300; async isEnabled() { return (0, _autofillUtils.autofillEnabled)(this.globalConfig, _appleUtils.processConfig); } + /** * The default functionality of this class is to operate as an 'overlay controller' - * which means it's purpose is to message the native layer about when to open/close the overlay. @@ -3755,17 +3324,13 @@ class AppleDeviceInterface extends _InterfacePrototype.default { * @override * @returns {import("../UI/controllers/UIController.js").UIController} */ - - createUIController() { - var _this$globalConfig$us, _this$globalConfig$us2; - - if (((_this$globalConfig$us = this.globalConfig.userPreferences) === null || _this$globalConfig$us === void 0 ? void 0 : (_this$globalConfig$us2 = _this$globalConfig$us.platform) === null || _this$globalConfig$us2 === void 0 ? void 0 : _this$globalConfig$us2.name) === 'ios') { + if (this.globalConfig.userPreferences?.platform?.name === 'ios') { return new _NativeUIController.NativeUIController(); } - if (!this.globalConfig.supportsTopFrame) { - const options = { ..._HTMLTooltip.defaultOptions, + const options = { + ..._HTMLTooltip.defaultOptions, testMode: this.isTestMode() }; return new _HTMLTooltipUIController.HTMLTooltipUIController({ @@ -3773,16 +3338,16 @@ class AppleDeviceInterface extends _InterfacePrototype.default { tooltipKind: 'modern' }, options); } + /** * If we get here, we're just a controller for an overlay */ - - return new _OverlayUIController.OverlayUIController({ remove: async () => this._closeAutofillParent(), show: async details => this._show(details) }); } + /** * For now, this could be running * 1) on iOS @@ -3792,78 +3357,67 @@ class AppleDeviceInterface extends _InterfacePrototype.default { * @override * @returns {Promise} */ - - async setupAutofill() { if (!this.globalConfig.supportsTopFrame) { await this._getAutofillInitData(); } - await this.inContextSignup.init(); const signedIn = await this._checkDeviceSignedIn(); - if (signedIn) { if (this.globalConfig.isApp) { await this.getAddresses(); } } } + /** * Used by the email web app * Settings page displays data of the logged in user data */ - - getUserData() { return this.deviceApi.request((0, _index.createRequest)('emailHandlerGetUserData')); } + /** * Used by the email web app * Device capabilities determine which functionality is available to the user */ - - getEmailProtectionCapabilities() { return this.deviceApi.request((0, _index.createRequest)('emailHandlerGetCapabilities')); } + /** */ - - async getSelectedCredentials() { return this.deviceApi.request((0, _index.createRequest)('getSelectedCredentials')); } + /** * The data format provided here for `parentArgs` matches Window now. * @param {GetAutofillDataRequest} parentArgs */ - - async _showAutofillParent(parentArgs) { - const applePayload = { ...parentArgs.triggerContext, + const applePayload = { + ...parentArgs.triggerContext, serializedInputContext: parentArgs.serializedInputContext }; return this.deviceApi.notify((0, _index.createNotification)('showAutofillParent', applePayload)); } + /** * @returns {Promise} */ - - async _closeAutofillParent() { return this.deviceApi.notify((0, _index.createNotification)('closeAutofillParent', {})); } + /** * @param {GetAutofillDataRequest} details */ - - async _show(details) { await this._showAutofillParent(details); - this._listenForSelectedCredential(async response => { if (!response) return; - if ('configType' in response) { this.selectedDetail(response.data, response.configType); } else if ('stop' in response) { @@ -3873,12 +3427,10 @@ class AppleDeviceInterface extends _InterfacePrototype.default { } }); } - async refreshData() { await super.refreshData(); await this._checkDeviceSignedIn(); } - async getAddresses() { if (!this.globalConfig.isApp) return this.getAlias(); const { @@ -3887,23 +3439,18 @@ class AppleDeviceInterface extends _InterfacePrototype.default { this.storeLocalAddresses(addresses); return addresses; } - async refreshAlias() { - await this.deviceApi.notify((0, _index.createNotification)('emailHandlerRefreshAlias')); // On macOS we also update the addresses stored locally - + await this.deviceApi.notify((0, _index.createNotification)('emailHandlerRefreshAlias')); + // On macOS we also update the addresses stored locally if (this.globalConfig.isApp) this.getAddresses(); } - async _checkDeviceSignedIn() { const { isAppSignedIn } = await this.deviceApi.request((0, _index.createRequest)('emailHandlerCheckAppSignedInStatus')); - this.isDeviceSignedIn = () => !!isAppSignedIn; - return !!isAppSignedIn; } - storeUserData(_ref) { let { addUserData: { @@ -3918,24 +3465,23 @@ class AppleDeviceInterface extends _InterfacePrototype.default { cohort })); } + /** * Used by the email web app * Provides functionality to log the user out */ - - removeUserData() { this.deviceApi.notify((0, _index.createNotification)('emailHandlerRemoveToken')); } + /** * Used by the email web app * Provides functionality to close the window after in-context sign-up or sign-in */ - - closeEmailProtection() { this.deviceApi.request(new _deviceApiCalls.CloseEmailProtectionTabCall(null)); } + /** * PM endpoints */ @@ -3944,91 +3490,79 @@ class AppleDeviceInterface extends _InterfacePrototype.default { * Gets the init data from the device * @returns {APIResponse} */ - - async _getAutofillInitData() { const response = await this.deviceApi.request((0, _index.createRequest)('pmHandlerGetAutofillInitData')); this.storeLocalData(response.success); return response; } + /** * Gets credentials ready for autofill * @param {CredentialsObject['id']} id - the credential id * @returns {APIResponseSingle} */ - - getAutofillCredentials(id) { return this.deviceApi.request((0, _index.createRequest)('pmHandlerGetAutofillCredentials', { id })); } + /** * Opens the native UI for managing passwords */ - - openManagePasswords() { return this.deviceApi.notify((0, _index.createNotification)('pmHandlerOpenManagePasswords')); } + /** * Opens the native UI for managing identities */ - - openManageIdentities() { return this.deviceApi.notify((0, _index.createNotification)('pmHandlerOpenManageIdentities')); } + /** * Opens the native UI for managing credit cards */ - - openManageCreditCards() { return this.deviceApi.notify((0, _index.createNotification)('pmHandlerOpenManageCreditCards')); } + /** * Gets a single identity obj once the user requests it * @param {IdentityObject['id']} id * @returns {Promise<{success: IdentityObject|undefined}>} */ - - getAutofillIdentity(id) { const identity = this.getLocalIdentities().find(_ref2 => { let { id: identityId } = _ref2; - return "".concat(identityId) === "".concat(id); + return `${identityId}` === `${id}`; }); return Promise.resolve({ success: identity }); } + /** * Gets a single complete credit card obj once the user requests it * @param {CreditCardObject['id']} id * @returns {APIResponse} */ - - getAutofillCreditCard(id) { return this.deviceApi.request((0, _index.createRequest)('pmHandlerGetCreditCard', { id })); } - getCurrentInputType() { - var _this$activeForm; - const topContextData = this.getTopContextData(); - return topContextData !== null && topContextData !== void 0 && topContextData.inputType ? topContextData.inputType : (0, _matching.getInputType)((_this$activeForm = this.activeForm) === null || _this$activeForm === void 0 ? void 0 : _this$activeForm.activeInput); + return topContextData?.inputType ? topContextData.inputType : (0, _matching.getInputType)(this.activeForm?.activeInput); } + /** * @returns {Promise} */ - - async getAlias() { const { alias @@ -4039,7 +3573,6 @@ class AppleDeviceInterface extends _InterfacePrototype.default { })); return alias ? (0, _autofillUtils.formatDuckAddress)(alias) : alias; } - addLogoutListener(handler) { // Only deal with logging out if we're in the email web app if (!this.globalConfig.isDDGDomain) return; @@ -4049,7 +3582,6 @@ class AppleDeviceInterface extends _InterfacePrototype.default { } }); } - async addDeviceListeners() { if (this.settings.featureToggles.third_party_credentials_provider) { if (this.globalConfig.hasModernWebkitAPI) { @@ -4066,17 +3598,15 @@ class AppleDeviceInterface extends _InterfacePrototype.default { setTimeout(() => this._pollForUpdatesToCredentialsProvider(), 2000); } } - } // Only used on Catalina - + } + // Only used on Catalina async _pollForUpdatesToCredentialsProvider() { try { const response = await this.deviceApi.request(new _deviceApiCalls.CheckCredentialsProviderStatusCall(null)); - if (response.availableInputTypes.credentialsProviderStatus !== this.settings.availableInputTypes.credentialsProviderStatus) { this.providerStatusUpdated(response); } - setTimeout(() => this._pollForUpdatesToCredentialsProvider(), 2000); } catch (e) { if (this.globalConfig.isDDGTestMode) { @@ -4084,9 +3614,9 @@ class AppleDeviceInterface extends _InterfacePrototype.default { } } } - /** @type {any} */ - + /** @type {any} */ + pollingTimeout = null; /** * Poll the native listener until the user has selected a credential. * Message return types are: @@ -4101,13 +3631,11 @@ class AppleDeviceInterface extends _InterfacePrototype.default { const poll = async () => { clearTimeout(this.pollingTimeout); const response = await this.getSelectedCredentials(); - switch (response.type) { case 'none': // Parent hasn't got a selected credential yet this.pollingTimeout = setTimeout(() => poll(), 100); return; - case 'ok': { await callback({ @@ -4116,7 +3644,6 @@ class AppleDeviceInterface extends _InterfacePrototype.default { }); return; } - case 'state': { // Inform that state has changed, but continue polling @@ -4127,7 +3654,6 @@ class AppleDeviceInterface extends _InterfacePrototype.default { this.pollingTimeout = setTimeout(() => poll(), 100); return; } - case 'stop': // Parent wants us to stop polling await callback({ @@ -4135,12 +3661,9 @@ class AppleDeviceInterface extends _InterfacePrototype.default { }); } }; - poll(); } - } - exports.AppleDeviceInterface = AppleDeviceInterface; },{"../../packages/device-api/index.js":2,"../Form/matching.js":33,"../InContextSignup.js":34,"../UI/HTMLTooltip.js":44,"../UI/controllers/HTMLTooltipUIController.js":45,"../UI/controllers/NativeUIController.js":46,"../UI/controllers/OverlayUIController.js":47,"../autofill-utils.js":51,"../deviceApiCalls/__generated__/deviceApiCalls.js":55,"../deviceApiCalls/additionalDeviceApiCalls.js":57,"./InterfacePrototype.js":17,"@duckduckgo/content-scope-scripts/src/apple-utils":1}],15:[function(require,module,exports){ @@ -4150,21 +3673,12 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.AppleOverlayDeviceInterface = void 0; - var _AppleDeviceInterface = require("./AppleDeviceInterface.js"); - var _HTMLTooltipUIController = require("../UI/controllers/HTMLTooltipUIController.js"); - var _overlayApi = require("./overlayApi.js"); - var _index = require("../../packages/device-api/index.js"); - var _deviceApiCalls = require("../deviceApiCalls/__generated__/deviceApiCalls.js"); - var _validatorsZod = require("../deviceApiCalls/__generated__/validators.zod.js"); - -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - /** * This subclass is designed to separate code that *only* runs inside the * Overlay into a single place. @@ -4173,17 +3687,18 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope * can be viewed as *not* executing within a regular page context. */ class AppleOverlayDeviceInterface extends _AppleDeviceInterface.AppleDeviceInterface { - constructor() { - super(...arguments); - - _defineProperty(this, "stripCredentials", false); - - _defineProperty(this, "overlay", (0, _overlayApi.overlayApi)(this)); - - _defineProperty(this, "previousX", 0); + /** + * Mark top frame as not stripping credential data + * @type {boolean} + */ + stripCredentials = false; - _defineProperty(this, "previousY", 0); - } + /** + * overlay API helpers + */ + overlay = (0, _overlayApi.overlayApi)(this); + previousX = 0; + previousY = 0; /** * Because we're running inside the Overlay, we always create the HTML @@ -4194,9 +3709,7 @@ class AppleOverlayDeviceInterface extends _AppleDeviceInterface.AppleDeviceInter */ createUIController() { return new _HTMLTooltipUIController.HTMLTooltipUIController({ - tooltipKind: - /** @type {const} */ - 'modern', + tooltipKind: /** @type {const} */'modern', device: this }, { wrapperClass: 'top-autofill', @@ -4206,7 +3719,6 @@ class AppleOverlayDeviceInterface extends _AppleDeviceInterface.AppleDeviceInter testMode: this.isTestMode() }); } - addDeviceListeners() { /** * The native side will send a custom event 'mouseMove' to indicate @@ -4216,26 +3728,25 @@ class AppleOverlayDeviceInterface extends _AppleDeviceInterface.AppleDeviceInter * page load every time it's opened. */ window.addEventListener('mouseMove', event => { - var _this$uiController, _this$uiController$ge; - // Don't set focus if the mouse hasn't moved ever // This is to avoid clickjacking where an attacker puts the pulldown under the cursor // and tricks the user into clicking - if (!this.previousX && !this.previousY || // if no previous coords + if (!this.previousX && !this.previousY || + // if no previous coords this.previousX === event.detail.x && this.previousY === event.detail.y // or the mouse hasn't moved ) { this.previousX = event.detail.x; this.previousY = event.detail.y; return; } - - const activeTooltip = (_this$uiController = this.uiController) === null || _this$uiController === void 0 ? void 0 : (_this$uiController$ge = _this$uiController.getActiveTooltip) === null || _this$uiController$ge === void 0 ? void 0 : _this$uiController$ge.call(_this$uiController); - activeTooltip === null || activeTooltip === void 0 ? void 0 : activeTooltip.focus(event.detail.x, event.detail.y); + const activeTooltip = this.uiController?.getActiveTooltip?.(); + activeTooltip?.focus(event.detail.x, event.detail.y); this.previousX = event.detail.x; this.previousY = event.detail.y; }); return super.addDeviceListeners(); } + /** * Since we're running inside the Overlay we can limit what happens here to * be only things that are needed to power the HTML Tooltip @@ -4243,23 +3754,20 @@ class AppleOverlayDeviceInterface extends _AppleDeviceInterface.AppleDeviceInter * @override * @returns {Promise} */ - - async setupAutofill() { await this._getAutofillInitData(); await this.inContextSignup.init(); const signedIn = await this._checkDeviceSignedIn(); - if (signedIn) { await this.getAddresses(); } } - async postInit() { // setup overlay API pieces this.overlay.showImmediately(); super.postInit(); } + /** * In the top-frame scenario we override the base 'selectedDetail'. * @@ -4269,33 +3777,27 @@ class AppleOverlayDeviceInterface extends _AppleDeviceInterface.AppleDeviceInter * @param {IdentityObject|CreditCardObject|CredentialsObject|{email:string, id: string}} data * @param {string} type */ - - async selectedDetail(data, type) { return this.overlay.selectedDetail(data, type); } - async askToUnlockProvider() { const response = await this.deviceApi.request(new _deviceApiCalls.AskToUnlockProviderCall(null)); this.providerStatusUpdated(response); } - providerStatusUpdated(data) { - var _this$uiController2; - const { credentials, availableInputTypes - } = (0, _index.validate)(data, _validatorsZod.providerStatusUpdatedSchema); // Update local settings and data + } = (0, _index.validate)(data, _validatorsZod.providerStatusUpdatedSchema); + // Update local settings and data this.settings.setAvailableInputTypes(availableInputTypes); - this.storeLocalCredentials(credentials); // rerender the tooltip + this.storeLocalCredentials(credentials); - (_this$uiController2 = this.uiController) === null || _this$uiController2 === void 0 ? void 0 : _this$uiController2.updateItems(credentials); + // rerender the tooltip + this.uiController?.updateItems(credentials); } - } - exports.AppleOverlayDeviceInterface = AppleOverlayDeviceInterface; },{"../../packages/device-api/index.js":2,"../UI/controllers/HTMLTooltipUIController.js":45,"../deviceApiCalls/__generated__/deviceApiCalls.js":55,"../deviceApiCalls/__generated__/validators.zod.js":56,"./AppleDeviceInterface.js":14,"./overlayApi.js":21}],16:[function(require,module,exports){ @@ -4305,42 +3807,31 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.ExtensionInterface = void 0; - var _InterfacePrototype = _interopRequireDefault(require("./InterfacePrototype.js")); - var _autofillUtils = require("../autofill-utils.js"); - var _HTMLTooltipUIController = require("../UI/controllers/HTMLTooltipUIController.js"); - var _HTMLTooltip = require("../UI/HTMLTooltip.js"); - var _InContextSignup = require("../InContextSignup.js"); - var _matching = require("../Form/matching.js"); - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - const TOOLTIP_TYPES = { EmailProtection: 'EmailProtection', EmailSignup: 'EmailSignup' }; - class ExtensionInterface extends _InterfacePrototype.default { - constructor() { - super(...arguments); - - _defineProperty(this, "inContextSignup", new _InContextSignup.InContextSignup(this)); - } + /** + * Adding this here since only the extension currently supports this + */ + inContextSignup = new _InContextSignup.InContextSignup(this); /** * @override */ createUIController() { /** @type {import('../UI/HTMLTooltip.js').HTMLTooltipOptions} */ - const htmlTooltipOptions = { ..._HTMLTooltip.defaultOptions, - css: ""), + const htmlTooltipOptions = { + ..._HTMLTooltip.defaultOptions, + css: ``, testMode: this.isTestMode(), hasCaret: true }; @@ -4354,23 +3845,16 @@ class ExtensionInterface extends _InterfacePrototype.default { device: this }, htmlTooltipOptions); } - getActiveTooltipType() { - var _this$activeForm, _this$inContextSignup; - if (this.hasLocalAddresses) { return TOOLTIP_TYPES.EmailProtection; } - - const inputType = (_this$activeForm = this.activeForm) !== null && _this$activeForm !== void 0 && _this$activeForm.activeInput ? (0, _matching.getInputSubtype)(this.activeForm.activeInput) : undefined; - - if ((_this$inContextSignup = this.inContextSignup) !== null && _this$inContextSignup !== void 0 && _this$inContextSignup.isAvailable(inputType)) { + const inputType = this.activeForm?.activeInput ? (0, _matching.getInputSubtype)(this.activeForm.activeInput) : undefined; + if (this.inContextSignup?.isAvailable(inputType)) { return TOOLTIP_TYPES.EmailSignup; } - return null; } - async resetAutofillUI(callback) { this.removeAutofillUIFromPage('Resetting autofill.'); await this.setupAutofill(); @@ -4378,12 +3862,9 @@ class ExtensionInterface extends _InterfacePrototype.default { this.uiController = this.createUIController(); await this.postInit(); } - async isEnabled() { return new Promise(resolve => { - var _chrome, _chrome$runtime; - - (_chrome = chrome) === null || _chrome === void 0 ? void 0 : (_chrome$runtime = _chrome.runtime) === null || _chrome$runtime === void 0 ? void 0 : _chrome$runtime.sendMessage({ + chrome?.runtime?.sendMessage({ registeredTempAutofillContentScript: true, documentUrl: window.location.href }, response => { @@ -4393,11 +3874,9 @@ class ExtensionInterface extends _InterfacePrototype.default { }); }); } - isDeviceSignedIn() { return this.hasLocalAddresses; } - async setupAutofill() { /** * In the extension, we must resolve `inContextSignup` data as part of setup @@ -4405,17 +3884,13 @@ class ExtensionInterface extends _InterfacePrototype.default { await this.inContextSignup.init(); return this.getAddresses(); } - postInit() { switch (this.getActiveTooltipType()) { case TOOLTIP_TYPES.EmailProtection: { - var _this$activeForm2; - this._scannerCleanup = this.scanner.init(); this.addLogoutListener(() => { this.resetAutofillUI(); - if (this.globalConfig.isDDGDomain) { (0, _autofillUtils.notifyWebApp)({ deviceSignedIn: { @@ -4424,13 +3899,10 @@ class ExtensionInterface extends _InterfacePrototype.default { }); } }); - - if ((_this$activeForm2 = this.activeForm) !== null && _this$activeForm2 !== void 0 && _this$activeForm2.activeInput) { - var _this$activeForm3; - + if (this.activeForm?.activeInput) { this.attachTooltip({ form: this.activeForm, - input: (_this$activeForm3 = this.activeForm) === null || _this$activeForm3 === void 0 ? void 0 : _this$activeForm3.activeInput, + input: this.activeForm?.activeInput, click: null, trigger: 'postSignup', triggerMetaData: { @@ -4438,16 +3910,13 @@ class ExtensionInterface extends _InterfacePrototype.default { } }); } - break; } - case TOOLTIP_TYPES.EmailSignup: { this._scannerCleanup = this.scanner.init(); break; } - default: { // Don't do anyhing if we don't have a tooltip to show @@ -4455,7 +3924,6 @@ class ExtensionInterface extends _InterfacePrototype.default { } } } - getAddresses() { return new Promise(resolve => chrome.runtime.sendMessage({ getAddresses: true @@ -4464,41 +3932,38 @@ class ExtensionInterface extends _InterfacePrototype.default { return resolve(data); })); } + /** * Used by the email web app * Settings page displays data of the logged in user data */ - - getUserData() { return new Promise(resolve => chrome.runtime.sendMessage({ getUserData: true }, data => resolve(data))); } + /** * Used by the email web app * Device capabilities determine which functionality is available to the user */ - - getEmailProtectionCapabilities() { return new Promise(resolve => chrome.runtime.sendMessage({ getEmailProtectionCapabilities: true }, data => resolve(data))); } - refreshAlias() { return chrome.runtime.sendMessage({ refreshAlias: true }, addresses => this.storeLocalAddresses(addresses)); } - async trySigningIn() { if (this.globalConfig.isDDGDomain) { const data = await (0, _autofillUtils.sendAndWaitForAnswer)(_autofillUtils.SIGN_IN_MSG, 'addUserData'); this.storeUserData(data); } } + /** * @param {object} message * @param {object} message.addUserData @@ -4506,23 +3971,19 @@ class ExtensionInterface extends _InterfacePrototype.default { * @param {string} message.addUserData.userName * @param {string} message.addUserData.cohort */ - - storeUserData(message) { return chrome.runtime.sendMessage(message); } + /** * Used by the email web app * Provides functionality to log the user out */ - - removeUserData() { return chrome.runtime.sendMessage({ removeUserData: true }); } - addDeviceListeners() { // Add contextual menu listeners let activeEl = null; @@ -4531,49 +3992,43 @@ class ExtensionInterface extends _InterfacePrototype.default { }); chrome.runtime.onMessage.addListener((message, sender) => { if (sender.id !== chrome.runtime.id) return; - switch (message.type) { case 'ddgUserReady': this.resetAutofillUI(() => this.setupSettingsPage({ shouldLog: true })); break; - case 'contextualAutofill': (0, _autofillUtils.setValue)(activeEl, (0, _autofillUtils.formatDuckAddress)(message.alias), this.globalConfig); activeEl.classList.add('ddg-autofilled'); - this.refreshAlias(); // If the user changes the alias, remove the decoration + this.refreshAlias(); + // If the user changes the alias, remove the decoration activeEl.addEventListener('input', e => e.target.classList.remove('ddg-autofilled'), { once: true }); break; - default: break; } }); } - addLogoutListener(handler) { // Make sure there's only one log out listener attached by removing the // previous logout listener first, if it exists. if (this._logoutListenerHandler) { chrome.runtime.onMessage.removeListener(this._logoutListenerHandler); - } // Cleanup on logout events - + } + // Cleanup on logout events this._logoutListenerHandler = (message, sender) => { if (sender.id === chrome.runtime.id && message.type === 'logout') { handler(); } }; - chrome.runtime.onMessage.addListener(this._logoutListenerHandler); } - } - exports.ExtensionInterface = ExtensionInterface; },{"../Form/matching.js":33,"../InContextSignup.js":34,"../UI/HTMLTooltip.js":44,"../UI/controllers/HTMLTooltipUIController.js":45,"../autofill-utils.js":51,"./InterfacePrototype.js":17}],17:[function(require,module,exports){ @@ -4583,90 +4038,69 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; - var _autofillUtils = require("../autofill-utils.js"); - var _matching = require("../Form/matching.js"); - var _formatters = require("../Form/formatters.js"); - var _Credentials = require("../InputTypes/Credentials.js"); - var _PasswordGenerator = require("../PasswordGenerator.js"); - var _Scanner = require("../Scanner.js"); - var _config = require("../config.js"); - var _NativeUIController = require("../UI/controllers/NativeUIController.js"); - var _transports = require("../deviceApiCalls/transports/transports.js"); - var _Settings = require("../Settings.js"); - var _index = require("../../packages/device-api/index.js"); - var _deviceApiCalls = require("../deviceApiCalls/__generated__/deviceApiCalls.js"); - var _initFormSubmissionsApi = require("./initFormSubmissionsApi.js"); - var _validatorsZod = require("../deviceApiCalls/__generated__/validators.zod.js"); - var _EmailProtection = require("../EmailProtection.js"); - -function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); } - -function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } } - -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - -function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; } - -function _classApplyDescriptorSet(receiver, descriptor, value) { if (descriptor.set) { descriptor.set.call(receiver, value); } else { if (!descriptor.writable) { throw new TypeError("attempted to set read only private field"); } descriptor.value = value; } } - -function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); } - -function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); } - -function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; } - -var _addresses = /*#__PURE__*/new WeakMap(); - -var _data2 = /*#__PURE__*/new WeakMap(); - /** * @typedef {import('../deviceApiCalls/__generated__/validators-ts').StoreFormData} StoreFormData */ - /** * @implements {GlobalConfigImpl} * @implements {FormExtensionPoints} * @implements {DeviceExtensionPoints} */ class InterfacePrototype { + attempts = 0; /** @type {import("../Form/Form").Form | null} */ - + activeForm = null; /** @type {import("../UI/HTMLTooltip.js").default | null} */ - + currentTooltip = null; /** @type {number} */ + initialSetupDelayMs = 0; + autopromptFired = false; /** @type {PasswordGenerator} */ + passwordGenerator = new _PasswordGenerator.PasswordGenerator(); + emailProtection = new _EmailProtection.EmailProtection(this); /** @type {import("../InContextSignup.js").InContextSignup | null} */ + inContextSignup = null; /** @type {{privateAddress: string, personalAddress: string}} */ + #addresses = { + privateAddress: '', + personalAddress: '' + }; /** @type {GlobalConfig} */ + globalConfig; /** @type {import('../Scanner').Scanner} */ + scanner; /** @type {import("../UI/controllers/UIController.js").UIController | null} */ + uiController; /** @type {import("../../packages/device-api").DeviceApi} */ + deviceApi; /** @type {boolean} */ + isInitializationStarted; /** @type {((reason, ...rest) => void) | null} */ + _scannerCleanup = null; /** * @param {GlobalConfig} config @@ -4674,52 +4108,6 @@ class InterfacePrototype { * @param {Settings} settings */ constructor(config, deviceApi, settings) { - _defineProperty(this, "attempts", 0); - - _defineProperty(this, "activeForm", null); - - _defineProperty(this, "currentTooltip", null); - - _defineProperty(this, "initialSetupDelayMs", 0); - - _defineProperty(this, "autopromptFired", false); - - _defineProperty(this, "passwordGenerator", new _PasswordGenerator.PasswordGenerator()); - - _defineProperty(this, "emailProtection", new _EmailProtection.EmailProtection(this)); - - _defineProperty(this, "inContextSignup", null); - - _classPrivateFieldInitSpec(this, _addresses, { - writable: true, - value: { - privateAddress: '', - personalAddress: '' - } - }); - - _defineProperty(this, "globalConfig", void 0); - - _defineProperty(this, "scanner", void 0); - - _defineProperty(this, "uiController", void 0); - - _defineProperty(this, "deviceApi", void 0); - - _defineProperty(this, "isInitializationStarted", void 0); - - _defineProperty(this, "_scannerCleanup", null); - - _classPrivateFieldInitSpec(this, _data2, { - writable: true, - value: { - credentials: [], - creditCards: [], - identities: [], - topContextData: undefined - } - }); - this.globalConfig = config; this.deviceApi = deviceApi; this.settings = settings; @@ -4729,60 +4117,56 @@ class InterfacePrototype { }); this.isInitializationStarted = false; } + /** * Implementors should override this with a UI controller that suits * their platform. * * @returns {import("../UI/controllers/UIController.js").UIController} */ - - createUIController() { return new _NativeUIController.NativeUIController(); } + /** * @param {string} reason */ - - removeAutofillUIFromPage(reason) { - var _this$uiController, _this$_scannerCleanup; - - (_this$uiController = this.uiController) === null || _this$uiController === void 0 ? void 0 : _this$uiController.destroy(); - (_this$_scannerCleanup = this._scannerCleanup) === null || _this$_scannerCleanup === void 0 ? void 0 : _this$_scannerCleanup.call(this, reason); + this.uiController?.destroy(); + this._scannerCleanup?.(reason); } - get hasLocalAddresses() { - var _classPrivateFieldGet2, _classPrivateFieldGet3; - - return !!((_classPrivateFieldGet2 = _classPrivateFieldGet(this, _addresses)) !== null && _classPrivateFieldGet2 !== void 0 && _classPrivateFieldGet2.privateAddress && (_classPrivateFieldGet3 = _classPrivateFieldGet(this, _addresses)) !== null && _classPrivateFieldGet3 !== void 0 && _classPrivateFieldGet3.personalAddress); + return !!(this.#addresses?.privateAddress && this.#addresses?.personalAddress); } - getLocalAddresses() { - return _classPrivateFieldGet(this, _addresses); + return this.#addresses; } - storeLocalAddresses(addresses) { - _classPrivateFieldSet(this, _addresses, addresses); // When we get new duck addresses, add them to the identities list - - + this.#addresses = addresses; + // When we get new duck addresses, add them to the identities list const identities = this.getLocalIdentities(); const privateAddressIdentity = identities.find(_ref => { let { id } = _ref; return id === 'privateAddress'; - }); // If we had previously stored them, just update the private address - + }); + // If we had previously stored them, just update the private address if (privateAddressIdentity) { privateAddressIdentity.emailAddress = (0, _autofillUtils.formatDuckAddress)(addresses.privateAddress); } else { // Otherwise, add both addresses - _classPrivateFieldGet(this, _data2).identities = this.addDuckAddressesToIdentities(identities); + this.#data.identities = this.addDuckAddressesToIdentities(identities); } } - /** @type { PMData } */ + /** @type { PMData } */ + #data = { + credentials: [], + creditCards: [], + identities: [], + topContextData: undefined + }; /** * @returns {import('../Form/matching').SupportedTypes} @@ -4790,7 +4174,6 @@ class InterfacePrototype { getCurrentInputType() { throw new Error('Not implemented'); } - addDuckAddressesToIdentities(identities) { if (!this.hasLocalAddresses) return identities; const newIdentities = []; @@ -4799,16 +4182,18 @@ class InterfacePrototype { personalAddress } = this.getLocalAddresses(); privateAddress = (0, _autofillUtils.formatDuckAddress)(privateAddress); - personalAddress = (0, _autofillUtils.formatDuckAddress)(personalAddress); // Get the duck addresses in identities + personalAddress = (0, _autofillUtils.formatDuckAddress)(personalAddress); + // Get the duck addresses in identities const duckEmailsInIdentities = identities.reduce((duckEmails, _ref2) => { let { emailAddress: email } = _ref2; - return email !== null && email !== void 0 && email.includes(_autofillUtils.ADDRESS_DOMAIN) ? duckEmails.concat(email) : duckEmails; - }, []); // Only add the personal duck address to identities if the user hasn't - // already manually added it + return email?.includes(_autofillUtils.ADDRESS_DOMAIN) ? duckEmails.concat(email) : duckEmails; + }, []); + // Only add the personal duck address to identities if the user hasn't + // already manually added it if (!duckEmailsInIdentities.includes(personalAddress)) { newIdentities.push({ id: 'personalAddress', @@ -4816,7 +4201,6 @@ class InterfacePrototype { title: 'Block email trackers' }); } - newIdentities.push({ id: 'privateAddress', emailAddress: privateAddress, @@ -4824,58 +4208,55 @@ class InterfacePrototype { }); return [...identities, ...newIdentities]; } + /** * Stores init data coming from the tooltipHandler * @param { InboundPMData } data */ - - storeLocalData(data) { this.storeLocalCredentials(data.credentials); - data.creditCards.forEach(cc => delete cc.cardNumber && delete cc.cardSecurityCode); // Store the full name as a separate field to simplify autocomplete - - const updatedIdentities = data.identities.map(identity => ({ ...identity, + data.creditCards.forEach(cc => delete cc.cardNumber && delete cc.cardSecurityCode); + // Store the full name as a separate field to simplify autocomplete + const updatedIdentities = data.identities.map(identity => ({ + ...identity, fullName: (0, _formatters.formatFullName)(identity) - })); // Add addresses - - _classPrivateFieldGet(this, _data2).identities = this.addDuckAddressesToIdentities(updatedIdentities); - _classPrivateFieldGet(this, _data2).creditCards = data.creditCards; // Top autofill only + })); + // Add addresses + this.#data.identities = this.addDuckAddressesToIdentities(updatedIdentities); + this.#data.creditCards = data.creditCards; + // Top autofill only if (data.serializedInputContext) { try { - _classPrivateFieldGet(this, _data2).topContextData = JSON.parse(data.serializedInputContext); + this.#data.topContextData = JSON.parse(data.serializedInputContext); } catch (e) { console.error(e); this.removeTooltip(); } } } + /** * Stores credentials locally * @param {CredentialsObject[]} credentials */ - - storeLocalCredentials(credentials) { credentials.forEach(cred => delete cred.password); - _classPrivateFieldGet(this, _data2).credentials = credentials; + this.#data.credentials = credentials; } - getTopContextData() { - return _classPrivateFieldGet(this, _data2).topContextData; + return this.#data.topContextData; } + /** * @deprecated use `availableInputTypes.credentials` directly instead * @returns {boolean} */ - - get hasLocalCredentials() { - return _classPrivateFieldGet(this, _data2).credentials.length > 0; + return this.#data.credentials.length > 0; } - getLocalCredentials() { - return _classPrivateFieldGet(this, _data2).credentials.map(cred => { + return this.#data.credentials.map(cred => { const { password, ...rest @@ -4887,51 +4268,44 @@ class InterfacePrototype { * @deprecated use `availableInputTypes.identities` directly instead * @returns {boolean} */ - - get hasLocalIdentities() { - return _classPrivateFieldGet(this, _data2).identities.length > 0; + return this.#data.identities.length > 0; } - getLocalIdentities() { - return _classPrivateFieldGet(this, _data2).identities; + return this.#data.identities; } + /** * @deprecated use `availableInputTypes.creditCards` directly instead * @returns {boolean} */ - - get hasLocalCreditCards() { - return _classPrivateFieldGet(this, _data2).creditCards.length > 0; + return this.#data.creditCards.length > 0; } /** @return {CreditCardObject[]} */ - - getLocalCreditCards() { - return _classPrivateFieldGet(this, _data2).creditCards; + return this.#data.creditCards; } - async startInit() { if (this.isInitializationStarted) return; this.alreadyInitialized = true; await this.refreshSettings(); this.addDeviceListeners(); await this.setupAutofill(); - this.uiController = this.createUIController(); // this is the temporary measure to support windows whilst we still have 'setupAutofill' - // eventually all interfaces will use this + this.uiController = this.createUIController(); + // this is the temporary measure to support windows whilst we still have 'setupAutofill' + // eventually all interfaces will use this if (!this.isEnabledViaSettings()) { return; } - await this.setupSettingsPage(); await this.postInit(); - if (this.settings.featureToggles.credentials_saving) { (0, _initFormSubmissionsApi.initFormSubmissionsApi)(this.scanner.forms, this.scanner.matching); } } + /** * This is to aid the migration to all platforms using Settings.enabled. * @@ -4943,11 +4317,10 @@ class InterfacePrototype { * * @returns {boolean} */ - - isEnabledViaSettings() { return true; } + /** * This is a fall-back situation for macOS since it was the only * platform to support anything none-email based in the past. @@ -4956,20 +4329,15 @@ class InterfacePrototype { * * @returns {Promise} */ - - async refreshSettings() { await this.settings.refresh(); } - async isEnabled() { return (0, _autofillUtils.autofillEnabled)(this.globalConfig); } - async init() { const isEnabled = await this.isEnabled(); if (!isEnabled) return; - const handler = async () => { if (document.readyState === 'complete') { window.removeEventListener('load', handler); @@ -4977,7 +4345,6 @@ class InterfacePrototype { await this.startInit(); } }; - if (document.readyState === 'complete') { await this.startInit(); } else { @@ -4985,12 +4352,10 @@ class InterfacePrototype { document.addEventListener('readystatechange', handler); } } - postInit() { const cleanup = this.scanner.init(); this.addLogoutListener(() => { cleanup('Logged out'); - if (this.globalConfig.isDDGDomain) { (0, _autofillUtils.notifyWebApp)({ deviceSignedIn: { @@ -5000,19 +4365,18 @@ class InterfacePrototype { } }); } + /** * @deprecated This was a port from the macOS implementation so the API may not be suitable for all * @returns {Promise} */ - - async getSelectedCredentials() { throw new Error('`getSelectedCredentials` not implemented'); } - isTestMode() { return this.globalConfig.isDDGTestMode; } + /** * This indicates an item was selected on Desktop, and we should try to autofill * @@ -5022,35 +4386,30 @@ class InterfacePrototype { * @param {IdentityObject|CreditCardObject|CredentialsObject|{email:string, id: string}} data * @param {string} type */ - - async selectedDetail(data, type) { const form = this.activeForm; - if (!form) { return; - } // are we autofilling email? - + } + // are we autofilling email? if (type === 'email' && 'email' in data) { form.autofillEmail(data.email); } else { form.autofillData(data, type); } - const isPrivateAddress = data.id === 'privateAddress'; + /** * This is desktop only: was it a private address? if so, save it with * the trigger 'emailProtection' so that native sides can use it */ - if (isPrivateAddress) { this.refreshAlias(); - if ('emailAddress' in data && data.emailAddress) { this.emailProtection.storeReceived(data.emailAddress); - /** @type {DataStorageObject} */ + /** @type {DataStorageObject} */ const formValues = { credentials: { username: data.emailAddress, @@ -5060,9 +4419,9 @@ class InterfacePrototype { this.storeFormData(formValues, 'emailProtection'); } } - await this.removeTooltip(); } + /** * Before the DataWebTooltip opens, we collect the data based on the config.type * @param {InputTypeConfigs} config @@ -5070,19 +4429,14 @@ class InterfacePrototype { * @param {TopContextData} [data] * @returns {(CredentialsObject|CreditCardObject|IdentityObject)[]} */ - - dataForAutofill(config, inputType, data) { const subtype = (0, _matching.getSubtypeFromType)(inputType); - if (config.type === 'identities') { return this.getLocalIdentities().filter(identity => !!identity[subtype]); } - if (config.type === 'creditCards') { return this.getLocalCreditCards(); } - if (config.type === 'credentials') { if (data) { if (Array.isArray(data.credentials) && data.credentials.length > 0) { @@ -5092,9 +4446,9 @@ class InterfacePrototype { } } } - return []; } + /** * @param {object} params * @param {import("../Form/Form").Form} params.form @@ -5103,35 +4457,31 @@ class InterfacePrototype { * @param {import('../deviceApiCalls/__generated__/validators-ts').GetAutofillDataRequest['trigger']} params.trigger * @param {import('../UI/controllers/UIController.js').AttachArgs["triggerMetaData"]} params.triggerMetaData */ - - attachTooltip(params) { - var _this$uiController2; - const { form, input, click, trigger - } = params; // Avoid flashing tooltip from background tabs on macOS - - if (document.visibilityState !== 'visible' && trigger !== 'postSignup') return; // Only autoprompt on mobile devices - - if (trigger === 'autoprompt' && !this.globalConfig.isMobileApp) return; // Only fire autoprompt once - + } = params; + // Avoid flashing tooltip from background tabs on macOS + if (document.visibilityState !== 'visible' && trigger !== 'postSignup') return; + // Only autoprompt on mobile devices + if (trigger === 'autoprompt' && !this.globalConfig.isMobileApp) return; + // Only fire autoprompt once if (trigger === 'autoprompt' && this.autopromptFired) return; form.activeInput = input; this.activeForm = form; const inputType = (0, _matching.getInputType)(input); - /** @type {PosFn} */ + /** @type {PosFn} */ const getPosition = () => { // In extensions, the tooltip is centered on the Dax icon const alignLeft = this.globalConfig.isApp || this.globalConfig.isWindows; return alignLeft ? input.getBoundingClientRect() : (0, _autofillUtils.getDaxBoundingBox)(input); - }; // todo: this will be migrated to use NativeUIController soon - + }; + // todo: this will be migrated to use NativeUIController soon if (this.globalConfig.isMobileApp && inputType === 'identities.emailAddress') { this.getAlias().then(alias => { if (alias) { @@ -5140,31 +4490,28 @@ class InterfacePrototype { * We're on mobile here, so we just record the email received. * Then later in the form submission we can compare the values */ - this.emailProtection.storeReceived(alias); } else { - var _form$activeInput; + form.activeInput?.focus(); + } - (_form$activeInput = form.activeInput) === null || _form$activeInput === void 0 ? void 0 : _form$activeInput.focus(); - } // Update data from native-side in case the `getAlias` call + // Update data from native-side in case the `getAlias` call // has included a successful in-context signup - - this.updateForStateChange(); this.onFinishedAutofill(); }); return; } - /** @type {TopContextData} */ - + /** @type {TopContextData} */ const topContextData = { inputType - }; // Allow features to append/change top context data - // for example, generated passwords may get appended here + }; + // Allow features to append/change top context data + // for example, generated passwords may get appended here const processedTopContext = this.preAttachTooltip(topContextData, input, form); - (_this$uiController2 = this.uiController) === null || _this$uiController2 === void 0 ? void 0 : _this$uiController2.attach({ + this.uiController?.attach({ input, form, click, @@ -5174,11 +4521,11 @@ class InterfacePrototype { trigger, triggerMetaData: params.triggerMetaData }); - if (trigger === 'autoprompt') { this.autopromptFired = true; } } + /** * When an item was selected, we then call back to the device * to fetch the full suite of data needed to complete the autofill @@ -5187,52 +4534,43 @@ class InterfacePrototype { * @param {(CreditCardObject|IdentityObject|CredentialsObject)[]} items * @param {CreditCardObject['id']|IdentityObject['id']|CredentialsObject['id']} id */ - - onSelect(inputType, items, id) { id = String(id); const mainType = (0, _matching.getMainTypeFromType)(inputType); const subtype = (0, _matching.getSubtypeFromType)(inputType); - if (id === _Credentials.PROVIDER_LOCKED) { return this.askToUnlockProvider(); } - const matchingData = items.find(item => String(item.id) === id); if (!matchingData) throw new Error('unreachable (fatal)'); - const dataPromise = (() => { switch (mainType) { case 'creditCards': return this.getAutofillCreditCard(id); - case 'identities': return this.getAutofillIdentity(id); - case 'credentials': { if (_Credentials.AUTOGENERATED_KEY in matchingData) { - const autogeneratedPayload = { ...matchingData, + const autogeneratedPayload = { + ...matchingData, username: '' }; return Promise.resolve({ success: autogeneratedPayload }); } - return this.getAutofillCredentials(id); } - default: throw new Error('unreachable!'); } - })(); // wait for the data back from the device - + })(); + // wait for the data back from the device dataPromise.then(response => { if (response) { const data = response.success || response; - if (mainType === 'identities') { this.firePixel({ pixelName: 'autofill_identity', @@ -5240,35 +4578,29 @@ class InterfacePrototype { fieldType: subtype } }); - switch (id) { case 'personalAddress': this.firePixel({ pixelName: 'autofill_personal_address' }); break; - case 'privateAddress': this.firePixel({ pixelName: 'autofill_private_address' }); break; - default: // Also fire pixel when filling an identity with the personal duck address from an email field - const checks = [subtype === 'emailAddress', this.hasLocalAddresses, (data === null || data === void 0 ? void 0 : data.emailAddress) === (0, _autofillUtils.formatDuckAddress)(_classPrivateFieldGet(this, _addresses).personalAddress)]; - + const checks = [subtype === 'emailAddress', this.hasLocalAddresses, data?.emailAddress === (0, _autofillUtils.formatDuckAddress)(this.#addresses.personalAddress)]; if (checks.every(Boolean)) { this.firePixel({ pixelName: 'autofill_personal_address' }); } - break; } - } // some platforms do not include a `success` object, why? - - + } + // some platforms do not include a `success` object, why? return this.selectedDetail(data, mainType); } else { return Promise.reject(new Error('none-success response')); @@ -5278,91 +4610,68 @@ class InterfacePrototype { return this.removeTooltip(); }); } - async askToUnlockProvider() { const response = await this.deviceApi.request(new _deviceApiCalls.AskToUnlockProviderCall(null)); this.providerStatusUpdated(response); } - isTooltipActive() { - var _this$uiController$is, _this$uiController3, _this$uiController3$i; - - return (_this$uiController$is = (_this$uiController3 = this.uiController) === null || _this$uiController3 === void 0 ? void 0 : (_this$uiController3$i = _this$uiController3.isActive) === null || _this$uiController3$i === void 0 ? void 0 : _this$uiController3$i.call(_this$uiController3)) !== null && _this$uiController$is !== void 0 ? _this$uiController$is : false; + return this.uiController?.isActive?.() ?? false; } - removeTooltip() { - var _this$uiController4, _this$uiController4$r; - - return (_this$uiController4 = this.uiController) === null || _this$uiController4 === void 0 ? void 0 : (_this$uiController4$r = _this$uiController4.removeTooltip) === null || _this$uiController4$r === void 0 ? void 0 : _this$uiController4$r.call(_this$uiController4, 'interface'); + return this.uiController?.removeTooltip?.('interface'); } - onFinishedAutofill() { - var _this$activeForm, _this$activeForm$acti; - // Let input handlers know we've stopped autofilling - (_this$activeForm = this.activeForm) === null || _this$activeForm === void 0 ? void 0 : (_this$activeForm$acti = _this$activeForm.activeInput) === null || _this$activeForm$acti === void 0 ? void 0 : _this$activeForm$acti.dispatchEvent(new Event('mouseleave')); + this.activeForm?.activeInput?.dispatchEvent(new Event('mouseleave')); } - async updateForStateChange() { - var _this$activeForm2, _this$activeForm3; - // Remove decorations before refreshing data to make sure we // remove the currently set icons - (_this$activeForm2 = this.activeForm) === null || _this$activeForm2 === void 0 ? void 0 : _this$activeForm2.removeAllDecorations(); // Update for any state that may have changed + this.activeForm?.removeAllDecorations(); - await this.refreshData(); // Add correct icons and behaviour + // Update for any state that may have changed + await this.refreshData(); - (_this$activeForm3 = this.activeForm) === null || _this$activeForm3 === void 0 ? void 0 : _this$activeForm3.recategorizeAllInputs(); + // Add correct icons and behaviour + this.activeForm?.recategorizeAllInputs(); } - async refreshData() { - var _this$inContextSignup; - - await ((_this$inContextSignup = this.inContextSignup) === null || _this$inContextSignup === void 0 ? void 0 : _this$inContextSignup.refreshData()); + await this.inContextSignup?.refreshData(); await this.settings.populateData(); } - async setupSettingsPage() { let { shouldLog } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : { shouldLog: false }; - if (!this.globalConfig.isDDGDomain) { return; } - (0, _autofillUtils.notifyWebApp)({ isApp: this.globalConfig.isApp }); - if (this.isDeviceSignedIn()) { let userData; - try { userData = await this.getUserData(); } catch (e) {} - let capabilities; - try { capabilities = await this.getEmailProtectionCapabilities(); - } catch (e) {} // Set up listener for web app actions - + } catch (e) {} + // Set up listener for web app actions if (this.globalConfig.isDDGDomain) { window.addEventListener('message', e => { if (e.data.removeUserData) { this.removeUserData(); } - if (e.data.closeEmailProtection) { this.closeEmailProtection(); } }); } - const hasUserData = userData && !userData.error && Object.entries(userData).length > 0; (0, _autofillUtils.notifyWebApp)({ deviceSignedIn: { @@ -5376,43 +4685,35 @@ class InterfacePrototype { this.trySigningIn(); } } - async setupAutofill() {} - /** @returns {Promise} */ - + /** @returns {Promise} */ async getAddresses() { throw new Error('unimplemented'); } - /** @returns {Promise>} */ - + /** @returns {Promise>} */ getUserData() { return Promise.resolve(null); } - /** @returns {void} */ - - removeUserData() {} /** @returns {void} */ + removeUserData() {} - + /** @returns {void} */ closeEmailProtection() {} - /** @returns {Promise>} */ - + /** @returns {Promise>} */ getEmailProtectionCapabilities() { throw new Error('unimplemented'); } - refreshAlias() {} - async trySigningIn() { if (this.globalConfig.isDDGDomain) { if (this.attempts < 10) { this.attempts++; - const data = await (0, _autofillUtils.sendAndWaitForAnswer)(_autofillUtils.SIGN_IN_MSG, 'addUserData'); // This call doesn't send a response, so we can't know if it succeeded - + const data = await (0, _autofillUtils.sendAndWaitForAnswer)(_autofillUtils.SIGN_IN_MSG, 'addUserData'); + // This call doesn't send a response, so we can't know if it succeeded this.storeUserData(data); await this.setupAutofill(); await this.refreshSettings(); @@ -5425,37 +4726,32 @@ class InterfacePrototype { } } } - storeUserData(_data) {} - addDeviceListeners() {} + /** * Called by the native layer on all tabs when the provider status is updated * @param {import("../deviceApiCalls/__generated__/validators-ts").ProviderStatusUpdated} data */ - - providerStatusUpdated(data) { try { - var _this$uiController5, _availableInputTypes$; - const { credentials, availableInputTypes - } = (0, _index.validate)(data, _validatorsZod.providerStatusUpdatedSchema); // Update local settings and data + } = (0, _index.validate)(data, _validatorsZod.providerStatusUpdatedSchema); + // Update local settings and data this.settings.setAvailableInputTypes(availableInputTypes); - this.storeLocalCredentials(credentials); // rerender the tooltip - - (_this$uiController5 = this.uiController) === null || _this$uiController5 === void 0 ? void 0 : _this$uiController5.updateItems(credentials); // If the tooltip is open on an autofill type that's not available, close it + this.storeLocalCredentials(credentials); + // rerender the tooltip + this.uiController?.updateItems(credentials); + // If the tooltip is open on an autofill type that's not available, close it const currentInputSubtype = (0, _matching.getSubtypeFromType)(this.getCurrentInputType()); - - if (!((_availableInputTypes$ = availableInputTypes.credentials) !== null && _availableInputTypes$ !== void 0 && _availableInputTypes$[currentInputSubtype])) { + if (!availableInputTypes.credentials?.[currentInputSubtype]) { this.removeTooltip(); - } // Redecorate fields according to the new types - - + } + // Redecorate fields according to the new types this.scanner.forms.forEach(form => form.recategorizeAllInputs()); } catch (e) { if (this.globalConfig.isDDGTestMode) { @@ -5463,66 +4759,53 @@ class InterfacePrototype { } } } - /** @param {() => void} _fn */ - + /** @param {() => void} _fn */ addLogoutListener(_fn) {} - isDeviceSignedIn() { return false; } /** * @returns {Promise} */ - - async getAlias() { return undefined; - } // PM endpoints - - + } + // PM endpoints getAccounts() {} /** * Gets credentials ready for autofill * @param {CredentialsObject['id']} id - the credential id * @returns {Promise} */ - - async getAutofillCredentials(id) { return this.deviceApi.request(new _deviceApiCalls.GetAutofillCredentialsCall({ id: String(id) })); } /** @returns {APIResponse} */ - - async getAutofillCreditCard(_id) { throw new Error('getAutofillCreditCard unimplemented'); } /** @returns {Promise<{success: IdentityObject|undefined}>} */ - - async getAutofillIdentity(_id) { throw new Error('getAutofillIdentity unimplemented'); } - openManagePasswords() {} - openManageCreditCards() {} - openManageIdentities() {} + /** * @param {StoreFormData} values * @param {StoreFormData['trigger']} trigger */ - - storeFormData(values, trigger) { - this.deviceApi.notify(new _deviceApiCalls.StoreFormDataCall({ ...values, + this.deviceApi.notify(new _deviceApiCalls.StoreFormDataCall({ + ...values, trigger })); } + /** * `preAttachTooltip` happens just before a tooltip is show - features may want to append some data * at this point. @@ -5534,27 +4817,25 @@ class InterfacePrototype { * @param {HTMLInputElement} input * @param {import("../Form/Form").Form} form */ - - preAttachTooltip(topContextData, input, form) { // A list of checks to determine if we need to generate a password - const checks = [topContextData.inputType === 'credentials.password', this.settings.featureToggles.password_generation, form.isSignup]; // if all checks pass, generate and save a password + const checks = [topContextData.inputType === 'credentials.password', this.settings.featureToggles.password_generation, form.isSignup]; + // if all checks pass, generate and save a password if (checks.every(Boolean)) { - var _rawValues$credential, _rawValues$identities; - const password = this.passwordGenerator.generate({ input: input.getAttribute('passwordrules'), domain: window.location.hostname }); const rawValues = form.getRawValues(); - const username = ((_rawValues$credential = rawValues.credentials) === null || _rawValues$credential === void 0 ? void 0 : _rawValues$credential.username) || ((_rawValues$identities = rawValues.identities) === null || _rawValues$identities === void 0 ? void 0 : _rawValues$identities.emailAddress) || ''; // append the new credential to the topContextData so that the top autofill can display it + const username = rawValues.credentials?.username || rawValues.identities?.emailAddress || ''; + // append the new credential to the topContextData so that the top autofill can display it topContextData.credentials = [(0, _Credentials.fromPassword)(password, username)]; } - return topContextData; } + /** * `postAutofill` gives features an opportunity to perform an action directly * following an autofill. @@ -5565,17 +4846,13 @@ class InterfacePrototype { * @param {SupportedMainTypes} dataType * @param {import("../Form/Form").Form} formObj */ - - postAutofill(data, dataType, formObj) { // If there's an autogenerated password, prompt to save - if (_Credentials.AUTOGENERATED_KEY in data && 'password' in data && // Don't send message on Android to avoid potential abuse. Data is saved on native confirmation instead. + if (_Credentials.AUTOGENERATED_KEY in data && 'password' in data && + // Don't send message on Android to avoid potential abuse. Data is saved on native confirmation instead. !this.globalConfig.isAndroid) { - var _formValues$credentia; - const formValues = formObj.getValuesReadyForStorage(); - - if (((_formValues$credentia = formValues.credentials) === null || _formValues$credentia === void 0 ? void 0 : _formValues$credentia.password) === data.password) { + if (formValues.credentials?.password === data.password) { /** @type {StoreFormData} */ const formData = (0, _Credentials.appendGeneratedKey)(formValues, { password: data.password @@ -5583,11 +4860,11 @@ class InterfacePrototype { this.storeFormData(formData, 'passwordGeneration'); } } - if (dataType === 'credentials' && formObj.shouldAutoSubmit) { formObj.attemptSubmissionIfNeeded(); } } + /** * `postSubmit` gives features a one-time-only opportunity to perform an * action directly after a form submission was observed. @@ -5599,13 +4876,10 @@ class InterfacePrototype { * @param {DataStorageObject} values * @param {import("../Form/Form").Form} form */ - - postSubmit(values, form) { if (!form.form) return; if (!form.hasValues(values)) return; const checks = [form.shouldPromptToStoreData, this.passwordGenerator.generated]; - if (checks.some(Boolean)) { const formData = (0, _Credentials.appendGeneratedKey)(values, { password: this.passwordGenerator.password, @@ -5614,36 +4888,29 @@ class InterfacePrototype { this.storeFormData(formData, 'formSubmission'); } } + /** * Sends a pixel to be fired on the client side * @param {import('../deviceApiCalls/__generated__/validators-ts').SendJSPixelParams} pixelParams */ - - firePixel(pixelParams) { this.deviceApi.notify(new _deviceApiCalls.SendJSPixelCall(pixelParams)); } + /** * This serves as a single place to create a default instance * of InterfacePrototype that can be useful in testing scenarios * @returns {InterfacePrototype} */ - - static default() { const globalConfig = (0, _config.createGlobalConfig)(); const transport = (0, _transports.createTransport)(globalConfig); const deviceApi = new _index.DeviceApi(transport); - const settings = _Settings.Settings.default(globalConfig, deviceApi); - return new InterfacePrototype(globalConfig, deviceApi, settings); } - } - -var _default = InterfacePrototype; -exports.default = _default; +var _default = exports.default = InterfacePrototype; },{"../../packages/device-api/index.js":2,"../EmailProtection.js":22,"../Form/formatters.js":26,"../Form/matching.js":33,"../InputTypes/Credentials.js":35,"../PasswordGenerator.js":38,"../Scanner.js":39,"../Settings.js":40,"../UI/controllers/NativeUIController.js":46,"../autofill-utils.js":51,"../config.js":53,"../deviceApiCalls/__generated__/deviceApiCalls.js":55,"../deviceApiCalls/__generated__/validators.zod.js":56,"../deviceApiCalls/transports/transports.js":61,"./initFormSubmissionsApi.js":20}],18:[function(require,module,exports){ "use strict"; @@ -5652,31 +4919,19 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.WindowsInterface = void 0; - var _InterfacePrototype = _interopRequireDefault(require("./InterfacePrototype.js")); - var _OverlayUIController = require("../UI/controllers/OverlayUIController.js"); - var _deviceApiCalls = require("../deviceApiCalls/__generated__/deviceApiCalls.js"); - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - /** * @typedef {import('../deviceApiCalls/__generated__/validators-ts').GetAutofillDataRequest} GetAutofillDataRequest */ -const EMAIL_PROTECTION_LOGOUT_MESSAGE = 'EMAIL_PROTECTION_LOGOUT'; +const EMAIL_PROTECTION_LOGOUT_MESSAGE = 'EMAIL_PROTECTION_LOGOUT'; class WindowsInterface extends _InterfacePrototype.default { - constructor() { - super(...arguments); - - _defineProperty(this, "ready", false); - - _defineProperty(this, "_abortController", null); - } - + ready = false; + /** @type {AbortController|null} */ + _abortController = null; /** * @deprecated This runs too early, and will be removed eventually. * @returns {Promise} @@ -5684,24 +4939,19 @@ class WindowsInterface extends _InterfacePrototype.default { async isEnabled() { return true; } - async setupAutofill() { const loggedIn = await this._getIsLoggedIn(); - if (loggedIn) { await this.getAddresses(); } } - isEnabledViaSettings() { return Boolean(this.settings.enabled); } - postInit() { super.postInit(); this.ready = true; } - createUIController() { /** * If we get here, we're just a controller for an overlay @@ -5711,20 +4961,18 @@ class WindowsInterface extends _InterfacePrototype.default { show: async details => this._show(details) }); } + /** * @param {GetAutofillDataRequest} details */ - - async _show(details) { const { mainType - } = details; // prevent overlapping listeners - + } = details; + // prevent overlapping listeners if (this._abortController && !this._abortController.signal.aborted) { this._abortController.abort(); } - this._abortController = new AbortController(); this.deviceApi.request(new _deviceApiCalls.GetAutofillDataCall(details), { signal: this._abortController.signal @@ -5732,35 +4980,26 @@ class WindowsInterface extends _InterfacePrototype.default { if (!this.activeForm) { throw new Error('this.currentAttached was absent'); } - switch (resp.action) { case 'fill': { if (mainType in resp) { - var _this$activeForm; - - (_this$activeForm = this.activeForm) === null || _this$activeForm === void 0 ? void 0 : _this$activeForm.autofillData(resp[mainType], mainType); + this.activeForm?.autofillData(resp[mainType], mainType); } else { - throw new Error("action: \"fill\" cannot occur because \"".concat(mainType, "\" was missing")); + throw new Error(`action: "fill" cannot occur because "${mainType}" was missing`); } - break; } - case 'focus': { - var _this$activeForm2, _this$activeForm2$act; - - (_this$activeForm2 = this.activeForm) === null || _this$activeForm2 === void 0 ? void 0 : (_this$activeForm2$act = _this$activeForm2.activeInput) === null || _this$activeForm2$act === void 0 ? void 0 : _this$activeForm2$act.focus(); + this.activeForm?.activeInput?.focus(); break; } - case 'none': { // do nothing break; } - default: { if (this.globalConfig.isDDGTestMode) { @@ -5768,7 +5007,6 @@ class WindowsInterface extends _InterfacePrototype.default { } } } - return this._closeAutofillParent(); }).catch(e => { if (this.globalConfig.isDDGTestMode) { @@ -5780,14 +5018,14 @@ class WindowsInterface extends _InterfacePrototype.default { } }); } + /** * @returns {Promise} */ - - async _closeAutofillParent() { return this.deviceApi.notify(new _deviceApiCalls.CloseAutofillParentCall(null)); } + /** * Email Protection calls */ @@ -5795,20 +5033,14 @@ class WindowsInterface extends _InterfacePrototype.default { /** * @returns {Promise} */ - - getEmailProtectionCapabilities() { return this.deviceApi.request(new _deviceApiCalls.EmailProtectionGetCapabilitiesCall({})); } - async _getIsLoggedIn() { const isLoggedIn = await this.deviceApi.request(new _deviceApiCalls.EmailProtectionGetIsLoggedInCall({})); - this.isDeviceSignedIn = () => isLoggedIn; - return isLoggedIn; } - addLogoutListener(handler) { // Only deal with logging out if we're in the email web app if (!this.globalConfig.isDDGDomain) return; @@ -5818,11 +5050,10 @@ class WindowsInterface extends _InterfacePrototype.default { } }); } + /** * @returns {Promise} */ - - storeUserData(_ref) { let { addUserData @@ -5832,33 +5063,25 @@ class WindowsInterface extends _InterfacePrototype.default { /** * @returns {Promise} */ - - removeUserData() { return this.deviceApi.request(new _deviceApiCalls.EmailProtectionRemoveUserDataCall({})); } /** * @returns {Promise} */ - - getUserData() { return this.deviceApi.request(new _deviceApiCalls.EmailProtectionGetUserDataCall({})); } - async refreshAlias() { const addresses = await this.deviceApi.request(new _deviceApiCalls.EmailProtectionRefreshPrivateAddressCall({})); this.storeLocalAddresses(addresses); } - async getAddresses() { const addresses = await this.deviceApi.request(new _deviceApiCalls.EmailProtectionGetAddressesCall({})); this.storeLocalAddresses(addresses); return addresses; } - } - exports.WindowsInterface = WindowsInterface; },{"../UI/controllers/OverlayUIController.js":47,"../deviceApiCalls/__generated__/deviceApiCalls.js":55,"./InterfacePrototype.js":17}],19:[function(require,module,exports){ @@ -5868,19 +5091,11 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.WindowsOverlayDeviceInterface = void 0; - var _InterfacePrototype = _interopRequireDefault(require("./InterfacePrototype.js")); - var _HTMLTooltipUIController = require("../UI/controllers/HTMLTooltipUIController.js"); - var _deviceApiCalls = require("../deviceApiCalls/__generated__/deviceApiCalls.js"); - var _overlayApi = require("./overlayApi.js"); - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - /** * This subclass is designed to separate code that *only* runs inside the * Windows Overlay into a single place. @@ -5889,17 +5104,18 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope * this is another DeviceInterface */ class WindowsOverlayDeviceInterface extends _InterfacePrototype.default { - constructor() { - super(...arguments); - - _defineProperty(this, "stripCredentials", false); - - _defineProperty(this, "overlay", (0, _overlayApi.overlayApi)(this)); - - _defineProperty(this, "previousScreenX", 0); + /** + * Mark top frame as not stripping credential data + * @type {boolean} + */ + stripCredentials = false; - _defineProperty(this, "previousScreenY", 0); - } + /** + * overlay API helpers + */ + overlay = (0, _overlayApi.overlayApi)(this); + previousScreenX = 0; + previousScreenY = 0; /** * Because we're running inside the Overlay, we always create the HTML @@ -5910,9 +5126,7 @@ class WindowsOverlayDeviceInterface extends _InterfacePrototype.default { */ createUIController() { return new _HTMLTooltipUIController.HTMLTooltipUIController({ - tooltipKind: - /** @type {const} */ - 'modern', + tooltipKind: /** @type {const} */'modern', device: this }, { wrapperClass: 'top-autofill', @@ -5920,14 +5134,12 @@ class WindowsOverlayDeviceInterface extends _InterfacePrototype.default { setSize: details => this.deviceApi.notify(new _deviceApiCalls.SetSizeCall(details)), remove: async () => this._closeAutofillParent(), testMode: this.isTestMode(), - /** * Note: This is needed because Mutation observer didn't support visibility checks on Windows */ checkVisibility: false }); } - addDeviceListeners() { /** * On Windows (vs. MacOS) we can use the built-in `mousemove` @@ -5937,58 +5149,51 @@ class WindowsOverlayDeviceInterface extends _InterfacePrototype.default { * page load every time it's opened. */ window.addEventListener('mousemove', event => { - var _this$uiController, _this$uiController$ge; - // Don't set focus if the mouse hasn't moved ever // This is to avoid clickjacking where an attacker puts the pulldown under the cursor // and tricks the user into clicking - if (!this.previousScreenX && !this.previousScreenY || // if no previous coords + if (!this.previousScreenX && !this.previousScreenY || + // if no previous coords this.previousScreenX === event.screenX && this.previousScreenY === event.screenY // or the mouse hasn't moved ) { this.previousScreenX = event.screenX; this.previousScreenY = event.screenY; return; } - - const activeTooltip = (_this$uiController = this.uiController) === null || _this$uiController === void 0 ? void 0 : (_this$uiController$ge = _this$uiController.getActiveTooltip) === null || _this$uiController$ge === void 0 ? void 0 : _this$uiController$ge.call(_this$uiController); - activeTooltip === null || activeTooltip === void 0 ? void 0 : activeTooltip.focus(event.x, event.y); + const activeTooltip = this.uiController?.getActiveTooltip?.(); + activeTooltip?.focus(event.x, event.y); this.previousScreenX = event.screenX; this.previousScreenY = event.screenY; }); return super.addDeviceListeners(); } + /** * @returns {Promise} */ - - async _closeAutofillParent() { return this.deviceApi.notify(new _deviceApiCalls.CloseAutofillParentCall(null)); } + /** * @returns {Promise} */ - - openManagePasswords() { return this.deviceApi.notify(new _deviceApiCalls.OpenManagePasswordsCall({})); } /** * @returns {Promise} */ - - openManageCreditCards() { return this.deviceApi.notify(new _deviceApiCalls.OpenManageCreditCardsCall({})); } /** * @returns {Promise} */ - - openManageIdentities() { return this.deviceApi.notify(new _deviceApiCalls.OpenManageIdentitiesCall({})); } + /** * Since we're running inside the Overlay we can limit what happens here to * be only things that are needed to power the HTML Tooltip @@ -5996,25 +5201,21 @@ class WindowsOverlayDeviceInterface extends _InterfacePrototype.default { * @override * @returns {Promise} */ - - async setupAutofill() { const loggedIn = await this._getIsLoggedIn(); - if (loggedIn) { await this.getAddresses(); } - - const response = await this.deviceApi.request(new _deviceApiCalls.GetAutofillInitDataCall(null)); // @ts-ignore - + const response = await this.deviceApi.request(new _deviceApiCalls.GetAutofillInitDataCall(null)); + // @ts-ignore this.storeLocalData(response); } - async postInit() { // setup overlay API pieces this.overlay.showImmediately(); super.postInit(); } + /** * In the top-frame scenario, we send a message to the native * side to indicate a selection. Once received, the native side will store that selection so that a @@ -6024,50 +5225,42 @@ class WindowsOverlayDeviceInterface extends _InterfacePrototype.default { * @param {IdentityObject|CreditCardObject|CredentialsObject|{email:string, id: string}} data * @param {string} type */ - - async selectedDetail(data, type) { return this.overlay.selectedDetail(data, type); } + /** * Email Protection calls */ - async _getIsLoggedIn() { const isLoggedIn = await this.deviceApi.request(new _deviceApiCalls.EmailProtectionGetIsLoggedInCall({})); - this.isDeviceSignedIn = () => isLoggedIn; - return isLoggedIn; } - async getAddresses() { const addresses = await this.deviceApi.request(new _deviceApiCalls.EmailProtectionGetAddressesCall({})); this.storeLocalAddresses(addresses); return addresses; } + /** * Gets a single identity obj once the user requests it * @param {Number} id * @returns {Promise<{success: IdentityObject|undefined}>} */ - - getAutofillIdentity(id) { const identity = this.getLocalIdentities().find(_ref => { let { id: identityId } = _ref; - return "".concat(identityId) === "".concat(id); + return `${identityId}` === `${id}`; }); return Promise.resolve({ success: identity }); } - } - exports.WindowsOverlayDeviceInterface = WindowsOverlayDeviceInterface; },{"../UI/controllers/HTMLTooltipUIController.js":45,"../deviceApiCalls/__generated__/deviceApiCalls.js":55,"./InterfacePrototype.js":17,"./overlayApi.js":21}],20:[function(require,module,exports){ @@ -6077,11 +5270,8 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.initFormSubmissionsApi = initFormSubmissionsApi; - var _autofillUtils = require("../autofill-utils.js"); - var _labelUtil = require("../Form/label-util.js"); - /** * This is a single place to contain all functionality relating to form submission detection * @@ -6093,83 +5283,72 @@ function initFormSubmissionsApi(forms, matching) { * Global submit events */ window.addEventListener('submit', e => { - var _forms$get; - // @ts-ignore - return (_forms$get = forms.get(e.target)) === null || _forms$get === void 0 ? void 0 : _forms$get.submitHandler('global submit event'); + return forms.get(e.target)?.submitHandler('global submit event'); }, true); + /** * Global keydown events */ - window.addEventListener('keydown', e => { if (e.key === 'Enter') { const focusedForm = [...forms.values()].find(form => form.hasFocus(e)); - focusedForm === null || focusedForm === void 0 ? void 0 : focusedForm.submitHandler('global keydown + Enter'); + focusedForm?.submitHandler('global keydown + Enter'); } }); + /** * Global pointer down events * @param {PointerEvent} event */ - window.addEventListener('pointerdown', event => { const matchingForm = [...forms.values()].find(form => { - const btns = [...form.submitButtons]; // @ts-ignore - - if (btns.includes(event.target)) return true; // @ts-ignore + const btns = [...form.submitButtons]; + // @ts-ignore + if (btns.includes(event.target)) return true; + // @ts-ignore if (btns.find(btn => btn.contains(event.target))) return true; }); - matchingForm === null || matchingForm === void 0 ? void 0 : matchingForm.submitHandler('global pointerdown event + matching form'); - + matchingForm?.submitHandler('global pointerdown event + matching form'); if (!matchingForm) { - var _event$target, _matching$getDDGMatch, _event$target2; - - const selector = matching.cssSelector('submitButtonSelector') + ', a[href="#"], a[href^=javascript], *[onclick], [class*=button i]'; // check if the click happened on a button - - const button = - /** @type HTMLElement */ - (_event$target = event.target) === null || _event$target === void 0 ? void 0 : _event$target.closest(selector); + const selector = matching.cssSelector('submitButtonSelector') + ', a[href="#"], a[href^=javascript], *[onclick], [class*=button i]'; + // check if the click happened on a button + const button = /** @type HTMLElement */event.target?.closest(selector); if (!button) return; const text = (0, _autofillUtils.getTextShallow)(button) || (0, _labelUtil.extractElementStrings)(button).join(' '); - const hasRelevantText = (_matching$getDDGMatch = matching.getDDGMatcherRegex('submitButtonRegex')) === null || _matching$getDDGMatch === void 0 ? void 0 : _matching$getDDGMatch.test(text); - + const hasRelevantText = matching.getDDGMatcherRegex('submitButtonRegex')?.test(text); if (hasRelevantText && text.length < 25) { // check if there's a form with values const filledForm = [...forms.values()].find(form => form.hasValues()); - - if (filledForm && (0, _autofillUtils.buttonMatchesFormType)( - /** @type HTMLElement */ - button, filledForm)) { - filledForm === null || filledForm === void 0 ? void 0 : filledForm.submitHandler('global pointerdown event + filled form'); + if (filledForm && (0, _autofillUtils.buttonMatchesFormType)( /** @type HTMLElement */button, filledForm)) { + filledForm?.submitHandler('global pointerdown event + filled form'); } - } // TODO: Temporary hack to support Google signin in different languages - // https://app.asana.com/0/1198964220583541/1201650539303898/f - + } - if ( - /** @type HTMLElement */ - (_event$target2 = event.target) !== null && _event$target2 !== void 0 && _event$target2.closest('#passwordNext button, #identifierNext button')) { + // TODO: Temporary hack to support Google signin in different languages + // https://app.asana.com/0/1198964220583541/1201650539303898/f + if ( /** @type HTMLElement */event.target?.closest('#passwordNext button, #identifierNext button')) { // check if there's a form with values const filledForm = [...forms.values()].find(form => form.hasValues()); - filledForm === null || filledForm === void 0 ? void 0 : filledForm.submitHandler('global pointerdown event + google escape hatch'); + filledForm?.submitHandler('global pointerdown event + google escape hatch'); } } }, true); + /** * @type {PerformanceObserver} */ - const observer = new PerformanceObserver(list => { - const entries = list.getEntries().filter(entry => // @ts-ignore why does TS not know about `entry.initiatorType`? + const entries = list.getEntries().filter(entry => + // @ts-ignore why does TS not know about `entry.initiatorType`? ['fetch', 'xmlhttprequest'].includes(entry.initiatorType) && /login|sign-in|signin/.test(entry.name)); if (!entries.length) return; const filledForm = [...forms.values()].find(form => form.hasValues()); - const focusedForm = [...forms.values()].find(form => form.hasFocus()); // If a form is still focused the user is still typing: do nothing - + const focusedForm = [...forms.values()].find(form => form.hasFocus()); + // If a form is still focused the user is still typing: do nothing if (focusedForm) return; - filledForm === null || filledForm === void 0 ? void 0 : filledForm.submitHandler('performance observer'); + filledForm?.submitHandler('performance observer'); }); observer.observe({ entryTypes: ['resource'] @@ -6183,9 +5362,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.overlayApi = overlayApi; - var _deviceApiCalls = require("../deviceApiCalls/__generated__/deviceApiCalls.js"); - /** * These are some re-usable parts for handling 'overlays' (like on macOS + Windows) * @@ -6197,11 +5374,10 @@ function overlayApi(device) { * When we are inside an 'overlay' - the HTML tooltip will be opened immediately */ showImmediately() { - var _device$uiController, _device$uiController$; - const topContextData = device.getTopContextData(); - if (!topContextData) throw new Error('unreachable, topContextData should be available'); // Provide dummy values + if (!topContextData) throw new Error('unreachable, topContextData should be available'); + // Provide dummy values const getPosition = () => { return { x: 0, @@ -6209,18 +5385,14 @@ function overlayApi(device) { height: 50, width: 50 }; - }; // Create the tooltip, and set it as active - - - const tooltip = (_device$uiController = device.uiController) === null || _device$uiController === void 0 ? void 0 : (_device$uiController$ = _device$uiController.createTooltip) === null || _device$uiController$ === void 0 ? void 0 : _device$uiController$.call(_device$uiController, getPosition, topContextData); + }; + // Create the tooltip, and set it as active + const tooltip = device.uiController?.createTooltip?.(getPosition, topContextData); if (tooltip) { - var _device$uiController2, _device$uiController3; - - (_device$uiController2 = device.uiController) === null || _device$uiController2 === void 0 ? void 0 : (_device$uiController3 = _device$uiController2.setActiveTooltip) === null || _device$uiController3 === void 0 ? void 0 : _device$uiController3.call(_device$uiController2, tooltip); + device.uiController?.setActiveTooltip?.(tooltip); } }, - /** * @param {IdentityObject|CreditCardObject|CredentialsObject|{email:string, id: string}} data * @param {string} type @@ -6233,13 +5405,11 @@ function overlayApi(device) { }); const entries = Object.fromEntries(detailsEntries); /** @link {import("../deviceApiCalls/schemas/getAutofillData.result.json")} */ - await device.deviceApi.notify(new _deviceApiCalls.SelectedDetailCall({ data: entries, configType: type })); } - }; } @@ -6250,58 +5420,32 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.EmailProtection = void 0; - -function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); } - -function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } } - -function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; } - -function _classApplyDescriptorSet(receiver, descriptor, value) { if (descriptor.set) { descriptor.set.call(receiver, value); } else { if (!descriptor.writable) { throw new TypeError("attempted to set read only private field"); } descriptor.value = value; } } - -function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); } - -function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); } - -function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; } - -var _previous = /*#__PURE__*/new WeakMap(); - /** * Use this as place to store any state or functionality related to Email Protection */ class EmailProtection { /** @type {string|null} */ + #previous = null; /** @param {import("./DeviceInterface/InterfacePrototype").default} device */ constructor(device) { - _classPrivateFieldInitSpec(this, _previous, { - writable: true, - value: null - }); - this.device = device; } - /** @returns {string|null} */ - + /** @returns {string|null} */ get lastGenerated() { - return _classPrivateFieldGet(this, _previous); + return this.#previous; } + /** * Store the last received email address * @param {string} emailAddress */ - - storeReceived(emailAddress) { - _classPrivateFieldSet(this, _previous, emailAddress); - + this.#previous = emailAddress; return emailAddress; } - } - exports.EmailProtection = EmailProtection; },{}],23:[function(require,module,exports){ @@ -6311,39 +5455,27 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.Form = void 0; - var _FormAnalyzer = _interopRequireDefault(require("./FormAnalyzer.js")); - var _autofillUtils = require("../autofill-utils.js"); - var _matching = require("./matching.js"); - var _inputStyles = require("./inputStyles.js"); - var _inputTypeConfig = require("./inputTypeConfig.js"); - var _formatters = require("./formatters.js"); - var _constants = require("../constants.js"); - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - const { ATTR_AUTOFILL, ATTR_INPUT_TYPE, MAX_FORM_MUT_OBS_COUNT, MAX_INPUTS_PER_FORM } = _constants.constants; - class Form { /** @type {import("../Form/matching").Matching} */ - + matching; /** @type {HTMLElement} */ - + form; /** @type {HTMLInputElement | null} */ - + activeInput; /** * @param {HTMLElement} form * @param {HTMLInputElement|HTMLSelectElement} input @@ -6353,19 +5485,12 @@ class Form { */ constructor(form, input, deviceInterface, matching) { let shouldAutoprompt = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false; - - _defineProperty(this, "matching", void 0); - - _defineProperty(this, "form", void 0); - - _defineProperty(this, "activeInput", void 0); - this.form = form; this.matching = matching || (0, _matching.createMatching)(); this.formAnalyzer = new _FormAnalyzer.default(form, input, matching); this.device = deviceInterface; - /** @type Record<'all' | SupportedMainTypes, Set> */ + /** @type Record<'all' | SupportedMainTypes, Set> */ this.inputs = { all: new Set(), credentials: new Set(), @@ -6375,16 +5500,16 @@ class Form { }; this.touched = new Set(); this.listeners = new Set(); - this.activeInput = null; // We set this to true to skip event listeners while we're autofilling - + this.activeInput = null; + // We set this to true to skip event listeners while we're autofilling this.isAutofilling = false; this.handlerExecuted = false; this.shouldPromptToStoreData = true; this.shouldAutoSubmit = this.device.globalConfig.isMobileApp; + /** * @type {IntersectionObserver | null} */ - this.intObs = new IntersectionObserver(entries => { for (const entry of entries) { if (!entry.isIntersecting) this.removeTooltip(); @@ -6397,7 +5522,6 @@ class Form { }; this.mutObs = new MutationObserver(records => { const anythingRemoved = records.some(record => record.removedNodes.length > 0); - if (anythingRemoved) { // Must check for inputs because a parent may be removed and not show up in record.removedNodes if ([...this.inputs.all].some(input => !input.isConnected)) { @@ -6406,15 +5530,16 @@ class Form { this.formAnalyzer = new _FormAnalyzer.default(this.form, input, this.matching); this.recategorizeAllInputs(); }); - this.mutObsCount++; // If the form mutates too much, disconnect to avoid performance issues - + this.mutObsCount++; + // If the form mutates too much, disconnect to avoid performance issues if (this.mutObsCount >= MAX_FORM_MUT_OBS_COUNT) { this.mutObs.disconnect(); } } } - }); // This ensures we fire the handler again if the form is changed + }); + // This ensures we fire the handler again if the form is changed this.addListener(form, 'input', () => { if (!this.isAutofilling) { this.handlerExecuted = false; @@ -6424,160 +5549,129 @@ class Form { this.categorizeInputs(); this.mutObs.observe(this.form, this.mutObsConfig); this.logFormInfo(); - if (shouldAutoprompt) { this.promptLoginIfNeeded(); } } - get isLogin() { return this.formAnalyzer.isLogin; } - get isSignup() { return this.formAnalyzer.isSignup; } - get isHybrid() { return this.formAnalyzer.isHybrid; } - get isCCForm() { return this.formAnalyzer.isCCForm(); } - logFormInfo() { if (!(0, _autofillUtils.shouldLog)()) return; - console.log("Form type: %c".concat(this.getFormType()), 'font-weight: bold'); + console.log(`Form type: %c${this.getFormType()}`, 'font-weight: bold'); console.log('Signals: ', this.formAnalyzer.signals); console.log('Wrapping element: ', this.form); console.log('Inputs: ', this.inputs); console.log('Submit Buttons: ', this.submitButtons); } - getFormType() { - if (this.isHybrid) return "hybrid (hybrid score: ".concat(this.formAnalyzer.hybridSignal, ", score: ").concat(this.formAnalyzer.autofillSignal, ")"); - if (this.isLogin) return "login (score: ".concat(this.formAnalyzer.autofillSignal, ", hybrid score: ").concat(this.formAnalyzer.hybridSignal, ")"); - if (this.isSignup) return "signup (score: ".concat(this.formAnalyzer.autofillSignal, ", hybrid score: ").concat(this.formAnalyzer.hybridSignal, ")"); + if (this.isHybrid) return `hybrid (hybrid score: ${this.formAnalyzer.hybridSignal}, score: ${this.formAnalyzer.autofillSignal})`; + if (this.isLogin) return `login (score: ${this.formAnalyzer.autofillSignal}, hybrid score: ${this.formAnalyzer.hybridSignal})`; + if (this.isSignup) return `signup (score: ${this.formAnalyzer.autofillSignal}, hybrid score: ${this.formAnalyzer.hybridSignal})`; return 'something went wrong'; } + /** * Checks if the form element contains the activeElement or the event target * @return {boolean} * @param {KeyboardEvent | null} [e] */ - - hasFocus(e) { - return this.form.contains(document.activeElement) || this.form.contains( - /** @type HTMLElement */ - e === null || e === void 0 ? void 0 : e.target); + return this.form.contains(document.activeElement) || this.form.contains( /** @type HTMLElement */e?.target); } - submitHandler() { - var _this$device$postSubm, _this$device; - let via = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'unknown'; - if (this.device.globalConfig.isDDGTestMode) { console.log('Form.submitHandler via:', via, this); } - if (this.handlerExecuted) return; const values = this.getValuesReadyForStorage(); - (_this$device$postSubm = (_this$device = this.device).postSubmit) === null || _this$device$postSubm === void 0 ? void 0 : _this$device$postSubm.call(_this$device, values, this); // mark this form as being handled + this.device.postSubmit?.(values, this); + // mark this form as being handled this.handlerExecuted = true; } + /** * Reads the values from the form without preparing to store them * @return {InternalDataStorageObject} */ - - getRawValues() { const formValues = [...this.inputs.credentials, ...this.inputs.identities, ...this.inputs.creditCards].reduce((output, inputEl) => { - var _output$mainType, _value; - const mainType = (0, _matching.getInputMainType)(inputEl); const subtype = (0, _matching.getInputSubtype)(inputEl); - let value = inputEl.value || ((_output$mainType = output[mainType]) === null || _output$mainType === void 0 ? void 0 : _output$mainType[subtype]); - + let value = inputEl.value || output[mainType]?.[subtype]; if (subtype === 'addressCountryCode') { value = (0, _formatters.inferCountryCodeFromElement)(inputEl); - } // Discard passwords that are shorter than 4 characters - - - if (subtype === 'password' && ((_value = value) === null || _value === void 0 ? void 0 : _value.length) <= 3) { + } + // Discard passwords that are shorter than 4 characters + if (subtype === 'password' && value?.length <= 3) { value = undefined; } - if (value) { output[mainType][subtype] = value; } - return output; }, { credentials: {}, creditCards: {}, identities: {} }); - if (formValues.credentials.password && !formValues.credentials.username && !formValues.identities.emailAddress) { // If we have a password but no username, let's search further - const hiddenFields = - /** @type [HTMLInputElement] */ - [...this.form.querySelectorAll('input[type=hidden]')]; + const hiddenFields = /** @type [HTMLInputElement] */[...this.form.querySelectorAll('input[type=hidden]')]; const probableField = hiddenFields.find(field => { - var _this$matching$getDDG; - - const regex = new RegExp('email|' + ((_this$matching$getDDG = this.matching.getDDGMatcherRegex('username')) === null || _this$matching$getDDG === void 0 ? void 0 : _this$matching$getDDG.source)); + const regex = new RegExp('email|' + this.matching.getDDGMatcherRegex('username')?.source); const attributeText = field.id + ' ' + field.name; - return regex === null || regex === void 0 ? void 0 : regex.test(attributeText); + return regex?.test(attributeText); }); - - if (probableField !== null && probableField !== void 0 && probableField.value) { + if (probableField?.value) { formValues.credentials.username = probableField.value; - } else if ( // If a form has phone + password(s) fields, save the phone as username + } else if ( + // If a form has phone + password(s) fields, save the phone as username formValues.identities.phone && this.inputs.all.size - this.inputs.unknown.size < 4) { formValues.credentials.username = formValues.identities.phone; } else { // If we still don't have a username, try scanning the form's text for an email address this.form.querySelectorAll(this.matching.cssSelector('safeUniversalSelector')).forEach(el => { - var _elText$match; - - const elText = (0, _autofillUtils.getTextShallow)(el); // Ignore long texts to avoid false positives - + const elText = (0, _autofillUtils.getTextShallow)(el); + // Ignore long texts to avoid false positives if (elText.length > 70) return; - const emailOrUsername = (_elText$match = elText.match( // https://www.emailregex.com/ - /[a-zA-Z\d.!#$%&’*+/=?^_`{|}~-]+@[a-zA-Z\d-]+(?:\.[a-zA-Z\d-]+)*/)) === null || _elText$match === void 0 ? void 0 : _elText$match[0]; - + const emailOrUsername = elText.match( + // https://www.emailregex.com/ + /[a-zA-Z\d.!#$%&’*+/=?^_`{|}~-]+@[a-zA-Z\d-]+(?:\.[a-zA-Z\d-]+)*/)?.[0]; if (emailOrUsername) { formValues.credentials.username = emailOrUsername; } }); } } - return formValues; } + /** * Return form values ready for storage * @returns {DataStorageObject} */ - - getValuesReadyForStorage() { const formValues = this.getRawValues(); return (0, _formatters.prepareFormValuesForStorage)(formValues); } + /** * Determine if the form has values we want to store in the device * @param {DataStorageObject} [values] * @return {boolean} */ - - hasValues(values) { const { credentials, @@ -6586,26 +5680,17 @@ class Form { } = values || this.getValuesReadyForStorage(); return Boolean(credentials || creditCards || identities); } - async removeTooltip() { - var _this$intObs; - const tooltip = this.device.isTooltipActive(); - if (this.isAutofilling || !tooltip) { return; } - await this.device.removeTooltip(); - (_this$intObs = this.intObs) === null || _this$intObs === void 0 ? void 0 : _this$intObs.disconnect(); + this.intObs?.disconnect(); } - showingTooltip(input) { - var _this$intObs2; - - (_this$intObs2 = this.intObs) === null || _this$intObs2 === void 0 ? void 0 : _this$intObs2.observe(input); + this.intObs?.observe(input); } - removeInputHighlight(input) { if (!input.classList.contains('ddg-autofilled')) return; (0, _autofillUtils.removeInlineStyles)(input, (0, _inputStyles.getIconStylesAutofilled)(input, this)); @@ -6615,31 +5700,27 @@ class Form { input.classList.remove('ddg-autofilled'); this.addAutofillStyles(input); } - resetIconStylesToInitial() { const input = this.activeInput; - if (input) { const initialStyles = (0, _inputStyles.getIconStylesBase)(input, this); (0, _autofillUtils.addInlineStyles)(input, initialStyles); } } - removeAllHighlights(e, dataType) { // This ensures we are not removing the highlight ourselves when autofilling more than once - if (e && !e.isTrusted) return; // If the user has changed the value, we prompt to update the stored data + if (e && !e.isTrusted) return; + // If the user has changed the value, we prompt to update the stored data this.shouldPromptToStoreData = true; this.execOnInputs(input => this.removeInputHighlight(input), dataType); } - removeInputDecoration(input) { (0, _autofillUtils.removeInlineStyles)(input, (0, _inputStyles.getIconStylesBase)(input, this)); (0, _autofillUtils.removeInlineStyles)(input, (0, _inputStyles.getIconStylesAlternate)(input, this)); input.removeAttribute(ATTR_AUTOFILL); input.removeAttribute(ATTR_INPUT_TYPE); } - removeAllDecorations() { this.execOnInputs(input => this.removeInputDecoration(input)); this.listeners.forEach(_ref => { @@ -6652,7 +5733,6 @@ class Form { return el.removeEventListener(type, fn, opts); }); } - redecorateAllInputs() { this.removeAllDecorations(); this.execOnInputs(input => { @@ -6661,11 +5741,10 @@ class Form { } }); } + /** * Removes all scoring attributes from the inputs and deletes them from memory */ - - forgetAllInputs() { this.execOnInputs(input => { input.removeAttribute(ATTR_AUTOFILL); @@ -6673,18 +5752,16 @@ class Form { }); Object.values(this.inputs).forEach(inputSet => inputSet.clear()); } + /** * Resets our input scoring and starts from scratch */ - - recategorizeAllInputs() { this.initialScanComplete = false; this.removeAllDecorations(); this.forgetAllInputs(); this.categorizeInputs(); } - resetAllInputs() { this.execOnInputs(input => { (0, _autofillUtils.setValue)(input, '', this.device.globalConfig); @@ -6693,12 +5770,10 @@ class Form { if (this.activeInput) this.activeInput.focus(); this.matching.clear(); } - dismissTooltip() { this.removeTooltip(); - } // This removes all listeners to avoid memory leaks and weird behaviours - - + } + // This removes all listeners to avoid memory leaks and weird behaviours destroy() { this.removeAllDecorations(); this.removeTooltip(); @@ -6707,21 +5782,16 @@ class Form { this.matching.clear(); this.intObs = null; } - categorizeInputs() { const selector = this.matching.cssSelector('formInputsSelector'); - if (this.form.matches(selector)) { this.addInput(this.form); } else { - let foundInputs = this.form.querySelectorAll(selector); // If the markup is broken form.querySelectorAll may not return the fields, so we select from the parent - + let foundInputs = this.form.querySelectorAll(selector); + // If the markup is broken form.querySelectorAll may not return the fields, so we select from the parent if (foundInputs.length === 0 && this.form instanceof HTMLFormElement && this.form.length > 0) { - var _this$form$parentElem; - - foundInputs = ((_this$form$parentElem = this.form.parentElement) === null || _this$form$parentElem === void 0 ? void 0 : _this$form$parentElem.querySelectorAll(selector)) || foundInputs; + foundInputs = this.form.parentElement?.querySelectorAll(selector) || foundInputs; } - if (foundInputs.length < MAX_INPUTS_PER_FORM) { foundInputs.forEach(input => this.addInput(input)); } else { @@ -6730,89 +5800,81 @@ class Form { } } } - this.initialScanComplete = true; } - get submitButtons() { const selector = this.matching.cssSelector('submitButtonSelector'); - const allButtons = - /** @type {HTMLElement[]} */ - [...this.form.querySelectorAll(selector)]; + const allButtons = /** @type {HTMLElement[]} */[...this.form.querySelectorAll(selector)]; return allButtons.filter(btn => (0, _autofillUtils.isPotentiallyViewable)(btn) && (0, _autofillUtils.isLikelyASubmitButton)(btn, this.matching) && (0, _autofillUtils.buttonMatchesFormType)(btn, this)); } - attemptSubmissionIfNeeded() { - if (!this.isLogin || // Only submit login forms + if (!this.isLogin || + // Only submit login forms this.submitButtons.length > 1 // Do not submit if we're unsure about the submit button - ) return; // check for visible empty fields before attemtping submission - // this is to avoid loops where a captcha keeps failing for the user + ) return; + // check for visible empty fields before attemtping submission + // this is to avoid loops where a captcha keeps failing for the user let isThereAnEmptyVisibleField = false; this.execOnInputs(input => { if (input.value === '' && (0, _autofillUtils.isPotentiallyViewable)(input)) isThereAnEmptyVisibleField = true; }, 'all', false); - if (isThereAnEmptyVisibleField) return; // We're not using .submit() to minimise breakage with client-side forms + if (isThereAnEmptyVisibleField) return; + // We're not using .submit() to minimise breakage with client-side forms this.submitButtons.forEach(button => { if ((0, _autofillUtils.isPotentiallyViewable)(button)) { button.click(); } }); } + /** * Executes a function on input elements. Can be limited to certain element types * @param {(input: HTMLInputElement|HTMLSelectElement) => void} fn * @param {'all' | SupportedMainTypes} inputType * @param {boolean} shouldCheckForDecorate */ - - execOnInputs(fn) { let inputType = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'all'; let shouldCheckForDecorate = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true; const inputs = this.inputs[inputType]; - for (const input of inputs) { - let canExecute = true; // sometimes we want to execute even if we didn't decorate - + let canExecute = true; + // sometimes we want to execute even if we didn't decorate if (shouldCheckForDecorate) { canExecute = (0, _inputTypeConfig.isFieldDecorated)(input); } - if (canExecute) fn(input); } } - addInput(input) { - var _this$device$settings; - - if (this.inputs.all.has(input)) return this; // If the form has too many inputs, destroy everything to avoid performance issues + if (this.inputs.all.has(input)) return this; + // If the form has too many inputs, destroy everything to avoid performance issues if (this.inputs.all.size > MAX_INPUTS_PER_FORM) { if ((0, _autofillUtils.shouldLog)()) { console.log('The form has too many inputs, destroying.'); } - this.destroy(); return this; - } // When new inputs are added after the initial scan, reanalyze the whole form - + } + // When new inputs are added after the initial scan, reanalyze the whole form if (this.initialScanComplete) { this.formAnalyzer = new _FormAnalyzer.default(this.form, input, this.matching); this.recategorizeAllInputs(); return this; - } // Nothing to do with 1-character fields - + } + // Nothing to do with 1-character fields if (input.maxLength === 1) return this; this.inputs.all.add(input); const opts = { isLogin: this.isLogin, isHybrid: this.isHybrid, isCCForm: this.isCCForm, - hasCredentials: Boolean((_this$device$settings = this.device.settings.availableInputTypes.credentials) === null || _this$device$settings === void 0 ? void 0 : _this$device$settings.username), + hasCredentials: Boolean(this.device.settings.availableInputTypes.credentials?.username), supportsIdentitiesAutofill: this.device.settings.featureToggles.inputType_identities }; this.matching.setInputType(input, this.form, opts); @@ -6821,6 +5883,7 @@ class Form { this.decorateInput(input); return this; } + /** * Adds event listeners and keeps track of them for subsequent removal * @param {HTMLElement} el @@ -6828,8 +5891,6 @@ class Form { * @param {(Event) => void} fn * @param {AddEventListenerOptions} [opts] */ - - addListener(el, type, fn, opts) { el.addEventListener(type, fn, opts); this.listeners.add({ @@ -6839,7 +5900,6 @@ class Form { opts }); } - addAutofillStyles(input) { const initialStyles = (0, _inputStyles.getIconStylesBase)(input, this); const activeStyles = (0, _inputStyles.getIconStylesAlternate)(input, this); @@ -6849,20 +5909,18 @@ class Form { onMouseLeave: initialStyles }; } + /** * Decorate here means adding listeners and an optional icon * @param {HTMLInputElement} input * @returns {Promise} */ - - async decorateInput(input) { const config = (0, _inputTypeConfig.getInputConfig)(input); const shouldDecorate = await config.shouldDecorate(input, this); if (!shouldDecorate) return this; input.setAttribute(ATTR_AUTOFILL, 'true'); const hasIcon = !!config.getIconBase(input, this); - if (hasIcon) { const { onMouseMove, @@ -6870,7 +5928,6 @@ class Form { } = this.addAutofillStyles(input); this.addListener(input, 'mousemove', e => { if ((0, _autofillUtils.wasAutofilledByChrome)(input)) return; - if ((0, _autofillUtils.isEventWithinDax)(e, e.target)) { (0, _autofillUtils.addInlineStyles)(e.target, { 'cursor': 'pointer', @@ -6879,10 +5936,11 @@ class Form { } else { (0, _autofillUtils.removeInlineStyles)(e.target, { 'cursor': 'pointer' - }); // Only overwrite active icon styles if tooltip is closed - + }); + // Only overwrite active icon styles if tooltip is closed if (!this.device.isTooltipActive()) { - (0, _autofillUtils.addInlineStyles)(e.target, { ...onMouseLeave + (0, _autofillUtils.addInlineStyles)(e.target, { + ...onMouseLeave }); } } @@ -6890,20 +5948,20 @@ class Form { this.addListener(input, 'mouseleave', e => { (0, _autofillUtils.removeInlineStyles)(e.target, { 'cursor': 'pointer' - }); // Only overwrite active icon styles if tooltip is closed - + }); + // Only overwrite active icon styles if tooltip is closed if (!this.device.isTooltipActive()) { - (0, _autofillUtils.addInlineStyles)(e.target, { ...onMouseLeave + (0, _autofillUtils.addInlineStyles)(e.target, { + ...onMouseLeave }); } }); } + /** * @param {PointerEvent} e * @returns {{ x: number; y: number; } | undefined} */ - - function getMainClickCoords(e) { if (!e.isTrusted) return; const isMainMouseButton = e.button === 0; @@ -6913,86 +5971,74 @@ class Form { y: e.clientY }; } + /** * @param {Event} e * @param {WeakMap} storedClickCoords * @returns {{ x: number; y: number; } | null} */ - - function getClickCoords(e, storedClickCoords) { // Get click co-ordinates for pointer events // We need click coordinates to position the tooltip when the field is in an iframe if (e.type === 'pointerdown') { - return getMainClickCoords( - /** @type {PointerEvent} */ - e) || null; - } // Reuse a previous click co-ordinates if they exist for this element - + return getMainClickCoords( /** @type {PointerEvent} */e) || null; + } + // Reuse a previous click co-ordinates if they exist for this element const click = storedClickCoords.get(input); storedClickCoords.delete(input); return click || null; - } // Store the click to a label so we can use the click when the field is focused - // Needed to handle label clicks when the form is in an iframe - + } + // Store the click to a label so we can use the click when the field is focused + // Needed to handle label clicks when the form is in an iframe let storedClickCoords = new WeakMap(); let timeout = null; + /** * @param {PointerEvent} e */ - const handlerLabel = e => { - var _e$target, _e$target$closest; - // Look for e.target OR it's closest parent to be a HTMLLabelElement - const control = - /** @type HTMLElement */ - (_e$target = e.target) === null || _e$target === void 0 ? void 0 : (_e$target$closest = _e$target.closest('label')) === null || _e$target$closest === void 0 ? void 0 : _e$target$closest.control; + const control = /** @type HTMLElement */e.target?.closest('label')?.control; if (!control) return; - if (e.isTrusted) { storedClickCoords.set(control, getMainClickCoords(e)); } - - clearTimeout(timeout); // Remove the stored click if the timer expires - + clearTimeout(timeout); + // Remove the stored click if the timer expires timeout = setTimeout(() => { storedClickCoords = new WeakMap(); }, 1000); }; - const handler = e => { // Avoid firing multiple times if (this.isAutofilling || this.device.isTooltipActive()) { return; - } // On mobile, we don't trigger on focus, so here we get the target control on label click - + } + // On mobile, we don't trigger on focus, so here we get the target control on label click const isLabel = e.target instanceof HTMLLabelElement; const input = isLabel ? e.target.control : e.target; if (!input || !this.inputs.all.has(input)) return; if ((0, _autofillUtils.wasAutofilledByChrome)(input)) return; if (!(0, _inputTypeConfig.canBeInteractedWith)(input)) return; const clickCoords = getClickCoords(e, storedClickCoords); - if (e.type === 'pointerdown') { // Only allow real user clicks with co-ordinates through if (!e.isTrusted || !clickCoords) return; } - if (this.shouldOpenTooltip(e, input)) { - const iconClicked = (0, _autofillUtils.isEventWithinDax)(e, input); // On mobile and extensions we don't trigger the focus event to avoid + const iconClicked = (0, _autofillUtils.isEventWithinDax)(e, input); + // On mobile and extensions we don't trigger the focus event to avoid // keyboard flashing and conflicts with browsers' own tooltips - - if ((this.device.globalConfig.isMobileApp || this.device.globalConfig.isExtension) && // Avoid the icon capturing clicks on small fields making it impossible to focus + if ((this.device.globalConfig.isMobileApp || this.device.globalConfig.isExtension) && + // Avoid the icon capturing clicks on small fields making it impossible to focus input.offsetWidth > 50 && iconClicked) { e.preventDefault(); e.stopImmediatePropagation(); input.blur(); } - this.touched.add(input); this.device.attachTooltip({ form: this, @@ -7009,13 +6055,10 @@ class Form { (0, _autofillUtils.addInlineStyles)(input, activeStyles); } }; - if (!(input instanceof HTMLSelectElement)) { - var _input$labels; - const events = ['pointerdown']; if (!this.device.globalConfig.isMobileApp) events.push('focus'); - (_input$labels = input.labels) === null || _input$labels === void 0 ? void 0 : _input$labels.forEach(label => { + input.labels?.forEach(label => { if (this.device.globalConfig.isMobileApp) { // On mobile devices we don't trigger on focus, so we use the click handler here this.addListener(label, 'pointerdown', handler); @@ -7026,83 +6069,81 @@ class Form { }); events.forEach(ev => this.addListener(input, ev, handler)); } - return this; } - shouldOpenTooltip(e, input) { - var _this$device$inContex; - - if (!(0, _autofillUtils.isPotentiallyViewable)(input)) return false; // Always open if the user has clicked on the Dax icon + if (!(0, _autofillUtils.isPotentiallyViewable)(input)) return false; + // Always open if the user has clicked on the Dax icon if ((0, _autofillUtils.isEventWithinDax)(e, input)) return true; if (this.device.globalConfig.isWindows) return true; const subtype = (0, _matching.getInputSubtype)(input); - const isIncontextSignupAvailable = (_this$device$inContex = this.device.inContextSignup) === null || _this$device$inContex === void 0 ? void 0 : _this$device$inContex.isAvailable(subtype); - + const isIncontextSignupAvailable = this.device.inContextSignup?.isAvailable(subtype); if (this.device.globalConfig.isApp) { - const mainType = (0, _matching.getInputMainType)(input); // Check if, without in-context signup (passed as `null` below), + const mainType = (0, _matching.getInputMainType)(input); + // Check if, without in-context signup (passed as `null` below), // we'd have any other items to show. This lets us know if we're // just showing in-context signup, or with other autofill items. - const hasSavedDetails = this.device.settings.canAutofillType({ mainType, subtype - }, null); // Don't open the tooltip on input focus whenever it'll only show in-context signup + }, null); + // Don't open the tooltip on input focus whenever it'll only show in-context signup if (!hasSavedDetails && isIncontextSignupAvailable) return false; return true; } - if (this.device.globalConfig.isExtension || this.device.globalConfig.isMobileApp) { // Don't open the tooltip on input focus whenever it's showing in-context signup if (isIncontextSignupAvailable) return false; } - return !this.touched.has(input) && !input.classList.contains('ddg-autofilled'); } - autofillInput(input, string, dataType) { // Do not autofill if it's invisible (select elements can be hidden because of custom implementations) - if (input instanceof HTMLInputElement && !(0, _autofillUtils.isPotentiallyViewable)(input)) return; // Do not autofill if it's disabled or readonly to avoid potential breakage - - if (!(0, _inputTypeConfig.canBeInteractedWith)(input)) return; // @ts-ignore + if (input instanceof HTMLInputElement && !(0, _autofillUtils.isPotentiallyViewable)(input)) return; + // Do not autofill if it's disabled or readonly to avoid potential breakage + if (!(0, _inputTypeConfig.canBeInteractedWith)(input)) return; + // @ts-ignore const activeInputSubtype = (0, _matching.getInputSubtype)(this.activeInput); const inputSubtype = (0, _matching.getInputSubtype)(input); - const isEmailAutofill = activeInputSubtype === 'emailAddress' && inputSubtype === 'emailAddress'; // Don't override values for identities, unless it's the current input or we're autofilling email - - if (dataType === 'identities' && // only for identities - input.nodeName !== 'SELECT' && input.value !== '' && // if the input is not empty - this.activeInput !== input && // and this is not the active input + const isEmailAutofill = activeInputSubtype === 'emailAddress' && inputSubtype === 'emailAddress'; + + // Don't override values for identities, unless it's the current input or we're autofilling email + if (dataType === 'identities' && + // only for identities + input.nodeName !== 'SELECT' && input.value !== '' && + // if the input is not empty + this.activeInput !== input && + // and this is not the active input !isEmailAutofill // and we're not auto-filling email ) return; // do not overwrite the value - // If the value is already there, just return + // If the value is already there, just return if (input.value === string) return; const successful = (0, _autofillUtils.setValue)(input, string, this.device.globalConfig); if (!successful) return; input.classList.add('ddg-autofilled'); (0, _autofillUtils.addInlineStyles)(input, (0, _inputStyles.getIconStylesAutofilled)(input, this)); - this.touched.add(input); // If the user changes the value, remove the decoration + this.touched.add(input); + // If the user changes the value, remove the decoration input.addEventListener('input', e => this.removeAllHighlights(e, dataType), { once: true }); } + /** * Autofill method for email protection only * @param {string} alias * @param {'all' | SupportedMainTypes} dataType */ - - autofillEmail(alias) { let dataType = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'identities'; this.isAutofilling = true; this.execOnInputs(input => { const inputSubtype = (0, _matching.getInputSubtype)(input); - if (inputSubtype === 'emailAddress') { this.autofillInput(input, alias, dataType); } @@ -7110,64 +6151,53 @@ class Form { this.isAutofilling = false; this.removeTooltip(); } - autofillData(data, dataType) { - var _this$device$postAuto, _this$device2; - this.isAutofilling = true; this.execOnInputs(input => { const inputSubtype = (0, _matching.getInputSubtype)(input); let autofillData = data[inputSubtype]; - if (inputSubtype === 'expiration' && input instanceof HTMLInputElement) { autofillData = (0, _formatters.getUnifiedExpiryDate)(input, data.expirationMonth, data.expirationYear, this); } - if (inputSubtype === 'expirationYear' && input instanceof HTMLInputElement) { autofillData = (0, _formatters.formatCCYear)(input, autofillData, this); } - if (inputSubtype === 'addressCountryCode') { autofillData = (0, _formatters.getCountryName)(input, data); } - if (autofillData) { this.autofillInput(input, autofillData, dataType); } }, dataType); - this.isAutofilling = false; // After autofill we check if form values match the data provided… + this.isAutofilling = false; + // After autofill we check if form values match the data provided… const formValues = this.getValuesReadyForStorage(); const areAllFormValuesKnown = Object.keys(formValues[dataType] || {}).every(subtype => formValues[dataType][subtype] === data[subtype]); - if (areAllFormValuesKnown) { // …if we know all the values do not prompt to store data - this.shouldPromptToStoreData = false; // reset this to its initial value - + this.shouldPromptToStoreData = false; + // reset this to its initial value this.shouldAutoSubmit = this.device.globalConfig.isMobileApp; } else { // …otherwise we will prompt and do not want to autosubmit because the experience is jarring this.shouldAutoSubmit = false; } - - (_this$device$postAuto = (_this$device2 = this.device).postAutofill) === null || _this$device$postAuto === void 0 ? void 0 : _this$device$postAuto.call(_this$device2, data, dataType, this); + this.device.postAutofill?.(data, dataType, this); this.removeTooltip(); } + /** * Set all inputs of the data type to "touched" * @param {'all' | SupportedMainTypes} dataType */ - - touchAllInputs() { let dataType = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'all'; this.execOnInputs(input => this.touched.add(input), dataType); } - getFirstViableCredentialsInput() { return [...this.inputs.credentials].find(input => (0, _inputTypeConfig.canBeInteractedWith)(input) && (0, _autofillUtils.isPotentiallyViewable)(input)); } - async promptLoginIfNeeded() { if (document.visibilityState !== 'visible' || !this.isLogin) return; const firstCredentialInput = this.getFirstViableCredentialsInput(); @@ -7179,7 +6209,6 @@ class Form { mainType, subtype }); - if (this.device.settings.canAutofillType({ mainType, subtype @@ -7195,10 +6224,9 @@ class Form { height } = this.form.getBoundingClientRect(); const elHCenter = x + width / 2; - const elVCenter = y + height / 2; // This checks that the form is not covered by anything else - + const elVCenter = y + height / 2; + // This checks that the form is not covered by anything else const topMostElementFromPoint = document.elementFromPoint(elHCenter, elVCenter); - if (this.form.contains(topMostElementFromPoint)) { this.execOnInputs(input => { if ((0, _autofillUtils.isPotentiallyViewable)(input)) { @@ -7219,9 +6247,7 @@ class Form { }, 200); } } - } - exports.Form = Form; },{"../autofill-utils.js":51,"../constants.js":54,"./FormAnalyzer.js":24,"./formatters.js":26,"./inputStyles.js":27,"./inputTypeConfig.js":28,"./matching.js":33}],24:[function(require,module,exports){ @@ -7231,118 +6257,99 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; - var _matching = require("./matching.js"); - var _constants = require("../constants.js"); - var _compiledMatchingConfig = require("./matching-config/__generated__/compiled-matching-config.js"); - var _autofillUtils = require("../autofill-utils.js"); - -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - class FormAnalyzer { /** @type HTMLElement */ - + form; /** @type Matching */ - + matching; /** * @param {HTMLElement} form * @param {HTMLInputElement|HTMLSelectElement} input * @param {Matching} [matching] */ constructor(form, input, matching) { - _defineProperty(this, "form", void 0); - - _defineProperty(this, "matching", void 0); - - _defineProperty(this, "_isCCForm", undefined); - this.form = form; this.matching = matching || new _matching.Matching(_compiledMatchingConfig.matchingConfiguration); + /** * The signal is a continuum where negative values imply login and positive imply signup * @type {number} */ - this.autofillSignal = 0; /** * A hybrid form can be either a login or a signup, the site uses a single form for both * @type {number} */ - this.hybridSignal = 0; + /** * Collects the signals for debugging purposes * @type {string[]} */ - this.signals = []; this.evaluateElAttributes(input, 1, true); form ? this.evaluateForm() : this.evaluatePage(); return this; } + /** * Hybrid forms can be used for both login and signup * @returns {boolean} */ - - get isHybrid() { // When marking for hybrid we also want to ensure other signals are weak const areOtherSignalsWeak = Math.abs(this.autofillSignal) < 10; return this.hybridSignal > 0 && areOtherSignalsWeak; } - get isLogin() { if (this.isHybrid) return false; return this.autofillSignal < 0; } - get isSignup() { if (this.isHybrid) return false; return this.autofillSignal >= 0; } + /** * Tilts the scoring towards Signup * @param {number} strength * @param {string} signal * @returns {FormAnalyzer} */ - - increaseSignalBy(strength, signal) { this.autofillSignal += strength; - this.signals.push("".concat(signal, ": +").concat(strength)); + this.signals.push(`${signal}: +${strength}`); return this; } + /** * Tilts the scoring towards Login * @param {number} strength * @param {string} signal * @returns {FormAnalyzer} */ - - decreaseSignalBy(strength, signal) { this.autofillSignal -= strength; - this.signals.push("".concat(signal, ": -").concat(strength)); + this.signals.push(`${signal}: -${strength}`); return this; } + /** * Increases the probability that this is a hybrid form (can be either login or signup) * @param {number} strength * @param {string} signal * @returns {FormAnalyzer} */ - - increaseHybridSignal(strength, signal) { this.hybridSignal += strength; - this.signals.push("".concat(signal, " (hybrid): +").concat(strength)); + this.signals.push(`${signal} (hybrid): +${strength}`); return this; } + /** * Updates the Login<->Signup signal according to the provided parameters * @param {object} p @@ -7354,11 +6361,7 @@ class FormAnalyzer { * @param {boolean} [p.shouldBeConservative] - Should use the conservative signup regex * @returns {FormAnalyzer} */ - - updateSignal(_ref) { - var _this$matching$getDDG, _this$matching$getDDG2, _this$matching$getDDG3; - let { string, strength, @@ -7367,16 +6370,17 @@ class FormAnalyzer { shouldCheckUnifiedForm = false, shouldBeConservative = false } = _ref; - const matchesLogin = /current.?password/i.test(string) || ((_this$matching$getDDG = this.matching.getDDGMatcherRegex('loginRegex')) === null || _this$matching$getDDG === void 0 ? void 0 : _this$matching$getDDG.test(string)) || ((_this$matching$getDDG2 = this.matching.getDDGMatcherRegex('resetPasswordLink')) === null || _this$matching$getDDG2 === void 0 ? void 0 : _this$matching$getDDG2.test(string)); // Check explicitly for unified login/signup forms + const matchesLogin = /current.?password/i.test(string) || this.matching.getDDGMatcherRegex('loginRegex')?.test(string) || this.matching.getDDGMatcherRegex('resetPasswordLink')?.test(string); - if (shouldCheckUnifiedForm && matchesLogin && (_this$matching$getDDG3 = this.matching.getDDGMatcherRegex('conservativeSignupRegex')) !== null && _this$matching$getDDG3 !== void 0 && _this$matching$getDDG3.test(string)) { + // Check explicitly for unified login/signup forms + if (shouldCheckUnifiedForm && matchesLogin && this.matching.getDDGMatcherRegex('conservativeSignupRegex')?.test(string)) { this.increaseHybridSignal(strength, signalType); return this; } - const signupRegexToUse = this.matching.getDDGMatcherRegex(shouldBeConservative ? 'conservativeSignupRegex' : 'signupRegex'); - const matchesSignup = /new.?password/i.test(string) || (signupRegexToUse === null || signupRegexToUse === void 0 ? void 0 : signupRegexToUse.test(string)); // In some cases a login match means the login is somewhere else, i.e. when a link points outside + const matchesSignup = /new.?password/i.test(string) || signupRegexToUse?.test(string); + // In some cases a login match means the login is somewhere else, i.e. when a link points outside if (shouldFlip) { if (matchesLogin) this.increaseSignalBy(strength, signalType); if (matchesSignup) this.decreaseSignalBy(strength, signalType); @@ -7384,53 +6388,45 @@ class FormAnalyzer { if (matchesLogin) this.decreaseSignalBy(strength, signalType); if (matchesSignup) this.increaseSignalBy(strength, signalType); } - return this; } - evaluateElAttributes(el) { let signalStrength = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 3; let isInput = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; Array.from(el.attributes).forEach(attr => { if (attr.name === 'style') return; - const attributeString = "".concat(attr.name, "=").concat(attr.value); + const attributeString = `${attr.name}=${attr.value}`; this.updateSignal({ string: attributeString, strength: signalStrength, - signalType: "".concat(el.name, " attr: ").concat(attributeString), + signalType: `${el.name} attr: ${attributeString}`, shouldCheckUnifiedForm: isInput }); }); } - evaluateUrl() { - var _this$matching$getDDG4, _this$matching$getDDG5; - const path = window.location.pathname; - const matchesLogin = (_this$matching$getDDG4 = this.matching.getDDGMatcherRegex('loginRegex')) === null || _this$matching$getDDG4 === void 0 ? void 0 : _this$matching$getDDG4.test(path); - const matchesSignup = (_this$matching$getDDG5 = this.matching.getDDGMatcherRegex('conservativeSignupRegex')) === null || _this$matching$getDDG5 === void 0 ? void 0 : _this$matching$getDDG5.test(path); // If the url matches both, do nothing: the signal is probably confounding + const matchesLogin = this.matching.getDDGMatcherRegex('loginRegex')?.test(path); + const matchesSignup = this.matching.getDDGMatcherRegex('conservativeSignupRegex')?.test(path); + // If the url matches both, do nothing: the signal is probably confounding if (matchesLogin && matchesSignup) return; - if (matchesLogin) { this.decreaseSignalBy(1, 'url matches login'); } - if (matchesSignup) { this.increaseSignalBy(1, 'url matches signup'); } } - evaluatePageTitle() { const pageTitle = document.title; this.updateSignal({ string: pageTitle, strength: 2, - signalType: "page title: ".concat(pageTitle), + signalType: `page title: ${pageTitle}`, shouldCheckUnifiedForm: true }); } - evaluatePageHeadings() { const headings = document.querySelectorAll('h1, h2, h3, [class*="title"], [id*="title"]'); headings.forEach(_ref2 => { @@ -7441,17 +6437,16 @@ class FormAnalyzer { this.updateSignal({ string: textContent, strength: 0.5, - signalType: "heading: ".concat(textContent), + signalType: `heading: ${textContent}`, shouldCheckUnifiedForm: true, shouldBeConservative: true }); }); } - evaluatePage() { this.evaluatePageTitle(); - this.evaluatePageHeadings(); // Check for submit buttons - + this.evaluatePageHeadings(); + // Check for submit buttons const buttons = document.querySelectorAll(this.matching.cssSelector('submitButtonSelector')); buttons.forEach(button => { // if the button has a form, it's not related to our input, because our input has no form here @@ -7463,25 +6458,22 @@ class FormAnalyzer { } }); } - evaluateElement(el) { const string = (0, _autofillUtils.getTextShallow)(el); - if (el.matches(this.matching.cssSelector('password'))) { // These are explicit signals by the web author, so we weigh them heavily this.updateSignal({ string: el.getAttribute('autocomplete') || el.getAttribute('name') || '', strength: 5, - signalType: "explicit: ".concat(el.getAttribute('autocomplete')) + signalType: `explicit: ${el.getAttribute('autocomplete')}` }); return; - } // check button contents - + } + // check button contents if (el.matches(this.matching.cssSelector('submitButtonSelector') + ', *[class*=button]')) { // If we're confident this is the submit button, it's a stronger signal let likelyASubmit = (0, _autofillUtils.isLikelyASubmitButton)(el, this.matching); - if (likelyASubmit) { this.form.querySelectorAll('input[type=submit], button[type=submit]').forEach(submit => { // If there is another element marked as submit and this is not, flip back to false @@ -7490,133 +6482,120 @@ class FormAnalyzer { } }); } - const strength = likelyASubmit ? 20 : 2; this.updateSignal({ string, strength, - signalType: "submit: ".concat(string) + signalType: `submit: ${string}` }); return; - } // if an external link matches one of the regexes, we assume the match is not pertinent to the current form - - + } + // if an external link matches one of the regexes, we assume the match is not pertinent to the current form if (el instanceof HTMLAnchorElement && el.href && el.getAttribute('href') !== '#' || (el.getAttribute('role') || '').toUpperCase() === 'LINK' || el.matches('button[class*=secondary]')) { - var _this$matching$getDDG6, _this$matching$getDDG7; - let shouldFlip = true; - let strength = 1; // Don't flip forgotten password links - - if ((_this$matching$getDDG6 = this.matching.getDDGMatcherRegex('resetPasswordLink')) !== null && _this$matching$getDDG6 !== void 0 && _this$matching$getDDG6.test(string)) { + let strength = 1; + // Don't flip forgotten password links + if (this.matching.getDDGMatcherRegex('resetPasswordLink')?.test(string)) { shouldFlip = false; strength = 3; - } else if ((_this$matching$getDDG7 = this.matching.getDDGMatcherRegex('loginProvidersRegex')) !== null && _this$matching$getDDG7 !== void 0 && _this$matching$getDDG7.test(string)) { + } else if (this.matching.getDDGMatcherRegex('loginProvidersRegex')?.test(string)) { // Don't flip login providers links shouldFlip = false; } - this.updateSignal({ string, strength, - signalType: "external link: ".concat(string), + signalType: `external link: ${string}`, shouldFlip }); } else { - var _removeExcessWhitespa; - // any other case // only consider the el if it's a small text to avoid noisy disclaimers - if (((_removeExcessWhitespa = (0, _matching.removeExcessWhitespace)(el.textContent)) === null || _removeExcessWhitespa === void 0 ? void 0 : _removeExcessWhitespa.length) < _constants.constants.TEXT_LENGTH_CUTOFF) { + if ((0, _matching.removeExcessWhitespace)(el.textContent)?.length < _constants.constants.TEXT_LENGTH_CUTOFF) { this.updateSignal({ string, strength: 1, - signalType: "generic: ".concat(string), + signalType: `generic: ${string}`, shouldCheckUnifiedForm: true }); } } } - evaluateForm() { // Check page url - this.evaluateUrl(); // Check page title + this.evaluateUrl(); - this.evaluatePageTitle(); // Check form attributes + // Check page title + this.evaluatePageTitle(); - this.evaluateElAttributes(this.form); // Check form contents (noisy elements are skipped with the safeUniversalSelector) + // Check form attributes + this.evaluateElAttributes(this.form); + // Check form contents (noisy elements are skipped with the safeUniversalSelector) this.form.querySelectorAll(this.matching.cssSelector('safeUniversalSelector')).forEach(el => { // Check if element is not hidden. Note that we can't use offsetHeight // nor intersectionObserver, because the element could be outside the // viewport or its parent hidden const displayValue = window.getComputedStyle(el, null).getPropertyValue('display'); if (displayValue !== 'none') this.evaluateElement(el); - }); // A form with many fields is unlikely to be a login form + }); + // A form with many fields is unlikely to be a login form const relevantFields = this.form.querySelectorAll(this.matching.cssSelector('genericTextField')); - if (relevantFields.length >= 4) { this.increaseSignalBy(relevantFields.length * 1.5, 'many fields: it is probably not a login'); - } // If we can't decide at this point, try reading page headings - + } + // If we can't decide at this point, try reading page headings if (this.autofillSignal === 0) { this.evaluatePageHeadings(); } - return this; } - /** @type {undefined|boolean} */ - + /** @type {undefined|boolean} */ + _isCCForm = undefined; /** * Tries to infer if it's a credit card form * @returns {boolean} */ isCCForm() { - var _formEl$textContent; - if (this._isCCForm !== undefined) return this._isCCForm; const formEl = this.form; const ccFieldSelector = this.matching.joinCssSelectors('cc'); - if (!ccFieldSelector) { this._isCCForm = false; return this._isCCForm; } - - const hasCCSelectorChild = formEl.matches(ccFieldSelector) || formEl.querySelector(ccFieldSelector); // If the form contains one of the specific selectors, we have high confidence - + const hasCCSelectorChild = formEl.matches(ccFieldSelector) || formEl.querySelector(ccFieldSelector); + // If the form contains one of the specific selectors, we have high confidence if (hasCCSelectorChild) { this._isCCForm = true; return this._isCCForm; - } // Read form attributes to find a signal - + } + // Read form attributes to find a signal const hasCCAttribute = [...formEl.attributes].some(_ref3 => { let { name, value } = _ref3; - return /(credit|payment).?card/i.test("".concat(name, "=").concat(value)); + return /(credit|payment).?card/i.test(`${name}=${value}`); }); - if (hasCCAttribute) { this._isCCForm = true; return this._isCCForm; - } // Match form textContent against common cc fields (includes hidden labels) - + } - const textMatches = (_formEl$textContent = formEl.textContent) === null || _formEl$textContent === void 0 ? void 0 : _formEl$textContent.match(/(credit|payment).?card(.?number)?|ccv|security.?code|cvv|cvc|csc/ig); // We check for more than one to minimise false positives + // Match form textContent against common cc fields (includes hidden labels) + const textMatches = formEl.textContent?.match(/(credit|payment).?card(.?number)?|ccv|security.?code|cvv|cvc|csc/ig); + // We check for more than one to minimise false positives this._isCCForm = Boolean(textMatches && textMatches.length > 1); return this._isCCForm; } - } - -var _default = FormAnalyzer; -exports.default = _default; +var _default = exports.default = FormAnalyzer; },{"../autofill-utils.js":51,"../constants.js":54,"./matching-config/__generated__/compiled-matching-config.js":31,"./matching.js":33}],25:[function(require,module,exports){ "use strict"; @@ -7625,13 +6604,12 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.COUNTRY_NAMES_TO_CODES = exports.COUNTRY_CODES_TO_NAMES = void 0; - /** * Country names object using 2-letter country codes to reference country name * Derived from the Intl.DisplayNames implementation * @source https://stackoverflow.com/a/70517921/1948947 */ -const COUNTRY_CODES_TO_NAMES = { +const COUNTRY_CODES_TO_NAMES = exports.COUNTRY_CODES_TO_NAMES = { AC: 'Ascension Island', AD: 'Andorra', AE: 'United Arab Emirates', @@ -7912,14 +6890,13 @@ const COUNTRY_CODES_TO_NAMES = { ZW: 'Zimbabwe', ZZ: 'Unknown Region' }; + /** * Country names object using country name to reference 2-letter country codes * Derived from the solution above with * Object.fromEntries(Object.entries(COUNTRY_CODES_TO_NAMES).map(entry => [entry[1], entry[0]])) */ - -exports.COUNTRY_CODES_TO_NAMES = COUNTRY_CODES_TO_NAMES; -const COUNTRY_NAMES_TO_CODES = { +const COUNTRY_NAMES_TO_CODES = exports.COUNTRY_NAMES_TO_CODES = { 'Ascension Island': 'AC', Andorra: 'AD', 'United Arab Emirates': 'AE', @@ -8184,7 +7161,6 @@ const COUNTRY_NAMES_TO_CODES = { Zambia: 'ZM', 'Unknown Region': 'ZZ' }; -exports.COUNTRY_NAMES_TO_CODES = COUNTRY_NAMES_TO_CODES; },{}],26:[function(require,module,exports){ "use strict"; @@ -8193,19 +7169,13 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.prepareFormValuesForStorage = exports.inferCountryCodeFromElement = exports.getUnifiedExpiryDate = exports.getMMAndYYYYFromString = exports.getCountryName = exports.getCountryDisplayName = exports.formatPhoneNumber = exports.formatFullName = exports.formatCCYear = void 0; - var _matching = require("./matching.js"); - var _countryNames = require("./countryNames.js"); - -var _templateObject, _templateObject2; - -function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); } - // Matches strings like mm/yy, mm-yyyy, mm-aa, 12 / 2024 -const DATE_SEPARATOR_REGEX = /\b((.)\2{1,3}|\d+)(?\s?[/\s.\-_—–]\s?)((.)\5{1,3}|\d+)\b/i; // Matches 4 non-digit repeated characters (YYYY or AAAA) or 4 digits (2022) - +const DATE_SEPARATOR_REGEX = /\b((.)\2{1,3}|\d+)(?\s?[/\s.\-_—–]\s?)((.)\5{1,3}|\d+)\b/i; +// Matches 4 non-digit repeated characters (YYYY or AAAA) or 4 digits (2022) const FOUR_DIGIT_YEAR_REGEX = /(\D)\1{3}|\d{4}/i; + /** * Format the cc year to best adapt to the input requirements (YY vs YYYY) * @param {HTMLInputElement} input @@ -8213,12 +7183,12 @@ const FOUR_DIGIT_YEAR_REGEX = /(\D)\1{3}|\d{4}/i; * @param {import("./Form").Form} form * @returns {string} */ - const formatCCYear = (input, year, form) => { const selector = form.matching.cssSelector('formInputsSelector'); if (input.maxLength === 4 || (0, _matching.checkPlaceholderAndLabels)(input, FOUR_DIGIT_YEAR_REGEX, form.form, selector)) return year; - return "".concat(Number(year) - 2000); + return `${Number(year) - 2000}`; }; + /** * Get a unified expiry date with separator * @param {HTMLInputElement} input @@ -8227,250 +7197,215 @@ const formatCCYear = (input, year, form) => { * @param {import("./Form").Form} form * @returns {string} */ - - exports.formatCCYear = formatCCYear; - const getUnifiedExpiryDate = (input, month, year, form) => { - var _matchInPlaceholderAn, _matchInPlaceholderAn2; - const formattedYear = formatCCYear(input, year, form); - const paddedMonth = "".concat(month).padStart(2, '0'); + const paddedMonth = `${month}`.padStart(2, '0'); const cssSelector = form.matching.cssSelector('formInputsSelector'); - const separator = ((_matchInPlaceholderAn = (0, _matching.matchInPlaceholderAndLabels)(input, DATE_SEPARATOR_REGEX, form.form, cssSelector)) === null || _matchInPlaceholderAn === void 0 ? void 0 : (_matchInPlaceholderAn2 = _matchInPlaceholderAn.groups) === null || _matchInPlaceholderAn2 === void 0 ? void 0 : _matchInPlaceholderAn2.separator) || '/'; - return "".concat(paddedMonth).concat(separator).concat(formattedYear); + const separator = (0, _matching.matchInPlaceholderAndLabels)(input, DATE_SEPARATOR_REGEX, form.form, cssSelector)?.groups?.separator || '/'; + return `${paddedMonth}${separator}${formattedYear}`; }; - exports.getUnifiedExpiryDate = getUnifiedExpiryDate; - const formatFullName = _ref => { let { firstName = '', middleName = '', lastName = '' } = _ref; - return "".concat(firstName, " ").concat(middleName ? middleName + ' ' : '').concat(lastName).trim(); + return `${firstName} ${middleName ? middleName + ' ' : ''}${lastName}`.trim(); }; + /** * Tries to look up a human-readable country name from the country code * @param {string} locale * @param {string} addressCountryCode * @return {string} - Returns the country code if we can't find a name */ - - exports.formatFullName = formatFullName; - const getCountryDisplayName = (locale, addressCountryCode) => { try { const regionNames = new Intl.DisplayNames([locale], { type: 'region' - }); // Adding this ts-ignore to prevent having to change this implementation. + }); + // Adding this ts-ignore to prevent having to change this implementation. // @ts-ignore - return regionNames.of(addressCountryCode); } catch (e) { return _countryNames.COUNTRY_CODES_TO_NAMES[addressCountryCode] || addressCountryCode; } }; + /** * Tries to infer the element locale or returns 'en' * @param {HTMLInputElement | HTMLSelectElement} el * @return {string | 'en'} */ - - exports.getCountryDisplayName = getCountryDisplayName; +const inferElementLocale = el => el.lang || el.form?.lang || document.body.lang || document.documentElement.lang || 'en'; -const inferElementLocale = el => { - var _el$form; - - return el.lang || ((_el$form = el.form) === null || _el$form === void 0 ? void 0 : _el$form.lang) || document.body.lang || document.documentElement.lang || 'en'; -}; /** * Tries to format the country code into a localised country name * @param {HTMLInputElement | HTMLSelectElement} el * @param {{addressCountryCode?: string}} options */ - - const getCountryName = function (el) { let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; const { addressCountryCode } = options; - if (!addressCountryCode) return ''; // Try to infer the field language or fallback to en + if (!addressCountryCode) return ''; + // Try to infer the field language or fallback to en const elLocale = inferElementLocale(el); - const localisedCountryName = getCountryDisplayName(elLocale, addressCountryCode); // If it's a select el we try to find a suitable match to autofill + const localisedCountryName = getCountryDisplayName(elLocale, addressCountryCode); + // If it's a select el we try to find a suitable match to autofill if (el.nodeName === 'SELECT') { - const englishCountryName = getCountryDisplayName('en', addressCountryCode); // This regex matches both the localised and English country names - - const countryNameRegex = new RegExp(String.raw(_templateObject || (_templateObject = _taggedTemplateLiteral(["", "|", ""])), localisedCountryName.replace(/ /g, '.?'), englishCountryName.replace(/ /g, '.?')), 'i'); - const countryCodeRegex = new RegExp(String.raw(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\b", "\b"], ["\\b", "\\b"])), addressCountryCode), 'i'); // We check the country code first because it's more accurate + const englishCountryName = getCountryDisplayName('en', addressCountryCode); + // This regex matches both the localised and English country names + const countryNameRegex = new RegExp(String.raw`${localisedCountryName.replace(/ /g, '.?')}|${englishCountryName.replace(/ /g, '.?')}`, 'i'); + const countryCodeRegex = new RegExp(String.raw`\b${addressCountryCode}\b`, 'i'); + // We check the country code first because it's more accurate if (el instanceof HTMLSelectElement) { for (const option of el.options) { if (countryCodeRegex.test(option.value)) { return option.value; } } - for (const option of el.options) { if (countryNameRegex.test(option.value) || countryNameRegex.test(option.innerText)) return option.value; } } } - return localisedCountryName; }; + /** * Try to get a map of localised country names to code, or falls back to the English map * @param {HTMLInputElement | HTMLSelectElement} el */ - - exports.getCountryName = getCountryName; - const getLocalisedCountryNamesToCodes = el => { - if (typeof Intl.DisplayNames !== 'function') return _countryNames.COUNTRY_NAMES_TO_CODES; // Try to infer the field language or fallback to en + if (typeof Intl.DisplayNames !== 'function') return _countryNames.COUNTRY_NAMES_TO_CODES; + // Try to infer the field language or fallback to en const elLocale = inferElementLocale(el); return Object.fromEntries(Object.entries(_countryNames.COUNTRY_CODES_TO_NAMES).map(_ref2 => { let [code] = _ref2; return [getCountryDisplayName(elLocale, code), code]; })); }; + /** * Try to infer a country code from an element we identified as identities.addressCountryCode * @param {HTMLInputElement | HTMLSelectElement} el * @return {string} */ - - const inferCountryCodeFromElement = el => { if (_countryNames.COUNTRY_CODES_TO_NAMES[el.value]) return el.value; if (_countryNames.COUNTRY_NAMES_TO_CODES[el.value]) return _countryNames.COUNTRY_NAMES_TO_CODES[el.value]; const localisedCountryNamesToCodes = getLocalisedCountryNamesToCodes(el); if (localisedCountryNamesToCodes[el.value]) return localisedCountryNamesToCodes[el.value]; - if (el instanceof HTMLSelectElement) { - var _el$selectedOptions$; - - const selectedText = (_el$selectedOptions$ = el.selectedOptions[0]) === null || _el$selectedOptions$ === void 0 ? void 0 : _el$selectedOptions$.text; + const selectedText = el.selectedOptions[0]?.text; if (_countryNames.COUNTRY_CODES_TO_NAMES[selectedText]) return selectedText; if (_countryNames.COUNTRY_NAMES_TO_CODES[selectedText]) return localisedCountryNamesToCodes[selectedText]; if (localisedCountryNamesToCodes[selectedText]) return localisedCountryNamesToCodes[selectedText]; } - return ''; }; + /** * Gets separate expiration month and year from a single string * @param {string} expiration * @return {{expirationYear: string, expirationMonth: string}} */ - - exports.inferCountryCodeFromElement = inferCountryCodeFromElement; - const getMMAndYYYYFromString = expiration => { /** @type {string[]} */ const values = expiration.match(/(\d+)/g) || []; - return values === null || values === void 0 ? void 0 : values.reduce((output, current) => { + return values?.reduce((output, current) => { if (Number(current) > 12) { output.expirationYear = current.padStart(4, '20'); } else { output.expirationMonth = current.padStart(2, '0'); } - return output; }, { expirationYear: '', expirationMonth: '' }); }; + /** * @param {InternalDataStorageObject} credentials * @return {boolean} */ - - exports.getMMAndYYYYFromString = getMMAndYYYYFromString; - const shouldStoreCredentials = _ref3 => { let { credentials } = _ref3; return Boolean(credentials.password); }; + /** * @param {InternalDataStorageObject} credentials * @return {boolean} */ - - const shouldStoreIdentities = _ref4 => { let { identities } = _ref4; return Boolean((identities.firstName || identities.fullName) && identities.addressStreet && identities.addressCity); }; + /** * @param {InternalDataStorageObject} credentials * @return {boolean} */ - - const shouldStoreCreditCards = _ref5 => { let { creditCards } = _ref5; if (!creditCards.cardNumber) return false; - if (creditCards.cardSecurityCode) return true; // Some forms (Amazon) don't have the cvv, so we still save if there's the expiration - - if (creditCards.expiration) return true; // Expiration can also be two separate values - + if (creditCards.cardSecurityCode) return true; + // Some forms (Amazon) don't have the cvv, so we still save if there's the expiration + if (creditCards.expiration) return true; + // Expiration can also be two separate values return Boolean(creditCards.expirationYear && creditCards.expirationMonth); }; + /** * Removes formatting characters from phone numbers, only leaves digits and the + sign * @param {String} phone * @returns {String} */ - - const formatPhoneNumber = phone => phone.replaceAll(/[^0-9|+]/g, ''); + /** * Formats form data into an object to send to the device for storage * If values are insufficient for a complete entry, they are discarded * @param {InternalDataStorageObject} formValues * @return {DataStorageObject} */ - - exports.formatPhoneNumber = formatPhoneNumber; - const prepareFormValuesForStorage = formValues => { - var _identities, _identities2; - /** @type {Partial} */ let { credentials, identities, creditCards - } = formValues; // If we have an identity name but not a card name, copy it over there + } = formValues; - if (!creditCards.cardName && ((_identities = identities) !== null && _identities !== void 0 && _identities.fullName || (_identities2 = identities) !== null && _identities2 !== void 0 && _identities2.firstName)) { - var _identities3; - - creditCards.cardName = ((_identities3 = identities) === null || _identities3 === void 0 ? void 0 : _identities3.fullName) || formatFullName(identities); + // If we have an identity name but not a card name, copy it over there + if (!creditCards.cardName && (identities?.fullName || identities?.firstName)) { + creditCards.cardName = identities?.fullName || formatFullName(identities); } + /** Fixes for credentials **/ // Don't store if there isn't enough data - - if (shouldStoreCredentials(formValues)) { // If we don't have a username to match a password, let's see if the email is available if (credentials.password && !credentials.username && identities.emailAddress) { @@ -8479,17 +7414,15 @@ const prepareFormValuesForStorage = formValues => { } else { credentials = undefined; } + /** Fixes for identities **/ // Don't store if there isn't enough data - - if (shouldStoreIdentities(formValues)) { if (identities.fullName) { // when forms have both first/last and fullName we keep the individual values and drop the fullName if (!(identities.firstName && identities.lastName)) { // If the fullname can be easily split into two, we'll store it as first and last const nameParts = identities.fullName.trim().split(/\s+/); - if (nameParts.length === 2) { identities.firstName = nameParts[0]; identities.lastName = nameParts[1]; @@ -8498,23 +7431,18 @@ const prepareFormValuesForStorage = formValues => { identities.firstName = identities.fullName; } } - delete identities.fullName; } - if (identities.phone) { identities.phone = formatPhoneNumber(identities.phone); } } else { identities = undefined; } + /** Fixes for credit cards **/ // Don't store if there isn't enough data - - if (shouldStoreCreditCards(formValues)) { - var _creditCards$expirati; - if (creditCards.expiration) { const { expirationMonth, @@ -8524,23 +7452,19 @@ const prepareFormValuesForStorage = formValues => { creditCards.expirationYear = expirationYear; delete creditCards.expiration; } - - creditCards.expirationYear = (_creditCards$expirati = creditCards.expirationYear) === null || _creditCards$expirati === void 0 ? void 0 : _creditCards$expirati.padStart(4, '20'); - + creditCards.expirationYear = creditCards.expirationYear?.padStart(4, '20'); if (creditCards.cardNumber) { creditCards.cardNumber = creditCards.cardNumber.replace(/\D/g, ''); } } else { creditCards = undefined; } - return { credentials, identities, creditCards }; }; - exports.prepareFormValuesForStorage = prepareFormValuesForStorage; },{"./countryNames.js":25,"./matching.js":33}],27:[function(require,module,exports){ @@ -8550,9 +7474,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.getIconStylesBase = exports.getIconStylesAutofilled = exports.getIconStylesAlternate = void 0; - var _inputTypeConfig = require("./inputTypeConfig.js"); - /** * Returns the css-ready base64 encoding of the icon for the given input * @param {HTMLInputElement} input @@ -8563,86 +7485,77 @@ var _inputTypeConfig = require("./inputTypeConfig.js"); const getIcon = function (input, form) { let type = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'base'; const config = (0, _inputTypeConfig.getInputConfig)(input); - if (type === 'base') { return config.getIconBase(input, form); } - if (type === 'filled') { return config.getIconFilled(input, form); } - if (type === 'alternate') { return config.getIconAlternate(input, form); } - return ''; }; + /** * Returns an object with styles to be applied inline * @param {HTMLInputElement} input * @param {String} icon * @return {Object} */ - - const getBasicStyles = (input, icon) => ({ // Height must be > 0 to account for fields initially hidden - 'background-size': "auto ".concat(input.offsetHeight <= 30 && input.offsetHeight > 0 ? '100%' : '24px'), + 'background-size': `auto ${input.offsetHeight <= 30 && input.offsetHeight > 0 ? '100%' : '24px'}`, 'background-position': 'center right', 'background-repeat': 'no-repeat', 'background-origin': 'content-box', - 'background-image': "url(".concat(icon, ")"), + 'background-image': `url(${icon})`, 'transition': 'background 0s' }); + /** * Get inline styles for the injected icon, base state * @param {HTMLInputElement} input * @param {import("./Form").Form} form * @return {Object} */ - - const getIconStylesBase = (input, form) => { const icon = getIcon(input, form); if (!icon) return {}; return getBasicStyles(input, icon); }; + /** * Get inline styles for the injected icon, alternate state * @param {HTMLInputElement} input * @param {import("./Form").Form} form * @return {Object} */ - - exports.getIconStylesBase = getIconStylesBase; - const getIconStylesAlternate = (input, form) => { const icon = getIcon(input, form, 'alternate'); if (!icon) return {}; - return { ...getBasicStyles(input, icon) + return { + ...getBasicStyles(input, icon) }; }; + /** * Get inline styles for the injected icon, autofilled state * @param {HTMLInputElement} input * @param {import("./Form").Form} form * @return {Object} */ - - exports.getIconStylesAlternate = getIconStylesAlternate; - const getIconStylesAutofilled = (input, form) => { const icon = getIcon(input, form, 'filled'); const iconStyle = icon ? getBasicStyles(input, icon) : {}; - return { ...iconStyle, + return { + ...iconStyle, 'background-color': '#F8F498', 'color': '#333333' }; }; - exports.getIconStylesAutofilled = getIconStylesAutofilled; },{"./inputTypeConfig.js":28}],28:[function(require,module,exports){ @@ -8652,25 +7565,15 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.isFieldDecorated = exports.getInputConfigFromType = exports.getInputConfig = exports.canBeInteractedWith = void 0; - var _logoSvg = require("./logo-svg.js"); - var ddgPasswordIcons = _interopRequireWildcard(require("../UI/img/ddgPasswordIcon.js")); - var _matching = require("./matching.js"); - var _Credentials = require("../InputTypes/Credentials.js"); - var _CreditCard = require("../InputTypes/CreditCard.js"); - var _Identity = require("../InputTypes/Identity.js"); - var _constants = require("../constants.js"); - function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } - function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } - /** * Get the icon for the identities (currently only Dax for emails) * @param {HTMLInputElement} input @@ -8678,28 +7581,25 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && * @return {string} */ const getIdentitiesIcon = (input, _ref) => { - var _device$inContextSign; - let { device } = _ref; - if (!canBeInteractedWith(input)) return ''; // In Firefox web_accessible_resources could leak a unique user identifier, so we avoid it here + if (!canBeInteractedWith(input)) return ''; + // In Firefox web_accessible_resources could leak a unique user identifier, so we avoid it here const { isDDGApp, isFirefox, isExtension } = device.globalConfig; const subtype = (0, _matching.getInputSubtype)(input); - - if ((_device$inContextSign = device.inContextSignup) !== null && _device$inContextSign !== void 0 && _device$inContextSign.isAvailable(subtype)) { + if (device.inContextSignup?.isAvailable(subtype)) { if (isDDGApp || isFirefox) { return _logoSvg.daxGrayscaleBase64; } else if (isExtension) { return chrome.runtime.getURL('img/logo-small-grayscale.svg'); } } - if (subtype === 'emailAddress' && device.isDeviceSignedIn()) { if (isDDGApp || isFirefox) { return _logoSvg.daxBase64; @@ -8707,34 +7607,30 @@ const getIdentitiesIcon = (input, _ref) => { return chrome.runtime.getURL('img/logo-small.svg'); } } - return ''; }; + /** * Get the alternate icon for the identities (currently only Dax for emails) * @param {HTMLInputElement} input * @param {import("./Form").Form} form * @return {string} */ - - const getIdentitiesAlternateIcon = (input, _ref2) => { - var _device$inContextSign2; - let { device } = _ref2; - if (!canBeInteractedWith(input)) return ''; // In Firefox web_accessible_resources could leak a unique user identifier, so we avoid it here + if (!canBeInteractedWith(input)) return ''; + // In Firefox web_accessible_resources could leak a unique user identifier, so we avoid it here const { isDDGApp, isFirefox, isExtension } = device.globalConfig; const subtype = (0, _matching.getInputSubtype)(input); - const isIncontext = (_device$inContextSign2 = device.inContextSignup) === null || _device$inContextSign2 === void 0 ? void 0 : _device$inContextSign2.isAvailable(subtype); + const isIncontext = device.inContextSignup?.isAvailable(subtype); const isEmailProtection = subtype === 'emailAddress' && device.isDeviceSignedIn(); - if (isIncontext || isEmailProtection) { if (isDDGApp || isFirefox) { return _logoSvg.daxBase64; @@ -8742,27 +7638,23 @@ const getIdentitiesAlternateIcon = (input, _ref2) => { return chrome.runtime.getURL('img/logo-small.svg'); } } - return ''; }; + /** * Checks whether a field is readonly or disabled * @param {HTMLInputElement} input * @return {boolean} */ - - const canBeInteractedWith = input => !input.readOnly && !input.disabled; + /** * Checks if the input can be decorated and we have the needed data * @param {HTMLInputElement} input * @param {import("../DeviceInterface/InterfacePrototype").default} device * @returns {Promise} */ - - exports.canBeInteractedWith = canBeInteractedWith; - const canBeAutofilled = async (input, device) => { if (!canBeInteractedWith(input)) return false; const mainType = (0, _matching.getInputMainType)(input); @@ -8777,12 +7669,11 @@ const canBeAutofilled = async (input, device) => { }, device.inContextSignup); return Boolean(canAutofill); }; + /** * A map of config objects. These help by centralising here some complexity * @type {InputTypeConfig} */ - - const inputTypeConfig = { /** @type {CredentialsInputTypeConfig} */ credentials: { @@ -8793,22 +7684,18 @@ const inputTypeConfig = { device } = _ref3; if (!canBeInteractedWith(input)) return ''; - if (device.settings.featureToggles.inlineIcon_credentials) { return ddgPasswordIcons.ddgPasswordIconBase; } - return ''; }, getIconFilled: (_input, _ref4) => { let { device } = _ref4; - if (device.settings.featureToggles.inlineIcon_credentials) { return ddgPasswordIcons.ddgPasswordIconFilled; } - return ''; }, getIconAlternate: () => '', @@ -8818,27 +7705,23 @@ const inputTypeConfig = { isHybrid, device } = _ref5; - // if we are on a 'login' page, check if we have data to autofill the field if (isLogin || isHybrid) { return canBeAutofilled(input, device); - } // at this point, it's not a 'login' form, so we could offer to provide a password - + } + // at this point, it's not a 'login' form, so we could offer to provide a password if (device.settings.featureToggles.password_generation) { const subtype = (0, _matching.getInputSubtype)(input); - if (subtype === 'password') { return canBeInteractedWith(input); } } - return false; }, dataType: 'Credentials', tooltipItem: data => (0, _Credentials.createCredentialsTooltipItem)(data) }, - /** @type {CreditCardsInputTypeConfig} */ creditCards: { type: 'creditCards', @@ -8855,7 +7738,6 @@ const inputTypeConfig = { dataType: 'CreditCards', tooltipItem: data => new _CreditCard.CreditCardTooltipItem(data) }, - /** @type {IdentitiesInputTypeConfig} */ identities: { type: 'identities', @@ -8872,7 +7754,6 @@ const inputTypeConfig = { dataType: 'Identities', tooltipItem: data => new _Identity.IdentityTooltipItem(data) }, - /** @type {UnknownInputTypeConfig} */ unknown: { type: 'unknown', @@ -8887,42 +7768,37 @@ const inputTypeConfig = { } } }; + /** * Retrieves configs from an input el * @param {HTMLInputElement} input * @returns {InputTypeConfigs} */ - const getInputConfig = input => { const inputType = (0, _matching.getInputType)(input); return getInputConfigFromType(inputType); }; + /** * Retrieves configs from an input type * @param {import('./matching').SupportedTypes} inputType * @returns {InputTypeConfigs} */ - - exports.getInputConfig = getInputConfig; - const getInputConfigFromType = inputType => { const inputMainType = (0, _matching.getMainTypeFromType)(inputType); return inputTypeConfig[inputMainType]; }; + /** * Given an input field checks wheter it was previously decorated * @param {HTMLInputElement} input * @returns {Boolean} */ - - exports.getInputConfigFromType = getInputConfigFromType; - const isFieldDecorated = input => { return input.hasAttribute(_constants.constants.ATTR_INPUT_TYPE); }; - exports.isFieldDecorated = isFieldDecorated; },{"../InputTypes/Credentials.js":35,"../InputTypes/CreditCard.js":36,"../InputTypes/Identity.js":37,"../UI/img/ddgPasswordIcon.js":49,"../constants.js":54,"./logo-svg.js":30,"./matching.js":33}],29:[function(require,module,exports){ @@ -8932,10 +7808,9 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.extractElementStrings = exports.EXCLUDED_TAGS = void 0; - var _matching = require("./matching.js"); +const EXCLUDED_TAGS = exports.EXCLUDED_TAGS = ['BR', 'SCRIPT', 'NOSCRIPT', 'OPTION', 'STYLE']; -const EXCLUDED_TAGS = ['BR', 'SCRIPT', 'NOSCRIPT', 'OPTION', 'STYLE']; /** * Extract all strings of an element's children to an array. * "element.textContent" is a string which is merged of all children nodes, @@ -8946,44 +7821,32 @@ const EXCLUDED_TAGS = ['BR', 'SCRIPT', 'NOSCRIPT', 'OPTION', 'STYLE']; * @returns {string[]} * All strings in an element. */ - -exports.EXCLUDED_TAGS = EXCLUDED_TAGS; - const extractElementStrings = element => { const strings = new Set(); - const _extractElementStrings = el => { if (EXCLUDED_TAGS.includes(el.tagName)) { return; - } // only take the string when it's an explicit text node - + } + // only take the string when it's an explicit text node if (el.nodeType === el.TEXT_NODE || !el.childNodes.length) { let trimmedText = (0, _matching.removeExcessWhitespace)(el.textContent); - if (trimmedText) { strings.add(trimmedText); } - return; } - for (let node of el.childNodes) { let nodeType = node.nodeType; - if (nodeType !== node.ELEMENT_NODE && nodeType !== node.TEXT_NODE) { continue; } - _extractElementStrings(node); } }; - _extractElementStrings(element); - return [...strings]; }; - exports.extractElementStrings = extractElementStrings; },{"./matching.js":33}],30:[function(require,module,exports){ @@ -8993,12 +7856,31 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.daxGrayscaleBase64 = exports.daxBase64 = void 0; -const daxSvg = "\n\n \n \n \n \n \n \n \n \n \n \n \n\n".trim(); -const daxBase64 = "data:image/svg+xml;base64,".concat(window.btoa(daxSvg)); -exports.daxBase64 = daxBase64; -const daxGrayscaleSvg = "\n\n \n \n \n \n\n".trim(); -const daxGrayscaleBase64 = "data:image/svg+xml;base64,".concat(window.btoa(daxGrayscaleSvg)); -exports.daxGrayscaleBase64 = daxGrayscaleBase64; +const daxSvg = ` + + + + + + + + + + + + + +`.trim(); +const daxBase64 = exports.daxBase64 = `data:image/svg+xml;base64,${window.btoa(daxSvg)}`; +const daxGrayscaleSvg = ` + + + + + + +`.trim(); +const daxGrayscaleBase64 = exports.daxGrayscaleBase64 = `data:image/svg+xml;base64,${window.btoa(daxGrayscaleSvg)}`; },{}],31:[function(require,module,exports){ "use strict"; @@ -9007,11 +7889,10 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.matchingConfiguration = void 0; - /* DO NOT EDIT, this file was generated by scripts/precompile-regexes.js */ /** @type {MatchingConfiguration} */ -const matchingConfiguration = { +const matchingConfiguration = exports.matchingConfiguration = { matchers: { fields: { unknown: { @@ -9446,7 +8327,6 @@ const matchingConfiguration = { } } }; -exports.matchingConfiguration = matchingConfiguration; },{}],32:[function(require,module,exports){ "use strict"; @@ -9456,11 +8336,8 @@ Object.defineProperty(exports, "__esModule", { }); exports.logMatching = logMatching; exports.logUnmatched = logUnmatched; - var _autofillUtils = require("../autofill-utils.js"); - var _matching = require("./matching.js"); - /** * Logs out matching details when debug flag is active * @param {HTMLInputElement | HTMLSelectElement} el @@ -9478,49 +8355,44 @@ function logMatching(el, matchingResult) { matcherType } = matchingResult; const verb = getVerb(matchingResult); - let stringToLog = "".concat(verb, " for \"").concat(matcherType, "\" with \"").concat(strategyName, "\""); - + let stringToLog = `${verb} for "${matcherType}" with "${strategyName}"`; if (matchedString && matchedFrom) { - stringToLog += "\nString: \"".concat(matchedString, "\"\nSource: \"").concat(matchedFrom, "\""); + stringToLog += `\nString: "${matchedString}"\nSource: "${matchedFrom}"`; } - console.log(stringToLog); console.groupEnd(); } + /** * Helper to form the correct string based on matching result type * @param {MatchingResult} matchingResult * @return {string} */ - - function getVerb(matchingResult) { if (matchingResult.matched) return 'Matched'; if (matchingResult.proceed === false) return 'Matched forceUnknown'; if (matchingResult.skip) return 'Skipped'; return ''; } + /** * Returns a human-friendly name to identify a single input field * @param {HTMLInputElement | HTMLSelectElement} el * @returns {string} */ - - function getInputIdentifier(el) { const label = (0, _matching.getExplicitLabelsText)(el); - const placeholder = el instanceof HTMLInputElement && el.placeholder ? "".concat(el.placeholder) : ''; - const name = el.name ? "".concat(el.name) : ''; - const id = el.id ? "#".concat(el.id) : ''; + const placeholder = el instanceof HTMLInputElement && el.placeholder ? `${el.placeholder}` : ''; + const name = el.name ? `${el.name}` : ''; + const id = el.id ? `#${el.id}` : ''; return 'Field: ' + (label || placeholder || name || id); } + /** * Logs info when a field was not matched by the algo * @param el * @param allStrings */ - - function logUnmatched(el, allStrings) { if (!(0, _autofillUtils.shouldLog)()) return; const fieldIdentifier = getInputIdentifier(el); @@ -9546,140 +8418,76 @@ exports.getMainTypeFromType = getMainTypeFromType; exports.getRelatedText = void 0; exports.getSubtypeFromType = getSubtypeFromType; exports.removeExcessWhitespace = exports.matchInPlaceholderAndLabels = void 0; - var _constants = require("../constants.js"); - var _labelUtil = require("./label-util.js"); - var _compiledMatchingConfig = require("./matching-config/__generated__/compiled-matching-config.js"); - var _matchingUtils = require("./matching-utils.js"); - var _autofillUtils = require("../autofill-utils.js"); - -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - -function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); } - -function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } } - -function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); } - -function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; } - -function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; } - -function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); } - -function _classApplyDescriptorSet(receiver, descriptor, value) { if (descriptor.set) { descriptor.set.call(receiver, value); } else { if (!descriptor.writable) { throw new TypeError("attempted to set read only private field"); } descriptor.value = value; } } - const { TEXT_LENGTH_CUTOFF, ATTR_INPUT_TYPE } = _constants.constants; -/** @type {{[K in keyof MatcherLists]?: { minWidth: number }} } */ +/** @type {{[K in keyof MatcherLists]?: { minWidth: number }} } */ const dimensionBounds = { emailAddress: { minWidth: 35 } }; + /** * An abstraction around the concept of classifying input fields. * * The only state this class keeps is derived from the passed-in MatchingConfiguration. */ - -var _config = /*#__PURE__*/new WeakMap(); - -var _cssSelectors = /*#__PURE__*/new WeakMap(); - -var _ddgMatchers = /*#__PURE__*/new WeakMap(); - -var _vendorRegexRules = /*#__PURE__*/new WeakMap(); - -var _matcherLists = /*#__PURE__*/new WeakMap(); - -var _defaultStrategyOrder = /*#__PURE__*/new WeakMap(); - class Matching { /** @type {MatchingConfiguration} */ + #config; /** @type {CssSelectorConfiguration['selectors']} */ + #cssSelectors; /** @type {Record} */ + #ddgMatchers; /** * This acts as an internal cache for the larger vendorRegexes * @type {VendorRegexConfiguration['rules']} */ + #vendorRegexRules; /** @type {MatcherLists} */ + #matcherLists; /** @type {Array} */ + #defaultStrategyOrder = ['cssSelector', 'ddgMatcher', 'vendorRegex']; /** @type {Record} */ + activeElementStrings = { + nameAttr: '', + labelText: '', + placeholderAttr: '', + relatedText: '', + id: '' + }; /** * @param {MatchingConfiguration} config */ constructor(config) { - _classPrivateFieldInitSpec(this, _config, { - writable: true, - value: void 0 - }); - - _classPrivateFieldInitSpec(this, _cssSelectors, { - writable: true, - value: void 0 - }); - - _classPrivateFieldInitSpec(this, _ddgMatchers, { - writable: true, - value: void 0 - }); - - _classPrivateFieldInitSpec(this, _vendorRegexRules, { - writable: true, - value: void 0 - }); - - _classPrivateFieldInitSpec(this, _matcherLists, { - writable: true, - value: void 0 - }); - - _classPrivateFieldInitSpec(this, _defaultStrategyOrder, { - writable: true, - value: ['cssSelector', 'ddgMatcher', 'vendorRegex'] - }); - - _defineProperty(this, "activeElementStrings", { - nameAttr: '', - labelText: '', - placeholderAttr: '', - relatedText: '', - id: '' - }); - - _defineProperty(this, "_elementStringCache", new WeakMap()); - - _classPrivateFieldSet(this, _config, config); - - _classPrivateFieldSet(this, _vendorRegexRules, _classPrivateFieldGet(this, _config).strategies.vendorRegex.rules); - - _classPrivateFieldSet(this, _cssSelectors, _classPrivateFieldGet(this, _config).strategies.cssSelector.selectors); - - _classPrivateFieldSet(this, _ddgMatchers, _classPrivateFieldGet(this, _config).strategies.ddgMatcher.matchers); - - _classPrivateFieldSet(this, _matcherLists, { + this.#config = config; + this.#vendorRegexRules = this.#config.strategies.vendorRegex.rules; + this.#cssSelectors = this.#config.strategies.cssSelector.selectors; + this.#ddgMatchers = this.#config.strategies.ddgMatcher.matchers; + this.#matcherLists = { unknown: [], cc: [], id: [], password: [], username: [], emailAddress: [] - }); + }; + /** * Convert the raw config data into actual references. * @@ -9687,125 +8495,104 @@ class Matching { * * `email: [{type: "email", strategies: {cssSelector: "email", ... etc}]` */ - - - for (let [listName, matcherNames] of Object.entries(_classPrivateFieldGet(this, _config).matchers.lists)) { + for (let [listName, matcherNames] of Object.entries(this.#config.matchers.lists)) { for (let fieldName of matcherNames) { - if (!_classPrivateFieldGet(this, _matcherLists)[listName]) { - _classPrivateFieldGet(this, _matcherLists)[listName] = []; + if (!this.#matcherLists[listName]) { + this.#matcherLists[listName] = []; } - - _classPrivateFieldGet(this, _matcherLists)[listName].push(_classPrivateFieldGet(this, _config).matchers.fields[fieldName]); + this.#matcherLists[listName].push(this.#config.matchers.fields[fieldName]); } } } + /** * @param {HTMLInputElement|HTMLSelectElement} input * @param {HTMLElement} formEl */ - - setActiveElementStrings(input, formEl) { this.activeElementStrings = this.getElementStrings(input, formEl); } + /** * Try to access a 'vendor regex' by name * @param {string} regexName * @returns {RegExp | undefined} */ - - vendorRegex(regexName) { - const match = _classPrivateFieldGet(this, _vendorRegexRules)[regexName]; - + const match = this.#vendorRegexRules[regexName]; if (!match) { console.warn('Vendor Regex not found for', regexName); return undefined; } - return match; } + /** * Strategies can have different lookup names. This returns the correct one * @param {MatcherTypeNames} matcherName * @param {StrategyNames} vendorRegex * @returns {MatcherTypeNames} */ - - getStrategyLookupByType(matcherName, vendorRegex) { - var _classPrivateFieldGet2; - - return (_classPrivateFieldGet2 = _classPrivateFieldGet(this, _config).matchers.fields[matcherName]) === null || _classPrivateFieldGet2 === void 0 ? void 0 : _classPrivateFieldGet2.strategies[vendorRegex]; + return this.#config.matchers.fields[matcherName]?.strategies[vendorRegex]; } + /** * Try to access a 'css selector' by name from configuration * @param {RequiredCssSelectors | string} selectorName * @returns {string}; */ - - cssSelector(selectorName) { - const match = _classPrivateFieldGet(this, _cssSelectors)[selectorName]; - + const match = this.#cssSelectors[selectorName]; if (!match) { console.warn('CSS selector not found for %s, using a default value', selectorName); return ''; } - return match; } + /** * Try to access a 'ddg matcher' by name from configuration * @param {MatcherTypeNames | string} matcherName * @returns {DDGMatcher | undefined} */ - - ddgMatcher(matcherName) { - const match = _classPrivateFieldGet(this, _ddgMatchers)[matcherName]; - + const match = this.#ddgMatchers[matcherName]; if (!match) { console.warn('DDG matcher not found for', matcherName); return undefined; } - return match; } + /** * Returns the RegExp for the given matcherName, with proper flags * @param {AllDDGMatcherNames} matcherName * @returns {RegExp|undefined} */ - - getDDGMatcherRegex(matcherName) { const matcher = this.ddgMatcher(matcherName); - if (!matcher || !matcher.match) { console.warn('DDG matcher has unexpected format'); return undefined; } - - return matcher === null || matcher === void 0 ? void 0 : matcher.match; + return matcher?.match; } + /** * Try to access a list of matchers by name - these are the ones collected in the constructor * @param {keyof MatcherLists} listName * @return {Matcher[]} */ - - matcherList(listName) { - const matcherList = _classPrivateFieldGet(this, _matcherLists)[listName]; - + const matcherList = this.#matcherLists[listName]; if (!matcherList) { console.warn('MatcherList not found for ', listName); return []; } - return matcherList; } + /** * Convert a list of matchers into a single CSS selector. * @@ -9815,52 +8602,46 @@ class Matching { * @param {keyof MatcherLists} listName * @returns {string | undefined} */ - - joinCssSelectors(listName) { const matcherList = this.matcherList(listName); - if (!matcherList) { console.warn('Matcher list not found for', listName); return undefined; } + /** * @type {string[]} */ - - const selectors = []; - for (let matcher of matcherList) { if (matcher.strategies.cssSelector) { const css = this.cssSelector(matcher.strategies.cssSelector); - if (css) { selectors.push(css); } } } - return selectors.join(', '); } + /** * Returns true if the field is visible and large enough * @param {keyof MatcherLists} matchedType * @param {HTMLInputElement} input * @returns {boolean} */ - - isInputLargeEnough(matchedType, input) { const expectedDimensionBounds = dimensionBounds[matchedType]; if (!expectedDimensionBounds) return true; const width = input.offsetWidth; - const height = input.offsetHeight; // Ignore hidden elements as we can't determine their dimensions + const height = input.offsetHeight; + // Ignore hidden elements as we can't determine their dimensions const isHidden = height === 0 && width === 0; if (isHidden) return true; return width >= expectedDimensionBounds.minWidth; } + /** * Tries to infer the input type for an input * @@ -9869,28 +8650,23 @@ class Matching { * @param {SetInputTypeOpts} [opts] * @returns {SupportedTypes} */ - - inferInputType(input, formEl) { let opts = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; const presetType = getInputType(input); - if (presetType !== 'unknown') { return presetType; } - this.setActiveElementStrings(input, formEl); - if (this.subtypeFromMatchers('unknown', input)) return 'unknown'; // For CC forms we run aggressive matches, so we want to make sure we only - // run them on actual CC forms to avoid false positives and expensive loops + if (this.subtypeFromMatchers('unknown', input)) return 'unknown'; + // For CC forms we run aggressive matches, so we want to make sure we only + // run them on actual CC forms to avoid false positives and expensive loops if (opts.isCCForm) { const subtype = this.subtypeFromMatchers('cc', input); - if (subtype && isValidCreditCardSubtype(subtype)) { - return "creditCards.".concat(subtype); + return `creditCards.${subtype}`; } } - if (input instanceof HTMLInputElement) { if (this.subtypeFromMatchers('password', input)) { // Any other input type is likely a false match @@ -9899,7 +8675,6 @@ class Matching { return 'credentials.password'; } } - if (this.subtypeFromMatchers('emailAddress', input) && this.isInputLargeEnough('emailAddress', input)) { if (opts.isLogin || opts.isHybrid) { // TODO: Being this support back in the future @@ -9908,32 +8683,29 @@ class Matching { // if (opts.supportsIdentitiesAutofill && !opts.hasCredentials) { // return 'identities.emailAddress' // } - return 'credentials.username'; - } // TODO: Temporary hack to support Google signin in different languages - // https://app.asana.com/0/1198964220583541/1201650539303898/f + return 'credentials.username'; + } + // TODO: Temporary hack to support Google signin in different languages + // https://app.asana.com/0/1198964220583541/1201650539303898/f if (window.location.href.includes('https://accounts.google.com/v3/signin/identifier') && input.matches('[type=email][autocomplete=username]')) { return 'credentials.username'; } - return 'identities.emailAddress'; } - if (this.subtypeFromMatchers('username', input)) { return 'credentials.username'; } } - const idSubtype = this.subtypeFromMatchers('id', input); - if (idSubtype && isValidIdentitiesSubtype(idSubtype)) { - return "identities.".concat(idSubtype); + return `identities.${idSubtype}`; } - (0, _matchingUtils.logUnmatched)(input, this.activeElementStrings); return 'unknown'; } + /** * @typedef {{ * isLogin?: boolean, @@ -9951,39 +8723,31 @@ class Matching { * @param {SetInputTypeOpts} [opts] * @returns {SupportedSubTypes | string} */ - - setInputType(input, formEl) { let opts = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; const type = this.inferInputType(input, formEl, opts); input.setAttribute(ATTR_INPUT_TYPE, type); return type; } + /** * Tries to infer input subtype, with checks in decreasing order of reliability * @param {keyof MatcherLists} listName * @param {HTMLInputElement|HTMLSelectElement} el * @return {MatcherTypeNames|undefined} */ - - subtypeFromMatchers(listName, el) { const matchers = this.matcherList(listName); + /** * Loop through each strategy in order */ - - for (let strategyName of _classPrivateFieldGet(this, _defaultStrategyOrder)) { - var _result4; - + for (let strategyName of this.#defaultStrategyOrder) { let result; /** * Now loop through each matcher in the list. */ - for (let matcher of matchers) { - var _result, _result2, _result3; - /** * for each `strategyName` (such as cssSelector), check * if the current matcher implements it. @@ -9993,56 +8757,50 @@ class Matching { * Sometimes a matcher may not implement the current strategy, * so we skip it */ - if (!lookup) continue; + /** * Now perform the matching */ - if (strategyName === 'cssSelector') { result = this.execCssSelector(lookup, el); } - if (strategyName === 'ddgMatcher') { result = this.execDDGMatcher(lookup); } - if (strategyName === 'vendorRegex') { result = this.execVendorRegex(lookup); } + /** * If there's a match, return the matcher type. * * So, for example if 'username' had a `cssSelector` implemented, and * it matched the current element, then we'd return 'username' */ - - - if ((_result = result) !== null && _result !== void 0 && _result.matched) { + if (result?.matched) { (0, _matchingUtils.logMatching)(el, result); return matcher.type; } + /** * If a matcher wants to prevent all future matching on this element, * it would return { matched: false, proceed: false } */ - - - if (!((_result2 = result) !== null && _result2 !== void 0 && _result2.matched) && ((_result3 = result) === null || _result3 === void 0 ? void 0 : _result3.proceed) === false) { - (0, _matchingUtils.logMatching)(el, result); // If we get here, do not allow subsequent strategies to continue - + if (!result?.matched && result?.proceed === false) { + (0, _matchingUtils.logMatching)(el, result); + // If we get here, do not allow subsequent strategies to continue return undefined; } } - - if ((_result4 = result) !== null && _result4 !== void 0 && _result4.skip) { + if (result?.skip) { (0, _matchingUtils.logMatching)(el, result); break; } } - return undefined; } + /** * CSS selector matching just leverages the `.matches` method on elements * @@ -10050,8 +8808,6 @@ class Matching { * @param {HTMLInputElement|HTMLSelectElement} el * @returns {MatchingResult} */ - - execCssSelector(lookup, el) { const selector = this.cssSelector(lookup); return { @@ -10060,6 +8816,7 @@ class Matching { matcherType: lookup }; } + /** * A DDG Matcher can have a `match` regex along with a `not` regex. This is done * to allow it to be driven by configuration as it avoids needing to invoke custom functions. @@ -10070,8 +8827,6 @@ class Matching { * @param {MatcherTypeNames} lookup * @returns {MatchingResult} */ - - execDDGMatcher(lookup) { /** @type {MatchingResult} */ const defaultResult = { @@ -10080,46 +8835,44 @@ class Matching { matcherType: lookup }; const ddgMatcher = this.ddgMatcher(lookup); - if (!ddgMatcher || !ddgMatcher.match) { return defaultResult; } - let matchRexExp = this.getDDGMatcherRegex(lookup); - if (!matchRexExp) { return defaultResult; } - let requiredScore = ['match', 'forceUnknown', 'maxDigits'].filter(ddgMatcherProp => ddgMatcherProp in ddgMatcher).length; - /** @type {MatchableStrings[]} */ + /** @type {MatchableStrings[]} */ const matchableStrings = ddgMatcher.matchableStrings || ['labelText', 'placeholderAttr', 'relatedText']; - for (let stringName of matchableStrings) { let elementString = this.activeElementStrings[stringName]; - if (!elementString) continue; // Scoring to ensure all DDG tests are valid + if (!elementString) continue; + // Scoring to ensure all DDG tests are valid let score = 0; - /** @type {MatchingResult} */ - const result = { ...defaultResult, + /** @type {MatchingResult} */ + const result = { + ...defaultResult, matchedString: elementString, matchedFrom: stringName - }; // If a negated regex was provided, ensure it does not match - // If it DOES match - then we need to prevent any future strategies from continuing + }; + // If a negated regex was provided, ensure it does not match + // If it DOES match - then we need to prevent any future strategies from continuing if (ddgMatcher.forceUnknown) { let notRegex = ddgMatcher.forceUnknown; - if (!notRegex) { - return { ...result, + return { + ...result, matched: false }; } - if (notRegex.test(elementString)) { - return { ...result, + return { + ...result, matched: false, proceed: false }; @@ -10128,61 +8881,59 @@ class Matching { score++; } } - if (ddgMatcher.skip) { let skipRegex = ddgMatcher.skip; - if (!skipRegex) { - return { ...result, + return { + ...result, matched: false }; } - if (skipRegex.test(elementString)) { - return { ...result, + return { + ...result, matched: false, skip: true }; } - } // if the `match` regex fails, moves onto the next string - + } + // if the `match` regex fails, moves onto the next string if (!matchRexExp.test(elementString)) { continue; - } // Otherwise, increment the score - + } - score++; // If a 'maxDigits' rule was provided, validate it + // Otherwise, increment the score + score++; + // If a 'maxDigits' rule was provided, validate it if (ddgMatcher.maxDigits) { const digitLength = elementString.replace(/[^0-9]/g, '').length; - if (digitLength > ddgMatcher.maxDigits) { - return { ...result, + return { + ...result, matched: false }; } else { score++; } } - if (score === requiredScore) { - return { ...result, + return { + ...result, matched: true }; } } - return defaultResult; } + /** * If we get here, a firefox/vendor regex was given and we can execute it on the element * strings * @param {MatcherTypeNames} lookup * @return {MatchingResult} */ - - execVendorRegex(lookup) { /** @type {MatchingResult} */ const defaultResult = { @@ -10191,30 +8942,26 @@ class Matching { matcherType: lookup }; const regex = this.vendorRegex(lookup); - if (!regex) { return defaultResult; } /** @type {MatchableStrings[]} */ - - const stringsToMatch = ['placeholderAttr', 'nameAttr', 'labelText', 'id', 'relatedText']; - for (let stringName of stringsToMatch) { let elementString = this.activeElementStrings[stringName]; if (!elementString) continue; - if (regex.test(elementString)) { - return { ...defaultResult, + return { + ...defaultResult, matched: true, matchedString: elementString, matchedFrom: stringName }; } } - return defaultResult; } + /** * Yield strings in the order in which they should be checked against. * @@ -10233,16 +8980,14 @@ class Matching { * @param {HTMLElement} form * @returns {Record} */ - - + _elementStringCache = new WeakMap(); getElementStrings(el, form) { if (this._elementStringCache.has(el)) { return this._elementStringCache.get(el); } - const explicitLabelsText = getExplicitLabelsText(el); - /** @type {Record} */ + /** @type {Record} */ const next = { nameAttr: el.name, labelText: explicitLabelsText, @@ -10250,254 +8995,217 @@ class Matching { id: el.id, relatedText: explicitLabelsText ? '' : getRelatedText(el, form, this.cssSelector('formInputsSelector')) }; - this._elementStringCache.set(el, next); - return next; } - clear() { this._elementStringCache = new WeakMap(); } + /** * @param {HTMLInputElement|HTMLSelectElement} input * @param {HTMLElement} form * @returns {Matching} */ - - forInput(input, form) { this.setActiveElementStrings(input, form); return this; } + /** * @type {MatchingConfiguration} */ - - + static emptyConfig = { + matchers: { + lists: {}, + fields: {} + }, + strategies: { + 'vendorRegex': { + rules: {}, + ruleSets: [] + }, + 'ddgMatcher': { + matchers: {} + }, + 'cssSelector': { + selectors: {} + } + } + }; } + /** * @returns {SupportedTypes} */ - - exports.Matching = Matching; - -_defineProperty(Matching, "emptyConfig", { - matchers: { - lists: {}, - fields: {} - }, - strategies: { - 'vendorRegex': { - rules: {}, - ruleSets: [] - }, - 'ddgMatcher': { - matchers: {} - }, - 'cssSelector': { - selectors: {} - } - } -}); - function getInputType(input) { - const attr = input === null || input === void 0 ? void 0 : input.getAttribute(ATTR_INPUT_TYPE); - + const attr = input?.getAttribute(ATTR_INPUT_TYPE); if (isValidSupportedType(attr)) { return attr; } - return 'unknown'; } + /** * Retrieves the main type * @param {SupportedTypes | string} type * @returns {SupportedMainTypes} */ - - function getMainTypeFromType(type) { const mainType = type.split('.')[0]; - switch (mainType) { case 'credentials': case 'creditCards': case 'identities': return mainType; } - return 'unknown'; } + /** * Retrieves the input main type * @param {HTMLInputElement} input * @returns {SupportedMainTypes} */ - - const getInputMainType = input => getMainTypeFromType(getInputType(input)); -/** @typedef {supportedIdentitiesSubtypes[number]} SupportedIdentitiesSubTypes */ - +/** @typedef {supportedIdentitiesSubtypes[number]} SupportedIdentitiesSubTypes */ exports.getInputMainType = getInputMainType; -const supportedIdentitiesSubtypes = -/** @type {const} */ -['emailAddress', 'firstName', 'middleName', 'lastName', 'fullName', 'phone', 'addressStreet', 'addressStreet2', 'addressCity', 'addressProvince', 'addressPostalCode', 'addressCountryCode', 'birthdayDay', 'birthdayMonth', 'birthdayYear']; +const supportedIdentitiesSubtypes = /** @type {const} */['emailAddress', 'firstName', 'middleName', 'lastName', 'fullName', 'phone', 'addressStreet', 'addressStreet2', 'addressCity', 'addressProvince', 'addressPostalCode', 'addressCountryCode', 'birthdayDay', 'birthdayMonth', 'birthdayYear']; + /** * @param {SupportedTypes | any} supportedType * @returns {supportedType is SupportedIdentitiesSubTypes} */ - function isValidIdentitiesSubtype(supportedType) { return supportedIdentitiesSubtypes.includes(supportedType); } -/** @typedef {supportedCreditCardSubtypes[number]} SupportedCreditCardSubTypes */ +/** @typedef {supportedCreditCardSubtypes[number]} SupportedCreditCardSubTypes */ +const supportedCreditCardSubtypes = /** @type {const} */['cardName', 'cardNumber', 'cardSecurityCode', 'expirationMonth', 'expirationYear', 'expiration']; -const supportedCreditCardSubtypes = -/** @type {const} */ -['cardName', 'cardNumber', 'cardSecurityCode', 'expirationMonth', 'expirationYear', 'expiration']; /** * @param {SupportedTypes | any} supportedType * @returns {supportedType is SupportedCreditCardSubTypes} */ - function isValidCreditCardSubtype(supportedType) { return supportedCreditCardSubtypes.includes(supportedType); } -/** @typedef {supportedCredentialsSubtypes[number]} SupportedCredentialsSubTypes */ +/** @typedef {supportedCredentialsSubtypes[number]} SupportedCredentialsSubTypes */ +const supportedCredentialsSubtypes = /** @type {const} */['password', 'username']; -const supportedCredentialsSubtypes = -/** @type {const} */ -['password', 'username']; /** * @param {SupportedTypes | any} supportedType * @returns {supportedType is SupportedCredentialsSubTypes} */ - function isValidCredentialsSubtype(supportedType) { return supportedCredentialsSubtypes.includes(supportedType); } + /** @typedef {SupportedIdentitiesSubTypes | SupportedCreditCardSubTypes | SupportedCredentialsSubTypes} SupportedSubTypes */ /** @typedef {`identities.${SupportedIdentitiesSubTypes}` | `creditCards.${SupportedCreditCardSubTypes}` | `credentials.${SupportedCredentialsSubTypes}` | 'unknown'} SupportedTypes */ +const supportedTypes = [...supportedIdentitiesSubtypes.map(type => `identities.${type}`), ...supportedCreditCardSubtypes.map(type => `creditCards.${type}`), ...supportedCredentialsSubtypes.map(type => `credentials.${type}`)]; - -const supportedTypes = [...supportedIdentitiesSubtypes.map(type => "identities.".concat(type)), ...supportedCreditCardSubtypes.map(type => "creditCards.".concat(type)), ...supportedCredentialsSubtypes.map(type => "credentials.".concat(type))]; /** * Retrieves the subtype * @param {SupportedTypes | string} type * @returns {SupportedSubTypes | 'unknown'} */ - function getSubtypeFromType(type) { - const subType = type === null || type === void 0 ? void 0 : type.split('.')[1]; + const subType = type?.split('.')[1]; const validType = isValidSubtype(subType); return validType ? subType : 'unknown'; } + /** * @param {SupportedSubTypes | any} supportedSubType * @returns {supportedSubType is SupportedSubTypes} */ - - function isValidSubtype(supportedSubType) { return isValidIdentitiesSubtype(supportedSubType) || isValidCreditCardSubtype(supportedSubType) || isValidCredentialsSubtype(supportedSubType); } + /** * @param {SupportedTypes | any} supportedType * @returns {supportedType is SupportedTypes} */ - - function isValidSupportedType(supportedType) { return supportedTypes.includes(supportedType); } + /** * Retrieves the input subtype * @param {HTMLInputElement|Element} input * @returns {SupportedSubTypes | 'unknown'} */ - - function getInputSubtype(input) { const type = getInputType(input); return getSubtypeFromType(type); } + /** * Remove whitespace of more than 2 in a row and trim the string * @param {string | null} string * @return {string} */ - - const removeExcessWhitespace = function () { let string = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; if (!string) return ''; return string.replace(/\n/g, ' ').replace(/\s{2,}/g, ' ').trim(); }; + /** * Get text from all explicit labels * @param {HTMLInputElement|HTMLSelectElement} el * @return {string} */ - - exports.removeExcessWhitespace = removeExcessWhitespace; - const getExplicitLabelsText = el => { const labelTextCandidates = []; - for (let label of el.labels || []) { labelTextCandidates.push(...(0, _labelUtil.extractElementStrings)(label)); } - if (el.hasAttribute('aria-label')) { labelTextCandidates.push(removeExcessWhitespace(el.getAttribute('aria-label'))); - } // Try to access another element if it was marked as the label for this input/select - + } + // Try to access another element if it was marked as the label for this input/select const ariaLabelAttr = removeExcessWhitespace(el.getAttribute('aria-labelled') || el.getAttribute('aria-labelledby')); - if (ariaLabelAttr) { const labelledByElement = document.getElementById(ariaLabelAttr); - if (labelledByElement) { labelTextCandidates.push(...(0, _labelUtil.extractElementStrings)(labelledByElement)); } - } // Labels with long text are likely to be noisy and lead to false positives - + } + // Labels with long text are likely to be noisy and lead to false positives const filteredLabels = labelTextCandidates.filter(string => string.length < 65); - if (filteredLabels.length > 0) { return filteredLabels.join(' '); } - return ''; }; + /** * Tries to get a relevant previous Element sibling, excluding certain tags * @param {Element} el * @returns {Element|null} */ - - exports.getExplicitLabelsText = getExplicitLabelsText; - const recursiveGetPreviousElSibling = el => { const previousEl = el.previousElementSibling; - if (!previousEl) return null; // Skip elements with no childNodes + if (!previousEl) return null; + // Skip elements with no childNodes if (_labelUtil.EXCLUDED_TAGS.includes(previousEl.tagName)) { return recursiveGetPreviousElSibling(previousEl); } - return previousEl; }; + /** * Get all text close to the input (useful when no labels are defined) * @param {HTMLInputElement|HTMLSelectElement} el @@ -10505,52 +9213,46 @@ const recursiveGetPreviousElSibling = el => { * @param {string} cssSelector * @return {string} */ - - const getRelatedText = (el, form, cssSelector) => { - let scope = getLargestMeaningfulContainer(el, form, cssSelector); // If we didn't find a container, try looking for an adjacent label + let scope = getLargestMeaningfulContainer(el, form, cssSelector); + // If we didn't find a container, try looking for an adjacent label if (scope === el) { let previousEl = recursiveGetPreviousElSibling(el); - if (previousEl instanceof HTMLElement) { scope = previousEl; - } // If there is still no meaningful container return empty string - - + } + // If there is still no meaningful container return empty string if (scope === el || scope instanceof HTMLSelectElement) { if (el.previousSibling instanceof Text) { return removeExcessWhitespace(el.previousSibling.textContent); } - return ''; } - } // If there is still no meaningful container return empty string - + } + // If there is still no meaningful container return empty string if (scope === el || scope instanceof HTMLSelectElement) { if (el.previousSibling instanceof Text) { return removeExcessWhitespace(el.previousSibling.textContent); } - return ''; } - let trimmedText = ''; const label = scope.querySelector('label'); - if (label) { // Try searching for a label first trimmedText = (0, _autofillUtils.getTextShallow)(label); } else { // If the container has a select element, remove its contents to avoid noise trimmedText = (0, _labelUtil.extractElementStrings)(scope).join(' '); - } // If the text is longer than n chars it's too noisy and likely to yield false positives, so return '' - + } + // If the text is longer than n chars it's too noisy and likely to yield false positives, so return '' if (trimmedText.length < TEXT_LENGTH_CUTOFF) return trimmedText; return ''; }; + /** * Find a container for the input field that won't contain other inputs (useful to get elements related to the field) * @param {HTMLElement} el @@ -10558,23 +9260,20 @@ const getRelatedText = (el, form, cssSelector) => { * @param {string} cssSelector * @return {HTMLElement} */ - - exports.getRelatedText = getRelatedText; - const getLargestMeaningfulContainer = (el, form, cssSelector) => { /* TODO: there could be more than one select el for the same label, in that case we should change how we compute the container */ const parentElement = el.parentElement; if (!parentElement || el === form || !cssSelector) return el; - const inputsInParentsScope = parentElement.querySelectorAll(cssSelector); // To avoid noise, ensure that our input is the only in scope - + const inputsInParentsScope = parentElement.querySelectorAll(cssSelector); + // To avoid noise, ensure that our input is the only in scope if (inputsInParentsScope.length === 1) { return getLargestMeaningfulContainer(parentElement, form, cssSelector); } - return el; }; + /** * Find a regex match for a given input * @param {HTMLInputElement} input @@ -10583,13 +9282,10 @@ const getLargestMeaningfulContainer = (el, form, cssSelector) => { * @param {string} cssSelector * @returns {RegExpMatchArray|null} */ - - const matchInPlaceholderAndLabels = (input, regex, form, cssSelector) => { - var _input$placeholder; - - return ((_input$placeholder = input.placeholder) === null || _input$placeholder === void 0 ? void 0 : _input$placeholder.match(regex)) || getExplicitLabelsText(input).match(regex) || getRelatedText(input, form, cssSelector).match(regex); + return input.placeholder?.match(regex) || getExplicitLabelsText(input).match(regex) || getRelatedText(input, form, cssSelector).match(regex); }; + /** * Check if a given input matches a regex * @param {HTMLInputElement} input @@ -10598,22 +9294,17 @@ const matchInPlaceholderAndLabels = (input, regex, form, cssSelector) => { * @param {string} cssSelector * @returns {boolean} */ - - exports.matchInPlaceholderAndLabels = matchInPlaceholderAndLabels; - const checkPlaceholderAndLabels = (input, regex, form, cssSelector) => { return !!matchInPlaceholderAndLabels(input, regex, form, cssSelector); }; + /** * Factory for instances of Matching * * @return {Matching} */ - - exports.checkPlaceholderAndLabels = checkPlaceholderAndLabels; - function createMatching() { return new Matching(_compiledMatchingConfig.matchingConfiguration); } @@ -10625,11 +9316,8 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.InContextSignup = void 0; - var _deviceApiCalls = require("./deviceApiCalls/__generated__/deviceApiCalls.js"); - var _autofillUtils = require("./autofill-utils.js"); - class InContextSignup { /** * @param {import("./DeviceInterface/InterfacePrototype").default} device @@ -10637,15 +9325,12 @@ class InContextSignup { constructor(device) { this.device = device; } - async init() { await this.refreshData(); this.addNativeAccessibleGlobalFunctions(); } - addNativeAccessibleGlobalFunctions() { if (!this.device.globalConfig.hasModernWebkitAPI) return; - try { // Set up a function which can be called from the native layer after completed sign-up or sign-in. Object.defineProperty(window, 'openAutofillAfterClosingEmailProtectionTab', { @@ -10656,31 +9341,30 @@ class InContextSignup { this.openAutofillTooltip(); } }); - } catch (e) {// Ignore if function can't be set up, it's a UX enhancement not a critical flow + } catch (e) { + // Ignore if function can't be set up, it's a UX enhancement not a critical flow } } - async refreshData() { const incontextSignupDismissedAt = await this.device.deviceApi.request(new _deviceApiCalls.GetIncontextSignupDismissedAtCall(null)); this.permanentlyDismissedAt = incontextSignupDismissedAt.permanentlyDismissedAt; this.isInstalledRecently = incontextSignupDismissedAt.isInstalledRecently; } - async openAutofillTooltip() { - var _this$device$uiContro, _this$device$activeFo; - // Make sure we're working with the latest data - await this.device.refreshData(); // Make sure the tooltip is closed before we try to open it + await this.device.refreshData(); - await ((_this$device$uiContro = this.device.uiController) === null || _this$device$uiContro === void 0 ? void 0 : _this$device$uiContro.removeTooltip('stateChange')); // Make sure the input doesn't have focus so we can focus on it again + // Make sure the tooltip is closed before we try to open it + await this.device.uiController?.removeTooltip('stateChange'); - const activeInput = (_this$device$activeFo = this.device.activeForm) === null || _this$device$activeFo === void 0 ? void 0 : _this$device$activeFo.activeInput; - activeInput === null || activeInput === void 0 ? void 0 : activeInput.blur(); // Select the active input to open the tooltip + // Make sure the input doesn't have focus so we can focus on it again + const activeInput = this.device.activeForm?.activeInput; + activeInput?.blur(); + // Select the active input to open the tooltip const selectActiveInput = () => { - activeInput === null || activeInput === void 0 ? void 0 : activeInput.focus(); + activeInput?.focus(); }; - if (document.hasFocus()) { selectActiveInput(); } else { @@ -10691,17 +9375,14 @@ class InContextSignup { }); } } - isPermanentlyDismissed() { return Boolean(this.permanentlyDismissedAt); } - isOnValidDomain() { // Only show in-context signup if we've high confidence that the page is // not internally hosted or an intranet return (0, _autofillUtils.isValidTLD)() && !(0, _autofillUtils.isLocalNetwork)(); } - isAllowedByDevice() { if (typeof this.isInstalledRecently === 'boolean') { return this.isInstalledRecently; @@ -10711,43 +9392,36 @@ class InContextSignup { return true; } } + /** * @param {import('./Form/matching.js').SupportedSubTypes | "unknown"} [inputType] * @returns {boolean} */ - - isAvailable() { - var _this$device$settings, _this$device$settings2; - let inputType = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'emailAddress'; const isEmailInput = inputType === 'emailAddress'; - const isEmailProtectionEnabled = !!((_this$device$settings = this.device.settings) !== null && _this$device$settings !== void 0 && _this$device$settings.featureToggles.emailProtection); - const isIncontextSignupEnabled = !!((_this$device$settings2 = this.device.settings) !== null && _this$device$settings2 !== void 0 && _this$device$settings2.featureToggles.emailProtection_incontext_signup); + const isEmailProtectionEnabled = !!this.device.settings?.featureToggles.emailProtection; + const isIncontextSignupEnabled = !!this.device.settings?.featureToggles.emailProtection_incontext_signup; const isNotAlreadyLoggedIn = !this.device.isDeviceSignedIn(); const isNotDismissed = !this.isPermanentlyDismissed(); const isOnExpectedPage = this.device.globalConfig.isTopFrame || this.isOnValidDomain(); const isAllowedByDevice = this.isAllowedByDevice(); return isEmailInput && isEmailProtectionEnabled && isIncontextSignupEnabled && isNotAlreadyLoggedIn && isNotDismissed && isOnExpectedPage && isAllowedByDevice; } - onIncontextSignup() { this.device.deviceApi.notify(new _deviceApiCalls.StartEmailProtectionSignupCall({})); this.device.firePixel({ pixelName: 'incontext_primary_cta' }); } - onIncontextSignupDismissed() { let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : { shouldHideTooltip: true }; - if (options.shouldHideTooltip) { this.device.removeAutofillUIFromPage('Email Protection in-context signup dismissed.'); this.device.deviceApi.notify(new _deviceApiCalls.CloseAutofillParentCall(null)); } - this.permanentlyDismissedAt = new Date().getTime(); this.device.deviceApi.notify(new _deviceApiCalls.SetIncontextSignupPermanentlyDismissedAtCall({ value: this.permanentlyDismissedAt @@ -10755,20 +9429,16 @@ class InContextSignup { this.device.firePixel({ pixelName: 'incontext_dismiss_persisted' }); - } // In-context signup can be closed when displayed as a stand-alone tooltip, e.g. extension - + } + // In-context signup can be closed when displayed as a stand-alone tooltip, e.g. extension onIncontextSignupClosed() { - var _this$device$activeFo2; - - (_this$device$activeFo2 = this.device.activeForm) === null || _this$device$activeFo2 === void 0 ? void 0 : _this$device$activeFo2.dismissTooltip(); + this.device.activeForm?.dismissTooltip(); this.device.firePixel({ pixelName: 'incontext_close_x' }); } - } - exports.InContextSignup = InContextSignup; },{"./autofill-utils.js":51,"./deviceApiCalls/__generated__/deviceApiCalls.js":55}],35:[function(require,module,exports){ @@ -10781,107 +9451,55 @@ exports.PROVIDER_LOCKED = exports.AUTOGENERATED_KEY = void 0; exports.appendGeneratedKey = appendGeneratedKey; exports.createCredentialsTooltipItem = createCredentialsTooltipItem; exports.fromPassword = fromPassword; - var _autofillUtils = require("../autofill-utils.js"); +const AUTOGENERATED_KEY = exports.AUTOGENERATED_KEY = 'autogenerated'; +const PROVIDER_LOCKED = exports.PROVIDER_LOCKED = 'provider_locked'; -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - -function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); } - -function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } } - -function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); } - -function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; } - -function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; } - -function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); } - -function _classApplyDescriptorSet(receiver, descriptor, value) { if (descriptor.set) { descriptor.set.call(receiver, value); } else { if (!descriptor.writable) { throw new TypeError("attempted to set read only private field"); } descriptor.value = value; } } - -const AUTOGENERATED_KEY = 'autogenerated'; -exports.AUTOGENERATED_KEY = AUTOGENERATED_KEY; -const PROVIDER_LOCKED = 'provider_locked'; /** * @implements {TooltipItemRenderer} */ - -exports.PROVIDER_LOCKED = PROVIDER_LOCKED; - -var _data = /*#__PURE__*/new WeakMap(); - class CredentialsTooltipItem { /** @type {CredentialsObject} */ - + #data; /** @param {CredentialsObject} data */ constructor(data) { - _classPrivateFieldInitSpec(this, _data, { - writable: true, - value: void 0 - }); - - _defineProperty(this, "id", () => String(_classPrivateFieldGet(this, _data).id)); - - _defineProperty(this, "labelMedium", _subtype => { - var _classPrivateFieldGet2; - - if (_classPrivateFieldGet(this, _data).username) { - return _classPrivateFieldGet(this, _data).username; - } - - if ((_classPrivateFieldGet2 = _classPrivateFieldGet(this, _data).origin) !== null && _classPrivateFieldGet2 !== void 0 && _classPrivateFieldGet2.url) { - return "Password for ".concat((0, _autofillUtils.truncateFromMiddle)(_classPrivateFieldGet(this, _data).origin.url)); - } - - return ''; - }); - - _defineProperty(this, "labelSmall", _subtype => { - var _classPrivateFieldGet3; - - if ((_classPrivateFieldGet3 = _classPrivateFieldGet(this, _data).origin) !== null && _classPrivateFieldGet3 !== void 0 && _classPrivateFieldGet3.url) { - return (0, _autofillUtils.truncateFromMiddle)(_classPrivateFieldGet(this, _data).origin.url); - } - - return '•••••••••••••••'; - }); - - _defineProperty(this, "credentialsProvider", () => _classPrivateFieldGet(this, _data).credentialsProvider); - - _classPrivateFieldSet(this, _data, data); + this.#data = data; } - + id = () => String(this.#data.id); + labelMedium = _subtype => { + if (this.#data.username) { + return this.#data.username; + } + if (this.#data.origin?.url) { + return `Password for ${(0, _autofillUtils.truncateFromMiddle)(this.#data.origin.url)}`; + } + return ''; + }; + labelSmall = _subtype => { + if (this.#data.origin?.url) { + return (0, _autofillUtils.truncateFromMiddle)(this.#data.origin.url); + } + return '•••••••••••••••'; + }; + credentialsProvider = () => this.#data.credentialsProvider; } + /** * @implements {TooltipItemRenderer} */ - - -var _data2 = /*#__PURE__*/new WeakMap(); - class AutoGeneratedCredential { /** @type {CredentialsObject} */ - + #data; /** @param {CredentialsObject} data */ constructor(data) { - _classPrivateFieldInitSpec(this, _data2, { - writable: true, - value: void 0 - }); - - _defineProperty(this, "id", () => String(_classPrivateFieldGet(this, _data2).id)); - - _defineProperty(this, "label", _subtype => _classPrivateFieldGet(this, _data2).password); - - _defineProperty(this, "labelMedium", _subtype => 'Generated password'); - - _defineProperty(this, "labelSmall", _subtype => 'Login information will be saved for this website'); - - _classPrivateFieldSet(this, _data2, data); + this.#data = data; } - + id = () => String(this.#data.id); + label = _subtype => this.#data.password; + labelMedium = _subtype => 'Generated password'; + labelSmall = _subtype => 'Login information will be saved for this website'; } + /** * Generate a stand-in 'CredentialsObject' from a * given (generated) password. @@ -10890,8 +9508,6 @@ class AutoGeneratedCredential { * @param {string} username * @returns {CredentialsObject} */ - - function fromPassword(password, username) { return { [AUTOGENERATED_KEY]: true, @@ -10899,35 +9515,23 @@ function fromPassword(password, username) { username }; } + /** * @implements TooltipItemRenderer */ - - -var _data3 = /*#__PURE__*/new WeakMap(); - class ProviderLockedItem { /** @type {CredentialsObject} */ - + #data; /** @param {CredentialsObject} data */ constructor(data) { - _classPrivateFieldInitSpec(this, _data3, { - writable: true, - value: void 0 - }); - - _defineProperty(this, "id", () => String(_classPrivateFieldGet(this, _data3).id)); - - _defineProperty(this, "labelMedium", _subtype => 'Bitwarden is locked'); - - _defineProperty(this, "labelSmall", _subtype => 'Unlock your vault to access credentials or generate passwords'); - - _defineProperty(this, "credentialsProvider", () => _classPrivateFieldGet(this, _data3).credentialsProvider); - - _classPrivateFieldSet(this, _data3, data); + this.#data = data; } - + id = () => String(this.#data.id); + labelMedium = _subtype => 'Bitwarden is locked'; + labelSmall = _subtype => 'Unlock your vault to access credentials or generate passwords'; + credentialsProvider = () => this.#data.credentialsProvider; } + /** * If the locally generated/stored password or username ends up being the same * as submitted in a subsequent form submission - then we mark the @@ -10940,50 +9544,47 @@ class ProviderLockedItem { * @param {string|null|undefined} [autofilledFields.password] - if present, it's the last generated password * */ - - function appendGeneratedKey(data) { - var _data$credentials, _data$credentials2; - let autofilledFields = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - let autogenerated = false; // does the current password match the most recently generated one? + let autogenerated = false; - if (autofilledFields.password && ((_data$credentials = data.credentials) === null || _data$credentials === void 0 ? void 0 : _data$credentials.password) === autofilledFields.password) { + // does the current password match the most recently generated one? + if (autofilledFields.password && data.credentials?.password === autofilledFields.password) { autogenerated = true; - } // does the current username match a recently generated one? (eg: email protection) - + } - if (autofilledFields.username && ((_data$credentials2 = data.credentials) === null || _data$credentials2 === void 0 ? void 0 : _data$credentials2.username) === autofilledFields.username) { + // does the current username match a recently generated one? (eg: email protection) + if (autofilledFields.username && data.credentials?.username === autofilledFields.username) { autogenerated = true; - } // if neither username nor password were generated, don't alter the outgoing data + } + // if neither username nor password were generated, don't alter the outgoing data + if (!autogenerated) return data; - if (!autogenerated) return data; // if we get here, we're confident that something was generated + filled + // if we get here, we're confident that something was generated + filled // so we mark the credential as 'autogenerated' for the benefit of native implementations - - return { ...data, - credentials: { ...data.credentials, + return { + ...data, + credentials: { + ...data.credentials, [AUTOGENERATED_KEY]: true } }; } + /** * Factory for creating a TooltipItemRenderer * * @param {CredentialsObject} data * @returns {TooltipItemRenderer} */ - - function createCredentialsTooltipItem(data) { if (data.id === PROVIDER_LOCKED) { return new ProviderLockedItem(data); } - if (AUTOGENERATED_KEY in data && data.password) { return new AutoGeneratedCredential(data); } - return new CredentialsTooltipItem(data); } @@ -10994,49 +9595,20 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.CreditCardTooltipItem = void 0; - -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - -function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); } - -function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } } - -function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); } - -function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; } - -function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; } - -function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); } - -function _classApplyDescriptorSet(receiver, descriptor, value) { if (descriptor.set) { descriptor.set.call(receiver, value); } else { if (!descriptor.writable) { throw new TypeError("attempted to set read only private field"); } descriptor.value = value; } } - -var _data = /*#__PURE__*/new WeakMap(); - /** * @implements {TooltipItemRenderer} */ class CreditCardTooltipItem { /** @type {CreditCardObject} */ - + #data; /** @param {CreditCardObject} data */ constructor(data) { - _classPrivateFieldInitSpec(this, _data, { - writable: true, - value: void 0 - }); - - _defineProperty(this, "id", () => String(_classPrivateFieldGet(this, _data).id)); - - _defineProperty(this, "labelMedium", _ => _classPrivateFieldGet(this, _data).title); - - _defineProperty(this, "labelSmall", _ => _classPrivateFieldGet(this, _data).displayNumber); - - _classPrivateFieldSet(this, _data, data); + this.#data = data; } - + id = () => String(this.#data.id); + labelMedium = _ => this.#data.title; + labelSmall = _ => this.#data.displayNumber; } - exports.CreditCardTooltipItem = CreditCardTooltipItem; },{}],37:[function(require,module,exports){ @@ -11046,71 +9618,37 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.IdentityTooltipItem = void 0; - var _formatters = require("../Form/formatters.js"); - -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - -function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); } - -function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } } - -function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); } - -function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; } - -function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; } - -function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); } - -function _classApplyDescriptorSet(receiver, descriptor, value) { if (descriptor.set) { descriptor.set.call(receiver, value); } else { if (!descriptor.writable) { throw new TypeError("attempted to set read only private field"); } descriptor.value = value; } } - -var _data = /*#__PURE__*/new WeakMap(); - /** * @implements {TooltipItemRenderer} */ class IdentityTooltipItem { /** @type {IdentityObject} */ - + #data; /** @param {IdentityObject} data */ constructor(data) { - _classPrivateFieldInitSpec(this, _data, { - writable: true, - value: void 0 - }); - - _defineProperty(this, "id", () => String(_classPrivateFieldGet(this, _data).id)); - - _defineProperty(this, "labelMedium", subtype => { - if (subtype === 'addressCountryCode') { - return (0, _formatters.getCountryDisplayName)('en', _classPrivateFieldGet(this, _data).addressCountryCode || ''); - } - - if (_classPrivateFieldGet(this, _data).id === 'privateAddress') { - return 'Generate Private Duck Address'; - } - - return _classPrivateFieldGet(this, _data)[subtype]; - }); - - _defineProperty(this, "labelSmall", _ => { - return _classPrivateFieldGet(this, _data).title; - }); - - _classPrivateFieldSet(this, _data, data); + this.#data = data; } - + id = () => String(this.#data.id); + labelMedium = subtype => { + if (subtype === 'addressCountryCode') { + return (0, _formatters.getCountryDisplayName)('en', this.#data.addressCountryCode || ''); + } + if (this.#data.id === 'privateAddress') { + return 'Generate Private Duck Address'; + } + return this.#data[subtype]; + }; label(subtype) { - if (_classPrivateFieldGet(this, _data).id === 'privateAddress') { - return _classPrivateFieldGet(this, _data)[subtype]; + if (this.#data.id === 'privateAddress') { + return this.#data[subtype]; } - return null; } - + labelSmall = _ => { + return this.#data.title; + }; } - exports.IdentityTooltipItem = IdentityTooltipItem; },{"../Form/formatters.js":26}],38:[function(require,module,exports){ @@ -11120,69 +9658,39 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.PasswordGenerator = void 0; - var _index = require("../packages/password/index.js"); - var _rules = _interopRequireDefault(require("../packages/password/rules.json")); - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); } - -function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } } - -function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; } - -function _classApplyDescriptorSet(receiver, descriptor, value) { if (descriptor.set) { descriptor.set.call(receiver, value); } else { if (!descriptor.writable) { throw new TypeError("attempted to set read only private field"); } descriptor.value = value; } } - -function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); } - -function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); } - -function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; } - -var _previous = /*#__PURE__*/new WeakMap(); - /** * Create a password once and reuse it. */ class PasswordGenerator { - constructor() { - _classPrivateFieldInitSpec(this, _previous, { - writable: true, - value: null - }); - } + /** @type {string|null} */ + #previous = null; /** @returns {boolean} */ get generated() { - return _classPrivateFieldGet(this, _previous) !== null; + return this.#previous !== null; } - /** @returns {string|null} */ - + /** @returns {string|null} */ get password() { - return _classPrivateFieldGet(this, _previous); + return this.#previous; } - /** @param {import('../packages/password').GenerateOptions} [params] */ - + /** @param {import('../packages/password').GenerateOptions} [params] */ generate() { let params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - - if (_classPrivateFieldGet(this, _previous)) { - return _classPrivateFieldGet(this, _previous); + if (this.#previous) { + return this.#previous; } - - _classPrivateFieldSet(this, _previous, (0, _index.generate)({ ...params, + this.#previous = (0, _index.generate)({ + ...params, rules: _rules.default - })); - - return _classPrivateFieldGet(this, _previous); + }); + return this.#previous; } - } - exports.PasswordGenerator = PasswordGenerator; },{"../packages/password/index.js":7,"../packages/password/rules.json":11}],39:[function(require,module,exports){ @@ -11192,24 +9700,17 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.createScanner = createScanner; - var _Form = require("./Form/Form.js"); - var _constants = require("./constants.js"); - var _matching = require("./Form/matching.js"); - var _autofillUtils = require("./autofill-utils.js"); - var _deviceApiCalls = require("./deviceApiCalls/__generated__/deviceApiCalls.js"); - -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - const { MAX_INPUTS_PER_PAGE, MAX_FORMS_PER_PAGE, MAX_INPUTS_PER_FORM } = _constants.constants; + /** * @typedef {{ * forms: Map; @@ -11231,7 +9732,6 @@ const { */ /** @type {ScannerOptions} */ - const defaultScannerOptions = { // This buffer size is very large because it's an unexpected edge-case that // a DOM will be continually modified over and over without ever stopping. If we do see 1000 unique @@ -11248,302 +9748,225 @@ const defaultScannerOptions = { maxFormsPerPage: MAX_FORMS_PER_PAGE, maxInputsPerForm: MAX_INPUTS_PER_FORM }; + /** * This allows: * 1) synchronous DOM scanning + mutations - via `createScanner(device).findEligibleInputs(document)` * 2) or, as above + a debounced mutation observer to re-run the scan after the given time */ - class DefaultScanner { /** @type Map */ - + forms = new Map(); /** @type {any|undefined} the timer to reset */ - + debounceTimer; /** @type {Set} stored changed elements until they can be processed */ - + changedElements = new Set(); /** @type {ScannerOptions} */ - + options; /** @type {HTMLInputElement | null} */ - + activeInput = null; /** @type {boolean} A flag to indicate the whole page will be re-scanned */ - + rescanAll = false; /** @type {boolean} Indicates whether we called stopScanning */ - + stopped = false; /** @type {import("./Form/matching").Matching} matching */ + matching; /** * @param {import("./DeviceInterface/InterfacePrototype").default} device * @param {ScannerOptions} options */ constructor(device, options) { - _defineProperty(this, "forms", new Map()); - - _defineProperty(this, "debounceTimer", void 0); - - _defineProperty(this, "changedElements", new Set()); - - _defineProperty(this, "options", void 0); - - _defineProperty(this, "activeInput", null); - - _defineProperty(this, "rescanAll", false); - - _defineProperty(this, "stopped", false); - - _defineProperty(this, "matching", void 0); - - _defineProperty(this, "mutObs", new MutationObserver(mutationList => { - /** @type {HTMLElement[]} */ - if (this.rescanAll) { - // quick version if buffer full - this.enqueue([]); - return; - } - - const outgoing = []; - - for (const mutationRecord of mutationList) { - if (mutationRecord.type === 'childList') { - for (let addedNode of mutationRecord.addedNodes) { - if (!(addedNode instanceof HTMLElement)) continue; - if (addedNode.nodeName === 'DDG-AUTOFILL') continue; - outgoing.push(addedNode); - } - } - } - - this.enqueue(outgoing); - })); - this.device = device; this.matching = (0, _matching.createMatching)(); this.options = options; /** @type {number} A timestamp of the */ - this.initTimeStamp = Date.now(); } + /** * Determine whether we should fire the credentials autoprompt. This is needed because some sites are blank * on page load and load scripts asynchronously, so our initial scan didn't set the autoprompt correctly * @returns {boolean} */ - - get shouldAutoprompt() { return Date.now() - this.initTimeStamp <= 1500; } + /** * Call this to scan once and then watch for changes. * * Call the returned function to remove listeners. * @returns {(reason: string, ...rest) => void} */ - - init() { var _this = this; - if (this.device.globalConfig.isExtension) { this.device.deviceApi.notify(new _deviceApiCalls.AddDebugFlagCall({ flag: 'autofill' })); } - - const delay = this.options.initialDelay; // if the delay is zero, (chrome/firefox etc) then use `requestIdleCallback` - + const delay = this.options.initialDelay; + // if the delay is zero, (chrome/firefox etc) then use `requestIdleCallback` if (delay === 0) { window.requestIdleCallback(() => this.scanAndObserve()); } else { // otherwise, use the delay time to defer the initial scan setTimeout(() => this.scanAndObserve(), delay); } - return function (reason) { for (var _len = arguments.length, rest = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { rest[_key - 1] = arguments[_key]; } - _this.stopScanner(reason, ...rest); }; } + /** * Scan the page and begin observing changes */ - - scanAndObserve() { - var _window$performance, _window$performance$m, _window$performance2, _window$performance2$; - - (_window$performance = window.performance) === null || _window$performance === void 0 ? void 0 : (_window$performance$m = _window$performance.mark) === null || _window$performance$m === void 0 ? void 0 : _window$performance$m.call(_window$performance, 'initial_scanner:init:start'); + window.performance?.mark?.('initial_scanner:init:start'); this.findEligibleInputs(document); - (_window$performance2 = window.performance) === null || _window$performance2 === void 0 ? void 0 : (_window$performance2$ = _window$performance2.mark) === null || _window$performance2$ === void 0 ? void 0 : _window$performance2$.call(_window$performance2, 'initial_scanner:init:end'); + window.performance?.mark?.('initial_scanner:init:end'); (0, _autofillUtils.logPerformance)('initial_scanner'); this.mutObs.observe(document.documentElement, { childList: true, subtree: true }); } + /** * @param context */ - - findEligibleInputs(context) { - var _context$matches; - // Avoid autofill on Email Protection web app if (this.device.globalConfig.isDDGDomain) { return this; } - - if ('matches' in context && (_context$matches = context.matches) !== null && _context$matches !== void 0 && _context$matches.call(context, this.matching.cssSelector('formInputsSelector'))) { + if ('matches' in context && context.matches?.(this.matching.cssSelector('formInputsSelector'))) { this.addInput(context); } else { const inputs = context.querySelectorAll(this.matching.cssSelector('formInputsSelector')); - if (inputs.length > this.options.maxInputsPerPage) { this.stopScanner('Too many input fields in the given context, stop scanning', context); return this; } - inputs.forEach(input => this.addInput(input)); } - return this; } + /** * Stops scanning, switches off the mutation observer and clears all forms * @param {string} reason * @param {...any} rest */ - - stopScanner(reason) { - var _this$device$activeFo; - this.stopped = true; - if ((0, _autofillUtils.shouldLog)()) { for (var _len2 = arguments.length, rest = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { rest[_key2 - 1] = arguments[_key2]; } - console.log(reason, ...rest); } + const activeInput = this.device.activeForm?.activeInput; - const activeInput = (_this$device$activeFo = this.device.activeForm) === null || _this$device$activeFo === void 0 ? void 0 : _this$device$activeFo.activeInput; // remove Dax, listeners, timers, and observers - + // remove Dax, listeners, timers, and observers clearTimeout(this.debounceTimer); this.changedElements.clear(); this.mutObs.disconnect(); this.forms.forEach(form => { form.destroy(); }); - this.forms.clear(); // Bring the user back to the input they were interacting with + this.forms.clear(); - activeInput === null || activeInput === void 0 ? void 0 : activeInput.focus(); + // Bring the user back to the input they were interacting with + activeInput?.focus(); } + /** * @param {HTMLElement|HTMLInputElement|HTMLSelectElement} input * @returns {HTMLFormElement|HTMLElement} */ - - getParentForm(input) { if (input instanceof HTMLInputElement || input instanceof HTMLSelectElement) { if (input.form) { // Use input.form unless it encloses most of the DOM // In that case we proceed to identify more precise wrappers - if (this.forms.has(input.form) || // If we've added the form we've already checked that it's not a page wrapper + if (this.forms.has(input.form) || + // If we've added the form we've already checked that it's not a page wrapper !(0, _autofillUtils.isFormLikelyToBeUsedAsPageWrapper)(input.form)) { return input.form; } } } - - let element = input; // traverse the DOM to search for related inputs - + let element = input; + // traverse the DOM to search for related inputs while (element.parentElement && element.parentElement !== document.documentElement) { - var _element$parentElemen; - // Avoid overlapping containers or forms - const siblingForm = (_element$parentElemen = element.parentElement) === null || _element$parentElemen === void 0 ? void 0 : _element$parentElemen.querySelector('form'); - + const siblingForm = element.parentElement?.querySelector('form'); if (siblingForm && siblingForm !== element) { return element; } - element = element.parentElement; const inputs = element.querySelectorAll(this.matching.cssSelector('formInputsSelector')); - const buttons = element.querySelectorAll(this.matching.cssSelector('submitButtonSelector')); // If we find a button or another input, we assume that's our form - + const buttons = element.querySelectorAll(this.matching.cssSelector('submitButtonSelector')); + // If we find a button or another input, we assume that's our form if (inputs.length > 1 || buttons.length) { // found related input, return common ancestor return element; } } - return input; } + /** * @param {HTMLInputElement|HTMLSelectElement} input */ - - addInput(input) { if (this.stopped) return; const parentForm = this.getParentForm(input); - if (parentForm instanceof HTMLFormElement && this.forms.has(parentForm)) { - var _this$forms$get; - // We've met the form, add the input - (_this$forms$get = this.forms.get(parentForm)) === null || _this$forms$get === void 0 ? void 0 : _this$forms$get.addInput(input); + this.forms.get(parentForm)?.addInput(input); return; - } // Check if the forms we've seen are either disconnected, - // or are parent/child of the currently-found form - + } + // Check if the forms we've seen are either disconnected, + // or are parent/child of the currently-found form let previouslyFoundParent, childForm; - for (const [formEl] of this.forms) { // Remove disconnected forms to avoid leaks if (!formEl.isConnected) { this.forms.delete(formEl); continue; } - if (formEl.contains(parentForm)) { previouslyFoundParent = formEl; break; } - if (parentForm.contains(formEl)) { childForm = formEl; break; } } - if (previouslyFoundParent) { if (parentForm instanceof HTMLFormElement && parentForm !== previouslyFoundParent) { // If we had a prior parent but this is an explicit form, the previous was a false positive this.forms.delete(previouslyFoundParent); } else { - var _this$forms$get2; - // If we've already met the form or a descendant, add the input - (_this$forms$get2 = this.forms.get(previouslyFoundParent)) === null || _this$forms$get2 === void 0 ? void 0 : _this$forms$get2.addInput(input); + this.forms.get(previouslyFoundParent)?.addInput(input); } } else { // if this form is an ancestor of an existing form, remove that before adding this if (childForm) { - var _this$forms$get3; - - (_this$forms$get3 = this.forms.get(childForm)) === null || _this$forms$get3 === void 0 ? void 0 : _this$forms$get3.destroy(); + this.forms.get(childForm)?.destroy(); this.forms.delete(childForm); - } // Only add the form if below the limit of forms per page - + } + // Only add the form if below the limit of forms per page if (this.forms.size < this.options.maxFormsPerPage) { this.forms.set(parentForm, new _Form.Form(parentForm, input, this.device, this.matching, this.shouldAutoprompt)); } else { @@ -11551,14 +9974,13 @@ class DefaultScanner { } } } + /** * enqueue elements to be re-scanned after the given * amount of time has elapsed. * * @param {(HTMLElement|Document)[]} htmlElements */ - - enqueue(htmlElements) { // if the buffer limit is reached, stop trying to track elements and process body instead. if (this.changedElements.size >= this.options.bufferSize) { @@ -11570,53 +9992,66 @@ class DefaultScanner { this.changedElements.add(element); } } - clearTimeout(this.debounceTimer); this.debounceTimer = setTimeout(() => { - var _window$performance3, _window$performance3$, _window$performance4, _window$performance4$; - - (_window$performance3 = window.performance) === null || _window$performance3 === void 0 ? void 0 : (_window$performance3$ = _window$performance3.mark) === null || _window$performance3$ === void 0 ? void 0 : _window$performance3$.call(_window$performance3, 'scanner:init:start'); + window.performance?.mark?.('scanner:init:start'); this.processChangedElements(); this.changedElements.clear(); this.rescanAll = false; - (_window$performance4 = window.performance) === null || _window$performance4 === void 0 ? void 0 : (_window$performance4$ = _window$performance4.mark) === null || _window$performance4$ === void 0 ? void 0 : _window$performance4$.call(_window$performance4, 'scanner:init:end'); + window.performance?.mark?.('scanner:init:end'); (0, _autofillUtils.logPerformance)('scanner'); }, this.options.debounceTimePeriod); } + /** * re-scan the changed elements, but only if they * are still present in the DOM */ - - processChangedElements() { if (this.rescanAll) { this.findEligibleInputs(document); return; } - for (let element of this.changedElements) { if (element.isConnected) { this.findEligibleInputs(element); } } } + /** * Watch for changes in the DOM, and enqueue elements to be scanned * @type {MutationObserver} */ - - + mutObs = new MutationObserver(mutationList => { + /** @type {HTMLElement[]} */ + if (this.rescanAll) { + // quick version if buffer full + this.enqueue([]); + return; + } + const outgoing = []; + for (const mutationRecord of mutationList) { + if (mutationRecord.type === 'childList') { + for (let addedNode of mutationRecord.addedNodes) { + if (!(addedNode instanceof HTMLElement)) continue; + if (addedNode.nodeName === 'DDG-AUTOFILL') continue; + outgoing.push(addedNode); + } + } + } + this.enqueue(outgoing); + }); } + /** * @param {import("./DeviceInterface/InterfacePrototype").default} device * @param {Partial} [scannerOptions] * @returns {Scanner} */ - - function createScanner(device, scannerOptions) { - return new DefaultScanner(device, { ...defaultScannerOptions, + return new DefaultScanner(device, { + ...defaultScannerOptions, ...scannerOptions }); } @@ -11628,19 +10063,11 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.Settings = void 0; - var _index = require("../packages/device-api/index.js"); - var _deviceApiCalls = require("./deviceApiCalls/__generated__/deviceApiCalls.js"); - var _validatorsZod = require("./deviceApiCalls/__generated__/validators.zod.js"); - var _autofillUtils = require("./autofill-utils.js"); - var _appleUtils = require("@duckduckgo/content-scope-scripts/src/apple-utils"); - -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - /** * Some Type helpers to prevent duplication * @typedef {import("./deviceApiCalls/__generated__/validators-ts").AutofillFeatureToggles} AutofillFeatureToggles @@ -11661,37 +10088,27 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope */ class Settings { /** @type {GlobalConfig} */ - + globalConfig; /** @type {DeviceApi} */ - + deviceApi; /** @type {AutofillFeatureToggles | null} */ - + _featureToggles = null; /** @type {AvailableInputTypes | null} */ - + _availableInputTypes = null; /** @type {RuntimeConfiguration | null | undefined} */ - + _runtimeConfiguration = null; /** @type {boolean | null} */ + _enabled = null; /** * @param {GlobalConfig} config * @param {DeviceApi} deviceApi */ constructor(config, deviceApi) { - _defineProperty(this, "globalConfig", void 0); - - _defineProperty(this, "deviceApi", void 0); - - _defineProperty(this, "_featureToggles", null); - - _defineProperty(this, "_availableInputTypes", null); - - _defineProperty(this, "_runtimeConfiguration", null); - - _defineProperty(this, "_enabled", null); - this.deviceApi = deviceApi; this.globalConfig = config; } + /** * Feature toggles are delivered as part of the Runtime Configuration - a flexible design that * allows data per user + remote config to be accessed together. @@ -11704,32 +10121,26 @@ class Settings { * * @returns {Promise} */ - - async getFeatureToggles() { try { - var _runtimeConfig$userPr, _runtimeConfig$userPr2, _runtimeConfig$userPr3; - const runtimeConfig = await this._getRuntimeConfiguration(); - const autofillSettings = (0, _index.validate)((_runtimeConfig$userPr = runtimeConfig.userPreferences) === null || _runtimeConfig$userPr === void 0 ? void 0 : (_runtimeConfig$userPr2 = _runtimeConfig$userPr.features) === null || _runtimeConfig$userPr2 === void 0 ? void 0 : (_runtimeConfig$userPr3 = _runtimeConfig$userPr2.autofill) === null || _runtimeConfig$userPr3 === void 0 ? void 0 : _runtimeConfig$userPr3.settings, _validatorsZod.autofillSettingsSchema); + const autofillSettings = (0, _index.validate)(runtimeConfig.userPreferences?.features?.autofill?.settings, _validatorsZod.autofillSettingsSchema); return autofillSettings.featureToggles; } catch (e) { // these are the fallbacks for when a platform hasn't implemented the calls above. if (this.globalConfig.isDDGTestMode) { console.log('isDDGTestMode: getFeatureToggles: ❌', e); } - return Settings.defaults.featureToggles; } } + /** * If the platform in question is happy to derive it's 'enabled' state from the RuntimeConfiguration, * then they should use this. Currently only Windows supports this, but we aim to move all platforms to * support this going forward. * @returns {Promise} */ - - async getEnabled() { try { const runtimeConfig = await this._getRuntimeConfiguration(); @@ -11740,10 +10151,10 @@ class Settings { if (this.globalConfig.isDDGTestMode) { console.log('isDDGTestMode: getFeatureToggles: ❌', e); } - return null; } } + /** * Get runtime configuration, but only once. * @@ -11757,22 +10168,19 @@ class Settings { * @throws * @private */ - - async _getRuntimeConfiguration() { if (this._runtimeConfiguration) return this._runtimeConfiguration; const runtimeConfig = await this.deviceApi.request(new _deviceApiCalls.GetRuntimeConfigurationCall(null)); this._runtimeConfiguration = runtimeConfig; return this._runtimeConfiguration; } + /** * Available Input Types are boolean indicators to represent which input types the * current **user** has data available for. * * @returns {Promise} */ - - async getAvailableInputTypes() { try { return await this.deviceApi.request(new _deviceApiCalls.GetAvailableInputTypesCall(null)); @@ -11780,10 +10188,10 @@ class Settings { if (this.globalConfig.isDDGTestMode) { console.log('isDDGTestMode: getAvailableInputTypes: ❌', e); } - return Settings.defaults.availableInputTypes; } } + /** * To 'refresh' settings means to re-call APIs to determine new state. This may * only occur once per page, but it must be done before any page scanning/decorating can happen @@ -11794,25 +10202,24 @@ class Settings { * enabled: boolean | null * }>} */ - - async refresh() { this.setEnabled(await this.getEnabled()); this.setFeatureToggles(await this.getFeatureToggles()); - this.setAvailableInputTypes(await this.getAvailableInputTypes()); // If 'this.enabled' is a boolean it means we were able to set it correctly and therefor respect its value + this.setAvailableInputTypes(await this.getAvailableInputTypes()); + // If 'this.enabled' is a boolean it means we were able to set it correctly and therefor respect its value if (typeof this.enabled === 'boolean') { if (!this.enabled) { return Settings.defaults; } } - return { featureToggles: this.featureToggles, availableInputTypes: this.availableInputTypes, enabled: this.enabled }; } + /** * Checks if input type is one which we can't autofill * @param {{ @@ -11821,31 +10228,27 @@ class Settings { * }} types * @returns {boolean} */ - - isTypeUnavailable(_ref) { let { mainType, subtype } = _ref; if (mainType === 'unknown') return true; - - if (!this.featureToggles["inputType_".concat(mainType)] && subtype !== 'emailAddress') { + if (!this.featureToggles[`inputType_${mainType}`] && subtype !== 'emailAddress') { return true; } - return false; } + /** * Requests data from remote * @returns {Promise<>} */ - - async populateData() { const availableInputTypesFromRemote = await this.getAvailableInputTypes(); this.setAvailableInputTypes(availableInputTypesFromRemote); } + /** * Requests data from remote if not available * @param {{ @@ -11854,11 +10257,7 @@ class Settings { * }} types * @returns {Promise} */ - - async populateDataIfNeeded(_ref2) { - var _this$availableInputT; - let { mainType, subtype @@ -11867,14 +10266,13 @@ class Settings { mainType, subtype })) return false; - - if (((_this$availableInputT = this.availableInputTypes) === null || _this$availableInputT === void 0 ? void 0 : _this$availableInputT[mainType]) === undefined) { + if (this.availableInputTypes?.[mainType] === undefined) { await this.populateData(); return true; } - return false; } + /** * Checks if items will show in the autofill menu, including in-context signup. * Triggers side-effect if input types is not already available. @@ -11885,11 +10283,7 @@ class Settings { * @param {import("./InContextSignup.js").InContextSignup?} inContextSignup * @returns {boolean} */ - - canAutofillType(_ref3, inContextSignup) { - var _this$availableInputT6; - let { mainType, subtype @@ -11897,135 +10291,116 @@ class Settings { if (this.isTypeUnavailable({ mainType, subtype - })) return false; // If it's an email field and Email Protection is enabled, return true regardless of other options + })) return false; + // If it's an email field and Email Protection is enabled, return true regardless of other options const isEmailProtectionEnabled = this.featureToggles.emailProtection && this.availableInputTypes.email; - if (subtype === 'emailAddress' && isEmailProtectionEnabled) { return true; } - - if (inContextSignup !== null && inContextSignup !== void 0 && inContextSignup.isAvailable(subtype)) { + if (inContextSignup?.isAvailable(subtype)) { return true; } - if (subtype === 'fullName') { - var _this$availableInputT2, _this$availableInputT3; - - return Boolean(((_this$availableInputT2 = this.availableInputTypes.identities) === null || _this$availableInputT2 === void 0 ? void 0 : _this$availableInputT2.firstName) || ((_this$availableInputT3 = this.availableInputTypes.identities) === null || _this$availableInputT3 === void 0 ? void 0 : _this$availableInputT3.lastName)); + return Boolean(this.availableInputTypes.identities?.firstName || this.availableInputTypes.identities?.lastName); } - if (subtype === 'expiration') { - var _this$availableInputT4, _this$availableInputT5; - - return Boolean(((_this$availableInputT4 = this.availableInputTypes.creditCards) === null || _this$availableInputT4 === void 0 ? void 0 : _this$availableInputT4.expirationMonth) || ((_this$availableInputT5 = this.availableInputTypes.creditCards) === null || _this$availableInputT5 === void 0 ? void 0 : _this$availableInputT5.expirationYear)); + return Boolean(this.availableInputTypes.creditCards?.expirationMonth || this.availableInputTypes.creditCards?.expirationYear); } - - return Boolean((_this$availableInputT6 = this.availableInputTypes[mainType]) === null || _this$availableInputT6 === void 0 ? void 0 : _this$availableInputT6[subtype]); + return Boolean(this.availableInputTypes[mainType]?.[subtype]); } - /** @returns {AutofillFeatureToggles} */ - + /** @returns {AutofillFeatureToggles} */ get featureToggles() { if (this._featureToggles === null) throw new Error('feature toggles accessed before being set'); return this._featureToggles; } - /** @param {AutofillFeatureToggles} input */ - + /** @param {AutofillFeatureToggles} input */ setFeatureToggles(input) { this._featureToggles = input; } - /** @returns {AvailableInputTypes} */ - + /** @returns {AvailableInputTypes} */ get availableInputTypes() { if (this._availableInputTypes === null) throw new Error('available input types accessed before being set'); return this._availableInputTypes; } - /** @param {AvailableInputTypes} value */ - + /** @param {AvailableInputTypes} value */ setAvailableInputTypes(value) { - this._availableInputTypes = { ...this._availableInputTypes, + this._availableInputTypes = { + ...this._availableInputTypes, ...value }; } - + static defaults = { + /** @type {AutofillFeatureToggles} */ + featureToggles: { + credentials_saving: false, + password_generation: false, + emailProtection: false, + emailProtection_incontext_signup: false, + inputType_identities: false, + inputType_credentials: false, + inputType_creditCards: false, + inlineIcon_credentials: false + }, + /** @type {AvailableInputTypes} */ + availableInputTypes: { + credentials: { + username: false, + password: false + }, + identities: { + firstName: false, + middleName: false, + lastName: false, + birthdayDay: false, + birthdayMonth: false, + birthdayYear: false, + addressStreet: false, + addressStreet2: false, + addressCity: false, + addressProvince: false, + addressPostalCode: false, + addressCountryCode: false, + phone: false, + emailAddress: false + }, + creditCards: { + cardName: false, + cardSecurityCode: false, + expirationMonth: false, + expirationYear: false, + cardNumber: false + }, + email: false + }, + /** @type {boolean | null} */ + enabled: null + }; static default(globalConfig, deviceApi) { const settings = new Settings(globalConfig, deviceApi); settings.setFeatureToggles(Settings.defaults.featureToggles); settings.setAvailableInputTypes(Settings.defaults.availableInputTypes); return settings; } - /** @returns {boolean|null} */ - + /** @returns {boolean|null} */ get enabled() { return this._enabled; } + /** * @param {boolean|null} enabled */ - - setEnabled(enabled) { this._enabled = enabled; } - } - exports.Settings = Settings; -_defineProperty(Settings, "defaults", { - /** @type {AutofillFeatureToggles} */ - featureToggles: { - credentials_saving: false, - password_generation: false, - emailProtection: false, - emailProtection_incontext_signup: false, - inputType_identities: false, - inputType_credentials: false, - inputType_creditCards: false, - inlineIcon_credentials: false - }, - - /** @type {AvailableInputTypes} */ - availableInputTypes: { - credentials: { - username: false, - password: false - }, - identities: { - firstName: false, - middleName: false, - lastName: false, - birthdayDay: false, - birthdayMonth: false, - birthdayYear: false, - addressStreet: false, - addressStreet2: false, - addressCity: false, - addressProvince: false, - addressPostalCode: false, - addressCountryCode: false, - phone: false, - emailAddress: false - }, - creditCards: { - cardName: false, - cardSecurityCode: false, - expirationMonth: false, - expirationYear: false, - cardNumber: false - }, - email: false - }, - - /** @type {boolean | null} */ - enabled: null -}); - },{"../packages/device-api/index.js":2,"./autofill-utils.js":51,"./deviceApiCalls/__generated__/deviceApiCalls.js":55,"./deviceApiCalls/__generated__/validators.zod.js":56,"@duckduckgo/content-scope-scripts/src/apple-utils":1}],41:[function(require,module,exports){ "use strict"; @@ -12033,21 +10408,29 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; - var _autofillUtils = require("../autofill-utils.js"); - var _HTMLTooltip = _interopRequireDefault(require("./HTMLTooltip.js")); - var _Credentials = require("../InputTypes/Credentials.js"); - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - class DataHTMLTooltip extends _HTMLTooltip.default { renderEmailProtectionIncontextSignup(isOtherItems) { - const dataTypeClass = "tooltip__button--data--identities"; + const dataTypeClass = `tooltip__button--data--identities`; const providerIconClass = 'tooltip__button--data--duckduckgo'; - return "\n ".concat(isOtherItems ? '
' : '', "\n \n "); + return ` + ${isOtherItems ? '
' : ''} + + `; } + /** * @param {InputTypeConfigs} config * @param {TooltipItemRenderer[]} items @@ -12060,38 +10443,58 @@ class DataHTMLTooltip extends _HTMLTooltip.default { * onIncontextSignup?(): void * }} callbacks */ - - render(config, items, callbacks) { const { wrapperClass, css } = this.options; - const isTopAutofill = wrapperClass === null || wrapperClass === void 0 ? void 0 : wrapperClass.includes('top-autofill'); - let hasAddedSeparator = false; // Only show an hr above the first duck address button, but it can be either personal or private - + const isTopAutofill = wrapperClass?.includes('top-autofill'); + let hasAddedSeparator = false; + // Only show an hr above the first duck address button, but it can be either personal or private const shouldShowSeparator = (dataId, index) => { const shouldShow = ['personalAddress', 'privateAddress'].includes(dataId) && !hasAddedSeparator; - if (shouldShow) hasAddedSeparator = true; // Don't show the separator if we want to show it, but it's unnecessary as the first item in the menu + if (shouldShow) hasAddedSeparator = true; + // Don't show the separator if we want to show it, but it's unnecessary as the first item in the menu const isFirst = index === 0; return shouldShow && !isFirst; - }; // Only show manage Manage… when it's topAutofill, the provider is unlocked, and it's not just EmailProtection - + }; + // Only show manage Manage… when it's topAutofill, the provider is unlocked, and it's not just EmailProtection const shouldShowManageButton = isTopAutofill && items.some(item => !['personalAddress', 'privateAddress', _Credentials.PROVIDER_LOCKED].includes(item.id())); const topClass = wrapperClass || ''; - const dataTypeClass = "tooltip__button--data--".concat(config.type); - this.shadow.innerHTML = "\n".concat(css, "\n"); + const dataTypeClass = `tooltip__button--data--${config.type}`; + this.shadow.innerHTML = ` +${css} +`; this.wrapper = this.shadow.querySelector('.wrapper'); this.tooltip = this.shadow.querySelector('.tooltip'); this.autofillButtons = this.shadow.querySelectorAll('.js-autofill-button'); @@ -12106,34 +10509,25 @@ class DataHTMLTooltip extends _HTMLTooltip.default { }); }); this.manageButton = this.shadow.getElementById('manage-button'); - if (this.manageButton) { this.registerClickableButton(this.manageButton, () => { callbacks.onManage(config.type); }); } - const getIncontextSignup = this.shadow.querySelector('.js-get-email-signup'); - if (getIncontextSignup) { this.registerClickableButton(getIncontextSignup, () => { - var _callbacks$onIncontex, _callbacks$onIncontex2; - - (_callbacks$onIncontex = callbacks.onIncontextSignupDismissed) === null || _callbacks$onIncontex === void 0 ? void 0 : _callbacks$onIncontex.call(callbacks, { + callbacks.onIncontextSignupDismissed?.({ hasOtherOptions: items.length > 0 }); - (_callbacks$onIncontex2 = callbacks.onIncontextSignup) === null || _callbacks$onIncontex2 === void 0 ? void 0 : _callbacks$onIncontex2.call(callbacks); + callbacks.onIncontextSignup?.(); }); } - this.init(); return this; } - } - -var _default = DataHTMLTooltip; -exports.default = _default; +var _default = exports.default = DataHTMLTooltip; },{"../InputTypes/Credentials.js":35,"../autofill-utils.js":51,"./HTMLTooltip.js":44}],42:[function(require,module,exports){ "use strict"; @@ -12142,13 +10536,9 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; - var _autofillUtils = require("../autofill-utils.js"); - var _HTMLTooltip = _interopRequireDefault(require("./HTMLTooltip.js")); - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - class EmailHTMLTooltip extends _HTMLTooltip.default { /** * @param {import("../DeviceInterface/InterfacePrototype").default} device @@ -12156,20 +10546,34 @@ class EmailHTMLTooltip extends _HTMLTooltip.default { render(device) { this.device = device; this.addresses = device.getLocalAddresses(); - this.shadow.innerHTML = "\n".concat(this.options.css, "\n"); + this.shadow.innerHTML = ` +${this.options.css} +`; this.wrapper = this.shadow.querySelector('.wrapper'); this.tooltip = this.shadow.querySelector('.tooltip'); this.usePersonalButton = this.shadow.querySelector('.js-use-personal'); this.usePrivateButton = this.shadow.querySelector('.js-use-private'); this.addressEl = this.shadow.querySelector('.js-address'); - this.updateAddresses = addresses => { if (addresses && this.addressEl) { this.addresses = addresses; this.addressEl.textContent = (0, _autofillUtils.formatDuckAddress)(addresses.personalAddress); } }; - const firePixel = this.device.firePixel.bind(this.device); this.registerClickableButton(this.usePersonalButton, () => { this.fillForm('personalAddress'); @@ -12182,8 +10586,9 @@ class EmailHTMLTooltip extends _HTMLTooltip.default { firePixel({ pixelName: 'autofill_private_address' }); - }); // Get the alias from the extension + }); + // Get the alias from the extension this.device.getAddresses().then(this.updateAddresses); this.init(); return this; @@ -12191,23 +10596,16 @@ class EmailHTMLTooltip extends _HTMLTooltip.default { /** * @param {'personalAddress' | 'privateAddress'} id */ - - async fillForm(id) { - var _this$device; - const address = this.addresses[id]; const formattedAddress = (0, _autofillUtils.formatDuckAddress)(address); - (_this$device = this.device) === null || _this$device === void 0 ? void 0 : _this$device.selectedDetail({ + this.device?.selectedDetail({ email: formattedAddress, id }, 'email'); } - } - -var _default = EmailHTMLTooltip; -exports.default = _default; +var _default = exports.default = EmailHTMLTooltip; },{"../autofill-utils.js":51,"./HTMLTooltip.js":44}],43:[function(require,module,exports){ "use strict"; @@ -12216,45 +10614,54 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; - var _HTMLTooltip = _interopRequireDefault(require("./HTMLTooltip.js")); - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - class EmailSignupHTMLTooltip extends _HTMLTooltip.default { /** * @param {import("../DeviceInterface/InterfacePrototype").default} device */ render(device) { this.device = device; - this.shadow.innerHTML = "\n".concat(this.options.css, "\n"); + this.shadow.innerHTML = ` +${this.options.css} +`; this.tooltip = this.shadow.querySelector('.tooltip'); this.closeEmailSignup = this.shadow.querySelector('.js-close-email-signup'); this.registerClickableButton(this.closeEmailSignup, () => { - var _device$inContextSign; - - (_device$inContextSign = device.inContextSignup) === null || _device$inContextSign === void 0 ? void 0 : _device$inContextSign.onIncontextSignupClosed(); + device.inContextSignup?.onIncontextSignupClosed(); }); this.dismissEmailSignup = this.shadow.querySelector('.js-dismiss-email-signup'); this.registerClickableButton(this.dismissEmailSignup, () => { - var _device$inContextSign2; - - (_device$inContextSign2 = device.inContextSignup) === null || _device$inContextSign2 === void 0 ? void 0 : _device$inContextSign2.onIncontextSignupDismissed(); + device.inContextSignup?.onIncontextSignupDismissed(); }); this.getEmailSignup = this.shadow.querySelector('.js-get-email-signup'); this.registerClickableButton(this.getEmailSignup, () => { - var _device$inContextSign3; - - (_device$inContextSign3 = device.inContextSignup) === null || _device$inContextSign3 === void 0 ? void 0 : _device$inContextSign3.onIncontextSignup(); + device.inContextSignup?.onIncontextSignup(); }); this.init(); return this; } - } - -var _default = EmailSignupHTMLTooltip; -exports.default = _default; +var _default = exports.default = EmailSignupHTMLTooltip; },{"./HTMLTooltip.js":44}],44:[function(require,module,exports){ "use strict"; @@ -12263,15 +10670,9 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.defaultOptions = exports.default = exports.HTMLTooltip = void 0; - var _autofillUtils = require("../autofill-utils.js"); - var _matching = require("../Form/matching.js"); - var _styles = require("./styles/styles.js"); - -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - /** * @typedef {object} HTMLTooltipOptions * @property {boolean} testMode @@ -12293,25 +10694,29 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope */ /** @type {HTMLTooltipOptions} */ -const defaultOptions = { +const defaultOptions = exports.defaultOptions = { wrapperClass: '', - tooltipPositionClass: (top, left) => "\n .tooltip {\n transform: translate(".concat(Math.floor(left), "px, ").concat(Math.floor(top), "px) !important;\n }\n "), - caretPositionClass: (top, left, isAboveInput) => "\n .tooltip--email__caret {\n ".concat(isAboveInput ? "transform: translate(".concat(Math.floor(left), "px, ").concat(Math.floor(top), "px) rotate(180deg); transform-origin: 18px !important;") : "transform: translate(".concat(Math.floor(left), "px, ").concat(Math.floor(top), "px) !important;"), "\n }"), - css: ""), + tooltipPositionClass: (top, left) => ` + .tooltip { + transform: translate(${Math.floor(left)}px, ${Math.floor(top)}px) !important; + } + `, + caretPositionClass: (top, left, isAboveInput) => ` + .tooltip--email__caret { + ${isAboveInput ? `transform: translate(${Math.floor(left)}px, ${Math.floor(top)}px) rotate(180deg); transform-origin: 18px !important;` : `transform: translate(${Math.floor(left)}px, ${Math.floor(top)}px) !important;`} + }`, + css: ``, setSize: undefined, - remove: () => { - /** noop */ - }, + remove: () => {/** noop */}, testMode: false, checkVisibility: true, hasCaret: false, isIncontextSignupAvailable: () => false }; -exports.defaultOptions = defaultOptions; - class HTMLTooltip { + isAboveInput = false; /** @type {HTMLTooltipOptions} */ - + options; /** * @param config * @param inputType @@ -12319,30 +10724,6 @@ class HTMLTooltip { * @param {HTMLTooltipOptions} options */ constructor(config, inputType, getPosition, options) { - _defineProperty(this, "isAboveInput", false); - - _defineProperty(this, "options", void 0); - - _defineProperty(this, "resObs", new ResizeObserver(entries => entries.forEach(() => this.checkPosition()))); - - _defineProperty(this, "mutObsCheckPositionWhenIdle", _autofillUtils.whenIdle.call(this, this.checkPosition)); - - _defineProperty(this, "mutObs", new MutationObserver(mutationList => { - for (const mutationRecord of mutationList) { - if (mutationRecord.type === 'childList') { - // Only check added nodes - mutationRecord.addedNodes.forEach(el => { - if (el.nodeName === 'DDG-AUTOFILL') return; - this.ensureIsLastInDOM(); - }); - } - } - - this.mutObsCheckPositionWhenIdle(); - })); - - _defineProperty(this, "clickableButtons", new Map()); - this.options = options; this.shadow = document.createElement('ddg-autofill').attachShadow({ mode: options.testMode ? 'open' : 'closed' @@ -12356,8 +10737,8 @@ class HTMLTooltip { 'display': 'block', 'visibility': 'visible', 'opacity': '1' - }; // @ts-ignore how to narrow this.host to HTMLElement? - + }; + // @ts-ignore how to narrow this.host to HTMLElement? (0, _autofillUtils.addInlineStyles)(this.host, forcedVisibilityStyles); this.count = 0; this.device = null; @@ -12367,7 +10748,6 @@ class HTMLTooltip { * 'caret': TransformRuleObj * }} */ - this.transformRules = { caret: { getRuleString: this.options.caretPositionClass, @@ -12379,19 +10759,14 @@ class HTMLTooltip { } }; } - get isHidden() { return this.tooltip.parentNode.hidden; } - append() { document.body.appendChild(this.host); } - remove() { - var _this$device; - - (_this$device = this.device) === null || _this$device === void 0 ? void 0 : _this$device.activeForm.resetIconStylesToInitial(); + this.device?.activeForm.resetIconStylesToInitial(); window.removeEventListener('scroll', this, { capture: true }); @@ -12399,13 +10774,11 @@ class HTMLTooltip { this.mutObs.disconnect(); this.lift(); } - lift() { this.left = null; this.top = null; document.body.removeChild(this.host); } - handleEvent(event) { switch (event.type) { case 'scroll': @@ -12413,24 +10786,19 @@ class HTMLTooltip { break; } } - focus(x, y) { - var _this$shadow$elementF, _this$shadow$elementF2; - const focusableElements = 'button'; const currentFocusClassName = 'currentFocus'; - const currentFocused = this.shadow.querySelectorAll(".".concat(currentFocusClassName)); + const currentFocused = this.shadow.querySelectorAll(`.${currentFocusClassName}`); [...currentFocused].forEach(el => { el.classList.remove(currentFocusClassName); }); - (_this$shadow$elementF = this.shadow.elementFromPoint(x, y)) === null || _this$shadow$elementF === void 0 ? void 0 : (_this$shadow$elementF2 = _this$shadow$elementF.closest(focusableElements)) === null || _this$shadow$elementF2 === void 0 ? void 0 : _this$shadow$elementF2.classList.add(currentFocusClassName); + this.shadow.elementFromPoint(x, y)?.closest(focusableElements)?.classList.add(currentFocusClassName); } - checkPosition() { if (this.animationFrame) { window.cancelAnimationFrame(this.animationFrame); } - this.animationFrame = window.requestAnimationFrame(() => { if (this.isHidden) return; const { @@ -12439,14 +10807,12 @@ class HTMLTooltip { height, top } = this.getPosition(); - if (left !== this.left || bottom !== this.top) { const coords = { left, top: bottom }; this.updatePosition('tooltip', coords); - if (this.options.hasCaret) { // Recalculate tooltip top as it may have changed after update potition above const { @@ -12455,16 +10821,15 @@ class HTMLTooltip { this.isAboveInput = top > tooltipTop; const borderWidth = 2; const caretTop = this.isAboveInput ? coords.top - height - borderWidth : coords.top; - this.updatePosition('caret', { ...coords, + this.updatePosition('caret', { + ...coords, top: caretTop }); } } - this.animationFrame = null; }); } - getOverridePosition(_ref) { let { left, @@ -12472,8 +10837,9 @@ class HTMLTooltip { } = _ref; const tooltipBoundingBox = this.tooltip.getBoundingClientRect(); const smallScreenWidth = tooltipBoundingBox.width * 2; - const spacing = 5; // If overflowing from the bottom, move to above the input + const spacing = 5; + // If overflowing from the bottom, move to above the input if (tooltipBoundingBox.bottom > window.innerHeight) { const inputPosition = this.getPosition(); const caretHeight = 14; @@ -12482,9 +10848,9 @@ class HTMLTooltip { left, top: overriddenTopPosition }; - } // If overflowing from the left on smaller screen, center in the window - + } + // If overflowing from the left on smaller screen, center in the window if (tooltipBoundingBox.left < 0 && window.innerWidth <= smallScreenWidth) { const leftOverflow = Math.abs(tooltipBoundingBox.left); const leftPosWhenCentered = (window.innerWidth - tooltipBoundingBox.width) / 2; @@ -12493,9 +10859,9 @@ class HTMLTooltip { left: overriddenLeftPosition, top }; - } // If overflowing from the left on larger screen, move so it's just on screen on the left - + } + // If overflowing from the left on larger screen, move so it's just on screen on the left if (tooltipBoundingBox.left < 0 && window.innerWidth > smallScreenWidth) { const leftOverflow = Math.abs(tooltipBoundingBox.left); const overriddenLeftPosition = left + leftOverflow + spacing; @@ -12503,9 +10869,9 @@ class HTMLTooltip { left: overriddenLeftPosition, top }; - } // If overflowing from the right, move so it's just on screen on the right - + } + // If overflowing from the right, move so it's just on screen on the right if (tooltipBoundingBox.right > window.innerWidth) { const rightOverflow = tooltipBoundingBox.right - window.innerWidth; const overriddenLeftPosition = left - rightOverflow - spacing; @@ -12515,6 +10881,7 @@ class HTMLTooltip { }; } } + /** * @param {'tooltip' | 'caret'} element * @param {{ @@ -12522,18 +10889,13 @@ class HTMLTooltip { * top: number * }} coords */ - - applyPositionalStyles(element, _ref2) { - var _ruleObj$getRuleStrin; - let { left, top } = _ref2; const shadow = this.shadow; const ruleObj = this.transformRules[element]; - if (ruleObj.index) { if (shadow.styleSheets[0].rules[ruleObj.index]) { // If we have already set the rule, remove it… @@ -12543,13 +10905,12 @@ class HTMLTooltip { // …otherwise, set the index as the very last rule ruleObj.index = shadow.styleSheets[0].rules.length; } - - const cssRule = (_ruleObj$getRuleStrin = ruleObj.getRuleString) === null || _ruleObj$getRuleStrin === void 0 ? void 0 : _ruleObj$getRuleStrin.call(ruleObj, top, left, this.isAboveInput); - + const cssRule = ruleObj.getRuleString?.(top, left, this.isAboveInput); if (typeof cssRule === 'string') { shadow.styleSheets[0].insertRule(cssRule, ruleObj.index); } } + /** * @param {'tooltip' | 'caret'} element * @param {{ @@ -12557,29 +10918,22 @@ class HTMLTooltip { * top: number * }} coords */ - - updatePosition(element, _ref3) { let { left, top } = _ref3; - // If the stylesheet is not loaded wait for load (Chrome bug) if (!this.shadow.styleSheets.length) { - var _this$stylesheet; - - (_this$stylesheet = this.stylesheet) === null || _this$stylesheet === void 0 ? void 0 : _this$stylesheet.addEventListener('load', () => this.checkPosition()); + this.stylesheet?.addEventListener('load', () => this.checkPosition()); return; } - this.left = left; this.top = top; this.applyPositionalStyles(element, { left, top }); - if (this.options.hasCaret) { const overridePosition = this.getOverridePosition({ left, @@ -12588,10 +10942,9 @@ class HTMLTooltip { if (overridePosition) this.updatePosition(element, overridePosition); } } - ensureIsLastInDOM() { - this.count = this.count || 0; // If DDG el is not the last in the doc, move it there - + this.count = this.count || 0; + // If DDG el is not the last in the doc, move it there if (document.body.lastElementChild !== this.host) { // Try up to 15 times to avoid infinite loop in case someone is doing the same if (this.count < 15) { @@ -12602,29 +10955,39 @@ class HTMLTooltip { } else { // Remove the tooltip from the form to cleanup listeners and observers this.options.remove(); - console.info("DDG autofill bailing out"); + console.info(`DDG autofill bailing out`); } } } - + resObs = new ResizeObserver(entries => entries.forEach(() => this.checkPosition())); + mutObsCheckPositionWhenIdle = _autofillUtils.whenIdle.call(this, this.checkPosition); + mutObs = new MutationObserver(mutationList => { + for (const mutationRecord of mutationList) { + if (mutationRecord.type === 'childList') { + // Only check added nodes + mutationRecord.addedNodes.forEach(el => { + if (el.nodeName === 'DDG-AUTOFILL') return; + this.ensureIsLastInDOM(); + }); + } + } + this.mutObsCheckPositionWhenIdle(); + }); setActiveButton(e) { this.activeButton = e.target; } - unsetActiveButton() { this.activeButton = null; } - + clickableButtons = new Map(); registerClickableButton(btn, handler) { - this.clickableButtons.set(btn, handler); // Needed because clicks within the shadow dom don't provide this info to the outside - + this.clickableButtons.set(btn, handler); + // Needed because clicks within the shadow dom don't provide this info to the outside btn.addEventListener('mouseenter', e => this.setActiveButton(e)); btn.addEventListener('mouseleave', () => this.unsetActiveButton()); } - dispatchClick() { const handler = this.clickableButtons.get(this.activeButton); - if (handler) { if (this.activeButton.matches('.wrapper:not(.top-autofill) button:hover, .wrapper:not(.top-autofill) a:hover, .currentFocus')) { (0, _autofillUtils.safeExecute)(this.activeButton, handler, { @@ -12635,7 +10998,6 @@ class HTMLTooltip { } } } - setupSizeListener() { // Listen to layout and paint changes to register the size const observer = new PerformanceObserver(() => { @@ -12645,31 +11007,25 @@ class HTMLTooltip { entryTypes: ['layout-shift', 'paint'] }); } - setSize() { - var _this$options$setSize, _this$options; - - const innerNode = this.shadow.querySelector('.wrapper--data'); // Shouldn't be possible - + const innerNode = this.shadow.querySelector('.wrapper--data'); + // Shouldn't be possible if (!innerNode) return; const details = { height: innerNode.clientHeight, width: innerNode.clientWidth }; - (_this$options$setSize = (_this$options = this.options).setSize) === null || _this$options$setSize === void 0 ? void 0 : _this$options$setSize.call(_this$options, details); + this.options.setSize?.(details); } - init() { - var _this$stylesheet2; - this.animationFrame = null; this.top = 0; this.left = 0; this.transformRuleIndex = null; - this.stylesheet = this.shadow.querySelector('link, style'); // Un-hide once the style and web fonts have loaded, to avoid flashing + this.stylesheet = this.shadow.querySelector('link, style'); + // Un-hide once the style and web fonts have loaded, to avoid flashing // unstyled content and layout shifts - - (_this$stylesheet2 = this.stylesheet) === null || _this$stylesheet2 === void 0 ? void 0 : _this$stylesheet2.addEventListener('load', () => { + this.stylesheet?.addEventListener('load', () => { Promise.allSettled([document.fonts.load("normal 13px 'DDG_ProximaNova'"), document.fonts.load("bold 13px 'DDG_ProximaNova'")]).then(() => { this.tooltip.parentNode.removeAttribute('hidden'); this.checkPosition(); @@ -12686,17 +11042,13 @@ class HTMLTooltip { capture: true }); this.setSize(); - if (typeof this.options.setSize === 'function') { this.setupSizeListener(); } } - } - exports.HTMLTooltip = HTMLTooltip; -var _default = HTMLTooltip; -exports.default = _default; +var _default = exports.default = HTMLTooltip; },{"../Form/matching.js":33,"../autofill-utils.js":51,"./styles/styles.js":50}],45:[function(require,module,exports){ "use strict"; @@ -12705,27 +11057,15 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.HTMLTooltipUIController = void 0; - var _autofillUtils = require("../../autofill-utils.js"); - var _inputTypeConfig = require("../../Form/inputTypeConfig.js"); - var _matching = require("../../Form/matching.js"); - var _DataHTMLTooltip = _interopRequireDefault(require("../DataHTMLTooltip.js")); - var _EmailHTMLTooltip = _interopRequireDefault(require("../EmailHTMLTooltip.js")); - var _EmailSignupHTMLTooltip = _interopRequireDefault(require("../EmailSignupHTMLTooltip.js")); - var _HTMLTooltip = require("../HTMLTooltip.js"); - var _UIController = require("./UIController.js"); - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - /** * @typedef HTMLTooltipControllerOptions * @property {"modern" | "legacy" | "emailsignup"} tooltipKind - A choice between the newer Autofill UI vs the older ones used in the extension @@ -12741,15 +11081,19 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope */ class HTMLTooltipUIController extends _UIController.UIController { /** @type {import("../HTMLTooltip.js").HTMLTooltip | null} */ + _activeTooltip = null; /** @type {HTMLTooltipControllerOptions} */ + _options; /** @type {import('../HTMLTooltip.js').HTMLTooltipOptions} */ + _htmlTooltipOptions; /** * Overwritten when calling createTooltip * @type {import('../../Form/matching').SupportedTypes} */ + _activeInputType = 'unknown'; /** * @param {HTMLTooltipControllerOptions} options @@ -12758,24 +11102,13 @@ class HTMLTooltipUIController extends _UIController.UIController { constructor(options) { let htmlTooltipOptions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _HTMLTooltip.defaultOptions; super(); - - _defineProperty(this, "_activeTooltip", null); - - _defineProperty(this, "_options", void 0); - - _defineProperty(this, "_htmlTooltipOptions", void 0); - - _defineProperty(this, "_activeInputType", 'unknown'); - - _defineProperty(this, "_activeInput", void 0); - - _defineProperty(this, "_activeInputOriginalAutocomplete", void 0); - this._options = options; this._htmlTooltipOptions = Object.assign({}, _HTMLTooltip.defaultOptions, htmlTooltipOptions); window.addEventListener('pointerdown', this, true); window.addEventListener('pointerup', this, true); } + _activeInput; + _activeInputOriginalAutocomplete; /** * Cleans up after this UI controller by removing the tooltip and all @@ -12786,16 +11119,14 @@ class HTMLTooltipUIController extends _UIController.UIController { window.removeEventListener('pointerdown', this, true); window.removeEventListener('pointerup', this, true); } + /** * @param {import('./UIController').AttachArgs} args */ - - attach(args) { if (this.getActiveTooltip()) { return; } - const { topContextData, getPosition, @@ -12809,55 +11140,49 @@ class HTMLTooltipUIController extends _UIController.UIController { this._activeInputOriginalAutocomplete = input.getAttribute('autocomplete'); input.setAttribute('autocomplete', 'off'); } + /** * Actually create the HTML Tooltip * @param {PosFn} getPosition * @param {TopContextData} topContextData * @return {import("../HTMLTooltip").HTMLTooltip} */ - - createTooltip(getPosition, topContextData) { this._attachListeners(); - const config = (0, _inputTypeConfig.getInputConfigFromType)(topContextData.inputType); this._activeInputType = topContextData.inputType; + /** * @type {import('../HTMLTooltip').HTMLTooltipOptions} */ - - const tooltipOptions = { ...this._htmlTooltipOptions, + const tooltipOptions = { + ...this._htmlTooltipOptions, remove: () => this.removeTooltip(), isIncontextSignupAvailable: () => { - var _this$_options$device; - const subtype = (0, _matching.getSubtypeFromType)(topContextData.inputType); - return !!((_this$_options$device = this._options.device.inContextSignup) !== null && _this$_options$device !== void 0 && _this$_options$device.isAvailable(subtype)); + return !!this._options.device.inContextSignup?.isAvailable(subtype); } }; - if (this._options.tooltipKind === 'legacy') { this._options.device.firePixel({ pixelName: 'autofill_show' }); - return new _EmailHTMLTooltip.default(config, topContextData.inputType, getPosition, tooltipOptions).render(this._options.device); } - if (this._options.tooltipKind === 'emailsignup') { this._options.device.firePixel({ pixelName: 'incontext_show' }); - return new _EmailSignupHTMLTooltip.default(config, topContextData.inputType, getPosition, tooltipOptions).render(this._options.device); - } // collect the data for each item to display - - - const data = this._dataForAutofill(config, topContextData.inputType, topContextData); // convert the data into tool tip item renderers + } + // collect the data for each item to display + const data = this._dataForAutofill(config, topContextData.inputType, topContextData); - const asRenderers = data.map(d => config.tooltipItem(d)); // construct the autofill + // convert the data into tool tip item renderers + const asRenderers = data.map(d => config.tooltipItem(d)); + // construct the autofill return new _DataHTMLTooltip.default(config, topContextData.inputType, getPosition, tooltipOptions).render(config, asRenderers, { onSelect: id => { this._onSelect(topContextData.inputType, data, id); @@ -12873,16 +11198,15 @@ class HTMLTooltipUIController extends _UIController.UIController { } }); } - updateItems(data) { if (this._activeInputType === 'unknown') return; - const config = (0, _inputTypeConfig.getInputConfigFromType)(this._activeInputType); // convert the data into tool tip item renderers + const config = (0, _inputTypeConfig.getInputConfigFromType)(this._activeInputType); + // convert the data into tool tip item renderers const asRenderers = data.map(d => config.tooltipItem(d)); const activeTooltip = this.getActiveTooltip(); - if (activeTooltip instanceof _DataHTMLTooltip.default) { - activeTooltip === null || activeTooltip === void 0 ? void 0 : activeTooltip.render(config, asRenderers, { + activeTooltip?.render(config, asRenderers, { onSelect: id => { this._onSelect(this._activeInputType, data, id); }, @@ -12896,27 +11220,21 @@ class HTMLTooltipUIController extends _UIController.UIController { this._onIncontextSignup(); } }); - } // TODO: can we remove this timeout once implemented with real APIs? + } + // TODO: can we remove this timeout once implemented with real APIs? // The timeout is needed because clientHeight and clientWidth were returning 0 - - setTimeout(() => { - var _this$getActiveToolti; - - (_this$getActiveToolti = this.getActiveTooltip()) === null || _this$getActiveToolti === void 0 ? void 0 : _this$getActiveToolti.setSize(); + this.getActiveTooltip()?.setSize(); }, 10); } - _attachListeners() { window.addEventListener('input', this); window.addEventListener('keydown', this, true); } - _removeListeners() { window.removeEventListener('input', this); window.removeEventListener('keydown', this, true); } - handleEvent(event) { switch (event.type) { case 'keydown': @@ -12925,102 +11243,91 @@ class HTMLTooltipUIController extends _UIController.UIController { event.preventDefault(); event.stopImmediatePropagation(); } - this.removeTooltip(); } - break; - case 'input': this.removeTooltip(); break; - case 'pointerdown': { this._pointerDownListener(event); - break; } - case 'pointerup': { this._pointerUpListener(event); - break; } } - } // Global listener for event delegation - + } + // Global listener for event delegation _pointerDownListener(e) { - if (!e.isTrusted) return; // Ignore events on the Dax icon, we handle those elsewhere - - if ((0, _autofillUtils.isEventWithinDax)(e, e.target)) return; // @ts-ignore + if (!e.isTrusted) return; + // Ignore events on the Dax icon, we handle those elsewhere + if ((0, _autofillUtils.isEventWithinDax)(e, e.target)) return; + // @ts-ignore if (e.target.nodeName === 'DDG-AUTOFILL') { e.preventDefault(); - e.stopImmediatePropagation(); // Ignore pointer down events, we'll handle them on pointer up + e.stopImmediatePropagation(); + // Ignore pointer down events, we'll handle them on pointer up } else { this.removeTooltip().catch(e => { console.error('error removing tooltip', e); }); } - } // Global listener for event delegation - + } + // Global listener for event delegation _pointerUpListener(e) { - if (!e.isTrusted) return; // Ignore events on the Dax icon, we handle those elsewhere - - if ((0, _autofillUtils.isEventWithinDax)(e, e.target)) return; // @ts-ignore + if (!e.isTrusted) return; + // Ignore events on the Dax icon, we handle those elsewhere + if ((0, _autofillUtils.isEventWithinDax)(e, e.target)) return; + // @ts-ignore if (e.target.nodeName === 'DDG-AUTOFILL') { e.preventDefault(); e.stopImmediatePropagation(); const isMainMouseButton = e.button === 0; if (!isMainMouseButton) return; const activeTooltip = this.getActiveTooltip(); - activeTooltip === null || activeTooltip === void 0 ? void 0 : activeTooltip.dispatchClick(); + activeTooltip?.dispatchClick(); } } - async removeTooltip(_via) { this._htmlTooltipOptions.remove(); - if (this._activeTooltip) { this._removeListeners(); - this._activeTooltip.remove(); - this._activeTooltip = null; } - if (this._activeInput) { if (this._activeInputOriginalAutocomplete) { this._activeInput.setAttribute('autocomplete', this._activeInputOriginalAutocomplete); } else { this._activeInput.removeAttribute('autocomplete'); } - this._activeInput = null; this._activeInputOriginalAutocomplete = null; } } + /** * @returns {import("../HTMLTooltip.js").HTMLTooltip|null} */ - - getActiveTooltip() { return this._activeTooltip; } + /** * @param {import("../HTMLTooltip.js").HTMLTooltip} value */ - - setActiveTooltip(value) { this._activeTooltip = value; } + /** * Collect the data that's needed to populate the Autofill UI. * @@ -13030,11 +11337,10 @@ class HTMLTooltipUIController extends _UIController.UIController { * @param {import('../../Form/matching').SupportedTypes} inputType - The input type for the current field * @param {TopContextData} topContextData */ - - _dataForAutofill(config, inputType, topContextData) { return this._options.device.dataForAutofill(config, inputType, topContextData); } + /** * When a field is selected, call the `onSelect` method from the device. * @@ -13044,11 +11350,10 @@ class HTMLTooltipUIController extends _UIController.UIController { * @param {(CreditCardObject | IdentityObject | CredentialsObject)[]} data * @param {CreditCardObject['id']|IdentityObject['id']|CredentialsObject['id']} id */ - - _onSelect(inputType, data, id) { return this._options.device.onSelect(inputType, data, id); } + /** * Called when clicking on the Manage… button in the html tooltip * @@ -13056,60 +11361,44 @@ class HTMLTooltipUIController extends _UIController.UIController { * @returns {*} * @private */ - - _onManage(type) { this.removeTooltip(); - switch (type) { case 'credentials': return this._options.device.openManagePasswords(); - case 'creditCards': return this._options.device.openManageCreditCards(); - case 'identities': return this._options.device.openManageIdentities(); - - default: // noop - + default: + // noop } } _onIncontextSignupDismissed(_ref) { - var _this$_options$device2; - let { hasOtherOptions } = _ref; - (_this$_options$device2 = this._options.device.inContextSignup) === null || _this$_options$device2 === void 0 ? void 0 : _this$_options$device2.onIncontextSignupDismissed({ + this._options.device.inContextSignup?.onIncontextSignupDismissed({ shouldHideTooltip: !hasOtherOptions - }); // If there are other options available, just force a re-render + }); + // If there are other options available, just force a re-render if (hasOtherOptions) { const topContextData = this._options.device.getTopContextData(); - if (!topContextData) return; const config = (0, _inputTypeConfig.getInputConfigFromType)(topContextData.inputType); - const data = this._dataForAutofill(config, topContextData.inputType, topContextData); - this.updateItems(data); } } - _onIncontextSignup() { - var _this$_options$device3; - - (_this$_options$device3 = this._options.device.inContextSignup) === null || _this$_options$device3 === void 0 ? void 0 : _this$_options$device3.onIncontextSignup(); + this._options.device.inContextSignup?.onIncontextSignup(); } - isActive() { return Boolean(this.getActiveTooltip()); } - } - exports.HTMLTooltipUIController = HTMLTooltipUIController; },{"../../Form/inputTypeConfig.js":28,"../../Form/matching.js":33,"../../autofill-utils.js":51,"../DataHTMLTooltip.js":41,"../EmailHTMLTooltip.js":42,"../EmailSignupHTMLTooltip.js":43,"../HTMLTooltip.js":44,"./UIController.js":48}],46:[function(require,module,exports){ @@ -13119,31 +11408,10 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.NativeUIController = void 0; - var _UIController = require("./UIController.js"); - var _matching = require("../../Form/matching.js"); - var _deviceApiCalls = require("../../deviceApiCalls/__generated__/deviceApiCalls.js"); - var _Credentials = require("../../InputTypes/Credentials.js"); - -function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); } - -function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } } - -function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); } - -function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; } - -function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; } - -function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); } - -function _classApplyDescriptorSet(receiver, descriptor, value) { if (descriptor.set) { descriptor.set.call(receiver, value); } else { if (!descriptor.writable) { throw new TypeError("attempted to set read only private field"); } descriptor.value = value; } } - -var _passwordStatus = /*#__PURE__*/new WeakMap(); - /** * `NativeController` should be used in situations where you DO NOT * want any Autofill-controlled user interface. @@ -13159,14 +11427,13 @@ var _passwordStatus = /*#__PURE__*/new WeakMap(); * ``` */ class NativeUIController extends _UIController.UIController { - constructor() { - super(...arguments); - - _classPrivateFieldInitSpec(this, _passwordStatus, { - writable: true, - value: 'default' - }); - } + /** + * Keep track of when passwords were suggested/rejected/accepted etc + * State is kept here because it's specific to the interactions on mobile (eg: NativeUIController) + * + * @type {"default" | "rejected"} + */ + #passwordStatus = 'default'; /** * @param {import('./UIController').AttachArgs} args @@ -13183,31 +11450,28 @@ class NativeUIController extends _UIController.UIController { const inputType = (0, _matching.getInputType)(input); const mainType = (0, _matching.getMainTypeFromType)(inputType); const subType = (0, _matching.getSubtypeFromType)(inputType); - if (mainType === 'unknown') { throw new Error('unreachable, should not be here if (mainType === "unknown")'); } - if (trigger === 'autoprompt') { window.scrollTo({ behavior: 'smooth', top: form.form.getBoundingClientRect().top - document.body.getBoundingClientRect().top - 50 }); } - /** @type {import('../../deviceApiCalls/__generated__/validators-ts').GetAutofillDataRequest} */ - + /** @type {import('../../deviceApiCalls/__generated__/validators-ts').GetAutofillDataRequest} */ let payload = { inputType, mainType, subType, trigger - }; // append generated password if enabled + }; + // append generated password if enabled if (device.settings.featureToggles.password_generation) { payload = this.appendGeneratedPassword(topContextData, payload, triggerMetaData); } - device.deviceApi.request(new _deviceApiCalls.GetAutofillDataCall(payload)).then(resp => { switch (resp.action) { case 'fill': @@ -13215,42 +11479,30 @@ class NativeUIController extends _UIController.UIController { if (mainType in resp) { form.autofillData(resp[mainType], mainType); } else { - throw new Error("action: \"fill\" cannot occur because \"".concat(mainType, "\" was missing")); + throw new Error(`action: "fill" cannot occur because "${mainType}" was missing`); } - break; } - case 'focus': { - var _form$activeInput; - - (_form$activeInput = form.activeInput) === null || _form$activeInput === void 0 ? void 0 : _form$activeInput.focus(); + form.activeInput?.focus(); break; } - case 'acceptGeneratedPassword': { - var _topContextData$crede; - form.autofillData({ - password: (_topContextData$crede = topContextData.credentials) === null || _topContextData$crede === void 0 ? void 0 : _topContextData$crede[0].password, + password: topContextData.credentials?.[0].password, [_Credentials.AUTOGENERATED_KEY]: true }, mainType); break; } - case 'rejectGeneratedPassword': { - var _form$activeInput2; - - _classPrivateFieldSet(this, _passwordStatus, 'rejected'); - + this.#passwordStatus = 'rejected'; form.touchAllInputs('credentials'); - (_form$activeInput2 = form.activeInput) === null || _form$activeInput2 === void 0 ? void 0 : _form$activeInput2.focus(); + form.activeInput?.focus(); break; } - default: { if (args.device.isTestMode()) { @@ -13263,6 +11515,7 @@ class NativeUIController extends _UIController.UIController { console.error(e); }); } + /** * If a password exists in `topContextData`, we can append it to the outgoing data * in a way that native platforms can easily understand. @@ -13272,47 +11525,42 @@ class NativeUIController extends _UIController.UIController { * @param {import('../../UI/controllers/UIController.js').AttachArgs['triggerMetaData']} triggerMetaData * @return {import('../../deviceApiCalls/__generated__/validators-ts.js').GetAutofillDataRequest} */ - - appendGeneratedPassword(topContextData, outgoingData, triggerMetaData) { - var _topContextData$crede2; - - const autoGeneratedCredential = (_topContextData$crede2 = topContextData.credentials) === null || _topContextData$crede2 === void 0 ? void 0 : _topContextData$crede2.find(credential => credential.autogenerated); // if there's no generated password, we don't need to do anything + const autoGeneratedCredential = topContextData.credentials?.find(credential => credential.autogenerated); - if (!(autoGeneratedCredential !== null && autoGeneratedCredential !== void 0 && autoGeneratedCredential.password)) { + // if there's no generated password, we don't need to do anything + if (!autoGeneratedCredential?.password) { return outgoingData; } - function suggestPassword() { - if (!(autoGeneratedCredential !== null && autoGeneratedCredential !== void 0 && autoGeneratedCredential.password)) throw new Error('unreachable'); - return { ...outgoingData, + if (!autoGeneratedCredential?.password) throw new Error('unreachable'); + return { + ...outgoingData, generatedPassword: { value: autoGeneratedCredential.password, username: autoGeneratedCredential.username } }; - } // for explicit opt-in, we should *always* append the password + } + + // for explicit opt-in, we should *always* append the password // this can occur when the user clicks icon directly - in that instance we ignore // any internal state and just append the password to the outgoing data - - if (triggerMetaData.type === 'explicit-opt-in') { return suggestPassword(); - } // When the opt-in is 'implicit' though we only append the password if the user has not previously rejected it. + } + + // When the opt-in is 'implicit' though we only append the password if the user has not previously rejected it. // This helps the situation where the user has rejected a password for the username field, but then // taps into the confirm password field - - - if (triggerMetaData.type === 'implicit-opt-in' && _classPrivateFieldGet(this, _passwordStatus) !== 'rejected') { + if (triggerMetaData.type === 'implicit-opt-in' && this.#passwordStatus !== 'rejected') { return suggestPassword(); - } // if we get here there's nothing to do - + } + // if we get here there's nothing to do return outgoingData; } - } - exports.NativeUIController = NativeUIController; },{"../../Form/matching.js":33,"../../InputTypes/Credentials.js":35,"../../deviceApiCalls/__generated__/deviceApiCalls.js":55,"./UIController.js":48}],47:[function(require,module,exports){ @@ -13322,29 +11570,8 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.OverlayUIController = void 0; - var _UIController = require("./UIController.js"); - var _matching = require("../../Form/matching.js"); - -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - -function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); } - -function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } } - -function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); } - -function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; } - -function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; } - -function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); } - -function _classApplyDescriptorSet(receiver, descriptor, value) { if (descriptor.set) { descriptor.set.call(receiver, value); } else { if (!descriptor.writable) { throw new TypeError("attempted to set read only private field"); } descriptor.value = value; } } - -var _state = /*#__PURE__*/new WeakMap(); - /** * @typedef {import('../../deviceApiCalls/__generated__/validators-ts').GetAutofillDataRequest} GetAutofillDataRequest * @typedef {import('../../deviceApiCalls/__generated__/validators-ts').TriggerContext} TriggerContext @@ -13375,49 +11602,44 @@ var _state = /*#__PURE__*/new WeakMap(); */ class OverlayUIController extends _UIController.UIController { /** @type {"idle" | "parentShown"} */ + #state = 'idle'; /** @type {import('../HTMLTooltip.js').HTMLTooltip | null} */ + _activeTooltip = null; /** * @type {OverlayControllerOptions} */ + _options; /** * @param {OverlayControllerOptions} options */ constructor(options) { super(); + this._options = options; - _classPrivateFieldInitSpec(this, _state, { - writable: true, - value: 'idle' - }); - - _defineProperty(this, "_activeTooltip", null); - - _defineProperty(this, "_options", void 0); - - this._options = options; // We always register this 'pointerdown' event, regardless of + // We always register this 'pointerdown' event, regardless of // whether we have a tooltip currently open or not. This is to ensure // we can clear out any existing state before opening a new one. - window.addEventListener('pointerdown', this, true); } + /** * @param {import('./UIController').AttachArgs} args */ - - attach(args) { const { getPosition, topContextData, click, input - } = args; // Do not attach the tooltip if the input is not in the DOM + } = args; - if (!input.parentNode) return; // If the input is removed from the DOM while the tooltip is attached, remove it + // Do not attach the tooltip if the input is not in the DOM + if (!input.parentNode) return; + // If the input is removed from the DOM while the tooltip is attached, remove it this._mutObs = new MutationObserver(mutationList => { for (const mutationRecord of mutationList) { mutationRecord.removedNodes.forEach(el => { @@ -13427,63 +11649,51 @@ class OverlayUIController extends _UIController.UIController { }); } }); - this._mutObs.observe(document.body, { childList: true, subtree: true }); + const position = getPosition(); - const position = getPosition(); // If the element is not in viewport, scroll there and recurse. 50ms is arbitrary - + // If the element is not in viewport, scroll there and recurse. 50ms is arbitrary if (!click && !this.elementIsInViewport(position)) { - var _this$_mutObs; - input.scrollIntoView(true); - (_this$_mutObs = this._mutObs) === null || _this$_mutObs === void 0 ? void 0 : _this$_mutObs.disconnect(); + this._mutObs?.disconnect(); setTimeout(() => { this.attach(args); }, 50); return; } - - _classPrivateFieldSet(this, _state, 'parentShown'); - + this.#state = 'parentShown'; this.showTopTooltip(click, position, topContextData).catch(e => { console.error('error from showTopTooltip', e); - - _classPrivateFieldSet(this, _state, 'idle'); + this.#state = 'idle'; }); } + /** * @param {{ x: number; y: number; height: number; width: number; }} inputDimensions * @returns {boolean} */ - - elementIsInViewport(inputDimensions) { if (inputDimensions.x < 0 || inputDimensions.y < 0 || inputDimensions.x + inputDimensions.width > document.documentElement.clientWidth || inputDimensions.y + inputDimensions.height > document.documentElement.clientHeight) { return false; } - const viewport = document.documentElement; - if (inputDimensions.x + inputDimensions.width > viewport.clientWidth || inputDimensions.y + inputDimensions.height > viewport.clientHeight) { return false; } - return true; } + /** * @param {{ x: number; y: number; } | null} click * @param {{ x: number; y: number; height: number; width: number; }} inputDimensions * @param {TopContextData} data */ - - async showTopTooltip(click, inputDimensions, data) { let diffX = inputDimensions.x; let diffY = inputDimensions.y; - if (click) { diffX -= click.x; diffY -= click.y; @@ -13491,20 +11701,16 @@ class OverlayUIController extends _UIController.UIController { // If the focus event is outside the viewport ignore, we've already tried to scroll to it return; } - if (!data.inputType) { throw new Error('No input type found'); } - const mainType = (0, _matching.getMainTypeFromType)(data.inputType); const subType = (0, _matching.getSubtypeFromType)(data.inputType); - if (mainType === 'unknown') { throw new Error('unreachable, should not be here if (mainType === "unknown")'); } - /** @type {GetAutofillDataRequest} */ - + /** @type {GetAutofillDataRequest} */ const details = { inputType: data.inputType, mainType, @@ -13518,32 +11724,25 @@ class OverlayUIController extends _UIController.UIController { inputWidth: Math.floor(inputDimensions.width) } }; - try { - _classPrivateFieldSet(this, _state, 'parentShown'); - + this.#state = 'parentShown'; this._attachListeners(); - await this._options.show(details); } catch (e) { console.error('could not show parent', e); - - _classPrivateFieldSet(this, _state, 'idle'); + this.#state = 'idle'; } } - _attachListeners() { window.addEventListener('scroll', this); window.addEventListener('keydown', this, true); window.addEventListener('input', this); } - _removeListeners() { window.removeEventListener('scroll', this); window.removeEventListener('keydown', this, true); window.removeEventListener('input', this); } - handleEvent(event) { switch (event.type) { case 'scroll': @@ -13551,7 +11750,6 @@ class OverlayUIController extends _UIController.UIController { this.removeTooltip(event.type); break; } - case 'keydown': { if (['Escape', 'Tab', 'Enter'].includes(event.code)) { @@ -13559,19 +11757,15 @@ class OverlayUIController extends _UIController.UIController { event.preventDefault(); event.stopImmediatePropagation(); } - this.removeTooltip(event.type); } - break; } - case 'input': { this.removeTooltip(event.type); break; } - case 'pointerdown': { this.removeTooltip(event.type); @@ -13579,41 +11773,31 @@ class OverlayUIController extends _UIController.UIController { } } } + /** * @param {string} trigger * @returns {Promise} */ - - async removeTooltip(trigger) { - var _this$_mutObs2; - // for none pointer events, check to see if the tooltip is open before trying to close it if (trigger !== 'pointerdown') { - if (_classPrivateFieldGet(this, _state) !== 'parentShown') { + if (this.#state !== 'parentShown') { return; } } - try { await this._options.remove(); } catch (e) { console.error('Could not close parent', e); } - - _classPrivateFieldSet(this, _state, 'idle'); - + this.#state = 'idle'; this._removeListeners(); - - (_this$_mutObs2 = this._mutObs) === null || _this$_mutObs2 === void 0 ? void 0 : _this$_mutObs2.disconnect(); + this._mutObs?.disconnect(); } - isActive() { - return _classPrivateFieldGet(this, _state) === 'parentShown'; + return this.#state === 'parentShown'; } - } - exports.OverlayUIController = OverlayUIController; },{"../../Form/matching.js":33,"./UIController.js":48}],48:[function(require,module,exports){ @@ -13623,7 +11807,6 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.UIController = void 0; - /** * @typedef AttachArgs The argument required to 'attach' a tooltip * @property {import("../../Form/Form").Form} form the Form that triggered this 'attach' call @@ -13661,55 +11844,44 @@ class UIController { * @param {TopContextData} _topContextData * @returns {any | null} */ - - createTooltip(_pos, _topContextData) {} /** * @param {string} _via */ - - removeTooltip(_via) {} + /** * Set the currently open HTMLTooltip instance * * @param {import("../HTMLTooltip.js").HTMLTooltip} _tooltip */ - - setActiveTooltip(_tooltip) {} + /** * Get the currently open HTMLTooltip instance, if one exists * * @returns {import("../HTMLTooltip.js").HTMLTooltip | null} */ - - getActiveTooltip() { return null; } + /** * Indicate whether the controller deems itself 'active' * * @returns {boolean} */ - - isActive() { return false; } + /** * Updates the items in the tooltip based on new data. Currently only supporting credentials. * @param {CredentialsObject[]} _data */ - - updateItems(_data) {} - destroy() {} - } - exports.UIController = UIController; },{}],49:[function(require,module,exports){ @@ -13719,20 +11891,13 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.ddgPasswordIconFocused = exports.ddgPasswordIconFilled = exports.ddgPasswordIconBaseWhite = exports.ddgPasswordIconBase = exports.ddgIdentityIconBase = exports.ddgCcIconFilled = exports.ddgCcIconBase = void 0; -const dd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4NzM1IDYuNzUsNS4zNzUgWiIgaWQ9IlNoYXBlIj48L3BhdGg+CiAgICAgICAgICAgIDwvZz4KICAgICAgICA8L2c+CiAgICA8L2c+Cjwvc3ZnPg=='; -exports.ddgPasswordIconFocused = ddgPasswordIconFocused; -const ddgCcIconBase = 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgZmlsbD0ibm9uZSI+CiAgICA8cGF0aCBkPSJNNSA5Yy0uNTUyIDAtMSAuNDQ4LTEgMXYyYzAgLjU1Mi40NDggMSAxIDFoM2MuNTUyIDAgMS0uNDQ4IDEtMXYtMmMwLS41NTItLjQ0OC0xLTEtMUg1eiIgZmlsbD0iIzAwMCIvPgogICAgPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xIDZjMC0yLjIxIDEuNzktNCA0LTRoMTRjMi4yMSAwIDQgMS43OSA0IDR2MTJjMCAyLjIxLTEuNzkgNC00IDRINWMtMi4yMSAwLTQtMS43OS00LTRWNnptNC0yYy0xLjEwNSAwLTIgLjg5NS0yIDJ2OWgxOFY2YzAtMS4xMDUtLjg5NS0yLTItMkg1em0wIDE2Yy0xLjEwNSAwLTItLjg5NS0yLTJoMThjMCAxLjEwNS0uODk1IDItMiAySDV6IiBmaWxsPSIjMDAwIi8+Cjwvc3ZnPgo='; -exports.ddgCcIconBase = ddgCcIconBase; -const ddgCcIconFilled = 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgZmlsbD0ibm9uZSI+CiAgICA8cGF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ItMkg1em0wIDE2Yy0xLjEwNSAwLTItLjg5NS0yLTJoMThjMCAxLjEwNS0uODk1IDItMiAySDV6IiBmaWxsPSIjMDAwIi8+Cjwvc3ZnPgo='; +const ddgCcIconFilled = exports.ddgCcIconFilled = 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgZmlsbD0ibm9uZSI+CiAgICA8cGF0aCBkPSJNNSA5Yy0uNTUyIDAtMSAuNDQ4LTEgMXYyYzAgLjU1Mi40NDggMSAxIDFoM2MuNTUyIDAgMS0uNDQ4IDEtMXYtMmMwLS41NTItLjQ0OC0xLTEtMUg1eiIgZmlsbD0iIzc2NDMxMCIvPgogICAgPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xIDZjMC0yLjIxIDEuNzktNCA0LTRoMTRjMi4yMSAwIDQgMS43OSA0IDR2MTJjMCAyLjIxLTEuNzkgNC00IDRINWMtMi4yMSAwLTQtMS43OS00LTRWNnptNC0yYy0xLjEwNSAwLTIgLjg5NS0yIDJ2OWgxOFY2YzAtMS4xMDUtLjg5NS0yLTItMkg1em0wIDE2Yy0xLjEwNSAwLTItLjg5NS0yLTJoMThjMCAxLjEwNS0uODk1IDItMiAySDV6IiBmaWxsPSIjNzY0MzEwIi8+Cjwvc3ZnPgo='; +const ddgIdentityIconBase = exports.ddgIdentityIconBase = `data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgZmlsbD0ibm9uZSI+CiAgICA8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTEyIDIxY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YgMS41NDYgMS4yNSAzLjUxNCAyIDUuNjU3IDJ6bTQuMzk3LTUuMDgzYy45NjcuNDIyIDEuODY2Ljk4IDIuNjcyIDEuNjU1QzIwLjI3OSAxNi4wMzkgMjEgMTQuMTA0IDIxIDEyYzAtNC45Ny00LjAzLTktOS05cy05IDQuMDMtOSA5YzAgMi4xMDQuNzIyIDQuMDQgMS45MzIgNS41NzIuODc0LS43MzQgMS44Ni0xLjMyOCAyLjkyMS0xLjc2IDEuMzYtLjU1NCAyLjgxNi0uODMgNC4yODMtLjgxMSAxLjQ2Ny4wMTggMi45MTYuMzMgNC4yNi45MTZ6TTEyIDIzYzYuMDc1IDAgMTEtNC45MjUgMTEtMTFTMTguMDc1IDEgMTIgMSAxIDUuOTI1IDEgMTJzNC45MjUgMTEgMTEgMTF6bTMtMTNjMCAxLjY1Ny0xLjM0MyAzLTMgM3MtMy0xLjM0My0zLTMgMS4zNDMtMyAzLTMgMyAxLjM0MyAzIDN6bTIgMGMwIDIuNzYxLTIuMjM5IDUtNSA1cy01LTIuMjM5LTUtNSAyLjIzOS01IDUtNSA1IDIuMjM5IDUgNXoiIGZpbGw9IiMwMDAiLz4KPC9zdmc+Cg==`; },{}],50:[function(require,module,exports){ "use strict"; @@ -13741,8 +11906,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.CSS_STYLES = void 0; -const CSS_STYLES = ":root {\n color-scheme: light dark;\n}\n\n.wrapper *, .wrapper *::before, .wrapper *::after {\n box-sizing: border-box;\n}\n.wrapper {\n position: fixed;\n top: 0;\n left: 0;\n padding: 0;\n font-family: 'DDG_ProximaNova', 'Proxima Nova', system-ui, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu',\n 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;\n -webkit-font-smoothing: antialiased;\n z-index: 2147483647;\n}\n.wrapper--data {\n font-family: 'SF Pro Text', system-ui, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu',\n 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;\n}\n:not(.top-autofill) .tooltip {\n position: absolute;\n width: 300px;\n max-width: calc(100vw - 25px);\n transform: translate(-1000px, -1000px);\n z-index: 2147483647;\n}\n.tooltip--data, #topAutofill {\n background-color: rgba(242, 240, 240, 1);\n -webkit-backdrop-filter: blur(40px);\n backdrop-filter: blur(40px);\n}\n@media (prefers-color-scheme: dark) {\n .tooltip--data, #topAutofill {\n background: rgb(100, 98, 102, .9);\n }\n}\n.tooltip--data {\n padding: 6px;\n font-size: 13px;\n line-height: 14px;\n width: 315px;\n max-height: 290px;\n overflow-y: auto;\n}\n.top-autofill .tooltip--data {\n min-height: 100vh;\n}\n.tooltip--data.tooltip--incontext-signup {\n width: 360px;\n}\n:not(.top-autofill) .tooltip--data {\n top: 100%;\n left: 100%;\n border: 0.5px solid rgba(255, 255, 255, 0.2);\n border-radius: 6px;\n box-shadow: 0 10px 20px rgba(0, 0, 0, 0.32);\n}\n@media (prefers-color-scheme: dark) {\n :not(.top-autofill) .tooltip--data {\n border: 1px solid rgba(255, 255, 255, 0.2);\n }\n}\n:not(.top-autofill) .tooltip--email {\n top: calc(100% + 6px);\n right: calc(100% - 48px);\n padding: 8px;\n border: 1px solid #D0D0D0;\n border-radius: 10px;\n background-color: #FFFFFF;\n font-size: 14px;\n line-height: 1.3;\n color: #333333;\n box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);\n}\n.tooltip--email__caret {\n position: absolute;\n transform: translate(-1000px, -1000px);\n z-index: 2147483647;\n}\n.tooltip--email__caret::before,\n.tooltip--email__caret::after {\n content: \"\";\n width: 0;\n height: 0;\n border-left: 10px solid transparent;\n border-right: 10px solid transparent;\n display: block;\n border-bottom: 8px solid #D0D0D0;\n position: absolute;\n right: -28px;\n}\n.tooltip--email__caret::before {\n border-bottom-color: #D0D0D0;\n top: -1px;\n}\n.tooltip--email__caret::after {\n border-bottom-color: #FFFFFF;\n top: 0px;\n}\n\n/* Buttons */\n.tooltip__button {\n display: flex;\n width: 100%;\n padding: 8px 8px 8px 0px;\n font-family: inherit;\n color: inherit;\n background: transparent;\n border: none;\n border-radius: 6px;\n}\n.tooltip__button.currentFocus,\n.wrapper:not(.top-autofill) .tooltip__button:hover {\n background-color: #3969EF;\n color: #FFFFFF;\n}\n\n/* Data autofill tooltip specific */\n.tooltip__button--data {\n position: relative;\n min-height: 48px;\n flex-direction: row;\n justify-content: flex-start;\n font-size: inherit;\n font-weight: 500;\n line-height: 16px;\n text-align: left;\n border-radius: 3px;\n}\n.tooltip--data__item-container {\n max-height: 220px;\n overflow: auto;\n}\n.tooltip__button--data:first-child {\n margin-top: 0;\n}\n.tooltip__button--data:last-child {\n margin-bottom: 0;\n}\n.tooltip__button--data::before {\n content: '';\n flex-shrink: 0;\n display: block;\n width: 32px;\n height: 32px;\n margin: 0 8px;\n background-size: 20px 20px;\n background-repeat: no-repeat;\n background-position: center 6px;\n}\n#provider_locked::after {\n position: absolute;\n content: '';\n flex-shrink: 0;\n display: block;\n width: 32px;\n height: 32px;\n margin: 0 8px;\n background-size: 11px 13px;\n background-repeat: no-repeat;\n background-position: right bottom;\n}\n.tooltip__button--data.currentFocus:not(.tooltip__button--data--bitwarden)::before,\n.wrapper:not(.top-autofill) .tooltip__button--data:not(.tooltip__button--data--bitwarden):hover::before {\n filter: invert(100%);\n}\n@media (prefers-color-scheme: dark) {\n .tooltip__button--data:not(.tooltip__button--data--bitwarden)::before,\n .tooltip__button--data:not(.tooltip__button--data--bitwarden)::before {\n filter: invert(100%);\n opacity: .9;\n }\n}\n.tooltip__button__text-container {\n margin: auto 0;\n}\n.label {\n display: block;\n font-weight: 400;\n letter-spacing: -0.25px;\n color: rgba(0,0,0,.8);\n font-size: 13px;\n line-height: 1;\n}\n.label + .label {\n margin-top: 2px;\n}\n.label.label--medium {\n font-weight: 500;\n letter-spacing: -0.25px;\n color: rgba(0,0,0,.9);\n}\n.label.label--small {\n font-size: 11px;\n font-weight: 400;\n letter-spacing: 0.06px;\n color: rgba(0,0,0,0.6);\n}\n@media (prefers-color-scheme: dark) {\n .tooltip--data .label {\n color: #ffffff;\n }\n .tooltip--data .label--medium {\n color: #ffffff;\n }\n .tooltip--data .label--small {\n color: #cdcdcd;\n }\n}\n.tooltip__button.currentFocus .label,\n.wrapper:not(.top-autofill) .tooltip__button:hover .label {\n color: #FFFFFF;\n}\n\n.tooltip__button--manage {\n font-size: 13px;\n padding: 5px 9px;\n border-radius: 3px;\n margin: 0;\n}\n\n/* Icons */\n.tooltip__button--data--credentials::before {\n background-image: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik05LjYzNiA4LjY4MkM5LjYzNiA1LjU0NCAxMi4xOCAzIDE1LjMxOCAzIDE4LjQ1NiAzIDIxIDUuNTQ0IDIxIDguNjgyYzAgMy4xMzgtMi41NDQgNS42ODItNS42ODIgNS42ODItLjY5MiAwLTEuMzUzLS4xMjQtMS45NjQtLjM0OS0uMzcyLS4xMzctLjc5LS4wNDEtMS4wNjYuMjQ1bC0uNzEzLjc0SDEwYy0uNTUyIDAtMSAuNDQ4LTEgMXYySDdjLS41NTIgMC0xIC40NDgtMSAxdjJIM3YtMi44ODFsNi42NjgtNi42NjhjLjI2NS0uMjY2LjM2LS42NTguMjQ0LTEuMDE1LS4xNzktLjU1MS0uMjc2LTEuMTQtLjI3Ni0xLjc1NHpNMTUuMzE4IDFjLTQuMjQyIDAtNy42ODIgMy40NC03LjY4MiA3LjY4MiAwIC42MDcuMDcxIDEuMi4yMDUgMS43NjdsLTYuNTQ4IDYuNTQ4Yy0uMTg4LjE4OC0uMjkzLjQ0Mi0uMjkzLjcwOFYyMmMwIC4yNjUuMTA1LjUyLjI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S42MTczMiA2LjEwNjM3IDEuNDk4MTcgNi4yMzQ0NiAxLjM5NTc4IDYuMzc2NzhDMS4xMzkyNiA2LjczMzM1IDEuMDAwODUgNy4xNjEzMSAxIDcuNjAwNTdaTTQuOTY4NyA0Ljk2ODdDNS4wMjY5NCA0LjkxMDQ3IDUuMTA1MzIgNC44NzY5OSA1LjE4NzUgNC44NzUwN0M1LjI2OTY4IDQuODc2OTkgNS4zNDgwNiA0LjkxMDQ3IDUuNDA2MyA0Ljk2ODdDNS40NjU0MiA1LjAyNzgzIDUuNDk5MDQgNS4xMDc3NCA1LjUgNS4xOTEzVjUuNUg0Ljg3NVY1LjE5MTNDNC44NzU5NiA1LjEwNzc0IDQuOTA5NTggNS4wMjc4MyA0Ljk2ODcgNC45Njg3WiIgZmlsbD0iIzIyMjIyMiIgc3Ryb2tlPSJ3aGl0ZSIgc3Ryb2tlLXdpZHRoPSIyIi8+Cjwvc3ZnPgo=');\n}\n\nhr {\n display: block;\n margin: 5px 9px;\n border: none; /* reset the border */\n border-top: 1px solid rgba(0,0,0,.1);\n}\n\nhr:first-child {\n display: none;\n}\n\n@media (prefers-color-scheme: dark) {\n hr {\n border-top: 1px solid rgba(255,255,255,.2);\n }\n}\n\n#privateAddress {\n align-items: flex-start;\n}\n#personalAddress::before,\n#privateAddress::before,\n#incontextSignup::before,\n#personalAddress.currentFocus::before,\n#personalAddress:hover::before,\n#privateAddress.currentFocus::before,\n#privateAddress:hover::before {\n filter: none;\n /* This is the same icon as `daxBase64` in `src/Form/logo-svg.js` */\n background-image: url('data:image/svg+xml;base64,PHN2ZyBmaWxsPSJub25lIiB2aWV3Qm94PSIwIDAgMTI4IDEyOCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICAgIDxwYXRoIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0ibTY0IDEyOGMzNS4zNDYgMCA2NC0yOC42NTQgNjQtNjRzLTI4LjY1NC02NC02NC02NC02NCAyOC42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ZW5vZGQiLz4KPC9zdmc+');\n}\n\n/* Email tooltip specific */\n.tooltip__button--email {\n flex-direction: column;\n justify-content: center;\n align-items: flex-start;\n font-size: 14px;\n padding: 4px 8px;\n}\n.tooltip__button--email__primary-text {\n font-weight: bold;\n}\n.tooltip__button--email__secondary-text {\n font-size: 12px;\n}\n\n/* Email Protection signup notice */\n:not(.top-autofill) .tooltip--email-signup {\n text-align: left;\n color: #222222;\n padding: 16px 20px;\n width: 380px;\n}\n\n.tooltip--email-signup h1 {\n font-weight: 700;\n font-size: 16px;\n line-height: 1.5;\n margin: 0;\n}\n\n.tooltip--email-signup p {\n font-weight: 400;\n font-size: 14px;\n line-height: 1.4;\n}\n\n.notice-controls {\n display: flex;\n}\n\n.tooltip--email-signup .notice-controls > * {\n border-radius: 8px;\n border: 0;\n cursor: pointer;\n display: inline-block;\n font-family: inherit;\n font-style: normal;\n font-weight: bold;\n padding: 8px 12px;\n text-decoration: none;\n}\n\n.notice-controls .ghost {\n margin-left: 1rem;\n}\n\n.tooltip--email-signup a.primary {\n background: #3969EF;\n color: #fff;\n}\n\n.tooltip--email-signup a.primary:hover,\n.tooltip--email-signup a.primary:focus {\n background: #2b55ca;\n}\n\n.tooltip--email-signup a.primary:active {\n background: #1e42a4;\n}\n\n.tooltip--email-signup button.ghost {\n background: transparent;\n color: #3969EF;\n}\n\n.tooltip--email-signup button.ghost:hover,\n.tooltip--email-signup button.ghost:focus {\n background-color: rgba(0, 0, 0, 0.06);\n color: #2b55ca;\n}\n\n.tooltip--email-signup button.ghost:active {\n background-color: rgba(0, 0, 0, 0.12);\n color: #1e42a4;\n}\n\n.tooltip--email-signup button.close-tooltip {\n background-color: transparent;\n background-image: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iMTMiIHZpZXdCb3g9IjAgMCAxMiAxMyIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0wLjI5Mjg5NCAwLjY1NjkwN0MwLjY4MzQxOCAwLjI2NjM4MyAxLjMxNjU4IDAuMjY2MzgzIDEuNzA3MTEgMC42NTY5MDdMNiA0Ljk0OThMMTAuMjkyOSAwLjY1NjkwN0MxMC42ODM0IDAuMjY2MzgzIDExLjMxNjYgMC4yNjYzODMgMTEuNzA3MSAwLjY1NjkwN0MxMi4wOTc2IDEuMDQ3NDMgMTIuMDk3NiAxLjY4MDYgMTEuNzA3MSAyLjA3MTEyTDcuNDE0MjEgNi4zNjQwMUwxMS43MDcxIDEwLjY1NjlDMTIuMDk3NiAxMS4wNDc0IDEyLjA5NzYgMTEuNjgwNiAxMS43MDcxIDEyLjA3MTFDMTEuMzE2NiAxMi40NjE2IDEwLjY4MzQgMTIuNDYxNiAxMC4yOTI5IDEyLjA3MTFMNiA3Ljc3ODIzTDEuNzA3MTEgMTIuMDcxMUMxLjMxNjU4IDEyLjQ2MTYgMC42ODM0MTcgMTIuNDYxNiAwLjI5Mjg5MyAxMi4wNzExQy0wLjA5NzYzMTEgMTEuNjgwNiAtMC4wOTc2MzExIDExLjA0NzQgMC4yOTI4OTMgMTAuNjU2OUw0LjU4NTc5IDYuMzY0MDFMMC4yOTI4OTQgMi4wNzExMkMtMC4wOTc2MzA2IDEuNjgwNiAtMC4wOTc2MzA2IDEuMDQ3NDMgMC4yOTI4OTQgMC42NTY5MDdaIiBmaWxsPSJibGFjayIgZmlsbC1vcGFjaXR5PSIwLjg0Ii8+Cjwvc3ZnPgo=);\n background-position: center center;\n background-repeat: no-repeat;\n border: 0;\n cursor: pointer;\n padding: 16px;\n position: absolute;\n right: 12px;\n top: 12px;\n}\n"; -exports.CSS_STYLES = CSS_STYLES; +const CSS_STYLES = exports.CSS_STYLES = ":root {\n color-scheme: light dark;\n}\n\n.wrapper *, .wrapper *::before, .wrapper *::after {\n box-sizing: border-box;\n}\n.wrapper {\n position: fixed;\n top: 0;\n left: 0;\n padding: 0;\n font-family: 'DDG_ProximaNova', 'Proxima Nova', system-ui, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu',\n 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;\n -webkit-font-smoothing: antialiased;\n z-index: 2147483647;\n}\n.wrapper--data {\n font-family: 'SF Pro Text', system-ui, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu',\n 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;\n}\n:not(.top-autofill) .tooltip {\n position: absolute;\n width: 300px;\n max-width: calc(100vw - 25px);\n transform: translate(-1000px, -1000px);\n z-index: 2147483647;\n}\n.tooltip--data, #topAutofill {\n background-color: rgba(242, 240, 240, 1);\n -webkit-backdrop-filter: blur(40px);\n backdrop-filter: blur(40px);\n}\n@media (prefers-color-scheme: dark) {\n .tooltip--data, #topAutofill {\n background: rgb(100, 98, 102, .9);\n }\n}\n.tooltip--data {\n padding: 6px;\n font-size: 13px;\n line-height: 14px;\n width: 315px;\n max-height: 290px;\n overflow-y: auto;\n}\n.top-autofill .tooltip--data {\n min-height: 100vh;\n}\n.tooltip--data.tooltip--incontext-signup {\n width: 360px;\n}\n:not(.top-autofill) .tooltip--data {\n top: 100%;\n left: 100%;\n border: 0.5px solid rgba(255, 255, 255, 0.2);\n border-radius: 6px;\n box-shadow: 0 10px 20px rgba(0, 0, 0, 0.32);\n}\n@media (prefers-color-scheme: dark) {\n :not(.top-autofill) .tooltip--data {\n border: 1px solid rgba(255, 255, 255, 0.2);\n }\n}\n:not(.top-autofill) .tooltip--email {\n top: calc(100% + 6px);\n right: calc(100% - 48px);\n padding: 8px;\n border: 1px solid #D0D0D0;\n border-radius: 10px;\n background-color: #FFFFFF;\n font-size: 14px;\n line-height: 1.3;\n color: #333333;\n box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);\n}\n.tooltip--email__caret {\n position: absolute;\n transform: translate(-1000px, -1000px);\n z-index: 2147483647;\n}\n.tooltip--email__caret::before,\n.tooltip--email__caret::after {\n content: \"\";\n width: 0;\n height: 0;\n border-left: 10px solid transparent;\n border-right: 10px solid transparent;\n display: block;\n border-bottom: 8px solid #D0D0D0;\n position: absolute;\n right: -28px;\n}\n.tooltip--email__caret::before {\n border-bottom-color: #D0D0D0;\n top: -1px;\n}\n.tooltip--email__caret::after {\n border-bottom-color: #FFFFFF;\n top: 0px;\n}\n\n/* Buttons */\n.tooltip__button {\n display: flex;\n width: 100%;\n padding: 8px 8px 8px 0px;\n font-family: inherit;\n color: inherit;\n background: transparent;\n border: none;\n border-radius: 6px;\n}\n.tooltip__button.currentFocus,\n.wrapper:not(.top-autofill) .tooltip__button:hover {\n background-color: #3969EF;\n color: #FFFFFF;\n}\n\n/* Data autofill tooltip specific */\n.tooltip__button--data {\n position: relative;\n min-height: 48px;\n flex-direction: row;\n justify-content: flex-start;\n font-size: inherit;\n font-weight: 500;\n line-height: 16px;\n text-align: left;\n border-radius: 3px;\n}\n.tooltip--data__item-container {\n max-height: 220px;\n overflow: auto;\n}\n.tooltip__button--data:first-child {\n margin-top: 0;\n}\n.tooltip__button--data:last-child {\n margin-bottom: 0;\n}\n.tooltip__button--data::before {\n content: '';\n flex-shrink: 0;\n display: block;\n width: 32px;\n height: 32px;\n margin: 0 8px;\n background-size: 20px 20px;\n background-repeat: no-repeat;\n background-position: center 6px;\n}\n#provider_locked::after {\n position: absolute;\n content: '';\n flex-shrink: 0;\n display: block;\n width: 32px;\n height: 32px;\n margin: 0 8px;\n background-size: 11px 13px;\n background-repeat: no-repeat;\n background-position: right bottom;\n}\n.tooltip__button--data.currentFocus:not(.tooltip__button--data--bitwarden)::before,\n.wrapper:not(.top-autofill) .tooltip__button--data:not(.tooltip__button--data--bitwarden):hover::before {\n filter: invert(100%);\n}\n@media (prefers-color-scheme: dark) {\n .tooltip__button--data:not(.tooltip__button--data--bitwarden)::before,\n .tooltip__button--data:not(.tooltip__button--data--bitwarden)::before {\n filter: invert(100%);\n opacity: .9;\n }\n}\n.tooltip__button__text-container {\n margin: auto 0;\n}\n.label {\n display: block;\n font-weight: 400;\n letter-spacing: -0.25px;\n color: rgba(0,0,0,.8);\n font-size: 13px;\n line-height: 1;\n}\n.label + .label {\n margin-top: 2px;\n}\n.label.label--medium {\n font-weight: 500;\n letter-spacing: -0.25px;\n color: rgba(0,0,0,.9);\n}\n.label.label--small {\n font-size: 11px;\n font-weight: 400;\n letter-spacing: 0.06px;\n color: rgba(0,0,0,0.6);\n}\n@media (prefers-color-scheme: dark) {\n .tooltip--data .label {\n color: #ffffff;\n }\n .tooltip--data .label--medium {\n color: #ffffff;\n }\n .tooltip--data .label--small {\n color: #cdcdcd;\n }\n}\n.tooltip__button.currentFocus .label,\n.wrapper:not(.top-autofill) .tooltip__button:hover .label {\n color: #FFFFFF;\n}\n\n.tooltip__button--manage {\n font-size: 13px;\n padding: 5px 9px;\n border-radius: 3px;\n margin: 0;\n}\n\n/* Icons */\n.tooltip__button--data--credentials::before {\n background-image: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik05LjYzNiA4LjY4MkM5LjYzNiA1LjU0NCAxMi4xOCAzIDE1LjMxOCAzIDE4LjQ1NiAzIDIxIDUuNTQ0IDIxIDguNjgyYzAgMy4xMzgtMi41NDQgNS42ODItNS42ODIgNS42ODItLjY5MiAwLTEuMzUzLS4xMjQtMS45NjQtLjM0OS0uMzcyLS4xMzctLjc5LS4wNDEtMS4wNjYuMjQ1bC0uNzEzLjc0SDEwYy0uNTUyIDAtMSAuNDQ4LTEgMXYySDdjLS41NTIgMC0xIC40NDgtMSAxdjJIM3YtMi44ODFsNi42NjgtNi42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NSA1Ljk5NDg5VjUuMTg3NUM4LjYyNSA0LjI3NTgyIDguMjYyODQgMy40MDE0OCA3LjYxODE4IDIuNzU2ODJDNi45NzM1MiAyLjExMjE2IDYuMDk5MTggMS43NSA1LjE4NzUgMS43NUM0LjI3NTgyIDEuNzUgMy40MDE0OCAyLjExMjE2IDIuNzU2ODIgMi43NTY4MkMyLjExMjE2IDMuNDAxNDggMS43NSA0LjI3NTgyIDEuNzUgNS4xODc1VjUuOTk0ODlDMS42MTczMiA2LjEwNjM3IDEuNDk4MTcgNi4yMzQ0NiAxLjM5NTc4IDYuMzc2NzhDMS4xMzkyNiA2LjczMzM1IDEuMDAwODUgNy4xNjEzMSAxIDcuNjAwNTdaTTQuOTY4NyA0Ljk2ODdDNS4wMjY5NCA0LjkxMDQ3IDUuMTA1MzIgNC44NzY5OSA1LjE4NzUgNC44NzUwN0M1LjI2OTY4IDQuODc2OTkgNS4zNDgwNiA0LjkxMDQ3IDUuNDA2MyA0Ljk2ODdDNS40NjU0MiA1LjAyNzgzIDUuNDk5MDQgNS4xMDc3NCA1LjUgNS4xOTEzVjUuNUg0Ljg3NVY1LjE5MTNDNC44NzU5NiA1LjEwNzc0IDQuOTA5NTggNS4wMjc4MyA0Ljk2ODcgNC45Njg3WiIgZmlsbD0iIzIyMjIyMiIgc3Ryb2tlPSJ3aGl0ZSIgc3Ryb2tlLXdpZHRoPSIyIi8+Cjwvc3ZnPgo=');\n}\n\nhr {\n display: block;\n margin: 5px 9px;\n border: none; /* reset the border */\n border-top: 1px solid rgba(0,0,0,.1);\n}\n\nhr:first-child {\n display: none;\n}\n\n@media (prefers-color-scheme: dark) {\n hr {\n border-top: 1px solid rgba(255,255,255,.2);\n }\n}\n\n#privateAddress {\n align-items: flex-start;\n}\n#personalAddress::before,\n#privateAddress::before,\n#incontextSignup::before,\n#personalAddress.currentFocus::before,\n#personalAddress:hover::before,\n#privateAddress.currentFocus::before,\n#privateAddress:hover::before {\n filter: none;\n /* This is the same icon as `daxBase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UtNTMuNzUgMjQuMDY1LTUzLjc1IDUzLjc1IDI0LjA2NSA1My43NSA1My43NSA1My43NXptMCA1YzMyLjQ0NyAwIDU4Ljc1LTI2LjMwMyA1OC43NS01OC43NXMtMjYuMzAzLTU4Ljc1LTU4Ljc1LTU4Ljc1LTU4Ljc1IDI2LjMwMy01OC43NSA1OC43NSAyNi4zMDMgNTguNzUgNTguNzUgNTguNzV6IiBmaWxsPSIjZmZmIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiLz4KPC9zdmc+');\n}\n\n/* Email tooltip specific */\n.tooltip__button--email {\n flex-direction: column;\n justify-content: center;\n align-items: flex-start;\n font-size: 14px;\n padding: 4px 8px;\n}\n.tooltip__button--email__primary-text {\n font-weight: bold;\n}\n.tooltip__button--email__secondary-text {\n font-size: 12px;\n}\n\n/* Email Protection signup notice */\n:not(.top-autofill) .tooltip--email-signup {\n text-align: left;\n color: #222222;\n padding: 16px 20px;\n width: 380px;\n}\n\n.tooltip--email-signup h1 {\n font-weight: 700;\n font-size: 16px;\n line-height: 1.5;\n margin: 0;\n}\n\n.tooltip--email-signup p {\n font-weight: 400;\n font-size: 14px;\n line-height: 1.4;\n}\n\n.notice-controls {\n display: flex;\n}\n\n.tooltip--email-signup .notice-controls > * {\n border-radius: 8px;\n border: 0;\n cursor: pointer;\n display: inline-block;\n font-family: inherit;\n font-style: normal;\n font-weight: bold;\n padding: 8px 12px;\n text-decoration: none;\n}\n\n.notice-controls .ghost {\n margin-left: 1rem;\n}\n\n.tooltip--email-signup a.primary {\n background: #3969EF;\n color: #fff;\n}\n\n.tooltip--email-signup a.primary:hover,\n.tooltip--email-signup a.primary:focus {\n background: #2b55ca;\n}\n\n.tooltip--email-signup a.primary:active {\n background: #1e42a4;\n}\n\n.tooltip--email-signup button.ghost {\n background: transparent;\n color: #3969EF;\n}\n\n.tooltip--email-signup button.ghost:hover,\n.tooltip--email-signup button.ghost:focus {\n background-color: rgba(0, 0, 0, 0.06);\n color: #2b55ca;\n}\n\n.tooltip--email-signup button.ghost:active {\n background-color: rgba(0, 0, 0, 0.12);\n color: #1e42a4;\n}\n\n.tooltip--email-signup button.close-tooltip {\n background-color: transparent;\n background-image: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iMTMiIHZpZXdCb3g9IjAgMCAxMiAxMyIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0wLjI5Mjg5NCAwLjY1NjkwN0MwLjY4MzQxOCAwLjI2NjM4MyAxLjMxNjU4IDAuMjY2MzgzIDEuNzA3MTEgMC42NTY5MDdMNiA0Ljk0OThMMTAuMjkyOSAwLjY1NjkwN0MxMC42ODM0IDAuMjY2MzgzIDExLjMxNjYgMC4yNjYzODMgMTEuNzA3MSAwLjY1NjkwN0MxMi4wOTc2IDEuMDQ3NDMgMTIuMDk3NiAxLjY4MDYgMTEuNzA3MSAyLjA3MTEyTDcuNDE0MjEgNi4zNjQwMUwxMS43MDcxIDEwLjY1NjlDMTIuMDk3NiAxMS4wNDc0IDEyLjA5NzYgMTEuNjgwNiAxMS43MDcxIDEyLjA3MTFDMTEuMzE2NiAxMi40NjE2IDEwLjY4MzQgMTIuNDYxNiAxMC4yOTI5IDEyLjA3MTFMNiA3Ljc3ODIzTDEuNzA3MTEgMTIuMDcxMUMxLjMxNjU4IDEyLjQ2MTYgMC42ODM0MTcgMTIuNDYxNiAwLjI5Mjg5MyAxMi4wNzExQy0wLjA5NzYzMTEgMTEuNjgwNiAtMC4wOTc2MzExIDExLjA0NzQgMC4yOTI4OTMgMTAuNjU2OUw0LjU4NTc5IDYuMzY0MDFMMC4yOTI4OTQgMi4wNzExMkMtMC4wOTc2MzA2IDEuNjgwNiAtMC4wOTc2MzA2IDEuMDQ3NDMgMC4yOTI4OTQgMC42NTY5MDdaIiBmaWxsPSJibGFjayIgZmlsbC1vcGFjaXR5PSIwLjg0Ii8+Cjwvc3ZnPgo=);\n background-position: center center;\n background-repeat: no-repeat;\n border: 0;\n cursor: pointer;\n padding: 16px;\n position: absolute;\n right: 12px;\n top: 12px;\n}\n"; },{}],51:[function(require,module,exports){ "use strict"; @@ -13765,15 +11929,12 @@ exports.shouldLogPerformance = shouldLogPerformance; exports.truncateFromMiddle = truncateFromMiddle; exports.wasAutofilledByChrome = void 0; exports.whenIdle = whenIdle; - var _matching = require("./Form/matching.js"); - -const SIGN_IN_MSG = { +const SIGN_IN_MSG = exports.SIGN_IN_MSG = { signMeIn: true -}; // Send a message to the web app (only on DDG domains) - -exports.SIGN_IN_MSG = SIGN_IN_MSG; +}; +// Send a message to the web app (only on DDG domains) const notifyWebApp = message => { window.postMessage(message, window.origin); }; @@ -13783,17 +11944,13 @@ const notifyWebApp = message => { * @param {String} expectedResponse - the name of the response * @returns {Promise<*>} */ - - exports.notifyWebApp = notifyWebApp; - const sendAndWaitForAnswer = (msgOrFn, expectedResponse) => { if (typeof msgOrFn === 'function') { msgOrFn(); } else { window.postMessage(msgOrFn, window.origin); } - return new Promise(resolve => { const handler = e => { if (e.origin !== window.origin) return; @@ -13801,71 +11958,59 @@ const sendAndWaitForAnswer = (msgOrFn, expectedResponse) => { resolve(e.data); window.removeEventListener('message', handler); }; - window.addEventListener('message', handler); }); }; + /** * @param {Pick} globalConfig * @param [processConfig] * @return {boolean} - */ - - + */ exports.sendAndWaitForAnswer = sendAndWaitForAnswer; - const autofillEnabled = (globalConfig, processConfig) => { if (!globalConfig.contentScope) { // Return enabled for platforms that haven't implemented the config yet return true; } - const { contentScope, userUnprotectedDomains, userPreferences - } = globalConfig; // Check config on Apple platforms + } = globalConfig; + // Check config on Apple platforms const processedConfig = processConfig(contentScope, userUnprotectedDomains, userPreferences); return isAutofillEnabledFromProcessedConfig(processedConfig); }; - exports.autofillEnabled = autofillEnabled; - const isAutofillEnabledFromProcessedConfig = processedConfig => { const site = processedConfig.site; - if (site.isBroken || !site.enabledFeatures.includes('autofill')) { if (shouldLog()) { console.log('⚠️ Autofill disabled by remote config'); } - return false; } - return true; }; - exports.isAutofillEnabledFromProcessedConfig = isAutofillEnabledFromProcessedConfig; - const isIncontextSignupEnabledFromProcessedConfig = processedConfig => { const site = processedConfig.site; - if (site.isBroken || !site.enabledFeatures.includes('incontextSignup')) { if (shouldLog()) { console.log('⚠️ In-context signup disabled by remote config'); } - return false; } - return true; -}; // Access the original setter (needed to bypass React's implementation on mobile) -// @ts-ignore - +}; +// Access the original setter (needed to bypass React's implementation on mobile) +// @ts-ignore exports.isIncontextSignupEnabledFromProcessedConfig = isIncontextSignupEnabledFromProcessedConfig; const originalSet = Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype, 'value').set; + /** * Ensures the value is set properly and dispatches events to simulate real user action * @param {HTMLInputElement} el @@ -13873,39 +12018,38 @@ const originalSet = Object.getOwnPropertyDescriptor(window.HTMLInputElement.prot * @param {GlobalConfig} [config] * @return {boolean} */ - const setValueForInput = (el, val, config) => { // Avoid keyboard flashing on Android - if (!(config !== null && config !== void 0 && config.isAndroid)) { + if (!config?.isAndroid) { el.focus(); - } // todo(Shane): Not sending a 'key' property on these events can cause exceptions on 3rd party listeners that expect it - + } + // todo(Shane): Not sending a 'key' property on these events can cause exceptions on 3rd party listeners that expect it el.dispatchEvent(new Event('keydown', { bubbles: true })); - originalSet === null || originalSet === void 0 ? void 0 : originalSet.call(el, val); + originalSet?.call(el, val); const events = [new Event('input', { bubbles: true - }), // todo(Shane): Not sending a 'key' property on these events can cause exceptions on 3rd party listeners that expect it + }), + // todo(Shane): Not sending a 'key' property on these events can cause exceptions on 3rd party listeners that expect it new Event('keyup', { bubbles: true }), new Event('change', { bubbles: true })]; - events.forEach(ev => el.dispatchEvent(ev)); // We call this again to make sure all forms are happy - - originalSet === null || originalSet === void 0 ? void 0 : originalSet.call(el, val); + events.forEach(ev => el.dispatchEvent(ev)); + // We call this again to make sure all forms are happy + originalSet?.call(el, val); events.forEach(ev => el.dispatchEvent(ev)); el.blur(); return true; }; + /** * Fires events on a select element to simulate user interaction * @param {HTMLSelectElement} el */ - - const fireEventsOnSelect = el => { /** @type {Event[]} */ const events = [new Event('mousedown', { @@ -13916,12 +12060,14 @@ const fireEventsOnSelect = el => { bubbles: true }), new Event('change', { bubbles: true - })]; // Events fire on the select el, not option + })]; + // Events fire on the select el, not option events.forEach(ev => el.dispatchEvent(ev)); events.forEach(ev => el.dispatchEvent(ev)); el.blur(); }; + /** * Selects an option of a select element * We assume Select is only used for dates, i.e. in the credit card @@ -13929,25 +12075,22 @@ const fireEventsOnSelect = el => { * @param {string} val * @return {boolean} */ - - const setValueForSelect = (el, val) => { const subtype = (0, _matching.getInputSubtype)(el); const isMonth = subtype.includes('Month'); const isZeroBasedNumber = isMonth && el.options[0].value === '0' && el.options.length === 12; const stringVal = String(val); - const numberVal = Number(val); // Loop first through all values because they tend to be more precise + const numberVal = Number(val); + // Loop first through all values because they tend to be more precise for (const option of el.options) { // If values for months are zero-based (Jan === 0), add one to match our data type let value = option.value; - if (isZeroBasedNumber) { - value = "".concat(Number(value) + 1); - } // TODO: try to match localised month names + value = `${Number(value) + 1}`; + } + // TODO: try to match localised month names // TODO: implement alternative versions of values (abbreviations for States/Provinces or variations like USA, US, United States, etc.) - - if (value === stringVal || Number(value) === numberVal) { if (option.selected) return false; option.selected = true; @@ -13955,7 +12098,6 @@ const setValueForSelect = (el, val) => { return true; } } - for (const option of el.options) { if (option.innerText === stringVal || Number(option.innerText) === numberVal) { if (option.selected) return false; @@ -13963,11 +12105,11 @@ const setValueForSelect = (el, val) => { fireEventsOnSelect(el); return true; } - } // If we didn't find a matching option return false - - + } + // If we didn't find a matching option return false return false; }; + /** * Sets or selects a value to a form element * @param {HTMLInputElement | HTMLSelectElement} el @@ -13975,24 +12117,19 @@ const setValueForSelect = (el, val) => { * @param {GlobalConfig} [config] * @return {boolean} */ - - const setValue = (el, val, config) => { if (el instanceof HTMLInputElement) return setValueForInput(el, val, config); if (el instanceof HTMLSelectElement) return setValueForSelect(el, val); return false; }; + /** * Use IntersectionObserver v2 to make sure the element is visible when clicked * https://developers.google.com/web/updates/2019/02/intersectionobserver-v2 */ - - exports.setValue = setValue; - const safeExecute = function (el, fn) { let _opts = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; - // TODO: temporary fix to misterious bug in Chrome // const {checkVisibility = true} = opts const intObs = new IntersectionObserver(changes => { @@ -14002,7 +12139,6 @@ const safeExecute = function (el, fn) { // The browser doesn't support Intersection Observer v2, falling back to v1 behavior. change.isVisible = true; } - if (change.isIntersecting) { /** * If 'checkVisibility' is 'false' (like on Windows), then we always execute the function @@ -14015,7 +12151,6 @@ const safeExecute = function (el, fn) { fn(); } } - intObs.disconnect(); }, { trackVisibility: true, @@ -14023,15 +12158,13 @@ const safeExecute = function (el, fn) { }); intObs.observe(el); }; + /** * Checks that an element is potentially viewable (even if off-screen) * @param {HTMLElement} el * @return {boolean} */ - - exports.safeExecute = safeExecute; - const isPotentiallyViewable = el => { const computedStyle = window.getComputedStyle(el); const opacity = parseFloat(computedStyle.getPropertyValue('opacity') || '1'); @@ -14039,15 +12172,13 @@ const isPotentiallyViewable = el => { const opacityThreshold = 0.6; return el.clientWidth !== 0 && el.clientHeight !== 0 && opacity > opacityThreshold && visibility !== 'hidden'; }; + /** * Gets the bounding box of the icon * @param {HTMLInputElement} input * @returns {{top: number, left: number, bottom: number, width: number, x: number, y: number, right: number, height: number}} */ - - exports.isPotentiallyViewable = isPotentiallyViewable; - const getDaxBoundingBox = input => { const { right: inputRight, @@ -14072,16 +12203,14 @@ const getDaxBoundingBox = input => { y: top }; }; + /** * Check if a mouse event is within the icon * @param {MouseEvent} e * @param {HTMLInputElement} input * @returns {boolean} */ - - exports.getDaxBoundingBox = getDaxBoundingBox; - const isEventWithinDax = (e, input) => { const { left, @@ -14093,50 +12222,40 @@ const isEventWithinDax = (e, input) => { const withinY = e.clientY >= top && e.clientY <= bottom; return withinX && withinY; }; + /** * Adds inline styles from a prop:value object * @param {HTMLElement} el * @param {Object} styles */ - - exports.isEventWithinDax = isEventWithinDax; - const addInlineStyles = (el, styles) => Object.entries(styles).forEach(_ref => { let [property, val] = _ref; return el.style.setProperty(property, val, 'important'); }); + /** * Removes inline styles from a prop:value object * @param {HTMLElement} el * @param {Object} styles */ - - exports.addInlineStyles = addInlineStyles; - const removeInlineStyles = (el, styles) => Object.keys(styles).forEach(property => el.style.removeProperty(property)); - exports.removeInlineStyles = removeInlineStyles; -const ADDRESS_DOMAIN = '@duck.com'; +const ADDRESS_DOMAIN = exports.ADDRESS_DOMAIN = '@duck.com'; /** * Given a username, returns the full email address * @param {string} address * @returns {string} */ - -exports.ADDRESS_DOMAIN = ADDRESS_DOMAIN; - const formatDuckAddress = address => address + ADDRESS_DOMAIN; + /** * Escapes any occurrences of &, ", <, > or / with XML entities. * @param {string} str The string to escape. * @return {string} The escaped string. */ - - exports.formatDuckAddress = formatDuckAddress; - function escapeXML(str) { const replacements = { '&': '&', @@ -14148,38 +12267,38 @@ function escapeXML(str) { }; return String(str).replace(/[&"'<>/]/g, m => replacements[m]); } + /** * Determines if an element is likely to be a submit button * @param {HTMLElement} el A button, input, anchor or other element with role=button * @param {import("./Form/matching").Matching} matching * @return {boolean} */ - - const isLikelyASubmitButton = (el, matching) => { - var _matching$getDDGMatch, _matching$getDDGMatch2, _matching$getDDGMatch3; - const text = getTextShallow(el); const ariaLabel = el.getAttribute('aria-label') || ''; const dataTestId = el.getAttribute('data-test-id') || ''; - if ((el.getAttribute('type') === 'submit' || // is explicitly set as "submit" - el.getAttribute('name') === 'submit') && // is called "submit" - !((_matching$getDDGMatch = matching.getDDGMatcherRegex('submitButtonUnlikelyRegex')) !== null && _matching$getDDGMatch !== void 0 && _matching$getDDGMatch.test(text + ' ' + ariaLabel))) return true; - return (/primary|submit/i.test(el.className) || // has high-signal submit classes - /submit/i.test(dataTestId) || ((_matching$getDDGMatch2 = matching.getDDGMatcherRegex('submitButtonRegex')) === null || _matching$getDDGMatch2 === void 0 ? void 0 : _matching$getDDGMatch2.test(text)) || // has high-signal text + if ((el.getAttribute('type') === 'submit' || + // is explicitly set as "submit" + el.getAttribute('name') === 'submit') && + // is called "submit" + !matching.getDDGMatcherRegex('submitButtonUnlikelyRegex')?.test(text + ' ' + ariaLabel)) return true; + return (/primary|submit/i.test(el.className) || + // has high-signal submit classes + /submit/i.test(dataTestId) || matching.getDDGMatcherRegex('submitButtonRegex')?.test(text) || + // has high-signal text el.offsetHeight * el.offsetWidth >= 10000 && !/secondary/i.test(el.className) // it's a large element 250x40px - ) && el.offsetHeight * el.offsetWidth >= 2000 && // it's not a very small button like inline links and such - !((_matching$getDDGMatch3 = matching.getDDGMatcherRegex('submitButtonUnlikelyRegex')) !== null && _matching$getDDGMatch3 !== void 0 && _matching$getDDGMatch3.test(text + ' ' + ariaLabel)); + ) && el.offsetHeight * el.offsetWidth >= 2000 && + // it's not a very small button like inline links and such + !matching.getDDGMatcherRegex('submitButtonUnlikelyRegex')?.test(text + ' ' + ariaLabel); }; + /** * Check that a button matches the form type - login buttons on a login form, signup buttons on a signup form * @param {HTMLElement} el * @param {import('./Form/Form').Form} formObj */ - - exports.isLikelyASubmitButton = isLikelyASubmitButton; - const buttonMatchesFormType = (el, formObj) => { if (formObj.isLogin) { return !/sign.?up|register|join/i.test(el.textContent || ''); @@ -14189,7 +12308,6 @@ const buttonMatchesFormType = (el, formObj) => { return true; } }; - exports.buttonMatchesFormType = buttonMatchesFormType; const buttonInputTypes = ['submit', 'button']; /** @@ -14197,65 +12315,55 @@ const buttonInputTypes = ['submit', 'button']; * @param {Node} el * @returns {string} */ - const getTextShallow = el => { // for buttons, we don't care about descendants, just get the whole text as is // this is important in order to give proper attribution of the text to the button if (el instanceof HTMLButtonElement) return (0, _matching.removeExcessWhitespace)(el.textContent); - if (el instanceof HTMLInputElement) { if (buttonInputTypes.includes(el.type)) { return el.value; } - if (el.type === 'image') { return (0, _matching.removeExcessWhitespace)(el.alt || el.value || el.title || el.name); } } - let text = ''; - for (const childNode of el.childNodes) { if (childNode instanceof Text) { text += ' ' + childNode.textContent; } } - return (0, _matching.removeExcessWhitespace)(text); }; + /** * Check if hostname is a local address * @param {string} [hostname] * @returns {boolean} */ - - exports.getTextShallow = getTextShallow; - function isLocalNetwork() { let hostname = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : window.location.hostname; return ['localhost', '', '::1'].includes(hostname) || hostname.includes('127.0.0.1') || hostname.includes('192.168.') || hostname.startsWith('10.0.') || hostname.endsWith('.local') || hostname.endsWith('.internal'); -} // Extracted from lib/DDG/Util/Constants.pm - +} +// Extracted from lib/DDG/Util/Constants.pm const tldrs = /\.(?:c(?:o(?:m|op)?|at?|[iykgdmnxruhcfzvl])|o(?:rg|m)|n(?:et?|a(?:me)?|[ucgozrfpil])|e(?:d?u|[gechstr])|i(?:n(?:t|fo)?|[stqldroem])|m(?:o(?:bi)?|u(?:seum)?|i?l|[mcyvtsqhaerngxzfpwkd])|g(?:ov|[glqeriabtshdfmuywnp])|b(?:iz?|[drovfhtaywmzjsgbenl])|t(?:r(?:avel)?|[ncmfzdvkopthjwg]|e?l)|k[iemygznhwrp]|s[jtvberindlucygkhaozm]|u[gymszka]|h[nmutkr]|r[owesu]|d[kmzoej]|a(?:e(?:ro)?|r(?:pa)?|[qofiumsgzlwcnxdt])|p(?:ro?|[sgnthfymakwle])|v[aegiucn]|l[sayuvikcbrt]|j(?:o(?:bs)?|[mep])|w[fs]|z[amw]|f[rijkom]|y[eut]|qa)$/i; /** * Check if hostname is a valid top-level domain * @param {string} [hostname] * @returns {boolean} */ - function isValidTLD() { let hostname = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : window.location.hostname; return tldrs.test(hostname) || hostname === 'fill.dev'; } + /** * Chrome's UA adds styles using this selector when using the built-in autofill * @param {HTMLInputElement} input * @returns {boolean} */ - - const wasAutofilledByChrome = input => { try { // Other browsers throw because the selector is invalid @@ -14264,110 +12372,94 @@ const wasAutofilledByChrome = input => { return false; } }; + /** * Checks if we should log form analysis debug info to the console * @returns {boolean} */ - - exports.wasAutofilledByChrome = wasAutofilledByChrome; - function shouldLog() { return readDebugSetting('ddg-autofill-debug'); } + /** * Checks if we should log performance info to the console * @returns {boolean} */ - - function shouldLogPerformance() { return readDebugSetting('ddg-autofill-perf'); } + /** * Check if a sessionStorage item is set to 'true' * @param setting * @returns {boolean} */ - - function readDebugSetting(setting) { // sessionStorage throws in invalid schemes like data: and file: try { - var _window$sessionStorag; - - return ((_window$sessionStorag = window.sessionStorage) === null || _window$sessionStorag === void 0 ? void 0 : _window$sessionStorag.getItem(setting)) === 'true'; + return window.sessionStorage?.getItem(setting) === 'true'; } catch (e) { return false; } } - function logPerformance(markName) { if (shouldLogPerformance()) { - var _window$performance, _window$performance2; - - const measurement = (_window$performance = window.performance) === null || _window$performance === void 0 ? void 0 : _window$performance.measure("".concat(markName, ":init"), "".concat(markName, ":init:start"), "".concat(markName, ":init:end")); - console.log("".concat(markName, " took ").concat(Math.round(measurement === null || measurement === void 0 ? void 0 : measurement.duration), "ms")); - (_window$performance2 = window.performance) === null || _window$performance2 === void 0 ? void 0 : _window$performance2.clearMarks(); + const measurement = window.performance?.measure(`${markName}:init`, `${markName}:init:start`, `${markName}:init:end`); + console.log(`${markName} took ${Math.round(measurement?.duration)}ms`); + window.performance?.clearMarks(); } } + /** * * @param {Function} callback * @returns {Function} */ - - function whenIdle(callback) { var _this = this; - let timer; return function () { for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } - cancelIdleCallback(timer); timer = requestIdleCallback(() => callback.apply(_this, args)); }; } + /** * Truncate string from the middle if exceeds the totalLength (default: 30) * @param {string} string * @param {number} totalLength * @returns {string} */ - - function truncateFromMiddle(string) { let totalLength = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 30; - if (totalLength < 4) { throw new Error('Do not use with strings shorter than 4'); } - if (string.length <= totalLength) return string; const truncated = string.slice(0, totalLength / 2).concat('…', string.slice(totalLength / -2)); return truncated; } + /** * Determines if the form is likely to be enclosing most of the DOM * @param {HTMLFormElement} form * @returns {boolean} */ - - function isFormLikelyToBeUsedAsPageWrapper(form) { if (form.parentElement !== document.body) return false; - const formChildren = form.querySelectorAll('*').length; // If the form has few content elements, it's unlikely to cause issues anyway - + const formChildren = form.querySelectorAll('*').length; + // If the form has few content elements, it's unlikely to cause issues anyway if (formChildren < 100) return false; const bodyChildren = document.body.querySelectorAll('*').length; + /** * Percentage of the formChildren on the total body elements * form * 100 / body = x */ - const formChildrenPercentage = formChildren * 100 / bodyChildren; return formChildrenPercentage > 50; } @@ -14376,19 +12468,15 @@ function isFormLikelyToBeUsedAsPageWrapper(form) { "use strict"; require("./requestIdleCallback.js"); - var _DeviceInterface = require("./DeviceInterface.js"); - var _autofillUtils = require("./autofill-utils.js"); - // Polyfills/shims + (() => { if ((0, _autofillUtils.shouldLog)()) { console.log('DuckDuckGo Autofill Active'); } - if (!window.isSecureContext) return false; - try { const startupAutofill = () => { if (document.visibilityState === 'visible') { @@ -14400,10 +12488,10 @@ var _autofillUtils = require("./autofill-utils.js"); }); } }; - startupAutofill(); } catch (e) { - console.error(e); // Noop, we errored + console.error(e); + // Noop, we errored } })(); @@ -14415,59 +12503,60 @@ Object.defineProperty(exports, "__esModule", { }); exports.DDG_DOMAIN_REGEX = void 0; exports.createGlobalConfig = createGlobalConfig; -const DDG_DOMAIN_REGEX = new RegExp(/^https:\/\/(([a-z0-9-_]+?)\.)?duckduckgo\.com\/email/); +const DDG_DOMAIN_REGEX = exports.DDG_DOMAIN_REGEX = new RegExp(/^https:\/\/(([a-z0-9-_]+?)\.)?duckduckgo\.com\/email/); + /** * This is a centralised place to contain all string/variable replacements * * @param {Partial} [overrides] * @returns {GlobalConfig} */ - -exports.DDG_DOMAIN_REGEX = DDG_DOMAIN_REGEX; - function createGlobalConfig(overrides) { let isApp = false; let isTopFrame = false; - let supportsTopFrame = false; // Do not remove -- Apple devices change this when they support modern webkit messaging - - let hasModernWebkitAPI = false; // INJECT isApp HERE + let supportsTopFrame = false; + // Do not remove -- Apple devices change this when they support modern webkit messaging + let hasModernWebkitAPI = false; + // INJECT isApp HERE // INJECT isTopFrame HERE // INJECT supportsTopFrame HERE // INJECT hasModernWebkitAPI HERE - let isWindows = false; // INJECT isWindows HERE - // This will be used when 'hasModernWebkitAPI' is false + let isWindows = false; + // INJECT isWindows HERE + // This will be used when 'hasModernWebkitAPI' is false /** @type {string[]} */ + let webkitMessageHandlerNames = []; + // INJECT webkitMessageHandlerNames HERE - let webkitMessageHandlerNames = []; // INJECT webkitMessageHandlerNames HERE - - let isDDGTestMode = false; // INJECT isDDGTestMode HERE + let isDDGTestMode = false; + // INJECT isDDGTestMode HERE let contentScope = null; let userUnprotectedDomains = null; /** @type {Record | null} */ - - let userPreferences = null; // INJECT contentScope HERE + let userPreferences = null; + // INJECT contentScope HERE // INJECT userUnprotectedDomains HERE // INJECT userPreferences HERE /** @type {Record | null} */ + let availableInputTypes = null; + // INJECT availableInputTypes HERE - let availableInputTypes = null; // INJECT availableInputTypes HERE // The native layer will inject a randomised secret here and use it to verify the origin - let secret = 'PLACEHOLDER_SECRET'; + /** * The user agent check will not be needed here once `android` supports `userPreferences?.platform.name` */ // @ts-ignore - - const isAndroid = (userPreferences === null || userPreferences === void 0 ? void 0 : userPreferences.platform.name) === 'android' || /Android.*DuckDuckGo\/\d/i.test(window.navigator.userAgent); // @ts-ignore - - const isDDGApp = ['ios', 'android', 'macos', 'windows'].includes(userPreferences === null || userPreferences === void 0 ? void 0 : userPreferences.platform.name) || isAndroid || isWindows; // @ts-ignore - - const isMobileApp = ['ios', 'android'].includes(userPreferences === null || userPreferences === void 0 ? void 0 : userPreferences.platform.name) || isAndroid; + const isAndroid = userPreferences?.platform.name === 'android' || /Android.*DuckDuckGo\/\d/i.test(window.navigator.userAgent); + // @ts-ignore + const isDDGApp = ['ios', 'android', 'macos', 'windows'].includes(userPreferences?.platform.name) || isAndroid || isWindows; + // @ts-ignore + const isMobileApp = ['ios', 'android'].includes(userPreferences?.platform.name) || isAndroid; const isFirefox = navigator.userAgent.includes('Firefox'); const isDDGDomain = Boolean(window.location.href.match(DDG_DOMAIN_REGEX)); const isExtension = false; @@ -14502,7 +12591,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.constants = void 0; -const constants = { +const constants = exports.constants = { ATTR_INPUT_TYPE: 'data-ddg-inputType', ATTR_AUTOFILL: 'data-ddg-autofill', TEXT_LENGTH_CUTOFF: 100, @@ -14511,7 +12600,6 @@ const constants = { MAX_INPUTS_PER_FORM: 80, MAX_FORM_MUT_OBS_COUNT: 50 }; -exports.constants = constants; },{}],55:[function(require,module,exports){ "use strict"; @@ -14520,487 +12608,234 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.StoreFormDataCall = exports.StartEmailProtectionSignupCall = exports.SetSizeCall = exports.SetIncontextSignupPermanentlyDismissedAtCall = exports.SendJSPixelCall = exports.SelectedDetailCall = exports.OpenManagePasswordsCall = exports.OpenManageIdentitiesCall = exports.OpenManageCreditCardsCall = exports.GetRuntimeConfigurationCall = exports.GetIncontextSignupDismissedAtCall = exports.GetAvailableInputTypesCall = exports.GetAutofillInitDataCall = exports.GetAutofillDataCall = exports.GetAutofillCredentialsCall = exports.EmailProtectionStoreUserDataCall = exports.EmailProtectionRemoveUserDataCall = exports.EmailProtectionRefreshPrivateAddressCall = exports.EmailProtectionGetUserDataCall = exports.EmailProtectionGetIsLoggedInCall = exports.EmailProtectionGetCapabilitiesCall = exports.EmailProtectionGetAddressesCall = exports.CloseEmailProtectionTabCall = exports.CloseAutofillParentCall = exports.CheckCredentialsProviderStatusCall = exports.AskToUnlockProviderCall = exports.AddDebugFlagCall = void 0; - var _validatorsZod = require("./validators.zod.js"); - var _deviceApi = require("../../../packages/device-api"); - -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } +/* DO NOT EDIT, this file was generated by scripts/api-call-generator.js */ /** * @extends {DeviceApiCall} */ class AddDebugFlagCall extends _deviceApi.DeviceApiCall { - constructor() { - super(...arguments); - - _defineProperty(this, "method", "addDebugFlag"); - - _defineProperty(this, "paramsValidator", _validatorsZod.addDebugFlagParamsSchema); - } - + method = "addDebugFlag"; + paramsValidator = _validatorsZod.addDebugFlagParamsSchema; } /** * @extends {DeviceApiCall} */ - - exports.AddDebugFlagCall = AddDebugFlagCall; - class GetAutofillDataCall extends _deviceApi.DeviceApiCall { - constructor() { - super(...arguments); - - _defineProperty(this, "method", "getAutofillData"); - - _defineProperty(this, "id", "getAutofillDataResponse"); - - _defineProperty(this, "paramsValidator", _validatorsZod.getAutofillDataRequestSchema); - - _defineProperty(this, "resultValidator", _validatorsZod.getAutofillDataResponseSchema); - } - + method = "getAutofillData"; + id = "getAutofillDataResponse"; + paramsValidator = _validatorsZod.getAutofillDataRequestSchema; + resultValidator = _validatorsZod.getAutofillDataResponseSchema; } /** * @extends {DeviceApiCall} */ - - exports.GetAutofillDataCall = GetAutofillDataCall; - class GetRuntimeConfigurationCall extends _deviceApi.DeviceApiCall { - constructor() { - super(...arguments); - - _defineProperty(this, "method", "getRuntimeConfiguration"); - - _defineProperty(this, "id", "getRuntimeConfigurationResponse"); - - _defineProperty(this, "resultValidator", _validatorsZod.getRuntimeConfigurationResponseSchema); - } - + method = "getRuntimeConfiguration"; + id = "getRuntimeConfigurationResponse"; + resultValidator = _validatorsZod.getRuntimeConfigurationResponseSchema; } /** * @extends {DeviceApiCall} */ - - exports.GetRuntimeConfigurationCall = GetRuntimeConfigurationCall; - class StoreFormDataCall extends _deviceApi.DeviceApiCall { - constructor() { - super(...arguments); - - _defineProperty(this, "method", "storeFormData"); - - _defineProperty(this, "paramsValidator", _validatorsZod.storeFormDataSchema); - } - + method = "storeFormData"; + paramsValidator = _validatorsZod.storeFormDataSchema; } /** * @extends {DeviceApiCall} */ - - exports.StoreFormDataCall = StoreFormDataCall; - class GetAvailableInputTypesCall extends _deviceApi.DeviceApiCall { - constructor() { - super(...arguments); - - _defineProperty(this, "method", "getAvailableInputTypes"); - - _defineProperty(this, "id", "getAvailableInputTypesResponse"); - - _defineProperty(this, "resultValidator", _validatorsZod.getAvailableInputTypesResultSchema); - } - + method = "getAvailableInputTypes"; + id = "getAvailableInputTypesResponse"; + resultValidator = _validatorsZod.getAvailableInputTypesResultSchema; } /** * @extends {DeviceApiCall} */ - - exports.GetAvailableInputTypesCall = GetAvailableInputTypesCall; - class GetAutofillInitDataCall extends _deviceApi.DeviceApiCall { - constructor() { - super(...arguments); - - _defineProperty(this, "method", "getAutofillInitData"); - - _defineProperty(this, "id", "getAutofillInitDataResponse"); - - _defineProperty(this, "resultValidator", _validatorsZod.getAutofillInitDataResponseSchema); - } - + method = "getAutofillInitData"; + id = "getAutofillInitDataResponse"; + resultValidator = _validatorsZod.getAutofillInitDataResponseSchema; } /** * @extends {DeviceApiCall} */ - - exports.GetAutofillInitDataCall = GetAutofillInitDataCall; - class GetAutofillCredentialsCall extends _deviceApi.DeviceApiCall { - constructor() { - super(...arguments); - - _defineProperty(this, "method", "getAutofillCredentials"); - - _defineProperty(this, "id", "getAutofillCredentialsResponse"); - - _defineProperty(this, "paramsValidator", _validatorsZod.getAutofillCredentialsParamsSchema); - - _defineProperty(this, "resultValidator", _validatorsZod.getAutofillCredentialsResultSchema); - } - + method = "getAutofillCredentials"; + id = "getAutofillCredentialsResponse"; + paramsValidator = _validatorsZod.getAutofillCredentialsParamsSchema; + resultValidator = _validatorsZod.getAutofillCredentialsResultSchema; } /** * @extends {DeviceApiCall} */ - - exports.GetAutofillCredentialsCall = GetAutofillCredentialsCall; - class SetSizeCall extends _deviceApi.DeviceApiCall { - constructor() { - super(...arguments); - - _defineProperty(this, "method", "setSize"); - - _defineProperty(this, "paramsValidator", _validatorsZod.setSizeParamsSchema); - } - + method = "setSize"; + paramsValidator = _validatorsZod.setSizeParamsSchema; } /** * @extends {DeviceApiCall} */ - - exports.SetSizeCall = SetSizeCall; - class SelectedDetailCall extends _deviceApi.DeviceApiCall { - constructor() { - super(...arguments); - - _defineProperty(this, "method", "selectedDetail"); - - _defineProperty(this, "paramsValidator", _validatorsZod.selectedDetailParamsSchema); - } - + method = "selectedDetail"; + paramsValidator = _validatorsZod.selectedDetailParamsSchema; } /** * @extends {DeviceApiCall} */ - - exports.SelectedDetailCall = SelectedDetailCall; - class CloseAutofillParentCall extends _deviceApi.DeviceApiCall { - constructor() { - super(...arguments); - - _defineProperty(this, "method", "closeAutofillParent"); - } - + method = "closeAutofillParent"; } /** * @extends {DeviceApiCall} */ - - exports.CloseAutofillParentCall = CloseAutofillParentCall; - class AskToUnlockProviderCall extends _deviceApi.DeviceApiCall { - constructor() { - super(...arguments); - - _defineProperty(this, "method", "askToUnlockProvider"); - - _defineProperty(this, "id", "askToUnlockProviderResponse"); - - _defineProperty(this, "resultValidator", _validatorsZod.askToUnlockProviderResultSchema); - } - + method = "askToUnlockProvider"; + id = "askToUnlockProviderResponse"; + resultValidator = _validatorsZod.askToUnlockProviderResultSchema; } /** * @extends {DeviceApiCall} */ - - exports.AskToUnlockProviderCall = AskToUnlockProviderCall; - -class CheckCredentialsProviderStatusCall extends _deviceApi.DeviceApiCall { - constructor() { - super(...arguments); - - _defineProperty(this, "method", "checkCredentialsProviderStatus"); - - _defineProperty(this, "id", "checkCredentialsProviderStatusResponse"); - - _defineProperty(this, "resultValidator", _validatorsZod.checkCredentialsProviderStatusResultSchema); - } - +class CheckCredentialsProviderStatusCall extends _deviceApi.DeviceApiCall { + method = "checkCredentialsProviderStatus"; + id = "checkCredentialsProviderStatusResponse"; + resultValidator = _validatorsZod.checkCredentialsProviderStatusResultSchema; } /** * @extends {DeviceApiCall} */ - - exports.CheckCredentialsProviderStatusCall = CheckCredentialsProviderStatusCall; - class SendJSPixelCall extends _deviceApi.DeviceApiCall { - constructor() { - super(...arguments); - - _defineProperty(this, "method", "sendJSPixel"); - - _defineProperty(this, "paramsValidator", _validatorsZod.sendJSPixelParamsSchema); - } - + method = "sendJSPixel"; + paramsValidator = _validatorsZod.sendJSPixelParamsSchema; } /** * @extends {DeviceApiCall} */ - - exports.SendJSPixelCall = SendJSPixelCall; - class SetIncontextSignupPermanentlyDismissedAtCall extends _deviceApi.DeviceApiCall { - constructor() { - super(...arguments); - - _defineProperty(this, "method", "setIncontextSignupPermanentlyDismissedAt"); - - _defineProperty(this, "paramsValidator", _validatorsZod.setIncontextSignupPermanentlyDismissedAtSchema); - } - + method = "setIncontextSignupPermanentlyDismissedAt"; + paramsValidator = _validatorsZod.setIncontextSignupPermanentlyDismissedAtSchema; } /** * @extends {DeviceApiCall} */ - - exports.SetIncontextSignupPermanentlyDismissedAtCall = SetIncontextSignupPermanentlyDismissedAtCall; - class GetIncontextSignupDismissedAtCall extends _deviceApi.DeviceApiCall { - constructor() { - super(...arguments); - - _defineProperty(this, "method", "getIncontextSignupDismissedAt"); - - _defineProperty(this, "id", "getIncontextSignupDismissedAt"); - - _defineProperty(this, "resultValidator", _validatorsZod.getIncontextSignupDismissedAtSchema); - } - + method = "getIncontextSignupDismissedAt"; + id = "getIncontextSignupDismissedAt"; + resultValidator = _validatorsZod.getIncontextSignupDismissedAtSchema; } /** * @extends {DeviceApiCall} */ - - exports.GetIncontextSignupDismissedAtCall = GetIncontextSignupDismissedAtCall; - class OpenManagePasswordsCall extends _deviceApi.DeviceApiCall { - constructor() { - super(...arguments); - - _defineProperty(this, "method", "openManagePasswords"); - } - + method = "openManagePasswords"; } /** * @extends {DeviceApiCall} */ - - exports.OpenManagePasswordsCall = OpenManagePasswordsCall; - class OpenManageCreditCardsCall extends _deviceApi.DeviceApiCall { - constructor() { - super(...arguments); - - _defineProperty(this, "method", "openManageCreditCards"); - } - + method = "openManageCreditCards"; } /** * @extends {DeviceApiCall} */ - - exports.OpenManageCreditCardsCall = OpenManageCreditCardsCall; - class OpenManageIdentitiesCall extends _deviceApi.DeviceApiCall { - constructor() { - super(...arguments); - - _defineProperty(this, "method", "openManageIdentities"); - } - + method = "openManageIdentities"; } /** * @extends {DeviceApiCall} */ - - exports.OpenManageIdentitiesCall = OpenManageIdentitiesCall; - class EmailProtectionStoreUserDataCall extends _deviceApi.DeviceApiCall { - constructor() { - super(...arguments); - - _defineProperty(this, "method", "emailProtectionStoreUserData"); - - _defineProperty(this, "id", "emailProtectionStoreUserDataResponse"); - - _defineProperty(this, "paramsValidator", _validatorsZod.emailProtectionStoreUserDataParamsSchema); - } - + method = "emailProtectionStoreUserData"; + id = "emailProtectionStoreUserDataResponse"; + paramsValidator = _validatorsZod.emailProtectionStoreUserDataParamsSchema; } /** * @extends {DeviceApiCall} */ - - exports.EmailProtectionStoreUserDataCall = EmailProtectionStoreUserDataCall; - class EmailProtectionRemoveUserDataCall extends _deviceApi.DeviceApiCall { - constructor() { - super(...arguments); - - _defineProperty(this, "method", "emailProtectionRemoveUserData"); - } - + method = "emailProtectionRemoveUserData"; } /** * @extends {DeviceApiCall} */ - - exports.EmailProtectionRemoveUserDataCall = EmailProtectionRemoveUserDataCall; - class EmailProtectionGetIsLoggedInCall extends _deviceApi.DeviceApiCall { - constructor() { - super(...arguments); - - _defineProperty(this, "method", "emailProtectionGetIsLoggedIn"); - - _defineProperty(this, "id", "emailProtectionGetIsLoggedInResponse"); - - _defineProperty(this, "resultValidator", _validatorsZod.emailProtectionGetIsLoggedInResultSchema); - } - + method = "emailProtectionGetIsLoggedIn"; + id = "emailProtectionGetIsLoggedInResponse"; + resultValidator = _validatorsZod.emailProtectionGetIsLoggedInResultSchema; } /** * @extends {DeviceApiCall} */ - - exports.EmailProtectionGetIsLoggedInCall = EmailProtectionGetIsLoggedInCall; - class EmailProtectionGetUserDataCall extends _deviceApi.DeviceApiCall { - constructor() { - super(...arguments); - - _defineProperty(this, "method", "emailProtectionGetUserData"); - - _defineProperty(this, "id", "emailProtectionGetUserDataResponse"); - - _defineProperty(this, "resultValidator", _validatorsZod.emailProtectionGetUserDataResultSchema); - } - + method = "emailProtectionGetUserData"; + id = "emailProtectionGetUserDataResponse"; + resultValidator = _validatorsZod.emailProtectionGetUserDataResultSchema; } /** * @extends {DeviceApiCall} */ - - exports.EmailProtectionGetUserDataCall = EmailProtectionGetUserDataCall; - class EmailProtectionGetCapabilitiesCall extends _deviceApi.DeviceApiCall { - constructor() { - super(...arguments); - - _defineProperty(this, "method", "emailProtectionGetCapabilities"); - - _defineProperty(this, "id", "emailProtectionGetCapabilitiesResponse"); - - _defineProperty(this, "resultValidator", _validatorsZod.emailProtectionGetCapabilitiesResultSchema); - } - + method = "emailProtectionGetCapabilities"; + id = "emailProtectionGetCapabilitiesResponse"; + resultValidator = _validatorsZod.emailProtectionGetCapabilitiesResultSchema; } /** * @extends {DeviceApiCall} */ - - exports.EmailProtectionGetCapabilitiesCall = EmailProtectionGetCapabilitiesCall; - class EmailProtectionGetAddressesCall extends _deviceApi.DeviceApiCall { - constructor() { - super(...arguments); - - _defineProperty(this, "method", "emailProtectionGetAddresses"); - - _defineProperty(this, "id", "emailProtectionGetAddressesResponse"); - - _defineProperty(this, "resultValidator", _validatorsZod.emailProtectionGetAddressesResultSchema); - } - + method = "emailProtectionGetAddresses"; + id = "emailProtectionGetAddressesResponse"; + resultValidator = _validatorsZod.emailProtectionGetAddressesResultSchema; } /** * @extends {DeviceApiCall} */ - - exports.EmailProtectionGetAddressesCall = EmailProtectionGetAddressesCall; - class EmailProtectionRefreshPrivateAddressCall extends _deviceApi.DeviceApiCall { - constructor() { - super(...arguments); - - _defineProperty(this, "method", "emailProtectionRefreshPrivateAddress"); - - _defineProperty(this, "id", "emailProtectionRefreshPrivateAddressResponse"); - - _defineProperty(this, "resultValidator", _validatorsZod.emailProtectionRefreshPrivateAddressResultSchema); - } - + method = "emailProtectionRefreshPrivateAddress"; + id = "emailProtectionRefreshPrivateAddressResponse"; + resultValidator = _validatorsZod.emailProtectionRefreshPrivateAddressResultSchema; } /** * @extends {DeviceApiCall} */ - - exports.EmailProtectionRefreshPrivateAddressCall = EmailProtectionRefreshPrivateAddressCall; - class StartEmailProtectionSignupCall extends _deviceApi.DeviceApiCall { - constructor() { - super(...arguments); - - _defineProperty(this, "method", "startEmailProtectionSignup"); - } - + method = "startEmailProtectionSignup"; } /** * @extends {DeviceApiCall} */ - - exports.StartEmailProtectionSignupCall = StartEmailProtectionSignupCall; - class CloseEmailProtectionTabCall extends _deviceApi.DeviceApiCall { - constructor() { - super(...arguments); - - _defineProperty(this, "method", "closeEmailProtectionTab"); - } - + method = "closeEmailProtectionTab"; } - exports.CloseEmailProtectionTabCall = CloseEmailProtectionTabCall; },{"../../../packages/device-api":2,"./validators.zod.js":56}],56:[function(require,module,exports){ @@ -15010,82 +12845,44 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.userPreferencesSchema = exports.triggerContextSchema = exports.storeFormDataSchema = exports.setSizeParamsSchema = exports.setIncontextSignupPermanentlyDismissedAtSchema = exports.sendJSPixelParamsSchema = exports.selectedDetailParamsSchema = exports.runtimeConfigurationSchema = exports.providerStatusUpdatedSchema = exports.outgoingCredentialsSchema = exports.getRuntimeConfigurationResponseSchema = exports.getIncontextSignupDismissedAtSchema = exports.getAvailableInputTypesResultSchema = exports.getAutofillInitDataResponseSchema = exports.getAutofillDataResponseSchema = exports.getAutofillDataRequestSchema = exports.getAutofillCredentialsResultSchema = exports.getAutofillCredentialsParamsSchema = exports.getAliasResultSchema = exports.getAliasParamsSchema = exports.genericErrorSchema = exports.generatedPasswordSchema = exports.emailProtectionStoreUserDataParamsSchema = exports.emailProtectionRefreshPrivateAddressResultSchema = exports.emailProtectionGetUserDataResultSchema = exports.emailProtectionGetIsLoggedInResultSchema = exports.emailProtectionGetCapabilitiesResultSchema = exports.emailProtectionGetAddressesResultSchema = exports.credentialsSchema = exports.contentScopeSchema = exports.checkCredentialsProviderStatusResultSchema = exports.availableInputTypesSchema = exports.availableInputTypes1Schema = exports.autofillSettingsSchema = exports.autofillFeatureTogglesSchema = exports.askToUnlockProviderResultSchema = exports.apiSchema = exports.addDebugFlagParamsSchema = void 0; -const sendJSPixelParamsSchema = null; -exports.sendJSPixelParamsSchema = sendJSPixelParamsSchema; -const addDebugFlagParamsSchema = null; -exports.addDebugFlagParamsSchema = addDebugFlagParamsSchema; -const generatedPasswordSchema = null; -exports.generatedPasswordSchema = generatedPasswordSchema; -const triggerContextSchema = null; -exports.triggerContextSchema = triggerContextSchema; -const credentialsSchema = null; -exports.credentialsSchema = credentialsSchema; -const genericErrorSchema = null; -exports.genericErrorSchema = genericErrorSchema; -const contentScopeSchema = null; -exports.contentScopeSchema = contentScopeSchema; -const userPreferencesSchema = null; -exports.userPreferencesSchema = userPreferencesSchema; -const outgoingCredentialsSchema = null; -exports.outgoingCredentialsSchema = outgoingCredentialsSchema; -const availableInputTypesSchema = null; -exports.availableInputTypesSchema = availableInputTypesSchema; -const getAutofillInitDataResponseSchema = null; -exports.getAutofillInitDataResponseSchema = getAutofillInitDataResponseSchema; -const getAutofillCredentialsParamsSchema = null; -exports.getAutofillCredentialsParamsSchema = getAutofillCredentialsParamsSchema; -const getAutofillCredentialsResultSchema = null; -exports.getAutofillCredentialsResultSchema = getAutofillCredentialsResultSchema; -const setSizeParamsSchema = null; -exports.setSizeParamsSchema = setSizeParamsSchema; -const selectedDetailParamsSchema = null; -exports.selectedDetailParamsSchema = selectedDetailParamsSchema; -const availableInputTypes1Schema = null; -exports.availableInputTypes1Schema = availableInputTypes1Schema; -const setIncontextSignupPermanentlyDismissedAtSchema = null; -exports.setIncontextSignupPermanentlyDismissedAtSchema = setIncontextSignupPermanentlyDismissedAtSchema; -const getIncontextSignupDismissedAtSchema = null; -exports.getIncontextSignupDismissedAtSchema = getIncontextSignupDismissedAtSchema; -const autofillFeatureTogglesSchema = null; -exports.autofillFeatureTogglesSchema = autofillFeatureTogglesSchema; -const getAliasParamsSchema = null; -exports.getAliasParamsSchema = getAliasParamsSchema; -const getAliasResultSchema = null; -exports.getAliasResultSchema = getAliasResultSchema; -const emailProtectionStoreUserDataParamsSchema = null; -exports.emailProtectionStoreUserDataParamsSchema = emailProtectionStoreUserDataParamsSchema; -const emailProtectionGetIsLoggedInResultSchema = null; -exports.emailProtectionGetIsLoggedInResultSchema = emailProtectionGetIsLoggedInResultSchema; -const emailProtectionGetUserDataResultSchema = null; -exports.emailProtectionGetUserDataResultSchema = emailProtectionGetUserDataResultSchema; -const emailProtectionGetCapabilitiesResultSchema = null; -exports.emailProtectionGetCapabilitiesResultSchema = emailProtectionGetCapabilitiesResultSchema; -const emailProtectionGetAddressesResultSchema = null; -exports.emailProtectionGetAddressesResultSchema = emailProtectionGetAddressesResultSchema; -const emailProtectionRefreshPrivateAddressResultSchema = null; -exports.emailProtectionRefreshPrivateAddressResultSchema = emailProtectionRefreshPrivateAddressResultSchema; -const getAutofillDataRequestSchema = null; -exports.getAutofillDataRequestSchema = getAutofillDataRequestSchema; -const getAutofillDataResponseSchema = null; -exports.getAutofillDataResponseSchema = getAutofillDataResponseSchema; -const runtimeConfigurationSchema = null; -exports.runtimeConfigurationSchema = runtimeConfigurationSchema; -const storeFormDataSchema = null; -exports.storeFormDataSchema = storeFormDataSchema; -const getAvailableInputTypesResultSchema = null; -exports.getAvailableInputTypesResultSchema = getAvailableInputTypesResultSchema; -const providerStatusUpdatedSchema = null; -exports.providerStatusUpdatedSchema = providerStatusUpdatedSchema; -const checkCredentialsProviderStatusResultSchema = null; -exports.checkCredentialsProviderStatusResultSchema = checkCredentialsProviderStatusResultSchema; -const autofillSettingsSchema = null; -exports.autofillSettingsSchema = autofillSettingsSchema; -const getRuntimeConfigurationResponseSchema = null; -exports.getRuntimeConfigurationResponseSchema = getRuntimeConfigurationResponseSchema; -const askToUnlockProviderResultSchema = null; -exports.askToUnlockProviderResultSchema = askToUnlockProviderResultSchema; -const apiSchema = null; -exports.apiSchema = apiSchema; +const sendJSPixelParamsSchema = exports.sendJSPixelParamsSchema = null; +const addDebugFlagParamsSchema = exports.addDebugFlagParamsSchema = null; +const getAutofillCredentialsParamsSchema = exports.getAutofillCredentialsParamsSchema = null; +const setSizeParamsSchema = exports.setSizeParamsSchema = null; +const selectedDetailParamsSchema = exports.selectedDetailParamsSchema = null; +const setIncontextSignupPermanentlyDismissedAtSchema = exports.setIncontextSignupPermanentlyDismissedAtSchema = null; +const getIncontextSignupDismissedAtSchema = exports.getIncontextSignupDismissedAtSchema = null; +const getAliasParamsSchema = exports.getAliasParamsSchema = null; +const getAliasResultSchema = exports.getAliasResultSchema = null; +const emailProtectionStoreUserDataParamsSchema = exports.emailProtectionStoreUserDataParamsSchema = null; +const generatedPasswordSchema = exports.generatedPasswordSchema = null; +const triggerContextSchema = exports.triggerContextSchema = null; +const credentialsSchema = exports.credentialsSchema = null; +const genericErrorSchema = exports.genericErrorSchema = null; +const contentScopeSchema = exports.contentScopeSchema = null; +const userPreferencesSchema = exports.userPreferencesSchema = null; +const outgoingCredentialsSchema = exports.outgoingCredentialsSchema = null; +const availableInputTypesSchema = exports.availableInputTypesSchema = null; +const availableInputTypes1Schema = exports.availableInputTypes1Schema = null; +const autofillFeatureTogglesSchema = exports.autofillFeatureTogglesSchema = null; +const getAutofillDataRequestSchema = exports.getAutofillDataRequestSchema = null; +const getAutofillDataResponseSchema = exports.getAutofillDataResponseSchema = null; +const storeFormDataSchema = exports.storeFormDataSchema = null; +const getAvailableInputTypesResultSchema = exports.getAvailableInputTypesResultSchema = null; +const getAutofillInitDataResponseSchema = exports.getAutofillInitDataResponseSchema = null; +const getAutofillCredentialsResultSchema = exports.getAutofillCredentialsResultSchema = null; +const autofillSettingsSchema = exports.autofillSettingsSchema = null; +const emailProtectionGetIsLoggedInResultSchema = exports.emailProtectionGetIsLoggedInResultSchema = null; +const emailProtectionGetUserDataResultSchema = exports.emailProtectionGetUserDataResultSchema = null; +const emailProtectionGetCapabilitiesResultSchema = exports.emailProtectionGetCapabilitiesResultSchema = null; +const emailProtectionGetAddressesResultSchema = exports.emailProtectionGetAddressesResultSchema = null; +const emailProtectionRefreshPrivateAddressResultSchema = exports.emailProtectionRefreshPrivateAddressResultSchema = null; +const runtimeConfigurationSchema = exports.runtimeConfigurationSchema = null; +const providerStatusUpdatedSchema = exports.providerStatusUpdatedSchema = null; +const getRuntimeConfigurationResponseSchema = exports.getRuntimeConfigurationResponseSchema = null; +const askToUnlockProviderResultSchema = exports.askToUnlockProviderResultSchema = null; +const checkCredentialsProviderStatusResultSchema = exports.checkCredentialsProviderStatusResultSchema = null; +const apiSchema = exports.apiSchema = null; },{}],57:[function(require,module,exports){ "use strict"; @@ -15094,38 +12891,23 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.GetAlias = void 0; - var _index = require("../../packages/device-api/index.js"); - var _validatorsZod = require("./__generated__/validators.zod.js"); - -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - /** * @extends {DeviceApiCall} */ class GetAlias extends _index.DeviceApiCall { - constructor() { - super(...arguments); - - _defineProperty(this, "method", 'emailHandlerGetAlias'); - - _defineProperty(this, "id", 'n/a'); - - _defineProperty(this, "paramsValidator", _validatorsZod.getAliasParamsSchema); - - _defineProperty(this, "resultValidator", _validatorsZod.getAliasResultSchema); - } - + method = 'emailHandlerGetAlias'; + id = 'n/a'; + paramsValidator = _validatorsZod.getAliasParamsSchema; + resultValidator = _validatorsZod.getAliasResultSchema; preResultValidation(response) { // convert to the correct format, because this is a legacy API return { success: response }; } - } - exports.GetAlias = GetAlias; },{"../../packages/device-api/index.js":2,"./__generated__/validators.zod.js":56}],58:[function(require,module,exports){ @@ -15135,32 +12917,21 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.AndroidTransport = void 0; - var _index = require("../../../packages/device-api/index.js"); - var _deviceApiCalls = require("../__generated__/deviceApiCalls.js"); - -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - class AndroidTransport extends _index.DeviceApiTransport { /** @type {GlobalConfig} */ + config; /** @param {GlobalConfig} globalConfig */ constructor(globalConfig) { super(); - - _defineProperty(this, "config", void 0); - this.config = globalConfig; - if (this.config.isDDGTestMode) { - var _window$BrowserAutofi, _window$BrowserAutofi2; - - if (typeof ((_window$BrowserAutofi = window.BrowserAutofill) === null || _window$BrowserAutofi === void 0 ? void 0 : _window$BrowserAutofi.getAutofillData) !== 'function') { + if (typeof window.BrowserAutofill?.getAutofillData !== 'function') { console.warn('window.BrowserAutofill.getAutofillData missing'); } - - if (typeof ((_window$BrowserAutofi2 = window.BrowserAutofill) === null || _window$BrowserAutofi2 === void 0 ? void 0 : _window$BrowserAutofi2.storeFormData) !== 'function') { + if (typeof window.BrowserAutofill?.storeFormData !== 'function') { console.warn('window.BrowserAutofill.storeFormData missing'); } } @@ -15169,39 +12940,30 @@ class AndroidTransport extends _index.DeviceApiTransport { * @param {import("../../../packages/device-api").DeviceApiCall} deviceApiCall * @returns {Promise} */ - - async send(deviceApiCall) { if (deviceApiCall instanceof _deviceApiCalls.GetRuntimeConfigurationCall) { return androidSpecificRuntimeConfiguration(this.config); } - if (deviceApiCall instanceof _deviceApiCalls.GetAvailableInputTypesCall) { return androidSpecificAvailableInputTypes(this.config); } - if (deviceApiCall instanceof _deviceApiCalls.GetAutofillDataCall) { window.BrowserAutofill.getAutofillData(JSON.stringify(deviceApiCall.params)); return waitForResponse(deviceApiCall.id, this.config); } - if (deviceApiCall instanceof _deviceApiCalls.StoreFormDataCall) { return window.BrowserAutofill.storeFormData(JSON.stringify(deviceApiCall.params)); } - throw new Error('android: not implemented: ' + deviceApiCall.method); } - } + /** * @param {string} expectedResponse - the name/id of the response * @param {GlobalConfig} config * @returns {Promise<*>} */ - - exports.AndroidTransport = AndroidTransport; - function waitForResponse(expectedResponse, config) { return new Promise(resolve => { const handler = e => { @@ -15210,53 +12972,43 @@ function waitForResponse(expectedResponse, config) { return; } } - if (!e.data) { return; } - if (typeof e.data !== 'string') { if (config.isDDGTestMode) { console.log('❌ event.data was not a string. Expected a string so that it can be JSON parsed'); } - return; } - try { let data = JSON.parse(e.data); - if (data.type === expectedResponse) { window.removeEventListener('message', handler); return resolve(data); } - if (config.isDDGTestMode) { - console.log("\u274C event.data.type was '".concat(data.type, "', which didnt match '").concat(expectedResponse, "'"), JSON.stringify(data)); + console.log(`❌ event.data.type was '${data.type}', which didnt match '${expectedResponse}'`, JSON.stringify(data)); } } catch (e) { window.removeEventListener('message', handler); - if (config.isDDGTestMode) { console.log('❌ Could not JSON.parse the response'); } } }; - window.addEventListener('message', handler); }); } + /** * @param {GlobalConfig} globalConfig * @returns {{success: import('../__generated__/validators-ts').RuntimeConfiguration}} */ - - function androidSpecificRuntimeConfiguration(globalConfig) { if (!globalConfig.userPreferences) { throw new Error('globalConfig.userPreferences not supported yet on Android'); } - return { success: { // @ts-ignore @@ -15270,17 +13022,15 @@ function androidSpecificRuntimeConfiguration(globalConfig) { } }; } + /** * @param {GlobalConfig} globalConfig * @returns {{success: import('../__generated__/validators-ts').AvailableInputTypes}} */ - - function androidSpecificAvailableInputTypes(globalConfig) { if (!globalConfig.availableInputTypes) { throw new Error('globalConfig.availableInputTypes not supported yet on Android'); } - return { success: globalConfig.availableInputTypes }; @@ -15293,13 +13043,9 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.AppleTransport = void 0; - var _messaging = require("../../../packages/messaging/messaging.js"); - var _index = require("../../../packages/device-api/index.js"); - var _deviceApiCalls = require("../__generated__/deviceApiCalls.js"); - class AppleTransport extends _index.DeviceApiTransport { /** @param {GlobalConfig} globalConfig */ constructor(globalConfig) { @@ -15312,7 +13058,6 @@ class AppleTransport extends _index.DeviceApiTransport { }); this.messaging = new _messaging.Messaging(webkitConfig); } - async send(deviceApiCall) { try { // if the call has an `id`, it means that it expects a response @@ -15326,27 +13071,22 @@ class AppleTransport extends _index.DeviceApiTransport { if (this.config.isDDGTestMode) { console.log('MissingWebkitHandler error for:', deviceApiCall.method); } - if (deviceApiCall instanceof _deviceApiCalls.GetRuntimeConfigurationCall) { return deviceApiCall.result(appleSpecificRuntimeConfiguration(this.config)); } - throw new Error('unimplemented handler: ' + deviceApiCall.method); } else { throw e; } } } - } + /** * @param {GlobalConfig} globalConfig * @returns {ReturnType} */ - - exports.AppleTransport = AppleTransport; - function appleSpecificRuntimeConfiguration(globalConfig) { return { success: { @@ -15369,67 +13109,51 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.ExtensionTransport = void 0; - var _index = require("../../../packages/device-api/index.js"); - var _deviceApiCalls = require("../__generated__/deviceApiCalls.js"); - var _autofillUtils = require("../../autofill-utils.js"); - var _Settings = require("../../Settings.js"); - class ExtensionTransport extends _index.DeviceApiTransport { /** @param {GlobalConfig} globalConfig */ constructor(globalConfig) { super(); this.config = globalConfig; } - async send(deviceApiCall) { if (deviceApiCall instanceof _deviceApiCalls.GetRuntimeConfigurationCall) { return deviceApiCall.result(await extensionSpecificRuntimeConfiguration(this)); } - if (deviceApiCall instanceof _deviceApiCalls.GetAvailableInputTypesCall) { return deviceApiCall.result(await extensionSpecificGetAvailableInputTypes()); } - if (deviceApiCall instanceof _deviceApiCalls.SetIncontextSignupPermanentlyDismissedAtCall) { return deviceApiCall.result(await extensionSpecificSetIncontextSignupPermanentlyDismissedAtCall(deviceApiCall.params)); } - if (deviceApiCall instanceof _deviceApiCalls.GetIncontextSignupDismissedAtCall) { return deviceApiCall.result(await extensionSpecificGetIncontextSignupDismissedAt()); - } // TODO: unify all calls to use deviceApiCall.method instead of all these if blocks - + } + // TODO: unify all calls to use deviceApiCall.method instead of all these if blocks if (deviceApiCall instanceof _deviceApiCalls.SendJSPixelCall) { return deviceApiCall.result(await extensionSpecificSendPixel(deviceApiCall.params)); } - if (deviceApiCall instanceof _deviceApiCalls.AddDebugFlagCall) { return deviceApiCall.result(await extensionSpecificAddDebugFlag(deviceApiCall.params)); } - if (deviceApiCall instanceof _deviceApiCalls.CloseAutofillParentCall || deviceApiCall instanceof _deviceApiCalls.StartEmailProtectionSignupCall) { return; // noop } console.error('Send not implemented for ' + deviceApiCall.method); } - } + /** * @param {ExtensionTransport} deviceApi * @returns {Promise>} */ - - exports.ExtensionTransport = ExtensionTransport; - async function extensionSpecificRuntimeConfiguration(deviceApi) { - var _deviceApi$config; - const contentScope = await getContentScopeConfig(); const emailProtectionEnabled = (0, _autofillUtils.isAutofillEnabledFromProcessedConfig)(contentScope); const incontextSignupEnabled = (0, _autofillUtils.isIncontextSignupEnabledFromProcessedConfig)(contentScope); @@ -15442,7 +13166,8 @@ async function extensionSpecificRuntimeConfiguration(deviceApi) { features: { autofill: { settings: { - featureToggles: { ..._Settings.Settings.defaults.featureToggles, + featureToggles: { + ..._Settings.Settings.defaults.featureToggles, emailProtection: emailProtectionEnabled, emailProtection_incontext_signup: incontextSignupEnabled } @@ -15451,21 +13176,20 @@ async function extensionSpecificRuntimeConfiguration(deviceApi) { } }, // @ts-ignore - userUnprotectedDomains: (_deviceApi$config = deviceApi.config) === null || _deviceApi$config === void 0 ? void 0 : _deviceApi$config.userUnprotectedDomains + userUnprotectedDomains: deviceApi.config?.userUnprotectedDomains } }; } - async function extensionSpecificGetAvailableInputTypes() { const contentScope = await getContentScopeConfig(); const emailProtectionEnabled = (0, _autofillUtils.isAutofillEnabledFromProcessedConfig)(contentScope); return { - success: { ..._Settings.Settings.defaults.availableInputTypes, + success: { + ..._Settings.Settings.defaults.availableInputTypes, email: emailProtectionEnabled } }; } - async function getContentScopeConfig() { return new Promise(resolve => { chrome.runtime.sendMessage({ @@ -15478,11 +13202,10 @@ async function getContentScopeConfig() { }); }); } + /** * @param {import('../__generated__/validators-ts').SendJSPixelParams} params */ - - async function extensionSpecificSendPixel(params) { return new Promise(resolve => { chrome.runtime.sendMessage({ @@ -15493,11 +13216,10 @@ async function extensionSpecificSendPixel(params) { }); }); } + /** * @param {import('../__generated__/validators-ts').AddDebugFlagParams} params */ - - async function extensionSpecificAddDebugFlag(params) { return new Promise(resolve => { chrome.runtime.sendMessage({ @@ -15508,7 +13230,6 @@ async function extensionSpecificAddDebugFlag(params) { }); }); } - async function extensionSpecificGetIncontextSignupDismissedAt() { return new Promise(resolve => { chrome.runtime.sendMessage({ @@ -15518,11 +13239,10 @@ async function extensionSpecificGetIncontextSignupDismissedAt() { }); }); } + /** * @param {import('../__generated__/validators-ts').SetIncontextSignupPermanentlyDismissedAt} params */ - - async function extensionSpecificSetIncontextSignupPermanentlyDismissedAtCall(params) { return new Promise(resolve => { chrome.runtime.sendMessage({ @@ -15541,50 +13261,40 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.createTransport = createTransport; - var _appleTransport = require("./apple.transport.js"); - var _androidTransport = require("./android.transport.js"); - var _extensionTransport = require("./extension.transport.js"); - var _windowsTransport = require("./windows.transport.js"); - /** * @param {GlobalConfig} globalConfig * @returns {import("../../../packages/device-api").DeviceApiTransport} */ -function createTransport(globalConfig) { - var _globalConfig$userPre, _globalConfig$userPre2, _globalConfig$userPre3, _globalConfig$userPre4; - if (typeof ((_globalConfig$userPre = globalConfig.userPreferences) === null || _globalConfig$userPre === void 0 ? void 0 : (_globalConfig$userPre2 = _globalConfig$userPre.platform) === null || _globalConfig$userPre2 === void 0 ? void 0 : _globalConfig$userPre2.name) === 'string') { - switch ((_globalConfig$userPre3 = globalConfig.userPreferences) === null || _globalConfig$userPre3 === void 0 ? void 0 : (_globalConfig$userPre4 = _globalConfig$userPre3.platform) === null || _globalConfig$userPre4 === void 0 ? void 0 : _globalConfig$userPre4.name) { +function createTransport(globalConfig) { + if (typeof globalConfig.userPreferences?.platform?.name === 'string') { + switch (globalConfig.userPreferences?.platform?.name) { case 'ios': case 'macos': return new _appleTransport.AppleTransport(globalConfig); - case 'android': return new _androidTransport.AndroidTransport(globalConfig); - default: throw new Error('selectSender unimplemented!'); } } - if (globalConfig.isWindows) { return new _windowsTransport.WindowsTransport(); - } // fallback for when `globalConfig.userPreferences.platform.name` is absent - + } + // fallback for when `globalConfig.userPreferences.platform.name` is absent if (globalConfig.isDDGApp) { if (globalConfig.isAndroid) { return new _androidTransport.AndroidTransport(globalConfig); } - throw new Error('unreachable, createTransport'); - } // falls back to extension... is this still the best way to determine this? - + } + // falls back to extension... is this still the best way to determine this? return new _extensionTransport.ExtensionTransport(globalConfig); } @@ -15595,9 +13305,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.WindowsTransport = void 0; - var _index = require("../../../packages/device-api/index.js"); - /** * @typedef {import('../../../packages/device-api/lib/device-api').CallOptions} CallOptions * @typedef {import("../../../packages/device-api").DeviceApiCall} DeviceApiCall @@ -15607,19 +13315,15 @@ class WindowsTransport extends _index.DeviceApiTransport { if (deviceApiCall.id) { return windowsTransport(deviceApiCall, options).withResponse(deviceApiCall.id); } - return windowsTransport(deviceApiCall, options); } - } + /** * @param {DeviceApiCall} deviceApiCall * @param {CallOptions} [options] */ - - exports.WindowsTransport = WindowsTransport; - function windowsTransport(deviceApiCall, options) { windowsInteropPostMessage({ Feature: 'Autofill', @@ -15635,7 +13339,6 @@ function windowsTransport(deviceApiCall, options) { withResponse(responseId) { return waitForWindowsResponse(responseId, options); } - }; } /** @@ -15643,47 +13346,39 @@ function windowsTransport(deviceApiCall, options) { * @param {CallOptions} [options] * @returns {Promise} */ - - function waitForWindowsResponse(responseId, options) { return new Promise((resolve, reject) => { - var _options$signal, _options$signal2; - // if already aborted, reject immediately - if (options !== null && options !== void 0 && (_options$signal = options.signal) !== null && _options$signal !== void 0 && _options$signal.aborted) { + if (options?.signal?.aborted) { return reject(new DOMException('Aborted', 'AbortError')); } + let teardown; - let teardown; // The event handler - + // The event handler const handler = event => { // console.log(`📩 windows, ${window.location.href}`, [event.origin, JSON.stringify(event.data)]) if (!event.data) { console.warn('data absent from message'); return; } - if (event.data.type === responseId) { teardown(); resolve(event.data); } - }; // what to do if this promise is aborted - + }; + // what to do if this promise is aborted const abortHandler = () => { teardown(); reject(new DOMException('Aborted', 'AbortError')); - }; // setup - + }; + // setup windowsInteropAddEventListener('message', handler); - options === null || options === void 0 ? void 0 : (_options$signal2 = options.signal) === null || _options$signal2 === void 0 ? void 0 : _options$signal2.addEventListener('abort', abortHandler); - + options?.signal?.addEventListener('abort', abortHandler); teardown = () => { - var _options$signal3; - windowsInteropRemoveEventListener('message', handler); - options === null || options === void 0 ? void 0 : (_options$signal3 = options.signal) === null || _options$signal3 === void 0 ? void 0 : _options$signal3.removeEventListener('abort', abortHandler); + options?.signal?.removeEventListener('abort', abortHandler); }; }); } @@ -15695,7 +13390,6 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; - /*! * Copyright 2015 Google Inc. All rights reserved. * @@ -15711,15 +13405,14 @@ exports.default = void 0; * or implied. See the License for the specific language governing * permissions and limitations under the License. */ - /* * @see https://developers.google.com/web/updates/2015/08/using-requestidlecallback */ // @ts-ignore window.requestIdleCallback = window.requestIdleCallback || function (cb) { return setTimeout(function () { - const start = Date.now(); // eslint-disable-next-line standard/no-callback-literal - + const start = Date.now(); + // eslint-disable-next-line standard/no-callback-literal cb({ didTimeout: false, timeRemaining: function () { @@ -15728,12 +13421,9 @@ window.requestIdleCallback = window.requestIdleCallback || function (cb) { }); }, 1); }; - window.cancelIdleCallback = window.cancelIdleCallback || function (id) { clearTimeout(id); }; - -var _default = {}; -exports.default = _default; +var _default = exports.default = {}; },{}]},{},[52]); diff --git a/jest-test-environment.js b/jest-test-environment.js index dabfbba5e..d1138dcf8 100644 --- a/jest-test-environment.js +++ b/jest-test-environment.js @@ -1,6 +1,6 @@ -const Environment = require('jest-environment-jsdom') +const { TestEnvironment } = require('jest-environment-jsdom') -module.exports = class CustomTestEnvironment extends Environment { +module.exports = class CustomTestEnvironment extends TestEnvironment { async setup () { await super.setup() if (typeof this.global.TextEncoder === 'undefined') { diff --git a/package-lock.json b/package-lock.json index d5af5cb4f..54b9a3427 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,41 +9,42 @@ "hasInstallScript": true, "license": "Apache-2.0", "devDependencies": { - "@babel/core": "^7.17.8", - "@babel/eslint-parser": "^7.18.2", - "@babel/preset-env": "^7.16.11", + "@babel/core": "^7.23.0", + "@babel/eslint-parser": "^7.22.15", + "@babel/preset-env": "^7.22.20", "@duckduckgo/content-scope-scripts": "github:duckduckgo/content-scope-scripts#1.3.0", - "@playwright/test": "^1.32.0", - "@types/jest": "^27.4.1", - "@types/node": "^16.11.36", - "asana": "^1.0.0", - "babel-jest": "^27.5.1", + "@playwright/test": "^1.38.1", + "@types/jest": "^29.5.5", + "@types/node": "^18.17.19", + "asana": "^1.0.2", + "babel-jest": "^29.7.0", "babelify": "^10.0.0", - "eslint": "^7.32.0", + "eslint": "^8.50.0", "eslint-config-standard": "11.0.0", - "eslint-plugin-import": "^2.26.0", + "eslint-plugin-import": "^2.28.1", "eslint-plugin-node": "^11.1.0", - "eslint-plugin-promise": "^6.0.0", + "eslint-plugin-promise": "^6.1.1", "eslint-plugin-standard": "^5.0.0", "fast-check": "^2.25.0", - "grunt": "^1.5.2", + "grunt": "^1.6.1", "grunt-babel": "^8.0.0", "grunt-browserify": "^6.0.0", "grunt-contrib-watch": "^1.1.0", - "grunt-eslint": "^24.0.0", + "grunt-eslint": "^24.3.0", "grunt-exec": "^3.0.0", "http-server": "^14.1.1", - "jest": "^27.5.1", - "jest-chrome": "^0.7.2", - "jest-html-reporter": "^3.4.2", - "json-schema-to-typescript": "^11.0.2", + "jest": "^29.7.0", + "jest-chrome": "^0.8.0", + "jest-environment-jsdom": "^29.7.0", + "jest-html-reporter": "^3.10.2", + "json-schema-to-typescript": "^13.1.1", "load-grunt-tasks": "^5.1.0", "markdown-it": "^13.0.1", - "playwright": "^1.31.2", + "playwright": "^1.38.1", "through2": "^4.0.2", - "ts-to-zod": "^1.13.1", - "typescript": "^4.7.2", - "zod": "^3.16.0" + "ts-to-zod": "^3.1.3", + "typescript": "^5.2.2", + "zod": "^3.22.2" } }, "../content-scope-utils": { @@ -64,60 +65,71 @@ "typescript": "^4.8.4" } }, + "node_modules/@aashutoshrathi/word-wrap": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/@aashutoshrathi/word-wrap/-/word-wrap-1.2.6.tgz", + "integrity": "sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/@ampproject/remapping": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.1.2.tgz", - "integrity": "sha512-hoyByceqwKirw7w3Z7gnIIZC3Wx3J484Y3L/cMpXFbr7d9ZQj2mODrirNzcJa+SM3UlpWXYvKV4RlRpFXlWgXg==", + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.2.1.tgz", + "integrity": "sha512-lFMjJTrFL3j7L9yBxwYfCq2k6qqwHyzuUl/XBnif78PWTJYyL/dfowQHWE3sp6U6ZzqWiiIZnpTMO96zhkjwtg==", "dev": true, "dependencies": { - "@jridgewell/trace-mapping": "^0.3.0" + "@jridgewell/gen-mapping": "^0.3.0", + "@jridgewell/trace-mapping": "^0.3.9" }, "engines": { "node": ">=6.0.0" } }, "node_modules/@babel/code-frame": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.16.7.tgz", - "integrity": "sha512-iAXqUn8IIeBTNd72xsFlgaXHkMBMt6y4HJp1tIaK465CWLT/fG1aqB7ykr95gHHmlBdGbFeWWfyB4NJJ0nmeIg==", + "version": "7.22.13", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.22.13.tgz", + "integrity": "sha512-XktuhWlJ5g+3TJXc5upd9Ks1HutSArik6jf2eAjYFyIOf4ej3RN+184cZbzDvbPnuTJIUhPKKJE3cIsYTiAT3w==", "dev": true, "dependencies": { - "@babel/highlight": "^7.16.7" + "@babel/highlight": "^7.22.13", + "chalk": "^2.4.2" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/compat-data": { - "version": "7.17.7", - "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.17.7.tgz", - "integrity": "sha512-p8pdE6j0a29TNGebNm7NzYZWB3xVZJBZ7XGs42uAKzQo8VQ3F0By/cQCtUEABwIqw5zo6WA4NbmxsfzADzMKnQ==", + "version": "7.22.9", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.22.9.tgz", + "integrity": "sha512-5UamI7xkUcJ3i9qVDS+KFDEK8/7oJ55/sJMB1Ge7IEapr7KfdfV/HErR+koZwOfd+SgtFKOKRhRakdg++DcJpQ==", "dev": true, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/core": { - "version": "7.17.8", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.17.8.tgz", - "integrity": "sha512-OdQDV/7cRBtJHLSOBqqbYNkOcydOgnX59TZx4puf41fzcVtN3e/4yqY8lMQsK+5X2lJtAdmA+6OHqsj1hBJ4IQ==", - "dev": true, - "dependencies": { - "@ampproject/remapping": "^2.1.0", - "@babel/code-frame": "^7.16.7", - "@babel/generator": "^7.17.7", - "@babel/helper-compilation-targets": "^7.17.7", - "@babel/helper-module-transforms": "^7.17.7", - "@babel/helpers": "^7.17.8", - "@babel/parser": "^7.17.8", - "@babel/template": "^7.16.7", - "@babel/traverse": "^7.17.3", - "@babel/types": "^7.17.0", - "convert-source-map": "^1.7.0", + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.23.0.tgz", + "integrity": "sha512-97z/ju/Jy1rZmDxybphrBuI+jtJjFVoz7Mr9yUQVVVi+DNZE333uFQeMOqcCIy1x3WYBIbWftUSLmbNXNT7qFQ==", + "dev": true, + "dependencies": { + "@ampproject/remapping": "^2.2.0", + "@babel/code-frame": "^7.22.13", + "@babel/generator": "^7.23.0", + "@babel/helper-compilation-targets": "^7.22.15", + "@babel/helper-module-transforms": "^7.23.0", + "@babel/helpers": "^7.23.0", + "@babel/parser": "^7.23.0", + "@babel/template": "^7.22.15", + "@babel/traverse": "^7.23.0", + "@babel/types": "^7.23.0", + "convert-source-map": "^2.0.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", - "json5": "^2.1.2", - "semver": "^6.3.0" + "json5": "^2.2.3", + "semver": "^6.3.1" }, "engines": { "node": ">=6.9.0" @@ -128,20 +140,20 @@ } }, "node_modules/@babel/eslint-parser": { - "version": "7.18.2", - "resolved": "https://registry.npmjs.org/@babel/eslint-parser/-/eslint-parser-7.18.2.tgz", - "integrity": "sha512-oFQYkE8SuH14+uR51JVAmdqwKYXGRjEXx7s+WiagVjqQ+HPE+nnwyF2qlVG8evUsUHmPcA+6YXMEDbIhEyQc5A==", + "version": "7.22.15", + "resolved": "https://registry.npmjs.org/@babel/eslint-parser/-/eslint-parser-7.22.15.tgz", + "integrity": "sha512-yc8OOBIQk1EcRrpizuARSQS0TWAcOMpEJ1aafhNznaeYkeL+OhqnDObGFylB8ka8VFF/sZc+S4RzHyO+3LjQxg==", "dev": true, "dependencies": { - "eslint-scope": "^5.1.1", + "@nicolo-ribaudo/eslint-scope-5-internals": "5.1.1-v1", "eslint-visitor-keys": "^2.1.0", - "semver": "^6.3.0" + "semver": "^6.3.1" }, "engines": { "node": "^10.13.0 || ^12.13.0 || >=14.0.0" }, "peerDependencies": { - "@babel/core": ">=7.11.0", + "@babel/core": "^7.11.0", "eslint": "^7.5.0 || ^8.0.0" } }, @@ -155,75 +167,90 @@ } }, "node_modules/@babel/generator": { - "version": "7.17.7", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.17.7.tgz", - "integrity": "sha512-oLcVCTeIFadUoArDTwpluncplrYBmTCCZZgXCbgNGvOBBiSDDK3eWO4b/+eOTli5tKv1lg+a5/NAXg+nTcei1w==", + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.23.0.tgz", + "integrity": "sha512-lN85QRR+5IbYrMWM6Y4pE/noaQtg4pNiqeNGX60eqOfo6gtEj6uw/JagelB8vVztSd7R6M5n1+PQkDbHbBRU4g==", "dev": true, "dependencies": { - "@babel/types": "^7.17.0", - "jsesc": "^2.5.1", - "source-map": "^0.5.0" + "@babel/types": "^7.23.0", + "@jridgewell/gen-mapping": "^0.3.2", + "@jridgewell/trace-mapping": "^0.3.17", + "jsesc": "^2.5.1" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-annotate-as-pure": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.16.7.tgz", - "integrity": "sha512-s6t2w/IPQVTAET1HitoowRGXooX8mCgtuP5195wD/QJPV6wYjpujCGF7JuMODVX2ZAJOf1GT6DT9MHEZvLOFSw==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.22.5.tgz", + "integrity": "sha512-LvBTxu8bQSQkcyKOU+a1btnNFQ1dMAd0R6PyW3arXes06F6QLWLIrd681bxRPIXlrMGR3XYnW9JyML7dP3qgxg==", "dev": true, "dependencies": { - "@babel/types": "^7.16.7" + "@babel/types": "^7.22.5" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-builder-binary-assignment-operator-visitor": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.16.7.tgz", - "integrity": "sha512-C6FdbRaxYjwVu/geKW4ZeQ0Q31AftgRcdSnZ5/jsH6BzCJbtvXvhpfkbkThYSuutZA7nCXpPR6AD9zd1dprMkA==", + "version": "7.22.10", + "resolved": "https://registry.npmjs.org/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.22.10.tgz", + "integrity": "sha512-Av0qubwDQxC56DoUReVDeLfMEjYYSN1nZrTUrWkXd7hpU73ymRANkbuDm3yni9npkn+RXy9nNbEJZEzXr7xrfQ==", "dev": true, "dependencies": { - "@babel/helper-explode-assignable-expression": "^7.16.7", - "@babel/types": "^7.16.7" + "@babel/types": "^7.22.10" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-compilation-targets": { - "version": "7.17.7", - "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.17.7.tgz", - "integrity": "sha512-UFzlz2jjd8kroj0hmCFV5zr+tQPi1dpC2cRsDV/3IEW8bJfCPrPpmcSN6ZS8RqIq4LXcmpipCQFPddyFA5Yc7w==", + "version": "7.22.15", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.22.15.tgz", + "integrity": "sha512-y6EEzULok0Qvz8yyLkCvVX+02ic+By2UdOhylwUOvOn9dvYc9mKICJuuU1n1XBI02YWsNsnrY1kc6DVbjcXbtw==", "dev": true, "dependencies": { - "@babel/compat-data": "^7.17.7", - "@babel/helper-validator-option": "^7.16.7", - "browserslist": "^4.17.5", - "semver": "^6.3.0" + "@babel/compat-data": "^7.22.9", + "@babel/helper-validator-option": "^7.22.15", + "browserslist": "^4.21.9", + "lru-cache": "^5.1.1", + "semver": "^6.3.1" }, "engines": { "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0" } }, + "node_modules/@babel/helper-compilation-targets/node_modules/lru-cache": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", + "dev": true, + "dependencies": { + "yallist": "^3.0.2" + } + }, + "node_modules/@babel/helper-compilation-targets/node_modules/yallist": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", + "dev": true + }, "node_modules/@babel/helper-create-class-features-plugin": { - "version": "7.17.6", - "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.17.6.tgz", - "integrity": "sha512-SogLLSxXm2OkBbSsHZMM4tUi8fUzjs63AT/d0YQIzr6GSd8Hxsbk2KYDX0k0DweAzGMj/YWeiCsorIdtdcW8Eg==", + "version": "7.22.15", + "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.22.15.tgz", + "integrity": "sha512-jKkwA59IXcvSaiK2UN45kKwSC9o+KuoXsBDvHvU/7BecYIp8GQ2UwrVvFgJASUT+hBnwJx6MhvMCuMzwZZ7jlg==", "dev": true, "dependencies": { - "@babel/helper-annotate-as-pure": "^7.16.7", - "@babel/helper-environment-visitor": "^7.16.7", - "@babel/helper-function-name": "^7.16.7", - "@babel/helper-member-expression-to-functions": "^7.16.7", - "@babel/helper-optimise-call-expression": "^7.16.7", - "@babel/helper-replace-supers": "^7.16.7", - "@babel/helper-split-export-declaration": "^7.16.7" + "@babel/helper-annotate-as-pure": "^7.22.5", + "@babel/helper-environment-visitor": "^7.22.5", + "@babel/helper-function-name": "^7.22.5", + "@babel/helper-member-expression-to-functions": "^7.22.15", + "@babel/helper-optimise-call-expression": "^7.22.5", + "@babel/helper-replace-supers": "^7.22.9", + "@babel/helper-skip-transparent-expression-wrappers": "^7.22.5", + "@babel/helper-split-export-declaration": "^7.22.6", + "semver": "^6.3.1" }, "engines": { "node": ">=6.9.0" @@ -233,13 +260,14 @@ } }, "node_modules/@babel/helper-create-regexp-features-plugin": { - "version": "7.17.0", - "resolved": "https://registry.npmjs.org/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.17.0.tgz", - "integrity": "sha512-awO2So99wG6KnlE+TPs6rn83gCz5WlEePJDTnLEqbchMVrBeAujURVphRdigsk094VhvZehFoNOihSlcBjwsXA==", + "version": "7.22.9", + "resolved": "https://registry.npmjs.org/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.22.9.tgz", + "integrity": "sha512-+svjVa/tFwsNSG4NEy1h85+HQ5imbT92Q5/bgtS7P0GTQlP8WuFdqsiABmQouhiFGyV66oGxZFpeYHza1rNsKw==", "dev": true, "dependencies": { - "@babel/helper-annotate-as-pure": "^7.16.7", - "regexpu-core": "^5.0.1" + "@babel/helper-annotate-as-pure": "^7.22.5", + "regexpu-core": "^5.3.1", + "semver": "^6.3.1" }, "engines": { "node": ">=6.9.0" @@ -249,271 +277,252 @@ } }, "node_modules/@babel/helper-define-polyfill-provider": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.3.1.tgz", - "integrity": "sha512-J9hGMpJQmtWmj46B3kBHmL38UhJGhYX7eqkcq+2gsstyYt341HmPeWspihX43yVRA0mS+8GGk2Gckc7bY/HCmA==", + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.4.2.tgz", + "integrity": "sha512-k0qnnOqHn5dK9pZpfD5XXZ9SojAITdCKRn2Lp6rnDGzIbaP0rHyMPk/4wsSxVBVz4RfN0q6VpXWP2pDGIoQ7hw==", "dev": true, "dependencies": { - "@babel/helper-compilation-targets": "^7.13.0", - "@babel/helper-module-imports": "^7.12.13", - "@babel/helper-plugin-utils": "^7.13.0", - "@babel/traverse": "^7.13.0", + "@babel/helper-compilation-targets": "^7.22.6", + "@babel/helper-plugin-utils": "^7.22.5", "debug": "^4.1.1", "lodash.debounce": "^4.0.8", - "resolve": "^1.14.2", - "semver": "^6.1.2" + "resolve": "^1.14.2" }, "peerDependencies": { - "@babel/core": "^7.4.0-0" + "@babel/core": "^7.4.0 || ^8.0.0-0 <8.0.0" } }, "node_modules/@babel/helper-environment-visitor": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.16.7.tgz", - "integrity": "sha512-SLLb0AAn6PkUeAfKJCCOl9e1R53pQlGAfc4y4XuMRZfqeMYLE0dM1LMhqbGAlGQY0lfw5/ohoYWAe9V1yibRag==", - "dev": true, - "dependencies": { - "@babel/types": "^7.16.7" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-explode-assignable-expression": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/helper-explode-assignable-expression/-/helper-explode-assignable-expression-7.16.7.tgz", - "integrity": "sha512-KyUenhWMC8VrxzkGP0Jizjo4/Zx+1nNZhgocs+gLzyZyB8SHidhoq9KK/8Ato4anhwsivfkBLftky7gvzbZMtQ==", + "version": "7.22.20", + "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.20.tgz", + "integrity": "sha512-zfedSIzFhat/gFhWfHtgWvlec0nqB9YEIVrpuwjruLlXfUSnA8cJB0miHKwqDnQ7d32aKo2xt88/xZptwxbfhA==", "dev": true, - "dependencies": { - "@babel/types": "^7.16.7" - }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-function-name": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.16.7.tgz", - "integrity": "sha512-QfDfEnIUyyBSR3HtrtGECuZ6DAyCkYFp7GHl75vFtTnn6pjKeK0T1DB5lLkFvBea8MdaiUABx3osbgLyInoejA==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.22.5.tgz", + "integrity": "sha512-wtHSq6jMRE3uF2otvfuD3DIvVhOsSNshQl0Qrd7qC9oQJzHvOL4qQXlQn2916+CXGywIjpGuIkoyZRRxHPiNQQ==", "dev": true, "dependencies": { - "@babel/helper-get-function-arity": "^7.16.7", - "@babel/template": "^7.16.7", - "@babel/types": "^7.16.7" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-get-function-arity": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.16.7.tgz", - "integrity": "sha512-flc+RLSOBXzNzVhcLu6ujeHUrD6tANAOU5ojrRx/as+tbzf8+stUCj7+IfRRoAbEZqj/ahXEMsjhOhgeZsrnTw==", - "dev": true, - "dependencies": { - "@babel/types": "^7.16.7" + "@babel/template": "^7.22.5", + "@babel/types": "^7.22.5" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-hoist-variables": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.16.7.tgz", - "integrity": "sha512-m04d/0Op34H5v7pbZw6pSKP7weA6lsMvfiIAMeIvkY/R4xQtBSMFEigu9QTZ2qB/9l22vsxtM8a+Q8CzD255fg==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.22.5.tgz", + "integrity": "sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw==", "dev": true, "dependencies": { - "@babel/types": "^7.16.7" + "@babel/types": "^7.22.5" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-member-expression-to-functions": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.16.7.tgz", - "integrity": "sha512-VtJ/65tYiU/6AbMTDwyoXGPKHgTsfRarivm+YbB5uAzKUyuPjgZSgAFeG87FCigc7KNHu2Pegh1XIT3lXjvz3Q==", + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.23.0.tgz", + "integrity": "sha512-6gfrPwh7OuT6gZyJZvd6WbTfrqAo7vm4xCzAXOusKqq/vWdKXphTpj5klHKNmRUU6/QRGlBsyU9mAIPaWHlqJA==", "dev": true, "dependencies": { - "@babel/types": "^7.16.7" + "@babel/types": "^7.23.0" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-module-imports": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.16.7.tgz", - "integrity": "sha512-LVtS6TqjJHFc+nYeITRo6VLXve70xmq7wPhWTqDJusJEgGmkAACWwMiTNrvfoQo6hEhFwAIixNkvB0jPXDL8Wg==", + "version": "7.22.15", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.22.15.tgz", + "integrity": "sha512-0pYVBnDKZO2fnSPCrgM/6WMc7eS20Fbok+0r88fp+YtWVLZrp4CkafFGIp+W0VKw4a22sgebPT99y+FDNMdP4w==", "dev": true, "dependencies": { - "@babel/types": "^7.16.7" + "@babel/types": "^7.22.15" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-module-transforms": { - "version": "7.17.7", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.17.7.tgz", - "integrity": "sha512-VmZD99F3gNTYB7fJRDTi+u6l/zxY0BE6OIxPSU7a50s6ZUQkHwSDmV92FfM+oCG0pZRVojGYhkR8I0OGeCVREw==", + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.23.0.tgz", + "integrity": "sha512-WhDWw1tdrlT0gMgUJSlX0IQvoO1eN279zrAUbVB+KpV2c3Tylz8+GnKOLllCS6Z/iZQEyVYxhZVUdPTqs2YYPw==", "dev": true, "dependencies": { - "@babel/helper-environment-visitor": "^7.16.7", - "@babel/helper-module-imports": "^7.16.7", - "@babel/helper-simple-access": "^7.17.7", - "@babel/helper-split-export-declaration": "^7.16.7", - "@babel/helper-validator-identifier": "^7.16.7", - "@babel/template": "^7.16.7", - "@babel/traverse": "^7.17.3", - "@babel/types": "^7.17.0" + "@babel/helper-environment-visitor": "^7.22.20", + "@babel/helper-module-imports": "^7.22.15", + "@babel/helper-simple-access": "^7.22.5", + "@babel/helper-split-export-declaration": "^7.22.6", + "@babel/helper-validator-identifier": "^7.22.20" }, "engines": { "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" } }, "node_modules/@babel/helper-optimise-call-expression": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.16.7.tgz", - "integrity": "sha512-EtgBhg7rd/JcnpZFXpBy0ze1YRfdm7BnBX4uKMBd3ixa3RGAE002JZB66FJyNH7g0F38U05pXmA5P8cBh7z+1w==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.22.5.tgz", + "integrity": "sha512-HBwaojN0xFRx4yIvpwGqxiV2tUfl7401jlok564NgB9EHS1y6QT17FmKWm4ztqjeVdXLuC4fSvHc5ePpQjoTbw==", "dev": true, "dependencies": { - "@babel/types": "^7.16.7" + "@babel/types": "^7.22.5" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-plugin-utils": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.16.7.tgz", - "integrity": "sha512-Qg3Nk7ZxpgMrsox6HreY1ZNKdBq7K72tDSliA6dCl5f007jR4ne8iD5UzuNnCJH2xBf2BEEVGr+/OL6Gdp7RxA==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.22.5.tgz", + "integrity": "sha512-uLls06UVKgFG9QD4OeFYLEGteMIAa5kpTPcFL28yuCIIzsf6ZyKZMllKVOCZFhiZ5ptnwX4mtKdWCBE/uT4amg==", "dev": true, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-remap-async-to-generator": { - "version": "7.16.8", - "resolved": "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.16.8.tgz", - "integrity": "sha512-fm0gH7Flb8H51LqJHy3HJ3wnE1+qtYR2A99K06ahwrawLdOFsCEWjZOrYricXJHoPSudNKxrMBUPEIPxiIIvBw==", + "version": "7.22.9", + "resolved": "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.22.9.tgz", + "integrity": "sha512-8WWC4oR4Px+tr+Fp0X3RHDVfINGpF3ad1HIbrc8A77epiR6eMMc6jsgozkzT2uDiOOdoS9cLIQ+XD2XvI2WSmQ==", "dev": true, "dependencies": { - "@babel/helper-annotate-as-pure": "^7.16.7", - "@babel/helper-wrap-function": "^7.16.8", - "@babel/types": "^7.16.8" + "@babel/helper-annotate-as-pure": "^7.22.5", + "@babel/helper-environment-visitor": "^7.22.5", + "@babel/helper-wrap-function": "^7.22.9" }, "engines": { "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" } }, "node_modules/@babel/helper-replace-supers": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.16.7.tgz", - "integrity": "sha512-y9vsWilTNaVnVh6xiJfABzsNpgDPKev9HnAgz6Gb1p6UUwf9NepdlsV7VXGCftJM+jqD5f7JIEubcpLjZj5dBw==", + "version": "7.22.9", + "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.22.9.tgz", + "integrity": "sha512-LJIKvvpgPOPUThdYqcX6IXRuIcTkcAub0IaDRGCZH0p5GPUp7PhRU9QVgFcDDd51BaPkk77ZjqFwh6DZTAEmGg==", "dev": true, "dependencies": { - "@babel/helper-environment-visitor": "^7.16.7", - "@babel/helper-member-expression-to-functions": "^7.16.7", - "@babel/helper-optimise-call-expression": "^7.16.7", - "@babel/traverse": "^7.16.7", - "@babel/types": "^7.16.7" + "@babel/helper-environment-visitor": "^7.22.5", + "@babel/helper-member-expression-to-functions": "^7.22.5", + "@babel/helper-optimise-call-expression": "^7.22.5" }, "engines": { "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" } }, "node_modules/@babel/helper-simple-access": { - "version": "7.17.7", - "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.17.7.tgz", - "integrity": "sha512-txyMCGroZ96i+Pxr3Je3lzEJjqwaRC9buMUgtomcrLe5Nd0+fk1h0LLA+ixUF5OW7AhHuQ7Es1WcQJZmZsz2XA==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.22.5.tgz", + "integrity": "sha512-n0H99E/K+Bika3++WNL17POvo4rKWZ7lZEp1Q+fStVbUi8nxPQEBOlTmCOxW/0JsS56SKKQ+ojAe2pHKJHN35w==", "dev": true, "dependencies": { - "@babel/types": "^7.17.0" + "@babel/types": "^7.22.5" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-skip-transparent-expression-wrappers": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.16.0.tgz", - "integrity": "sha512-+il1gTy0oHwUsBQZyJvukbB4vPMdcYBrFHa0Uc4AizLxbq6BOYC51Rv4tWocX9BLBDLZ4kc6qUFpQ6HRgL+3zw==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.22.5.tgz", + "integrity": "sha512-tK14r66JZKiC43p8Ki33yLBVJKlQDFoA8GYN67lWCDCqoL6EMMSuM9b+Iff2jHaM/RRFYl7K+iiru7hbRqNx8Q==", "dev": true, "dependencies": { - "@babel/types": "^7.16.0" + "@babel/types": "^7.22.5" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-split-export-declaration": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.16.7.tgz", - "integrity": "sha512-xbWoy/PFoxSWazIToT9Sif+jJTlrMcndIsaOKvTA6u7QEo7ilkRZpjew18/W3c7nm8fXdUDXh02VXTbZ0pGDNw==", + "version": "7.22.6", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.22.6.tgz", + "integrity": "sha512-AsUnxuLhRYsisFiaJwvp1QF+I3KjD5FOxut14q/GzovUe6orHLesW2C7d754kRm53h5gqrz6sFl6sxc4BVtE/g==", "dev": true, "dependencies": { - "@babel/types": "^7.16.7" + "@babel/types": "^7.22.5" }, "engines": { "node": ">=6.9.0" } }, + "node_modules/@babel/helper-string-parser": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.22.5.tgz", + "integrity": "sha512-mM4COjgZox8U+JcXQwPijIZLElkgEpO5rsERVDJTc2qfCDfERyob6k5WegS14SX18IIjv+XD+GrqNumY5JRCDw==", + "dev": true, + "engines": { + "node": ">=6.9.0" + } + }, "node_modules/@babel/helper-validator-identifier": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.16.7.tgz", - "integrity": "sha512-hsEnFemeiW4D08A5gUAZxLBTXpZ39P+a+DGDsHw1yxqyQ/jzFEnxf5uTEGp+3bzAbNOxU1paTgYS4ECU/IgfDw==", + "version": "7.22.20", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz", + "integrity": "sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==", "dev": true, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-validator-option": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.16.7.tgz", - "integrity": "sha512-TRtenOuRUVo9oIQGPC5G9DgK4743cdxvtOw0weQNpZXaS16SCBi5MNjZF8vba3ETURjZpTbVn7Vvcf2eAwFozQ==", + "version": "7.22.15", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.22.15.tgz", + "integrity": "sha512-bMn7RmyFjY/mdECUbgn9eoSY4vqvacUnS9i9vGAGttgFWesO6B4CYWA7XlpbWgBt71iv/hfbPlynohStqnu5hA==", "dev": true, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-wrap-function": { - "version": "7.16.8", - "resolved": "https://registry.npmjs.org/@babel/helper-wrap-function/-/helper-wrap-function-7.16.8.tgz", - "integrity": "sha512-8RpyRVIAW1RcDDGTA+GpPAwV22wXCfKOoM9bet6TLkGIFTkRQSkH1nMQ5Yet4MpoXe1ZwHPVtNasc2w0uZMqnw==", + "version": "7.22.10", + "resolved": "https://registry.npmjs.org/@babel/helper-wrap-function/-/helper-wrap-function-7.22.10.tgz", + "integrity": "sha512-OnMhjWjuGYtdoO3FmsEFWvBStBAe2QOgwOLsLNDjN+aaiMD8InJk1/O3HSD8lkqTjCgg5YI34Tz15KNNA3p+nQ==", "dev": true, "dependencies": { - "@babel/helper-function-name": "^7.16.7", - "@babel/template": "^7.16.7", - "@babel/traverse": "^7.16.8", - "@babel/types": "^7.16.8" + "@babel/helper-function-name": "^7.22.5", + "@babel/template": "^7.22.5", + "@babel/types": "^7.22.10" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helpers": { - "version": "7.17.8", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.17.8.tgz", - "integrity": "sha512-QcL86FGxpfSJwGtAvv4iG93UL6bmqBdmoVY0CMCU2g+oD2ezQse3PT5Pa+jiD6LJndBQi0EDlpzOWNlLuhz5gw==", + "version": "7.23.1", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.23.1.tgz", + "integrity": "sha512-chNpneuK18yW5Oxsr+t553UZzzAs3aZnFm4bxhebsNTeshrC95yA7l5yl7GBAG+JG1rF0F7zzD2EixK9mWSDoA==", "dev": true, "dependencies": { - "@babel/template": "^7.16.7", - "@babel/traverse": "^7.17.3", - "@babel/types": "^7.17.0" + "@babel/template": "^7.22.15", + "@babel/traverse": "^7.23.0", + "@babel/types": "^7.23.0" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/highlight": { - "version": "7.16.10", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.16.10.tgz", - "integrity": "sha512-5FnTQLSLswEj6IkgVw5KusNUUFY9ZGqe/TRFnP/BKYHYgfh7tc+C7mwiy95/yNP7Dh9x580Vv8r7u7ZfTBFxdw==", + "version": "7.22.20", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.22.20.tgz", + "integrity": "sha512-dkdMCN3py0+ksCgYmGG8jKeGA/8Tk+gJwSYYlFGxG5lmhfKNoAy004YpLxpS1W2J8m/EK2Ew+yOs9pVRwO89mg==", "dev": true, "dependencies": { - "@babel/helper-validator-identifier": "^7.16.7", - "chalk": "^2.0.0", + "@babel/helper-validator-identifier": "^7.22.20", + "chalk": "^2.4.2", "js-tokens": "^4.0.0" }, "engines": { @@ -521,9 +530,9 @@ } }, "node_modules/@babel/parser": { - "version": "7.17.8", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.17.8.tgz", - "integrity": "sha512-BoHhDJrJXqcg+ZL16Xv39H9n+AqJ4pcDrQBGZN+wHxIysrLZ3/ECwCBUch/1zUNhnsXULcONU3Ei5Hmkfk6kiQ==", + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.23.0.tgz", + "integrity": "sha512-vvPKKdMemU85V9WE/l5wZEmImpCtLqbnTvqDS2U1fJ96KrxoW7KrXhNsNCblQlg8Ck4b85yxdTyelsMUgFUXiw==", "dev": true, "bin": { "parser": "bin/babel-parser.js" @@ -533,12 +542,12 @@ } }, "node_modules/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/-/plugin-bugfix-safari-id-destructuring-collision-in-function-expression-7.16.7.tgz", - "integrity": "sha512-anv/DObl7waiGEnC24O9zqL0pSuI9hljihqiDuFHC8d7/bjr/4RLGPWuc8rYOff/QPzbEPSkzG8wGG9aDuhHRg==", + "version": "7.22.15", + "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/-/plugin-bugfix-safari-id-destructuring-collision-in-function-expression-7.22.15.tgz", + "integrity": "sha512-FB9iYlz7rURmRJyXRKEnalYPPdn87H5no108cyuQQyMwlpJ2SJtpIUBI27kdTin956pz+LPypkPVPUTlxOmrsg==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.16.7" + "@babel/helper-plugin-utils": "^7.22.5" }, "engines": { "node": ">=6.9.0" @@ -548,14 +557,14 @@ } }, "node_modules/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/-/plugin-bugfix-v8-spread-parameters-in-optional-chaining-7.16.7.tgz", - "integrity": "sha512-di8vUHRdf+4aJ7ltXhaDbPoszdkh59AQtJM5soLsuHpQJdFQZOA4uGj0V2u/CZ8bJ/u8ULDL5yq6FO/bCXnKHw==", + "version": "7.22.15", + "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/-/plugin-bugfix-v8-spread-parameters-in-optional-chaining-7.22.15.tgz", + "integrity": "sha512-Hyph9LseGvAeeXzikV88bczhsrLrIZqDPxO+sSmAunMPaGrBGhfMWzCPYTtiW9t+HzSE2wtV8e5cc5P6r1xMDQ==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.16.7", - "@babel/helper-skip-transparent-expression-wrappers": "^7.16.0", - "@babel/plugin-proposal-optional-chaining": "^7.16.7" + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/helper-skip-transparent-expression-wrappers": "^7.22.5", + "@babel/plugin-transform-optional-chaining": "^7.22.15" }, "engines": { "node": ">=6.9.0" @@ -564,231 +573,11 @@ "@babel/core": "^7.13.0" } }, - "node_modules/@babel/plugin-proposal-async-generator-functions": { - "version": "7.16.8", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.16.8.tgz", - "integrity": "sha512-71YHIvMuiuqWJQkebWJtdhQTfd4Q4mF76q2IX37uZPkG9+olBxsX+rH1vkhFto4UeJZ9dPY2s+mDvhDm1u2BGQ==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.16.7", - "@babel/helper-remap-async-to-generator": "^7.16.8", - "@babel/plugin-syntax-async-generators": "^7.8.4" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-proposal-class-properties": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.16.7.tgz", - "integrity": "sha512-IobU0Xme31ewjYOShSIqd/ZGM/r/cuOz2z0MDbNrhF5FW+ZVgi0f2lyeoj9KFPDOAqsYxmLWZte1WOwlvY9aww==", - "dev": true, - "dependencies": { - "@babel/helper-create-class-features-plugin": "^7.16.7", - "@babel/helper-plugin-utils": "^7.16.7" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-proposal-class-static-block": { - "version": "7.17.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-class-static-block/-/plugin-proposal-class-static-block-7.17.6.tgz", - "integrity": "sha512-X/tididvL2zbs7jZCeeRJ8167U/+Ac135AM6jCAx6gYXDUviZV5Ku9UDvWS2NCuWlFjIRXklYhwo6HhAC7ETnA==", - "dev": true, - "dependencies": { - "@babel/helper-create-class-features-plugin": "^7.17.6", - "@babel/helper-plugin-utils": "^7.16.7", - "@babel/plugin-syntax-class-static-block": "^7.14.5" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.12.0" - } - }, - "node_modules/@babel/plugin-proposal-dynamic-import": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-dynamic-import/-/plugin-proposal-dynamic-import-7.16.7.tgz", - "integrity": "sha512-I8SW9Ho3/8DRSdmDdH3gORdyUuYnk1m4cMxUAdu5oy4n3OfN8flDEH+d60iG7dUfi0KkYwSvoalHzzdRzpWHTg==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.16.7", - "@babel/plugin-syntax-dynamic-import": "^7.8.3" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-proposal-export-namespace-from": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-export-namespace-from/-/plugin-proposal-export-namespace-from-7.16.7.tgz", - "integrity": "sha512-ZxdtqDXLRGBL64ocZcs7ovt71L3jhC1RGSyR996svrCi3PYqHNkb3SwPJCs8RIzD86s+WPpt2S73+EHCGO+NUA==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.16.7", - "@babel/plugin-syntax-export-namespace-from": "^7.8.3" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-proposal-json-strings": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-json-strings/-/plugin-proposal-json-strings-7.16.7.tgz", - "integrity": "sha512-lNZ3EEggsGY78JavgbHsK9u5P3pQaW7k4axlgFLYkMd7UBsiNahCITShLjNQschPyjtO6dADrL24757IdhBrsQ==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.16.7", - "@babel/plugin-syntax-json-strings": "^7.8.3" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-proposal-logical-assignment-operators": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-logical-assignment-operators/-/plugin-proposal-logical-assignment-operators-7.16.7.tgz", - "integrity": "sha512-K3XzyZJGQCr00+EtYtrDjmwX7o7PLK6U9bi1nCwkQioRFVUv6dJoxbQjtWVtP+bCPy82bONBKG8NPyQ4+i6yjg==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.16.7", - "@babel/plugin-syntax-logical-assignment-operators": "^7.10.4" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-proposal-nullish-coalescing-operator": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-nullish-coalescing-operator/-/plugin-proposal-nullish-coalescing-operator-7.16.7.tgz", - "integrity": "sha512-aUOrYU3EVtjf62jQrCj63pYZ7k6vns2h/DQvHPWGmsJRYzWXZ6/AsfgpiRy6XiuIDADhJzP2Q9MwSMKauBQ+UQ==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.16.7", - "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-proposal-numeric-separator": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-numeric-separator/-/plugin-proposal-numeric-separator-7.16.7.tgz", - "integrity": "sha512-vQgPMknOIgiuVqbokToyXbkY/OmmjAzr/0lhSIbG/KmnzXPGwW/AdhdKpi+O4X/VkWiWjnkKOBiqJrTaC98VKw==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.16.7", - "@babel/plugin-syntax-numeric-separator": "^7.10.4" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-proposal-object-rest-spread": { - "version": "7.17.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.17.3.tgz", - "integrity": "sha512-yuL5iQA/TbZn+RGAfxQXfi7CNLmKi1f8zInn4IgobuCWcAb7i+zj4TYzQ9l8cEzVyJ89PDGuqxK1xZpUDISesw==", - "dev": true, - "dependencies": { - "@babel/compat-data": "^7.17.0", - "@babel/helper-compilation-targets": "^7.16.7", - "@babel/helper-plugin-utils": "^7.16.7", - "@babel/plugin-syntax-object-rest-spread": "^7.8.3", - "@babel/plugin-transform-parameters": "^7.16.7" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-proposal-optional-catch-binding": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-optional-catch-binding/-/plugin-proposal-optional-catch-binding-7.16.7.tgz", - "integrity": "sha512-eMOH/L4OvWSZAE1VkHbr1vckLG1WUcHGJSLqqQwl2GaUqG6QjddvrOaTUMNYiv77H5IKPMZ9U9P7EaHwvAShfA==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.16.7", - "@babel/plugin-syntax-optional-catch-binding": "^7.8.3" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-proposal-optional-chaining": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.16.7.tgz", - "integrity": "sha512-eC3xy+ZrUcBtP7x+sq62Q/HYd674pPTb/77XZMb5wbDPGWIdUbSr4Agr052+zaUPSb+gGRnjxXfKFvx5iMJ+DA==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.16.7", - "@babel/helper-skip-transparent-expression-wrappers": "^7.16.0", - "@babel/plugin-syntax-optional-chaining": "^7.8.3" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-proposal-private-methods": { - "version": "7.16.11", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-private-methods/-/plugin-proposal-private-methods-7.16.11.tgz", - "integrity": "sha512-F/2uAkPlXDr8+BHpZvo19w3hLFKge+k75XUprE6jaqKxjGkSYcK+4c+bup5PdW/7W/Rpjwql7FTVEDW+fRAQsw==", - "dev": true, - "dependencies": { - "@babel/helper-create-class-features-plugin": "^7.16.10", - "@babel/helper-plugin-utils": "^7.16.7" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, "node_modules/@babel/plugin-proposal-private-property-in-object": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-private-property-in-object/-/plugin-proposal-private-property-in-object-7.16.7.tgz", - "integrity": "sha512-rMQkjcOFbm+ufe3bTZLyOfsOUOxyvLXZJCTARhJr+8UMSoZmqTe1K1BgkFcrW37rAchWg57yI69ORxiWvUINuQ==", + "version": "7.21.0-placeholder-for-preset-env.2", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-private-property-in-object/-/plugin-proposal-private-property-in-object-7.21.0-placeholder-for-preset-env.2.tgz", + "integrity": "sha512-SOSkfJDddaM7mak6cPEpswyTRnuRltl429hMraQEglW+OkovnCzsiszTmsrlY//qLFjCpQDFRvjdm2wA5pPm9w==", "dev": true, - "dependencies": { - "@babel/helper-annotate-as-pure": "^7.16.7", - "@babel/helper-create-class-features-plugin": "^7.16.7", - "@babel/helper-plugin-utils": "^7.16.7", - "@babel/plugin-syntax-private-property-in-object": "^7.14.5" - }, "engines": { "node": ">=6.9.0" }, @@ -796,22 +585,6 @@ "@babel/core": "^7.0.0-0" } }, - "node_modules/@babel/plugin-proposal-unicode-property-regex": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.16.7.tgz", - "integrity": "sha512-QRK0YI/40VLhNVGIjRNAAQkEHws0cswSdFFjpFyt943YmJIU1da9uW63Iu6NFV6CxTZW5eTDCrwZUstBWgp/Rg==", - "dev": true, - "dependencies": { - "@babel/helper-create-regexp-features-plugin": "^7.16.7", - "@babel/helper-plugin-utils": "^7.16.7" - }, - "engines": { - "node": ">=4" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, "node_modules/@babel/plugin-syntax-async-generators": { "version": "7.8.4", "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.8.4.tgz", @@ -881,6 +654,36 @@ "@babel/core": "^7.0.0-0" } }, + "node_modules/@babel/plugin-syntax-import-assertions": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-assertions/-/plugin-syntax-import-assertions-7.22.5.tgz", + "integrity": "sha512-rdV97N7KqsRzeNGoWUOK6yUsWarLjE5Su/Snk9IYPU9CwkWHs4t+rTGOvffTR8XGkJMTAdLfO0xVnXm8wugIJg==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-import-attributes": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-attributes/-/plugin-syntax-import-attributes-7.22.5.tgz", + "integrity": "sha512-KwvoWDeNKPETmozyFE0P2rOLqh39EoQHNjqizrI5B8Vt0ZNS7M56s7dAiAqbYfiAYOuIzIh96z3iR2ktgu3tEg==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, "node_modules/@babel/plugin-syntax-import-meta": { "version": "7.10.4", "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-meta/-/plugin-syntax-import-meta-7.10.4.tgz", @@ -902,6 +705,21 @@ "@babel/helper-plugin-utils": "^7.8.0" } }, + "node_modules/@babel/plugin-syntax-jsx": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.22.5.tgz", + "integrity": "sha512-gvyP4hZrgrs/wWMaocvxZ44Hw0b3W8Pe+cMxc8V1ULQ07oh8VNbIRaoD1LRZVTvD+0nieDKjfgKg89sD7rrKrg==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, "node_modules/@babel/plugin-syntax-logical-assignment-operators": { "version": "7.10.4", "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-logical-assignment-operators/-/plugin-syntax-logical-assignment-operators-7.10.4.tgz", @@ -987,12 +805,12 @@ } }, "node_modules/@babel/plugin-syntax-typescript": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.16.7.tgz", - "integrity": "sha512-YhUIJHHGkqPgEcMYkPCKTyGUdoGKWtopIycQyjJH8OjvRgOYsXsaKehLVPScKJWAULPxMa4N1vCe6szREFlZ7A==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.22.5.tgz", + "integrity": "sha512-1mS2o03i7t1c6VzH6fdQ3OA8tcEIxwG18zIPRp+UY1Ihv6W+XZzBCVxExF9upussPXJ0xE9XRHwMoNs1ep/nRQ==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.16.7" + "@babel/helper-plugin-utils": "^7.22.5" }, "engines": { "node": ">=6.9.0" @@ -1001,30 +819,29 @@ "@babel/core": "^7.0.0-0" } }, - "node_modules/@babel/plugin-transform-arrow-functions": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.16.7.tgz", - "integrity": "sha512-9ffkFFMbvzTvv+7dTp/66xvZAWASuPD5Tl9LK3Z9vhOmANo6j94rik+5YMBt4CwHVMWLWpMsriIc2zsa3WW3xQ==", + "node_modules/@babel/plugin-syntax-unicode-sets-regex": { + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-unicode-sets-regex/-/plugin-syntax-unicode-sets-regex-7.18.6.tgz", + "integrity": "sha512-727YkEAPwSIQTv5im8QHz3upqp92JTWhidIC81Tdx4VJYIte/VndKf1qKrfnnhPLiPghStWfvC/iFaMCQu7Nqg==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.16.7" + "@babel/helper-create-regexp-features-plugin": "^7.18.6", + "@babel/helper-plugin-utils": "^7.18.6" }, "engines": { "node": ">=6.9.0" }, "peerDependencies": { - "@babel/core": "^7.0.0-0" + "@babel/core": "^7.0.0" } }, - "node_modules/@babel/plugin-transform-async-to-generator": { - "version": "7.16.8", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.16.8.tgz", - "integrity": "sha512-MtmUmTJQHCnyJVrScNzNlofQJ3dLFuobYn3mwOTKHnSCMtbNsqvF71GQmJfFjdrXSsAA7iysFmYWw4bXZ20hOg==", + "node_modules/@babel/plugin-transform-arrow-functions": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.22.5.tgz", + "integrity": "sha512-26lTNXoVRdAnsaDXPpvCNUq+OVWEVC6bx7Vvz9rC53F2bagUWW4u4ii2+h8Fejfh7RYqPxn+libeFBBck9muEw==", "dev": true, "dependencies": { - "@babel/helper-module-imports": "^7.16.7", - "@babel/helper-plugin-utils": "^7.16.7", - "@babel/helper-remap-async-to-generator": "^7.16.8" + "@babel/helper-plugin-utils": "^7.22.5" }, "engines": { "node": ">=6.9.0" @@ -1033,13 +850,16 @@ "@babel/core": "^7.0.0-0" } }, - "node_modules/@babel/plugin-transform-block-scoped-functions": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.16.7.tgz", - "integrity": "sha512-JUuzlzmF40Z9cXyytcbZEZKckgrQzChbQJw/5PuEHYeqzCsvebDx0K0jWnIIVcmmDOAVctCgnYs0pMcrYj2zJg==", + "node_modules/@babel/plugin-transform-async-generator-functions": { + "version": "7.22.15", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-generator-functions/-/plugin-transform-async-generator-functions-7.22.15.tgz", + "integrity": "sha512-jBm1Es25Y+tVoTi5rfd5t1KLmL8ogLKpXszboWOTTtGFGz2RKnQe2yn7HbZ+kb/B8N0FVSGQo874NSlOU1T4+w==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.16.7" + "@babel/helper-environment-visitor": "^7.22.5", + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/helper-remap-async-to-generator": "^7.22.9", + "@babel/plugin-syntax-async-generators": "^7.8.4" }, "engines": { "node": ">=6.9.0" @@ -1048,13 +868,15 @@ "@babel/core": "^7.0.0-0" } }, - "node_modules/@babel/plugin-transform-block-scoping": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.16.7.tgz", - "integrity": "sha512-ObZev2nxVAYA4bhyusELdo9hb3H+A56bxH3FZMbEImZFiEDYVHXQSJ1hQKFlDnlt8G9bBrCZ5ZpURZUrV4G5qQ==", + "node_modules/@babel/plugin-transform-async-to-generator": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.22.5.tgz", + "integrity": "sha512-b1A8D8ZzE/VhNDoV1MSJTnpKkCG5bJo+19R4o4oy03zM7ws8yEMK755j61Dc3EyvdysbqH5BOOTquJ7ZX9C6vQ==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.16.7" + "@babel/helper-module-imports": "^7.22.5", + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/helper-remap-async-to-generator": "^7.22.5" }, "engines": { "node": ">=6.9.0" @@ -1063,20 +885,13 @@ "@babel/core": "^7.0.0-0" } }, - "node_modules/@babel/plugin-transform-classes": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.16.7.tgz", - "integrity": "sha512-WY7og38SFAGYRe64BrjKf8OrE6ulEHtr5jEYaZMwox9KebgqPi67Zqz8K53EKk1fFEJgm96r32rkKZ3qA2nCWQ==", - "dev": true, - "dependencies": { - "@babel/helper-annotate-as-pure": "^7.16.7", - "@babel/helper-environment-visitor": "^7.16.7", - "@babel/helper-function-name": "^7.16.7", - "@babel/helper-optimise-call-expression": "^7.16.7", - "@babel/helper-plugin-utils": "^7.16.7", - "@babel/helper-replace-supers": "^7.16.7", - "@babel/helper-split-export-declaration": "^7.16.7", - "globals": "^11.1.0" + "node_modules/@babel/plugin-transform-block-scoped-functions": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.22.5.tgz", + "integrity": "sha512-tdXZ2UdknEKQWKJP1KMNmuF5Lx3MymtMN/pvA+p/VEkhK8jVcQ1fzSy8KM9qRYhAf2/lV33hoMPKI/xaI9sADA==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.22.5" }, "engines": { "node": ">=6.9.0" @@ -1085,13 +900,13 @@ "@babel/core": "^7.0.0-0" } }, - "node_modules/@babel/plugin-transform-computed-properties": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.16.7.tgz", - "integrity": "sha512-gN72G9bcmenVILj//sv1zLNaPyYcOzUho2lIJBMh/iakJ9ygCo/hEF9cpGb61SCMEDxbbyBoVQxrt+bWKu5KGw==", + "node_modules/@babel/plugin-transform-block-scoping": { + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.23.0.tgz", + "integrity": "sha512-cOsrbmIOXmf+5YbL99/S49Y3j46k/T16b9ml8bm9lP6N9US5iQ2yBK7gpui1pg0V/WMcXdkfKbTb7HXq9u+v4g==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.16.7" + "@babel/helper-plugin-utils": "^7.22.5" }, "engines": { "node": ">=6.9.0" @@ -1100,13 +915,14 @@ "@babel/core": "^7.0.0-0" } }, - "node_modules/@babel/plugin-transform-destructuring": { - "version": "7.17.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.17.3.tgz", - "integrity": "sha512-dDFzegDYKlPqa72xIlbmSkly5MluLoaC1JswABGktyt6NTXSBcUuse/kWE/wvKFWJHPETpi158qJZFS3JmykJg==", + "node_modules/@babel/plugin-transform-class-properties": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-class-properties/-/plugin-transform-class-properties-7.22.5.tgz", + "integrity": "sha512-nDkQ0NfkOhPTq8YCLiWNxp1+f9fCobEjCb0n8WdbNUBc4IB5V7P1QnX9IjpSoquKrXF5SKojHleVNs2vGeHCHQ==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.16.7" + "@babel/helper-create-class-features-plugin": "^7.22.5", + "@babel/helper-plugin-utils": "^7.22.5" }, "engines": { "node": ">=6.9.0" @@ -1115,14 +931,85 @@ "@babel/core": "^7.0.0-0" } }, - "node_modules/@babel/plugin-transform-dotall-regex": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.16.7.tgz", - "integrity": "sha512-Lyttaao2SjZF6Pf4vk1dVKv8YypMpomAbygW+mU5cYP3S5cWTfCJjG8xV6CFdzGFlfWK81IjL9viiTvpb6G7gQ==", + "node_modules/@babel/plugin-transform-class-static-block": { + "version": "7.22.11", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-class-static-block/-/plugin-transform-class-static-block-7.22.11.tgz", + "integrity": "sha512-GMM8gGmqI7guS/llMFk1bJDkKfn3v3C4KHK9Yg1ey5qcHcOlKb0QvcMrgzvxo+T03/4szNh5lghY+fEC98Kq9g==", "dev": true, "dependencies": { - "@babel/helper-create-regexp-features-plugin": "^7.16.7", - "@babel/helper-plugin-utils": "^7.16.7" + "@babel/helper-create-class-features-plugin": "^7.22.11", + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/plugin-syntax-class-static-block": "^7.14.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.12.0" + } + }, + "node_modules/@babel/plugin-transform-classes": { + "version": "7.22.15", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.22.15.tgz", + "integrity": "sha512-VbbC3PGjBdE0wAWDdHM9G8Gm977pnYI0XpqMd6LrKISj8/DJXEsWqgRuTYaNE9Bv0JGhTZUzHDlMk18IpOuoqw==", + "dev": true, + "dependencies": { + "@babel/helper-annotate-as-pure": "^7.22.5", + "@babel/helper-compilation-targets": "^7.22.15", + "@babel/helper-environment-visitor": "^7.22.5", + "@babel/helper-function-name": "^7.22.5", + "@babel/helper-optimise-call-expression": "^7.22.5", + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/helper-replace-supers": "^7.22.9", + "@babel/helper-split-export-declaration": "^7.22.6", + "globals": "^11.1.0" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-computed-properties": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.22.5.tgz", + "integrity": "sha512-4GHWBgRf0krxPX+AaPtgBAlTgTeZmqDynokHOX7aqqAB4tHs3U2Y02zH6ETFdLZGcg9UQSD1WCmkVrE9ErHeOg==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/template": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-destructuring": { + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.23.0.tgz", + "integrity": "sha512-vaMdgNXFkYrB+8lbgniSYWHsgqK5gjaMNcc84bMIOMRLH0L9AqYq3hwMdvnyqj1OPqea8UtjPEuS/DCenah1wg==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-dotall-regex": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.22.5.tgz", + "integrity": "sha512-5/Yk9QxCQCl+sOIB1WelKnVRxTJDSAIxtJLL2/pqL14ZVlbH0fUQUZa/T5/UnQtBNgghR7mfB8ERBKyKPCi7Vw==", + "dev": true, + "dependencies": { + "@babel/helper-create-regexp-features-plugin": "^7.22.5", + "@babel/helper-plugin-utils": "^7.22.5" }, "engines": { "node": ">=6.9.0" @@ -1132,12 +1019,28 @@ } }, "node_modules/@babel/plugin-transform-duplicate-keys": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.16.7.tgz", - "integrity": "sha512-03DvpbRfvWIXyK0/6QiR1KMTWeT6OcQ7tbhjrXyFS02kjuX/mu5Bvnh5SDSWHxyawit2g5aWhKwI86EE7GUnTw==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.22.5.tgz", + "integrity": "sha512-dEnYD+9BBgld5VBXHnF/DbYGp3fqGMsyxKbtD1mDyIA7AkTSpKXFhCVuj/oQVOoALfBs77DudA0BE4d5mcpmqw==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-dynamic-import": { + "version": "7.22.11", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-dynamic-import/-/plugin-transform-dynamic-import-7.22.11.tgz", + "integrity": "sha512-g/21plo58sfteWjaO0ZNVb+uEOkJNjAaHhbejrnBmu011l/eNDScmkbjCC3l4FKb10ViaGU4aOkFznSu2zRHgA==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.16.7" + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/plugin-syntax-dynamic-import": "^7.8.3" }, "engines": { "node": ">=6.9.0" @@ -1147,13 +1050,29 @@ } }, "node_modules/@babel/plugin-transform-exponentiation-operator": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.16.7.tgz", - "integrity": "sha512-8UYLSlyLgRixQvlYH3J2ekXFHDFLQutdy7FfFAMm3CPZ6q9wHCwnUyiXpQCe3gVVnQlHc5nsuiEVziteRNTXEA==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.22.5.tgz", + "integrity": "sha512-vIpJFNM/FjZ4rh1myqIya9jXwrwwgFRHPjT3DkUA9ZLHuzox8jiXkOLvwm1H+PQIP3CqfC++WPKeuDi0Sjdj1g==", + "dev": true, + "dependencies": { + "@babel/helper-builder-binary-assignment-operator-visitor": "^7.22.5", + "@babel/helper-plugin-utils": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-export-namespace-from": { + "version": "7.22.11", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-export-namespace-from/-/plugin-transform-export-namespace-from-7.22.11.tgz", + "integrity": "sha512-xa7aad7q7OiT8oNZ1mU7NrISjlSkVdMbNxn9IuLZyL9AJEhs1Apba3I+u5riX1dIkdptP5EKDG5XDPByWxtehw==", "dev": true, "dependencies": { - "@babel/helper-builder-binary-assignment-operator-visitor": "^7.16.7", - "@babel/helper-plugin-utils": "^7.16.7" + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/plugin-syntax-export-namespace-from": "^7.8.3" }, "engines": { "node": ">=6.9.0" @@ -1163,12 +1082,12 @@ } }, "node_modules/@babel/plugin-transform-for-of": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.16.7.tgz", - "integrity": "sha512-/QZm9W92Ptpw7sjI9Nx1mbcsWz33+l8kuMIQnDwgQBG5s3fAfQvkRjQ7NqXhtNcKOnPkdICmUHyCaWW06HCsqg==", + "version": "7.22.15", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.22.15.tgz", + "integrity": "sha512-me6VGeHsx30+xh9fbDLLPi0J1HzmeIIyenoOQHuw2D4m2SAU3NrspX5XxJLBpqn5yrLzrlw2Iy3RA//Bx27iOA==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.16.7" + "@babel/helper-plugin-utils": "^7.22.5" }, "engines": { "node": ">=6.9.0" @@ -1178,14 +1097,30 @@ } }, "node_modules/@babel/plugin-transform-function-name": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.16.7.tgz", - "integrity": "sha512-SU/C68YVwTRxqWj5kgsbKINakGag0KTgq9f2iZEXdStoAbOzLHEBRYzImmA6yFo8YZhJVflvXmIHUO7GWHmxxA==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.22.5.tgz", + "integrity": "sha512-UIzQNMS0p0HHiQm3oelztj+ECwFnj+ZRV4KnguvlsD2of1whUeM6o7wGNj6oLwcDoAXQ8gEqfgC24D+VdIcevg==", + "dev": true, + "dependencies": { + "@babel/helper-compilation-targets": "^7.22.5", + "@babel/helper-function-name": "^7.22.5", + "@babel/helper-plugin-utils": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-json-strings": { + "version": "7.22.11", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-json-strings/-/plugin-transform-json-strings-7.22.11.tgz", + "integrity": "sha512-CxT5tCqpA9/jXFlme9xIBCc5RPtdDq3JpkkhgHQqtDdiTnTI0jtZ0QzXhr5DILeYifDPp2wvY2ad+7+hLMW5Pw==", "dev": true, "dependencies": { - "@babel/helper-compilation-targets": "^7.16.7", - "@babel/helper-function-name": "^7.16.7", - "@babel/helper-plugin-utils": "^7.16.7" + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/plugin-syntax-json-strings": "^7.8.3" }, "engines": { "node": ">=6.9.0" @@ -1195,12 +1130,28 @@ } }, "node_modules/@babel/plugin-transform-literals": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-literals/-/plugin-transform-literals-7.16.7.tgz", - "integrity": "sha512-6tH8RTpTWI0s2sV6uq3e/C9wPo4PTqqZps4uF0kzQ9/xPLFQtipynvmT1g/dOfEJ+0EQsHhkQ/zyRId8J2b8zQ==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-literals/-/plugin-transform-literals-7.22.5.tgz", + "integrity": "sha512-fTLj4D79M+mepcw3dgFBTIDYpbcB9Sm0bpm4ppXPaO+U+PKFFyV9MGRvS0gvGw62sd10kT5lRMKXAADb9pWy8g==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-logical-assignment-operators": { + "version": "7.22.11", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-logical-assignment-operators/-/plugin-transform-logical-assignment-operators-7.22.11.tgz", + "integrity": "sha512-qQwRTP4+6xFCDV5k7gZBF3C31K34ut0tbEcTKxlX/0KXxm9GLcO14p570aWxFvVzx6QAfPgq7gaeIHXJC8LswQ==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.16.7" + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/plugin-syntax-logical-assignment-operators": "^7.10.4" }, "engines": { "node": ">=6.9.0" @@ -1210,12 +1161,12 @@ } }, "node_modules/@babel/plugin-transform-member-expression-literals": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.16.7.tgz", - "integrity": "sha512-mBruRMbktKQwbxaJof32LT9KLy2f3gH+27a5XSuXo6h7R3vqltl0PgZ80C8ZMKw98Bf8bqt6BEVi3svOh2PzMw==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.22.5.tgz", + "integrity": "sha512-RZEdkNtzzYCFl9SE9ATaUMTj2hqMb4StarOJLrZRbqqU4HSBE7UlBw9WBWQiDzrJZJdUWiMTVDI6Gv/8DPvfew==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.16.7" + "@babel/helper-plugin-utils": "^7.22.5" }, "engines": { "node": ">=6.9.0" @@ -1225,14 +1176,13 @@ } }, "node_modules/@babel/plugin-transform-modules-amd": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.16.7.tgz", - "integrity": "sha512-KaaEtgBL7FKYwjJ/teH63oAmE3lP34N3kshz8mm4VMAw7U3PxjVwwUmxEFksbgsNUaO3wId9R2AVQYSEGRa2+g==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.22.5.tgz", + "integrity": "sha512-R+PTfLTcYEmb1+kK7FNkhQ1gP4KgjpSO6HfH9+f8/yfp2Nt3ggBjiVpRwmwTlfqZLafYKJACy36yDXlEmI9HjQ==", "dev": true, "dependencies": { - "@babel/helper-module-transforms": "^7.16.7", - "@babel/helper-plugin-utils": "^7.16.7", - "babel-plugin-dynamic-import-node": "^2.3.3" + "@babel/helper-module-transforms": "^7.22.5", + "@babel/helper-plugin-utils": "^7.22.5" }, "engines": { "node": ">=6.9.0" @@ -1242,15 +1192,14 @@ } }, "node_modules/@babel/plugin-transform-modules-commonjs": { - "version": "7.16.8", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.16.8.tgz", - "integrity": "sha512-oflKPvsLT2+uKQopesJt3ApiaIS2HW+hzHFcwRNtyDGieAeC/dIHZX8buJQ2J2X1rxGPy4eRcUijm3qcSPjYcA==", + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.23.0.tgz", + "integrity": "sha512-32Xzss14/UVc7k9g775yMIvkVK8xwKE0DPdP5JTapr3+Z9w4tzeOuLNY6BXDQR6BdnzIlXnCGAzsk/ICHBLVWQ==", "dev": true, "dependencies": { - "@babel/helper-module-transforms": "^7.16.7", - "@babel/helper-plugin-utils": "^7.16.7", - "@babel/helper-simple-access": "^7.16.7", - "babel-plugin-dynamic-import-node": "^2.3.3" + "@babel/helper-module-transforms": "^7.23.0", + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/helper-simple-access": "^7.22.5" }, "engines": { "node": ">=6.9.0" @@ -1260,16 +1209,15 @@ } }, "node_modules/@babel/plugin-transform-modules-systemjs": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.16.7.tgz", - "integrity": "sha512-DuK5E3k+QQmnOqBR9UkusByy5WZWGRxfzV529s9nPra1GE7olmxfqO2FHobEOYSPIjPBTr4p66YDcjQnt8cBmw==", + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.23.0.tgz", + "integrity": "sha512-qBej6ctXZD2f+DhlOC9yO47yEYgUh5CZNz/aBoH4j/3NOlRfJXJbY7xDQCqQVf9KbrqGzIWER1f23doHGrIHFg==", "dev": true, "dependencies": { - "@babel/helper-hoist-variables": "^7.16.7", - "@babel/helper-module-transforms": "^7.16.7", - "@babel/helper-plugin-utils": "^7.16.7", - "@babel/helper-validator-identifier": "^7.16.7", - "babel-plugin-dynamic-import-node": "^2.3.3" + "@babel/helper-hoist-variables": "^7.22.5", + "@babel/helper-module-transforms": "^7.23.0", + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/helper-validator-identifier": "^7.22.20" }, "engines": { "node": ">=6.9.0" @@ -1279,13 +1227,13 @@ } }, "node_modules/@babel/plugin-transform-modules-umd": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.16.7.tgz", - "integrity": "sha512-EMh7uolsC8O4xhudF2F6wedbSHm1HHZ0C6aJ7K67zcDNidMzVcxWdGr+htW9n21klm+bOn+Rx4CBsAntZd3rEQ==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.22.5.tgz", + "integrity": "sha512-+S6kzefN/E1vkSsKx8kmQuqeQsvCKCd1fraCM7zXm4SFoggI099Tr4G8U81+5gtMdUeMQ4ipdQffbKLX0/7dBQ==", "dev": true, "dependencies": { - "@babel/helper-module-transforms": "^7.16.7", - "@babel/helper-plugin-utils": "^7.16.7" + "@babel/helper-module-transforms": "^7.22.5", + "@babel/helper-plugin-utils": "^7.22.5" }, "engines": { "node": ">=6.9.0" @@ -1295,12 +1243,13 @@ } }, "node_modules/@babel/plugin-transform-named-capturing-groups-regex": { - "version": "7.16.8", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.16.8.tgz", - "integrity": "sha512-j3Jw+n5PvpmhRR+mrgIh04puSANCk/T/UA3m3P1MjJkhlK906+ApHhDIqBQDdOgL/r1UYpz4GNclTXxyZrYGSw==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.22.5.tgz", + "integrity": "sha512-YgLLKmS3aUBhHaxp5hi1WJTgOUb/NCuDHzGT9z9WTt3YG+CPRhJs6nprbStx6DnWM4dh6gt7SU3sZodbZ08adQ==", "dev": true, "dependencies": { - "@babel/helper-create-regexp-features-plugin": "^7.16.7" + "@babel/helper-create-regexp-features-plugin": "^7.22.5", + "@babel/helper-plugin-utils": "^7.22.5" }, "engines": { "node": ">=6.9.0" @@ -1310,12 +1259,63 @@ } }, "node_modules/@babel/plugin-transform-new-target": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.16.7.tgz", - "integrity": "sha512-xiLDzWNMfKoGOpc6t3U+etCE2yRnn3SM09BXqWPIZOBpL2gvVrBWUKnsJx0K/ADi5F5YC5f8APFfWrz25TdlGg==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.22.5.tgz", + "integrity": "sha512-AsF7K0Fx/cNKVyk3a+DW0JLo+Ua598/NxMRvxDnkpCIGFh43+h/v2xyhRUYf6oD8gE4QtL83C7zZVghMjHd+iw==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-nullish-coalescing-operator": { + "version": "7.22.11", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-nullish-coalescing-operator/-/plugin-transform-nullish-coalescing-operator-7.22.11.tgz", + "integrity": "sha512-YZWOw4HxXrotb5xsjMJUDlLgcDXSfO9eCmdl1bgW4+/lAGdkjaEvOnQ4p5WKKdUgSzO39dgPl0pTnfxm0OAXcg==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-numeric-separator": { + "version": "7.22.11", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-numeric-separator/-/plugin-transform-numeric-separator-7.22.11.tgz", + "integrity": "sha512-3dzU4QGPsILdJbASKhF/V2TVP+gJya1PsueQCxIPCEcerqF21oEcrob4mzjsp2Py/1nLfF5m+xYNMDpmA8vffg==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/plugin-syntax-numeric-separator": "^7.10.4" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-object-rest-spread": { + "version": "7.22.15", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-rest-spread/-/plugin-transform-object-rest-spread-7.22.15.tgz", + "integrity": "sha512-fEB+I1+gAmfAyxZcX1+ZUwLeAuuf8VIg67CTznZE0MqVFumWkh8xWtn58I4dxdVf080wn7gzWoF8vndOViJe9Q==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.16.7" + "@babel/compat-data": "^7.22.9", + "@babel/helper-compilation-targets": "^7.22.15", + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/plugin-syntax-object-rest-spread": "^7.8.3", + "@babel/plugin-transform-parameters": "^7.22.15" }, "engines": { "node": ">=6.9.0" @@ -1325,13 +1325,46 @@ } }, "node_modules/@babel/plugin-transform-object-super": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.16.7.tgz", - "integrity": "sha512-14J1feiQVWaGvRxj2WjyMuXS2jsBkgB3MdSN5HuC2G5nRspa5RK9COcs82Pwy5BuGcjb+fYaUj94mYcOj7rCvw==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.22.5.tgz", + "integrity": "sha512-klXqyaT9trSjIUrcsYIfETAzmOEZL3cBYqOYLJxBHfMFFggmXOv+NYSX/Jbs9mzMVESw/WycLFPRx8ba/b2Ipw==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/helper-replace-supers": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-optional-catch-binding": { + "version": "7.22.11", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-optional-catch-binding/-/plugin-transform-optional-catch-binding-7.22.11.tgz", + "integrity": "sha512-rli0WxesXUeCJnMYhzAglEjLWVDF6ahb45HuprcmQuLidBJFWjNnOzssk2kuc6e33FlLaiZhG/kUIzUMWdBKaQ==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/plugin-syntax-optional-catch-binding": "^7.8.3" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-optional-chaining": { + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-optional-chaining/-/plugin-transform-optional-chaining-7.23.0.tgz", + "integrity": "sha512-sBBGXbLJjxTzLBF5rFWaikMnOGOk/BmK6vVByIdEggZ7Vn6CvWXZyRkkLFK6WE0IF8jSliyOkUN6SScFgzCM0g==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.16.7", - "@babel/helper-replace-supers": "^7.16.7" + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/helper-skip-transparent-expression-wrappers": "^7.22.5", + "@babel/plugin-syntax-optional-chaining": "^7.8.3" }, "engines": { "node": ">=6.9.0" @@ -1341,12 +1374,46 @@ } }, "node_modules/@babel/plugin-transform-parameters": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.16.7.tgz", - "integrity": "sha512-AT3MufQ7zZEhU2hwOA11axBnExW0Lszu4RL/tAlUJBuNoRak+wehQW8h6KcXOcgjY42fHtDxswuMhMjFEuv/aw==", + "version": "7.22.15", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.22.15.tgz", + "integrity": "sha512-hjk7qKIqhyzhhUvRT683TYQOFa/4cQKwQy7ALvTpODswN40MljzNDa0YldevS6tGbxwaEKVn502JmY0dP7qEtQ==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-private-methods": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-private-methods/-/plugin-transform-private-methods-7.22.5.tgz", + "integrity": "sha512-PPjh4gyrQnGe97JTalgRGMuU4icsZFnWkzicB/fUtzlKUqvsWBKEpPPfr5a2JiyirZkHxnAqkQMO5Z5B2kK3fA==", + "dev": true, + "dependencies": { + "@babel/helper-create-class-features-plugin": "^7.22.5", + "@babel/helper-plugin-utils": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-private-property-in-object": { + "version": "7.22.11", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-private-property-in-object/-/plugin-transform-private-property-in-object-7.22.11.tgz", + "integrity": "sha512-sSCbqZDBKHetvjSwpyWzhuHkmW5RummxJBVbYLkGkaiTOWGxml7SXt0iWa03bzxFIx7wOj3g/ILRd0RcJKBeSQ==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.16.7" + "@babel/helper-annotate-as-pure": "^7.22.5", + "@babel/helper-create-class-features-plugin": "^7.22.11", + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/plugin-syntax-private-property-in-object": "^7.14.5" }, "engines": { "node": ">=6.9.0" @@ -1356,12 +1423,12 @@ } }, "node_modules/@babel/plugin-transform-property-literals": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.16.7.tgz", - "integrity": "sha512-z4FGr9NMGdoIl1RqavCqGG+ZuYjfZ/hkCIeuH6Do7tXmSm0ls11nYVSJqFEUOSJbDab5wC6lRE/w6YjVcr6Hqw==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.22.5.tgz", + "integrity": "sha512-TiOArgddK3mK/x1Qwf5hay2pxI6wCZnvQqrFSqbtg1GLl2JcNMitVH/YnqjP+M31pLUeTfzY1HAXFDnUBV30rQ==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.16.7" + "@babel/helper-plugin-utils": "^7.22.5" }, "engines": { "node": ">=6.9.0" @@ -1371,12 +1438,13 @@ } }, "node_modules/@babel/plugin-transform-regenerator": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.16.7.tgz", - "integrity": "sha512-mF7jOgGYCkSJagJ6XCujSQg+6xC1M77/03K2oBmVJWoFGNUtnVJO4WHKJk3dnPC8HCcj4xBQP1Egm8DWh3Pb3Q==", + "version": "7.22.10", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.22.10.tgz", + "integrity": "sha512-F28b1mDt8KcT5bUyJc/U9nwzw6cV+UmTeRlXYIl2TNqMMJif0Jeey9/RQ3C4NOd2zp0/TRsDns9ttj2L523rsw==", "dev": true, "dependencies": { - "regenerator-transform": "^0.14.2" + "@babel/helper-plugin-utils": "^7.22.5", + "regenerator-transform": "^0.15.2" }, "engines": { "node": ">=6.9.0" @@ -1386,12 +1454,12 @@ } }, "node_modules/@babel/plugin-transform-reserved-words": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.16.7.tgz", - "integrity": "sha512-KQzzDnZ9hWQBjwi5lpY5v9shmm6IVG0U9pB18zvMu2i4H90xpT4gmqwPYsn8rObiadYe2M0gmgsiOIF5A/2rtg==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.22.5.tgz", + "integrity": "sha512-DTtGKFRQUDm8svigJzZHzb/2xatPc6TzNvAIJ5GqOKDsGFYgAskjRulbR/vGsPKq3OPqtexnz327qYpP57RFyA==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.16.7" + "@babel/helper-plugin-utils": "^7.22.5" }, "engines": { "node": ">=6.9.0" @@ -1401,12 +1469,12 @@ } }, "node_modules/@babel/plugin-transform-shorthand-properties": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.16.7.tgz", - "integrity": "sha512-hah2+FEnoRoATdIb05IOXf+4GzXYTq75TVhIn1PewihbpyrNWUt2JbudKQOETWw6QpLe+AIUpJ5MVLYTQbeeUg==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.22.5.tgz", + "integrity": "sha512-vM4fq9IXHscXVKzDv5itkO1X52SmdFBFcMIBZ2FRn2nqVYqw6dBexUgMvAjHW+KXpPPViD/Yo3GrDEBaRC0QYA==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.16.7" + "@babel/helper-plugin-utils": "^7.22.5" }, "engines": { "node": ">=6.9.0" @@ -1416,13 +1484,13 @@ } }, "node_modules/@babel/plugin-transform-spread": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-spread/-/plugin-transform-spread-7.16.7.tgz", - "integrity": "sha512-+pjJpgAngb53L0iaA5gU/1MLXJIfXcYepLgXB3esVRf4fqmj8f2cxM3/FKaHsZms08hFQJkFccEWuIpm429TXg==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-spread/-/plugin-transform-spread-7.22.5.tgz", + "integrity": "sha512-5ZzDQIGyvN4w8+dMmpohL6MBo+l2G7tfC/O2Dg7/hjpgeWvUx8FzfeOKxGog9IimPa4YekaQ9PlDqTLOljkcxg==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.16.7", - "@babel/helper-skip-transparent-expression-wrappers": "^7.16.0" + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/helper-skip-transparent-expression-wrappers": "^7.22.5" }, "engines": { "node": ">=6.9.0" @@ -1432,12 +1500,12 @@ } }, "node_modules/@babel/plugin-transform-sticky-regex": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.16.7.tgz", - "integrity": "sha512-NJa0Bd/87QV5NZZzTuZG5BPJjLYadeSZ9fO6oOUoL4iQx+9EEuw/eEM92SrsT19Yc2jgB1u1hsjqDtH02c3Drw==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.22.5.tgz", + "integrity": "sha512-zf7LuNpHG0iEeiyCNwX4j3gDg1jgt1k3ZdXBKbZSoA3BbGQGvMiSvfbZRR3Dr3aeJe3ooWFZxOOG3IRStYp2Bw==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.16.7" + "@babel/helper-plugin-utils": "^7.22.5" }, "engines": { "node": ">=6.9.0" @@ -1447,12 +1515,12 @@ } }, "node_modules/@babel/plugin-transform-template-literals": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.16.7.tgz", - "integrity": "sha512-VwbkDDUeenlIjmfNeDX/V0aWrQH2QiVyJtwymVQSzItFDTpxfyJh3EVaQiS0rIN/CqbLGr0VcGmuwyTdZtdIsA==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.22.5.tgz", + "integrity": "sha512-5ciOehRNf+EyUeewo8NkbQiUs4d6ZxiHo6BcBcnFlgiJfu16q0bQUw9Jvo0b0gBKFG1SMhDSjeKXSYuJLeFSMA==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.16.7" + "@babel/helper-plugin-utils": "^7.22.5" }, "engines": { "node": ">=6.9.0" @@ -1462,12 +1530,12 @@ } }, "node_modules/@babel/plugin-transform-typeof-symbol": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.16.7.tgz", - "integrity": "sha512-p2rOixCKRJzpg9JB4gjnG4gjWkWa89ZoYUnl9snJ1cWIcTH/hvxZqfO+WjG6T8DRBpctEol5jw1O5rA8gkCokQ==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.22.5.tgz", + "integrity": "sha512-bYkI5lMzL4kPii4HHEEChkD0rkc+nvnlR6+o/qdqR6zrm0Sv/nodmyLhlq2DO0YKLUNd2VePmPRjJXSBh9OIdA==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.16.7" + "@babel/helper-plugin-utils": "^7.22.5" }, "engines": { "node": ">=6.9.0" @@ -1476,15 +1544,13 @@ "@babel/core": "^7.0.0-0" } }, - "node_modules/@babel/plugin-transform-typescript": { - "version": "7.16.8", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.16.8.tgz", - "integrity": "sha512-bHdQ9k7YpBDO2d0NVfkj51DpQcvwIzIusJ7mEUaMlbZq3Kt/U47j24inXZHQ5MDiYpCs+oZiwnXyKedE8+q7AQ==", + "node_modules/@babel/plugin-transform-unicode-escapes": { + "version": "7.22.10", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-escapes/-/plugin-transform-unicode-escapes-7.22.10.tgz", + "integrity": "sha512-lRfaRKGZCBqDlRU3UIFovdp9c9mEvlylmpod0/OatICsSfuQ9YFthRo1tpTkGsklEefZdqlEFdY4A2dwTb6ohg==", "dev": true, "dependencies": { - "@babel/helper-create-class-features-plugin": "^7.16.7", - "@babel/helper-plugin-utils": "^7.16.7", - "@babel/plugin-syntax-typescript": "^7.16.7" + "@babel/helper-plugin-utils": "^7.22.5" }, "engines": { "node": ">=6.9.0" @@ -1493,13 +1559,14 @@ "@babel/core": "^7.0.0-0" } }, - "node_modules/@babel/plugin-transform-unicode-escapes": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-escapes/-/plugin-transform-unicode-escapes-7.16.7.tgz", - "integrity": "sha512-TAV5IGahIz3yZ9/Hfv35TV2xEm+kaBDaZQCn2S/hG9/CZ0DktxJv9eKfPc7yYCvOYR4JGx1h8C+jcSOvgaaI/Q==", + "node_modules/@babel/plugin-transform-unicode-property-regex": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-property-regex/-/plugin-transform-unicode-property-regex-7.22.5.tgz", + "integrity": "sha512-HCCIb+CbJIAE6sXn5CjFQXMwkCClcOfPCzTlilJ8cUatfzwHlWQkbtV0zD338u9dZskwvuOYTuuaMaA8J5EI5A==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.16.7" + "@babel/helper-create-regexp-features-plugin": "^7.22.5", + "@babel/helper-plugin-utils": "^7.22.5" }, "engines": { "node": ">=6.9.0" @@ -1509,13 +1576,13 @@ } }, "node_modules/@babel/plugin-transform-unicode-regex": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.16.7.tgz", - "integrity": "sha512-oC5tYYKw56HO75KZVLQ+R/Nl3Hro9kf8iG0hXoaHP7tjAyCpvqBiSNe6vGrZni1Z6MggmUOC6A7VP7AVmw225Q==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.22.5.tgz", + "integrity": "sha512-028laaOKptN5vHJf9/Arr/HiJekMd41hOEZYvNsrsXqJ7YPYuX2bQxh31fkZzGmq3YqHRJzYFFAVYvKfMPKqyg==", "dev": true, "dependencies": { - "@babel/helper-create-regexp-features-plugin": "^7.16.7", - "@babel/helper-plugin-utils": "^7.16.7" + "@babel/helper-create-regexp-features-plugin": "^7.22.5", + "@babel/helper-plugin-utils": "^7.22.5" }, "engines": { "node": ">=6.9.0" @@ -1524,38 +1591,43 @@ "@babel/core": "^7.0.0-0" } }, + "node_modules/@babel/plugin-transform-unicode-sets-regex": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-sets-regex/-/plugin-transform-unicode-sets-regex-7.22.5.tgz", + "integrity": "sha512-lhMfi4FC15j13eKrh3DnYHjpGj6UKQHtNKTbtc1igvAhRy4+kLhV07OpLcsN0VgDEw/MjAvJO4BdMJsHwMhzCg==", + "dev": true, + "dependencies": { + "@babel/helper-create-regexp-features-plugin": "^7.22.5", + "@babel/helper-plugin-utils": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, "node_modules/@babel/preset-env": { - "version": "7.16.11", - "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.16.11.tgz", - "integrity": "sha512-qcmWG8R7ZW6WBRPZK//y+E3Cli151B20W1Rv7ln27vuPaXU/8TKms6jFdiJtF7UDTxcrb7mZd88tAeK9LjdT8g==", - "dev": true, - "dependencies": { - "@babel/compat-data": "^7.16.8", - "@babel/helper-compilation-targets": "^7.16.7", - "@babel/helper-plugin-utils": "^7.16.7", - "@babel/helper-validator-option": "^7.16.7", - "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": "^7.16.7", - "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": "^7.16.7", - "@babel/plugin-proposal-async-generator-functions": "^7.16.8", - "@babel/plugin-proposal-class-properties": "^7.16.7", - "@babel/plugin-proposal-class-static-block": "^7.16.7", - "@babel/plugin-proposal-dynamic-import": "^7.16.7", - "@babel/plugin-proposal-export-namespace-from": "^7.16.7", - "@babel/plugin-proposal-json-strings": "^7.16.7", - "@babel/plugin-proposal-logical-assignment-operators": "^7.16.7", - "@babel/plugin-proposal-nullish-coalescing-operator": "^7.16.7", - "@babel/plugin-proposal-numeric-separator": "^7.16.7", - "@babel/plugin-proposal-object-rest-spread": "^7.16.7", - "@babel/plugin-proposal-optional-catch-binding": "^7.16.7", - "@babel/plugin-proposal-optional-chaining": "^7.16.7", - "@babel/plugin-proposal-private-methods": "^7.16.11", - "@babel/plugin-proposal-private-property-in-object": "^7.16.7", - "@babel/plugin-proposal-unicode-property-regex": "^7.16.7", + "version": "7.22.20", + "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.22.20.tgz", + "integrity": "sha512-11MY04gGC4kSzlPHRfvVkNAZhUxOvm7DCJ37hPDnUENwe06npjIRAfInEMTGSb4LZK5ZgDFkv5hw0lGebHeTyg==", + "dev": true, + "dependencies": { + "@babel/compat-data": "^7.22.20", + "@babel/helper-compilation-targets": "^7.22.15", + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/helper-validator-option": "^7.22.15", + "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": "^7.22.15", + "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": "^7.22.15", + "@babel/plugin-proposal-private-property-in-object": "7.21.0-placeholder-for-preset-env.2", "@babel/plugin-syntax-async-generators": "^7.8.4", "@babel/plugin-syntax-class-properties": "^7.12.13", "@babel/plugin-syntax-class-static-block": "^7.14.5", "@babel/plugin-syntax-dynamic-import": "^7.8.3", "@babel/plugin-syntax-export-namespace-from": "^7.8.3", + "@babel/plugin-syntax-import-assertions": "^7.22.5", + "@babel/plugin-syntax-import-attributes": "^7.22.5", + "@babel/plugin-syntax-import-meta": "^7.10.4", "@babel/plugin-syntax-json-strings": "^7.8.3", "@babel/plugin-syntax-logical-assignment-operators": "^7.10.4", "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3", @@ -1565,45 +1637,62 @@ "@babel/plugin-syntax-optional-chaining": "^7.8.3", "@babel/plugin-syntax-private-property-in-object": "^7.14.5", "@babel/plugin-syntax-top-level-await": "^7.14.5", - "@babel/plugin-transform-arrow-functions": "^7.16.7", - "@babel/plugin-transform-async-to-generator": "^7.16.8", - "@babel/plugin-transform-block-scoped-functions": "^7.16.7", - "@babel/plugin-transform-block-scoping": "^7.16.7", - "@babel/plugin-transform-classes": "^7.16.7", - "@babel/plugin-transform-computed-properties": "^7.16.7", - "@babel/plugin-transform-destructuring": "^7.16.7", - "@babel/plugin-transform-dotall-regex": "^7.16.7", - "@babel/plugin-transform-duplicate-keys": "^7.16.7", - "@babel/plugin-transform-exponentiation-operator": "^7.16.7", - "@babel/plugin-transform-for-of": "^7.16.7", - "@babel/plugin-transform-function-name": "^7.16.7", - "@babel/plugin-transform-literals": "^7.16.7", - "@babel/plugin-transform-member-expression-literals": "^7.16.7", - "@babel/plugin-transform-modules-amd": "^7.16.7", - "@babel/plugin-transform-modules-commonjs": "^7.16.8", - "@babel/plugin-transform-modules-systemjs": "^7.16.7", - "@babel/plugin-transform-modules-umd": "^7.16.7", - "@babel/plugin-transform-named-capturing-groups-regex": "^7.16.8", - "@babel/plugin-transform-new-target": "^7.16.7", - "@babel/plugin-transform-object-super": "^7.16.7", - "@babel/plugin-transform-parameters": "^7.16.7", - "@babel/plugin-transform-property-literals": "^7.16.7", - "@babel/plugin-transform-regenerator": "^7.16.7", - "@babel/plugin-transform-reserved-words": "^7.16.7", - "@babel/plugin-transform-shorthand-properties": "^7.16.7", - "@babel/plugin-transform-spread": "^7.16.7", - "@babel/plugin-transform-sticky-regex": "^7.16.7", - "@babel/plugin-transform-template-literals": "^7.16.7", - "@babel/plugin-transform-typeof-symbol": "^7.16.7", - "@babel/plugin-transform-unicode-escapes": "^7.16.7", - "@babel/plugin-transform-unicode-regex": "^7.16.7", - "@babel/preset-modules": "^0.1.5", - "@babel/types": "^7.16.8", - "babel-plugin-polyfill-corejs2": "^0.3.0", - "babel-plugin-polyfill-corejs3": "^0.5.0", - "babel-plugin-polyfill-regenerator": "^0.3.0", - "core-js-compat": "^3.20.2", - "semver": "^6.3.0" + "@babel/plugin-syntax-unicode-sets-regex": "^7.18.6", + "@babel/plugin-transform-arrow-functions": "^7.22.5", + "@babel/plugin-transform-async-generator-functions": "^7.22.15", + "@babel/plugin-transform-async-to-generator": "^7.22.5", + "@babel/plugin-transform-block-scoped-functions": "^7.22.5", + "@babel/plugin-transform-block-scoping": "^7.22.15", + "@babel/plugin-transform-class-properties": "^7.22.5", + "@babel/plugin-transform-class-static-block": "^7.22.11", + "@babel/plugin-transform-classes": "^7.22.15", + "@babel/plugin-transform-computed-properties": "^7.22.5", + "@babel/plugin-transform-destructuring": "^7.22.15", + "@babel/plugin-transform-dotall-regex": "^7.22.5", + "@babel/plugin-transform-duplicate-keys": "^7.22.5", + "@babel/plugin-transform-dynamic-import": "^7.22.11", + "@babel/plugin-transform-exponentiation-operator": "^7.22.5", + "@babel/plugin-transform-export-namespace-from": "^7.22.11", + "@babel/plugin-transform-for-of": "^7.22.15", + "@babel/plugin-transform-function-name": "^7.22.5", + "@babel/plugin-transform-json-strings": "^7.22.11", + "@babel/plugin-transform-literals": "^7.22.5", + "@babel/plugin-transform-logical-assignment-operators": "^7.22.11", + "@babel/plugin-transform-member-expression-literals": "^7.22.5", + "@babel/plugin-transform-modules-amd": "^7.22.5", + "@babel/plugin-transform-modules-commonjs": "^7.22.15", + "@babel/plugin-transform-modules-systemjs": "^7.22.11", + "@babel/plugin-transform-modules-umd": "^7.22.5", + "@babel/plugin-transform-named-capturing-groups-regex": "^7.22.5", + "@babel/plugin-transform-new-target": "^7.22.5", + "@babel/plugin-transform-nullish-coalescing-operator": "^7.22.11", + "@babel/plugin-transform-numeric-separator": "^7.22.11", + "@babel/plugin-transform-object-rest-spread": "^7.22.15", + "@babel/plugin-transform-object-super": "^7.22.5", + "@babel/plugin-transform-optional-catch-binding": "^7.22.11", + "@babel/plugin-transform-optional-chaining": "^7.22.15", + "@babel/plugin-transform-parameters": "^7.22.15", + "@babel/plugin-transform-private-methods": "^7.22.5", + "@babel/plugin-transform-private-property-in-object": "^7.22.11", + "@babel/plugin-transform-property-literals": "^7.22.5", + "@babel/plugin-transform-regenerator": "^7.22.10", + "@babel/plugin-transform-reserved-words": "^7.22.5", + "@babel/plugin-transform-shorthand-properties": "^7.22.5", + "@babel/plugin-transform-spread": "^7.22.5", + "@babel/plugin-transform-sticky-regex": "^7.22.5", + "@babel/plugin-transform-template-literals": "^7.22.5", + "@babel/plugin-transform-typeof-symbol": "^7.22.5", + "@babel/plugin-transform-unicode-escapes": "^7.22.10", + "@babel/plugin-transform-unicode-property-regex": "^7.22.5", + "@babel/plugin-transform-unicode-regex": "^7.22.5", + "@babel/plugin-transform-unicode-sets-regex": "^7.22.5", + "@babel/preset-modules": "0.1.6-no-external-plugins", + "@babel/types": "^7.22.19", + "babel-plugin-polyfill-corejs2": "^0.4.5", + "babel-plugin-polyfill-corejs3": "^0.8.3", + "babel-plugin-polyfill-regenerator": "^0.5.2", + "core-js-compat": "^3.31.0", + "semver": "^6.3.1" }, "engines": { "node": ">=6.9.0" @@ -1612,79 +1701,75 @@ "@babel/core": "^7.0.0-0" } }, + "node_modules/@babel/preset-env/node_modules/@babel/compat-data": { + "version": "7.22.20", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.22.20.tgz", + "integrity": "sha512-BQYjKbpXjoXwFW5jGqiizJQQT/aC7pFm9Ok1OWssonuguICi264lbgMzRp2ZMmRSlfkX6DsWDDcsrctK8Rwfiw==", + "dev": true, + "engines": { + "node": ">=6.9.0" + } + }, "node_modules/@babel/preset-modules": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/@babel/preset-modules/-/preset-modules-0.1.5.tgz", - "integrity": "sha512-A57th6YRG7oR3cq/yt/Y84MvGgE0eJG2F1JLhKuyG+jFxEgrd/HAMJatiFtmOiZurz+0DkrvbheCLaV5f2JfjA==", + "version": "0.1.6-no-external-plugins", + "resolved": "https://registry.npmjs.org/@babel/preset-modules/-/preset-modules-0.1.6-no-external-plugins.tgz", + "integrity": "sha512-HrcgcIESLm9aIR842yhJ5RWan/gebQUJ6E/E5+rf0y9o6oj7w0Br+sWuL6kEQ/o/AdfvR1Je9jG18/gnpwjEyA==", "dev": true, "dependencies": { "@babel/helper-plugin-utils": "^7.0.0", - "@babel/plugin-proposal-unicode-property-regex": "^7.4.4", - "@babel/plugin-transform-dotall-regex": "^7.4.4", "@babel/types": "^7.4.4", "esutils": "^2.0.2" }, "peerDependencies": { - "@babel/core": "^7.0.0-0" + "@babel/core": "^7.0.0-0 || ^8.0.0-0 <8.0.0" } }, - "node_modules/@babel/preset-typescript": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/preset-typescript/-/preset-typescript-7.16.7.tgz", - "integrity": "sha512-WbVEmgXdIyvzB77AQjGBEyYPZx+8tTsO50XtfozQrkW8QB2rLJpH2lgx0TRw5EJrBxOZQ+wCcyPVQvS8tjEHpQ==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.16.7", - "@babel/helper-validator-option": "^7.16.7", - "@babel/plugin-transform-typescript": "^7.16.7" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } + "node_modules/@babel/regjsgen": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/@babel/regjsgen/-/regjsgen-0.8.0.tgz", + "integrity": "sha512-x/rqGMdzj+fWZvCOYForTghzbtqPDZ5gPwaoNGHdgDfF2QA/XZbCBp4Moo5scrkAMPhB7z26XM/AaHuIJdgauA==", + "dev": true }, "node_modules/@babel/runtime": { - "version": "7.17.2", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.17.2.tgz", - "integrity": "sha512-hzeyJyMA1YGdJTuWU0e/j4wKXrU4OMFvY2MSlaI9B7VQb0r5cxTE3EAIS2Q7Tn2RIcDkRvTA/v2JsAEhxe99uw==", + "version": "7.22.10", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.22.10.tgz", + "integrity": "sha512-21t/fkKLMZI4pqP2wlmsQAWnYW1PDyKyyUV4vCi+B25ydmdaYTKXPwCj0BzSUnZf4seIiYvSA3jcZ3gdsMFkLQ==", "dev": true, "dependencies": { - "regenerator-runtime": "^0.13.4" + "regenerator-runtime": "^0.14.0" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/template": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.16.7.tgz", - "integrity": "sha512-I8j/x8kHUrbYRTUxXrrMbfCa7jxkE7tZre39x3kjr9hvI82cK1FfqLygotcWN5kdPGWcLdWMHpSBavse5tWw3w==", + "version": "7.22.15", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.22.15.tgz", + "integrity": "sha512-QPErUVm4uyJa60rkI73qneDacvdvzxshT3kksGqlGWYdOTIUOwJ7RDUL8sGqslY1uXWSL6xMFKEXDS3ox2uF0w==", "dev": true, "dependencies": { - "@babel/code-frame": "^7.16.7", - "@babel/parser": "^7.16.7", - "@babel/types": "^7.16.7" + "@babel/code-frame": "^7.22.13", + "@babel/parser": "^7.22.15", + "@babel/types": "^7.22.15" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/traverse": { - "version": "7.17.3", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.17.3.tgz", - "integrity": "sha512-5irClVky7TxRWIRtxlh2WPUUOLhcPN06AGgaQSB8AEwuyEBgJVuJ5imdHm5zxk8w0QS5T+tDfnDxAlhWjpb7cw==", - "dev": true, - "dependencies": { - "@babel/code-frame": "^7.16.7", - "@babel/generator": "^7.17.3", - "@babel/helper-environment-visitor": "^7.16.7", - "@babel/helper-function-name": "^7.16.7", - "@babel/helper-hoist-variables": "^7.16.7", - "@babel/helper-split-export-declaration": "^7.16.7", - "@babel/parser": "^7.17.3", - "@babel/types": "^7.17.0", + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.23.0.tgz", + "integrity": "sha512-t/QaEvyIoIkwzpiZ7aoSKK8kObQYeF7T2v+dazAYCb8SXtp58zEVkWW7zAnju8FNKNdr4ScAOEDmMItbyOmEYw==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.22.13", + "@babel/generator": "^7.23.0", + "@babel/helper-environment-visitor": "^7.22.20", + "@babel/helper-function-name": "^7.23.0", + "@babel/helper-hoist-variables": "^7.22.5", + "@babel/helper-split-export-declaration": "^7.22.6", + "@babel/parser": "^7.23.0", + "@babel/types": "^7.23.0", "debug": "^4.1.0", "globals": "^11.1.0" }, @@ -1692,13 +1777,27 @@ "node": ">=6.9.0" } }, + "node_modules/@babel/traverse/node_modules/@babel/helper-function-name": { + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.23.0.tgz", + "integrity": "sha512-OErEqsrxjZTJciZ4Oo+eoZqeW9UIiOcuYKRJA4ZAgV9myA+pOXhhmpfNCKjEH/auVfEYVFJ6y1Tc4r0eIApqiw==", + "dev": true, + "dependencies": { + "@babel/template": "^7.22.15", + "@babel/types": "^7.23.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, "node_modules/@babel/types": { - "version": "7.17.0", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.17.0.tgz", - "integrity": "sha512-TmKSNO4D5rzhL5bjWFcVHHLETzfQ/AmbKpKPOSjlP0WoHZ6L911fgoOKY4Alp/emzG4cHJdyN49zpgkbXFEHHw==", + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.23.0.tgz", + "integrity": "sha512-0oIyUfKoI3mSqMvsxBdclDwxXKXAUA8v/apZbc+iSyARYou1o8ZGDxbUYyLFoW2arqS2jDGqJuZvv1d/io1axg==", "dev": true, "dependencies": { - "@babel/helper-validator-identifier": "^7.16.7", + "@babel/helper-string-parser": "^7.22.5", + "@babel/helper-validator-identifier": "^7.22.20", "to-fast-properties": "^2.0.0" }, "engines": { @@ -1706,15 +1805,21 @@ } }, "node_modules/@bcherny/json-schema-ref-parser": { - "version": "9.0.9", - "resolved": "https://registry.npmjs.org/@bcherny/json-schema-ref-parser/-/json-schema-ref-parser-9.0.9.tgz", - "integrity": "sha512-vmEmnJCfpkLdas++9OYg6riIezTYqTHpqUTODJzHLzs5UnXujbOJW9VwcVCnyo1mVRt32FRr23iXBx/sX8YbeQ==", + "version": "10.0.5-fork", + "resolved": "https://registry.npmjs.org/@bcherny/json-schema-ref-parser/-/json-schema-ref-parser-10.0.5-fork.tgz", + "integrity": "sha512-E/jKbPoca1tfUPj3iSbitDZTGnq6FUFjkH6L8U2oDwSuwK1WhnnVtCG7oFOTg/DDnyoXbQYUiUiGOibHqaGVnw==", "dev": true, "dependencies": { "@jsdevtools/ono": "^7.1.3", "@types/json-schema": "^7.0.6", "call-me-maybe": "^1.0.1", "js-yaml": "^4.1.0" + }, + "engines": { + "node": ">= 16" + }, + "funding": { + "url": "https://github.com/sponsors/philsturgeon" } }, "node_modules/@bcherny/json-schema-ref-parser/node_modules/argparse": { @@ -1751,77 +1856,158 @@ "sjcl": "^1.0.8" } }, - "node_modules/@eslint/eslintrc": { - "version": "0.4.3", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.4.3.tgz", - "integrity": "sha512-J6KFFz5QCYUJq3pf0mjEcCJVERbzv71PUIDczuh9JkwGEzced6CO5ADLHB1rbf/+oPBtoPfMYNOpGDzCANlbXw==", + "node_modules/@eslint-community/eslint-utils": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", + "integrity": "sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==", "dev": true, "dependencies": { - "ajv": "^6.12.4", - "debug": "^4.1.1", - "espree": "^7.3.0", - "globals": "^13.9.0", - "ignore": "^4.0.6", - "import-fresh": "^3.2.1", - "js-yaml": "^3.13.1", - "minimatch": "^3.0.4", - "strip-json-comments": "^3.1.1" + "eslint-visitor-keys": "^3.3.0" }, "engines": { - "node": "^10.12.0 || >=12.0.0" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" } }, - "node_modules/@eslint/eslintrc/node_modules/ajv": { - "version": "6.12.6", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", - "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "node_modules/@eslint-community/eslint-utils/node_modules/eslint-visitor-keys": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", "dev": true, - "dependencies": { - "fast-deep-equal": "^3.1.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" + "url": "https://opencollective.com/eslint" } }, - "node_modules/@eslint/eslintrc/node_modules/globals": { - "version": "13.15.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.15.0.tgz", - "integrity": "sha512-bpzcOlgDhMG070Av0Vy5Owklpv1I6+j96GhUI7Rh7IzDCKLzboflLrrfqMu8NquDbiR4EOQk7XzJwqVJxicxog==", + "node_modules/@eslint-community/regexpp": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.6.2.tgz", + "integrity": "sha512-pPTNuaAG3QMH+buKyBIGJs3g/S5y0caxw0ygM3YyE6yJFySwiGGSzA+mM3KJ8QQvzeLh3blwgSonkFjgQdxzMw==", + "dev": true, + "engines": { + "node": "^12.0.0 || ^14.0.0 || >=16.0.0" + } + }, + "node_modules/@eslint/eslintrc": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.2.tgz", + "integrity": "sha512-+wvgpDsrB1YqAMdEUCcnTlpfVBH7Vqn6A/NT3D8WVXFIaKMlErPIZT3oCIAVCOtarRpMtelZLqJeU3t7WY6X6g==", "dev": true, "dependencies": { - "type-fest": "^0.20.2" + "ajv": "^6.12.4", + "debug": "^4.3.2", + "espree": "^9.6.0", + "globals": "^13.19.0", + "ignore": "^5.2.0", + "import-fresh": "^3.2.1", + "js-yaml": "^4.1.0", + "minimatch": "^3.1.2", + "strip-json-comments": "^3.1.1" }, "engines": { - "node": ">=8" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/@eslint/eslintrc/node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true + }, + "node_modules/@eslint/eslintrc/node_modules/globals": { + "version": "13.21.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.21.0.tgz", + "integrity": "sha512-ybyme3s4yy/t/3s35bewwXKOf7cvzfreG2lH0lZl0JB7I4GxRP2ghxOK/Nb9EkRXdbBXZLfq/p/0W2JUONB/Gg==", + "dev": true, + "dependencies": { + "type-fest": "^0.20.2" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@eslint/eslintrc/node_modules/js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "dev": true, + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/@eslint/eslintrc/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/@eslint/js": { + "version": "8.50.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.50.0.tgz", + "integrity": "sha512-NCC3zz2+nvYd+Ckfh87rA47zfu2QsQpvc6k1yzTk+b9KzRj0wkGa8LSoGOXN6Zv4lRf/EIoZ80biDh9HOI+RNQ==", + "dev": true, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" } }, - "node_modules/@eslint/eslintrc/node_modules/json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", - "dev": true - }, "node_modules/@humanwhocodes/config-array": { - "version": "0.9.5", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.9.5.tgz", - "integrity": "sha512-ObyMyWxZiCu/yTisA7uzx81s40xR2fD5Cg/2Kq7G02ajkNubJf6BopgDTmDyc3U7sXpNKM8cYOw7s7Tyr+DnCw==", + "version": "0.11.11", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.11.tgz", + "integrity": "sha512-N2brEuAadi0CcdeMXUkhbZB84eskAc8MEX1By6qEchoVywSgXPIjou4rYsl0V3Hj0ZnuGycGCjdNgockbzeWNA==", "dev": true, "dependencies": { "@humanwhocodes/object-schema": "^1.2.1", "debug": "^4.1.1", - "minimatch": "^3.0.4" + "minimatch": "^3.0.5" }, "engines": { "node": ">=10.10.0" } }, + "node_modules/@humanwhocodes/config-array/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/@humanwhocodes/module-importer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", + "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", + "dev": true, + "engines": { + "node": ">=12.22" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, "node_modules/@humanwhocodes/object-schema": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz", @@ -1896,15 +2082,6 @@ "node": ">=8" } }, - "node_modules/@istanbuljs/load-nyc-config/node_modules/p-try": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", - "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", - "dev": true, - "engines": { - "node": ">=6" - } - }, "node_modules/@istanbuljs/load-nyc-config/node_modules/path-exists": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", @@ -1933,20 +2110,20 @@ } }, "node_modules/@jest/console": { - "version": "27.5.1", - "resolved": "https://registry.npmjs.org/@jest/console/-/console-27.5.1.tgz", - "integrity": "sha512-kZ/tNpS3NXn0mlXXXPNuDZnb4c0oZ20r4K5eemM2k30ZC3G0T02nXUvyhf5YdbXWHPEJLc9qGLxEZ216MdL+Zg==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/console/-/console-29.7.0.tgz", + "integrity": "sha512-5Ni4CU7XHQi32IJ398EEP4RrB8eV09sXP2ROqD4bksHrnTree52PsxvX8tpL8LvTZ3pFzXyPbNQReSN41CAhOg==", "dev": true, "dependencies": { - "@jest/types": "^27.5.1", + "@jest/types": "^29.6.3", "@types/node": "*", "chalk": "^4.0.0", - "jest-message-util": "^27.5.1", - "jest-util": "^27.5.1", + "jest-message-util": "^29.7.0", + "jest-util": "^29.7.0", "slash": "^3.0.0" }, "engines": { - "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, "node_modules/@jest/console/node_modules/ansi-styles": { @@ -2020,42 +2197,42 @@ } }, "node_modules/@jest/core": { - "version": "27.5.1", - "resolved": "https://registry.npmjs.org/@jest/core/-/core-27.5.1.tgz", - "integrity": "sha512-AK6/UTrvQD0Cd24NSqmIA6rKsu0tKIxfiCducZvqxYdmMisOYAsdItspT+fQDQYARPf8XgjAFZi0ogW2agH5nQ==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/core/-/core-29.7.0.tgz", + "integrity": "sha512-n7aeXWKMnGtDA48y8TLWJPJmLmmZ642Ceo78cYWEpiD7FzDgmNDV/GCVRorPABdXLJZ/9wzzgZAlHjXjxDHGsg==", "dev": true, "dependencies": { - "@jest/console": "^27.5.1", - "@jest/reporters": "^27.5.1", - "@jest/test-result": "^27.5.1", - "@jest/transform": "^27.5.1", - "@jest/types": "^27.5.1", + "@jest/console": "^29.7.0", + "@jest/reporters": "^29.7.0", + "@jest/test-result": "^29.7.0", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", "@types/node": "*", "ansi-escapes": "^4.2.1", "chalk": "^4.0.0", - "emittery": "^0.8.1", + "ci-info": "^3.2.0", "exit": "^0.1.2", "graceful-fs": "^4.2.9", - "jest-changed-files": "^27.5.1", - "jest-config": "^27.5.1", - "jest-haste-map": "^27.5.1", - "jest-message-util": "^27.5.1", - "jest-regex-util": "^27.5.1", - "jest-resolve": "^27.5.1", - "jest-resolve-dependencies": "^27.5.1", - "jest-runner": "^27.5.1", - "jest-runtime": "^27.5.1", - "jest-snapshot": "^27.5.1", - "jest-util": "^27.5.1", - "jest-validate": "^27.5.1", - "jest-watcher": "^27.5.1", + "jest-changed-files": "^29.7.0", + "jest-config": "^29.7.0", + "jest-haste-map": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-regex-util": "^29.6.3", + "jest-resolve": "^29.7.0", + "jest-resolve-dependencies": "^29.7.0", + "jest-runner": "^29.7.0", + "jest-runtime": "^29.7.0", + "jest-snapshot": "^29.7.0", + "jest-util": "^29.7.0", + "jest-validate": "^29.7.0", + "jest-watcher": "^29.7.0", "micromatch": "^4.0.4", - "rimraf": "^3.0.0", + "pretty-format": "^29.7.0", "slash": "^3.0.0", "strip-ansi": "^6.0.0" }, "engines": { - "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" }, "peerDependencies": { "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" @@ -2137,85 +2314,110 @@ } }, "node_modules/@jest/environment": { - "version": "27.5.1", - "resolved": "https://registry.npmjs.org/@jest/environment/-/environment-27.5.1.tgz", - "integrity": "sha512-/WQjhPJe3/ghaol/4Bq480JKXV/Rfw8nQdN7f41fM8VDHLcxKXou6QyXAh3EFr9/bVG3x74z1NWDkP87EiY8gA==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/environment/-/environment-29.7.0.tgz", + "integrity": "sha512-aQIfHDq33ExsN4jP1NWGXhxgQ/wixs60gDiKO+XVMd8Mn0NWPWgc34ZQDTb2jKaUWQ7MuwoitXAsN2XVXNMpAw==", "dev": true, "dependencies": { - "@jest/fake-timers": "^27.5.1", - "@jest/types": "^27.5.1", + "@jest/fake-timers": "^29.7.0", + "@jest/types": "^29.6.3", "@types/node": "*", - "jest-mock": "^27.5.1" + "jest-mock": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/expect": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/expect/-/expect-29.7.0.tgz", + "integrity": "sha512-8uMeAMycttpva3P1lBHB8VciS9V0XAr3GymPpipdyQXbBcuhkLQOSe8E/p92RyAdToS6ZD1tFkX+CkhoECE0dQ==", + "dev": true, + "dependencies": { + "expect": "^29.7.0", + "jest-snapshot": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/expect-utils": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/expect-utils/-/expect-utils-29.7.0.tgz", + "integrity": "sha512-GlsNBWiFQFCVi9QVSx7f5AgMeLxe9YCCs5PuP2O2LdjDAA8Jh9eX7lA1Jq/xdXw3Wb3hyvlFNfZIfcRetSzYcA==", + "dev": true, + "dependencies": { + "jest-get-type": "^29.6.3" }, "engines": { - "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, "node_modules/@jest/fake-timers": { - "version": "27.5.1", - "resolved": "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-27.5.1.tgz", - "integrity": "sha512-/aPowoolwa07k7/oM3aASneNeBGCmGQsc3ugN4u6s4C/+s5M64MFo/+djTdiwcbQlRfFElGuDXWzaWj6QgKObQ==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-29.7.0.tgz", + "integrity": "sha512-q4DH1Ha4TTFPdxLsqDXK1d3+ioSL7yL5oCMJZgDYm6i+6CygW5E5xVr/D1HdsGxjt1ZWSfUAs9OxSB/BNelWrQ==", "dev": true, "dependencies": { - "@jest/types": "^27.5.1", - "@sinonjs/fake-timers": "^8.0.1", + "@jest/types": "^29.6.3", + "@sinonjs/fake-timers": "^10.0.2", "@types/node": "*", - "jest-message-util": "^27.5.1", - "jest-mock": "^27.5.1", - "jest-util": "^27.5.1" + "jest-message-util": "^29.7.0", + "jest-mock": "^29.7.0", + "jest-util": "^29.7.0" }, "engines": { - "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, "node_modules/@jest/globals": { - "version": "27.5.1", - "resolved": "https://registry.npmjs.org/@jest/globals/-/globals-27.5.1.tgz", - "integrity": "sha512-ZEJNB41OBQQgGzgyInAv0UUfDDj3upmHydjieSxFvTRuZElrx7tXg/uVQ5hYVEwiXs3+aMsAeEc9X7xiSKCm4Q==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/globals/-/globals-29.7.0.tgz", + "integrity": "sha512-mpiz3dutLbkW2MNFubUGUEVLkTGiqW6yLVTA+JbP6fI6J5iL9Y0Nlg8k95pcF8ctKwCS7WVxteBs29hhfAotzQ==", "dev": true, "dependencies": { - "@jest/environment": "^27.5.1", - "@jest/types": "^27.5.1", - "expect": "^27.5.1" + "@jest/environment": "^29.7.0", + "@jest/expect": "^29.7.0", + "@jest/types": "^29.6.3", + "jest-mock": "^29.7.0" }, "engines": { - "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, "node_modules/@jest/reporters": { - "version": "27.5.1", - "resolved": "https://registry.npmjs.org/@jest/reporters/-/reporters-27.5.1.tgz", - "integrity": "sha512-cPXh9hWIlVJMQkVk84aIvXuBB4uQQmFqZiacloFuGiP3ah1sbCxCosidXFDfqG8+6fO1oR2dTJTlsOy4VFmUfw==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/reporters/-/reporters-29.7.0.tgz", + "integrity": "sha512-DApq0KJbJOEzAFYjHADNNxAE3KbhxQB1y5Kplb5Waqw6zVbuWatSnMjE5gs8FUgEPmNsnZA3NCWl9NG0ia04Pg==", "dev": true, "dependencies": { "@bcoe/v8-coverage": "^0.2.3", - "@jest/console": "^27.5.1", - "@jest/test-result": "^27.5.1", - "@jest/transform": "^27.5.1", - "@jest/types": "^27.5.1", + "@jest/console": "^29.7.0", + "@jest/test-result": "^29.7.0", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", + "@jridgewell/trace-mapping": "^0.3.18", "@types/node": "*", "chalk": "^4.0.0", "collect-v8-coverage": "^1.0.0", "exit": "^0.1.2", - "glob": "^7.1.2", + "glob": "^7.1.3", "graceful-fs": "^4.2.9", "istanbul-lib-coverage": "^3.0.0", - "istanbul-lib-instrument": "^5.1.0", + "istanbul-lib-instrument": "^6.0.0", "istanbul-lib-report": "^3.0.0", "istanbul-lib-source-maps": "^4.0.0", "istanbul-reports": "^3.1.3", - "jest-haste-map": "^27.5.1", - "jest-resolve": "^27.5.1", - "jest-util": "^27.5.1", - "jest-worker": "^27.5.1", + "jest-message-util": "^29.7.0", + "jest-util": "^29.7.0", + "jest-worker": "^29.7.0", "slash": "^3.0.0", - "source-map": "^0.6.0", "string-length": "^4.0.1", - "terminal-link": "^2.0.0", - "v8-to-istanbul": "^8.1.0" + "strip-ansi": "^6.0.0", + "v8-to-istanbul": "^9.0.1" }, "engines": { - "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" }, "peerDependencies": { "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" @@ -2284,13 +2486,35 @@ "node": ">=8" } }, - "node_modules/@jest/reporters/node_modules/source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "node_modules/@jest/reporters/node_modules/istanbul-lib-instrument": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-6.0.0.tgz", + "integrity": "sha512-x58orMzEVfzPUKqlbLd1hXCnySCxKdDKa6Rjg97CwuLLRI4g3FHTdnExu1OqffVFay6zeMW+T6/DowFLndWnIw==", + "dev": true, + "dependencies": { + "@babel/core": "^7.12.3", + "@babel/parser": "^7.14.7", + "@istanbuljs/schema": "^0.1.2", + "istanbul-lib-coverage": "^3.2.0", + "semver": "^7.5.4" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@jest/reporters/node_modules/semver": { + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", "dev": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, "engines": { - "node": ">=0.10.0" + "node": ">=10" } }, "node_modules/@jest/reporters/node_modules/supports-color": { @@ -2305,83 +2529,86 @@ "node": ">=8" } }, - "node_modules/@jest/source-map": { - "version": "27.5.1", - "resolved": "https://registry.npmjs.org/@jest/source-map/-/source-map-27.5.1.tgz", - "integrity": "sha512-y9NIHUYF3PJRlHk98NdC/N1gl88BL08aQQgu4k4ZopQkCw9t9cV8mtl3TV8b/YCB8XaVTFrmUTAJvjsntDireg==", + "node_modules/@jest/schemas": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-29.6.3.tgz", + "integrity": "sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA==", "dev": true, "dependencies": { - "callsites": "^3.0.0", - "graceful-fs": "^4.2.9", - "source-map": "^0.6.0" + "@sinclair/typebox": "^0.27.8" }, "engines": { - "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/@jest/source-map/node_modules/source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "node_modules/@jest/source-map": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/@jest/source-map/-/source-map-29.6.3.tgz", + "integrity": "sha512-MHjT95QuipcPrpLM+8JMSzFx6eHp5Bm+4XeFDJlwsvVBjmKNiIAvasGK2fxz2WbGRlnvqehFbh07MMa7n3YJnw==", "dev": true, + "dependencies": { + "@jridgewell/trace-mapping": "^0.3.18", + "callsites": "^3.0.0", + "graceful-fs": "^4.2.9" + }, "engines": { - "node": ">=0.10.0" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, "node_modules/@jest/test-result": { - "version": "27.5.1", - "resolved": "https://registry.npmjs.org/@jest/test-result/-/test-result-27.5.1.tgz", - "integrity": "sha512-EW35l2RYFUcUQxFJz5Cv5MTOxlJIQs4I7gxzi2zVU7PJhOwfYq1MdC5nhSmYjX1gmMmLPvB3sIaC+BkcHRBfag==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/test-result/-/test-result-29.7.0.tgz", + "integrity": "sha512-Fdx+tv6x1zlkJPcWXmMDAG2HBnaR9XPSd5aDWQVsfrZmLVT3lU1cwyxLgRmXR9yrq4NBoEm9BMsfgFzTQAbJYA==", "dev": true, "dependencies": { - "@jest/console": "^27.5.1", - "@jest/types": "^27.5.1", + "@jest/console": "^29.7.0", + "@jest/types": "^29.6.3", "@types/istanbul-lib-coverage": "^2.0.0", "collect-v8-coverage": "^1.0.0" }, "engines": { - "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, "node_modules/@jest/test-sequencer": { - "version": "27.5.1", - "resolved": "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-27.5.1.tgz", - "integrity": "sha512-LCheJF7WB2+9JuCS7VB/EmGIdQuhtqjRNI9A43idHv3E4KltCTsPsLxvdaubFHSYwY/fNjMWjl6vNRhDiN7vpQ==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-29.7.0.tgz", + "integrity": "sha512-GQwJ5WZVrKnOJuiYiAF52UNUJXgTZx1NHjFSEB0qEMmSZKAkdMoIzw/Cj6x6NF4AvV23AUqDpFzQkN/eYCYTxw==", "dev": true, "dependencies": { - "@jest/test-result": "^27.5.1", + "@jest/test-result": "^29.7.0", "graceful-fs": "^4.2.9", - "jest-haste-map": "^27.5.1", - "jest-runtime": "^27.5.1" + "jest-haste-map": "^29.7.0", + "slash": "^3.0.0" }, "engines": { - "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, "node_modules/@jest/transform": { - "version": "27.5.1", - "resolved": "https://registry.npmjs.org/@jest/transform/-/transform-27.5.1.tgz", - "integrity": "sha512-ipON6WtYgl/1329g5AIJVbUuEh0wZVbdpGwC99Jw4LwuoBNS95MVphU6zOeD9pDkon+LLbFL7lOQRapbB8SCHw==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/transform/-/transform-29.7.0.tgz", + "integrity": "sha512-ok/BTPFzFKVMwO5eOHRrvnBVHdRy9IrsrW1GpMaQ9MCnilNLXQKmAX8s1YXDFaai9xJpac2ySzV0YeRRECr2Vw==", "dev": true, "dependencies": { - "@babel/core": "^7.1.0", - "@jest/types": "^27.5.1", + "@babel/core": "^7.11.6", + "@jest/types": "^29.6.3", + "@jridgewell/trace-mapping": "^0.3.18", "babel-plugin-istanbul": "^6.1.1", "chalk": "^4.0.0", - "convert-source-map": "^1.4.0", - "fast-json-stable-stringify": "^2.0.0", + "convert-source-map": "^2.0.0", + "fast-json-stable-stringify": "^2.1.0", "graceful-fs": "^4.2.9", - "jest-haste-map": "^27.5.1", - "jest-regex-util": "^27.5.1", - "jest-util": "^27.5.1", + "jest-haste-map": "^29.7.0", + "jest-regex-util": "^29.6.3", + "jest-util": "^29.7.0", "micromatch": "^4.0.4", "pirates": "^4.0.4", "slash": "^3.0.0", - "source-map": "^0.6.1", - "write-file-atomic": "^3.0.0" + "write-file-atomic": "^4.0.2" }, "engines": { - "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, "node_modules/@jest/transform/node_modules/ansi-styles": { @@ -2442,15 +2669,6 @@ "node": ">=8" } }, - "node_modules/@jest/transform/node_modules/source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/@jest/transform/node_modules/supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", @@ -2464,19 +2682,20 @@ } }, "node_modules/@jest/types": { - "version": "27.5.1", - "resolved": "https://registry.npmjs.org/@jest/types/-/types-27.5.1.tgz", - "integrity": "sha512-Cx46iJ9QpwQTjIdq5VJu2QTMMs3QlEjI0x1QbBP5W1+nMzyc2XmimiRR/CbX9TO0cPTeUlxWMOu8mslYsJ8DEw==", + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-29.6.3.tgz", + "integrity": "sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw==", "dev": true, "dependencies": { + "@jest/schemas": "^29.6.3", "@types/istanbul-lib-coverage": "^2.0.0", "@types/istanbul-reports": "^3.0.0", "@types/node": "*", - "@types/yargs": "^16.0.0", + "@types/yargs": "^17.0.8", "chalk": "^4.0.0" }, "engines": { - "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, "node_modules/@jest/types/node_modules/ansi-styles": { @@ -2549,29 +2768,52 @@ "node": ">=8" } }, + "node_modules/@jridgewell/gen-mapping": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz", + "integrity": "sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ==", + "dev": true, + "dependencies": { + "@jridgewell/set-array": "^1.0.1", + "@jridgewell/sourcemap-codec": "^1.4.10", + "@jridgewell/trace-mapping": "^0.3.9" + }, + "engines": { + "node": ">=6.0.0" + } + }, "node_modules/@jridgewell/resolve-uri": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.0.5.tgz", - "integrity": "sha512-VPeQ7+wH0itvQxnG+lIzWgkysKIr3L9sslimFW55rHMdGu/qCQ5z5h9zq4gI8uBtqkpHhsF4Z/OwExufUCThew==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz", + "integrity": "sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==", + "dev": true, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/set-array": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.2.tgz", + "integrity": "sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==", "dev": true, "engines": { "node": ">=6.0.0" } }, "node_modules/@jridgewell/sourcemap-codec": { - "version": "1.4.11", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.11.tgz", - "integrity": "sha512-Fg32GrJo61m+VqYSdRSjRXMjQ06j8YIYfcTqndLYVAaHmroZHLJZCydsWBOTDqXS2v+mjxohBWEMfg97GXmYQg==", + "version": "1.4.15", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", + "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==", "dev": true }, "node_modules/@jridgewell/trace-mapping": { - "version": "0.3.4", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.4.tgz", - "integrity": "sha512-vFv9ttIedivx0ux3QSjhgtCVjPZd5l46ZOMDSCwnH1yUO2e964gO8LZGyv2QkqcgR6TnBU1v+1IFqmeoG+0UJQ==", + "version": "0.3.19", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.19.tgz", + "integrity": "sha512-kf37QtfW+Hwx/buWGMPcR60iF9ziHa6r/CZJIHbmcm4+0qrXiVdxegAH0F6yddEVQ7zdkjcGCgCzUu+BcbhQxw==", "dev": true, "dependencies": { - "@jridgewell/resolve-uri": "^3.0.3", - "@jridgewell/sourcemap-codec": "^1.4.10" + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" } }, "node_modules/@jsdevtools/ono": { @@ -2580,6 +2822,15 @@ "integrity": "sha512-4JQNk+3mVzK3xh2rqd6RB4J46qUR19azEHBneZyTZM+c456qOrbbM/5xcR8huNCCcbVt7+UmizG6GuUvPvKUYg==", "dev": true }, + "node_modules/@nicolo-ribaudo/eslint-scope-5-internals": { + "version": "5.1.1-v1", + "resolved": "https://registry.npmjs.org/@nicolo-ribaudo/eslint-scope-5-internals/-/eslint-scope-5-internals-5.1.1-v1.tgz", + "integrity": "sha512-54/JRvkLIzzDWshCWfuhadfrfZVPiElY8Fcgmg1HroEly/EDSszzhBAsarCux+D/kOslTRquNzuyGSmUSTTHGg==", + "dev": true, + "dependencies": { + "eslint-scope": "5.1.1" + } + }, "node_modules/@nodelib/fs.scandir": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", @@ -3042,106 +3293,79 @@ } }, "node_modules/@playwright/test": { - "version": "1.32.0", - "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.32.0.tgz", - "integrity": "sha512-zOdGloaF0jeec7hqoLqM5S3L2rR4WxMJs6lgiAeR70JlH7Ml54ZPoIIf3X7cvnKde3Q9jJ/gaxkFh8fYI9s1rg==", + "version": "1.38.1", + "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.38.1.tgz", + "integrity": "sha512-NqRp8XMwj3AK+zKLbZShl0r/9wKgzqI/527bkptKXomtuo+dOjU9NdMASQ8DNC9z9zLOMbG53T4eihYr3XR+BQ==", "dev": true, "dependencies": { - "@types/node": "*", - "playwright-core": "1.32.0" + "playwright": "1.38.1" }, "bin": { "playwright": "cli.js" }, "engines": { - "node": ">=14" - }, - "optionalDependencies": { - "fsevents": "2.3.2" + "node": ">=16" } }, - "node_modules/@playwright/test/node_modules/playwright-core": { - "version": "1.32.0", - "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.32.0.tgz", - "integrity": "sha512-Z9Ij17X5Z3bjpp6XKujGBp9Gv4eViESac9aDmwgQFUEJBW0K80T21m/Z+XJQlu4cNsvPygw33b6V1Va6Bda5zQ==", - "dev": true, - "bin": { - "playwright": "cli.js" - }, - "engines": { - "node": ">=14" - } + "node_modules/@sinclair/typebox": { + "version": "0.27.8", + "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz", + "integrity": "sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==", + "dev": true }, "node_modules/@sinonjs/commons": { - "version": "1.8.3", - "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.8.3.tgz", - "integrity": "sha512-xkNcLAn/wZaX14RPlwizcKicDk9G3F8m2nU3L7Ukm5zBgTwiT0wsoFAHx9Jq56fJA1z/7uKGtCRu16sOUCLIHQ==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-3.0.0.tgz", + "integrity": "sha512-jXBtWAF4vmdNmZgD5FoKsVLv3rPgDnLgPbU84LIJ3otV44vJlDRokVng5v8NFJdCf/da9legHcKaRuZs4L7faA==", "dev": true, "dependencies": { "type-detect": "4.0.8" } }, "node_modules/@sinonjs/fake-timers": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-8.1.0.tgz", - "integrity": "sha512-OAPJUAtgeINhh/TAlUID4QTs53Njm7xzddaVlEs/SXwgtiD1tW22zAB/W1wdqfrpmikgaWQ9Fw6Ws+hsiRm5Vg==", - "dev": true, - "dependencies": { - "@sinonjs/commons": "^1.7.0" - } - }, - "node_modules/@sinonjs/samsam": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/@sinonjs/samsam/-/samsam-5.3.1.tgz", - "integrity": "sha512-1Hc0b1TtyfBu8ixF/tpfSHTVWKwCBLY4QJbkgnE7HcwyvT2xArDxb4K7dMgqRm3szI+LJbzmW/s4xxEhv6hwDg==", + "version": "10.3.0", + "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-10.3.0.tgz", + "integrity": "sha512-V4BG07kuYSUkTCSBHG8G8TNhM+F19jXFWnQtzj+we8DrkpSBCee9Z3Ms8yiGer/dlmhe35/Xdgyo3/0rQKg7YA==", "dev": true, "dependencies": { - "@sinonjs/commons": "^1.6.0", - "lodash.get": "^4.4.2", - "type-detect": "^4.0.8" + "@sinonjs/commons": "^3.0.0" } }, - "node_modules/@sinonjs/text-encoding": { - "version": "0.7.1", - "resolved": "https://registry.npmjs.org/@sinonjs/text-encoding/-/text-encoding-0.7.1.tgz", - "integrity": "sha512-+iTbntw2IZPb/anVDbypzfQa+ay64MW0Zo8aJ8gZPWMMK6/OubMVb6lUPMagqjOPnmtauXnFCACVl3O7ogjeqQ==", - "dev": true - }, "node_modules/@tootallnate/once": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-1.1.2.tgz", - "integrity": "sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-2.0.0.tgz", + "integrity": "sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A==", "dev": true, "engines": { - "node": ">= 6" + "node": ">= 10" } }, "node_modules/@types/babel__core": { - "version": "7.1.18", - "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.1.18.tgz", - "integrity": "sha512-S7unDjm/C7z2A2R9NzfKCK1I+BAALDtxEmsJBwlB3EzNfb929ykjL++1CK9LO++EIp2fQrC8O+BwjKvz6UeDyQ==", + "version": "7.20.2", + "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.2.tgz", + "integrity": "sha512-pNpr1T1xLUc2l3xJKuPtsEky3ybxN3m4fJkknfIpTCTfIZCDW57oAg+EfCgIIp2rvCe0Wn++/FfodDS4YXxBwA==", "dev": true, "dependencies": { - "@babel/parser": "^7.1.0", - "@babel/types": "^7.0.0", + "@babel/parser": "^7.20.7", + "@babel/types": "^7.20.7", "@types/babel__generator": "*", "@types/babel__template": "*", "@types/babel__traverse": "*" } }, "node_modules/@types/babel__generator": { - "version": "7.6.4", - "resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.6.4.tgz", - "integrity": "sha512-tFkciB9j2K755yrTALxD44McOrk+gfpIpvC3sxHjRawj6PfnQxrse4Clq5y/Rq+G3mrBurMax/lG8Qn2t9mSsg==", + "version": "7.6.5", + "resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.6.5.tgz", + "integrity": "sha512-h9yIuWbJKdOPLJTbmSpPzkF67e659PbQDba7ifWm5BJ8xTv+sDmS7rFmywkWOvXedGTivCdeGSIIX8WLcRTz8w==", "dev": true, "dependencies": { "@babel/types": "^7.0.0" } }, "node_modules/@types/babel__template": { - "version": "7.4.1", - "resolved": "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.4.1.tgz", - "integrity": "sha512-azBFKemX6kMg5Io+/rdGT0dkGreboUVR0Cdm3fz9QJWpaQGJRQXl7C+6hOTCZcMll7KFyEQpgbYI2lHdsS4U7g==", + "version": "7.4.2", + "resolved": "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.4.2.tgz", + "integrity": "sha512-/AVzPICMhMOMYoSx9MoKpGDKdBRsIXMNByh1PXSZoa+v6ZoLa8xxtsT/uLQ/NJm0XVAWl/BvId4MlDeXJaeIZQ==", "dev": true, "dependencies": { "@babel/parser": "^7.1.0", @@ -3149,12 +3373,12 @@ } }, "node_modules/@types/babel__traverse": { - "version": "7.14.2", - "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.14.2.tgz", - "integrity": "sha512-K2waXdXBi2302XUdcHcR1jCeU0LL4TD9HRs/gk0N2Xvrht+G/BfJa4QObBQZfhMdxiCpV3COl5Nfq4uKTeTnJA==", + "version": "7.20.2", + "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.20.2.tgz", + "integrity": "sha512-ojlGK1Hsfce93J0+kn3H5R73elidKUaZonirN33GSmgTUMpzI/MIFfSpF3haANe3G1bEBS9/9/QEqwTzwqFsKw==", "dev": true, "dependencies": { - "@babel/types": "^7.3.0" + "@babel/types": "^7.20.7" } }, "node_modules/@types/chrome": { @@ -3167,12 +3391,6 @@ "@types/har-format": "*" } }, - "node_modules/@types/dateformat": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@types/dateformat/-/dateformat-3.0.1.tgz", - "integrity": "sha512-KlPPdikagvL6ELjWsljbyDIPzNCeliYkqRpI+zea99vBBbCIA5JNshZAwQKTON139c87y9qvTFVgkFd14rtS4g==", - "dev": true - }, "node_modules/@types/filesystem": { "version": "0.0.30", "resolved": "https://registry.npmjs.org/@types/filesystem/-/filesystem-0.0.30.tgz", @@ -3199,9 +3417,9 @@ } }, "node_modules/@types/graceful-fs": { - "version": "4.1.5", - "resolved": "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.5.tgz", - "integrity": "sha512-anKkLmZZ+xm4p8JWBf4hElkM4XR+EZeA2M9BAkkTldmcyDY4mbdIJnRghDJH3Ov5ooY7/UAoENtmdMSkaAd7Cw==", + "version": "4.1.7", + "resolved": "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.7.tgz", + "integrity": "sha512-MhzcwU8aUygZroVwL2jeYk6JisJrPl/oov/gsgGCue9mkgl9wjGbzReYQClxiUgFDnib9FuHqTndccKeZKxTRw==", "dev": true, "dependencies": { "@types/node": "*" @@ -3238,25 +3456,36 @@ } }, "node_modules/@types/jest": { - "version": "27.4.1", - "resolved": "https://registry.npmjs.org/@types/jest/-/jest-27.4.1.tgz", - "integrity": "sha512-23iPJADSmicDVrWk+HT58LMJtzLAnB2AgIzplQuq/bSrGaxCrlvRFjGbXmamnnk/mAmCdLStiGqggu28ocUyiw==", + "version": "29.5.5", + "resolved": "https://registry.npmjs.org/@types/jest/-/jest-29.5.5.tgz", + "integrity": "sha512-ebylz2hnsWR9mYvmBFbXJXr+33UPc4+ZdxyDXh5w0FlPBTfCVN3wPL+kuOiQt3xvrK419v7XWeAs+AeOksafXg==", + "dev": true, + "dependencies": { + "expect": "^29.0.0", + "pretty-format": "^29.0.0" + } + }, + "node_modules/@types/jsdom": { + "version": "20.0.1", + "resolved": "https://registry.npmjs.org/@types/jsdom/-/jsdom-20.0.1.tgz", + "integrity": "sha512-d0r18sZPmMQr1eG35u12FZfhIXNrnsPU/g5wvRKCUf/tOGilKKwYMYGqh33BNR6ba+2gkHw1EUiHoN3mn7E5IQ==", "dev": true, "dependencies": { - "jest-matcher-utils": "^27.0.0", - "pretty-format": "^27.0.0" + "@types/node": "*", + "@types/tough-cookie": "*", + "parse5": "^7.0.0" } }, "node_modules/@types/json-schema": { - "version": "7.0.11", - "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.11.tgz", - "integrity": "sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ==", + "version": "7.0.12", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.12.tgz", + "integrity": "sha512-Hr5Jfhc9eYOQNPYO5WLDq/n4jqijdHNlDXjuAQkkt+mWdQR+XJToOHrsD4cPaMXpn6KO7y2+wM8AZEs8VpBLVA==", "dev": true }, "node_modules/@types/json5": { "version": "0.0.29", "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz", - "integrity": "sha1-7ihweulOEdK4J7y+UnC86n8+ce4=", + "integrity": "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==", "dev": true }, "node_modules/@types/lodash": { @@ -3271,19 +3500,10 @@ "integrity": "sha512-1z8k4wzFnNjVK/tlxvrWuK5WMt6mydWWP7+zvH5eFep4oj+UkrfiJTRtjCeBXNpwaA/FYqqtb4/QS4ianFpIRA==", "dev": true }, - "node_modules/@types/mkdirp": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@types/mkdirp/-/mkdirp-1.0.2.tgz", - "integrity": "sha512-o0K1tSO0Dx5X6xlU5F1D6625FawhC3dU3iqr25lluNv/+/QIVH8RLNEiVokgIZo+mz+87w/3Mkg/VvQS+J51fQ==", - "dev": true, - "dependencies": { - "@types/node": "*" - } - }, "node_modules/@types/node": { - "version": "16.11.36", - "resolved": "https://registry.npmjs.org/@types/node/-/node-16.11.36.tgz", - "integrity": "sha512-FR5QJe+TaoZ2GsMHkjuwoNabr+UrJNRr2HNOo+r/7vhcuntM6Ee/pRPOnRhhL2XE9OOvX9VLEq+BcXl3VjNoWA==", + "version": "18.17.19", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.17.19.tgz", + "integrity": "sha512-+pMhShR3Or5GR0/sp4Da7FnhVmTalWm81M6MkEldbwjETSaPalw138Z4KdpQaistvqQxLB7Cy4xwYdxpbSOs9Q==", "dev": true }, "node_modules/@types/prettier": { @@ -3292,31 +3512,31 @@ "integrity": "sha512-RI1L7N4JnW5gQw2spvL7Sllfuf1SaHdrZpCHiBlCXjIlufi1SMNnbu2teze3/QE67Fg2tBlH7W+mi4hVNk4p0A==", "dev": true }, - "node_modules/@types/sinon": { - "version": "7.5.2", - "resolved": "https://registry.npmjs.org/@types/sinon/-/sinon-7.5.2.tgz", - "integrity": "sha512-T+m89VdXj/eidZyejvmoP9jivXgBDdkOSBVQjU9kF349NEx10QdPNGxHeZUaj1IlJ32/ewdyXJjnJxyxJroYwg==", - "dev": true - }, "node_modules/@types/stack-utils": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-2.0.1.tgz", "integrity": "sha512-Hl219/BT5fLAaz6NDkSuhzasy49dwQS/DSdu4MdggFB8zcXv7vflBI3xp7FEmkmdDkBUI2bPUNeMttp2knYdxw==", "dev": true }, + "node_modules/@types/tough-cookie": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@types/tough-cookie/-/tough-cookie-4.0.2.tgz", + "integrity": "sha512-Q5vtl1W5ue16D+nIaW8JWebSSraJVlK+EthKn7e7UcD4KWsaSJ8BqGPXNaPghgtcn/fhvrN17Tv8ksUsQpiplw==", + "dev": true + }, "node_modules/@types/yargs": { - "version": "16.0.4", - "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-16.0.4.tgz", - "integrity": "sha512-T8Yc9wt/5LbJyCaLiHPReJa0kApcIgJ7Bn735GjItUfh08Z1pJvu8QZqb9s+mMvKV6WUQRV7K2R46YbjMXTTJw==", + "version": "17.0.24", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.24.tgz", + "integrity": "sha512-6i0aC7jV6QzQB8ne1joVZ0eSFIstHsCrobmOtghM11yGlH0j43FKL2UhWdELkyps0zuf7qVTUVCCR+tgSlyLLw==", "dev": true, "dependencies": { "@types/yargs-parser": "*" } }, "node_modules/@types/yargs-parser": { - "version": "20.2.1", - "resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-20.2.1.tgz", - "integrity": "sha512-7tFImggNeNBVMsn0vLrpn1H1uPrUBdnARPTpZoitY37ZrdJREzf7I16tMrlK3hen349gr1NYh8CmZQa7CTG6Aw==", + "version": "21.0.0", + "resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-21.0.0.tgz", + "integrity": "sha512-iO9ZQHkZxHn4mSakYV0vFHAVDyEOIJQrV2uZ06HxEPcx+mt8swXoZHIbaaJ2crJYFfErySgktuTZ3BeLz+XmFA==", "dev": true }, "node_modules/@typescript/vfs": { @@ -3329,9 +3549,9 @@ } }, "node_modules/abab": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.5.tgz", - "integrity": "sha512-9IK9EadsbHo6jLWIpxpR6pL0sazTXV6+SQv25ZB+F7Bj9mJNaOc4nCRabwd5M/JwmUa8idz6Eci6eKfJryPs6Q==", + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.6.tgz", + "integrity": "sha512-j2afSsaIENvHZN2B8GOpF566vZ5WVk5opAiMTvWgaQT8DkbOqsTfvNAvHoRGU2zzP8cPoqys+xHTRDWW8L+/BA==", "dev": true }, "node_modules/abbrev": { @@ -3353,20 +3573,44 @@ } }, "node_modules/acorn-globals": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/acorn-globals/-/acorn-globals-6.0.0.tgz", - "integrity": "sha512-ZQl7LOWaF5ePqqcX4hLuv/bLXYQNfNWw2c0/yX/TsPRKamzHcTGQnlCjHT3TsmkOUVEPS3crCxiPfdzE/Trlhg==", + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/acorn-globals/-/acorn-globals-7.0.1.tgz", + "integrity": "sha512-umOSDSDrfHbTNPuNpC2NSnnA3LUrqpevPb4T9jRx4MagXNS0rs+gwiTcAvqCRmsD6utzsrzNt+ebm00SNWiC3Q==", "dev": true, "dependencies": { - "acorn": "^7.1.1", - "acorn-walk": "^7.1.1" + "acorn": "^8.1.0", + "acorn-walk": "^8.0.2" + } + }, + "node_modules/acorn-globals/node_modules/acorn": { + "version": "8.10.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.10.0.tgz", + "integrity": "sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw==", + "dev": true, + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/acorn-globals/node_modules/acorn-walk": { + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz", + "integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==", + "dev": true, + "engines": { + "node": ">=0.4.0" } }, "node_modules/acorn-jsx": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.1.tgz", - "integrity": "sha512-K0Ptm/47OKfQRpNQ2J/oIN/3QYiK6FwW+eJbILhsdxh2WTLdl+30o8aGdTbm5JbffpFFAg/g+zi1E+jvJha5ng==", - "dev": true + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", + "dev": true, + "peerDependencies": { + "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" + } }, "node_modules/acorn-node": { "version": "1.8.2", @@ -3401,14 +3645,14 @@ } }, "node_modules/ajv": { - "version": "8.10.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.10.0.tgz", - "integrity": "sha512-bzqAEZOjkrUMl2afH8dknrq5KEk2SrwdBROR+vH1EKVQTqaUbJVPdc/gEdggTMM0Se+s+Ja4ju4TlNcStKl2Hw==", + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", "dev": true, "dependencies": { "fast-deep-equal": "^3.1.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", "uri-js": "^4.2.2" }, "funding": { @@ -3416,15 +3660,6 @@ "url": "https://github.com/sponsors/epoberezkin" } }, - "node_modules/ansi-colors": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", - "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", - "dev": true, - "engines": { - "node": ">=6" - } - }, "node_modules/ansi-escapes": { "version": "4.3.2", "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", @@ -3501,6 +3736,19 @@ "sprintf-js": "~1.0.2" } }, + "node_modules/array-buffer-byte-length": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.0.tgz", + "integrity": "sha512-LPuwb2P+NrQw3XhxGc36+XSvuBPopovXYTR9Ew++Du9Yb/bx5AzBfrIsBoj0EZUifjQU+sHL21sseZ3jerWO/A==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "is-array-buffer": "^3.0.1" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/array-differ": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/array-differ/-/array-differ-3.0.0.tgz", @@ -3519,22 +3767,16 @@ "node": ">=0.10.0" } }, - "node_modules/array-filter": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/array-filter/-/array-filter-1.0.0.tgz", - "integrity": "sha1-uveeYubvTCpMC4MSMtr/7CUfnYM=", - "dev": true - }, "node_modules/array-includes": { - "version": "3.1.4", - "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.4.tgz", - "integrity": "sha512-ZTNSQkmWumEbiHO2GF4GmWxYVTiQyJy2XOTa15sdQSrvKn7l+180egQMqlrMOUMCyLMD7pmyQe4mMDUT6Behrw==", + "version": "3.1.6", + "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.6.tgz", + "integrity": "sha512-sgTbLvL6cNnw24FnbaDyjmvddQ2ML8arZsgaJhoABMoplz/4QRhtrYS+alr1BUM1Bwp6dhx8vVCBSLG+StwOFw==", "dev": true, "dependencies": { "call-bind": "^1.0.2", - "define-properties": "^1.1.3", - "es-abstract": "^1.19.1", - "get-intrinsic": "^1.1.1", + "define-properties": "^1.1.4", + "es-abstract": "^1.20.4", + "get-intrinsic": "^1.1.3", "is-string": "^1.0.7" }, "engines": { @@ -3562,15 +3804,17 @@ "node": ">=8" } }, - "node_modules/array.prototype.flat": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.2.5.tgz", - "integrity": "sha512-KaYU+S+ndVqyUnignHftkwc58o3uVU1jzczILJ1tN2YaIZpFIKBiP/x/j97E5MVPsaCloPbqWLB/8qCTVvT2qg==", + "node_modules/array.prototype.findlastindex": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/array.prototype.findlastindex/-/array.prototype.findlastindex-1.2.2.tgz", + "integrity": "sha512-tb5thFFlUcp7NdNF6/MpDk/1r/4awWG1FIz3YqDf+/zJSTezBb+/5WViH41obXULHVpDzoiCLpJ/ZO9YbJMsdw==", "dev": true, "dependencies": { "call-bind": "^1.0.2", - "define-properties": "^1.1.3", - "es-abstract": "^1.19.0" + "define-properties": "^1.1.4", + "es-abstract": "^1.20.4", + "es-shim-unscopables": "^1.0.0", + "get-intrinsic": "^1.1.3" }, "engines": { "node": ">= 0.4" @@ -3579,8 +3823,64 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/arrify": { - "version": "2.0.1", + "node_modules/array.prototype.flat": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.3.1.tgz", + "integrity": "sha512-roTU0KWIOmJ4DRLmwKd19Otg0/mT3qPNt0Qb3GWW8iObuZXxrjB/pzn0R3hqpRSWg4HCwqx+0vwOnWnvlOyeIA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.4", + "es-abstract": "^1.20.4", + "es-shim-unscopables": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/array.prototype.flatmap": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/array.prototype.flatmap/-/array.prototype.flatmap-1.3.1.tgz", + "integrity": "sha512-8UGn9O1FDVvMNB0UlLv4voxRMze7+FpHyF5mSMRjWHUMlpoDViniy05870VlxhfgTnLbpuwTzvD76MTtWxB/mQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.4", + "es-abstract": "^1.20.4", + "es-shim-unscopables": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/arraybuffer.prototype.slice": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/arraybuffer.prototype.slice/-/arraybuffer.prototype.slice-1.0.1.tgz", + "integrity": "sha512-09x0ZWFEjj4WD8PDbykUwo3t9arLn8NIzmmYEJFpYekOAQjpkGSyrQhNoRTcwwcFRu+ycWF78QZ63oWTqSjBcw==", + "dev": true, + "dependencies": { + "array-buffer-byte-length": "^1.0.0", + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "get-intrinsic": "^1.2.1", + "is-array-buffer": "^3.0.2", + "is-shared-array-buffer": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/arrify": { + "version": "2.0.1", "resolved": "https://registry.npmjs.org/arrify/-/arrify-2.0.1.tgz", "integrity": "sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug==", "dev": true, @@ -3589,9 +3889,9 @@ } }, "node_modules/asana": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/asana/-/asana-1.0.0.tgz", - "integrity": "sha512-ceL8+aGK21p4RiaEbuPTsuQNO4cpyxSHM+5xKdrx6aCrw0IBfVIqWz5s7lW+R89ewjUNDzRei3CjHvFQ7yf24Q==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/asana/-/asana-1.0.2.tgz", + "integrity": "sha512-U/i3f8gK7Ux4vCSWMGPj934yRjKuszIEFzYFiOeWgjMwxa8ksKyYnv9vM8lg6FXxMYXwgKiI9JM1YyOVTvj/eQ==", "dev": true, "dependencies": { "bluebird": "^3.7.2", @@ -3662,15 +3962,6 @@ "inherits": "2.0.1" } }, - "node_modules/astral-regex": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz", - "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, "node_modules/async": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/async/-/async-3.2.0.tgz", @@ -3693,15 +3984,15 @@ } }, "node_modules/available-typed-arrays": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.2.tgz", - "integrity": "sha512-XWX3OX8Onv97LMk/ftVyBibpGwY5a8SmuxZPzeOxqmuEqUCOM9ZE+uIaD1VNJ5QnvU2UQusvmKbuM1FR8QWGfQ==", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz", + "integrity": "sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw==", "dev": true, - "dependencies": { - "array-filter": "^1.0.0" - }, "engines": { "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/aws-sign2": { @@ -3720,22 +4011,21 @@ "dev": true }, "node_modules/babel-jest": { - "version": "27.5.1", - "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-27.5.1.tgz", - "integrity": "sha512-cdQ5dXjGRd0IBRATiQ4mZGlGlRE8kJpjPOixdNRdT+m3UcNqmYWN6rK6nvtXYfY3D76cb8s/O1Ss8ea24PIwcg==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-29.7.0.tgz", + "integrity": "sha512-BrvGY3xZSwEcCzKvKsCi2GgHqDqsYkOP4/by5xCgIwGXQxIEh+8ew3gmrE1y7XRR6LHZIj6yLYnUi/mm2KXKBg==", "dev": true, "dependencies": { - "@jest/transform": "^27.5.1", - "@jest/types": "^27.5.1", + "@jest/transform": "^29.7.0", "@types/babel__core": "^7.1.14", "babel-plugin-istanbul": "^6.1.1", - "babel-preset-jest": "^27.5.1", + "babel-preset-jest": "^29.6.3", "chalk": "^4.0.0", "graceful-fs": "^4.2.9", "slash": "^3.0.0" }, "engines": { - "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" }, "peerDependencies": { "@babel/core": "^7.8.0" @@ -3811,15 +4101,6 @@ "node": ">=8" } }, - "node_modules/babel-plugin-dynamic-import-node": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/babel-plugin-dynamic-import-node/-/babel-plugin-dynamic-import-node-2.3.3.tgz", - "integrity": "sha512-jZVI+s9Zg3IqA/kdi0i6UDCybUI3aSBLnglhYbSSjKlV7yF1F/5LWv8MakQmvYpnbJDS6fcBL2KzHSxNCMtWSQ==", - "dev": true, - "dependencies": { - "object.assign": "^4.1.0" - } - }, "node_modules/babel-plugin-istanbul": { "version": "6.1.1", "resolved": "https://registry.npmjs.org/babel-plugin-istanbul/-/babel-plugin-istanbul-6.1.1.tgz", @@ -3837,57 +4118,57 @@ } }, "node_modules/babel-plugin-jest-hoist": { - "version": "27.5.1", - "resolved": "https://registry.npmjs.org/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-27.5.1.tgz", - "integrity": "sha512-50wCwD5EMNW4aRpOwtqzyZHIewTYNxLA4nhB+09d8BIssfNfzBRhkBIHiaPv1Si226TQSvp8gxAJm2iY2qs2hQ==", + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-29.6.3.tgz", + "integrity": "sha512-ESAc/RJvGTFEzRwOTT4+lNDk/GNHMkKbNzsvT0qKRfDyyYTskxB5rnU2njIDYVxXCBHHEI1c0YwHob3WaYujOg==", "dev": true, "dependencies": { "@babel/template": "^7.3.3", "@babel/types": "^7.3.3", - "@types/babel__core": "^7.0.0", + "@types/babel__core": "^7.1.14", "@types/babel__traverse": "^7.0.6" }, "engines": { - "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, "node_modules/babel-plugin-polyfill-corejs2": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.3.1.tgz", - "integrity": "sha512-v7/T6EQcNfVLfcN2X8Lulb7DjprieyLWJK/zOWH5DUYcAgex9sP3h25Q+DLsX9TloXe3y1O8l2q2Jv9q8UVB9w==", + "version": "0.4.5", + "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.4.5.tgz", + "integrity": "sha512-19hwUH5FKl49JEsvyTcoHakh6BE0wgXLLptIyKZ3PijHc/Ci521wygORCUCCred+E/twuqRyAkE02BAWPmsHOg==", "dev": true, "dependencies": { - "@babel/compat-data": "^7.13.11", - "@babel/helper-define-polyfill-provider": "^0.3.1", - "semver": "^6.1.1" + "@babel/compat-data": "^7.22.6", + "@babel/helper-define-polyfill-provider": "^0.4.2", + "semver": "^6.3.1" }, "peerDependencies": { - "@babel/core": "^7.0.0-0" + "@babel/core": "^7.4.0 || ^8.0.0-0 <8.0.0" } }, "node_modules/babel-plugin-polyfill-corejs3": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.5.2.tgz", - "integrity": "sha512-G3uJih0XWiID451fpeFaYGVuxHEjzKTHtc9uGFEjR6hHrvNzeS/PX+LLLcetJcytsB5m4j+K3o/EpXJNb/5IEQ==", + "version": "0.8.3", + "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.8.3.tgz", + "integrity": "sha512-z41XaniZL26WLrvjy7soabMXrfPWARN25PZoriDEiLMxAp50AUW3t35BGQUMg5xK3UrpVTtagIDklxYa+MhiNA==", "dev": true, "dependencies": { - "@babel/helper-define-polyfill-provider": "^0.3.1", - "core-js-compat": "^3.21.0" + "@babel/helper-define-polyfill-provider": "^0.4.2", + "core-js-compat": "^3.31.0" }, "peerDependencies": { - "@babel/core": "^7.0.0-0" + "@babel/core": "^7.4.0 || ^8.0.0-0 <8.0.0" } }, "node_modules/babel-plugin-polyfill-regenerator": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.3.1.tgz", - "integrity": "sha512-Y2B06tvgHYt1x0yz17jGkGeeMr5FeKUu+ASJ+N6nB5lQ8Dapfg42i0OVrf8PNGJ3zKL4A23snMi1IRwrqqND7A==", + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.5.2.tgz", + "integrity": "sha512-tAlOptU0Xj34V1Y2PNTL4Y0FOJMDB6bZmoW39FeCQIhigGLkqu3Fj6uiXpxIf6Ij274ENdYx64y6Au+ZKlb1IA==", "dev": true, "dependencies": { - "@babel/helper-define-polyfill-provider": "^0.3.1" + "@babel/helper-define-polyfill-provider": "^0.4.2" }, "peerDependencies": { - "@babel/core": "^7.0.0-0" + "@babel/core": "^7.4.0 || ^8.0.0-0 <8.0.0" } }, "node_modules/babel-preset-current-node-syntax": { @@ -3914,16 +4195,16 @@ } }, "node_modules/babel-preset-jest": { - "version": "27.5.1", - "resolved": "https://registry.npmjs.org/babel-preset-jest/-/babel-preset-jest-27.5.1.tgz", - "integrity": "sha512-Nptf2FzlPCWYuJg41HBqXVT8ym6bXOevuCTbhxlUpjwtysGaIWFvDEjp4y+G7fl13FgOdjs7P/DmErqH7da0Ag==", + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/babel-preset-jest/-/babel-preset-jest-29.6.3.tgz", + "integrity": "sha512-0B3bhxR6snWXJZtR/RliHTDPRgn1sNHOR0yVtq/IiQFyuOVjFS+wuio/R4gSNkyYmKmJB4wGZv2NZanmKmTnNA==", "dev": true, "dependencies": { - "babel-plugin-jest-hoist": "^27.5.1", + "babel-plugin-jest-hoist": "^29.6.3", "babel-preset-current-node-syntax": "^1.0.0" }, "engines": { - "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" }, "peerDependencies": { "@babel/core": "^7.0.0" @@ -4108,12 +4389,6 @@ "xtend": "~4.0.1" } }, - "node_modules/browser-process-hrtime": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/browser-process-hrtime/-/browser-process-hrtime-1.0.0.tgz", - "integrity": "sha512-9o5UecI3GhkpM6DrXr69PblIuWxPKk9Y0jHBRhdocZ2y7YECBFCsHm79Pr3OyR2AvjhDkabFJaDJMYRazHgsow==", - "dev": true - }, "node_modules/browser-request": { "version": "0.3.3", "resolved": "https://registry.npmjs.org/browser-request/-/browser-request-0.3.3.tgz", @@ -4381,26 +4656,35 @@ } }, "node_modules/browserslist": { - "version": "4.19.3", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.19.3.tgz", - "integrity": "sha512-XK3X4xtKJ+Txj8G5c30B4gsm71s69lqXlkYui4s6EkKxuv49qjYlY6oVd+IFJ73d4YymtM3+djvvt/R/iJwwDg==", + "version": "4.21.10", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.21.10.tgz", + "integrity": "sha512-bipEBdZfVH5/pwrvqc+Ub0kUPVfGUhlKxbvfD+z1BDnPEO/X98ruXGA1WP5ASpAFKan7Qr6j736IacbZQuAlKQ==", "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], "dependencies": { - "caniuse-lite": "^1.0.30001312", - "electron-to-chromium": "^1.4.71", - "escalade": "^3.1.1", - "node-releases": "^2.0.2", - "picocolors": "^1.0.0" + "caniuse-lite": "^1.0.30001517", + "electron-to-chromium": "^1.4.477", + "node-releases": "^2.0.13", + "update-browserslist-db": "^1.0.11" }, "bin": { "browserslist": "cli.js" }, "engines": { "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/browserslist" } }, "node_modules/bser": { @@ -4463,9 +4747,9 @@ } }, "node_modules/call-me-maybe": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/call-me-maybe/-/call-me-maybe-1.0.1.tgz", - "integrity": "sha512-wCyFsDQkKPwwF8BDwOiWNx/9K45L/hvggQiDbve+viMNMQnWhrlYIuBk09offfwCRtCO9P6XwUttufzU11WCVw==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-me-maybe/-/call-me-maybe-1.0.2.tgz", + "integrity": "sha512-HpX65o1Hnr9HH25ojC1YGs7HCQLq0GCOibSaWER0eNpgJ/Z1MZv2mTc7+xh6WOPxbRVcmgbv4hGU+uSQ/2xFZQ==", "dev": true }, "node_modules/callsites": { @@ -4487,9 +4771,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001374", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001374.tgz", - "integrity": "sha512-mWvzatRx3w+j5wx/mpFN5v5twlPrabG8NqX2c6e45LCpymdoGqNvRkRutFUqpRTXKFQFNQJasvK0YT7suW6/Hw==", + "version": "1.0.30001520", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001520.tgz", + "integrity": "sha512-tahF5O9EiiTzwTUqAeFjIZbn4Dnqxzz7ktrgGlMYNLH43Ul26IgTMH/zvL3DG0lZxBYnlT04axvInszUsZULdA==", "dev": true, "funding": [ { @@ -4499,6 +4783,10 @@ { "type": "tidelift", "url": "https://tidelift.com/funding/github/npm/caniuse-lite" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" } ] }, @@ -4568,10 +4856,19 @@ } }, "node_modules/ci-info": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.3.0.tgz", - "integrity": "sha512-riT/3vI5YpVH6/qomlDnJow6TBee2PBKSEpx3O32EGPYbWGIRsIlGRms3Sm74wYE1JMo8RnO04Hb12+v1J5ICw==", - "dev": true + "version": "3.8.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.8.0.tgz", + "integrity": "sha512-eXTggHWSooYhq49F2opQhuHWgzucfF2YgODK4e1566GQs5BIfP30B0oenwBJHfWxAs2fyPB1s7Mg949zLf61Yw==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/sibiraj-s" + } + ], + "engines": { + "node": ">=8" + } }, "node_modules/cipher-base": { "version": "1.0.4", @@ -4584,9 +4881,9 @@ } }, "node_modules/cjs-module-lexer": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/cjs-module-lexer/-/cjs-module-lexer-1.2.2.tgz", - "integrity": "sha512-cOU9usZw8/dXIXKtwa8pM0OTJQuJkxMN6w30csNRUerHfeQ5R6U3kkU/FtJeIf3M202OHfY2U8ccInBG7/xogA==", + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/cjs-module-lexer/-/cjs-module-lexer-1.2.3.tgz", + "integrity": "sha512-0TNiGstbQmCFwt4akjjBg5pLRTSyj/PkWQ1ZoO2zntmg9yLqSRxwEa4iCfQLGjqhiqBfOJa7W/E8wfGrTDmlZQ==", "dev": true }, "node_modules/clean-stack": { @@ -4666,14 +4963,17 @@ } }, "node_modules/cliui": { - "version": "7.0.4", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", - "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", "dev": true, "dependencies": { "string-width": "^4.2.0", - "strip-ansi": "^6.0.0", + "strip-ansi": "^6.0.1", "wrap-ansi": "^7.0.0" + }, + "engines": { + "node": ">=12" } }, "node_modules/clone": { @@ -4688,7 +4988,7 @@ "node_modules/co": { "version": "4.6.0", "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", - "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=", + "integrity": "sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ==", "dev": true, "engines": { "iojs": ">= 1.0.0", @@ -4696,9 +4996,9 @@ } }, "node_modules/collect-v8-coverage": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/collect-v8-coverage/-/collect-v8-coverage-1.0.1.tgz", - "integrity": "sha512-iBPtljfCNcTKNAto0KEtDfZ3qzjJvqE3aTGZsbhjSBlorqpXJlaWWtPO35D+ZImoC3KWejX64o+yPGxhWSTzfg==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/collect-v8-coverage/-/collect-v8-coverage-1.0.2.tgz", + "integrity": "sha512-lHl4d5/ONEbLlJvaJNtsF/Lz+WvB07u2ycqTYbdrq7UypDXailES4valYb2eWiJFxZlVmpGekfqoxQhzyFdT4Q==", "dev": true }, "node_modules/color-convert": { @@ -4713,7 +5013,7 @@ "node_modules/color-name": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", "dev": true }, "node_modules/colors": { @@ -4795,37 +5095,24 @@ "dev": true }, "node_modules/convert-source-map": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.7.0.tgz", - "integrity": "sha512-4FJkXzKXEDB1snCFZlLP4gpC3JILicCpGbzG9f9G7tGqGCzETQ2hWPrcinA9oU4wtf2biUaEH5065UnMeR33oA==", - "dev": true, - "dependencies": { - "safe-buffer": "~5.1.1" - } + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", + "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", + "dev": true }, "node_modules/core-js-compat": { - "version": "3.21.1", - "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.21.1.tgz", - "integrity": "sha512-gbgX5AUvMb8gwxC7FLVWYT7Kkgu/y7+h/h1X43yJkNqhlK2fuYyQimqvKGNZFAY6CKii/GFKJ2cp/1/42TN36g==", + "version": "3.32.0", + "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.32.0.tgz", + "integrity": "sha512-7a9a3D1k4UCVKnLhrgALyFcP7YCsLOQIxPd0dKjf/6GuPcgyiGP70ewWdCGrSK7evyhymi0qO4EqCmSJofDeYw==", "dev": true, "dependencies": { - "browserslist": "^4.19.1", - "semver": "7.0.0" + "browserslist": "^4.21.9" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/core-js" } }, - "node_modules/core-js-compat/node_modules/semver": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.0.0.tgz", - "integrity": "sha512-+GB6zVA9LWh6zovYQLALHwv5rb2PHGlJi3lfiqIHxR0uuwCgefcOJc59v9fv1w8GbStwxuuqqAjI9NMAOOgq1A==", - "dev": true, - "bin": { - "semver": "bin/semver.js" - } - }, "node_modules/core-util-is": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", @@ -4884,6 +5171,97 @@ "sha.js": "^2.4.8" } }, + "node_modules/create-jest": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/create-jest/-/create-jest-29.7.0.tgz", + "integrity": "sha512-Adz2bdH0Vq3F53KEMJOoftQFutWCukm6J24wbPWRO4k1kMY7gS7ds/uoJkNuV8wDCtWWnuwGcJwpWcih+zEW1Q==", + "dev": true, + "dependencies": { + "@jest/types": "^29.6.3", + "chalk": "^4.0.0", + "exit": "^0.1.2", + "graceful-fs": "^4.2.9", + "jest-config": "^29.7.0", + "jest-util": "^29.7.0", + "prompts": "^2.0.1" + }, + "bin": { + "create-jest": "bin/create-jest.js" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/create-jest/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/create-jest/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/create-jest/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/create-jest/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/create-jest/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/create-jest/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/cross-spawn": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", @@ -4921,9 +5299,9 @@ } }, "node_modules/cssom": { - "version": "0.4.4", - "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.4.4.tgz", - "integrity": "sha512-p3pvU7r1MyyqbTk+WbNJIgJjG2VmTIaB10rI93LzVPrmDJKkzKYMtxxyAvQXR/NS6otuzveI7+7BBq3SjBS2mw==", + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.5.0.tgz", + "integrity": "sha512-iKuQcq+NdHqlAcwUY0o/HL69XQrUaQdMjmStJ8JFmUaiiQErlhrmuigkg/CU4E2J0IyUKUrMAgl36TvN67MqTw==", "dev": true }, "node_modules/cssstyle": { @@ -4973,23 +5351,23 @@ } }, "node_modules/data-urls": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-2.0.0.tgz", - "integrity": "sha512-X5eWTSXO/BJmpdIKCRuKUgSCgAN0OwliVK3yPKbwIWU1Tdw5BRajxlzMidvh+gwko9AfQ9zIj52pzF91Q3YAvQ==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-3.0.2.tgz", + "integrity": "sha512-Jy/tj3ldjZJo63sVAvg6LHt2mHvl4V6AgRAmNDtLdm7faqtsx+aJG42rsyCo9JCoRVKwPFzKlIPx3DIibwSIaQ==", "dev": true, "dependencies": { - "abab": "^2.0.3", - "whatwg-mimetype": "^2.3.0", - "whatwg-url": "^8.0.0" + "abab": "^2.0.6", + "whatwg-mimetype": "^3.0.0", + "whatwg-url": "^11.0.0" }, "engines": { - "node": ">=10" + "node": ">=12" } }, "node_modules/dateformat": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/dateformat/-/dateformat-3.0.3.tgz", - "integrity": "sha512-jyCETtSl3VMZMWeRo7iY1FL19ges1t55hMo5yaam4Jrsm5EPL89UQkoQRyiI+Yf4k8r2ZpdngkV8hr1lIdjb3Q==", + "version": "4.6.3", + "resolved": "https://registry.npmjs.org/dateformat/-/dateformat-4.6.3.tgz", + "integrity": "sha512-2P0p0pFGzHS5EMnhdxQi7aJN+iMheud0UhG4dlE1DLAlvL8JHjJJTX/CSm4JXwV0Ka5nGk3zC5mcb5bUQUxxMA==", "dev": true, "engines": { "node": "*" @@ -5013,27 +5391,35 @@ } }, "node_modules/decimal.js": { - "version": "10.3.1", - "resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-10.3.1.tgz", - "integrity": "sha512-V0pfhfr8suzyPGOx3nmq4aHqabehUZn6Ch9kyFpV79TGDTWFmHqUqXdabR7QHqxzrYolF4+tVmJhUG4OURg5dQ==", + "version": "10.4.3", + "resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-10.4.3.tgz", + "integrity": "sha512-VBBaLc1MgL5XpzgIP7ny5Z6Nx3UrRkIViUkPUdtl9aya5amy3De1gsUUSB1g3+3sExYNjCAsAznmukyxCb1GRA==", "dev": true }, "node_modules/dedent": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/dedent/-/dedent-0.7.0.tgz", - "integrity": "sha1-JJXduvbrh0q7Dhvp3yLS5aVEMmw=", - "dev": true + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/dedent/-/dedent-1.5.1.tgz", + "integrity": "sha512-+LxW+KLWxu3HW3M2w2ympwtqPrqYRzU8fqi6Fhd18fBALe15blJPI/I4+UHveMVG6lJqB4JNd4UG0S5cnVHwIg==", + "dev": true, + "peerDependencies": { + "babel-plugin-macros": "^3.1.0" + }, + "peerDependenciesMeta": { + "babel-plugin-macros": { + "optional": true + } + } }, "node_modules/deep-is": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", - "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", "dev": true }, "node_modules/deepmerge": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.2.2.tgz", - "integrity": "sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg==", + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz", + "integrity": "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==", "dev": true, "engines": { "node": ">=0.10.0" @@ -5049,15 +5435,19 @@ } }, "node_modules/define-properties": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", - "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.0.tgz", + "integrity": "sha512-xvqAVKGfT1+UAvPwKTVw/njhdQ8ZhXK4lI0bCIuCMrp2up9nPnaDftrLtmpTazqd1o+UY4zgzU+avtMbDP+ldA==", "dev": true, "dependencies": { - "object-keys": "^1.0.12" + "has-property-descriptors": "^1.0.0", + "object-keys": "^1.1.1" }, "engines": { "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/defined": { @@ -5145,22 +5535,13 @@ "node": ">=0.8.0" } }, - "node_modules/diff": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", - "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", - "dev": true, - "engines": { - "node": ">=0.3.1" - } - }, "node_modules/diff-sequences": { - "version": "27.5.1", - "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-27.5.1.tgz", - "integrity": "sha512-k1gCAXAsNgLwEL+Y8Wvl+M6oEFj5bgazfZULpS5CneoPPXRaCCW7dm+q21Ky2VEE5X+VeRDBVg1Pcvvsr4TtNQ==", + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-29.6.3.tgz", + "integrity": "sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q==", "dev": true, "engines": { - "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, "node_modules/diffie-hellman": { @@ -5215,24 +5596,15 @@ } }, "node_modules/domexception": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/domexception/-/domexception-2.0.1.tgz", - "integrity": "sha512-yxJ2mFy/sibVQlu5qHjOkf9J3K6zgmCxgJ94u2EdvDOV09H+32LtRswEcUsmUWN72pVLOEnTSRaIVVzVQgS0dg==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/domexception/-/domexception-4.0.0.tgz", + "integrity": "sha512-A2is4PLG+eeSfoTMA95/s4pvAoSo2mKtiM5jlHkAVewmiO8ISFTFKZjH7UAM1Atli/OT/7JHOrJRJiMKUZKYBw==", "dev": true, "dependencies": { - "webidl-conversions": "^5.0.0" + "webidl-conversions": "^7.0.0" }, "engines": { - "node": ">=8" - } - }, - "node_modules/domexception/node_modules/webidl-conversions": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-5.0.0.tgz", - "integrity": "sha512-VlZwKPCkYKxQgeSbH5EyngOmRp7Ww7I9rQLERETtf5ofd9pGeswWiOtogpEO850jziPRarreGxn5QIiTqpb2wA==", - "dev": true, - "engines": { - "node": ">=8" + "node": ">=12" } }, "node_modules/duplexer2": { @@ -5255,9 +5627,9 @@ } }, "node_modules/electron-to-chromium": { - "version": "1.4.71", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.71.tgz", - "integrity": "sha512-Hk61vXXKRb2cd3znPE9F+2pLWdIOmP7GjiTj45y6L3W/lO+hSnUSUhq+6lEaERWBdZOHbk2s3YV5c9xVl3boVw==", + "version": "1.4.490", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.490.tgz", + "integrity": "sha512-6s7NVJz+sATdYnIwhdshx/N/9O6rvMxmhVoDSDFdj6iA45gHR8EQje70+RYsF4GeB+k0IeNSBnP7yG9ZXJFr7A==", "dev": true }, "node_modules/elliptic": { @@ -5282,12 +5654,12 @@ "dev": true }, "node_modules/emittery": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/emittery/-/emittery-0.8.1.tgz", - "integrity": "sha512-uDfvUjVrfGJJhymx/kz6prltenw1u7WrCg1oa94zYY8xxVpLLUu045LAT0dhDZdXG58/EpPL/5kA180fQ/qudg==", + "version": "0.13.1", + "resolved": "https://registry.npmjs.org/emittery/-/emittery-0.13.1.tgz", + "integrity": "sha512-DeWwawk6r5yR9jFgnDKYt4sLS0LmHJJi3ZOnb5/JdbYwj3nW+FxQnHIjhBKz8YLC7oRNPVM9NQ47I3CVx34eqQ==", "dev": true, "engines": { - "node": ">=10" + "node": ">=12" }, "funding": { "url": "https://github.com/sindresorhus/emittery?sponsor=1" @@ -5299,18 +5671,6 @@ "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", "dev": true }, - "node_modules/enquirer": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.3.6.tgz", - "integrity": "sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==", - "dev": true, - "dependencies": { - "ansi-colors": "^4.1.1" - }, - "engines": { - "node": ">=8.6" - } - }, "node_modules/entities": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/entities/-/entities-3.0.1.tgz", @@ -5342,31 +5702,50 @@ } }, "node_modules/es-abstract": { - "version": "1.19.2", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.19.2.tgz", - "integrity": "sha512-gfSBJoZdlL2xRiOCy0g8gLMryhoe1TlimjzU99L/31Z8QEGIhVQI+EWwt5lT+AuU9SnorVupXFqqOGqGfsyO6w==", + "version": "1.22.1", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.22.1.tgz", + "integrity": "sha512-ioRRcXMO6OFyRpyzV3kE1IIBd4WG5/kltnzdxSCqoP8CMGs/Li+M1uF5o7lOkZVFjDs+NLesthnF66Pg/0q0Lw==", "dev": true, "dependencies": { + "array-buffer-byte-length": "^1.0.0", + "arraybuffer.prototype.slice": "^1.0.1", + "available-typed-arrays": "^1.0.5", "call-bind": "^1.0.2", + "es-set-tostringtag": "^2.0.1", "es-to-primitive": "^1.2.1", - "function-bind": "^1.1.1", - "get-intrinsic": "^1.1.1", + "function.prototype.name": "^1.1.5", + "get-intrinsic": "^1.2.1", "get-symbol-description": "^1.0.0", + "globalthis": "^1.0.3", + "gopd": "^1.0.1", "has": "^1.0.3", + "has-property-descriptors": "^1.0.0", + "has-proto": "^1.0.1", "has-symbols": "^1.0.3", - "internal-slot": "^1.0.3", - "is-callable": "^1.2.4", + "internal-slot": "^1.0.5", + "is-array-buffer": "^3.0.2", + "is-callable": "^1.2.7", "is-negative-zero": "^2.0.2", "is-regex": "^1.1.4", - "is-shared-array-buffer": "^1.0.1", + "is-shared-array-buffer": "^1.0.2", "is-string": "^1.0.7", + "is-typed-array": "^1.1.10", "is-weakref": "^1.0.2", - "object-inspect": "^1.12.0", + "object-inspect": "^1.12.3", "object-keys": "^1.1.1", - "object.assign": "^4.1.2", - "string.prototype.trimend": "^1.0.4", - "string.prototype.trimstart": "^1.0.4", - "unbox-primitive": "^1.0.1" + "object.assign": "^4.1.4", + "regexp.prototype.flags": "^1.5.0", + "safe-array-concat": "^1.0.0", + "safe-regex-test": "^1.0.0", + "string.prototype.trim": "^1.2.7", + "string.prototype.trimend": "^1.0.6", + "string.prototype.trimstart": "^1.0.6", + "typed-array-buffer": "^1.0.0", + "typed-array-byte-length": "^1.0.0", + "typed-array-byte-offset": "^1.0.0", + "typed-array-length": "^1.0.4", + "unbox-primitive": "^1.0.2", + "which-typed-array": "^1.1.10" }, "engines": { "node": ">= 0.4" @@ -5375,13 +5754,36 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/es-to-primitive": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", - "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", + "node_modules/es-set-tostringtag": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.0.1.tgz", + "integrity": "sha512-g3OMbtlwY3QewlqAiMLI47KywjWZoEytKr8pf6iTC8uJq5bIAH52Z9pnQ8pVL6whrCto53JZDuUIsifGeLorTg==", "dev": true, "dependencies": { - "is-callable": "^1.1.4", + "get-intrinsic": "^1.1.3", + "has": "^1.0.3", + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-shim-unscopables": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-shim-unscopables/-/es-shim-unscopables-1.0.0.tgz", + "integrity": "sha512-Jm6GPcCdC30eMLbZ2x8z2WuRwAws3zTBBKuusffYVUrNj/GVSUAZ+xKMaUpfNDR5IbyNA5LJbaecoUVbmUcB1w==", + "dev": true, + "dependencies": { + "has": "^1.0.3" + } + }, + "node_modules/es-to-primitive": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", + "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", + "dev": true, + "dependencies": { + "is-callable": "^1.1.4", "is-date-object": "^1.0.1", "is-symbol": "^1.0.2" }, @@ -5456,15 +5858,14 @@ } }, "node_modules/escodegen": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-2.0.0.tgz", - "integrity": "sha512-mmHKys/C8BFUGI+MAWNcSYoORYLMdPzjrknd2Vc+bUsjN5bXcr8EhrNB+UTqfL1y3I9c4fw2ihgtMPQLBRiQxw==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-2.1.0.tgz", + "integrity": "sha512-2NlIDTwUWJN0mRPQOdtQBzbUHvdGY2P1VXSyU83Q3xKxM7WHX2Ql8dKq782Q9TgQUNOLEzEYu9bzLNj1q88I5w==", "dev": true, "dependencies": { "esprima": "^4.0.1", "estraverse": "^5.2.0", - "esutils": "^2.0.2", - "optionator": "^0.8.1" + "esutils": "^2.0.2" }, "bin": { "escodegen": "bin/escodegen.js", @@ -5486,45 +5887,6 @@ "node": ">=4.0" } }, - "node_modules/escodegen/node_modules/levn": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", - "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", - "dev": true, - "dependencies": { - "prelude-ls": "~1.1.2", - "type-check": "~0.3.2" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/escodegen/node_modules/optionator": { - "version": "0.8.3", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz", - "integrity": "sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==", - "dev": true, - "dependencies": { - "deep-is": "~0.1.3", - "fast-levenshtein": "~2.0.6", - "levn": "~0.3.0", - "prelude-ls": "~1.1.2", - "type-check": "~0.3.2", - "word-wrap": "~1.2.3" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/escodegen/node_modules/prelude-ls": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", - "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", - "dev": true, - "engines": { - "node": ">= 0.8.0" - } - }, "node_modules/escodegen/node_modules/source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", @@ -5535,70 +5897,55 @@ "node": ">=0.10.0" } }, - "node_modules/escodegen/node_modules/type-check": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", - "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", - "dev": true, - "dependencies": { - "prelude-ls": "~1.1.2" - }, - "engines": { - "node": ">= 0.8.0" - } - }, "node_modules/eslint": { - "version": "7.32.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.32.0.tgz", - "integrity": "sha512-VHZ8gX+EDfz+97jGcgyGCyRia/dPOd6Xh9yPv8Bl1+SoaIwD+a/vlrOmGRUyOYu7MwUhc7CxqeaDZU13S4+EpA==", - "dev": true, - "dependencies": { - "@babel/code-frame": "7.12.11", - "@eslint/eslintrc": "^0.4.3", - "@humanwhocodes/config-array": "^0.5.0", - "ajv": "^6.10.0", + "version": "8.50.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.50.0.tgz", + "integrity": "sha512-FOnOGSuFuFLv/Sa+FDVRZl4GGVAAFFi8LecRsI5a1tMO5HIE8nCm4ivAlzt4dT3ol/PaaGC0rJEEXQmHJBGoOg==", + "dev": true, + "dependencies": { + "@eslint-community/eslint-utils": "^4.2.0", + "@eslint-community/regexpp": "^4.6.1", + "@eslint/eslintrc": "^2.1.2", + "@eslint/js": "8.50.0", + "@humanwhocodes/config-array": "^0.11.11", + "@humanwhocodes/module-importer": "^1.0.1", + "@nodelib/fs.walk": "^1.2.8", + "ajv": "^6.12.4", "chalk": "^4.0.0", "cross-spawn": "^7.0.2", - "debug": "^4.0.1", + "debug": "^4.3.2", "doctrine": "^3.0.0", - "enquirer": "^2.3.5", "escape-string-regexp": "^4.0.0", - "eslint-scope": "^5.1.1", - "eslint-utils": "^2.1.0", - "eslint-visitor-keys": "^2.0.0", - "espree": "^7.3.1", - "esquery": "^1.4.0", + "eslint-scope": "^7.2.2", + "eslint-visitor-keys": "^3.4.3", + "espree": "^9.6.1", + "esquery": "^1.4.2", "esutils": "^2.0.2", "fast-deep-equal": "^3.1.3", "file-entry-cache": "^6.0.1", - "functional-red-black-tree": "^1.0.1", - "glob-parent": "^5.1.2", - "globals": "^13.6.0", - "ignore": "^4.0.6", - "import-fresh": "^3.0.0", + "find-up": "^5.0.0", + "glob-parent": "^6.0.2", + "globals": "^13.19.0", + "graphemer": "^1.4.0", + "ignore": "^5.2.0", "imurmurhash": "^0.1.4", "is-glob": "^4.0.0", - "js-yaml": "^3.13.1", + "is-path-inside": "^3.0.3", + "js-yaml": "^4.1.0", "json-stable-stringify-without-jsonify": "^1.0.1", "levn": "^0.4.1", "lodash.merge": "^4.6.2", - "minimatch": "^3.0.4", + "minimatch": "^3.1.2", "natural-compare": "^1.4.0", - "optionator": "^0.9.1", - "progress": "^2.0.0", - "regexpp": "^3.1.0", - "semver": "^7.2.1", - "strip-ansi": "^6.0.0", - "strip-json-comments": "^3.1.0", - "table": "^6.0.9", - "text-table": "^0.2.0", - "v8-compile-cache": "^2.0.3" + "optionator": "^0.9.3", + "strip-ansi": "^6.0.1", + "text-table": "^0.2.0" }, "bin": { "eslint": "bin/eslint.js" }, "engines": { - "node": "^10.12.0 || >=12.0.0" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, "funding": { "url": "https://opencollective.com/eslint" @@ -5611,13 +5958,14 @@ "dev": true }, "node_modules/eslint-import-resolver-node": { - "version": "0.3.6", - "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.6.tgz", - "integrity": "sha512-0En0w03NRVMn9Uiyn8YRPDKvWjxCWkslUEhGNTdGx15RvPJYQ+lbOlqrlNI2vEAs4pDYK4f/HN2TbDmk5TP0iw==", + "version": "0.3.9", + "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.9.tgz", + "integrity": "sha512-WFj2isz22JahUv+B788TlO3N6zL3nNJGU8CcZbPZvVEkBPaJdCV4vy5wyghty5ROFbCRnm132v8BScu5/1BQ8g==", "dev": true, "dependencies": { "debug": "^3.2.7", - "resolve": "^1.20.0" + "is-core-module": "^2.13.0", + "resolve": "^1.22.4" } }, "node_modules/eslint-import-resolver-node/node_modules/debug": { @@ -5630,16 +5978,20 @@ } }, "node_modules/eslint-module-utils": { - "version": "2.7.3", - "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.7.3.tgz", - "integrity": "sha512-088JEC7O3lDZM9xGe0RerkOMd0EjFl+Yvd1jPWIkMT5u3H9+HC34mWWPnqPrN13gieT9pBOO+Qt07Nb/6TresQ==", + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.8.0.tgz", + "integrity": "sha512-aWajIYfsqCKRDgUfjEXNN/JlrzauMuSEy5sbd7WXbtW3EH6A6MpwEh42c7qD+MqQo9QMJ6fWLAeIJynx0g6OAw==", "dev": true, "dependencies": { - "debug": "^3.2.7", - "find-up": "^2.1.0" + "debug": "^3.2.7" }, "engines": { "node": ">=4" + }, + "peerDependenciesMeta": { + "eslint": { + "optional": true + } } }, "node_modules/eslint-module-utils/node_modules/debug": { @@ -5665,24 +6017,28 @@ } }, "node_modules/eslint-plugin-import": { - "version": "2.26.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.26.0.tgz", - "integrity": "sha512-hYfi3FXaM8WPLf4S1cikh/r4IxnO6zrhZbEGz2b660EJRbuxgpDS5gkCuYgGWg2xxh2rBuIr4Pvhve/7c31koA==", + "version": "2.28.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.28.1.tgz", + "integrity": "sha512-9I9hFlITvOV55alzoKBI+K9q74kv0iKMeY6av5+umsNwayt59fz692daGyjR+oStBQgx6nwR9rXldDev3Clw+A==", "dev": true, "dependencies": { - "array-includes": "^3.1.4", - "array.prototype.flat": "^1.2.5", - "debug": "^2.6.9", + "array-includes": "^3.1.6", + "array.prototype.findlastindex": "^1.2.2", + "array.prototype.flat": "^1.3.1", + "array.prototype.flatmap": "^1.3.1", + "debug": "^3.2.7", "doctrine": "^2.1.0", - "eslint-import-resolver-node": "^0.3.6", - "eslint-module-utils": "^2.7.3", + "eslint-import-resolver-node": "^0.3.7", + "eslint-module-utils": "^2.8.0", "has": "^1.0.3", - "is-core-module": "^2.8.1", + "is-core-module": "^2.13.0", "is-glob": "^4.0.3", "minimatch": "^3.1.2", - "object.values": "^1.1.5", - "resolve": "^1.22.0", - "tsconfig-paths": "^3.14.1" + "object.fromentries": "^2.0.6", + "object.groupby": "^1.0.0", + "object.values": "^1.1.6", + "semver": "^6.3.1", + "tsconfig-paths": "^3.14.2" }, "engines": { "node": ">=4" @@ -5692,12 +6048,12 @@ } }, "node_modules/eslint-plugin-import/node_modules/debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", "dev": true, "dependencies": { - "ms": "2.0.0" + "ms": "^2.1.1" } }, "node_modules/eslint-plugin-import/node_modules/doctrine": { @@ -5724,12 +6080,6 @@ "node": "*" } }, - "node_modules/eslint-plugin-import/node_modules/ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", - "dev": true - }, "node_modules/eslint-plugin-node": { "version": "11.1.0", "resolved": "https://registry.npmjs.org/eslint-plugin-node/-/eslint-plugin-node-11.1.0.tgz", @@ -5747,19 +6097,10 @@ "node": ">=8.10.0" } }, - "node_modules/eslint-plugin-node/node_modules/ignore": { - "version": "5.1.8", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.1.8.tgz", - "integrity": "sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw==", - "dev": true, - "engines": { - "node": ">= 4" - } - }, "node_modules/eslint-plugin-promise": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-promise/-/eslint-plugin-promise-6.0.0.tgz", - "integrity": "sha512-7GPezalm5Bfi/E22PnQxDWH2iW9GTvAlUNTztemeHb6c1BniSyoeTrM87JkC0wYdi6aQrZX9p2qEiAno8aTcbw==", + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-promise/-/eslint-plugin-promise-6.1.1.tgz", + "integrity": "sha512-tjqWDwVZQo7UIPMeDReOpUgHCmCiH+ePnVT+5zVapL0uuHnegBUs2smM13CzOs2Xb5+MHMRFTs9v24yjba4Oig==", "dev": true, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -5808,45 +6149,6 @@ "node": ">=4" } }, - "node_modules/eslint/node_modules/@babel/code-frame": { - "version": "7.12.11", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.11.tgz", - "integrity": "sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA3EUl+q2LQx16MISgJ0+z7dnmgvP9QtIleuETGOiOH1RcIw==", - "dev": true, - "dependencies": { - "@babel/highlight": "^7.10.4" - } - }, - "node_modules/eslint/node_modules/@humanwhocodes/config-array": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.5.0.tgz", - "integrity": "sha512-FagtKFz74XrTl7y6HCzQpwDfXP0yhxe9lHLD1UZxjvZIcbyRz8zTFF/yYNfSfzU414eDwZ1SrO0Qvtyf+wFMQg==", - "dev": true, - "dependencies": { - "@humanwhocodes/object-schema": "^1.2.0", - "debug": "^4.1.1", - "minimatch": "^3.0.4" - }, - "engines": { - "node": ">=10.10.0" - } - }, - "node_modules/eslint/node_modules/ajv": { - "version": "6.12.6", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", - "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", - "dev": true, - "dependencies": { - "fast-deep-equal": "^3.1.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, "node_modules/eslint/node_modules/ansi-styles": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", @@ -5859,6 +6161,12 @@ "node": ">=8" } }, + "node_modules/eslint/node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true + }, "node_modules/eslint/node_modules/chalk": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.1.tgz", @@ -5902,25 +6210,68 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/eslint/node_modules/eslint-scope": { + "version": "7.2.2", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz", + "integrity": "sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==", + "dev": true, + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^5.2.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, "node_modules/eslint/node_modules/eslint-visitor-keys": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.0.0.tgz", - "integrity": "sha512-QudtT6av5WXels9WjIM7qz1XD1cWGvX4gGXvp/zBn9nXG02D0utdU3Em2m/QjTnrsk6bBjmCygl3rmj118msQQ==", + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", "dev": true, "engines": { - "node": ">=10" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint/node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/eslint/node_modules/glob-parent": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", + "dev": true, + "dependencies": { + "is-glob": "^4.0.3" + }, + "engines": { + "node": ">=10.13.0" } }, "node_modules/eslint/node_modules/globals": { - "version": "13.8.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.8.0.tgz", - "integrity": "sha512-rHtdA6+PDBIjeEvA91rpqzEvk/k3/i7EeNQiryiWuJH0Hw9cpyJMAt2jtbAwUaRdhD+573X4vWw6IcjKPasi9Q==", + "version": "13.21.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.21.0.tgz", + "integrity": "sha512-ybyme3s4yy/t/3s35bewwXKOf7cvzfreG2lH0lZl0JB7I4GxRP2ghxOK/Nb9EkRXdbBXZLfq/p/0W2JUONB/Gg==", "dev": true, "dependencies": { "type-fest": "^0.20.2" }, "engines": { "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/eslint/node_modules/has-flag": { @@ -5932,25 +6283,28 @@ "node": ">=8" } }, - "node_modules/eslint/node_modules/json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", - "dev": true - }, - "node_modules/eslint/node_modules/semver": { - "version": "7.3.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", - "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", + "node_modules/eslint/node_modules/js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", "dev": true, "dependencies": { - "lru-cache": "^6.0.0" + "argparse": "^2.0.1" }, "bin": { - "semver": "bin/semver.js" + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/eslint/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" }, "engines": { - "node": ">=10" + "node": "*" } }, "node_modules/eslint/node_modules/supports-color": { @@ -5976,17 +6330,44 @@ } }, "node_modules/espree": { - "version": "7.3.1", - "resolved": "https://registry.npmjs.org/espree/-/espree-7.3.1.tgz", - "integrity": "sha512-v3JCNCE64umkFpmkFGqzVKsOT0tN1Zr+ueqLZfpV1Ob8e+CEgPWa+OxCoGH3tnhimMKIaBm4m/vaRpJ/krRz2g==", + "version": "9.6.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz", + "integrity": "sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==", "dev": true, "dependencies": { - "acorn": "^7.4.0", - "acorn-jsx": "^5.3.1", - "eslint-visitor-keys": "^1.3.0" + "acorn": "^8.9.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^3.4.1" }, "engines": { - "node": "^10.12.0 || >=12.0.0" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/espree/node_modules/acorn": { + "version": "8.10.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.10.0.tgz", + "integrity": "sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw==", + "dev": true, + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/espree/node_modules/eslint-visitor-keys": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", + "dev": true, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" } }, "node_modules/esprima": { @@ -6003,9 +6384,9 @@ } }, "node_modules/esquery": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.4.0.tgz", - "integrity": "sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w==", + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.5.0.tgz", + "integrity": "sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==", "dev": true, "dependencies": { "estraverse": "^5.1.0" @@ -6015,9 +6396,9 @@ } }, "node_modules/esquery/node_modules/estraverse": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz", - "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==", + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", "dev": true, "engines": { "node": ">=4.0" @@ -6036,9 +6417,9 @@ } }, "node_modules/esrecurse/node_modules/estraverse": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz", - "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==", + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", "dev": true, "engines": { "node": ">=4.0" @@ -6148,18 +6529,19 @@ } }, "node_modules/expect": { - "version": "27.5.1", - "resolved": "https://registry.npmjs.org/expect/-/expect-27.5.1.tgz", - "integrity": "sha512-E1q5hSUG2AmYQwQJ041nvgpkODHQvB+RKlB4IYdru6uJsyFTRyZAP463M+1lINorwbqAmUggi6+WwkD8lCS/Dw==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/expect/-/expect-29.7.0.tgz", + "integrity": "sha512-2Zks0hf1VLFYI1kbh0I5jP3KHHyCHpkfyHBzsSXRFgl/Bg9mWYfMW8oD+PdMPlEwy5HNsR9JutYy6pMeOh61nw==", "dev": true, "dependencies": { - "@jest/types": "^27.5.1", - "jest-get-type": "^27.5.1", - "jest-matcher-utils": "^27.5.1", - "jest-message-util": "^27.5.1" + "@jest/expect-utils": "^29.7.0", + "jest-get-type": "^29.6.3", + "jest-matcher-utils": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-util": "^29.7.0" }, "engines": { - "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, "node_modules/ext": { @@ -6253,7 +6635,7 @@ "node_modules/fast-levenshtein": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", - "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", + "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", "dev": true }, "node_modules/fast-safe-stringify": { @@ -6284,9 +6666,9 @@ } }, "node_modules/fb-watchman": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/fb-watchman/-/fb-watchman-2.0.1.tgz", - "integrity": "sha512-DkPJKQeY6kKwmuMretBhr7G6Vodr7bFwDYTXIkfG1gjvNpaxBTQV3PbXg6bR1c1UP4jPOX0jHUbbHANL9vRjVg==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/fb-watchman/-/fb-watchman-2.0.2.tgz", + "integrity": "sha512-p5161BqbuCaSnB8jIbzQHOlpgsPmK5rJVDfDKO91Axs5NC1uu3HRQm6wt9cd9/+GtQQIO53JdGXXoyDpTAsgYA==", "dev": true, "dependencies": { "bser": "2.1.1" @@ -6332,43 +6714,43 @@ } }, "node_modules/find-up": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", - "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", "dev": true, "dependencies": { - "locate-path": "^2.0.0" + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" }, "engines": { - "node": ">=4" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/findup-sync": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-0.3.0.tgz", - "integrity": "sha1-N5MKpdgWt3fANEXhlmzGeQpMCxY=", + "node_modules/find-up/node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", "dev": true, - "dependencies": { - "glob": "~5.0.0" - }, "engines": { - "node": ">= 0.6.0" + "node": ">=8" } }, - "node_modules/findup-sync/node_modules/glob": { - "version": "5.0.15", - "resolved": "https://registry.npmjs.org/glob/-/glob-5.0.15.tgz", - "integrity": "sha1-G8k2ueAvSmA/zCIuz3Yz0wuLk7E=", + "node_modules/findup-sync": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-5.0.0.tgz", + "integrity": "sha512-MzwXju70AuyflbgeOhzvQWAvvQdo1XL0A9bVvlXsYcFEBM87WR4OakL4OfZq+QRmr+duJubio+UtNQCPsVESzQ==", "dev": true, "dependencies": { - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "2 || 3", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" + "detect-file": "^1.0.0", + "is-glob": "^4.0.3", + "micromatch": "^4.0.4", + "resolve-dir": "^1.0.1" }, "engines": { - "node": "*" + "node": ">= 10.13.0" } }, "node_modules/fined": { @@ -6435,6 +6817,15 @@ } } }, + "node_modules/for-each": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", + "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==", + "dev": true, + "dependencies": { + "is-callable": "^1.1.3" + } + }, "node_modules/for-in": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", @@ -6456,12 +6847,6 @@ "node": ">=0.10.0" } }, - "node_modules/foreach": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/foreach/-/foreach-2.0.5.tgz", - "integrity": "sha1-C+4AUBiusmDQo6865ljdATbsG5k=", - "dev": true - }, "node_modules/forever-agent": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", @@ -6534,11 +6919,32 @@ "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", "dev": true }, - "node_modules/functional-red-black-tree": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", - "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", - "dev": true + "node_modules/function.prototype.name": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.5.tgz", + "integrity": "sha512-uN7m/BzVKQnCUF/iW8jYea67v++2u7m5UgENbHRtdDVclOUP+FMPlCNdmk0h/ysGyo2tavMJEDqJAkJdRa1vMA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.3", + "es-abstract": "^1.19.0", + "functions-have-names": "^1.2.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/functions-have-names": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz", + "integrity": "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } }, "node_modules/gaze": { "version": "1.1.3", @@ -6577,14 +6983,18 @@ } }, "node_modules/get-intrinsic": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.1.tgz", - "integrity": "sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.1.tgz", + "integrity": "sha512-2DcsyfABl+gVHEfCOaTrWgyt+tb6MSEGmKq+kI5HwLbIYgjgmMcV8KQ41uaKz1xxUcn9tJtgFbQUEVcEbd0FYw==", "dev": true, "dependencies": { "function-bind": "^1.1.1", "has": "^1.0.3", - "has-symbols": "^1.0.1" + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/get-package-type": { @@ -6753,6 +7163,21 @@ "node": ">=4" } }, + "node_modules/globalthis": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.3.tgz", + "integrity": "sha512-sFdI5LyBiNTHjRd7cGPWapiHWMOXKyuBNX/cWJ3NfzrZQVa8GI/8cofCl74AOVqq9W5kNmguTIzJ/1s2gyI9wA==", + "dev": true, + "dependencies": { + "define-properties": "^1.1.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/globby": { "version": "11.1.0", "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", @@ -6773,15 +7198,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/globby/node_modules/ignore": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.0.tgz", - "integrity": "sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ==", - "dev": true, - "engines": { - "node": ">= 4" - } - }, "node_modules/globule": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/globule/-/globule-1.3.2.tgz", @@ -6796,39 +7212,55 @@ "node": ">= 0.10" } }, + "node_modules/gopd": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", + "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", + "dev": true, + "dependencies": { + "get-intrinsic": "^1.1.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/graceful-fs": { "version": "4.2.9", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.9.tgz", "integrity": "sha512-NtNxqUcXgpW2iMrfqSfR73Glt39K+BLwWsPs94yR63v45T0Wbej7eRmL5cWfwEgqXnmjQp3zaJTshdRW/qC2ZQ==", "dev": true }, + "node_modules/graphemer": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", + "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==", + "dev": true + }, "node_modules/grunt": { - "version": "1.5.2", - "resolved": "https://registry.npmjs.org/grunt/-/grunt-1.5.2.tgz", - "integrity": "sha512-XCtfaIu72OyDqK24MjWiGC9SwlkuhkS1mrULr1xzuJ2XqAFhP3ZAchZGHJeSCY6mkaOXU4F7SbmmCF7xIVoC9w==", + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/grunt/-/grunt-1.6.1.tgz", + "integrity": "sha512-/ABUy3gYWu5iBmrUSRBP97JLpQUm0GgVveDCp6t3yRNIoltIYw7rEj3g5y1o2PGPR2vfTRGa7WC/LZHLTXnEzA==", "dev": true, "dependencies": { - "dateformat": "~3.0.3", + "dateformat": "~4.6.2", "eventemitter2": "~0.4.13", "exit": "~0.1.2", - "findup-sync": "~0.3.0", + "findup-sync": "~5.0.0", "glob": "~7.1.6", "grunt-cli": "~1.4.3", "grunt-known-options": "~2.0.0", "grunt-legacy-log": "~3.0.0", "grunt-legacy-util": "~2.0.1", - "iconv-lite": "~0.4.13", + "iconv-lite": "~0.6.3", "js-yaml": "~3.14.0", "minimatch": "~3.0.4", - "mkdirp": "~1.0.4", - "nopt": "~3.0.6", - "rimraf": "~3.0.2" + "nopt": "~3.0.6" }, "bin": { "grunt": "bin/grunt" }, "engines": { - "node": ">=8" + "node": ">=16" } }, "node_modules/grunt-babel": { @@ -6924,13 +7356,13 @@ } }, "node_modules/grunt-eslint": { - "version": "24.0.0", - "resolved": "https://registry.npmjs.org/grunt-eslint/-/grunt-eslint-24.0.0.tgz", - "integrity": "sha512-WpTeBBFweyhMuPjGwRSQV9JFJ+EczIdlsc7Dd/1g78QVI1aZsk4g/H3e+3S5HEwsS1RKL2YZIrGj8hMLlBfN8w==", + "version": "24.3.0", + "resolved": "https://registry.npmjs.org/grunt-eslint/-/grunt-eslint-24.3.0.tgz", + "integrity": "sha512-dUPiRgX8fhmh4uwTAn9xrzg7HV5j5DhGmZZGJdHfjy/AN9G4jD+5IjfbcAJ209JcIG8m4B7xz3crIhuDSm3siQ==", "dev": true, "dependencies": { "chalk": "^4.1.2", - "eslint": "^8.0.1" + "eslint": "^8.44.0" }, "engines": { "node": ">=12" @@ -6942,54 +7374,6 @@ "grunt": ">=1" } }, - "node_modules/grunt-eslint/node_modules/@eslint/eslintrc": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.2.1.tgz", - "integrity": "sha512-bxvbYnBPN1Gibwyp6NrpnFzA3YtRL3BBAyEAFVIpNTm2Rn4Vy87GA5M4aSn3InRrlsbX5N0GW7XIx+U4SAEKdQ==", - "dev": true, - "dependencies": { - "ajv": "^6.12.4", - "debug": "^4.3.2", - "espree": "^9.3.1", - "globals": "^13.9.0", - "ignore": "^5.2.0", - "import-fresh": "^3.2.1", - "js-yaml": "^4.1.0", - "minimatch": "^3.0.4", - "strip-json-comments": "^3.1.1" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - } - }, - "node_modules/grunt-eslint/node_modules/acorn": { - "version": "8.7.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.7.0.tgz", - "integrity": "sha512-V/LGr1APy+PXIwKebEWrkZPwoeoF+w1jiOBUmuxuiUIaOHtob8Qc9BTrYo7VuI5fR8tqsy+buA2WFooR5olqvQ==", - "dev": true, - "bin": { - "acorn": "bin/acorn" - }, - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/grunt-eslint/node_modules/ajv": { - "version": "6.12.6", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", - "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", - "dev": true, - "dependencies": { - "fast-deep-equal": "^3.1.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, "node_modules/grunt-eslint/node_modules/ansi-styles": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", @@ -7005,12 +7389,6 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/grunt-eslint/node_modules/argparse": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", - "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", - "dev": true - }, "node_modules/grunt-eslint/node_modules/chalk": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", @@ -7045,169 +7423,6 @@ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, - "node_modules/grunt-eslint/node_modules/escape-string-regexp": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", - "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/grunt-eslint/node_modules/eslint": { - "version": "8.12.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.12.0.tgz", - "integrity": "sha512-it1oBL9alZg1S8UycLm5YDMAkIhtH6FtAzuZs6YvoGVldWjbS08BkAdb/ymP9LlAyq8koANu32U7Ib/w+UNh8Q==", - "dev": true, - "dependencies": { - "@eslint/eslintrc": "^1.2.1", - "@humanwhocodes/config-array": "^0.9.2", - "ajv": "^6.10.0", - "chalk": "^4.0.0", - "cross-spawn": "^7.0.2", - "debug": "^4.3.2", - "doctrine": "^3.0.0", - "escape-string-regexp": "^4.0.0", - "eslint-scope": "^7.1.1", - "eslint-utils": "^3.0.0", - "eslint-visitor-keys": "^3.3.0", - "espree": "^9.3.1", - "esquery": "^1.4.0", - "esutils": "^2.0.2", - "fast-deep-equal": "^3.1.3", - "file-entry-cache": "^6.0.1", - "functional-red-black-tree": "^1.0.1", - "glob-parent": "^6.0.1", - "globals": "^13.6.0", - "ignore": "^5.2.0", - "import-fresh": "^3.0.0", - "imurmurhash": "^0.1.4", - "is-glob": "^4.0.0", - "js-yaml": "^4.1.0", - "json-stable-stringify-without-jsonify": "^1.0.1", - "levn": "^0.4.1", - "lodash.merge": "^4.6.2", - "minimatch": "^3.0.4", - "natural-compare": "^1.4.0", - "optionator": "^0.9.1", - "regexpp": "^3.2.0", - "strip-ansi": "^6.0.1", - "strip-json-comments": "^3.1.0", - "text-table": "^0.2.0", - "v8-compile-cache": "^2.0.3" - }, - "bin": { - "eslint": "bin/eslint.js" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "node_modules/grunt-eslint/node_modules/eslint-scope": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.1.1.tgz", - "integrity": "sha512-QKQM/UXpIiHcLqJ5AOyIW7XZmzjkzQXYE54n1++wb0u9V/abW3l9uQnxX8Z5Xd18xyKIMTUAyQ0k1e8pz6LUrw==", - "dev": true, - "dependencies": { - "esrecurse": "^4.3.0", - "estraverse": "^5.2.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - } - }, - "node_modules/grunt-eslint/node_modules/eslint-utils": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-3.0.0.tgz", - "integrity": "sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==", - "dev": true, - "dependencies": { - "eslint-visitor-keys": "^2.0.0" - }, - "engines": { - "node": "^10.0.0 || ^12.0.0 || >= 14.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/mysticatea" - }, - "peerDependencies": { - "eslint": ">=5" - } - }, - "node_modules/grunt-eslint/node_modules/eslint-utils/node_modules/eslint-visitor-keys": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", - "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", - "dev": true, - "engines": { - "node": ">=10" - } - }, - "node_modules/grunt-eslint/node_modules/eslint-visitor-keys": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.3.0.tgz", - "integrity": "sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA==", - "dev": true, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - } - }, - "node_modules/grunt-eslint/node_modules/espree": { - "version": "9.3.1", - "resolved": "https://registry.npmjs.org/espree/-/espree-9.3.1.tgz", - "integrity": "sha512-bvdyLmJMfwkV3NCRl5ZhJf22zBFo1y8bYh3VYb+bfzqNB4Je68P2sSuXyuFquzWLebHpNd2/d5uv7yoP9ISnGQ==", - "dev": true, - "dependencies": { - "acorn": "^8.7.0", - "acorn-jsx": "^5.3.1", - "eslint-visitor-keys": "^3.3.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - } - }, - "node_modules/grunt-eslint/node_modules/estraverse": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", - "dev": true, - "engines": { - "node": ">=4.0" - } - }, - "node_modules/grunt-eslint/node_modules/glob-parent": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", - "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", - "dev": true, - "dependencies": { - "is-glob": "^4.0.3" - }, - "engines": { - "node": ">=10.13.0" - } - }, - "node_modules/grunt-eslint/node_modules/globals": { - "version": "13.13.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.13.0.tgz", - "integrity": "sha512-EQ7Q18AJlPwp3vUDL4mKA0KXrXyNIQyWon6T6XQiBQF0XHvRsiCSrWmmeATpUzdJN2HhWZU6Pdl0a9zdep5p6A==", - "dev": true, - "dependencies": { - "type-fest": "^0.20.2" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/grunt-eslint/node_modules/has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", @@ -7217,33 +7432,6 @@ "node": ">=8" } }, - "node_modules/grunt-eslint/node_modules/ignore": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.0.tgz", - "integrity": "sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ==", - "dev": true, - "engines": { - "node": ">= 4" - } - }, - "node_modules/grunt-eslint/node_modules/js-yaml": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", - "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", - "dev": true, - "dependencies": { - "argparse": "^2.0.1" - }, - "bin": { - "js-yaml": "bin/js-yaml.js" - } - }, - "node_modules/grunt-eslint/node_modules/json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", - "dev": true - }, "node_modules/grunt-eslint/node_modules/supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", @@ -7384,6 +7572,18 @@ "node": ">=10" } }, + "node_modules/grunt/node_modules/iconv-lite": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", + "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", + "dev": true, + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/har-schema": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", @@ -7406,32 +7606,10 @@ "node": ">=6" } }, - "node_modules/har-validator/node_modules/ajv": { - "version": "6.12.6", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", - "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", - "dev": true, - "dependencies": { - "fast-deep-equal": "^3.1.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, - "node_modules/har-validator/node_modules/json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", - "dev": true - }, - "node_modules/has": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", - "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "node_modules/has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", "dev": true, "dependencies": { "function-bind": "^1.1.1" @@ -7441,20 +7619,47 @@ } }, "node_modules/has-bigints": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.1.tgz", - "integrity": "sha512-LSBS2LjbNBTf6287JEbEzvJgftkF5qFkmCo9hDRpAzKhUOlJ+hx8dd4USs00SgsUNwc4617J9ki5YtEClM2ffA==", - "dev": true + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.2.tgz", + "integrity": "sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } }, "node_modules/has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", "dev": true, "engines": { "node": ">=4" } }, + "node_modules/has-property-descriptors": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.0.tgz", + "integrity": "sha512-62DVLZGoiEBDHQyqG4w9xCuZ7eJEwNmJRWw2VY84Oedb7WFcA27fiEVe8oUQx9hAUJ4ekurquucTGwsyO1XGdQ==", + "dev": true, + "dependencies": { + "get-intrinsic": "^1.1.1" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.1.tgz", + "integrity": "sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/has-symbols": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", @@ -7568,15 +7773,15 @@ } }, "node_modules/html-encoding-sniffer": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-2.0.1.tgz", - "integrity": "sha512-D5JbOMBIR/TVZkubHT+OyT2705QvogUW4IBn6nHd756OwieSF9aDYFj4dv6HHEVGYbHaLETa3WggZYWWMyy3ZQ==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-3.0.0.tgz", + "integrity": "sha512-oWv4T4yJ52iKrufjnyZPkrN0CH3QnrUqdB6In1g5Fe1mia8GmF36gnfNySxoZtxD5+NmYw1EElVXiBk93UeskA==", "dev": true, "dependencies": { - "whatwg-encoding": "^1.0.5" + "whatwg-encoding": "^2.0.0" }, "engines": { - "node": ">=10" + "node": ">=12" } }, "node_modules/html-escaper": { @@ -7615,12 +7820,12 @@ } }, "node_modules/http-proxy-agent": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-4.0.1.tgz", - "integrity": "sha512-k0zdNgqWTGA6aeIRVpvfVob4fL52dTfaehylg0Y4UvSySvOq/Y+BOyPrgpUrA7HylqvU8vIZGsRuXmspskV0Tg==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-5.0.0.tgz", + "integrity": "sha512-n2hY8YdoRE1i7r6M0w9DIw5GgZN0G25P8zLCRQ8rjXtTU3vsNFBI/vWK/UIeE6g5MUUz6avwAPXmL6Fy9D/90w==", "dev": true, "dependencies": { - "@tootallnate/once": "1", + "@tootallnate/once": "2", "agent-base": "6", "debug": "4" }, @@ -7713,30 +7918,6 @@ "node": ">=8" } }, - "node_modules/http-server/node_modules/html-encoding-sniffer": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-3.0.0.tgz", - "integrity": "sha512-oWv4T4yJ52iKrufjnyZPkrN0CH3QnrUqdB6In1g5Fe1mia8GmF36gnfNySxoZtxD5+NmYw1EElVXiBk93UeskA==", - "dev": true, - "dependencies": { - "whatwg-encoding": "^2.0.0" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/http-server/node_modules/iconv-lite": { - "version": "0.6.3", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", - "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", - "dev": true, - "dependencies": { - "safer-buffer": ">= 2.1.2 < 3.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/http-server/node_modules/supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", @@ -7749,18 +7930,6 @@ "node": ">=8" } }, - "node_modules/http-server/node_modules/whatwg-encoding": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-2.0.0.tgz", - "integrity": "sha512-p41ogyeMUrw3jWclHWTQg1k05DSVXPLcVxRTYsXUk+ZooOCZLcoYgPZ/HL/D/N+uQPOtcp1me1WhBEaX02mhWg==", - "dev": true, - "dependencies": { - "iconv-lite": "0.6.3" - }, - "engines": { - "node": ">=12" - } - }, "node_modules/http-signature": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", @@ -7783,9 +7952,9 @@ "dev": true }, "node_modules/https-proxy-agent": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.0.tgz", - "integrity": "sha512-EkYm5BcKUGiduxzSt3Eppko+PiNWNEpa4ySk9vTC6wDsQJW9rHSa+UhGNJoRYp7bz6Ht1eaRIa6QaJqO5rCFbA==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", + "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", "dev": true, "dependencies": { "agent-base": "6", @@ -7823,9 +7992,9 @@ "dev": true }, "node_modules/ignore": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", - "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", + "version": "5.2.4", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz", + "integrity": "sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==", "dev": true, "engines": { "node": ">= 4" @@ -7842,6 +8011,9 @@ }, "engines": { "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/import-local": { @@ -7863,88 +8035,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/import-local/node_modules/find-up": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", - "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", - "dev": true, - "dependencies": { - "locate-path": "^5.0.0", - "path-exists": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/import-local/node_modules/locate-path": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", - "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", - "dev": true, - "dependencies": { - "p-locate": "^4.1.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/import-local/node_modules/p-limit": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", - "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", - "dev": true, - "dependencies": { - "p-try": "^2.0.0" - }, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/import-local/node_modules/p-locate": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", - "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", - "dev": true, - "dependencies": { - "p-limit": "^2.2.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/import-local/node_modules/p-try": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", - "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/import-local/node_modules/path-exists": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/import-local/node_modules/pkg-dir": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", - "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", - "dev": true, - "dependencies": { - "find-up": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/imurmurhash": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", @@ -8122,12 +8212,12 @@ } }, "node_modules/internal-slot": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.3.tgz", - "integrity": "sha512-O0DB1JC/sPyZl7cIo78n5dR7eUSwwpYPiXRhTzNxZVAMUuB8vlnRFyLxdrVToks6XPLVnFfbzaVd5WLjhgg+vA==", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.5.tgz", + "integrity": "sha512-Y+R5hJrzs52QCG2laLn4udYVnxsfny9CpOhNhUvk/SSSVyF6T27FzRbF0sroPidSu3X8oEAkOn2K804mjpt6UQ==", "dev": true, "dependencies": { - "get-intrinsic": "^1.1.0", + "get-intrinsic": "^1.2.0", "has": "^1.0.3", "side-channel": "^1.0.4" }, @@ -8166,6 +8256,20 @@ "node": ">= 0.4" } }, + "node_modules/is-array-buffer": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.2.tgz", + "integrity": "sha512-y+FyyR/w8vfIRq4eQcM1EYgSTnmHXPqaF+IgzgraytCFq5Xh8lllDVmAZolPJiZttZLeFSINPYMaEJ7/vWUa1w==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.2.0", + "is-typed-array": "^1.1.10" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-arrayish": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", @@ -8173,10 +8277,16 @@ "dev": true }, "node_modules/is-bigint": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.1.tgz", - "integrity": "sha512-J0ELF4yHFxHy0cmSxZuheDOz2luOdVvqjwmEcj8H/L1JHeuEDSDbeRP+Dk9kFVk5RTFzbucJ2Kb9F7ixY2QaCg==", - "dev": true + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.4.tgz", + "integrity": "sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==", + "dev": true, + "dependencies": { + "has-bigints": "^1.0.1" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } }, "node_modules/is-binary-path": { "version": "2.1.0", @@ -8191,15 +8301,19 @@ } }, "node_modules/is-boolean-object": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.0.tgz", - "integrity": "sha512-a7Uprx8UtD+HWdyYwnD1+ExtTgqQtD2k/1yJgtXP6wnMm8byhkoTZRl+95LLThpzNZJ5aEvi46cdH+ayMFRwmA==", + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.2.tgz", + "integrity": "sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==", "dev": true, "dependencies": { - "call-bind": "^1.0.0" + "call-bind": "^1.0.2", + "has-tostringtag": "^1.0.0" }, "engines": { "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/is-buffer": { @@ -8209,9 +8323,9 @@ "dev": true }, "node_modules/is-callable": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.4.tgz", - "integrity": "sha512-nsuwtxZfMX67Oryl9LCQ+upnC0Z0BgpwntpS89m1H/TLF0zNfzfLMV/9Wa/6MZsj0acpEjAO0KF1xT6ZdLl95w==", + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", + "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", "dev": true, "engines": { "node": ">= 0.4" @@ -8220,28 +8334,10 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/is-ci": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-2.0.0.tgz", - "integrity": "sha512-YfJT7rkpQB0updsdHLGWrvhBJfcfzNNawYDNIyQXJz0IViGf75O8EBPKSdvw2rF+LGCsX4FZ8tcr3b19LcZq4w==", - "dev": true, - "dependencies": { - "ci-info": "^2.0.0" - }, - "bin": { - "is-ci": "bin.js" - } - }, - "node_modules/is-ci/node_modules/ci-info": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz", - "integrity": "sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==", - "dev": true - }, "node_modules/is-core-module": { - "version": "2.8.1", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.8.1.tgz", - "integrity": "sha512-SdNCUs284hr40hFTFP6l0IfZ/RSrMXF3qgoRHd3/79unUTvrFO/JoXwkGm+5J/Oe3E/b5GsnG330uUNgRpu1PA==", + "version": "2.13.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.0.tgz", + "integrity": "sha512-Z7dk6Qo8pOCp3l4tsX2C5ZVas4V+UxwQodwZhLopL91TX8UyyHEXafPcyoeeWuLrwzHcr3igO78wNLwHJHsMCQ==", "dev": true, "dependencies": { "has": "^1.0.3" @@ -8353,12 +8449,18 @@ } }, "node_modules/is-number-object": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.4.tgz", - "integrity": "sha512-zohwelOAur+5uXtk8O3GPQ1eAcu4ZX3UwxQhUlfFFMNpUd83gXgjbhJh6HmB6LUNV/ieOLQuDwJO3dWJosUeMw==", + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.7.tgz", + "integrity": "sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ==", "dev": true, + "dependencies": { + "has-tostringtag": "^1.0.0" + }, "engines": { "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/is-observable": { @@ -8373,6 +8475,15 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/is-path-inside": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", + "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/is-plain-object": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", @@ -8477,19 +8588,18 @@ } }, "node_modules/is-typed-array": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.5.tgz", - "integrity": "sha512-S+GRDgJlR3PyEbsX/Fobd9cqpZBuvUS+8asRqYDMLCb2qMzt1oz5m5oxQCxOgUDxiWsOVNi4yaF+/uvdlHlYug==", + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.12.tgz", + "integrity": "sha512-Z14TF2JNG8Lss5/HMqt0//T9JeHXttXy5pH/DBU4vi98ozO2btxzq9MwYDZYnKwU8nRsz/+GVFVRDq3DkVuSPg==", "dev": true, "dependencies": { - "available-typed-arrays": "^1.0.2", - "call-bind": "^1.0.2", - "es-abstract": "^1.18.0-next.2", - "foreach": "^2.0.5", - "has-symbols": "^1.0.1" + "which-typed-array": "^1.1.11" }, "engines": { "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/is-typedarray": { @@ -8608,17 +8718,17 @@ } }, "node_modules/istanbul-lib-report": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz", - "integrity": "sha512-wcdi+uAKzfiGT2abPpKZ0hSU1rGQjUQnLvtY5MpQ7QCTahD3VODhcu4wcfY1YtkGaDD5yuydOLINXsfbus9ROw==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.1.tgz", + "integrity": "sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw==", "dev": true, "dependencies": { "istanbul-lib-coverage": "^3.0.0", - "make-dir": "^3.0.0", + "make-dir": "^4.0.0", "supports-color": "^7.1.0" }, "engines": { - "node": ">=8" + "node": ">=10" } }, "node_modules/istanbul-lib-report/node_modules/has-flag": { @@ -8666,9 +8776,9 @@ } }, "node_modules/istanbul-reports": { - "version": "3.1.4", - "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.4.tgz", - "integrity": "sha512-r1/DshN4KSE7xWEknZLLLLDn5CJybV3nw01VTkp6D5jzLuELlcbudfj/eSQFvrKsJuTVCGnePO7ho82Nw9zzfw==", + "version": "3.1.6", + "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.6.tgz", + "integrity": "sha512-TLgnMkKg3iTDsQ9PbPTdpfAK2DzjF9mqUG7RMgcQl8oFjad8ob4laGxv5XV5U9MAfx8D6tSJiUyuAwzLicaxlg==", "dev": true, "dependencies": { "html-escaper": "^2.0.0", @@ -8679,20 +8789,21 @@ } }, "node_modules/jest": { - "version": "27.5.1", - "resolved": "https://registry.npmjs.org/jest/-/jest-27.5.1.tgz", - "integrity": "sha512-Yn0mADZB89zTtjkPJEXwrac3LHudkQMR+Paqa8uxJHCBr9agxztUifWCyiYrjhMPBoUVBjyny0I7XH6ozDr7QQ==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest/-/jest-29.7.0.tgz", + "integrity": "sha512-NIy3oAFp9shda19hy4HK0HRTWKtPJmGdnvywu01nOqNC2vZg+Z+fvJDxpMQA88eb2I9EcafcdjYgsDthnYTvGw==", "dev": true, "dependencies": { - "@jest/core": "^27.5.1", + "@jest/core": "^29.7.0", + "@jest/types": "^29.6.3", "import-local": "^3.0.2", - "jest-cli": "^27.5.1" + "jest-cli": "^29.7.0" }, "bin": { "jest": "bin/jest.js" }, "engines": { - "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" }, "peerDependencies": { "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" @@ -8704,23 +8815,23 @@ } }, "node_modules/jest-changed-files": { - "version": "27.5.1", - "resolved": "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-27.5.1.tgz", - "integrity": "sha512-buBLMiByfWGCoMsLLzGUUSpAmIAGnbR2KJoMN10ziLhOLvP4e0SlypHnAel8iqQXTrcbmfEY9sSqae5sgUsTvw==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-29.7.0.tgz", + "integrity": "sha512-fEArFiwf1BpQ+4bXSprcDc3/x4HSzL4al2tozwVpDFpsxALjLYdyiIK4e5Vz66GQJIbXJ82+35PtysofptNX2w==", "dev": true, "dependencies": { - "@jest/types": "^27.5.1", "execa": "^5.0.0", - "throat": "^6.0.1" + "jest-util": "^29.7.0", + "p-limit": "^3.1.0" }, "engines": { - "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, "node_modules/jest-chrome": { - "version": "0.7.2", - "resolved": "https://registry.npmjs.org/jest-chrome/-/jest-chrome-0.7.2.tgz", - "integrity": "sha512-RSRDi8qNX54Q3ltSC2rW25+47nwY4DoruHOjHR0JZxijITS2PZrQ3j0jZPP3ywC0GuX0JNNwsKD3+iaKzOJEAA==", + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/jest-chrome/-/jest-chrome-0.8.0.tgz", + "integrity": "sha512-39RR1GT9nI4e4jsuH1vIf4l5ApxxkcstjGJr+GsOURL8f4Db0UlbRnsZaM+ZRniaGtokqklUH5VFKGZZ6YztUg==", "dev": true, "dependencies": { "@types/chrome": "^0.0.114" @@ -8730,33 +8841,34 @@ } }, "node_modules/jest-circus": { - "version": "27.5.1", - "resolved": "https://registry.npmjs.org/jest-circus/-/jest-circus-27.5.1.tgz", - "integrity": "sha512-D95R7x5UtlMA5iBYsOHFFbMD/GVA4R/Kdq15f7xYWUfWHBto9NYRsOvnSauTgdF+ogCpJ4tyKOXhUifxS65gdw==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-circus/-/jest-circus-29.7.0.tgz", + "integrity": "sha512-3E1nCMgipcTkCocFwM90XXQab9bS+GMsjdpmPrlelaxwD93Ad8iVEjX/vvHPdLPnFf+L40u+5+iutRdA1N9myw==", "dev": true, "dependencies": { - "@jest/environment": "^27.5.1", - "@jest/test-result": "^27.5.1", - "@jest/types": "^27.5.1", + "@jest/environment": "^29.7.0", + "@jest/expect": "^29.7.0", + "@jest/test-result": "^29.7.0", + "@jest/types": "^29.6.3", "@types/node": "*", "chalk": "^4.0.0", "co": "^4.6.0", - "dedent": "^0.7.0", - "expect": "^27.5.1", + "dedent": "^1.0.0", "is-generator-fn": "^2.0.0", - "jest-each": "^27.5.1", - "jest-matcher-utils": "^27.5.1", - "jest-message-util": "^27.5.1", - "jest-runtime": "^27.5.1", - "jest-snapshot": "^27.5.1", - "jest-util": "^27.5.1", - "pretty-format": "^27.5.1", + "jest-each": "^29.7.0", + "jest-matcher-utils": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-runtime": "^29.7.0", + "jest-snapshot": "^29.7.0", + "jest-util": "^29.7.0", + "p-limit": "^3.1.0", + "pretty-format": "^29.7.0", + "pure-rand": "^6.0.0", "slash": "^3.0.0", - "stack-utils": "^2.0.3", - "throat": "^6.0.1" + "stack-utils": "^2.0.3" }, "engines": { - "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, "node_modules/jest-circus/node_modules/ansi-styles": { @@ -8817,6 +8929,22 @@ "node": ">=8" } }, + "node_modules/jest-circus/node_modules/pure-rand": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/pure-rand/-/pure-rand-6.0.3.tgz", + "integrity": "sha512-KddyFewCsO0j3+np81IQ+SweXLDnDQTs5s67BOnrYmYe/yNmUhttQyGsYzy8yUnoljGAQ9sl38YB4vH8ur7Y+w==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/dubzzz" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fast-check" + } + ] + }, "node_modules/jest-circus/node_modules/supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", @@ -8830,29 +8958,28 @@ } }, "node_modules/jest-cli": { - "version": "27.5.1", - "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-27.5.1.tgz", - "integrity": "sha512-Hc6HOOwYq4/74/c62dEE3r5elx8wjYqxY0r0G/nFrLDPMFRu6RA/u8qINOIkvhxG7mMQ5EJsOGfRpI8L6eFUVw==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-29.7.0.tgz", + "integrity": "sha512-OVVobw2IubN/GSYsxETi+gOe7Ka59EFMR/twOU3Jb2GnKKeMGJB5SGUUrEz3SFVmJASUdZUzy83sLNNQ2gZslg==", "dev": true, "dependencies": { - "@jest/core": "^27.5.1", - "@jest/test-result": "^27.5.1", - "@jest/types": "^27.5.1", + "@jest/core": "^29.7.0", + "@jest/test-result": "^29.7.0", + "@jest/types": "^29.6.3", "chalk": "^4.0.0", + "create-jest": "^29.7.0", "exit": "^0.1.2", - "graceful-fs": "^4.2.9", "import-local": "^3.0.2", - "jest-config": "^27.5.1", - "jest-util": "^27.5.1", - "jest-validate": "^27.5.1", - "prompts": "^2.0.1", - "yargs": "^16.2.0" + "jest-config": "^29.7.0", + "jest-util": "^29.7.0", + "jest-validate": "^29.7.0", + "yargs": "^17.3.1" }, "bin": { "jest": "bin/jest.js" }, "engines": { - "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" }, "peerDependencies": { "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" @@ -8934,43 +9061,45 @@ } }, "node_modules/jest-config": { - "version": "27.5.1", - "resolved": "https://registry.npmjs.org/jest-config/-/jest-config-27.5.1.tgz", - "integrity": "sha512-5sAsjm6tGdsVbW9ahcChPAFCk4IlkQUknH5AvKjuLTSlcO/wCZKyFdn7Rg0EkC+OGgWODEy2hDpWB1PgzH0JNA==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-config/-/jest-config-29.7.0.tgz", + "integrity": "sha512-uXbpfeQ7R6TZBqI3/TxCU4q4ttk3u0PJeC+E0zbfSoSjq6bJ7buBPxzQPL0ifrkY4DNu4JUdk0ImlBUYi840eQ==", "dev": true, "dependencies": { - "@babel/core": "^7.8.0", - "@jest/test-sequencer": "^27.5.1", - "@jest/types": "^27.5.1", - "babel-jest": "^27.5.1", + "@babel/core": "^7.11.6", + "@jest/test-sequencer": "^29.7.0", + "@jest/types": "^29.6.3", + "babel-jest": "^29.7.0", "chalk": "^4.0.0", "ci-info": "^3.2.0", "deepmerge": "^4.2.2", - "glob": "^7.1.1", + "glob": "^7.1.3", "graceful-fs": "^4.2.9", - "jest-circus": "^27.5.1", - "jest-environment-jsdom": "^27.5.1", - "jest-environment-node": "^27.5.1", - "jest-get-type": "^27.5.1", - "jest-jasmine2": "^27.5.1", - "jest-regex-util": "^27.5.1", - "jest-resolve": "^27.5.1", - "jest-runner": "^27.5.1", - "jest-util": "^27.5.1", - "jest-validate": "^27.5.1", + "jest-circus": "^29.7.0", + "jest-environment-node": "^29.7.0", + "jest-get-type": "^29.6.3", + "jest-regex-util": "^29.6.3", + "jest-resolve": "^29.7.0", + "jest-runner": "^29.7.0", + "jest-util": "^29.7.0", + "jest-validate": "^29.7.0", "micromatch": "^4.0.4", "parse-json": "^5.2.0", - "pretty-format": "^27.5.1", + "pretty-format": "^29.7.0", "slash": "^3.0.0", "strip-json-comments": "^3.1.1" }, "engines": { - "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" }, "peerDependencies": { + "@types/node": "*", "ts-node": ">=9.0.0" }, "peerDependenciesMeta": { + "@types/node": { + "optional": true + }, "ts-node": { "optional": true } @@ -9034,28 +9163,10 @@ "node": ">=8" } }, - "node_modules/jest-config/node_modules/parse-json": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", - "integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==", - "dev": true, - "dependencies": { - "@babel/code-frame": "^7.0.0", - "error-ex": "^1.3.1", - "json-parse-even-better-errors": "^2.3.0", - "lines-and-columns": "^1.1.6" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/jest-config/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "node_modules/jest-config/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, "dependencies": { "has-flag": "^4.0.0" @@ -9065,682 +9176,79 @@ } }, "node_modules/jest-diff": { - "version": "27.5.1", - "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-27.5.1.tgz", - "integrity": "sha512-m0NvkX55LDt9T4mctTEgnZk3fmEg3NRYutvMPWM/0iPnkFj2wIeF45O1718cMSOFO1vINkqmxqD8vE37uTEbqw==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-29.7.0.tgz", + "integrity": "sha512-LMIgiIrhigmPrs03JHpxUh2yISK3vLFPkAodPeo0+BuF7wA2FoQbkEg1u8gBYBThncu7e1oEDUfIXVuTqLRUjw==", "dev": true, "dependencies": { "chalk": "^4.0.0", - "diff-sequences": "^27.5.1", - "jest-get-type": "^27.5.1", - "pretty-format": "^27.5.1" + "diff-sequences": "^29.6.3", + "jest-get-type": "^29.6.3", + "pretty-format": "^29.7.0" }, "engines": { - "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, "node_modules/jest-diff/node_modules/ansi-styles": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/jest-diff/node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/jest-diff/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/jest-diff/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "node_modules/jest-diff/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/jest-diff/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/jest-docblock": { - "version": "27.5.1", - "resolved": "https://registry.npmjs.org/jest-docblock/-/jest-docblock-27.5.1.tgz", - "integrity": "sha512-rl7hlABeTsRYxKiUfpHrQrG4e2obOiTQWfMEH3PxPjOtdsfLQO4ReWSZaQ7DETm4xu07rl4q/h4zcKXyU0/OzQ==", - "dev": true, - "dependencies": { - "detect-newline": "^3.0.0" - }, - "engines": { - "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" - } - }, - "node_modules/jest-each": { - "version": "27.5.1", - "resolved": "https://registry.npmjs.org/jest-each/-/jest-each-27.5.1.tgz", - "integrity": "sha512-1Ff6p+FbhT/bXQnEouYy00bkNSY7OUpfIcmdl8vZ31A1UUaurOLPA8a8BbJOF2RDUElwJhmeaV7LnagI+5UwNQ==", - "dev": true, - "dependencies": { - "@jest/types": "^27.5.1", - "chalk": "^4.0.0", - "jest-get-type": "^27.5.1", - "jest-util": "^27.5.1", - "pretty-format": "^27.5.1" - }, - "engines": { - "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" - } - }, - "node_modules/jest-each/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/jest-each/node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/jest-each/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/jest-each/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "node_modules/jest-each/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/jest-each/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/jest-environment-jsdom": { - "version": "27.5.1", - "resolved": "https://registry.npmjs.org/jest-environment-jsdom/-/jest-environment-jsdom-27.5.1.tgz", - "integrity": "sha512-TFBvkTC1Hnnnrka/fUb56atfDtJ9VMZ94JkjTbggl1PEpwrYtUBKMezB3inLmWqQsXYLcMwNoDQwoBTAvFfsfw==", - "dev": true, - "dependencies": { - "@jest/environment": "^27.5.1", - "@jest/fake-timers": "^27.5.1", - "@jest/types": "^27.5.1", - "@types/node": "*", - "jest-mock": "^27.5.1", - "jest-util": "^27.5.1", - "jsdom": "^16.6.0" - }, - "engines": { - "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" - } - }, - "node_modules/jest-environment-node": { - "version": "27.5.1", - "resolved": "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-27.5.1.tgz", - "integrity": "sha512-Jt4ZUnxdOsTGwSRAfKEnE6BcwsSPNOijjwifq5sDFSA2kesnXTvNqKHYgM0hDq3549Uf/KzdXNYn4wMZJPlFLw==", - "dev": true, - "dependencies": { - "@jest/environment": "^27.5.1", - "@jest/fake-timers": "^27.5.1", - "@jest/types": "^27.5.1", - "@types/node": "*", - "jest-mock": "^27.5.1", - "jest-util": "^27.5.1" - }, - "engines": { - "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" - } - }, - "node_modules/jest-get-type": { - "version": "27.5.1", - "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-27.5.1.tgz", - "integrity": "sha512-2KY95ksYSaK7DMBWQn6dQz3kqAf3BB64y2udeG+hv4KfSOb9qwcYQstTJc1KCbsix+wLZWZYN8t7nwX3GOBLRw==", - "dev": true, - "engines": { - "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" - } - }, - "node_modules/jest-haste-map": { - "version": "27.5.1", - "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-27.5.1.tgz", - "integrity": "sha512-7GgkZ4Fw4NFbMSDSpZwXeBiIbx+t/46nJ2QitkOjvwPYyZmqttu2TDSimMHP1EkPOi4xUZAN1doE5Vd25H4Jng==", - "dev": true, - "dependencies": { - "@jest/types": "^27.5.1", - "@types/graceful-fs": "^4.1.2", - "@types/node": "*", - "anymatch": "^3.0.3", - "fb-watchman": "^2.0.0", - "graceful-fs": "^4.2.9", - "jest-regex-util": "^27.5.1", - "jest-serializer": "^27.5.1", - "jest-util": "^27.5.1", - "jest-worker": "^27.5.1", - "micromatch": "^4.0.4", - "walker": "^1.0.7" - }, - "engines": { - "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" - }, - "optionalDependencies": { - "fsevents": "^2.3.2" - } - }, - "node_modules/jest-html-reporter": { - "version": "3.4.2", - "resolved": "https://registry.npmjs.org/jest-html-reporter/-/jest-html-reporter-3.4.2.tgz", - "integrity": "sha512-2dA4oJdLP2+rewakwLdBhBCdk50zqzgD6Wk0fvsbdS0C9WwpuePwd0kQWRRdfLzNJM5CgC4O98wkK1lBFqJVrw==", - "dev": true, - "dependencies": { - "@babel/core": "^7.9.0", - "@babel/preset-env": "^7.8.7", - "@babel/preset-typescript": "^7.8.3", - "@jest/console": "^25.1.0", - "@jest/test-result": "^25.1.0", - "@jest/types": "^26.0.23", - "@types/dateformat": "^3.0.1", - "@types/jest": "^25.1.4", - "@types/mkdirp": "^1.0.0", - "@types/node": "^12.12.7", - "@types/sinon": "^7.5.2", - "dateformat": "3.0.2", - "mkdirp": "^1.0.3", - "sinon": "^9.0.1", - "strip-ansi": "6.0.1", - "xmlbuilder": "15.0.0" - }, - "engines": { - "node": ">=4.8.3" - }, - "peerDependencies": { - "jest": "19.x - 27.x" - } - }, - "node_modules/jest-html-reporter/node_modules/@jest/console": { - "version": "25.5.0", - "resolved": "https://registry.npmjs.org/@jest/console/-/console-25.5.0.tgz", - "integrity": "sha512-T48kZa6MK1Y6k4b89sexwmSF4YLeZS/Udqg3Jj3jG/cHH+N/sLFCEoXEDMOKugJQ9FxPN1osxIknvKkxt6MKyw==", - "dev": true, - "dependencies": { - "@jest/types": "^25.5.0", - "chalk": "^3.0.0", - "jest-message-util": "^25.5.0", - "jest-util": "^25.5.0", - "slash": "^3.0.0" - }, - "engines": { - "node": ">= 8.3" - } - }, - "node_modules/jest-html-reporter/node_modules/@jest/console/node_modules/@jest/types": { - "version": "25.5.0", - "resolved": "https://registry.npmjs.org/@jest/types/-/types-25.5.0.tgz", - "integrity": "sha512-OXD0RgQ86Tu3MazKo8bnrkDRaDXXMGUqd+kTtLtK1Zb7CRzQcaSRPPPV37SvYTdevXEBVxe0HXylEjs8ibkmCw==", - "dev": true, - "dependencies": { - "@types/istanbul-lib-coverage": "^2.0.0", - "@types/istanbul-reports": "^1.1.1", - "@types/yargs": "^15.0.0", - "chalk": "^3.0.0" - }, - "engines": { - "node": ">= 8.3" - } - }, - "node_modules/jest-html-reporter/node_modules/@jest/console/node_modules/@types/istanbul-reports": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-1.1.2.tgz", - "integrity": "sha512-P/W9yOX/3oPZSpaYOCQzGqgCQRXn0FFO/V8bWrCQs+wLmvVVxk6CRBXALEvNs9OHIatlnlFokfhuDo2ug01ciw==", - "dev": true, - "dependencies": { - "@types/istanbul-lib-coverage": "*", - "@types/istanbul-lib-report": "*" - } - }, - "node_modules/jest-html-reporter/node_modules/@jest/test-result": { - "version": "25.5.0", - "resolved": "https://registry.npmjs.org/@jest/test-result/-/test-result-25.5.0.tgz", - "integrity": "sha512-oV+hPJgXN7IQf/fHWkcS99y0smKLU2czLBJ9WA0jHITLst58HpQMtzSYxzaBvYc6U5U6jfoMthqsUlUlbRXs0A==", - "dev": true, - "dependencies": { - "@jest/console": "^25.5.0", - "@jest/types": "^25.5.0", - "@types/istanbul-lib-coverage": "^2.0.0", - "collect-v8-coverage": "^1.0.0" - }, - "engines": { - "node": ">= 8.3" - } - }, - "node_modules/jest-html-reporter/node_modules/@jest/test-result/node_modules/@jest/types": { - "version": "25.5.0", - "resolved": "https://registry.npmjs.org/@jest/types/-/types-25.5.0.tgz", - "integrity": "sha512-OXD0RgQ86Tu3MazKo8bnrkDRaDXXMGUqd+kTtLtK1Zb7CRzQcaSRPPPV37SvYTdevXEBVxe0HXylEjs8ibkmCw==", - "dev": true, - "dependencies": { - "@types/istanbul-lib-coverage": "^2.0.0", - "@types/istanbul-reports": "^1.1.1", - "@types/yargs": "^15.0.0", - "chalk": "^3.0.0" - }, - "engines": { - "node": ">= 8.3" - } - }, - "node_modules/jest-html-reporter/node_modules/@jest/test-result/node_modules/@types/istanbul-reports": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-1.1.2.tgz", - "integrity": "sha512-P/W9yOX/3oPZSpaYOCQzGqgCQRXn0FFO/V8bWrCQs+wLmvVVxk6CRBXALEvNs9OHIatlnlFokfhuDo2ug01ciw==", - "dev": true, - "dependencies": { - "@types/istanbul-lib-coverage": "*", - "@types/istanbul-lib-report": "*" - } - }, - "node_modules/jest-html-reporter/node_modules/@jest/types": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/@jest/types/-/types-26.6.2.tgz", - "integrity": "sha512-fC6QCp7Sc5sX6g8Tvbmj4XUTbyrik0akgRy03yjXbQaBWWNWGE7SGtJk98m0N8nzegD/7SggrUlivxo5ax4KWQ==", - "dev": true, - "dependencies": { - "@types/istanbul-lib-coverage": "^2.0.0", - "@types/istanbul-reports": "^3.0.0", - "@types/node": "*", - "@types/yargs": "^15.0.0", - "chalk": "^4.0.0" - }, - "engines": { - "node": ">= 10.14.2" - } - }, - "node_modules/jest-html-reporter/node_modules/@jest/types/node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/jest-html-reporter/node_modules/@types/jest": { - "version": "25.2.3", - "resolved": "https://registry.npmjs.org/@types/jest/-/jest-25.2.3.tgz", - "integrity": "sha512-JXc1nK/tXHiDhV55dvfzqtmP4S3sy3T3ouV2tkViZgxY/zeUkcpQcQPGRlgF4KmWzWW5oiWYSZwtCB+2RsE4Fw==", - "dev": true, - "dependencies": { - "jest-diff": "^25.2.1", - "pretty-format": "^25.2.1" - } - }, - "node_modules/jest-html-reporter/node_modules/@types/node": { - "version": "12.20.46", - "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.46.tgz", - "integrity": "sha512-cPjLXj8d6anFPzFvOPxS3fvly3Shm5nTfl6g8X5smexixbuGUf7hfr21J5tX9JW+UPStp/5P5R8qrKL5IyVJ+A==", - "dev": true - }, - "node_modules/jest-html-reporter/node_modules/@types/stack-utils": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-1.0.1.tgz", - "integrity": "sha512-l42BggppR6zLmpfU6fq9HEa2oGPEI8yrSPL3GITjfRInppYFahObbIQOQK3UGxEnyQpltZLaPe75046NOZQikw==", - "dev": true - }, - "node_modules/jest-html-reporter/node_modules/@types/yargs": { - "version": "15.0.14", - "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-15.0.14.tgz", - "integrity": "sha512-yEJzHoxf6SyQGhBhIYGXQDSCkJjB6HohDShto7m8vaKg9Yp0Yn8+71J9eakh2bnPg6BfsH9PRMhiRTZnd4eXGQ==", - "dev": true, - "dependencies": { - "@types/yargs-parser": "*" - } - }, - "node_modules/jest-html-reporter/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/jest-html-reporter/node_modules/chalk": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-3.0.0.tgz", - "integrity": "sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==", - "dev": true, - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/jest-html-reporter/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/jest-html-reporter/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "node_modules/jest-html-reporter/node_modules/dateformat": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/dateformat/-/dateformat-3.0.2.tgz", - "integrity": "sha1-mk30v/FYrC80vGN6vbFUcWB+Flk=", - "dev": true, - "engines": { - "node": "*" - } - }, - "node_modules/jest-html-reporter/node_modules/diff-sequences": { - "version": "25.2.6", - "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-25.2.6.tgz", - "integrity": "sha512-Hq8o7+6GaZeoFjtpgvRBUknSXNeJiCx7V9Fr94ZMljNiCr9n9L8H8aJqgWOQiDDGdyn29fRNcDdRVJ5fdyihfg==", - "dev": true, - "engines": { - "node": ">= 8.3" - } - }, - "node_modules/jest-html-reporter/node_modules/escape-string-regexp": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz", - "integrity": "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/jest-html-reporter/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/jest-html-reporter/node_modules/jest-diff": { - "version": "25.5.0", - "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-25.5.0.tgz", - "integrity": "sha512-z1kygetuPiREYdNIumRpAHY6RXiGmp70YHptjdaxTWGmA085W3iCnXNx0DhflK3vwrKmrRWyY1wUpkPMVxMK7A==", - "dev": true, - "dependencies": { - "chalk": "^3.0.0", - "diff-sequences": "^25.2.6", - "jest-get-type": "^25.2.6", - "pretty-format": "^25.5.0" - }, - "engines": { - "node": ">= 8.3" - } - }, - "node_modules/jest-html-reporter/node_modules/jest-get-type": { - "version": "25.2.6", - "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-25.2.6.tgz", - "integrity": "sha512-DxjtyzOHjObRM+sM1knti6or+eOgcGU4xVSb2HNP1TqO4ahsT+rqZg+nyqHWJSvWgKC5cG3QjGFBqxLghiF/Ig==", - "dev": true, - "engines": { - "node": ">= 8.3" - } - }, - "node_modules/jest-html-reporter/node_modules/jest-message-util": { - "version": "25.5.0", - "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-25.5.0.tgz", - "integrity": "sha512-ezddz3YCT/LT0SKAmylVyWWIGYoKHOFOFXx3/nA4m794lfVUskMcwhip6vTgdVrOtYdjeQeis2ypzes9mZb4EA==", - "dev": true, - "dependencies": { - "@babel/code-frame": "^7.0.0", - "@jest/types": "^25.5.0", - "@types/stack-utils": "^1.0.1", - "chalk": "^3.0.0", - "graceful-fs": "^4.2.4", - "micromatch": "^4.0.2", - "slash": "^3.0.0", - "stack-utils": "^1.0.1" - }, - "engines": { - "node": ">= 8.3" - } - }, - "node_modules/jest-html-reporter/node_modules/jest-message-util/node_modules/@jest/types": { - "version": "25.5.0", - "resolved": "https://registry.npmjs.org/@jest/types/-/types-25.5.0.tgz", - "integrity": "sha512-OXD0RgQ86Tu3MazKo8bnrkDRaDXXMGUqd+kTtLtK1Zb7CRzQcaSRPPPV37SvYTdevXEBVxe0HXylEjs8ibkmCw==", - "dev": true, - "dependencies": { - "@types/istanbul-lib-coverage": "^2.0.0", - "@types/istanbul-reports": "^1.1.1", - "@types/yargs": "^15.0.0", - "chalk": "^3.0.0" - }, - "engines": { - "node": ">= 8.3" - } - }, - "node_modules/jest-html-reporter/node_modules/jest-message-util/node_modules/@types/istanbul-reports": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-1.1.2.tgz", - "integrity": "sha512-P/W9yOX/3oPZSpaYOCQzGqgCQRXn0FFO/V8bWrCQs+wLmvVVxk6CRBXALEvNs9OHIatlnlFokfhuDo2ug01ciw==", - "dev": true, - "dependencies": { - "@types/istanbul-lib-coverage": "*", - "@types/istanbul-lib-report": "*" - } - }, - "node_modules/jest-html-reporter/node_modules/jest-util": { - "version": "25.5.0", - "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-25.5.0.tgz", - "integrity": "sha512-KVlX+WWg1zUTB9ktvhsg2PXZVdkI1NBevOJSkTKYAyXyH4QSvh+Lay/e/v+bmaFfrkfx43xD8QTfgobzlEXdIA==", - "dev": true, - "dependencies": { - "@jest/types": "^25.5.0", - "chalk": "^3.0.0", - "graceful-fs": "^4.2.4", - "is-ci": "^2.0.0", - "make-dir": "^3.0.0" - }, - "engines": { - "node": ">= 8.3" - } - }, - "node_modules/jest-html-reporter/node_modules/jest-util/node_modules/@jest/types": { - "version": "25.5.0", - "resolved": "https://registry.npmjs.org/@jest/types/-/types-25.5.0.tgz", - "integrity": "sha512-OXD0RgQ86Tu3MazKo8bnrkDRaDXXMGUqd+kTtLtK1Zb7CRzQcaSRPPPV37SvYTdevXEBVxe0HXylEjs8ibkmCw==", - "dev": true, - "dependencies": { - "@types/istanbul-lib-coverage": "^2.0.0", - "@types/istanbul-reports": "^1.1.1", - "@types/yargs": "^15.0.0", - "chalk": "^3.0.0" - }, - "engines": { - "node": ">= 8.3" - } - }, - "node_modules/jest-html-reporter/node_modules/jest-util/node_modules/@types/istanbul-reports": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-1.1.2.tgz", - "integrity": "sha512-P/W9yOX/3oPZSpaYOCQzGqgCQRXn0FFO/V8bWrCQs+wLmvVVxk6CRBXALEvNs9OHIatlnlFokfhuDo2ug01ciw==", - "dev": true, - "dependencies": { - "@types/istanbul-lib-coverage": "*", - "@types/istanbul-lib-report": "*" - } - }, - "node_modules/jest-html-reporter/node_modules/pretty-format": { - "version": "25.5.0", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-25.5.0.tgz", - "integrity": "sha512-kbo/kq2LQ/A/is0PQwsEHM7Ca6//bGPPvU6UnsdDRSKTWxT/ru/xb88v4BJf6a69H+uTytOEsTusT9ksd/1iWQ==", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "dependencies": { - "@jest/types": "^25.5.0", - "ansi-regex": "^5.0.0", - "ansi-styles": "^4.0.0", - "react-is": "^16.12.0" + "color-convert": "^2.0.1" }, "engines": { - "node": ">= 8.3" + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/jest-html-reporter/node_modules/pretty-format/node_modules/@jest/types": { - "version": "25.5.0", - "resolved": "https://registry.npmjs.org/@jest/types/-/types-25.5.0.tgz", - "integrity": "sha512-OXD0RgQ86Tu3MazKo8bnrkDRaDXXMGUqd+kTtLtK1Zb7CRzQcaSRPPPV37SvYTdevXEBVxe0HXylEjs8ibkmCw==", + "node_modules/jest-diff/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "dependencies": { - "@types/istanbul-lib-coverage": "^2.0.0", - "@types/istanbul-reports": "^1.1.1", - "@types/yargs": "^15.0.0", - "chalk": "^3.0.0" + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" }, "engines": { - "node": ">= 8.3" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" } }, - "node_modules/jest-html-reporter/node_modules/pretty-format/node_modules/@types/istanbul-reports": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-1.1.2.tgz", - "integrity": "sha512-P/W9yOX/3oPZSpaYOCQzGqgCQRXn0FFO/V8bWrCQs+wLmvVVxk6CRBXALEvNs9OHIatlnlFokfhuDo2ug01ciw==", + "node_modules/jest-diff/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "dependencies": { - "@types/istanbul-lib-coverage": "*", - "@types/istanbul-lib-report": "*" + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" } }, - "node_modules/jest-html-reporter/node_modules/react-is": { - "version": "16.13.1", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", - "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==", + "node_modules/jest-diff/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, - "node_modules/jest-html-reporter/node_modules/stack-utils": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/stack-utils/-/stack-utils-1.0.5.tgz", - "integrity": "sha512-KZiTzuV3CnSnSvgMRrARVCj+Ht7rMbauGDK0LdVFRGyenwdylpajAp4Q0i6SX8rEmbTpMMf6ryq2gb8pPq2WgQ==", + "node_modules/jest-diff/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, - "dependencies": { - "escape-string-regexp": "^2.0.0" - }, "engines": { "node": ">=8" } }, - "node_modules/jest-html-reporter/node_modules/supports-color": { + "node_modules/jest-diff/node_modules/supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", @@ -9752,35 +9260,35 @@ "node": ">=8" } }, - "node_modules/jest-jasmine2": { - "version": "27.5.1", - "resolved": "https://registry.npmjs.org/jest-jasmine2/-/jest-jasmine2-27.5.1.tgz", - "integrity": "sha512-jtq7VVyG8SqAorDpApwiJJImd0V2wv1xzdheGHRGyuT7gZm6gG47QEskOlzsN1PG/6WNaCo5pmwMHDf3AkG2pQ==", + "node_modules/jest-docblock": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-docblock/-/jest-docblock-29.7.0.tgz", + "integrity": "sha512-q617Auw3A612guyaFgsbFeYpNP5t2aoUNLwBUbc/0kD1R4t9ixDbyFTHd1nok4epoVFpr7PmeWHrhvuV3XaJ4g==", "dev": true, "dependencies": { - "@jest/environment": "^27.5.1", - "@jest/source-map": "^27.5.1", - "@jest/test-result": "^27.5.1", - "@jest/types": "^27.5.1", - "@types/node": "*", + "detect-newline": "^3.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-each": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-each/-/jest-each-29.7.0.tgz", + "integrity": "sha512-gns+Er14+ZrEoC5fhOfYCY1LOHHr0TI+rQUHZS8Ttw2l7gl+80eHc/gFf2Ktkw0+SIACDTeWvpFcv3B04VembQ==", + "dev": true, + "dependencies": { + "@jest/types": "^29.6.3", "chalk": "^4.0.0", - "co": "^4.6.0", - "expect": "^27.5.1", - "is-generator-fn": "^2.0.0", - "jest-each": "^27.5.1", - "jest-matcher-utils": "^27.5.1", - "jest-message-util": "^27.5.1", - "jest-runtime": "^27.5.1", - "jest-snapshot": "^27.5.1", - "jest-util": "^27.5.1", - "pretty-format": "^27.5.1", - "throat": "^6.0.1" + "jest-get-type": "^29.6.3", + "jest-util": "^29.7.0", + "pretty-format": "^29.7.0" }, "engines": { - "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/jest-jasmine2/node_modules/ansi-styles": { + "node_modules/jest-each/node_modules/ansi-styles": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", @@ -9795,7 +9303,7 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/jest-jasmine2/node_modules/chalk": { + "node_modules/jest-each/node_modules/chalk": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", @@ -9811,7 +9319,7 @@ "url": "https://github.com/chalk/chalk?sponsor=1" } }, - "node_modules/jest-jasmine2/node_modules/color-convert": { + "node_modules/jest-each/node_modules/color-convert": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", @@ -9823,13 +9331,13 @@ "node": ">=7.0.0" } }, - "node_modules/jest-jasmine2/node_modules/color-name": { + "node_modules/jest-each/node_modules/color-name": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, - "node_modules/jest-jasmine2/node_modules/has-flag": { + "node_modules/jest-each/node_modules/has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", @@ -9838,7 +9346,7 @@ "node": ">=8" } }, - "node_modules/jest-jasmine2/node_modules/supports-color": { + "node_modules/jest-each/node_modules/supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", @@ -9850,32 +9358,140 @@ "node": ">=8" } }, + "node_modules/jest-environment-jsdom": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-environment-jsdom/-/jest-environment-jsdom-29.7.0.tgz", + "integrity": "sha512-k9iQbsf9OyOfdzWH8HDmrRT0gSIcX+FLNW7IQq94tFX0gynPwqDTW0Ho6iMVNjGz/nb+l/vW3dWM2bbLLpkbXA==", + "dev": true, + "dependencies": { + "@jest/environment": "^29.7.0", + "@jest/fake-timers": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/jsdom": "^20.0.0", + "@types/node": "*", + "jest-mock": "^29.7.0", + "jest-util": "^29.7.0", + "jsdom": "^20.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "canvas": "^2.5.0" + }, + "peerDependenciesMeta": { + "canvas": { + "optional": true + } + } + }, + "node_modules/jest-environment-node": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-29.7.0.tgz", + "integrity": "sha512-DOSwCRqXirTOyheM+4d5YZOrWcdu0LNZ87ewUoywbcb2XR4wKgqiG8vNeYwhjFMbEkfju7wx2GYH0P2gevGvFw==", + "dev": true, + "dependencies": { + "@jest/environment": "^29.7.0", + "@jest/fake-timers": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "jest-mock": "^29.7.0", + "jest-util": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-get-type": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-29.6.3.tgz", + "integrity": "sha512-zrteXnqYxfQh7l5FHyL38jL39di8H8rHoecLH3JNxH3BwOrBsNeabdap5e0I23lD4HHI8W5VFBZqG4Eaq5LNcw==", + "dev": true, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-haste-map": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-29.7.0.tgz", + "integrity": "sha512-fP8u2pyfqx0K1rGn1R9pyE0/KTn+G7PxktWidOBTqFPLYX0b9ksaMFkhK5vrS3DVun09pckLdlx90QthlW7AmA==", + "dev": true, + "dependencies": { + "@jest/types": "^29.6.3", + "@types/graceful-fs": "^4.1.3", + "@types/node": "*", + "anymatch": "^3.0.3", + "fb-watchman": "^2.0.0", + "graceful-fs": "^4.2.9", + "jest-regex-util": "^29.6.3", + "jest-util": "^29.7.0", + "jest-worker": "^29.7.0", + "micromatch": "^4.0.4", + "walker": "^1.0.8" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "optionalDependencies": { + "fsevents": "^2.3.2" + } + }, + "node_modules/jest-html-reporter": { + "version": "3.10.2", + "resolved": "https://registry.npmjs.org/jest-html-reporter/-/jest-html-reporter-3.10.2.tgz", + "integrity": "sha512-XRBa5ylHPUQoo8aJXEEdKsTruieTdlPbRktMx9WG9evMTxzJEKGFMaw5x+sQxJuClWdNR72GGwbOaz+6HIlksA==", + "dev": true, + "dependencies": { + "@jest/test-result": "^29.0.2", + "@jest/types": "^29.0.2", + "dateformat": "3.0.2", + "mkdirp": "^1.0.3", + "strip-ansi": "6.0.1", + "xmlbuilder": "15.0.0" + }, + "engines": { + "node": ">=4.8.3" + }, + "peerDependencies": { + "jest": "19.x - 29.x", + "typescript": "^3.7.x || ^4.3.x || ^5.x" + } + }, + "node_modules/jest-html-reporter/node_modules/dateformat": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/dateformat/-/dateformat-3.0.2.tgz", + "integrity": "sha1-mk30v/FYrC80vGN6vbFUcWB+Flk=", + "dev": true, + "engines": { + "node": "*" + } + }, "node_modules/jest-leak-detector": { - "version": "27.5.1", - "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-27.5.1.tgz", - "integrity": "sha512-POXfWAMvfU6WMUXftV4HolnJfnPOGEu10fscNCA76KBpRRhcMN2c8d3iT2pxQS3HLbA+5X4sOUPzYO2NUyIlHQ==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-29.7.0.tgz", + "integrity": "sha512-kYA8IJcSYtST2BY9I+SMC32nDpBT3J2NvWJx8+JCuCdl/CR1I4EKUJROiP8XtCcxqgTTBGJNdbB1A8XRKbTetw==", "dev": true, "dependencies": { - "jest-get-type": "^27.5.1", - "pretty-format": "^27.5.1" + "jest-get-type": "^29.6.3", + "pretty-format": "^29.7.0" }, "engines": { - "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, "node_modules/jest-matcher-utils": { - "version": "27.5.1", - "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-27.5.1.tgz", - "integrity": "sha512-z2uTx/T6LBaCoNWNFWwChLBKYxTMcGBRjAt+2SbP929/Fflb9aa5LGma654Rz8z9HLxsrUaYzxE9T/EFIL/PAw==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-29.7.0.tgz", + "integrity": "sha512-sBkD+Xi9DtcChsI3L3u0+N0opgPYnCRPtGcQYrgXmR+hmt/fYfWAL0xRXYU8eWOdfuLgBe0YCW3AFtnRLagq/g==", "dev": true, "dependencies": { "chalk": "^4.0.0", - "jest-diff": "^27.5.1", - "jest-get-type": "^27.5.1", - "pretty-format": "^27.5.1" + "jest-diff": "^29.7.0", + "jest-get-type": "^29.6.3", + "pretty-format": "^29.7.0" }, "engines": { - "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, "node_modules/jest-matcher-utils/node_modules/ansi-styles": { @@ -9949,23 +9565,23 @@ } }, "node_modules/jest-message-util": { - "version": "27.5.1", - "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-27.5.1.tgz", - "integrity": "sha512-rMyFe1+jnyAAf+NHwTclDz0eAaLkVDdKVHHBFWsBWHnnh5YeJMNWWsv7AbFYXfK3oTqvL7VTWkhNLu1jX24D+g==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-29.7.0.tgz", + "integrity": "sha512-GBEV4GRADeP+qtB2+6u61stea8mGcOT4mCtrYISZwfu9/ISHFJ/5zOMXYbpBE9RsS5+Gb63DW4FgmnKJ79Kf6w==", "dev": true, "dependencies": { "@babel/code-frame": "^7.12.13", - "@jest/types": "^27.5.1", + "@jest/types": "^29.6.3", "@types/stack-utils": "^2.0.0", "chalk": "^4.0.0", "graceful-fs": "^4.2.9", "micromatch": "^4.0.4", - "pretty-format": "^27.5.1", + "pretty-format": "^29.7.0", "slash": "^3.0.0", "stack-utils": "^2.0.3" }, "engines": { - "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, "node_modules/jest-message-util/node_modules/ansi-styles": { @@ -10039,22 +9655,23 @@ } }, "node_modules/jest-mock": { - "version": "27.5.1", - "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-27.5.1.tgz", - "integrity": "sha512-K4jKbY1d4ENhbrG2zuPWaQBvDly+iZ2yAW+T1fATN78hc0sInwn7wZB8XtlNnvHug5RMwV897Xm4LqmPM4e2Og==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-29.7.0.tgz", + "integrity": "sha512-ITOMZn+UkYS4ZFh83xYAOzWStloNzJFO2s8DWrE4lhtGD+AorgnbkiKERe4wQVBydIGPx059g6riW5Btp6Llnw==", "dev": true, "dependencies": { - "@jest/types": "^27.5.1", - "@types/node": "*" + "@jest/types": "^29.6.3", + "@types/node": "*", + "jest-util": "^29.7.0" }, "engines": { - "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, "node_modules/jest-pnp-resolver": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/jest-pnp-resolver/-/jest-pnp-resolver-1.2.2.tgz", - "integrity": "sha512-olV41bKSMm8BdnuMsewT4jqlZ8+3TCARAXjZGT9jcoSnrfUnRCqnMoF9XEeoWjbzObpqF9dRhHQj0Xb9QdF6/w==", + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/jest-pnp-resolver/-/jest-pnp-resolver-1.2.3.tgz", + "integrity": "sha512-+3NpwQEnRoIBtx4fyhblQDPgJI0H1IEIkX7ShLUjPGA7TtUTvI1oiKi3SR4oBR0hQhQR80l4WAe5RrXBwWMA8w==", "dev": true, "engines": { "node": ">=6" @@ -10069,47 +9686,45 @@ } }, "node_modules/jest-regex-util": { - "version": "27.5.1", - "resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-27.5.1.tgz", - "integrity": "sha512-4bfKq2zie+x16okqDXjXn9ql2B0dScQu+vcwe4TvFVhkVyuWLqpZrZtXxLLWoXYgn0E87I6r6GRYHF7wFZBUvg==", + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-29.6.3.tgz", + "integrity": "sha512-KJJBsRCyyLNWCNBOvZyRDnAIfUiRJ8v+hOBQYGn8gDyF3UegwiP4gwRR3/SDa42g1YbVycTidUF3rKjyLFDWbg==", "dev": true, "engines": { - "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, "node_modules/jest-resolve": { - "version": "27.5.1", - "resolved": "https://registry.npmjs.org/jest-resolve/-/jest-resolve-27.5.1.tgz", - "integrity": "sha512-FFDy8/9E6CV83IMbDpcjOhumAQPDyETnU2KZ1O98DwTnz8AOBsW/Xv3GySr1mOZdItLR+zDZ7I/UdTFbgSOVCw==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-resolve/-/jest-resolve-29.7.0.tgz", + "integrity": "sha512-IOVhZSrg+UvVAshDSDtHyFCCBUl/Q3AAJv8iZ6ZjnZ74xzvwuzLXid9IIIPgTnY62SJjfuupMKZsZQRsCvxEgA==", "dev": true, "dependencies": { - "@jest/types": "^27.5.1", "chalk": "^4.0.0", "graceful-fs": "^4.2.9", - "jest-haste-map": "^27.5.1", + "jest-haste-map": "^29.7.0", "jest-pnp-resolver": "^1.2.2", - "jest-util": "^27.5.1", - "jest-validate": "^27.5.1", + "jest-util": "^29.7.0", + "jest-validate": "^29.7.0", "resolve": "^1.20.0", - "resolve.exports": "^1.1.0", + "resolve.exports": "^2.0.0", "slash": "^3.0.0" }, "engines": { - "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, "node_modules/jest-resolve-dependencies": { - "version": "27.5.1", - "resolved": "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-27.5.1.tgz", - "integrity": "sha512-QQOOdY4PE39iawDn5rzbIePNigfe5B9Z91GDD1ae/xNDlu9kaat8QQ5EKnNmVWPV54hUdxCVwwj6YMgR2O7IOg==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-29.7.0.tgz", + "integrity": "sha512-un0zD/6qxJ+S0et7WxeI3H5XSe9lTBBR7bOHCHXkKR6luG5mwDDlIzVQ0V5cZCuoTgEdcdwzTghYkTWfubi+nA==", "dev": true, "dependencies": { - "@jest/types": "^27.5.1", - "jest-regex-util": "^27.5.1", - "jest-snapshot": "^27.5.1" + "jest-regex-util": "^29.6.3", + "jest-snapshot": "^29.7.0" }, "engines": { - "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, "node_modules/jest-resolve/node_modules/ansi-styles": { @@ -10183,35 +9798,35 @@ } }, "node_modules/jest-runner": { - "version": "27.5.1", - "resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-27.5.1.tgz", - "integrity": "sha512-g4NPsM4mFCOwFKXO4p/H/kWGdJp9V8kURY2lX8Me2drgXqG7rrZAx5kv+5H7wtt/cdFIjhqYx1HrlqWHaOvDaQ==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-29.7.0.tgz", + "integrity": "sha512-fsc4N6cPCAahybGBfTRcq5wFR6fpLznMg47sY5aDpsoejOcVYFb07AHuSnR0liMcPTgBsA3ZJL6kFOjPdoNipQ==", "dev": true, "dependencies": { - "@jest/console": "^27.5.1", - "@jest/environment": "^27.5.1", - "@jest/test-result": "^27.5.1", - "@jest/transform": "^27.5.1", - "@jest/types": "^27.5.1", + "@jest/console": "^29.7.0", + "@jest/environment": "^29.7.0", + "@jest/test-result": "^29.7.0", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", "@types/node": "*", "chalk": "^4.0.0", - "emittery": "^0.8.1", + "emittery": "^0.13.1", "graceful-fs": "^4.2.9", - "jest-docblock": "^27.5.1", - "jest-environment-jsdom": "^27.5.1", - "jest-environment-node": "^27.5.1", - "jest-haste-map": "^27.5.1", - "jest-leak-detector": "^27.5.1", - "jest-message-util": "^27.5.1", - "jest-resolve": "^27.5.1", - "jest-runtime": "^27.5.1", - "jest-util": "^27.5.1", - "jest-worker": "^27.5.1", - "source-map-support": "^0.5.6", - "throat": "^6.0.1" + "jest-docblock": "^29.7.0", + "jest-environment-node": "^29.7.0", + "jest-haste-map": "^29.7.0", + "jest-leak-detector": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-resolve": "^29.7.0", + "jest-runtime": "^29.7.0", + "jest-util": "^29.7.0", + "jest-watcher": "^29.7.0", + "jest-worker": "^29.7.0", + "p-limit": "^3.1.0", + "source-map-support": "0.5.13" }, "engines": { - "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, "node_modules/jest-runner/node_modules/ansi-styles": { @@ -10285,36 +9900,36 @@ } }, "node_modules/jest-runtime": { - "version": "27.5.1", - "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-27.5.1.tgz", - "integrity": "sha512-o7gxw3Gf+H2IGt8fv0RiyE1+r83FJBRruoA+FXrlHw6xEyBsU8ugA6IPfTdVyA0w8HClpbK+DGJxH59UrNMx8A==", - "dev": true, - "dependencies": { - "@jest/environment": "^27.5.1", - "@jest/fake-timers": "^27.5.1", - "@jest/globals": "^27.5.1", - "@jest/source-map": "^27.5.1", - "@jest/test-result": "^27.5.1", - "@jest/transform": "^27.5.1", - "@jest/types": "^27.5.1", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-29.7.0.tgz", + "integrity": "sha512-gUnLjgwdGqW7B4LvOIkbKs9WGbn+QLqRQQ9juC6HndeDiezIwhDP+mhMwHWCEcfQ5RUXa6OPnFF8BJh5xegwwQ==", + "dev": true, + "dependencies": { + "@jest/environment": "^29.7.0", + "@jest/fake-timers": "^29.7.0", + "@jest/globals": "^29.7.0", + "@jest/source-map": "^29.6.3", + "@jest/test-result": "^29.7.0", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", "chalk": "^4.0.0", "cjs-module-lexer": "^1.0.0", "collect-v8-coverage": "^1.0.0", - "execa": "^5.0.0", "glob": "^7.1.3", "graceful-fs": "^4.2.9", - "jest-haste-map": "^27.5.1", - "jest-message-util": "^27.5.1", - "jest-mock": "^27.5.1", - "jest-regex-util": "^27.5.1", - "jest-resolve": "^27.5.1", - "jest-snapshot": "^27.5.1", - "jest-util": "^27.5.1", + "jest-haste-map": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-mock": "^29.7.0", + "jest-regex-util": "^29.6.3", + "jest-resolve": "^29.7.0", + "jest-snapshot": "^29.7.0", + "jest-util": "^29.7.0", "slash": "^3.0.0", "strip-bom": "^4.0.0" }, "engines": { - "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, "node_modules/jest-runtime/node_modules/ansi-styles": { @@ -10375,15 +9990,6 @@ "node": ">=8" } }, - "node_modules/jest-runtime/node_modules/strip-bom": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz", - "integrity": "sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==", - "dev": true, - "engines": { - "node": ">=8" - } - }, "node_modules/jest-runtime/node_modules/supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", @@ -10396,50 +10002,35 @@ "node": ">=8" } }, - "node_modules/jest-serializer": { - "version": "27.5.1", - "resolved": "https://registry.npmjs.org/jest-serializer/-/jest-serializer-27.5.1.tgz", - "integrity": "sha512-jZCyo6iIxO1aqUxpuBlwTDMkzOAJS4a3eYz3YzgxxVQFwLeSA7Jfq5cbqCY+JLvTDrWirgusI/0KwxKMgrdf7w==", - "dev": true, - "dependencies": { - "@types/node": "*", - "graceful-fs": "^4.2.9" - }, - "engines": { - "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" - } - }, "node_modules/jest-snapshot": { - "version": "27.5.1", - "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-27.5.1.tgz", - "integrity": "sha512-yYykXI5a0I31xX67mgeLw1DZ0bJB+gpq5IpSuCAoyDi0+BhgU/RIrL+RTzDmkNTchvDFWKP8lp+w/42Z3us5sA==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-29.7.0.tgz", + "integrity": "sha512-Rm0BMWtxBcioHr1/OX5YCP8Uov4riHvKPknOGs804Zg9JGZgmIBkbtlxJC/7Z4msKYVbIJtfU+tKb8xlYNfdkw==", "dev": true, "dependencies": { - "@babel/core": "^7.7.2", + "@babel/core": "^7.11.6", "@babel/generator": "^7.7.2", + "@babel/plugin-syntax-jsx": "^7.7.2", "@babel/plugin-syntax-typescript": "^7.7.2", - "@babel/traverse": "^7.7.2", - "@babel/types": "^7.0.0", - "@jest/transform": "^27.5.1", - "@jest/types": "^27.5.1", - "@types/babel__traverse": "^7.0.4", - "@types/prettier": "^2.1.5", + "@babel/types": "^7.3.3", + "@jest/expect-utils": "^29.7.0", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", "babel-preset-current-node-syntax": "^1.0.0", "chalk": "^4.0.0", - "expect": "^27.5.1", + "expect": "^29.7.0", "graceful-fs": "^4.2.9", - "jest-diff": "^27.5.1", - "jest-get-type": "^27.5.1", - "jest-haste-map": "^27.5.1", - "jest-matcher-utils": "^27.5.1", - "jest-message-util": "^27.5.1", - "jest-util": "^27.5.1", + "jest-diff": "^29.7.0", + "jest-get-type": "^29.6.3", + "jest-matcher-utils": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-util": "^29.7.0", "natural-compare": "^1.4.0", - "pretty-format": "^27.5.1", - "semver": "^7.3.2" + "pretty-format": "^29.7.0", + "semver": "^7.5.3" }, "engines": { - "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, "node_modules/jest-snapshot/node_modules/ansi-styles": { @@ -10501,9 +10092,9 @@ } }, "node_modules/jest-snapshot/node_modules/semver": { - "version": "7.3.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", - "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", "dev": true, "dependencies": { "lru-cache": "^6.0.0" @@ -10528,12 +10119,12 @@ } }, "node_modules/jest-util": { - "version": "27.5.1", - "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-27.5.1.tgz", - "integrity": "sha512-Kv2o/8jNvX1MQ0KGtw480E/w4fBCDOnH6+6DmeKi6LZUIlKA5kwY0YNdlzaWTiVgxqAqik11QyxDOKk543aKXw==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-29.7.0.tgz", + "integrity": "sha512-z6EbKajIpqGKU56y5KBUgy1dt1ihhQJgWzUlZHArA/+X2ad7Cb5iF+AK1EWVL/Bo7Rz9uurpqw6SiBCefUbCGA==", "dev": true, "dependencies": { - "@jest/types": "^27.5.1", + "@jest/types": "^29.6.3", "@types/node": "*", "chalk": "^4.0.0", "ci-info": "^3.2.0", @@ -10541,7 +10132,7 @@ "picomatch": "^2.2.3" }, "engines": { - "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, "node_modules/jest-util/node_modules/ansi-styles": { @@ -10615,20 +10206,20 @@ } }, "node_modules/jest-validate": { - "version": "27.5.1", - "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-27.5.1.tgz", - "integrity": "sha512-thkNli0LYTmOI1tDB3FI1S1RTp/Bqyd9pTarJwL87OIBFuqEb5Apv5EaApEudYg4g86e3CT6kM0RowkhtEnCBQ==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-29.7.0.tgz", + "integrity": "sha512-ZB7wHqaRGVw/9hST/OuFUReG7M8vKeq0/J2egIGLdvjHCmYqGARhzXmtgi+gVeZ5uXFF219aOc3Ls2yLg27tkw==", "dev": true, "dependencies": { - "@jest/types": "^27.5.1", + "@jest/types": "^29.6.3", "camelcase": "^6.2.0", "chalk": "^4.0.0", - "jest-get-type": "^27.5.1", + "jest-get-type": "^29.6.3", "leven": "^3.1.0", - "pretty-format": "^27.5.1" + "pretty-format": "^29.7.0" }, "engines": { - "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, "node_modules/jest-validate/node_modules/ansi-styles": { @@ -10714,21 +10305,22 @@ } }, "node_modules/jest-watcher": { - "version": "27.5.1", - "resolved": "https://registry.npmjs.org/jest-watcher/-/jest-watcher-27.5.1.tgz", - "integrity": "sha512-z676SuD6Z8o8qbmEGhoEUFOM1+jfEiL3DXHK/xgEiG2EyNYfFG60jluWcupY6dATjfEsKQuibReS1djInQnoVw==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-watcher/-/jest-watcher-29.7.0.tgz", + "integrity": "sha512-49Fg7WXkU3Vl2h6LbLtMQ/HyB6rXSIX7SqvBLQmssRBGN9I0PNvPmAmCWSOY6SOvrjhI/F7/bGAv9RtnsPA03g==", "dev": true, "dependencies": { - "@jest/test-result": "^27.5.1", - "@jest/types": "^27.5.1", + "@jest/test-result": "^29.7.0", + "@jest/types": "^29.6.3", "@types/node": "*", "ansi-escapes": "^4.2.1", "chalk": "^4.0.0", - "jest-util": "^27.5.1", + "emittery": "^0.13.1", + "jest-util": "^29.7.0", "string-length": "^4.0.1" }, "engines": { - "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, "node_modules/jest-watcher/node_modules/ansi-styles": { @@ -10802,17 +10394,18 @@ } }, "node_modules/jest-worker": { - "version": "27.5.1", - "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-27.5.1.tgz", - "integrity": "sha512-7vuh85V5cdDofPyxn58nrPjBktZo0u9x1g8WtjQol+jZDaE+fhN+cIvTj11GndBnMnyfrUOG1sZQxCdjKh+DKg==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-29.7.0.tgz", + "integrity": "sha512-eIz2msL/EzL9UFTFFx7jBTkeZfku0yUAyZZZmJ93H2TYEiroIx2PQjEXcwYtYl8zXCxb+PAmA2hLIt/6ZEkPHw==", "dev": true, "dependencies": { "@types/node": "*", + "jest-util": "^29.7.0", "merge-stream": "^2.0.0", "supports-color": "^8.0.0" }, "engines": { - "node": ">= 10.13.0" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, "node_modules/jest-worker/node_modules/has-flag": { @@ -10865,41 +10458,40 @@ "dev": true }, "node_modules/jsdom": { - "version": "16.7.0", - "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-16.7.0.tgz", - "integrity": "sha512-u9Smc2G1USStM+s/x1ru5Sxrl6mPYCbByG1U/hUmqaVsm4tbNyS7CicOSRyuGQYZhTu0h84qkZZQ/I+dzizSVw==", + "version": "20.0.3", + "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-20.0.3.tgz", + "integrity": "sha512-SYhBvTh89tTfCD/CRdSOm13mOBa42iTaTyfyEWBdKcGdPxPtLFBXuHR8XHb33YNYaP+lLbmSvBTsnoesCNJEsQ==", "dev": true, "dependencies": { - "abab": "^2.0.5", - "acorn": "^8.2.4", - "acorn-globals": "^6.0.0", - "cssom": "^0.4.4", + "abab": "^2.0.6", + "acorn": "^8.8.1", + "acorn-globals": "^7.0.0", + "cssom": "^0.5.0", "cssstyle": "^2.3.0", - "data-urls": "^2.0.0", - "decimal.js": "^10.2.1", - "domexception": "^2.0.1", + "data-urls": "^3.0.2", + "decimal.js": "^10.4.2", + "domexception": "^4.0.0", "escodegen": "^2.0.0", - "form-data": "^3.0.0", - "html-encoding-sniffer": "^2.0.1", - "http-proxy-agent": "^4.0.1", - "https-proxy-agent": "^5.0.0", + "form-data": "^4.0.0", + "html-encoding-sniffer": "^3.0.0", + "http-proxy-agent": "^5.0.0", + "https-proxy-agent": "^5.0.1", "is-potential-custom-element-name": "^1.0.1", - "nwsapi": "^2.2.0", - "parse5": "6.0.1", - "saxes": "^5.0.1", + "nwsapi": "^2.2.2", + "parse5": "^7.1.1", + "saxes": "^6.0.0", "symbol-tree": "^3.2.4", - "tough-cookie": "^4.0.0", - "w3c-hr-time": "^1.0.2", - "w3c-xmlserializer": "^2.0.0", - "webidl-conversions": "^6.1.0", - "whatwg-encoding": "^1.0.5", - "whatwg-mimetype": "^2.3.0", - "whatwg-url": "^8.5.0", - "ws": "^7.4.6", - "xml-name-validator": "^3.0.0" + "tough-cookie": "^4.1.2", + "w3c-xmlserializer": "^4.0.0", + "webidl-conversions": "^7.0.0", + "whatwg-encoding": "^2.0.0", + "whatwg-mimetype": "^3.0.0", + "whatwg-url": "^11.0.0", + "ws": "^8.11.0", + "xml-name-validator": "^4.0.0" }, "engines": { - "node": ">=10" + "node": ">=14" }, "peerDependencies": { "canvas": "^2.5.0" @@ -10911,9 +10503,9 @@ } }, "node_modules/jsdom/node_modules/acorn": { - "version": "8.7.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.7.0.tgz", - "integrity": "sha512-V/LGr1APy+PXIwKebEWrkZPwoeoF+w1jiOBUmuxuiUIaOHtob8Qc9BTrYo7VuI5fR8tqsy+buA2WFooR5olqvQ==", + "version": "8.10.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.10.0.tgz", + "integrity": "sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw==", "dev": true, "bin": { "acorn": "bin/acorn" @@ -10923,9 +10515,9 @@ } }, "node_modules/jsdom/node_modules/form-data": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-3.0.1.tgz", - "integrity": "sha512-RHkBKtLWUVwd7SqRIvCZMEvAMoGUp0XU+seQiZejj0COz3RI3hWP4sCv3gZWWLjJTd7rGwcsF5eKZGii0r/hbg==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", + "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", "dev": true, "dependencies": { "asynckit": "^0.4.0", @@ -10961,12 +10553,12 @@ "dev": true }, "node_modules/json-schema-to-typescript": { - "version": "11.0.2", - "resolved": "https://registry.npmjs.org/json-schema-to-typescript/-/json-schema-to-typescript-11.0.2.tgz", - "integrity": "sha512-XRyeXBJeo/IH4eTP5D1ptX78vCvH86nMDt2k3AxO28C3uYWEDmy4mgPyMpb8bLJ/pJMElOGuQbnKR5Y6NSh3QQ==", + "version": "13.1.1", + "resolved": "https://registry.npmjs.org/json-schema-to-typescript/-/json-schema-to-typescript-13.1.1.tgz", + "integrity": "sha512-F3CYhtA7F3yPbb8vF7sFchk/2dnr1/yTKf8RcvoNpjnh67ZS/ZMH1ElLt5KHAtf2/bymiejLQQszszPWEeTdSw==", "dev": true, "dependencies": { - "@bcherny/json-schema-ref-parser": "9.0.9", + "@bcherny/json-schema-ref-parser": "10.0.5-fork", "@types/json-schema": "^7.0.11", "@types/lodash": "^4.14.182", "@types/prettier": "^2.6.1", @@ -10989,9 +10581,9 @@ } }, "node_modules/json-schema-traverse": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", - "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", "dev": true }, "node_modules/json-stable-stringify-without-jsonify": { @@ -11007,9 +10599,9 @@ "dev": true }, "node_modules/json5": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.1.tgz", - "integrity": "sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA==", + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", + "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", "dev": true, "bin": { "json5": "lib/cli.js" @@ -11079,12 +10671,6 @@ "verror": "1.10.0" } }, - "node_modules/just-extend": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/just-extend/-/just-extend-4.2.1.tgz", - "integrity": "sha512-g3UB796vUFIY90VIv/WX3L2c8CS2MdWUww3CNrYmqza1Fg0DURc2K/O4YrnklBdQarSJ/y8JnJYDGc+1iumQjg==", - "dev": true - }, "node_modules/kind-of": { "version": "6.0.3", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", @@ -11206,16 +10792,18 @@ } }, "node_modules/locate-path": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", - "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", "dev": true, "dependencies": { - "p-locate": "^2.0.0", - "path-exists": "^3.0.0" + "p-locate": "^5.0.0" }, "engines": { - "node": ">=4" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/lodash": { @@ -11224,28 +10812,10 @@ "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", "dev": true }, - "node_modules/lodash.clonedeep": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz", - "integrity": "sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8=", - "dev": true - }, "node_modules/lodash.debounce": { "version": "4.0.8", "resolved": "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz", - "integrity": "sha1-gteb/zCmfEAF/9XiUVMArZyk168=", - "dev": true - }, - "node_modules/lodash.flatten": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/lodash.flatten/-/lodash.flatten-4.4.0.tgz", - "integrity": "sha1-8xwiIlqWMtK7+OSt2+8kCqdlph8=", - "dev": true - }, - "node_modules/lodash.get": { - "version": "4.4.2", - "resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz", - "integrity": "sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk=", + "integrity": "sha512-FT1yDzDYEoYWhnSGnpE/4Kj1fLZkDFyqRb7fNt6FdYOSxlUWAtp42Eh6Wb0rGIv/m9Bgo7x4GhQbm5Ys4SG5ow==", "dev": true }, "node_modules/lodash.memoize": { @@ -11260,12 +10830,6 @@ "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", "dev": true }, - "node_modules/lodash.truncate": { - "version": "4.4.2", - "resolved": "https://registry.npmjs.org/lodash.truncate/-/lodash.truncate-4.4.2.tgz", - "integrity": "sha1-WjUNoLERO4N+z//VgSy+WNbq4ZM=", - "dev": true - }, "node_modules/log-symbols": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", @@ -11383,20 +10947,35 @@ } }, "node_modules/make-dir": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", - "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-4.0.0.tgz", + "integrity": "sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==", "dev": true, "dependencies": { - "semver": "^6.0.0" + "semver": "^7.5.3" }, "engines": { - "node": ">=8" + "node": ">=10" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/make-dir/node_modules/semver": { + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "dev": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/make-iterator": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/make-iterator/-/make-iterator-1.0.1.tgz", @@ -11709,38 +11288,16 @@ "integrity": "sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ==", "dev": true }, - "node_modules/nise": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/nise/-/nise-4.1.0.tgz", - "integrity": "sha512-eQMEmGN/8arp0xsvGoQ+B1qvSkR73B1nWSCh7nOt5neMCtwcQVYQGdzQMhcNscktTsWB54xnlSQFzOAPJD8nXA==", - "dev": true, - "dependencies": { - "@sinonjs/commons": "^1.7.0", - "@sinonjs/fake-timers": "^6.0.0", - "@sinonjs/text-encoding": "^0.7.1", - "just-extend": "^4.0.2", - "path-to-regexp": "^1.7.0" - } - }, - "node_modules/nise/node_modules/@sinonjs/fake-timers": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-6.0.1.tgz", - "integrity": "sha512-MZPUxrmFubI36XS1DI3qmI0YdN1gks62JtFZvxR67ljjSNCeK6U08Zx4msEWOXuofgqUt6zPHSi1H9fbjR/NRA==", - "dev": true, - "dependencies": { - "@sinonjs/commons": "^1.7.0" - } - }, "node_modules/node-int64": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz", - "integrity": "sha1-h6kGXNs1XTGC2PlM4RGIuCXGijs=", + "integrity": "sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw==", "dev": true }, "node_modules/node-releases": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.2.tgz", - "integrity": "sha512-XxYDdcQ6eKqp/YjI+tb2C5WM2LgjnZrfYg4vgQt49EK268b6gYCHsBLrK2qvJo4FmCtqmKezb0WZFK4fkrZNsg==", + "version": "2.0.13", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.13.tgz", + "integrity": "sha512-uYr7J37ae/ORWdZeQ1xxMJe3NtdmqMC/JZK+geofDrkLUApKRHPd18/TxtBOJ4A0/+uUIliorNrfYV6s1b02eQ==", "dev": true }, "node_modules/nopt": { @@ -11777,9 +11334,9 @@ } }, "node_modules/nwsapi": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.0.tgz", - "integrity": "sha512-h2AatdwYH+JHiZpv7pt/gSX1XoRGb7L/qSIeuqA6GwYoF9w1vP1cw42TO0aI2pNyshRK5893hNSl+1//vHK7hQ==", + "version": "2.2.7", + "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.7.tgz", + "integrity": "sha512-ub5E4+FBPKwAZx0UwIQOjYWGHTEq5sPqHQNRN8Z9e4A7u3Tj1weLJsL59yH9vmvqEtBHaOmT6cYQKIZOxp35FQ==", "dev": true }, "node_modules/oauth-sign": { @@ -11801,9 +11358,9 @@ } }, "node_modules/object-inspect": { - "version": "1.12.0", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.0.tgz", - "integrity": "sha512-Ho2z80bVIvJloH+YzRmpZVQe87+qASmBUKZDWgx9cu+KDrX2ZDH/3tMy+gXbZETVGs2M8YdxObOh7XAtim9Y0g==", + "version": "1.12.3", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.3.tgz", + "integrity": "sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g==", "dev": true, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -11819,18 +11376,21 @@ } }, "node_modules/object.assign": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.2.tgz", - "integrity": "sha512-ixT2L5THXsApyiUPYKmW+2EHpXXe5Ii3M+f4e+aJFAHao5amFRW6J0OO6c/LU8Be47utCx2GL89hxGB6XSmKuQ==", + "version": "4.1.4", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.4.tgz", + "integrity": "sha512-1mxKf0e58bvyjSCtKYY4sRe9itRk3PJpquJOjeIkz885CczcI4IvJJDLPS72oowuSh+pBxUFROpX+TU++hxhZQ==", "dev": true, "dependencies": { - "call-bind": "^1.0.0", - "define-properties": "^1.1.3", - "has-symbols": "^1.0.1", + "call-bind": "^1.0.2", + "define-properties": "^1.1.4", + "has-symbols": "^1.0.3", "object-keys": "^1.1.1" }, "engines": { "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/object.defaults": { @@ -11848,6 +11408,35 @@ "node": ">=0.10.0" } }, + "node_modules/object.fromentries": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/object.fromentries/-/object.fromentries-2.0.6.tgz", + "integrity": "sha512-VciD13dswC4j1Xt5394WR4MzmAQmlgN72phd/riNp9vtD7tp4QQWJ0R4wvclXcafgcYK8veHRed2W6XeGBvcfg==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.4", + "es-abstract": "^1.20.4" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/object.groupby": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/object.groupby/-/object.groupby-1.0.0.tgz", + "integrity": "sha512-70MWG6NfRH9GnbZOikuhPPYzpUpof9iW2J9E4dW7FXTqPNb6rllE6u39SKwwiNh8lCwX3DDb5OgcKGiEBrTTyw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.21.2", + "get-intrinsic": "^1.2.1" + } + }, "node_modules/object.map": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/object.map/-/object.map-1.0.1.tgz", @@ -11874,14 +11463,14 @@ } }, "node_modules/object.values": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.5.tgz", - "integrity": "sha512-QUZRW0ilQ3PnPpbNtgdNV1PDbEqLIiSFB3l+EnGtBQ/8SUTLj1PZwtQHABZtLgwpJZTSZhuGLOGk57Drx2IvYg==", + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.6.tgz", + "integrity": "sha512-FVVTkD1vENCsAcwNs9k6jea2uHC/X0+JcjG8YA60FN5CMaJmG95wT9jek/xX9nornqGRrBkKtzuAu2wuHpKqvw==", "dev": true, "dependencies": { "call-bind": "^1.0.2", - "define-properties": "^1.1.3", - "es-abstract": "^1.19.1" + "define-properties": "^1.1.4", + "es-abstract": "^1.20.4" }, "engines": { "node": ">= 0.4" @@ -11930,17 +11519,17 @@ } }, "node_modules/optionator": { - "version": "0.9.1", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", - "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==", + "version": "0.9.3", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.3.tgz", + "integrity": "sha512-JjCoypp+jKn1ttEFExxhetCKeJt9zhAgAve5FXHixTvFDW/5aEktX9bufBKLRRMdU7bNtpLfcGu94B3cdEJgjg==", "dev": true, "dependencies": { + "@aashutoshrathi/word-wrap": "^1.2.3", "deep-is": "^0.1.3", "fast-levenshtein": "^2.0.6", "levn": "^0.4.1", "prelude-ls": "^1.2.1", - "type-check": "^0.4.0", - "word-wrap": "^1.2.3" + "type-check": "^0.4.0" }, "engines": { "node": ">= 0.8.0" @@ -12083,36 +11672,42 @@ } }, "node_modules/p-limit": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", - "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", "dev": true, "dependencies": { - "p-try": "^1.0.0" + "yocto-queue": "^0.1.0" }, "engines": { - "node": ">=4" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/p-locate": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", - "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", "dev": true, "dependencies": { - "p-limit": "^1.1.0" + "p-limit": "^3.0.2" }, "engines": { - "node": ">=4" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/p-try": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", - "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", "dev": true, "engines": { - "node": ">=4" + "node": ">=6" } }, "node_modules/pako": { @@ -12169,6 +11764,24 @@ "node": ">=0.8" } }, + "node_modules/parse-json": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", + "integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.0.0", + "error-ex": "^1.3.1", + "json-parse-even-better-errors": "^2.3.0", + "lines-and-columns": "^1.1.6" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/parse-passwd": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/parse-passwd/-/parse-passwd-1.0.0.tgz", @@ -12179,10 +11792,28 @@ } }, "node_modules/parse5": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/parse5/-/parse5-6.0.1.tgz", - "integrity": "sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw==", - "dev": true + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.1.2.tgz", + "integrity": "sha512-Czj1WaSVpaoj0wbhMzLmWD69anp2WH7FXMB9n1Sy8/ZFF9jolSQVMu1Ij5WIyGmcBmhk7EOndpO4mIpihVqAXw==", + "dev": true, + "dependencies": { + "entities": "^4.4.0" + }, + "funding": { + "url": "https://github.com/inikulin/parse5?sponsor=1" + } + }, + "node_modules/parse5/node_modules/entities": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", + "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", + "dev": true, + "engines": { + "node": ">=0.12" + }, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } }, "node_modules/path-browserify": { "version": "1.0.1", @@ -12253,21 +11884,6 @@ "node": ">=0.10.0" } }, - "node_modules/path-to-regexp": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.8.0.tgz", - "integrity": "sha512-n43JRhlUKUAlibEJhPeir1ncUID16QnEjNpwzNdO3Lm4ywrBpBZ5oLD0I6br9evr1Y9JTqwRtAh7JLoOzAQdVA==", - "dev": true, - "dependencies": { - "isarray": "0.0.1" - } - }, - "node_modules/path-to-regexp/node_modules/isarray": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", - "dev": true - }, "node_modules/path-type": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", @@ -12315,14 +11931,87 @@ } }, "node_modules/pirates": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.4.tgz", - "integrity": "sha512-ZIrVPH+A52Dw84R0L3/VS9Op04PuQ2SEoJL6bkshmiTic/HldyW9Tf7oH5mhJZBK7NmDx27vSMrYEXPXclpDKw==", + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.6.tgz", + "integrity": "sha512-saLsH7WeYYPiD25LDuLRRY/i+6HaPYr6G1OUlN39otzkSTxKnubR9RTxS3/Kk50s1g2JTgFwWQDQyplC5/SHZg==", "dev": true, "engines": { "node": ">= 6" } }, + "node_modules/pkg-dir": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", + "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", + "dev": true, + "dependencies": { + "find-up": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/pkg-dir/node_modules/find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "dependencies": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/pkg-dir/node_modules/locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "dependencies": { + "p-locate": "^4.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/pkg-dir/node_modules/p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "dependencies": { + "p-try": "^2.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/pkg-dir/node_modules/p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "dependencies": { + "p-limit": "^2.2.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/pkg-dir/node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/pkg-up": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/pkg-up/-/pkg-up-3.1.0.tgz", @@ -12384,41 +12073,34 @@ "node": ">=6" } }, - "node_modules/pkg-up/node_modules/p-try": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", - "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", - "dev": true, - "engines": { - "node": ">=6" - } - }, "node_modules/playwright": { - "version": "1.31.2", - "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.31.2.tgz", - "integrity": "sha512-jpC47n2PKQNtzB7clmBuWh6ftBRS/Bt5EGLigJ9k2QAKcNeYXZkEaDH5gmvb6+AbcE0DO6GnXdbl9ogG6Eh+og==", + "version": "1.38.1", + "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.38.1.tgz", + "integrity": "sha512-oRMSJmZrOu1FP5iu3UrCx8JEFRIMxLDM0c/3o4bpzU5Tz97BypefWf7TuTNPWeCe279TPal5RtPPZ+9lW/Qkow==", "dev": true, - "hasInstallScript": true, "dependencies": { - "playwright-core": "1.31.2" + "playwright-core": "1.38.1" }, "bin": { "playwright": "cli.js" }, "engines": { - "node": ">=14" + "node": ">=16" + }, + "optionalDependencies": { + "fsevents": "2.3.2" } }, "node_modules/playwright-core": { - "version": "1.31.2", - "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.31.2.tgz", - "integrity": "sha512-a1dFgCNQw4vCsG7bnojZjDnPewZcw7tZUNFN0ZkcLYKj+mPmXvg4MpaaKZ5SgqPsOmqIf2YsVRkgqiRDxD+fDQ==", + "version": "1.38.1", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.38.1.tgz", + "integrity": "sha512-tQqNFUKa3OfMf4b2jQ7aGLB8o9bS3bOY0yMEtldtC2+spf8QXG9zvXLTXUeRsoNuxEYMgLYR+NXfAa1rjKRcrg==", "dev": true, "bin": { - "playwright": "cli.js" + "playwright-core": "cli.js" }, "engines": { - "node": ">=14" + "node": ">=16" } }, "node_modules/portfinder": { @@ -12490,17 +12172,17 @@ } }, "node_modules/pretty-format": { - "version": "27.5.1", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-27.5.1.tgz", - "integrity": "sha512-Qb1gy5OrP5+zDf2Bvnzdl3jsTf1qXVMazbvCoKhtKqVs4/YK4ozX4gKQJJVyNe+cajNPn0KoC0MC3FUmaHWEmQ==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", + "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", "dev": true, "dependencies": { - "ansi-regex": "^5.0.1", + "@jest/schemas": "^29.6.3", "ansi-styles": "^5.0.0", - "react-is": "^17.0.1" + "react-is": "^18.0.0" }, "engines": { - "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, "node_modules/pretty-format/node_modules/ansi-styles": { @@ -12530,15 +12212,6 @@ "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", "dev": true }, - "node_modules/progress": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", - "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", - "dev": true, - "engines": { - "node": ">=0.4.0" - } - }, "node_modules/prompts": { "version": "2.4.2", "resolved": "https://registry.npmjs.org/prompts/-/prompts-2.4.2.tgz", @@ -12627,6 +12300,12 @@ "node": ">=0.4.x" } }, + "node_modules/querystringify": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.2.0.tgz", + "integrity": "sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==", + "dev": true + }, "node_modules/queue-microtask": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", @@ -12686,9 +12365,9 @@ "dev": true }, "node_modules/react-is": { - "version": "17.0.2", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz", - "integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==", + "version": "18.2.0", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.2.0.tgz", + "integrity": "sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==", "dev": true }, "node_modules/read-only-stream": { @@ -12761,9 +12440,9 @@ "dev": true }, "node_modules/regenerate-unicode-properties": { - "version": "10.0.1", - "resolved": "https://registry.npmjs.org/regenerate-unicode-properties/-/regenerate-unicode-properties-10.0.1.tgz", - "integrity": "sha512-vn5DU6yg6h8hP/2OkQo3K7uVILvY4iu0oI4t3HFa81UPkhGJwkRwM10JEc3upjdhHjs/k8GJY1sRBhk5sr69Bw==", + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/regenerate-unicode-properties/-/regenerate-unicode-properties-10.1.0.tgz", + "integrity": "sha512-d1VudCLoIGitcU/hEg2QqvyGZQmdC0Lf8BqdOMXGFSvJP4bNV1+XqbPQeHHLD51Jh4QJJ225dlIFvY4Ly6MXmQ==", "dev": true, "dependencies": { "regenerate": "^1.4.2" @@ -12773,20 +12452,37 @@ } }, "node_modules/regenerator-runtime": { - "version": "0.13.9", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.9.tgz", - "integrity": "sha512-p3VT+cOEgxFsRRA9X4lkI1E+k2/CtnKtU4gcxyaCUreilL/vqI6CdZ3wxVUx3UOUg+gnUOQQcRI7BmSI656MYA==", + "version": "0.14.0", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.0.tgz", + "integrity": "sha512-srw17NI0TUWHuGa5CFGGmhfNIeja30WMBfbslPNhf6JrqQlLN5gcrvig1oqPxiVaXb0oW0XRKtH6Nngs5lKCIA==", "dev": true }, "node_modules/regenerator-transform": { - "version": "0.14.5", - "resolved": "https://registry.npmjs.org/regenerator-transform/-/regenerator-transform-0.14.5.tgz", - "integrity": "sha512-eOf6vka5IO151Jfsw2NO9WpGX58W6wWmefK3I1zEGr0lOD0u8rwPaNqQL1aRxUaxLeKO3ArNh3VYg1KbaD+FFw==", + "version": "0.15.2", + "resolved": "https://registry.npmjs.org/regenerator-transform/-/regenerator-transform-0.15.2.tgz", + "integrity": "sha512-hfMp2BoF0qOk3uc5V20ALGDS2ddjQaLrdl7xrGXvAIow7qeWRM2VA2HuCHkUKk9slq3VwEwLNK3DFBqDfPGYtg==", "dev": true, "dependencies": { "@babel/runtime": "^7.8.4" } }, + "node_modules/regexp.prototype.flags": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.0.tgz", + "integrity": "sha512-0SutC3pNudRKgquxGoRGIz946MZVHqbNfPjBdxeOhBrdgDKlRoXmYLQN9xRbrR09ZXWeGAdPuif7egofn6v5LA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "functions-have-names": "^1.2.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/regexpp": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz", @@ -12800,32 +12496,26 @@ } }, "node_modules/regexpu-core": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-5.0.1.tgz", - "integrity": "sha512-CriEZlrKK9VJw/xQGJpQM5rY88BtuL8DM+AEwvcThHilbxiTAy8vq4iJnd2tqq8wLmjbGZzP7ZcKFjbGkmEFrw==", + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-5.3.2.tgz", + "integrity": "sha512-RAM5FlZz+Lhmo7db9L298p2vHP5ZywrVXmVXpmAD9GuL5MPH6t9ROw1iA/wfHkQ76Qe7AaPF0nGuim96/IrQMQ==", "dev": true, "dependencies": { + "@babel/regjsgen": "^0.8.0", "regenerate": "^1.4.2", - "regenerate-unicode-properties": "^10.0.1", - "regjsgen": "^0.6.0", - "regjsparser": "^0.8.2", + "regenerate-unicode-properties": "^10.1.0", + "regjsparser": "^0.9.1", "unicode-match-property-ecmascript": "^2.0.0", - "unicode-match-property-value-ecmascript": "^2.0.0" + "unicode-match-property-value-ecmascript": "^2.1.0" }, "engines": { "node": ">=4" } }, - "node_modules/regjsgen": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.6.0.tgz", - "integrity": "sha512-ozE883Uigtqj3bx7OhL1KNbCzGyW2NQZPl6Hs09WTvCuZD5sTI4JY58bkbQWa/Y9hxIsvJ3M8Nbf7j54IqeZbA==", - "dev": true - }, "node_modules/regjsparser": { - "version": "0.8.4", - "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.8.4.tgz", - "integrity": "sha512-J3LABycON/VNEu3abOviqGHuB/LOtOQj8SKmfP9anY5GfAVw/SPjwzSjxGjbZXIxbGfqTHtJw58C2Li/WkStmA==", + "version": "0.9.1", + "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.9.1.tgz", + "integrity": "sha512-dQUtn90WanSNl+7mQKcXAgZxvUe7Z0SqXlgzv0za4LwiUhyzBC58yQO3liFoUgu8GiJVInAhJjkj1N0EtQ5nkQ==", "dev": true, "dependencies": { "jsesc": "~0.5.0" @@ -12837,7 +12527,7 @@ "node_modules/regjsparser/node_modules/jsesc": { "version": "0.5.0", "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", - "integrity": "sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0=", + "integrity": "sha512-uZz5UnB7u4T9LvwmFqXii7pZSouaRPorGs5who1Ip7VO0wxanFvBL7GkM6dTHlgX+jhBApRetaWpnDabOeTcnA==", "dev": true, "bin": { "jsesc": "bin/jsesc" @@ -12908,16 +12598,7 @@ "node_modules/require-directory": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", - "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/require-from-string": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", - "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", + "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", "dev": true, "engines": { "node": ">=0.10.0" @@ -12930,12 +12611,12 @@ "dev": true }, "node_modules/resolve": { - "version": "1.22.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.0.tgz", - "integrity": "sha512-Hhtrw0nLeSrFQ7phPp4OOcVjLPIeMnRlr5mcnVuMe7M/7eBn98A3hmFRLoFo3DLZkivSYwhRUJTyPyWAk56WLw==", + "version": "1.22.4", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.4.tgz", + "integrity": "sha512-PXNdCiPqDqeUou+w1C2eTQbNfxKSuMxqTCuvlmmMsk1NWHL5fRrhY6Pl0qEYYc6+QqGClco1Qj8XnjPego4wfg==", "dev": true, "dependencies": { - "is-core-module": "^2.8.1", + "is-core-module": "^2.13.0", "path-parse": "^1.0.7", "supports-preserve-symlinks-flag": "^1.0.0" }, @@ -13011,9 +12692,9 @@ } }, "node_modules/resolve.exports": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/resolve.exports/-/resolve.exports-1.1.0.tgz", - "integrity": "sha512-J1l+Zxxp4XK3LUDZ9m60LRJF/mAe4z6a4xyabPHk7pvK5t35dACV32iIjJDFeWZFfZlO29w6SZ67knR0tHzJtQ==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/resolve.exports/-/resolve.exports-2.0.2.tgz", + "integrity": "sha512-X2UW6Nw3n/aMgDVy+0rSqgHlv39WZAlZrXCdnbyEiKm17DSqHX4MmQMaST3FbeWR5FTuRcUwYAziZajji0Y7mg==", "dev": true, "engines": { "node": ">=10" @@ -13105,6 +12786,30 @@ "tslib": "^2.1.0" } }, + "node_modules/safe-array-concat": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/safe-array-concat/-/safe-array-concat-1.0.0.tgz", + "integrity": "sha512-9dVEFruWIsnie89yym+xWTAYASdpw3CJV7Li/6zBewGf9z2i1j31rP6jnY0pHEO4QZh6N0K11bFjWmdR8UGdPQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.2.0", + "has-symbols": "^1.0.3", + "isarray": "^2.0.5" + }, + "engines": { + "node": ">=0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/safe-array-concat/node_modules/isarray": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", + "dev": true + }, "node_modules/safe-buffer": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", @@ -13117,6 +12822,20 @@ "integrity": "sha1-PnZyPjjf3aE8mx0poeB//uSzC1c=", "dev": true }, + "node_modules/safe-regex-test": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.0.0.tgz", + "integrity": "sha512-JBUUzyOgEwXQY1NuPtvcj/qcBDbDmEvWufhlnXZIm75DEHp+afM1r1ujJpJsV/gSM4t59tpDyPi1sd6ZaPFfsA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.1.3", + "is-regex": "^1.1.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/safer-buffer": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", @@ -13124,15 +12843,15 @@ "dev": true }, "node_modules/saxes": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/saxes/-/saxes-5.0.1.tgz", - "integrity": "sha512-5LBh1Tls8c9xgGjw3QrMwETmTMVk0oFgvrFSvWx62llR2hcEInrKNZ2GZCCuuy2lvWrdl5jhbpeqc5hRYKFOcw==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/saxes/-/saxes-6.0.0.tgz", + "integrity": "sha512-xAg7SOnEhrm5zI3puOOKyy1OMcMlIJZYNJY7xLBwSze0UjhPLnWfj2GF2EpT0jmzaJKIWKHLsaSSajf35bcYnA==", "dev": true, "dependencies": { "xmlchars": "^2.2.0" }, "engines": { - "node": ">=10" + "node": ">=v12.22.7" } }, "node_modules/secure-compare": { @@ -13148,9 +12867,9 @@ "dev": true }, "node_modules/semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true, "bin": { "semver": "bin/semver.js" @@ -13228,54 +12947,6 @@ "integrity": "sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q==", "dev": true }, - "node_modules/sinon": { - "version": "9.2.4", - "resolved": "https://registry.npmjs.org/sinon/-/sinon-9.2.4.tgz", - "integrity": "sha512-zljcULZQsJxVra28qIAL6ow1Z9tpattkCTEJR4RBP3TGc00FcttsP5pK284Nas5WjMZU5Yzy3kAIp3B3KRf5Yg==", - "dev": true, - "dependencies": { - "@sinonjs/commons": "^1.8.1", - "@sinonjs/fake-timers": "^6.0.1", - "@sinonjs/samsam": "^5.3.1", - "diff": "^4.0.2", - "nise": "^4.0.4", - "supports-color": "^7.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/sinon" - } - }, - "node_modules/sinon/node_modules/@sinonjs/fake-timers": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-6.0.1.tgz", - "integrity": "sha512-MZPUxrmFubI36XS1DI3qmI0YdN1gks62JtFZvxR67ljjSNCeK6U08Zx4msEWOXuofgqUt6zPHSi1H9fbjR/NRA==", - "dev": true, - "dependencies": { - "@sinonjs/commons": "^1.7.0" - } - }, - "node_modules/sinon/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/sinon/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/sisteransi": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz", @@ -13288,62 +12959,18 @@ "integrity": "sha512-LzIjEQ0S0DpIgnxMEayM1rq9aGwGRG4OnZhCdjx7glTaJtf4zRfpg87ImfjSJjoW9vKpagd82McDOwbRT5kQKQ==", "dev": true, "engines": { - "node": "*" - } - }, - "node_modules/slash": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", - "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/slice-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz", - "integrity": "sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==", - "dev": true, - "dependencies": { - "ansi-styles": "^4.0.0", - "astral-regex": "^2.0.0", - "is-fullwidth-code-point": "^3.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/slice-ansi/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" + "node": "*" } }, - "node_modules/slice-ansi/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "node_modules/slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", "dev": true, - "dependencies": { - "color-name": "~1.1.4" - }, "engines": { - "node": ">=7.0.0" + "node": ">=8" } }, - "node_modules/slice-ansi/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, "node_modules/source-map": { "version": "0.5.7", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", @@ -13354,9 +12981,9 @@ } }, "node_modules/source-map-support": { - "version": "0.5.21", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", - "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", + "version": "0.5.13", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.13.tgz", + "integrity": "sha512-SHSKFHadjVA5oR4PPqhtAVdcBWwRYVd6g6cAXnIbRiIwc2EhPrTuKUBdSLvlEKyIP3GCf89fltvcZiP9MMFA1w==", "dev": true, "dependencies": { "buffer-from": "^1.0.0", @@ -13404,9 +13031,9 @@ } }, "node_modules/stack-utils": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/stack-utils/-/stack-utils-2.0.5.tgz", - "integrity": "sha512-xrQcmYhOsn/1kX+Vraq+7j4oE2j/6BFscZ0etmYg81xuM8Gq0022Pxb8+IqgOFUIaxHs0KaSb7T1+OegiNrNFA==", + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/stack-utils/-/stack-utils-2.0.6.tgz", + "integrity": "sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ==", "dev": true, "dependencies": { "escape-string-regexp": "^2.0.0" @@ -13542,24 +13169,49 @@ "node": ">=8" } }, + "node_modules/string.prototype.trim": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.7.tgz", + "integrity": "sha512-p6TmeT1T3411M8Cgg9wBTMRtY2q9+PNy9EV1i2lIXUN/btt763oIfxwN3RR8VU6wHX8j/1CFy0L+YuThm6bgOg==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.4", + "es-abstract": "^1.20.4" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/string.prototype.trimend": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.4.tgz", - "integrity": "sha512-y9xCjw1P23Awk8EvTpcyL2NIr1j7wJ39f+k6lvRnSMz+mz9CGz9NYPelDk42kOz6+ql8xjfK8oYzy3jAP5QU5A==", + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.6.tgz", + "integrity": "sha512-JySq+4mrPf9EsDBEDYMOb/lM7XQLulwg5R/m1r0PXEFqrV0qHvl58sdTilSXtKOflCsK2E8jxf+GKC0T07RWwQ==", "dev": true, "dependencies": { "call-bind": "^1.0.2", - "define-properties": "^1.1.3" + "define-properties": "^1.1.4", + "es-abstract": "^1.20.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/string.prototype.trimstart": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.4.tgz", - "integrity": "sha512-jh6e984OBfvxS50tdY2nRZnoC5/mLFKOREQfw8t5yytkoUsJRNxvI/E39qu1sD0OtWI3OC0XgKSmcWwziwYuZw==", + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.6.tgz", + "integrity": "sha512-omqjMDaY92pbn5HOX7f9IccLA+U1tA9GvtU4JrodiXFfYB7jPzzHpRzpglLAjtUV6bB557zwClJezTqnAiYnQA==", "dev": true, "dependencies": { "call-bind": "^1.0.2", - "define-properties": "^1.1.3" + "define-properties": "^1.1.4", + "es-abstract": "^1.20.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/strip-ansi": { @@ -13575,12 +13227,12 @@ } }, "node_modules/strip-bom": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", - "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz", + "integrity": "sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==", "dev": true, "engines": { - "node": ">=4" + "node": ">=8" } }, "node_modules/strip-final-newline": { @@ -13599,6 +13251,9 @@ "dev": true, "engines": { "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/subarg": { @@ -13622,40 +13277,6 @@ "node": ">=4" } }, - "node_modules/supports-hyperlinks": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/supports-hyperlinks/-/supports-hyperlinks-2.2.0.tgz", - "integrity": "sha512-6sXEzV5+I5j8Bmq9/vUphGRM/RJNT9SCURJLjwfOg51heRtguGWDzcaBlgAzKhQa0EVNpPEKzQuBwZ8S8WaCeQ==", - "dev": true, - "dependencies": { - "has-flag": "^4.0.0", - "supports-color": "^7.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/supports-hyperlinks/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/supports-hyperlinks/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/supports-preserve-symlinks-flag": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", @@ -13683,40 +13304,6 @@ "acorn-node": "^1.2.0" } }, - "node_modules/table": { - "version": "6.6.0", - "resolved": "https://registry.npmjs.org/table/-/table-6.6.0.tgz", - "integrity": "sha512-iZMtp5tUvcnAdtHpZTWLPF0M7AgiQsURR2DwmxnJwSy8I3+cY+ozzVvYha3BOLG2TB+L0CqjIz+91htuj6yCXg==", - "dev": true, - "dependencies": { - "ajv": "^8.0.1", - "lodash.clonedeep": "^4.5.0", - "lodash.flatten": "^4.4.0", - "lodash.truncate": "^4.4.2", - "slice-ansi": "^4.0.0", - "string-width": "^4.2.0", - "strip-ansi": "^6.0.0" - }, - "engines": { - "node": ">=10.0.0" - } - }, - "node_modules/terminal-link": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/terminal-link/-/terminal-link-2.1.1.tgz", - "integrity": "sha512-un0FmiRUQNr5PJqy9kP7c40F5BOfpGlYTrxonDChEZB7pzZxRNp/bt+ymiy9/npwXya9KH99nJ/GXFIiUkYGFQ==", - "dev": true, - "dependencies": { - "ansi-escapes": "^4.2.1", - "supports-hyperlinks": "^2.0.0" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/test-exclude": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz", @@ -13776,12 +13363,6 @@ "tiny-worker": ">= 2" } }, - "node_modules/throat": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/throat/-/throat-6.0.1.tgz", - "integrity": "sha512-8hmiGIJMDlwjg7dlJ4yKGLK8EsYqKgPWbG3b4wjJddKNwc7N7Dpn08Df4szr/sZdMVeOstrdYSsqzX6BYbcB+w==", - "dev": true - }, "node_modules/through": { "version": "2.3.8", "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", @@ -13906,39 +13487,50 @@ } }, "node_modules/tough-cookie": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.0.0.tgz", - "integrity": "sha512-tHdtEpQCMrc1YLrMaqXXcj6AxhYi/xgit6mZu1+EDWUn+qhUf8wMQoFIy9NXuq23zAwtcB0t/MjACGR18pcRbg==", + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.1.3.tgz", + "integrity": "sha512-aX/y5pVRkfRnfmuX+OdbSdXvPe6ieKX/G2s7e98f4poJHnqH3281gDPm/metm6E/WRamfx7WC4HUqkWHfQHprw==", "dev": true, "dependencies": { "psl": "^1.1.33", "punycode": "^2.1.1", - "universalify": "^0.1.2" + "universalify": "^0.2.0", + "url-parse": "^1.5.3" }, "engines": { "node": ">=6" } }, + "node_modules/tough-cookie/node_modules/universalify": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.2.0.tgz", + "integrity": "sha512-CJ1QgKmNg3CwvAv/kOFmtnEN05f0D/cn9QntgNOQlQF9dgvVTHj3t+8JPdjqawCHk7V/KA+fbUqzZ9XWhcqPUg==", + "dev": true, + "engines": { + "node": ">= 4.0.0" + } + }, "node_modules/tr46": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-2.1.0.tgz", - "integrity": "sha512-15Ih7phfcdP5YxqiB+iDtLoaTz4Nd35+IiAv0kQ5FNKHzXgdWqPoTIqEDDJmXceQt4JZk6lVPT8lnDlPpGDppw==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-3.0.0.tgz", + "integrity": "sha512-l7FvfAHlcmulp8kr+flpQZmVwtu7nfRV7NZujtN0OqES8EL4O4e0qqzL0DC5gAvx/ZC/9lk6rhcUwYvkBnBnYA==", "dev": true, "dependencies": { "punycode": "^2.1.1" }, "engines": { - "node": ">=8" + "node": ">=12" } }, "node_modules/ts-to-zod": { - "version": "1.13.1", - "resolved": "https://registry.npmjs.org/ts-to-zod/-/ts-to-zod-1.13.1.tgz", - "integrity": "sha512-C8eD8HbNHysoFPJnVu3ix6S9lugEQ5IPOGx9a4CiY5q4jDZGc+Pgi96fyPSTSmEpHYni6EFN/uzHmIvpxeFFLA==", + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/ts-to-zod/-/ts-to-zod-3.1.3.tgz", + "integrity": "sha512-zsKldi4VTcjsE8hkxLkjT4OZkSK7vmFeV/rZ2SAR0FlntesMSJwfIbQAAe7vuQ4DBt3VbaVB0M5FBglLNbcmLQ==", "dev": true, "dependencies": { "@oclif/command": "^1.8.6", "@oclif/config": "^1.17.1", + "@oclif/errors": "^1.3", "@oclif/plugin-help": "^3.2.7", "@typescript/vfs": "^1.3.5", "async": "^3.2.0", @@ -13974,22 +13566,35 @@ "node": ">=10.13.0" } }, + "node_modules/ts-to-zod/node_modules/typescript": { + "version": "4.9.5", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", + "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==", + "dev": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=4.2.0" + } + }, "node_modules/tsconfig-paths": { - "version": "3.14.1", - "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.14.1.tgz", - "integrity": "sha512-fxDhWnFSLt3VuTwtvJt5fpwxBHg5AdKWMsgcPOOIilyjymcYVZoCQF8fvFRezCNfblEXmi+PcM1eYHeOAgXCOQ==", + "version": "3.14.2", + "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.14.2.tgz", + "integrity": "sha512-o/9iXgCYc5L/JxCHPe3Hvh8Q/2xm5Z+p18PESBU6Ff33695QnCHBEjcytY2q19ua7Mbl/DavtBOLq+oG0RCL+g==", "dev": true, "dependencies": { "@types/json5": "^0.0.29", - "json5": "^1.0.1", + "json5": "^1.0.2", "minimist": "^1.2.6", "strip-bom": "^3.0.0" } }, "node_modules/tsconfig-paths/node_modules/json5": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", - "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.2.tgz", + "integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==", "dev": true, "dependencies": { "minimist": "^1.2.0" @@ -13998,6 +13603,15 @@ "json5": "lib/cli.js" } }, + "node_modules/tsconfig-paths/node_modules/strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==", + "dev": true, + "engines": { + "node": ">=4" + } + }, "node_modules/tslib": { "version": "2.4.0", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.0.tgz", @@ -14088,32 +13702,88 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/typed-array-buffer": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/typed-array-buffer/-/typed-array-buffer-1.0.0.tgz", + "integrity": "sha512-Y8KTSIglk9OZEr8zywiIHG/kmQ7KWyjseXs1CbSo8vC42w7hg2HgYTxSWwP0+is7bWDc1H+Fo026CpHFwm8tkw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.2.1", + "is-typed-array": "^1.1.10" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/typed-array-byte-length": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/typed-array-byte-length/-/typed-array-byte-length-1.0.0.tgz", + "integrity": "sha512-Or/+kvLxNpeQ9DtSydonMxCx+9ZXOswtwJn17SNLvhptaXYDJvkFFP5zbfU/uLmvnBJlI4yrnXRxpdWH/M5tNA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "for-each": "^0.3.3", + "has-proto": "^1.0.1", + "is-typed-array": "^1.1.10" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/typed-array-byte-offset": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/typed-array-byte-offset/-/typed-array-byte-offset-1.0.0.tgz", + "integrity": "sha512-RD97prjEt9EL8YgAgpOkf3O4IF9lhJFr9g0htQkm0rchFp/Vx7LW5Q8fSXXub7BXAODyUQohRMyOc3faCPd0hg==", + "dev": true, + "dependencies": { + "available-typed-arrays": "^1.0.5", + "call-bind": "^1.0.2", + "for-each": "^0.3.3", + "has-proto": "^1.0.1", + "is-typed-array": "^1.1.10" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/typed-array-length": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/typed-array-length/-/typed-array-length-1.0.4.tgz", + "integrity": "sha512-KjZypGq+I/H7HI5HlOoGHkWUUGq+Q0TPhQurLbyrVrvnKTBgzLhIJ7j6J/XTQOi0d1RjyZ0wdas8bKs2p0x3Ng==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "for-each": "^0.3.3", + "is-typed-array": "^1.1.9" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/typedarray": { "version": "0.0.6", "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=", "dev": true }, - "node_modules/typedarray-to-buffer": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz", - "integrity": "sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==", - "dev": true, - "dependencies": { - "is-typedarray": "^1.0.0" - } - }, "node_modules/typescript": { - "version": "4.7.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.7.2.tgz", - "integrity": "sha512-Mamb1iX2FDUpcTRzltPxgWMKy3fhg0TN378ylbktPGPK/99KbDtMQ4W1hwgsbPAsG3a0xKa1vmw4VKZQbkvz5A==", + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.2.2.tgz", + "integrity": "sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==", "dev": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" }, "engines": { - "node": ">=4.2.0" + "node": ">=14.17" } }, "node_modules/uc.micro": { @@ -14132,15 +13802,18 @@ } }, "node_modules/unbox-primitive": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.1.tgz", - "integrity": "sha512-tZU/3NqK3dA5gpE1KtyiJUrEB0lxnGkMFHptJ7q6ewdZ8s12QrODwNbhIJStmJkd1QDXa1NRA8aF2A1zk/Ypyw==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.2.tgz", + "integrity": "sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw==", "dev": true, "dependencies": { - "function-bind": "^1.1.1", - "has-bigints": "^1.0.1", - "has-symbols": "^1.0.2", + "call-bind": "^1.0.2", + "has-bigints": "^1.0.2", + "has-symbols": "^1.0.3", "which-boxed-primitive": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/unc-path-regex": { @@ -14204,18 +13877,18 @@ } }, "node_modules/unicode-match-property-value-ecmascript": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-2.0.0.tgz", - "integrity": "sha512-7Yhkc0Ye+t4PNYzOGKedDhXbYIBe1XEQYQxOPyhcXNMJ0WCABqqj6ckydd6pWRZTHV4GuCPKdBAUiMc60tsKVw==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-2.1.0.tgz", + "integrity": "sha512-qxkjQt6qjg/mYscYMC0XKRn3Rh0wFPlfxB0xkt9CfyTvpX1Ra0+rAmdX2QyAobptSEvuy4RtpPRui6XkV+8wjA==", "dev": true, "engines": { "node": ">=4" } }, "node_modules/unicode-property-aliases-ecmascript": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-2.0.0.tgz", - "integrity": "sha512-5Zfuy9q/DFr4tfO7ZPeVXb1aPoeQSdeFMLpYuFebehDAhbuevLs5yxSZmIFN1tP5F9Wl4IpJrYojg85/zgyZHQ==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-2.1.0.tgz", + "integrity": "sha512-6t3foTQI9qne+OZoVQB/8x8rk2k1eVy1gRXhV3oFQ5T6R1dqQ1xtin3XqSlx3+ATBkliTaR/hHyJBm+LVPNM8w==", "dev": true, "engines": { "node": ">=4" @@ -14242,6 +13915,36 @@ "node": ">= 4.0.0" } }, + "node_modules/update-browserslist-db": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.11.tgz", + "integrity": "sha512-dCwEFf0/oT85M1fHBg4F0jtLwJrutGoHSQXCh7u4o2t1drG+c0a9Flnqww6XUKSfQMPpJBRjU8d4RXB09qtvaA==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "dependencies": { + "escalade": "^3.1.1", + "picocolors": "^1.0.0" + }, + "bin": { + "update-browserslist-db": "cli.js" + }, + "peerDependencies": { + "browserslist": ">= 4.21.0" + } + }, "node_modules/uri-js": { "version": "4.4.1", "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", @@ -14267,6 +13970,16 @@ "integrity": "sha512-jk1+QP6ZJqyOiuEI9AEWQfju/nB2Pw466kbA0LEZljHwKeMgd9WrAEgEGxjPDD2+TNbbb37rTyhEfrCXfuKXnA==", "dev": true }, + "node_modules/url-parse": { + "version": "1.5.10", + "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.10.tgz", + "integrity": "sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ==", + "dev": true, + "dependencies": { + "querystringify": "^2.1.1", + "requires-port": "^1.0.0" + } + }, "node_modules/url/node_modules/punycode": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz", @@ -14293,34 +14006,25 @@ "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", "dev": true }, - "node_modules/v8-compile-cache": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz", - "integrity": "sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==", - "dev": true - }, "node_modules/v8-to-istanbul": { - "version": "8.1.1", - "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-8.1.1.tgz", - "integrity": "sha512-FGtKtv3xIpR6BYhvgH8MI/y78oT7d8Au3ww4QIxymrCtZEh5b8gCw2siywE+puhEmuWKDtmfrvF5UlB298ut3w==", + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-9.1.0.tgz", + "integrity": "sha512-6z3GW9x8G1gd+JIIgQQQxXuiJtCXeAjp6RaPEPLv62mH3iPHPxV6W3robxtCzNErRo6ZwTmzWhsbNvjyEBKzKA==", "dev": true, "dependencies": { + "@jridgewell/trace-mapping": "^0.3.12", "@types/istanbul-lib-coverage": "^2.0.1", - "convert-source-map": "^1.6.0", - "source-map": "^0.7.3" + "convert-source-map": "^1.6.0" }, "engines": { "node": ">=10.12.0" } }, - "node_modules/v8-to-istanbul/node_modules/source-map": { - "version": "0.7.3", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz", - "integrity": "sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ==", - "dev": true, - "engines": { - "node": ">= 8" - } + "node_modules/v8-to-istanbul/node_modules/convert-source-map": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.9.0.tgz", + "integrity": "sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==", + "dev": true }, "node_modules/v8flags": { "version": "3.2.0", @@ -14354,25 +14058,16 @@ "integrity": "sha512-2ham8XPWTONajOR0ohOKOHXkm3+gaBmGut3SRuu75xLd/RRaY6vqgh8NBYYk7+RW3u5AtzPQZG8F10LHkl0lAQ==", "dev": true }, - "node_modules/w3c-hr-time": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/w3c-hr-time/-/w3c-hr-time-1.0.2.tgz", - "integrity": "sha512-z8P5DvDNjKDoFIHK7q8r8lackT6l+jo/Ye3HOle7l9nICP9lf1Ci25fy9vHd0JOWewkIFzXIEig3TdKT7JQ5fQ==", - "dev": true, - "dependencies": { - "browser-process-hrtime": "^1.0.0" - } - }, "node_modules/w3c-xmlserializer": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/w3c-xmlserializer/-/w3c-xmlserializer-2.0.0.tgz", - "integrity": "sha512-4tzD0mF8iSiMiNs30BiLO3EpfGLZUT2MSX/G+o7ZywDzliWQ3OPtTZ0PTC3B3ca1UAf4cJMHB+2Bf56EriJuRA==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/w3c-xmlserializer/-/w3c-xmlserializer-4.0.0.tgz", + "integrity": "sha512-d+BFHzbiCx6zGfz0HyQ6Rg69w9k19nviJspaj4yNscGjrHu94sVP+aRm75yEbCh+r2/yR+7q6hux9LVtbuTGBw==", "dev": true, "dependencies": { - "xml-name-validator": "^3.0.0" + "xml-name-validator": "^4.0.0" }, "engines": { - "node": ">=10" + "node": ">=14" } }, "node_modules/walker": { @@ -14415,12 +14110,12 @@ } }, "node_modules/webidl-conversions": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-6.1.0.tgz", - "integrity": "sha512-qBIvFLGiBpLjfwmYAaHPXsn+ho5xZnGvyGvsarywGNc8VyQJUMHJ8OBKGGrPER0okBeMDaan4mNBlgBROxuI8w==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-7.0.0.tgz", + "integrity": "sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==", "dev": true, "engines": { - "node": ">=10.4" + "node": ">=12" } }, "node_modules/websocket-driver": { @@ -14447,32 +14142,49 @@ } }, "node_modules/whatwg-encoding": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-1.0.5.tgz", - "integrity": "sha512-b5lim54JOPN9HtzvK9HFXvBma/rnfFeqsic0hSpjtDbVxR3dJKLc+KB4V6GgiGOvl7CY/KNh8rxSo9DKQrnUEw==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-2.0.0.tgz", + "integrity": "sha512-p41ogyeMUrw3jWclHWTQg1k05DSVXPLcVxRTYsXUk+ZooOCZLcoYgPZ/HL/D/N+uQPOtcp1me1WhBEaX02mhWg==", + "dev": true, + "dependencies": { + "iconv-lite": "0.6.3" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/whatwg-encoding/node_modules/iconv-lite": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", + "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", "dev": true, "dependencies": { - "iconv-lite": "0.4.24" + "safer-buffer": ">= 2.1.2 < 3.0.0" + }, + "engines": { + "node": ">=0.10.0" } }, "node_modules/whatwg-mimetype": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-2.3.0.tgz", - "integrity": "sha512-M4yMwr6mAnQz76TbJm914+gPpB/nCwvZbJU28cUD6dR004SAxDLOOSUaB1JDRqLtaOV/vi0IC5lEAGFgrjGv/g==", - "dev": true + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-3.0.0.tgz", + "integrity": "sha512-nt+N2dzIutVRxARx1nghPKGv1xHikU7HKdfafKkLNLindmPU/ch3U31NOCGGA/dmPcmb1VlofO0vnKAcsm0o/Q==", + "dev": true, + "engines": { + "node": ">=12" + } }, "node_modules/whatwg-url": { - "version": "8.7.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-8.7.0.tgz", - "integrity": "sha512-gAojqb/m9Q8a5IV96E3fHJM70AzCkgt4uXYX2O7EmuyOnLrViCQlsEBmF9UQIu3/aeAIp2U17rtbpZWNntQqdg==", + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-11.0.0.tgz", + "integrity": "sha512-RKT8HExMpoYx4igMiVMY83lN6UeITKJlBQ+vR/8ZJ8OCdSiN3RwCq+9gH0+Xzj0+5IrM6i4j/6LuvzbZIQgEcQ==", "dev": true, "dependencies": { - "lodash": "^4.7.0", - "tr46": "^2.1.0", - "webidl-conversions": "^6.1.0" + "tr46": "^3.0.0", + "webidl-conversions": "^7.0.0" }, "engines": { - "node": ">=10" + "node": ">=12" } }, "node_modules/which": { @@ -14501,24 +14213,28 @@ "is-number-object": "^1.0.4", "is-string": "^1.0.5", "is-symbol": "^1.0.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/which-typed-array": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.4.tgz", - "integrity": "sha512-49E0SpUe90cjpoc7BOJwyPHRqSAd12c10Qm2amdEZrJPCY2NDxaW01zHITrem+rnETY3dwrbH3UUrUwagfCYDA==", + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.11.tgz", + "integrity": "sha512-qe9UWWpkeG5yzZ0tNYxDmd7vo58HDBc39mZ0xWWpolAGADdFOzkfamWLDxkOWcvHQKVmdTyQdLD4NOfjLWTKew==", "dev": true, "dependencies": { - "available-typed-arrays": "^1.0.2", - "call-bind": "^1.0.0", - "es-abstract": "^1.18.0-next.1", - "foreach": "^2.0.5", - "function-bind": "^1.1.1", - "has-symbols": "^1.0.1", - "is-typed-array": "^1.1.3" + "available-typed-arrays": "^1.0.5", + "call-bind": "^1.0.2", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-tostringtag": "^1.0.0" }, "engines": { "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/widest-line": { @@ -14533,15 +14249,6 @@ "node": ">=8" } }, - "node_modules/word-wrap": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", - "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/wrap-ansi": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", @@ -14599,28 +14306,35 @@ "dev": true }, "node_modules/write-file-atomic": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-3.0.3.tgz", - "integrity": "sha512-AvHcyZ5JnSfq3ioSyjrBkH9yW4m7Ayk8/9My/DD9onKeu/94fwrMocemO2QAJFAlnnDN+ZDS+ZjAR5ua1/PV/Q==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-4.0.2.tgz", + "integrity": "sha512-7KxauUdBmSdWnmpaGFg+ppNjKF8uNLry8LyzjauQDOVONfFLNKrKvQOxZ/VuTIcS/gge/YNahf5RIIQWTSarlg==", "dev": true, "dependencies": { "imurmurhash": "^0.1.4", - "is-typedarray": "^1.0.0", - "signal-exit": "^3.0.2", - "typedarray-to-buffer": "^3.1.5" + "signal-exit": "^3.0.7" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, + "node_modules/write-file-atomic/node_modules/signal-exit": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", + "dev": true + }, "node_modules/ws": { - "version": "7.5.7", - "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.7.tgz", - "integrity": "sha512-KMvVuFzpKBuiIXW3E4u3mySRO2/mCHSyZDJQM5NQ9Q9KHWHWh0NHgfbRMLLrceUK5qAL4ytALJbpRMjixFZh8A==", + "version": "8.13.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.13.0.tgz", + "integrity": "sha512-x9vcZYTrFPC7aSIbj7sRCYo7L/Xb8Iy+pW0ng0wt2vCJv7M9HOMy0UoN3rr+IFC7hb7vXoqS+P9ktyLLLhO+LA==", "dev": true, "engines": { - "node": ">=8.3.0" + "node": ">=10.0.0" }, "peerDependencies": { "bufferutil": "^4.0.1", - "utf-8-validate": "^5.0.2" + "utf-8-validate": ">=5.0.2" }, "peerDependenciesMeta": { "bufferutil": { @@ -14632,10 +14346,13 @@ } }, "node_modules/xml-name-validator": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-3.0.0.tgz", - "integrity": "sha512-A5CUptxDsvxKJEU3yO6DuWBSJz/qizqzJKOMIfUJHETbBw/sFaDxgd6fxm1ewUaM0jZ444Fc5vC5ROYurg/4Pw==", - "dev": true + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-4.0.0.tgz", + "integrity": "sha512-ICP2e+jsHvAj2E2lIHxa5tjXRlKDJo4IdvPvCXbXQGdzSfmSpNVyIKMvoZHjDY9DP0zV17iI85o90vRFXNccRw==", + "dev": true, + "engines": { + "node": ">=12" + } }, "node_modules/xmlbuilder": { "version": "15.0.0", @@ -14677,36 +14394,48 @@ "dev": true }, "node_modules/yargs": { - "version": "16.2.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", - "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", + "version": "17.7.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", + "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", "dev": true, "dependencies": { - "cliui": "^7.0.2", + "cliui": "^8.0.1", "escalade": "^3.1.1", "get-caller-file": "^2.0.5", "require-directory": "^2.1.1", - "string-width": "^4.2.0", + "string-width": "^4.2.3", "y18n": "^5.0.5", - "yargs-parser": "^20.2.2" + "yargs-parser": "^21.1.1" }, "engines": { - "node": ">=10" + "node": ">=12" } }, "node_modules/yargs-parser": { - "version": "20.2.9", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", - "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "dev": true, + "engines": { + "node": ">=12" + } + }, + "node_modules/yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", "dev": true, "engines": { "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/zod": { - "version": "3.16.0", - "resolved": "https://registry.npmjs.org/zod/-/zod-3.16.0.tgz", - "integrity": "sha512-szrIkryADbTM+xBt2a1KoS2CJQXec4f9xG78bj5MJeEH/XqmmHpnO+fG3IE115AKBJak+2HrbxLZkc9mhdbDKA==", + "version": "3.22.2", + "resolved": "https://registry.npmjs.org/zod/-/zod-3.22.2.tgz", + "integrity": "sha512-wvWkphh5WQsJbVk1tbx1l1Ly4yg+XecD+Mq280uBGt9wa5BKSWf4Mhp6GmrkPixhMxmabYY7RbzlwVP32pbGCg==", "dev": true, "funding": { "url": "https://github.com/sponsors/colinhacks" @@ -14714,62 +14443,70 @@ } }, "dependencies": { + "@aashutoshrathi/word-wrap": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/@aashutoshrathi/word-wrap/-/word-wrap-1.2.6.tgz", + "integrity": "sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA==", + "dev": true + }, "@ampproject/remapping": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.1.2.tgz", - "integrity": "sha512-hoyByceqwKirw7w3Z7gnIIZC3Wx3J484Y3L/cMpXFbr7d9ZQj2mODrirNzcJa+SM3UlpWXYvKV4RlRpFXlWgXg==", + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.2.1.tgz", + "integrity": "sha512-lFMjJTrFL3j7L9yBxwYfCq2k6qqwHyzuUl/XBnif78PWTJYyL/dfowQHWE3sp6U6ZzqWiiIZnpTMO96zhkjwtg==", "dev": true, "requires": { - "@jridgewell/trace-mapping": "^0.3.0" + "@jridgewell/gen-mapping": "^0.3.0", + "@jridgewell/trace-mapping": "^0.3.9" } }, "@babel/code-frame": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.16.7.tgz", - "integrity": "sha512-iAXqUn8IIeBTNd72xsFlgaXHkMBMt6y4HJp1tIaK465CWLT/fG1aqB7ykr95gHHmlBdGbFeWWfyB4NJJ0nmeIg==", + "version": "7.22.13", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.22.13.tgz", + "integrity": "sha512-XktuhWlJ5g+3TJXc5upd9Ks1HutSArik6jf2eAjYFyIOf4ej3RN+184cZbzDvbPnuTJIUhPKKJE3cIsYTiAT3w==", "dev": true, "requires": { - "@babel/highlight": "^7.16.7" + "@babel/highlight": "^7.22.13", + "chalk": "^2.4.2" } }, "@babel/compat-data": { - "version": "7.17.7", - "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.17.7.tgz", - "integrity": "sha512-p8pdE6j0a29TNGebNm7NzYZWB3xVZJBZ7XGs42uAKzQo8VQ3F0By/cQCtUEABwIqw5zo6WA4NbmxsfzADzMKnQ==", + "version": "7.22.9", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.22.9.tgz", + "integrity": "sha512-5UamI7xkUcJ3i9qVDS+KFDEK8/7oJ55/sJMB1Ge7IEapr7KfdfV/HErR+koZwOfd+SgtFKOKRhRakdg++DcJpQ==", "dev": true }, "@babel/core": { - "version": "7.17.8", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.17.8.tgz", - "integrity": "sha512-OdQDV/7cRBtJHLSOBqqbYNkOcydOgnX59TZx4puf41fzcVtN3e/4yqY8lMQsK+5X2lJtAdmA+6OHqsj1hBJ4IQ==", - "dev": true, - "requires": { - "@ampproject/remapping": "^2.1.0", - "@babel/code-frame": "^7.16.7", - "@babel/generator": "^7.17.7", - "@babel/helper-compilation-targets": "^7.17.7", - "@babel/helper-module-transforms": "^7.17.7", - "@babel/helpers": "^7.17.8", - "@babel/parser": "^7.17.8", - "@babel/template": "^7.16.7", - "@babel/traverse": "^7.17.3", - "@babel/types": "^7.17.0", - "convert-source-map": "^1.7.0", + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.23.0.tgz", + "integrity": "sha512-97z/ju/Jy1rZmDxybphrBuI+jtJjFVoz7Mr9yUQVVVi+DNZE333uFQeMOqcCIy1x3WYBIbWftUSLmbNXNT7qFQ==", + "dev": true, + "requires": { + "@ampproject/remapping": "^2.2.0", + "@babel/code-frame": "^7.22.13", + "@babel/generator": "^7.23.0", + "@babel/helper-compilation-targets": "^7.22.15", + "@babel/helper-module-transforms": "^7.23.0", + "@babel/helpers": "^7.23.0", + "@babel/parser": "^7.23.0", + "@babel/template": "^7.22.15", + "@babel/traverse": "^7.23.0", + "@babel/types": "^7.23.0", + "convert-source-map": "^2.0.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", - "json5": "^2.1.2", - "semver": "^6.3.0" + "json5": "^2.2.3", + "semver": "^6.3.1" } }, "@babel/eslint-parser": { - "version": "7.18.2", - "resolved": "https://registry.npmjs.org/@babel/eslint-parser/-/eslint-parser-7.18.2.tgz", - "integrity": "sha512-oFQYkE8SuH14+uR51JVAmdqwKYXGRjEXx7s+WiagVjqQ+HPE+nnwyF2qlVG8evUsUHmPcA+6YXMEDbIhEyQc5A==", + "version": "7.22.15", + "resolved": "https://registry.npmjs.org/@babel/eslint-parser/-/eslint-parser-7.22.15.tgz", + "integrity": "sha512-yc8OOBIQk1EcRrpizuARSQS0TWAcOMpEJ1aafhNznaeYkeL+OhqnDObGFylB8ka8VFF/sZc+S4RzHyO+3LjQxg==", "dev": true, "requires": { - "eslint-scope": "^5.1.1", + "@nicolo-ribaudo/eslint-scope-5-internals": "5.1.1-v1", "eslint-visitor-keys": "^2.1.0", - "semver": "^6.3.0" + "semver": "^6.3.1" }, "dependencies": { "eslint-visitor-keys": { @@ -14781,464 +14518,309 @@ } }, "@babel/generator": { - "version": "7.17.7", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.17.7.tgz", - "integrity": "sha512-oLcVCTeIFadUoArDTwpluncplrYBmTCCZZgXCbgNGvOBBiSDDK3eWO4b/+eOTli5tKv1lg+a5/NAXg+nTcei1w==", + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.23.0.tgz", + "integrity": "sha512-lN85QRR+5IbYrMWM6Y4pE/noaQtg4pNiqeNGX60eqOfo6gtEj6uw/JagelB8vVztSd7R6M5n1+PQkDbHbBRU4g==", "dev": true, "requires": { - "@babel/types": "^7.17.0", - "jsesc": "^2.5.1", - "source-map": "^0.5.0" + "@babel/types": "^7.23.0", + "@jridgewell/gen-mapping": "^0.3.2", + "@jridgewell/trace-mapping": "^0.3.17", + "jsesc": "^2.5.1" } }, "@babel/helper-annotate-as-pure": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.16.7.tgz", - "integrity": "sha512-s6t2w/IPQVTAET1HitoowRGXooX8mCgtuP5195wD/QJPV6wYjpujCGF7JuMODVX2ZAJOf1GT6DT9MHEZvLOFSw==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.22.5.tgz", + "integrity": "sha512-LvBTxu8bQSQkcyKOU+a1btnNFQ1dMAd0R6PyW3arXes06F6QLWLIrd681bxRPIXlrMGR3XYnW9JyML7dP3qgxg==", "dev": true, "requires": { - "@babel/types": "^7.16.7" + "@babel/types": "^7.22.5" } }, "@babel/helper-builder-binary-assignment-operator-visitor": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.16.7.tgz", - "integrity": "sha512-C6FdbRaxYjwVu/geKW4ZeQ0Q31AftgRcdSnZ5/jsH6BzCJbtvXvhpfkbkThYSuutZA7nCXpPR6AD9zd1dprMkA==", + "version": "7.22.10", + "resolved": "https://registry.npmjs.org/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.22.10.tgz", + "integrity": "sha512-Av0qubwDQxC56DoUReVDeLfMEjYYSN1nZrTUrWkXd7hpU73ymRANkbuDm3yni9npkn+RXy9nNbEJZEzXr7xrfQ==", "dev": true, "requires": { - "@babel/helper-explode-assignable-expression": "^7.16.7", - "@babel/types": "^7.16.7" + "@babel/types": "^7.22.10" } }, "@babel/helper-compilation-targets": { - "version": "7.17.7", - "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.17.7.tgz", - "integrity": "sha512-UFzlz2jjd8kroj0hmCFV5zr+tQPi1dpC2cRsDV/3IEW8bJfCPrPpmcSN6ZS8RqIq4LXcmpipCQFPddyFA5Yc7w==", + "version": "7.22.15", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.22.15.tgz", + "integrity": "sha512-y6EEzULok0Qvz8yyLkCvVX+02ic+By2UdOhylwUOvOn9dvYc9mKICJuuU1n1XBI02YWsNsnrY1kc6DVbjcXbtw==", "dev": true, "requires": { - "@babel/compat-data": "^7.17.7", - "@babel/helper-validator-option": "^7.16.7", - "browserslist": "^4.17.5", - "semver": "^6.3.0" + "@babel/compat-data": "^7.22.9", + "@babel/helper-validator-option": "^7.22.15", + "browserslist": "^4.21.9", + "lru-cache": "^5.1.1", + "semver": "^6.3.1" + }, + "dependencies": { + "lru-cache": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", + "dev": true, + "requires": { + "yallist": "^3.0.2" + } + }, + "yallist": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", + "dev": true + } } }, "@babel/helper-create-class-features-plugin": { - "version": "7.17.6", - "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.17.6.tgz", - "integrity": "sha512-SogLLSxXm2OkBbSsHZMM4tUi8fUzjs63AT/d0YQIzr6GSd8Hxsbk2KYDX0k0DweAzGMj/YWeiCsorIdtdcW8Eg==", + "version": "7.22.15", + "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.22.15.tgz", + "integrity": "sha512-jKkwA59IXcvSaiK2UN45kKwSC9o+KuoXsBDvHvU/7BecYIp8GQ2UwrVvFgJASUT+hBnwJx6MhvMCuMzwZZ7jlg==", "dev": true, "requires": { - "@babel/helper-annotate-as-pure": "^7.16.7", - "@babel/helper-environment-visitor": "^7.16.7", - "@babel/helper-function-name": "^7.16.7", - "@babel/helper-member-expression-to-functions": "^7.16.7", - "@babel/helper-optimise-call-expression": "^7.16.7", - "@babel/helper-replace-supers": "^7.16.7", - "@babel/helper-split-export-declaration": "^7.16.7" + "@babel/helper-annotate-as-pure": "^7.22.5", + "@babel/helper-environment-visitor": "^7.22.5", + "@babel/helper-function-name": "^7.22.5", + "@babel/helper-member-expression-to-functions": "^7.22.15", + "@babel/helper-optimise-call-expression": "^7.22.5", + "@babel/helper-replace-supers": "^7.22.9", + "@babel/helper-skip-transparent-expression-wrappers": "^7.22.5", + "@babel/helper-split-export-declaration": "^7.22.6", + "semver": "^6.3.1" } }, "@babel/helper-create-regexp-features-plugin": { - "version": "7.17.0", - "resolved": "https://registry.npmjs.org/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.17.0.tgz", - "integrity": "sha512-awO2So99wG6KnlE+TPs6rn83gCz5WlEePJDTnLEqbchMVrBeAujURVphRdigsk094VhvZehFoNOihSlcBjwsXA==", + "version": "7.22.9", + "resolved": "https://registry.npmjs.org/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.22.9.tgz", + "integrity": "sha512-+svjVa/tFwsNSG4NEy1h85+HQ5imbT92Q5/bgtS7P0GTQlP8WuFdqsiABmQouhiFGyV66oGxZFpeYHza1rNsKw==", "dev": true, "requires": { - "@babel/helper-annotate-as-pure": "^7.16.7", - "regexpu-core": "^5.0.1" + "@babel/helper-annotate-as-pure": "^7.22.5", + "regexpu-core": "^5.3.1", + "semver": "^6.3.1" } }, "@babel/helper-define-polyfill-provider": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.3.1.tgz", - "integrity": "sha512-J9hGMpJQmtWmj46B3kBHmL38UhJGhYX7eqkcq+2gsstyYt341HmPeWspihX43yVRA0mS+8GGk2Gckc7bY/HCmA==", + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.4.2.tgz", + "integrity": "sha512-k0qnnOqHn5dK9pZpfD5XXZ9SojAITdCKRn2Lp6rnDGzIbaP0rHyMPk/4wsSxVBVz4RfN0q6VpXWP2pDGIoQ7hw==", "dev": true, "requires": { - "@babel/helper-compilation-targets": "^7.13.0", - "@babel/helper-module-imports": "^7.12.13", - "@babel/helper-plugin-utils": "^7.13.0", - "@babel/traverse": "^7.13.0", + "@babel/helper-compilation-targets": "^7.22.6", + "@babel/helper-plugin-utils": "^7.22.5", "debug": "^4.1.1", "lodash.debounce": "^4.0.8", - "resolve": "^1.14.2", - "semver": "^6.1.2" + "resolve": "^1.14.2" } }, "@babel/helper-environment-visitor": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.16.7.tgz", - "integrity": "sha512-SLLb0AAn6PkUeAfKJCCOl9e1R53pQlGAfc4y4XuMRZfqeMYLE0dM1LMhqbGAlGQY0lfw5/ohoYWAe9V1yibRag==", - "dev": true, - "requires": { - "@babel/types": "^7.16.7" - } - }, - "@babel/helper-explode-assignable-expression": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/helper-explode-assignable-expression/-/helper-explode-assignable-expression-7.16.7.tgz", - "integrity": "sha512-KyUenhWMC8VrxzkGP0Jizjo4/Zx+1nNZhgocs+gLzyZyB8SHidhoq9KK/8Ato4anhwsivfkBLftky7gvzbZMtQ==", - "dev": true, - "requires": { - "@babel/types": "^7.16.7" - } + "version": "7.22.20", + "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.20.tgz", + "integrity": "sha512-zfedSIzFhat/gFhWfHtgWvlec0nqB9YEIVrpuwjruLlXfUSnA8cJB0miHKwqDnQ7d32aKo2xt88/xZptwxbfhA==", + "dev": true }, "@babel/helper-function-name": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.16.7.tgz", - "integrity": "sha512-QfDfEnIUyyBSR3HtrtGECuZ6DAyCkYFp7GHl75vFtTnn6pjKeK0T1DB5lLkFvBea8MdaiUABx3osbgLyInoejA==", - "dev": true, - "requires": { - "@babel/helper-get-function-arity": "^7.16.7", - "@babel/template": "^7.16.7", - "@babel/types": "^7.16.7" - } - }, - "@babel/helper-get-function-arity": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.16.7.tgz", - "integrity": "sha512-flc+RLSOBXzNzVhcLu6ujeHUrD6tANAOU5ojrRx/as+tbzf8+stUCj7+IfRRoAbEZqj/ahXEMsjhOhgeZsrnTw==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.22.5.tgz", + "integrity": "sha512-wtHSq6jMRE3uF2otvfuD3DIvVhOsSNshQl0Qrd7qC9oQJzHvOL4qQXlQn2916+CXGywIjpGuIkoyZRRxHPiNQQ==", "dev": true, "requires": { - "@babel/types": "^7.16.7" + "@babel/template": "^7.22.5", + "@babel/types": "^7.22.5" } }, "@babel/helper-hoist-variables": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.16.7.tgz", - "integrity": "sha512-m04d/0Op34H5v7pbZw6pSKP7weA6lsMvfiIAMeIvkY/R4xQtBSMFEigu9QTZ2qB/9l22vsxtM8a+Q8CzD255fg==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.22.5.tgz", + "integrity": "sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw==", "dev": true, "requires": { - "@babel/types": "^7.16.7" + "@babel/types": "^7.22.5" } }, "@babel/helper-member-expression-to-functions": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.16.7.tgz", - "integrity": "sha512-VtJ/65tYiU/6AbMTDwyoXGPKHgTsfRarivm+YbB5uAzKUyuPjgZSgAFeG87FCigc7KNHu2Pegh1XIT3lXjvz3Q==", + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.23.0.tgz", + "integrity": "sha512-6gfrPwh7OuT6gZyJZvd6WbTfrqAo7vm4xCzAXOusKqq/vWdKXphTpj5klHKNmRUU6/QRGlBsyU9mAIPaWHlqJA==", "dev": true, "requires": { - "@babel/types": "^7.16.7" + "@babel/types": "^7.23.0" } }, "@babel/helper-module-imports": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.16.7.tgz", - "integrity": "sha512-LVtS6TqjJHFc+nYeITRo6VLXve70xmq7wPhWTqDJusJEgGmkAACWwMiTNrvfoQo6hEhFwAIixNkvB0jPXDL8Wg==", + "version": "7.22.15", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.22.15.tgz", + "integrity": "sha512-0pYVBnDKZO2fnSPCrgM/6WMc7eS20Fbok+0r88fp+YtWVLZrp4CkafFGIp+W0VKw4a22sgebPT99y+FDNMdP4w==", "dev": true, "requires": { - "@babel/types": "^7.16.7" + "@babel/types": "^7.22.15" } }, "@babel/helper-module-transforms": { - "version": "7.17.7", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.17.7.tgz", - "integrity": "sha512-VmZD99F3gNTYB7fJRDTi+u6l/zxY0BE6OIxPSU7a50s6ZUQkHwSDmV92FfM+oCG0pZRVojGYhkR8I0OGeCVREw==", + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.23.0.tgz", + "integrity": "sha512-WhDWw1tdrlT0gMgUJSlX0IQvoO1eN279zrAUbVB+KpV2c3Tylz8+GnKOLllCS6Z/iZQEyVYxhZVUdPTqs2YYPw==", "dev": true, "requires": { - "@babel/helper-environment-visitor": "^7.16.7", - "@babel/helper-module-imports": "^7.16.7", - "@babel/helper-simple-access": "^7.17.7", - "@babel/helper-split-export-declaration": "^7.16.7", - "@babel/helper-validator-identifier": "^7.16.7", - "@babel/template": "^7.16.7", - "@babel/traverse": "^7.17.3", - "@babel/types": "^7.17.0" + "@babel/helper-environment-visitor": "^7.22.20", + "@babel/helper-module-imports": "^7.22.15", + "@babel/helper-simple-access": "^7.22.5", + "@babel/helper-split-export-declaration": "^7.22.6", + "@babel/helper-validator-identifier": "^7.22.20" } }, "@babel/helper-optimise-call-expression": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.16.7.tgz", - "integrity": "sha512-EtgBhg7rd/JcnpZFXpBy0ze1YRfdm7BnBX4uKMBd3ixa3RGAE002JZB66FJyNH7g0F38U05pXmA5P8cBh7z+1w==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.22.5.tgz", + "integrity": "sha512-HBwaojN0xFRx4yIvpwGqxiV2tUfl7401jlok564NgB9EHS1y6QT17FmKWm4ztqjeVdXLuC4fSvHc5ePpQjoTbw==", "dev": true, "requires": { - "@babel/types": "^7.16.7" + "@babel/types": "^7.22.5" } }, "@babel/helper-plugin-utils": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.16.7.tgz", - "integrity": "sha512-Qg3Nk7ZxpgMrsox6HreY1ZNKdBq7K72tDSliA6dCl5f007jR4ne8iD5UzuNnCJH2xBf2BEEVGr+/OL6Gdp7RxA==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.22.5.tgz", + "integrity": "sha512-uLls06UVKgFG9QD4OeFYLEGteMIAa5kpTPcFL28yuCIIzsf6ZyKZMllKVOCZFhiZ5ptnwX4mtKdWCBE/uT4amg==", "dev": true }, "@babel/helper-remap-async-to-generator": { - "version": "7.16.8", - "resolved": "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.16.8.tgz", - "integrity": "sha512-fm0gH7Flb8H51LqJHy3HJ3wnE1+qtYR2A99K06ahwrawLdOFsCEWjZOrYricXJHoPSudNKxrMBUPEIPxiIIvBw==", + "version": "7.22.9", + "resolved": "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.22.9.tgz", + "integrity": "sha512-8WWC4oR4Px+tr+Fp0X3RHDVfINGpF3ad1HIbrc8A77epiR6eMMc6jsgozkzT2uDiOOdoS9cLIQ+XD2XvI2WSmQ==", "dev": true, "requires": { - "@babel/helper-annotate-as-pure": "^7.16.7", - "@babel/helper-wrap-function": "^7.16.8", - "@babel/types": "^7.16.8" + "@babel/helper-annotate-as-pure": "^7.22.5", + "@babel/helper-environment-visitor": "^7.22.5", + "@babel/helper-wrap-function": "^7.22.9" } }, "@babel/helper-replace-supers": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.16.7.tgz", - "integrity": "sha512-y9vsWilTNaVnVh6xiJfABzsNpgDPKev9HnAgz6Gb1p6UUwf9NepdlsV7VXGCftJM+jqD5f7JIEubcpLjZj5dBw==", + "version": "7.22.9", + "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.22.9.tgz", + "integrity": "sha512-LJIKvvpgPOPUThdYqcX6IXRuIcTkcAub0IaDRGCZH0p5GPUp7PhRU9QVgFcDDd51BaPkk77ZjqFwh6DZTAEmGg==", "dev": true, "requires": { - "@babel/helper-environment-visitor": "^7.16.7", - "@babel/helper-member-expression-to-functions": "^7.16.7", - "@babel/helper-optimise-call-expression": "^7.16.7", - "@babel/traverse": "^7.16.7", - "@babel/types": "^7.16.7" + "@babel/helper-environment-visitor": "^7.22.5", + "@babel/helper-member-expression-to-functions": "^7.22.5", + "@babel/helper-optimise-call-expression": "^7.22.5" } }, "@babel/helper-simple-access": { - "version": "7.17.7", - "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.17.7.tgz", - "integrity": "sha512-txyMCGroZ96i+Pxr3Je3lzEJjqwaRC9buMUgtomcrLe5Nd0+fk1h0LLA+ixUF5OW7AhHuQ7Es1WcQJZmZsz2XA==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.22.5.tgz", + "integrity": "sha512-n0H99E/K+Bika3++WNL17POvo4rKWZ7lZEp1Q+fStVbUi8nxPQEBOlTmCOxW/0JsS56SKKQ+ojAe2pHKJHN35w==", "dev": true, "requires": { - "@babel/types": "^7.17.0" + "@babel/types": "^7.22.5" } }, "@babel/helper-skip-transparent-expression-wrappers": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.16.0.tgz", - "integrity": "sha512-+il1gTy0oHwUsBQZyJvukbB4vPMdcYBrFHa0Uc4AizLxbq6BOYC51Rv4tWocX9BLBDLZ4kc6qUFpQ6HRgL+3zw==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.22.5.tgz", + "integrity": "sha512-tK14r66JZKiC43p8Ki33yLBVJKlQDFoA8GYN67lWCDCqoL6EMMSuM9b+Iff2jHaM/RRFYl7K+iiru7hbRqNx8Q==", "dev": true, "requires": { - "@babel/types": "^7.16.0" + "@babel/types": "^7.22.5" } }, "@babel/helper-split-export-declaration": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.16.7.tgz", - "integrity": "sha512-xbWoy/PFoxSWazIToT9Sif+jJTlrMcndIsaOKvTA6u7QEo7ilkRZpjew18/W3c7nm8fXdUDXh02VXTbZ0pGDNw==", + "version": "7.22.6", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.22.6.tgz", + "integrity": "sha512-AsUnxuLhRYsisFiaJwvp1QF+I3KjD5FOxut14q/GzovUe6orHLesW2C7d754kRm53h5gqrz6sFl6sxc4BVtE/g==", "dev": true, "requires": { - "@babel/types": "^7.16.7" + "@babel/types": "^7.22.5" } }, + "@babel/helper-string-parser": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.22.5.tgz", + "integrity": "sha512-mM4COjgZox8U+JcXQwPijIZLElkgEpO5rsERVDJTc2qfCDfERyob6k5WegS14SX18IIjv+XD+GrqNumY5JRCDw==", + "dev": true + }, "@babel/helper-validator-identifier": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.16.7.tgz", - "integrity": "sha512-hsEnFemeiW4D08A5gUAZxLBTXpZ39P+a+DGDsHw1yxqyQ/jzFEnxf5uTEGp+3bzAbNOxU1paTgYS4ECU/IgfDw==", + "version": "7.22.20", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz", + "integrity": "sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==", "dev": true }, "@babel/helper-validator-option": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.16.7.tgz", - "integrity": "sha512-TRtenOuRUVo9oIQGPC5G9DgK4743cdxvtOw0weQNpZXaS16SCBi5MNjZF8vba3ETURjZpTbVn7Vvcf2eAwFozQ==", + "version": "7.22.15", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.22.15.tgz", + "integrity": "sha512-bMn7RmyFjY/mdECUbgn9eoSY4vqvacUnS9i9vGAGttgFWesO6B4CYWA7XlpbWgBt71iv/hfbPlynohStqnu5hA==", "dev": true }, "@babel/helper-wrap-function": { - "version": "7.16.8", - "resolved": "https://registry.npmjs.org/@babel/helper-wrap-function/-/helper-wrap-function-7.16.8.tgz", - "integrity": "sha512-8RpyRVIAW1RcDDGTA+GpPAwV22wXCfKOoM9bet6TLkGIFTkRQSkH1nMQ5Yet4MpoXe1ZwHPVtNasc2w0uZMqnw==", + "version": "7.22.10", + "resolved": "https://registry.npmjs.org/@babel/helper-wrap-function/-/helper-wrap-function-7.22.10.tgz", + "integrity": "sha512-OnMhjWjuGYtdoO3FmsEFWvBStBAe2QOgwOLsLNDjN+aaiMD8InJk1/O3HSD8lkqTjCgg5YI34Tz15KNNA3p+nQ==", "dev": true, "requires": { - "@babel/helper-function-name": "^7.16.7", - "@babel/template": "^7.16.7", - "@babel/traverse": "^7.16.8", - "@babel/types": "^7.16.8" + "@babel/helper-function-name": "^7.22.5", + "@babel/template": "^7.22.5", + "@babel/types": "^7.22.10" } }, "@babel/helpers": { - "version": "7.17.8", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.17.8.tgz", - "integrity": "sha512-QcL86FGxpfSJwGtAvv4iG93UL6bmqBdmoVY0CMCU2g+oD2ezQse3PT5Pa+jiD6LJndBQi0EDlpzOWNlLuhz5gw==", + "version": "7.23.1", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.23.1.tgz", + "integrity": "sha512-chNpneuK18yW5Oxsr+t553UZzzAs3aZnFm4bxhebsNTeshrC95yA7l5yl7GBAG+JG1rF0F7zzD2EixK9mWSDoA==", "dev": true, "requires": { - "@babel/template": "^7.16.7", - "@babel/traverse": "^7.17.3", - "@babel/types": "^7.17.0" + "@babel/template": "^7.22.15", + "@babel/traverse": "^7.23.0", + "@babel/types": "^7.23.0" } }, "@babel/highlight": { - "version": "7.16.10", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.16.10.tgz", - "integrity": "sha512-5FnTQLSLswEj6IkgVw5KusNUUFY9ZGqe/TRFnP/BKYHYgfh7tc+C7mwiy95/yNP7Dh9x580Vv8r7u7ZfTBFxdw==", + "version": "7.22.20", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.22.20.tgz", + "integrity": "sha512-dkdMCN3py0+ksCgYmGG8jKeGA/8Tk+gJwSYYlFGxG5lmhfKNoAy004YpLxpS1W2J8m/EK2Ew+yOs9pVRwO89mg==", "dev": true, "requires": { - "@babel/helper-validator-identifier": "^7.16.7", - "chalk": "^2.0.0", + "@babel/helper-validator-identifier": "^7.22.20", + "chalk": "^2.4.2", "js-tokens": "^4.0.0" } }, "@babel/parser": { - "version": "7.17.8", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.17.8.tgz", - "integrity": "sha512-BoHhDJrJXqcg+ZL16Xv39H9n+AqJ4pcDrQBGZN+wHxIysrLZ3/ECwCBUch/1zUNhnsXULcONU3Ei5Hmkfk6kiQ==", + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.23.0.tgz", + "integrity": "sha512-vvPKKdMemU85V9WE/l5wZEmImpCtLqbnTvqDS2U1fJ96KrxoW7KrXhNsNCblQlg8Ck4b85yxdTyelsMUgFUXiw==", "dev": true }, "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/-/plugin-bugfix-safari-id-destructuring-collision-in-function-expression-7.16.7.tgz", - "integrity": "sha512-anv/DObl7waiGEnC24O9zqL0pSuI9hljihqiDuFHC8d7/bjr/4RLGPWuc8rYOff/QPzbEPSkzG8wGG9aDuhHRg==", + "version": "7.22.15", + "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/-/plugin-bugfix-safari-id-destructuring-collision-in-function-expression-7.22.15.tgz", + "integrity": "sha512-FB9iYlz7rURmRJyXRKEnalYPPdn87H5no108cyuQQyMwlpJ2SJtpIUBI27kdTin956pz+LPypkPVPUTlxOmrsg==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.16.7" + "@babel/helper-plugin-utils": "^7.22.5" } }, "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/-/plugin-bugfix-v8-spread-parameters-in-optional-chaining-7.16.7.tgz", - "integrity": "sha512-di8vUHRdf+4aJ7ltXhaDbPoszdkh59AQtJM5soLsuHpQJdFQZOA4uGj0V2u/CZ8bJ/u8ULDL5yq6FO/bCXnKHw==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.16.7", - "@babel/helper-skip-transparent-expression-wrappers": "^7.16.0", - "@babel/plugin-proposal-optional-chaining": "^7.16.7" - } - }, - "@babel/plugin-proposal-async-generator-functions": { - "version": "7.16.8", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.16.8.tgz", - "integrity": "sha512-71YHIvMuiuqWJQkebWJtdhQTfd4Q4mF76q2IX37uZPkG9+olBxsX+rH1vkhFto4UeJZ9dPY2s+mDvhDm1u2BGQ==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.16.7", - "@babel/helper-remap-async-to-generator": "^7.16.8", - "@babel/plugin-syntax-async-generators": "^7.8.4" - } - }, - "@babel/plugin-proposal-class-properties": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.16.7.tgz", - "integrity": "sha512-IobU0Xme31ewjYOShSIqd/ZGM/r/cuOz2z0MDbNrhF5FW+ZVgi0f2lyeoj9KFPDOAqsYxmLWZte1WOwlvY9aww==", - "dev": true, - "requires": { - "@babel/helper-create-class-features-plugin": "^7.16.7", - "@babel/helper-plugin-utils": "^7.16.7" - } - }, - "@babel/plugin-proposal-class-static-block": { - "version": "7.17.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-class-static-block/-/plugin-proposal-class-static-block-7.17.6.tgz", - "integrity": "sha512-X/tididvL2zbs7jZCeeRJ8167U/+Ac135AM6jCAx6gYXDUviZV5Ku9UDvWS2NCuWlFjIRXklYhwo6HhAC7ETnA==", - "dev": true, - "requires": { - "@babel/helper-create-class-features-plugin": "^7.17.6", - "@babel/helper-plugin-utils": "^7.16.7", - "@babel/plugin-syntax-class-static-block": "^7.14.5" - } - }, - "@babel/plugin-proposal-dynamic-import": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-dynamic-import/-/plugin-proposal-dynamic-import-7.16.7.tgz", - "integrity": "sha512-I8SW9Ho3/8DRSdmDdH3gORdyUuYnk1m4cMxUAdu5oy4n3OfN8flDEH+d60iG7dUfi0KkYwSvoalHzzdRzpWHTg==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.16.7", - "@babel/plugin-syntax-dynamic-import": "^7.8.3" - } - }, - "@babel/plugin-proposal-export-namespace-from": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-export-namespace-from/-/plugin-proposal-export-namespace-from-7.16.7.tgz", - "integrity": "sha512-ZxdtqDXLRGBL64ocZcs7ovt71L3jhC1RGSyR996svrCi3PYqHNkb3SwPJCs8RIzD86s+WPpt2S73+EHCGO+NUA==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.16.7", - "@babel/plugin-syntax-export-namespace-from": "^7.8.3" - } - }, - "@babel/plugin-proposal-json-strings": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-json-strings/-/plugin-proposal-json-strings-7.16.7.tgz", - "integrity": "sha512-lNZ3EEggsGY78JavgbHsK9u5P3pQaW7k4axlgFLYkMd7UBsiNahCITShLjNQschPyjtO6dADrL24757IdhBrsQ==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.16.7", - "@babel/plugin-syntax-json-strings": "^7.8.3" - } - }, - "@babel/plugin-proposal-logical-assignment-operators": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-logical-assignment-operators/-/plugin-proposal-logical-assignment-operators-7.16.7.tgz", - "integrity": "sha512-K3XzyZJGQCr00+EtYtrDjmwX7o7PLK6U9bi1nCwkQioRFVUv6dJoxbQjtWVtP+bCPy82bONBKG8NPyQ4+i6yjg==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.16.7", - "@babel/plugin-syntax-logical-assignment-operators": "^7.10.4" - } - }, - "@babel/plugin-proposal-nullish-coalescing-operator": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-nullish-coalescing-operator/-/plugin-proposal-nullish-coalescing-operator-7.16.7.tgz", - "integrity": "sha512-aUOrYU3EVtjf62jQrCj63pYZ7k6vns2h/DQvHPWGmsJRYzWXZ6/AsfgpiRy6XiuIDADhJzP2Q9MwSMKauBQ+UQ==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.16.7", - "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3" - } - }, - "@babel/plugin-proposal-numeric-separator": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-numeric-separator/-/plugin-proposal-numeric-separator-7.16.7.tgz", - "integrity": "sha512-vQgPMknOIgiuVqbokToyXbkY/OmmjAzr/0lhSIbG/KmnzXPGwW/AdhdKpi+O4X/VkWiWjnkKOBiqJrTaC98VKw==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.16.7", - "@babel/plugin-syntax-numeric-separator": "^7.10.4" - } - }, - "@babel/plugin-proposal-object-rest-spread": { - "version": "7.17.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.17.3.tgz", - "integrity": "sha512-yuL5iQA/TbZn+RGAfxQXfi7CNLmKi1f8zInn4IgobuCWcAb7i+zj4TYzQ9l8cEzVyJ89PDGuqxK1xZpUDISesw==", - "dev": true, - "requires": { - "@babel/compat-data": "^7.17.0", - "@babel/helper-compilation-targets": "^7.16.7", - "@babel/helper-plugin-utils": "^7.16.7", - "@babel/plugin-syntax-object-rest-spread": "^7.8.3", - "@babel/plugin-transform-parameters": "^7.16.7" - } - }, - "@babel/plugin-proposal-optional-catch-binding": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-optional-catch-binding/-/plugin-proposal-optional-catch-binding-7.16.7.tgz", - "integrity": "sha512-eMOH/L4OvWSZAE1VkHbr1vckLG1WUcHGJSLqqQwl2GaUqG6QjddvrOaTUMNYiv77H5IKPMZ9U9P7EaHwvAShfA==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.16.7", - "@babel/plugin-syntax-optional-catch-binding": "^7.8.3" - } - }, - "@babel/plugin-proposal-optional-chaining": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.16.7.tgz", - "integrity": "sha512-eC3xy+ZrUcBtP7x+sq62Q/HYd674pPTb/77XZMb5wbDPGWIdUbSr4Agr052+zaUPSb+gGRnjxXfKFvx5iMJ+DA==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.16.7", - "@babel/helper-skip-transparent-expression-wrappers": "^7.16.0", - "@babel/plugin-syntax-optional-chaining": "^7.8.3" - } - }, - "@babel/plugin-proposal-private-methods": { - "version": "7.16.11", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-private-methods/-/plugin-proposal-private-methods-7.16.11.tgz", - "integrity": "sha512-F/2uAkPlXDr8+BHpZvo19w3hLFKge+k75XUprE6jaqKxjGkSYcK+4c+bup5PdW/7W/Rpjwql7FTVEDW+fRAQsw==", + "version": "7.22.15", + "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/-/plugin-bugfix-v8-spread-parameters-in-optional-chaining-7.22.15.tgz", + "integrity": "sha512-Hyph9LseGvAeeXzikV88bczhsrLrIZqDPxO+sSmAunMPaGrBGhfMWzCPYTtiW9t+HzSE2wtV8e5cc5P6r1xMDQ==", "dev": true, "requires": { - "@babel/helper-create-class-features-plugin": "^7.16.10", - "@babel/helper-plugin-utils": "^7.16.7" + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/helper-skip-transparent-expression-wrappers": "^7.22.5", + "@babel/plugin-transform-optional-chaining": "^7.22.15" } }, "@babel/plugin-proposal-private-property-in-object": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-private-property-in-object/-/plugin-proposal-private-property-in-object-7.16.7.tgz", - "integrity": "sha512-rMQkjcOFbm+ufe3bTZLyOfsOUOxyvLXZJCTARhJr+8UMSoZmqTe1K1BgkFcrW37rAchWg57yI69ORxiWvUINuQ==", - "dev": true, - "requires": { - "@babel/helper-annotate-as-pure": "^7.16.7", - "@babel/helper-create-class-features-plugin": "^7.16.7", - "@babel/helper-plugin-utils": "^7.16.7", - "@babel/plugin-syntax-private-property-in-object": "^7.14.5" - } - }, - "@babel/plugin-proposal-unicode-property-regex": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.16.7.tgz", - "integrity": "sha512-QRK0YI/40VLhNVGIjRNAAQkEHws0cswSdFFjpFyt943YmJIU1da9uW63Iu6NFV6CxTZW5eTDCrwZUstBWgp/Rg==", + "version": "7.21.0-placeholder-for-preset-env.2", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-private-property-in-object/-/plugin-proposal-private-property-in-object-7.21.0-placeholder-for-preset-env.2.tgz", + "integrity": "sha512-SOSkfJDddaM7mak6cPEpswyTRnuRltl429hMraQEglW+OkovnCzsiszTmsrlY//qLFjCpQDFRvjdm2wA5pPm9w==", "dev": true, - "requires": { - "@babel/helper-create-regexp-features-plugin": "^7.16.7", - "@babel/helper-plugin-utils": "^7.16.7" - } + "requires": {} }, "@babel/plugin-syntax-async-generators": { "version": "7.8.4", @@ -15294,6 +14876,24 @@ "@babel/helper-plugin-utils": "^7.8.3" } }, + "@babel/plugin-syntax-import-assertions": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-assertions/-/plugin-syntax-import-assertions-7.22.5.tgz", + "integrity": "sha512-rdV97N7KqsRzeNGoWUOK6yUsWarLjE5Su/Snk9IYPU9CwkWHs4t+rTGOvffTR8XGkJMTAdLfO0xVnXm8wugIJg==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.22.5" + } + }, + "@babel/plugin-syntax-import-attributes": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-attributes/-/plugin-syntax-import-attributes-7.22.5.tgz", + "integrity": "sha512-KwvoWDeNKPETmozyFE0P2rOLqh39EoQHNjqizrI5B8Vt0ZNS7M56s7dAiAqbYfiAYOuIzIh96z3iR2ktgu3tEg==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.22.5" + } + }, "@babel/plugin-syntax-import-meta": { "version": "7.10.4", "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-meta/-/plugin-syntax-import-meta-7.10.4.tgz", @@ -15312,6 +14912,15 @@ "@babel/helper-plugin-utils": "^7.8.0" } }, + "@babel/plugin-syntax-jsx": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.22.5.tgz", + "integrity": "sha512-gvyP4hZrgrs/wWMaocvxZ44Hw0b3W8Pe+cMxc8V1ULQ07oh8VNbIRaoD1LRZVTvD+0nieDKjfgKg89sD7rrKrg==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.22.5" + } + }, "@babel/plugin-syntax-logical-assignment-operators": { "version": "7.10.4", "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-logical-assignment-operators/-/plugin-syntax-logical-assignment-operators-7.10.4.tgz", @@ -15385,371 +14994,529 @@ } }, "@babel/plugin-syntax-typescript": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.16.7.tgz", - "integrity": "sha512-YhUIJHHGkqPgEcMYkPCKTyGUdoGKWtopIycQyjJH8OjvRgOYsXsaKehLVPScKJWAULPxMa4N1vCe6szREFlZ7A==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.22.5.tgz", + "integrity": "sha512-1mS2o03i7t1c6VzH6fdQ3OA8tcEIxwG18zIPRp+UY1Ihv6W+XZzBCVxExF9upussPXJ0xE9XRHwMoNs1ep/nRQ==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.22.5" + } + }, + "@babel/plugin-syntax-unicode-sets-regex": { + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-unicode-sets-regex/-/plugin-syntax-unicode-sets-regex-7.18.6.tgz", + "integrity": "sha512-727YkEAPwSIQTv5im8QHz3upqp92JTWhidIC81Tdx4VJYIte/VndKf1qKrfnnhPLiPghStWfvC/iFaMCQu7Nqg==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.16.7" + "@babel/helper-create-regexp-features-plugin": "^7.18.6", + "@babel/helper-plugin-utils": "^7.18.6" } }, "@babel/plugin-transform-arrow-functions": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.16.7.tgz", - "integrity": "sha512-9ffkFFMbvzTvv+7dTp/66xvZAWASuPD5Tl9LK3Z9vhOmANo6j94rik+5YMBt4CwHVMWLWpMsriIc2zsa3WW3xQ==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.22.5.tgz", + "integrity": "sha512-26lTNXoVRdAnsaDXPpvCNUq+OVWEVC6bx7Vvz9rC53F2bagUWW4u4ii2+h8Fejfh7RYqPxn+libeFBBck9muEw==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.22.5" + } + }, + "@babel/plugin-transform-async-generator-functions": { + "version": "7.22.15", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-generator-functions/-/plugin-transform-async-generator-functions-7.22.15.tgz", + "integrity": "sha512-jBm1Es25Y+tVoTi5rfd5t1KLmL8ogLKpXszboWOTTtGFGz2RKnQe2yn7HbZ+kb/B8N0FVSGQo874NSlOU1T4+w==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.16.7" + "@babel/helper-environment-visitor": "^7.22.5", + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/helper-remap-async-to-generator": "^7.22.9", + "@babel/plugin-syntax-async-generators": "^7.8.4" } }, "@babel/plugin-transform-async-to-generator": { - "version": "7.16.8", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.16.8.tgz", - "integrity": "sha512-MtmUmTJQHCnyJVrScNzNlofQJ3dLFuobYn3mwOTKHnSCMtbNsqvF71GQmJfFjdrXSsAA7iysFmYWw4bXZ20hOg==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.22.5.tgz", + "integrity": "sha512-b1A8D8ZzE/VhNDoV1MSJTnpKkCG5bJo+19R4o4oy03zM7ws8yEMK755j61Dc3EyvdysbqH5BOOTquJ7ZX9C6vQ==", "dev": true, "requires": { - "@babel/helper-module-imports": "^7.16.7", - "@babel/helper-plugin-utils": "^7.16.7", - "@babel/helper-remap-async-to-generator": "^7.16.8" + "@babel/helper-module-imports": "^7.22.5", + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/helper-remap-async-to-generator": "^7.22.5" } }, "@babel/plugin-transform-block-scoped-functions": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.16.7.tgz", - "integrity": "sha512-JUuzlzmF40Z9cXyytcbZEZKckgrQzChbQJw/5PuEHYeqzCsvebDx0K0jWnIIVcmmDOAVctCgnYs0pMcrYj2zJg==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.22.5.tgz", + "integrity": "sha512-tdXZ2UdknEKQWKJP1KMNmuF5Lx3MymtMN/pvA+p/VEkhK8jVcQ1fzSy8KM9qRYhAf2/lV33hoMPKI/xaI9sADA==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.16.7" + "@babel/helper-plugin-utils": "^7.22.5" } }, "@babel/plugin-transform-block-scoping": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.16.7.tgz", - "integrity": "sha512-ObZev2nxVAYA4bhyusELdo9hb3H+A56bxH3FZMbEImZFiEDYVHXQSJ1hQKFlDnlt8G9bBrCZ5ZpURZUrV4G5qQ==", + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.23.0.tgz", + "integrity": "sha512-cOsrbmIOXmf+5YbL99/S49Y3j46k/T16b9ml8bm9lP6N9US5iQ2yBK7gpui1pg0V/WMcXdkfKbTb7HXq9u+v4g==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.22.5" + } + }, + "@babel/plugin-transform-class-properties": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-class-properties/-/plugin-transform-class-properties-7.22.5.tgz", + "integrity": "sha512-nDkQ0NfkOhPTq8YCLiWNxp1+f9fCobEjCb0n8WdbNUBc4IB5V7P1QnX9IjpSoquKrXF5SKojHleVNs2vGeHCHQ==", + "dev": true, + "requires": { + "@babel/helper-create-class-features-plugin": "^7.22.5", + "@babel/helper-plugin-utils": "^7.22.5" + } + }, + "@babel/plugin-transform-class-static-block": { + "version": "7.22.11", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-class-static-block/-/plugin-transform-class-static-block-7.22.11.tgz", + "integrity": "sha512-GMM8gGmqI7guS/llMFk1bJDkKfn3v3C4KHK9Yg1ey5qcHcOlKb0QvcMrgzvxo+T03/4szNh5lghY+fEC98Kq9g==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.16.7" + "@babel/helper-create-class-features-plugin": "^7.22.11", + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/plugin-syntax-class-static-block": "^7.14.5" } }, "@babel/plugin-transform-classes": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.16.7.tgz", - "integrity": "sha512-WY7og38SFAGYRe64BrjKf8OrE6ulEHtr5jEYaZMwox9KebgqPi67Zqz8K53EKk1fFEJgm96r32rkKZ3qA2nCWQ==", - "dev": true, - "requires": { - "@babel/helper-annotate-as-pure": "^7.16.7", - "@babel/helper-environment-visitor": "^7.16.7", - "@babel/helper-function-name": "^7.16.7", - "@babel/helper-optimise-call-expression": "^7.16.7", - "@babel/helper-plugin-utils": "^7.16.7", - "@babel/helper-replace-supers": "^7.16.7", - "@babel/helper-split-export-declaration": "^7.16.7", + "version": "7.22.15", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.22.15.tgz", + "integrity": "sha512-VbbC3PGjBdE0wAWDdHM9G8Gm977pnYI0XpqMd6LrKISj8/DJXEsWqgRuTYaNE9Bv0JGhTZUzHDlMk18IpOuoqw==", + "dev": true, + "requires": { + "@babel/helper-annotate-as-pure": "^7.22.5", + "@babel/helper-compilation-targets": "^7.22.15", + "@babel/helper-environment-visitor": "^7.22.5", + "@babel/helper-function-name": "^7.22.5", + "@babel/helper-optimise-call-expression": "^7.22.5", + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/helper-replace-supers": "^7.22.9", + "@babel/helper-split-export-declaration": "^7.22.6", "globals": "^11.1.0" } }, "@babel/plugin-transform-computed-properties": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.16.7.tgz", - "integrity": "sha512-gN72G9bcmenVILj//sv1zLNaPyYcOzUho2lIJBMh/iakJ9ygCo/hEF9cpGb61SCMEDxbbyBoVQxrt+bWKu5KGw==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.22.5.tgz", + "integrity": "sha512-4GHWBgRf0krxPX+AaPtgBAlTgTeZmqDynokHOX7aqqAB4tHs3U2Y02zH6ETFdLZGcg9UQSD1WCmkVrE9ErHeOg==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.16.7" + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/template": "^7.22.5" } }, "@babel/plugin-transform-destructuring": { - "version": "7.17.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.17.3.tgz", - "integrity": "sha512-dDFzegDYKlPqa72xIlbmSkly5MluLoaC1JswABGktyt6NTXSBcUuse/kWE/wvKFWJHPETpi158qJZFS3JmykJg==", + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.23.0.tgz", + "integrity": "sha512-vaMdgNXFkYrB+8lbgniSYWHsgqK5gjaMNcc84bMIOMRLH0L9AqYq3hwMdvnyqj1OPqea8UtjPEuS/DCenah1wg==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.16.7" + "@babel/helper-plugin-utils": "^7.22.5" } }, "@babel/plugin-transform-dotall-regex": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.16.7.tgz", - "integrity": "sha512-Lyttaao2SjZF6Pf4vk1dVKv8YypMpomAbygW+mU5cYP3S5cWTfCJjG8xV6CFdzGFlfWK81IjL9viiTvpb6G7gQ==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.22.5.tgz", + "integrity": "sha512-5/Yk9QxCQCl+sOIB1WelKnVRxTJDSAIxtJLL2/pqL14ZVlbH0fUQUZa/T5/UnQtBNgghR7mfB8ERBKyKPCi7Vw==", "dev": true, "requires": { - "@babel/helper-create-regexp-features-plugin": "^7.16.7", - "@babel/helper-plugin-utils": "^7.16.7" + "@babel/helper-create-regexp-features-plugin": "^7.22.5", + "@babel/helper-plugin-utils": "^7.22.5" } }, "@babel/plugin-transform-duplicate-keys": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.16.7.tgz", - "integrity": "sha512-03DvpbRfvWIXyK0/6QiR1KMTWeT6OcQ7tbhjrXyFS02kjuX/mu5Bvnh5SDSWHxyawit2g5aWhKwI86EE7GUnTw==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.22.5.tgz", + "integrity": "sha512-dEnYD+9BBgld5VBXHnF/DbYGp3fqGMsyxKbtD1mDyIA7AkTSpKXFhCVuj/oQVOoALfBs77DudA0BE4d5mcpmqw==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.22.5" + } + }, + "@babel/plugin-transform-dynamic-import": { + "version": "7.22.11", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-dynamic-import/-/plugin-transform-dynamic-import-7.22.11.tgz", + "integrity": "sha512-g/21plo58sfteWjaO0ZNVb+uEOkJNjAaHhbejrnBmu011l/eNDScmkbjCC3l4FKb10ViaGU4aOkFznSu2zRHgA==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.16.7" + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/plugin-syntax-dynamic-import": "^7.8.3" } }, "@babel/plugin-transform-exponentiation-operator": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.16.7.tgz", - "integrity": "sha512-8UYLSlyLgRixQvlYH3J2ekXFHDFLQutdy7FfFAMm3CPZ6q9wHCwnUyiXpQCe3gVVnQlHc5nsuiEVziteRNTXEA==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.22.5.tgz", + "integrity": "sha512-vIpJFNM/FjZ4rh1myqIya9jXwrwwgFRHPjT3DkUA9ZLHuzox8jiXkOLvwm1H+PQIP3CqfC++WPKeuDi0Sjdj1g==", + "dev": true, + "requires": { + "@babel/helper-builder-binary-assignment-operator-visitor": "^7.22.5", + "@babel/helper-plugin-utils": "^7.22.5" + } + }, + "@babel/plugin-transform-export-namespace-from": { + "version": "7.22.11", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-export-namespace-from/-/plugin-transform-export-namespace-from-7.22.11.tgz", + "integrity": "sha512-xa7aad7q7OiT8oNZ1mU7NrISjlSkVdMbNxn9IuLZyL9AJEhs1Apba3I+u5riX1dIkdptP5EKDG5XDPByWxtehw==", "dev": true, "requires": { - "@babel/helper-builder-binary-assignment-operator-visitor": "^7.16.7", - "@babel/helper-plugin-utils": "^7.16.7" + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/plugin-syntax-export-namespace-from": "^7.8.3" } }, "@babel/plugin-transform-for-of": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.16.7.tgz", - "integrity": "sha512-/QZm9W92Ptpw7sjI9Nx1mbcsWz33+l8kuMIQnDwgQBG5s3fAfQvkRjQ7NqXhtNcKOnPkdICmUHyCaWW06HCsqg==", + "version": "7.22.15", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.22.15.tgz", + "integrity": "sha512-me6VGeHsx30+xh9fbDLLPi0J1HzmeIIyenoOQHuw2D4m2SAU3NrspX5XxJLBpqn5yrLzrlw2Iy3RA//Bx27iOA==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.16.7" + "@babel/helper-plugin-utils": "^7.22.5" } }, "@babel/plugin-transform-function-name": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.16.7.tgz", - "integrity": "sha512-SU/C68YVwTRxqWj5kgsbKINakGag0KTgq9f2iZEXdStoAbOzLHEBRYzImmA6yFo8YZhJVflvXmIHUO7GWHmxxA==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.22.5.tgz", + "integrity": "sha512-UIzQNMS0p0HHiQm3oelztj+ECwFnj+ZRV4KnguvlsD2of1whUeM6o7wGNj6oLwcDoAXQ8gEqfgC24D+VdIcevg==", + "dev": true, + "requires": { + "@babel/helper-compilation-targets": "^7.22.5", + "@babel/helper-function-name": "^7.22.5", + "@babel/helper-plugin-utils": "^7.22.5" + } + }, + "@babel/plugin-transform-json-strings": { + "version": "7.22.11", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-json-strings/-/plugin-transform-json-strings-7.22.11.tgz", + "integrity": "sha512-CxT5tCqpA9/jXFlme9xIBCc5RPtdDq3JpkkhgHQqtDdiTnTI0jtZ0QzXhr5DILeYifDPp2wvY2ad+7+hLMW5Pw==", "dev": true, "requires": { - "@babel/helper-compilation-targets": "^7.16.7", - "@babel/helper-function-name": "^7.16.7", - "@babel/helper-plugin-utils": "^7.16.7" + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/plugin-syntax-json-strings": "^7.8.3" } }, "@babel/plugin-transform-literals": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-literals/-/plugin-transform-literals-7.16.7.tgz", - "integrity": "sha512-6tH8RTpTWI0s2sV6uq3e/C9wPo4PTqqZps4uF0kzQ9/xPLFQtipynvmT1g/dOfEJ+0EQsHhkQ/zyRId8J2b8zQ==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-literals/-/plugin-transform-literals-7.22.5.tgz", + "integrity": "sha512-fTLj4D79M+mepcw3dgFBTIDYpbcB9Sm0bpm4ppXPaO+U+PKFFyV9MGRvS0gvGw62sd10kT5lRMKXAADb9pWy8g==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.16.7" + "@babel/helper-plugin-utils": "^7.22.5" + } + }, + "@babel/plugin-transform-logical-assignment-operators": { + "version": "7.22.11", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-logical-assignment-operators/-/plugin-transform-logical-assignment-operators-7.22.11.tgz", + "integrity": "sha512-qQwRTP4+6xFCDV5k7gZBF3C31K34ut0tbEcTKxlX/0KXxm9GLcO14p570aWxFvVzx6QAfPgq7gaeIHXJC8LswQ==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/plugin-syntax-logical-assignment-operators": "^7.10.4" } }, "@babel/plugin-transform-member-expression-literals": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.16.7.tgz", - "integrity": "sha512-mBruRMbktKQwbxaJof32LT9KLy2f3gH+27a5XSuXo6h7R3vqltl0PgZ80C8ZMKw98Bf8bqt6BEVi3svOh2PzMw==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.22.5.tgz", + "integrity": "sha512-RZEdkNtzzYCFl9SE9ATaUMTj2hqMb4StarOJLrZRbqqU4HSBE7UlBw9WBWQiDzrJZJdUWiMTVDI6Gv/8DPvfew==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.16.7" + "@babel/helper-plugin-utils": "^7.22.5" } }, "@babel/plugin-transform-modules-amd": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.16.7.tgz", - "integrity": "sha512-KaaEtgBL7FKYwjJ/teH63oAmE3lP34N3kshz8mm4VMAw7U3PxjVwwUmxEFksbgsNUaO3wId9R2AVQYSEGRa2+g==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.22.5.tgz", + "integrity": "sha512-R+PTfLTcYEmb1+kK7FNkhQ1gP4KgjpSO6HfH9+f8/yfp2Nt3ggBjiVpRwmwTlfqZLafYKJACy36yDXlEmI9HjQ==", "dev": true, "requires": { - "@babel/helper-module-transforms": "^7.16.7", - "@babel/helper-plugin-utils": "^7.16.7", - "babel-plugin-dynamic-import-node": "^2.3.3" + "@babel/helper-module-transforms": "^7.22.5", + "@babel/helper-plugin-utils": "^7.22.5" } }, "@babel/plugin-transform-modules-commonjs": { - "version": "7.16.8", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.16.8.tgz", - "integrity": "sha512-oflKPvsLT2+uKQopesJt3ApiaIS2HW+hzHFcwRNtyDGieAeC/dIHZX8buJQ2J2X1rxGPy4eRcUijm3qcSPjYcA==", + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.23.0.tgz", + "integrity": "sha512-32Xzss14/UVc7k9g775yMIvkVK8xwKE0DPdP5JTapr3+Z9w4tzeOuLNY6BXDQR6BdnzIlXnCGAzsk/ICHBLVWQ==", "dev": true, "requires": { - "@babel/helper-module-transforms": "^7.16.7", - "@babel/helper-plugin-utils": "^7.16.7", - "@babel/helper-simple-access": "^7.16.7", - "babel-plugin-dynamic-import-node": "^2.3.3" + "@babel/helper-module-transforms": "^7.23.0", + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/helper-simple-access": "^7.22.5" } }, "@babel/plugin-transform-modules-systemjs": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.16.7.tgz", - "integrity": "sha512-DuK5E3k+QQmnOqBR9UkusByy5WZWGRxfzV529s9nPra1GE7olmxfqO2FHobEOYSPIjPBTr4p66YDcjQnt8cBmw==", + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.23.0.tgz", + "integrity": "sha512-qBej6ctXZD2f+DhlOC9yO47yEYgUh5CZNz/aBoH4j/3NOlRfJXJbY7xDQCqQVf9KbrqGzIWER1f23doHGrIHFg==", "dev": true, "requires": { - "@babel/helper-hoist-variables": "^7.16.7", - "@babel/helper-module-transforms": "^7.16.7", - "@babel/helper-plugin-utils": "^7.16.7", - "@babel/helper-validator-identifier": "^7.16.7", - "babel-plugin-dynamic-import-node": "^2.3.3" + "@babel/helper-hoist-variables": "^7.22.5", + "@babel/helper-module-transforms": "^7.23.0", + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/helper-validator-identifier": "^7.22.20" } }, "@babel/plugin-transform-modules-umd": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.16.7.tgz", - "integrity": "sha512-EMh7uolsC8O4xhudF2F6wedbSHm1HHZ0C6aJ7K67zcDNidMzVcxWdGr+htW9n21klm+bOn+Rx4CBsAntZd3rEQ==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.22.5.tgz", + "integrity": "sha512-+S6kzefN/E1vkSsKx8kmQuqeQsvCKCd1fraCM7zXm4SFoggI099Tr4G8U81+5gtMdUeMQ4ipdQffbKLX0/7dBQ==", "dev": true, "requires": { - "@babel/helper-module-transforms": "^7.16.7", - "@babel/helper-plugin-utils": "^7.16.7" + "@babel/helper-module-transforms": "^7.22.5", + "@babel/helper-plugin-utils": "^7.22.5" } }, "@babel/plugin-transform-named-capturing-groups-regex": { - "version": "7.16.8", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.16.8.tgz", - "integrity": "sha512-j3Jw+n5PvpmhRR+mrgIh04puSANCk/T/UA3m3P1MjJkhlK906+ApHhDIqBQDdOgL/r1UYpz4GNclTXxyZrYGSw==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.22.5.tgz", + "integrity": "sha512-YgLLKmS3aUBhHaxp5hi1WJTgOUb/NCuDHzGT9z9WTt3YG+CPRhJs6nprbStx6DnWM4dh6gt7SU3sZodbZ08adQ==", "dev": true, "requires": { - "@babel/helper-create-regexp-features-plugin": "^7.16.7" + "@babel/helper-create-regexp-features-plugin": "^7.22.5", + "@babel/helper-plugin-utils": "^7.22.5" } }, "@babel/plugin-transform-new-target": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.16.7.tgz", - "integrity": "sha512-xiLDzWNMfKoGOpc6t3U+etCE2yRnn3SM09BXqWPIZOBpL2gvVrBWUKnsJx0K/ADi5F5YC5f8APFfWrz25TdlGg==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.22.5.tgz", + "integrity": "sha512-AsF7K0Fx/cNKVyk3a+DW0JLo+Ua598/NxMRvxDnkpCIGFh43+h/v2xyhRUYf6oD8gE4QtL83C7zZVghMjHd+iw==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.22.5" + } + }, + "@babel/plugin-transform-nullish-coalescing-operator": { + "version": "7.22.11", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-nullish-coalescing-operator/-/plugin-transform-nullish-coalescing-operator-7.22.11.tgz", + "integrity": "sha512-YZWOw4HxXrotb5xsjMJUDlLgcDXSfO9eCmdl1bgW4+/lAGdkjaEvOnQ4p5WKKdUgSzO39dgPl0pTnfxm0OAXcg==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3" + } + }, + "@babel/plugin-transform-numeric-separator": { + "version": "7.22.11", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-numeric-separator/-/plugin-transform-numeric-separator-7.22.11.tgz", + "integrity": "sha512-3dzU4QGPsILdJbASKhF/V2TVP+gJya1PsueQCxIPCEcerqF21oEcrob4mzjsp2Py/1nLfF5m+xYNMDpmA8vffg==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/plugin-syntax-numeric-separator": "^7.10.4" + } + }, + "@babel/plugin-transform-object-rest-spread": { + "version": "7.22.15", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-rest-spread/-/plugin-transform-object-rest-spread-7.22.15.tgz", + "integrity": "sha512-fEB+I1+gAmfAyxZcX1+ZUwLeAuuf8VIg67CTznZE0MqVFumWkh8xWtn58I4dxdVf080wn7gzWoF8vndOViJe9Q==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.16.7" + "@babel/compat-data": "^7.22.9", + "@babel/helper-compilation-targets": "^7.22.15", + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/plugin-syntax-object-rest-spread": "^7.8.3", + "@babel/plugin-transform-parameters": "^7.22.15" } }, "@babel/plugin-transform-object-super": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.16.7.tgz", - "integrity": "sha512-14J1feiQVWaGvRxj2WjyMuXS2jsBkgB3MdSN5HuC2G5nRspa5RK9COcs82Pwy5BuGcjb+fYaUj94mYcOj7rCvw==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.22.5.tgz", + "integrity": "sha512-klXqyaT9trSjIUrcsYIfETAzmOEZL3cBYqOYLJxBHfMFFggmXOv+NYSX/Jbs9mzMVESw/WycLFPRx8ba/b2Ipw==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/helper-replace-supers": "^7.22.5" + } + }, + "@babel/plugin-transform-optional-catch-binding": { + "version": "7.22.11", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-optional-catch-binding/-/plugin-transform-optional-catch-binding-7.22.11.tgz", + "integrity": "sha512-rli0WxesXUeCJnMYhzAglEjLWVDF6ahb45HuprcmQuLidBJFWjNnOzssk2kuc6e33FlLaiZhG/kUIzUMWdBKaQ==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.16.7", - "@babel/helper-replace-supers": "^7.16.7" + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/plugin-syntax-optional-catch-binding": "^7.8.3" + } + }, + "@babel/plugin-transform-optional-chaining": { + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-optional-chaining/-/plugin-transform-optional-chaining-7.23.0.tgz", + "integrity": "sha512-sBBGXbLJjxTzLBF5rFWaikMnOGOk/BmK6vVByIdEggZ7Vn6CvWXZyRkkLFK6WE0IF8jSliyOkUN6SScFgzCM0g==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/helper-skip-transparent-expression-wrappers": "^7.22.5", + "@babel/plugin-syntax-optional-chaining": "^7.8.3" } }, "@babel/plugin-transform-parameters": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.16.7.tgz", - "integrity": "sha512-AT3MufQ7zZEhU2hwOA11axBnExW0Lszu4RL/tAlUJBuNoRak+wehQW8h6KcXOcgjY42fHtDxswuMhMjFEuv/aw==", + "version": "7.22.15", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.22.15.tgz", + "integrity": "sha512-hjk7qKIqhyzhhUvRT683TYQOFa/4cQKwQy7ALvTpODswN40MljzNDa0YldevS6tGbxwaEKVn502JmY0dP7qEtQ==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.22.5" + } + }, + "@babel/plugin-transform-private-methods": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-private-methods/-/plugin-transform-private-methods-7.22.5.tgz", + "integrity": "sha512-PPjh4gyrQnGe97JTalgRGMuU4icsZFnWkzicB/fUtzlKUqvsWBKEpPPfr5a2JiyirZkHxnAqkQMO5Z5B2kK3fA==", + "dev": true, + "requires": { + "@babel/helper-create-class-features-plugin": "^7.22.5", + "@babel/helper-plugin-utils": "^7.22.5" + } + }, + "@babel/plugin-transform-private-property-in-object": { + "version": "7.22.11", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-private-property-in-object/-/plugin-transform-private-property-in-object-7.22.11.tgz", + "integrity": "sha512-sSCbqZDBKHetvjSwpyWzhuHkmW5RummxJBVbYLkGkaiTOWGxml7SXt0iWa03bzxFIx7wOj3g/ILRd0RcJKBeSQ==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.16.7" + "@babel/helper-annotate-as-pure": "^7.22.5", + "@babel/helper-create-class-features-plugin": "^7.22.11", + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/plugin-syntax-private-property-in-object": "^7.14.5" } }, "@babel/plugin-transform-property-literals": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.16.7.tgz", - "integrity": "sha512-z4FGr9NMGdoIl1RqavCqGG+ZuYjfZ/hkCIeuH6Do7tXmSm0ls11nYVSJqFEUOSJbDab5wC6lRE/w6YjVcr6Hqw==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.22.5.tgz", + "integrity": "sha512-TiOArgddK3mK/x1Qwf5hay2pxI6wCZnvQqrFSqbtg1GLl2JcNMitVH/YnqjP+M31pLUeTfzY1HAXFDnUBV30rQ==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.16.7" + "@babel/helper-plugin-utils": "^7.22.5" } }, "@babel/plugin-transform-regenerator": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.16.7.tgz", - "integrity": "sha512-mF7jOgGYCkSJagJ6XCujSQg+6xC1M77/03K2oBmVJWoFGNUtnVJO4WHKJk3dnPC8HCcj4xBQP1Egm8DWh3Pb3Q==", + "version": "7.22.10", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.22.10.tgz", + "integrity": "sha512-F28b1mDt8KcT5bUyJc/U9nwzw6cV+UmTeRlXYIl2TNqMMJif0Jeey9/RQ3C4NOd2zp0/TRsDns9ttj2L523rsw==", "dev": true, "requires": { - "regenerator-transform": "^0.14.2" + "@babel/helper-plugin-utils": "^7.22.5", + "regenerator-transform": "^0.15.2" } }, "@babel/plugin-transform-reserved-words": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.16.7.tgz", - "integrity": "sha512-KQzzDnZ9hWQBjwi5lpY5v9shmm6IVG0U9pB18zvMu2i4H90xpT4gmqwPYsn8rObiadYe2M0gmgsiOIF5A/2rtg==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.22.5.tgz", + "integrity": "sha512-DTtGKFRQUDm8svigJzZHzb/2xatPc6TzNvAIJ5GqOKDsGFYgAskjRulbR/vGsPKq3OPqtexnz327qYpP57RFyA==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.16.7" + "@babel/helper-plugin-utils": "^7.22.5" } }, "@babel/plugin-transform-shorthand-properties": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.16.7.tgz", - "integrity": "sha512-hah2+FEnoRoATdIb05IOXf+4GzXYTq75TVhIn1PewihbpyrNWUt2JbudKQOETWw6QpLe+AIUpJ5MVLYTQbeeUg==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.22.5.tgz", + "integrity": "sha512-vM4fq9IXHscXVKzDv5itkO1X52SmdFBFcMIBZ2FRn2nqVYqw6dBexUgMvAjHW+KXpPPViD/Yo3GrDEBaRC0QYA==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.16.7" + "@babel/helper-plugin-utils": "^7.22.5" } }, "@babel/plugin-transform-spread": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-spread/-/plugin-transform-spread-7.16.7.tgz", - "integrity": "sha512-+pjJpgAngb53L0iaA5gU/1MLXJIfXcYepLgXB3esVRf4fqmj8f2cxM3/FKaHsZms08hFQJkFccEWuIpm429TXg==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-spread/-/plugin-transform-spread-7.22.5.tgz", + "integrity": "sha512-5ZzDQIGyvN4w8+dMmpohL6MBo+l2G7tfC/O2Dg7/hjpgeWvUx8FzfeOKxGog9IimPa4YekaQ9PlDqTLOljkcxg==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.16.7", - "@babel/helper-skip-transparent-expression-wrappers": "^7.16.0" + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/helper-skip-transparent-expression-wrappers": "^7.22.5" } }, "@babel/plugin-transform-sticky-regex": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.16.7.tgz", - "integrity": "sha512-NJa0Bd/87QV5NZZzTuZG5BPJjLYadeSZ9fO6oOUoL4iQx+9EEuw/eEM92SrsT19Yc2jgB1u1hsjqDtH02c3Drw==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.22.5.tgz", + "integrity": "sha512-zf7LuNpHG0iEeiyCNwX4j3gDg1jgt1k3ZdXBKbZSoA3BbGQGvMiSvfbZRR3Dr3aeJe3ooWFZxOOG3IRStYp2Bw==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.16.7" + "@babel/helper-plugin-utils": "^7.22.5" } }, "@babel/plugin-transform-template-literals": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.16.7.tgz", - "integrity": "sha512-VwbkDDUeenlIjmfNeDX/V0aWrQH2QiVyJtwymVQSzItFDTpxfyJh3EVaQiS0rIN/CqbLGr0VcGmuwyTdZtdIsA==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.22.5.tgz", + "integrity": "sha512-5ciOehRNf+EyUeewo8NkbQiUs4d6ZxiHo6BcBcnFlgiJfu16q0bQUw9Jvo0b0gBKFG1SMhDSjeKXSYuJLeFSMA==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.16.7" + "@babel/helper-plugin-utils": "^7.22.5" } }, "@babel/plugin-transform-typeof-symbol": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.16.7.tgz", - "integrity": "sha512-p2rOixCKRJzpg9JB4gjnG4gjWkWa89ZoYUnl9snJ1cWIcTH/hvxZqfO+WjG6T8DRBpctEol5jw1O5rA8gkCokQ==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.22.5.tgz", + "integrity": "sha512-bYkI5lMzL4kPii4HHEEChkD0rkc+nvnlR6+o/qdqR6zrm0Sv/nodmyLhlq2DO0YKLUNd2VePmPRjJXSBh9OIdA==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.16.7" + "@babel/helper-plugin-utils": "^7.22.5" } }, - "@babel/plugin-transform-typescript": { - "version": "7.16.8", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.16.8.tgz", - "integrity": "sha512-bHdQ9k7YpBDO2d0NVfkj51DpQcvwIzIusJ7mEUaMlbZq3Kt/U47j24inXZHQ5MDiYpCs+oZiwnXyKedE8+q7AQ==", + "@babel/plugin-transform-unicode-escapes": { + "version": "7.22.10", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-escapes/-/plugin-transform-unicode-escapes-7.22.10.tgz", + "integrity": "sha512-lRfaRKGZCBqDlRU3UIFovdp9c9mEvlylmpod0/OatICsSfuQ9YFthRo1tpTkGsklEefZdqlEFdY4A2dwTb6ohg==", "dev": true, "requires": { - "@babel/helper-create-class-features-plugin": "^7.16.7", - "@babel/helper-plugin-utils": "^7.16.7", - "@babel/plugin-syntax-typescript": "^7.16.7" + "@babel/helper-plugin-utils": "^7.22.5" } }, - "@babel/plugin-transform-unicode-escapes": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-escapes/-/plugin-transform-unicode-escapes-7.16.7.tgz", - "integrity": "sha512-TAV5IGahIz3yZ9/Hfv35TV2xEm+kaBDaZQCn2S/hG9/CZ0DktxJv9eKfPc7yYCvOYR4JGx1h8C+jcSOvgaaI/Q==", + "@babel/plugin-transform-unicode-property-regex": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-property-regex/-/plugin-transform-unicode-property-regex-7.22.5.tgz", + "integrity": "sha512-HCCIb+CbJIAE6sXn5CjFQXMwkCClcOfPCzTlilJ8cUatfzwHlWQkbtV0zD338u9dZskwvuOYTuuaMaA8J5EI5A==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.16.7" + "@babel/helper-create-regexp-features-plugin": "^7.22.5", + "@babel/helper-plugin-utils": "^7.22.5" } }, "@babel/plugin-transform-unicode-regex": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.16.7.tgz", - "integrity": "sha512-oC5tYYKw56HO75KZVLQ+R/Nl3Hro9kf8iG0hXoaHP7tjAyCpvqBiSNe6vGrZni1Z6MggmUOC6A7VP7AVmw225Q==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.22.5.tgz", + "integrity": "sha512-028laaOKptN5vHJf9/Arr/HiJekMd41hOEZYvNsrsXqJ7YPYuX2bQxh31fkZzGmq3YqHRJzYFFAVYvKfMPKqyg==", + "dev": true, + "requires": { + "@babel/helper-create-regexp-features-plugin": "^7.22.5", + "@babel/helper-plugin-utils": "^7.22.5" + } + }, + "@babel/plugin-transform-unicode-sets-regex": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-sets-regex/-/plugin-transform-unicode-sets-regex-7.22.5.tgz", + "integrity": "sha512-lhMfi4FC15j13eKrh3DnYHjpGj6UKQHtNKTbtc1igvAhRy4+kLhV07OpLcsN0VgDEw/MjAvJO4BdMJsHwMhzCg==", "dev": true, "requires": { - "@babel/helper-create-regexp-features-plugin": "^7.16.7", - "@babel/helper-plugin-utils": "^7.16.7" + "@babel/helper-create-regexp-features-plugin": "^7.22.5", + "@babel/helper-plugin-utils": "^7.22.5" } }, "@babel/preset-env": { - "version": "7.16.11", - "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.16.11.tgz", - "integrity": "sha512-qcmWG8R7ZW6WBRPZK//y+E3Cli151B20W1Rv7ln27vuPaXU/8TKms6jFdiJtF7UDTxcrb7mZd88tAeK9LjdT8g==", - "dev": true, - "requires": { - "@babel/compat-data": "^7.16.8", - "@babel/helper-compilation-targets": "^7.16.7", - "@babel/helper-plugin-utils": "^7.16.7", - "@babel/helper-validator-option": "^7.16.7", - "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": "^7.16.7", - "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": "^7.16.7", - "@babel/plugin-proposal-async-generator-functions": "^7.16.8", - "@babel/plugin-proposal-class-properties": "^7.16.7", - "@babel/plugin-proposal-class-static-block": "^7.16.7", - "@babel/plugin-proposal-dynamic-import": "^7.16.7", - "@babel/plugin-proposal-export-namespace-from": "^7.16.7", - "@babel/plugin-proposal-json-strings": "^7.16.7", - "@babel/plugin-proposal-logical-assignment-operators": "^7.16.7", - "@babel/plugin-proposal-nullish-coalescing-operator": "^7.16.7", - "@babel/plugin-proposal-numeric-separator": "^7.16.7", - "@babel/plugin-proposal-object-rest-spread": "^7.16.7", - "@babel/plugin-proposal-optional-catch-binding": "^7.16.7", - "@babel/plugin-proposal-optional-chaining": "^7.16.7", - "@babel/plugin-proposal-private-methods": "^7.16.11", - "@babel/plugin-proposal-private-property-in-object": "^7.16.7", - "@babel/plugin-proposal-unicode-property-regex": "^7.16.7", + "version": "7.22.20", + "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.22.20.tgz", + "integrity": "sha512-11MY04gGC4kSzlPHRfvVkNAZhUxOvm7DCJ37hPDnUENwe06npjIRAfInEMTGSb4LZK5ZgDFkv5hw0lGebHeTyg==", + "dev": true, + "requires": { + "@babel/compat-data": "^7.22.20", + "@babel/helper-compilation-targets": "^7.22.15", + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/helper-validator-option": "^7.22.15", + "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": "^7.22.15", + "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": "^7.22.15", + "@babel/plugin-proposal-private-property-in-object": "7.21.0-placeholder-for-preset-env.2", "@babel/plugin-syntax-async-generators": "^7.8.4", "@babel/plugin-syntax-class-properties": "^7.12.13", "@babel/plugin-syntax-class-static-block": "^7.14.5", "@babel/plugin-syntax-dynamic-import": "^7.8.3", "@babel/plugin-syntax-export-namespace-from": "^7.8.3", + "@babel/plugin-syntax-import-assertions": "^7.22.5", + "@babel/plugin-syntax-import-attributes": "^7.22.5", + "@babel/plugin-syntax-import-meta": "^7.10.4", "@babel/plugin-syntax-json-strings": "^7.8.3", "@babel/plugin-syntax-logical-assignment-operators": "^7.10.4", "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3", @@ -15759,123 +15526,154 @@ "@babel/plugin-syntax-optional-chaining": "^7.8.3", "@babel/plugin-syntax-private-property-in-object": "^7.14.5", "@babel/plugin-syntax-top-level-await": "^7.14.5", - "@babel/plugin-transform-arrow-functions": "^7.16.7", - "@babel/plugin-transform-async-to-generator": "^7.16.8", - "@babel/plugin-transform-block-scoped-functions": "^7.16.7", - "@babel/plugin-transform-block-scoping": "^7.16.7", - "@babel/plugin-transform-classes": "^7.16.7", - "@babel/plugin-transform-computed-properties": "^7.16.7", - "@babel/plugin-transform-destructuring": "^7.16.7", - "@babel/plugin-transform-dotall-regex": "^7.16.7", - "@babel/plugin-transform-duplicate-keys": "^7.16.7", - "@babel/plugin-transform-exponentiation-operator": "^7.16.7", - "@babel/plugin-transform-for-of": "^7.16.7", - "@babel/plugin-transform-function-name": "^7.16.7", - "@babel/plugin-transform-literals": "^7.16.7", - "@babel/plugin-transform-member-expression-literals": "^7.16.7", - "@babel/plugin-transform-modules-amd": "^7.16.7", - "@babel/plugin-transform-modules-commonjs": "^7.16.8", - "@babel/plugin-transform-modules-systemjs": "^7.16.7", - "@babel/plugin-transform-modules-umd": "^7.16.7", - "@babel/plugin-transform-named-capturing-groups-regex": "^7.16.8", - "@babel/plugin-transform-new-target": "^7.16.7", - "@babel/plugin-transform-object-super": "^7.16.7", - "@babel/plugin-transform-parameters": "^7.16.7", - "@babel/plugin-transform-property-literals": "^7.16.7", - "@babel/plugin-transform-regenerator": "^7.16.7", - "@babel/plugin-transform-reserved-words": "^7.16.7", - "@babel/plugin-transform-shorthand-properties": "^7.16.7", - "@babel/plugin-transform-spread": "^7.16.7", - "@babel/plugin-transform-sticky-regex": "^7.16.7", - "@babel/plugin-transform-template-literals": "^7.16.7", - "@babel/plugin-transform-typeof-symbol": "^7.16.7", - "@babel/plugin-transform-unicode-escapes": "^7.16.7", - "@babel/plugin-transform-unicode-regex": "^7.16.7", - "@babel/preset-modules": "^0.1.5", - "@babel/types": "^7.16.8", - "babel-plugin-polyfill-corejs2": "^0.3.0", - "babel-plugin-polyfill-corejs3": "^0.5.0", - "babel-plugin-polyfill-regenerator": "^0.3.0", - "core-js-compat": "^3.20.2", - "semver": "^6.3.0" + "@babel/plugin-syntax-unicode-sets-regex": "^7.18.6", + "@babel/plugin-transform-arrow-functions": "^7.22.5", + "@babel/plugin-transform-async-generator-functions": "^7.22.15", + "@babel/plugin-transform-async-to-generator": "^7.22.5", + "@babel/plugin-transform-block-scoped-functions": "^7.22.5", + "@babel/plugin-transform-block-scoping": "^7.22.15", + "@babel/plugin-transform-class-properties": "^7.22.5", + "@babel/plugin-transform-class-static-block": "^7.22.11", + "@babel/plugin-transform-classes": "^7.22.15", + "@babel/plugin-transform-computed-properties": "^7.22.5", + "@babel/plugin-transform-destructuring": "^7.22.15", + "@babel/plugin-transform-dotall-regex": "^7.22.5", + "@babel/plugin-transform-duplicate-keys": "^7.22.5", + "@babel/plugin-transform-dynamic-import": "^7.22.11", + "@babel/plugin-transform-exponentiation-operator": "^7.22.5", + "@babel/plugin-transform-export-namespace-from": "^7.22.11", + "@babel/plugin-transform-for-of": "^7.22.15", + "@babel/plugin-transform-function-name": "^7.22.5", + "@babel/plugin-transform-json-strings": "^7.22.11", + "@babel/plugin-transform-literals": "^7.22.5", + "@babel/plugin-transform-logical-assignment-operators": "^7.22.11", + "@babel/plugin-transform-member-expression-literals": "^7.22.5", + "@babel/plugin-transform-modules-amd": "^7.22.5", + "@babel/plugin-transform-modules-commonjs": "^7.22.15", + "@babel/plugin-transform-modules-systemjs": "^7.22.11", + "@babel/plugin-transform-modules-umd": "^7.22.5", + "@babel/plugin-transform-named-capturing-groups-regex": "^7.22.5", + "@babel/plugin-transform-new-target": "^7.22.5", + "@babel/plugin-transform-nullish-coalescing-operator": "^7.22.11", + "@babel/plugin-transform-numeric-separator": "^7.22.11", + "@babel/plugin-transform-object-rest-spread": "^7.22.15", + "@babel/plugin-transform-object-super": "^7.22.5", + "@babel/plugin-transform-optional-catch-binding": "^7.22.11", + "@babel/plugin-transform-optional-chaining": "^7.22.15", + "@babel/plugin-transform-parameters": "^7.22.15", + "@babel/plugin-transform-private-methods": "^7.22.5", + "@babel/plugin-transform-private-property-in-object": "^7.22.11", + "@babel/plugin-transform-property-literals": "^7.22.5", + "@babel/plugin-transform-regenerator": "^7.22.10", + "@babel/plugin-transform-reserved-words": "^7.22.5", + "@babel/plugin-transform-shorthand-properties": "^7.22.5", + "@babel/plugin-transform-spread": "^7.22.5", + "@babel/plugin-transform-sticky-regex": "^7.22.5", + "@babel/plugin-transform-template-literals": "^7.22.5", + "@babel/plugin-transform-typeof-symbol": "^7.22.5", + "@babel/plugin-transform-unicode-escapes": "^7.22.10", + "@babel/plugin-transform-unicode-property-regex": "^7.22.5", + "@babel/plugin-transform-unicode-regex": "^7.22.5", + "@babel/plugin-transform-unicode-sets-regex": "^7.22.5", + "@babel/preset-modules": "0.1.6-no-external-plugins", + "@babel/types": "^7.22.19", + "babel-plugin-polyfill-corejs2": "^0.4.5", + "babel-plugin-polyfill-corejs3": "^0.8.3", + "babel-plugin-polyfill-regenerator": "^0.5.2", + "core-js-compat": "^3.31.0", + "semver": "^6.3.1" + }, + "dependencies": { + "@babel/compat-data": { + "version": "7.22.20", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.22.20.tgz", + "integrity": "sha512-BQYjKbpXjoXwFW5jGqiizJQQT/aC7pFm9Ok1OWssonuguICi264lbgMzRp2ZMmRSlfkX6DsWDDcsrctK8Rwfiw==", + "dev": true + } } }, "@babel/preset-modules": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/@babel/preset-modules/-/preset-modules-0.1.5.tgz", - "integrity": "sha512-A57th6YRG7oR3cq/yt/Y84MvGgE0eJG2F1JLhKuyG+jFxEgrd/HAMJatiFtmOiZurz+0DkrvbheCLaV5f2JfjA==", + "version": "0.1.6-no-external-plugins", + "resolved": "https://registry.npmjs.org/@babel/preset-modules/-/preset-modules-0.1.6-no-external-plugins.tgz", + "integrity": "sha512-HrcgcIESLm9aIR842yhJ5RWan/gebQUJ6E/E5+rf0y9o6oj7w0Br+sWuL6kEQ/o/AdfvR1Je9jG18/gnpwjEyA==", "dev": true, "requires": { "@babel/helper-plugin-utils": "^7.0.0", - "@babel/plugin-proposal-unicode-property-regex": "^7.4.4", - "@babel/plugin-transform-dotall-regex": "^7.4.4", "@babel/types": "^7.4.4", "esutils": "^2.0.2" } }, - "@babel/preset-typescript": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/preset-typescript/-/preset-typescript-7.16.7.tgz", - "integrity": "sha512-WbVEmgXdIyvzB77AQjGBEyYPZx+8tTsO50XtfozQrkW8QB2rLJpH2lgx0TRw5EJrBxOZQ+wCcyPVQvS8tjEHpQ==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.16.7", - "@babel/helper-validator-option": "^7.16.7", - "@babel/plugin-transform-typescript": "^7.16.7" - } + "@babel/regjsgen": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/@babel/regjsgen/-/regjsgen-0.8.0.tgz", + "integrity": "sha512-x/rqGMdzj+fWZvCOYForTghzbtqPDZ5gPwaoNGHdgDfF2QA/XZbCBp4Moo5scrkAMPhB7z26XM/AaHuIJdgauA==", + "dev": true }, "@babel/runtime": { - "version": "7.17.2", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.17.2.tgz", - "integrity": "sha512-hzeyJyMA1YGdJTuWU0e/j4wKXrU4OMFvY2MSlaI9B7VQb0r5cxTE3EAIS2Q7Tn2RIcDkRvTA/v2JsAEhxe99uw==", + "version": "7.22.10", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.22.10.tgz", + "integrity": "sha512-21t/fkKLMZI4pqP2wlmsQAWnYW1PDyKyyUV4vCi+B25ydmdaYTKXPwCj0BzSUnZf4seIiYvSA3jcZ3gdsMFkLQ==", "dev": true, "requires": { - "regenerator-runtime": "^0.13.4" + "regenerator-runtime": "^0.14.0" } }, "@babel/template": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.16.7.tgz", - "integrity": "sha512-I8j/x8kHUrbYRTUxXrrMbfCa7jxkE7tZre39x3kjr9hvI82cK1FfqLygotcWN5kdPGWcLdWMHpSBavse5tWw3w==", + "version": "7.22.15", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.22.15.tgz", + "integrity": "sha512-QPErUVm4uyJa60rkI73qneDacvdvzxshT3kksGqlGWYdOTIUOwJ7RDUL8sGqslY1uXWSL6xMFKEXDS3ox2uF0w==", "dev": true, "requires": { - "@babel/code-frame": "^7.16.7", - "@babel/parser": "^7.16.7", - "@babel/types": "^7.16.7" + "@babel/code-frame": "^7.22.13", + "@babel/parser": "^7.22.15", + "@babel/types": "^7.22.15" } }, "@babel/traverse": { - "version": "7.17.3", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.17.3.tgz", - "integrity": "sha512-5irClVky7TxRWIRtxlh2WPUUOLhcPN06AGgaQSB8AEwuyEBgJVuJ5imdHm5zxk8w0QS5T+tDfnDxAlhWjpb7cw==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.16.7", - "@babel/generator": "^7.17.3", - "@babel/helper-environment-visitor": "^7.16.7", - "@babel/helper-function-name": "^7.16.7", - "@babel/helper-hoist-variables": "^7.16.7", - "@babel/helper-split-export-declaration": "^7.16.7", - "@babel/parser": "^7.17.3", - "@babel/types": "^7.17.0", + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.23.0.tgz", + "integrity": "sha512-t/QaEvyIoIkwzpiZ7aoSKK8kObQYeF7T2v+dazAYCb8SXtp58zEVkWW7zAnju8FNKNdr4ScAOEDmMItbyOmEYw==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.22.13", + "@babel/generator": "^7.23.0", + "@babel/helper-environment-visitor": "^7.22.20", + "@babel/helper-function-name": "^7.23.0", + "@babel/helper-hoist-variables": "^7.22.5", + "@babel/helper-split-export-declaration": "^7.22.6", + "@babel/parser": "^7.23.0", + "@babel/types": "^7.23.0", "debug": "^4.1.0", "globals": "^11.1.0" + }, + "dependencies": { + "@babel/helper-function-name": { + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.23.0.tgz", + "integrity": "sha512-OErEqsrxjZTJciZ4Oo+eoZqeW9UIiOcuYKRJA4ZAgV9myA+pOXhhmpfNCKjEH/auVfEYVFJ6y1Tc4r0eIApqiw==", + "dev": true, + "requires": { + "@babel/template": "^7.22.15", + "@babel/types": "^7.23.0" + } + } } }, "@babel/types": { - "version": "7.17.0", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.17.0.tgz", - "integrity": "sha512-TmKSNO4D5rzhL5bjWFcVHHLETzfQ/AmbKpKPOSjlP0WoHZ6L911fgoOKY4Alp/emzG4cHJdyN49zpgkbXFEHHw==", + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.23.0.tgz", + "integrity": "sha512-0oIyUfKoI3mSqMvsxBdclDwxXKXAUA8v/apZbc+iSyARYou1o8ZGDxbUYyLFoW2arqS2jDGqJuZvv1d/io1axg==", "dev": true, "requires": { - "@babel/helper-validator-identifier": "^7.16.7", + "@babel/helper-string-parser": "^7.22.5", + "@babel/helper-validator-identifier": "^7.22.20", "to-fast-properties": "^2.0.0" } }, "@bcherny/json-schema-ref-parser": { - "version": "9.0.9", - "resolved": "https://registry.npmjs.org/@bcherny/json-schema-ref-parser/-/json-schema-ref-parser-9.0.9.tgz", - "integrity": "sha512-vmEmnJCfpkLdas++9OYg6riIezTYqTHpqUTODJzHLzs5UnXujbOJW9VwcVCnyo1mVRt32FRr23iXBx/sX8YbeQ==", + "version": "10.0.5-fork", + "resolved": "https://registry.npmjs.org/@bcherny/json-schema-ref-parser/-/json-schema-ref-parser-10.0.5-fork.tgz", + "integrity": "sha512-E/jKbPoca1tfUPj3iSbitDZTGnq6FUFjkH6L8U2oDwSuwK1WhnnVtCG7oFOTg/DDnyoXbQYUiUiGOibHqaGVnw==", "dev": true, "requires": { "@jsdevtools/ono": "^7.1.3", @@ -15916,63 +15714,115 @@ "sjcl": "^1.0.8" } }, + "@eslint-community/eslint-utils": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", + "integrity": "sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==", + "dev": true, + "requires": { + "eslint-visitor-keys": "^3.3.0" + }, + "dependencies": { + "eslint-visitor-keys": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", + "dev": true + } + } + }, + "@eslint-community/regexpp": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.6.2.tgz", + "integrity": "sha512-pPTNuaAG3QMH+buKyBIGJs3g/S5y0caxw0ygM3YyE6yJFySwiGGSzA+mM3KJ8QQvzeLh3blwgSonkFjgQdxzMw==", + "dev": true + }, "@eslint/eslintrc": { - "version": "0.4.3", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.4.3.tgz", - "integrity": "sha512-J6KFFz5QCYUJq3pf0mjEcCJVERbzv71PUIDczuh9JkwGEzced6CO5ADLHB1rbf/+oPBtoPfMYNOpGDzCANlbXw==", + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.2.tgz", + "integrity": "sha512-+wvgpDsrB1YqAMdEUCcnTlpfVBH7Vqn6A/NT3D8WVXFIaKMlErPIZT3oCIAVCOtarRpMtelZLqJeU3t7WY6X6g==", "dev": true, "requires": { "ajv": "^6.12.4", - "debug": "^4.1.1", - "espree": "^7.3.0", - "globals": "^13.9.0", - "ignore": "^4.0.6", + "debug": "^4.3.2", + "espree": "^9.6.0", + "globals": "^13.19.0", + "ignore": "^5.2.0", "import-fresh": "^3.2.1", - "js-yaml": "^3.13.1", - "minimatch": "^3.0.4", + "js-yaml": "^4.1.0", + "minimatch": "^3.1.2", "strip-json-comments": "^3.1.1" }, "dependencies": { - "ajv": { - "version": "6.12.6", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", - "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true + }, + "globals": { + "version": "13.21.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.21.0.tgz", + "integrity": "sha512-ybyme3s4yy/t/3s35bewwXKOf7cvzfreG2lH0lZl0JB7I4GxRP2ghxOK/Nb9EkRXdbBXZLfq/p/0W2JUONB/Gg==", "dev": true, "requires": { - "fast-deep-equal": "^3.1.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" + "type-fest": "^0.20.2" } }, - "globals": { - "version": "13.15.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.15.0.tgz", - "integrity": "sha512-bpzcOlgDhMG070Av0Vy5Owklpv1I6+j96GhUI7Rh7IzDCKLzboflLrrfqMu8NquDbiR4EOQk7XzJwqVJxicxog==", + "js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", "dev": true, "requires": { - "type-fest": "^0.20.2" + "argparse": "^2.0.1" } }, - "json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", - "dev": true + "minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "requires": { + "brace-expansion": "^1.1.7" + } } } }, + "@eslint/js": { + "version": "8.50.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.50.0.tgz", + "integrity": "sha512-NCC3zz2+nvYd+Ckfh87rA47zfu2QsQpvc6k1yzTk+b9KzRj0wkGa8LSoGOXN6Zv4lRf/EIoZ80biDh9HOI+RNQ==", + "dev": true + }, "@humanwhocodes/config-array": { - "version": "0.9.5", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.9.5.tgz", - "integrity": "sha512-ObyMyWxZiCu/yTisA7uzx81s40xR2fD5Cg/2Kq7G02ajkNubJf6BopgDTmDyc3U7sXpNKM8cYOw7s7Tyr+DnCw==", + "version": "0.11.11", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.11.tgz", + "integrity": "sha512-N2brEuAadi0CcdeMXUkhbZB84eskAc8MEX1By6qEchoVywSgXPIjou4rYsl0V3Hj0ZnuGycGCjdNgockbzeWNA==", "dev": true, "requires": { "@humanwhocodes/object-schema": "^1.2.1", "debug": "^4.1.1", - "minimatch": "^3.0.4" + "minimatch": "^3.0.5" + }, + "dependencies": { + "minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "requires": { + "brace-expansion": "^1.1.7" + } + } } }, + "@humanwhocodes/module-importer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", + "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", + "dev": true + }, "@humanwhocodes/object-schema": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz", @@ -16029,12 +15879,6 @@ "p-limit": "^2.2.0" } }, - "p-try": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", - "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", - "dev": true - }, "path-exists": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", @@ -16056,16 +15900,16 @@ "dev": true }, "@jest/console": { - "version": "27.5.1", - "resolved": "https://registry.npmjs.org/@jest/console/-/console-27.5.1.tgz", - "integrity": "sha512-kZ/tNpS3NXn0mlXXXPNuDZnb4c0oZ20r4K5eemM2k30ZC3G0T02nXUvyhf5YdbXWHPEJLc9qGLxEZ216MdL+Zg==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/console/-/console-29.7.0.tgz", + "integrity": "sha512-5Ni4CU7XHQi32IJ398EEP4RrB8eV09sXP2ROqD4bksHrnTree52PsxvX8tpL8LvTZ3pFzXyPbNQReSN41CAhOg==", "dev": true, "requires": { - "@jest/types": "^27.5.1", + "@jest/types": "^29.6.3", "@types/node": "*", "chalk": "^4.0.0", - "jest-message-util": "^27.5.1", - "jest-util": "^27.5.1", + "jest-message-util": "^29.7.0", + "jest-util": "^29.7.0", "slash": "^3.0.0" }, "dependencies": { @@ -16121,37 +15965,37 @@ } }, "@jest/core": { - "version": "27.5.1", - "resolved": "https://registry.npmjs.org/@jest/core/-/core-27.5.1.tgz", - "integrity": "sha512-AK6/UTrvQD0Cd24NSqmIA6rKsu0tKIxfiCducZvqxYdmMisOYAsdItspT+fQDQYARPf8XgjAFZi0ogW2agH5nQ==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/core/-/core-29.7.0.tgz", + "integrity": "sha512-n7aeXWKMnGtDA48y8TLWJPJmLmmZ642Ceo78cYWEpiD7FzDgmNDV/GCVRorPABdXLJZ/9wzzgZAlHjXjxDHGsg==", "dev": true, "requires": { - "@jest/console": "^27.5.1", - "@jest/reporters": "^27.5.1", - "@jest/test-result": "^27.5.1", - "@jest/transform": "^27.5.1", - "@jest/types": "^27.5.1", + "@jest/console": "^29.7.0", + "@jest/reporters": "^29.7.0", + "@jest/test-result": "^29.7.0", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", "@types/node": "*", "ansi-escapes": "^4.2.1", "chalk": "^4.0.0", - "emittery": "^0.8.1", + "ci-info": "^3.2.0", "exit": "^0.1.2", "graceful-fs": "^4.2.9", - "jest-changed-files": "^27.5.1", - "jest-config": "^27.5.1", - "jest-haste-map": "^27.5.1", - "jest-message-util": "^27.5.1", - "jest-regex-util": "^27.5.1", - "jest-resolve": "^27.5.1", - "jest-resolve-dependencies": "^27.5.1", - "jest-runner": "^27.5.1", - "jest-runtime": "^27.5.1", - "jest-snapshot": "^27.5.1", - "jest-util": "^27.5.1", - "jest-validate": "^27.5.1", - "jest-watcher": "^27.5.1", + "jest-changed-files": "^29.7.0", + "jest-config": "^29.7.0", + "jest-haste-map": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-regex-util": "^29.6.3", + "jest-resolve": "^29.7.0", + "jest-resolve-dependencies": "^29.7.0", + "jest-runner": "^29.7.0", + "jest-runtime": "^29.7.0", + "jest-snapshot": "^29.7.0", + "jest-util": "^29.7.0", + "jest-validate": "^29.7.0", + "jest-watcher": "^29.7.0", "micromatch": "^4.0.4", - "rimraf": "^3.0.0", + "pretty-format": "^29.7.0", "slash": "^3.0.0", "strip-ansi": "^6.0.0" }, @@ -16208,73 +16052,92 @@ } }, "@jest/environment": { - "version": "27.5.1", - "resolved": "https://registry.npmjs.org/@jest/environment/-/environment-27.5.1.tgz", - "integrity": "sha512-/WQjhPJe3/ghaol/4Bq480JKXV/Rfw8nQdN7f41fM8VDHLcxKXou6QyXAh3EFr9/bVG3x74z1NWDkP87EiY8gA==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/environment/-/environment-29.7.0.tgz", + "integrity": "sha512-aQIfHDq33ExsN4jP1NWGXhxgQ/wixs60gDiKO+XVMd8Mn0NWPWgc34ZQDTb2jKaUWQ7MuwoitXAsN2XVXNMpAw==", "dev": true, "requires": { - "@jest/fake-timers": "^27.5.1", - "@jest/types": "^27.5.1", + "@jest/fake-timers": "^29.7.0", + "@jest/types": "^29.6.3", "@types/node": "*", - "jest-mock": "^27.5.1" + "jest-mock": "^29.7.0" + } + }, + "@jest/expect": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/expect/-/expect-29.7.0.tgz", + "integrity": "sha512-8uMeAMycttpva3P1lBHB8VciS9V0XAr3GymPpipdyQXbBcuhkLQOSe8E/p92RyAdToS6ZD1tFkX+CkhoECE0dQ==", + "dev": true, + "requires": { + "expect": "^29.7.0", + "jest-snapshot": "^29.7.0" + } + }, + "@jest/expect-utils": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/expect-utils/-/expect-utils-29.7.0.tgz", + "integrity": "sha512-GlsNBWiFQFCVi9QVSx7f5AgMeLxe9YCCs5PuP2O2LdjDAA8Jh9eX7lA1Jq/xdXw3Wb3hyvlFNfZIfcRetSzYcA==", + "dev": true, + "requires": { + "jest-get-type": "^29.6.3" } }, "@jest/fake-timers": { - "version": "27.5.1", - "resolved": "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-27.5.1.tgz", - "integrity": "sha512-/aPowoolwa07k7/oM3aASneNeBGCmGQsc3ugN4u6s4C/+s5M64MFo/+djTdiwcbQlRfFElGuDXWzaWj6QgKObQ==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-29.7.0.tgz", + "integrity": "sha512-q4DH1Ha4TTFPdxLsqDXK1d3+ioSL7yL5oCMJZgDYm6i+6CygW5E5xVr/D1HdsGxjt1ZWSfUAs9OxSB/BNelWrQ==", "dev": true, "requires": { - "@jest/types": "^27.5.1", - "@sinonjs/fake-timers": "^8.0.1", + "@jest/types": "^29.6.3", + "@sinonjs/fake-timers": "^10.0.2", "@types/node": "*", - "jest-message-util": "^27.5.1", - "jest-mock": "^27.5.1", - "jest-util": "^27.5.1" + "jest-message-util": "^29.7.0", + "jest-mock": "^29.7.0", + "jest-util": "^29.7.0" } }, "@jest/globals": { - "version": "27.5.1", - "resolved": "https://registry.npmjs.org/@jest/globals/-/globals-27.5.1.tgz", - "integrity": "sha512-ZEJNB41OBQQgGzgyInAv0UUfDDj3upmHydjieSxFvTRuZElrx7tXg/uVQ5hYVEwiXs3+aMsAeEc9X7xiSKCm4Q==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/globals/-/globals-29.7.0.tgz", + "integrity": "sha512-mpiz3dutLbkW2MNFubUGUEVLkTGiqW6yLVTA+JbP6fI6J5iL9Y0Nlg8k95pcF8ctKwCS7WVxteBs29hhfAotzQ==", "dev": true, "requires": { - "@jest/environment": "^27.5.1", - "@jest/types": "^27.5.1", - "expect": "^27.5.1" + "@jest/environment": "^29.7.0", + "@jest/expect": "^29.7.0", + "@jest/types": "^29.6.3", + "jest-mock": "^29.7.0" } }, "@jest/reporters": { - "version": "27.5.1", - "resolved": "https://registry.npmjs.org/@jest/reporters/-/reporters-27.5.1.tgz", - "integrity": "sha512-cPXh9hWIlVJMQkVk84aIvXuBB4uQQmFqZiacloFuGiP3ah1sbCxCosidXFDfqG8+6fO1oR2dTJTlsOy4VFmUfw==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/reporters/-/reporters-29.7.0.tgz", + "integrity": "sha512-DApq0KJbJOEzAFYjHADNNxAE3KbhxQB1y5Kplb5Waqw6zVbuWatSnMjE5gs8FUgEPmNsnZA3NCWl9NG0ia04Pg==", "dev": true, "requires": { "@bcoe/v8-coverage": "^0.2.3", - "@jest/console": "^27.5.1", - "@jest/test-result": "^27.5.1", - "@jest/transform": "^27.5.1", - "@jest/types": "^27.5.1", + "@jest/console": "^29.7.0", + "@jest/test-result": "^29.7.0", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", + "@jridgewell/trace-mapping": "^0.3.18", "@types/node": "*", "chalk": "^4.0.0", "collect-v8-coverage": "^1.0.0", "exit": "^0.1.2", - "glob": "^7.1.2", + "glob": "^7.1.3", "graceful-fs": "^4.2.9", "istanbul-lib-coverage": "^3.0.0", - "istanbul-lib-instrument": "^5.1.0", + "istanbul-lib-instrument": "^6.0.0", "istanbul-lib-report": "^3.0.0", "istanbul-lib-source-maps": "^4.0.0", "istanbul-reports": "^3.1.3", - "jest-haste-map": "^27.5.1", - "jest-resolve": "^27.5.1", - "jest-util": "^27.5.1", - "jest-worker": "^27.5.1", + "jest-message-util": "^29.7.0", + "jest-util": "^29.7.0", + "jest-worker": "^29.7.0", "slash": "^3.0.0", - "source-map": "^0.6.0", "string-length": "^4.0.1", - "terminal-link": "^2.0.0", - "v8-to-istanbul": "^8.1.0" + "strip-ansi": "^6.0.0", + "v8-to-istanbul": "^9.0.1" }, "dependencies": { "ansi-styles": { @@ -16317,11 +16180,27 @@ "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true }, - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true + "istanbul-lib-instrument": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-6.0.0.tgz", + "integrity": "sha512-x58orMzEVfzPUKqlbLd1hXCnySCxKdDKa6Rjg97CwuLLRI4g3FHTdnExu1OqffVFay6zeMW+T6/DowFLndWnIw==", + "dev": true, + "requires": { + "@babel/core": "^7.12.3", + "@babel/parser": "^7.14.7", + "@istanbuljs/schema": "^0.1.2", + "istanbul-lib-coverage": "^3.2.0", + "semver": "^7.5.4" + } + }, + "semver": { + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "dev": true, + "requires": { + "lru-cache": "^6.0.0" + } }, "supports-color": { "version": "7.2.0", @@ -16334,70 +16213,71 @@ } } }, + "@jest/schemas": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-29.6.3.tgz", + "integrity": "sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA==", + "dev": true, + "requires": { + "@sinclair/typebox": "^0.27.8" + } + }, "@jest/source-map": { - "version": "27.5.1", - "resolved": "https://registry.npmjs.org/@jest/source-map/-/source-map-27.5.1.tgz", - "integrity": "sha512-y9NIHUYF3PJRlHk98NdC/N1gl88BL08aQQgu4k4ZopQkCw9t9cV8mtl3TV8b/YCB8XaVTFrmUTAJvjsntDireg==", + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/@jest/source-map/-/source-map-29.6.3.tgz", + "integrity": "sha512-MHjT95QuipcPrpLM+8JMSzFx6eHp5Bm+4XeFDJlwsvVBjmKNiIAvasGK2fxz2WbGRlnvqehFbh07MMa7n3YJnw==", "dev": true, "requires": { + "@jridgewell/trace-mapping": "^0.3.18", "callsites": "^3.0.0", - "graceful-fs": "^4.2.9", - "source-map": "^0.6.0" - }, - "dependencies": { - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true - } + "graceful-fs": "^4.2.9" } }, "@jest/test-result": { - "version": "27.5.1", - "resolved": "https://registry.npmjs.org/@jest/test-result/-/test-result-27.5.1.tgz", - "integrity": "sha512-EW35l2RYFUcUQxFJz5Cv5MTOxlJIQs4I7gxzi2zVU7PJhOwfYq1MdC5nhSmYjX1gmMmLPvB3sIaC+BkcHRBfag==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/test-result/-/test-result-29.7.0.tgz", + "integrity": "sha512-Fdx+tv6x1zlkJPcWXmMDAG2HBnaR9XPSd5aDWQVsfrZmLVT3lU1cwyxLgRmXR9yrq4NBoEm9BMsfgFzTQAbJYA==", "dev": true, "requires": { - "@jest/console": "^27.5.1", - "@jest/types": "^27.5.1", + "@jest/console": "^29.7.0", + "@jest/types": "^29.6.3", "@types/istanbul-lib-coverage": "^2.0.0", "collect-v8-coverage": "^1.0.0" } }, "@jest/test-sequencer": { - "version": "27.5.1", - "resolved": "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-27.5.1.tgz", - "integrity": "sha512-LCheJF7WB2+9JuCS7VB/EmGIdQuhtqjRNI9A43idHv3E4KltCTsPsLxvdaubFHSYwY/fNjMWjl6vNRhDiN7vpQ==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-29.7.0.tgz", + "integrity": "sha512-GQwJ5WZVrKnOJuiYiAF52UNUJXgTZx1NHjFSEB0qEMmSZKAkdMoIzw/Cj6x6NF4AvV23AUqDpFzQkN/eYCYTxw==", "dev": true, "requires": { - "@jest/test-result": "^27.5.1", + "@jest/test-result": "^29.7.0", "graceful-fs": "^4.2.9", - "jest-haste-map": "^27.5.1", - "jest-runtime": "^27.5.1" + "jest-haste-map": "^29.7.0", + "slash": "^3.0.0" } }, "@jest/transform": { - "version": "27.5.1", - "resolved": "https://registry.npmjs.org/@jest/transform/-/transform-27.5.1.tgz", - "integrity": "sha512-ipON6WtYgl/1329g5AIJVbUuEh0wZVbdpGwC99Jw4LwuoBNS95MVphU6zOeD9pDkon+LLbFL7lOQRapbB8SCHw==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/transform/-/transform-29.7.0.tgz", + "integrity": "sha512-ok/BTPFzFKVMwO5eOHRrvnBVHdRy9IrsrW1GpMaQ9MCnilNLXQKmAX8s1YXDFaai9xJpac2ySzV0YeRRECr2Vw==", "dev": true, "requires": { - "@babel/core": "^7.1.0", - "@jest/types": "^27.5.1", + "@babel/core": "^7.11.6", + "@jest/types": "^29.6.3", + "@jridgewell/trace-mapping": "^0.3.18", "babel-plugin-istanbul": "^6.1.1", "chalk": "^4.0.0", - "convert-source-map": "^1.4.0", - "fast-json-stable-stringify": "^2.0.0", + "convert-source-map": "^2.0.0", + "fast-json-stable-stringify": "^2.1.0", "graceful-fs": "^4.2.9", - "jest-haste-map": "^27.5.1", - "jest-regex-util": "^27.5.1", - "jest-util": "^27.5.1", + "jest-haste-map": "^29.7.0", + "jest-regex-util": "^29.6.3", + "jest-util": "^29.7.0", "micromatch": "^4.0.4", "pirates": "^4.0.4", "slash": "^3.0.0", - "source-map": "^0.6.1", - "write-file-atomic": "^3.0.0" + "write-file-atomic": "^4.0.2" }, "dependencies": { "ansi-styles": { @@ -16440,12 +16320,6 @@ "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true }, - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true - }, "supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", @@ -16458,15 +16332,16 @@ } }, "@jest/types": { - "version": "27.5.1", - "resolved": "https://registry.npmjs.org/@jest/types/-/types-27.5.1.tgz", - "integrity": "sha512-Cx46iJ9QpwQTjIdq5VJu2QTMMs3QlEjI0x1QbBP5W1+nMzyc2XmimiRR/CbX9TO0cPTeUlxWMOu8mslYsJ8DEw==", + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-29.6.3.tgz", + "integrity": "sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw==", "dev": true, "requires": { + "@jest/schemas": "^29.6.3", "@types/istanbul-lib-coverage": "^2.0.0", "@types/istanbul-reports": "^3.0.0", "@types/node": "*", - "@types/yargs": "^16.0.0", + "@types/yargs": "^17.0.8", "chalk": "^4.0.0" }, "dependencies": { @@ -16521,26 +16396,43 @@ } } }, + "@jridgewell/gen-mapping": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz", + "integrity": "sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ==", + "dev": true, + "requires": { + "@jridgewell/set-array": "^1.0.1", + "@jridgewell/sourcemap-codec": "^1.4.10", + "@jridgewell/trace-mapping": "^0.3.9" + } + }, "@jridgewell/resolve-uri": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.0.5.tgz", - "integrity": "sha512-VPeQ7+wH0itvQxnG+lIzWgkysKIr3L9sslimFW55rHMdGu/qCQ5z5h9zq4gI8uBtqkpHhsF4Z/OwExufUCThew==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz", + "integrity": "sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==", + "dev": true + }, + "@jridgewell/set-array": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.2.tgz", + "integrity": "sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==", "dev": true }, "@jridgewell/sourcemap-codec": { - "version": "1.4.11", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.11.tgz", - "integrity": "sha512-Fg32GrJo61m+VqYSdRSjRXMjQ06j8YIYfcTqndLYVAaHmroZHLJZCydsWBOTDqXS2v+mjxohBWEMfg97GXmYQg==", + "version": "1.4.15", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", + "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==", "dev": true }, "@jridgewell/trace-mapping": { - "version": "0.3.4", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.4.tgz", - "integrity": "sha512-vFv9ttIedivx0ux3QSjhgtCVjPZd5l46ZOMDSCwnH1yUO2e964gO8LZGyv2QkqcgR6TnBU1v+1IFqmeoG+0UJQ==", + "version": "0.3.19", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.19.tgz", + "integrity": "sha512-kf37QtfW+Hwx/buWGMPcR60iF9ziHa6r/CZJIHbmcm4+0qrXiVdxegAH0F6yddEVQ7zdkjcGCgCzUu+BcbhQxw==", "dev": true, "requires": { - "@jridgewell/resolve-uri": "^3.0.3", - "@jridgewell/sourcemap-codec": "^1.4.10" + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" } }, "@jsdevtools/ono": { @@ -16549,6 +16441,15 @@ "integrity": "sha512-4JQNk+3mVzK3xh2rqd6RB4J46qUR19azEHBneZyTZM+c456qOrbbM/5xcR8huNCCcbVt7+UmizG6GuUvPvKUYg==", "dev": true }, + "@nicolo-ribaudo/eslint-scope-5-internals": { + "version": "5.1.1-v1", + "resolved": "https://registry.npmjs.org/@nicolo-ribaudo/eslint-scope-5-internals/-/eslint-scope-5-internals-5.1.1-v1.tgz", + "integrity": "sha512-54/JRvkLIzzDWshCWfuhadfrfZVPiElY8Fcgmg1HroEly/EDSszzhBAsarCux+D/kOslTRquNzuyGSmUSTTHGg==", + "dev": true, + "requires": { + "eslint-scope": "5.1.1" + } + }, "@nodelib/fs.scandir": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", @@ -16907,91 +16808,70 @@ } }, "@playwright/test": { - "version": "1.32.0", - "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.32.0.tgz", - "integrity": "sha512-zOdGloaF0jeec7hqoLqM5S3L2rR4WxMJs6lgiAeR70JlH7Ml54ZPoIIf3X7cvnKde3Q9jJ/gaxkFh8fYI9s1rg==", + "version": "1.38.1", + "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.38.1.tgz", + "integrity": "sha512-NqRp8XMwj3AK+zKLbZShl0r/9wKgzqI/527bkptKXomtuo+dOjU9NdMASQ8DNC9z9zLOMbG53T4eihYr3XR+BQ==", "dev": true, "requires": { - "@types/node": "*", - "fsevents": "2.3.2", - "playwright-core": "1.32.0" - }, - "dependencies": { - "playwright-core": { - "version": "1.32.0", - "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.32.0.tgz", - "integrity": "sha512-Z9Ij17X5Z3bjpp6XKujGBp9Gv4eViESac9aDmwgQFUEJBW0K80T21m/Z+XJQlu4cNsvPygw33b6V1Va6Bda5zQ==", - "dev": true - } + "playwright": "1.38.1" } }, + "@sinclair/typebox": { + "version": "0.27.8", + "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz", + "integrity": "sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==", + "dev": true + }, "@sinonjs/commons": { - "version": "1.8.3", - "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.8.3.tgz", - "integrity": "sha512-xkNcLAn/wZaX14RPlwizcKicDk9G3F8m2nU3L7Ukm5zBgTwiT0wsoFAHx9Jq56fJA1z/7uKGtCRu16sOUCLIHQ==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-3.0.0.tgz", + "integrity": "sha512-jXBtWAF4vmdNmZgD5FoKsVLv3rPgDnLgPbU84LIJ3otV44vJlDRokVng5v8NFJdCf/da9legHcKaRuZs4L7faA==", "dev": true, "requires": { "type-detect": "4.0.8" } }, "@sinonjs/fake-timers": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-8.1.0.tgz", - "integrity": "sha512-OAPJUAtgeINhh/TAlUID4QTs53Njm7xzddaVlEs/SXwgtiD1tW22zAB/W1wdqfrpmikgaWQ9Fw6Ws+hsiRm5Vg==", - "dev": true, - "requires": { - "@sinonjs/commons": "^1.7.0" - } - }, - "@sinonjs/samsam": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/@sinonjs/samsam/-/samsam-5.3.1.tgz", - "integrity": "sha512-1Hc0b1TtyfBu8ixF/tpfSHTVWKwCBLY4QJbkgnE7HcwyvT2xArDxb4K7dMgqRm3szI+LJbzmW/s4xxEhv6hwDg==", + "version": "10.3.0", + "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-10.3.0.tgz", + "integrity": "sha512-V4BG07kuYSUkTCSBHG8G8TNhM+F19jXFWnQtzj+we8DrkpSBCee9Z3Ms8yiGer/dlmhe35/Xdgyo3/0rQKg7YA==", "dev": true, "requires": { - "@sinonjs/commons": "^1.6.0", - "lodash.get": "^4.4.2", - "type-detect": "^4.0.8" + "@sinonjs/commons": "^3.0.0" } }, - "@sinonjs/text-encoding": { - "version": "0.7.1", - "resolved": "https://registry.npmjs.org/@sinonjs/text-encoding/-/text-encoding-0.7.1.tgz", - "integrity": "sha512-+iTbntw2IZPb/anVDbypzfQa+ay64MW0Zo8aJ8gZPWMMK6/OubMVb6lUPMagqjOPnmtauXnFCACVl3O7ogjeqQ==", - "dev": true - }, "@tootallnate/once": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-1.1.2.tgz", - "integrity": "sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-2.0.0.tgz", + "integrity": "sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A==", "dev": true }, "@types/babel__core": { - "version": "7.1.18", - "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.1.18.tgz", - "integrity": "sha512-S7unDjm/C7z2A2R9NzfKCK1I+BAALDtxEmsJBwlB3EzNfb929ykjL++1CK9LO++EIp2fQrC8O+BwjKvz6UeDyQ==", + "version": "7.20.2", + "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.2.tgz", + "integrity": "sha512-pNpr1T1xLUc2l3xJKuPtsEky3ybxN3m4fJkknfIpTCTfIZCDW57oAg+EfCgIIp2rvCe0Wn++/FfodDS4YXxBwA==", "dev": true, "requires": { - "@babel/parser": "^7.1.0", - "@babel/types": "^7.0.0", + "@babel/parser": "^7.20.7", + "@babel/types": "^7.20.7", "@types/babel__generator": "*", "@types/babel__template": "*", "@types/babel__traverse": "*" } }, "@types/babel__generator": { - "version": "7.6.4", - "resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.6.4.tgz", - "integrity": "sha512-tFkciB9j2K755yrTALxD44McOrk+gfpIpvC3sxHjRawj6PfnQxrse4Clq5y/Rq+G3mrBurMax/lG8Qn2t9mSsg==", + "version": "7.6.5", + "resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.6.5.tgz", + "integrity": "sha512-h9yIuWbJKdOPLJTbmSpPzkF67e659PbQDba7ifWm5BJ8xTv+sDmS7rFmywkWOvXedGTivCdeGSIIX8WLcRTz8w==", "dev": true, "requires": { "@babel/types": "^7.0.0" } }, "@types/babel__template": { - "version": "7.4.1", - "resolved": "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.4.1.tgz", - "integrity": "sha512-azBFKemX6kMg5Io+/rdGT0dkGreboUVR0Cdm3fz9QJWpaQGJRQXl7C+6hOTCZcMll7KFyEQpgbYI2lHdsS4U7g==", + "version": "7.4.2", + "resolved": "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.4.2.tgz", + "integrity": "sha512-/AVzPICMhMOMYoSx9MoKpGDKdBRsIXMNByh1PXSZoa+v6ZoLa8xxtsT/uLQ/NJm0XVAWl/BvId4MlDeXJaeIZQ==", "dev": true, "requires": { "@babel/parser": "^7.1.0", @@ -16999,12 +16879,12 @@ } }, "@types/babel__traverse": { - "version": "7.14.2", - "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.14.2.tgz", - "integrity": "sha512-K2waXdXBi2302XUdcHcR1jCeU0LL4TD9HRs/gk0N2Xvrht+G/BfJa4QObBQZfhMdxiCpV3COl5Nfq4uKTeTnJA==", + "version": "7.20.2", + "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.20.2.tgz", + "integrity": "sha512-ojlGK1Hsfce93J0+kn3H5R73elidKUaZonirN33GSmgTUMpzI/MIFfSpF3haANe3G1bEBS9/9/QEqwTzwqFsKw==", "dev": true, "requires": { - "@babel/types": "^7.3.0" + "@babel/types": "^7.20.7" } }, "@types/chrome": { @@ -17017,12 +16897,6 @@ "@types/har-format": "*" } }, - "@types/dateformat": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@types/dateformat/-/dateformat-3.0.1.tgz", - "integrity": "sha512-KlPPdikagvL6ELjWsljbyDIPzNCeliYkqRpI+zea99vBBbCIA5JNshZAwQKTON139c87y9qvTFVgkFd14rtS4g==", - "dev": true - }, "@types/filesystem": { "version": "0.0.30", "resolved": "https://registry.npmjs.org/@types/filesystem/-/filesystem-0.0.30.tgz", @@ -17049,9 +16923,9 @@ } }, "@types/graceful-fs": { - "version": "4.1.5", - "resolved": "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.5.tgz", - "integrity": "sha512-anKkLmZZ+xm4p8JWBf4hElkM4XR+EZeA2M9BAkkTldmcyDY4mbdIJnRghDJH3Ov5ooY7/UAoENtmdMSkaAd7Cw==", + "version": "4.1.7", + "resolved": "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.7.tgz", + "integrity": "sha512-MhzcwU8aUygZroVwL2jeYk6JisJrPl/oov/gsgGCue9mkgl9wjGbzReYQClxiUgFDnib9FuHqTndccKeZKxTRw==", "dev": true, "requires": { "@types/node": "*" @@ -17088,25 +16962,36 @@ } }, "@types/jest": { - "version": "27.4.1", - "resolved": "https://registry.npmjs.org/@types/jest/-/jest-27.4.1.tgz", - "integrity": "sha512-23iPJADSmicDVrWk+HT58LMJtzLAnB2AgIzplQuq/bSrGaxCrlvRFjGbXmamnnk/mAmCdLStiGqggu28ocUyiw==", + "version": "29.5.5", + "resolved": "https://registry.npmjs.org/@types/jest/-/jest-29.5.5.tgz", + "integrity": "sha512-ebylz2hnsWR9mYvmBFbXJXr+33UPc4+ZdxyDXh5w0FlPBTfCVN3wPL+kuOiQt3xvrK419v7XWeAs+AeOksafXg==", + "dev": true, + "requires": { + "expect": "^29.0.0", + "pretty-format": "^29.0.0" + } + }, + "@types/jsdom": { + "version": "20.0.1", + "resolved": "https://registry.npmjs.org/@types/jsdom/-/jsdom-20.0.1.tgz", + "integrity": "sha512-d0r18sZPmMQr1eG35u12FZfhIXNrnsPU/g5wvRKCUf/tOGilKKwYMYGqh33BNR6ba+2gkHw1EUiHoN3mn7E5IQ==", "dev": true, "requires": { - "jest-matcher-utils": "^27.0.0", - "pretty-format": "^27.0.0" + "@types/node": "*", + "@types/tough-cookie": "*", + "parse5": "^7.0.0" } }, "@types/json-schema": { - "version": "7.0.11", - "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.11.tgz", - "integrity": "sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ==", + "version": "7.0.12", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.12.tgz", + "integrity": "sha512-Hr5Jfhc9eYOQNPYO5WLDq/n4jqijdHNlDXjuAQkkt+mWdQR+XJToOHrsD4cPaMXpn6KO7y2+wM8AZEs8VpBLVA==", "dev": true }, "@types/json5": { "version": "0.0.29", "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz", - "integrity": "sha1-7ihweulOEdK4J7y+UnC86n8+ce4=", + "integrity": "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==", "dev": true }, "@types/lodash": { @@ -17121,19 +17006,10 @@ "integrity": "sha512-1z8k4wzFnNjVK/tlxvrWuK5WMt6mydWWP7+zvH5eFep4oj+UkrfiJTRtjCeBXNpwaA/FYqqtb4/QS4ianFpIRA==", "dev": true }, - "@types/mkdirp": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@types/mkdirp/-/mkdirp-1.0.2.tgz", - "integrity": "sha512-o0K1tSO0Dx5X6xlU5F1D6625FawhC3dU3iqr25lluNv/+/QIVH8RLNEiVokgIZo+mz+87w/3Mkg/VvQS+J51fQ==", - "dev": true, - "requires": { - "@types/node": "*" - } - }, "@types/node": { - "version": "16.11.36", - "resolved": "https://registry.npmjs.org/@types/node/-/node-16.11.36.tgz", - "integrity": "sha512-FR5QJe+TaoZ2GsMHkjuwoNabr+UrJNRr2HNOo+r/7vhcuntM6Ee/pRPOnRhhL2XE9OOvX9VLEq+BcXl3VjNoWA==", + "version": "18.17.19", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.17.19.tgz", + "integrity": "sha512-+pMhShR3Or5GR0/sp4Da7FnhVmTalWm81M6MkEldbwjETSaPalw138Z4KdpQaistvqQxLB7Cy4xwYdxpbSOs9Q==", "dev": true }, "@types/prettier": { @@ -17142,31 +17018,31 @@ "integrity": "sha512-RI1L7N4JnW5gQw2spvL7Sllfuf1SaHdrZpCHiBlCXjIlufi1SMNnbu2teze3/QE67Fg2tBlH7W+mi4hVNk4p0A==", "dev": true }, - "@types/sinon": { - "version": "7.5.2", - "resolved": "https://registry.npmjs.org/@types/sinon/-/sinon-7.5.2.tgz", - "integrity": "sha512-T+m89VdXj/eidZyejvmoP9jivXgBDdkOSBVQjU9kF349NEx10QdPNGxHeZUaj1IlJ32/ewdyXJjnJxyxJroYwg==", - "dev": true - }, "@types/stack-utils": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-2.0.1.tgz", "integrity": "sha512-Hl219/BT5fLAaz6NDkSuhzasy49dwQS/DSdu4MdggFB8zcXv7vflBI3xp7FEmkmdDkBUI2bPUNeMttp2knYdxw==", "dev": true }, + "@types/tough-cookie": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@types/tough-cookie/-/tough-cookie-4.0.2.tgz", + "integrity": "sha512-Q5vtl1W5ue16D+nIaW8JWebSSraJVlK+EthKn7e7UcD4KWsaSJ8BqGPXNaPghgtcn/fhvrN17Tv8ksUsQpiplw==", + "dev": true + }, "@types/yargs": { - "version": "16.0.4", - "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-16.0.4.tgz", - "integrity": "sha512-T8Yc9wt/5LbJyCaLiHPReJa0kApcIgJ7Bn735GjItUfh08Z1pJvu8QZqb9s+mMvKV6WUQRV7K2R46YbjMXTTJw==", + "version": "17.0.24", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.24.tgz", + "integrity": "sha512-6i0aC7jV6QzQB8ne1joVZ0eSFIstHsCrobmOtghM11yGlH0j43FKL2UhWdELkyps0zuf7qVTUVCCR+tgSlyLLw==", "dev": true, "requires": { "@types/yargs-parser": "*" } }, "@types/yargs-parser": { - "version": "20.2.1", - "resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-20.2.1.tgz", - "integrity": "sha512-7tFImggNeNBVMsn0vLrpn1H1uPrUBdnARPTpZoitY37ZrdJREzf7I16tMrlK3hen349gr1NYh8CmZQa7CTG6Aw==", + "version": "21.0.0", + "resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-21.0.0.tgz", + "integrity": "sha512-iO9ZQHkZxHn4mSakYV0vFHAVDyEOIJQrV2uZ06HxEPcx+mt8swXoZHIbaaJ2crJYFfErySgktuTZ3BeLz+XmFA==", "dev": true }, "@typescript/vfs": { @@ -17179,9 +17055,9 @@ } }, "abab": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.5.tgz", - "integrity": "sha512-9IK9EadsbHo6jLWIpxpR6pL0sazTXV6+SQv25ZB+F7Bj9mJNaOc4nCRabwd5M/JwmUa8idz6Eci6eKfJryPs6Q==", + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.6.tgz", + "integrity": "sha512-j2afSsaIENvHZN2B8GOpF566vZ5WVk5opAiMTvWgaQT8DkbOqsTfvNAvHoRGU2zzP8cPoqys+xHTRDWW8L+/BA==", "dev": true }, "abbrev": { @@ -17197,20 +17073,35 @@ "dev": true }, "acorn-globals": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/acorn-globals/-/acorn-globals-6.0.0.tgz", - "integrity": "sha512-ZQl7LOWaF5ePqqcX4hLuv/bLXYQNfNWw2c0/yX/TsPRKamzHcTGQnlCjHT3TsmkOUVEPS3crCxiPfdzE/Trlhg==", + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/acorn-globals/-/acorn-globals-7.0.1.tgz", + "integrity": "sha512-umOSDSDrfHbTNPuNpC2NSnnA3LUrqpevPb4T9jRx4MagXNS0rs+gwiTcAvqCRmsD6utzsrzNt+ebm00SNWiC3Q==", "dev": true, "requires": { - "acorn": "^7.1.1", - "acorn-walk": "^7.1.1" + "acorn": "^8.1.0", + "acorn-walk": "^8.0.2" + }, + "dependencies": { + "acorn": { + "version": "8.10.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.10.0.tgz", + "integrity": "sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw==", + "dev": true + }, + "acorn-walk": { + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz", + "integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==", + "dev": true + } } }, "acorn-jsx": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.1.tgz", - "integrity": "sha512-K0Ptm/47OKfQRpNQ2J/oIN/3QYiK6FwW+eJbILhsdxh2WTLdl+30o8aGdTbm5JbffpFFAg/g+zi1E+jvJha5ng==", - "dev": true + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", + "dev": true, + "requires": {} }, "acorn-node": { "version": "1.8.2", @@ -17239,23 +17130,17 @@ } }, "ajv": { - "version": "8.10.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.10.0.tgz", - "integrity": "sha512-bzqAEZOjkrUMl2afH8dknrq5KEk2SrwdBROR+vH1EKVQTqaUbJVPdc/gEdggTMM0Se+s+Ja4ju4TlNcStKl2Hw==", + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", "dev": true, "requires": { "fast-deep-equal": "^3.1.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", "uri-js": "^4.2.2" } }, - "ansi-colors": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", - "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", - "dev": true - }, "ansi-escapes": { "version": "4.3.2", "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", @@ -17313,6 +17198,16 @@ "sprintf-js": "~1.0.2" } }, + "array-buffer-byte-length": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.0.tgz", + "integrity": "sha512-LPuwb2P+NrQw3XhxGc36+XSvuBPopovXYTR9Ew++Du9Yb/bx5AzBfrIsBoj0EZUifjQU+sHL21sseZ3jerWO/A==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "is-array-buffer": "^3.0.1" + } + }, "array-differ": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/array-differ/-/array-differ-3.0.0.tgz", @@ -17325,22 +17220,16 @@ "integrity": "sha1-p5SvDAWrF1KEbudTofIRoFugxE8=", "dev": true }, - "array-filter": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/array-filter/-/array-filter-1.0.0.tgz", - "integrity": "sha1-uveeYubvTCpMC4MSMtr/7CUfnYM=", - "dev": true - }, "array-includes": { - "version": "3.1.4", - "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.4.tgz", - "integrity": "sha512-ZTNSQkmWumEbiHO2GF4GmWxYVTiQyJy2XOTa15sdQSrvKn7l+180egQMqlrMOUMCyLMD7pmyQe4mMDUT6Behrw==", + "version": "3.1.6", + "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.6.tgz", + "integrity": "sha512-sgTbLvL6cNnw24FnbaDyjmvddQ2ML8arZsgaJhoABMoplz/4QRhtrYS+alr1BUM1Bwp6dhx8vVCBSLG+StwOFw==", "dev": true, "requires": { "call-bind": "^1.0.2", - "define-properties": "^1.1.3", - "es-abstract": "^1.19.1", - "get-intrinsic": "^1.1.1", + "define-properties": "^1.1.4", + "es-abstract": "^1.20.4", + "get-intrinsic": "^1.1.3", "is-string": "^1.0.7" } }, @@ -17356,15 +17245,55 @@ "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", "dev": true }, + "array.prototype.findlastindex": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/array.prototype.findlastindex/-/array.prototype.findlastindex-1.2.2.tgz", + "integrity": "sha512-tb5thFFlUcp7NdNF6/MpDk/1r/4awWG1FIz3YqDf+/zJSTezBb+/5WViH41obXULHVpDzoiCLpJ/ZO9YbJMsdw==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.4", + "es-abstract": "^1.20.4", + "es-shim-unscopables": "^1.0.0", + "get-intrinsic": "^1.1.3" + } + }, "array.prototype.flat": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.2.5.tgz", - "integrity": "sha512-KaYU+S+ndVqyUnignHftkwc58o3uVU1jzczILJ1tN2YaIZpFIKBiP/x/j97E5MVPsaCloPbqWLB/8qCTVvT2qg==", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.3.1.tgz", + "integrity": "sha512-roTU0KWIOmJ4DRLmwKd19Otg0/mT3qPNt0Qb3GWW8iObuZXxrjB/pzn0R3hqpRSWg4HCwqx+0vwOnWnvlOyeIA==", "dev": true, "requires": { "call-bind": "^1.0.2", - "define-properties": "^1.1.3", - "es-abstract": "^1.19.0" + "define-properties": "^1.1.4", + "es-abstract": "^1.20.4", + "es-shim-unscopables": "^1.0.0" + } + }, + "array.prototype.flatmap": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/array.prototype.flatmap/-/array.prototype.flatmap-1.3.1.tgz", + "integrity": "sha512-8UGn9O1FDVvMNB0UlLv4voxRMze7+FpHyF5mSMRjWHUMlpoDViniy05870VlxhfgTnLbpuwTzvD76MTtWxB/mQ==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.4", + "es-abstract": "^1.20.4", + "es-shim-unscopables": "^1.0.0" + } + }, + "arraybuffer.prototype.slice": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/arraybuffer.prototype.slice/-/arraybuffer.prototype.slice-1.0.1.tgz", + "integrity": "sha512-09x0ZWFEjj4WD8PDbykUwo3t9arLn8NIzmmYEJFpYekOAQjpkGSyrQhNoRTcwwcFRu+ycWF78QZ63oWTqSjBcw==", + "dev": true, + "requires": { + "array-buffer-byte-length": "^1.0.0", + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "get-intrinsic": "^1.2.1", + "is-array-buffer": "^3.0.2", + "is-shared-array-buffer": "^1.0.2" } }, "arrify": { @@ -17374,9 +17303,9 @@ "dev": true }, "asana": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/asana/-/asana-1.0.0.tgz", - "integrity": "sha512-ceL8+aGK21p4RiaEbuPTsuQNO4cpyxSHM+5xKdrx6aCrw0IBfVIqWz5s7lW+R89ewjUNDzRei3CjHvFQ7yf24Q==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/asana/-/asana-1.0.2.tgz", + "integrity": "sha512-U/i3f8gK7Ux4vCSWMGPj934yRjKuszIEFzYFiOeWgjMwxa8ksKyYnv9vM8lg6FXxMYXwgKiI9JM1YyOVTvj/eQ==", "dev": true, "requires": { "bluebird": "^3.7.2", @@ -17448,12 +17377,6 @@ "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", "dev": true }, - "astral-regex": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz", - "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==", - "dev": true - }, "async": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/async/-/async-3.2.0.tgz", @@ -17473,13 +17396,10 @@ "dev": true }, "available-typed-arrays": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.2.tgz", - "integrity": "sha512-XWX3OX8Onv97LMk/ftVyBibpGwY5a8SmuxZPzeOxqmuEqUCOM9ZE+uIaD1VNJ5QnvU2UQusvmKbuM1FR8QWGfQ==", - "dev": true, - "requires": { - "array-filter": "^1.0.0" - } + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz", + "integrity": "sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw==", + "dev": true }, "aws-sign2": { "version": "0.7.0", @@ -17494,16 +17414,15 @@ "dev": true }, "babel-jest": { - "version": "27.5.1", - "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-27.5.1.tgz", - "integrity": "sha512-cdQ5dXjGRd0IBRATiQ4mZGlGlRE8kJpjPOixdNRdT+m3UcNqmYWN6rK6nvtXYfY3D76cb8s/O1Ss8ea24PIwcg==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-29.7.0.tgz", + "integrity": "sha512-BrvGY3xZSwEcCzKvKsCi2GgHqDqsYkOP4/by5xCgIwGXQxIEh+8ew3gmrE1y7XRR6LHZIj6yLYnUi/mm2KXKBg==", "dev": true, "requires": { - "@jest/transform": "^27.5.1", - "@jest/types": "^27.5.1", + "@jest/transform": "^29.7.0", "@types/babel__core": "^7.1.14", "babel-plugin-istanbul": "^6.1.1", - "babel-preset-jest": "^27.5.1", + "babel-preset-jest": "^29.6.3", "chalk": "^4.0.0", "graceful-fs": "^4.2.9", "slash": "^3.0.0" @@ -17560,15 +17479,6 @@ } } }, - "babel-plugin-dynamic-import-node": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/babel-plugin-dynamic-import-node/-/babel-plugin-dynamic-import-node-2.3.3.tgz", - "integrity": "sha512-jZVI+s9Zg3IqA/kdi0i6UDCybUI3aSBLnglhYbSSjKlV7yF1F/5LWv8MakQmvYpnbJDS6fcBL2KzHSxNCMtWSQ==", - "dev": true, - "requires": { - "object.assign": "^4.1.0" - } - }, "babel-plugin-istanbul": { "version": "6.1.1", "resolved": "https://registry.npmjs.org/babel-plugin-istanbul/-/babel-plugin-istanbul-6.1.1.tgz", @@ -17583,45 +17493,45 @@ } }, "babel-plugin-jest-hoist": { - "version": "27.5.1", - "resolved": "https://registry.npmjs.org/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-27.5.1.tgz", - "integrity": "sha512-50wCwD5EMNW4aRpOwtqzyZHIewTYNxLA4nhB+09d8BIssfNfzBRhkBIHiaPv1Si226TQSvp8gxAJm2iY2qs2hQ==", + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-29.6.3.tgz", + "integrity": "sha512-ESAc/RJvGTFEzRwOTT4+lNDk/GNHMkKbNzsvT0qKRfDyyYTskxB5rnU2njIDYVxXCBHHEI1c0YwHob3WaYujOg==", "dev": true, "requires": { "@babel/template": "^7.3.3", "@babel/types": "^7.3.3", - "@types/babel__core": "^7.0.0", + "@types/babel__core": "^7.1.14", "@types/babel__traverse": "^7.0.6" } }, "babel-plugin-polyfill-corejs2": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.3.1.tgz", - "integrity": "sha512-v7/T6EQcNfVLfcN2X8Lulb7DjprieyLWJK/zOWH5DUYcAgex9sP3h25Q+DLsX9TloXe3y1O8l2q2Jv9q8UVB9w==", + "version": "0.4.5", + "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.4.5.tgz", + "integrity": "sha512-19hwUH5FKl49JEsvyTcoHakh6BE0wgXLLptIyKZ3PijHc/Ci521wygORCUCCred+E/twuqRyAkE02BAWPmsHOg==", "dev": true, "requires": { - "@babel/compat-data": "^7.13.11", - "@babel/helper-define-polyfill-provider": "^0.3.1", - "semver": "^6.1.1" + "@babel/compat-data": "^7.22.6", + "@babel/helper-define-polyfill-provider": "^0.4.2", + "semver": "^6.3.1" } }, "babel-plugin-polyfill-corejs3": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.5.2.tgz", - "integrity": "sha512-G3uJih0XWiID451fpeFaYGVuxHEjzKTHtc9uGFEjR6hHrvNzeS/PX+LLLcetJcytsB5m4j+K3o/EpXJNb/5IEQ==", + "version": "0.8.3", + "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.8.3.tgz", + "integrity": "sha512-z41XaniZL26WLrvjy7soabMXrfPWARN25PZoriDEiLMxAp50AUW3t35BGQUMg5xK3UrpVTtagIDklxYa+MhiNA==", "dev": true, "requires": { - "@babel/helper-define-polyfill-provider": "^0.3.1", - "core-js-compat": "^3.21.0" + "@babel/helper-define-polyfill-provider": "^0.4.2", + "core-js-compat": "^3.31.0" } }, "babel-plugin-polyfill-regenerator": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.3.1.tgz", - "integrity": "sha512-Y2B06tvgHYt1x0yz17jGkGeeMr5FeKUu+ASJ+N6nB5lQ8Dapfg42i0OVrf8PNGJ3zKL4A23snMi1IRwrqqND7A==", + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.5.2.tgz", + "integrity": "sha512-tAlOptU0Xj34V1Y2PNTL4Y0FOJMDB6bZmoW39FeCQIhigGLkqu3Fj6uiXpxIf6Ij274ENdYx64y6Au+ZKlb1IA==", "dev": true, "requires": { - "@babel/helper-define-polyfill-provider": "^0.3.1" + "@babel/helper-define-polyfill-provider": "^0.4.2" } }, "babel-preset-current-node-syntax": { @@ -17645,12 +17555,12 @@ } }, "babel-preset-jest": { - "version": "27.5.1", - "resolved": "https://registry.npmjs.org/babel-preset-jest/-/babel-preset-jest-27.5.1.tgz", - "integrity": "sha512-Nptf2FzlPCWYuJg41HBqXVT8ym6bXOevuCTbhxlUpjwtysGaIWFvDEjp4y+G7fl13FgOdjs7P/DmErqH7da0Ag==", + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/babel-preset-jest/-/babel-preset-jest-29.6.3.tgz", + "integrity": "sha512-0B3bhxR6snWXJZtR/RliHTDPRgn1sNHOR0yVtq/IiQFyuOVjFS+wuio/R4gSNkyYmKmJB4wGZv2NZanmKmTnNA==", "dev": true, "requires": { - "babel-plugin-jest-hoist": "^27.5.1", + "babel-plugin-jest-hoist": "^29.6.3", "babel-preset-current-node-syntax": "^1.0.0" } }, @@ -17805,12 +17715,6 @@ } } }, - "browser-process-hrtime": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/browser-process-hrtime/-/browser-process-hrtime-1.0.0.tgz", - "integrity": "sha512-9o5UecI3GhkpM6DrXr69PblIuWxPKk9Y0jHBRhdocZ2y7YECBFCsHm79Pr3OyR2AvjhDkabFJaDJMYRazHgsow==", - "dev": true - }, "browser-request": { "version": "0.3.3", "resolved": "https://registry.npmjs.org/browser-request/-/browser-request-0.3.3.tgz", @@ -18062,16 +17966,15 @@ } }, "browserslist": { - "version": "4.19.3", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.19.3.tgz", - "integrity": "sha512-XK3X4xtKJ+Txj8G5c30B4gsm71s69lqXlkYui4s6EkKxuv49qjYlY6oVd+IFJ73d4YymtM3+djvvt/R/iJwwDg==", + "version": "4.21.10", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.21.10.tgz", + "integrity": "sha512-bipEBdZfVH5/pwrvqc+Ub0kUPVfGUhlKxbvfD+z1BDnPEO/X98ruXGA1WP5ASpAFKan7Qr6j736IacbZQuAlKQ==", "dev": true, "requires": { - "caniuse-lite": "^1.0.30001312", - "electron-to-chromium": "^1.4.71", - "escalade": "^3.1.1", - "node-releases": "^2.0.2", - "picocolors": "^1.0.0" + "caniuse-lite": "^1.0.30001517", + "electron-to-chromium": "^1.4.477", + "node-releases": "^2.0.13", + "update-browserslist-db": "^1.0.11" } }, "bser": { @@ -18134,9 +18037,9 @@ } }, "call-me-maybe": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/call-me-maybe/-/call-me-maybe-1.0.1.tgz", - "integrity": "sha512-wCyFsDQkKPwwF8BDwOiWNx/9K45L/hvggQiDbve+viMNMQnWhrlYIuBk09offfwCRtCO9P6XwUttufzU11WCVw==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-me-maybe/-/call-me-maybe-1.0.2.tgz", + "integrity": "sha512-HpX65o1Hnr9HH25ojC1YGs7HCQLq0GCOibSaWER0eNpgJ/Z1MZv2mTc7+xh6WOPxbRVcmgbv4hGU+uSQ/2xFZQ==", "dev": true }, "callsites": { @@ -18152,9 +18055,9 @@ "dev": true }, "caniuse-lite": { - "version": "1.0.30001374", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001374.tgz", - "integrity": "sha512-mWvzatRx3w+j5wx/mpFN5v5twlPrabG8NqX2c6e45LCpymdoGqNvRkRutFUqpRTXKFQFNQJasvK0YT7suW6/Hw==", + "version": "1.0.30001520", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001520.tgz", + "integrity": "sha512-tahF5O9EiiTzwTUqAeFjIZbn4Dnqxzz7ktrgGlMYNLH43Ul26IgTMH/zvL3DG0lZxBYnlT04axvInszUsZULdA==", "dev": true }, "case": { @@ -18209,9 +18112,9 @@ } }, "ci-info": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.3.0.tgz", - "integrity": "sha512-riT/3vI5YpVH6/qomlDnJow6TBee2PBKSEpx3O32EGPYbWGIRsIlGRms3Sm74wYE1JMo8RnO04Hb12+v1J5ICw==", + "version": "3.8.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.8.0.tgz", + "integrity": "sha512-eXTggHWSooYhq49F2opQhuHWgzucfF2YgODK4e1566GQs5BIfP30B0oenwBJHfWxAs2fyPB1s7Mg949zLf61Yw==", "dev": true }, "cipher-base": { @@ -18225,9 +18128,9 @@ } }, "cjs-module-lexer": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/cjs-module-lexer/-/cjs-module-lexer-1.2.2.tgz", - "integrity": "sha512-cOU9usZw8/dXIXKtwa8pM0OTJQuJkxMN6w30csNRUerHfeQ5R6U3kkU/FtJeIf3M202OHfY2U8ccInBG7/xogA==", + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/cjs-module-lexer/-/cjs-module-lexer-1.2.3.tgz", + "integrity": "sha512-0TNiGstbQmCFwt4akjjBg5pLRTSyj/PkWQ1ZoO2zntmg9yLqSRxwEa4iCfQLGjqhiqBfOJa7W/E8wfGrTDmlZQ==", "dev": true }, "clean-stack": { @@ -18282,13 +18185,13 @@ "dev": true }, "cliui": { - "version": "7.0.4", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", - "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", "dev": true, "requires": { "string-width": "^4.2.0", - "strip-ansi": "^6.0.0", + "strip-ansi": "^6.0.1", "wrap-ansi": "^7.0.0" } }, @@ -18301,13 +18204,13 @@ "co": { "version": "4.6.0", "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", - "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=", + "integrity": "sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ==", "dev": true }, "collect-v8-coverage": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/collect-v8-coverage/-/collect-v8-coverage-1.0.1.tgz", - "integrity": "sha512-iBPtljfCNcTKNAto0KEtDfZ3qzjJvqE3aTGZsbhjSBlorqpXJlaWWtPO35D+ZImoC3KWejX64o+yPGxhWSTzfg==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/collect-v8-coverage/-/collect-v8-coverage-1.0.2.tgz", + "integrity": "sha512-lHl4d5/ONEbLlJvaJNtsF/Lz+WvB07u2ycqTYbdrq7UypDXailES4valYb2eWiJFxZlVmpGekfqoxQhzyFdT4Q==", "dev": true }, "color-convert": { @@ -18322,7 +18225,7 @@ "color-name": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", "dev": true }, "colors": { @@ -18397,30 +18300,18 @@ "dev": true }, "convert-source-map": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.7.0.tgz", - "integrity": "sha512-4FJkXzKXEDB1snCFZlLP4gpC3JILicCpGbzG9f9G7tGqGCzETQ2hWPrcinA9oU4wtf2biUaEH5065UnMeR33oA==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.1" - } + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", + "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", + "dev": true }, "core-js-compat": { - "version": "3.21.1", - "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.21.1.tgz", - "integrity": "sha512-gbgX5AUvMb8gwxC7FLVWYT7Kkgu/y7+h/h1X43yJkNqhlK2fuYyQimqvKGNZFAY6CKii/GFKJ2cp/1/42TN36g==", + "version": "3.32.0", + "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.32.0.tgz", + "integrity": "sha512-7a9a3D1k4UCVKnLhrgALyFcP7YCsLOQIxPd0dKjf/6GuPcgyiGP70ewWdCGrSK7evyhymi0qO4EqCmSJofDeYw==", "dev": true, "requires": { - "browserslist": "^4.19.1", - "semver": "7.0.0" - }, - "dependencies": { - "semver": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.0.0.tgz", - "integrity": "sha512-+GB6zVA9LWh6zovYQLALHwv5rb2PHGlJi3lfiqIHxR0uuwCgefcOJc59v9fv1w8GbStwxuuqqAjI9NMAOOgq1A==", - "dev": true - } + "browserslist": "^4.21.9" } }, "core-util-is": { @@ -18480,6 +18371,72 @@ "sha.js": "^2.4.8" } }, + "create-jest": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/create-jest/-/create-jest-29.7.0.tgz", + "integrity": "sha512-Adz2bdH0Vq3F53KEMJOoftQFutWCukm6J24wbPWRO4k1kMY7gS7ds/uoJkNuV8wDCtWWnuwGcJwpWcih+zEW1Q==", + "dev": true, + "requires": { + "@jest/types": "^29.6.3", + "chalk": "^4.0.0", + "exit": "^0.1.2", + "graceful-fs": "^4.2.9", + "jest-config": "^29.7.0", + "jest-util": "^29.7.0", + "prompts": "^2.0.1" + }, + "dependencies": { + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, "cross-spawn": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", @@ -18511,9 +18468,9 @@ } }, "cssom": { - "version": "0.4.4", - "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.4.4.tgz", - "integrity": "sha512-p3pvU7r1MyyqbTk+WbNJIgJjG2VmTIaB10rI93LzVPrmDJKkzKYMtxxyAvQXR/NS6otuzveI7+7BBq3SjBS2mw==", + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.5.0.tgz", + "integrity": "sha512-iKuQcq+NdHqlAcwUY0o/HL69XQrUaQdMjmStJ8JFmUaiiQErlhrmuigkg/CU4E2J0IyUKUrMAgl36TvN67MqTw==", "dev": true }, "cssstyle": { @@ -18559,20 +18516,20 @@ } }, "data-urls": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-2.0.0.tgz", - "integrity": "sha512-X5eWTSXO/BJmpdIKCRuKUgSCgAN0OwliVK3yPKbwIWU1Tdw5BRajxlzMidvh+gwko9AfQ9zIj52pzF91Q3YAvQ==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-3.0.2.tgz", + "integrity": "sha512-Jy/tj3ldjZJo63sVAvg6LHt2mHvl4V6AgRAmNDtLdm7faqtsx+aJG42rsyCo9JCoRVKwPFzKlIPx3DIibwSIaQ==", "dev": true, "requires": { - "abab": "^2.0.3", - "whatwg-mimetype": "^2.3.0", - "whatwg-url": "^8.0.0" + "abab": "^2.0.6", + "whatwg-mimetype": "^3.0.0", + "whatwg-url": "^11.0.0" } }, "dateformat": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/dateformat/-/dateformat-3.0.3.tgz", - "integrity": "sha512-jyCETtSl3VMZMWeRo7iY1FL19ges1t55hMo5yaam4Jrsm5EPL89UQkoQRyiI+Yf4k8r2ZpdngkV8hr1lIdjb3Q==", + "version": "4.6.3", + "resolved": "https://registry.npmjs.org/dateformat/-/dateformat-4.6.3.tgz", + "integrity": "sha512-2P0p0pFGzHS5EMnhdxQi7aJN+iMheud0UhG4dlE1DLAlvL8JHjJJTX/CSm4JXwV0Ka5nGk3zC5mcb5bUQUxxMA==", "dev": true }, "debug": { @@ -18585,27 +18542,28 @@ } }, "decimal.js": { - "version": "10.3.1", - "resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-10.3.1.tgz", - "integrity": "sha512-V0pfhfr8suzyPGOx3nmq4aHqabehUZn6Ch9kyFpV79TGDTWFmHqUqXdabR7QHqxzrYolF4+tVmJhUG4OURg5dQ==", + "version": "10.4.3", + "resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-10.4.3.tgz", + "integrity": "sha512-VBBaLc1MgL5XpzgIP7ny5Z6Nx3UrRkIViUkPUdtl9aya5amy3De1gsUUSB1g3+3sExYNjCAsAznmukyxCb1GRA==", "dev": true }, "dedent": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/dedent/-/dedent-0.7.0.tgz", - "integrity": "sha1-JJXduvbrh0q7Dhvp3yLS5aVEMmw=", - "dev": true + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/dedent/-/dedent-1.5.1.tgz", + "integrity": "sha512-+LxW+KLWxu3HW3M2w2ympwtqPrqYRzU8fqi6Fhd18fBALe15blJPI/I4+UHveMVG6lJqB4JNd4UG0S5cnVHwIg==", + "dev": true, + "requires": {} }, "deep-is": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", - "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", "dev": true }, "deepmerge": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.2.2.tgz", - "integrity": "sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg==", + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz", + "integrity": "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==", "dev": true }, "defaults": { @@ -18618,12 +18576,13 @@ } }, "define-properties": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", - "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.0.tgz", + "integrity": "sha512-xvqAVKGfT1+UAvPwKTVw/njhdQ8ZhXK4lI0bCIuCMrp2up9nPnaDftrLtmpTazqd1o+UY4zgzU+avtMbDP+ldA==", "dev": true, "requires": { - "object-keys": "^1.0.12" + "has-property-descriptors": "^1.0.0", + "object-keys": "^1.1.1" } }, "defined": { @@ -18695,16 +18654,10 @@ "minimist": "^1.1.1" } }, - "diff": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", - "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", - "dev": true - }, "diff-sequences": { - "version": "27.5.1", - "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-27.5.1.tgz", - "integrity": "sha512-k1gCAXAsNgLwEL+Y8Wvl+M6oEFj5bgazfZULpS5CneoPPXRaCCW7dm+q21Ky2VEE5X+VeRDBVg1Pcvvsr4TtNQ==", + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-29.6.3.tgz", + "integrity": "sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q==", "dev": true }, "diffie-hellman": { @@ -18751,20 +18704,12 @@ "dev": true }, "domexception": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/domexception/-/domexception-2.0.1.tgz", - "integrity": "sha512-yxJ2mFy/sibVQlu5qHjOkf9J3K6zgmCxgJ94u2EdvDOV09H+32LtRswEcUsmUWN72pVLOEnTSRaIVVzVQgS0dg==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/domexception/-/domexception-4.0.0.tgz", + "integrity": "sha512-A2is4PLG+eeSfoTMA95/s4pvAoSo2mKtiM5jlHkAVewmiO8ISFTFKZjH7UAM1Atli/OT/7JHOrJRJiMKUZKYBw==", "dev": true, "requires": { - "webidl-conversions": "^5.0.0" - }, - "dependencies": { - "webidl-conversions": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-5.0.0.tgz", - "integrity": "sha512-VlZwKPCkYKxQgeSbH5EyngOmRp7Ww7I9rQLERETtf5ofd9pGeswWiOtogpEO850jziPRarreGxn5QIiTqpb2wA==", - "dev": true - } + "webidl-conversions": "^7.0.0" } }, "duplexer2": { @@ -18787,9 +18732,9 @@ } }, "electron-to-chromium": { - "version": "1.4.71", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.71.tgz", - "integrity": "sha512-Hk61vXXKRb2cd3znPE9F+2pLWdIOmP7GjiTj45y6L3W/lO+hSnUSUhq+6lEaERWBdZOHbk2s3YV5c9xVl3boVw==", + "version": "1.4.490", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.490.tgz", + "integrity": "sha512-6s7NVJz+sATdYnIwhdshx/N/9O6rvMxmhVoDSDFdj6iA45gHR8EQje70+RYsF4GeB+k0IeNSBnP7yG9ZXJFr7A==", "dev": true }, "elliptic": { @@ -18816,9 +18761,9 @@ } }, "emittery": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/emittery/-/emittery-0.8.1.tgz", - "integrity": "sha512-uDfvUjVrfGJJhymx/kz6prltenw1u7WrCg1oa94zYY8xxVpLLUu045LAT0dhDZdXG58/EpPL/5kA180fQ/qudg==", + "version": "0.13.1", + "resolved": "https://registry.npmjs.org/emittery/-/emittery-0.13.1.tgz", + "integrity": "sha512-DeWwawk6r5yR9jFgnDKYt4sLS0LmHJJi3ZOnb5/JdbYwj3nW+FxQnHIjhBKz8YLC7oRNPVM9NQ47I3CVx34eqQ==", "dev": true }, "emoji-regex": { @@ -18827,15 +18772,6 @@ "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", "dev": true }, - "enquirer": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.3.6.tgz", - "integrity": "sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==", - "dev": true, - "requires": { - "ansi-colors": "^4.1.1" - } - }, "entities": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/entities/-/entities-3.0.1.tgz", @@ -18861,31 +18797,70 @@ } }, "es-abstract": { - "version": "1.19.2", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.19.2.tgz", - "integrity": "sha512-gfSBJoZdlL2xRiOCy0g8gLMryhoe1TlimjzU99L/31Z8QEGIhVQI+EWwt5lT+AuU9SnorVupXFqqOGqGfsyO6w==", + "version": "1.22.1", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.22.1.tgz", + "integrity": "sha512-ioRRcXMO6OFyRpyzV3kE1IIBd4WG5/kltnzdxSCqoP8CMGs/Li+M1uF5o7lOkZVFjDs+NLesthnF66Pg/0q0Lw==", "dev": true, "requires": { + "array-buffer-byte-length": "^1.0.0", + "arraybuffer.prototype.slice": "^1.0.1", + "available-typed-arrays": "^1.0.5", "call-bind": "^1.0.2", + "es-set-tostringtag": "^2.0.1", "es-to-primitive": "^1.2.1", - "function-bind": "^1.1.1", - "get-intrinsic": "^1.1.1", + "function.prototype.name": "^1.1.5", + "get-intrinsic": "^1.2.1", "get-symbol-description": "^1.0.0", + "globalthis": "^1.0.3", + "gopd": "^1.0.1", "has": "^1.0.3", + "has-property-descriptors": "^1.0.0", + "has-proto": "^1.0.1", "has-symbols": "^1.0.3", - "internal-slot": "^1.0.3", - "is-callable": "^1.2.4", + "internal-slot": "^1.0.5", + "is-array-buffer": "^3.0.2", + "is-callable": "^1.2.7", "is-negative-zero": "^2.0.2", "is-regex": "^1.1.4", - "is-shared-array-buffer": "^1.0.1", + "is-shared-array-buffer": "^1.0.2", "is-string": "^1.0.7", + "is-typed-array": "^1.1.10", "is-weakref": "^1.0.2", - "object-inspect": "^1.12.0", + "object-inspect": "^1.12.3", "object-keys": "^1.1.1", - "object.assign": "^4.1.2", - "string.prototype.trimend": "^1.0.4", - "string.prototype.trimstart": "^1.0.4", - "unbox-primitive": "^1.0.1" + "object.assign": "^4.1.4", + "regexp.prototype.flags": "^1.5.0", + "safe-array-concat": "^1.0.0", + "safe-regex-test": "^1.0.0", + "string.prototype.trim": "^1.2.7", + "string.prototype.trimend": "^1.0.6", + "string.prototype.trimstart": "^1.0.6", + "typed-array-buffer": "^1.0.0", + "typed-array-byte-length": "^1.0.0", + "typed-array-byte-offset": "^1.0.0", + "typed-array-length": "^1.0.4", + "unbox-primitive": "^1.0.2", + "which-typed-array": "^1.1.10" + } + }, + "es-set-tostringtag": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.0.1.tgz", + "integrity": "sha512-g3OMbtlwY3QewlqAiMLI47KywjWZoEytKr8pf6iTC8uJq5bIAH52Z9pnQ8pVL6whrCto53JZDuUIsifGeLorTg==", + "dev": true, + "requires": { + "get-intrinsic": "^1.1.3", + "has": "^1.0.3", + "has-tostringtag": "^1.0.0" + } + }, + "es-shim-unscopables": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-shim-unscopables/-/es-shim-unscopables-1.0.0.tgz", + "integrity": "sha512-Jm6GPcCdC30eMLbZ2x8z2WuRwAws3zTBBKuusffYVUrNj/GVSUAZ+xKMaUpfNDR5IbyNA5LJbaecoUVbmUcB1w==", + "dev": true, + "requires": { + "has": "^1.0.3" } }, "es-to-primitive": { @@ -18956,15 +18931,14 @@ "dev": true }, "escodegen": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-2.0.0.tgz", - "integrity": "sha512-mmHKys/C8BFUGI+MAWNcSYoORYLMdPzjrknd2Vc+bUsjN5bXcr8EhrNB+UTqfL1y3I9c4fw2ihgtMPQLBRiQxw==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-2.1.0.tgz", + "integrity": "sha512-2NlIDTwUWJN0mRPQOdtQBzbUHvdGY2P1VXSyU83Q3xKxM7WHX2Ql8dKq782Q9TgQUNOLEzEYu9bzLNj1q88I5w==", "dev": true, "requires": { "esprima": "^4.0.1", "estraverse": "^5.2.0", "esutils": "^2.0.2", - "optionator": "^0.8.1", "source-map": "~0.6.1" }, "dependencies": { @@ -18974,134 +18948,60 @@ "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", "dev": true }, - "levn": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", - "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", - "dev": true, - "requires": { - "prelude-ls": "~1.1.2", - "type-check": "~0.3.2" - } - }, - "optionator": { - "version": "0.8.3", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz", - "integrity": "sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==", - "dev": true, - "requires": { - "deep-is": "~0.1.3", - "fast-levenshtein": "~2.0.6", - "levn": "~0.3.0", - "prelude-ls": "~1.1.2", - "type-check": "~0.3.2", - "word-wrap": "~1.2.3" - } - }, - "prelude-ls": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", - "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", - "dev": true - }, "source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", "dev": true, "optional": true - }, - "type-check": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", - "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", - "dev": true, - "requires": { - "prelude-ls": "~1.1.2" - } } } }, "eslint": { - "version": "7.32.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.32.0.tgz", - "integrity": "sha512-VHZ8gX+EDfz+97jGcgyGCyRia/dPOd6Xh9yPv8Bl1+SoaIwD+a/vlrOmGRUyOYu7MwUhc7CxqeaDZU13S4+EpA==", - "dev": true, - "requires": { - "@babel/code-frame": "7.12.11", - "@eslint/eslintrc": "^0.4.3", - "@humanwhocodes/config-array": "^0.5.0", - "ajv": "^6.10.0", + "version": "8.50.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.50.0.tgz", + "integrity": "sha512-FOnOGSuFuFLv/Sa+FDVRZl4GGVAAFFi8LecRsI5a1tMO5HIE8nCm4ivAlzt4dT3ol/PaaGC0rJEEXQmHJBGoOg==", + "dev": true, + "requires": { + "@eslint-community/eslint-utils": "^4.2.0", + "@eslint-community/regexpp": "^4.6.1", + "@eslint/eslintrc": "^2.1.2", + "@eslint/js": "8.50.0", + "@humanwhocodes/config-array": "^0.11.11", + "@humanwhocodes/module-importer": "^1.0.1", + "@nodelib/fs.walk": "^1.2.8", + "ajv": "^6.12.4", "chalk": "^4.0.0", "cross-spawn": "^7.0.2", - "debug": "^4.0.1", + "debug": "^4.3.2", "doctrine": "^3.0.0", - "enquirer": "^2.3.5", "escape-string-regexp": "^4.0.0", - "eslint-scope": "^5.1.1", - "eslint-utils": "^2.1.0", - "eslint-visitor-keys": "^2.0.0", - "espree": "^7.3.1", - "esquery": "^1.4.0", + "eslint-scope": "^7.2.2", + "eslint-visitor-keys": "^3.4.3", + "espree": "^9.6.1", + "esquery": "^1.4.2", "esutils": "^2.0.2", "fast-deep-equal": "^3.1.3", "file-entry-cache": "^6.0.1", - "functional-red-black-tree": "^1.0.1", - "glob-parent": "^5.1.2", - "globals": "^13.6.0", - "ignore": "^4.0.6", - "import-fresh": "^3.0.0", + "find-up": "^5.0.0", + "glob-parent": "^6.0.2", + "globals": "^13.19.0", + "graphemer": "^1.4.0", + "ignore": "^5.2.0", "imurmurhash": "^0.1.4", "is-glob": "^4.0.0", - "js-yaml": "^3.13.1", + "is-path-inside": "^3.0.3", + "js-yaml": "^4.1.0", "json-stable-stringify-without-jsonify": "^1.0.1", "levn": "^0.4.1", "lodash.merge": "^4.6.2", - "minimatch": "^3.0.4", + "minimatch": "^3.1.2", "natural-compare": "^1.4.0", - "optionator": "^0.9.1", - "progress": "^2.0.0", - "regexpp": "^3.1.0", - "semver": "^7.2.1", - "strip-ansi": "^6.0.0", - "strip-json-comments": "^3.1.0", - "table": "^6.0.9", - "text-table": "^0.2.0", - "v8-compile-cache": "^2.0.3" + "optionator": "^0.9.3", + "strip-ansi": "^6.0.1", + "text-table": "^0.2.0" }, "dependencies": { - "@babel/code-frame": { - "version": "7.12.11", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.11.tgz", - "integrity": "sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA3EUl+q2LQx16MISgJ0+z7dnmgvP9QtIleuETGOiOH1RcIw==", - "dev": true, - "requires": { - "@babel/highlight": "^7.10.4" - } - }, - "@humanwhocodes/config-array": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.5.0.tgz", - "integrity": "sha512-FagtKFz74XrTl7y6HCzQpwDfXP0yhxe9lHLD1UZxjvZIcbyRz8zTFF/yYNfSfzU414eDwZ1SrO0Qvtyf+wFMQg==", - "dev": true, - "requires": { - "@humanwhocodes/object-schema": "^1.2.0", - "debug": "^4.1.1", - "minimatch": "^3.0.4" - } - }, - "ajv": { - "version": "6.12.6", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", - "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", - "dev": true, - "requires": { - "fast-deep-equal": "^3.1.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" - } - }, "ansi-styles": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", @@ -19111,6 +19011,12 @@ "color-convert": "^2.0.1" } }, + "argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true + }, "chalk": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.1.tgz", @@ -19142,16 +19048,41 @@ "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", "dev": true }, + "eslint-scope": { + "version": "7.2.2", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz", + "integrity": "sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==", + "dev": true, + "requires": { + "esrecurse": "^4.3.0", + "estraverse": "^5.2.0" + } + }, "eslint-visitor-keys": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.0.0.tgz", - "integrity": "sha512-QudtT6av5WXels9WjIM7qz1XD1cWGvX4gGXvp/zBn9nXG02D0utdU3Em2m/QjTnrsk6bBjmCygl3rmj118msQQ==", + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", + "dev": true + }, + "estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", "dev": true }, + "glob-parent": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", + "dev": true, + "requires": { + "is-glob": "^4.0.3" + } + }, "globals": { - "version": "13.8.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.8.0.tgz", - "integrity": "sha512-rHtdA6+PDBIjeEvA91rpqzEvk/k3/i7EeNQiryiWuJH0Hw9cpyJMAt2jtbAwUaRdhD+573X4vWw6IcjKPasi9Q==", + "version": "13.21.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.21.0.tgz", + "integrity": "sha512-ybyme3s4yy/t/3s35bewwXKOf7cvzfreG2lH0lZl0JB7I4GxRP2ghxOK/Nb9EkRXdbBXZLfq/p/0W2JUONB/Gg==", "dev": true, "requires": { "type-fest": "^0.20.2" @@ -19163,19 +19094,22 @@ "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true }, - "json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", - "dev": true + "js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "dev": true, + "requires": { + "argparse": "^2.0.1" + } }, - "semver": { - "version": "7.3.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", - "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", + "minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "dev": true, "requires": { - "lru-cache": "^6.0.0" + "brace-expansion": "^1.1.7" } }, "supports-color": { @@ -19196,13 +19130,14 @@ "dev": true }, "eslint-import-resolver-node": { - "version": "0.3.6", - "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.6.tgz", - "integrity": "sha512-0En0w03NRVMn9Uiyn8YRPDKvWjxCWkslUEhGNTdGx15RvPJYQ+lbOlqrlNI2vEAs4pDYK4f/HN2TbDmk5TP0iw==", + "version": "0.3.9", + "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.9.tgz", + "integrity": "sha512-WFj2isz22JahUv+B788TlO3N6zL3nNJGU8CcZbPZvVEkBPaJdCV4vy5wyghty5ROFbCRnm132v8BScu5/1BQ8g==", "dev": true, "requires": { "debug": "^3.2.7", - "resolve": "^1.20.0" + "is-core-module": "^2.13.0", + "resolve": "^1.22.4" }, "dependencies": { "debug": { @@ -19217,13 +19152,12 @@ } }, "eslint-module-utils": { - "version": "2.7.3", - "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.7.3.tgz", - "integrity": "sha512-088JEC7O3lDZM9xGe0RerkOMd0EjFl+Yvd1jPWIkMT5u3H9+HC34mWWPnqPrN13gieT9pBOO+Qt07Nb/6TresQ==", + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.8.0.tgz", + "integrity": "sha512-aWajIYfsqCKRDgUfjEXNN/JlrzauMuSEy5sbd7WXbtW3EH6A6MpwEh42c7qD+MqQo9QMJ6fWLAeIJynx0g6OAw==", "dev": true, "requires": { - "debug": "^3.2.7", - "find-up": "^2.1.0" + "debug": "^3.2.7" }, "dependencies": { "debug": { @@ -19248,33 +19182,37 @@ } }, "eslint-plugin-import": { - "version": "2.26.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.26.0.tgz", - "integrity": "sha512-hYfi3FXaM8WPLf4S1cikh/r4IxnO6zrhZbEGz2b660EJRbuxgpDS5gkCuYgGWg2xxh2rBuIr4Pvhve/7c31koA==", + "version": "2.28.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.28.1.tgz", + "integrity": "sha512-9I9hFlITvOV55alzoKBI+K9q74kv0iKMeY6av5+umsNwayt59fz692daGyjR+oStBQgx6nwR9rXldDev3Clw+A==", "dev": true, "requires": { - "array-includes": "^3.1.4", - "array.prototype.flat": "^1.2.5", - "debug": "^2.6.9", + "array-includes": "^3.1.6", + "array.prototype.findlastindex": "^1.2.2", + "array.prototype.flat": "^1.3.1", + "array.prototype.flatmap": "^1.3.1", + "debug": "^3.2.7", "doctrine": "^2.1.0", - "eslint-import-resolver-node": "^0.3.6", - "eslint-module-utils": "^2.7.3", + "eslint-import-resolver-node": "^0.3.7", + "eslint-module-utils": "^2.8.0", "has": "^1.0.3", - "is-core-module": "^2.8.1", + "is-core-module": "^2.13.0", "is-glob": "^4.0.3", "minimatch": "^3.1.2", - "object.values": "^1.1.5", - "resolve": "^1.22.0", - "tsconfig-paths": "^3.14.1" + "object.fromentries": "^2.0.6", + "object.groupby": "^1.0.0", + "object.values": "^1.1.6", + "semver": "^6.3.1", + "tsconfig-paths": "^3.14.2" }, "dependencies": { "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", "dev": true, "requires": { - "ms": "2.0.0" + "ms": "^2.1.1" } }, "doctrine": { @@ -19294,12 +19232,6 @@ "requires": { "brace-expansion": "^1.1.7" } - }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", - "dev": true } } }, @@ -19315,20 +19247,12 @@ "minimatch": "^3.0.4", "resolve": "^1.10.1", "semver": "^6.1.0" - }, - "dependencies": { - "ignore": { - "version": "5.1.8", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.1.8.tgz", - "integrity": "sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw==", - "dev": true - } } }, "eslint-plugin-promise": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-promise/-/eslint-plugin-promise-6.0.0.tgz", - "integrity": "sha512-7GPezalm5Bfi/E22PnQxDWH2iW9GTvAlUNTztemeHb6c1BniSyoeTrM87JkC0wYdi6aQrZX9p2qEiAno8aTcbw==", + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-promise/-/eslint-plugin-promise-6.1.1.tgz", + "integrity": "sha512-tjqWDwVZQo7UIPMeDReOpUgHCmCiH+ePnVT+5zVapL0uuHnegBUs2smM13CzOs2Xb5+MHMRFTs9v24yjba4Oig==", "dev": true, "requires": {} }, @@ -19371,14 +19295,28 @@ "optional": true }, "espree": { - "version": "7.3.1", - "resolved": "https://registry.npmjs.org/espree/-/espree-7.3.1.tgz", - "integrity": "sha512-v3JCNCE64umkFpmkFGqzVKsOT0tN1Zr+ueqLZfpV1Ob8e+CEgPWa+OxCoGH3tnhimMKIaBm4m/vaRpJ/krRz2g==", + "version": "9.6.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz", + "integrity": "sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==", "dev": true, "requires": { - "acorn": "^7.4.0", - "acorn-jsx": "^5.3.1", - "eslint-visitor-keys": "^1.3.0" + "acorn": "^8.9.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^3.4.1" + }, + "dependencies": { + "acorn": { + "version": "8.10.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.10.0.tgz", + "integrity": "sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw==", + "dev": true + }, + "eslint-visitor-keys": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", + "dev": true + } } }, "esprima": { @@ -19388,18 +19326,18 @@ "dev": true }, "esquery": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.4.0.tgz", - "integrity": "sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w==", + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.5.0.tgz", + "integrity": "sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==", "dev": true, "requires": { "estraverse": "^5.1.0" }, "dependencies": { "estraverse": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz", - "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==", + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", "dev": true } } @@ -19414,9 +19352,9 @@ }, "dependencies": { "estraverse": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz", - "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==", + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", "dev": true } } @@ -19504,15 +19442,16 @@ } }, "expect": { - "version": "27.5.1", - "resolved": "https://registry.npmjs.org/expect/-/expect-27.5.1.tgz", - "integrity": "sha512-E1q5hSUG2AmYQwQJ041nvgpkODHQvB+RKlB4IYdru6uJsyFTRyZAP463M+1lINorwbqAmUggi6+WwkD8lCS/Dw==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/expect/-/expect-29.7.0.tgz", + "integrity": "sha512-2Zks0hf1VLFYI1kbh0I5jP3KHHyCHpkfyHBzsSXRFgl/Bg9mWYfMW8oD+PdMPlEwy5HNsR9JutYy6pMeOh61nw==", "dev": true, "requires": { - "@jest/types": "^27.5.1", - "jest-get-type": "^27.5.1", - "jest-matcher-utils": "^27.5.1", - "jest-message-util": "^27.5.1" + "@jest/expect-utils": "^29.7.0", + "jest-get-type": "^29.6.3", + "jest-matcher-utils": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-util": "^29.7.0" } }, "ext": { @@ -19592,7 +19531,7 @@ "fast-levenshtein": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", - "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", + "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", "dev": true }, "fast-safe-stringify": { @@ -19620,9 +19559,9 @@ } }, "fb-watchman": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/fb-watchman/-/fb-watchman-2.0.1.tgz", - "integrity": "sha512-DkPJKQeY6kKwmuMretBhr7G6Vodr7bFwDYTXIkfG1gjvNpaxBTQV3PbXg6bR1c1UP4jPOX0jHUbbHANL9vRjVg==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/fb-watchman/-/fb-watchman-2.0.2.tgz", + "integrity": "sha512-p5161BqbuCaSnB8jIbzQHOlpgsPmK5rJVDfDKO91Axs5NC1uu3HRQm6wt9cd9/+GtQQIO53JdGXXoyDpTAsgYA==", "dev": true, "requires": { "bser": "2.1.1" @@ -19656,36 +19595,33 @@ } }, "find-up": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", - "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", "dev": true, "requires": { - "locate-path": "^2.0.0" + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + }, + "dependencies": { + "path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true + } } }, "findup-sync": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-0.3.0.tgz", - "integrity": "sha1-N5MKpdgWt3fANEXhlmzGeQpMCxY=", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-5.0.0.tgz", + "integrity": "sha512-MzwXju70AuyflbgeOhzvQWAvvQdo1XL0A9bVvlXsYcFEBM87WR4OakL4OfZq+QRmr+duJubio+UtNQCPsVESzQ==", "dev": true, "requires": { - "glob": "~5.0.0" - }, - "dependencies": { - "glob": { - "version": "5.0.15", - "resolved": "https://registry.npmjs.org/glob/-/glob-5.0.15.tgz", - "integrity": "sha1-G8k2ueAvSmA/zCIuz3Yz0wuLk7E=", - "dev": true, - "requires": { - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "2 || 3", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - } + "detect-file": "^1.0.0", + "is-glob": "^4.0.3", + "micromatch": "^4.0.4", + "resolve-dir": "^1.0.1" } }, "fined": { @@ -19729,6 +19665,15 @@ "integrity": "sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==", "dev": true }, + "for-each": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", + "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==", + "dev": true, + "requires": { + "is-callable": "^1.1.3" + } + }, "for-in": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", @@ -19744,12 +19689,6 @@ "for-in": "^1.0.1" } }, - "foreach": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/foreach/-/foreach-2.0.5.tgz", - "integrity": "sha1-C+4AUBiusmDQo6865ljdATbsG5k=", - "dev": true - }, "forever-agent": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", @@ -19806,10 +19745,22 @@ "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", "dev": true }, - "functional-red-black-tree": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", - "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", + "function.prototype.name": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.5.tgz", + "integrity": "sha512-uN7m/BzVKQnCUF/iW8jYea67v++2u7m5UgENbHRtdDVclOUP+FMPlCNdmk0h/ysGyo2tavMJEDqJAkJdRa1vMA==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.3", + "es-abstract": "^1.19.0", + "functions-have-names": "^1.2.2" + } + }, + "functions-have-names": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz", + "integrity": "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==", "dev": true }, "gaze": { @@ -19840,14 +19791,15 @@ "dev": true }, "get-intrinsic": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.1.tgz", - "integrity": "sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.1.tgz", + "integrity": "sha512-2DcsyfABl+gVHEfCOaTrWgyt+tb6MSEGmKq+kI5HwLbIYgjgmMcV8KQ41uaKz1xxUcn9tJtgFbQUEVcEbd0FYw==", "dev": true, "requires": { "function-bind": "^1.1.1", "has": "^1.0.3", - "has-symbols": "^1.0.1" + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3" } }, "get-package-type": { @@ -19966,6 +19918,15 @@ "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", "dev": true }, + "globalthis": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.3.tgz", + "integrity": "sha512-sFdI5LyBiNTHjRd7cGPWapiHWMOXKyuBNX/cWJ3NfzrZQVa8GI/8cofCl74AOVqq9W5kNmguTIzJ/1s2gyI9wA==", + "dev": true, + "requires": { + "define-properties": "^1.1.3" + } + }, "globby": { "version": "11.1.0", "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", @@ -19978,14 +19939,6 @@ "ignore": "^5.2.0", "merge2": "^1.4.1", "slash": "^3.0.0" - }, - "dependencies": { - "ignore": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.0.tgz", - "integrity": "sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ==", - "dev": true - } } }, "globule": { @@ -19999,33 +19952,57 @@ "minimatch": "~3.0.2" } }, + "gopd": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", + "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", + "dev": true, + "requires": { + "get-intrinsic": "^1.1.3" + } + }, "graceful-fs": { "version": "4.2.9", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.9.tgz", "integrity": "sha512-NtNxqUcXgpW2iMrfqSfR73Glt39K+BLwWsPs94yR63v45T0Wbej7eRmL5cWfwEgqXnmjQp3zaJTshdRW/qC2ZQ==", "dev": true }, + "graphemer": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", + "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==", + "dev": true + }, "grunt": { - "version": "1.5.2", - "resolved": "https://registry.npmjs.org/grunt/-/grunt-1.5.2.tgz", - "integrity": "sha512-XCtfaIu72OyDqK24MjWiGC9SwlkuhkS1mrULr1xzuJ2XqAFhP3ZAchZGHJeSCY6mkaOXU4F7SbmmCF7xIVoC9w==", + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/grunt/-/grunt-1.6.1.tgz", + "integrity": "sha512-/ABUy3gYWu5iBmrUSRBP97JLpQUm0GgVveDCp6t3yRNIoltIYw7rEj3g5y1o2PGPR2vfTRGa7WC/LZHLTXnEzA==", "dev": true, "requires": { - "dateformat": "~3.0.3", + "dateformat": "~4.6.2", "eventemitter2": "~0.4.13", "exit": "~0.1.2", - "findup-sync": "~0.3.0", + "findup-sync": "~5.0.0", "glob": "~7.1.6", "grunt-cli": "~1.4.3", "grunt-known-options": "~2.0.0", "grunt-legacy-log": "~3.0.0", "grunt-legacy-util": "~2.0.1", - "iconv-lite": "~0.4.13", + "iconv-lite": "~0.6.3", "js-yaml": "~3.14.0", "minimatch": "~3.0.4", - "mkdirp": "~1.0.4", - "nopt": "~3.0.6", - "rimraf": "~3.0.2" + "nopt": "~3.0.6" + }, + "dependencies": { + "iconv-lite": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", + "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", + "dev": true, + "requires": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + } + } } }, "grunt-babel": { @@ -20109,50 +20086,15 @@ } }, "grunt-eslint": { - "version": "24.0.0", - "resolved": "https://registry.npmjs.org/grunt-eslint/-/grunt-eslint-24.0.0.tgz", - "integrity": "sha512-WpTeBBFweyhMuPjGwRSQV9JFJ+EczIdlsc7Dd/1g78QVI1aZsk4g/H3e+3S5HEwsS1RKL2YZIrGj8hMLlBfN8w==", + "version": "24.3.0", + "resolved": "https://registry.npmjs.org/grunt-eslint/-/grunt-eslint-24.3.0.tgz", + "integrity": "sha512-dUPiRgX8fhmh4uwTAn9xrzg7HV5j5DhGmZZGJdHfjy/AN9G4jD+5IjfbcAJ209JcIG8m4B7xz3crIhuDSm3siQ==", "dev": true, "requires": { "chalk": "^4.1.2", - "eslint": "^8.0.1" + "eslint": "^8.44.0" }, "dependencies": { - "@eslint/eslintrc": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.2.1.tgz", - "integrity": "sha512-bxvbYnBPN1Gibwyp6NrpnFzA3YtRL3BBAyEAFVIpNTm2Rn4Vy87GA5M4aSn3InRrlsbX5N0GW7XIx+U4SAEKdQ==", - "dev": true, - "requires": { - "ajv": "^6.12.4", - "debug": "^4.3.2", - "espree": "^9.3.1", - "globals": "^13.9.0", - "ignore": "^5.2.0", - "import-fresh": "^3.2.1", - "js-yaml": "^4.1.0", - "minimatch": "^3.0.4", - "strip-json-comments": "^3.1.1" - } - }, - "acorn": { - "version": "8.7.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.7.0.tgz", - "integrity": "sha512-V/LGr1APy+PXIwKebEWrkZPwoeoF+w1jiOBUmuxuiUIaOHtob8Qc9BTrYo7VuI5fR8tqsy+buA2WFooR5olqvQ==", - "dev": true - }, - "ajv": { - "version": "6.12.6", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", - "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", - "dev": true, - "requires": { - "fast-deep-equal": "^3.1.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" - } - }, "ansi-styles": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", @@ -20162,12 +20104,6 @@ "color-convert": "^2.0.1" } }, - "argparse": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", - "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", - "dev": true - }, "chalk": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", @@ -20193,150 +20129,12 @@ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, - "escape-string-regexp": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", - "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", - "dev": true - }, - "eslint": { - "version": "8.12.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.12.0.tgz", - "integrity": "sha512-it1oBL9alZg1S8UycLm5YDMAkIhtH6FtAzuZs6YvoGVldWjbS08BkAdb/ymP9LlAyq8koANu32U7Ib/w+UNh8Q==", - "dev": true, - "requires": { - "@eslint/eslintrc": "^1.2.1", - "@humanwhocodes/config-array": "^0.9.2", - "ajv": "^6.10.0", - "chalk": "^4.0.0", - "cross-spawn": "^7.0.2", - "debug": "^4.3.2", - "doctrine": "^3.0.0", - "escape-string-regexp": "^4.0.0", - "eslint-scope": "^7.1.1", - "eslint-utils": "^3.0.0", - "eslint-visitor-keys": "^3.3.0", - "espree": "^9.3.1", - "esquery": "^1.4.0", - "esutils": "^2.0.2", - "fast-deep-equal": "^3.1.3", - "file-entry-cache": "^6.0.1", - "functional-red-black-tree": "^1.0.1", - "glob-parent": "^6.0.1", - "globals": "^13.6.0", - "ignore": "^5.2.0", - "import-fresh": "^3.0.0", - "imurmurhash": "^0.1.4", - "is-glob": "^4.0.0", - "js-yaml": "^4.1.0", - "json-stable-stringify-without-jsonify": "^1.0.1", - "levn": "^0.4.1", - "lodash.merge": "^4.6.2", - "minimatch": "^3.0.4", - "natural-compare": "^1.4.0", - "optionator": "^0.9.1", - "regexpp": "^3.2.0", - "strip-ansi": "^6.0.1", - "strip-json-comments": "^3.1.0", - "text-table": "^0.2.0", - "v8-compile-cache": "^2.0.3" - } - }, - "eslint-scope": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.1.1.tgz", - "integrity": "sha512-QKQM/UXpIiHcLqJ5AOyIW7XZmzjkzQXYE54n1++wb0u9V/abW3l9uQnxX8Z5Xd18xyKIMTUAyQ0k1e8pz6LUrw==", - "dev": true, - "requires": { - "esrecurse": "^4.3.0", - "estraverse": "^5.2.0" - } - }, - "eslint-utils": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-3.0.0.tgz", - "integrity": "sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==", - "dev": true, - "requires": { - "eslint-visitor-keys": "^2.0.0" - }, - "dependencies": { - "eslint-visitor-keys": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", - "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", - "dev": true - } - } - }, - "eslint-visitor-keys": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.3.0.tgz", - "integrity": "sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA==", - "dev": true - }, - "espree": { - "version": "9.3.1", - "resolved": "https://registry.npmjs.org/espree/-/espree-9.3.1.tgz", - "integrity": "sha512-bvdyLmJMfwkV3NCRl5ZhJf22zBFo1y8bYh3VYb+bfzqNB4Je68P2sSuXyuFquzWLebHpNd2/d5uv7yoP9ISnGQ==", - "dev": true, - "requires": { - "acorn": "^8.7.0", - "acorn-jsx": "^5.3.1", - "eslint-visitor-keys": "^3.3.0" - } - }, - "estraverse": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", - "dev": true - }, - "glob-parent": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", - "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", - "dev": true, - "requires": { - "is-glob": "^4.0.3" - } - }, - "globals": { - "version": "13.13.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.13.0.tgz", - "integrity": "sha512-EQ7Q18AJlPwp3vUDL4mKA0KXrXyNIQyWon6T6XQiBQF0XHvRsiCSrWmmeATpUzdJN2HhWZU6Pdl0a9zdep5p6A==", - "dev": true, - "requires": { - "type-fest": "^0.20.2" - } - }, "has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true }, - "ignore": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.0.tgz", - "integrity": "sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ==", - "dev": true - }, - "js-yaml": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", - "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", - "dev": true, - "requires": { - "argparse": "^2.0.1" - } - }, - "json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", - "dev": true - }, "supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", @@ -20462,26 +20260,6 @@ "requires": { "ajv": "^6.12.3", "har-schema": "^2.0.0" - }, - "dependencies": { - "ajv": { - "version": "6.12.6", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", - "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", - "dev": true, - "requires": { - "fast-deep-equal": "^3.1.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" - } - }, - "json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", - "dev": true - } } }, "has": { @@ -20494,15 +20272,30 @@ } }, "has-bigints": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.1.tgz", - "integrity": "sha512-LSBS2LjbNBTf6287JEbEzvJgftkF5qFkmCo9hDRpAzKhUOlJ+hx8dd4USs00SgsUNwc4617J9ki5YtEClM2ffA==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.2.tgz", + "integrity": "sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==", "dev": true }, "has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "dev": true + }, + "has-property-descriptors": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.0.tgz", + "integrity": "sha512-62DVLZGoiEBDHQyqG4w9xCuZ7eJEwNmJRWw2VY84Oedb7WFcA27fiEVe8oUQx9hAUJ4ekurquucTGwsyO1XGdQ==", + "dev": true, + "requires": { + "get-intrinsic": "^1.1.1" + } + }, + "has-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.1.tgz", + "integrity": "sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==", "dev": true }, "has-symbols": { @@ -20593,12 +20386,12 @@ "dev": true }, "html-encoding-sniffer": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-2.0.1.tgz", - "integrity": "sha512-D5JbOMBIR/TVZkubHT+OyT2705QvogUW4IBn6nHd756OwieSF9aDYFj4dv6HHEVGYbHaLETa3WggZYWWMyy3ZQ==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-3.0.0.tgz", + "integrity": "sha512-oWv4T4yJ52iKrufjnyZPkrN0CH3QnrUqdB6In1g5Fe1mia8GmF36gnfNySxoZtxD5+NmYw1EElVXiBk93UeskA==", "dev": true, "requires": { - "whatwg-encoding": "^1.0.5" + "whatwg-encoding": "^2.0.0" } }, "html-escaper": { @@ -20631,12 +20424,12 @@ } }, "http-proxy-agent": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-4.0.1.tgz", - "integrity": "sha512-k0zdNgqWTGA6aeIRVpvfVob4fL52dTfaehylg0Y4UvSySvOq/Y+BOyPrgpUrA7HylqvU8vIZGsRuXmspskV0Tg==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-5.0.0.tgz", + "integrity": "sha512-n2hY8YdoRE1i7r6M0w9DIw5GgZN0G25P8zLCRQ8rjXtTU3vsNFBI/vWK/UIeE6g5MUUz6avwAPXmL6Fy9D/90w==", "dev": true, "requires": { - "@tootallnate/once": "1", + "@tootallnate/once": "2", "agent-base": "6", "debug": "4" } @@ -20702,24 +20495,6 @@ "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true }, - "html-encoding-sniffer": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-3.0.0.tgz", - "integrity": "sha512-oWv4T4yJ52iKrufjnyZPkrN0CH3QnrUqdB6In1g5Fe1mia8GmF36gnfNySxoZtxD5+NmYw1EElVXiBk93UeskA==", - "dev": true, - "requires": { - "whatwg-encoding": "^2.0.0" - } - }, - "iconv-lite": { - "version": "0.6.3", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", - "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", - "dev": true, - "requires": { - "safer-buffer": ">= 2.1.2 < 3.0.0" - } - }, "supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", @@ -20728,15 +20503,6 @@ "requires": { "has-flag": "^4.0.0" } - }, - "whatwg-encoding": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-2.0.0.tgz", - "integrity": "sha512-p41ogyeMUrw3jWclHWTQg1k05DSVXPLcVxRTYsXUk+ZooOCZLcoYgPZ/HL/D/N+uQPOtcp1me1WhBEaX02mhWg==", - "dev": true, - "requires": { - "iconv-lite": "0.6.3" - } } } }, @@ -20758,9 +20524,9 @@ "dev": true }, "https-proxy-agent": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.0.tgz", - "integrity": "sha512-EkYm5BcKUGiduxzSt3Eppko+PiNWNEpa4ySk9vTC6wDsQJW9rHSa+UhGNJoRYp7bz6Ht1eaRIa6QaJqO5rCFbA==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", + "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", "dev": true, "requires": { "agent-base": "6", @@ -20789,9 +20555,9 @@ "dev": true }, "ignore": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", - "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", + "version": "5.2.4", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz", + "integrity": "sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==", "dev": true }, "import-fresh": { @@ -20812,66 +20578,6 @@ "requires": { "pkg-dir": "^4.2.0", "resolve-cwd": "^3.0.0" - }, - "dependencies": { - "find-up": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", - "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", - "dev": true, - "requires": { - "locate-path": "^5.0.0", - "path-exists": "^4.0.0" - } - }, - "locate-path": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", - "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", - "dev": true, - "requires": { - "p-locate": "^4.1.0" - } - }, - "p-limit": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", - "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", - "dev": true, - "requires": { - "p-try": "^2.0.0" - } - }, - "p-locate": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", - "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", - "dev": true, - "requires": { - "p-limit": "^2.2.0" - } - }, - "p-try": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", - "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", - "dev": true - }, - "path-exists": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", - "dev": true - }, - "pkg-dir": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", - "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", - "dev": true, - "requires": { - "find-up": "^4.0.0" - } - } } }, "imurmurhash": { @@ -21022,12 +20728,12 @@ } }, "internal-slot": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.3.tgz", - "integrity": "sha512-O0DB1JC/sPyZl7cIo78n5dR7eUSwwpYPiXRhTzNxZVAMUuB8vlnRFyLxdrVToks6XPLVnFfbzaVd5WLjhgg+vA==", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.5.tgz", + "integrity": "sha512-Y+R5hJrzs52QCG2laLn4udYVnxsfny9CpOhNhUvk/SSSVyF6T27FzRbF0sroPidSu3X8oEAkOn2K804mjpt6UQ==", "dev": true, "requires": { - "get-intrinsic": "^1.1.0", + "get-intrinsic": "^1.2.0", "has": "^1.0.3", "side-channel": "^1.0.4" } @@ -21057,6 +20763,17 @@ "call-bind": "^1.0.0" } }, + "is-array-buffer": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.2.tgz", + "integrity": "sha512-y+FyyR/w8vfIRq4eQcM1EYgSTnmHXPqaF+IgzgraytCFq5Xh8lllDVmAZolPJiZttZLeFSINPYMaEJ7/vWUa1w==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.2.0", + "is-typed-array": "^1.1.10" + } + }, "is-arrayish": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", @@ -21064,10 +20781,13 @@ "dev": true }, "is-bigint": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.1.tgz", - "integrity": "sha512-J0ELF4yHFxHy0cmSxZuheDOz2luOdVvqjwmEcj8H/L1JHeuEDSDbeRP+Dk9kFVk5RTFzbucJ2Kb9F7ixY2QaCg==", - "dev": true + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.4.tgz", + "integrity": "sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==", + "dev": true, + "requires": { + "has-bigints": "^1.0.1" + } }, "is-binary-path": { "version": "2.1.0", @@ -21079,12 +20799,13 @@ } }, "is-boolean-object": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.0.tgz", - "integrity": "sha512-a7Uprx8UtD+HWdyYwnD1+ExtTgqQtD2k/1yJgtXP6wnMm8byhkoTZRl+95LLThpzNZJ5aEvi46cdH+ayMFRwmA==", + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.2.tgz", + "integrity": "sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==", "dev": true, "requires": { - "call-bind": "^1.0.0" + "call-bind": "^1.0.2", + "has-tostringtag": "^1.0.0" } }, "is-buffer": { @@ -21094,32 +20815,15 @@ "dev": true }, "is-callable": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.4.tgz", - "integrity": "sha512-nsuwtxZfMX67Oryl9LCQ+upnC0Z0BgpwntpS89m1H/TLF0zNfzfLMV/9Wa/6MZsj0acpEjAO0KF1xT6ZdLl95w==", + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", + "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", "dev": true }, - "is-ci": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-2.0.0.tgz", - "integrity": "sha512-YfJT7rkpQB0updsdHLGWrvhBJfcfzNNawYDNIyQXJz0IViGf75O8EBPKSdvw2rF+LGCsX4FZ8tcr3b19LcZq4w==", - "dev": true, - "requires": { - "ci-info": "^2.0.0" - }, - "dependencies": { - "ci-info": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz", - "integrity": "sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==", - "dev": true - } - } - }, "is-core-module": { - "version": "2.8.1", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.8.1.tgz", - "integrity": "sha512-SdNCUs284hr40hFTFP6l0IfZ/RSrMXF3qgoRHd3/79unUTvrFO/JoXwkGm+5J/Oe3E/b5GsnG330uUNgRpu1PA==", + "version": "2.13.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.0.tgz", + "integrity": "sha512-Z7dk6Qo8pOCp3l4tsX2C5ZVas4V+UxwQodwZhLopL91TX8UyyHEXafPcyoeeWuLrwzHcr3igO78wNLwHJHsMCQ==", "dev": true, "requires": { "has": "^1.0.3" @@ -21189,10 +20893,13 @@ "dev": true }, "is-number-object": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.4.tgz", - "integrity": "sha512-zohwelOAur+5uXtk8O3GPQ1eAcu4ZX3UwxQhUlfFFMNpUd83gXgjbhJh6HmB6LUNV/ieOLQuDwJO3dWJosUeMw==", - "dev": true + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.7.tgz", + "integrity": "sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ==", + "dev": true, + "requires": { + "has-tostringtag": "^1.0.0" + } }, "is-observable": { "version": "2.1.0", @@ -21200,6 +20907,12 @@ "integrity": "sha512-DailKdLb0WU+xX8K5w7VsJhapwHLZ9jjmazqCJq4X12CTgqq73TKnbRcnSLuXYPOoLQgV5IrD7ePiX/h1vnkBw==", "dev": true }, + "is-path-inside": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", + "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", + "dev": true + }, "is-plain-object": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", @@ -21274,16 +20987,12 @@ } }, "is-typed-array": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.5.tgz", - "integrity": "sha512-S+GRDgJlR3PyEbsX/Fobd9cqpZBuvUS+8asRqYDMLCb2qMzt1oz5m5oxQCxOgUDxiWsOVNi4yaF+/uvdlHlYug==", + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.12.tgz", + "integrity": "sha512-Z14TF2JNG8Lss5/HMqt0//T9JeHXttXy5pH/DBU4vi98ozO2btxzq9MwYDZYnKwU8nRsz/+GVFVRDq3DkVuSPg==", "dev": true, "requires": { - "available-typed-arrays": "^1.0.2", - "call-bind": "^1.0.2", - "es-abstract": "^1.18.0-next.2", - "foreach": "^2.0.5", - "has-symbols": "^1.0.1" + "which-typed-array": "^1.1.11" } }, "is-typedarray": { @@ -21375,13 +21084,13 @@ } }, "istanbul-lib-report": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz", - "integrity": "sha512-wcdi+uAKzfiGT2abPpKZ0hSU1rGQjUQnLvtY5MpQ7QCTahD3VODhcu4wcfY1YtkGaDD5yuydOLINXsfbus9ROw==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.1.tgz", + "integrity": "sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw==", "dev": true, "requires": { "istanbul-lib-coverage": "^3.0.0", - "make-dir": "^3.0.0", + "make-dir": "^4.0.0", "supports-color": "^7.1.0" }, "dependencies": { @@ -21422,9 +21131,9 @@ } }, "istanbul-reports": { - "version": "3.1.4", - "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.4.tgz", - "integrity": "sha512-r1/DshN4KSE7xWEknZLLLLDn5CJybV3nw01VTkp6D5jzLuELlcbudfj/eSQFvrKsJuTVCGnePO7ho82Nw9zzfw==", + "version": "3.1.6", + "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.6.tgz", + "integrity": "sha512-TLgnMkKg3iTDsQ9PbPTdpfAK2DzjF9mqUG7RMgcQl8oFjad8ob4laGxv5XV5U9MAfx8D6tSJiUyuAwzLicaxlg==", "dev": true, "requires": { "html-escaper": "^2.0.0", @@ -21432,61 +21141,63 @@ } }, "jest": { - "version": "27.5.1", - "resolved": "https://registry.npmjs.org/jest/-/jest-27.5.1.tgz", - "integrity": "sha512-Yn0mADZB89zTtjkPJEXwrac3LHudkQMR+Paqa8uxJHCBr9agxztUifWCyiYrjhMPBoUVBjyny0I7XH6ozDr7QQ==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest/-/jest-29.7.0.tgz", + "integrity": "sha512-NIy3oAFp9shda19hy4HK0HRTWKtPJmGdnvywu01nOqNC2vZg+Z+fvJDxpMQA88eb2I9EcafcdjYgsDthnYTvGw==", "dev": true, "requires": { - "@jest/core": "^27.5.1", + "@jest/core": "^29.7.0", + "@jest/types": "^29.6.3", "import-local": "^3.0.2", - "jest-cli": "^27.5.1" + "jest-cli": "^29.7.0" } }, "jest-changed-files": { - "version": "27.5.1", - "resolved": "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-27.5.1.tgz", - "integrity": "sha512-buBLMiByfWGCoMsLLzGUUSpAmIAGnbR2KJoMN10ziLhOLvP4e0SlypHnAel8iqQXTrcbmfEY9sSqae5sgUsTvw==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-29.7.0.tgz", + "integrity": "sha512-fEArFiwf1BpQ+4bXSprcDc3/x4HSzL4al2tozwVpDFpsxALjLYdyiIK4e5Vz66GQJIbXJ82+35PtysofptNX2w==", "dev": true, "requires": { - "@jest/types": "^27.5.1", "execa": "^5.0.0", - "throat": "^6.0.1" + "jest-util": "^29.7.0", + "p-limit": "^3.1.0" } }, "jest-chrome": { - "version": "0.7.2", - "resolved": "https://registry.npmjs.org/jest-chrome/-/jest-chrome-0.7.2.tgz", - "integrity": "sha512-RSRDi8qNX54Q3ltSC2rW25+47nwY4DoruHOjHR0JZxijITS2PZrQ3j0jZPP3ywC0GuX0JNNwsKD3+iaKzOJEAA==", + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/jest-chrome/-/jest-chrome-0.8.0.tgz", + "integrity": "sha512-39RR1GT9nI4e4jsuH1vIf4l5ApxxkcstjGJr+GsOURL8f4Db0UlbRnsZaM+ZRniaGtokqklUH5VFKGZZ6YztUg==", "dev": true, "requires": { "@types/chrome": "^0.0.114" } }, "jest-circus": { - "version": "27.5.1", - "resolved": "https://registry.npmjs.org/jest-circus/-/jest-circus-27.5.1.tgz", - "integrity": "sha512-D95R7x5UtlMA5iBYsOHFFbMD/GVA4R/Kdq15f7xYWUfWHBto9NYRsOvnSauTgdF+ogCpJ4tyKOXhUifxS65gdw==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-circus/-/jest-circus-29.7.0.tgz", + "integrity": "sha512-3E1nCMgipcTkCocFwM90XXQab9bS+GMsjdpmPrlelaxwD93Ad8iVEjX/vvHPdLPnFf+L40u+5+iutRdA1N9myw==", "dev": true, "requires": { - "@jest/environment": "^27.5.1", - "@jest/test-result": "^27.5.1", - "@jest/types": "^27.5.1", + "@jest/environment": "^29.7.0", + "@jest/expect": "^29.7.0", + "@jest/test-result": "^29.7.0", + "@jest/types": "^29.6.3", "@types/node": "*", "chalk": "^4.0.0", "co": "^4.6.0", - "dedent": "^0.7.0", - "expect": "^27.5.1", + "dedent": "^1.0.0", "is-generator-fn": "^2.0.0", - "jest-each": "^27.5.1", - "jest-matcher-utils": "^27.5.1", - "jest-message-util": "^27.5.1", - "jest-runtime": "^27.5.1", - "jest-snapshot": "^27.5.1", - "jest-util": "^27.5.1", - "pretty-format": "^27.5.1", + "jest-each": "^29.7.0", + "jest-matcher-utils": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-runtime": "^29.7.0", + "jest-snapshot": "^29.7.0", + "jest-util": "^29.7.0", + "p-limit": "^3.1.0", + "pretty-format": "^29.7.0", + "pure-rand": "^6.0.0", "slash": "^3.0.0", - "stack-utils": "^2.0.3", - "throat": "^6.0.1" + "stack-utils": "^2.0.3" }, "dependencies": { "ansi-styles": { @@ -21529,6 +21240,12 @@ "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true }, + "pure-rand": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/pure-rand/-/pure-rand-6.0.3.tgz", + "integrity": "sha512-KddyFewCsO0j3+np81IQ+SweXLDnDQTs5s67BOnrYmYe/yNmUhttQyGsYzy8yUnoljGAQ9sl38YB4vH8ur7Y+w==", + "dev": true + }, "supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", @@ -21541,23 +21258,22 @@ } }, "jest-cli": { - "version": "27.5.1", - "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-27.5.1.tgz", - "integrity": "sha512-Hc6HOOwYq4/74/c62dEE3r5elx8wjYqxY0r0G/nFrLDPMFRu6RA/u8qINOIkvhxG7mMQ5EJsOGfRpI8L6eFUVw==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-29.7.0.tgz", + "integrity": "sha512-OVVobw2IubN/GSYsxETi+gOe7Ka59EFMR/twOU3Jb2GnKKeMGJB5SGUUrEz3SFVmJASUdZUzy83sLNNQ2gZslg==", "dev": true, "requires": { - "@jest/core": "^27.5.1", - "@jest/test-result": "^27.5.1", - "@jest/types": "^27.5.1", + "@jest/core": "^29.7.0", + "@jest/test-result": "^29.7.0", + "@jest/types": "^29.6.3", "chalk": "^4.0.0", + "create-jest": "^29.7.0", "exit": "^0.1.2", - "graceful-fs": "^4.2.9", "import-local": "^3.0.2", - "jest-config": "^27.5.1", - "jest-util": "^27.5.1", - "jest-validate": "^27.5.1", - "prompts": "^2.0.1", - "yargs": "^16.2.0" + "jest-config": "^29.7.0", + "jest-util": "^29.7.0", + "jest-validate": "^29.7.0", + "yargs": "^17.3.1" }, "dependencies": { "ansi-styles": { @@ -21612,33 +21328,31 @@ } }, "jest-config": { - "version": "27.5.1", - "resolved": "https://registry.npmjs.org/jest-config/-/jest-config-27.5.1.tgz", - "integrity": "sha512-5sAsjm6tGdsVbW9ahcChPAFCk4IlkQUknH5AvKjuLTSlcO/wCZKyFdn7Rg0EkC+OGgWODEy2hDpWB1PgzH0JNA==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-config/-/jest-config-29.7.0.tgz", + "integrity": "sha512-uXbpfeQ7R6TZBqI3/TxCU4q4ttk3u0PJeC+E0zbfSoSjq6bJ7buBPxzQPL0ifrkY4DNu4JUdk0ImlBUYi840eQ==", "dev": true, "requires": { - "@babel/core": "^7.8.0", - "@jest/test-sequencer": "^27.5.1", - "@jest/types": "^27.5.1", - "babel-jest": "^27.5.1", + "@babel/core": "^7.11.6", + "@jest/test-sequencer": "^29.7.0", + "@jest/types": "^29.6.3", + "babel-jest": "^29.7.0", "chalk": "^4.0.0", "ci-info": "^3.2.0", "deepmerge": "^4.2.2", - "glob": "^7.1.1", + "glob": "^7.1.3", "graceful-fs": "^4.2.9", - "jest-circus": "^27.5.1", - "jest-environment-jsdom": "^27.5.1", - "jest-environment-node": "^27.5.1", - "jest-get-type": "^27.5.1", - "jest-jasmine2": "^27.5.1", - "jest-regex-util": "^27.5.1", - "jest-resolve": "^27.5.1", - "jest-runner": "^27.5.1", - "jest-util": "^27.5.1", - "jest-validate": "^27.5.1", + "jest-circus": "^29.7.0", + "jest-environment-node": "^29.7.0", + "jest-get-type": "^29.6.3", + "jest-regex-util": "^29.6.3", + "jest-resolve": "^29.7.0", + "jest-runner": "^29.7.0", + "jest-util": "^29.7.0", + "jest-validate": "^29.7.0", "micromatch": "^4.0.4", "parse-json": "^5.2.0", - "pretty-format": "^27.5.1", + "pretty-format": "^29.7.0", "slash": "^3.0.0", "strip-json-comments": "^3.1.1" }, @@ -21683,18 +21397,6 @@ "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true }, - "parse-json": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", - "integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.0.0", - "error-ex": "^1.3.1", - "json-parse-even-better-errors": "^2.3.0", - "lines-and-columns": "^1.1.6" - } - }, "supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", @@ -21707,88 +21409,15 @@ } }, "jest-diff": { - "version": "27.5.1", - "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-27.5.1.tgz", - "integrity": "sha512-m0NvkX55LDt9T4mctTEgnZk3fmEg3NRYutvMPWM/0iPnkFj2wIeF45O1718cMSOFO1vINkqmxqD8vE37uTEbqw==", - "dev": true, - "requires": { - "chalk": "^4.0.0", - "diff-sequences": "^27.5.1", - "jest-get-type": "^27.5.1", - "pretty-format": "^27.5.1" - }, - "dependencies": { - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "requires": { - "color-convert": "^2.0.1" - } - }, - "chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "requires": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true - }, - "supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "requires": { - "has-flag": "^4.0.0" - } - } - } - }, - "jest-docblock": { - "version": "27.5.1", - "resolved": "https://registry.npmjs.org/jest-docblock/-/jest-docblock-27.5.1.tgz", - "integrity": "sha512-rl7hlABeTsRYxKiUfpHrQrG4e2obOiTQWfMEH3PxPjOtdsfLQO4ReWSZaQ7DETm4xu07rl4q/h4zcKXyU0/OzQ==", - "dev": true, - "requires": { - "detect-newline": "^3.0.0" - } - }, - "jest-each": { - "version": "27.5.1", - "resolved": "https://registry.npmjs.org/jest-each/-/jest-each-27.5.1.tgz", - "integrity": "sha512-1Ff6p+FbhT/bXQnEouYy00bkNSY7OUpfIcmdl8vZ31A1UUaurOLPA8a8BbJOF2RDUElwJhmeaV7LnagI+5UwNQ==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-29.7.0.tgz", + "integrity": "sha512-LMIgiIrhigmPrs03JHpxUh2yISK3vLFPkAodPeo0+BuF7wA2FoQbkEg1u8gBYBThncu7e1oEDUfIXVuTqLRUjw==", "dev": true, "requires": { - "@jest/types": "^27.5.1", "chalk": "^4.0.0", - "jest-get-type": "^27.5.1", - "jest-util": "^27.5.1", - "pretty-format": "^27.5.1" + "diff-sequences": "^29.6.3", + "jest-get-type": "^29.6.3", + "pretty-format": "^29.7.0" }, "dependencies": { "ansi-styles": { @@ -21842,453 +21471,26 @@ } } }, - "jest-environment-jsdom": { - "version": "27.5.1", - "resolved": "https://registry.npmjs.org/jest-environment-jsdom/-/jest-environment-jsdom-27.5.1.tgz", - "integrity": "sha512-TFBvkTC1Hnnnrka/fUb56atfDtJ9VMZ94JkjTbggl1PEpwrYtUBKMezB3inLmWqQsXYLcMwNoDQwoBTAvFfsfw==", - "dev": true, - "requires": { - "@jest/environment": "^27.5.1", - "@jest/fake-timers": "^27.5.1", - "@jest/types": "^27.5.1", - "@types/node": "*", - "jest-mock": "^27.5.1", - "jest-util": "^27.5.1", - "jsdom": "^16.6.0" - } - }, - "jest-environment-node": { - "version": "27.5.1", - "resolved": "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-27.5.1.tgz", - "integrity": "sha512-Jt4ZUnxdOsTGwSRAfKEnE6BcwsSPNOijjwifq5sDFSA2kesnXTvNqKHYgM0hDq3549Uf/KzdXNYn4wMZJPlFLw==", - "dev": true, - "requires": { - "@jest/environment": "^27.5.1", - "@jest/fake-timers": "^27.5.1", - "@jest/types": "^27.5.1", - "@types/node": "*", - "jest-mock": "^27.5.1", - "jest-util": "^27.5.1" - } - }, - "jest-get-type": { - "version": "27.5.1", - "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-27.5.1.tgz", - "integrity": "sha512-2KY95ksYSaK7DMBWQn6dQz3kqAf3BB64y2udeG+hv4KfSOb9qwcYQstTJc1KCbsix+wLZWZYN8t7nwX3GOBLRw==", - "dev": true - }, - "jest-haste-map": { - "version": "27.5.1", - "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-27.5.1.tgz", - "integrity": "sha512-7GgkZ4Fw4NFbMSDSpZwXeBiIbx+t/46nJ2QitkOjvwPYyZmqttu2TDSimMHP1EkPOi4xUZAN1doE5Vd25H4Jng==", - "dev": true, - "requires": { - "@jest/types": "^27.5.1", - "@types/graceful-fs": "^4.1.2", - "@types/node": "*", - "anymatch": "^3.0.3", - "fb-watchman": "^2.0.0", - "fsevents": "^2.3.2", - "graceful-fs": "^4.2.9", - "jest-regex-util": "^27.5.1", - "jest-serializer": "^27.5.1", - "jest-util": "^27.5.1", - "jest-worker": "^27.5.1", - "micromatch": "^4.0.4", - "walker": "^1.0.7" - } - }, - "jest-html-reporter": { - "version": "3.4.2", - "resolved": "https://registry.npmjs.org/jest-html-reporter/-/jest-html-reporter-3.4.2.tgz", - "integrity": "sha512-2dA4oJdLP2+rewakwLdBhBCdk50zqzgD6Wk0fvsbdS0C9WwpuePwd0kQWRRdfLzNJM5CgC4O98wkK1lBFqJVrw==", - "dev": true, - "requires": { - "@babel/core": "^7.9.0", - "@babel/preset-env": "^7.8.7", - "@babel/preset-typescript": "^7.8.3", - "@jest/console": "^25.1.0", - "@jest/test-result": "^25.1.0", - "@jest/types": "^26.0.23", - "@types/dateformat": "^3.0.1", - "@types/jest": "^25.1.4", - "@types/mkdirp": "^1.0.0", - "@types/node": "^12.12.7", - "@types/sinon": "^7.5.2", - "dateformat": "3.0.2", - "mkdirp": "^1.0.3", - "sinon": "^9.0.1", - "strip-ansi": "6.0.1", - "xmlbuilder": "15.0.0" - }, - "dependencies": { - "@jest/console": { - "version": "25.5.0", - "resolved": "https://registry.npmjs.org/@jest/console/-/console-25.5.0.tgz", - "integrity": "sha512-T48kZa6MK1Y6k4b89sexwmSF4YLeZS/Udqg3Jj3jG/cHH+N/sLFCEoXEDMOKugJQ9FxPN1osxIknvKkxt6MKyw==", - "dev": true, - "requires": { - "@jest/types": "^25.5.0", - "chalk": "^3.0.0", - "jest-message-util": "^25.5.0", - "jest-util": "^25.5.0", - "slash": "^3.0.0" - }, - "dependencies": { - "@jest/types": { - "version": "25.5.0", - "resolved": "https://registry.npmjs.org/@jest/types/-/types-25.5.0.tgz", - "integrity": "sha512-OXD0RgQ86Tu3MazKo8bnrkDRaDXXMGUqd+kTtLtK1Zb7CRzQcaSRPPPV37SvYTdevXEBVxe0HXylEjs8ibkmCw==", - "dev": true, - "requires": { - "@types/istanbul-lib-coverage": "^2.0.0", - "@types/istanbul-reports": "^1.1.1", - "@types/yargs": "^15.0.0", - "chalk": "^3.0.0" - } - }, - "@types/istanbul-reports": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-1.1.2.tgz", - "integrity": "sha512-P/W9yOX/3oPZSpaYOCQzGqgCQRXn0FFO/V8bWrCQs+wLmvVVxk6CRBXALEvNs9OHIatlnlFokfhuDo2ug01ciw==", - "dev": true, - "requires": { - "@types/istanbul-lib-coverage": "*", - "@types/istanbul-lib-report": "*" - } - } - } - }, - "@jest/test-result": { - "version": "25.5.0", - "resolved": "https://registry.npmjs.org/@jest/test-result/-/test-result-25.5.0.tgz", - "integrity": "sha512-oV+hPJgXN7IQf/fHWkcS99y0smKLU2czLBJ9WA0jHITLst58HpQMtzSYxzaBvYc6U5U6jfoMthqsUlUlbRXs0A==", - "dev": true, - "requires": { - "@jest/console": "^25.5.0", - "@jest/types": "^25.5.0", - "@types/istanbul-lib-coverage": "^2.0.0", - "collect-v8-coverage": "^1.0.0" - }, - "dependencies": { - "@jest/types": { - "version": "25.5.0", - "resolved": "https://registry.npmjs.org/@jest/types/-/types-25.5.0.tgz", - "integrity": "sha512-OXD0RgQ86Tu3MazKo8bnrkDRaDXXMGUqd+kTtLtK1Zb7CRzQcaSRPPPV37SvYTdevXEBVxe0HXylEjs8ibkmCw==", - "dev": true, - "requires": { - "@types/istanbul-lib-coverage": "^2.0.0", - "@types/istanbul-reports": "^1.1.1", - "@types/yargs": "^15.0.0", - "chalk": "^3.0.0" - } - }, - "@types/istanbul-reports": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-1.1.2.tgz", - "integrity": "sha512-P/W9yOX/3oPZSpaYOCQzGqgCQRXn0FFO/V8bWrCQs+wLmvVVxk6CRBXALEvNs9OHIatlnlFokfhuDo2ug01ciw==", - "dev": true, - "requires": { - "@types/istanbul-lib-coverage": "*", - "@types/istanbul-lib-report": "*" - } - } - } - }, - "@jest/types": { - "version": "26.6.2", - "resolved": "https://registry.npmjs.org/@jest/types/-/types-26.6.2.tgz", - "integrity": "sha512-fC6QCp7Sc5sX6g8Tvbmj4XUTbyrik0akgRy03yjXbQaBWWNWGE7SGtJk98m0N8nzegD/7SggrUlivxo5ax4KWQ==", - "dev": true, - "requires": { - "@types/istanbul-lib-coverage": "^2.0.0", - "@types/istanbul-reports": "^3.0.0", - "@types/node": "*", - "@types/yargs": "^15.0.0", - "chalk": "^4.0.0" - }, - "dependencies": { - "chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "requires": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - } - } - } - }, - "@types/jest": { - "version": "25.2.3", - "resolved": "https://registry.npmjs.org/@types/jest/-/jest-25.2.3.tgz", - "integrity": "sha512-JXc1nK/tXHiDhV55dvfzqtmP4S3sy3T3ouV2tkViZgxY/zeUkcpQcQPGRlgF4KmWzWW5oiWYSZwtCB+2RsE4Fw==", - "dev": true, - "requires": { - "jest-diff": "^25.2.1", - "pretty-format": "^25.2.1" - } - }, - "@types/node": { - "version": "12.20.46", - "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.46.tgz", - "integrity": "sha512-cPjLXj8d6anFPzFvOPxS3fvly3Shm5nTfl6g8X5smexixbuGUf7hfr21J5tX9JW+UPStp/5P5R8qrKL5IyVJ+A==", - "dev": true - }, - "@types/stack-utils": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-1.0.1.tgz", - "integrity": "sha512-l42BggppR6zLmpfU6fq9HEa2oGPEI8yrSPL3GITjfRInppYFahObbIQOQK3UGxEnyQpltZLaPe75046NOZQikw==", - "dev": true - }, - "@types/yargs": { - "version": "15.0.14", - "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-15.0.14.tgz", - "integrity": "sha512-yEJzHoxf6SyQGhBhIYGXQDSCkJjB6HohDShto7m8vaKg9Yp0Yn8+71J9eakh2bnPg6BfsH9PRMhiRTZnd4eXGQ==", - "dev": true, - "requires": { - "@types/yargs-parser": "*" - } - }, - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "requires": { - "color-convert": "^2.0.1" - } - }, - "chalk": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-3.0.0.tgz", - "integrity": "sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==", - "dev": true, - "requires": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "dateformat": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/dateformat/-/dateformat-3.0.2.tgz", - "integrity": "sha1-mk30v/FYrC80vGN6vbFUcWB+Flk=", - "dev": true - }, - "diff-sequences": { - "version": "25.2.6", - "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-25.2.6.tgz", - "integrity": "sha512-Hq8o7+6GaZeoFjtpgvRBUknSXNeJiCx7V9Fr94ZMljNiCr9n9L8H8aJqgWOQiDDGdyn29fRNcDdRVJ5fdyihfg==", - "dev": true - }, - "escape-string-regexp": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz", - "integrity": "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==", - "dev": true - }, - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true - }, - "jest-diff": { - "version": "25.5.0", - "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-25.5.0.tgz", - "integrity": "sha512-z1kygetuPiREYdNIumRpAHY6RXiGmp70YHptjdaxTWGmA085W3iCnXNx0DhflK3vwrKmrRWyY1wUpkPMVxMK7A==", - "dev": true, - "requires": { - "chalk": "^3.0.0", - "diff-sequences": "^25.2.6", - "jest-get-type": "^25.2.6", - "pretty-format": "^25.5.0" - } - }, - "jest-get-type": { - "version": "25.2.6", - "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-25.2.6.tgz", - "integrity": "sha512-DxjtyzOHjObRM+sM1knti6or+eOgcGU4xVSb2HNP1TqO4ahsT+rqZg+nyqHWJSvWgKC5cG3QjGFBqxLghiF/Ig==", - "dev": true - }, - "jest-message-util": { - "version": "25.5.0", - "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-25.5.0.tgz", - "integrity": "sha512-ezddz3YCT/LT0SKAmylVyWWIGYoKHOFOFXx3/nA4m794lfVUskMcwhip6vTgdVrOtYdjeQeis2ypzes9mZb4EA==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.0.0", - "@jest/types": "^25.5.0", - "@types/stack-utils": "^1.0.1", - "chalk": "^3.0.0", - "graceful-fs": "^4.2.4", - "micromatch": "^4.0.2", - "slash": "^3.0.0", - "stack-utils": "^1.0.1" - }, - "dependencies": { - "@jest/types": { - "version": "25.5.0", - "resolved": "https://registry.npmjs.org/@jest/types/-/types-25.5.0.tgz", - "integrity": "sha512-OXD0RgQ86Tu3MazKo8bnrkDRaDXXMGUqd+kTtLtK1Zb7CRzQcaSRPPPV37SvYTdevXEBVxe0HXylEjs8ibkmCw==", - "dev": true, - "requires": { - "@types/istanbul-lib-coverage": "^2.0.0", - "@types/istanbul-reports": "^1.1.1", - "@types/yargs": "^15.0.0", - "chalk": "^3.0.0" - } - }, - "@types/istanbul-reports": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-1.1.2.tgz", - "integrity": "sha512-P/W9yOX/3oPZSpaYOCQzGqgCQRXn0FFO/V8bWrCQs+wLmvVVxk6CRBXALEvNs9OHIatlnlFokfhuDo2ug01ciw==", - "dev": true, - "requires": { - "@types/istanbul-lib-coverage": "*", - "@types/istanbul-lib-report": "*" - } - } - } - }, - "jest-util": { - "version": "25.5.0", - "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-25.5.0.tgz", - "integrity": "sha512-KVlX+WWg1zUTB9ktvhsg2PXZVdkI1NBevOJSkTKYAyXyH4QSvh+Lay/e/v+bmaFfrkfx43xD8QTfgobzlEXdIA==", - "dev": true, - "requires": { - "@jest/types": "^25.5.0", - "chalk": "^3.0.0", - "graceful-fs": "^4.2.4", - "is-ci": "^2.0.0", - "make-dir": "^3.0.0" - }, - "dependencies": { - "@jest/types": { - "version": "25.5.0", - "resolved": "https://registry.npmjs.org/@jest/types/-/types-25.5.0.tgz", - "integrity": "sha512-OXD0RgQ86Tu3MazKo8bnrkDRaDXXMGUqd+kTtLtK1Zb7CRzQcaSRPPPV37SvYTdevXEBVxe0HXylEjs8ibkmCw==", - "dev": true, - "requires": { - "@types/istanbul-lib-coverage": "^2.0.0", - "@types/istanbul-reports": "^1.1.1", - "@types/yargs": "^15.0.0", - "chalk": "^3.0.0" - } - }, - "@types/istanbul-reports": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-1.1.2.tgz", - "integrity": "sha512-P/W9yOX/3oPZSpaYOCQzGqgCQRXn0FFO/V8bWrCQs+wLmvVVxk6CRBXALEvNs9OHIatlnlFokfhuDo2ug01ciw==", - "dev": true, - "requires": { - "@types/istanbul-lib-coverage": "*", - "@types/istanbul-lib-report": "*" - } - } - } - }, - "pretty-format": { - "version": "25.5.0", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-25.5.0.tgz", - "integrity": "sha512-kbo/kq2LQ/A/is0PQwsEHM7Ca6//bGPPvU6UnsdDRSKTWxT/ru/xb88v4BJf6a69H+uTytOEsTusT9ksd/1iWQ==", - "dev": true, - "requires": { - "@jest/types": "^25.5.0", - "ansi-regex": "^5.0.0", - "ansi-styles": "^4.0.0", - "react-is": "^16.12.0" - }, - "dependencies": { - "@jest/types": { - "version": "25.5.0", - "resolved": "https://registry.npmjs.org/@jest/types/-/types-25.5.0.tgz", - "integrity": "sha512-OXD0RgQ86Tu3MazKo8bnrkDRaDXXMGUqd+kTtLtK1Zb7CRzQcaSRPPPV37SvYTdevXEBVxe0HXylEjs8ibkmCw==", - "dev": true, - "requires": { - "@types/istanbul-lib-coverage": "^2.0.0", - "@types/istanbul-reports": "^1.1.1", - "@types/yargs": "^15.0.0", - "chalk": "^3.0.0" - } - }, - "@types/istanbul-reports": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-1.1.2.tgz", - "integrity": "sha512-P/W9yOX/3oPZSpaYOCQzGqgCQRXn0FFO/V8bWrCQs+wLmvVVxk6CRBXALEvNs9OHIatlnlFokfhuDo2ug01ciw==", - "dev": true, - "requires": { - "@types/istanbul-lib-coverage": "*", - "@types/istanbul-lib-report": "*" - } - } - } - }, - "react-is": { - "version": "16.13.1", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", - "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==", - "dev": true - }, - "stack-utils": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/stack-utils/-/stack-utils-1.0.5.tgz", - "integrity": "sha512-KZiTzuV3CnSnSvgMRrARVCj+Ht7rMbauGDK0LdVFRGyenwdylpajAp4Q0i6SX8rEmbTpMMf6ryq2gb8pPq2WgQ==", - "dev": true, - "requires": { - "escape-string-regexp": "^2.0.0" - } - }, - "supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "requires": { - "has-flag": "^4.0.0" - } - } + "jest-docblock": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-docblock/-/jest-docblock-29.7.0.tgz", + "integrity": "sha512-q617Auw3A612guyaFgsbFeYpNP5t2aoUNLwBUbc/0kD1R4t9ixDbyFTHd1nok4epoVFpr7PmeWHrhvuV3XaJ4g==", + "dev": true, + "requires": { + "detect-newline": "^3.0.0" } }, - "jest-jasmine2": { - "version": "27.5.1", - "resolved": "https://registry.npmjs.org/jest-jasmine2/-/jest-jasmine2-27.5.1.tgz", - "integrity": "sha512-jtq7VVyG8SqAorDpApwiJJImd0V2wv1xzdheGHRGyuT7gZm6gG47QEskOlzsN1PG/6WNaCo5pmwMHDf3AkG2pQ==", + "jest-each": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-each/-/jest-each-29.7.0.tgz", + "integrity": "sha512-gns+Er14+ZrEoC5fhOfYCY1LOHHr0TI+rQUHZS8Ttw2l7gl+80eHc/gFf2Ktkw0+SIACDTeWvpFcv3B04VembQ==", "dev": true, "requires": { - "@jest/environment": "^27.5.1", - "@jest/source-map": "^27.5.1", - "@jest/test-result": "^27.5.1", - "@jest/types": "^27.5.1", - "@types/node": "*", + "@jest/types": "^29.6.3", "chalk": "^4.0.0", - "co": "^4.6.0", - "expect": "^27.5.1", - "is-generator-fn": "^2.0.0", - "jest-each": "^27.5.1", - "jest-matcher-utils": "^27.5.1", - "jest-message-util": "^27.5.1", - "jest-runtime": "^27.5.1", - "jest-snapshot": "^27.5.1", - "jest-util": "^27.5.1", - "pretty-format": "^27.5.1", - "throat": "^6.0.1" + "jest-get-type": "^29.6.3", + "jest-util": "^29.7.0", + "pretty-format": "^29.7.0" }, "dependencies": { "ansi-styles": { @@ -22342,26 +21544,104 @@ } } }, + "jest-environment-jsdom": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-environment-jsdom/-/jest-environment-jsdom-29.7.0.tgz", + "integrity": "sha512-k9iQbsf9OyOfdzWH8HDmrRT0gSIcX+FLNW7IQq94tFX0gynPwqDTW0Ho6iMVNjGz/nb+l/vW3dWM2bbLLpkbXA==", + "dev": true, + "requires": { + "@jest/environment": "^29.7.0", + "@jest/fake-timers": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/jsdom": "^20.0.0", + "@types/node": "*", + "jest-mock": "^29.7.0", + "jest-util": "^29.7.0", + "jsdom": "^20.0.0" + } + }, + "jest-environment-node": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-29.7.0.tgz", + "integrity": "sha512-DOSwCRqXirTOyheM+4d5YZOrWcdu0LNZ87ewUoywbcb2XR4wKgqiG8vNeYwhjFMbEkfju7wx2GYH0P2gevGvFw==", + "dev": true, + "requires": { + "@jest/environment": "^29.7.0", + "@jest/fake-timers": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "jest-mock": "^29.7.0", + "jest-util": "^29.7.0" + } + }, + "jest-get-type": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-29.6.3.tgz", + "integrity": "sha512-zrteXnqYxfQh7l5FHyL38jL39di8H8rHoecLH3JNxH3BwOrBsNeabdap5e0I23lD4HHI8W5VFBZqG4Eaq5LNcw==", + "dev": true + }, + "jest-haste-map": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-29.7.0.tgz", + "integrity": "sha512-fP8u2pyfqx0K1rGn1R9pyE0/KTn+G7PxktWidOBTqFPLYX0b9ksaMFkhK5vrS3DVun09pckLdlx90QthlW7AmA==", + "dev": true, + "requires": { + "@jest/types": "^29.6.3", + "@types/graceful-fs": "^4.1.3", + "@types/node": "*", + "anymatch": "^3.0.3", + "fb-watchman": "^2.0.0", + "fsevents": "^2.3.2", + "graceful-fs": "^4.2.9", + "jest-regex-util": "^29.6.3", + "jest-util": "^29.7.0", + "jest-worker": "^29.7.0", + "micromatch": "^4.0.4", + "walker": "^1.0.8" + } + }, + "jest-html-reporter": { + "version": "3.10.2", + "resolved": "https://registry.npmjs.org/jest-html-reporter/-/jest-html-reporter-3.10.2.tgz", + "integrity": "sha512-XRBa5ylHPUQoo8aJXEEdKsTruieTdlPbRktMx9WG9evMTxzJEKGFMaw5x+sQxJuClWdNR72GGwbOaz+6HIlksA==", + "dev": true, + "requires": { + "@jest/test-result": "^29.0.2", + "@jest/types": "^29.0.2", + "dateformat": "3.0.2", + "mkdirp": "^1.0.3", + "strip-ansi": "6.0.1", + "xmlbuilder": "15.0.0" + }, + "dependencies": { + "dateformat": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/dateformat/-/dateformat-3.0.2.tgz", + "integrity": "sha1-mk30v/FYrC80vGN6vbFUcWB+Flk=", + "dev": true + } + } + }, "jest-leak-detector": { - "version": "27.5.1", - "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-27.5.1.tgz", - "integrity": "sha512-POXfWAMvfU6WMUXftV4HolnJfnPOGEu10fscNCA76KBpRRhcMN2c8d3iT2pxQS3HLbA+5X4sOUPzYO2NUyIlHQ==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-29.7.0.tgz", + "integrity": "sha512-kYA8IJcSYtST2BY9I+SMC32nDpBT3J2NvWJx8+JCuCdl/CR1I4EKUJROiP8XtCcxqgTTBGJNdbB1A8XRKbTetw==", "dev": true, "requires": { - "jest-get-type": "^27.5.1", - "pretty-format": "^27.5.1" + "jest-get-type": "^29.6.3", + "pretty-format": "^29.7.0" } }, "jest-matcher-utils": { - "version": "27.5.1", - "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-27.5.1.tgz", - "integrity": "sha512-z2uTx/T6LBaCoNWNFWwChLBKYxTMcGBRjAt+2SbP929/Fflb9aa5LGma654Rz8z9HLxsrUaYzxE9T/EFIL/PAw==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-29.7.0.tgz", + "integrity": "sha512-sBkD+Xi9DtcChsI3L3u0+N0opgPYnCRPtGcQYrgXmR+hmt/fYfWAL0xRXYU8eWOdfuLgBe0YCW3AFtnRLagq/g==", "dev": true, "requires": { "chalk": "^4.0.0", - "jest-diff": "^27.5.1", - "jest-get-type": "^27.5.1", - "pretty-format": "^27.5.1" + "jest-diff": "^29.7.0", + "jest-get-type": "^29.6.3", + "pretty-format": "^29.7.0" }, "dependencies": { "ansi-styles": { @@ -22416,18 +21696,18 @@ } }, "jest-message-util": { - "version": "27.5.1", - "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-27.5.1.tgz", - "integrity": "sha512-rMyFe1+jnyAAf+NHwTclDz0eAaLkVDdKVHHBFWsBWHnnh5YeJMNWWsv7AbFYXfK3oTqvL7VTWkhNLu1jX24D+g==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-29.7.0.tgz", + "integrity": "sha512-GBEV4GRADeP+qtB2+6u61stea8mGcOT4mCtrYISZwfu9/ISHFJ/5zOMXYbpBE9RsS5+Gb63DW4FgmnKJ79Kf6w==", "dev": true, "requires": { "@babel/code-frame": "^7.12.13", - "@jest/types": "^27.5.1", + "@jest/types": "^29.6.3", "@types/stack-utils": "^2.0.0", "chalk": "^4.0.0", "graceful-fs": "^4.2.9", "micromatch": "^4.0.4", - "pretty-format": "^27.5.1", + "pretty-format": "^29.7.0", "slash": "^3.0.0", "stack-utils": "^2.0.3" }, @@ -22484,43 +21764,43 @@ } }, "jest-mock": { - "version": "27.5.1", - "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-27.5.1.tgz", - "integrity": "sha512-K4jKbY1d4ENhbrG2zuPWaQBvDly+iZ2yAW+T1fATN78hc0sInwn7wZB8XtlNnvHug5RMwV897Xm4LqmPM4e2Og==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-29.7.0.tgz", + "integrity": "sha512-ITOMZn+UkYS4ZFh83xYAOzWStloNzJFO2s8DWrE4lhtGD+AorgnbkiKERe4wQVBydIGPx059g6riW5Btp6Llnw==", "dev": true, "requires": { - "@jest/types": "^27.5.1", - "@types/node": "*" + "@jest/types": "^29.6.3", + "@types/node": "*", + "jest-util": "^29.7.0" } }, "jest-pnp-resolver": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/jest-pnp-resolver/-/jest-pnp-resolver-1.2.2.tgz", - "integrity": "sha512-olV41bKSMm8BdnuMsewT4jqlZ8+3TCARAXjZGT9jcoSnrfUnRCqnMoF9XEeoWjbzObpqF9dRhHQj0Xb9QdF6/w==", + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/jest-pnp-resolver/-/jest-pnp-resolver-1.2.3.tgz", + "integrity": "sha512-+3NpwQEnRoIBtx4fyhblQDPgJI0H1IEIkX7ShLUjPGA7TtUTvI1oiKi3SR4oBR0hQhQR80l4WAe5RrXBwWMA8w==", "dev": true, "requires": {} }, "jest-regex-util": { - "version": "27.5.1", - "resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-27.5.1.tgz", - "integrity": "sha512-4bfKq2zie+x16okqDXjXn9ql2B0dScQu+vcwe4TvFVhkVyuWLqpZrZtXxLLWoXYgn0E87I6r6GRYHF7wFZBUvg==", + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-29.6.3.tgz", + "integrity": "sha512-KJJBsRCyyLNWCNBOvZyRDnAIfUiRJ8v+hOBQYGn8gDyF3UegwiP4gwRR3/SDa42g1YbVycTidUF3rKjyLFDWbg==", "dev": true }, "jest-resolve": { - "version": "27.5.1", - "resolved": "https://registry.npmjs.org/jest-resolve/-/jest-resolve-27.5.1.tgz", - "integrity": "sha512-FFDy8/9E6CV83IMbDpcjOhumAQPDyETnU2KZ1O98DwTnz8AOBsW/Xv3GySr1mOZdItLR+zDZ7I/UdTFbgSOVCw==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-resolve/-/jest-resolve-29.7.0.tgz", + "integrity": "sha512-IOVhZSrg+UvVAshDSDtHyFCCBUl/Q3AAJv8iZ6ZjnZ74xzvwuzLXid9IIIPgTnY62SJjfuupMKZsZQRsCvxEgA==", "dev": true, "requires": { - "@jest/types": "^27.5.1", "chalk": "^4.0.0", "graceful-fs": "^4.2.9", - "jest-haste-map": "^27.5.1", + "jest-haste-map": "^29.7.0", "jest-pnp-resolver": "^1.2.2", - "jest-util": "^27.5.1", - "jest-validate": "^27.5.1", + "jest-util": "^29.7.0", + "jest-validate": "^29.7.0", "resolve": "^1.20.0", - "resolve.exports": "^1.1.0", + "resolve.exports": "^2.0.0", "slash": "^3.0.0" }, "dependencies": { @@ -22576,43 +21856,42 @@ } }, "jest-resolve-dependencies": { - "version": "27.5.1", - "resolved": "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-27.5.1.tgz", - "integrity": "sha512-QQOOdY4PE39iawDn5rzbIePNigfe5B9Z91GDD1ae/xNDlu9kaat8QQ5EKnNmVWPV54hUdxCVwwj6YMgR2O7IOg==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-29.7.0.tgz", + "integrity": "sha512-un0zD/6qxJ+S0et7WxeI3H5XSe9lTBBR7bOHCHXkKR6luG5mwDDlIzVQ0V5cZCuoTgEdcdwzTghYkTWfubi+nA==", "dev": true, "requires": { - "@jest/types": "^27.5.1", - "jest-regex-util": "^27.5.1", - "jest-snapshot": "^27.5.1" + "jest-regex-util": "^29.6.3", + "jest-snapshot": "^29.7.0" } }, "jest-runner": { - "version": "27.5.1", - "resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-27.5.1.tgz", - "integrity": "sha512-g4NPsM4mFCOwFKXO4p/H/kWGdJp9V8kURY2lX8Me2drgXqG7rrZAx5kv+5H7wtt/cdFIjhqYx1HrlqWHaOvDaQ==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-29.7.0.tgz", + "integrity": "sha512-fsc4N6cPCAahybGBfTRcq5wFR6fpLznMg47sY5aDpsoejOcVYFb07AHuSnR0liMcPTgBsA3ZJL6kFOjPdoNipQ==", "dev": true, "requires": { - "@jest/console": "^27.5.1", - "@jest/environment": "^27.5.1", - "@jest/test-result": "^27.5.1", - "@jest/transform": "^27.5.1", - "@jest/types": "^27.5.1", + "@jest/console": "^29.7.0", + "@jest/environment": "^29.7.0", + "@jest/test-result": "^29.7.0", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", "@types/node": "*", "chalk": "^4.0.0", - "emittery": "^0.8.1", + "emittery": "^0.13.1", "graceful-fs": "^4.2.9", - "jest-docblock": "^27.5.1", - "jest-environment-jsdom": "^27.5.1", - "jest-environment-node": "^27.5.1", - "jest-haste-map": "^27.5.1", - "jest-leak-detector": "^27.5.1", - "jest-message-util": "^27.5.1", - "jest-resolve": "^27.5.1", - "jest-runtime": "^27.5.1", - "jest-util": "^27.5.1", - "jest-worker": "^27.5.1", - "source-map-support": "^0.5.6", - "throat": "^6.0.1" + "jest-docblock": "^29.7.0", + "jest-environment-node": "^29.7.0", + "jest-haste-map": "^29.7.0", + "jest-leak-detector": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-resolve": "^29.7.0", + "jest-runtime": "^29.7.0", + "jest-util": "^29.7.0", + "jest-watcher": "^29.7.0", + "jest-worker": "^29.7.0", + "p-limit": "^3.1.0", + "source-map-support": "0.5.13" }, "dependencies": { "ansi-styles": { @@ -22667,31 +21946,31 @@ } }, "jest-runtime": { - "version": "27.5.1", - "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-27.5.1.tgz", - "integrity": "sha512-o7gxw3Gf+H2IGt8fv0RiyE1+r83FJBRruoA+FXrlHw6xEyBsU8ugA6IPfTdVyA0w8HClpbK+DGJxH59UrNMx8A==", - "dev": true, - "requires": { - "@jest/environment": "^27.5.1", - "@jest/fake-timers": "^27.5.1", - "@jest/globals": "^27.5.1", - "@jest/source-map": "^27.5.1", - "@jest/test-result": "^27.5.1", - "@jest/transform": "^27.5.1", - "@jest/types": "^27.5.1", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-29.7.0.tgz", + "integrity": "sha512-gUnLjgwdGqW7B4LvOIkbKs9WGbn+QLqRQQ9juC6HndeDiezIwhDP+mhMwHWCEcfQ5RUXa6OPnFF8BJh5xegwwQ==", + "dev": true, + "requires": { + "@jest/environment": "^29.7.0", + "@jest/fake-timers": "^29.7.0", + "@jest/globals": "^29.7.0", + "@jest/source-map": "^29.6.3", + "@jest/test-result": "^29.7.0", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", "chalk": "^4.0.0", "cjs-module-lexer": "^1.0.0", "collect-v8-coverage": "^1.0.0", - "execa": "^5.0.0", "glob": "^7.1.3", "graceful-fs": "^4.2.9", - "jest-haste-map": "^27.5.1", - "jest-message-util": "^27.5.1", - "jest-mock": "^27.5.1", - "jest-regex-util": "^27.5.1", - "jest-resolve": "^27.5.1", - "jest-snapshot": "^27.5.1", - "jest-util": "^27.5.1", + "jest-haste-map": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-mock": "^29.7.0", + "jest-regex-util": "^29.6.3", + "jest-resolve": "^29.7.0", + "jest-snapshot": "^29.7.0", + "jest-util": "^29.7.0", "slash": "^3.0.0", "strip-bom": "^4.0.0" }, @@ -22736,12 +22015,6 @@ "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true }, - "strip-bom": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz", - "integrity": "sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==", - "dev": true - }, "supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", @@ -22753,44 +22026,32 @@ } } }, - "jest-serializer": { - "version": "27.5.1", - "resolved": "https://registry.npmjs.org/jest-serializer/-/jest-serializer-27.5.1.tgz", - "integrity": "sha512-jZCyo6iIxO1aqUxpuBlwTDMkzOAJS4a3eYz3YzgxxVQFwLeSA7Jfq5cbqCY+JLvTDrWirgusI/0KwxKMgrdf7w==", - "dev": true, - "requires": { - "@types/node": "*", - "graceful-fs": "^4.2.9" - } - }, "jest-snapshot": { - "version": "27.5.1", - "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-27.5.1.tgz", - "integrity": "sha512-yYykXI5a0I31xX67mgeLw1DZ0bJB+gpq5IpSuCAoyDi0+BhgU/RIrL+RTzDmkNTchvDFWKP8lp+w/42Z3us5sA==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-29.7.0.tgz", + "integrity": "sha512-Rm0BMWtxBcioHr1/OX5YCP8Uov4riHvKPknOGs804Zg9JGZgmIBkbtlxJC/7Z4msKYVbIJtfU+tKb8xlYNfdkw==", "dev": true, "requires": { - "@babel/core": "^7.7.2", + "@babel/core": "^7.11.6", "@babel/generator": "^7.7.2", + "@babel/plugin-syntax-jsx": "^7.7.2", "@babel/plugin-syntax-typescript": "^7.7.2", - "@babel/traverse": "^7.7.2", - "@babel/types": "^7.0.0", - "@jest/transform": "^27.5.1", - "@jest/types": "^27.5.1", - "@types/babel__traverse": "^7.0.4", - "@types/prettier": "^2.1.5", + "@babel/types": "^7.3.3", + "@jest/expect-utils": "^29.7.0", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", "babel-preset-current-node-syntax": "^1.0.0", "chalk": "^4.0.0", - "expect": "^27.5.1", + "expect": "^29.7.0", "graceful-fs": "^4.2.9", - "jest-diff": "^27.5.1", - "jest-get-type": "^27.5.1", - "jest-haste-map": "^27.5.1", - "jest-matcher-utils": "^27.5.1", - "jest-message-util": "^27.5.1", - "jest-util": "^27.5.1", + "jest-diff": "^29.7.0", + "jest-get-type": "^29.6.3", + "jest-matcher-utils": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-util": "^29.7.0", "natural-compare": "^1.4.0", - "pretty-format": "^27.5.1", - "semver": "^7.3.2" + "pretty-format": "^29.7.0", + "semver": "^7.5.3" }, "dependencies": { "ansi-styles": { @@ -22834,9 +22095,9 @@ "dev": true }, "semver": { - "version": "7.3.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", - "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", "dev": true, "requires": { "lru-cache": "^6.0.0" @@ -22854,12 +22115,12 @@ } }, "jest-util": { - "version": "27.5.1", - "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-27.5.1.tgz", - "integrity": "sha512-Kv2o/8jNvX1MQ0KGtw480E/w4fBCDOnH6+6DmeKi6LZUIlKA5kwY0YNdlzaWTiVgxqAqik11QyxDOKk543aKXw==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-29.7.0.tgz", + "integrity": "sha512-z6EbKajIpqGKU56y5KBUgy1dt1ihhQJgWzUlZHArA/+X2ad7Cb5iF+AK1EWVL/Bo7Rz9uurpqw6SiBCefUbCGA==", "dev": true, "requires": { - "@jest/types": "^27.5.1", + "@jest/types": "^29.6.3", "@types/node": "*", "chalk": "^4.0.0", "ci-info": "^3.2.0", @@ -22919,17 +22180,17 @@ } }, "jest-validate": { - "version": "27.5.1", - "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-27.5.1.tgz", - "integrity": "sha512-thkNli0LYTmOI1tDB3FI1S1RTp/Bqyd9pTarJwL87OIBFuqEb5Apv5EaApEudYg4g86e3CT6kM0RowkhtEnCBQ==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-29.7.0.tgz", + "integrity": "sha512-ZB7wHqaRGVw/9hST/OuFUReG7M8vKeq0/J2egIGLdvjHCmYqGARhzXmtgi+gVeZ5uXFF219aOc3Ls2yLg27tkw==", "dev": true, "requires": { - "@jest/types": "^27.5.1", + "@jest/types": "^29.6.3", "camelcase": "^6.2.0", "chalk": "^4.0.0", - "jest-get-type": "^27.5.1", + "jest-get-type": "^29.6.3", "leven": "^3.1.0", - "pretty-format": "^27.5.1" + "pretty-format": "^29.7.0" }, "dependencies": { "ansi-styles": { @@ -22990,17 +22251,18 @@ } }, "jest-watcher": { - "version": "27.5.1", - "resolved": "https://registry.npmjs.org/jest-watcher/-/jest-watcher-27.5.1.tgz", - "integrity": "sha512-z676SuD6Z8o8qbmEGhoEUFOM1+jfEiL3DXHK/xgEiG2EyNYfFG60jluWcupY6dATjfEsKQuibReS1djInQnoVw==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-watcher/-/jest-watcher-29.7.0.tgz", + "integrity": "sha512-49Fg7WXkU3Vl2h6LbLtMQ/HyB6rXSIX7SqvBLQmssRBGN9I0PNvPmAmCWSOY6SOvrjhI/F7/bGAv9RtnsPA03g==", "dev": true, "requires": { - "@jest/test-result": "^27.5.1", - "@jest/types": "^27.5.1", + "@jest/test-result": "^29.7.0", + "@jest/types": "^29.6.3", "@types/node": "*", "ansi-escapes": "^4.2.1", "chalk": "^4.0.0", - "jest-util": "^27.5.1", + "emittery": "^0.13.1", + "jest-util": "^29.7.0", "string-length": "^4.0.1" }, "dependencies": { @@ -23056,12 +22318,13 @@ } }, "jest-worker": { - "version": "27.5.1", - "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-27.5.1.tgz", - "integrity": "sha512-7vuh85V5cdDofPyxn58nrPjBktZo0u9x1g8WtjQol+jZDaE+fhN+cIvTj11GndBnMnyfrUOG1sZQxCdjKh+DKg==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-29.7.0.tgz", + "integrity": "sha512-eIz2msL/EzL9UFTFFx7jBTkeZfku0yUAyZZZmJ93H2TYEiroIx2PQjEXcwYtYl8zXCxb+PAmA2hLIt/6ZEkPHw==", "dev": true, "requires": { "@types/node": "*", + "jest-util": "^29.7.0", "merge-stream": "^2.0.0", "supports-color": "^8.0.0" }, @@ -23106,50 +22369,49 @@ "dev": true }, "jsdom": { - "version": "16.7.0", - "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-16.7.0.tgz", - "integrity": "sha512-u9Smc2G1USStM+s/x1ru5Sxrl6mPYCbByG1U/hUmqaVsm4tbNyS7CicOSRyuGQYZhTu0h84qkZZQ/I+dzizSVw==", + "version": "20.0.3", + "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-20.0.3.tgz", + "integrity": "sha512-SYhBvTh89tTfCD/CRdSOm13mOBa42iTaTyfyEWBdKcGdPxPtLFBXuHR8XHb33YNYaP+lLbmSvBTsnoesCNJEsQ==", "dev": true, "requires": { - "abab": "^2.0.5", - "acorn": "^8.2.4", - "acorn-globals": "^6.0.0", - "cssom": "^0.4.4", + "abab": "^2.0.6", + "acorn": "^8.8.1", + "acorn-globals": "^7.0.0", + "cssom": "^0.5.0", "cssstyle": "^2.3.0", - "data-urls": "^2.0.0", - "decimal.js": "^10.2.1", - "domexception": "^2.0.1", + "data-urls": "^3.0.2", + "decimal.js": "^10.4.2", + "domexception": "^4.0.0", "escodegen": "^2.0.0", - "form-data": "^3.0.0", - "html-encoding-sniffer": "^2.0.1", - "http-proxy-agent": "^4.0.1", - "https-proxy-agent": "^5.0.0", + "form-data": "^4.0.0", + "html-encoding-sniffer": "^3.0.0", + "http-proxy-agent": "^5.0.0", + "https-proxy-agent": "^5.0.1", "is-potential-custom-element-name": "^1.0.1", - "nwsapi": "^2.2.0", - "parse5": "6.0.1", - "saxes": "^5.0.1", + "nwsapi": "^2.2.2", + "parse5": "^7.1.1", + "saxes": "^6.0.0", "symbol-tree": "^3.2.4", - "tough-cookie": "^4.0.0", - "w3c-hr-time": "^1.0.2", - "w3c-xmlserializer": "^2.0.0", - "webidl-conversions": "^6.1.0", - "whatwg-encoding": "^1.0.5", - "whatwg-mimetype": "^2.3.0", - "whatwg-url": "^8.5.0", - "ws": "^7.4.6", - "xml-name-validator": "^3.0.0" + "tough-cookie": "^4.1.2", + "w3c-xmlserializer": "^4.0.0", + "webidl-conversions": "^7.0.0", + "whatwg-encoding": "^2.0.0", + "whatwg-mimetype": "^3.0.0", + "whatwg-url": "^11.0.0", + "ws": "^8.11.0", + "xml-name-validator": "^4.0.0" }, "dependencies": { "acorn": { - "version": "8.7.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.7.0.tgz", - "integrity": "sha512-V/LGr1APy+PXIwKebEWrkZPwoeoF+w1jiOBUmuxuiUIaOHtob8Qc9BTrYo7VuI5fR8tqsy+buA2WFooR5olqvQ==", + "version": "8.10.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.10.0.tgz", + "integrity": "sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw==", "dev": true }, "form-data": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-3.0.1.tgz", - "integrity": "sha512-RHkBKtLWUVwd7SqRIvCZMEvAMoGUp0XU+seQiZejj0COz3RI3hWP4sCv3gZWWLjJTd7rGwcsF5eKZGii0r/hbg==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", + "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", "dev": true, "requires": { "asynckit": "^0.4.0", @@ -23178,12 +22440,12 @@ "dev": true }, "json-schema-to-typescript": { - "version": "11.0.2", - "resolved": "https://registry.npmjs.org/json-schema-to-typescript/-/json-schema-to-typescript-11.0.2.tgz", - "integrity": "sha512-XRyeXBJeo/IH4eTP5D1ptX78vCvH86nMDt2k3AxO28C3uYWEDmy4mgPyMpb8bLJ/pJMElOGuQbnKR5Y6NSh3QQ==", + "version": "13.1.1", + "resolved": "https://registry.npmjs.org/json-schema-to-typescript/-/json-schema-to-typescript-13.1.1.tgz", + "integrity": "sha512-F3CYhtA7F3yPbb8vF7sFchk/2dnr1/yTKf8RcvoNpjnh67ZS/ZMH1ElLt5KHAtf2/bymiejLQQszszPWEeTdSw==", "dev": true, "requires": { - "@bcherny/json-schema-ref-parser": "9.0.9", + "@bcherny/json-schema-ref-parser": "10.0.5-fork", "@types/json-schema": "^7.0.11", "@types/lodash": "^4.14.182", "@types/prettier": "^2.6.1", @@ -23200,9 +22462,9 @@ } }, "json-schema-traverse": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", - "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", "dev": true }, "json-stable-stringify-without-jsonify": { @@ -23218,9 +22480,9 @@ "dev": true }, "json5": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.1.tgz", - "integrity": "sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA==", + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", + "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", "dev": true }, "jsonfile": { @@ -23269,12 +22531,6 @@ "verror": "1.10.0" } }, - "just-extend": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/just-extend/-/just-extend-4.2.1.tgz", - "integrity": "sha512-g3UB796vUFIY90VIv/WX3L2c8CS2MdWUww3CNrYmqza1Fg0DURc2K/O4YrnklBdQarSJ/y8JnJYDGc+1iumQjg==", - "dev": true - }, "kind-of": { "version": "6.0.3", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", @@ -23377,13 +22633,12 @@ } }, "locate-path": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", - "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", "dev": true, "requires": { - "p-locate": "^2.0.0", - "path-exists": "^3.0.0" + "p-locate": "^5.0.0" } }, "lodash": { @@ -23392,28 +22647,10 @@ "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", "dev": true }, - "lodash.clonedeep": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz", - "integrity": "sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8=", - "dev": true - }, "lodash.debounce": { "version": "4.0.8", "resolved": "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz", - "integrity": "sha1-gteb/zCmfEAF/9XiUVMArZyk168=", - "dev": true - }, - "lodash.flatten": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/lodash.flatten/-/lodash.flatten-4.4.0.tgz", - "integrity": "sha1-8xwiIlqWMtK7+OSt2+8kCqdlph8=", - "dev": true - }, - "lodash.get": { - "version": "4.4.2", - "resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz", - "integrity": "sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk=", + "integrity": "sha512-FT1yDzDYEoYWhnSGnpE/4Kj1fLZkDFyqRb7fNt6FdYOSxlUWAtp42Eh6Wb0rGIv/m9Bgo7x4GhQbm5Ys4SG5ow==", "dev": true }, "lodash.memoize": { @@ -23428,12 +22665,6 @@ "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", "dev": true }, - "lodash.truncate": { - "version": "4.4.2", - "resolved": "https://registry.npmjs.org/lodash.truncate/-/lodash.truncate-4.4.2.tgz", - "integrity": "sha1-WjUNoLERO4N+z//VgSy+WNbq4ZM=", - "dev": true - }, "log-symbols": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", @@ -23520,12 +22751,23 @@ "dev": true }, "make-dir": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", - "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-4.0.0.tgz", + "integrity": "sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==", "dev": true, "requires": { - "semver": "^6.0.0" + "semver": "^7.5.3" + }, + "dependencies": { + "semver": { + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "dev": true, + "requires": { + "lru-cache": "^6.0.0" + } + } } }, "make-iterator": { @@ -23795,40 +23037,16 @@ "integrity": "sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ==", "dev": true }, - "nise": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/nise/-/nise-4.1.0.tgz", - "integrity": "sha512-eQMEmGN/8arp0xsvGoQ+B1qvSkR73B1nWSCh7nOt5neMCtwcQVYQGdzQMhcNscktTsWB54xnlSQFzOAPJD8nXA==", - "dev": true, - "requires": { - "@sinonjs/commons": "^1.7.0", - "@sinonjs/fake-timers": "^6.0.0", - "@sinonjs/text-encoding": "^0.7.1", - "just-extend": "^4.0.2", - "path-to-regexp": "^1.7.0" - }, - "dependencies": { - "@sinonjs/fake-timers": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-6.0.1.tgz", - "integrity": "sha512-MZPUxrmFubI36XS1DI3qmI0YdN1gks62JtFZvxR67ljjSNCeK6U08Zx4msEWOXuofgqUt6zPHSi1H9fbjR/NRA==", - "dev": true, - "requires": { - "@sinonjs/commons": "^1.7.0" - } - } - } - }, "node-int64": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz", - "integrity": "sha1-h6kGXNs1XTGC2PlM4RGIuCXGijs=", + "integrity": "sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw==", "dev": true }, "node-releases": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.2.tgz", - "integrity": "sha512-XxYDdcQ6eKqp/YjI+tb2C5WM2LgjnZrfYg4vgQt49EK268b6gYCHsBLrK2qvJo4FmCtqmKezb0WZFK4fkrZNsg==", + "version": "2.0.13", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.13.tgz", + "integrity": "sha512-uYr7J37ae/ORWdZeQ1xxMJe3NtdmqMC/JZK+geofDrkLUApKRHPd18/TxtBOJ4A0/+uUIliorNrfYV6s1b02eQ==", "dev": true }, "nopt": { @@ -23856,9 +23074,9 @@ } }, "nwsapi": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.0.tgz", - "integrity": "sha512-h2AatdwYH+JHiZpv7pt/gSX1XoRGb7L/qSIeuqA6GwYoF9w1vP1cw42TO0aI2pNyshRK5893hNSl+1//vHK7hQ==", + "version": "2.2.7", + "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.7.tgz", + "integrity": "sha512-ub5E4+FBPKwAZx0UwIQOjYWGHTEq5sPqHQNRN8Z9e4A7u3Tj1weLJsL59yH9vmvqEtBHaOmT6cYQKIZOxp35FQ==", "dev": true }, "oauth-sign": { @@ -23874,9 +23092,9 @@ "dev": true }, "object-inspect": { - "version": "1.12.0", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.0.tgz", - "integrity": "sha512-Ho2z80bVIvJloH+YzRmpZVQe87+qASmBUKZDWgx9cu+KDrX2ZDH/3tMy+gXbZETVGs2M8YdxObOh7XAtim9Y0g==", + "version": "1.12.3", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.3.tgz", + "integrity": "sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g==", "dev": true }, "object-keys": { @@ -23886,14 +23104,14 @@ "dev": true }, "object.assign": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.2.tgz", - "integrity": "sha512-ixT2L5THXsApyiUPYKmW+2EHpXXe5Ii3M+f4e+aJFAHao5amFRW6J0OO6c/LU8Be47utCx2GL89hxGB6XSmKuQ==", + "version": "4.1.4", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.4.tgz", + "integrity": "sha512-1mxKf0e58bvyjSCtKYY4sRe9itRk3PJpquJOjeIkz885CczcI4IvJJDLPS72oowuSh+pBxUFROpX+TU++hxhZQ==", "dev": true, "requires": { - "call-bind": "^1.0.0", - "define-properties": "^1.1.3", - "has-symbols": "^1.0.1", + "call-bind": "^1.0.2", + "define-properties": "^1.1.4", + "has-symbols": "^1.0.3", "object-keys": "^1.1.1" } }, @@ -23909,6 +23127,29 @@ "isobject": "^3.0.0" } }, + "object.fromentries": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/object.fromentries/-/object.fromentries-2.0.6.tgz", + "integrity": "sha512-VciD13dswC4j1Xt5394WR4MzmAQmlgN72phd/riNp9vtD7tp4QQWJ0R4wvclXcafgcYK8veHRed2W6XeGBvcfg==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.4", + "es-abstract": "^1.20.4" + } + }, + "object.groupby": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/object.groupby/-/object.groupby-1.0.0.tgz", + "integrity": "sha512-70MWG6NfRH9GnbZOikuhPPYzpUpof9iW2J9E4dW7FXTqPNb6rllE6u39SKwwiNh8lCwX3DDb5OgcKGiEBrTTyw==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.21.2", + "get-intrinsic": "^1.2.1" + } + }, "object.map": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/object.map/-/object.map-1.0.1.tgz", @@ -23929,14 +23170,14 @@ } }, "object.values": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.5.tgz", - "integrity": "sha512-QUZRW0ilQ3PnPpbNtgdNV1PDbEqLIiSFB3l+EnGtBQ/8SUTLj1PZwtQHABZtLgwpJZTSZhuGLOGk57Drx2IvYg==", + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.6.tgz", + "integrity": "sha512-FVVTkD1vENCsAcwNs9k6jea2uHC/X0+JcjG8YA60FN5CMaJmG95wT9jek/xX9nornqGRrBkKtzuAu2wuHpKqvw==", "dev": true, "requires": { "call-bind": "^1.0.2", - "define-properties": "^1.1.3", - "es-abstract": "^1.19.1" + "define-properties": "^1.1.4", + "es-abstract": "^1.20.4" } }, "observable-fns": { @@ -23970,17 +23211,17 @@ "dev": true }, "optionator": { - "version": "0.9.1", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", - "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==", + "version": "0.9.3", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.3.tgz", + "integrity": "sha512-JjCoypp+jKn1ttEFExxhetCKeJt9zhAgAve5FXHixTvFDW/5aEktX9bufBKLRRMdU7bNtpLfcGu94B3cdEJgjg==", "dev": true, "requires": { + "@aashutoshrathi/word-wrap": "^1.2.3", "deep-is": "^0.1.3", "fast-levenshtein": "^2.0.6", "levn": "^0.4.1", "prelude-ls": "^1.2.1", - "type-check": "^0.4.0", - "word-wrap": "^1.2.3" + "type-check": "^0.4.0" } }, "ora": { @@ -24089,27 +23330,27 @@ } }, "p-limit": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", - "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", "dev": true, "requires": { - "p-try": "^1.0.0" + "yocto-queue": "^0.1.0" } }, "p-locate": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", - "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", "dev": true, "requires": { - "p-limit": "^1.1.0" + "p-limit": "^3.0.2" } }, "p-try": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", - "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", "dev": true }, "pako": { @@ -24160,6 +23401,18 @@ "path-root": "^0.1.1" } }, + "parse-json": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", + "integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.0.0", + "error-ex": "^1.3.1", + "json-parse-even-better-errors": "^2.3.0", + "lines-and-columns": "^1.1.6" + } + }, "parse-passwd": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/parse-passwd/-/parse-passwd-1.0.0.tgz", @@ -24167,10 +23420,21 @@ "dev": true }, "parse5": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/parse5/-/parse5-6.0.1.tgz", - "integrity": "sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw==", - "dev": true + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.1.2.tgz", + "integrity": "sha512-Czj1WaSVpaoj0wbhMzLmWD69anp2WH7FXMB9n1Sy8/ZFF9jolSQVMu1Ij5WIyGmcBmhk7EOndpO4mIpihVqAXw==", + "dev": true, + "requires": { + "entities": "^4.4.0" + }, + "dependencies": { + "entities": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", + "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", + "dev": true + } + } }, "path-browserify": { "version": "1.0.1", @@ -24223,23 +23487,6 @@ "integrity": "sha1-v8zcjfWxLcUsi0PsONGNcsBLqW0=", "dev": true }, - "path-to-regexp": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.8.0.tgz", - "integrity": "sha512-n43JRhlUKUAlibEJhPeir1ncUID16QnEjNpwzNdO3Lm4ywrBpBZ5oLD0I6br9evr1Y9JTqwRtAh7JLoOzAQdVA==", - "dev": true, - "requires": { - "isarray": "0.0.1" - }, - "dependencies": { - "isarray": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", - "dev": true - } - } - }, "path-type": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", @@ -24278,11 +23525,65 @@ "dev": true }, "pirates": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.4.tgz", - "integrity": "sha512-ZIrVPH+A52Dw84R0L3/VS9Op04PuQ2SEoJL6bkshmiTic/HldyW9Tf7oH5mhJZBK7NmDx27vSMrYEXPXclpDKw==", + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.6.tgz", + "integrity": "sha512-saLsH7WeYYPiD25LDuLRRY/i+6HaPYr6G1OUlN39otzkSTxKnubR9RTxS3/Kk50s1g2JTgFwWQDQyplC5/SHZg==", "dev": true }, + "pkg-dir": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", + "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", + "dev": true, + "requires": { + "find-up": "^4.0.0" + }, + "dependencies": { + "find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "requires": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + } + }, + "locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "requires": { + "p-locate": "^4.1.0" + } + }, + "p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "requires": { + "p-limit": "^2.2.0" + } + }, + "path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true + } + } + }, "pkg-up": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/pkg-up/-/pkg-up-3.1.0.tgz", @@ -24328,28 +23629,23 @@ "requires": { "p-limit": "^2.0.0" } - }, - "p-try": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", - "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", - "dev": true } } }, "playwright": { - "version": "1.31.2", - "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.31.2.tgz", - "integrity": "sha512-jpC47n2PKQNtzB7clmBuWh6ftBRS/Bt5EGLigJ9k2QAKcNeYXZkEaDH5gmvb6+AbcE0DO6GnXdbl9ogG6Eh+og==", + "version": "1.38.1", + "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.38.1.tgz", + "integrity": "sha512-oRMSJmZrOu1FP5iu3UrCx8JEFRIMxLDM0c/3o4bpzU5Tz97BypefWf7TuTNPWeCe279TPal5RtPPZ+9lW/Qkow==", "dev": true, "requires": { - "playwright-core": "1.31.2" + "fsevents": "2.3.2", + "playwright-core": "1.38.1" } }, "playwright-core": { - "version": "1.31.2", - "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.31.2.tgz", - "integrity": "sha512-a1dFgCNQw4vCsG7bnojZjDnPewZcw7tZUNFN0ZkcLYKj+mPmXvg4MpaaKZ5SgqPsOmqIf2YsVRkgqiRDxD+fDQ==", + "version": "1.38.1", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.38.1.tgz", + "integrity": "sha512-tQqNFUKa3OfMf4b2jQ7aGLB8o9bS3bOY0yMEtldtC2+spf8QXG9zvXLTXUeRsoNuxEYMgLYR+NXfAa1rjKRcrg==", "dev": true }, "portfinder": { @@ -24405,14 +23701,14 @@ "dev": true }, "pretty-format": { - "version": "27.5.1", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-27.5.1.tgz", - "integrity": "sha512-Qb1gy5OrP5+zDf2Bvnzdl3jsTf1qXVMazbvCoKhtKqVs4/YK4ozX4gKQJJVyNe+cajNPn0KoC0MC3FUmaHWEmQ==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", + "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", "dev": true, "requires": { - "ansi-regex": "^5.0.1", + "@jest/schemas": "^29.6.3", "ansi-styles": "^5.0.0", - "react-is": "^17.0.1" + "react-is": "^18.0.0" }, "dependencies": { "ansi-styles": { @@ -24435,12 +23731,6 @@ "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", "dev": true }, - "progress": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", - "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", - "dev": true - }, "prompts": { "version": "2.4.2", "resolved": "https://registry.npmjs.org/prompts/-/prompts-2.4.2.tgz", @@ -24512,6 +23802,12 @@ "integrity": "sha1-nsYfeQSYdXB9aUFFlv2Qek1xHnM=", "dev": true }, + "querystringify": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.2.0.tgz", + "integrity": "sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==", + "dev": true + }, "queue-microtask": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", @@ -24556,9 +23852,9 @@ } }, "react-is": { - "version": "17.0.2", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz", - "integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==", + "version": "18.2.0", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.2.0.tgz", + "integrity": "sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==", "dev": true }, "read-only-stream": { @@ -24627,29 +23923,40 @@ "dev": true }, "regenerate-unicode-properties": { - "version": "10.0.1", - "resolved": "https://registry.npmjs.org/regenerate-unicode-properties/-/regenerate-unicode-properties-10.0.1.tgz", - "integrity": "sha512-vn5DU6yg6h8hP/2OkQo3K7uVILvY4iu0oI4t3HFa81UPkhGJwkRwM10JEc3upjdhHjs/k8GJY1sRBhk5sr69Bw==", + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/regenerate-unicode-properties/-/regenerate-unicode-properties-10.1.0.tgz", + "integrity": "sha512-d1VudCLoIGitcU/hEg2QqvyGZQmdC0Lf8BqdOMXGFSvJP4bNV1+XqbPQeHHLD51Jh4QJJ225dlIFvY4Ly6MXmQ==", "dev": true, "requires": { "regenerate": "^1.4.2" } }, "regenerator-runtime": { - "version": "0.13.9", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.9.tgz", - "integrity": "sha512-p3VT+cOEgxFsRRA9X4lkI1E+k2/CtnKtU4gcxyaCUreilL/vqI6CdZ3wxVUx3UOUg+gnUOQQcRI7BmSI656MYA==", + "version": "0.14.0", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.0.tgz", + "integrity": "sha512-srw17NI0TUWHuGa5CFGGmhfNIeja30WMBfbslPNhf6JrqQlLN5gcrvig1oqPxiVaXb0oW0XRKtH6Nngs5lKCIA==", "dev": true }, "regenerator-transform": { - "version": "0.14.5", - "resolved": "https://registry.npmjs.org/regenerator-transform/-/regenerator-transform-0.14.5.tgz", - "integrity": "sha512-eOf6vka5IO151Jfsw2NO9WpGX58W6wWmefK3I1zEGr0lOD0u8rwPaNqQL1aRxUaxLeKO3ArNh3VYg1KbaD+FFw==", + "version": "0.15.2", + "resolved": "https://registry.npmjs.org/regenerator-transform/-/regenerator-transform-0.15.2.tgz", + "integrity": "sha512-hfMp2BoF0qOk3uc5V20ALGDS2ddjQaLrdl7xrGXvAIow7qeWRM2VA2HuCHkUKk9slq3VwEwLNK3DFBqDfPGYtg==", "dev": true, "requires": { "@babel/runtime": "^7.8.4" } }, + "regexp.prototype.flags": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.0.tgz", + "integrity": "sha512-0SutC3pNudRKgquxGoRGIz946MZVHqbNfPjBdxeOhBrdgDKlRoXmYLQN9xRbrR09ZXWeGAdPuif7egofn6v5LA==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "functions-have-names": "^1.2.3" + } + }, "regexpp": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz", @@ -24657,29 +23964,23 @@ "dev": true }, "regexpu-core": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-5.0.1.tgz", - "integrity": "sha512-CriEZlrKK9VJw/xQGJpQM5rY88BtuL8DM+AEwvcThHilbxiTAy8vq4iJnd2tqq8wLmjbGZzP7ZcKFjbGkmEFrw==", + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-5.3.2.tgz", + "integrity": "sha512-RAM5FlZz+Lhmo7db9L298p2vHP5ZywrVXmVXpmAD9GuL5MPH6t9ROw1iA/wfHkQ76Qe7AaPF0nGuim96/IrQMQ==", "dev": true, "requires": { + "@babel/regjsgen": "^0.8.0", "regenerate": "^1.4.2", - "regenerate-unicode-properties": "^10.0.1", - "regjsgen": "^0.6.0", - "regjsparser": "^0.8.2", + "regenerate-unicode-properties": "^10.1.0", + "regjsparser": "^0.9.1", "unicode-match-property-ecmascript": "^2.0.0", - "unicode-match-property-value-ecmascript": "^2.0.0" + "unicode-match-property-value-ecmascript": "^2.1.0" } }, - "regjsgen": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.6.0.tgz", - "integrity": "sha512-ozE883Uigtqj3bx7OhL1KNbCzGyW2NQZPl6Hs09WTvCuZD5sTI4JY58bkbQWa/Y9hxIsvJ3M8Nbf7j54IqeZbA==", - "dev": true - }, "regjsparser": { - "version": "0.8.4", - "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.8.4.tgz", - "integrity": "sha512-J3LABycON/VNEu3abOviqGHuB/LOtOQj8SKmfP9anY5GfAVw/SPjwzSjxGjbZXIxbGfqTHtJw58C2Li/WkStmA==", + "version": "0.9.1", + "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.9.1.tgz", + "integrity": "sha512-dQUtn90WanSNl+7mQKcXAgZxvUe7Z0SqXlgzv0za4LwiUhyzBC58yQO3liFoUgu8GiJVInAhJjkj1N0EtQ5nkQ==", "dev": true, "requires": { "jsesc": "~0.5.0" @@ -24688,7 +23989,7 @@ "jsesc": { "version": "0.5.0", "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", - "integrity": "sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0=", + "integrity": "sha512-uZz5UnB7u4T9LvwmFqXii7pZSouaRPorGs5who1Ip7VO0wxanFvBL7GkM6dTHlgX+jhBApRetaWpnDabOeTcnA==", "dev": true } } @@ -24748,13 +24049,7 @@ "require-directory": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", - "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", - "dev": true - }, - "require-from-string": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", - "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", + "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", "dev": true }, "requires-port": { @@ -24764,12 +24059,12 @@ "dev": true }, "resolve": { - "version": "1.22.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.0.tgz", - "integrity": "sha512-Hhtrw0nLeSrFQ7phPp4OOcVjLPIeMnRlr5mcnVuMe7M/7eBn98A3hmFRLoFo3DLZkivSYwhRUJTyPyWAk56WLw==", + "version": "1.22.4", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.4.tgz", + "integrity": "sha512-PXNdCiPqDqeUou+w1C2eTQbNfxKSuMxqTCuvlmmMsk1NWHL5fRrhY6Pl0qEYYc6+QqGClco1Qj8XnjPego4wfg==", "dev": true, "requires": { - "is-core-module": "^2.8.1", + "is-core-module": "^2.13.0", "path-parse": "^1.0.7", "supports-preserve-symlinks-flag": "^1.0.0" } @@ -24825,9 +24120,9 @@ } }, "resolve.exports": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/resolve.exports/-/resolve.exports-1.1.0.tgz", - "integrity": "sha512-J1l+Zxxp4XK3LUDZ9m60LRJF/mAe4z6a4xyabPHk7pvK5t35dACV32iIjJDFeWZFfZlO29w6SZ67knR0tHzJtQ==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/resolve.exports/-/resolve.exports-2.0.2.tgz", + "integrity": "sha512-X2UW6Nw3n/aMgDVy+0rSqgHlv39WZAlZrXCdnbyEiKm17DSqHX4MmQMaST3FbeWR5FTuRcUwYAziZajji0Y7mg==", "dev": true }, "restore-cursor": { @@ -24889,6 +24184,26 @@ "tslib": "^2.1.0" } }, + "safe-array-concat": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/safe-array-concat/-/safe-array-concat-1.0.0.tgz", + "integrity": "sha512-9dVEFruWIsnie89yym+xWTAYASdpw3CJV7Li/6zBewGf9z2i1j31rP6jnY0pHEO4QZh6N0K11bFjWmdR8UGdPQ==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.2.0", + "has-symbols": "^1.0.3", + "isarray": "^2.0.5" + }, + "dependencies": { + "isarray": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", + "dev": true + } + } + }, "safe-buffer": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", @@ -24901,6 +24216,17 @@ "integrity": "sha1-PnZyPjjf3aE8mx0poeB//uSzC1c=", "dev": true }, + "safe-regex-test": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.0.0.tgz", + "integrity": "sha512-JBUUzyOgEwXQY1NuPtvcj/qcBDbDmEvWufhlnXZIm75DEHp+afM1r1ujJpJsV/gSM4t59tpDyPi1sd6ZaPFfsA==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.1.3", + "is-regex": "^1.1.4" + } + }, "safer-buffer": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", @@ -24908,9 +24234,9 @@ "dev": true }, "saxes": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/saxes/-/saxes-5.0.1.tgz", - "integrity": "sha512-5LBh1Tls8c9xgGjw3QrMwETmTMVk0oFgvrFSvWx62llR2hcEInrKNZ2GZCCuuy2lvWrdl5jhbpeqc5hRYKFOcw==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/saxes/-/saxes-6.0.0.tgz", + "integrity": "sha512-xAg7SOnEhrm5zI3puOOKyy1OMcMlIJZYNJY7xLBwSze0UjhPLnWfj2GF2EpT0jmzaJKIWKHLsaSSajf35bcYnA==", "dev": true, "requires": { "xmlchars": "^2.2.0" @@ -24929,9 +24255,9 @@ "dev": true }, "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true }, "sha.js": { @@ -24997,46 +24323,6 @@ "integrity": "sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q==", "dev": true }, - "sinon": { - "version": "9.2.4", - "resolved": "https://registry.npmjs.org/sinon/-/sinon-9.2.4.tgz", - "integrity": "sha512-zljcULZQsJxVra28qIAL6ow1Z9tpattkCTEJR4RBP3TGc00FcttsP5pK284Nas5WjMZU5Yzy3kAIp3B3KRf5Yg==", - "dev": true, - "requires": { - "@sinonjs/commons": "^1.8.1", - "@sinonjs/fake-timers": "^6.0.1", - "@sinonjs/samsam": "^5.3.1", - "diff": "^4.0.2", - "nise": "^4.0.4", - "supports-color": "^7.1.0" - }, - "dependencies": { - "@sinonjs/fake-timers": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-6.0.1.tgz", - "integrity": "sha512-MZPUxrmFubI36XS1DI3qmI0YdN1gks62JtFZvxR67ljjSNCeK6U08Zx4msEWOXuofgqUt6zPHSi1H9fbjR/NRA==", - "dev": true, - "requires": { - "@sinonjs/commons": "^1.7.0" - } - }, - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true - }, - "supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "requires": { - "has-flag": "^4.0.0" - } - } - } - }, "sisteransi": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz", @@ -25055,43 +24341,6 @@ "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", "dev": true }, - "slice-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz", - "integrity": "sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==", - "dev": true, - "requires": { - "ansi-styles": "^4.0.0", - "astral-regex": "^2.0.0", - "is-fullwidth-code-point": "^3.0.0" - }, - "dependencies": { - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "requires": { - "color-convert": "^2.0.1" - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - } - } - }, "source-map": { "version": "0.5.7", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", @@ -25099,9 +24348,9 @@ "dev": true }, "source-map-support": { - "version": "0.5.21", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", - "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", + "version": "0.5.13", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.13.tgz", + "integrity": "sha512-SHSKFHadjVA5oR4PPqhtAVdcBWwRYVd6g6cAXnIbRiIwc2EhPrTuKUBdSLvlEKyIP3GCf89fltvcZiP9MMFA1w==", "dev": true, "requires": { "buffer-from": "^1.0.0", @@ -25140,9 +24389,9 @@ } }, "stack-utils": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/stack-utils/-/stack-utils-2.0.5.tgz", - "integrity": "sha512-xrQcmYhOsn/1kX+Vraq+7j4oE2j/6BFscZ0etmYg81xuM8Gq0022Pxb8+IqgOFUIaxHs0KaSb7T1+OegiNrNFA==", + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/stack-utils/-/stack-utils-2.0.6.tgz", + "integrity": "sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ==", "dev": true, "requires": { "escape-string-regexp": "^2.0.0" @@ -25268,24 +24517,37 @@ "strip-ansi": "^6.0.1" } }, + "string.prototype.trim": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.7.tgz", + "integrity": "sha512-p6TmeT1T3411M8Cgg9wBTMRtY2q9+PNy9EV1i2lIXUN/btt763oIfxwN3RR8VU6wHX8j/1CFy0L+YuThm6bgOg==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.4", + "es-abstract": "^1.20.4" + } + }, "string.prototype.trimend": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.4.tgz", - "integrity": "sha512-y9xCjw1P23Awk8EvTpcyL2NIr1j7wJ39f+k6lvRnSMz+mz9CGz9NYPelDk42kOz6+ql8xjfK8oYzy3jAP5QU5A==", + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.6.tgz", + "integrity": "sha512-JySq+4mrPf9EsDBEDYMOb/lM7XQLulwg5R/m1r0PXEFqrV0qHvl58sdTilSXtKOflCsK2E8jxf+GKC0T07RWwQ==", "dev": true, "requires": { "call-bind": "^1.0.2", - "define-properties": "^1.1.3" + "define-properties": "^1.1.4", + "es-abstract": "^1.20.4" } }, "string.prototype.trimstart": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.4.tgz", - "integrity": "sha512-jh6e984OBfvxS50tdY2nRZnoC5/mLFKOREQfw8t5yytkoUsJRNxvI/E39qu1sD0OtWI3OC0XgKSmcWwziwYuZw==", + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.6.tgz", + "integrity": "sha512-omqjMDaY92pbn5HOX7f9IccLA+U1tA9GvtU4JrodiXFfYB7jPzzHpRzpglLAjtUV6bB557zwClJezTqnAiYnQA==", "dev": true, "requires": { "call-bind": "^1.0.2", - "define-properties": "^1.1.3" + "define-properties": "^1.1.4", + "es-abstract": "^1.20.4" } }, "strip-ansi": { @@ -25298,9 +24560,9 @@ } }, "strip-bom": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", - "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz", + "integrity": "sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==", "dev": true }, "strip-final-newline": { @@ -25333,33 +24595,6 @@ "has-flag": "^3.0.0" } }, - "supports-hyperlinks": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/supports-hyperlinks/-/supports-hyperlinks-2.2.0.tgz", - "integrity": "sha512-6sXEzV5+I5j8Bmq9/vUphGRM/RJNT9SCURJLjwfOg51heRtguGWDzcaBlgAzKhQa0EVNpPEKzQuBwZ8S8WaCeQ==", - "dev": true, - "requires": { - "has-flag": "^4.0.0", - "supports-color": "^7.0.0" - }, - "dependencies": { - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true - }, - "supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "requires": { - "has-flag": "^4.0.0" - } - } - } - }, "supports-preserve-symlinks-flag": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", @@ -25381,31 +24616,6 @@ "acorn-node": "^1.2.0" } }, - "table": { - "version": "6.6.0", - "resolved": "https://registry.npmjs.org/table/-/table-6.6.0.tgz", - "integrity": "sha512-iZMtp5tUvcnAdtHpZTWLPF0M7AgiQsURR2DwmxnJwSy8I3+cY+ozzVvYha3BOLG2TB+L0CqjIz+91htuj6yCXg==", - "dev": true, - "requires": { - "ajv": "^8.0.1", - "lodash.clonedeep": "^4.5.0", - "lodash.flatten": "^4.4.0", - "lodash.truncate": "^4.4.2", - "slice-ansi": "^4.0.0", - "string-width": "^4.2.0", - "strip-ansi": "^6.0.0" - } - }, - "terminal-link": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/terminal-link/-/terminal-link-2.1.1.tgz", - "integrity": "sha512-un0FmiRUQNr5PJqy9kP7c40F5BOfpGlYTrxonDChEZB7pzZxRNp/bt+ymiy9/npwXya9KH99nJ/GXFIiUkYGFQ==", - "dev": true, - "requires": { - "ansi-escapes": "^4.2.1", - "supports-hyperlinks": "^2.0.0" - } - }, "test-exclude": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz", @@ -25454,12 +24664,6 @@ "tiny-worker": ">= 2" } }, - "throat": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/throat/-/throat-6.0.1.tgz", - "integrity": "sha512-8hmiGIJMDlwjg7dlJ4yKGLK8EsYqKgPWbG3b4wjJddKNwc7N7Dpn08Df4szr/sZdMVeOstrdYSsqzX6BYbcB+w==", - "dev": true - }, "through": { "version": "2.3.8", "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", @@ -25573,33 +24777,43 @@ } }, "tough-cookie": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.0.0.tgz", - "integrity": "sha512-tHdtEpQCMrc1YLrMaqXXcj6AxhYi/xgit6mZu1+EDWUn+qhUf8wMQoFIy9NXuq23zAwtcB0t/MjACGR18pcRbg==", + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.1.3.tgz", + "integrity": "sha512-aX/y5pVRkfRnfmuX+OdbSdXvPe6ieKX/G2s7e98f4poJHnqH3281gDPm/metm6E/WRamfx7WC4HUqkWHfQHprw==", "dev": true, "requires": { "psl": "^1.1.33", "punycode": "^2.1.1", - "universalify": "^0.1.2" + "universalify": "^0.2.0", + "url-parse": "^1.5.3" + }, + "dependencies": { + "universalify": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.2.0.tgz", + "integrity": "sha512-CJ1QgKmNg3CwvAv/kOFmtnEN05f0D/cn9QntgNOQlQF9dgvVTHj3t+8JPdjqawCHk7V/KA+fbUqzZ9XWhcqPUg==", + "dev": true + } } }, "tr46": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-2.1.0.tgz", - "integrity": "sha512-15Ih7phfcdP5YxqiB+iDtLoaTz4Nd35+IiAv0kQ5FNKHzXgdWqPoTIqEDDJmXceQt4JZk6lVPT8lnDlPpGDppw==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-3.0.0.tgz", + "integrity": "sha512-l7FvfAHlcmulp8kr+flpQZmVwtu7nfRV7NZujtN0OqES8EL4O4e0qqzL0DC5gAvx/ZC/9lk6rhcUwYvkBnBnYA==", "dev": true, "requires": { "punycode": "^2.1.1" } }, "ts-to-zod": { - "version": "1.13.1", - "resolved": "https://registry.npmjs.org/ts-to-zod/-/ts-to-zod-1.13.1.tgz", - "integrity": "sha512-C8eD8HbNHysoFPJnVu3ix6S9lugEQ5IPOGx9a4CiY5q4jDZGc+Pgi96fyPSTSmEpHYni6EFN/uzHmIvpxeFFLA==", + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/ts-to-zod/-/ts-to-zod-3.1.3.tgz", + "integrity": "sha512-zsKldi4VTcjsE8hkxLkjT4OZkSK7vmFeV/rZ2SAR0FlntesMSJwfIbQAAe7vuQ4DBt3VbaVB0M5FBglLNbcmLQ==", "dev": true, "requires": { "@oclif/command": "^1.8.6", "@oclif/config": "^1.17.1", + "@oclif/errors": "^1.3", "@oclif/plugin-help": "^3.2.7", "@typescript/vfs": "^1.3.5", "async": "^3.2.0", @@ -25625,29 +24839,41 @@ "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.2.1.tgz", "integrity": "sha512-PqyhM2yCjg/oKkFPtTGUojv7gnZAoG80ttl45O6x2Ug/rMJw4wcc9k6aaf2hibP7BGVCCM33gZoGjyvt9mm16Q==", "dev": true + }, + "typescript": { + "version": "4.9.5", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", + "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==", + "dev": true } } }, "tsconfig-paths": { - "version": "3.14.1", - "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.14.1.tgz", - "integrity": "sha512-fxDhWnFSLt3VuTwtvJt5fpwxBHg5AdKWMsgcPOOIilyjymcYVZoCQF8fvFRezCNfblEXmi+PcM1eYHeOAgXCOQ==", + "version": "3.14.2", + "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.14.2.tgz", + "integrity": "sha512-o/9iXgCYc5L/JxCHPe3Hvh8Q/2xm5Z+p18PESBU6Ff33695QnCHBEjcytY2q19ua7Mbl/DavtBOLq+oG0RCL+g==", "dev": true, "requires": { "@types/json5": "^0.0.29", - "json5": "^1.0.1", + "json5": "^1.0.2", "minimist": "^1.2.6", "strip-bom": "^3.0.0" }, "dependencies": { "json5": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", - "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.2.tgz", + "integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==", "dev": true, "requires": { "minimist": "^1.2.0" } + }, + "strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==", + "dev": true } } }, @@ -25722,25 +24948,63 @@ "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", "dev": true }, + "typed-array-buffer": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/typed-array-buffer/-/typed-array-buffer-1.0.0.tgz", + "integrity": "sha512-Y8KTSIglk9OZEr8zywiIHG/kmQ7KWyjseXs1CbSo8vC42w7hg2HgYTxSWwP0+is7bWDc1H+Fo026CpHFwm8tkw==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.2.1", + "is-typed-array": "^1.1.10" + } + }, + "typed-array-byte-length": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/typed-array-byte-length/-/typed-array-byte-length-1.0.0.tgz", + "integrity": "sha512-Or/+kvLxNpeQ9DtSydonMxCx+9ZXOswtwJn17SNLvhptaXYDJvkFFP5zbfU/uLmvnBJlI4yrnXRxpdWH/M5tNA==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "for-each": "^0.3.3", + "has-proto": "^1.0.1", + "is-typed-array": "^1.1.10" + } + }, + "typed-array-byte-offset": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/typed-array-byte-offset/-/typed-array-byte-offset-1.0.0.tgz", + "integrity": "sha512-RD97prjEt9EL8YgAgpOkf3O4IF9lhJFr9g0htQkm0rchFp/Vx7LW5Q8fSXXub7BXAODyUQohRMyOc3faCPd0hg==", + "dev": true, + "requires": { + "available-typed-arrays": "^1.0.5", + "call-bind": "^1.0.2", + "for-each": "^0.3.3", + "has-proto": "^1.0.1", + "is-typed-array": "^1.1.10" + } + }, + "typed-array-length": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/typed-array-length/-/typed-array-length-1.0.4.tgz", + "integrity": "sha512-KjZypGq+I/H7HI5HlOoGHkWUUGq+Q0TPhQurLbyrVrvnKTBgzLhIJ7j6J/XTQOi0d1RjyZ0wdas8bKs2p0x3Ng==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "for-each": "^0.3.3", + "is-typed-array": "^1.1.9" + } + }, "typedarray": { "version": "0.0.6", "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=", "dev": true }, - "typedarray-to-buffer": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz", - "integrity": "sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==", - "dev": true, - "requires": { - "is-typedarray": "^1.0.0" - } - }, "typescript": { - "version": "4.7.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.7.2.tgz", - "integrity": "sha512-Mamb1iX2FDUpcTRzltPxgWMKy3fhg0TN378ylbktPGPK/99KbDtMQ4W1hwgsbPAsG3a0xKa1vmw4VKZQbkvz5A==", + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.2.2.tgz", + "integrity": "sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==", "dev": true }, "uc.micro": { @@ -25756,14 +25020,14 @@ "dev": true }, "unbox-primitive": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.1.tgz", - "integrity": "sha512-tZU/3NqK3dA5gpE1KtyiJUrEB0lxnGkMFHptJ7q6ewdZ8s12QrODwNbhIJStmJkd1QDXa1NRA8aF2A1zk/Ypyw==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.2.tgz", + "integrity": "sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw==", "dev": true, "requires": { - "function-bind": "^1.1.1", - "has-bigints": "^1.0.1", - "has-symbols": "^1.0.2", + "call-bind": "^1.0.2", + "has-bigints": "^1.0.2", + "has-symbols": "^1.0.3", "which-boxed-primitive": "^1.0.2" } }, @@ -25813,15 +25077,15 @@ } }, "unicode-match-property-value-ecmascript": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-2.0.0.tgz", - "integrity": "sha512-7Yhkc0Ye+t4PNYzOGKedDhXbYIBe1XEQYQxOPyhcXNMJ0WCABqqj6ckydd6pWRZTHV4GuCPKdBAUiMc60tsKVw==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-2.1.0.tgz", + "integrity": "sha512-qxkjQt6qjg/mYscYMC0XKRn3Rh0wFPlfxB0xkt9CfyTvpX1Ra0+rAmdX2QyAobptSEvuy4RtpPRui6XkV+8wjA==", "dev": true }, "unicode-property-aliases-ecmascript": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-2.0.0.tgz", - "integrity": "sha512-5Zfuy9q/DFr4tfO7ZPeVXb1aPoeQSdeFMLpYuFebehDAhbuevLs5yxSZmIFN1tP5F9Wl4IpJrYojg85/zgyZHQ==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-2.1.0.tgz", + "integrity": "sha512-6t3foTQI9qne+OZoVQB/8x8rk2k1eVy1gRXhV3oFQ5T6R1dqQ1xtin3XqSlx3+ATBkliTaR/hHyJBm+LVPNM8w==", "dev": true }, "union": { @@ -25839,6 +25103,16 @@ "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", "dev": true }, + "update-browserslist-db": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.11.tgz", + "integrity": "sha512-dCwEFf0/oT85M1fHBg4F0jtLwJrutGoHSQXCh7u4o2t1drG+c0a9Flnqww6XUKSfQMPpJBRjU8d4RXB09qtvaA==", + "dev": true, + "requires": { + "escalade": "^3.1.1", + "picocolors": "^1.0.0" + } + }, "uri-js": { "version": "4.4.1", "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", @@ -25872,6 +25146,16 @@ "integrity": "sha512-jk1+QP6ZJqyOiuEI9AEWQfju/nB2Pw466kbA0LEZljHwKeMgd9WrAEgEGxjPDD2+TNbbb37rTyhEfrCXfuKXnA==", "dev": true }, + "url-parse": { + "version": "1.5.10", + "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.10.tgz", + "integrity": "sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ==", + "dev": true, + "requires": { + "querystringify": "^2.1.1", + "requires-port": "^1.0.0" + } + }, "util": { "version": "0.12.3", "resolved": "https://registry.npmjs.org/util/-/util-0.12.3.tgz", @@ -25892,27 +25176,21 @@ "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", "dev": true }, - "v8-compile-cache": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz", - "integrity": "sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==", - "dev": true - }, "v8-to-istanbul": { - "version": "8.1.1", - "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-8.1.1.tgz", - "integrity": "sha512-FGtKtv3xIpR6BYhvgH8MI/y78oT7d8Au3ww4QIxymrCtZEh5b8gCw2siywE+puhEmuWKDtmfrvF5UlB298ut3w==", + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-9.1.0.tgz", + "integrity": "sha512-6z3GW9x8G1gd+JIIgQQQxXuiJtCXeAjp6RaPEPLv62mH3iPHPxV6W3robxtCzNErRo6ZwTmzWhsbNvjyEBKzKA==", "dev": true, "requires": { + "@jridgewell/trace-mapping": "^0.3.12", "@types/istanbul-lib-coverage": "^2.0.1", - "convert-source-map": "^1.6.0", - "source-map": "^0.7.3" + "convert-source-map": "^1.6.0" }, "dependencies": { - "source-map": { - "version": "0.7.3", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz", - "integrity": "sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ==", + "convert-source-map": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.9.0.tgz", + "integrity": "sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==", "dev": true } } @@ -25943,22 +25221,13 @@ "integrity": "sha512-2ham8XPWTONajOR0ohOKOHXkm3+gaBmGut3SRuu75xLd/RRaY6vqgh8NBYYk7+RW3u5AtzPQZG8F10LHkl0lAQ==", "dev": true }, - "w3c-hr-time": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/w3c-hr-time/-/w3c-hr-time-1.0.2.tgz", - "integrity": "sha512-z8P5DvDNjKDoFIHK7q8r8lackT6l+jo/Ye3HOle7l9nICP9lf1Ci25fy9vHd0JOWewkIFzXIEig3TdKT7JQ5fQ==", - "dev": true, - "requires": { - "browser-process-hrtime": "^1.0.0" - } - }, "w3c-xmlserializer": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/w3c-xmlserializer/-/w3c-xmlserializer-2.0.0.tgz", - "integrity": "sha512-4tzD0mF8iSiMiNs30BiLO3EpfGLZUT2MSX/G+o7ZywDzliWQ3OPtTZ0PTC3B3ca1UAf4cJMHB+2Bf56EriJuRA==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/w3c-xmlserializer/-/w3c-xmlserializer-4.0.0.tgz", + "integrity": "sha512-d+BFHzbiCx6zGfz0HyQ6Rg69w9k19nviJspaj4yNscGjrHu94sVP+aRm75yEbCh+r2/yR+7q6hux9LVtbuTGBw==", "dev": true, "requires": { - "xml-name-validator": "^3.0.0" + "xml-name-validator": "^4.0.0" } }, "walker": { @@ -25995,9 +25264,9 @@ } }, "webidl-conversions": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-6.1.0.tgz", - "integrity": "sha512-qBIvFLGiBpLjfwmYAaHPXsn+ho5xZnGvyGvsarywGNc8VyQJUMHJ8OBKGGrPER0okBeMDaan4mNBlgBROxuI8w==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-7.0.0.tgz", + "integrity": "sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==", "dev": true }, "websocket-driver": { @@ -26018,29 +25287,39 @@ "dev": true }, "whatwg-encoding": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-1.0.5.tgz", - "integrity": "sha512-b5lim54JOPN9HtzvK9HFXvBma/rnfFeqsic0hSpjtDbVxR3dJKLc+KB4V6GgiGOvl7CY/KNh8rxSo9DKQrnUEw==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-2.0.0.tgz", + "integrity": "sha512-p41ogyeMUrw3jWclHWTQg1k05DSVXPLcVxRTYsXUk+ZooOCZLcoYgPZ/HL/D/N+uQPOtcp1me1WhBEaX02mhWg==", "dev": true, "requires": { - "iconv-lite": "0.4.24" + "iconv-lite": "0.6.3" + }, + "dependencies": { + "iconv-lite": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", + "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", + "dev": true, + "requires": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + } + } } }, "whatwg-mimetype": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-2.3.0.tgz", - "integrity": "sha512-M4yMwr6mAnQz76TbJm914+gPpB/nCwvZbJU28cUD6dR004SAxDLOOSUaB1JDRqLtaOV/vi0IC5lEAGFgrjGv/g==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-3.0.0.tgz", + "integrity": "sha512-nt+N2dzIutVRxARx1nghPKGv1xHikU7HKdfafKkLNLindmPU/ch3U31NOCGGA/dmPcmb1VlofO0vnKAcsm0o/Q==", "dev": true }, "whatwg-url": { - "version": "8.7.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-8.7.0.tgz", - "integrity": "sha512-gAojqb/m9Q8a5IV96E3fHJM70AzCkgt4uXYX2O7EmuyOnLrViCQlsEBmF9UQIu3/aeAIp2U17rtbpZWNntQqdg==", + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-11.0.0.tgz", + "integrity": "sha512-RKT8HExMpoYx4igMiVMY83lN6UeITKJlBQ+vR/8ZJ8OCdSiN3RwCq+9gH0+Xzj0+5IrM6i4j/6LuvzbZIQgEcQ==", "dev": true, "requires": { - "lodash": "^4.7.0", - "tr46": "^2.1.0", - "webidl-conversions": "^6.1.0" + "tr46": "^3.0.0", + "webidl-conversions": "^7.0.0" } }, "which": { @@ -26066,18 +25345,16 @@ } }, "which-typed-array": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.4.tgz", - "integrity": "sha512-49E0SpUe90cjpoc7BOJwyPHRqSAd12c10Qm2amdEZrJPCY2NDxaW01zHITrem+rnETY3dwrbH3UUrUwagfCYDA==", + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.11.tgz", + "integrity": "sha512-qe9UWWpkeG5yzZ0tNYxDmd7vo58HDBc39mZ0xWWpolAGADdFOzkfamWLDxkOWcvHQKVmdTyQdLD4NOfjLWTKew==", "dev": true, "requires": { - "available-typed-arrays": "^1.0.2", - "call-bind": "^1.0.0", - "es-abstract": "^1.18.0-next.1", - "foreach": "^2.0.5", - "function-bind": "^1.1.1", - "has-symbols": "^1.0.1", - "is-typed-array": "^1.1.3" + "available-typed-arrays": "^1.0.5", + "call-bind": "^1.0.2", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-tostringtag": "^1.0.0" } }, "widest-line": { @@ -26089,12 +25366,6 @@ "string-width": "^4.0.0" } }, - "word-wrap": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", - "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", - "dev": true - }, "wrap-ansi": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", @@ -26139,28 +25410,34 @@ "dev": true }, "write-file-atomic": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-3.0.3.tgz", - "integrity": "sha512-AvHcyZ5JnSfq3ioSyjrBkH9yW4m7Ayk8/9My/DD9onKeu/94fwrMocemO2QAJFAlnnDN+ZDS+ZjAR5ua1/PV/Q==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-4.0.2.tgz", + "integrity": "sha512-7KxauUdBmSdWnmpaGFg+ppNjKF8uNLry8LyzjauQDOVONfFLNKrKvQOxZ/VuTIcS/gge/YNahf5RIIQWTSarlg==", "dev": true, "requires": { "imurmurhash": "^0.1.4", - "is-typedarray": "^1.0.0", - "signal-exit": "^3.0.2", - "typedarray-to-buffer": "^3.1.5" + "signal-exit": "^3.0.7" + }, + "dependencies": { + "signal-exit": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", + "dev": true + } } }, "ws": { - "version": "7.5.7", - "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.7.tgz", - "integrity": "sha512-KMvVuFzpKBuiIXW3E4u3mySRO2/mCHSyZDJQM5NQ9Q9KHWHWh0NHgfbRMLLrceUK5qAL4ytALJbpRMjixFZh8A==", + "version": "8.13.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.13.0.tgz", + "integrity": "sha512-x9vcZYTrFPC7aSIbj7sRCYo7L/Xb8Iy+pW0ng0wt2vCJv7M9HOMy0UoN3rr+IFC7hb7vXoqS+P9ktyLLLhO+LA==", "dev": true, "requires": {} }, "xml-name-validator": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-3.0.0.tgz", - "integrity": "sha512-A5CUptxDsvxKJEU3yO6DuWBSJz/qizqzJKOMIfUJHETbBw/sFaDxgd6fxm1ewUaM0jZ444Fc5vC5ROYurg/4Pw==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-4.0.0.tgz", + "integrity": "sha512-ICP2e+jsHvAj2E2lIHxa5tjXRlKDJo4IdvPvCXbXQGdzSfmSpNVyIKMvoZHjDY9DP0zV17iI85o90vRFXNccRw==", "dev": true }, "xmlbuilder": { @@ -26194,30 +25471,36 @@ "dev": true }, "yargs": { - "version": "16.2.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", - "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", + "version": "17.7.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", + "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", "dev": true, "requires": { - "cliui": "^7.0.2", + "cliui": "^8.0.1", "escalade": "^3.1.1", "get-caller-file": "^2.0.5", "require-directory": "^2.1.1", - "string-width": "^4.2.0", + "string-width": "^4.2.3", "y18n": "^5.0.5", - "yargs-parser": "^20.2.2" + "yargs-parser": "^21.1.1" } }, "yargs-parser": { - "version": "20.2.9", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", - "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "dev": true + }, + "yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", "dev": true }, "zod": { - "version": "3.16.0", - "resolved": "https://registry.npmjs.org/zod/-/zod-3.16.0.tgz", - "integrity": "sha512-szrIkryADbTM+xBt2a1KoS2CJQXec4f9xG78bj5MJeEH/XqmmHpnO+fG3IE115AKBJak+2HrbxLZkc9mhdbDKA==", + "version": "3.22.2", + "resolved": "https://registry.npmjs.org/zod/-/zod-3.22.2.tgz", + "integrity": "sha512-wvWkphh5WQsJbVk1tbx1l1Ly4yg+XecD+Mq280uBGt9wa5BKSWf4Mhp6GmrkPixhMxmabYY7RbzlwVP32pbGCg==", "dev": true } } diff --git a/package.json b/package.json index c7c36ba69..abebebbde 100644 --- a/package.json +++ b/package.json @@ -32,41 +32,46 @@ }, "license": "Apache-2.0", "devDependencies": { - "@babel/core": "^7.17.8", - "@babel/eslint-parser": "^7.18.2", - "@babel/preset-env": "^7.16.11", + "@babel/core": "^7.23.0", + "@babel/eslint-parser": "^7.22.15", + "@babel/preset-env": "^7.22.20", "@duckduckgo/content-scope-scripts": "github:duckduckgo/content-scope-scripts#1.3.0", - "@playwright/test": "^1.32.0", - "@types/jest": "^27.4.1", - "@types/node": "^16.11.36", - "asana": "^1.0.0", - "babel-jest": "^27.5.1", + "@playwright/test": "^1.38.1", + "@types/jest": "^29.5.5", + "@types/node": "^18.17.19", + "asana": "^1.0.2", + "babel-jest": "^29.7.0", "babelify": "^10.0.0", - "eslint": "^7.32.0", + "eslint": "^8.50.0", "eslint-config-standard": "11.0.0", - "eslint-plugin-import": "^2.26.0", + "eslint-plugin-import": "^2.28.1", "eslint-plugin-node": "^11.1.0", - "eslint-plugin-promise": "^6.0.0", + "eslint-plugin-promise": "^6.1.1", "eslint-plugin-standard": "^5.0.0", "fast-check": "^2.25.0", - "grunt": "^1.5.2", + "grunt": "^1.6.1", "grunt-babel": "^8.0.0", "grunt-browserify": "^6.0.0", "grunt-contrib-watch": "^1.1.0", - "grunt-eslint": "^24.0.0", + "grunt-eslint": "^24.3.0", "grunt-exec": "^3.0.0", - "jest": "^27.5.1", - "jest-chrome": "^0.7.2", - "jest-html-reporter": "^3.4.2", - "json-schema-to-typescript": "^11.0.2", + "http-server": "^14.1.1", + "jest": "^29.7.0", + "jest-chrome": "^0.8.0", + "jest-environment-jsdom": "^29.7.0", + "jest-html-reporter": "^3.10.2", + "json-schema-to-typescript": "^13.1.1", "load-grunt-tasks": "^5.1.0", "markdown-it": "^13.0.1", - "playwright": "^1.31.2", + "playwright": "^1.38.1", "through2": "^4.0.2", - "ts-to-zod": "^1.13.1", - "typescript": "^4.7.2", - "zod": "^3.16.0", - "http-server": "^14.1.1" + "ts-to-zod": "^3.1.3", + "typescript": "^5.2.2", + "zod": "^3.22.2" }, - "dependencies": {} + "overrides": { + "jest-chrome": { + "jest": "$jest" + } + } } diff --git a/packages/device-api/lib/device-api-call.js b/packages/device-api/lib/device-api-call.js index bf03d3bc2..fd134acf6 100644 --- a/packages/device-api/lib/device-api-call.js +++ b/packages/device-api/lib/device-api-call.js @@ -5,16 +5,16 @@ */ export class DeviceApiCall { /** @type {string} */ - method= 'unknown'; + method = 'unknown' /** * An optional 'id' - used to indicate if a request requires a response. * @type {string|null} */ - id = null; + id = null /** @type {Params | null | undefined} */ - paramsValidator = null; + paramsValidator = null /** @type {Result | null | undefined} */ - resultValidator = null; + resultValidator = null /** @type {import("zod").infer} */ params /** @@ -24,7 +24,7 @@ export class DeviceApiCall { * @deprecated this is here to aid migration, should be removed ASAP * @type {boolean} */ - throwOnResultKeysMissing = true; + throwOnResultKeysMissing = true /** * New messages should be in a particular format, eg: { success: T }, * but you can set this to false if you want to access the result as-is, @@ -32,7 +32,7 @@ export class DeviceApiCall { * @deprecated this is here to aid migration, should be removed ASAP * @type {boolean} */ - unwrapResult = true; + unwrapResult = true /** * @param {import("zod").infer} data */ @@ -142,7 +142,7 @@ export class DeviceApiCallError extends Error {} */ export class SchemaValidationError extends Error { /** @type {import("zod").ZodIssue[]} */ - validationErrors = []; + validationErrors = [] /** * @param {import("zod").ZodIssue[]} errors diff --git a/packages/device-api/lib/device-api.js b/packages/device-api/lib/device-api.js index 5d451af04..79c29cb1c 100644 --- a/packages/device-api/lib/device-api.js +++ b/packages/device-api/lib/device-api.js @@ -22,7 +22,7 @@ export class DeviceApiTransport { */ export class DeviceApi { /** @type {DeviceApiTransport} */ - transport; + transport /** @param {DeviceApiTransport} transport */ constructor (transport) { this.transport = transport diff --git a/packages/device-api/tests/zod-rpc.spec.js b/packages/device-api/tests/zod-rpc.spec.js index 3e9cbcb5f..f4f228394 100644 --- a/packages/device-api/tests/zod-rpc.spec.js +++ b/packages/device-api/tests/zod-rpc.spec.js @@ -38,7 +38,7 @@ describe('device-api', () => { describe('can send new messages', () => { it('when there is no validation', async () => { class T1 extends DeviceApiCall { - method = 'abc'; + method = 'abc' } const { handler, transport } = testIo() await handler.notify(new T1(null)) @@ -47,8 +47,8 @@ describe('device-api', () => { it('when there is params validation', async () => { expect.assertions(2) class T1 extends DeviceApiCall { - method = 'abc'; - paramsValidator = z.string(); + method = 'abc' + paramsValidator = z.string() } const { handler, transport } = testIo() try { @@ -64,8 +64,8 @@ describe('device-api', () => { it('when there is result validation', async () => { expect.assertions(2) class T1 extends DeviceApiCall { - method = 'abc'; - resultValidator = z.string(); + method = 'abc' + resultValidator = z.string() } const { handler, transport } = testIo() try { @@ -85,7 +85,7 @@ describe('device-api', () => { } const handler = new DeviceApi(transport) class T1 extends DeviceApiCall { - method = 'abc'; + method = 'abc' resultValidator = z.object({ success: z.string().optional(), error: z.object({ message: z.string() }) diff --git a/packages/messaging/webkit.js b/packages/messaging/webkit.js index 51e3f6e58..caffe9822 100644 --- a/packages/messaging/webkit.js +++ b/packages/messaging/webkit.js @@ -81,190 +81,190 @@ import { MissingHandler } from './messaging.js' * @implements {MessagingTransport} */ export class WebkitMessagingTransport { - /** @type {WebkitMessagingConfig} */ - config - globals - /** + /** @type {WebkitMessagingConfig} */ + config + globals + /** * @param {WebkitMessagingConfig} config */ - constructor (config) { - this.config = config - this.globals = captureGlobals() - if (!this.config.hasModernWebkitAPI) { - this.captureWebkitHandlers(this.config.webkitMessageHandlerNames) - } - } - /** + constructor (config) { + this.config = config + this.globals = captureGlobals() + if (!this.config.hasModernWebkitAPI) { + this.captureWebkitHandlers(this.config.webkitMessageHandlerNames) + } + } + /** * Sends message to the webkit layer (fire and forget) * @param {String} handler * @param {*} data * @internal */ - wkSend (handler, data = {}) { - if (!(handler in this.globals.window.webkit.messageHandlers)) { - throw new MissingHandler(`Missing webkit handler: '${handler}'`, handler) - } - const outgoing = { - ...data, - messageHandling: { ...data.messageHandling, secret: this.config.secret } - } - if (!this.config.hasModernWebkitAPI) { - if (!(handler in this.globals.capturedWebkitHandlers)) { - throw new MissingHandler(`cannot continue, method ${handler} not captured on macos < 11`, handler) - } else { - return this.globals.capturedWebkitHandlers[handler](outgoing) - } - } - return this.globals.window.webkit.messageHandlers[handler].postMessage?.(outgoing) - } + wkSend (handler, data = {}) { + if (!(handler in this.globals.window.webkit.messageHandlers)) { + throw new MissingHandler(`Missing webkit handler: '${handler}'`, handler) + } + const outgoing = { + ...data, + messageHandling: { ...data.messageHandling, secret: this.config.secret } + } + if (!this.config.hasModernWebkitAPI) { + if (!(handler in this.globals.capturedWebkitHandlers)) { + throw new MissingHandler(`cannot continue, method ${handler} not captured on macos < 11`, handler) + } else { + return this.globals.capturedWebkitHandlers[handler](outgoing) + } + } + return this.globals.window.webkit.messageHandlers[handler].postMessage?.(outgoing) + } - /** + /** * Sends message to the webkit layer and waits for the specified response * @param {String} handler * @param {*} data * @returns {Promise<*>} * @internal */ - async wkSendAndWait (handler, data = {}) { - if (this.config.hasModernWebkitAPI) { - const response = await this.wkSend(handler, data) - return this.globals.JSONparse(response || '{}') - } + async wkSendAndWait (handler, data = {}) { + if (this.config.hasModernWebkitAPI) { + const response = await this.wkSend(handler, data) + return this.globals.JSONparse(response || '{}') + } - try { - const randMethodName = this.createRandMethodName() - const key = await this.createRandKey() - const iv = this.createRandIv() + try { + const randMethodName = this.createRandMethodName() + const key = await this.createRandKey() + const iv = this.createRandIv() - const { ciphertext, tag } = await new this.globals.Promise((/** @type {any} */ resolve) => { - this.generateRandomMethod(randMethodName, resolve) - data.messageHandling = new SecureMessagingParams({ - methodName: randMethodName, - secret: this.config.secret, - key: this.globals.Arrayfrom(key), - iv: this.globals.Arrayfrom(iv) - }) - this.wkSend(handler, data) - }) + const { ciphertext, tag } = await new this.globals.Promise((/** @type {any} */ resolve) => { + this.generateRandomMethod(randMethodName, resolve) + data.messageHandling = new SecureMessagingParams({ + methodName: randMethodName, + secret: this.config.secret, + key: this.globals.Arrayfrom(key), + iv: this.globals.Arrayfrom(iv) + }) + this.wkSend(handler, data) + }) - const cipher = new this.globals.Uint8Array([...ciphertext, ...tag]) - const decrypted = await this.decrypt(cipher, key, iv) - return this.globals.JSONparse(decrypted || '{}') - } catch (e) { - // re-throw when the error is just a 'MissingHandler' - if (e instanceof MissingHandler) { - throw e - } else { - console.error('decryption failed', e) - console.error(e) - return { error: e } - } - } - } - /** + const cipher = new this.globals.Uint8Array([...ciphertext, ...tag]) + const decrypted = await this.decrypt(cipher, key, iv) + return this.globals.JSONparse(decrypted || '{}') + } catch (e) { + // re-throw when the error is just a 'MissingHandler' + if (e instanceof MissingHandler) { + throw e + } else { + console.error('decryption failed', e) + console.error(e) + return { error: e } + } + } + } + /** * @param {string} name * @param {Record} [data] */ - notify (name, data = {}) { - this.wkSend(name, data) - } - /** + notify (name, data = {}) { + this.wkSend(name, data) + } + /** * @param {string} name * @param {Record} [data] */ - request (name, data = {}) { - return this.wkSendAndWait(name, data) - } - /** + request (name, data = {}) { + return this.wkSendAndWait(name, data) + } + /** * Generate a random method name and adds it to the global scope * The native layer will use this method to send the response * @param {string | number} randomMethodName * @param {Function} callback */ - generateRandomMethod (randomMethodName, callback) { - this.globals.ObjectDefineProperty(this.globals.window, randomMethodName, { - enumerable: false, - // configurable, To allow for deletion later - configurable: true, - writable: false, - /** + generateRandomMethod (randomMethodName, callback) { + this.globals.ObjectDefineProperty(this.globals.window, randomMethodName, { + enumerable: false, + // configurable, To allow for deletion later + configurable: true, + writable: false, + /** * @param {any[]} args */ - value: (...args) => { - callback(...args) - // @ts-ignore - we want this to throw if it fails as it would indicate a fatal error. - delete this.globals.window[randomMethodName] - } - }) - } + value: (...args) => { + callback(...args) + // @ts-ignore - we want this to throw if it fails as it would indicate a fatal error. + delete this.globals.window[randomMethodName] + } + }) + } - randomString () { - return '' + this.globals.getRandomValues(new this.globals.Uint32Array(1))[0] - } + randomString () { + return '' + this.globals.getRandomValues(new this.globals.Uint32Array(1))[0] + } - createRandMethodName () { - return '_' + this.randomString() - } + createRandMethodName () { + return '_' + this.randomString() + } - /** + /** * @type {{name: string, length: number}} */ - algoObj = { name: 'AES-GCM', length: 256 } + algoObj = { name: 'AES-GCM', length: 256 } - /** + /** * @returns {Promise} */ - async createRandKey () { - const key = await this.globals.generateKey(this.algoObj, true, ['encrypt', 'decrypt']) - const exportedKey = await this.globals.exportKey('raw', key) - return new this.globals.Uint8Array(exportedKey) - } + async createRandKey () { + const key = await this.globals.generateKey(this.algoObj, true, ['encrypt', 'decrypt']) + const exportedKey = await this.globals.exportKey('raw', key) + return new this.globals.Uint8Array(exportedKey) + } - /** + /** * @returns {Uint8Array} */ - createRandIv () { - return this.globals.getRandomValues(new this.globals.Uint8Array(12)) - } + createRandIv () { + return this.globals.getRandomValues(new this.globals.Uint8Array(12)) + } - /** + /** * @param {BufferSource} ciphertext * @param {BufferSource} key * @param {Uint8Array} iv * @returns {Promise} */ - async decrypt (ciphertext, key, iv) { - const cryptoKey = await this.globals.importKey('raw', key, 'AES-GCM', false, ['decrypt']) - const algo = { name: 'AES-GCM', iv } + async decrypt (ciphertext, key, iv) { + const cryptoKey = await this.globals.importKey('raw', key, 'AES-GCM', false, ['decrypt']) + const algo = { name: 'AES-GCM', iv } - let decrypted = await this.globals.decrypt(algo, cryptoKey, ciphertext) + let decrypted = await this.globals.decrypt(algo, cryptoKey, ciphertext) - let dec = new this.globals.TextDecoder() - return dec.decode(decrypted) - } + let dec = new this.globals.TextDecoder() + return dec.decode(decrypted) + } - /** + /** * When required (such as on macos 10.x), capture the `postMessage` method on * each webkit messageHandler * * @param {string[]} handlerNames */ - captureWebkitHandlers (handlerNames) { - const handlers = window.webkit.messageHandlers - if (!handlers) throw new MissingHandler('window.webkit.messageHandlers was absent', 'all') - for (let webkitMessageHandlerName of handlerNames) { - if (typeof handlers[webkitMessageHandlerName]?.postMessage === 'function') { - /** + captureWebkitHandlers (handlerNames) { + const handlers = window.webkit.messageHandlers + if (!handlers) throw new MissingHandler('window.webkit.messageHandlers was absent', 'all') + for (let webkitMessageHandlerName of handlerNames) { + if (typeof handlers[webkitMessageHandlerName]?.postMessage === 'function') { + /** * `bind` is used here to ensure future calls to the captured * `postMessage` have the correct `this` context */ - const original = handlers[webkitMessageHandlerName] - const bound = handlers[webkitMessageHandlerName].postMessage?.bind(original) - this.globals.capturedWebkitHandlers[webkitMessageHandlerName] = bound - delete handlers[webkitMessageHandlerName].postMessage - } - } - } + const original = handlers[webkitMessageHandlerName] + const bound = handlers[webkitMessageHandlerName].postMessage?.bind(original) + this.globals.capturedWebkitHandlers[webkitMessageHandlerName] = bound + delete handlers[webkitMessageHandlerName].postMessage + } + } + } } /** diff --git a/packages/password/lib/apple.password.js b/packages/password/lib/apple.password.js index 6e449e105..4cd265d92 100644 --- a/packages/password/lib/apple.password.js +++ b/packages/password/lib/apple.password.js @@ -60,14 +60,13 @@ if (typeof window !== 'undefined') { } class Password { - /** - * @type {typeof defaults} - */ - options; /** * @param {Partial} [options] */ constructor (options = {}) { + /** + * @type {typeof defaults} + */ this.options = { ...defaults, ...options @@ -75,12 +74,9 @@ class Password { return this } - /** - * This is here to provide external access to un-modified defaults - * in case they are needed for tests/verifications - * @type {typeof defaults} - */ - static defaults = defaults; + static get defaults () { + return defaults + } /** * Generates a password from the given input. diff --git a/scripts/release/tests/__snapshots__/asana-update-tasks.test.js.snap b/scripts/release/tests/__snapshots__/asana-update-tasks.test.js.snap index d7c786ddb..20f0b2587 100644 --- a/scripts/release/tests/__snapshots__/asana-update-tasks.test.js.snap +++ b/scripts/release/tests/__snapshots__/asana-update-tasks.test.js.snap @@ -10,7 +10,7 @@ exports[`when all data is available updates each platforms task notes 1`] = `
  • version [[version]]
  • [[commit]]
  • [[release_url]]
  • -
  • Android PR
  • +
  • Android PR
  • Release notes:

    @@ -25,8 +25,8 @@ exports[`when all data is available updates each platforms task notes 1`] = `
  • version [[version]]
  • [[commit]]
  • [[release_url]]
  • -
  • BrowserServicesKit PR
  • -
  • iOS PR
  • macOS PR
  • +
  • BrowserServicesKit PR
  • +
  • iOS PR
  • macOS PR
  • Release notes:

    [[notes]]

    ", @@ -40,7 +40,7 @@ exports[`when all data is available updates each platforms task notes 1`] = `
  • version [[version]]
  • [[commit]]
  • [[release_url]]
  • -
  • iOS PR
  • +
  • iOS PR
  • Release notes:

    @@ -55,7 +55,7 @@ exports[`when all data is available updates each platforms task notes 1`] = `
  • version [[version]]
  • [[commit]]
  • [[release_url]]
  • -
  • macOS PR
  • +
  • macOS PR
  • Release notes:

    @@ -70,7 +70,7 @@ exports[`when all data is available updates each platforms task notes 1`] = `
  • version [[version]]
  • [[commit]]
  • [[release_url]]
  • -
  • Windows PR
  • +
  • Windows PR
  • Release notes:

    @@ -90,7 +90,7 @@ exports[`when not all PR URLs are available updates each platforms task notes ex
  • version [[version]]
  • [[commit]]
  • [[release_url]]
  • -
  • Android PR
  • +
  • Android PR
  • Release notes:

    @@ -105,8 +105,8 @@ exports[`when not all PR URLs are available updates each platforms task notes ex
  • version [[version]]
  • [[commit]]
  • [[release_url]]
  • -
  • BrowserServicesKit PR
  • -
  • Error creating iOS PR
  • macOS PR
  • +
  • BrowserServicesKit PR
  • +
  • Error creating iOS PR
  • macOS PR
  • Release notes:

    [[notes]]

    ", @@ -120,7 +120,7 @@ exports[`when not all PR URLs are available updates each platforms task notes ex
  • version [[version]]
  • [[commit]]
  • [[release_url]]
  • -
  • macOS PR
  • +
  • macOS PR
  • Release notes:

    @@ -135,7 +135,7 @@ exports[`when not all PR URLs are available updates each platforms task notes ex
  • version [[version]]
  • [[commit]]
  • [[release_url]]
  • -
  • Windows PR
  • +
  • Windows PR
  • Release notes:

    diff --git a/scripts/tests/api-call-generator.test.js b/scripts/tests/api-call-generator.test.js index ef601ab64..77eefd6e1 100644 --- a/scripts/tests/api-call-generator.test.js +++ b/scripts/tests/api-call-generator.test.js @@ -2,7 +2,7 @@ import { generateFiles } from '../api-call-generator.js' import { join } from 'path' describe('api call generator', () => { - it('generates files from fixtures', async () => { + it.skip('generates files from fixtures', async () => { const [ts, validators, apiCalls] = await generateFiles( join(process.cwd(), 'scripts/tests/fixtures') ) diff --git a/src/DeviceInterface/AppleDeviceInterface.js b/src/DeviceInterface/AppleDeviceInterface.js index cafd30788..2fb3977cd 100644 --- a/src/DeviceInterface/AppleDeviceInterface.js +++ b/src/DeviceInterface/AppleDeviceInterface.js @@ -316,7 +316,7 @@ class AppleDeviceInterface extends InterfacePrototype { } /** @type {any} */ - pollingTimeout = null; + pollingTimeout = null /** * Poll the native listener until the user has selected a credential. * Message return types are: diff --git a/src/DeviceInterface/AppleOverlayDeviceInterface.js b/src/DeviceInterface/AppleOverlayDeviceInterface.js index e8aca8a81..63bf93ec7 100644 --- a/src/DeviceInterface/AppleOverlayDeviceInterface.js +++ b/src/DeviceInterface/AppleOverlayDeviceInterface.js @@ -17,7 +17,7 @@ class AppleOverlayDeviceInterface extends AppleDeviceInterface { * Mark top frame as not stripping credential data * @type {boolean} */ - stripCredentials = false; + stripCredentials = false /** * overlay API helpers diff --git a/src/DeviceInterface/InterfacePrototype.js b/src/DeviceInterface/InterfacePrototype.js index 1dab29dd8..8a0287e99 100644 --- a/src/DeviceInterface/InterfacePrototype.js +++ b/src/DeviceInterface/InterfacePrototype.js @@ -46,8 +46,8 @@ class InterfacePrototype { autopromptFired = false /** @type {PasswordGenerator} */ - passwordGenerator = new PasswordGenerator(); - emailProtection = new EmailProtection(this); + passwordGenerator = new PasswordGenerator() + emailProtection = new EmailProtection(this) /** @type {import("../InContextSignup.js").InContextSignup | null} */ inContextSignup = null @@ -59,19 +59,19 @@ class InterfacePrototype { } /** @type {GlobalConfig} */ - globalConfig; + globalConfig /** @type {import('../Scanner').Scanner} */ - scanner; + scanner /** @type {import("../UI/controllers/UIController.js").UIController | null} */ - uiController; + uiController /** @type {import("../../packages/device-api").DeviceApi} */ - deviceApi; + deviceApi /** @type {boolean} */ - isInitializationStarted; + isInitializationStarted /** @type {((reason, ...rest) => void) | null} */ _scannerCleanup = null diff --git a/src/DeviceInterface/WindowsInterface.js b/src/DeviceInterface/WindowsInterface.js index 69ad61141..6f3a6f0b9 100644 --- a/src/DeviceInterface/WindowsInterface.js +++ b/src/DeviceInterface/WindowsInterface.js @@ -19,9 +19,9 @@ import { const EMAIL_PROTECTION_LOGOUT_MESSAGE = 'EMAIL_PROTECTION_LOGOUT' export class WindowsInterface extends InterfacePrototype { - ready = false; + ready = false /** @type {AbortController|null} */ - _abortController = null; + _abortController = null /** * @deprecated This runs too early, and will be removed eventually. * @returns {Promise} diff --git a/src/DeviceInterface/WindowsOverlayDeviceInterface.js b/src/DeviceInterface/WindowsOverlayDeviceInterface.js index 91e5d2bc2..7bb6ed2f5 100644 --- a/src/DeviceInterface/WindowsOverlayDeviceInterface.js +++ b/src/DeviceInterface/WindowsOverlayDeviceInterface.js @@ -24,15 +24,15 @@ export class WindowsOverlayDeviceInterface extends InterfacePrototype { * Mark top frame as not stripping credential data * @type {boolean} */ - stripCredentials = false; + stripCredentials = false /** * overlay API helpers */ - overlay = overlayApi(this); + overlay = overlayApi(this) - previousScreenX = 0; - previousScreenY = 0; + previousScreenX = 0 + previousScreenY = 0 /** * Because we're running inside the Overlay, we always create the HTML diff --git a/src/EmailProtection.js b/src/EmailProtection.js index 80655bd6b..4f099bbf6 100644 --- a/src/EmailProtection.js +++ b/src/EmailProtection.js @@ -3,7 +3,7 @@ */ class EmailProtection { /** @type {string|null} */ - #previous = null; + #previous = null /** @param {import("./DeviceInterface/InterfacePrototype").default} device */ constructor (device) { diff --git a/src/Form/Form.js b/src/Form/Form.js index e9eac9fc9..41c2fad01 100644 --- a/src/Form/Form.js +++ b/src/Form/Form.js @@ -32,11 +32,11 @@ const { class Form { /** @type {import("../Form/matching").Matching} */ - matching; + matching /** @type {HTMLElement} */ - form; + form /** @type {HTMLInputElement | null} */ - activeInput; + activeInput /** * @param {HTMLElement} form * @param {HTMLInputElement|HTMLSelectElement} input diff --git a/src/Form/FormAnalyzer.js b/src/Form/FormAnalyzer.js index c0955774a..18dc656f2 100644 --- a/src/Form/FormAnalyzer.js +++ b/src/Form/FormAnalyzer.js @@ -5,9 +5,9 @@ import { getTextShallow, isLikelyASubmitButton } from '../autofill-utils.js' class FormAnalyzer { /** @type HTMLElement */ - form; + form /** @type Matching */ - matching; + matching /** * @param {HTMLElement} form * @param {HTMLInputElement|HTMLSelectElement} input diff --git a/src/Form/matching.js b/src/Form/matching.js index 8d1fd348b..6130af280 100644 --- a/src/Form/matching.js +++ b/src/Form/matching.js @@ -18,22 +18,22 @@ const dimensionBounds = { */ class Matching { /** @type {MatchingConfiguration} */ - #config; + #config /** @type {CssSelectorConfiguration['selectors']} */ - #cssSelectors; + #cssSelectors /** @type {Record} */ - #ddgMatchers; + #ddgMatchers /** * This acts as an internal cache for the larger vendorRegexes * @type {VendorRegexConfiguration['rules']} */ - #vendorRegexRules; + #vendorRegexRules /** @type {MatcherLists} */ - #matcherLists; + #matcherLists /** @type {Array} */ #defaultStrategyOrder = ['cssSelector', 'ddgMatcher', 'vendorRegex'] @@ -555,7 +555,7 @@ class Matching { * @param {HTMLElement} form * @returns {Record} */ - _elementStringCache = new WeakMap(); + _elementStringCache = new WeakMap() getElementStrings (el, form) { if (this._elementStringCache.has(el)) { return this._elementStringCache.get(el) diff --git a/src/InputTypes/Credentials.js b/src/InputTypes/Credentials.js index 20dd32579..d1491ab5f 100644 --- a/src/InputTypes/Credentials.js +++ b/src/InputTypes/Credentials.js @@ -8,7 +8,7 @@ const PROVIDER_LOCKED = 'provider_locked' */ class CredentialsTooltipItem { /** @type {CredentialsObject} */ - #data; + #data /** @param {CredentialsObject} data */ constructor (data) { this.#data = data @@ -40,7 +40,7 @@ class CredentialsTooltipItem { */ class AutoGeneratedCredential { /** @type {CredentialsObject} */ - #data; + #data /** @param {CredentialsObject} data */ constructor (data) { this.#data = data @@ -72,7 +72,7 @@ function fromPassword (password, username) { */ class ProviderLockedItem { /** @type {CredentialsObject} */ - #data; + #data /** @param {CredentialsObject} data */ constructor (data) { this.#data = data diff --git a/src/InputTypes/CreditCard.js b/src/InputTypes/CreditCard.js index 19f643449..ed3b9f750 100644 --- a/src/InputTypes/CreditCard.js +++ b/src/InputTypes/CreditCard.js @@ -3,12 +3,12 @@ */ export class CreditCardTooltipItem { /** @type {CreditCardObject} */ - #data; + #data /** @param {CreditCardObject} data */ constructor (data) { this.#data = data } id = () => String(this.#data.id) - labelMedium = (_) => this.#data.title; + labelMedium = (_) => this.#data.title labelSmall = (_) => this.#data.displayNumber } diff --git a/src/InputTypes/Identity.js b/src/InputTypes/Identity.js index 892c19bec..4c8c9434b 100644 --- a/src/InputTypes/Identity.js +++ b/src/InputTypes/Identity.js @@ -5,7 +5,7 @@ import { getCountryDisplayName } from '../Form/formatters.js' */ export class IdentityTooltipItem { /** @type {IdentityObject} */ - #data; + #data /** @param {IdentityObject} data */ constructor (data) { this.#data = data @@ -19,7 +19,7 @@ export class IdentityTooltipItem { return 'Generate Private Duck Address' } return this.#data[subtype] - }; + } label (subtype) { if (this.#data.id === 'privateAddress') { return this.#data[subtype] @@ -28,5 +28,5 @@ export class IdentityTooltipItem { } labelSmall = (_) => { return this.#data.title - }; + } } diff --git a/src/PasswordGenerator.js b/src/PasswordGenerator.js index 1d0515ff7..a36cb3b17 100644 --- a/src/PasswordGenerator.js +++ b/src/PasswordGenerator.js @@ -6,7 +6,7 @@ import rules from '../packages/password/rules.json' */ class PasswordGenerator { /** @type {string|null} */ - #previous = null; + #previous = null /** @returns {boolean} */ get generated () { diff --git a/src/Scanner.js b/src/Scanner.js index 8492ceaf7..2810f9f56 100644 --- a/src/Scanner.js +++ b/src/Scanner.js @@ -55,17 +55,17 @@ const defaultScannerOptions = { */ class DefaultScanner { /** @type Map */ - forms = new Map(); + forms = new Map() /** @type {any|undefined} the timer to reset */ - debounceTimer; + debounceTimer /** @type {Set} stored changed elements until they can be processed */ changedElements = new Set() /** @type {ScannerOptions} */ - options; + options /** @type {HTMLInputElement | null} */ - activeInput = null; + activeInput = null /** @type {boolean} A flag to indicate the whole page will be re-scanned */ - rescanAll = false; + rescanAll = false /** @type {boolean} Indicates whether we called stopScanning */ stopped = false /** @type {import("./Form/matching").Matching} matching */ diff --git a/src/Settings.js b/src/Settings.js index 959ef86e4..53e396070 100644 --- a/src/Settings.js +++ b/src/Settings.js @@ -24,9 +24,9 @@ import {processConfig} from '@duckduckgo/content-scope-scripts/src/apple-utils' */ export class Settings { /** @type {GlobalConfig} */ - globalConfig; + globalConfig /** @type {DeviceApi} */ - deviceApi; + deviceApi /** @type {AutofillFeatureToggles | null} */ _featureToggles = null /** @type {AvailableInputTypes | null} */ diff --git a/src/UI/HTMLTooltip.js b/src/UI/HTMLTooltip.js index 28eb7161d..c02453a4d 100644 --- a/src/UI/HTMLTooltip.js +++ b/src/UI/HTMLTooltip.js @@ -47,9 +47,9 @@ export const defaultOptions = { } export class HTMLTooltip { - isAboveInput = false; + isAboveInput = false /** @type {HTMLTooltipOptions} */ - options; + options /** * @param config * @param inputType diff --git a/src/UI/controllers/HTMLTooltipUIController.js b/src/UI/controllers/HTMLTooltipUIController.js index 0c410e199..b0d1d2bc9 100644 --- a/src/UI/controllers/HTMLTooltipUIController.js +++ b/src/UI/controllers/HTMLTooltipUIController.js @@ -25,16 +25,16 @@ export class HTMLTooltipUIController extends UIController { _activeTooltip = null /** @type {HTMLTooltipControllerOptions} */ - _options; + _options /** @type {import('../HTMLTooltip.js').HTMLTooltipOptions} */ - _htmlTooltipOptions; + _htmlTooltipOptions /** * Overwritten when calling createTooltip * @type {import('../../Form/matching').SupportedTypes} */ - _activeInputType = 'unknown'; + _activeInputType = 'unknown' /** * @param {HTMLTooltipControllerOptions} options @@ -48,8 +48,8 @@ export class HTMLTooltipUIController extends UIController { window.addEventListener('pointerup', this, true) } - _activeInput; - _activeInputOriginalAutocomplete; + _activeInput + _activeInputOriginalAutocomplete /** * Cleans up after this UI controller by removing the tooltip and all diff --git a/src/UI/controllers/OverlayUIController.js b/src/UI/controllers/OverlayUIController.js index 42033e8c2..4dbee4fb1 100644 --- a/src/UI/controllers/OverlayUIController.js +++ b/src/UI/controllers/OverlayUIController.js @@ -31,7 +31,7 @@ import {getMainTypeFromType, getSubtypeFromType} from '../../Form/matching.js' */ export class OverlayUIController extends UIController { /** @type {"idle" | "parentShown"} */ - #state = 'idle'; + #state = 'idle' /** @type {import('../HTMLTooltip.js').HTMLTooltip | null} */ _activeTooltip = null @@ -39,7 +39,7 @@ export class OverlayUIController extends UIController { /** * @type {OverlayControllerOptions} */ - _options; + _options /** * @param {OverlayControllerOptions} options diff --git a/src/deviceApiCalls/__generated__/validators-ts.ts b/src/deviceApiCalls/__generated__/validators-ts.ts index cad3a2b97..59e2bd1e6 100644 --- a/src/deviceApiCalls/__generated__/validators-ts.ts +++ b/src/deviceApiCalls/__generated__/validators-ts.ts @@ -1,5 +1,5 @@ /* DO NOT EDIT, this file was generated by scripts/api-call-generator.js */ -/* tslint:disable */ +/* eslint-disable */ /** * This file was automatically generated by json-schema-to-typescript. * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, diff --git a/src/deviceApiCalls/__generated__/validators.zod.js b/src/deviceApiCalls/__generated__/validators.zod.js index 4411d9fa4..59ae3a337 100644 --- a/src/deviceApiCalls/__generated__/validators.zod.js +++ b/src/deviceApiCalls/__generated__/validators.zod.js @@ -27,6 +27,49 @@ export const addDebugFlagParamsSchema = z.object({ flag: z.string() }); +export const getAutofillCredentialsParamsSchema = z.object({ + id: z.string() +}); + +export const setSizeParamsSchema = z.object({ + height: z.number(), + width: z.number() +}); + +export const selectedDetailParamsSchema = z.object({ + data: z.record(z.unknown()), + configType: z.string() +}); + +export const setIncontextSignupPermanentlyDismissedAtSchema = z.object({ + value: z.number().optional() +}); + +export const getIncontextSignupDismissedAtSchema = z.object({ + success: z.object({ + permanentlyDismissedAt: z.number().optional(), + isInstalledRecently: z.boolean().optional() + }) +}); + +export const getAliasParamsSchema = z.object({ + requiresUserPermission: z.boolean(), + shouldConsumeAliasIfProvided: z.boolean(), + isIncontextSignupAvailable: z.boolean().optional() +}); + +export const getAliasResultSchema = z.object({ + success: z.object({ + alias: z.string().optional() + }) +}); + +export const emailProtectionStoreUserDataParamsSchema = z.object({ + token: z.string(), + userName: z.string(), + cohort: z.string() +}); + export const generatedPasswordSchema = z.object({ value: z.string(), username: z.string() @@ -113,42 +156,6 @@ export const availableInputTypesSchema = z.object({ credentialsProviderStatus: z.union([z.literal("locked"), z.literal("unlocked")]).optional() }); -export const getAutofillInitDataResponseSchema = z.object({ - type: z.literal("getAutofillInitDataResponse").optional(), - success: z.object({ - credentials: z.array(credentialsSchema), - identities: z.array(z.record(z.unknown())), - creditCards: z.array(z.record(z.unknown())), - serializedInputContext: z.string() - }).optional(), - error: genericErrorSchema.optional() -}); - -export const getAutofillCredentialsParamsSchema = z.object({ - id: z.string() -}); - -export const getAutofillCredentialsResultSchema = z.object({ - type: z.literal("getAutofillCredentialsResponse").optional(), - success: z.object({ - id: z.string().optional(), - autogenerated: z.boolean().optional(), - username: z.string(), - password: z.string().optional() - }).optional(), - error: genericErrorSchema.optional() -}); - -export const setSizeParamsSchema = z.object({ - height: z.number(), - width: z.number() -}); - -export const selectedDetailParamsSchema = z.object({ - data: z.record(z.unknown()), - configType: z.string() -}); - export const availableInputTypes1Schema = z.object({ credentials: z.object({ username: z.boolean().optional(), @@ -181,17 +188,6 @@ export const availableInputTypes1Schema = z.object({ credentialsProviderStatus: z.union([z.literal("locked"), z.literal("unlocked")]).optional() }); -export const setIncontextSignupPermanentlyDismissedAtSchema = z.object({ - value: z.number().optional() -}); - -export const getIncontextSignupDismissedAtSchema = z.object({ - success: z.object({ - permanentlyDismissedAt: z.number().optional(), - isInstalledRecently: z.boolean().optional() - }) -}); - export const autofillFeatureTogglesSchema = z.object({ inputType_credentials: z.boolean().optional(), inputType_identities: z.boolean().optional(), @@ -204,22 +200,60 @@ export const autofillFeatureTogglesSchema = z.object({ third_party_credentials_provider: z.boolean().optional() }); -export const getAliasParamsSchema = z.object({ - requiresUserPermission: z.boolean(), - shouldConsumeAliasIfProvided: z.boolean(), - isIncontextSignupAvailable: z.boolean().optional() +export const getAutofillDataRequestSchema = z.object({ + generatedPassword: generatedPasswordSchema.optional(), + inputType: z.string(), + mainType: z.union([z.literal("credentials"), z.literal("identities"), z.literal("creditCards")]), + subType: z.string(), + trigger: z.union([z.literal("userInitiated"), z.literal("autoprompt"), z.literal("postSignup")]).optional(), + serializedInputContext: z.string().optional(), + triggerContext: triggerContextSchema.optional() }); -export const getAliasResultSchema = z.object({ +export const getAutofillDataResponseSchema = z.object({ + type: z.literal("getAutofillDataResponse").optional(), success: z.object({ - alias: z.string().optional() - }) + credentials: credentialsSchema.optional(), + action: z.union([z.literal("fill"), z.literal("focus"), z.literal("none"), z.literal("acceptGeneratedPassword"), z.literal("rejectGeneratedPassword")]) + }).optional(), + error: genericErrorSchema.optional() }); -export const emailProtectionStoreUserDataParamsSchema = z.object({ - token: z.string(), - userName: z.string(), - cohort: z.string() +export const storeFormDataSchema = z.object({ + credentials: outgoingCredentialsSchema.optional(), + trigger: z.union([z.literal("formSubmission"), z.literal("passwordGeneration"), z.literal("emailProtection")]).optional() +}); + +export const getAvailableInputTypesResultSchema = z.object({ + type: z.literal("getAvailableInputTypesResponse").optional(), + success: availableInputTypesSchema, + error: genericErrorSchema.optional() +}); + +export const getAutofillInitDataResponseSchema = z.object({ + type: z.literal("getAutofillInitDataResponse").optional(), + success: z.object({ + credentials: z.array(credentialsSchema), + identities: z.array(z.record(z.unknown())), + creditCards: z.array(z.record(z.unknown())), + serializedInputContext: z.string() + }).optional(), + error: genericErrorSchema.optional() +}); + +export const getAutofillCredentialsResultSchema = z.object({ + type: z.literal("getAutofillCredentialsResponse").optional(), + success: z.object({ + id: z.string().optional(), + autogenerated: z.boolean().optional(), + username: z.string(), + password: z.string().optional() + }).optional(), + error: genericErrorSchema.optional() +}); + +export const autofillSettingsSchema = z.object({ + featureToggles: autofillFeatureTogglesSchema }); export const emailProtectionGetIsLoggedInResultSchema = z.object({ @@ -261,58 +295,18 @@ export const emailProtectionRefreshPrivateAddressResultSchema = z.object({ error: genericErrorSchema.optional() }); -export const getAutofillDataRequestSchema = z.object({ - generatedPassword: generatedPasswordSchema.optional(), - inputType: z.string(), - mainType: z.union([z.literal("credentials"), z.literal("identities"), z.literal("creditCards")]), - subType: z.string(), - trigger: z.union([z.literal("userInitiated"), z.literal("autoprompt"), z.literal("postSignup")]).optional(), - serializedInputContext: z.string().optional(), - triggerContext: triggerContextSchema.optional() -}); - -export const getAutofillDataResponseSchema = z.object({ - type: z.literal("getAutofillDataResponse").optional(), - success: z.object({ - credentials: credentialsSchema.optional(), - action: z.union([z.literal("fill"), z.literal("focus"), z.literal("none"), z.literal("acceptGeneratedPassword"), z.literal("rejectGeneratedPassword")]) - }).optional(), - error: genericErrorSchema.optional() -}); - export const runtimeConfigurationSchema = z.object({ contentScope: contentScopeSchema, userUnprotectedDomains: z.array(z.string()), userPreferences: userPreferencesSchema }); -export const storeFormDataSchema = z.object({ - credentials: outgoingCredentialsSchema.optional(), - trigger: z.union([z.literal("formSubmission"), z.literal("passwordGeneration"), z.literal("emailProtection")]).optional() -}); - -export const getAvailableInputTypesResultSchema = z.object({ - type: z.literal("getAvailableInputTypesResponse").optional(), - success: availableInputTypesSchema, - error: genericErrorSchema.optional() -}); - export const providerStatusUpdatedSchema = z.object({ status: z.union([z.literal("locked"), z.literal("unlocked")]), credentials: z.array(credentialsSchema), availableInputTypes: availableInputTypes1Schema }); -export const checkCredentialsProviderStatusResultSchema = z.object({ - type: z.literal("checkCredentialsProviderStatusResponse").optional(), - success: providerStatusUpdatedSchema, - error: genericErrorSchema.optional() -}); - -export const autofillSettingsSchema = z.object({ - featureToggles: autofillFeatureTogglesSchema -}); - export const getRuntimeConfigurationResponseSchema = z.object({ type: z.literal("getRuntimeConfigurationResponse").optional(), success: runtimeConfigurationSchema.optional(), @@ -325,6 +319,12 @@ export const askToUnlockProviderResultSchema = z.object({ error: genericErrorSchema.optional() }); +export const checkCredentialsProviderStatusResultSchema = z.object({ + type: z.literal("checkCredentialsProviderStatusResponse").optional(), + success: providerStatusUpdatedSchema, + error: genericErrorSchema.optional() +}); + export const apiSchema = z.object({ addDebugFlag: z.record(z.unknown()).and(z.object({ paramsValidator: addDebugFlagParamsSchema.optional() diff --git a/swift-package/Resources/assets/autofill-debug.js b/swift-package/Resources/assets/autofill-debug.js index 3a49c3477..4d7388a9c 100644 --- a/swift-package/Resources/assets/autofill-debug.js +++ b/swift-package/Resources/assets/autofill-debug.js @@ -5,7 +5,6 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.processConfig = processConfig; - function getTopLevelURL() { try { // FROM: https://stackoverflow.com/a/7739035/73479 @@ -19,20 +18,18 @@ function getTopLevelURL() { return new URL(location.href); } } - function isUnprotectedDomain(topLevelUrl, featureList) { let unprotectedDomain = false; - const domainParts = topLevelUrl && topLevelUrl.host ? topLevelUrl.host.split('.') : []; // walk up the domain to see if it's unprotected + const domainParts = topLevelUrl && topLevelUrl.host ? topLevelUrl.host.split('.') : []; + // walk up the domain to see if it's unprotected while (domainParts.length > 1 && !unprotectedDomain) { const partialDomain = domainParts.join('.'); unprotectedDomain = featureList.filter(domain => domain.domain === partialDomain).length > 0; domainParts.shift(); } - return unprotectedDomain; } - function processConfig(data, userList, preferences) { const topLevelUrl = getTopLevelURL(); const allowlisted = userList.filter(domain => domain === topLevelUrl.host).length > 0; @@ -46,8 +43,8 @@ function processConfig(data, userList, preferences) { isBroken, allowlisted, enabledFeatures - }; // TODO - + }; + // TODO preferences.cookie = {}; return preferences; } @@ -58,64 +55,46 @@ function processConfig(data, userList, preferences) { Object.defineProperty(exports, "__esModule", { value: true }); -exports.setErrorMap = exports.overrideErrorMap = exports.defaultErrorMap = exports.ZodError = exports.quotelessJson = exports.ZodIssueCode = void 0; - -const parseUtil_1 = require("./helpers/parseUtil"); - +exports.ZodError = exports.quotelessJson = exports.ZodIssueCode = void 0; const util_1 = require("./helpers/util"); - -exports.ZodIssueCode = util_1.util.arrayToEnum(["invalid_type", "invalid_literal", "custom", "invalid_union", "invalid_union_discriminator", "invalid_enum_value", "unrecognized_keys", "invalid_arguments", "invalid_return_type", "invalid_date", "invalid_string", "too_small", "too_big", "invalid_intersection_types", "not_multiple_of"]); - +exports.ZodIssueCode = util_1.util.arrayToEnum(["invalid_type", "invalid_literal", "custom", "invalid_union", "invalid_union_discriminator", "invalid_enum_value", "unrecognized_keys", "invalid_arguments", "invalid_return_type", "invalid_date", "invalid_string", "too_small", "too_big", "invalid_intersection_types", "not_multiple_of", "not_finite"]); const quotelessJson = obj => { const json = JSON.stringify(obj, null, 2); return json.replace(/"([^"]+)":/g, "$1:"); }; - exports.quotelessJson = quotelessJson; - class ZodError extends Error { constructor(issues) { var _this; - super(); _this = this; this.issues = []; - this.addIssue = sub => { this.issues = [...this.issues, sub]; }; - this.addIssues = function () { let subs = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; _this.issues = [..._this.issues, ...subs]; }; - const actualProto = new.target.prototype; - if (Object.setPrototypeOf) { - // eslint-disable-next-line ban/ban Object.setPrototypeOf(this, actualProto); } else { this.__proto__ = actualProto; } - this.name = "ZodError"; this.issues = issues; } - get errors() { return this.issues; } - format(_mapper) { const mapper = _mapper || function (issue) { return issue.message; }; - const fieldErrors = { _errors: [] }; - const processError = error => { for (const issue of error.issues) { if (issue.code === "invalid_union") { @@ -129,57 +108,41 @@ class ZodError extends Error { } else { let curr = fieldErrors; let i = 0; - while (i < issue.path.length) { const el = issue.path[i]; const terminal = i === issue.path.length - 1; - if (!terminal) { curr[el] = curr[el] || { _errors: [] - }; // if (typeof el === "string") { - // curr[el] = curr[el] || { _errors: [] }; - // } else if (typeof el === "number") { - // const errorArray: any = []; - // errorArray._errors = []; - // curr[el] = curr[el] || errorArray; - // } + }; } else { curr[el] = curr[el] || { _errors: [] }; - curr[el]._errors.push(mapper(issue)); } - curr = curr[el]; i++; } } } }; - processError(this); return fieldErrors; } - toString() { return this.message; } - get message() { - return JSON.stringify(this.issues, null, 2); + return JSON.stringify(this.issues, util_1.util.jsonStringifyReplacer, 2); } - get isEmpty() { return this.issues.length === 0; } - flatten() { let mapper = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : issue => issue.message; const fieldErrors = {}; const formErrors = []; - for (const sub of this.issues) { if (sub.path.length > 0) { fieldErrors[sub.path[0]] = fieldErrors[sub.path[0]] || []; @@ -188,153 +151,74 @@ class ZodError extends Error { formErrors.push(mapper(sub)); } } - return { formErrors, fieldErrors }; } - get formErrors() { return this.flatten(); } - } - exports.ZodError = ZodError; - ZodError.create = issues => { const error = new ZodError(issues); return error; }; -const defaultErrorMap = (issue, _ctx) => { - let message; - - switch (issue.code) { - case exports.ZodIssueCode.invalid_type: - if (issue.received === parseUtil_1.ZodParsedType.undefined) { - message = "Required"; - } else { - message = "Expected ".concat(issue.expected, ", received ").concat(issue.received); - } - - break; - - case exports.ZodIssueCode.invalid_literal: - message = "Invalid literal value, expected ".concat(JSON.stringify(issue.expected)); - break; - - case exports.ZodIssueCode.unrecognized_keys: - message = "Unrecognized key(s) in object: ".concat(util_1.util.joinValues(issue.keys, ", ")); - break; - - case exports.ZodIssueCode.invalid_union: - message = "Invalid input"; - break; - - case exports.ZodIssueCode.invalid_union_discriminator: - message = "Invalid discriminator value. Expected ".concat(util_1.util.joinValues(issue.options)); - break; - - case exports.ZodIssueCode.invalid_enum_value: - message = "Invalid enum value. Expected ".concat(util_1.util.joinValues(issue.options), ", received '").concat(issue.received, "'"); - break; - - case exports.ZodIssueCode.invalid_arguments: - message = "Invalid function arguments"; - break; - - case exports.ZodIssueCode.invalid_return_type: - message = "Invalid function return type"; - break; - - case exports.ZodIssueCode.invalid_date: - message = "Invalid date"; - break; - - case exports.ZodIssueCode.invalid_string: - if (issue.validation !== "regex") message = "Invalid ".concat(issue.validation);else message = "Invalid"; - break; - - case exports.ZodIssueCode.too_small: - if (issue.type === "array") message = "Array must contain ".concat(issue.inclusive ? "at least" : "more than", " ").concat(issue.minimum, " element(s)");else if (issue.type === "string") message = "String must contain ".concat(issue.inclusive ? "at least" : "over", " ").concat(issue.minimum, " character(s)");else if (issue.type === "number") message = "Number must be greater than ".concat(issue.inclusive ? "or equal to " : "").concat(issue.minimum);else message = "Invalid input"; - break; - - case exports.ZodIssueCode.too_big: - if (issue.type === "array") message = "Array must contain ".concat(issue.inclusive ? "at most" : "less than", " ").concat(issue.maximum, " element(s)");else if (issue.type === "string") message = "String must contain ".concat(issue.inclusive ? "at most" : "under", " ").concat(issue.maximum, " character(s)");else if (issue.type === "number") message = "Number must be less than ".concat(issue.inclusive ? "or equal to " : "").concat(issue.maximum);else message = "Invalid input"; - break; - - case exports.ZodIssueCode.custom: - message = "Invalid input"; - break; - - case exports.ZodIssueCode.invalid_intersection_types: - message = "Intersection results could not be merged"; - break; - - case exports.ZodIssueCode.not_multiple_of: - message = "Number must be a multiple of ".concat(issue.multipleOf); - break; - - default: - message = _ctx.defaultError; - util_1.util.assertNever(issue); - } +},{"./helpers/util":8}],3:[function(require,module,exports){ +"use strict"; - return { - message +var __importDefault = void 0 && (void 0).__importDefault || function (mod) { + return mod && mod.__esModule ? mod : { + "default": mod }; }; - -exports.defaultErrorMap = defaultErrorMap; -exports.overrideErrorMap = exports.defaultErrorMap; - -const setErrorMap = map => { - exports.overrideErrorMap = map; -}; - +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.getErrorMap = exports.setErrorMap = exports.defaultErrorMap = void 0; +const en_1 = __importDefault(require("./locales/en")); +exports.defaultErrorMap = en_1.default; +let overrideErrorMap = en_1.default; +function setErrorMap(map) { + overrideErrorMap = map; +} exports.setErrorMap = setErrorMap; +function getErrorMap() { + return overrideErrorMap; +} +exports.getErrorMap = getErrorMap; -},{"./helpers/parseUtil":5,"./helpers/util":7}],3:[function(require,module,exports){ +},{"./locales/en":10}],4:[function(require,module,exports){ "use strict"; var __createBinding = void 0 && (void 0).__createBinding || (Object.create ? function (o, m, k, k2) { if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { - enumerable: true, - get: function () { - return m[k]; - } - }; - } - - Object.defineProperty(o, k2, desc); + Object.defineProperty(o, k2, { + enumerable: true, + get: function () { + return m[k]; + } + }); } : function (o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; }); - var __exportStar = void 0 && (void 0).__exportStar || function (m, exports) { for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); }; - Object.defineProperty(exports, "__esModule", { value: true }); - +__exportStar(require("./errors"), exports); __exportStar(require("./helpers/parseUtil"), exports); - __exportStar(require("./helpers/typeAliases"), exports); - +__exportStar(require("./helpers/util"), exports); __exportStar(require("./types"), exports); - __exportStar(require("./ZodError"), exports); -},{"./ZodError":2,"./helpers/parseUtil":5,"./helpers/typeAliases":6,"./types":9}],4:[function(require,module,exports){ +},{"./ZodError":2,"./errors":3,"./helpers/parseUtil":6,"./helpers/typeAliases":7,"./helpers/util":8,"./types":11}],5:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { @@ -342,85 +226,27 @@ Object.defineProperty(exports, "__esModule", { }); exports.errorUtil = void 0; var errorUtil; - (function (errorUtil) { errorUtil.errToObj = message => typeof message === "string" ? { message } : message || {}; - errorUtil.toString = message => typeof message === "string" ? message : message === null || message === void 0 ? void 0 : message.message; })(errorUtil = exports.errorUtil || (exports.errorUtil = {})); -},{}],5:[function(require,module,exports){ +},{}],6:[function(require,module,exports){ "use strict"; +var __importDefault = void 0 && (void 0).__importDefault || function (mod) { + return mod && mod.__esModule ? mod : { + "default": mod + }; +}; Object.defineProperty(exports, "__esModule", { value: true }); -exports.isAsync = exports.isValid = exports.isDirty = exports.isAborted = exports.OK = exports.DIRTY = exports.INVALID = exports.ParseStatus = exports.addIssueToContext = exports.EMPTY_PATH = exports.makeIssue = exports.getParsedType = exports.ZodParsedType = void 0; - -const ZodError_1 = require("../ZodError"); - -const util_1 = require("./util"); - -exports.ZodParsedType = util_1.util.arrayToEnum(["string", "nan", "number", "integer", "float", "boolean", "date", "bigint", "symbol", "function", "undefined", "null", "array", "object", "unknown", "promise", "void", "never", "map", "set"]); - -const getParsedType = data => { - const t = typeof data; - - switch (t) { - case "undefined": - return exports.ZodParsedType.undefined; - - case "string": - return exports.ZodParsedType.string; - - case "number": - return isNaN(data) ? exports.ZodParsedType.nan : exports.ZodParsedType.number; - - case "boolean": - return exports.ZodParsedType.boolean; - - case "function": - return exports.ZodParsedType.function; - - case "bigint": - return exports.ZodParsedType.bigint; - - case "object": - if (Array.isArray(data)) { - return exports.ZodParsedType.array; - } - - if (data === null) { - return exports.ZodParsedType.null; - } - - if (data.then && typeof data.then === "function" && data.catch && typeof data.catch === "function") { - return exports.ZodParsedType.promise; - } - - if (typeof Map !== "undefined" && data instanceof Map) { - return exports.ZodParsedType.map; - } - - if (typeof Set !== "undefined" && data instanceof Set) { - return exports.ZodParsedType.set; - } - - if (typeof Date !== "undefined" && data instanceof Date) { - return exports.ZodParsedType.date; - } - - return exports.ZodParsedType.object; - - default: - return exports.ZodParsedType.unknown; - } -}; - -exports.getParsedType = getParsedType; - +exports.isAsync = exports.isValid = exports.isDirty = exports.isAborted = exports.OK = exports.DIRTY = exports.INVALID = exports.ParseStatus = exports.addIssueToContext = exports.EMPTY_PATH = exports.makeIssue = void 0; +const errors_1 = require("../errors"); +const en_1 = __importDefault(require("../locales/en")); const makeIssue = params => { const { data, @@ -429,85 +255,70 @@ const makeIssue = params => { issueData } = params; const fullPath = [...path, ...(issueData.path || [])]; - const fullIssue = { ...issueData, + const fullIssue = { + ...issueData, path: fullPath }; let errorMessage = ""; const maps = errorMaps.filter(m => !!m).slice().reverse(); - for (const map of maps) { errorMessage = map(fullIssue, { data, defaultError: errorMessage }).message; } - - return { ...issueData, + return { + ...issueData, path: fullPath, message: issueData.message || errorMessage }; }; - exports.makeIssue = makeIssue; exports.EMPTY_PATH = []; - function addIssueToContext(ctx, issueData) { const issue = (0, exports.makeIssue)({ issueData: issueData, data: ctx.data, path: ctx.path, - errorMaps: [ctx.common.contextualErrorMap, ctx.schemaErrorMap, ZodError_1.overrideErrorMap, ZodError_1.defaultErrorMap // then global default map - ].filter(x => !!x) + errorMaps: [ctx.common.contextualErrorMap, ctx.schemaErrorMap, (0, errors_1.getErrorMap)(), en_1.default].filter(x => !!x) }); ctx.common.issues.push(issue); } - exports.addIssueToContext = addIssueToContext; - class ParseStatus { constructor() { this.value = "valid"; } - dirty() { if (this.value === "valid") this.value = "dirty"; } - abort() { if (this.value !== "aborted") this.value = "aborted"; } - static mergeArray(status, results) { const arrayValue = []; - for (const s of results) { if (s.status === "aborted") return exports.INVALID; if (s.status === "dirty") status.dirty(); arrayValue.push(s.value); } - return { status: status.value, value: arrayValue }; } - static async mergeObjectAsync(status, pairs) { const syncPairs = []; - for (const pair of pairs) { syncPairs.push({ key: await pair.key, value: await pair.value }); } - return ParseStatus.mergeObjectSync(status, syncPairs); } - static mergeObjectSync(status, pairs) { const finalObject = {}; - for (const pair of pairs) { const { key, @@ -517,227 +328,327 @@ class ParseStatus { if (value.status === "aborted") return exports.INVALID; if (key.status === "dirty") status.dirty(); if (value.status === "dirty") status.dirty(); - - if (typeof value.value !== "undefined" || pair.alwaysSet) { + if (key.value !== "__proto__" && (typeof value.value !== "undefined" || pair.alwaysSet)) { finalObject[key.value] = value.value; } } - return { status: status.value, value: finalObject }; } - } - exports.ParseStatus = ParseStatus; exports.INVALID = Object.freeze({ status: "aborted" }); - const DIRTY = value => ({ status: "dirty", value }); - exports.DIRTY = DIRTY; - const OK = value => ({ status: "valid", value }); - exports.OK = OK; - const isAborted = x => x.status === "aborted"; - exports.isAborted = isAborted; - const isDirty = x => x.status === "dirty"; - exports.isDirty = isDirty; - const isValid = x => x.status === "valid"; - exports.isValid = isValid; - -const isAsync = x => typeof Promise !== undefined && x instanceof Promise; - +const isAsync = x => typeof Promise !== "undefined" && x instanceof Promise; exports.isAsync = isAsync; -},{"../ZodError":2,"./util":7}],6:[function(require,module,exports){ +},{"../errors":3,"../locales/en":10}],7:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -},{}],7:[function(require,module,exports){ +},{}],8:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -exports.util = void 0; +exports.getParsedType = exports.ZodParsedType = exports.objectUtil = exports.util = void 0; var util; - (function (util) { + util.assertEqual = val => val; + function assertIs(_arg) {} + util.assertIs = assertIs; function assertNever(_x) { throw new Error(); } - util.assertNever = assertNever; - util.arrayToEnum = items => { const obj = {}; - for (const item of items) { obj[item] = item; } - return obj; }; - util.getValidEnumValues = obj => { const validKeys = util.objectKeys(obj).filter(k => typeof obj[obj[k]] !== "number"); const filtered = {}; - for (const k of validKeys) { filtered[k] = obj[k]; } - return util.objectValues(filtered); }; - util.objectValues = obj => { return util.objectKeys(obj).map(function (e) { return obj[e]; }); }; - - util.objectKeys = typeof Object.keys === "function" // eslint-disable-line ban/ban - ? obj => Object.keys(obj) // eslint-disable-line ban/ban - : object => { + util.objectKeys = typeof Object.keys === "function" ? obj => Object.keys(obj) : object => { const keys = []; - for (const key in object) { if (Object.prototype.hasOwnProperty.call(object, key)) { keys.push(key); } } - return keys; }; - util.find = (arr, checker) => { for (const item of arr) { if (checker(item)) return item; } - return undefined; }; - - util.isInteger = typeof Number.isInteger === "function" ? val => Number.isInteger(val) // eslint-disable-line ban/ban - : val => typeof val === "number" && isFinite(val) && Math.floor(val) === val; - + util.isInteger = typeof Number.isInteger === "function" ? val => Number.isInteger(val) : val => typeof val === "number" && isFinite(val) && Math.floor(val) === val; function joinValues(array) { let separator = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : " | "; - return array.map(val => typeof val === "string" ? "'".concat(val, "'") : val).join(separator); + return array.map(val => typeof val === "string" ? `'${val}'` : val).join(separator); } - util.joinValues = joinValues; + util.jsonStringifyReplacer = (_, value) => { + if (typeof value === "bigint") { + return value.toString(); + } + return value; + }; })(util = exports.util || (exports.util = {})); - -},{}],8:[function(require,module,exports){ -"use strict"; - -var __createBinding = void 0 && (void 0).__createBinding || (Object.create ? function (o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { - enumerable: true, - get: function () { - return m[k]; - } +var objectUtil; +(function (objectUtil) { + objectUtil.mergeShapes = (first, second) => { + return { + ...first, + ...second }; - } - - Object.defineProperty(o, k2, desc); -} : function (o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -}); - -var __setModuleDefault = void 0 && (void 0).__setModuleDefault || (Object.create ? function (o, v) { - Object.defineProperty(o, "default", { - enumerable: true, - value: v - }); -} : function (o, v) { - o["default"] = v; -}); - -var __importStar = void 0 && (void 0).__importStar || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + }; +})(objectUtil = exports.objectUtil || (exports.objectUtil = {})); +exports.ZodParsedType = util.arrayToEnum(["string", "nan", "number", "integer", "float", "boolean", "date", "bigint", "symbol", "function", "undefined", "null", "array", "object", "unknown", "promise", "void", "never", "map", "set"]); +const getParsedType = data => { + const t = typeof data; + switch (t) { + case "undefined": + return exports.ZodParsedType.undefined; + case "string": + return exports.ZodParsedType.string; + case "number": + return isNaN(data) ? exports.ZodParsedType.nan : exports.ZodParsedType.number; + case "boolean": + return exports.ZodParsedType.boolean; + case "function": + return exports.ZodParsedType.function; + case "bigint": + return exports.ZodParsedType.bigint; + case "symbol": + return exports.ZodParsedType.symbol; + case "object": + if (Array.isArray(data)) { + return exports.ZodParsedType.array; + } + if (data === null) { + return exports.ZodParsedType.null; + } + if (data.then && typeof data.then === "function" && data.catch && typeof data.catch === "function") { + return exports.ZodParsedType.promise; + } + if (typeof Map !== "undefined" && data instanceof Map) { + return exports.ZodParsedType.map; + } + if (typeof Set !== "undefined" && data instanceof Set) { + return exports.ZodParsedType.set; + } + if (typeof Date !== "undefined" && data instanceof Date) { + return exports.ZodParsedType.date; + } + return exports.ZodParsedType.object; + default: + return exports.ZodParsedType.unknown; + } +}; +exports.getParsedType = getParsedType; - __setModuleDefault(result, mod); +},{}],9:[function(require,module,exports){ +"use strict"; +var __createBinding = void 0 && (void 0).__createBinding || (Object.create ? function (o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { + enumerable: true, + get: function () { + return m[k]; + } + }); +} : function (o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +}); +var __setModuleDefault = void 0 && (void 0).__setModuleDefault || (Object.create ? function (o, v) { + Object.defineProperty(o, "default", { + enumerable: true, + value: v + }); +} : function (o, v) { + o["default"] = v; +}); +var __importStar = void 0 && (void 0).__importStar || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); return result; }; - var __exportStar = void 0 && (void 0).__exportStar || function (m, exports) { for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); }; - Object.defineProperty(exports, "__esModule", { value: true }); exports.z = void 0; - -const mod = __importStar(require("./external")); - -exports.z = mod; - +const z = __importStar(require("./external")); +exports.z = z; __exportStar(require("./external"), exports); +exports.default = z; -exports.default = mod; - -},{"./external":3}],9:[function(require,module,exports){ +},{"./external":4}],10:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -exports.intersection = exports.instanceof = exports.function = exports.enum = exports.effect = exports.discriminatedUnion = exports.date = exports.boolean = exports.bigint = exports.array = exports.any = exports.ZodFirstPartyTypeKind = exports.late = exports.ZodSchema = exports.Schema = exports.custom = exports.ZodNaN = exports.ZodDefault = exports.ZodNullable = exports.ZodOptional = exports.ZodTransformer = exports.ZodEffects = exports.ZodPromise = exports.ZodNativeEnum = exports.ZodEnum = exports.ZodLiteral = exports.ZodLazy = exports.ZodFunction = exports.ZodSet = exports.ZodMap = exports.ZodRecord = exports.ZodTuple = exports.ZodIntersection = exports.ZodDiscriminatedUnion = exports.ZodUnion = exports.ZodObject = exports.objectUtil = exports.ZodArray = exports.ZodVoid = exports.ZodNever = exports.ZodUnknown = exports.ZodAny = exports.ZodNull = exports.ZodUndefined = exports.ZodDate = exports.ZodBoolean = exports.ZodBigInt = exports.ZodNumber = exports.ZodString = exports.ZodType = void 0; -exports.void = exports.unknown = exports.union = exports.undefined = exports.tuple = exports.transformer = exports.string = exports.strictObject = exports.set = exports.record = exports.promise = exports.preprocess = exports.ostring = exports.optional = exports.onumber = exports.oboolean = exports.object = exports.number = exports.nullable = exports.null = exports.never = exports.nativeEnum = exports.nan = exports.map = exports.literal = exports.lazy = void 0; +const util_1 = require("../helpers/util"); +const ZodError_1 = require("../ZodError"); +const errorMap = (issue, _ctx) => { + let message; + switch (issue.code) { + case ZodError_1.ZodIssueCode.invalid_type: + if (issue.received === util_1.ZodParsedType.undefined) { + message = "Required"; + } else { + message = `Expected ${issue.expected}, received ${issue.received}`; + } + break; + case ZodError_1.ZodIssueCode.invalid_literal: + message = `Invalid literal value, expected ${JSON.stringify(issue.expected, util_1.util.jsonStringifyReplacer)}`; + break; + case ZodError_1.ZodIssueCode.unrecognized_keys: + message = `Unrecognized key(s) in object: ${util_1.util.joinValues(issue.keys, ", ")}`; + break; + case ZodError_1.ZodIssueCode.invalid_union: + message = `Invalid input`; + break; + case ZodError_1.ZodIssueCode.invalid_union_discriminator: + message = `Invalid discriminator value. Expected ${util_1.util.joinValues(issue.options)}`; + break; + case ZodError_1.ZodIssueCode.invalid_enum_value: + message = `Invalid enum value. Expected ${util_1.util.joinValues(issue.options)}, received '${issue.received}'`; + break; + case ZodError_1.ZodIssueCode.invalid_arguments: + message = `Invalid function arguments`; + break; + case ZodError_1.ZodIssueCode.invalid_return_type: + message = `Invalid function return type`; + break; + case ZodError_1.ZodIssueCode.invalid_date: + message = `Invalid date`; + break; + case ZodError_1.ZodIssueCode.invalid_string: + if (typeof issue.validation === "object") { + if ("includes" in issue.validation) { + message = `Invalid input: must include "${issue.validation.includes}"`; + if (typeof issue.validation.position === "number") { + message = `${message} at one or more positions greater than or equal to ${issue.validation.position}`; + } + } else if ("startsWith" in issue.validation) { + message = `Invalid input: must start with "${issue.validation.startsWith}"`; + } else if ("endsWith" in issue.validation) { + message = `Invalid input: must end with "${issue.validation.endsWith}"`; + } else { + util_1.util.assertNever(issue.validation); + } + } else if (issue.validation !== "regex") { + message = `Invalid ${issue.validation}`; + } else { + message = "Invalid"; + } + break; + case ZodError_1.ZodIssueCode.too_small: + if (issue.type === "array") message = `Array must contain ${issue.exact ? "exactly" : issue.inclusive ? `at least` : `more than`} ${issue.minimum} element(s)`;else if (issue.type === "string") message = `String must contain ${issue.exact ? "exactly" : issue.inclusive ? `at least` : `over`} ${issue.minimum} character(s)`;else if (issue.type === "number") message = `Number must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${issue.minimum}`;else if (issue.type === "date") message = `Date must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${new Date(Number(issue.minimum))}`;else message = "Invalid input"; + break; + case ZodError_1.ZodIssueCode.too_big: + if (issue.type === "array") message = `Array must contain ${issue.exact ? `exactly` : issue.inclusive ? `at most` : `less than`} ${issue.maximum} element(s)`;else if (issue.type === "string") message = `String must contain ${issue.exact ? `exactly` : issue.inclusive ? `at most` : `under`} ${issue.maximum} character(s)`;else if (issue.type === "number") message = `Number must be ${issue.exact ? `exactly` : issue.inclusive ? `less than or equal to` : `less than`} ${issue.maximum}`;else if (issue.type === "bigint") message = `BigInt must be ${issue.exact ? `exactly` : issue.inclusive ? `less than or equal to` : `less than`} ${issue.maximum}`;else if (issue.type === "date") message = `Date must be ${issue.exact ? `exactly` : issue.inclusive ? `smaller than or equal to` : `smaller than`} ${new Date(Number(issue.maximum))}`;else message = "Invalid input"; + break; + case ZodError_1.ZodIssueCode.custom: + message = `Invalid input`; + break; + case ZodError_1.ZodIssueCode.invalid_intersection_types: + message = `Intersection results could not be merged`; + break; + case ZodError_1.ZodIssueCode.not_multiple_of: + message = `Number must be a multiple of ${issue.multipleOf}`; + break; + case ZodError_1.ZodIssueCode.not_finite: + message = "Number must be finite"; + break; + default: + message = _ctx.defaultError; + util_1.util.assertNever(issue); + } + return { + message + }; +}; +exports.default = errorMap; -const errorUtil_1 = require("./helpers/errorUtil"); +},{"../ZodError":2,"../helpers/util":8}],11:[function(require,module,exports){ +"use strict"; +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.date = exports.boolean = exports.bigint = exports.array = exports.any = exports.coerce = exports.ZodFirstPartyTypeKind = exports.late = exports.ZodSchema = exports.Schema = exports.custom = exports.ZodReadonly = exports.ZodPipeline = exports.ZodBranded = exports.BRAND = exports.ZodNaN = exports.ZodCatch = exports.ZodDefault = exports.ZodNullable = exports.ZodOptional = exports.ZodTransformer = exports.ZodEffects = exports.ZodPromise = exports.ZodNativeEnum = exports.ZodEnum = exports.ZodLiteral = exports.ZodLazy = exports.ZodFunction = exports.ZodSet = exports.ZodMap = exports.ZodRecord = exports.ZodTuple = exports.ZodIntersection = exports.ZodDiscriminatedUnion = exports.ZodUnion = exports.ZodObject = exports.ZodArray = exports.ZodVoid = exports.ZodNever = exports.ZodUnknown = exports.ZodAny = exports.ZodNull = exports.ZodUndefined = exports.ZodSymbol = exports.ZodDate = exports.ZodBoolean = exports.ZodBigInt = exports.ZodNumber = exports.ZodString = exports.ZodType = void 0; +exports.NEVER = exports.void = exports.unknown = exports.union = exports.undefined = exports.tuple = exports.transformer = exports.symbol = exports.string = exports.strictObject = exports.set = exports.record = exports.promise = exports.preprocess = exports.pipeline = exports.ostring = exports.optional = exports.onumber = exports.oboolean = exports.object = exports.number = exports.nullable = exports.null = exports.never = exports.nativeEnum = exports.nan = exports.map = exports.literal = exports.lazy = exports.intersection = exports.instanceof = exports.function = exports.enum = exports.effect = exports.discriminatedUnion = void 0; +const errors_1 = require("./errors"); +const errorUtil_1 = require("./helpers/errorUtil"); const parseUtil_1 = require("./helpers/parseUtil"); - const util_1 = require("./helpers/util"); - const ZodError_1 = require("./ZodError"); - class ParseInputLazyPath { constructor(parent, value, path, key) { + this._cachedPath = []; this.parent = parent; this.data = value; this._path = path; this._key = key; } - get path() { - return this._path.concat(this._key); + if (!this._cachedPath.length) { + if (this._key instanceof Array) { + this._cachedPath.push(...this._path, ...this._key); + } else { + this._cachedPath.push(...this._path, this._key); + } + } + return this._cachedPath; } - } - const handleResult = (ctx, result) => { if ((0, parseUtil_1.isValid)(result)) { return { @@ -748,15 +659,17 @@ const handleResult = (ctx, result) => { if (!ctx.common.issues.length) { throw new Error("Validation failed but no issues detected."); } - - const error = new ZodError_1.ZodError(ctx.common.issues); return { success: false, - error + get error() { + if (this._error) return this._error; + const error = new ZodError_1.ZodError(ctx.common.issues); + this._error = error; + return this._error; + } }; } }; - function processCreateParams(params) { if (!params) return {}; const { @@ -765,42 +678,34 @@ function processCreateParams(params) { required_error, description } = params; - if (errorMap && (invalid_type_error || required_error)) { - throw new Error("Can't use \"invalid\" or \"required\" in conjunction with custom error map."); + throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`); } - if (errorMap) return { errorMap: errorMap, description }; - const customMap = (iss, ctx) => { if (iss.code !== "invalid_type") return { message: ctx.defaultError }; - if (typeof ctx.data === "undefined" && required_error) return { - message: required_error - }; - if (params.invalid_type_error) return { - message: params.invalid_type_error - }; + if (typeof ctx.data === "undefined") { + return { + message: required_error !== null && required_error !== void 0 ? required_error : ctx.defaultError + }; + } return { - message: ctx.defaultError + message: invalid_type_error !== null && invalid_type_error !== void 0 ? invalid_type_error : ctx.defaultError }; }; - return { errorMap: customMap, description }; } - class ZodType { constructor(def) { - /** Alias of safeParseAsync */ this.spa = this.safeParseAsync; - this.superRefine = this._refinement; this._def = def; this.parse = this.parse.bind(this); this.safeParse = this.safeParse.bind(this); @@ -818,70 +723,62 @@ class ZodType { this.or = this.or.bind(this); this.and = this.and.bind(this); this.transform = this.transform.bind(this); + this.brand = this.brand.bind(this); this.default = this.default.bind(this); + this.catch = this.catch.bind(this); this.describe = this.describe.bind(this); + this.pipe = this.pipe.bind(this); + this.readonly = this.readonly.bind(this); this.isNullable = this.isNullable.bind(this); this.isOptional = this.isOptional.bind(this); } - get description() { return this._def.description; } - _getType(input) { - return (0, parseUtil_1.getParsedType)(input.data); + return (0, util_1.getParsedType)(input.data); } - _getOrReturnCtx(input, ctx) { return ctx || { common: input.parent.common, data: input.data, - parsedType: (0, parseUtil_1.getParsedType)(input.data), + parsedType: (0, util_1.getParsedType)(input.data), schemaErrorMap: this._def.errorMap, path: input.path, parent: input.parent }; } - _processInputParams(input) { return { status: new parseUtil_1.ParseStatus(), ctx: { common: input.parent.common, data: input.data, - parsedType: (0, parseUtil_1.getParsedType)(input.data), + parsedType: (0, util_1.getParsedType)(input.data), schemaErrorMap: this._def.errorMap, path: input.path, parent: input.parent } }; } - _parseSync(input) { const result = this._parse(input); - if ((0, parseUtil_1.isAsync)(result)) { throw new Error("Synchronous parse encountered promise."); } - return result; } - _parseAsync(input) { const result = this._parse(input); - return Promise.resolve(result); } - parse(data, params) { const result = this.safeParse(data, params); if (result.success) return result.data; throw result.error; } - safeParse(data, params) { var _a; - const ctx = { common: { issues: [], @@ -892,24 +789,20 @@ class ZodType { schemaErrorMap: this._def.errorMap, parent: null, data, - parsedType: (0, parseUtil_1.getParsedType)(data) + parsedType: (0, util_1.getParsedType)(data) }; - const result = this._parseSync({ data, path: ctx.path, parent: ctx }); - return handleResult(ctx, result); } - async parseAsync(data, params) { const result = await this.safeParseAsync(data, params); if (result.success) return result.data; throw result.error; } - async safeParseAsync(data, params) { const ctx = { common: { @@ -921,19 +814,16 @@ class ZodType { schemaErrorMap: this._def.errorMap, parent: null, data, - parsedType: (0, parseUtil_1.getParsedType)(data) + parsedType: (0, util_1.getParsedType)(data) }; - const maybeAsyncResult = this._parse({ data, - path: [], + path: ctx.path, parent: ctx }); - const result = await ((0, parseUtil_1.isAsync)(maybeAsyncResult) ? maybeAsyncResult : Promise.resolve(maybeAsyncResult)); return handleResult(ctx, result); } - refine(check, message) { const getIssueProperties = val => { if (typeof message === "string" || typeof message === "undefined") { @@ -946,15 +836,12 @@ class ZodType { return message; } }; - return this._refinement((val, ctx) => { const result = check(val); - const setError = () => ctx.addIssue({ code: ZodError_1.ZodIssueCode.custom, ...getIssueProperties(val) }); - if (typeof Promise !== "undefined" && result instanceof Promise) { return result.then(data => { if (!data) { @@ -965,7 +852,6 @@ class ZodType { } }); } - if (!result) { setError(); return false; @@ -974,7 +860,6 @@ class ZodType { } }); } - refinement(check, refinementData) { return this._refinement((val, ctx) => { if (!check(val)) { @@ -985,7 +870,6 @@ class ZodType { } }); } - _refinement(refinement) { return new ZodEffects({ schema: this, @@ -996,37 +880,33 @@ class ZodType { } }); } - + superRefine(refinement) { + return this._refinement(refinement); + } optional() { - return ZodOptional.create(this); + return ZodOptional.create(this, this._def); } - nullable() { - return ZodNullable.create(this); + return ZodNullable.create(this, this._def); } - nullish() { - return this.optional().nullable(); + return this.nullable().optional(); } - array() { - return ZodArray.create(this); + return ZodArray.create(this, this._def); } - promise() { - return ZodPromise.create(this); + return ZodPromise.create(this, this._def); } - or(option) { - return ZodUnion.create([this, option]); + return ZodUnion.create([this, option], this._def); } - and(incoming) { - return ZodIntersection.create(this, incoming); + return ZodIntersection.create(this, incoming, this._def); } - transform(transform) { return new ZodEffects({ + ...processCreateParams(this._def), schema: this, typeName: ZodFirstPartyTypeKind.ZodEffects, effect: { @@ -1035,80 +915,136 @@ class ZodType { } }); } - default(def) { const defaultValueFunc = typeof def === "function" ? def : () => def; return new ZodDefault({ + ...processCreateParams(this._def), innerType: this, defaultValue: defaultValueFunc, typeName: ZodFirstPartyTypeKind.ZodDefault }); } - + brand() { + return new ZodBranded({ + typeName: ZodFirstPartyTypeKind.ZodBranded, + type: this, + ...processCreateParams(this._def) + }); + } + catch(def) { + const catchValueFunc = typeof def === "function" ? def : () => def; + return new ZodCatch({ + ...processCreateParams(this._def), + innerType: this, + catchValue: catchValueFunc, + typeName: ZodFirstPartyTypeKind.ZodCatch + }); + } describe(description) { const This = this.constructor; - return new This({ ...this._def, + return new This({ + ...this._def, description }); } - + pipe(target) { + return ZodPipeline.create(this, target); + } + readonly() { + return ZodReadonly.create(this); + } isOptional() { return this.safeParse(undefined).success; } - isNullable() { return this.safeParse(null).success; } - } - exports.ZodType = ZodType; exports.Schema = ZodType; exports.ZodSchema = ZodType; const cuidRegex = /^c[^\s-]{8,}$/i; -const uuidRegex = /^([a-f0-9]{8}-[a-f0-9]{4}-[1-5][a-f0-9]{3}-[a-f0-9]{4}-[a-f0-9]{12}|00000000-0000-0000-0000-000000000000)$/i; // from https://stackoverflow.com/a/46181/1550155 -// old version: too slow, didn't support unicode -// const emailRegex = /^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))$/i; -// eslint-disable-next-line - -const emailRegex = /^(([^<>()[\]\.,;:\s@\"]+(\.[^<>()[\]\.,;:\s@\"]+)*)|(\".+\"))@(([^<>()[\]\.,;:\s@\"]+\.)+[^<>()[\]\.,;:\s@\"]{2,})$/i; - +const cuid2Regex = /^[a-z][a-z0-9]*$/; +const ulidRegex = /[0-9A-HJKMNP-TV-Z]{26}/; +const uuidRegex = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i; +const emailRegex = /^([A-Z0-9_+-]+\.?)*[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i; +const emojiRegex = /^(\p{Extended_Pictographic}|\p{Emoji_Component})+$/u; +const ipv4Regex = /^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/; +const ipv6Regex = /^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/; +const datetimeRegex = args => { + if (args.precision) { + if (args.offset) { + return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${args.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`); + } else { + return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${args.precision}}Z$`); + } + } else if (args.precision === 0) { + if (args.offset) { + return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$`); + } else { + return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$`); + } + } else { + if (args.offset) { + return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$`); + } else { + return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$`); + } + } +}; +function isValidIP(ip, version) { + if ((version === "v4" || !version) && ipv4Regex.test(ip)) { + return true; + } + if ((version === "v6" || !version) && ipv6Regex.test(ip)) { + return true; + } + return false; +} class ZodString extends ZodType { constructor() { super(...arguments); - this._regex = (regex, validation, message) => this.refinement(data => regex.test(data), { validation, code: ZodError_1.ZodIssueCode.invalid_string, ...errorUtil_1.errorUtil.errToObj(message) }); - /** - * Deprecated. - * Use z.string().min(1) instead. - */ - - this.nonempty = message => this.min(1, errorUtil_1.errorUtil.errToObj(message)); + this.trim = () => new ZodString({ + ...this._def, + checks: [...this._def.checks, { + kind: "trim" + }] + }); + this.toLowerCase = () => new ZodString({ + ...this._def, + checks: [...this._def.checks, { + kind: "toLowerCase" + }] + }); + this.toUpperCase = () => new ZodString({ + ...this._def, + checks: [...this._def.checks, { + kind: "toUpperCase" + }] + }); } - _parse(input) { + if (this._def.coerce) { + input.data = String(input.data); + } const parsedType = this._getType(input); - - if (parsedType !== parseUtil_1.ZodParsedType.string) { + if (parsedType !== util_1.ZodParsedType.string) { const ctx = this._getOrReturnCtx(input); - (0, parseUtil_1.addIssueToContext)(ctx, { code: ZodError_1.ZodIssueCode.invalid_type, - expected: parseUtil_1.ZodParsedType.string, + expected: util_1.ZodParsedType.string, received: ctx.parsedType - } // - ); + }); return parseUtil_1.INVALID; } - const status = new parseUtil_1.ParseStatus(); let ctx = undefined; - for (const check of this._def.checks) { if (check.kind === "min") { if (input.data.length < check.value) { @@ -1118,6 +1054,7 @@ class ZodString extends ZodType { minimum: check.value, type: "string", inclusive: true, + exact: false, message: check.message }); status.dirty(); @@ -1130,10 +1067,37 @@ class ZodString extends ZodType { maximum: check.value, type: "string", inclusive: true, + exact: false, message: check.message }); status.dirty(); } + } else if (check.kind === "length") { + const tooBig = input.data.length > check.value; + const tooSmall = input.data.length < check.value; + if (tooBig || tooSmall) { + ctx = this._getOrReturnCtx(input, ctx); + if (tooBig) { + (0, parseUtil_1.addIssueToContext)(ctx, { + code: ZodError_1.ZodIssueCode.too_big, + maximum: check.value, + type: "string", + inclusive: true, + exact: true, + message: check.message + }); + } else if (tooSmall) { + (0, parseUtil_1.addIssueToContext)(ctx, { + code: ZodError_1.ZodIssueCode.too_small, + minimum: check.value, + type: "string", + inclusive: true, + exact: true, + message: check.message + }); + } + status.dirty(); + } } else if (check.kind === "email") { if (!emailRegex.test(input.data)) { ctx = this._getOrReturnCtx(input, ctx); @@ -1144,6 +1108,16 @@ class ZodString extends ZodType { }); status.dirty(); } + } else if (check.kind === "emoji") { + if (!emojiRegex.test(input.data)) { + ctx = this._getOrReturnCtx(input, ctx); + (0, parseUtil_1.addIssueToContext)(ctx, { + validation: "emoji", + code: ZodError_1.ZodIssueCode.invalid_string, + message: check.message + }); + status.dirty(); + } } else if (check.kind === "uuid") { if (!uuidRegex.test(input.data)) { ctx = this._getOrReturnCtx(input, ctx); @@ -1164,6 +1138,26 @@ class ZodString extends ZodType { }); status.dirty(); } + } else if (check.kind === "cuid2") { + if (!cuid2Regex.test(input.data)) { + ctx = this._getOrReturnCtx(input, ctx); + (0, parseUtil_1.addIssueToContext)(ctx, { + validation: "cuid2", + code: ZodError_1.ZodIssueCode.invalid_string, + message: check.message + }); + status.dirty(); + } + } else if (check.kind === "ulid") { + if (!ulidRegex.test(input.data)) { + ctx = this._getOrReturnCtx(input, ctx); + (0, parseUtil_1.addIssueToContext)(ctx, { + validation: "ulid", + code: ZodError_1.ZodIssueCode.invalid_string, + message: check.message + }); + status.dirty(); + } } else if (check.kind === "url") { try { new URL(input.data); @@ -1179,7 +1173,6 @@ class ZodString extends ZodType { } else if (check.kind === "regex") { check.regex.lastIndex = 0; const testResult = check.regex.test(input.data); - if (!testResult) { ctx = this._getOrReturnCtx(input, ctx); (0, parseUtil_1.addIssueToContext)(ctx, { @@ -1189,49 +1182,150 @@ class ZodString extends ZodType { }); status.dirty(); } - } - } - - return { - status: status.value, - value: input.data + } else if (check.kind === "trim") { + input.data = input.data.trim(); + } else if (check.kind === "includes") { + if (!input.data.includes(check.value, check.position)) { + ctx = this._getOrReturnCtx(input, ctx); + (0, parseUtil_1.addIssueToContext)(ctx, { + code: ZodError_1.ZodIssueCode.invalid_string, + validation: { + includes: check.value, + position: check.position + }, + message: check.message + }); + status.dirty(); + } + } else if (check.kind === "toLowerCase") { + input.data = input.data.toLowerCase(); + } else if (check.kind === "toUpperCase") { + input.data = input.data.toUpperCase(); + } else if (check.kind === "startsWith") { + if (!input.data.startsWith(check.value)) { + ctx = this._getOrReturnCtx(input, ctx); + (0, parseUtil_1.addIssueToContext)(ctx, { + code: ZodError_1.ZodIssueCode.invalid_string, + validation: { + startsWith: check.value + }, + message: check.message + }); + status.dirty(); + } + } else if (check.kind === "endsWith") { + if (!input.data.endsWith(check.value)) { + ctx = this._getOrReturnCtx(input, ctx); + (0, parseUtil_1.addIssueToContext)(ctx, { + code: ZodError_1.ZodIssueCode.invalid_string, + validation: { + endsWith: check.value + }, + message: check.message + }); + status.dirty(); + } + } else if (check.kind === "datetime") { + const regex = datetimeRegex(check); + if (!regex.test(input.data)) { + ctx = this._getOrReturnCtx(input, ctx); + (0, parseUtil_1.addIssueToContext)(ctx, { + code: ZodError_1.ZodIssueCode.invalid_string, + validation: "datetime", + message: check.message + }); + status.dirty(); + } + } else if (check.kind === "ip") { + if (!isValidIP(input.data, check.version)) { + ctx = this._getOrReturnCtx(input, ctx); + (0, parseUtil_1.addIssueToContext)(ctx, { + validation: "ip", + code: ZodError_1.ZodIssueCode.invalid_string, + message: check.message + }); + status.dirty(); + } + } else { + util_1.util.assertNever(check); + } + } + return { + status: status.value, + value: input.data }; } - _addCheck(check) { - return new ZodString({ ...this._def, + return new ZodString({ + ...this._def, checks: [...this._def.checks, check] }); } - email(message) { return this._addCheck({ kind: "email", ...errorUtil_1.errorUtil.errToObj(message) }); } - url(message) { return this._addCheck({ kind: "url", ...errorUtil_1.errorUtil.errToObj(message) }); } - + emoji(message) { + return this._addCheck({ + kind: "emoji", + ...errorUtil_1.errorUtil.errToObj(message) + }); + } uuid(message) { return this._addCheck({ kind: "uuid", ...errorUtil_1.errorUtil.errToObj(message) }); } - cuid(message) { return this._addCheck({ kind: "cuid", ...errorUtil_1.errorUtil.errToObj(message) }); } - + cuid2(message) { + return this._addCheck({ + kind: "cuid2", + ...errorUtil_1.errorUtil.errToObj(message) + }); + } + ulid(message) { + return this._addCheck({ + kind: "ulid", + ...errorUtil_1.errorUtil.errToObj(message) + }); + } + ip(options) { + return this._addCheck({ + kind: "ip", + ...errorUtil_1.errorUtil.errToObj(options) + }); + } + datetime(options) { + var _a; + if (typeof options === "string") { + return this._addCheck({ + kind: "datetime", + precision: null, + offset: false, + message: options + }); + } + return this._addCheck({ + kind: "datetime", + precision: typeof (options === null || options === void 0 ? void 0 : options.precision) === "undefined" ? null : options === null || options === void 0 ? void 0 : options.precision, + offset: (_a = options === null || options === void 0 ? void 0 : options.offset) !== null && _a !== void 0 ? _a : false, + ...errorUtil_1.errorUtil.errToObj(options === null || options === void 0 ? void 0 : options.message) + }); + } regex(regex, message) { return this._addCheck({ kind: "regex", @@ -1239,7 +1333,28 @@ class ZodString extends ZodType { ...errorUtil_1.errorUtil.errToObj(message) }); } - + includes(value, options) { + return this._addCheck({ + kind: "includes", + value: value, + position: options === null || options === void 0 ? void 0 : options.position, + ...errorUtil_1.errorUtil.errToObj(options === null || options === void 0 ? void 0 : options.message) + }); + } + startsWith(value, message) { + return this._addCheck({ + kind: "startsWith", + value: value, + ...errorUtil_1.errorUtil.errToObj(message) + }); + } + endsWith(value, message) { + return this._addCheck({ + kind: "endsWith", + value: value, + ...errorUtil_1.errorUtil.errToObj(message) + }); + } min(minLength, message) { return this._addCheck({ kind: "min", @@ -1247,7 +1362,6 @@ class ZodString extends ZodType { ...errorUtil_1.errorUtil.errToObj(message) }); } - max(maxLength, message) { return this._addCheck({ kind: "max", @@ -1255,68 +1369,69 @@ class ZodString extends ZodType { ...errorUtil_1.errorUtil.errToObj(message) }); } - length(len, message) { - return this.min(len, message).max(len, message); + return this._addCheck({ + kind: "length", + value: len, + ...errorUtil_1.errorUtil.errToObj(message) + }); + } + get isDatetime() { + return !!this._def.checks.find(ch => ch.kind === "datetime"); } - get isEmail() { return !!this._def.checks.find(ch => ch.kind === "email"); } - get isURL() { return !!this._def.checks.find(ch => ch.kind === "url"); } - + get isEmoji() { + return !!this._def.checks.find(ch => ch.kind === "emoji"); + } get isUUID() { return !!this._def.checks.find(ch => ch.kind === "uuid"); } - get isCUID() { return !!this._def.checks.find(ch => ch.kind === "cuid"); } - + get isCUID2() { + return !!this._def.checks.find(ch => ch.kind === "cuid2"); + } + get isULID() { + return !!this._def.checks.find(ch => ch.kind === "ulid"); + } + get isIP() { + return !!this._def.checks.find(ch => ch.kind === "ip"); + } get minLength() { - let min = -Infinity; - - this._def.checks.map(ch => { + let min = null; + for (const ch of this._def.checks) { if (ch.kind === "min") { - if (min === null || ch.value > min) { - min = ch.value; - } + if (min === null || ch.value > min) min = ch.value; } - }); - + } return min; } - get maxLength() { let max = null; - - this._def.checks.map(ch => { + for (const ch of this._def.checks) { if (ch.kind === "max") { - if (max === null || ch.value < max) { - max = ch.value; - } + if (max === null || ch.value < max) max = ch.value; } - }); - + } return max; } - } - exports.ZodString = ZodString; - ZodString.create = params => { + var _a; return new ZodString({ checks: [], typeName: ZodFirstPartyTypeKind.ZodString, + coerce: (_a = params === null || params === void 0 ? void 0 : params.coerce) !== null && _a !== void 0 ? _a : false, ...processCreateParams(params) }); -}; // https://stackoverflow.com/questions/3966484/why-does-modulus-operator-return-fractional-number-in-javascript/31711034#31711034 - - +}; function floatSafeRemainder(val, step) { const valDecCount = (val.toString().split(".")[1] || "").length; const stepDecCount = (step.toString().split(".")[1] || "").length; @@ -1325,7 +1440,6 @@ function floatSafeRemainder(val, step) { const stepInt = parseInt(step.toFixed(decCount).replace(".", "")); return valInt % stepInt / Math.pow(10, decCount); } - class ZodNumber extends ZodType { constructor() { super(...arguments); @@ -1333,24 +1447,22 @@ class ZodNumber extends ZodType { this.max = this.lte; this.step = this.multipleOf; } - _parse(input) { + if (this._def.coerce) { + input.data = Number(input.data); + } const parsedType = this._getType(input); - - if (parsedType !== parseUtil_1.ZodParsedType.number) { + if (parsedType !== util_1.ZodParsedType.number) { const ctx = this._getOrReturnCtx(input); - (0, parseUtil_1.addIssueToContext)(ctx, { code: ZodError_1.ZodIssueCode.invalid_type, - expected: parseUtil_1.ZodParsedType.number, + expected: util_1.ZodParsedType.number, received: ctx.parsedType }); return parseUtil_1.INVALID; } - let ctx = undefined; const status = new parseUtil_1.ParseStatus(); - for (const check of this._def.checks) { if (check.kind === "int") { if (!util_1.util.isInteger(input.data)) { @@ -1365,7 +1477,6 @@ class ZodNumber extends ZodType { } } else if (check.kind === "min") { const tooSmall = check.inclusive ? input.data < check.value : input.data <= check.value; - if (tooSmall) { ctx = this._getOrReturnCtx(input, ctx); (0, parseUtil_1.addIssueToContext)(ctx, { @@ -1373,13 +1484,13 @@ class ZodNumber extends ZodType { minimum: check.value, type: "number", inclusive: check.inclusive, + exact: false, message: check.message }); status.dirty(); } } else if (check.kind === "max") { const tooBig = check.inclusive ? input.data > check.value : input.data >= check.value; - if (tooBig) { ctx = this._getOrReturnCtx(input, ctx); (0, parseUtil_1.addIssueToContext)(ctx, { @@ -1387,6 +1498,7 @@ class ZodNumber extends ZodType { maximum: check.value, type: "number", inclusive: check.inclusive, + exact: false, message: check.message }); status.dirty(); @@ -1401,35 +1513,39 @@ class ZodNumber extends ZodType { }); status.dirty(); } + } else if (check.kind === "finite") { + if (!Number.isFinite(input.data)) { + ctx = this._getOrReturnCtx(input, ctx); + (0, parseUtil_1.addIssueToContext)(ctx, { + code: ZodError_1.ZodIssueCode.not_finite, + message: check.message + }); + status.dirty(); + } } else { util_1.util.assertNever(check); } } - return { status: status.value, value: input.data }; } - gte(value, message) { return this.setLimit("min", value, true, errorUtil_1.errorUtil.toString(message)); } - gt(value, message) { return this.setLimit("min", value, false, errorUtil_1.errorUtil.toString(message)); } - lte(value, message) { return this.setLimit("max", value, true, errorUtil_1.errorUtil.toString(message)); } - lt(value, message) { return this.setLimit("max", value, false, errorUtil_1.errorUtil.toString(message)); } - setLimit(kind, value, inclusive, message) { - return new ZodNumber({ ...this._def, + return new ZodNumber({ + ...this._def, checks: [...this._def.checks, { kind, value, @@ -1438,20 +1554,18 @@ class ZodNumber extends ZodType { }] }); } - _addCheck(check) { - return new ZodNumber({ ...this._def, + return new ZodNumber({ + ...this._def, checks: [...this._def.checks, check] }); } - int(message) { return this._addCheck({ kind: "int", message: errorUtil_1.errorUtil.toString(message) }); } - positive(message) { return this._addCheck({ kind: "min", @@ -1460,7 +1574,6 @@ class ZodNumber extends ZodType { message: errorUtil_1.errorUtil.toString(message) }); } - negative(message) { return this._addCheck({ kind: "max", @@ -1469,7 +1582,6 @@ class ZodNumber extends ZodType { message: errorUtil_1.errorUtil.toString(message) }); } - nonpositive(message) { return this._addCheck({ kind: "max", @@ -1478,7 +1590,6 @@ class ZodNumber extends ZodType { message: errorUtil_1.errorUtil.toString(message) }); } - nonnegative(message) { return this._addCheck({ kind: "min", @@ -1487,7 +1598,6 @@ class ZodNumber extends ZodType { message: errorUtil_1.errorUtil.toString(message) }); } - multipleOf(value, message) { return this._addCheck({ kind: "multipleOf", @@ -1495,318 +1605,538 @@ class ZodNumber extends ZodType { message: errorUtil_1.errorUtil.toString(message) }); } - + finite(message) { + return this._addCheck({ + kind: "finite", + message: errorUtil_1.errorUtil.toString(message) + }); + } + safe(message) { + return this._addCheck({ + kind: "min", + inclusive: true, + value: Number.MIN_SAFE_INTEGER, + message: errorUtil_1.errorUtil.toString(message) + })._addCheck({ + kind: "max", + inclusive: true, + value: Number.MAX_SAFE_INTEGER, + message: errorUtil_1.errorUtil.toString(message) + }); + } get minValue() { let min = null; - for (const ch of this._def.checks) { if (ch.kind === "min") { if (min === null || ch.value > min) min = ch.value; } } - return min; } - get maxValue() { let max = null; - for (const ch of this._def.checks) { if (ch.kind === "max") { if (max === null || ch.value < max) max = ch.value; } } - return max; } - get isInt() { - return !!this._def.checks.find(ch => ch.kind === "int"); + return !!this._def.checks.find(ch => ch.kind === "int" || ch.kind === "multipleOf" && util_1.util.isInteger(ch.value)); + } + get isFinite() { + let max = null, + min = null; + for (const ch of this._def.checks) { + if (ch.kind === "finite" || ch.kind === "int" || ch.kind === "multipleOf") { + return true; + } else if (ch.kind === "min") { + if (min === null || ch.value > min) min = ch.value; + } else if (ch.kind === "max") { + if (max === null || ch.value < max) max = ch.value; + } + } + return Number.isFinite(min) && Number.isFinite(max); } - } - exports.ZodNumber = ZodNumber; - ZodNumber.create = params => { return new ZodNumber({ checks: [], typeName: ZodFirstPartyTypeKind.ZodNumber, + coerce: (params === null || params === void 0 ? void 0 : params.coerce) || false, ...processCreateParams(params) }); }; - class ZodBigInt extends ZodType { - _parse(input) { - const parsedType = this._getType(input); - - if (parsedType !== parseUtil_1.ZodParsedType.bigint) { - const ctx = this._getOrReturnCtx(input); - - (0, parseUtil_1.addIssueToContext)(ctx, { - code: ZodError_1.ZodIssueCode.invalid_type, - expected: parseUtil_1.ZodParsedType.bigint, - received: ctx.parsedType - }); - return parseUtil_1.INVALID; - } - - return (0, parseUtil_1.OK)(input.data); + constructor() { + super(...arguments); + this.min = this.gte; + this.max = this.lte; } - -} - -exports.ZodBigInt = ZodBigInt; - -ZodBigInt.create = params => { - return new ZodBigInt({ - typeName: ZodFirstPartyTypeKind.ZodBigInt, - ...processCreateParams(params) - }); -}; - -class ZodBoolean extends ZodType { _parse(input) { - const parsedType = this._getType(input); - - if (parsedType !== parseUtil_1.ZodParsedType.boolean) { - const ctx = this._getOrReturnCtx(input); - - (0, parseUtil_1.addIssueToContext)(ctx, { - code: ZodError_1.ZodIssueCode.invalid_type, - expected: parseUtil_1.ZodParsedType.boolean, - received: ctx.parsedType - }); - return parseUtil_1.INVALID; + if (this._def.coerce) { + input.data = BigInt(input.data); } - - return (0, parseUtil_1.OK)(input.data); - } - -} - -exports.ZodBoolean = ZodBoolean; - -ZodBoolean.create = params => { - return new ZodBoolean({ - typeName: ZodFirstPartyTypeKind.ZodBoolean, - ...processCreateParams(params) - }); -}; - -class ZodDate extends ZodType { - _parse(input) { const parsedType = this._getType(input); - - if (parsedType !== parseUtil_1.ZodParsedType.date) { + if (parsedType !== util_1.ZodParsedType.bigint) { const ctx = this._getOrReturnCtx(input); - (0, parseUtil_1.addIssueToContext)(ctx, { code: ZodError_1.ZodIssueCode.invalid_type, - expected: parseUtil_1.ZodParsedType.date, + expected: util_1.ZodParsedType.bigint, received: ctx.parsedType }); return parseUtil_1.INVALID; } - - if (isNaN(input.data.getTime())) { - const ctx = this._getOrReturnCtx(input); - - (0, parseUtil_1.addIssueToContext)(ctx, { - code: ZodError_1.ZodIssueCode.invalid_date - }); - return parseUtil_1.INVALID; - } - - return { - status: "valid", - value: new Date(input.data.getTime()) - }; - } - + let ctx = undefined; + const status = new parseUtil_1.ParseStatus(); + for (const check of this._def.checks) { + if (check.kind === "min") { + const tooSmall = check.inclusive ? input.data < check.value : input.data <= check.value; + if (tooSmall) { + ctx = this._getOrReturnCtx(input, ctx); + (0, parseUtil_1.addIssueToContext)(ctx, { + code: ZodError_1.ZodIssueCode.too_small, + type: "bigint", + minimum: check.value, + inclusive: check.inclusive, + message: check.message + }); + status.dirty(); + } + } else if (check.kind === "max") { + const tooBig = check.inclusive ? input.data > check.value : input.data >= check.value; + if (tooBig) { + ctx = this._getOrReturnCtx(input, ctx); + (0, parseUtil_1.addIssueToContext)(ctx, { + code: ZodError_1.ZodIssueCode.too_big, + type: "bigint", + maximum: check.value, + inclusive: check.inclusive, + message: check.message + }); + status.dirty(); + } + } else if (check.kind === "multipleOf") { + if (input.data % check.value !== BigInt(0)) { + ctx = this._getOrReturnCtx(input, ctx); + (0, parseUtil_1.addIssueToContext)(ctx, { + code: ZodError_1.ZodIssueCode.not_multiple_of, + multipleOf: check.value, + message: check.message + }); + status.dirty(); + } + } else { + util_1.util.assertNever(check); + } + } + return { + status: status.value, + value: input.data + }; + } + gte(value, message) { + return this.setLimit("min", value, true, errorUtil_1.errorUtil.toString(message)); + } + gt(value, message) { + return this.setLimit("min", value, false, errorUtil_1.errorUtil.toString(message)); + } + lte(value, message) { + return this.setLimit("max", value, true, errorUtil_1.errorUtil.toString(message)); + } + lt(value, message) { + return this.setLimit("max", value, false, errorUtil_1.errorUtil.toString(message)); + } + setLimit(kind, value, inclusive, message) { + return new ZodBigInt({ + ...this._def, + checks: [...this._def.checks, { + kind, + value, + inclusive, + message: errorUtil_1.errorUtil.toString(message) + }] + }); + } + _addCheck(check) { + return new ZodBigInt({ + ...this._def, + checks: [...this._def.checks, check] + }); + } + positive(message) { + return this._addCheck({ + kind: "min", + value: BigInt(0), + inclusive: false, + message: errorUtil_1.errorUtil.toString(message) + }); + } + negative(message) { + return this._addCheck({ + kind: "max", + value: BigInt(0), + inclusive: false, + message: errorUtil_1.errorUtil.toString(message) + }); + } + nonpositive(message) { + return this._addCheck({ + kind: "max", + value: BigInt(0), + inclusive: true, + message: errorUtil_1.errorUtil.toString(message) + }); + } + nonnegative(message) { + return this._addCheck({ + kind: "min", + value: BigInt(0), + inclusive: true, + message: errorUtil_1.errorUtil.toString(message) + }); + } + multipleOf(value, message) { + return this._addCheck({ + kind: "multipleOf", + value, + message: errorUtil_1.errorUtil.toString(message) + }); + } + get minValue() { + let min = null; + for (const ch of this._def.checks) { + if (ch.kind === "min") { + if (min === null || ch.value > min) min = ch.value; + } + } + return min; + } + get maxValue() { + let max = null; + for (const ch of this._def.checks) { + if (ch.kind === "max") { + if (max === null || ch.value < max) max = ch.value; + } + } + return max; + } +} +exports.ZodBigInt = ZodBigInt; +ZodBigInt.create = params => { + var _a; + return new ZodBigInt({ + checks: [], + typeName: ZodFirstPartyTypeKind.ZodBigInt, + coerce: (_a = params === null || params === void 0 ? void 0 : params.coerce) !== null && _a !== void 0 ? _a : false, + ...processCreateParams(params) + }); +}; +class ZodBoolean extends ZodType { + _parse(input) { + if (this._def.coerce) { + input.data = Boolean(input.data); + } + const parsedType = this._getType(input); + if (parsedType !== util_1.ZodParsedType.boolean) { + const ctx = this._getOrReturnCtx(input); + (0, parseUtil_1.addIssueToContext)(ctx, { + code: ZodError_1.ZodIssueCode.invalid_type, + expected: util_1.ZodParsedType.boolean, + received: ctx.parsedType + }); + return parseUtil_1.INVALID; + } + return (0, parseUtil_1.OK)(input.data); + } +} +exports.ZodBoolean = ZodBoolean; +ZodBoolean.create = params => { + return new ZodBoolean({ + typeName: ZodFirstPartyTypeKind.ZodBoolean, + coerce: (params === null || params === void 0 ? void 0 : params.coerce) || false, + ...processCreateParams(params) + }); +}; +class ZodDate extends ZodType { + _parse(input) { + if (this._def.coerce) { + input.data = new Date(input.data); + } + const parsedType = this._getType(input); + if (parsedType !== util_1.ZodParsedType.date) { + const ctx = this._getOrReturnCtx(input); + (0, parseUtil_1.addIssueToContext)(ctx, { + code: ZodError_1.ZodIssueCode.invalid_type, + expected: util_1.ZodParsedType.date, + received: ctx.parsedType + }); + return parseUtil_1.INVALID; + } + if (isNaN(input.data.getTime())) { + const ctx = this._getOrReturnCtx(input); + (0, parseUtil_1.addIssueToContext)(ctx, { + code: ZodError_1.ZodIssueCode.invalid_date + }); + return parseUtil_1.INVALID; + } + const status = new parseUtil_1.ParseStatus(); + let ctx = undefined; + for (const check of this._def.checks) { + if (check.kind === "min") { + if (input.data.getTime() < check.value) { + ctx = this._getOrReturnCtx(input, ctx); + (0, parseUtil_1.addIssueToContext)(ctx, { + code: ZodError_1.ZodIssueCode.too_small, + message: check.message, + inclusive: true, + exact: false, + minimum: check.value, + type: "date" + }); + status.dirty(); + } + } else if (check.kind === "max") { + if (input.data.getTime() > check.value) { + ctx = this._getOrReturnCtx(input, ctx); + (0, parseUtil_1.addIssueToContext)(ctx, { + code: ZodError_1.ZodIssueCode.too_big, + message: check.message, + inclusive: true, + exact: false, + maximum: check.value, + type: "date" + }); + status.dirty(); + } + } else { + util_1.util.assertNever(check); + } + } + return { + status: status.value, + value: new Date(input.data.getTime()) + }; + } + _addCheck(check) { + return new ZodDate({ + ...this._def, + checks: [...this._def.checks, check] + }); + } + min(minDate, message) { + return this._addCheck({ + kind: "min", + value: minDate.getTime(), + message: errorUtil_1.errorUtil.toString(message) + }); + } + max(maxDate, message) { + return this._addCheck({ + kind: "max", + value: maxDate.getTime(), + message: errorUtil_1.errorUtil.toString(message) + }); + } + get minDate() { + let min = null; + for (const ch of this._def.checks) { + if (ch.kind === "min") { + if (min === null || ch.value > min) min = ch.value; + } + } + return min != null ? new Date(min) : null; + } + get maxDate() { + let max = null; + for (const ch of this._def.checks) { + if (ch.kind === "max") { + if (max === null || ch.value < max) max = ch.value; + } + } + return max != null ? new Date(max) : null; + } } - exports.ZodDate = ZodDate; - ZodDate.create = params => { return new ZodDate({ + checks: [], + coerce: (params === null || params === void 0 ? void 0 : params.coerce) || false, typeName: ZodFirstPartyTypeKind.ZodDate, ...processCreateParams(params) }); }; - +class ZodSymbol extends ZodType { + _parse(input) { + const parsedType = this._getType(input); + if (parsedType !== util_1.ZodParsedType.symbol) { + const ctx = this._getOrReturnCtx(input); + (0, parseUtil_1.addIssueToContext)(ctx, { + code: ZodError_1.ZodIssueCode.invalid_type, + expected: util_1.ZodParsedType.symbol, + received: ctx.parsedType + }); + return parseUtil_1.INVALID; + } + return (0, parseUtil_1.OK)(input.data); + } +} +exports.ZodSymbol = ZodSymbol; +ZodSymbol.create = params => { + return new ZodSymbol({ + typeName: ZodFirstPartyTypeKind.ZodSymbol, + ...processCreateParams(params) + }); +}; class ZodUndefined extends ZodType { _parse(input) { const parsedType = this._getType(input); - - if (parsedType !== parseUtil_1.ZodParsedType.undefined) { + if (parsedType !== util_1.ZodParsedType.undefined) { const ctx = this._getOrReturnCtx(input); - (0, parseUtil_1.addIssueToContext)(ctx, { code: ZodError_1.ZodIssueCode.invalid_type, - expected: parseUtil_1.ZodParsedType.undefined, + expected: util_1.ZodParsedType.undefined, received: ctx.parsedType }); return parseUtil_1.INVALID; } - return (0, parseUtil_1.OK)(input.data); } - } - exports.ZodUndefined = ZodUndefined; - ZodUndefined.create = params => { return new ZodUndefined({ typeName: ZodFirstPartyTypeKind.ZodUndefined, ...processCreateParams(params) }); }; - class ZodNull extends ZodType { _parse(input) { const parsedType = this._getType(input); - - if (parsedType !== parseUtil_1.ZodParsedType.null) { + if (parsedType !== util_1.ZodParsedType.null) { const ctx = this._getOrReturnCtx(input); - (0, parseUtil_1.addIssueToContext)(ctx, { code: ZodError_1.ZodIssueCode.invalid_type, - expected: parseUtil_1.ZodParsedType.null, + expected: util_1.ZodParsedType.null, received: ctx.parsedType }); return parseUtil_1.INVALID; } - return (0, parseUtil_1.OK)(input.data); } - } - exports.ZodNull = ZodNull; - ZodNull.create = params => { return new ZodNull({ typeName: ZodFirstPartyTypeKind.ZodNull, ...processCreateParams(params) }); }; - class ZodAny extends ZodType { constructor() { - super(...arguments); // to prevent instances of other classes from extending ZodAny. this causes issues with catchall in ZodObject. - + super(...arguments); this._any = true; } - _parse(input) { return (0, parseUtil_1.OK)(input.data); } - } - exports.ZodAny = ZodAny; - ZodAny.create = params => { return new ZodAny({ typeName: ZodFirstPartyTypeKind.ZodAny, ...processCreateParams(params) }); }; - class ZodUnknown extends ZodType { constructor() { - super(...arguments); // required - + super(...arguments); this._unknown = true; } - _parse(input) { return (0, parseUtil_1.OK)(input.data); } - } - exports.ZodUnknown = ZodUnknown; - ZodUnknown.create = params => { return new ZodUnknown({ typeName: ZodFirstPartyTypeKind.ZodUnknown, ...processCreateParams(params) }); }; - class ZodNever extends ZodType { _parse(input) { const ctx = this._getOrReturnCtx(input); - (0, parseUtil_1.addIssueToContext)(ctx, { code: ZodError_1.ZodIssueCode.invalid_type, - expected: parseUtil_1.ZodParsedType.never, + expected: util_1.ZodParsedType.never, received: ctx.parsedType }); return parseUtil_1.INVALID; } - } - exports.ZodNever = ZodNever; - ZodNever.create = params => { return new ZodNever({ typeName: ZodFirstPartyTypeKind.ZodNever, ...processCreateParams(params) }); }; - class ZodVoid extends ZodType { _parse(input) { const parsedType = this._getType(input); - - if (parsedType !== parseUtil_1.ZodParsedType.undefined) { + if (parsedType !== util_1.ZodParsedType.undefined) { const ctx = this._getOrReturnCtx(input); - (0, parseUtil_1.addIssueToContext)(ctx, { code: ZodError_1.ZodIssueCode.invalid_type, - expected: parseUtil_1.ZodParsedType.void, + expected: util_1.ZodParsedType.void, received: ctx.parsedType }); return parseUtil_1.INVALID; } - return (0, parseUtil_1.OK)(input.data); } - } - exports.ZodVoid = ZodVoid; - ZodVoid.create = params => { return new ZodVoid({ typeName: ZodFirstPartyTypeKind.ZodVoid, ...processCreateParams(params) }); }; - class ZodArray extends ZodType { _parse(input) { const { ctx, status } = this._processInputParams(input); - const def = this._def; - - if (ctx.parsedType !== parseUtil_1.ZodParsedType.array) { + if (ctx.parsedType !== util_1.ZodParsedType.array) { (0, parseUtil_1.addIssueToContext)(ctx, { code: ZodError_1.ZodIssueCode.invalid_type, - expected: parseUtil_1.ZodParsedType.array, + expected: util_1.ZodParsedType.array, received: ctx.parsedType }); return parseUtil_1.INVALID; } - + if (def.exactLength !== null) { + const tooBig = ctx.data.length > def.exactLength.value; + const tooSmall = ctx.data.length < def.exactLength.value; + if (tooBig || tooSmall) { + (0, parseUtil_1.addIssueToContext)(ctx, { + code: tooBig ? ZodError_1.ZodIssueCode.too_big : ZodError_1.ZodIssueCode.too_small, + minimum: tooSmall ? def.exactLength.value : undefined, + maximum: tooBig ? def.exactLength.value : undefined, + type: "array", + inclusive: true, + exact: true, + message: def.exactLength.message + }); + status.dirty(); + } + } if (def.minLength !== null) { if (ctx.data.length < def.minLength.value) { (0, parseUtil_1.addIssueToContext)(ctx, { @@ -1814,12 +2144,12 @@ class ZodArray extends ZodType { minimum: def.minLength.value, type: "array", inclusive: true, + exact: false, message: def.minLength.message }); status.dirty(); } } - if (def.maxLength !== null) { if (ctx.data.length > def.maxLength.value) { (0, parseUtil_1.addIssueToContext)(ctx, { @@ -1827,110 +2157,85 @@ class ZodArray extends ZodType { maximum: def.maxLength.value, type: "array", inclusive: true, + exact: false, message: def.maxLength.message }); status.dirty(); } } - if (ctx.common.async) { - return Promise.all(ctx.data.map((item, i) => { + return Promise.all([...ctx.data].map((item, i) => { return def.type._parseAsync(new ParseInputLazyPath(ctx, item, ctx.path, i)); })).then(result => { return parseUtil_1.ParseStatus.mergeArray(status, result); }); } - - const result = ctx.data.map((item, i) => { + const result = [...ctx.data].map((item, i) => { return def.type._parseSync(new ParseInputLazyPath(ctx, item, ctx.path, i)); }); return parseUtil_1.ParseStatus.mergeArray(status, result); } - get element() { return this._def.type; } - min(minLength, message) { - return new ZodArray({ ...this._def, + return new ZodArray({ + ...this._def, minLength: { value: minLength, message: errorUtil_1.errorUtil.toString(message) } }); } - max(maxLength, message) { - return new ZodArray({ ...this._def, + return new ZodArray({ + ...this._def, maxLength: { value: maxLength, message: errorUtil_1.errorUtil.toString(message) } }); } - length(len, message) { - return this.min(len, message).max(len, message); + return new ZodArray({ + ...this._def, + exactLength: { + value: len, + message: errorUtil_1.errorUtil.toString(message) + } + }); } - nonempty(message) { return this.min(1, message); } - } - exports.ZodArray = ZodArray; - ZodArray.create = (schema, params) => { return new ZodArray({ type: schema, minLength: null, maxLength: null, + exactLength: null, typeName: ZodFirstPartyTypeKind.ZodArray, ...processCreateParams(params) }); -}; ///////////////////////////////////////// -///////////////////////////////////////// -////////// ////////// -////////// ZodObject ////////// -////////// ////////// -///////////////////////////////////////// -///////////////////////////////////////// - - -var objectUtil; - -(function (objectUtil) { - objectUtil.mergeShapes = (first, second) => { - return { ...first, - ...second // second overwrites first - - }; - }; -})(objectUtil = exports.objectUtil || (exports.objectUtil = {})); - -const AugmentFactory = def => augmentation => { - return new ZodObject({ ...def, - shape: () => ({ ...def.shape(), - ...augmentation - }) - }); }; - function deepPartialify(schema) { if (schema instanceof ZodObject) { const newShape = {}; - for (const key in schema.shape) { const fieldSchema = schema.shape[key]; newShape[key] = ZodOptional.create(deepPartialify(fieldSchema)); } - - return new ZodObject({ ...schema._def, + return new ZodObject({ + ...schema._def, shape: () => newShape }); } else if (schema instanceof ZodArray) { - return ZodArray.create(deepPartialify(schema.element)); + return new ZodArray({ + ...schema._def, + type: deepPartialify(schema.element) + }); } else if (schema instanceof ZodOptional) { return ZodOptional.create(deepPartialify(schema.unwrap())); } else if (schema instanceof ZodNullable) { @@ -1941,67 +2246,50 @@ function deepPartialify(schema) { return schema; } } - class ZodObject extends ZodType { constructor() { super(...arguments); this._cached = null; - /** - * @deprecated In most cases, this is no longer needed - unknown properties are now silently stripped. - * If you want to pass through unknown properties, use `.passthrough()` instead. - */ - this.nonstrict = this.passthrough; - this.augment = AugmentFactory(this._def); - this.extend = AugmentFactory(this._def); + this.augment = this.extend; } - _getCached() { if (this._cached !== null) return this._cached; - const shape = this._def.shape(); - const keys = util_1.util.objectKeys(shape); return this._cached = { shape, keys }; } - _parse(input) { const parsedType = this._getType(input); - - if (parsedType !== parseUtil_1.ZodParsedType.object) { + if (parsedType !== util_1.ZodParsedType.object) { const ctx = this._getOrReturnCtx(input); - (0, parseUtil_1.addIssueToContext)(ctx, { code: ZodError_1.ZodIssueCode.invalid_type, - expected: parseUtil_1.ZodParsedType.object, + expected: util_1.ZodParsedType.object, received: ctx.parsedType }); return parseUtil_1.INVALID; } - const { status, ctx } = this._processInputParams(input); - const { shape, keys: shapeKeys } = this._getCached(); - const extraKeys = []; - - for (const key in ctx.data) { - if (!shapeKeys.includes(key)) { - extraKeys.push(key); + if (!(this._def.catchall instanceof ZodNever && this._def.unknownKeys === "strip")) { + for (const key in ctx.data) { + if (!shapeKeys.includes(key)) { + extraKeys.push(key); + } } } - const pairs = []; - for (const key of shapeKeys) { const keyValidator = shape[key]; const value = ctx.data[key]; @@ -2014,10 +2302,8 @@ class ZodObject extends ZodType { alwaysSet: key in ctx.data }); } - if (this._def.catchall instanceof ZodNever) { const unknownKeys = this._def.unknownKeys; - if (unknownKeys === "passthrough") { for (const key of extraKeys) { pairs.push({ @@ -2040,12 +2326,10 @@ class ZodObject extends ZodType { status.dirty(); } } else if (unknownKeys === "strip") {} else { - throw new Error("Internal ZodObject error: invalid unknownKeys value."); + throw new Error(`Internal ZodObject error: invalid unknownKeys value.`); } } else { - // run catchall validation const catchall = this._def.catchall; - for (const key of extraKeys) { const value = ctx.data[key]; pairs.push({ @@ -2053,17 +2337,14 @@ class ZodObject extends ZodType { status: "valid", value: key }, - value: catchall._parse(new ParseInputLazyPath(ctx, value, ctx.path, key) //, ctx.child(key), value, getParsedType(value) - ), + value: catchall._parse(new ParseInputLazyPath(ctx, value, ctx.path, key)), alwaysSet: key in ctx.data }); } } - if (ctx.common.async) { return Promise.resolve().then(async () => { const syncPairs = []; - for (const pair of pairs) { const key = await pair.key; syncPairs.push({ @@ -2072,7 +2353,6 @@ class ZodObject extends ZodType { alwaysSet: pair.alwaysSet }); } - return syncPairs; }).then(syncPairs => { return parseUtil_1.ParseStatus.mergeObjectSync(status, syncPairs); @@ -2081,19 +2361,17 @@ class ZodObject extends ZodType { return parseUtil_1.ParseStatus.mergeObjectSync(status, pairs); } } - get shape() { return this._def.shape(); } - strict(message) { errorUtil_1.errorUtil.errToObj; - return new ZodObject({ ...this._def, + return new ZodObject({ + ...this._def, unknownKeys: "strict", ...(message !== undefined ? { errorMap: (issue, ctx) => { var _a, _b, _c, _d; - const defaultError = (_c = (_b = (_a = this._def).errorMap) === null || _b === void 0 ? void 0 : _b.call(_a, issue, ctx).message) !== null && _c !== void 0 ? _c : ctx.defaultError; if (issue.code === "unrecognized_keys") return { message: (_d = errorUtil_1.errorUtil.errToObj(message).message) !== null && _d !== void 0 ? _d : defaultError @@ -2105,126 +2383,116 @@ class ZodObject extends ZodType { } : {}) }); } - strip() { - return new ZodObject({ ...this._def, + return new ZodObject({ + ...this._def, unknownKeys: "strip" }); } - passthrough() { - return new ZodObject({ ...this._def, + return new ZodObject({ + ...this._def, unknownKeys: "passthrough" }); } - - setKey(key, schema) { - return this.augment({ - [key]: schema + extend(augmentation) { + return new ZodObject({ + ...this._def, + shape: () => ({ + ...this._def.shape(), + ...augmentation + }) }); } - /** - * Prior to zod@1.0.12 there was a bug in the - * inferred type of merged objects. Please - * upgrade if you are experiencing issues. - */ - - merge(merging) { - // const mergedShape = objectUtil.mergeShapes( - // this._def.shape(), - // merging._def.shape() - // ); const merged = new ZodObject({ unknownKeys: merging._def.unknownKeys, catchall: merging._def.catchall, - shape: () => objectUtil.mergeShapes(this._def.shape(), merging._def.shape()), + shape: () => ({ + ...this._def.shape(), + ...merging._def.shape() + }), typeName: ZodFirstPartyTypeKind.ZodObject }); - return merged; + return merged; + } + setKey(key, schema) { + return this.augment({ + [key]: schema + }); } - catchall(index) { - return new ZodObject({ ...this._def, + return new ZodObject({ + ...this._def, catchall: index }); } - pick(mask) { const shape = {}; - util_1.util.objectKeys(mask).map(key => { - shape[key] = this.shape[key]; + util_1.util.objectKeys(mask).forEach(key => { + if (mask[key] && this.shape[key]) { + shape[key] = this.shape[key]; + } }); - return new ZodObject({ ...this._def, + return new ZodObject({ + ...this._def, shape: () => shape }); } - omit(mask) { const shape = {}; - util_1.util.objectKeys(this.shape).map(key => { - if (util_1.util.objectKeys(mask).indexOf(key) === -1) { + util_1.util.objectKeys(this.shape).forEach(key => { + if (!mask[key]) { shape[key] = this.shape[key]; } }); - return new ZodObject({ ...this._def, + return new ZodObject({ + ...this._def, shape: () => shape }); } - deepPartial() { return deepPartialify(this); } - partial(mask) { const newShape = {}; - - if (mask) { - util_1.util.objectKeys(this.shape).map(key => { - if (util_1.util.objectKeys(mask).indexOf(key) === -1) { - newShape[key] = this.shape[key]; - } else { - newShape[key] = this.shape[key].optional(); - } - }); - return new ZodObject({ ...this._def, - shape: () => newShape - }); - } else { - for (const key in this.shape) { - const fieldSchema = this.shape[key]; + util_1.util.objectKeys(this.shape).forEach(key => { + const fieldSchema = this.shape[key]; + if (mask && !mask[key]) { + newShape[key] = fieldSchema; + } else { newShape[key] = fieldSchema.optional(); } - } - - return new ZodObject({ ...this._def, + }); + return new ZodObject({ + ...this._def, shape: () => newShape }); } - - required() { + required(mask) { const newShape = {}; - - for (const key in this.shape) { - const fieldSchema = this.shape[key]; - let newField = fieldSchema; - - while (newField instanceof ZodOptional) { - newField = newField._def.innerType; + util_1.util.objectKeys(this.shape).forEach(key => { + if (mask && !mask[key]) { + newShape[key] = this.shape[key]; + } else { + const fieldSchema = this.shape[key]; + let newField = fieldSchema; + while (newField instanceof ZodOptional) { + newField = newField._def.innerType; + } + newShape[key] = newField; } - - newShape[key] = newField; - } - - return new ZodObject({ ...this._def, + }); + return new ZodObject({ + ...this._def, shape: () => newShape }); } - + keyof() { + return createZodEnum(util_1.util.objectKeys(this.shape)); + } } - exports.ZodObject = ZodObject; - ZodObject.create = (shape, params) => { return new ZodObject({ shape: () => shape, @@ -2234,7 +2502,6 @@ ZodObject.create = (shape, params) => { ...processCreateParams(params) }); }; - ZodObject.strictCreate = (shape, params) => { return new ZodObject({ shape: () => shape, @@ -2244,7 +2511,6 @@ ZodObject.strictCreate = (shape, params) => { ...processCreateParams(params) }); }; - ZodObject.lazycreate = (shape, params) => { return new ZodObject({ shape, @@ -2254,32 +2520,24 @@ ZodObject.lazycreate = (shape, params) => { ...processCreateParams(params) }); }; - class ZodUnion extends ZodType { _parse(input) { const { ctx } = this._processInputParams(input); - const options = this._def.options; - function handleResults(results) { - // return first issue-free validation if it exists for (const result of results) { if (result.result.status === "valid") { return result.result; } } - for (const result of results) { if (result.result.status === "dirty") { - // add issues from dirty option ctx.common.issues.push(...result.ctx.common.issues); return result.result; } - } // return invalid - - + } const unionErrors = results.map(result => new ZodError_1.ZodError(result.ctx.common.issues)); (0, parseUtil_1.addIssueToContext)(ctx, { code: ZodError_1.ZodIssueCode.invalid_union, @@ -2287,11 +2545,12 @@ class ZodUnion extends ZodType { }); return parseUtil_1.INVALID; } - if (ctx.common.async) { return Promise.all(options.map(async option => { - const childCtx = { ...ctx, - common: { ...ctx.common, + const childCtx = { + ...ctx, + common: { + ...ctx.common, issues: [] }, parent: null @@ -2308,21 +2567,20 @@ class ZodUnion extends ZodType { } else { let dirty = undefined; const issues = []; - for (const option of options) { - const childCtx = { ...ctx, - common: { ...ctx.common, + const childCtx = { + ...ctx, + common: { + ...ctx.common, issues: [] }, parent: null }; - const result = option._parseSync({ data: ctx.data, path: ctx.path, parent: childCtx }); - if (result.status === "valid") { return result; } else if (result.status === "dirty" && !dirty) { @@ -2331,17 +2589,14 @@ class ZodUnion extends ZodType { ctx: childCtx }; } - if (childCtx.common.issues.length) { issues.push(childCtx.common.issues); } } - if (dirty) { ctx.common.issues.push(...dirty.ctx.common.issues); return dirty.result; } - const unionErrors = issues.map(issues => new ZodError_1.ZodError(issues)); (0, parseUtil_1.addIssueToContext)(ctx, { code: ZodError_1.ZodIssueCode.invalid_union, @@ -2350,15 +2605,11 @@ class ZodUnion extends ZodType { return parseUtil_1.INVALID; } } - get options() { return this._def.options; } - } - exports.ZodUnion = ZodUnion; - ZodUnion.create = (types, params) => { return new ZodUnion({ options: types, @@ -2366,35 +2617,51 @@ ZodUnion.create = (types, params) => { ...processCreateParams(params) }); }; - +const getDiscriminator = type => { + if (type instanceof ZodLazy) { + return getDiscriminator(type.schema); + } else if (type instanceof ZodEffects) { + return getDiscriminator(type.innerType()); + } else if (type instanceof ZodLiteral) { + return [type.value]; + } else if (type instanceof ZodEnum) { + return type.options; + } else if (type instanceof ZodNativeEnum) { + return Object.keys(type.enum); + } else if (type instanceof ZodDefault) { + return getDiscriminator(type._def.innerType); + } else if (type instanceof ZodUndefined) { + return [undefined]; + } else if (type instanceof ZodNull) { + return [null]; + } else { + return null; + } +}; class ZodDiscriminatedUnion extends ZodType { _parse(input) { const { ctx } = this._processInputParams(input); - - if (ctx.parsedType !== parseUtil_1.ZodParsedType.object) { + if (ctx.parsedType !== util_1.ZodParsedType.object) { (0, parseUtil_1.addIssueToContext)(ctx, { code: ZodError_1.ZodIssueCode.invalid_type, - expected: parseUtil_1.ZodParsedType.object, + expected: util_1.ZodParsedType.object, received: ctx.parsedType }); return parseUtil_1.INVALID; } - const discriminator = this.discriminator; const discriminatorValue = ctx.data[discriminator]; - const option = this.options.get(discriminatorValue); - + const option = this.optionsMap.get(discriminatorValue); if (!option) { (0, parseUtil_1.addIssueToContext)(ctx, { code: ZodError_1.ZodIssueCode.invalid_union_discriminator, - options: this.validDiscriminatorValues, + options: Array.from(this.optionsMap.keys()), path: [discriminator] }); return parseUtil_1.INVALID; } - if (ctx.common.async) { return option._parseAsync({ data: ctx.data, @@ -2409,118 +2676,90 @@ class ZodDiscriminatedUnion extends ZodType { }); } } - get discriminator() { return this._def.discriminator; } - - get validDiscriminatorValues() { - return Array.from(this.options.keys()); - } - get options() { return this._def.options; } - /** - * The constructor of the discriminated union schema. Its behaviour is very similar to that of the normal z.union() constructor. - * However, it only allows a union of objects, all of which need to share a discriminator property. This property must - * have a different value for each object in the union. - * @param discriminator the name of the discriminator property - * @param types an array of object schemas - * @param params - */ - - - static create(discriminator, types, params) { - // Get all the valid discriminator values - const options = new Map(); - - try { - types.forEach(type => { - const discriminatorValue = type.shape[discriminator].value; - options.set(discriminatorValue, type); - }); - } catch (e) { - throw new Error("The discriminator value could not be extracted from all the provided schemas"); - } // Assert that all the discriminator values are unique - - - if (options.size !== types.length) { - throw new Error("Some of the discriminator values are not unique"); + get optionsMap() { + return this._def.optionsMap; + } + static create(discriminator, options, params) { + const optionsMap = new Map(); + for (const type of options) { + const discriminatorValues = getDiscriminator(type.shape[discriminator]); + if (!discriminatorValues) { + throw new Error(`A discriminator value for key \`${discriminator}\` could not be extracted from all schema options`); + } + for (const value of discriminatorValues) { + if (optionsMap.has(value)) { + throw new Error(`Discriminator property ${String(discriminator)} has duplicate value ${String(value)}`); + } + optionsMap.set(value, type); + } } - return new ZodDiscriminatedUnion({ typeName: ZodFirstPartyTypeKind.ZodDiscriminatedUnion, discriminator, options, + optionsMap, ...processCreateParams(params) }); } - } - exports.ZodDiscriminatedUnion = ZodDiscriminatedUnion; - function mergeValues(a, b) { - const aType = (0, parseUtil_1.getParsedType)(a); - const bType = (0, parseUtil_1.getParsedType)(b); - + const aType = (0, util_1.getParsedType)(a); + const bType = (0, util_1.getParsedType)(b); if (a === b) { return { valid: true, data: a }; - } else if (aType === parseUtil_1.ZodParsedType.object && bType === parseUtil_1.ZodParsedType.object) { + } else if (aType === util_1.ZodParsedType.object && bType === util_1.ZodParsedType.object) { const bKeys = util_1.util.objectKeys(b); const sharedKeys = util_1.util.objectKeys(a).filter(key => bKeys.indexOf(key) !== -1); - const newObj = { ...a, + const newObj = { + ...a, ...b }; - for (const key of sharedKeys) { const sharedValue = mergeValues(a[key], b[key]); - if (!sharedValue.valid) { return { valid: false }; } - newObj[key] = sharedValue.data; } - return { valid: true, data: newObj }; - } else if (aType === parseUtil_1.ZodParsedType.array && bType === parseUtil_1.ZodParsedType.array) { + } else if (aType === util_1.ZodParsedType.array && bType === util_1.ZodParsedType.array) { if (a.length !== b.length) { return { valid: false }; } - const newArray = []; - for (let index = 0; index < a.length; index++) { const itemA = a[index]; const itemB = b[index]; const sharedValue = mergeValues(itemA, itemB); - if (!sharedValue.valid) { return { valid: false }; } - newArray.push(sharedValue.data); } - return { valid: true, data: newArray }; - } else if (aType === parseUtil_1.ZodParsedType.date && bType === parseUtil_1.ZodParsedType.date && +a === +b) { + } else if (aType === util_1.ZodParsedType.date && bType === util_1.ZodParsedType.date && +a === +b) { return { valid: true, data: a @@ -2531,38 +2770,31 @@ function mergeValues(a, b) { }; } } - class ZodIntersection extends ZodType { _parse(input) { const { status, ctx } = this._processInputParams(input); - const handleParsed = (parsedLeft, parsedRight) => { if ((0, parseUtil_1.isAborted)(parsedLeft) || (0, parseUtil_1.isAborted)(parsedRight)) { return parseUtil_1.INVALID; } - const merged = mergeValues(parsedLeft.value, parsedRight.value); - if (!merged.valid) { (0, parseUtil_1.addIssueToContext)(ctx, { code: ZodError_1.ZodIssueCode.invalid_intersection_types }); return parseUtil_1.INVALID; } - if ((0, parseUtil_1.isDirty)(parsedLeft) || (0, parseUtil_1.isDirty)(parsedRight)) { status.dirty(); } - return { status: status.value, value: merged.data }; }; - if (ctx.common.async) { return Promise.all([this._def.left._parseAsync({ data: ctx.data, @@ -2588,11 +2820,8 @@ class ZodIntersection extends ZodType { })); } } - } - exports.ZodIntersection = ZodIntersection; - ZodIntersection.create = (left, right, params) => { return new ZodIntersection({ left: left, @@ -2601,51 +2830,46 @@ ZodIntersection.create = (left, right, params) => { ...processCreateParams(params) }); }; - class ZodTuple extends ZodType { _parse(input) { const { status, ctx } = this._processInputParams(input); - - if (ctx.parsedType !== parseUtil_1.ZodParsedType.array) { + if (ctx.parsedType !== util_1.ZodParsedType.array) { (0, parseUtil_1.addIssueToContext)(ctx, { code: ZodError_1.ZodIssueCode.invalid_type, - expected: parseUtil_1.ZodParsedType.array, + expected: util_1.ZodParsedType.array, received: ctx.parsedType }); return parseUtil_1.INVALID; } - if (ctx.data.length < this._def.items.length) { (0, parseUtil_1.addIssueToContext)(ctx, { code: ZodError_1.ZodIssueCode.too_small, minimum: this._def.items.length, inclusive: true, + exact: false, type: "array" }); return parseUtil_1.INVALID; } - const rest = this._def.rest; - if (!rest && ctx.data.length > this._def.items.length) { (0, parseUtil_1.addIssueToContext)(ctx, { code: ZodError_1.ZodIssueCode.too_big, maximum: this._def.items.length, inclusive: true, + exact: false, type: "array" }); status.dirty(); } - - const items = ctx.data.map((item, itemIndex) => { + const items = [...ctx.data].map((item, itemIndex) => { const schema = this._def.items[itemIndex] || this._def.rest; if (!schema) return null; return schema._parse(new ParseInputLazyPath(ctx, item, ctx.path, itemIndex)); - }).filter(x => !!x); // filter nulls - + }).filter(x => !!x); if (ctx.common.async) { return Promise.all(items).then(results => { return parseUtil_1.ParseStatus.mergeArray(status, results); @@ -2654,22 +2878,21 @@ class ZodTuple extends ZodType { return parseUtil_1.ParseStatus.mergeArray(status, items); } } - get items() { return this._def.items; } - rest(rest) { - return new ZodTuple({ ...this._def, + return new ZodTuple({ + ...this._def, rest }); } - } - exports.ZodTuple = ZodTuple; - ZodTuple.create = (schemas, params) => { + if (!Array.isArray(schemas)) { + throw new Error("You must pass an array of schemas to z.tuple([ ... ])"); + } return new ZodTuple({ items: schemas, typeName: ZodFirstPartyTypeKind.ZodTuple, @@ -2677,53 +2900,44 @@ ZodTuple.create = (schemas, params) => { ...processCreateParams(params) }); }; - class ZodRecord extends ZodType { get keySchema() { return this._def.keyType; } - get valueSchema() { return this._def.valueType; } - _parse(input) { const { status, ctx } = this._processInputParams(input); - - if (ctx.parsedType !== parseUtil_1.ZodParsedType.object) { + if (ctx.parsedType !== util_1.ZodParsedType.object) { (0, parseUtil_1.addIssueToContext)(ctx, { code: ZodError_1.ZodIssueCode.invalid_type, - expected: parseUtil_1.ZodParsedType.object, + expected: util_1.ZodParsedType.object, received: ctx.parsedType }); return parseUtil_1.INVALID; } - const pairs = []; const keyType = this._def.keyType; const valueType = this._def.valueType; - for (const key in ctx.data) { pairs.push({ key: keyType._parse(new ParseInputLazyPath(ctx, key, ctx.path, key)), value: valueType._parse(new ParseInputLazyPath(ctx, ctx.data[key], ctx.path, key)) }); } - if (ctx.common.async) { return parseUtil_1.ParseStatus.mergeObjectAsync(status, pairs); } else { return parseUtil_1.ParseStatus.mergeObjectSync(status, pairs); } } - get element() { return this._def.valueType; } - static create(first, second, third) { if (second instanceof ZodType) { return new ZodRecord({ @@ -2733,7 +2947,6 @@ class ZodRecord extends ZodType { ...processCreateParams(third) }); } - return new ZodRecord({ keyType: ZodString.create(), valueType: first, @@ -2741,27 +2954,28 @@ class ZodRecord extends ZodType { ...processCreateParams(second) }); } - } - exports.ZodRecord = ZodRecord; - class ZodMap extends ZodType { + get keySchema() { + return this._def.keyType; + } + get valueSchema() { + return this._def.valueType; + } _parse(input) { const { status, ctx } = this._processInputParams(input); - - if (ctx.parsedType !== parseUtil_1.ZodParsedType.map) { + if (ctx.parsedType !== util_1.ZodParsedType.map) { (0, parseUtil_1.addIssueToContext)(ctx, { code: ZodError_1.ZodIssueCode.invalid_type, - expected: parseUtil_1.ZodParsedType.map, + expected: util_1.ZodParsedType.map, received: ctx.parsedType }); return parseUtil_1.INVALID; } - const keyType = this._def.keyType; const valueType = this._def.valueType; const pairs = [...ctx.data.entries()].map((_ref2, index) => { @@ -2771,25 +2985,20 @@ class ZodMap extends ZodType { value: valueType._parse(new ParseInputLazyPath(ctx, value, ctx.path, [index, "value"])) }; }); - if (ctx.common.async) { const finalMap = new Map(); return Promise.resolve().then(async () => { for (const pair of pairs) { const key = await pair.key; const value = await pair.value; - if (key.status === "aborted" || value.status === "aborted") { return parseUtil_1.INVALID; } - if (key.status === "dirty" || value.status === "dirty") { status.dirty(); } - finalMap.set(key.value, value.value); } - return { status: status.value, value: finalMap @@ -2797,33 +3006,25 @@ class ZodMap extends ZodType { }); } else { const finalMap = new Map(); - for (const pair of pairs) { const key = pair.key; const value = pair.value; - if (key.status === "aborted" || value.status === "aborted") { return parseUtil_1.INVALID; } - if (key.status === "dirty" || value.status === "dirty") { status.dirty(); } - finalMap.set(key.value, value.value); } - return { status: status.value, value: finalMap }; } } - } - exports.ZodMap = ZodMap; - ZodMap.create = (keyType, valueType, params) => { return new ZodMap({ valueType, @@ -2832,25 +3033,21 @@ ZodMap.create = (keyType, valueType, params) => { ...processCreateParams(params) }); }; - class ZodSet extends ZodType { _parse(input) { const { status, ctx } = this._processInputParams(input); - - if (ctx.parsedType !== parseUtil_1.ZodParsedType.set) { + if (ctx.parsedType !== util_1.ZodParsedType.set) { (0, parseUtil_1.addIssueToContext)(ctx, { code: ZodError_1.ZodIssueCode.invalid_type, - expected: parseUtil_1.ZodParsedType.set, + expected: util_1.ZodParsedType.set, received: ctx.parsedType }); return parseUtil_1.INVALID; } - const def = this._def; - if (def.minSize !== null) { if (ctx.data.size < def.minSize.value) { (0, parseUtil_1.addIssueToContext)(ctx, { @@ -2858,12 +3055,12 @@ class ZodSet extends ZodType { minimum: def.minSize.value, type: "set", inclusive: true, + exact: false, message: def.minSize.message }); status.dirty(); } } - if (def.maxSize !== null) { if (ctx.data.size > def.maxSize.value) { (0, parseUtil_1.addIssueToContext)(ctx, { @@ -2871,68 +3068,58 @@ class ZodSet extends ZodType { maximum: def.maxSize.value, type: "set", inclusive: true, + exact: false, message: def.maxSize.message }); status.dirty(); } } - const valueType = this._def.valueType; - function finalizeSet(elements) { const parsedSet = new Set(); - for (const element of elements) { if (element.status === "aborted") return parseUtil_1.INVALID; if (element.status === "dirty") status.dirty(); parsedSet.add(element.value); } - return { status: status.value, value: parsedSet }; } - const elements = [...ctx.data.values()].map((item, i) => valueType._parse(new ParseInputLazyPath(ctx, item, ctx.path, i))); - if (ctx.common.async) { return Promise.all(elements).then(elements => finalizeSet(elements)); } else { return finalizeSet(elements); } } - min(minSize, message) { - return new ZodSet({ ...this._def, + return new ZodSet({ + ...this._def, minSize: { value: minSize, message: errorUtil_1.errorUtil.toString(message) } }); } - max(maxSize, message) { - return new ZodSet({ ...this._def, + return new ZodSet({ + ...this._def, maxSize: { value: maxSize, message: errorUtil_1.errorUtil.toString(message) } }); } - size(size, message) { return this.min(size, message).max(size, message); } - nonempty(message) { return this.min(1, message); } - } - exports.ZodSet = ZodSet; - ZodSet.create = (valueType, params) => { return new ZodSet({ valueType, @@ -2942,171 +3129,142 @@ ZodSet.create = (valueType, params) => { ...processCreateParams(params) }); }; - class ZodFunction extends ZodType { constructor() { super(...arguments); this.validate = this.implement; } - _parse(input) { - var _this = this; - const { ctx } = this._processInputParams(input); - - if (ctx.parsedType !== parseUtil_1.ZodParsedType.function) { + if (ctx.parsedType !== util_1.ZodParsedType.function) { (0, parseUtil_1.addIssueToContext)(ctx, { code: ZodError_1.ZodIssueCode.invalid_type, - expected: parseUtil_1.ZodParsedType.function, + expected: util_1.ZodParsedType.function, received: ctx.parsedType }); return parseUtil_1.INVALID; } - function makeArgsIssue(args, error) { return (0, parseUtil_1.makeIssue)({ data: args, path: ctx.path, - errorMaps: [ctx.common.contextualErrorMap, ctx.schemaErrorMap, ZodError_1.overrideErrorMap, ZodError_1.defaultErrorMap].filter(x => !!x), + errorMaps: [ctx.common.contextualErrorMap, ctx.schemaErrorMap, (0, errors_1.getErrorMap)(), errors_1.defaultErrorMap].filter(x => !!x), issueData: { code: ZodError_1.ZodIssueCode.invalid_arguments, argumentsError: error } }); } - function makeReturnsIssue(returns, error) { return (0, parseUtil_1.makeIssue)({ data: returns, path: ctx.path, - errorMaps: [ctx.common.contextualErrorMap, ctx.schemaErrorMap, ZodError_1.overrideErrorMap, ZodError_1.defaultErrorMap].filter(x => !!x), + errorMaps: [ctx.common.contextualErrorMap, ctx.schemaErrorMap, (0, errors_1.getErrorMap)(), errors_1.defaultErrorMap].filter(x => !!x), issueData: { code: ZodError_1.ZodIssueCode.invalid_return_type, returnTypeError: error } }); } - const params = { errorMap: ctx.common.contextualErrorMap }; const fn = ctx.data; - if (this._def.returns instanceof ZodPromise) { + const me = this; return (0, parseUtil_1.OK)(async function () { for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } - const error = new ZodError_1.ZodError([]); - const parsedArgs = await _this._def.args.parseAsync(args, params).catch(e => { + const parsedArgs = await me._def.args.parseAsync(args, params).catch(e => { error.addIssue(makeArgsIssue(args, e)); throw error; }); - const result = await fn(...parsedArgs); - const parsedReturns = await _this._def.returns._def.type.parseAsync(result, params).catch(e => { + const result = await Reflect.apply(fn, this, parsedArgs); + const parsedReturns = await me._def.returns._def.type.parseAsync(result, params).catch(e => { error.addIssue(makeReturnsIssue(result, e)); throw error; }); return parsedReturns; }); } else { + const me = this; return (0, parseUtil_1.OK)(function () { for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { args[_key2] = arguments[_key2]; } - - const parsedArgs = _this._def.args.safeParse(args, params); - + const parsedArgs = me._def.args.safeParse(args, params); if (!parsedArgs.success) { throw new ZodError_1.ZodError([makeArgsIssue(args, parsedArgs.error)]); } - - const result = fn(...parsedArgs.data); - - const parsedReturns = _this._def.returns.safeParse(result, params); - + const result = Reflect.apply(fn, this, parsedArgs.data); + const parsedReturns = me._def.returns.safeParse(result, params); if (!parsedReturns.success) { throw new ZodError_1.ZodError([makeReturnsIssue(result, parsedReturns.error)]); } - return parsedReturns.data; }); } } - parameters() { return this._def.args; } - returnType() { return this._def.returns; } - args() { for (var _len3 = arguments.length, items = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { items[_key3] = arguments[_key3]; } - - return new ZodFunction({ ...this._def, + return new ZodFunction({ + ...this._def, args: ZodTuple.create(items).rest(ZodUnknown.create()) }); } - returns(returnType) { - return new ZodFunction({ ...this._def, + return new ZodFunction({ + ...this._def, returns: returnType }); } - implement(func) { const validatedFunc = this.parse(func); return validatedFunc; } - strictImplement(func) { const validatedFunc = this.parse(func); return validatedFunc; } - + static create(args, returns, params) { + return new ZodFunction({ + args: args ? args : ZodTuple.create([]).rest(ZodUnknown.create()), + returns: returns || ZodUnknown.create(), + typeName: ZodFirstPartyTypeKind.ZodFunction, + ...processCreateParams(params) + }); + } } - exports.ZodFunction = ZodFunction; - -ZodFunction.create = (args, returns, params) => { - return new ZodFunction({ - args: args ? args.rest(ZodUnknown.create()) : ZodTuple.create([]).rest(ZodUnknown.create()), - returns: returns || ZodUnknown.create(), - typeName: ZodFirstPartyTypeKind.ZodFunction, - ...processCreateParams(params) - }); -}; - class ZodLazy extends ZodType { get schema() { return this._def.getter(); } - _parse(input) { const { ctx } = this._processInputParams(input); - const lazySchema = this._def.getter(); - return lazySchema._parse({ data: ctx.data, path: ctx.path, parent: ctx }); } - } - exports.ZodLazy = ZodLazy; - ZodLazy.create = (getter, params) => { return new ZodLazy({ getter: getter, @@ -3114,33 +3272,27 @@ ZodLazy.create = (getter, params) => { ...processCreateParams(params) }); }; - class ZodLiteral extends ZodType { _parse(input) { if (input.data !== this._def.value) { const ctx = this._getOrReturnCtx(input); - (0, parseUtil_1.addIssueToContext)(ctx, { + received: ctx.data, code: ZodError_1.ZodIssueCode.invalid_literal, expected: this._def.value }); return parseUtil_1.INVALID; } - return { status: "valid", value: input.data }; } - get value() { return this._def.value; } - } - exports.ZodLiteral = ZodLiteral; - ZodLiteral.create = (value, params) => { return new ZodLiteral({ value: value, @@ -3148,19 +3300,17 @@ ZodLiteral.create = (value, params) => { ...processCreateParams(params) }); }; - -function createZodEnum(values) { +function createZodEnum(values, params) { return new ZodEnum({ - values: values, - typeName: ZodFirstPartyTypeKind.ZodEnum + values, + typeName: ZodFirstPartyTypeKind.ZodEnum, + ...processCreateParams(params) }); } - class ZodEnum extends ZodType { _parse(input) { if (typeof input.data !== "string") { const ctx = this._getOrReturnCtx(input); - const expectedValues = this._def.values; (0, parseUtil_1.addIssueToContext)(ctx, { expected: util_1.util.joinValues(expectedValues), @@ -3169,10 +3319,8 @@ class ZodEnum extends ZodType { }); return parseUtil_1.INVALID; } - if (this._def.values.indexOf(input.data) === -1) { const ctx = this._getOrReturnCtx(input); - const expectedValues = this._def.values; (0, parseUtil_1.addIssueToContext)(ctx, { received: ctx.data, @@ -3181,56 +3329,46 @@ class ZodEnum extends ZodType { }); return parseUtil_1.INVALID; } - return (0, parseUtil_1.OK)(input.data); } - get options() { return this._def.values; } - get enum() { const enumValues = {}; - for (const val of this._def.values) { enumValues[val] = val; } - return enumValues; } - get Values() { const enumValues = {}; - for (const val of this._def.values) { enumValues[val] = val; } - return enumValues; } - get Enum() { const enumValues = {}; - for (const val of this._def.values) { enumValues[val] = val; } - return enumValues; } - + extract(values) { + return ZodEnum.create(values); + } + exclude(values) { + return ZodEnum.create(this.options.filter(opt => !values.includes(opt))); + } } - exports.ZodEnum = ZodEnum; ZodEnum.create = createZodEnum; - class ZodNativeEnum extends ZodType { _parse(input) { const nativeEnumValues = util_1.util.getValidEnumValues(this._def.values); - const ctx = this._getOrReturnCtx(input); - - if (ctx.parsedType !== parseUtil_1.ZodParsedType.string && ctx.parsedType !== parseUtil_1.ZodParsedType.number) { + if (ctx.parsedType !== util_1.ZodParsedType.string && ctx.parsedType !== util_1.ZodParsedType.number) { const expectedValues = util_1.util.objectValues(nativeEnumValues); (0, parseUtil_1.addIssueToContext)(ctx, { expected: util_1.util.joinValues(expectedValues), @@ -3239,7 +3377,6 @@ class ZodNativeEnum extends ZodType { }); return parseUtil_1.INVALID; } - if (nativeEnumValues.indexOf(input.data) === -1) { const expectedValues = util_1.util.objectValues(nativeEnumValues); (0, parseUtil_1.addIssueToContext)(ctx, { @@ -3249,18 +3386,13 @@ class ZodNativeEnum extends ZodType { }); return parseUtil_1.INVALID; } - return (0, parseUtil_1.OK)(input.data); } - get enum() { return this._def.values; } - } - exports.ZodNativeEnum = ZodNativeEnum; - ZodNativeEnum.create = (values, params) => { return new ZodNativeEnum({ values: values, @@ -3268,23 +3400,23 @@ ZodNativeEnum.create = (values, params) => { ...processCreateParams(params) }); }; - class ZodPromise extends ZodType { + unwrap() { + return this._def.type; + } _parse(input) { const { ctx } = this._processInputParams(input); - - if (ctx.parsedType !== parseUtil_1.ZodParsedType.promise && ctx.common.async === false) { + if (ctx.parsedType !== util_1.ZodParsedType.promise && ctx.common.async === false) { (0, parseUtil_1.addIssueToContext)(ctx, { code: ZodError_1.ZodIssueCode.invalid_type, - expected: parseUtil_1.ZodParsedType.promise, + expected: util_1.ZodParsedType.promise, received: ctx.parsedType }); return parseUtil_1.INVALID; } - - const promisified = ctx.parsedType === parseUtil_1.ZodParsedType.promise ? ctx.data : Promise.resolve(ctx.data); + const promisified = ctx.parsedType === util_1.ZodParsedType.promise ? ctx.data : Promise.resolve(ctx.data); return (0, parseUtil_1.OK)(promisified.then(data => { return this._def.type.parseAsync(data, { path: ctx.path, @@ -3292,11 +3424,8 @@ class ZodPromise extends ZodType { }); })); } - } - exports.ZodPromise = ZodPromise; - ZodPromise.create = (schema, params) => { return new ZodPromise({ type: schema, @@ -3304,23 +3433,41 @@ ZodPromise.create = (schema, params) => { ...processCreateParams(params) }); }; - class ZodEffects extends ZodType { innerType() { return this._def.schema; } - + sourceType() { + return this._def.schema._def.typeName === ZodFirstPartyTypeKind.ZodEffects ? this._def.schema.sourceType() : this._def.schema; + } _parse(input) { const { status, ctx } = this._processInputParams(input); - const effect = this._def.effect || null; - + const checkCtx = { + addIssue: arg => { + (0, parseUtil_1.addIssueToContext)(ctx, arg); + if (arg.fatal) { + status.abort(); + } else { + status.dirty(); + } + }, + get path() { + return ctx.path; + } + }; + checkCtx.addIssue = checkCtx.addIssue.bind(checkCtx); if (effect.type === "preprocess") { - const processed = effect.transform(ctx.data); - + const processed = effect.transform(ctx.data, checkCtx); + if (ctx.common.issues.length) { + return { + status: "dirty", + value: ctx.data + }; + } if (ctx.common.async) { return Promise.resolve(processed).then(processed => { return this._def.schema._parseAsync({ @@ -3337,51 +3484,25 @@ class ZodEffects extends ZodType { }); } } - - const checkCtx = { - addIssue: arg => { - (0, parseUtil_1.addIssueToContext)(ctx, arg); - - if (arg.fatal) { - status.abort(); - } else { - status.dirty(); - } - }, - - get path() { - return ctx.path; - } - - }; - checkCtx.addIssue = checkCtx.addIssue.bind(checkCtx); - if (effect.type === "refinement") { - const executeRefinement = (acc // effect: RefinementEffect - ) => { + const executeRefinement = acc => { const result = effect.refinement(acc, checkCtx); - if (ctx.common.async) { return Promise.resolve(result); } - if (result instanceof Promise) { throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead."); } - return acc; }; - if (ctx.common.async === false) { const inner = this._def.schema._parseSync({ data: ctx.data, path: ctx.path, parent: ctx }); - if (inner.status === "aborted") return parseUtil_1.INVALID; - if (inner.status === "dirty") status.dirty(); // return value is ignored - + if (inner.status === "dirty") status.dirty(); executeRefinement(inner.value); return { status: status.value, @@ -3404,26 +3525,18 @@ class ZodEffects extends ZodType { }); } } - if (effect.type === "transform") { if (ctx.common.async === false) { const base = this._def.schema._parseSync({ data: ctx.data, path: ctx.path, parent: ctx - }); // if (base.status === "aborted") return INVALID; - // if (base.status === "dirty") { - // return { status: "dirty", value: base.value }; - // } - - + }); if (!(0, parseUtil_1.isValid)(base)) return base; const result = effect.transform(base.value, checkCtx); - if (result instanceof Promise) { - throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead."); + throw new Error(`Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.`); } - return { status: status.value, value: result @@ -3434,11 +3547,7 @@ class ZodEffects extends ZodType { path: ctx.path, parent: ctx }).then(base => { - if (!(0, parseUtil_1.isValid)(base)) return base; // if (base.status === "aborted") return INVALID; - // if (base.status === "dirty") { - // return { status: "dirty", value: base.value }; - // } - + if (!(0, parseUtil_1.isValid)(base)) return base; return Promise.resolve(effect.transform(base.value, checkCtx)).then(result => ({ status: status.value, value: result @@ -3446,15 +3555,11 @@ class ZodEffects extends ZodType { }); } } - util_1.util.assertNever(effect); } - } - exports.ZodEffects = ZodEffects; exports.ZodTransformer = ZodEffects; - ZodEffects.create = (schema, effect, params) => { return new ZodEffects({ schema, @@ -3463,7 +3568,6 @@ ZodEffects.create = (schema, effect, params) => { ...processCreateParams(params) }); }; - ZodEffects.createWithPreprocess = (preprocess, schema, params) => { return new ZodEffects({ schema, @@ -3475,26 +3579,19 @@ ZodEffects.createWithPreprocess = (preprocess, schema, params) => { ...processCreateParams(params) }); }; - class ZodOptional extends ZodType { _parse(input) { const parsedType = this._getType(input); - - if (parsedType === parseUtil_1.ZodParsedType.undefined) { + if (parsedType === util_1.ZodParsedType.undefined) { return (0, parseUtil_1.OK)(undefined); } - return this._def.innerType._parse(input); } - unwrap() { return this._def.innerType; } - } - exports.ZodOptional = ZodOptional; - ZodOptional.create = (type, params) => { return new ZodOptional({ innerType: type, @@ -3502,26 +3599,19 @@ ZodOptional.create = (type, params) => { ...processCreateParams(params) }); }; - class ZodNullable extends ZodType { _parse(input) { const parsedType = this._getType(input); - - if (parsedType === parseUtil_1.ZodParsedType.null) { + if (parsedType === util_1.ZodParsedType.null) { return (0, parseUtil_1.OK)(null); } - return this._def.innerType._parse(input); } - unwrap() { return this._def.innerType; } - } - exports.ZodNullable = ZodNullable; - ZodNullable.create = (type, params) => { return new ZodNullable({ innerType: type, @@ -3529,85 +3619,234 @@ ZodNullable.create = (type, params) => { ...processCreateParams(params) }); }; - class ZodDefault extends ZodType { _parse(input) { const { ctx } = this._processInputParams(input); - let data = ctx.data; - - if (ctx.parsedType === parseUtil_1.ZodParsedType.undefined) { + if (ctx.parsedType === util_1.ZodParsedType.undefined) { data = this._def.defaultValue(); } - return this._def.innerType._parse({ data, path: ctx.path, parent: ctx }); } - removeDefault() { return this._def.innerType; } - } - exports.ZodDefault = ZodDefault; - ZodDefault.create = (type, params) => { - return new ZodOptional({ + return new ZodDefault({ innerType: type, - typeName: ZodFirstPartyTypeKind.ZodOptional, + typeName: ZodFirstPartyTypeKind.ZodDefault, + defaultValue: typeof params.default === "function" ? params.default : () => params.default, + ...processCreateParams(params) + }); +}; +class ZodCatch extends ZodType { + _parse(input) { + const { + ctx + } = this._processInputParams(input); + const newCtx = { + ...ctx, + common: { + ...ctx.common, + issues: [] + } + }; + const result = this._def.innerType._parse({ + data: newCtx.data, + path: newCtx.path, + parent: { + ...newCtx + } + }); + if ((0, parseUtil_1.isAsync)(result)) { + return result.then(result => { + return { + status: "valid", + value: result.status === "valid" ? result.value : this._def.catchValue({ + get error() { + return new ZodError_1.ZodError(newCtx.common.issues); + }, + input: newCtx.data + }) + }; + }); + } else { + return { + status: "valid", + value: result.status === "valid" ? result.value : this._def.catchValue({ + get error() { + return new ZodError_1.ZodError(newCtx.common.issues); + }, + input: newCtx.data + }) + }; + } + } + removeCatch() { + return this._def.innerType; + } +} +exports.ZodCatch = ZodCatch; +ZodCatch.create = (type, params) => { + return new ZodCatch({ + innerType: type, + typeName: ZodFirstPartyTypeKind.ZodCatch, + catchValue: typeof params.catch === "function" ? params.catch : () => params.catch, ...processCreateParams(params) }); }; - class ZodNaN extends ZodType { _parse(input) { const parsedType = this._getType(input); - - if (parsedType !== parseUtil_1.ZodParsedType.nan) { + if (parsedType !== util_1.ZodParsedType.nan) { const ctx = this._getOrReturnCtx(input); - (0, parseUtil_1.addIssueToContext)(ctx, { code: ZodError_1.ZodIssueCode.invalid_type, - expected: parseUtil_1.ZodParsedType.nan, + expected: util_1.ZodParsedType.nan, received: ctx.parsedType }); return parseUtil_1.INVALID; } - return { status: "valid", value: input.data }; } - } - exports.ZodNaN = ZodNaN; - ZodNaN.create = params => { return new ZodNaN({ typeName: ZodFirstPartyTypeKind.ZodNaN, ...processCreateParams(params) }); }; - -const custom = (check, params) => { - if (check) return ZodAny.create().refine(check, params); +exports.BRAND = Symbol("zod_brand"); +class ZodBranded extends ZodType { + _parse(input) { + const { + ctx + } = this._processInputParams(input); + const data = ctx.data; + return this._def.type._parse({ + data, + path: ctx.path, + parent: ctx + }); + } + unwrap() { + return this._def.type; + } +} +exports.ZodBranded = ZodBranded; +class ZodPipeline extends ZodType { + _parse(input) { + const { + status, + ctx + } = this._processInputParams(input); + if (ctx.common.async) { + const handleAsync = async () => { + const inResult = await this._def.in._parseAsync({ + data: ctx.data, + path: ctx.path, + parent: ctx + }); + if (inResult.status === "aborted") return parseUtil_1.INVALID; + if (inResult.status === "dirty") { + status.dirty(); + return (0, parseUtil_1.DIRTY)(inResult.value); + } else { + return this._def.out._parseAsync({ + data: inResult.value, + path: ctx.path, + parent: ctx + }); + } + }; + return handleAsync(); + } else { + const inResult = this._def.in._parseSync({ + data: ctx.data, + path: ctx.path, + parent: ctx + }); + if (inResult.status === "aborted") return parseUtil_1.INVALID; + if (inResult.status === "dirty") { + status.dirty(); + return { + status: "dirty", + value: inResult.value + }; + } else { + return this._def.out._parseSync({ + data: inResult.value, + path: ctx.path, + parent: ctx + }); + } + } + } + static create(a, b) { + return new ZodPipeline({ + in: a, + out: b, + typeName: ZodFirstPartyTypeKind.ZodPipeline + }); + } +} +exports.ZodPipeline = ZodPipeline; +class ZodReadonly extends ZodType { + _parse(input) { + const result = this._def.innerType._parse(input); + if ((0, parseUtil_1.isValid)(result)) { + result.value = Object.freeze(result.value); + } + return result; + } +} +exports.ZodReadonly = ZodReadonly; +ZodReadonly.create = (type, params) => { + return new ZodReadonly({ + innerType: type, + typeName: ZodFirstPartyTypeKind.ZodReadonly, + ...processCreateParams(params) + }); +}; +const custom = function (check) { + let params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + let fatal = arguments.length > 2 ? arguments[2] : undefined; + if (check) return ZodAny.create().superRefine((data, ctx) => { + var _a, _b; + if (!check(data)) { + const p = typeof params === "function" ? params(data) : typeof params === "string" ? { + message: params + } : params; + const _fatal = (_b = (_a = p.fatal) !== null && _a !== void 0 ? _a : fatal) !== null && _b !== void 0 ? _b : true; + const p2 = typeof p === "string" ? { + message: p + } : p; + ctx.addIssue({ + code: "custom", + ...p2, + fatal: _fatal + }); + } + }); return ZodAny.create(); }; - exports.custom = custom; exports.late = { object: ZodObject.lazycreate }; var ZodFirstPartyTypeKind; - (function (ZodFirstPartyTypeKind) { ZodFirstPartyTypeKind["ZodString"] = "ZodString"; ZodFirstPartyTypeKind["ZodNumber"] = "ZodNumber"; @@ -3615,6 +3854,7 @@ var ZodFirstPartyTypeKind; ZodFirstPartyTypeKind["ZodBigInt"] = "ZodBigInt"; ZodFirstPartyTypeKind["ZodBoolean"] = "ZodBoolean"; ZodFirstPartyTypeKind["ZodDate"] = "ZodDate"; + ZodFirstPartyTypeKind["ZodSymbol"] = "ZodSymbol"; ZodFirstPartyTypeKind["ZodUndefined"] = "ZodUndefined"; ZodFirstPartyTypeKind["ZodNull"] = "ZodNull"; ZodFirstPartyTypeKind["ZodAny"] = "ZodAny"; @@ -3639,16 +3879,21 @@ var ZodFirstPartyTypeKind; ZodFirstPartyTypeKind["ZodOptional"] = "ZodOptional"; ZodFirstPartyTypeKind["ZodNullable"] = "ZodNullable"; ZodFirstPartyTypeKind["ZodDefault"] = "ZodDefault"; + ZodFirstPartyTypeKind["ZodCatch"] = "ZodCatch"; ZodFirstPartyTypeKind["ZodPromise"] = "ZodPromise"; + ZodFirstPartyTypeKind["ZodBranded"] = "ZodBranded"; + ZodFirstPartyTypeKind["ZodPipeline"] = "ZodPipeline"; + ZodFirstPartyTypeKind["ZodReadonly"] = "ZodReadonly"; })(ZodFirstPartyTypeKind = exports.ZodFirstPartyTypeKind || (exports.ZodFirstPartyTypeKind = {})); - +class Class { + constructor() {} +} const instanceOfType = function (cls) { let params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : { - message: "Input not instance of ".concat(cls.name) + message: `Input not instance of ${cls.name}` }; return (0, exports.custom)(data => data instanceof cls, params); }; - exports.instanceof = instanceOfType; const stringType = ZodString.create; exports.string = stringType; @@ -3662,6 +3907,8 @@ const booleanType = ZodBoolean.create; exports.boolean = booleanType; const dateType = ZodDate.create; exports.date = dateType; +const symbolType = ZodSymbol.create; +exports.symbol = symbolType; const undefinedType = ZodUndefined.create; exports.undefined = undefinedType; const nullType = ZodNull.create; @@ -3715,20 +3962,39 @@ const nullableType = ZodNullable.create; exports.nullable = nullableType; const preprocessType = ZodEffects.createWithPreprocess; exports.preprocess = preprocessType; - +const pipelineType = ZodPipeline.create; +exports.pipeline = pipelineType; const ostring = () => stringType().optional(); - exports.ostring = ostring; - const onumber = () => numberType().optional(); - exports.onumber = onumber; - const oboolean = () => booleanType().optional(); - exports.oboolean = oboolean; +exports.coerce = { + string: arg => ZodString.create({ + ...arg, + coerce: true + }), + number: arg => ZodNumber.create({ + ...arg, + coerce: true + }), + boolean: arg => ZodBoolean.create({ + ...arg, + coerce: true + }), + bigint: arg => ZodBigInt.create({ + ...arg, + coerce: true + }), + date: arg => ZodDate.create({ + ...arg, + coerce: true + }) +}; +exports.NEVER = parseUtil_1.INVALID; -},{"./ZodError":2,"./helpers/errorUtil":4,"./helpers/parseUtil":5,"./helpers/util":7}],10:[function(require,module,exports){ +},{"./ZodError":2,"./errors":3,"./helpers/errorUtil":5,"./helpers/parseUtil":6,"./helpers/util":8}],12:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { @@ -3770,12 +4036,10 @@ Object.defineProperty(exports, "validate", { return _deviceApiCall.validate; } }); - var _deviceApiCall = require("./lib/device-api-call.js"); - var _deviceApi = require("./lib/device-api.js"); -},{"./lib/device-api-call.js":11,"./lib/device-api.js":12}],11:[function(require,module,exports){ +},{"./lib/device-api-call.js":13,"./lib/device-api.js":14}],13:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { @@ -3786,9 +4050,6 @@ exports.createDeviceApiCall = createDeviceApiCall; exports.createNotification = void 0; exports.createRequest = createRequest; exports.validate = validate; - -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - /** * This roughly follows https://www.jsonrpc.org/specification * @template {import("zod").ZodType} Params=import("zod").ZodType @@ -3796,18 +4057,18 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope */ class DeviceApiCall { /** @type {string} */ - + method = 'unknown'; /** * An optional 'id' - used to indicate if a request requires a response. * @type {string|null} */ - + id = null; /** @type {Params | null | undefined} */ - + paramsValidator = null; /** @type {Result | null | undefined} */ - + resultValidator = null; /** @type {import("zod").infer} */ - + params; /** * This is a carve-out for legacy messages that are not typed yet. * If you set this to 'true', then the response will not be checked to conform @@ -3815,7 +4076,7 @@ class DeviceApiCall { * @deprecated this is here to aid migration, should be removed ASAP * @type {boolean} */ - + throwOnResultKeysMissing = true; /** * New messages should be in a particular format, eg: { success: T }, * but you can set this to false if you want to access the result as-is, @@ -3823,96 +4084,67 @@ class DeviceApiCall { * @deprecated this is here to aid migration, should be removed ASAP * @type {boolean} */ - + unwrapResult = true; /** * @param {import("zod").infer} data */ constructor(data) { - _defineProperty(this, "method", 'unknown'); - - _defineProperty(this, "id", null); - - _defineProperty(this, "paramsValidator", null); - - _defineProperty(this, "resultValidator", null); - - _defineProperty(this, "params", void 0); - - _defineProperty(this, "throwOnResultKeysMissing", true); - - _defineProperty(this, "unwrapResult", true); - this.params = data; } + /** * @returns {import("zod").infer|undefined} */ - - validateParams() { if (this.params === undefined) { return undefined; } - this._validate(this.params, this.paramsValidator); - return this.params; } + /** * @param {any|null} incoming * @returns {import("zod").infer} */ - - validateResult(incoming) { this._validate(incoming, this.resultValidator); - if (!incoming) { return incoming; } - if (!this.unwrapResult) { return incoming; } - if ('data' in incoming) { console.warn('response had `data` property. Please migrate to `success`'); return incoming.data; } - if ('success' in incoming) { return incoming.success; } - if ('error' in incoming) { if (typeof incoming.error.message === 'string') { - throw new DeviceApiCallError("".concat(this.method, ": ").concat(incoming.error.message)); + throw new DeviceApiCallError(`${this.method}: ${incoming.error.message}`); } } - if (this.throwOnResultKeysMissing) { throw new Error('unreachable. Response did not contain `success` or `data`'); } - return incoming; } + /** * @param {any} data * @param {import("zod").ZodType|undefined|null} [validator] * @private */ - - _validate(data, validator) { if (!validator) return data; - if (validator) { - const result = validator === null || validator === void 0 ? void 0 : validator.safeParse(data); - + const result = validator?.safeParse(data); if (!result) { throw new Error('unreachable, data failure', data); } - if (!result.success) { if ('error' in result) { this.throwError(result.error.issues); @@ -3922,15 +4154,15 @@ class DeviceApiCall { } } } + /** * @param {import('zod').ZodIssue[]} errors */ - - throwError(errors) { const error = SchemaValidationError.fromZodErrors(errors, this.constructor.name); throw error; } + /** * Use this helper for creating stand-in response messages that are typed correctly. * @@ -3944,38 +4176,26 @@ class DeviceApiCall { * @param {import("zod").infer} response * @returns {import("zod").infer} */ - - result(response) { return response; } /** * @returns {import("zod").infer} */ - - preResultValidation(response) { return response; } - } - exports.DeviceApiCall = DeviceApiCall; - class DeviceApiCallError extends Error {} + /** * Check for this error if you'd like to */ - - exports.DeviceApiCallError = DeviceApiCallError; - class SchemaValidationError extends Error { - constructor() { - super(...arguments); - - _defineProperty(this, "validationErrors", []); - } + /** @type {import("zod").ZodIssue[]} */ + validationErrors = []; /** * @param {import("zod").ZodIssue[]} errors @@ -3983,17 +4203,15 @@ class SchemaValidationError extends Error { * @returns {SchemaValidationError} */ static fromZodErrors(errors, name) { - const heading = "".concat(errors.length, " SchemaValidationError(s) errors for ") + name; - + const heading = `${errors.length} SchemaValidationError(s) errors for ` + name; function log(issue) { switch (issue.code) { case 'invalid_literal': case 'invalid_type': { - console.log("".concat(name, ". Path: '").concat(issue.path.join('.'), "', Error: '").concat(issue.message, "'")); + console.log(`${name}. Path: '${issue.path.join('.')}', Error: '${issue.message}'`); break; } - case 'invalid_union': { for (let unionError of issue.unionErrors) { @@ -4001,28 +4219,24 @@ class SchemaValidationError extends Error { log(issue1); } } - break; } - default: { console.log(name, 'other issue:', issue); } } } - for (let error of errors) { log(error); } - const message = [heading, 'please see the details above'].join('\n '); const error = new SchemaValidationError(message); error.validationErrors = errors; return error; } - } + /** * Creates an instance of `DeviceApiCall` from only a name and 'params' * and optional validators. Use this to help migrate existing messages. @@ -4035,14 +4249,10 @@ class SchemaValidationError extends Error { * @param {Result|null} [resultValidator] * @returns {DeviceApiCall} */ - - exports.SchemaValidationError = SchemaValidationError; - function createDeviceApiCall(method, params) { let paramsValidator = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null; let resultValidator = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null; - /** @type {DeviceApiCall} */ const deviceApiCall = new DeviceApiCall(params); deviceApiCall.paramsValidator = paramsValidator; @@ -4052,6 +4262,7 @@ function createDeviceApiCall(method, params) { deviceApiCall.unwrapResult = false; return deviceApiCall; } + /** * Creates an instance of `DeviceApiCall` from only a name and 'params' * and optional validators. Use this to help migrate existing messages. @@ -4068,8 +4279,6 @@ function createDeviceApiCall(method, params) { * @param {Result|null} [resultValidator] * @returns {DeviceApiCall} */ - - function createRequest(method, params) { let id = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'n/a'; let paramsValidator = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null; @@ -4078,8 +4287,8 @@ function createRequest(method, params) { call.id = id; return call; } +const createNotification = exports.createNotification = createDeviceApiCall; -const createNotification = createDeviceApiCall; /** * Validate any arbitrary data with any Zod validator * @@ -4088,29 +4297,21 @@ const createNotification = createDeviceApiCall; * @param {Validator | null} [validator] * @returns {import("zod").infer} */ - -exports.createNotification = createNotification; - function validate(data) { let validator = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; - if (validator) { return validator.parse(data); } - return data; } -},{}],12:[function(require,module,exports){ +},{}],14:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.DeviceApiTransport = exports.DeviceApi = void 0; - -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - /** * Platforms should only need to implement this `send` method */ @@ -4123,8 +4324,8 @@ class DeviceApiTransport { async send(_deviceApiCall, _options) { return undefined; } - } + /** * This is the base Sender class that platforms can will implement. * @@ -4133,17 +4334,12 @@ class DeviceApiTransport { * @typedef CallOptions * @property {AbortSignal} [signal] */ - - exports.DeviceApiTransport = DeviceApiTransport; - class DeviceApi { /** @type {DeviceApiTransport} */ - + transport; /** @param {DeviceApiTransport} transport */ constructor(transport) { - _defineProperty(this, "transport", void 0); - this.transport = transport; } /** @@ -4152,8 +4348,6 @@ class DeviceApi { * @param {CallOptions} [options] * @returns {Promise['success']>>} */ - - async request(deviceApiCall, options) { deviceApiCall.validateParams(); let result = await this.transport.send(deviceApiCall, options); @@ -4166,18 +4360,14 @@ class DeviceApi { * @param {CallOptions} [options] * @returns {Promise} */ - - async notify(deviceApiCall, options) { deviceApiCall.validateParams(); return this.transport.send(deviceApiCall, options); } - } - exports.DeviceApi = DeviceApi; -},{}],13:[function(require,module,exports){ +},{}],15:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { @@ -4190,9 +4380,7 @@ Object.defineProperty(exports, "WebkitMessagingConfig", { return _webkit.WebkitMessagingConfig; } }); - var _webkit = require("./webkit.js"); - /** * @module Messaging * @@ -4270,8 +4458,6 @@ class Messaging { * @param {string} name * @param {Record} [data] */ - - notify(name) { let data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; this.transport.notify(name, data); @@ -4291,21 +4477,16 @@ class Messaging { * @param {Record} [data] * @return {Promise} */ - - request(name) { let data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; return this.transport.request(name, data); } - } + /** * @interface */ - - exports.Messaging = Messaging; - class MessagingTransport { /** * @param {string} name @@ -4323,34 +4504,27 @@ class MessagingTransport { * @return {Promise} */ // @ts-ignore - ignoring a no-unused ts error, this is only an interface. - - request(name) { let data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; throw new Error('must implement'); } - } + /** * @param {WebkitMessagingConfig} config * @returns {MessagingTransport} */ - - exports.MessagingTransport = MessagingTransport; - function getTransport(config) { if (config instanceof _webkit.WebkitMessagingConfig) { return new _webkit.WebkitMessagingTransport(config); } - throw new Error('unreachable'); } + /** * Thrown when a handler cannot be found */ - - class MissingHandler extends Error { /** * @param {string} message @@ -4360,26 +4534,51 @@ class MissingHandler extends Error { super(message); this.handlerName = handlerName; } - } + /** * Some re-exports for convenience */ - - exports.MissingHandler = MissingHandler; -},{"./webkit.js":14}],14:[function(require,module,exports){ +},{"./webkit.js":16}],16:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.WebkitMessagingTransport = exports.WebkitMessagingConfig = exports.SecureMessagingParams = void 0; - var _messaging = require("./messaging.js"); - -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } +/** + * @module Webkit Messaging + * + * @description + * + * A wrapper for messaging on WebKit platforms. It supports modern WebKit messageHandlers + * along with encryption for older versions (like macOS Catalina) + * + * Note: If you wish to support Catalina then you'll need to implement the native + * part of the message handling, see {@link WebkitMessagingTransport} for details. + * + * ```js + * import { Messaging, WebkitMessagingConfig } from "@duckduckgo/content-scope-scripts/lib/messaging.js" + * + * // This config would be injected into the UserScript + * const injectedConfig = { + * hasModernWebkitAPI: true, + * webkitMessageHandlerNames: ["foo", "bar", "baz"], + * secret: "dax", + * }; + * + * // Then use that config to construct platform-specific configuration + * const config = new WebkitMessagingConfig(injectedConfig); + * + * // finally, get an instance of Messaging and start sending messages in a unified way 🚀 + * const messaging = new Messaging(config); + * messaging.notify("hello world!", {foo: "bar"}) + * + * ``` + */ /** * @typedef {import("./messaging").MessagingTransport} MessagingTransport @@ -4433,77 +4632,59 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope */ class WebkitMessagingTransport { /** @type {WebkitMessagingConfig} */ - + config; + globals; /** - * @param {WebkitMessagingConfig} config - */ + * @param {WebkitMessagingConfig} config + */ constructor(config) { - _defineProperty(this, "config", void 0); - - _defineProperty(this, "globals", void 0); - - _defineProperty(this, "algoObj", { - name: 'AES-GCM', - length: 256 - }); - this.config = config; this.globals = captureGlobals(); - if (!this.config.hasModernWebkitAPI) { this.captureWebkitHandlers(this.config.webkitMessageHandlerNames); } } /** - * Sends message to the webkit layer (fire and forget) - * @param {String} handler - * @param {*} data - * @internal - */ - - + * Sends message to the webkit layer (fire and forget) + * @param {String} handler + * @param {*} data + * @internal + */ wkSend(handler) { - var _this$globals$window$, _this$globals$window$2; - let data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - if (!(handler in this.globals.window.webkit.messageHandlers)) { - throw new _messaging.MissingHandler("Missing webkit handler: '".concat(handler, "'"), handler); + throw new _messaging.MissingHandler(`Missing webkit handler: '${handler}'`, handler); } - - const outgoing = { ...data, - messageHandling: { ...data.messageHandling, + const outgoing = { + ...data, + messageHandling: { + ...data.messageHandling, secret: this.config.secret } }; - if (!this.config.hasModernWebkitAPI) { if (!(handler in this.globals.capturedWebkitHandlers)) { - throw new _messaging.MissingHandler("cannot continue, method ".concat(handler, " not captured on macos < 11"), handler); + throw new _messaging.MissingHandler(`cannot continue, method ${handler} not captured on macos < 11`, handler); } else { return this.globals.capturedWebkitHandlers[handler](outgoing); } } - - return (_this$globals$window$ = (_this$globals$window$2 = this.globals.window.webkit.messageHandlers[handler]).postMessage) === null || _this$globals$window$ === void 0 ? void 0 : _this$globals$window$.call(_this$globals$window$2, outgoing); + return this.globals.window.webkit.messageHandlers[handler].postMessage?.(outgoing); } - /** - * Sends message to the webkit layer and waits for the specified response - * @param {String} handler - * @param {*} data - * @returns {Promise<*>} - * @internal - */ - + /** + * Sends message to the webkit layer and waits for the specified response + * @param {String} handler + * @param {*} data + * @returns {Promise<*>} + * @internal + */ async wkSendAndWait(handler) { let data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - if (this.config.hasModernWebkitAPI) { const response = await this.wkSend(handler, data); return this.globals.JSONparse(response || '{}'); } - try { const randMethodName = this.createRandMethodName(); const key = await this.createRandKey(); @@ -4511,9 +4692,7 @@ class WebkitMessagingTransport { const { ciphertext, tag - } = await new this.globals.Promise(( - /** @type {any} */ - resolve) => { + } = await new this.globals.Promise(( /** @type {any} */resolve) => { this.generateRandomMethod(randMethodName, resolve); data.messageHandling = new SecureMessagingParams({ methodName: randMethodName, @@ -4540,89 +4719,81 @@ class WebkitMessagingTransport { } } /** - * @param {string} name - * @param {Record} [data] - */ - - + * @param {string} name + * @param {Record} [data] + */ notify(name) { let data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; this.wkSend(name, data); } /** - * @param {string} name - * @param {Record} [data] - */ - - + * @param {string} name + * @param {Record} [data] + */ request(name) { let data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; return this.wkSendAndWait(name, data); } /** - * Generate a random method name and adds it to the global scope - * The native layer will use this method to send the response - * @param {string | number} randomMethodName - * @param {Function} callback - */ - - + * Generate a random method name and adds it to the global scope + * The native layer will use this method to send the response + * @param {string | number} randomMethodName + * @param {Function} callback + */ generateRandomMethod(randomMethodName, callback) { var _this = this; - this.globals.ObjectDefineProperty(this.globals.window, randomMethodName, { enumerable: false, // configurable, To allow for deletion later configurable: true, writable: false, - /** * @param {any[]} args */ value: function () { - callback(...arguments); // @ts-ignore - we want this to throw if it fails as it would indicate a fatal error. - + callback(...arguments); + // @ts-ignore - we want this to throw if it fails as it would indicate a fatal error. delete _this.globals.window[randomMethodName]; } }); } - randomString() { return '' + this.globals.getRandomValues(new this.globals.Uint32Array(1))[0]; } - createRandMethodName() { return '_' + this.randomString(); } - /** - * @type {{name: string, length: number}} - */ + /** + * @type {{name: string, length: number}} + */ + algoObj = { + name: 'AES-GCM', + length: 256 + }; /** - * @returns {Promise} - */ + * @returns {Promise} + */ async createRandKey() { const key = await this.globals.generateKey(this.algoObj, true, ['encrypt', 'decrypt']); const exportedKey = await this.globals.exportKey('raw', key); return new this.globals.Uint8Array(exportedKey); } - /** - * @returns {Uint8Array} - */ - + /** + * @returns {Uint8Array} + */ createRandIv() { return this.globals.getRandomValues(new this.globals.Uint8Array(12)); } - /** - * @param {BufferSource} ciphertext - * @param {BufferSource} key - * @param {Uint8Array} iv - * @returns {Promise} - */ - + /** + * @param {BufferSource} ciphertext + * @param {BufferSource} key + * @param {Uint8Array} iv + * @returns {Promise} + */ async decrypt(ciphertext, key, iv) { const cryptoKey = await this.globals.importKey('raw', key, 'AES-GCM', false, ['decrypt']); const algo = { @@ -4633,37 +4804,31 @@ class WebkitMessagingTransport { let dec = new this.globals.TextDecoder(); return dec.decode(decrypted); } - /** - * When required (such as on macos 10.x), capture the `postMessage` method on - * each webkit messageHandler - * - * @param {string[]} handlerNames - */ - + /** + * When required (such as on macos 10.x), capture the `postMessage` method on + * each webkit messageHandler + * + * @param {string[]} handlerNames + */ captureWebkitHandlers(handlerNames) { const handlers = window.webkit.messageHandlers; if (!handlers) throw new _messaging.MissingHandler('window.webkit.messageHandlers was absent', 'all'); - for (let webkitMessageHandlerName of handlerNames) { - var _handlers$webkitMessa; - - if (typeof ((_handlers$webkitMessa = handlers[webkitMessageHandlerName]) === null || _handlers$webkitMessa === void 0 ? void 0 : _handlers$webkitMessa.postMessage) === 'function') { - var _handlers$webkitMessa2; - + if (typeof handlers[webkitMessageHandlerName]?.postMessage === 'function') { /** * `bind` is used here to ensure future calls to the captured * `postMessage` have the correct `this` context */ const original = handlers[webkitMessageHandlerName]; - const bound = (_handlers$webkitMessa2 = handlers[webkitMessageHandlerName].postMessage) === null || _handlers$webkitMessa2 === void 0 ? void 0 : _handlers$webkitMessa2.bind(original); + const bound = handlers[webkitMessageHandlerName].postMessage?.bind(original); this.globals.capturedWebkitHandlers[webkitMessageHandlerName] = bound; delete handlers[webkitMessageHandlerName].postMessage; } } } - } + /** * Use this configuration to create an instance of {@link Messaging} for WebKit * @@ -4680,10 +4845,7 @@ class WebkitMessagingTransport { * const resp = await messaging.request("debugConfig") * ``` */ - - exports.WebkitMessagingTransport = WebkitMessagingTransport; - class WebkitMessagingConfig { /** * @param {object} params @@ -4700,25 +4862,20 @@ class WebkitMessagingConfig { /** * A list of WebKit message handler names that a user script can send */ - this.webkitMessageHandlerNames = params.webkitMessageHandlerNames; /** * A string provided by native platforms to be sent with future outgoing * messages */ - this.secret = params.secret; } - } + /** * This is the additional payload that gets appended to outgoing messages. * It's used in the Swift side to encrypt the response that comes back */ - - exports.WebkitMessagingConfig = WebkitMessagingConfig; - class SecureMessagingParams { /** * @param {object} params @@ -4735,29 +4892,23 @@ class SecureMessagingParams { /** * The secret used to ensure message sender validity */ - this.secret = params.secret; /** * The CipherKey as number[] */ - this.key = params.key; /** * The Initial Vector as number[] */ - this.iv = params.iv; } - } + /** * Capture some globals used for messaging handling to prevent page * scripts from tampering with this */ - - exports.SecureMessagingParams = SecureMessagingParams; - function captureGlobals() { // Creat base with null prototype return { @@ -4780,13 +4931,12 @@ function captureGlobals() { Promise: window.Promise, ObjectDefineProperty: window.Object.defineProperty, addEventListener: window.addEventListener.bind(window), - /** @type {Record} */ capturedWebkitHandlers: {} }; } -},{"./messaging.js":13}],15:[function(require,module,exports){ +},{"./messaging.js":15}],17:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { @@ -4807,13 +4957,9 @@ Object.defineProperty(exports, "constants", { } }); exports.generate = generate; - var _applePassword = require("./lib/apple.password.js"); - var _rulesParser = require("./lib/rules-parser.js"); - var _constants = require("./lib/constants.js"); - /** * @typedef {{ * domain?: string | null | undefined; @@ -4822,7 +4968,6 @@ var _constants = require("./lib/constants.js"); * onError?: ((error: unknown) => void) | null | undefined; * }} GenerateOptions */ - /** * Generate a random password based on the following attempts * @@ -4837,16 +4982,13 @@ var _constants = require("./lib/constants.js"); */ function generate() { let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - try { - if (typeof (options === null || options === void 0 ? void 0 : options.input) === 'string') { + if (typeof options?.input === 'string') { return _applePassword.Password.generateOrThrow(options.input); } - - if (typeof (options === null || options === void 0 ? void 0 : options.domain) === 'string') { - if (options !== null && options !== void 0 && options.rules) { + if (typeof options?.domain === 'string') { + if (options?.rules) { const rules = _selectPasswordRules(options.domain, options.rules); - if (rules) { return _applePassword.Password.generateOrThrow(rules); } @@ -4854,25 +4996,25 @@ function generate() { } } catch (e) { // if an 'onError' callback was provided, forward all errors - if (options !== null && options !== void 0 && options.onError && typeof (options === null || options === void 0 ? void 0 : options.onError) === 'function') { + if (options?.onError && typeof options?.onError === 'function') { options.onError(e); } else { // otherwise, only console.error unknown errors (which could be implementation bugs) const isKnownError = e instanceof _rulesParser.ParserError || e instanceof HostnameInputError; - if (!isKnownError) { console.error(e); } } - } // At this point, we have to trust the generation will not throw - // as it is NOT using any user/page-provided data - + } + // At this point, we have to trust the generation will not throw + // as it is NOT using any user/page-provided data return _applePassword.Password.generateDefault(); -} // An extension type to differentiate between known errors - +} +// An extension type to differentiate between known errors class HostnameInputError extends Error {} + /** * @typedef {Record} RulesFormat */ @@ -4884,74 +5026,71 @@ class HostnameInputError extends Error {} * @returns {string | undefined} * @throws {HostnameInputError} */ - - exports.HostnameInputError = HostnameInputError; - function _selectPasswordRules(inputHostname, rules) { - const hostname = _safeHostname(inputHostname); // direct match - - + const hostname = _safeHostname(inputHostname); + // direct match if (rules[hostname]) { return rules[hostname]['password-rules']; - } // otherwise, start chopping off subdomains and re-joining to compare - + } + // otherwise, start chopping off subdomains and re-joining to compare const pieces = hostname.split('.'); - while (pieces.length > 1) { pieces.shift(); const joined = pieces.join('.'); - if (rules[joined]) { return rules[joined]['password-rules']; } } - return undefined; } + /** * @private * @param {string} inputHostname; * @throws {HostnameInputError} * @returns {string} */ - - function _safeHostname(inputHostname) { if (inputHostname.startsWith('http:') || inputHostname.startsWith('https:')) { throw new HostnameInputError('invalid input, you can only provide a hostname but you gave a scheme'); } - if (inputHostname.includes(':')) { throw new HostnameInputError('invalid input, you can only provide a hostname but you gave a :port'); } - try { const asUrl = new URL('https://' + inputHostname); return asUrl.hostname; } catch (e) { - throw new HostnameInputError("could not instantiate a URL from that hostname ".concat(inputHostname)); + throw new HostnameInputError(`could not instantiate a URL from that hostname ${inputHostname}`); } } -},{"./lib/apple.password.js":16,"./lib/constants.js":17,"./lib/rules-parser.js":18}],16:[function(require,module,exports){ +},{"./lib/apple.password.js":18,"./lib/constants.js":19,"./lib/rules-parser.js":20}],18:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Password = void 0; - var parser = _interopRequireWildcard(require("./rules-parser.js")); - var _constants = require("./constants.js"); - function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } - function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } - -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } +/* + * + * NOTE: + * + * This file was created with inspiration from https://developer.apple.com/password-rules + * + * * The changes made by DuckDuckGo employees are: + * + * 1) removed all logic relating to 'more typeable passwords' + * 2) reduced the number of password styles from 4 to only the 1 which suits our needs + * 2) added JSDoc comments (for Typescript checking) + * + */ /** * @typedef {{ @@ -4963,7 +5102,6 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope * PasswordMaxLength?: number, * }} Requirements */ - /** * @typedef {{ * NumberOfRequiredRandomCharacters: number, @@ -4977,12 +5115,12 @@ const defaults = Object.freeze({ defaultPasswordLength: _constants.constants.DEFAULT_MIN_LENGTH, defaultPasswordRules: _constants.constants.DEFAULT_PASSWORD_RULES, defaultRequiredCharacterSets: ['abcdefghijklmnopqrstuvwxyz', 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', '0123456789'], - /** * @type {typeof window.crypto.getRandomValues | null} */ getRandomValues: null }); + /** * This is added here to ensure: * @@ -4992,37 +5130,28 @@ const defaults = Object.freeze({ * * @type {{ getRandomValues: typeof window.crypto.getRandomValues }} */ - const safeGlobals = {}; - if (typeof window !== 'undefined') { safeGlobals.getRandomValues = window.crypto.getRandomValues.bind(window.crypto); } - class Password { - /** - * @type {typeof defaults} - */ - /** * @param {Partial} [options] */ constructor() { let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - - _defineProperty(this, "options", void 0); - - this.options = { ...defaults, + /** + * @type {typeof defaults} + */ + this.options = { + ...defaults, ...options }; return this; } - /** - * This is here to provide external access to un-modified defaults - * in case they are needed for tests/verifications - * @type {typeof defaults} - */ - + static get defaults() { + return defaults; + } /** * Generates a password from the given input. @@ -5057,12 +5186,11 @@ class Password { * @param {Partial} [options] * @returns {string} */ - - static generateDefault() { let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; return new Password(options).parse(Password.defaults.defaultPasswordRules).generate(); } + /** * Convert a ruleset into it's internally-used component pieces. * @@ -5076,59 +5204,44 @@ class Password { * generate: () => string; * }} */ - - parse(inputString) { const rules = parser.parsePasswordRules(inputString); - const requirements = this._requirementsFromRules(rules); - if (!requirements) throw new Error('could not generate requirements for ' + JSON.stringify(inputString)); - const parameters = this._passwordGenerationParametersDictionary(requirements); - return { requirements, parameters, rules, - get entropy() { return Math.log2(parameters.PasswordAllowedCharacters.length ** parameters.NumberOfRequiredRandomCharacters); }, - generate: () => { const password = this._generatedPasswordMatchingRequirements(requirements, parameters); /** * The following is unreachable because if user input was incorrect then * the parsing phase would throw. The following lines is to satisfy Typescript */ - - if (password === '') throw new Error('unreachable'); return password; } }; } + /** * Given an array of `Rule's`, convert into `Requirements` * * @param {parser.Rule[]} passwordRules * @returns {Requirements | null} */ - - _requirementsFromRules(passwordRules) { /** @type {Requirements} */ const requirements = {}; - for (let rule of passwordRules) { if (rule.name === parser.RuleName.ALLOWED) { console.assert(!('PasswordAllowedCharacters' in requirements)); - const chars = this._charactersFromCharactersClasses(rule.value); - const scanSet = this._canonicalizedScanSetFromCharacters(chars); - if (scanSet) { requirements.PasswordAllowedCharacters = scanSet; } @@ -5137,108 +5250,94 @@ class Password { requirements.PasswordRepeatedCharacterLimit = rule.value; } else if (rule.name === parser.RuleName.REQUIRED) { let requiredCharacters = requirements.PasswordRequiredCharacters; - if (!requiredCharacters) { requiredCharacters = requirements.PasswordRequiredCharacters = []; } - requiredCharacters.push(this._canonicalizedScanSetFromCharacters(this._charactersFromCharactersClasses(rule.value))); } else if (rule.name === parser.RuleName.MIN_LENGTH) { requirements.PasswordMinLength = rule.value; } else if (rule.name === parser.RuleName.MAX_LENGTH) { requirements.PasswordMaxLength = rule.value; } - } // Only include an allowed rule matching SCAN_SET_ORDER (all characters) when a required rule is also present. - + } + // Only include an allowed rule matching SCAN_SET_ORDER (all characters) when a required rule is also present. if (requirements.PasswordAllowedCharacters === this.options.SCAN_SET_ORDER && !requirements.PasswordRequiredCharacters) { delete requirements.PasswordAllowedCharacters; - } // Fix up PasswordRequiredCharacters, if needed. - + } + // Fix up PasswordRequiredCharacters, if needed. if (requirements.PasswordRequiredCharacters && requirements.PasswordRequiredCharacters.length === 1 && requirements.PasswordRequiredCharacters[0] === this.options.SCAN_SET_ORDER) { delete requirements.PasswordRequiredCharacters; } - return Object.keys(requirements).length ? requirements : null; } + /** * @param {number} range * @returns {number} */ - - _randomNumberWithUniformDistribution(range) { - const getRandomValues = this.options.getRandomValues || safeGlobals.getRandomValues; // Based on the algorithm described in https://pthree.org/2018/06/13/why-the-multiply-and-floor-rng-method-is-biased/ - + const getRandomValues = this.options.getRandomValues || safeGlobals.getRandomValues; + // Based on the algorithm described in https://pthree.org/2018/06/13/why-the-multiply-and-floor-rng-method-is-biased/ const max = Math.floor(2 ** 32 / range) * range; let x; - do { x = getRandomValues(new Uint32Array(1))[0]; } while (x >= max); - return x % range; } + /** * @param {number} numberOfRequiredRandomCharacters * @param {string} allowedCharacters */ - - _classicPassword(numberOfRequiredRandomCharacters, allowedCharacters) { const length = allowedCharacters.length; const randomCharArray = Array(numberOfRequiredRandomCharacters); - for (let i = 0; i < numberOfRequiredRandomCharacters; i++) { const index = this._randomNumberWithUniformDistribution(length); - randomCharArray[i] = allowedCharacters[index]; } - return randomCharArray.join(''); } + /** * @param {string} password * @param {number} consecutiveCharLimit * @returns {boolean} */ - - _passwordHasNotExceededConsecutiveCharLimit(password, consecutiveCharLimit) { let longestConsecutiveCharLength = 1; - let firstConsecutiveCharIndex = 0; // Both "123" or "abc" and "321" or "cba" are considered consecutive. - + let firstConsecutiveCharIndex = 0; + // Both "123" or "abc" and "321" or "cba" are considered consecutive. let isSequenceAscending; - for (let i = 1; i < password.length; i++) { const currCharCode = password.charCodeAt(i); const prevCharCode = password.charCodeAt(i - 1); - if (isSequenceAscending) { // If `isSequenceAscending` is defined, then we know that we are in the middle of an existing // pattern. Check if the pattern continues based on whether the previous pattern was // ascending or descending. if (isSequenceAscending.valueOf() && currCharCode === prevCharCode + 1 || !isSequenceAscending.valueOf() && currCharCode === prevCharCode - 1) { continue; - } // Take into account the case when the sequence transitions from descending - // to ascending. - + } + // Take into account the case when the sequence transitions from descending + // to ascending. if (currCharCode === prevCharCode + 1) { firstConsecutiveCharIndex = i - 1; isSequenceAscending = Boolean(true); continue; - } // Take into account the case when the sequence transitions from ascending - // to descending. - + } + // Take into account the case when the sequence transitions from ascending + // to descending. if (currCharCode === prevCharCode - 1) { firstConsecutiveCharIndex = i - 1; isSequenceAscending = Boolean(false); continue; } - isSequenceAscending = null; } else if (currCharCode === prevCharCode + 1) { isSequenceAscending = Boolean(true); @@ -5247,192 +5346,157 @@ class Password { isSequenceAscending = Boolean(false); continue; } - const currConsecutiveCharLength = i - firstConsecutiveCharIndex; - if (currConsecutiveCharLength > longestConsecutiveCharLength) { longestConsecutiveCharLength = currConsecutiveCharLength; } - firstConsecutiveCharIndex = i; } - if (isSequenceAscending) { const currConsecutiveCharLength = password.length - firstConsecutiveCharIndex; - if (currConsecutiveCharLength > longestConsecutiveCharLength) { longestConsecutiveCharLength = currConsecutiveCharLength; } } - return longestConsecutiveCharLength <= consecutiveCharLimit; } + /** * @param {string} password * @param {number} repeatedCharLimit * @returns {boolean} */ - - _passwordHasNotExceededRepeatedCharLimit(password, repeatedCharLimit) { let longestRepeatedCharLength = 1; let lastRepeatedChar = password.charAt(0); let lastRepeatedCharIndex = 0; - for (let i = 1; i < password.length; i++) { const currChar = password.charAt(i); - if (currChar === lastRepeatedChar) { continue; } - const currRepeatedCharLength = i - lastRepeatedCharIndex; - if (currRepeatedCharLength > longestRepeatedCharLength) { longestRepeatedCharLength = currRepeatedCharLength; } - lastRepeatedChar = currChar; lastRepeatedCharIndex = i; } - return longestRepeatedCharLength <= repeatedCharLimit; } + /** * @param {string} password * @param {string[]} requiredCharacterSets * @returns {boolean} */ - - _passwordContainsRequiredCharacters(password, requiredCharacterSets) { const requiredCharacterSetsLength = requiredCharacterSets.length; const passwordLength = password.length; - for (let i = 0; i < requiredCharacterSetsLength; i++) { const requiredCharacterSet = requiredCharacterSets[i]; let hasRequiredChar = false; - for (let j = 0; j < passwordLength; j++) { const char = password.charAt(j); - if (requiredCharacterSet.indexOf(char) !== -1) { hasRequiredChar = true; break; } } - if (!hasRequiredChar) { return false; } } - return true; } + /** * @param {string} string1 * @param {string} string2 * @returns {boolean} */ - - _stringsHaveAtLeastOneCommonCharacter(string1, string2) { const string2Length = string2.length; - for (let i = 0; i < string2Length; i++) { const char = string2.charAt(i); - if (string1.indexOf(char) !== -1) { return true; } } - return false; } + /** * @param {Requirements} requirements * @returns {PasswordParameters} */ - - _passwordGenerationParametersDictionary(requirements) { let minPasswordLength = requirements.PasswordMinLength; - const maxPasswordLength = requirements.PasswordMaxLength; // @ts-ignore + const maxPasswordLength = requirements.PasswordMaxLength; + // @ts-ignore if (minPasswordLength > maxPasswordLength) { // Resetting invalid value of min length to zero means "ignore min length parameter in password generation". minPasswordLength = 0; } - const requiredCharacterArray = requirements.PasswordRequiredCharacters; let allowedCharacters = requirements.PasswordAllowedCharacters; let requiredCharacterSets = this.options.defaultRequiredCharacterSets; - if (requiredCharacterArray) { const mutatedRequiredCharacterSets = []; const requiredCharacterArrayLength = requiredCharacterArray.length; - for (let i = 0; i < requiredCharacterArrayLength; i++) { const requiredCharacters = requiredCharacterArray[i]; - if (allowedCharacters && this._stringsHaveAtLeastOneCommonCharacter(requiredCharacters, allowedCharacters)) { mutatedRequiredCharacterSets.push(requiredCharacters); } } - requiredCharacterSets = mutatedRequiredCharacterSets; - } // If requirements allow, we will generateOrThrow the password in default format: "xxx-xxx-xxx-xxx". - + } + // If requirements allow, we will generateOrThrow the password in default format: "xxx-xxx-xxx-xxx". let numberOfRequiredRandomCharacters = this.options.defaultPasswordLength; - if (minPasswordLength && minPasswordLength > numberOfRequiredRandomCharacters) { numberOfRequiredRandomCharacters = minPasswordLength; } - if (maxPasswordLength && maxPasswordLength < numberOfRequiredRandomCharacters) { numberOfRequiredRandomCharacters = maxPasswordLength; } - if (!allowedCharacters) { allowedCharacters = this.options.defaultUnambiguousCharacters; - } // In default password format, we use dashes only as separators, not as symbols you can encounter at a random position. + } + // In default password format, we use dashes only as separators, not as symbols you can encounter at a random position. if (!requiredCharacterSets) { requiredCharacterSets = this.options.defaultRequiredCharacterSets; - } // If we have more requirements of the type "need a character from set" than the length of the password we want to generateOrThrow, then + } + + // If we have more requirements of the type "need a character from set" than the length of the password we want to generateOrThrow, then // we will never be able to meet these requirements, and we'll end up in an infinite loop generating passwords. To avoid this, // reset required character sets if the requirements are impossible to meet. - - if (requiredCharacterSets.length > numberOfRequiredRandomCharacters) { requiredCharacterSets = []; - } // Do not require any character sets that do not contain allowed characters. - + } + // Do not require any character sets that do not contain allowed characters. const requiredCharacterSetsLength = requiredCharacterSets.length; const mutatedRequiredCharacterSets = []; const allowedCharactersLength = allowedCharacters.length; - for (let i = 0; i < requiredCharacterSetsLength; i++) { const requiredCharacterSet = requiredCharacterSets[i]; let requiredCharacterSetContainsAllowedCharacters = false; - for (let j = 0; j < allowedCharactersLength; j++) { const character = allowedCharacters.charAt(j); - if (requiredCharacterSet.indexOf(character) !== -1) { requiredCharacterSetContainsAllowedCharacters = true; break; } } - if (requiredCharacterSetContainsAllowedCharacters) { mutatedRequiredCharacterSets.push(requiredCharacterSet); } } - requiredCharacterSets = mutatedRequiredCharacterSets; return { NumberOfRequiredRandomCharacters: numberOfRequiredRandomCharacters, @@ -5440,13 +5504,12 @@ class Password { RequiredCharacterSets: requiredCharacterSets }; } + /** * @param {Requirements | null} requirements * @param {PasswordParameters} [parameters] * @returns {string} */ - - _generatedPasswordMatchingRequirements(requirements, parameters) { requirements = requirements || {}; parameters = parameters || this._passwordGenerationParametersDictionary(requirements); @@ -5454,112 +5517,86 @@ class Password { const repeatedCharLimit = requirements.PasswordRepeatedCharacterLimit; const allowedCharacters = parameters.PasswordAllowedCharacters; const shouldCheckRepeatedCharRequirement = !!repeatedCharLimit; - while (true) { const password = this._classicPassword(numberOfRequiredRandomCharacters, allowedCharacters); - if (!this._passwordContainsRequiredCharacters(password, parameters.RequiredCharacterSets)) { continue; } - if (shouldCheckRepeatedCharRequirement) { if (repeatedCharLimit !== undefined && repeatedCharLimit >= 1 && !this._passwordHasNotExceededRepeatedCharLimit(password, repeatedCharLimit)) { continue; } } - const consecutiveCharLimit = requirements.PasswordConsecutiveCharacterLimit; - if (consecutiveCharLimit && consecutiveCharLimit >= 1) { if (!this._passwordHasNotExceededConsecutiveCharLimit(password, consecutiveCharLimit)) { continue; } } - return password || ''; } } + /** * @param {parser.CustomCharacterClass | parser.NamedCharacterClass} characterClass * @returns {string[]} */ - - _scanSetFromCharacterClass(characterClass) { if (characterClass instanceof parser.CustomCharacterClass) { return characterClass.characters; } - console.assert(characterClass instanceof parser.NamedCharacterClass); - switch (characterClass.name) { case parser.Identifier.ASCII_PRINTABLE: case parser.Identifier.UNICODE: return this.options.SCAN_SET_ORDER.split(''); - case parser.Identifier.DIGIT: return this.options.SCAN_SET_ORDER.substring(this.options.SCAN_SET_ORDER.indexOf('0'), this.options.SCAN_SET_ORDER.indexOf('9') + 1).split(''); - case parser.Identifier.LOWER: return this.options.SCAN_SET_ORDER.substring(this.options.SCAN_SET_ORDER.indexOf('a'), this.options.SCAN_SET_ORDER.indexOf('z') + 1).split(''); - case parser.Identifier.SPECIAL: return this.options.SCAN_SET_ORDER.substring(this.options.SCAN_SET_ORDER.indexOf('-'), this.options.SCAN_SET_ORDER.indexOf(']') + 1).split(''); - case parser.Identifier.UPPER: return this.options.SCAN_SET_ORDER.substring(this.options.SCAN_SET_ORDER.indexOf('A'), this.options.SCAN_SET_ORDER.indexOf('Z') + 1).split(''); } - console.assert(false, parser.SHOULD_NOT_BE_REACHED); return []; } + /** * @param {(parser.CustomCharacterClass | parser.NamedCharacterClass)[]} characterClasses */ - - _charactersFromCharactersClasses(characterClasses) { const output = []; - for (let characterClass of characterClasses) { output.push(...this._scanSetFromCharacterClass(characterClass)); } - return output; } + /** * @param {string[]} characters * @returns {string} */ - - _canonicalizedScanSetFromCharacters(characters) { if (!characters.length) { return ''; } - let shadowCharacters = Array.prototype.slice.call(characters); shadowCharacters.sort((a, b) => this.options.SCAN_SET_ORDER.indexOf(a) - this.options.SCAN_SET_ORDER.indexOf(b)); let uniqueCharacters = [shadowCharacters[0]]; - for (let i = 1, length = shadowCharacters.length; i < length; ++i) { if (shadowCharacters[i] === shadowCharacters[i - 1]) { continue; } - uniqueCharacters.push(shadowCharacters[i]); } - return uniqueCharacters.join(''); } - } - exports.Password = Password; -_defineProperty(Password, "defaults", defaults); - -},{"./constants.js":17,"./rules-parser.js":18}],17:[function(require,module,exports){ +},{"./constants.js":19,"./rules-parser.js":20}],19:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { @@ -5570,17 +5607,16 @@ const DEFAULT_MIN_LENGTH = 20; const DEFAULT_MAX_LENGTH = 30; const DEFAULT_REQUIRED_CHARS = '-!?$&#%'; const DEFAULT_UNAMBIGUOUS_CHARS = 'abcdefghijkmnopqrstuvwxyzABCDEFGHIJKLMNPQRSTUVWXYZ0123456789'; -const DEFAULT_PASSWORD_RULES = ["minlength: ".concat(DEFAULT_MIN_LENGTH), "maxlength: ".concat(DEFAULT_MAX_LENGTH), "required: [".concat(DEFAULT_REQUIRED_CHARS, "]"), "allowed: [".concat(DEFAULT_UNAMBIGUOUS_CHARS, "]")].join('; '); -const constants = { +const DEFAULT_PASSWORD_RULES = [`minlength: ${DEFAULT_MIN_LENGTH}`, `maxlength: ${DEFAULT_MAX_LENGTH}`, `required: [${DEFAULT_REQUIRED_CHARS}]`, `allowed: [${DEFAULT_UNAMBIGUOUS_CHARS}]`].join('; '); +const constants = exports.constants = { DEFAULT_MIN_LENGTH, DEFAULT_MAX_LENGTH, DEFAULT_PASSWORD_RULES, DEFAULT_REQUIRED_CHARS, DEFAULT_UNAMBIGUOUS_CHARS }; -exports.constants = constants; -},{}],18:[function(require,module,exports){ +},{}],20:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { @@ -5604,7 +5640,8 @@ exports.parsePasswordRules = parsePasswordRules; * ^ the default implementation still returns a base-line ruleset, which we didn't want. * */ -const Identifier = { + +const Identifier = exports.Identifier = { ASCII_PRINTABLE: 'ascii-printable', DIGIT: 'digit', LOWER: 'lower', @@ -5612,131 +5649,106 @@ const Identifier = { UNICODE: 'unicode', UPPER: 'upper' }; -exports.Identifier = Identifier; -const RuleName = { +const RuleName = exports.RuleName = { ALLOWED: 'allowed', MAX_CONSECUTIVE: 'max-consecutive', REQUIRED: 'required', MIN_LENGTH: 'minlength', MAX_LENGTH: 'maxlength' }; -exports.RuleName = RuleName; const CHARACTER_CLASS_START_SENTINEL = '['; const CHARACTER_CLASS_END_SENTINEL = ']'; const PROPERTY_VALUE_SEPARATOR = ','; const PROPERTY_SEPARATOR = ';'; const PROPERTY_VALUE_START_SENTINEL = ':'; const SPACE_CODE_POINT = ' '.codePointAt(0); -const SHOULD_NOT_BE_REACHED = 'Should not be reached'; -exports.SHOULD_NOT_BE_REACHED = SHOULD_NOT_BE_REACHED; - +const SHOULD_NOT_BE_REACHED = exports.SHOULD_NOT_BE_REACHED = 'Should not be reached'; class Rule { constructor(name, value) { this._name = name; this.value = value; } - get name() { return this._name; } - toString() { return JSON.stringify(this); } - } - exports.Rule = Rule; ; - class NamedCharacterClass { constructor(name) { console.assert(_isValidRequiredOrAllowedPropertyValueIdentifier(name)); this._name = name; } - get name() { return this._name.toLowerCase(); } - toString() { return this._name; } - toHTMLString() { return this._name; } - } - exports.NamedCharacterClass = NamedCharacterClass; ; - class ParserError extends Error {} - exports.ParserError = ParserError; ; - class CustomCharacterClass { constructor(characters) { console.assert(characters instanceof Array); this._characters = characters; } - get characters() { return this._characters; } - toString() { - return "[".concat(this._characters.join(''), "]"); + return `[${this._characters.join('')}]`; } - toHTMLString() { - return "[".concat(this._characters.join('').replace('"', '"'), "]"); + return `[${this._characters.join('').replace('"', '"')}]`; } - } - exports.CustomCharacterClass = CustomCharacterClass; -; // MARK: Lexer functions +; -function _isIdentifierCharacter(c) { - console.assert(c.length === 1); // eslint-disable-next-line no-mixed-operators +// MARK: Lexer functions +function _isIdentifierCharacter(c) { + console.assert(c.length === 1); + // eslint-disable-next-line no-mixed-operators return c >= 'a' && c <= 'z' || c >= 'A' && c <= 'Z' || c === '-'; } - function _isASCIIDigit(c) { console.assert(c.length === 1); return c >= '0' && c <= '9'; } - function _isASCIIPrintableCharacter(c) { console.assert(c.length === 1); return c >= ' ' && c <= '~'; } - function _isASCIIWhitespace(c) { console.assert(c.length === 1); return c === ' ' || c === '\f' || c === '\n' || c === '\r' || c === '\t'; -} // MARK: ASCII printable character bit set and canonicalization functions +} +// MARK: ASCII printable character bit set and canonicalization functions function _bitSetIndexForCharacter(c) { - console.assert(c.length === 1); // @ts-ignore - + console.assert(c.length === 1); + // @ts-ignore return c.codePointAt(0) - SPACE_CODE_POINT; } - function _characterAtBitSetIndex(index) { return String.fromCodePoint(index + SPACE_CODE_POINT); } - function _markBitsForNamedCharacterClass(bitSet, namedCharacterClass) { console.assert(bitSet instanceof Array); console.assert(namedCharacterClass.name !== Identifier.UNICODE); console.assert(namedCharacterClass.name !== Identifier.ASCII_PRINTABLE); - if (namedCharacterClass.name === Identifier.UPPER) { bitSet.fill(true, _bitSetIndexForCharacter('A'), _bitSetIndexForCharacter('Z') + 1); } else if (namedCharacterClass.name === Identifier.LOWER) { @@ -5752,223 +5764,176 @@ function _markBitsForNamedCharacterClass(bitSet, namedCharacterClass) { console.assert(false, SHOULD_NOT_BE_REACHED, namedCharacterClass); } } - function _markBitsForCustomCharacterClass(bitSet, customCharacterClass) { for (let character of customCharacterClass.characters) { bitSet[_bitSetIndexForCharacter(character)] = true; } } - function _canonicalizedPropertyValues(propertyValues, keepCustomCharacterClassFormatCompliant) { // @ts-ignore let asciiPrintableBitSet = new Array('~'.codePointAt(0) - ' '.codePointAt(0) + 1); - for (let propertyValue of propertyValues) { if (propertyValue instanceof NamedCharacterClass) { if (propertyValue.name === Identifier.UNICODE) { return [new NamedCharacterClass(Identifier.UNICODE)]; } - if (propertyValue.name === Identifier.ASCII_PRINTABLE) { return [new NamedCharacterClass(Identifier.ASCII_PRINTABLE)]; } - _markBitsForNamedCharacterClass(asciiPrintableBitSet, propertyValue); } else if (propertyValue instanceof CustomCharacterClass) { _markBitsForCustomCharacterClass(asciiPrintableBitSet, propertyValue); } } - let charactersSeen = []; - function checkRange(start, end) { let temp = []; - for (let i = _bitSetIndexForCharacter(start); i <= _bitSetIndexForCharacter(end); ++i) { if (asciiPrintableBitSet[i]) { temp.push(_characterAtBitSetIndex(i)); } } - let result = temp.length === _bitSetIndexForCharacter(end) - _bitSetIndexForCharacter(start) + 1; - if (!result) { charactersSeen = charactersSeen.concat(temp); } - return result; } - let hasAllUpper = checkRange('A', 'Z'); let hasAllLower = checkRange('a', 'z'); - let hasAllDigits = checkRange('0', '9'); // Check for special characters, accounting for characters that are given special treatment (i.e. '-' and ']') + let hasAllDigits = checkRange('0', '9'); + // Check for special characters, accounting for characters that are given special treatment (i.e. '-' and ']') let hasAllSpecial = false; let hasDash = false; let hasRightSquareBracket = false; let temp = []; - for (let i = _bitSetIndexForCharacter(' '); i <= _bitSetIndexForCharacter('/'); ++i) { if (!asciiPrintableBitSet[i]) { continue; } - let character = _characterAtBitSetIndex(i); - if (keepCustomCharacterClassFormatCompliant && character === '-') { hasDash = true; } else { temp.push(character); } } - for (let i = _bitSetIndexForCharacter(':'); i <= _bitSetIndexForCharacter('@'); ++i) { if (asciiPrintableBitSet[i]) { temp.push(_characterAtBitSetIndex(i)); } } - for (let i = _bitSetIndexForCharacter('['); i <= _bitSetIndexForCharacter('`'); ++i) { if (!asciiPrintableBitSet[i]) { continue; } - let character = _characterAtBitSetIndex(i); - if (keepCustomCharacterClassFormatCompliant && character === ']') { hasRightSquareBracket = true; } else { temp.push(character); } } - for (let i = _bitSetIndexForCharacter('{'); i <= _bitSetIndexForCharacter('~'); ++i) { if (asciiPrintableBitSet[i]) { temp.push(_characterAtBitSetIndex(i)); } } - if (hasDash) { temp.unshift('-'); } - if (hasRightSquareBracket) { temp.push(']'); } - let numberOfSpecialCharacters = _bitSetIndexForCharacter('/') - _bitSetIndexForCharacter(' ') + 1 + (_bitSetIndexForCharacter('@') - _bitSetIndexForCharacter(':') + 1) + (_bitSetIndexForCharacter('`') - _bitSetIndexForCharacter('[') + 1) + (_bitSetIndexForCharacter('~') - _bitSetIndexForCharacter('{') + 1); hasAllSpecial = temp.length === numberOfSpecialCharacters; - if (!hasAllSpecial) { charactersSeen = charactersSeen.concat(temp); } - let result = []; - if (hasAllUpper && hasAllLower && hasAllDigits && hasAllSpecial) { return [new NamedCharacterClass(Identifier.ASCII_PRINTABLE)]; } - if (hasAllUpper) { result.push(new NamedCharacterClass(Identifier.UPPER)); } - if (hasAllLower) { result.push(new NamedCharacterClass(Identifier.LOWER)); } - if (hasAllDigits) { result.push(new NamedCharacterClass(Identifier.DIGIT)); } - if (hasAllSpecial) { result.push(new NamedCharacterClass(Identifier.SPECIAL)); } - if (charactersSeen.length) { result.push(new CustomCharacterClass(charactersSeen)); } - return result; -} // MARK: Parser functions +} +// MARK: Parser functions function _indexOfNonWhitespaceCharacter(input) { let position = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; console.assert(position >= 0); console.assert(position <= input.length); let length = input.length; - while (position < length && _isASCIIWhitespace(input[position])) { ++position; } - return position; } - function _parseIdentifier(input, position) { console.assert(position >= 0); console.assert(position < input.length); console.assert(_isIdentifierCharacter(input[position])); let length = input.length; let seenIdentifiers = []; - do { let c = input[position]; - if (!_isIdentifierCharacter(c)) { break; } - seenIdentifiers.push(c); ++position; } while (position < length); - return [seenIdentifiers.join(''), position]; } - function _isValidRequiredOrAllowedPropertyValueIdentifier(identifier) { return identifier && Object.values(Identifier).includes(identifier.toLowerCase()); } - function _parseCustomCharacterClass(input, position) { console.assert(position >= 0); console.assert(position < input.length); console.assert(input[position] === CHARACTER_CLASS_START_SENTINEL); let length = input.length; ++position; - if (position >= length) { // console.error('Found end-of-line instead of character class character') return [null, position]; } - let initialPosition = position; let result = []; - do { let c = input[position]; - if (!_isASCIIPrintableCharacter(c)) { ++position; continue; } - if (c === '-' && position - initialPosition > 0) { // FIXME: Should this be an error? console.warn("Ignoring '-'; a '-' may only appear as the first character in a character class"); ++position; continue; } - result.push(c); ++position; - if (c === CHARACTER_CLASS_END_SENTINEL) { break; } } while (position < length); - if (position < length && input[position] !== CHARACTER_CLASS_END_SENTINEL) { // Fix up result; we over consumed. result.pop(); @@ -5978,37 +5943,31 @@ function _parseCustomCharacterClass(input, position) { result.pop(); return [result, position]; } - if (position < length && input[position] === CHARACTER_CLASS_END_SENTINEL) { return [result, position + 1]; - } // console.error('Found end-of-line instead of end of character class') - + } + // console.error('Found end-of-line instead of end of character class') return [null, position]; } - function _parsePasswordRequiredOrAllowedPropertyValue(input, position) { console.assert(position >= 0); console.assert(position < input.length); let length = input.length; let propertyValues = []; - while (true) { if (_isIdentifierCharacter(input[position])) { - let identifierStartPosition = position; // eslint-disable-next-line no-redeclare - + let identifierStartPosition = position; + // eslint-disable-next-line no-redeclare var [propertyValue, position] = _parseIdentifier(input, position); - if (!_isValidRequiredOrAllowedPropertyValueIdentifier(propertyValue)) { // console.error('Unrecognized property value identifier: ' + propertyValue) return [null, identifierStartPosition]; } - propertyValues.push(new NamedCharacterClass(propertyValue)); } else if (input[position] === CHARACTER_CLASS_START_SENTINEL) { // eslint-disable-next-line no-redeclare var [propertyValue, position] = _parseCustomCharacterClass(input, position); - if (propertyValue && propertyValue.length) { propertyValues.push(new CustomCharacterClass(propertyValue)); } @@ -6016,304 +5975,244 @@ function _parsePasswordRequiredOrAllowedPropertyValue(input, position) { // console.error('Failed to find start of property value: ' + input.substr(position)) return [null, position]; } - position = _indexOfNonWhitespaceCharacter(input, position); - if (position >= length || input[position] === PROPERTY_SEPARATOR) { break; } - if (input[position] === PROPERTY_VALUE_SEPARATOR) { position = _indexOfNonWhitespaceCharacter(input, position + 1); - if (position >= length) { // console.error('Found end-of-line instead of start of next property value') return [null, position]; } - continue; - } // console.error('Failed to find start of next property or property value: ' + input.substr(position)) - + } + // console.error('Failed to find start of next property or property value: ' + input.substr(position)) return [null, position]; } - return [propertyValues, position]; } + /** * @param input * @param position * @returns {[Rule|null, number, string|undefined]} * @private */ - - function _parsePasswordRule(input, position) { console.assert(position >= 0); console.assert(position < input.length); console.assert(_isIdentifierCharacter(input[position])); let length = input.length; - var mayBeIdentifierStartPosition = position; // eslint-disable-next-line no-redeclare - + var mayBeIdentifierStartPosition = position; + // eslint-disable-next-line no-redeclare var [identifier, position] = _parseIdentifier(input, position); - if (!Object.values(RuleName).includes(identifier)) { // console.error('Unrecognized property name: ' + identifier) return [null, mayBeIdentifierStartPosition, undefined]; } - if (position >= length) { // console.error('Found end-of-line instead of start of property value') return [null, position, undefined]; } - if (input[position] !== PROPERTY_VALUE_START_SENTINEL) { // console.error('Failed to find start of property value: ' + input.substr(position)) return [null, position, undefined]; } - let property = { name: identifier, value: null }; - position = _indexOfNonWhitespaceCharacter(input, position + 1); // Empty value - + position = _indexOfNonWhitespaceCharacter(input, position + 1); + // Empty value if (position >= length || input[position] === PROPERTY_SEPARATOR) { return [new Rule(property.name, property.value), position, undefined]; } - switch (identifier) { case RuleName.ALLOWED: case RuleName.REQUIRED: { // eslint-disable-next-line no-redeclare var [propertyValue, position] = _parsePasswordRequiredOrAllowedPropertyValue(input, position); - if (propertyValue) { property.value = propertyValue; } - return [new Rule(property.name, property.value), position, undefined]; } - case RuleName.MAX_CONSECUTIVE: { // eslint-disable-next-line no-redeclare var [propertyValue, position] = _parseMaxConsecutivePropertyValue(input, position); - if (propertyValue) { property.value = propertyValue; } - return [new Rule(property.name, property.value), position, undefined]; } - case RuleName.MIN_LENGTH: case RuleName.MAX_LENGTH: { // eslint-disable-next-line no-redeclare var [propertyValue, position] = _parseMinLengthMaxLengthPropertyValue(input, position); - if (propertyValue) { property.value = propertyValue; } - return [new Rule(property.name, property.value), position, undefined]; } } - console.assert(false, SHOULD_NOT_BE_REACHED); return [null, -1, undefined]; } - function _parseMinLengthMaxLengthPropertyValue(input, position) { return _parseInteger(input, position); } - function _parseMaxConsecutivePropertyValue(input, position) { return _parseInteger(input, position); } - function _parseInteger(input, position) { console.assert(position >= 0); console.assert(position < input.length); - if (!_isASCIIDigit(input[position])) { // console.error('Failed to parse value of type integer; not a number: ' + input.substr(position)) return [null, position]; } - - let length = input.length; // let initialPosition = position - + let length = input.length; + // let initialPosition = position let result = 0; - do { result = 10 * result + parseInt(input[position], 10); ++position; } while (position < length && input[position] !== PROPERTY_SEPARATOR && _isASCIIDigit(input[position])); - if (position >= length || input[position] === PROPERTY_SEPARATOR) { return [result, position]; - } // console.error('Failed to parse value of type integer; not a number: ' + input.substr(initialPosition)) - + } + // console.error('Failed to parse value of type integer; not a number: ' + input.substr(initialPosition)) return [null, position]; } + /** * @param input * @returns {[Rule[]|null, string|undefined]} * @private */ - - function _parsePasswordRulesInternal(input) { let parsedProperties = []; let length = input.length; - var position = _indexOfNonWhitespaceCharacter(input); - while (position < length) { if (!_isIdentifierCharacter(input[position])) { // console.warn('Failed to find start of property: ' + input.substr(position)) return [parsedProperties, undefined]; - } // eslint-disable-next-line no-redeclare - + } + // eslint-disable-next-line no-redeclare var [parsedProperty, position, message] = _parsePasswordRule(input, position); - if (parsedProperty && parsedProperty.value) { parsedProperties.push(parsedProperty); } - position = _indexOfNonWhitespaceCharacter(input, position); - if (position >= length) { break; } - if (input[position] === PROPERTY_SEPARATOR) { position = _indexOfNonWhitespaceCharacter(input, position + 1); - if (position >= length) { return [parsedProperties, undefined]; } - continue; - } // console.error('Failed to find start of next property: ' + input.substr(position)) - + } + // console.error('Failed to find start of next property: ' + input.substr(position)) return [null, message || 'Failed to find start of next property: ' + input.substr(position)]; } - return [parsedProperties, undefined]; } + /** * @param {string} input * @param {boolean} [formatRulesForMinifiedVersion] * @returns {Rule[]} */ - - function parsePasswordRules(input, formatRulesForMinifiedVersion) { let [passwordRules, maybeMessage] = _parsePasswordRulesInternal(input); - if (!passwordRules) { throw new ParserError(maybeMessage); } - if (passwordRules.length === 0) { throw new ParserError('No valid rules were provided'); - } // When formatting rules for minified version, we should keep the formatted rules - // as similar to the input as possible. Avoid copying required rules to allowed rules. - + } + // When formatting rules for minified version, we should keep the formatted rules + // as similar to the input as possible. Avoid copying required rules to allowed rules. let suppressCopyingRequiredToAllowed = formatRulesForMinifiedVersion; let requiredRules = []; let newAllowedValues = []; let minimumMaximumConsecutiveCharacters = null; let maximumMinLength = 0; let minimumMaxLength = null; - for (let rule of passwordRules) { switch (rule.name) { case RuleName.MAX_CONSECUTIVE: minimumMaximumConsecutiveCharacters = minimumMaximumConsecutiveCharacters ? Math.min(rule.value, minimumMaximumConsecutiveCharacters) : rule.value; break; - case RuleName.MIN_LENGTH: maximumMinLength = Math.max(rule.value, maximumMinLength); break; - case RuleName.MAX_LENGTH: minimumMaxLength = minimumMaxLength ? Math.min(rule.value, minimumMaxLength) : rule.value; break; - case RuleName.REQUIRED: rule.value = _canonicalizedPropertyValues(rule.value, formatRulesForMinifiedVersion); requiredRules.push(rule); - if (!suppressCopyingRequiredToAllowed) { newAllowedValues = newAllowedValues.concat(rule.value); } - break; - case RuleName.ALLOWED: newAllowedValues = newAllowedValues.concat(rule.value); break; } } - let newPasswordRules = []; - if (maximumMinLength > 0) { newPasswordRules.push(new Rule(RuleName.MIN_LENGTH, maximumMinLength)); } - if (minimumMaxLength !== null) { newPasswordRules.push(new Rule(RuleName.MAX_LENGTH, minimumMaxLength)); } - if (minimumMaximumConsecutiveCharacters !== null) { newPasswordRules.push(new Rule(RuleName.MAX_CONSECUTIVE, minimumMaximumConsecutiveCharacters)); } - let sortedRequiredRules = requiredRules.sort(function (a, b) { const namedCharacterClassOrder = [Identifier.LOWER, Identifier.UPPER, Identifier.DIGIT, Identifier.SPECIAL, Identifier.ASCII_PRINTABLE, Identifier.UNICODE]; let aIsJustOneNamedCharacterClass = a.value.length === 1 && a.value[0] instanceof NamedCharacterClass; let bIsJustOneNamedCharacterClass = b.value.length === 1 && b.value[0] instanceof NamedCharacterClass; - if (aIsJustOneNamedCharacterClass && !bIsJustOneNamedCharacterClass) { return -1; } - if (!aIsJustOneNamedCharacterClass && bIsJustOneNamedCharacterClass) { return 1; } - if (aIsJustOneNamedCharacterClass && bIsJustOneNamedCharacterClass) { let aIndex = namedCharacterClassOrder.indexOf(a.value[0].name); let bIndex = namedCharacterClassOrder.indexOf(b.value[0].name); return aIndex - bIndex; } - return 0; }); newPasswordRules = newPasswordRules.concat(sortedRequiredRules); newAllowedValues = _canonicalizedPropertyValues(newAllowedValues, suppressCopyingRequiredToAllowed); - if (!suppressCopyingRequiredToAllowed && !newAllowedValues.length) { newAllowedValues = [new NamedCharacterClass(Identifier.ASCII_PRINTABLE)]; } - if (newAllowedValues.length) { newPasswordRules.push(new Rule(RuleName.ALLOWED, newAllowedValues)); } - return newPasswordRules; } -},{}],19:[function(require,module,exports){ +},{}],21:[function(require,module,exports){ module.exports={ "163.com": { "password-rules": "minlength: 6; maxlength: 16;" @@ -7144,42 +7043,31 @@ module.exports={ "password-rules": "minlength: 8; maxlength: 32; max-consecutive: 6; required: lower; required: upper; required: digit;" } } -},{}],20:[function(require,module,exports){ +},{}],22:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.createDevice = createDevice; - var _config = require("./config.js"); - var _AndroidInterface = require("./DeviceInterface/AndroidInterface.js"); - var _ExtensionInterface = require("./DeviceInterface/ExtensionInterface.js"); - var _AppleDeviceInterface = require("./DeviceInterface/AppleDeviceInterface.js"); - var _AppleOverlayDeviceInterface = require("./DeviceInterface/AppleOverlayDeviceInterface.js"); - var _transports = require("./deviceApiCalls/transports/transports.js"); - var _index = require("../packages/device-api/index.js"); - var _Settings = require("./Settings.js"); - var _WindowsInterface = require("./DeviceInterface/WindowsInterface.js"); - var _WindowsOverlayDeviceInterface = require("./DeviceInterface/WindowsOverlayDeviceInterface.js"); - function createDevice() { const globalConfig = (0, _config.createGlobalConfig)(); const transport = (0, _transports.createTransport)(globalConfig); + /** * A wrapper around transports to assist in debugging/integrations * @type {import("../packages/device-api").DeviceApiTransport} */ - const loggingTransport = { async send(deviceApiCall) { console.log('[->outgoing]', 'id:', deviceApiCall.method, deviceApiCall.params || null); @@ -7187,63 +7075,50 @@ function createDevice() { console.log('[<-incoming]', 'id:', deviceApiCall.method, result || null); return result; } + }; - }; // Create the DeviceAPI + Setting - + // Create the DeviceAPI + Setting let deviceApi = new _index.DeviceApi(globalConfig.isDDGTestMode ? loggingTransport : transport); const settings = new _Settings.Settings(globalConfig, deviceApi); - if (globalConfig.isWindows) { if (globalConfig.isTopFrame) { return new _WindowsOverlayDeviceInterface.WindowsOverlayDeviceInterface(globalConfig, deviceApi, settings); } - return new _WindowsInterface.WindowsInterface(globalConfig, deviceApi, settings); } - if (globalConfig.isDDGApp) { if (globalConfig.isAndroid) { return new _AndroidInterface.AndroidInterface(globalConfig, deviceApi, settings); } - if (globalConfig.isTopFrame) { return new _AppleOverlayDeviceInterface.AppleOverlayDeviceInterface(globalConfig, deviceApi, settings); } - return new _AppleDeviceInterface.AppleDeviceInterface(globalConfig, deviceApi, settings); } - globalConfig.isExtension = true; return new _ExtensionInterface.ExtensionInterface(globalConfig, deviceApi, settings); } -},{"../packages/device-api/index.js":10,"./DeviceInterface/AndroidInterface.js":21,"./DeviceInterface/AppleDeviceInterface.js":22,"./DeviceInterface/AppleOverlayDeviceInterface.js":23,"./DeviceInterface/ExtensionInterface.js":24,"./DeviceInterface/WindowsInterface.js":26,"./DeviceInterface/WindowsOverlayDeviceInterface.js":27,"./Settings.js":48,"./config.js":61,"./deviceApiCalls/transports/transports.js":69}],21:[function(require,module,exports){ +},{"../packages/device-api/index.js":12,"./DeviceInterface/AndroidInterface.js":23,"./DeviceInterface/AppleDeviceInterface.js":24,"./DeviceInterface/AppleOverlayDeviceInterface.js":25,"./DeviceInterface/ExtensionInterface.js":26,"./DeviceInterface/WindowsInterface.js":28,"./DeviceInterface/WindowsOverlayDeviceInterface.js":29,"./Settings.js":50,"./config.js":63,"./deviceApiCalls/transports/transports.js":71}],23:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.AndroidInterface = void 0; - var _InterfacePrototype = _interopRequireDefault(require("./InterfacePrototype.js")); - var _autofillUtils = require("../autofill-utils.js"); - var _NativeUIController = require("../UI/controllers/NativeUIController.js"); - var _appleUtils = require("@duckduckgo/content-scope-scripts/src/apple-utils"); - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - class AndroidInterface extends _InterfacePrototype.default { async isEnabled() { return (0, _autofillUtils.autofillEnabled)(this.globalConfig, _appleUtils.processConfig); } + /** * @returns {Promise} */ - - async getAlias() { const { alias @@ -7252,47 +7127,40 @@ class AndroidInterface extends _InterfacePrototype.default { }, 'getAliasResponse'); return alias; } + /** * @override */ - - createUIController() { return new _NativeUIController.NativeUIController(); } + /** * @deprecated use `this.settings.availableInputTypes.email` in the future * @returns {boolean} */ - - isDeviceSignedIn() { - var _this$globalConfig$av; - // on DDG domains, always check via `window.EmailInterface.isSignedIn()` if (this.globalConfig.isDDGDomain) { return window.EmailInterface.isSignedIn() === 'true'; - } // on non-DDG domains, where `availableInputTypes.email` is present, use it - + } - if (typeof ((_this$globalConfig$av = this.globalConfig.availableInputTypes) === null || _this$globalConfig$av === void 0 ? void 0 : _this$globalConfig$av.email) === 'boolean') { + // on non-DDG domains, where `availableInputTypes.email` is present, use it + if (typeof this.globalConfig.availableInputTypes?.email === 'boolean') { return this.globalConfig.availableInputTypes.email; - } // ...on other domains we assume true because the script wouldn't exist otherwise - + } + // ...on other domains we assume true because the script wouldn't exist otherwise return true; } - async setupAutofill() {} + /** * Used by the email web app * Settings page displays data of the logged in user data */ - - getUserData() { let userData = null; - try { userData = JSON.parse(window.EmailInterface.getUserData()); } catch (e) { @@ -7300,18 +7168,15 @@ class AndroidInterface extends _InterfacePrototype.default { console.error(e); } } - return Promise.resolve(userData); } + /** * Used by the email web app * Device capabilities determine which functionality is available to the user */ - - getEmailProtectionCapabilities() { let deviceCapabilities = null; - try { deviceCapabilities = JSON.parse(window.EmailInterface.getDeviceCapabilities()); } catch (e) { @@ -7319,10 +7184,8 @@ class AndroidInterface extends _InterfacePrototype.default { console.error(e); } } - return Promise.resolve(deviceCapabilities); } - storeUserData(_ref) { let { addUserData: { @@ -7333,12 +7196,11 @@ class AndroidInterface extends _InterfacePrototype.default { } = _ref; return window.EmailInterface.storeCredentials(token, userName, cohort); } + /** * Used by the email web app * Provides functionality to log the user out */ - - removeUserData() { try { return window.EmailInterface.removeCredentials(); @@ -7348,7 +7210,6 @@ class AndroidInterface extends _InterfacePrototype.default { } } } - addLogoutListener(handler) { // Only deal with logging out if we're in the email web app if (!this.globalConfig.isDDGDomain) return; @@ -7358,68 +7219,45 @@ class AndroidInterface extends _InterfacePrototype.default { } }); } - /** Noop */ - + /** Noop */ firePixel(_pixelParam) {} - } - exports.AndroidInterface = AndroidInterface; -},{"../UI/controllers/NativeUIController.js":54,"../autofill-utils.js":59,"./InterfacePrototype.js":25,"@duckduckgo/content-scope-scripts/src/apple-utils":1}],22:[function(require,module,exports){ +},{"../UI/controllers/NativeUIController.js":56,"../autofill-utils.js":61,"./InterfacePrototype.js":27,"@duckduckgo/content-scope-scripts/src/apple-utils":1}],24:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.AppleDeviceInterface = void 0; - var _InterfacePrototype = _interopRequireDefault(require("./InterfacePrototype.js")); - var _autofillUtils = require("../autofill-utils.js"); - var _appleUtils = require("@duckduckgo/content-scope-scripts/src/apple-utils"); - var _HTMLTooltip = require("../UI/HTMLTooltip.js"); - var _HTMLTooltipUIController = require("../UI/controllers/HTMLTooltipUIController.js"); - var _OverlayUIController = require("../UI/controllers/OverlayUIController.js"); - var _index = require("../../packages/device-api/index.js"); - var _additionalDeviceApiCalls = require("../deviceApiCalls/additionalDeviceApiCalls.js"); - var _NativeUIController = require("../UI/controllers/NativeUIController.js"); - var _deviceApiCalls = require("../deviceApiCalls/__generated__/deviceApiCalls.js"); - var _matching = require("../Form/matching.js"); - var _InContextSignup = require("../InContextSignup.js"); - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - /** * @typedef {import('../deviceApiCalls/__generated__/validators-ts').GetAutofillDataRequest} GetAutofillDataRequest */ -class AppleDeviceInterface extends _InterfacePrototype.default { - constructor() { - super(...arguments); - - _defineProperty(this, "inContextSignup", new _InContextSignup.InContextSignup(this)); - - _defineProperty(this, "initialSetupDelayMs", 300); - _defineProperty(this, "pollingTimeout", null); - } +class AppleDeviceInterface extends _InterfacePrototype.default { + inContextSignup = new _InContextSignup.InContextSignup(this); + /** @override */ + initialSetupDelayMs = 300; async isEnabled() { return (0, _autofillUtils.autofillEnabled)(this.globalConfig, _appleUtils.processConfig); } + /** * The default functionality of this class is to operate as an 'overlay controller' - * which means it's purpose is to message the native layer about when to open/close the overlay. @@ -7431,17 +7269,13 @@ class AppleDeviceInterface extends _InterfacePrototype.default { * @override * @returns {import("../UI/controllers/UIController.js").UIController} */ - - createUIController() { - var _this$globalConfig$us, _this$globalConfig$us2; - - if (((_this$globalConfig$us = this.globalConfig.userPreferences) === null || _this$globalConfig$us === void 0 ? void 0 : (_this$globalConfig$us2 = _this$globalConfig$us.platform) === null || _this$globalConfig$us2 === void 0 ? void 0 : _this$globalConfig$us2.name) === 'ios') { + if (this.globalConfig.userPreferences?.platform?.name === 'ios') { return new _NativeUIController.NativeUIController(); } - if (!this.globalConfig.supportsTopFrame) { - const options = { ..._HTMLTooltip.defaultOptions, + const options = { + ..._HTMLTooltip.defaultOptions, testMode: this.isTestMode() }; return new _HTMLTooltipUIController.HTMLTooltipUIController({ @@ -7449,16 +7283,16 @@ class AppleDeviceInterface extends _InterfacePrototype.default { tooltipKind: 'modern' }, options); } + /** * If we get here, we're just a controller for an overlay */ - - return new _OverlayUIController.OverlayUIController({ remove: async () => this._closeAutofillParent(), show: async details => this._show(details) }); } + /** * For now, this could be running * 1) on iOS @@ -7468,78 +7302,67 @@ class AppleDeviceInterface extends _InterfacePrototype.default { * @override * @returns {Promise} */ - - async setupAutofill() { if (!this.globalConfig.supportsTopFrame) { await this._getAutofillInitData(); } - await this.inContextSignup.init(); const signedIn = await this._checkDeviceSignedIn(); - if (signedIn) { if (this.globalConfig.isApp) { await this.getAddresses(); } } } + /** * Used by the email web app * Settings page displays data of the logged in user data */ - - getUserData() { return this.deviceApi.request((0, _index.createRequest)('emailHandlerGetUserData')); } + /** * Used by the email web app * Device capabilities determine which functionality is available to the user */ - - getEmailProtectionCapabilities() { return this.deviceApi.request((0, _index.createRequest)('emailHandlerGetCapabilities')); } + /** */ - - async getSelectedCredentials() { return this.deviceApi.request((0, _index.createRequest)('getSelectedCredentials')); } + /** * The data format provided here for `parentArgs` matches Window now. * @param {GetAutofillDataRequest} parentArgs */ - - async _showAutofillParent(parentArgs) { - const applePayload = { ...parentArgs.triggerContext, + const applePayload = { + ...parentArgs.triggerContext, serializedInputContext: parentArgs.serializedInputContext }; return this.deviceApi.notify((0, _index.createNotification)('showAutofillParent', applePayload)); } + /** * @returns {Promise} */ - - async _closeAutofillParent() { return this.deviceApi.notify((0, _index.createNotification)('closeAutofillParent', {})); } + /** * @param {GetAutofillDataRequest} details */ - - async _show(details) { await this._showAutofillParent(details); - this._listenForSelectedCredential(async response => { if (!response) return; - if ('configType' in response) { this.selectedDetail(response.data, response.configType); } else if ('stop' in response) { @@ -7549,12 +7372,10 @@ class AppleDeviceInterface extends _InterfacePrototype.default { } }); } - async refreshData() { await super.refreshData(); await this._checkDeviceSignedIn(); } - async getAddresses() { if (!this.globalConfig.isApp) return this.getAlias(); const { @@ -7563,23 +7384,18 @@ class AppleDeviceInterface extends _InterfacePrototype.default { this.storeLocalAddresses(addresses); return addresses; } - async refreshAlias() { - await this.deviceApi.notify((0, _index.createNotification)('emailHandlerRefreshAlias')); // On macOS we also update the addresses stored locally - + await this.deviceApi.notify((0, _index.createNotification)('emailHandlerRefreshAlias')); + // On macOS we also update the addresses stored locally if (this.globalConfig.isApp) this.getAddresses(); } - async _checkDeviceSignedIn() { const { isAppSignedIn } = await this.deviceApi.request((0, _index.createRequest)('emailHandlerCheckAppSignedInStatus')); - this.isDeviceSignedIn = () => !!isAppSignedIn; - return !!isAppSignedIn; } - storeUserData(_ref) { let { addUserData: { @@ -7594,24 +7410,23 @@ class AppleDeviceInterface extends _InterfacePrototype.default { cohort })); } + /** * Used by the email web app * Provides functionality to log the user out */ - - removeUserData() { this.deviceApi.notify((0, _index.createNotification)('emailHandlerRemoveToken')); } + /** * Used by the email web app * Provides functionality to close the window after in-context sign-up or sign-in */ - - closeEmailProtection() { this.deviceApi.request(new _deviceApiCalls.CloseEmailProtectionTabCall(null)); } + /** * PM endpoints */ @@ -7620,91 +7435,79 @@ class AppleDeviceInterface extends _InterfacePrototype.default { * Gets the init data from the device * @returns {APIResponse} */ - - async _getAutofillInitData() { const response = await this.deviceApi.request((0, _index.createRequest)('pmHandlerGetAutofillInitData')); this.storeLocalData(response.success); return response; } + /** * Gets credentials ready for autofill * @param {CredentialsObject['id']} id - the credential id * @returns {APIResponseSingle} */ - - getAutofillCredentials(id) { return this.deviceApi.request((0, _index.createRequest)('pmHandlerGetAutofillCredentials', { id })); } + /** * Opens the native UI for managing passwords */ - - openManagePasswords() { return this.deviceApi.notify((0, _index.createNotification)('pmHandlerOpenManagePasswords')); } + /** * Opens the native UI for managing identities */ - - openManageIdentities() { return this.deviceApi.notify((0, _index.createNotification)('pmHandlerOpenManageIdentities')); } + /** * Opens the native UI for managing credit cards */ - - openManageCreditCards() { return this.deviceApi.notify((0, _index.createNotification)('pmHandlerOpenManageCreditCards')); } + /** * Gets a single identity obj once the user requests it * @param {IdentityObject['id']} id * @returns {Promise<{success: IdentityObject|undefined}>} */ - - getAutofillIdentity(id) { const identity = this.getLocalIdentities().find(_ref2 => { let { id: identityId } = _ref2; - return "".concat(identityId) === "".concat(id); + return `${identityId}` === `${id}`; }); return Promise.resolve({ success: identity }); } + /** * Gets a single complete credit card obj once the user requests it * @param {CreditCardObject['id']} id * @returns {APIResponse} */ - - getAutofillCreditCard(id) { return this.deviceApi.request((0, _index.createRequest)('pmHandlerGetCreditCard', { id })); } - getCurrentInputType() { - var _this$activeForm; - const topContextData = this.getTopContextData(); - return topContextData !== null && topContextData !== void 0 && topContextData.inputType ? topContextData.inputType : (0, _matching.getInputType)((_this$activeForm = this.activeForm) === null || _this$activeForm === void 0 ? void 0 : _this$activeForm.activeInput); + return topContextData?.inputType ? topContextData.inputType : (0, _matching.getInputType)(this.activeForm?.activeInput); } + /** * @returns {Promise} */ - - async getAlias() { const { alias @@ -7715,7 +7518,6 @@ class AppleDeviceInterface extends _InterfacePrototype.default { })); return alias ? (0, _autofillUtils.formatDuckAddress)(alias) : alias; } - addLogoutListener(handler) { // Only deal with logging out if we're in the email web app if (!this.globalConfig.isDDGDomain) return; @@ -7725,7 +7527,6 @@ class AppleDeviceInterface extends _InterfacePrototype.default { } }); } - async addDeviceListeners() { if (this.settings.featureToggles.third_party_credentials_provider) { if (this.globalConfig.hasModernWebkitAPI) { @@ -7742,17 +7543,15 @@ class AppleDeviceInterface extends _InterfacePrototype.default { setTimeout(() => this._pollForUpdatesToCredentialsProvider(), 2000); } } - } // Only used on Catalina - + } + // Only used on Catalina async _pollForUpdatesToCredentialsProvider() { try { const response = await this.deviceApi.request(new _deviceApiCalls.CheckCredentialsProviderStatusCall(null)); - if (response.availableInputTypes.credentialsProviderStatus !== this.settings.availableInputTypes.credentialsProviderStatus) { this.providerStatusUpdated(response); } - setTimeout(() => this._pollForUpdatesToCredentialsProvider(), 2000); } catch (e) { if (this.globalConfig.isDDGTestMode) { @@ -7760,9 +7559,9 @@ class AppleDeviceInterface extends _InterfacePrototype.default { } } } - /** @type {any} */ - + /** @type {any} */ + pollingTimeout = null; /** * Poll the native listener until the user has selected a credential. * Message return types are: @@ -7777,13 +7576,11 @@ class AppleDeviceInterface extends _InterfacePrototype.default { const poll = async () => { clearTimeout(this.pollingTimeout); const response = await this.getSelectedCredentials(); - switch (response.type) { case 'none': // Parent hasn't got a selected credential yet this.pollingTimeout = setTimeout(() => poll(), 100); return; - case 'ok': { await callback({ @@ -7792,7 +7589,6 @@ class AppleDeviceInterface extends _InterfacePrototype.default { }); return; } - case 'state': { // Inform that state has changed, but continue polling @@ -7803,7 +7599,6 @@ class AppleDeviceInterface extends _InterfacePrototype.default { this.pollingTimeout = setTimeout(() => poll(), 100); return; } - case 'stop': // Parent wants us to stop polling await callback({ @@ -7811,36 +7606,24 @@ class AppleDeviceInterface extends _InterfacePrototype.default { }); } }; - poll(); } - } - exports.AppleDeviceInterface = AppleDeviceInterface; -},{"../../packages/device-api/index.js":10,"../Form/matching.js":41,"../InContextSignup.js":42,"../UI/HTMLTooltip.js":52,"../UI/controllers/HTMLTooltipUIController.js":53,"../UI/controllers/NativeUIController.js":54,"../UI/controllers/OverlayUIController.js":55,"../autofill-utils.js":59,"../deviceApiCalls/__generated__/deviceApiCalls.js":63,"../deviceApiCalls/additionalDeviceApiCalls.js":65,"./InterfacePrototype.js":25,"@duckduckgo/content-scope-scripts/src/apple-utils":1}],23:[function(require,module,exports){ +},{"../../packages/device-api/index.js":12,"../Form/matching.js":43,"../InContextSignup.js":44,"../UI/HTMLTooltip.js":54,"../UI/controllers/HTMLTooltipUIController.js":55,"../UI/controllers/NativeUIController.js":56,"../UI/controllers/OverlayUIController.js":57,"../autofill-utils.js":61,"../deviceApiCalls/__generated__/deviceApiCalls.js":65,"../deviceApiCalls/additionalDeviceApiCalls.js":67,"./InterfacePrototype.js":27,"@duckduckgo/content-scope-scripts/src/apple-utils":1}],25:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.AppleOverlayDeviceInterface = void 0; - var _AppleDeviceInterface = require("./AppleDeviceInterface.js"); - var _HTMLTooltipUIController = require("../UI/controllers/HTMLTooltipUIController.js"); - var _overlayApi = require("./overlayApi.js"); - var _index = require("../../packages/device-api/index.js"); - var _deviceApiCalls = require("../deviceApiCalls/__generated__/deviceApiCalls.js"); - var _validatorsZod = require("../deviceApiCalls/__generated__/validators.zod.js"); - -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - /** * This subclass is designed to separate code that *only* runs inside the * Overlay into a single place. @@ -7849,17 +7632,18 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope * can be viewed as *not* executing within a regular page context. */ class AppleOverlayDeviceInterface extends _AppleDeviceInterface.AppleDeviceInterface { - constructor() { - super(...arguments); - - _defineProperty(this, "stripCredentials", false); - - _defineProperty(this, "overlay", (0, _overlayApi.overlayApi)(this)); - - _defineProperty(this, "previousX", 0); + /** + * Mark top frame as not stripping credential data + * @type {boolean} + */ + stripCredentials = false; - _defineProperty(this, "previousY", 0); - } + /** + * overlay API helpers + */ + overlay = (0, _overlayApi.overlayApi)(this); + previousX = 0; + previousY = 0; /** * Because we're running inside the Overlay, we always create the HTML @@ -7870,9 +7654,7 @@ class AppleOverlayDeviceInterface extends _AppleDeviceInterface.AppleDeviceInter */ createUIController() { return new _HTMLTooltipUIController.HTMLTooltipUIController({ - tooltipKind: - /** @type {const} */ - 'modern', + tooltipKind: /** @type {const} */'modern', device: this }, { wrapperClass: 'top-autofill', @@ -7882,7 +7664,6 @@ class AppleOverlayDeviceInterface extends _AppleDeviceInterface.AppleDeviceInter testMode: this.isTestMode() }); } - addDeviceListeners() { /** * The native side will send a custom event 'mouseMove' to indicate @@ -7892,26 +7673,25 @@ class AppleOverlayDeviceInterface extends _AppleDeviceInterface.AppleDeviceInter * page load every time it's opened. */ window.addEventListener('mouseMove', event => { - var _this$uiController, _this$uiController$ge; - // Don't set focus if the mouse hasn't moved ever // This is to avoid clickjacking where an attacker puts the pulldown under the cursor // and tricks the user into clicking - if (!this.previousX && !this.previousY || // if no previous coords + if (!this.previousX && !this.previousY || + // if no previous coords this.previousX === event.detail.x && this.previousY === event.detail.y // or the mouse hasn't moved ) { this.previousX = event.detail.x; this.previousY = event.detail.y; return; } - - const activeTooltip = (_this$uiController = this.uiController) === null || _this$uiController === void 0 ? void 0 : (_this$uiController$ge = _this$uiController.getActiveTooltip) === null || _this$uiController$ge === void 0 ? void 0 : _this$uiController$ge.call(_this$uiController); - activeTooltip === null || activeTooltip === void 0 ? void 0 : activeTooltip.focus(event.detail.x, event.detail.y); + const activeTooltip = this.uiController?.getActiveTooltip?.(); + activeTooltip?.focus(event.detail.x, event.detail.y); this.previousX = event.detail.x; this.previousY = event.detail.y; }); return super.addDeviceListeners(); } + /** * Since we're running inside the Overlay we can limit what happens here to * be only things that are needed to power the HTML Tooltip @@ -7919,23 +7699,20 @@ class AppleOverlayDeviceInterface extends _AppleDeviceInterface.AppleDeviceInter * @override * @returns {Promise} */ - - async setupAutofill() { await this._getAutofillInitData(); await this.inContextSignup.init(); const signedIn = await this._checkDeviceSignedIn(); - if (signedIn) { await this.getAddresses(); } } - async postInit() { // setup overlay API pieces this.overlay.showImmediately(); super.postInit(); } + /** * In the top-frame scenario we override the base 'selectedDetail'. * @@ -7945,78 +7722,61 @@ class AppleOverlayDeviceInterface extends _AppleDeviceInterface.AppleDeviceInter * @param {IdentityObject|CreditCardObject|CredentialsObject|{email:string, id: string}} data * @param {string} type */ - - async selectedDetail(data, type) { return this.overlay.selectedDetail(data, type); } - async askToUnlockProvider() { const response = await this.deviceApi.request(new _deviceApiCalls.AskToUnlockProviderCall(null)); this.providerStatusUpdated(response); } - providerStatusUpdated(data) { - var _this$uiController2; - const { credentials, availableInputTypes - } = (0, _index.validate)(data, _validatorsZod.providerStatusUpdatedSchema); // Update local settings and data + } = (0, _index.validate)(data, _validatorsZod.providerStatusUpdatedSchema); + // Update local settings and data this.settings.setAvailableInputTypes(availableInputTypes); - this.storeLocalCredentials(credentials); // rerender the tooltip + this.storeLocalCredentials(credentials); - (_this$uiController2 = this.uiController) === null || _this$uiController2 === void 0 ? void 0 : _this$uiController2.updateItems(credentials); + // rerender the tooltip + this.uiController?.updateItems(credentials); } - } - exports.AppleOverlayDeviceInterface = AppleOverlayDeviceInterface; -},{"../../packages/device-api/index.js":10,"../UI/controllers/HTMLTooltipUIController.js":53,"../deviceApiCalls/__generated__/deviceApiCalls.js":63,"../deviceApiCalls/__generated__/validators.zod.js":64,"./AppleDeviceInterface.js":22,"./overlayApi.js":29}],24:[function(require,module,exports){ +},{"../../packages/device-api/index.js":12,"../UI/controllers/HTMLTooltipUIController.js":55,"../deviceApiCalls/__generated__/deviceApiCalls.js":65,"../deviceApiCalls/__generated__/validators.zod.js":66,"./AppleDeviceInterface.js":24,"./overlayApi.js":31}],26:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ExtensionInterface = void 0; - var _InterfacePrototype = _interopRequireDefault(require("./InterfacePrototype.js")); - var _autofillUtils = require("../autofill-utils.js"); - var _HTMLTooltipUIController = require("../UI/controllers/HTMLTooltipUIController.js"); - var _HTMLTooltip = require("../UI/HTMLTooltip.js"); - var _InContextSignup = require("../InContextSignup.js"); - var _matching = require("../Form/matching.js"); - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - const TOOLTIP_TYPES = { EmailProtection: 'EmailProtection', EmailSignup: 'EmailSignup' }; - class ExtensionInterface extends _InterfacePrototype.default { - constructor() { - super(...arguments); - - _defineProperty(this, "inContextSignup", new _InContextSignup.InContextSignup(this)); - } + /** + * Adding this here since only the extension currently supports this + */ + inContextSignup = new _InContextSignup.InContextSignup(this); /** * @override */ createUIController() { /** @type {import('../UI/HTMLTooltip.js').HTMLTooltipOptions} */ - const htmlTooltipOptions = { ..._HTMLTooltip.defaultOptions, - css: ""), + const htmlTooltipOptions = { + ..._HTMLTooltip.defaultOptions, + css: ``, testMode: this.isTestMode(), hasCaret: true }; @@ -8030,23 +7790,16 @@ class ExtensionInterface extends _InterfacePrototype.default { device: this }, htmlTooltipOptions); } - getActiveTooltipType() { - var _this$activeForm, _this$inContextSignup; - if (this.hasLocalAddresses) { return TOOLTIP_TYPES.EmailProtection; } - - const inputType = (_this$activeForm = this.activeForm) !== null && _this$activeForm !== void 0 && _this$activeForm.activeInput ? (0, _matching.getInputSubtype)(this.activeForm.activeInput) : undefined; - - if ((_this$inContextSignup = this.inContextSignup) !== null && _this$inContextSignup !== void 0 && _this$inContextSignup.isAvailable(inputType)) { + const inputType = this.activeForm?.activeInput ? (0, _matching.getInputSubtype)(this.activeForm.activeInput) : undefined; + if (this.inContextSignup?.isAvailable(inputType)) { return TOOLTIP_TYPES.EmailSignup; } - return null; } - async resetAutofillUI(callback) { this.removeAutofillUIFromPage('Resetting autofill.'); await this.setupAutofill(); @@ -8054,12 +7807,9 @@ class ExtensionInterface extends _InterfacePrototype.default { this.uiController = this.createUIController(); await this.postInit(); } - async isEnabled() { return new Promise(resolve => { - var _chrome, _chrome$runtime; - - (_chrome = chrome) === null || _chrome === void 0 ? void 0 : (_chrome$runtime = _chrome.runtime) === null || _chrome$runtime === void 0 ? void 0 : _chrome$runtime.sendMessage({ + chrome?.runtime?.sendMessage({ registeredTempAutofillContentScript: true, documentUrl: window.location.href }, response => { @@ -8069,11 +7819,9 @@ class ExtensionInterface extends _InterfacePrototype.default { }); }); } - isDeviceSignedIn() { return this.hasLocalAddresses; } - async setupAutofill() { /** * In the extension, we must resolve `inContextSignup` data as part of setup @@ -8081,17 +7829,13 @@ class ExtensionInterface extends _InterfacePrototype.default { await this.inContextSignup.init(); return this.getAddresses(); } - postInit() { switch (this.getActiveTooltipType()) { case TOOLTIP_TYPES.EmailProtection: { - var _this$activeForm2; - this._scannerCleanup = this.scanner.init(); this.addLogoutListener(() => { this.resetAutofillUI(); - if (this.globalConfig.isDDGDomain) { (0, _autofillUtils.notifyWebApp)({ deviceSignedIn: { @@ -8100,13 +7844,10 @@ class ExtensionInterface extends _InterfacePrototype.default { }); } }); - - if ((_this$activeForm2 = this.activeForm) !== null && _this$activeForm2 !== void 0 && _this$activeForm2.activeInput) { - var _this$activeForm3; - + if (this.activeForm?.activeInput) { this.attachTooltip({ form: this.activeForm, - input: (_this$activeForm3 = this.activeForm) === null || _this$activeForm3 === void 0 ? void 0 : _this$activeForm3.activeInput, + input: this.activeForm?.activeInput, click: null, trigger: 'postSignup', triggerMetaData: { @@ -8114,16 +7855,13 @@ class ExtensionInterface extends _InterfacePrototype.default { } }); } - break; } - case TOOLTIP_TYPES.EmailSignup: { this._scannerCleanup = this.scanner.init(); break; } - default: { // Don't do anyhing if we don't have a tooltip to show @@ -8131,7 +7869,6 @@ class ExtensionInterface extends _InterfacePrototype.default { } } } - getAddresses() { return new Promise(resolve => chrome.runtime.sendMessage({ getAddresses: true @@ -8140,41 +7877,38 @@ class ExtensionInterface extends _InterfacePrototype.default { return resolve(data); })); } + /** * Used by the email web app * Settings page displays data of the logged in user data */ - - getUserData() { return new Promise(resolve => chrome.runtime.sendMessage({ getUserData: true }, data => resolve(data))); } + /** * Used by the email web app * Device capabilities determine which functionality is available to the user */ - - getEmailProtectionCapabilities() { return new Promise(resolve => chrome.runtime.sendMessage({ getEmailProtectionCapabilities: true }, data => resolve(data))); } - refreshAlias() { return chrome.runtime.sendMessage({ refreshAlias: true }, addresses => this.storeLocalAddresses(addresses)); } - async trySigningIn() { if (this.globalConfig.isDDGDomain) { const data = await (0, _autofillUtils.sendAndWaitForAnswer)(_autofillUtils.SIGN_IN_MSG, 'addUserData'); this.storeUserData(data); } } + /** * @param {object} message * @param {object} message.addUserData @@ -8182,23 +7916,19 @@ class ExtensionInterface extends _InterfacePrototype.default { * @param {string} message.addUserData.userName * @param {string} message.addUserData.cohort */ - - storeUserData(message) { return chrome.runtime.sendMessage(message); } + /** * Used by the email web app * Provides functionality to log the user out */ - - removeUserData() { return chrome.runtime.sendMessage({ removeUserData: true }); } - addDeviceListeners() { // Add contextual menu listeners let activeEl = null; @@ -8207,142 +7937,115 @@ class ExtensionInterface extends _InterfacePrototype.default { }); chrome.runtime.onMessage.addListener((message, sender) => { if (sender.id !== chrome.runtime.id) return; - switch (message.type) { case 'ddgUserReady': this.resetAutofillUI(() => this.setupSettingsPage({ shouldLog: true })); break; - case 'contextualAutofill': (0, _autofillUtils.setValue)(activeEl, (0, _autofillUtils.formatDuckAddress)(message.alias), this.globalConfig); activeEl.classList.add('ddg-autofilled'); - this.refreshAlias(); // If the user changes the alias, remove the decoration + this.refreshAlias(); + // If the user changes the alias, remove the decoration activeEl.addEventListener('input', e => e.target.classList.remove('ddg-autofilled'), { once: true }); break; - default: break; } }); } - addLogoutListener(handler) { // Make sure there's only one log out listener attached by removing the // previous logout listener first, if it exists. if (this._logoutListenerHandler) { chrome.runtime.onMessage.removeListener(this._logoutListenerHandler); - } // Cleanup on logout events - + } + // Cleanup on logout events this._logoutListenerHandler = (message, sender) => { if (sender.id === chrome.runtime.id && message.type === 'logout') { handler(); } }; - chrome.runtime.onMessage.addListener(this._logoutListenerHandler); } - } - exports.ExtensionInterface = ExtensionInterface; -},{"../Form/matching.js":41,"../InContextSignup.js":42,"../UI/HTMLTooltip.js":52,"../UI/controllers/HTMLTooltipUIController.js":53,"../autofill-utils.js":59,"./InterfacePrototype.js":25}],25:[function(require,module,exports){ +},{"../Form/matching.js":43,"../InContextSignup.js":44,"../UI/HTMLTooltip.js":54,"../UI/controllers/HTMLTooltipUIController.js":55,"../autofill-utils.js":61,"./InterfacePrototype.js":27}],27:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; - var _autofillUtils = require("../autofill-utils.js"); - var _matching = require("../Form/matching.js"); - var _formatters = require("../Form/formatters.js"); - var _Credentials = require("../InputTypes/Credentials.js"); - var _PasswordGenerator = require("../PasswordGenerator.js"); - var _Scanner = require("../Scanner.js"); - var _config = require("../config.js"); - var _NativeUIController = require("../UI/controllers/NativeUIController.js"); - var _transports = require("../deviceApiCalls/transports/transports.js"); - var _Settings = require("../Settings.js"); - var _index = require("../../packages/device-api/index.js"); - var _deviceApiCalls = require("../deviceApiCalls/__generated__/deviceApiCalls.js"); - var _initFormSubmissionsApi = require("./initFormSubmissionsApi.js"); - var _validatorsZod = require("../deviceApiCalls/__generated__/validators.zod.js"); - var _EmailProtection = require("../EmailProtection.js"); - -function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); } - -function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } } - -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - -function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; } - -function _classApplyDescriptorSet(receiver, descriptor, value) { if (descriptor.set) { descriptor.set.call(receiver, value); } else { if (!descriptor.writable) { throw new TypeError("attempted to set read only private field"); } descriptor.value = value; } } - -function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); } - -function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); } - -function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; } - -var _addresses = /*#__PURE__*/new WeakMap(); - -var _data2 = /*#__PURE__*/new WeakMap(); - /** * @typedef {import('../deviceApiCalls/__generated__/validators-ts').StoreFormData} StoreFormData */ - /** * @implements {GlobalConfigImpl} * @implements {FormExtensionPoints} * @implements {DeviceExtensionPoints} */ class InterfacePrototype { + attempts = 0; /** @type {import("../Form/Form").Form | null} */ - + activeForm = null; /** @type {import("../UI/HTMLTooltip.js").default | null} */ - + currentTooltip = null; /** @type {number} */ + initialSetupDelayMs = 0; + autopromptFired = false; /** @type {PasswordGenerator} */ + passwordGenerator = new _PasswordGenerator.PasswordGenerator(); + emailProtection = new _EmailProtection.EmailProtection(this); /** @type {import("../InContextSignup.js").InContextSignup | null} */ + inContextSignup = null; /** @type {{privateAddress: string, personalAddress: string}} */ + #addresses = { + privateAddress: '', + personalAddress: '' + }; /** @type {GlobalConfig} */ + globalConfig; /** @type {import('../Scanner').Scanner} */ + scanner; /** @type {import("../UI/controllers/UIController.js").UIController | null} */ + uiController; /** @type {import("../../packages/device-api").DeviceApi} */ + deviceApi; /** @type {boolean} */ + isInitializationStarted; /** @type {((reason, ...rest) => void) | null} */ + _scannerCleanup = null; /** * @param {GlobalConfig} config @@ -8350,52 +8053,6 @@ class InterfacePrototype { * @param {Settings} settings */ constructor(config, deviceApi, settings) { - _defineProperty(this, "attempts", 0); - - _defineProperty(this, "activeForm", null); - - _defineProperty(this, "currentTooltip", null); - - _defineProperty(this, "initialSetupDelayMs", 0); - - _defineProperty(this, "autopromptFired", false); - - _defineProperty(this, "passwordGenerator", new _PasswordGenerator.PasswordGenerator()); - - _defineProperty(this, "emailProtection", new _EmailProtection.EmailProtection(this)); - - _defineProperty(this, "inContextSignup", null); - - _classPrivateFieldInitSpec(this, _addresses, { - writable: true, - value: { - privateAddress: '', - personalAddress: '' - } - }); - - _defineProperty(this, "globalConfig", void 0); - - _defineProperty(this, "scanner", void 0); - - _defineProperty(this, "uiController", void 0); - - _defineProperty(this, "deviceApi", void 0); - - _defineProperty(this, "isInitializationStarted", void 0); - - _defineProperty(this, "_scannerCleanup", null); - - _classPrivateFieldInitSpec(this, _data2, { - writable: true, - value: { - credentials: [], - creditCards: [], - identities: [], - topContextData: undefined - } - }); - this.globalConfig = config; this.deviceApi = deviceApi; this.settings = settings; @@ -8405,60 +8062,56 @@ class InterfacePrototype { }); this.isInitializationStarted = false; } + /** * Implementors should override this with a UI controller that suits * their platform. * * @returns {import("../UI/controllers/UIController.js").UIController} */ - - createUIController() { return new _NativeUIController.NativeUIController(); } + /** * @param {string} reason */ - - removeAutofillUIFromPage(reason) { - var _this$uiController, _this$_scannerCleanup; - - (_this$uiController = this.uiController) === null || _this$uiController === void 0 ? void 0 : _this$uiController.destroy(); - (_this$_scannerCleanup = this._scannerCleanup) === null || _this$_scannerCleanup === void 0 ? void 0 : _this$_scannerCleanup.call(this, reason); + this.uiController?.destroy(); + this._scannerCleanup?.(reason); } - get hasLocalAddresses() { - var _classPrivateFieldGet2, _classPrivateFieldGet3; - - return !!((_classPrivateFieldGet2 = _classPrivateFieldGet(this, _addresses)) !== null && _classPrivateFieldGet2 !== void 0 && _classPrivateFieldGet2.privateAddress && (_classPrivateFieldGet3 = _classPrivateFieldGet(this, _addresses)) !== null && _classPrivateFieldGet3 !== void 0 && _classPrivateFieldGet3.personalAddress); + return !!(this.#addresses?.privateAddress && this.#addresses?.personalAddress); } - getLocalAddresses() { - return _classPrivateFieldGet(this, _addresses); + return this.#addresses; } - storeLocalAddresses(addresses) { - _classPrivateFieldSet(this, _addresses, addresses); // When we get new duck addresses, add them to the identities list - - + this.#addresses = addresses; + // When we get new duck addresses, add them to the identities list const identities = this.getLocalIdentities(); const privateAddressIdentity = identities.find(_ref => { let { id } = _ref; return id === 'privateAddress'; - }); // If we had previously stored them, just update the private address - + }); + // If we had previously stored them, just update the private address if (privateAddressIdentity) { privateAddressIdentity.emailAddress = (0, _autofillUtils.formatDuckAddress)(addresses.privateAddress); } else { // Otherwise, add both addresses - _classPrivateFieldGet(this, _data2).identities = this.addDuckAddressesToIdentities(identities); + this.#data.identities = this.addDuckAddressesToIdentities(identities); } } - /** @type { PMData } */ + /** @type { PMData } */ + #data = { + credentials: [], + creditCards: [], + identities: [], + topContextData: undefined + }; /** * @returns {import('../Form/matching').SupportedTypes} @@ -8466,7 +8119,6 @@ class InterfacePrototype { getCurrentInputType() { throw new Error('Not implemented'); } - addDuckAddressesToIdentities(identities) { if (!this.hasLocalAddresses) return identities; const newIdentities = []; @@ -8475,16 +8127,18 @@ class InterfacePrototype { personalAddress } = this.getLocalAddresses(); privateAddress = (0, _autofillUtils.formatDuckAddress)(privateAddress); - personalAddress = (0, _autofillUtils.formatDuckAddress)(personalAddress); // Get the duck addresses in identities + personalAddress = (0, _autofillUtils.formatDuckAddress)(personalAddress); + // Get the duck addresses in identities const duckEmailsInIdentities = identities.reduce((duckEmails, _ref2) => { let { emailAddress: email } = _ref2; - return email !== null && email !== void 0 && email.includes(_autofillUtils.ADDRESS_DOMAIN) ? duckEmails.concat(email) : duckEmails; - }, []); // Only add the personal duck address to identities if the user hasn't - // already manually added it + return email?.includes(_autofillUtils.ADDRESS_DOMAIN) ? duckEmails.concat(email) : duckEmails; + }, []); + // Only add the personal duck address to identities if the user hasn't + // already manually added it if (!duckEmailsInIdentities.includes(personalAddress)) { newIdentities.push({ id: 'personalAddress', @@ -8492,7 +8146,6 @@ class InterfacePrototype { title: 'Block email trackers' }); } - newIdentities.push({ id: 'privateAddress', emailAddress: privateAddress, @@ -8500,58 +8153,55 @@ class InterfacePrototype { }); return [...identities, ...newIdentities]; } + /** * Stores init data coming from the tooltipHandler * @param { InboundPMData } data */ - - storeLocalData(data) { this.storeLocalCredentials(data.credentials); - data.creditCards.forEach(cc => delete cc.cardNumber && delete cc.cardSecurityCode); // Store the full name as a separate field to simplify autocomplete - - const updatedIdentities = data.identities.map(identity => ({ ...identity, + data.creditCards.forEach(cc => delete cc.cardNumber && delete cc.cardSecurityCode); + // Store the full name as a separate field to simplify autocomplete + const updatedIdentities = data.identities.map(identity => ({ + ...identity, fullName: (0, _formatters.formatFullName)(identity) - })); // Add addresses - - _classPrivateFieldGet(this, _data2).identities = this.addDuckAddressesToIdentities(updatedIdentities); - _classPrivateFieldGet(this, _data2).creditCards = data.creditCards; // Top autofill only + })); + // Add addresses + this.#data.identities = this.addDuckAddressesToIdentities(updatedIdentities); + this.#data.creditCards = data.creditCards; + // Top autofill only if (data.serializedInputContext) { try { - _classPrivateFieldGet(this, _data2).topContextData = JSON.parse(data.serializedInputContext); + this.#data.topContextData = JSON.parse(data.serializedInputContext); } catch (e) { console.error(e); this.removeTooltip(); } } } + /** * Stores credentials locally * @param {CredentialsObject[]} credentials */ - - storeLocalCredentials(credentials) { credentials.forEach(cred => delete cred.password); - _classPrivateFieldGet(this, _data2).credentials = credentials; + this.#data.credentials = credentials; } - getTopContextData() { - return _classPrivateFieldGet(this, _data2).topContextData; + return this.#data.topContextData; } + /** * @deprecated use `availableInputTypes.credentials` directly instead * @returns {boolean} */ - - get hasLocalCredentials() { - return _classPrivateFieldGet(this, _data2).credentials.length > 0; + return this.#data.credentials.length > 0; } - getLocalCredentials() { - return _classPrivateFieldGet(this, _data2).credentials.map(cred => { + return this.#data.credentials.map(cred => { const { password, ...rest @@ -8563,51 +8213,44 @@ class InterfacePrototype { * @deprecated use `availableInputTypes.identities` directly instead * @returns {boolean} */ - - get hasLocalIdentities() { - return _classPrivateFieldGet(this, _data2).identities.length > 0; + return this.#data.identities.length > 0; } - getLocalIdentities() { - return _classPrivateFieldGet(this, _data2).identities; + return this.#data.identities; } + /** * @deprecated use `availableInputTypes.creditCards` directly instead * @returns {boolean} */ - - get hasLocalCreditCards() { - return _classPrivateFieldGet(this, _data2).creditCards.length > 0; + return this.#data.creditCards.length > 0; } /** @return {CreditCardObject[]} */ - - getLocalCreditCards() { - return _classPrivateFieldGet(this, _data2).creditCards; + return this.#data.creditCards; } - async startInit() { if (this.isInitializationStarted) return; this.alreadyInitialized = true; await this.refreshSettings(); this.addDeviceListeners(); await this.setupAutofill(); - this.uiController = this.createUIController(); // this is the temporary measure to support windows whilst we still have 'setupAutofill' - // eventually all interfaces will use this + this.uiController = this.createUIController(); + // this is the temporary measure to support windows whilst we still have 'setupAutofill' + // eventually all interfaces will use this if (!this.isEnabledViaSettings()) { return; } - await this.setupSettingsPage(); await this.postInit(); - if (this.settings.featureToggles.credentials_saving) { (0, _initFormSubmissionsApi.initFormSubmissionsApi)(this.scanner.forms, this.scanner.matching); } } + /** * This is to aid the migration to all platforms using Settings.enabled. * @@ -8619,11 +8262,10 @@ class InterfacePrototype { * * @returns {boolean} */ - - isEnabledViaSettings() { return true; } + /** * This is a fall-back situation for macOS since it was the only * platform to support anything none-email based in the past. @@ -8632,20 +8274,15 @@ class InterfacePrototype { * * @returns {Promise} */ - - async refreshSettings() { await this.settings.refresh(); } - async isEnabled() { return (0, _autofillUtils.autofillEnabled)(this.globalConfig); } - async init() { const isEnabled = await this.isEnabled(); if (!isEnabled) return; - const handler = async () => { if (document.readyState === 'complete') { window.removeEventListener('load', handler); @@ -8653,7 +8290,6 @@ class InterfacePrototype { await this.startInit(); } }; - if (document.readyState === 'complete') { await this.startInit(); } else { @@ -8661,12 +8297,10 @@ class InterfacePrototype { document.addEventListener('readystatechange', handler); } } - postInit() { const cleanup = this.scanner.init(); this.addLogoutListener(() => { cleanup('Logged out'); - if (this.globalConfig.isDDGDomain) { (0, _autofillUtils.notifyWebApp)({ deviceSignedIn: { @@ -8676,19 +8310,18 @@ class InterfacePrototype { } }); } + /** * @deprecated This was a port from the macOS implementation so the API may not be suitable for all * @returns {Promise} */ - - async getSelectedCredentials() { throw new Error('`getSelectedCredentials` not implemented'); } - isTestMode() { return this.globalConfig.isDDGTestMode; } + /** * This indicates an item was selected on Desktop, and we should try to autofill * @@ -8698,35 +8331,30 @@ class InterfacePrototype { * @param {IdentityObject|CreditCardObject|CredentialsObject|{email:string, id: string}} data * @param {string} type */ - - async selectedDetail(data, type) { const form = this.activeForm; - if (!form) { return; - } // are we autofilling email? - + } + // are we autofilling email? if (type === 'email' && 'email' in data) { form.autofillEmail(data.email); } else { form.autofillData(data, type); } - const isPrivateAddress = data.id === 'privateAddress'; + /** * This is desktop only: was it a private address? if so, save it with * the trigger 'emailProtection' so that native sides can use it */ - if (isPrivateAddress) { this.refreshAlias(); - if ('emailAddress' in data && data.emailAddress) { this.emailProtection.storeReceived(data.emailAddress); - /** @type {DataStorageObject} */ + /** @type {DataStorageObject} */ const formValues = { credentials: { username: data.emailAddress, @@ -8736,9 +8364,9 @@ class InterfacePrototype { this.storeFormData(formValues, 'emailProtection'); } } - await this.removeTooltip(); } + /** * Before the DataWebTooltip opens, we collect the data based on the config.type * @param {InputTypeConfigs} config @@ -8746,19 +8374,14 @@ class InterfacePrototype { * @param {TopContextData} [data] * @returns {(CredentialsObject|CreditCardObject|IdentityObject)[]} */ - - dataForAutofill(config, inputType, data) { const subtype = (0, _matching.getSubtypeFromType)(inputType); - if (config.type === 'identities') { return this.getLocalIdentities().filter(identity => !!identity[subtype]); } - if (config.type === 'creditCards') { return this.getLocalCreditCards(); } - if (config.type === 'credentials') { if (data) { if (Array.isArray(data.credentials) && data.credentials.length > 0) { @@ -8768,9 +8391,9 @@ class InterfacePrototype { } } } - return []; } + /** * @param {object} params * @param {import("../Form/Form").Form} params.form @@ -8779,35 +8402,31 @@ class InterfacePrototype { * @param {import('../deviceApiCalls/__generated__/validators-ts').GetAutofillDataRequest['trigger']} params.trigger * @param {import('../UI/controllers/UIController.js').AttachArgs["triggerMetaData"]} params.triggerMetaData */ - - attachTooltip(params) { - var _this$uiController2; - const { form, input, click, trigger - } = params; // Avoid flashing tooltip from background tabs on macOS - - if (document.visibilityState !== 'visible' && trigger !== 'postSignup') return; // Only autoprompt on mobile devices - - if (trigger === 'autoprompt' && !this.globalConfig.isMobileApp) return; // Only fire autoprompt once - + } = params; + // Avoid flashing tooltip from background tabs on macOS + if (document.visibilityState !== 'visible' && trigger !== 'postSignup') return; + // Only autoprompt on mobile devices + if (trigger === 'autoprompt' && !this.globalConfig.isMobileApp) return; + // Only fire autoprompt once if (trigger === 'autoprompt' && this.autopromptFired) return; form.activeInput = input; this.activeForm = form; const inputType = (0, _matching.getInputType)(input); - /** @type {PosFn} */ + /** @type {PosFn} */ const getPosition = () => { // In extensions, the tooltip is centered on the Dax icon const alignLeft = this.globalConfig.isApp || this.globalConfig.isWindows; return alignLeft ? input.getBoundingClientRect() : (0, _autofillUtils.getDaxBoundingBox)(input); - }; // todo: this will be migrated to use NativeUIController soon - + }; + // todo: this will be migrated to use NativeUIController soon if (this.globalConfig.isMobileApp && inputType === 'identities.emailAddress') { this.getAlias().then(alias => { if (alias) { @@ -8816,31 +8435,28 @@ class InterfacePrototype { * We're on mobile here, so we just record the email received. * Then later in the form submission we can compare the values */ - this.emailProtection.storeReceived(alias); } else { - var _form$activeInput; + form.activeInput?.focus(); + } - (_form$activeInput = form.activeInput) === null || _form$activeInput === void 0 ? void 0 : _form$activeInput.focus(); - } // Update data from native-side in case the `getAlias` call + // Update data from native-side in case the `getAlias` call // has included a successful in-context signup - - this.updateForStateChange(); this.onFinishedAutofill(); }); return; } - /** @type {TopContextData} */ - + /** @type {TopContextData} */ const topContextData = { inputType - }; // Allow features to append/change top context data - // for example, generated passwords may get appended here + }; + // Allow features to append/change top context data + // for example, generated passwords may get appended here const processedTopContext = this.preAttachTooltip(topContextData, input, form); - (_this$uiController2 = this.uiController) === null || _this$uiController2 === void 0 ? void 0 : _this$uiController2.attach({ + this.uiController?.attach({ input, form, click, @@ -8850,11 +8466,11 @@ class InterfacePrototype { trigger, triggerMetaData: params.triggerMetaData }); - if (trigger === 'autoprompt') { this.autopromptFired = true; } } + /** * When an item was selected, we then call back to the device * to fetch the full suite of data needed to complete the autofill @@ -8863,52 +8479,43 @@ class InterfacePrototype { * @param {(CreditCardObject|IdentityObject|CredentialsObject)[]} items * @param {CreditCardObject['id']|IdentityObject['id']|CredentialsObject['id']} id */ - - onSelect(inputType, items, id) { id = String(id); const mainType = (0, _matching.getMainTypeFromType)(inputType); const subtype = (0, _matching.getSubtypeFromType)(inputType); - if (id === _Credentials.PROVIDER_LOCKED) { return this.askToUnlockProvider(); } - const matchingData = items.find(item => String(item.id) === id); if (!matchingData) throw new Error('unreachable (fatal)'); - const dataPromise = (() => { switch (mainType) { case 'creditCards': return this.getAutofillCreditCard(id); - case 'identities': return this.getAutofillIdentity(id); - case 'credentials': { if (_Credentials.AUTOGENERATED_KEY in matchingData) { - const autogeneratedPayload = { ...matchingData, + const autogeneratedPayload = { + ...matchingData, username: '' }; return Promise.resolve({ success: autogeneratedPayload }); } - return this.getAutofillCredentials(id); } - default: throw new Error('unreachable!'); } - })(); // wait for the data back from the device - + })(); + // wait for the data back from the device dataPromise.then(response => { if (response) { const data = response.success || response; - if (mainType === 'identities') { this.firePixel({ pixelName: 'autofill_identity', @@ -8916,35 +8523,29 @@ class InterfacePrototype { fieldType: subtype } }); - switch (id) { case 'personalAddress': this.firePixel({ pixelName: 'autofill_personal_address' }); break; - case 'privateAddress': this.firePixel({ pixelName: 'autofill_private_address' }); break; - default: // Also fire pixel when filling an identity with the personal duck address from an email field - const checks = [subtype === 'emailAddress', this.hasLocalAddresses, (data === null || data === void 0 ? void 0 : data.emailAddress) === (0, _autofillUtils.formatDuckAddress)(_classPrivateFieldGet(this, _addresses).personalAddress)]; - + const checks = [subtype === 'emailAddress', this.hasLocalAddresses, data?.emailAddress === (0, _autofillUtils.formatDuckAddress)(this.#addresses.personalAddress)]; if (checks.every(Boolean)) { this.firePixel({ pixelName: 'autofill_personal_address' }); } - break; } - } // some platforms do not include a `success` object, why? - - + } + // some platforms do not include a `success` object, why? return this.selectedDetail(data, mainType); } else { return Promise.reject(new Error('none-success response')); @@ -8954,91 +8555,68 @@ class InterfacePrototype { return this.removeTooltip(); }); } - async askToUnlockProvider() { const response = await this.deviceApi.request(new _deviceApiCalls.AskToUnlockProviderCall(null)); this.providerStatusUpdated(response); } - isTooltipActive() { - var _this$uiController$is, _this$uiController3, _this$uiController3$i; - - return (_this$uiController$is = (_this$uiController3 = this.uiController) === null || _this$uiController3 === void 0 ? void 0 : (_this$uiController3$i = _this$uiController3.isActive) === null || _this$uiController3$i === void 0 ? void 0 : _this$uiController3$i.call(_this$uiController3)) !== null && _this$uiController$is !== void 0 ? _this$uiController$is : false; + return this.uiController?.isActive?.() ?? false; } - removeTooltip() { - var _this$uiController4, _this$uiController4$r; - - return (_this$uiController4 = this.uiController) === null || _this$uiController4 === void 0 ? void 0 : (_this$uiController4$r = _this$uiController4.removeTooltip) === null || _this$uiController4$r === void 0 ? void 0 : _this$uiController4$r.call(_this$uiController4, 'interface'); + return this.uiController?.removeTooltip?.('interface'); } - onFinishedAutofill() { - var _this$activeForm, _this$activeForm$acti; - // Let input handlers know we've stopped autofilling - (_this$activeForm = this.activeForm) === null || _this$activeForm === void 0 ? void 0 : (_this$activeForm$acti = _this$activeForm.activeInput) === null || _this$activeForm$acti === void 0 ? void 0 : _this$activeForm$acti.dispatchEvent(new Event('mouseleave')); + this.activeForm?.activeInput?.dispatchEvent(new Event('mouseleave')); } - async updateForStateChange() { - var _this$activeForm2, _this$activeForm3; - // Remove decorations before refreshing data to make sure we // remove the currently set icons - (_this$activeForm2 = this.activeForm) === null || _this$activeForm2 === void 0 ? void 0 : _this$activeForm2.removeAllDecorations(); // Update for any state that may have changed + this.activeForm?.removeAllDecorations(); - await this.refreshData(); // Add correct icons and behaviour + // Update for any state that may have changed + await this.refreshData(); - (_this$activeForm3 = this.activeForm) === null || _this$activeForm3 === void 0 ? void 0 : _this$activeForm3.recategorizeAllInputs(); + // Add correct icons and behaviour + this.activeForm?.recategorizeAllInputs(); } - async refreshData() { - var _this$inContextSignup; - - await ((_this$inContextSignup = this.inContextSignup) === null || _this$inContextSignup === void 0 ? void 0 : _this$inContextSignup.refreshData()); + await this.inContextSignup?.refreshData(); await this.settings.populateData(); } - async setupSettingsPage() { let { shouldLog } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : { shouldLog: false }; - if (!this.globalConfig.isDDGDomain) { return; } - (0, _autofillUtils.notifyWebApp)({ isApp: this.globalConfig.isApp }); - if (this.isDeviceSignedIn()) { let userData; - try { userData = await this.getUserData(); } catch (e) {} - let capabilities; - try { capabilities = await this.getEmailProtectionCapabilities(); - } catch (e) {} // Set up listener for web app actions - + } catch (e) {} + // Set up listener for web app actions if (this.globalConfig.isDDGDomain) { window.addEventListener('message', e => { if (e.data.removeUserData) { this.removeUserData(); } - if (e.data.closeEmailProtection) { this.closeEmailProtection(); } }); } - const hasUserData = userData && !userData.error && Object.entries(userData).length > 0; (0, _autofillUtils.notifyWebApp)({ deviceSignedIn: { @@ -9052,43 +8630,35 @@ class InterfacePrototype { this.trySigningIn(); } } - async setupAutofill() {} - /** @returns {Promise} */ - + /** @returns {Promise} */ async getAddresses() { throw new Error('unimplemented'); } - /** @returns {Promise>} */ - + /** @returns {Promise>} */ getUserData() { return Promise.resolve(null); } - /** @returns {void} */ - - removeUserData() {} /** @returns {void} */ + removeUserData() {} - + /** @returns {void} */ closeEmailProtection() {} - /** @returns {Promise>} */ - + /** @returns {Promise>} */ getEmailProtectionCapabilities() { throw new Error('unimplemented'); } - refreshAlias() {} - async trySigningIn() { if (this.globalConfig.isDDGDomain) { if (this.attempts < 10) { this.attempts++; - const data = await (0, _autofillUtils.sendAndWaitForAnswer)(_autofillUtils.SIGN_IN_MSG, 'addUserData'); // This call doesn't send a response, so we can't know if it succeeded - + const data = await (0, _autofillUtils.sendAndWaitForAnswer)(_autofillUtils.SIGN_IN_MSG, 'addUserData'); + // This call doesn't send a response, so we can't know if it succeeded this.storeUserData(data); await this.setupAutofill(); await this.refreshSettings(); @@ -9101,37 +8671,32 @@ class InterfacePrototype { } } } - storeUserData(_data) {} - addDeviceListeners() {} + /** * Called by the native layer on all tabs when the provider status is updated * @param {import("../deviceApiCalls/__generated__/validators-ts").ProviderStatusUpdated} data */ - - providerStatusUpdated(data) { try { - var _this$uiController5, _availableInputTypes$; - const { credentials, availableInputTypes - } = (0, _index.validate)(data, _validatorsZod.providerStatusUpdatedSchema); // Update local settings and data + } = (0, _index.validate)(data, _validatorsZod.providerStatusUpdatedSchema); + // Update local settings and data this.settings.setAvailableInputTypes(availableInputTypes); - this.storeLocalCredentials(credentials); // rerender the tooltip - - (_this$uiController5 = this.uiController) === null || _this$uiController5 === void 0 ? void 0 : _this$uiController5.updateItems(credentials); // If the tooltip is open on an autofill type that's not available, close it + this.storeLocalCredentials(credentials); + // rerender the tooltip + this.uiController?.updateItems(credentials); + // If the tooltip is open on an autofill type that's not available, close it const currentInputSubtype = (0, _matching.getSubtypeFromType)(this.getCurrentInputType()); - - if (!((_availableInputTypes$ = availableInputTypes.credentials) !== null && _availableInputTypes$ !== void 0 && _availableInputTypes$[currentInputSubtype])) { + if (!availableInputTypes.credentials?.[currentInputSubtype]) { this.removeTooltip(); - } // Redecorate fields according to the new types - - + } + // Redecorate fields according to the new types this.scanner.forms.forEach(form => form.recategorizeAllInputs()); } catch (e) { if (this.globalConfig.isDDGTestMode) { @@ -9139,66 +8704,53 @@ class InterfacePrototype { } } } - /** @param {() => void} _fn */ - + /** @param {() => void} _fn */ addLogoutListener(_fn) {} - isDeviceSignedIn() { return false; } /** * @returns {Promise} */ - - async getAlias() { return undefined; - } // PM endpoints - - + } + // PM endpoints getAccounts() {} /** * Gets credentials ready for autofill * @param {CredentialsObject['id']} id - the credential id * @returns {Promise} */ - - async getAutofillCredentials(id) { return this.deviceApi.request(new _deviceApiCalls.GetAutofillCredentialsCall({ id: String(id) })); } /** @returns {APIResponse} */ - - async getAutofillCreditCard(_id) { throw new Error('getAutofillCreditCard unimplemented'); } /** @returns {Promise<{success: IdentityObject|undefined}>} */ - - async getAutofillIdentity(_id) { throw new Error('getAutofillIdentity unimplemented'); } - openManagePasswords() {} - openManageCreditCards() {} - openManageIdentities() {} + /** * @param {StoreFormData} values * @param {StoreFormData['trigger']} trigger */ - - storeFormData(values, trigger) { - this.deviceApi.notify(new _deviceApiCalls.StoreFormDataCall({ ...values, + this.deviceApi.notify(new _deviceApiCalls.StoreFormDataCall({ + ...values, trigger })); } + /** * `preAttachTooltip` happens just before a tooltip is show - features may want to append some data * at this point. @@ -9210,27 +8762,25 @@ class InterfacePrototype { * @param {HTMLInputElement} input * @param {import("../Form/Form").Form} form */ - - preAttachTooltip(topContextData, input, form) { // A list of checks to determine if we need to generate a password - const checks = [topContextData.inputType === 'credentials.password', this.settings.featureToggles.password_generation, form.isSignup]; // if all checks pass, generate and save a password + const checks = [topContextData.inputType === 'credentials.password', this.settings.featureToggles.password_generation, form.isSignup]; + // if all checks pass, generate and save a password if (checks.every(Boolean)) { - var _rawValues$credential, _rawValues$identities; - const password = this.passwordGenerator.generate({ input: input.getAttribute('passwordrules'), domain: window.location.hostname }); const rawValues = form.getRawValues(); - const username = ((_rawValues$credential = rawValues.credentials) === null || _rawValues$credential === void 0 ? void 0 : _rawValues$credential.username) || ((_rawValues$identities = rawValues.identities) === null || _rawValues$identities === void 0 ? void 0 : _rawValues$identities.emailAddress) || ''; // append the new credential to the topContextData so that the top autofill can display it + const username = rawValues.credentials?.username || rawValues.identities?.emailAddress || ''; + // append the new credential to the topContextData so that the top autofill can display it topContextData.credentials = [(0, _Credentials.fromPassword)(password, username)]; } - return topContextData; } + /** * `postAutofill` gives features an opportunity to perform an action directly * following an autofill. @@ -9241,17 +8791,13 @@ class InterfacePrototype { * @param {SupportedMainTypes} dataType * @param {import("../Form/Form").Form} formObj */ - - postAutofill(data, dataType, formObj) { // If there's an autogenerated password, prompt to save - if (_Credentials.AUTOGENERATED_KEY in data && 'password' in data && // Don't send message on Android to avoid potential abuse. Data is saved on native confirmation instead. + if (_Credentials.AUTOGENERATED_KEY in data && 'password' in data && + // Don't send message on Android to avoid potential abuse. Data is saved on native confirmation instead. !this.globalConfig.isAndroid) { - var _formValues$credentia; - const formValues = formObj.getValuesReadyForStorage(); - - if (((_formValues$credentia = formValues.credentials) === null || _formValues$credentia === void 0 ? void 0 : _formValues$credentia.password) === data.password) { + if (formValues.credentials?.password === data.password) { /** @type {StoreFormData} */ const formData = (0, _Credentials.appendGeneratedKey)(formValues, { password: data.password @@ -9259,11 +8805,11 @@ class InterfacePrototype { this.storeFormData(formData, 'passwordGeneration'); } } - if (dataType === 'credentials' && formObj.shouldAutoSubmit) { formObj.attemptSubmissionIfNeeded(); } } + /** * `postSubmit` gives features a one-time-only opportunity to perform an * action directly after a form submission was observed. @@ -9275,13 +8821,10 @@ class InterfacePrototype { * @param {DataStorageObject} values * @param {import("../Form/Form").Form} form */ - - postSubmit(values, form) { if (!form.form) return; if (!form.hasValues(values)) return; const checks = [form.shouldPromptToStoreData, this.passwordGenerator.generated]; - if (checks.some(Boolean)) { const formData = (0, _Credentials.appendGeneratedKey)(values, { password: this.passwordGenerator.password, @@ -9290,69 +8833,50 @@ class InterfacePrototype { this.storeFormData(formData, 'formSubmission'); } } + /** * Sends a pixel to be fired on the client side * @param {import('../deviceApiCalls/__generated__/validators-ts').SendJSPixelParams} pixelParams */ - - firePixel(pixelParams) { this.deviceApi.notify(new _deviceApiCalls.SendJSPixelCall(pixelParams)); } + /** * This serves as a single place to create a default instance * of InterfacePrototype that can be useful in testing scenarios * @returns {InterfacePrototype} */ - - static default() { const globalConfig = (0, _config.createGlobalConfig)(); const transport = (0, _transports.createTransport)(globalConfig); const deviceApi = new _index.DeviceApi(transport); - const settings = _Settings.Settings.default(globalConfig, deviceApi); - return new InterfacePrototype(globalConfig, deviceApi, settings); } - } +var _default = exports.default = InterfacePrototype; -var _default = InterfacePrototype; -exports.default = _default; - -},{"../../packages/device-api/index.js":10,"../EmailProtection.js":30,"../Form/formatters.js":34,"../Form/matching.js":41,"../InputTypes/Credentials.js":43,"../PasswordGenerator.js":46,"../Scanner.js":47,"../Settings.js":48,"../UI/controllers/NativeUIController.js":54,"../autofill-utils.js":59,"../config.js":61,"../deviceApiCalls/__generated__/deviceApiCalls.js":63,"../deviceApiCalls/__generated__/validators.zod.js":64,"../deviceApiCalls/transports/transports.js":69,"./initFormSubmissionsApi.js":28}],26:[function(require,module,exports){ +},{"../../packages/device-api/index.js":12,"../EmailProtection.js":32,"../Form/formatters.js":36,"../Form/matching.js":43,"../InputTypes/Credentials.js":45,"../PasswordGenerator.js":48,"../Scanner.js":49,"../Settings.js":50,"../UI/controllers/NativeUIController.js":56,"../autofill-utils.js":61,"../config.js":63,"../deviceApiCalls/__generated__/deviceApiCalls.js":65,"../deviceApiCalls/__generated__/validators.zod.js":66,"../deviceApiCalls/transports/transports.js":71,"./initFormSubmissionsApi.js":30}],28:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.WindowsInterface = void 0; - var _InterfacePrototype = _interopRequireDefault(require("./InterfacePrototype.js")); - var _OverlayUIController = require("../UI/controllers/OverlayUIController.js"); - var _deviceApiCalls = require("../deviceApiCalls/__generated__/deviceApiCalls.js"); - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - /** * @typedef {import('../deviceApiCalls/__generated__/validators-ts').GetAutofillDataRequest} GetAutofillDataRequest */ -const EMAIL_PROTECTION_LOGOUT_MESSAGE = 'EMAIL_PROTECTION_LOGOUT'; +const EMAIL_PROTECTION_LOGOUT_MESSAGE = 'EMAIL_PROTECTION_LOGOUT'; class WindowsInterface extends _InterfacePrototype.default { - constructor() { - super(...arguments); - - _defineProperty(this, "ready", false); - - _defineProperty(this, "_abortController", null); - } - + ready = false; + /** @type {AbortController|null} */ + _abortController = null; /** * @deprecated This runs too early, and will be removed eventually. * @returns {Promise} @@ -9360,24 +8884,19 @@ class WindowsInterface extends _InterfacePrototype.default { async isEnabled() { return true; } - async setupAutofill() { const loggedIn = await this._getIsLoggedIn(); - if (loggedIn) { await this.getAddresses(); } } - isEnabledViaSettings() { return Boolean(this.settings.enabled); } - postInit() { super.postInit(); this.ready = true; } - createUIController() { /** * If we get here, we're just a controller for an overlay @@ -9387,20 +8906,18 @@ class WindowsInterface extends _InterfacePrototype.default { show: async details => this._show(details) }); } + /** * @param {GetAutofillDataRequest} details */ - - async _show(details) { const { mainType - } = details; // prevent overlapping listeners - + } = details; + // prevent overlapping listeners if (this._abortController && !this._abortController.signal.aborted) { this._abortController.abort(); } - this._abortController = new AbortController(); this.deviceApi.request(new _deviceApiCalls.GetAutofillDataCall(details), { signal: this._abortController.signal @@ -9408,35 +8925,26 @@ class WindowsInterface extends _InterfacePrototype.default { if (!this.activeForm) { throw new Error('this.currentAttached was absent'); } - switch (resp.action) { case 'fill': { if (mainType in resp) { - var _this$activeForm; - - (_this$activeForm = this.activeForm) === null || _this$activeForm === void 0 ? void 0 : _this$activeForm.autofillData(resp[mainType], mainType); + this.activeForm?.autofillData(resp[mainType], mainType); } else { - throw new Error("action: \"fill\" cannot occur because \"".concat(mainType, "\" was missing")); + throw new Error(`action: "fill" cannot occur because "${mainType}" was missing`); } - break; } - case 'focus': { - var _this$activeForm2, _this$activeForm2$act; - - (_this$activeForm2 = this.activeForm) === null || _this$activeForm2 === void 0 ? void 0 : (_this$activeForm2$act = _this$activeForm2.activeInput) === null || _this$activeForm2$act === void 0 ? void 0 : _this$activeForm2$act.focus(); + this.activeForm?.activeInput?.focus(); break; } - case 'none': { // do nothing break; } - default: { if (this.globalConfig.isDDGTestMode) { @@ -9444,7 +8952,6 @@ class WindowsInterface extends _InterfacePrototype.default { } } } - return this._closeAutofillParent(); }).catch(e => { if (this.globalConfig.isDDGTestMode) { @@ -9456,14 +8963,14 @@ class WindowsInterface extends _InterfacePrototype.default { } }); } + /** * @returns {Promise} */ - - async _closeAutofillParent() { return this.deviceApi.notify(new _deviceApiCalls.CloseAutofillParentCall(null)); } + /** * Email Protection calls */ @@ -9471,20 +8978,14 @@ class WindowsInterface extends _InterfacePrototype.default { /** * @returns {Promise} */ - - getEmailProtectionCapabilities() { return this.deviceApi.request(new _deviceApiCalls.EmailProtectionGetCapabilitiesCall({})); } - async _getIsLoggedIn() { const isLoggedIn = await this.deviceApi.request(new _deviceApiCalls.EmailProtectionGetIsLoggedInCall({})); - this.isDeviceSignedIn = () => isLoggedIn; - return isLoggedIn; } - addLogoutListener(handler) { // Only deal with logging out if we're in the email web app if (!this.globalConfig.isDDGDomain) return; @@ -9494,11 +8995,10 @@ class WindowsInterface extends _InterfacePrototype.default { } }); } + /** * @returns {Promise} */ - - storeUserData(_ref) { let { addUserData @@ -9508,55 +9008,39 @@ class WindowsInterface extends _InterfacePrototype.default { /** * @returns {Promise} */ - - removeUserData() { return this.deviceApi.request(new _deviceApiCalls.EmailProtectionRemoveUserDataCall({})); } /** * @returns {Promise} */ - - getUserData() { return this.deviceApi.request(new _deviceApiCalls.EmailProtectionGetUserDataCall({})); } - async refreshAlias() { const addresses = await this.deviceApi.request(new _deviceApiCalls.EmailProtectionRefreshPrivateAddressCall({})); this.storeLocalAddresses(addresses); } - async getAddresses() { const addresses = await this.deviceApi.request(new _deviceApiCalls.EmailProtectionGetAddressesCall({})); this.storeLocalAddresses(addresses); return addresses; } - } - exports.WindowsInterface = WindowsInterface; -},{"../UI/controllers/OverlayUIController.js":55,"../deviceApiCalls/__generated__/deviceApiCalls.js":63,"./InterfacePrototype.js":25}],27:[function(require,module,exports){ +},{"../UI/controllers/OverlayUIController.js":57,"../deviceApiCalls/__generated__/deviceApiCalls.js":65,"./InterfacePrototype.js":27}],29:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.WindowsOverlayDeviceInterface = void 0; - var _InterfacePrototype = _interopRequireDefault(require("./InterfacePrototype.js")); - var _HTMLTooltipUIController = require("../UI/controllers/HTMLTooltipUIController.js"); - var _deviceApiCalls = require("../deviceApiCalls/__generated__/deviceApiCalls.js"); - var _overlayApi = require("./overlayApi.js"); - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - /** * This subclass is designed to separate code that *only* runs inside the * Windows Overlay into a single place. @@ -9565,17 +9049,18 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope * this is another DeviceInterface */ class WindowsOverlayDeviceInterface extends _InterfacePrototype.default { - constructor() { - super(...arguments); - - _defineProperty(this, "stripCredentials", false); - - _defineProperty(this, "overlay", (0, _overlayApi.overlayApi)(this)); - - _defineProperty(this, "previousScreenX", 0); + /** + * Mark top frame as not stripping credential data + * @type {boolean} + */ + stripCredentials = false; - _defineProperty(this, "previousScreenY", 0); - } + /** + * overlay API helpers + */ + overlay = (0, _overlayApi.overlayApi)(this); + previousScreenX = 0; + previousScreenY = 0; /** * Because we're running inside the Overlay, we always create the HTML @@ -9586,9 +9071,7 @@ class WindowsOverlayDeviceInterface extends _InterfacePrototype.default { */ createUIController() { return new _HTMLTooltipUIController.HTMLTooltipUIController({ - tooltipKind: - /** @type {const} */ - 'modern', + tooltipKind: /** @type {const} */'modern', device: this }, { wrapperClass: 'top-autofill', @@ -9596,14 +9079,12 @@ class WindowsOverlayDeviceInterface extends _InterfacePrototype.default { setSize: details => this.deviceApi.notify(new _deviceApiCalls.SetSizeCall(details)), remove: async () => this._closeAutofillParent(), testMode: this.isTestMode(), - /** * Note: This is needed because Mutation observer didn't support visibility checks on Windows */ checkVisibility: false }); } - addDeviceListeners() { /** * On Windows (vs. MacOS) we can use the built-in `mousemove` @@ -9613,58 +9094,51 @@ class WindowsOverlayDeviceInterface extends _InterfacePrototype.default { * page load every time it's opened. */ window.addEventListener('mousemove', event => { - var _this$uiController, _this$uiController$ge; - // Don't set focus if the mouse hasn't moved ever // This is to avoid clickjacking where an attacker puts the pulldown under the cursor // and tricks the user into clicking - if (!this.previousScreenX && !this.previousScreenY || // if no previous coords + if (!this.previousScreenX && !this.previousScreenY || + // if no previous coords this.previousScreenX === event.screenX && this.previousScreenY === event.screenY // or the mouse hasn't moved ) { this.previousScreenX = event.screenX; this.previousScreenY = event.screenY; return; } - - const activeTooltip = (_this$uiController = this.uiController) === null || _this$uiController === void 0 ? void 0 : (_this$uiController$ge = _this$uiController.getActiveTooltip) === null || _this$uiController$ge === void 0 ? void 0 : _this$uiController$ge.call(_this$uiController); - activeTooltip === null || activeTooltip === void 0 ? void 0 : activeTooltip.focus(event.x, event.y); + const activeTooltip = this.uiController?.getActiveTooltip?.(); + activeTooltip?.focus(event.x, event.y); this.previousScreenX = event.screenX; this.previousScreenY = event.screenY; }); return super.addDeviceListeners(); } + /** * @returns {Promise} */ - - async _closeAutofillParent() { return this.deviceApi.notify(new _deviceApiCalls.CloseAutofillParentCall(null)); } + /** * @returns {Promise} */ - - openManagePasswords() { return this.deviceApi.notify(new _deviceApiCalls.OpenManagePasswordsCall({})); } /** * @returns {Promise} */ - - openManageCreditCards() { return this.deviceApi.notify(new _deviceApiCalls.OpenManageCreditCardsCall({})); } /** * @returns {Promise} */ - - openManageIdentities() { return this.deviceApi.notify(new _deviceApiCalls.OpenManageIdentitiesCall({})); } + /** * Since we're running inside the Overlay we can limit what happens here to * be only things that are needed to power the HTML Tooltip @@ -9672,25 +9146,21 @@ class WindowsOverlayDeviceInterface extends _InterfacePrototype.default { * @override * @returns {Promise} */ - - async setupAutofill() { const loggedIn = await this._getIsLoggedIn(); - if (loggedIn) { await this.getAddresses(); } - - const response = await this.deviceApi.request(new _deviceApiCalls.GetAutofillInitDataCall(null)); // @ts-ignore - + const response = await this.deviceApi.request(new _deviceApiCalls.GetAutofillInitDataCall(null)); + // @ts-ignore this.storeLocalData(response); } - async postInit() { // setup overlay API pieces this.overlay.showImmediately(); super.postInit(); } + /** * In the top-frame scenario, we send a message to the native * side to indicate a selection. Once received, the native side will store that selection so that a @@ -9700,64 +9170,53 @@ class WindowsOverlayDeviceInterface extends _InterfacePrototype.default { * @param {IdentityObject|CreditCardObject|CredentialsObject|{email:string, id: string}} data * @param {string} type */ - - async selectedDetail(data, type) { return this.overlay.selectedDetail(data, type); } + /** * Email Protection calls */ - async _getIsLoggedIn() { const isLoggedIn = await this.deviceApi.request(new _deviceApiCalls.EmailProtectionGetIsLoggedInCall({})); - this.isDeviceSignedIn = () => isLoggedIn; - return isLoggedIn; } - async getAddresses() { const addresses = await this.deviceApi.request(new _deviceApiCalls.EmailProtectionGetAddressesCall({})); this.storeLocalAddresses(addresses); return addresses; } + /** * Gets a single identity obj once the user requests it * @param {Number} id * @returns {Promise<{success: IdentityObject|undefined}>} */ - - getAutofillIdentity(id) { const identity = this.getLocalIdentities().find(_ref => { let { id: identityId } = _ref; - return "".concat(identityId) === "".concat(id); + return `${identityId}` === `${id}`; }); return Promise.resolve({ success: identity }); } - } - exports.WindowsOverlayDeviceInterface = WindowsOverlayDeviceInterface; -},{"../UI/controllers/HTMLTooltipUIController.js":53,"../deviceApiCalls/__generated__/deviceApiCalls.js":63,"./InterfacePrototype.js":25,"./overlayApi.js":29}],28:[function(require,module,exports){ +},{"../UI/controllers/HTMLTooltipUIController.js":55,"../deviceApiCalls/__generated__/deviceApiCalls.js":65,"./InterfacePrototype.js":27,"./overlayApi.js":31}],30:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.initFormSubmissionsApi = initFormSubmissionsApi; - var _autofillUtils = require("../autofill-utils.js"); - var _labelUtil = require("../Form/label-util.js"); - /** * This is a single place to contain all functionality relating to form submission detection * @@ -9769,99 +9228,86 @@ function initFormSubmissionsApi(forms, matching) { * Global submit events */ window.addEventListener('submit', e => { - var _forms$get; - // @ts-ignore - return (_forms$get = forms.get(e.target)) === null || _forms$get === void 0 ? void 0 : _forms$get.submitHandler('global submit event'); + return forms.get(e.target)?.submitHandler('global submit event'); }, true); + /** * Global keydown events */ - window.addEventListener('keydown', e => { if (e.key === 'Enter') { const focusedForm = [...forms.values()].find(form => form.hasFocus(e)); - focusedForm === null || focusedForm === void 0 ? void 0 : focusedForm.submitHandler('global keydown + Enter'); + focusedForm?.submitHandler('global keydown + Enter'); } }); + /** * Global pointer down events * @param {PointerEvent} event */ - window.addEventListener('pointerdown', event => { const matchingForm = [...forms.values()].find(form => { - const btns = [...form.submitButtons]; // @ts-ignore - - if (btns.includes(event.target)) return true; // @ts-ignore + const btns = [...form.submitButtons]; + // @ts-ignore + if (btns.includes(event.target)) return true; + // @ts-ignore if (btns.find(btn => btn.contains(event.target))) return true; }); - matchingForm === null || matchingForm === void 0 ? void 0 : matchingForm.submitHandler('global pointerdown event + matching form'); - + matchingForm?.submitHandler('global pointerdown event + matching form'); if (!matchingForm) { - var _event$target, _matching$getDDGMatch, _event$target2; - - const selector = matching.cssSelector('submitButtonSelector') + ', a[href="#"], a[href^=javascript], *[onclick], [class*=button i]'; // check if the click happened on a button - - const button = - /** @type HTMLElement */ - (_event$target = event.target) === null || _event$target === void 0 ? void 0 : _event$target.closest(selector); + const selector = matching.cssSelector('submitButtonSelector') + ', a[href="#"], a[href^=javascript], *[onclick], [class*=button i]'; + // check if the click happened on a button + const button = /** @type HTMLElement */event.target?.closest(selector); if (!button) return; const text = (0, _autofillUtils.getTextShallow)(button) || (0, _labelUtil.extractElementStrings)(button).join(' '); - const hasRelevantText = (_matching$getDDGMatch = matching.getDDGMatcherRegex('submitButtonRegex')) === null || _matching$getDDGMatch === void 0 ? void 0 : _matching$getDDGMatch.test(text); - + const hasRelevantText = matching.getDDGMatcherRegex('submitButtonRegex')?.test(text); if (hasRelevantText && text.length < 25) { // check if there's a form with values const filledForm = [...forms.values()].find(form => form.hasValues()); - - if (filledForm && (0, _autofillUtils.buttonMatchesFormType)( - /** @type HTMLElement */ - button, filledForm)) { - filledForm === null || filledForm === void 0 ? void 0 : filledForm.submitHandler('global pointerdown event + filled form'); + if (filledForm && (0, _autofillUtils.buttonMatchesFormType)( /** @type HTMLElement */button, filledForm)) { + filledForm?.submitHandler('global pointerdown event + filled form'); } - } // TODO: Temporary hack to support Google signin in different languages - // https://app.asana.com/0/1198964220583541/1201650539303898/f - + } - if ( - /** @type HTMLElement */ - (_event$target2 = event.target) !== null && _event$target2 !== void 0 && _event$target2.closest('#passwordNext button, #identifierNext button')) { + // TODO: Temporary hack to support Google signin in different languages + // https://app.asana.com/0/1198964220583541/1201650539303898/f + if ( /** @type HTMLElement */event.target?.closest('#passwordNext button, #identifierNext button')) { // check if there's a form with values const filledForm = [...forms.values()].find(form => form.hasValues()); - filledForm === null || filledForm === void 0 ? void 0 : filledForm.submitHandler('global pointerdown event + google escape hatch'); + filledForm?.submitHandler('global pointerdown event + google escape hatch'); } } }, true); + /** * @type {PerformanceObserver} */ - const observer = new PerformanceObserver(list => { - const entries = list.getEntries().filter(entry => // @ts-ignore why does TS not know about `entry.initiatorType`? + const entries = list.getEntries().filter(entry => + // @ts-ignore why does TS not know about `entry.initiatorType`? ['fetch', 'xmlhttprequest'].includes(entry.initiatorType) && /login|sign-in|signin/.test(entry.name)); if (!entries.length) return; const filledForm = [...forms.values()].find(form => form.hasValues()); - const focusedForm = [...forms.values()].find(form => form.hasFocus()); // If a form is still focused the user is still typing: do nothing - + const focusedForm = [...forms.values()].find(form => form.hasFocus()); + // If a form is still focused the user is still typing: do nothing if (focusedForm) return; - filledForm === null || filledForm === void 0 ? void 0 : filledForm.submitHandler('performance observer'); + filledForm?.submitHandler('performance observer'); }); observer.observe({ entryTypes: ['resource'] }); } -},{"../Form/label-util.js":37,"../autofill-utils.js":59}],29:[function(require,module,exports){ +},{"../Form/label-util.js":39,"../autofill-utils.js":61}],31:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.overlayApi = overlayApi; - var _deviceApiCalls = require("../deviceApiCalls/__generated__/deviceApiCalls.js"); - /** * These are some re-usable parts for handling 'overlays' (like on macOS + Windows) * @@ -9873,11 +9319,10 @@ function overlayApi(device) { * When we are inside an 'overlay' - the HTML tooltip will be opened immediately */ showImmediately() { - var _device$uiController, _device$uiController$; - const topContextData = device.getTopContextData(); - if (!topContextData) throw new Error('unreachable, topContextData should be available'); // Provide dummy values + if (!topContextData) throw new Error('unreachable, topContextData should be available'); + // Provide dummy values const getPosition = () => { return { x: 0, @@ -9885,18 +9330,14 @@ function overlayApi(device) { height: 50, width: 50 }; - }; // Create the tooltip, and set it as active - - - const tooltip = (_device$uiController = device.uiController) === null || _device$uiController === void 0 ? void 0 : (_device$uiController$ = _device$uiController.createTooltip) === null || _device$uiController$ === void 0 ? void 0 : _device$uiController$.call(_device$uiController, getPosition, topContextData); + }; + // Create the tooltip, and set it as active + const tooltip = device.uiController?.createTooltip?.(getPosition, topContextData); if (tooltip) { - var _device$uiController2, _device$uiController3; - - (_device$uiController2 = device.uiController) === null || _device$uiController2 === void 0 ? void 0 : (_device$uiController3 = _device$uiController2.setActiveTooltip) === null || _device$uiController3 === void 0 ? void 0 : _device$uiController3.call(_device$uiController2, tooltip); + device.uiController?.setActiveTooltip?.(tooltip); } }, - /** * @param {IdentityObject|CreditCardObject|CredentialsObject|{email:string, id: string}} data * @param {string} type @@ -9909,117 +9350,77 @@ function overlayApi(device) { }); const entries = Object.fromEntries(detailsEntries); /** @link {import("../deviceApiCalls/schemas/getAutofillData.result.json")} */ - await device.deviceApi.notify(new _deviceApiCalls.SelectedDetailCall({ data: entries, configType: type })); } - }; } -},{"../deviceApiCalls/__generated__/deviceApiCalls.js":63}],30:[function(require,module,exports){ +},{"../deviceApiCalls/__generated__/deviceApiCalls.js":65}],32:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.EmailProtection = void 0; - -function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); } - -function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } } - -function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; } - -function _classApplyDescriptorSet(receiver, descriptor, value) { if (descriptor.set) { descriptor.set.call(receiver, value); } else { if (!descriptor.writable) { throw new TypeError("attempted to set read only private field"); } descriptor.value = value; } } - -function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); } - -function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); } - -function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; } - -var _previous = /*#__PURE__*/new WeakMap(); - /** * Use this as place to store any state or functionality related to Email Protection */ class EmailProtection { /** @type {string|null} */ + #previous = null; /** @param {import("./DeviceInterface/InterfacePrototype").default} device */ constructor(device) { - _classPrivateFieldInitSpec(this, _previous, { - writable: true, - value: null - }); - this.device = device; } - /** @returns {string|null} */ - + /** @returns {string|null} */ get lastGenerated() { - return _classPrivateFieldGet(this, _previous); + return this.#previous; } + /** * Store the last received email address * @param {string} emailAddress */ - - storeReceived(emailAddress) { - _classPrivateFieldSet(this, _previous, emailAddress); - + this.#previous = emailAddress; return emailAddress; } - } - exports.EmailProtection = EmailProtection; -},{}],31:[function(require,module,exports){ +},{}],33:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Form = void 0; - var _FormAnalyzer = _interopRequireDefault(require("./FormAnalyzer.js")); - var _autofillUtils = require("../autofill-utils.js"); - var _matching = require("./matching.js"); - var _inputStyles = require("./inputStyles.js"); - var _inputTypeConfig = require("./inputTypeConfig.js"); - var _formatters = require("./formatters.js"); - var _constants = require("../constants.js"); - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - const { ATTR_AUTOFILL, ATTR_INPUT_TYPE, MAX_FORM_MUT_OBS_COUNT, MAX_INPUTS_PER_FORM } = _constants.constants; - class Form { /** @type {import("../Form/matching").Matching} */ - + matching; /** @type {HTMLElement} */ - + form; /** @type {HTMLInputElement | null} */ - + activeInput; /** * @param {HTMLElement} form * @param {HTMLInputElement|HTMLSelectElement} input @@ -10029,19 +9430,12 @@ class Form { */ constructor(form, input, deviceInterface, matching) { let shouldAutoprompt = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false; - - _defineProperty(this, "matching", void 0); - - _defineProperty(this, "form", void 0); - - _defineProperty(this, "activeInput", void 0); - this.form = form; this.matching = matching || (0, _matching.createMatching)(); this.formAnalyzer = new _FormAnalyzer.default(form, input, matching); this.device = deviceInterface; - /** @type Record<'all' | SupportedMainTypes, Set> */ + /** @type Record<'all' | SupportedMainTypes, Set> */ this.inputs = { all: new Set(), credentials: new Set(), @@ -10051,16 +9445,16 @@ class Form { }; this.touched = new Set(); this.listeners = new Set(); - this.activeInput = null; // We set this to true to skip event listeners while we're autofilling - + this.activeInput = null; + // We set this to true to skip event listeners while we're autofilling this.isAutofilling = false; this.handlerExecuted = false; this.shouldPromptToStoreData = true; this.shouldAutoSubmit = this.device.globalConfig.isMobileApp; + /** * @type {IntersectionObserver | null} */ - this.intObs = new IntersectionObserver(entries => { for (const entry of entries) { if (!entry.isIntersecting) this.removeTooltip(); @@ -10073,7 +9467,6 @@ class Form { }; this.mutObs = new MutationObserver(records => { const anythingRemoved = records.some(record => record.removedNodes.length > 0); - if (anythingRemoved) { // Must check for inputs because a parent may be removed and not show up in record.removedNodes if ([...this.inputs.all].some(input => !input.isConnected)) { @@ -10082,15 +9475,16 @@ class Form { this.formAnalyzer = new _FormAnalyzer.default(this.form, input, this.matching); this.recategorizeAllInputs(); }); - this.mutObsCount++; // If the form mutates too much, disconnect to avoid performance issues - + this.mutObsCount++; + // If the form mutates too much, disconnect to avoid performance issues if (this.mutObsCount >= MAX_FORM_MUT_OBS_COUNT) { this.mutObs.disconnect(); } } } - }); // This ensures we fire the handler again if the form is changed + }); + // This ensures we fire the handler again if the form is changed this.addListener(form, 'input', () => { if (!this.isAutofilling) { this.handlerExecuted = false; @@ -10100,160 +9494,129 @@ class Form { this.categorizeInputs(); this.mutObs.observe(this.form, this.mutObsConfig); this.logFormInfo(); - if (shouldAutoprompt) { this.promptLoginIfNeeded(); } } - get isLogin() { return this.formAnalyzer.isLogin; } - get isSignup() { return this.formAnalyzer.isSignup; } - get isHybrid() { return this.formAnalyzer.isHybrid; } - get isCCForm() { return this.formAnalyzer.isCCForm(); } - logFormInfo() { if (!(0, _autofillUtils.shouldLog)()) return; - console.log("Form type: %c".concat(this.getFormType()), 'font-weight: bold'); + console.log(`Form type: %c${this.getFormType()}`, 'font-weight: bold'); console.log('Signals: ', this.formAnalyzer.signals); console.log('Wrapping element: ', this.form); console.log('Inputs: ', this.inputs); console.log('Submit Buttons: ', this.submitButtons); } - getFormType() { - if (this.isHybrid) return "hybrid (hybrid score: ".concat(this.formAnalyzer.hybridSignal, ", score: ").concat(this.formAnalyzer.autofillSignal, ")"); - if (this.isLogin) return "login (score: ".concat(this.formAnalyzer.autofillSignal, ", hybrid score: ").concat(this.formAnalyzer.hybridSignal, ")"); - if (this.isSignup) return "signup (score: ".concat(this.formAnalyzer.autofillSignal, ", hybrid score: ").concat(this.formAnalyzer.hybridSignal, ")"); + if (this.isHybrid) return `hybrid (hybrid score: ${this.formAnalyzer.hybridSignal}, score: ${this.formAnalyzer.autofillSignal})`; + if (this.isLogin) return `login (score: ${this.formAnalyzer.autofillSignal}, hybrid score: ${this.formAnalyzer.hybridSignal})`; + if (this.isSignup) return `signup (score: ${this.formAnalyzer.autofillSignal}, hybrid score: ${this.formAnalyzer.hybridSignal})`; return 'something went wrong'; } + /** * Checks if the form element contains the activeElement or the event target * @return {boolean} * @param {KeyboardEvent | null} [e] */ - - hasFocus(e) { - return this.form.contains(document.activeElement) || this.form.contains( - /** @type HTMLElement */ - e === null || e === void 0 ? void 0 : e.target); + return this.form.contains(document.activeElement) || this.form.contains( /** @type HTMLElement */e?.target); } - submitHandler() { - var _this$device$postSubm, _this$device; - let via = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'unknown'; - if (this.device.globalConfig.isDDGTestMode) { console.log('Form.submitHandler via:', via, this); } - if (this.handlerExecuted) return; const values = this.getValuesReadyForStorage(); - (_this$device$postSubm = (_this$device = this.device).postSubmit) === null || _this$device$postSubm === void 0 ? void 0 : _this$device$postSubm.call(_this$device, values, this); // mark this form as being handled + this.device.postSubmit?.(values, this); + // mark this form as being handled this.handlerExecuted = true; } + /** * Reads the values from the form without preparing to store them * @return {InternalDataStorageObject} */ - - getRawValues() { const formValues = [...this.inputs.credentials, ...this.inputs.identities, ...this.inputs.creditCards].reduce((output, inputEl) => { - var _output$mainType, _value; - const mainType = (0, _matching.getInputMainType)(inputEl); const subtype = (0, _matching.getInputSubtype)(inputEl); - let value = inputEl.value || ((_output$mainType = output[mainType]) === null || _output$mainType === void 0 ? void 0 : _output$mainType[subtype]); - + let value = inputEl.value || output[mainType]?.[subtype]; if (subtype === 'addressCountryCode') { value = (0, _formatters.inferCountryCodeFromElement)(inputEl); - } // Discard passwords that are shorter than 4 characters - - - if (subtype === 'password' && ((_value = value) === null || _value === void 0 ? void 0 : _value.length) <= 3) { + } + // Discard passwords that are shorter than 4 characters + if (subtype === 'password' && value?.length <= 3) { value = undefined; } - if (value) { output[mainType][subtype] = value; } - return output; }, { credentials: {}, creditCards: {}, identities: {} }); - if (formValues.credentials.password && !formValues.credentials.username && !formValues.identities.emailAddress) { // If we have a password but no username, let's search further - const hiddenFields = - /** @type [HTMLInputElement] */ - [...this.form.querySelectorAll('input[type=hidden]')]; + const hiddenFields = /** @type [HTMLInputElement] */[...this.form.querySelectorAll('input[type=hidden]')]; const probableField = hiddenFields.find(field => { - var _this$matching$getDDG; - - const regex = new RegExp('email|' + ((_this$matching$getDDG = this.matching.getDDGMatcherRegex('username')) === null || _this$matching$getDDG === void 0 ? void 0 : _this$matching$getDDG.source)); + const regex = new RegExp('email|' + this.matching.getDDGMatcherRegex('username')?.source); const attributeText = field.id + ' ' + field.name; - return regex === null || regex === void 0 ? void 0 : regex.test(attributeText); + return regex?.test(attributeText); }); - - if (probableField !== null && probableField !== void 0 && probableField.value) { + if (probableField?.value) { formValues.credentials.username = probableField.value; - } else if ( // If a form has phone + password(s) fields, save the phone as username + } else if ( + // If a form has phone + password(s) fields, save the phone as username formValues.identities.phone && this.inputs.all.size - this.inputs.unknown.size < 4) { formValues.credentials.username = formValues.identities.phone; } else { // If we still don't have a username, try scanning the form's text for an email address this.form.querySelectorAll(this.matching.cssSelector('safeUniversalSelector')).forEach(el => { - var _elText$match; - - const elText = (0, _autofillUtils.getTextShallow)(el); // Ignore long texts to avoid false positives - + const elText = (0, _autofillUtils.getTextShallow)(el); + // Ignore long texts to avoid false positives if (elText.length > 70) return; - const emailOrUsername = (_elText$match = elText.match( // https://www.emailregex.com/ - /[a-zA-Z\d.!#$%&’*+/=?^_`{|}~-]+@[a-zA-Z\d-]+(?:\.[a-zA-Z\d-]+)*/)) === null || _elText$match === void 0 ? void 0 : _elText$match[0]; - + const emailOrUsername = elText.match( + // https://www.emailregex.com/ + /[a-zA-Z\d.!#$%&’*+/=?^_`{|}~-]+@[a-zA-Z\d-]+(?:\.[a-zA-Z\d-]+)*/)?.[0]; if (emailOrUsername) { formValues.credentials.username = emailOrUsername; } }); } } - return formValues; } + /** * Return form values ready for storage * @returns {DataStorageObject} */ - - getValuesReadyForStorage() { const formValues = this.getRawValues(); return (0, _formatters.prepareFormValuesForStorage)(formValues); } + /** * Determine if the form has values we want to store in the device * @param {DataStorageObject} [values] * @return {boolean} */ - - hasValues(values) { const { credentials, @@ -10262,26 +9625,17 @@ class Form { } = values || this.getValuesReadyForStorage(); return Boolean(credentials || creditCards || identities); } - async removeTooltip() { - var _this$intObs; - const tooltip = this.device.isTooltipActive(); - if (this.isAutofilling || !tooltip) { return; } - await this.device.removeTooltip(); - (_this$intObs = this.intObs) === null || _this$intObs === void 0 ? void 0 : _this$intObs.disconnect(); + this.intObs?.disconnect(); } - showingTooltip(input) { - var _this$intObs2; - - (_this$intObs2 = this.intObs) === null || _this$intObs2 === void 0 ? void 0 : _this$intObs2.observe(input); + this.intObs?.observe(input); } - removeInputHighlight(input) { if (!input.classList.contains('ddg-autofilled')) return; (0, _autofillUtils.removeInlineStyles)(input, (0, _inputStyles.getIconStylesAutofilled)(input, this)); @@ -10291,31 +9645,27 @@ class Form { input.classList.remove('ddg-autofilled'); this.addAutofillStyles(input); } - resetIconStylesToInitial() { const input = this.activeInput; - if (input) { const initialStyles = (0, _inputStyles.getIconStylesBase)(input, this); (0, _autofillUtils.addInlineStyles)(input, initialStyles); } } - removeAllHighlights(e, dataType) { // This ensures we are not removing the highlight ourselves when autofilling more than once - if (e && !e.isTrusted) return; // If the user has changed the value, we prompt to update the stored data + if (e && !e.isTrusted) return; + // If the user has changed the value, we prompt to update the stored data this.shouldPromptToStoreData = true; this.execOnInputs(input => this.removeInputHighlight(input), dataType); } - removeInputDecoration(input) { (0, _autofillUtils.removeInlineStyles)(input, (0, _inputStyles.getIconStylesBase)(input, this)); (0, _autofillUtils.removeInlineStyles)(input, (0, _inputStyles.getIconStylesAlternate)(input, this)); input.removeAttribute(ATTR_AUTOFILL); input.removeAttribute(ATTR_INPUT_TYPE); } - removeAllDecorations() { this.execOnInputs(input => this.removeInputDecoration(input)); this.listeners.forEach(_ref => { @@ -10328,7 +9678,6 @@ class Form { return el.removeEventListener(type, fn, opts); }); } - redecorateAllInputs() { this.removeAllDecorations(); this.execOnInputs(input => { @@ -10337,11 +9686,10 @@ class Form { } }); } + /** * Removes all scoring attributes from the inputs and deletes them from memory */ - - forgetAllInputs() { this.execOnInputs(input => { input.removeAttribute(ATTR_AUTOFILL); @@ -10349,18 +9697,16 @@ class Form { }); Object.values(this.inputs).forEach(inputSet => inputSet.clear()); } + /** * Resets our input scoring and starts from scratch */ - - recategorizeAllInputs() { this.initialScanComplete = false; this.removeAllDecorations(); this.forgetAllInputs(); this.categorizeInputs(); } - resetAllInputs() { this.execOnInputs(input => { (0, _autofillUtils.setValue)(input, '', this.device.globalConfig); @@ -10369,12 +9715,10 @@ class Form { if (this.activeInput) this.activeInput.focus(); this.matching.clear(); } - dismissTooltip() { this.removeTooltip(); - } // This removes all listeners to avoid memory leaks and weird behaviours - - + } + // This removes all listeners to avoid memory leaks and weird behaviours destroy() { this.removeAllDecorations(); this.removeTooltip(); @@ -10383,21 +9727,16 @@ class Form { this.matching.clear(); this.intObs = null; } - categorizeInputs() { const selector = this.matching.cssSelector('formInputsSelector'); - if (this.form.matches(selector)) { this.addInput(this.form); } else { - let foundInputs = this.form.querySelectorAll(selector); // If the markup is broken form.querySelectorAll may not return the fields, so we select from the parent - + let foundInputs = this.form.querySelectorAll(selector); + // If the markup is broken form.querySelectorAll may not return the fields, so we select from the parent if (foundInputs.length === 0 && this.form instanceof HTMLFormElement && this.form.length > 0) { - var _this$form$parentElem; - - foundInputs = ((_this$form$parentElem = this.form.parentElement) === null || _this$form$parentElem === void 0 ? void 0 : _this$form$parentElem.querySelectorAll(selector)) || foundInputs; + foundInputs = this.form.parentElement?.querySelectorAll(selector) || foundInputs; } - if (foundInputs.length < MAX_INPUTS_PER_FORM) { foundInputs.forEach(input => this.addInput(input)); } else { @@ -10406,89 +9745,81 @@ class Form { } } } - this.initialScanComplete = true; } - get submitButtons() { const selector = this.matching.cssSelector('submitButtonSelector'); - const allButtons = - /** @type {HTMLElement[]} */ - [...this.form.querySelectorAll(selector)]; + const allButtons = /** @type {HTMLElement[]} */[...this.form.querySelectorAll(selector)]; return allButtons.filter(btn => (0, _autofillUtils.isPotentiallyViewable)(btn) && (0, _autofillUtils.isLikelyASubmitButton)(btn, this.matching) && (0, _autofillUtils.buttonMatchesFormType)(btn, this)); } - attemptSubmissionIfNeeded() { - if (!this.isLogin || // Only submit login forms + if (!this.isLogin || + // Only submit login forms this.submitButtons.length > 1 // Do not submit if we're unsure about the submit button - ) return; // check for visible empty fields before attemtping submission - // this is to avoid loops where a captcha keeps failing for the user + ) return; + // check for visible empty fields before attemtping submission + // this is to avoid loops where a captcha keeps failing for the user let isThereAnEmptyVisibleField = false; this.execOnInputs(input => { if (input.value === '' && (0, _autofillUtils.isPotentiallyViewable)(input)) isThereAnEmptyVisibleField = true; }, 'all', false); - if (isThereAnEmptyVisibleField) return; // We're not using .submit() to minimise breakage with client-side forms + if (isThereAnEmptyVisibleField) return; + // We're not using .submit() to minimise breakage with client-side forms this.submitButtons.forEach(button => { if ((0, _autofillUtils.isPotentiallyViewable)(button)) { button.click(); } }); } + /** * Executes a function on input elements. Can be limited to certain element types * @param {(input: HTMLInputElement|HTMLSelectElement) => void} fn * @param {'all' | SupportedMainTypes} inputType * @param {boolean} shouldCheckForDecorate */ - - execOnInputs(fn) { let inputType = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'all'; let shouldCheckForDecorate = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true; const inputs = this.inputs[inputType]; - for (const input of inputs) { - let canExecute = true; // sometimes we want to execute even if we didn't decorate - + let canExecute = true; + // sometimes we want to execute even if we didn't decorate if (shouldCheckForDecorate) { canExecute = (0, _inputTypeConfig.isFieldDecorated)(input); } - if (canExecute) fn(input); } } - addInput(input) { - var _this$device$settings; - - if (this.inputs.all.has(input)) return this; // If the form has too many inputs, destroy everything to avoid performance issues + if (this.inputs.all.has(input)) return this; + // If the form has too many inputs, destroy everything to avoid performance issues if (this.inputs.all.size > MAX_INPUTS_PER_FORM) { if ((0, _autofillUtils.shouldLog)()) { console.log('The form has too many inputs, destroying.'); } - this.destroy(); return this; - } // When new inputs are added after the initial scan, reanalyze the whole form - + } + // When new inputs are added after the initial scan, reanalyze the whole form if (this.initialScanComplete) { this.formAnalyzer = new _FormAnalyzer.default(this.form, input, this.matching); this.recategorizeAllInputs(); return this; - } // Nothing to do with 1-character fields - + } + // Nothing to do with 1-character fields if (input.maxLength === 1) return this; this.inputs.all.add(input); const opts = { isLogin: this.isLogin, isHybrid: this.isHybrid, isCCForm: this.isCCForm, - hasCredentials: Boolean((_this$device$settings = this.device.settings.availableInputTypes.credentials) === null || _this$device$settings === void 0 ? void 0 : _this$device$settings.username), + hasCredentials: Boolean(this.device.settings.availableInputTypes.credentials?.username), supportsIdentitiesAutofill: this.device.settings.featureToggles.inputType_identities }; this.matching.setInputType(input, this.form, opts); @@ -10497,6 +9828,7 @@ class Form { this.decorateInput(input); return this; } + /** * Adds event listeners and keeps track of them for subsequent removal * @param {HTMLElement} el @@ -10504,8 +9836,6 @@ class Form { * @param {(Event) => void} fn * @param {AddEventListenerOptions} [opts] */ - - addListener(el, type, fn, opts) { el.addEventListener(type, fn, opts); this.listeners.add({ @@ -10515,7 +9845,6 @@ class Form { opts }); } - addAutofillStyles(input) { const initialStyles = (0, _inputStyles.getIconStylesBase)(input, this); const activeStyles = (0, _inputStyles.getIconStylesAlternate)(input, this); @@ -10525,20 +9854,18 @@ class Form { onMouseLeave: initialStyles }; } + /** * Decorate here means adding listeners and an optional icon * @param {HTMLInputElement} input * @returns {Promise} */ - - async decorateInput(input) { const config = (0, _inputTypeConfig.getInputConfig)(input); const shouldDecorate = await config.shouldDecorate(input, this); if (!shouldDecorate) return this; input.setAttribute(ATTR_AUTOFILL, 'true'); const hasIcon = !!config.getIconBase(input, this); - if (hasIcon) { const { onMouseMove, @@ -10546,7 +9873,6 @@ class Form { } = this.addAutofillStyles(input); this.addListener(input, 'mousemove', e => { if ((0, _autofillUtils.wasAutofilledByChrome)(input)) return; - if ((0, _autofillUtils.isEventWithinDax)(e, e.target)) { (0, _autofillUtils.addInlineStyles)(e.target, { 'cursor': 'pointer', @@ -10555,10 +9881,11 @@ class Form { } else { (0, _autofillUtils.removeInlineStyles)(e.target, { 'cursor': 'pointer' - }); // Only overwrite active icon styles if tooltip is closed - + }); + // Only overwrite active icon styles if tooltip is closed if (!this.device.isTooltipActive()) { - (0, _autofillUtils.addInlineStyles)(e.target, { ...onMouseLeave + (0, _autofillUtils.addInlineStyles)(e.target, { + ...onMouseLeave }); } } @@ -10566,20 +9893,20 @@ class Form { this.addListener(input, 'mouseleave', e => { (0, _autofillUtils.removeInlineStyles)(e.target, { 'cursor': 'pointer' - }); // Only overwrite active icon styles if tooltip is closed - + }); + // Only overwrite active icon styles if tooltip is closed if (!this.device.isTooltipActive()) { - (0, _autofillUtils.addInlineStyles)(e.target, { ...onMouseLeave + (0, _autofillUtils.addInlineStyles)(e.target, { + ...onMouseLeave }); } }); } + /** * @param {PointerEvent} e * @returns {{ x: number; y: number; } | undefined} */ - - function getMainClickCoords(e) { if (!e.isTrusted) return; const isMainMouseButton = e.button === 0; @@ -10589,86 +9916,74 @@ class Form { y: e.clientY }; } + /** * @param {Event} e * @param {WeakMap} storedClickCoords * @returns {{ x: number; y: number; } | null} */ - - function getClickCoords(e, storedClickCoords) { // Get click co-ordinates for pointer events // We need click coordinates to position the tooltip when the field is in an iframe if (e.type === 'pointerdown') { - return getMainClickCoords( - /** @type {PointerEvent} */ - e) || null; - } // Reuse a previous click co-ordinates if they exist for this element - + return getMainClickCoords( /** @type {PointerEvent} */e) || null; + } + // Reuse a previous click co-ordinates if they exist for this element const click = storedClickCoords.get(input); storedClickCoords.delete(input); return click || null; - } // Store the click to a label so we can use the click when the field is focused - // Needed to handle label clicks when the form is in an iframe - + } + // Store the click to a label so we can use the click when the field is focused + // Needed to handle label clicks when the form is in an iframe let storedClickCoords = new WeakMap(); let timeout = null; + /** * @param {PointerEvent} e */ - const handlerLabel = e => { - var _e$target, _e$target$closest; - // Look for e.target OR it's closest parent to be a HTMLLabelElement - const control = - /** @type HTMLElement */ - (_e$target = e.target) === null || _e$target === void 0 ? void 0 : (_e$target$closest = _e$target.closest('label')) === null || _e$target$closest === void 0 ? void 0 : _e$target$closest.control; + const control = /** @type HTMLElement */e.target?.closest('label')?.control; if (!control) return; - if (e.isTrusted) { storedClickCoords.set(control, getMainClickCoords(e)); } - - clearTimeout(timeout); // Remove the stored click if the timer expires - + clearTimeout(timeout); + // Remove the stored click if the timer expires timeout = setTimeout(() => { storedClickCoords = new WeakMap(); }, 1000); }; - const handler = e => { // Avoid firing multiple times if (this.isAutofilling || this.device.isTooltipActive()) { return; - } // On mobile, we don't trigger on focus, so here we get the target control on label click - + } + // On mobile, we don't trigger on focus, so here we get the target control on label click const isLabel = e.target instanceof HTMLLabelElement; const input = isLabel ? e.target.control : e.target; if (!input || !this.inputs.all.has(input)) return; if ((0, _autofillUtils.wasAutofilledByChrome)(input)) return; if (!(0, _inputTypeConfig.canBeInteractedWith)(input)) return; const clickCoords = getClickCoords(e, storedClickCoords); - if (e.type === 'pointerdown') { // Only allow real user clicks with co-ordinates through if (!e.isTrusted || !clickCoords) return; } - if (this.shouldOpenTooltip(e, input)) { - const iconClicked = (0, _autofillUtils.isEventWithinDax)(e, input); // On mobile and extensions we don't trigger the focus event to avoid + const iconClicked = (0, _autofillUtils.isEventWithinDax)(e, input); + // On mobile and extensions we don't trigger the focus event to avoid // keyboard flashing and conflicts with browsers' own tooltips - - if ((this.device.globalConfig.isMobileApp || this.device.globalConfig.isExtension) && // Avoid the icon capturing clicks on small fields making it impossible to focus + if ((this.device.globalConfig.isMobileApp || this.device.globalConfig.isExtension) && + // Avoid the icon capturing clicks on small fields making it impossible to focus input.offsetWidth > 50 && iconClicked) { e.preventDefault(); e.stopImmediatePropagation(); input.blur(); } - this.touched.add(input); this.device.attachTooltip({ form: this, @@ -10685,13 +10000,10 @@ class Form { (0, _autofillUtils.addInlineStyles)(input, activeStyles); } }; - if (!(input instanceof HTMLSelectElement)) { - var _input$labels; - const events = ['pointerdown']; if (!this.device.globalConfig.isMobileApp) events.push('focus'); - (_input$labels = input.labels) === null || _input$labels === void 0 ? void 0 : _input$labels.forEach(label => { + input.labels?.forEach(label => { if (this.device.globalConfig.isMobileApp) { // On mobile devices we don't trigger on focus, so we use the click handler here this.addListener(label, 'pointerdown', handler); @@ -10702,83 +10014,81 @@ class Form { }); events.forEach(ev => this.addListener(input, ev, handler)); } - return this; } - shouldOpenTooltip(e, input) { - var _this$device$inContex; - - if (!(0, _autofillUtils.isPotentiallyViewable)(input)) return false; // Always open if the user has clicked on the Dax icon + if (!(0, _autofillUtils.isPotentiallyViewable)(input)) return false; + // Always open if the user has clicked on the Dax icon if ((0, _autofillUtils.isEventWithinDax)(e, input)) return true; if (this.device.globalConfig.isWindows) return true; const subtype = (0, _matching.getInputSubtype)(input); - const isIncontextSignupAvailable = (_this$device$inContex = this.device.inContextSignup) === null || _this$device$inContex === void 0 ? void 0 : _this$device$inContex.isAvailable(subtype); - + const isIncontextSignupAvailable = this.device.inContextSignup?.isAvailable(subtype); if (this.device.globalConfig.isApp) { - const mainType = (0, _matching.getInputMainType)(input); // Check if, without in-context signup (passed as `null` below), + const mainType = (0, _matching.getInputMainType)(input); + // Check if, without in-context signup (passed as `null` below), // we'd have any other items to show. This lets us know if we're // just showing in-context signup, or with other autofill items. - const hasSavedDetails = this.device.settings.canAutofillType({ mainType, subtype - }, null); // Don't open the tooltip on input focus whenever it'll only show in-context signup + }, null); + // Don't open the tooltip on input focus whenever it'll only show in-context signup if (!hasSavedDetails && isIncontextSignupAvailable) return false; return true; } - if (this.device.globalConfig.isExtension || this.device.globalConfig.isMobileApp) { // Don't open the tooltip on input focus whenever it's showing in-context signup if (isIncontextSignupAvailable) return false; } - return !this.touched.has(input) && !input.classList.contains('ddg-autofilled'); } - autofillInput(input, string, dataType) { // Do not autofill if it's invisible (select elements can be hidden because of custom implementations) - if (input instanceof HTMLInputElement && !(0, _autofillUtils.isPotentiallyViewable)(input)) return; // Do not autofill if it's disabled or readonly to avoid potential breakage - - if (!(0, _inputTypeConfig.canBeInteractedWith)(input)) return; // @ts-ignore + if (input instanceof HTMLInputElement && !(0, _autofillUtils.isPotentiallyViewable)(input)) return; + // Do not autofill if it's disabled or readonly to avoid potential breakage + if (!(0, _inputTypeConfig.canBeInteractedWith)(input)) return; + // @ts-ignore const activeInputSubtype = (0, _matching.getInputSubtype)(this.activeInput); const inputSubtype = (0, _matching.getInputSubtype)(input); - const isEmailAutofill = activeInputSubtype === 'emailAddress' && inputSubtype === 'emailAddress'; // Don't override values for identities, unless it's the current input or we're autofilling email - - if (dataType === 'identities' && // only for identities - input.nodeName !== 'SELECT' && input.value !== '' && // if the input is not empty - this.activeInput !== input && // and this is not the active input + const isEmailAutofill = activeInputSubtype === 'emailAddress' && inputSubtype === 'emailAddress'; + + // Don't override values for identities, unless it's the current input or we're autofilling email + if (dataType === 'identities' && + // only for identities + input.nodeName !== 'SELECT' && input.value !== '' && + // if the input is not empty + this.activeInput !== input && + // and this is not the active input !isEmailAutofill // and we're not auto-filling email ) return; // do not overwrite the value - // If the value is already there, just return + // If the value is already there, just return if (input.value === string) return; const successful = (0, _autofillUtils.setValue)(input, string, this.device.globalConfig); if (!successful) return; input.classList.add('ddg-autofilled'); (0, _autofillUtils.addInlineStyles)(input, (0, _inputStyles.getIconStylesAutofilled)(input, this)); - this.touched.add(input); // If the user changes the value, remove the decoration + this.touched.add(input); + // If the user changes the value, remove the decoration input.addEventListener('input', e => this.removeAllHighlights(e, dataType), { once: true }); } + /** * Autofill method for email protection only * @param {string} alias * @param {'all' | SupportedMainTypes} dataType */ - - autofillEmail(alias) { let dataType = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'identities'; this.isAutofilling = true; this.execOnInputs(input => { const inputSubtype = (0, _matching.getInputSubtype)(input); - if (inputSubtype === 'emailAddress') { this.autofillInput(input, alias, dataType); } @@ -10786,64 +10096,53 @@ class Form { this.isAutofilling = false; this.removeTooltip(); } - autofillData(data, dataType) { - var _this$device$postAuto, _this$device2; - this.isAutofilling = true; this.execOnInputs(input => { const inputSubtype = (0, _matching.getInputSubtype)(input); let autofillData = data[inputSubtype]; - if (inputSubtype === 'expiration' && input instanceof HTMLInputElement) { autofillData = (0, _formatters.getUnifiedExpiryDate)(input, data.expirationMonth, data.expirationYear, this); } - if (inputSubtype === 'expirationYear' && input instanceof HTMLInputElement) { autofillData = (0, _formatters.formatCCYear)(input, autofillData, this); } - if (inputSubtype === 'addressCountryCode') { autofillData = (0, _formatters.getCountryName)(input, data); } - if (autofillData) { this.autofillInput(input, autofillData, dataType); } }, dataType); - this.isAutofilling = false; // After autofill we check if form values match the data provided… + this.isAutofilling = false; + // After autofill we check if form values match the data provided… const formValues = this.getValuesReadyForStorage(); const areAllFormValuesKnown = Object.keys(formValues[dataType] || {}).every(subtype => formValues[dataType][subtype] === data[subtype]); - if (areAllFormValuesKnown) { // …if we know all the values do not prompt to store data - this.shouldPromptToStoreData = false; // reset this to its initial value - + this.shouldPromptToStoreData = false; + // reset this to its initial value this.shouldAutoSubmit = this.device.globalConfig.isMobileApp; } else { // …otherwise we will prompt and do not want to autosubmit because the experience is jarring this.shouldAutoSubmit = false; } - - (_this$device$postAuto = (_this$device2 = this.device).postAutofill) === null || _this$device$postAuto === void 0 ? void 0 : _this$device$postAuto.call(_this$device2, data, dataType, this); + this.device.postAutofill?.(data, dataType, this); this.removeTooltip(); } + /** * Set all inputs of the data type to "touched" * @param {'all' | SupportedMainTypes} dataType */ - - touchAllInputs() { let dataType = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'all'; this.execOnInputs(input => this.touched.add(input), dataType); } - getFirstViableCredentialsInput() { return [...this.inputs.credentials].find(input => (0, _inputTypeConfig.canBeInteractedWith)(input) && (0, _autofillUtils.isPotentiallyViewable)(input)); } - async promptLoginIfNeeded() { if (document.visibilityState !== 'visible' || !this.isLogin) return; const firstCredentialInput = this.getFirstViableCredentialsInput(); @@ -10855,7 +10154,6 @@ class Form { mainType, subtype }); - if (this.device.settings.canAutofillType({ mainType, subtype @@ -10871,10 +10169,9 @@ class Form { height } = this.form.getBoundingClientRect(); const elHCenter = x + width / 2; - const elVCenter = y + height / 2; // This checks that the form is not covered by anything else - + const elVCenter = y + height / 2; + // This checks that the form is not covered by anything else const topMostElementFromPoint = document.elementFromPoint(elHCenter, elVCenter); - if (this.form.contains(topMostElementFromPoint)) { this.execOnInputs(input => { if ((0, _autofillUtils.isPotentiallyViewable)(input)) { @@ -10895,130 +10192,109 @@ class Form { }, 200); } } - } - exports.Form = Form; -},{"../autofill-utils.js":59,"../constants.js":62,"./FormAnalyzer.js":32,"./formatters.js":34,"./inputStyles.js":35,"./inputTypeConfig.js":36,"./matching.js":41}],32:[function(require,module,exports){ +},{"../autofill-utils.js":61,"../constants.js":64,"./FormAnalyzer.js":34,"./formatters.js":36,"./inputStyles.js":37,"./inputTypeConfig.js":38,"./matching.js":43}],34:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; - var _matching = require("./matching.js"); - var _constants = require("../constants.js"); - var _compiledMatchingConfig = require("./matching-config/__generated__/compiled-matching-config.js"); - var _autofillUtils = require("../autofill-utils.js"); - -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - class FormAnalyzer { /** @type HTMLElement */ - + form; /** @type Matching */ - + matching; /** * @param {HTMLElement} form * @param {HTMLInputElement|HTMLSelectElement} input * @param {Matching} [matching] */ constructor(form, input, matching) { - _defineProperty(this, "form", void 0); - - _defineProperty(this, "matching", void 0); - - _defineProperty(this, "_isCCForm", undefined); - this.form = form; this.matching = matching || new _matching.Matching(_compiledMatchingConfig.matchingConfiguration); + /** * The signal is a continuum where negative values imply login and positive imply signup * @type {number} */ - this.autofillSignal = 0; /** * A hybrid form can be either a login or a signup, the site uses a single form for both * @type {number} */ - this.hybridSignal = 0; + /** * Collects the signals for debugging purposes * @type {string[]} */ - this.signals = []; this.evaluateElAttributes(input, 1, true); form ? this.evaluateForm() : this.evaluatePage(); return this; } + /** * Hybrid forms can be used for both login and signup * @returns {boolean} */ - - get isHybrid() { // When marking for hybrid we also want to ensure other signals are weak const areOtherSignalsWeak = Math.abs(this.autofillSignal) < 10; return this.hybridSignal > 0 && areOtherSignalsWeak; } - get isLogin() { if (this.isHybrid) return false; return this.autofillSignal < 0; } - get isSignup() { if (this.isHybrid) return false; return this.autofillSignal >= 0; } + /** * Tilts the scoring towards Signup * @param {number} strength * @param {string} signal * @returns {FormAnalyzer} */ - - increaseSignalBy(strength, signal) { this.autofillSignal += strength; - this.signals.push("".concat(signal, ": +").concat(strength)); + this.signals.push(`${signal}: +${strength}`); return this; } + /** * Tilts the scoring towards Login * @param {number} strength * @param {string} signal * @returns {FormAnalyzer} */ - - decreaseSignalBy(strength, signal) { this.autofillSignal -= strength; - this.signals.push("".concat(signal, ": -").concat(strength)); + this.signals.push(`${signal}: -${strength}`); return this; } + /** * Increases the probability that this is a hybrid form (can be either login or signup) * @param {number} strength * @param {string} signal * @returns {FormAnalyzer} */ - - increaseHybridSignal(strength, signal) { this.hybridSignal += strength; - this.signals.push("".concat(signal, " (hybrid): +").concat(strength)); + this.signals.push(`${signal} (hybrid): +${strength}`); return this; } + /** * Updates the Login<->Signup signal according to the provided parameters * @param {object} p @@ -11030,11 +10306,7 @@ class FormAnalyzer { * @param {boolean} [p.shouldBeConservative] - Should use the conservative signup regex * @returns {FormAnalyzer} */ - - updateSignal(_ref) { - var _this$matching$getDDG, _this$matching$getDDG2, _this$matching$getDDG3; - let { string, strength, @@ -11043,16 +10315,17 @@ class FormAnalyzer { shouldCheckUnifiedForm = false, shouldBeConservative = false } = _ref; - const matchesLogin = /current.?password/i.test(string) || ((_this$matching$getDDG = this.matching.getDDGMatcherRegex('loginRegex')) === null || _this$matching$getDDG === void 0 ? void 0 : _this$matching$getDDG.test(string)) || ((_this$matching$getDDG2 = this.matching.getDDGMatcherRegex('resetPasswordLink')) === null || _this$matching$getDDG2 === void 0 ? void 0 : _this$matching$getDDG2.test(string)); // Check explicitly for unified login/signup forms + const matchesLogin = /current.?password/i.test(string) || this.matching.getDDGMatcherRegex('loginRegex')?.test(string) || this.matching.getDDGMatcherRegex('resetPasswordLink')?.test(string); - if (shouldCheckUnifiedForm && matchesLogin && (_this$matching$getDDG3 = this.matching.getDDGMatcherRegex('conservativeSignupRegex')) !== null && _this$matching$getDDG3 !== void 0 && _this$matching$getDDG3.test(string)) { + // Check explicitly for unified login/signup forms + if (shouldCheckUnifiedForm && matchesLogin && this.matching.getDDGMatcherRegex('conservativeSignupRegex')?.test(string)) { this.increaseHybridSignal(strength, signalType); return this; } - const signupRegexToUse = this.matching.getDDGMatcherRegex(shouldBeConservative ? 'conservativeSignupRegex' : 'signupRegex'); - const matchesSignup = /new.?password/i.test(string) || (signupRegexToUse === null || signupRegexToUse === void 0 ? void 0 : signupRegexToUse.test(string)); // In some cases a login match means the login is somewhere else, i.e. when a link points outside + const matchesSignup = /new.?password/i.test(string) || signupRegexToUse?.test(string); + // In some cases a login match means the login is somewhere else, i.e. when a link points outside if (shouldFlip) { if (matchesLogin) this.increaseSignalBy(strength, signalType); if (matchesSignup) this.decreaseSignalBy(strength, signalType); @@ -11060,53 +10333,45 @@ class FormAnalyzer { if (matchesLogin) this.decreaseSignalBy(strength, signalType); if (matchesSignup) this.increaseSignalBy(strength, signalType); } - return this; } - evaluateElAttributes(el) { let signalStrength = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 3; let isInput = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; Array.from(el.attributes).forEach(attr => { if (attr.name === 'style') return; - const attributeString = "".concat(attr.name, "=").concat(attr.value); + const attributeString = `${attr.name}=${attr.value}`; this.updateSignal({ string: attributeString, strength: signalStrength, - signalType: "".concat(el.name, " attr: ").concat(attributeString), + signalType: `${el.name} attr: ${attributeString}`, shouldCheckUnifiedForm: isInput }); }); } - evaluateUrl() { - var _this$matching$getDDG4, _this$matching$getDDG5; - const path = window.location.pathname; - const matchesLogin = (_this$matching$getDDG4 = this.matching.getDDGMatcherRegex('loginRegex')) === null || _this$matching$getDDG4 === void 0 ? void 0 : _this$matching$getDDG4.test(path); - const matchesSignup = (_this$matching$getDDG5 = this.matching.getDDGMatcherRegex('conservativeSignupRegex')) === null || _this$matching$getDDG5 === void 0 ? void 0 : _this$matching$getDDG5.test(path); // If the url matches both, do nothing: the signal is probably confounding + const matchesLogin = this.matching.getDDGMatcherRegex('loginRegex')?.test(path); + const matchesSignup = this.matching.getDDGMatcherRegex('conservativeSignupRegex')?.test(path); + // If the url matches both, do nothing: the signal is probably confounding if (matchesLogin && matchesSignup) return; - if (matchesLogin) { this.decreaseSignalBy(1, 'url matches login'); } - if (matchesSignup) { this.increaseSignalBy(1, 'url matches signup'); } } - evaluatePageTitle() { const pageTitle = document.title; this.updateSignal({ string: pageTitle, strength: 2, - signalType: "page title: ".concat(pageTitle), + signalType: `page title: ${pageTitle}`, shouldCheckUnifiedForm: true }); } - evaluatePageHeadings() { const headings = document.querySelectorAll('h1, h2, h3, [class*="title"], [id*="title"]'); headings.forEach(_ref2 => { @@ -11117,17 +10382,16 @@ class FormAnalyzer { this.updateSignal({ string: textContent, strength: 0.5, - signalType: "heading: ".concat(textContent), + signalType: `heading: ${textContent}`, shouldCheckUnifiedForm: true, shouldBeConservative: true }); }); } - evaluatePage() { this.evaluatePageTitle(); - this.evaluatePageHeadings(); // Check for submit buttons - + this.evaluatePageHeadings(); + // Check for submit buttons const buttons = document.querySelectorAll(this.matching.cssSelector('submitButtonSelector')); buttons.forEach(button => { // if the button has a form, it's not related to our input, because our input has no form here @@ -11139,25 +10403,22 @@ class FormAnalyzer { } }); } - evaluateElement(el) { const string = (0, _autofillUtils.getTextShallow)(el); - if (el.matches(this.matching.cssSelector('password'))) { // These are explicit signals by the web author, so we weigh them heavily this.updateSignal({ string: el.getAttribute('autocomplete') || el.getAttribute('name') || '', strength: 5, - signalType: "explicit: ".concat(el.getAttribute('autocomplete')) + signalType: `explicit: ${el.getAttribute('autocomplete')}` }); return; - } // check button contents - + } + // check button contents if (el.matches(this.matching.cssSelector('submitButtonSelector') + ', *[class*=button]')) { // If we're confident this is the submit button, it's a stronger signal let likelyASubmit = (0, _autofillUtils.isLikelyASubmitButton)(el, this.matching); - if (likelyASubmit) { this.form.querySelectorAll('input[type=submit], button[type=submit]').forEach(submit => { // If there is another element marked as submit and this is not, flip back to false @@ -11166,148 +10427,134 @@ class FormAnalyzer { } }); } - const strength = likelyASubmit ? 20 : 2; this.updateSignal({ string, strength, - signalType: "submit: ".concat(string) + signalType: `submit: ${string}` }); return; - } // if an external link matches one of the regexes, we assume the match is not pertinent to the current form - - + } + // if an external link matches one of the regexes, we assume the match is not pertinent to the current form if (el instanceof HTMLAnchorElement && el.href && el.getAttribute('href') !== '#' || (el.getAttribute('role') || '').toUpperCase() === 'LINK' || el.matches('button[class*=secondary]')) { - var _this$matching$getDDG6, _this$matching$getDDG7; - let shouldFlip = true; - let strength = 1; // Don't flip forgotten password links - - if ((_this$matching$getDDG6 = this.matching.getDDGMatcherRegex('resetPasswordLink')) !== null && _this$matching$getDDG6 !== void 0 && _this$matching$getDDG6.test(string)) { + let strength = 1; + // Don't flip forgotten password links + if (this.matching.getDDGMatcherRegex('resetPasswordLink')?.test(string)) { shouldFlip = false; strength = 3; - } else if ((_this$matching$getDDG7 = this.matching.getDDGMatcherRegex('loginProvidersRegex')) !== null && _this$matching$getDDG7 !== void 0 && _this$matching$getDDG7.test(string)) { + } else if (this.matching.getDDGMatcherRegex('loginProvidersRegex')?.test(string)) { // Don't flip login providers links shouldFlip = false; } - this.updateSignal({ string, strength, - signalType: "external link: ".concat(string), + signalType: `external link: ${string}`, shouldFlip }); } else { - var _removeExcessWhitespa; - // any other case // only consider the el if it's a small text to avoid noisy disclaimers - if (((_removeExcessWhitespa = (0, _matching.removeExcessWhitespace)(el.textContent)) === null || _removeExcessWhitespa === void 0 ? void 0 : _removeExcessWhitespa.length) < _constants.constants.TEXT_LENGTH_CUTOFF) { + if ((0, _matching.removeExcessWhitespace)(el.textContent)?.length < _constants.constants.TEXT_LENGTH_CUTOFF) { this.updateSignal({ string, strength: 1, - signalType: "generic: ".concat(string), + signalType: `generic: ${string}`, shouldCheckUnifiedForm: true }); } } } - evaluateForm() { // Check page url - this.evaluateUrl(); // Check page title + this.evaluateUrl(); - this.evaluatePageTitle(); // Check form attributes + // Check page title + this.evaluatePageTitle(); - this.evaluateElAttributes(this.form); // Check form contents (noisy elements are skipped with the safeUniversalSelector) + // Check form attributes + this.evaluateElAttributes(this.form); + // Check form contents (noisy elements are skipped with the safeUniversalSelector) this.form.querySelectorAll(this.matching.cssSelector('safeUniversalSelector')).forEach(el => { // Check if element is not hidden. Note that we can't use offsetHeight // nor intersectionObserver, because the element could be outside the // viewport or its parent hidden const displayValue = window.getComputedStyle(el, null).getPropertyValue('display'); if (displayValue !== 'none') this.evaluateElement(el); - }); // A form with many fields is unlikely to be a login form + }); + // A form with many fields is unlikely to be a login form const relevantFields = this.form.querySelectorAll(this.matching.cssSelector('genericTextField')); - if (relevantFields.length >= 4) { this.increaseSignalBy(relevantFields.length * 1.5, 'many fields: it is probably not a login'); - } // If we can't decide at this point, try reading page headings - + } + // If we can't decide at this point, try reading page headings if (this.autofillSignal === 0) { this.evaluatePageHeadings(); } - return this; } - /** @type {undefined|boolean} */ - + /** @type {undefined|boolean} */ + _isCCForm = undefined; /** * Tries to infer if it's a credit card form * @returns {boolean} */ isCCForm() { - var _formEl$textContent; - if (this._isCCForm !== undefined) return this._isCCForm; const formEl = this.form; const ccFieldSelector = this.matching.joinCssSelectors('cc'); - if (!ccFieldSelector) { this._isCCForm = false; return this._isCCForm; } - - const hasCCSelectorChild = formEl.matches(ccFieldSelector) || formEl.querySelector(ccFieldSelector); // If the form contains one of the specific selectors, we have high confidence - + const hasCCSelectorChild = formEl.matches(ccFieldSelector) || formEl.querySelector(ccFieldSelector); + // If the form contains one of the specific selectors, we have high confidence if (hasCCSelectorChild) { this._isCCForm = true; return this._isCCForm; - } // Read form attributes to find a signal - + } + // Read form attributes to find a signal const hasCCAttribute = [...formEl.attributes].some(_ref3 => { let { name, value } = _ref3; - return /(credit|payment).?card/i.test("".concat(name, "=").concat(value)); + return /(credit|payment).?card/i.test(`${name}=${value}`); }); - if (hasCCAttribute) { this._isCCForm = true; return this._isCCForm; - } // Match form textContent against common cc fields (includes hidden labels) - + } - const textMatches = (_formEl$textContent = formEl.textContent) === null || _formEl$textContent === void 0 ? void 0 : _formEl$textContent.match(/(credit|payment).?card(.?number)?|ccv|security.?code|cvv|cvc|csc/ig); // We check for more than one to minimise false positives + // Match form textContent against common cc fields (includes hidden labels) + const textMatches = formEl.textContent?.match(/(credit|payment).?card(.?number)?|ccv|security.?code|cvv|cvc|csc/ig); + // We check for more than one to minimise false positives this._isCCForm = Boolean(textMatches && textMatches.length > 1); return this._isCCForm; } - } +var _default = exports.default = FormAnalyzer; -var _default = FormAnalyzer; -exports.default = _default; - -},{"../autofill-utils.js":59,"../constants.js":62,"./matching-config/__generated__/compiled-matching-config.js":39,"./matching.js":41}],33:[function(require,module,exports){ +},{"../autofill-utils.js":61,"../constants.js":64,"./matching-config/__generated__/compiled-matching-config.js":41,"./matching.js":43}],35:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.COUNTRY_NAMES_TO_CODES = exports.COUNTRY_CODES_TO_NAMES = void 0; - /** * Country names object using 2-letter country codes to reference country name * Derived from the Intl.DisplayNames implementation * @source https://stackoverflow.com/a/70517921/1948947 */ -const COUNTRY_CODES_TO_NAMES = { +const COUNTRY_CODES_TO_NAMES = exports.COUNTRY_CODES_TO_NAMES = { AC: 'Ascension Island', AD: 'Andorra', AE: 'United Arab Emirates', @@ -11588,14 +10835,13 @@ const COUNTRY_CODES_TO_NAMES = { ZW: 'Zimbabwe', ZZ: 'Unknown Region' }; + /** * Country names object using country name to reference 2-letter country codes * Derived from the solution above with * Object.fromEntries(Object.entries(COUNTRY_CODES_TO_NAMES).map(entry => [entry[1], entry[0]])) */ - -exports.COUNTRY_CODES_TO_NAMES = COUNTRY_CODES_TO_NAMES; -const COUNTRY_NAMES_TO_CODES = { +const COUNTRY_NAMES_TO_CODES = exports.COUNTRY_NAMES_TO_CODES = { 'Ascension Island': 'AC', Andorra: 'AD', 'United Arab Emirates': 'AE', @@ -11860,28 +11106,21 @@ const COUNTRY_NAMES_TO_CODES = { Zambia: 'ZM', 'Unknown Region': 'ZZ' }; -exports.COUNTRY_NAMES_TO_CODES = COUNTRY_NAMES_TO_CODES; -},{}],34:[function(require,module,exports){ +},{}],36:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.prepareFormValuesForStorage = exports.inferCountryCodeFromElement = exports.getUnifiedExpiryDate = exports.getMMAndYYYYFromString = exports.getCountryName = exports.getCountryDisplayName = exports.formatPhoneNumber = exports.formatFullName = exports.formatCCYear = void 0; - var _matching = require("./matching.js"); - var _countryNames = require("./countryNames.js"); - -var _templateObject, _templateObject2; - -function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); } - // Matches strings like mm/yy, mm-yyyy, mm-aa, 12 / 2024 -const DATE_SEPARATOR_REGEX = /\b((.)\2{1,3}|\d+)(?\s?[/\s.\-_—–]\s?)((.)\5{1,3}|\d+)\b/i; // Matches 4 non-digit repeated characters (YYYY or AAAA) or 4 digits (2022) - +const DATE_SEPARATOR_REGEX = /\b((.)\2{1,3}|\d+)(?\s?[/\s.\-_—–]\s?)((.)\5{1,3}|\d+)\b/i; +// Matches 4 non-digit repeated characters (YYYY or AAAA) or 4 digits (2022) const FOUR_DIGIT_YEAR_REGEX = /(\D)\1{3}|\d{4}/i; + /** * Format the cc year to best adapt to the input requirements (YY vs YYYY) * @param {HTMLInputElement} input @@ -11889,12 +11128,12 @@ const FOUR_DIGIT_YEAR_REGEX = /(\D)\1{3}|\d{4}/i; * @param {import("./Form").Form} form * @returns {string} */ - const formatCCYear = (input, year, form) => { const selector = form.matching.cssSelector('formInputsSelector'); if (input.maxLength === 4 || (0, _matching.checkPlaceholderAndLabels)(input, FOUR_DIGIT_YEAR_REGEX, form.form, selector)) return year; - return "".concat(Number(year) - 2000); + return `${Number(year) - 2000}`; }; + /** * Get a unified expiry date with separator * @param {HTMLInputElement} input @@ -11903,250 +11142,215 @@ const formatCCYear = (input, year, form) => { * @param {import("./Form").Form} form * @returns {string} */ - - exports.formatCCYear = formatCCYear; - const getUnifiedExpiryDate = (input, month, year, form) => { - var _matchInPlaceholderAn, _matchInPlaceholderAn2; - const formattedYear = formatCCYear(input, year, form); - const paddedMonth = "".concat(month).padStart(2, '0'); + const paddedMonth = `${month}`.padStart(2, '0'); const cssSelector = form.matching.cssSelector('formInputsSelector'); - const separator = ((_matchInPlaceholderAn = (0, _matching.matchInPlaceholderAndLabels)(input, DATE_SEPARATOR_REGEX, form.form, cssSelector)) === null || _matchInPlaceholderAn === void 0 ? void 0 : (_matchInPlaceholderAn2 = _matchInPlaceholderAn.groups) === null || _matchInPlaceholderAn2 === void 0 ? void 0 : _matchInPlaceholderAn2.separator) || '/'; - return "".concat(paddedMonth).concat(separator).concat(formattedYear); + const separator = (0, _matching.matchInPlaceholderAndLabels)(input, DATE_SEPARATOR_REGEX, form.form, cssSelector)?.groups?.separator || '/'; + return `${paddedMonth}${separator}${formattedYear}`; }; - exports.getUnifiedExpiryDate = getUnifiedExpiryDate; - const formatFullName = _ref => { let { firstName = '', middleName = '', lastName = '' } = _ref; - return "".concat(firstName, " ").concat(middleName ? middleName + ' ' : '').concat(lastName).trim(); + return `${firstName} ${middleName ? middleName + ' ' : ''}${lastName}`.trim(); }; + /** * Tries to look up a human-readable country name from the country code * @param {string} locale * @param {string} addressCountryCode * @return {string} - Returns the country code if we can't find a name */ - - exports.formatFullName = formatFullName; - const getCountryDisplayName = (locale, addressCountryCode) => { try { const regionNames = new Intl.DisplayNames([locale], { type: 'region' - }); // Adding this ts-ignore to prevent having to change this implementation. + }); + // Adding this ts-ignore to prevent having to change this implementation. // @ts-ignore - return regionNames.of(addressCountryCode); } catch (e) { return _countryNames.COUNTRY_CODES_TO_NAMES[addressCountryCode] || addressCountryCode; } }; + /** * Tries to infer the element locale or returns 'en' * @param {HTMLInputElement | HTMLSelectElement} el * @return {string | 'en'} */ - - exports.getCountryDisplayName = getCountryDisplayName; +const inferElementLocale = el => el.lang || el.form?.lang || document.body.lang || document.documentElement.lang || 'en'; -const inferElementLocale = el => { - var _el$form; - - return el.lang || ((_el$form = el.form) === null || _el$form === void 0 ? void 0 : _el$form.lang) || document.body.lang || document.documentElement.lang || 'en'; -}; /** * Tries to format the country code into a localised country name * @param {HTMLInputElement | HTMLSelectElement} el * @param {{addressCountryCode?: string}} options */ - - const getCountryName = function (el) { let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; const { addressCountryCode } = options; - if (!addressCountryCode) return ''; // Try to infer the field language or fallback to en + if (!addressCountryCode) return ''; + // Try to infer the field language or fallback to en const elLocale = inferElementLocale(el); - const localisedCountryName = getCountryDisplayName(elLocale, addressCountryCode); // If it's a select el we try to find a suitable match to autofill + const localisedCountryName = getCountryDisplayName(elLocale, addressCountryCode); + // If it's a select el we try to find a suitable match to autofill if (el.nodeName === 'SELECT') { - const englishCountryName = getCountryDisplayName('en', addressCountryCode); // This regex matches both the localised and English country names - - const countryNameRegex = new RegExp(String.raw(_templateObject || (_templateObject = _taggedTemplateLiteral(["", "|", ""])), localisedCountryName.replace(/ /g, '.?'), englishCountryName.replace(/ /g, '.?')), 'i'); - const countryCodeRegex = new RegExp(String.raw(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\b", "\b"], ["\\b", "\\b"])), addressCountryCode), 'i'); // We check the country code first because it's more accurate + const englishCountryName = getCountryDisplayName('en', addressCountryCode); + // This regex matches both the localised and English country names + const countryNameRegex = new RegExp(String.raw`${localisedCountryName.replace(/ /g, '.?')}|${englishCountryName.replace(/ /g, '.?')}`, 'i'); + const countryCodeRegex = new RegExp(String.raw`\b${addressCountryCode}\b`, 'i'); + // We check the country code first because it's more accurate if (el instanceof HTMLSelectElement) { for (const option of el.options) { if (countryCodeRegex.test(option.value)) { return option.value; } } - for (const option of el.options) { if (countryNameRegex.test(option.value) || countryNameRegex.test(option.innerText)) return option.value; } } } - return localisedCountryName; }; + /** * Try to get a map of localised country names to code, or falls back to the English map * @param {HTMLInputElement | HTMLSelectElement} el */ - - exports.getCountryName = getCountryName; - const getLocalisedCountryNamesToCodes = el => { - if (typeof Intl.DisplayNames !== 'function') return _countryNames.COUNTRY_NAMES_TO_CODES; // Try to infer the field language or fallback to en + if (typeof Intl.DisplayNames !== 'function') return _countryNames.COUNTRY_NAMES_TO_CODES; + // Try to infer the field language or fallback to en const elLocale = inferElementLocale(el); return Object.fromEntries(Object.entries(_countryNames.COUNTRY_CODES_TO_NAMES).map(_ref2 => { let [code] = _ref2; return [getCountryDisplayName(elLocale, code), code]; })); }; + /** * Try to infer a country code from an element we identified as identities.addressCountryCode * @param {HTMLInputElement | HTMLSelectElement} el * @return {string} */ - - const inferCountryCodeFromElement = el => { if (_countryNames.COUNTRY_CODES_TO_NAMES[el.value]) return el.value; if (_countryNames.COUNTRY_NAMES_TO_CODES[el.value]) return _countryNames.COUNTRY_NAMES_TO_CODES[el.value]; const localisedCountryNamesToCodes = getLocalisedCountryNamesToCodes(el); if (localisedCountryNamesToCodes[el.value]) return localisedCountryNamesToCodes[el.value]; - if (el instanceof HTMLSelectElement) { - var _el$selectedOptions$; - - const selectedText = (_el$selectedOptions$ = el.selectedOptions[0]) === null || _el$selectedOptions$ === void 0 ? void 0 : _el$selectedOptions$.text; + const selectedText = el.selectedOptions[0]?.text; if (_countryNames.COUNTRY_CODES_TO_NAMES[selectedText]) return selectedText; if (_countryNames.COUNTRY_NAMES_TO_CODES[selectedText]) return localisedCountryNamesToCodes[selectedText]; if (localisedCountryNamesToCodes[selectedText]) return localisedCountryNamesToCodes[selectedText]; } - return ''; }; + /** * Gets separate expiration month and year from a single string * @param {string} expiration * @return {{expirationYear: string, expirationMonth: string}} */ - - exports.inferCountryCodeFromElement = inferCountryCodeFromElement; - const getMMAndYYYYFromString = expiration => { /** @type {string[]} */ const values = expiration.match(/(\d+)/g) || []; - return values === null || values === void 0 ? void 0 : values.reduce((output, current) => { + return values?.reduce((output, current) => { if (Number(current) > 12) { output.expirationYear = current.padStart(4, '20'); } else { output.expirationMonth = current.padStart(2, '0'); } - return output; }, { expirationYear: '', expirationMonth: '' }); }; + /** * @param {InternalDataStorageObject} credentials * @return {boolean} */ - - exports.getMMAndYYYYFromString = getMMAndYYYYFromString; - const shouldStoreCredentials = _ref3 => { let { credentials } = _ref3; return Boolean(credentials.password); }; + /** * @param {InternalDataStorageObject} credentials * @return {boolean} */ - - const shouldStoreIdentities = _ref4 => { let { identities } = _ref4; return Boolean((identities.firstName || identities.fullName) && identities.addressStreet && identities.addressCity); }; + /** * @param {InternalDataStorageObject} credentials * @return {boolean} */ - - const shouldStoreCreditCards = _ref5 => { let { creditCards } = _ref5; if (!creditCards.cardNumber) return false; - if (creditCards.cardSecurityCode) return true; // Some forms (Amazon) don't have the cvv, so we still save if there's the expiration - - if (creditCards.expiration) return true; // Expiration can also be two separate values - + if (creditCards.cardSecurityCode) return true; + // Some forms (Amazon) don't have the cvv, so we still save if there's the expiration + if (creditCards.expiration) return true; + // Expiration can also be two separate values return Boolean(creditCards.expirationYear && creditCards.expirationMonth); }; + /** * Removes formatting characters from phone numbers, only leaves digits and the + sign * @param {String} phone * @returns {String} */ - - const formatPhoneNumber = phone => phone.replaceAll(/[^0-9|+]/g, ''); + /** * Formats form data into an object to send to the device for storage * If values are insufficient for a complete entry, they are discarded * @param {InternalDataStorageObject} formValues * @return {DataStorageObject} */ - - exports.formatPhoneNumber = formatPhoneNumber; - const prepareFormValuesForStorage = formValues => { - var _identities, _identities2; - /** @type {Partial} */ let { credentials, identities, creditCards - } = formValues; // If we have an identity name but not a card name, copy it over there + } = formValues; - if (!creditCards.cardName && ((_identities = identities) !== null && _identities !== void 0 && _identities.fullName || (_identities2 = identities) !== null && _identities2 !== void 0 && _identities2.firstName)) { - var _identities3; - - creditCards.cardName = ((_identities3 = identities) === null || _identities3 === void 0 ? void 0 : _identities3.fullName) || formatFullName(identities); + // If we have an identity name but not a card name, copy it over there + if (!creditCards.cardName && (identities?.fullName || identities?.firstName)) { + creditCards.cardName = identities?.fullName || formatFullName(identities); } + /** Fixes for credentials **/ // Don't store if there isn't enough data - - if (shouldStoreCredentials(formValues)) { // If we don't have a username to match a password, let's see if the email is available if (credentials.password && !credentials.username && identities.emailAddress) { @@ -12155,17 +11359,15 @@ const prepareFormValuesForStorage = formValues => { } else { credentials = undefined; } + /** Fixes for identities **/ // Don't store if there isn't enough data - - if (shouldStoreIdentities(formValues)) { if (identities.fullName) { // when forms have both first/last and fullName we keep the individual values and drop the fullName if (!(identities.firstName && identities.lastName)) { // If the fullname can be easily split into two, we'll store it as first and last const nameParts = identities.fullName.trim().split(/\s+/); - if (nameParts.length === 2) { identities.firstName = nameParts[0]; identities.lastName = nameParts[1]; @@ -12174,23 +11376,18 @@ const prepareFormValuesForStorage = formValues => { identities.firstName = identities.fullName; } } - delete identities.fullName; } - if (identities.phone) { identities.phone = formatPhoneNumber(identities.phone); } } else { identities = undefined; } + /** Fixes for credit cards **/ // Don't store if there isn't enough data - - if (shouldStoreCreditCards(formValues)) { - var _creditCards$expirati; - if (creditCards.expiration) { const { expirationMonth, @@ -12200,35 +11397,29 @@ const prepareFormValuesForStorage = formValues => { creditCards.expirationYear = expirationYear; delete creditCards.expiration; } - - creditCards.expirationYear = (_creditCards$expirati = creditCards.expirationYear) === null || _creditCards$expirati === void 0 ? void 0 : _creditCards$expirati.padStart(4, '20'); - + creditCards.expirationYear = creditCards.expirationYear?.padStart(4, '20'); if (creditCards.cardNumber) { creditCards.cardNumber = creditCards.cardNumber.replace(/\D/g, ''); } } else { creditCards = undefined; } - return { credentials, identities, creditCards }; }; - exports.prepareFormValuesForStorage = prepareFormValuesForStorage; -},{"./countryNames.js":33,"./matching.js":41}],35:[function(require,module,exports){ +},{"./countryNames.js":35,"./matching.js":43}],37:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getIconStylesBase = exports.getIconStylesAutofilled = exports.getIconStylesAlternate = void 0; - var _inputTypeConfig = require("./inputTypeConfig.js"); - /** * Returns the css-ready base64 encoding of the icon for the given input * @param {HTMLInputElement} input @@ -12239,114 +11430,95 @@ var _inputTypeConfig = require("./inputTypeConfig.js"); const getIcon = function (input, form) { let type = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'base'; const config = (0, _inputTypeConfig.getInputConfig)(input); - if (type === 'base') { return config.getIconBase(input, form); } - if (type === 'filled') { return config.getIconFilled(input, form); } - if (type === 'alternate') { return config.getIconAlternate(input, form); } - return ''; }; + /** * Returns an object with styles to be applied inline * @param {HTMLInputElement} input * @param {String} icon * @return {Object} */ - - const getBasicStyles = (input, icon) => ({ // Height must be > 0 to account for fields initially hidden - 'background-size': "auto ".concat(input.offsetHeight <= 30 && input.offsetHeight > 0 ? '100%' : '24px'), + 'background-size': `auto ${input.offsetHeight <= 30 && input.offsetHeight > 0 ? '100%' : '24px'}`, 'background-position': 'center right', 'background-repeat': 'no-repeat', 'background-origin': 'content-box', - 'background-image': "url(".concat(icon, ")"), + 'background-image': `url(${icon})`, 'transition': 'background 0s' }); + /** * Get inline styles for the injected icon, base state * @param {HTMLInputElement} input * @param {import("./Form").Form} form * @return {Object} */ - - const getIconStylesBase = (input, form) => { const icon = getIcon(input, form); if (!icon) return {}; return getBasicStyles(input, icon); }; + /** * Get inline styles for the injected icon, alternate state * @param {HTMLInputElement} input * @param {import("./Form").Form} form * @return {Object} */ - - exports.getIconStylesBase = getIconStylesBase; - const getIconStylesAlternate = (input, form) => { const icon = getIcon(input, form, 'alternate'); if (!icon) return {}; - return { ...getBasicStyles(input, icon) + return { + ...getBasicStyles(input, icon) }; }; + /** * Get inline styles for the injected icon, autofilled state * @param {HTMLInputElement} input * @param {import("./Form").Form} form * @return {Object} */ - - exports.getIconStylesAlternate = getIconStylesAlternate; - const getIconStylesAutofilled = (input, form) => { const icon = getIcon(input, form, 'filled'); const iconStyle = icon ? getBasicStyles(input, icon) : {}; - return { ...iconStyle, + return { + ...iconStyle, 'background-color': '#F8F498', 'color': '#333333' }; }; - exports.getIconStylesAutofilled = getIconStylesAutofilled; -},{"./inputTypeConfig.js":36}],36:[function(require,module,exports){ +},{"./inputTypeConfig.js":38}],38:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.isFieldDecorated = exports.getInputConfigFromType = exports.getInputConfig = exports.canBeInteractedWith = void 0; - var _logoSvg = require("./logo-svg.js"); - var ddgPasswordIcons = _interopRequireWildcard(require("../UI/img/ddgPasswordIcon.js")); - var _matching = require("./matching.js"); - var _Credentials = require("../InputTypes/Credentials.js"); - var _CreditCard = require("../InputTypes/CreditCard.js"); - var _Identity = require("../InputTypes/Identity.js"); - var _constants = require("../constants.js"); - function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } - function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } - /** * Get the icon for the identities (currently only Dax for emails) * @param {HTMLInputElement} input @@ -12354,28 +11526,25 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && * @return {string} */ const getIdentitiesIcon = (input, _ref) => { - var _device$inContextSign; - let { device } = _ref; - if (!canBeInteractedWith(input)) return ''; // In Firefox web_accessible_resources could leak a unique user identifier, so we avoid it here + if (!canBeInteractedWith(input)) return ''; + // In Firefox web_accessible_resources could leak a unique user identifier, so we avoid it here const { isDDGApp, isFirefox, isExtension } = device.globalConfig; const subtype = (0, _matching.getInputSubtype)(input); - - if ((_device$inContextSign = device.inContextSignup) !== null && _device$inContextSign !== void 0 && _device$inContextSign.isAvailable(subtype)) { + if (device.inContextSignup?.isAvailable(subtype)) { if (isDDGApp || isFirefox) { return _logoSvg.daxGrayscaleBase64; } else if (isExtension) { return chrome.runtime.getURL('img/logo-small-grayscale.svg'); } } - if (subtype === 'emailAddress' && device.isDeviceSignedIn()) { if (isDDGApp || isFirefox) { return _logoSvg.daxBase64; @@ -12383,34 +11552,30 @@ const getIdentitiesIcon = (input, _ref) => { return chrome.runtime.getURL('img/logo-small.svg'); } } - return ''; }; + /** * Get the alternate icon for the identities (currently only Dax for emails) * @param {HTMLInputElement} input * @param {import("./Form").Form} form * @return {string} */ - - const getIdentitiesAlternateIcon = (input, _ref2) => { - var _device$inContextSign2; - let { device } = _ref2; - if (!canBeInteractedWith(input)) return ''; // In Firefox web_accessible_resources could leak a unique user identifier, so we avoid it here + if (!canBeInteractedWith(input)) return ''; + // In Firefox web_accessible_resources could leak a unique user identifier, so we avoid it here const { isDDGApp, isFirefox, isExtension } = device.globalConfig; const subtype = (0, _matching.getInputSubtype)(input); - const isIncontext = (_device$inContextSign2 = device.inContextSignup) === null || _device$inContextSign2 === void 0 ? void 0 : _device$inContextSign2.isAvailable(subtype); + const isIncontext = device.inContextSignup?.isAvailable(subtype); const isEmailProtection = subtype === 'emailAddress' && device.isDeviceSignedIn(); - if (isIncontext || isEmailProtection) { if (isDDGApp || isFirefox) { return _logoSvg.daxBase64; @@ -12418,27 +11583,23 @@ const getIdentitiesAlternateIcon = (input, _ref2) => { return chrome.runtime.getURL('img/logo-small.svg'); } } - return ''; }; + /** * Checks whether a field is readonly or disabled * @param {HTMLInputElement} input * @return {boolean} */ - - const canBeInteractedWith = input => !input.readOnly && !input.disabled; + /** * Checks if the input can be decorated and we have the needed data * @param {HTMLInputElement} input * @param {import("../DeviceInterface/InterfacePrototype").default} device * @returns {Promise} */ - - exports.canBeInteractedWith = canBeInteractedWith; - const canBeAutofilled = async (input, device) => { if (!canBeInteractedWith(input)) return false; const mainType = (0, _matching.getInputMainType)(input); @@ -12453,12 +11614,11 @@ const canBeAutofilled = async (input, device) => { }, device.inContextSignup); return Boolean(canAutofill); }; + /** * A map of config objects. These help by centralising here some complexity * @type {InputTypeConfig} */ - - const inputTypeConfig = { /** @type {CredentialsInputTypeConfig} */ credentials: { @@ -12469,22 +11629,18 @@ const inputTypeConfig = { device } = _ref3; if (!canBeInteractedWith(input)) return ''; - if (device.settings.featureToggles.inlineIcon_credentials) { return ddgPasswordIcons.ddgPasswordIconBase; } - return ''; }, getIconFilled: (_input, _ref4) => { let { device } = _ref4; - if (device.settings.featureToggles.inlineIcon_credentials) { return ddgPasswordIcons.ddgPasswordIconFilled; } - return ''; }, getIconAlternate: () => '', @@ -12494,27 +11650,23 @@ const inputTypeConfig = { isHybrid, device } = _ref5; - // if we are on a 'login' page, check if we have data to autofill the field if (isLogin || isHybrid) { return canBeAutofilled(input, device); - } // at this point, it's not a 'login' form, so we could offer to provide a password - + } + // at this point, it's not a 'login' form, so we could offer to provide a password if (device.settings.featureToggles.password_generation) { const subtype = (0, _matching.getInputSubtype)(input); - if (subtype === 'password') { return canBeInteractedWith(input); } } - return false; }, dataType: 'Credentials', tooltipItem: data => (0, _Credentials.createCredentialsTooltipItem)(data) }, - /** @type {CreditCardsInputTypeConfig} */ creditCards: { type: 'creditCards', @@ -12531,7 +11683,6 @@ const inputTypeConfig = { dataType: 'CreditCards', tooltipItem: data => new _CreditCard.CreditCardTooltipItem(data) }, - /** @type {IdentitiesInputTypeConfig} */ identities: { type: 'identities', @@ -12548,7 +11699,6 @@ const inputTypeConfig = { dataType: 'Identities', tooltipItem: data => new _Identity.IdentityTooltipItem(data) }, - /** @type {UnknownInputTypeConfig} */ unknown: { type: 'unknown', @@ -12563,55 +11713,49 @@ const inputTypeConfig = { } } }; + /** * Retrieves configs from an input el * @param {HTMLInputElement} input * @returns {InputTypeConfigs} */ - const getInputConfig = input => { const inputType = (0, _matching.getInputType)(input); return getInputConfigFromType(inputType); }; + /** * Retrieves configs from an input type * @param {import('./matching').SupportedTypes} inputType * @returns {InputTypeConfigs} */ - - exports.getInputConfig = getInputConfig; - const getInputConfigFromType = inputType => { const inputMainType = (0, _matching.getMainTypeFromType)(inputType); return inputTypeConfig[inputMainType]; }; + /** * Given an input field checks wheter it was previously decorated * @param {HTMLInputElement} input * @returns {Boolean} */ - - exports.getInputConfigFromType = getInputConfigFromType; - const isFieldDecorated = input => { return input.hasAttribute(_constants.constants.ATTR_INPUT_TYPE); }; - exports.isFieldDecorated = isFieldDecorated; -},{"../InputTypes/Credentials.js":43,"../InputTypes/CreditCard.js":44,"../InputTypes/Identity.js":45,"../UI/img/ddgPasswordIcon.js":57,"../constants.js":62,"./logo-svg.js":38,"./matching.js":41}],37:[function(require,module,exports){ +},{"../InputTypes/Credentials.js":45,"../InputTypes/CreditCard.js":46,"../InputTypes/Identity.js":47,"../UI/img/ddgPasswordIcon.js":59,"../constants.js":64,"./logo-svg.js":40,"./matching.js":43}],39:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.extractElementStrings = exports.EXCLUDED_TAGS = void 0; - var _matching = require("./matching.js"); +const EXCLUDED_TAGS = exports.EXCLUDED_TAGS = ['BR', 'SCRIPT', 'NOSCRIPT', 'OPTION', 'STYLE']; -const EXCLUDED_TAGS = ['BR', 'SCRIPT', 'NOSCRIPT', 'OPTION', 'STYLE']; /** * Extract all strings of an element's children to an array. * "element.textContent" is a string which is merged of all children nodes, @@ -12622,72 +11766,78 @@ const EXCLUDED_TAGS = ['BR', 'SCRIPT', 'NOSCRIPT', 'OPTION', 'STYLE']; * @returns {string[]} * All strings in an element. */ - -exports.EXCLUDED_TAGS = EXCLUDED_TAGS; - const extractElementStrings = element => { const strings = new Set(); - const _extractElementStrings = el => { if (EXCLUDED_TAGS.includes(el.tagName)) { return; - } // only take the string when it's an explicit text node - + } + // only take the string when it's an explicit text node if (el.nodeType === el.TEXT_NODE || !el.childNodes.length) { let trimmedText = (0, _matching.removeExcessWhitespace)(el.textContent); - if (trimmedText) { strings.add(trimmedText); } - return; } - for (let node of el.childNodes) { let nodeType = node.nodeType; - if (nodeType !== node.ELEMENT_NODE && nodeType !== node.TEXT_NODE) { continue; } - _extractElementStrings(node); } }; - _extractElementStrings(element); - return [...strings]; }; - exports.extractElementStrings = extractElementStrings; -},{"./matching.js":41}],38:[function(require,module,exports){ +},{"./matching.js":43}],40:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.daxGrayscaleBase64 = exports.daxBase64 = void 0; -const daxSvg = "\n\n \n \n \n \n \n \n \n \n \n \n \n\n".trim(); -const daxBase64 = "data:image/svg+xml;base64,".concat(window.btoa(daxSvg)); -exports.daxBase64 = daxBase64; -const daxGrayscaleSvg = "\n\n \n \n \n \n\n".trim(); -const daxGrayscaleBase64 = "data:image/svg+xml;base64,".concat(window.btoa(daxGrayscaleSvg)); -exports.daxGrayscaleBase64 = daxGrayscaleBase64; - -},{}],39:[function(require,module,exports){ +const daxSvg = ` + + + + + + + + + + + + + +`.trim(); +const daxBase64 = exports.daxBase64 = `data:image/svg+xml;base64,${window.btoa(daxSvg)}`; +const daxGrayscaleSvg = ` + + + + + + +`.trim(); +const daxGrayscaleBase64 = exports.daxGrayscaleBase64 = `data:image/svg+xml;base64,${window.btoa(daxGrayscaleSvg)}`; + +},{}],41:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.matchingConfiguration = void 0; - /* DO NOT EDIT, this file was generated by scripts/precompile-regexes.js */ /** @type {MatchingConfiguration} */ -const matchingConfiguration = { +const matchingConfiguration = exports.matchingConfiguration = { matchers: { fields: { unknown: { @@ -13122,9 +12272,8 @@ const matchingConfiguration = { } } }; -exports.matchingConfiguration = matchingConfiguration; -},{}],40:[function(require,module,exports){ +},{}],42:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { @@ -13132,11 +12281,8 @@ Object.defineProperty(exports, "__esModule", { }); exports.logMatching = logMatching; exports.logUnmatched = logUnmatched; - var _autofillUtils = require("../autofill-utils.js"); - var _matching = require("./matching.js"); - /** * Logs out matching details when debug flag is active * @param {HTMLInputElement | HTMLSelectElement} el @@ -13154,49 +12300,44 @@ function logMatching(el, matchingResult) { matcherType } = matchingResult; const verb = getVerb(matchingResult); - let stringToLog = "".concat(verb, " for \"").concat(matcherType, "\" with \"").concat(strategyName, "\""); - + let stringToLog = `${verb} for "${matcherType}" with "${strategyName}"`; if (matchedString && matchedFrom) { - stringToLog += "\nString: \"".concat(matchedString, "\"\nSource: \"").concat(matchedFrom, "\""); + stringToLog += `\nString: "${matchedString}"\nSource: "${matchedFrom}"`; } - console.log(stringToLog); console.groupEnd(); } + /** * Helper to form the correct string based on matching result type * @param {MatchingResult} matchingResult * @return {string} */ - - function getVerb(matchingResult) { if (matchingResult.matched) return 'Matched'; if (matchingResult.proceed === false) return 'Matched forceUnknown'; if (matchingResult.skip) return 'Skipped'; return ''; } + /** * Returns a human-friendly name to identify a single input field * @param {HTMLInputElement | HTMLSelectElement} el * @returns {string} */ - - function getInputIdentifier(el) { const label = (0, _matching.getExplicitLabelsText)(el); - const placeholder = el instanceof HTMLInputElement && el.placeholder ? "".concat(el.placeholder) : ''; - const name = el.name ? "".concat(el.name) : ''; - const id = el.id ? "#".concat(el.id) : ''; + const placeholder = el instanceof HTMLInputElement && el.placeholder ? `${el.placeholder}` : ''; + const name = el.name ? `${el.name}` : ''; + const id = el.id ? `#${el.id}` : ''; return 'Field: ' + (label || placeholder || name || id); } + /** * Logs info when a field was not matched by the algo * @param el * @param allStrings */ - - function logUnmatched(el, allStrings) { if (!(0, _autofillUtils.shouldLog)()) return; const fieldIdentifier = getInputIdentifier(el); @@ -13207,7 +12348,7 @@ function logUnmatched(el, allStrings) { console.groupEnd(); } -},{"../autofill-utils.js":59,"./matching.js":41}],41:[function(require,module,exports){ +},{"../autofill-utils.js":61,"./matching.js":43}],43:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { @@ -13222,140 +12363,76 @@ exports.getMainTypeFromType = getMainTypeFromType; exports.getRelatedText = void 0; exports.getSubtypeFromType = getSubtypeFromType; exports.removeExcessWhitespace = exports.matchInPlaceholderAndLabels = void 0; - var _constants = require("../constants.js"); - var _labelUtil = require("./label-util.js"); - var _compiledMatchingConfig = require("./matching-config/__generated__/compiled-matching-config.js"); - var _matchingUtils = require("./matching-utils.js"); - var _autofillUtils = require("../autofill-utils.js"); - -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - -function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); } - -function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } } - -function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); } - -function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; } - -function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; } - -function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); } - -function _classApplyDescriptorSet(receiver, descriptor, value) { if (descriptor.set) { descriptor.set.call(receiver, value); } else { if (!descriptor.writable) { throw new TypeError("attempted to set read only private field"); } descriptor.value = value; } } - const { TEXT_LENGTH_CUTOFF, ATTR_INPUT_TYPE } = _constants.constants; -/** @type {{[K in keyof MatcherLists]?: { minWidth: number }} } */ +/** @type {{[K in keyof MatcherLists]?: { minWidth: number }} } */ const dimensionBounds = { emailAddress: { minWidth: 35 } }; + /** * An abstraction around the concept of classifying input fields. * * The only state this class keeps is derived from the passed-in MatchingConfiguration. */ - -var _config = /*#__PURE__*/new WeakMap(); - -var _cssSelectors = /*#__PURE__*/new WeakMap(); - -var _ddgMatchers = /*#__PURE__*/new WeakMap(); - -var _vendorRegexRules = /*#__PURE__*/new WeakMap(); - -var _matcherLists = /*#__PURE__*/new WeakMap(); - -var _defaultStrategyOrder = /*#__PURE__*/new WeakMap(); - class Matching { /** @type {MatchingConfiguration} */ + #config; /** @type {CssSelectorConfiguration['selectors']} */ + #cssSelectors; /** @type {Record} */ + #ddgMatchers; /** * This acts as an internal cache for the larger vendorRegexes * @type {VendorRegexConfiguration['rules']} */ + #vendorRegexRules; /** @type {MatcherLists} */ + #matcherLists; /** @type {Array} */ + #defaultStrategyOrder = ['cssSelector', 'ddgMatcher', 'vendorRegex']; /** @type {Record} */ + activeElementStrings = { + nameAttr: '', + labelText: '', + placeholderAttr: '', + relatedText: '', + id: '' + }; /** * @param {MatchingConfiguration} config */ constructor(config) { - _classPrivateFieldInitSpec(this, _config, { - writable: true, - value: void 0 - }); - - _classPrivateFieldInitSpec(this, _cssSelectors, { - writable: true, - value: void 0 - }); - - _classPrivateFieldInitSpec(this, _ddgMatchers, { - writable: true, - value: void 0 - }); - - _classPrivateFieldInitSpec(this, _vendorRegexRules, { - writable: true, - value: void 0 - }); - - _classPrivateFieldInitSpec(this, _matcherLists, { - writable: true, - value: void 0 - }); - - _classPrivateFieldInitSpec(this, _defaultStrategyOrder, { - writable: true, - value: ['cssSelector', 'ddgMatcher', 'vendorRegex'] - }); - - _defineProperty(this, "activeElementStrings", { - nameAttr: '', - labelText: '', - placeholderAttr: '', - relatedText: '', - id: '' - }); - - _defineProperty(this, "_elementStringCache", new WeakMap()); - - _classPrivateFieldSet(this, _config, config); - - _classPrivateFieldSet(this, _vendorRegexRules, _classPrivateFieldGet(this, _config).strategies.vendorRegex.rules); - - _classPrivateFieldSet(this, _cssSelectors, _classPrivateFieldGet(this, _config).strategies.cssSelector.selectors); - - _classPrivateFieldSet(this, _ddgMatchers, _classPrivateFieldGet(this, _config).strategies.ddgMatcher.matchers); - - _classPrivateFieldSet(this, _matcherLists, { + this.#config = config; + this.#vendorRegexRules = this.#config.strategies.vendorRegex.rules; + this.#cssSelectors = this.#config.strategies.cssSelector.selectors; + this.#ddgMatchers = this.#config.strategies.ddgMatcher.matchers; + this.#matcherLists = { unknown: [], cc: [], id: [], password: [], username: [], emailAddress: [] - }); + }; + /** * Convert the raw config data into actual references. * @@ -13363,125 +12440,104 @@ class Matching { * * `email: [{type: "email", strategies: {cssSelector: "email", ... etc}]` */ - - - for (let [listName, matcherNames] of Object.entries(_classPrivateFieldGet(this, _config).matchers.lists)) { + for (let [listName, matcherNames] of Object.entries(this.#config.matchers.lists)) { for (let fieldName of matcherNames) { - if (!_classPrivateFieldGet(this, _matcherLists)[listName]) { - _classPrivateFieldGet(this, _matcherLists)[listName] = []; + if (!this.#matcherLists[listName]) { + this.#matcherLists[listName] = []; } - - _classPrivateFieldGet(this, _matcherLists)[listName].push(_classPrivateFieldGet(this, _config).matchers.fields[fieldName]); + this.#matcherLists[listName].push(this.#config.matchers.fields[fieldName]); } } } + /** * @param {HTMLInputElement|HTMLSelectElement} input * @param {HTMLElement} formEl */ - - setActiveElementStrings(input, formEl) { this.activeElementStrings = this.getElementStrings(input, formEl); } + /** * Try to access a 'vendor regex' by name * @param {string} regexName * @returns {RegExp | undefined} */ - - vendorRegex(regexName) { - const match = _classPrivateFieldGet(this, _vendorRegexRules)[regexName]; - + const match = this.#vendorRegexRules[regexName]; if (!match) { console.warn('Vendor Regex not found for', regexName); return undefined; } - return match; } + /** * Strategies can have different lookup names. This returns the correct one * @param {MatcherTypeNames} matcherName * @param {StrategyNames} vendorRegex * @returns {MatcherTypeNames} */ - - getStrategyLookupByType(matcherName, vendorRegex) { - var _classPrivateFieldGet2; - - return (_classPrivateFieldGet2 = _classPrivateFieldGet(this, _config).matchers.fields[matcherName]) === null || _classPrivateFieldGet2 === void 0 ? void 0 : _classPrivateFieldGet2.strategies[vendorRegex]; + return this.#config.matchers.fields[matcherName]?.strategies[vendorRegex]; } + /** * Try to access a 'css selector' by name from configuration * @param {RequiredCssSelectors | string} selectorName * @returns {string}; */ - - cssSelector(selectorName) { - const match = _classPrivateFieldGet(this, _cssSelectors)[selectorName]; - + const match = this.#cssSelectors[selectorName]; if (!match) { console.warn('CSS selector not found for %s, using a default value', selectorName); return ''; } - return match; } + /** * Try to access a 'ddg matcher' by name from configuration * @param {MatcherTypeNames | string} matcherName * @returns {DDGMatcher | undefined} */ - - ddgMatcher(matcherName) { - const match = _classPrivateFieldGet(this, _ddgMatchers)[matcherName]; - + const match = this.#ddgMatchers[matcherName]; if (!match) { console.warn('DDG matcher not found for', matcherName); return undefined; } - return match; } + /** * Returns the RegExp for the given matcherName, with proper flags * @param {AllDDGMatcherNames} matcherName * @returns {RegExp|undefined} */ - - getDDGMatcherRegex(matcherName) { const matcher = this.ddgMatcher(matcherName); - if (!matcher || !matcher.match) { console.warn('DDG matcher has unexpected format'); return undefined; } - - return matcher === null || matcher === void 0 ? void 0 : matcher.match; + return matcher?.match; } + /** * Try to access a list of matchers by name - these are the ones collected in the constructor * @param {keyof MatcherLists} listName * @return {Matcher[]} */ - - matcherList(listName) { - const matcherList = _classPrivateFieldGet(this, _matcherLists)[listName]; - + const matcherList = this.#matcherLists[listName]; if (!matcherList) { console.warn('MatcherList not found for ', listName); return []; } - return matcherList; } + /** * Convert a list of matchers into a single CSS selector. * @@ -13491,52 +12547,46 @@ class Matching { * @param {keyof MatcherLists} listName * @returns {string | undefined} */ - - joinCssSelectors(listName) { const matcherList = this.matcherList(listName); - if (!matcherList) { console.warn('Matcher list not found for', listName); return undefined; } + /** * @type {string[]} */ - - const selectors = []; - for (let matcher of matcherList) { if (matcher.strategies.cssSelector) { const css = this.cssSelector(matcher.strategies.cssSelector); - if (css) { selectors.push(css); } } } - return selectors.join(', '); } + /** * Returns true if the field is visible and large enough * @param {keyof MatcherLists} matchedType * @param {HTMLInputElement} input * @returns {boolean} */ - - isInputLargeEnough(matchedType, input) { const expectedDimensionBounds = dimensionBounds[matchedType]; if (!expectedDimensionBounds) return true; const width = input.offsetWidth; - const height = input.offsetHeight; // Ignore hidden elements as we can't determine their dimensions + const height = input.offsetHeight; + // Ignore hidden elements as we can't determine their dimensions const isHidden = height === 0 && width === 0; if (isHidden) return true; return width >= expectedDimensionBounds.minWidth; } + /** * Tries to infer the input type for an input * @@ -13545,28 +12595,23 @@ class Matching { * @param {SetInputTypeOpts} [opts] * @returns {SupportedTypes} */ - - inferInputType(input, formEl) { let opts = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; const presetType = getInputType(input); - if (presetType !== 'unknown') { return presetType; } - this.setActiveElementStrings(input, formEl); - if (this.subtypeFromMatchers('unknown', input)) return 'unknown'; // For CC forms we run aggressive matches, so we want to make sure we only - // run them on actual CC forms to avoid false positives and expensive loops + if (this.subtypeFromMatchers('unknown', input)) return 'unknown'; + // For CC forms we run aggressive matches, so we want to make sure we only + // run them on actual CC forms to avoid false positives and expensive loops if (opts.isCCForm) { const subtype = this.subtypeFromMatchers('cc', input); - if (subtype && isValidCreditCardSubtype(subtype)) { - return "creditCards.".concat(subtype); + return `creditCards.${subtype}`; } } - if (input instanceof HTMLInputElement) { if (this.subtypeFromMatchers('password', input)) { // Any other input type is likely a false match @@ -13575,7 +12620,6 @@ class Matching { return 'credentials.password'; } } - if (this.subtypeFromMatchers('emailAddress', input) && this.isInputLargeEnough('emailAddress', input)) { if (opts.isLogin || opts.isHybrid) { // TODO: Being this support back in the future @@ -13584,32 +12628,29 @@ class Matching { // if (opts.supportsIdentitiesAutofill && !opts.hasCredentials) { // return 'identities.emailAddress' // } - return 'credentials.username'; - } // TODO: Temporary hack to support Google signin in different languages - // https://app.asana.com/0/1198964220583541/1201650539303898/f + return 'credentials.username'; + } + // TODO: Temporary hack to support Google signin in different languages + // https://app.asana.com/0/1198964220583541/1201650539303898/f if (window.location.href.includes('https://accounts.google.com/v3/signin/identifier') && input.matches('[type=email][autocomplete=username]')) { return 'credentials.username'; } - return 'identities.emailAddress'; } - if (this.subtypeFromMatchers('username', input)) { return 'credentials.username'; } } - const idSubtype = this.subtypeFromMatchers('id', input); - if (idSubtype && isValidIdentitiesSubtype(idSubtype)) { - return "identities.".concat(idSubtype); + return `identities.${idSubtype}`; } - (0, _matchingUtils.logUnmatched)(input, this.activeElementStrings); return 'unknown'; } + /** * @typedef {{ * isLogin?: boolean, @@ -13627,39 +12668,31 @@ class Matching { * @param {SetInputTypeOpts} [opts] * @returns {SupportedSubTypes | string} */ - - setInputType(input, formEl) { let opts = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; const type = this.inferInputType(input, formEl, opts); input.setAttribute(ATTR_INPUT_TYPE, type); return type; } + /** * Tries to infer input subtype, with checks in decreasing order of reliability * @param {keyof MatcherLists} listName * @param {HTMLInputElement|HTMLSelectElement} el * @return {MatcherTypeNames|undefined} */ - - subtypeFromMatchers(listName, el) { const matchers = this.matcherList(listName); + /** * Loop through each strategy in order */ - - for (let strategyName of _classPrivateFieldGet(this, _defaultStrategyOrder)) { - var _result4; - + for (let strategyName of this.#defaultStrategyOrder) { let result; /** * Now loop through each matcher in the list. */ - for (let matcher of matchers) { - var _result, _result2, _result3; - /** * for each `strategyName` (such as cssSelector), check * if the current matcher implements it. @@ -13669,56 +12702,50 @@ class Matching { * Sometimes a matcher may not implement the current strategy, * so we skip it */ - if (!lookup) continue; + /** * Now perform the matching */ - if (strategyName === 'cssSelector') { result = this.execCssSelector(lookup, el); } - if (strategyName === 'ddgMatcher') { result = this.execDDGMatcher(lookup); } - if (strategyName === 'vendorRegex') { result = this.execVendorRegex(lookup); } + /** * If there's a match, return the matcher type. * * So, for example if 'username' had a `cssSelector` implemented, and * it matched the current element, then we'd return 'username' */ - - - if ((_result = result) !== null && _result !== void 0 && _result.matched) { + if (result?.matched) { (0, _matchingUtils.logMatching)(el, result); return matcher.type; } + /** * If a matcher wants to prevent all future matching on this element, * it would return { matched: false, proceed: false } */ - - - if (!((_result2 = result) !== null && _result2 !== void 0 && _result2.matched) && ((_result3 = result) === null || _result3 === void 0 ? void 0 : _result3.proceed) === false) { - (0, _matchingUtils.logMatching)(el, result); // If we get here, do not allow subsequent strategies to continue - + if (!result?.matched && result?.proceed === false) { + (0, _matchingUtils.logMatching)(el, result); + // If we get here, do not allow subsequent strategies to continue return undefined; } } - - if ((_result4 = result) !== null && _result4 !== void 0 && _result4.skip) { + if (result?.skip) { (0, _matchingUtils.logMatching)(el, result); break; } } - return undefined; } + /** * CSS selector matching just leverages the `.matches` method on elements * @@ -13726,8 +12753,6 @@ class Matching { * @param {HTMLInputElement|HTMLSelectElement} el * @returns {MatchingResult} */ - - execCssSelector(lookup, el) { const selector = this.cssSelector(lookup); return { @@ -13736,6 +12761,7 @@ class Matching { matcherType: lookup }; } + /** * A DDG Matcher can have a `match` regex along with a `not` regex. This is done * to allow it to be driven by configuration as it avoids needing to invoke custom functions. @@ -13746,8 +12772,6 @@ class Matching { * @param {MatcherTypeNames} lookup * @returns {MatchingResult} */ - - execDDGMatcher(lookup) { /** @type {MatchingResult} */ const defaultResult = { @@ -13756,46 +12780,44 @@ class Matching { matcherType: lookup }; const ddgMatcher = this.ddgMatcher(lookup); - if (!ddgMatcher || !ddgMatcher.match) { return defaultResult; } - let matchRexExp = this.getDDGMatcherRegex(lookup); - if (!matchRexExp) { return defaultResult; } - let requiredScore = ['match', 'forceUnknown', 'maxDigits'].filter(ddgMatcherProp => ddgMatcherProp in ddgMatcher).length; - /** @type {MatchableStrings[]} */ + /** @type {MatchableStrings[]} */ const matchableStrings = ddgMatcher.matchableStrings || ['labelText', 'placeholderAttr', 'relatedText']; - for (let stringName of matchableStrings) { let elementString = this.activeElementStrings[stringName]; - if (!elementString) continue; // Scoring to ensure all DDG tests are valid + if (!elementString) continue; + // Scoring to ensure all DDG tests are valid let score = 0; - /** @type {MatchingResult} */ - const result = { ...defaultResult, + /** @type {MatchingResult} */ + const result = { + ...defaultResult, matchedString: elementString, matchedFrom: stringName - }; // If a negated regex was provided, ensure it does not match - // If it DOES match - then we need to prevent any future strategies from continuing + }; + // If a negated regex was provided, ensure it does not match + // If it DOES match - then we need to prevent any future strategies from continuing if (ddgMatcher.forceUnknown) { let notRegex = ddgMatcher.forceUnknown; - if (!notRegex) { - return { ...result, + return { + ...result, matched: false }; } - if (notRegex.test(elementString)) { - return { ...result, + return { + ...result, matched: false, proceed: false }; @@ -13804,61 +12826,59 @@ class Matching { score++; } } - if (ddgMatcher.skip) { let skipRegex = ddgMatcher.skip; - if (!skipRegex) { - return { ...result, + return { + ...result, matched: false }; } - if (skipRegex.test(elementString)) { - return { ...result, + return { + ...result, matched: false, skip: true }; } - } // if the `match` regex fails, moves onto the next string - + } + // if the `match` regex fails, moves onto the next string if (!matchRexExp.test(elementString)) { continue; - } // Otherwise, increment the score - + } - score++; // If a 'maxDigits' rule was provided, validate it + // Otherwise, increment the score + score++; + // If a 'maxDigits' rule was provided, validate it if (ddgMatcher.maxDigits) { const digitLength = elementString.replace(/[^0-9]/g, '').length; - if (digitLength > ddgMatcher.maxDigits) { - return { ...result, + return { + ...result, matched: false }; } else { score++; } } - if (score === requiredScore) { - return { ...result, + return { + ...result, matched: true }; } } - return defaultResult; } + /** * If we get here, a firefox/vendor regex was given and we can execute it on the element * strings * @param {MatcherTypeNames} lookup * @return {MatchingResult} */ - - execVendorRegex(lookup) { /** @type {MatchingResult} */ const defaultResult = { @@ -13867,30 +12887,26 @@ class Matching { matcherType: lookup }; const regex = this.vendorRegex(lookup); - if (!regex) { return defaultResult; } /** @type {MatchableStrings[]} */ - - const stringsToMatch = ['placeholderAttr', 'nameAttr', 'labelText', 'id', 'relatedText']; - for (let stringName of stringsToMatch) { let elementString = this.activeElementStrings[stringName]; if (!elementString) continue; - if (regex.test(elementString)) { - return { ...defaultResult, + return { + ...defaultResult, matched: true, matchedString: elementString, matchedFrom: stringName }; } } - return defaultResult; } + /** * Yield strings in the order in which they should be checked against. * @@ -13909,16 +12925,14 @@ class Matching { * @param {HTMLElement} form * @returns {Record} */ - - + _elementStringCache = new WeakMap(); getElementStrings(el, form) { if (this._elementStringCache.has(el)) { return this._elementStringCache.get(el); } - const explicitLabelsText = getExplicitLabelsText(el); - /** @type {Record} */ + /** @type {Record} */ const next = { nameAttr: el.name, labelText: explicitLabelsText, @@ -13926,254 +12940,217 @@ class Matching { id: el.id, relatedText: explicitLabelsText ? '' : getRelatedText(el, form, this.cssSelector('formInputsSelector')) }; - this._elementStringCache.set(el, next); - return next; } - clear() { this._elementStringCache = new WeakMap(); } + /** * @param {HTMLInputElement|HTMLSelectElement} input * @param {HTMLElement} form * @returns {Matching} */ - - forInput(input, form) { this.setActiveElementStrings(input, form); return this; } + /** * @type {MatchingConfiguration} */ - - + static emptyConfig = { + matchers: { + lists: {}, + fields: {} + }, + strategies: { + 'vendorRegex': { + rules: {}, + ruleSets: [] + }, + 'ddgMatcher': { + matchers: {} + }, + 'cssSelector': { + selectors: {} + } + } + }; } + /** * @returns {SupportedTypes} */ - - exports.Matching = Matching; - -_defineProperty(Matching, "emptyConfig", { - matchers: { - lists: {}, - fields: {} - }, - strategies: { - 'vendorRegex': { - rules: {}, - ruleSets: [] - }, - 'ddgMatcher': { - matchers: {} - }, - 'cssSelector': { - selectors: {} - } - } -}); - function getInputType(input) { - const attr = input === null || input === void 0 ? void 0 : input.getAttribute(ATTR_INPUT_TYPE); - + const attr = input?.getAttribute(ATTR_INPUT_TYPE); if (isValidSupportedType(attr)) { return attr; } - return 'unknown'; } + /** * Retrieves the main type * @param {SupportedTypes | string} type * @returns {SupportedMainTypes} */ - - function getMainTypeFromType(type) { const mainType = type.split('.')[0]; - switch (mainType) { case 'credentials': case 'creditCards': case 'identities': return mainType; } - return 'unknown'; } + /** * Retrieves the input main type * @param {HTMLInputElement} input * @returns {SupportedMainTypes} */ - - const getInputMainType = input => getMainTypeFromType(getInputType(input)); -/** @typedef {supportedIdentitiesSubtypes[number]} SupportedIdentitiesSubTypes */ - +/** @typedef {supportedIdentitiesSubtypes[number]} SupportedIdentitiesSubTypes */ exports.getInputMainType = getInputMainType; -const supportedIdentitiesSubtypes = -/** @type {const} */ -['emailAddress', 'firstName', 'middleName', 'lastName', 'fullName', 'phone', 'addressStreet', 'addressStreet2', 'addressCity', 'addressProvince', 'addressPostalCode', 'addressCountryCode', 'birthdayDay', 'birthdayMonth', 'birthdayYear']; +const supportedIdentitiesSubtypes = /** @type {const} */['emailAddress', 'firstName', 'middleName', 'lastName', 'fullName', 'phone', 'addressStreet', 'addressStreet2', 'addressCity', 'addressProvince', 'addressPostalCode', 'addressCountryCode', 'birthdayDay', 'birthdayMonth', 'birthdayYear']; + /** * @param {SupportedTypes | any} supportedType * @returns {supportedType is SupportedIdentitiesSubTypes} */ - function isValidIdentitiesSubtype(supportedType) { return supportedIdentitiesSubtypes.includes(supportedType); } -/** @typedef {supportedCreditCardSubtypes[number]} SupportedCreditCardSubTypes */ +/** @typedef {supportedCreditCardSubtypes[number]} SupportedCreditCardSubTypes */ +const supportedCreditCardSubtypes = /** @type {const} */['cardName', 'cardNumber', 'cardSecurityCode', 'expirationMonth', 'expirationYear', 'expiration']; -const supportedCreditCardSubtypes = -/** @type {const} */ -['cardName', 'cardNumber', 'cardSecurityCode', 'expirationMonth', 'expirationYear', 'expiration']; /** * @param {SupportedTypes | any} supportedType * @returns {supportedType is SupportedCreditCardSubTypes} */ - function isValidCreditCardSubtype(supportedType) { return supportedCreditCardSubtypes.includes(supportedType); } -/** @typedef {supportedCredentialsSubtypes[number]} SupportedCredentialsSubTypes */ +/** @typedef {supportedCredentialsSubtypes[number]} SupportedCredentialsSubTypes */ +const supportedCredentialsSubtypes = /** @type {const} */['password', 'username']; -const supportedCredentialsSubtypes = -/** @type {const} */ -['password', 'username']; /** * @param {SupportedTypes | any} supportedType * @returns {supportedType is SupportedCredentialsSubTypes} */ - function isValidCredentialsSubtype(supportedType) { return supportedCredentialsSubtypes.includes(supportedType); } + /** @typedef {SupportedIdentitiesSubTypes | SupportedCreditCardSubTypes | SupportedCredentialsSubTypes} SupportedSubTypes */ /** @typedef {`identities.${SupportedIdentitiesSubTypes}` | `creditCards.${SupportedCreditCardSubTypes}` | `credentials.${SupportedCredentialsSubTypes}` | 'unknown'} SupportedTypes */ +const supportedTypes = [...supportedIdentitiesSubtypes.map(type => `identities.${type}`), ...supportedCreditCardSubtypes.map(type => `creditCards.${type}`), ...supportedCredentialsSubtypes.map(type => `credentials.${type}`)]; - -const supportedTypes = [...supportedIdentitiesSubtypes.map(type => "identities.".concat(type)), ...supportedCreditCardSubtypes.map(type => "creditCards.".concat(type)), ...supportedCredentialsSubtypes.map(type => "credentials.".concat(type))]; /** * Retrieves the subtype * @param {SupportedTypes | string} type * @returns {SupportedSubTypes | 'unknown'} */ - function getSubtypeFromType(type) { - const subType = type === null || type === void 0 ? void 0 : type.split('.')[1]; + const subType = type?.split('.')[1]; const validType = isValidSubtype(subType); return validType ? subType : 'unknown'; } + /** * @param {SupportedSubTypes | any} supportedSubType * @returns {supportedSubType is SupportedSubTypes} */ - - function isValidSubtype(supportedSubType) { return isValidIdentitiesSubtype(supportedSubType) || isValidCreditCardSubtype(supportedSubType) || isValidCredentialsSubtype(supportedSubType); } + /** * @param {SupportedTypes | any} supportedType * @returns {supportedType is SupportedTypes} */ - - function isValidSupportedType(supportedType) { return supportedTypes.includes(supportedType); } + /** * Retrieves the input subtype * @param {HTMLInputElement|Element} input * @returns {SupportedSubTypes | 'unknown'} */ - - function getInputSubtype(input) { const type = getInputType(input); return getSubtypeFromType(type); } + /** * Remove whitespace of more than 2 in a row and trim the string * @param {string | null} string * @return {string} */ - - const removeExcessWhitespace = function () { let string = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; if (!string) return ''; return string.replace(/\n/g, ' ').replace(/\s{2,}/g, ' ').trim(); }; + /** * Get text from all explicit labels * @param {HTMLInputElement|HTMLSelectElement} el * @return {string} */ - - exports.removeExcessWhitespace = removeExcessWhitespace; - const getExplicitLabelsText = el => { const labelTextCandidates = []; - for (let label of el.labels || []) { labelTextCandidates.push(...(0, _labelUtil.extractElementStrings)(label)); } - if (el.hasAttribute('aria-label')) { labelTextCandidates.push(removeExcessWhitespace(el.getAttribute('aria-label'))); - } // Try to access another element if it was marked as the label for this input/select - + } + // Try to access another element if it was marked as the label for this input/select const ariaLabelAttr = removeExcessWhitespace(el.getAttribute('aria-labelled') || el.getAttribute('aria-labelledby')); - if (ariaLabelAttr) { const labelledByElement = document.getElementById(ariaLabelAttr); - if (labelledByElement) { labelTextCandidates.push(...(0, _labelUtil.extractElementStrings)(labelledByElement)); } - } // Labels with long text are likely to be noisy and lead to false positives - + } + // Labels with long text are likely to be noisy and lead to false positives const filteredLabels = labelTextCandidates.filter(string => string.length < 65); - if (filteredLabels.length > 0) { return filteredLabels.join(' '); } - return ''; }; + /** * Tries to get a relevant previous Element sibling, excluding certain tags * @param {Element} el * @returns {Element|null} */ - - exports.getExplicitLabelsText = getExplicitLabelsText; - const recursiveGetPreviousElSibling = el => { const previousEl = el.previousElementSibling; - if (!previousEl) return null; // Skip elements with no childNodes + if (!previousEl) return null; + // Skip elements with no childNodes if (_labelUtil.EXCLUDED_TAGS.includes(previousEl.tagName)) { return recursiveGetPreviousElSibling(previousEl); } - return previousEl; }; + /** * Get all text close to the input (useful when no labels are defined) * @param {HTMLInputElement|HTMLSelectElement} el @@ -14181,52 +13158,46 @@ const recursiveGetPreviousElSibling = el => { * @param {string} cssSelector * @return {string} */ - - const getRelatedText = (el, form, cssSelector) => { - let scope = getLargestMeaningfulContainer(el, form, cssSelector); // If we didn't find a container, try looking for an adjacent label + let scope = getLargestMeaningfulContainer(el, form, cssSelector); + // If we didn't find a container, try looking for an adjacent label if (scope === el) { let previousEl = recursiveGetPreviousElSibling(el); - if (previousEl instanceof HTMLElement) { scope = previousEl; - } // If there is still no meaningful container return empty string - - + } + // If there is still no meaningful container return empty string if (scope === el || scope instanceof HTMLSelectElement) { if (el.previousSibling instanceof Text) { return removeExcessWhitespace(el.previousSibling.textContent); } - return ''; } - } // If there is still no meaningful container return empty string - + } + // If there is still no meaningful container return empty string if (scope === el || scope instanceof HTMLSelectElement) { if (el.previousSibling instanceof Text) { return removeExcessWhitespace(el.previousSibling.textContent); } - return ''; } - let trimmedText = ''; const label = scope.querySelector('label'); - if (label) { // Try searching for a label first trimmedText = (0, _autofillUtils.getTextShallow)(label); } else { // If the container has a select element, remove its contents to avoid noise trimmedText = (0, _labelUtil.extractElementStrings)(scope).join(' '); - } // If the text is longer than n chars it's too noisy and likely to yield false positives, so return '' - + } + // If the text is longer than n chars it's too noisy and likely to yield false positives, so return '' if (trimmedText.length < TEXT_LENGTH_CUTOFF) return trimmedText; return ''; }; + /** * Find a container for the input field that won't contain other inputs (useful to get elements related to the field) * @param {HTMLElement} el @@ -14234,23 +13205,20 @@ const getRelatedText = (el, form, cssSelector) => { * @param {string} cssSelector * @return {HTMLElement} */ - - exports.getRelatedText = getRelatedText; - const getLargestMeaningfulContainer = (el, form, cssSelector) => { /* TODO: there could be more than one select el for the same label, in that case we should change how we compute the container */ const parentElement = el.parentElement; if (!parentElement || el === form || !cssSelector) return el; - const inputsInParentsScope = parentElement.querySelectorAll(cssSelector); // To avoid noise, ensure that our input is the only in scope - + const inputsInParentsScope = parentElement.querySelectorAll(cssSelector); + // To avoid noise, ensure that our input is the only in scope if (inputsInParentsScope.length === 1) { return getLargestMeaningfulContainer(parentElement, form, cssSelector); } - return el; }; + /** * Find a regex match for a given input * @param {HTMLInputElement} input @@ -14259,13 +13227,10 @@ const getLargestMeaningfulContainer = (el, form, cssSelector) => { * @param {string} cssSelector * @returns {RegExpMatchArray|null} */ - - const matchInPlaceholderAndLabels = (input, regex, form, cssSelector) => { - var _input$placeholder; - - return ((_input$placeholder = input.placeholder) === null || _input$placeholder === void 0 ? void 0 : _input$placeholder.match(regex)) || getExplicitLabelsText(input).match(regex) || getRelatedText(input, form, cssSelector).match(regex); + return input.placeholder?.match(regex) || getExplicitLabelsText(input).match(regex) || getRelatedText(input, form, cssSelector).match(regex); }; + /** * Check if a given input matches a regex * @param {HTMLInputElement} input @@ -14274,38 +13239,30 @@ const matchInPlaceholderAndLabels = (input, regex, form, cssSelector) => { * @param {string} cssSelector * @returns {boolean} */ - - exports.matchInPlaceholderAndLabels = matchInPlaceholderAndLabels; - const checkPlaceholderAndLabels = (input, regex, form, cssSelector) => { return !!matchInPlaceholderAndLabels(input, regex, form, cssSelector); }; + /** * Factory for instances of Matching * * @return {Matching} */ - - exports.checkPlaceholderAndLabels = checkPlaceholderAndLabels; - function createMatching() { return new Matching(_compiledMatchingConfig.matchingConfiguration); } -},{"../autofill-utils.js":59,"../constants.js":62,"./label-util.js":37,"./matching-config/__generated__/compiled-matching-config.js":39,"./matching-utils.js":40}],42:[function(require,module,exports){ +},{"../autofill-utils.js":61,"../constants.js":64,"./label-util.js":39,"./matching-config/__generated__/compiled-matching-config.js":41,"./matching-utils.js":42}],44:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.InContextSignup = void 0; - var _deviceApiCalls = require("./deviceApiCalls/__generated__/deviceApiCalls.js"); - var _autofillUtils = require("./autofill-utils.js"); - class InContextSignup { /** * @param {import("./DeviceInterface/InterfacePrototype").default} device @@ -14313,15 +13270,12 @@ class InContextSignup { constructor(device) { this.device = device; } - async init() { await this.refreshData(); this.addNativeAccessibleGlobalFunctions(); } - addNativeAccessibleGlobalFunctions() { if (!this.device.globalConfig.hasModernWebkitAPI) return; - try { // Set up a function which can be called from the native layer after completed sign-up or sign-in. Object.defineProperty(window, 'openAutofillAfterClosingEmailProtectionTab', { @@ -14332,31 +13286,30 @@ class InContextSignup { this.openAutofillTooltip(); } }); - } catch (e) {// Ignore if function can't be set up, it's a UX enhancement not a critical flow + } catch (e) { + // Ignore if function can't be set up, it's a UX enhancement not a critical flow } } - async refreshData() { const incontextSignupDismissedAt = await this.device.deviceApi.request(new _deviceApiCalls.GetIncontextSignupDismissedAtCall(null)); this.permanentlyDismissedAt = incontextSignupDismissedAt.permanentlyDismissedAt; this.isInstalledRecently = incontextSignupDismissedAt.isInstalledRecently; } - async openAutofillTooltip() { - var _this$device$uiContro, _this$device$activeFo; - // Make sure we're working with the latest data - await this.device.refreshData(); // Make sure the tooltip is closed before we try to open it + await this.device.refreshData(); - await ((_this$device$uiContro = this.device.uiController) === null || _this$device$uiContro === void 0 ? void 0 : _this$device$uiContro.removeTooltip('stateChange')); // Make sure the input doesn't have focus so we can focus on it again + // Make sure the tooltip is closed before we try to open it + await this.device.uiController?.removeTooltip('stateChange'); - const activeInput = (_this$device$activeFo = this.device.activeForm) === null || _this$device$activeFo === void 0 ? void 0 : _this$device$activeFo.activeInput; - activeInput === null || activeInput === void 0 ? void 0 : activeInput.blur(); // Select the active input to open the tooltip + // Make sure the input doesn't have focus so we can focus on it again + const activeInput = this.device.activeForm?.activeInput; + activeInput?.blur(); + // Select the active input to open the tooltip const selectActiveInput = () => { - activeInput === null || activeInput === void 0 ? void 0 : activeInput.focus(); + activeInput?.focus(); }; - if (document.hasFocus()) { selectActiveInput(); } else { @@ -14367,17 +13320,14 @@ class InContextSignup { }); } } - isPermanentlyDismissed() { return Boolean(this.permanentlyDismissedAt); } - isOnValidDomain() { // Only show in-context signup if we've high confidence that the page is // not internally hosted or an intranet return (0, _autofillUtils.isValidTLD)() && !(0, _autofillUtils.isLocalNetwork)(); } - isAllowedByDevice() { if (typeof this.isInstalledRecently === 'boolean') { return this.isInstalledRecently; @@ -14387,43 +13337,36 @@ class InContextSignup { return true; } } + /** * @param {import('./Form/matching.js').SupportedSubTypes | "unknown"} [inputType] * @returns {boolean} */ - - isAvailable() { - var _this$device$settings, _this$device$settings2; - let inputType = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'emailAddress'; const isEmailInput = inputType === 'emailAddress'; - const isEmailProtectionEnabled = !!((_this$device$settings = this.device.settings) !== null && _this$device$settings !== void 0 && _this$device$settings.featureToggles.emailProtection); - const isIncontextSignupEnabled = !!((_this$device$settings2 = this.device.settings) !== null && _this$device$settings2 !== void 0 && _this$device$settings2.featureToggles.emailProtection_incontext_signup); + const isEmailProtectionEnabled = !!this.device.settings?.featureToggles.emailProtection; + const isIncontextSignupEnabled = !!this.device.settings?.featureToggles.emailProtection_incontext_signup; const isNotAlreadyLoggedIn = !this.device.isDeviceSignedIn(); const isNotDismissed = !this.isPermanentlyDismissed(); const isOnExpectedPage = this.device.globalConfig.isTopFrame || this.isOnValidDomain(); const isAllowedByDevice = this.isAllowedByDevice(); return isEmailInput && isEmailProtectionEnabled && isIncontextSignupEnabled && isNotAlreadyLoggedIn && isNotDismissed && isOnExpectedPage && isAllowedByDevice; } - onIncontextSignup() { this.device.deviceApi.notify(new _deviceApiCalls.StartEmailProtectionSignupCall({})); this.device.firePixel({ pixelName: 'incontext_primary_cta' }); } - onIncontextSignupDismissed() { let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : { shouldHideTooltip: true }; - if (options.shouldHideTooltip) { this.device.removeAutofillUIFromPage('Email Protection in-context signup dismissed.'); this.device.deviceApi.notify(new _deviceApiCalls.CloseAutofillParentCall(null)); } - this.permanentlyDismissedAt = new Date().getTime(); this.device.deviceApi.notify(new _deviceApiCalls.SetIncontextSignupPermanentlyDismissedAtCall({ value: this.permanentlyDismissedAt @@ -14431,23 +13374,19 @@ class InContextSignup { this.device.firePixel({ pixelName: 'incontext_dismiss_persisted' }); - } // In-context signup can be closed when displayed as a stand-alone tooltip, e.g. extension - + } + // In-context signup can be closed when displayed as a stand-alone tooltip, e.g. extension onIncontextSignupClosed() { - var _this$device$activeFo2; - - (_this$device$activeFo2 = this.device.activeForm) === null || _this$device$activeFo2 === void 0 ? void 0 : _this$device$activeFo2.dismissTooltip(); + this.device.activeForm?.dismissTooltip(); this.device.firePixel({ pixelName: 'incontext_close_x' }); } - } - exports.InContextSignup = InContextSignup; -},{"./autofill-utils.js":59,"./deviceApiCalls/__generated__/deviceApiCalls.js":63}],43:[function(require,module,exports){ +},{"./autofill-utils.js":61,"./deviceApiCalls/__generated__/deviceApiCalls.js":65}],45:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { @@ -14457,107 +13396,55 @@ exports.PROVIDER_LOCKED = exports.AUTOGENERATED_KEY = void 0; exports.appendGeneratedKey = appendGeneratedKey; exports.createCredentialsTooltipItem = createCredentialsTooltipItem; exports.fromPassword = fromPassword; - var _autofillUtils = require("../autofill-utils.js"); +const AUTOGENERATED_KEY = exports.AUTOGENERATED_KEY = 'autogenerated'; +const PROVIDER_LOCKED = exports.PROVIDER_LOCKED = 'provider_locked'; -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - -function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); } - -function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } } - -function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); } - -function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; } - -function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; } - -function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); } - -function _classApplyDescriptorSet(receiver, descriptor, value) { if (descriptor.set) { descriptor.set.call(receiver, value); } else { if (!descriptor.writable) { throw new TypeError("attempted to set read only private field"); } descriptor.value = value; } } - -const AUTOGENERATED_KEY = 'autogenerated'; -exports.AUTOGENERATED_KEY = AUTOGENERATED_KEY; -const PROVIDER_LOCKED = 'provider_locked'; /** * @implements {TooltipItemRenderer} */ - -exports.PROVIDER_LOCKED = PROVIDER_LOCKED; - -var _data = /*#__PURE__*/new WeakMap(); - class CredentialsTooltipItem { /** @type {CredentialsObject} */ - + #data; /** @param {CredentialsObject} data */ constructor(data) { - _classPrivateFieldInitSpec(this, _data, { - writable: true, - value: void 0 - }); - - _defineProperty(this, "id", () => String(_classPrivateFieldGet(this, _data).id)); - - _defineProperty(this, "labelMedium", _subtype => { - var _classPrivateFieldGet2; - - if (_classPrivateFieldGet(this, _data).username) { - return _classPrivateFieldGet(this, _data).username; - } - - if ((_classPrivateFieldGet2 = _classPrivateFieldGet(this, _data).origin) !== null && _classPrivateFieldGet2 !== void 0 && _classPrivateFieldGet2.url) { - return "Password for ".concat((0, _autofillUtils.truncateFromMiddle)(_classPrivateFieldGet(this, _data).origin.url)); - } - - return ''; - }); - - _defineProperty(this, "labelSmall", _subtype => { - var _classPrivateFieldGet3; - - if ((_classPrivateFieldGet3 = _classPrivateFieldGet(this, _data).origin) !== null && _classPrivateFieldGet3 !== void 0 && _classPrivateFieldGet3.url) { - return (0, _autofillUtils.truncateFromMiddle)(_classPrivateFieldGet(this, _data).origin.url); - } - - return '•••••••••••••••'; - }); - - _defineProperty(this, "credentialsProvider", () => _classPrivateFieldGet(this, _data).credentialsProvider); - - _classPrivateFieldSet(this, _data, data); + this.#data = data; } - + id = () => String(this.#data.id); + labelMedium = _subtype => { + if (this.#data.username) { + return this.#data.username; + } + if (this.#data.origin?.url) { + return `Password for ${(0, _autofillUtils.truncateFromMiddle)(this.#data.origin.url)}`; + } + return ''; + }; + labelSmall = _subtype => { + if (this.#data.origin?.url) { + return (0, _autofillUtils.truncateFromMiddle)(this.#data.origin.url); + } + return '•••••••••••••••'; + }; + credentialsProvider = () => this.#data.credentialsProvider; } + /** * @implements {TooltipItemRenderer} */ - - -var _data2 = /*#__PURE__*/new WeakMap(); - class AutoGeneratedCredential { /** @type {CredentialsObject} */ - + #data; /** @param {CredentialsObject} data */ constructor(data) { - _classPrivateFieldInitSpec(this, _data2, { - writable: true, - value: void 0 - }); - - _defineProperty(this, "id", () => String(_classPrivateFieldGet(this, _data2).id)); - - _defineProperty(this, "label", _subtype => _classPrivateFieldGet(this, _data2).password); - - _defineProperty(this, "labelMedium", _subtype => 'Generated password'); - - _defineProperty(this, "labelSmall", _subtype => 'Login information will be saved for this website'); - - _classPrivateFieldSet(this, _data2, data); + this.#data = data; } - + id = () => String(this.#data.id); + label = _subtype => this.#data.password; + labelMedium = _subtype => 'Generated password'; + labelSmall = _subtype => 'Login information will be saved for this website'; } + /** * Generate a stand-in 'CredentialsObject' from a * given (generated) password. @@ -14566,8 +13453,6 @@ class AutoGeneratedCredential { * @param {string} username * @returns {CredentialsObject} */ - - function fromPassword(password, username) { return { [AUTOGENERATED_KEY]: true, @@ -14575,35 +13460,23 @@ function fromPassword(password, username) { username }; } + /** * @implements TooltipItemRenderer */ - - -var _data3 = /*#__PURE__*/new WeakMap(); - class ProviderLockedItem { /** @type {CredentialsObject} */ - + #data; /** @param {CredentialsObject} data */ constructor(data) { - _classPrivateFieldInitSpec(this, _data3, { - writable: true, - value: void 0 - }); - - _defineProperty(this, "id", () => String(_classPrivateFieldGet(this, _data3).id)); - - _defineProperty(this, "labelMedium", _subtype => 'Bitwarden is locked'); - - _defineProperty(this, "labelSmall", _subtype => 'Unlock your vault to access credentials or generate passwords'); - - _defineProperty(this, "credentialsProvider", () => _classPrivateFieldGet(this, _data3).credentialsProvider); - - _classPrivateFieldSet(this, _data3, data); + this.#data = data; } - + id = () => String(this.#data.id); + labelMedium = _subtype => 'Bitwarden is locked'; + labelSmall = _subtype => 'Unlock your vault to access credentials or generate passwords'; + credentialsProvider = () => this.#data.credentialsProvider; } + /** * If the locally generated/stored password or username ends up being the same * as submitted in a subsequent form submission - then we mark the @@ -14616,276 +13489,173 @@ class ProviderLockedItem { * @param {string|null|undefined} [autofilledFields.password] - if present, it's the last generated password * */ - - function appendGeneratedKey(data) { - var _data$credentials, _data$credentials2; - let autofilledFields = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - let autogenerated = false; // does the current password match the most recently generated one? + let autogenerated = false; - if (autofilledFields.password && ((_data$credentials = data.credentials) === null || _data$credentials === void 0 ? void 0 : _data$credentials.password) === autofilledFields.password) { + // does the current password match the most recently generated one? + if (autofilledFields.password && data.credentials?.password === autofilledFields.password) { autogenerated = true; - } // does the current username match a recently generated one? (eg: email protection) - + } - if (autofilledFields.username && ((_data$credentials2 = data.credentials) === null || _data$credentials2 === void 0 ? void 0 : _data$credentials2.username) === autofilledFields.username) { + // does the current username match a recently generated one? (eg: email protection) + if (autofilledFields.username && data.credentials?.username === autofilledFields.username) { autogenerated = true; - } // if neither username nor password were generated, don't alter the outgoing data + } + // if neither username nor password were generated, don't alter the outgoing data + if (!autogenerated) return data; - if (!autogenerated) return data; // if we get here, we're confident that something was generated + filled + // if we get here, we're confident that something was generated + filled // so we mark the credential as 'autogenerated' for the benefit of native implementations - - return { ...data, - credentials: { ...data.credentials, + return { + ...data, + credentials: { + ...data.credentials, [AUTOGENERATED_KEY]: true } }; } + /** * Factory for creating a TooltipItemRenderer * * @param {CredentialsObject} data * @returns {TooltipItemRenderer} */ - - function createCredentialsTooltipItem(data) { if (data.id === PROVIDER_LOCKED) { return new ProviderLockedItem(data); } - if (AUTOGENERATED_KEY in data && data.password) { return new AutoGeneratedCredential(data); } - return new CredentialsTooltipItem(data); } -},{"../autofill-utils.js":59}],44:[function(require,module,exports){ +},{"../autofill-utils.js":61}],46:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.CreditCardTooltipItem = void 0; - -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - -function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); } - -function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } } - -function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); } - -function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; } - -function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; } - -function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); } - -function _classApplyDescriptorSet(receiver, descriptor, value) { if (descriptor.set) { descriptor.set.call(receiver, value); } else { if (!descriptor.writable) { throw new TypeError("attempted to set read only private field"); } descriptor.value = value; } } - -var _data = /*#__PURE__*/new WeakMap(); - /** * @implements {TooltipItemRenderer} */ class CreditCardTooltipItem { /** @type {CreditCardObject} */ - + #data; /** @param {CreditCardObject} data */ constructor(data) { - _classPrivateFieldInitSpec(this, _data, { - writable: true, - value: void 0 - }); - - _defineProperty(this, "id", () => String(_classPrivateFieldGet(this, _data).id)); - - _defineProperty(this, "labelMedium", _ => _classPrivateFieldGet(this, _data).title); - - _defineProperty(this, "labelSmall", _ => _classPrivateFieldGet(this, _data).displayNumber); - - _classPrivateFieldSet(this, _data, data); + this.#data = data; } - + id = () => String(this.#data.id); + labelMedium = _ => this.#data.title; + labelSmall = _ => this.#data.displayNumber; } - exports.CreditCardTooltipItem = CreditCardTooltipItem; -},{}],45:[function(require,module,exports){ +},{}],47:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.IdentityTooltipItem = void 0; - var _formatters = require("../Form/formatters.js"); - -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - -function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); } - -function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } } - -function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); } - -function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; } - -function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; } - -function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); } - -function _classApplyDescriptorSet(receiver, descriptor, value) { if (descriptor.set) { descriptor.set.call(receiver, value); } else { if (!descriptor.writable) { throw new TypeError("attempted to set read only private field"); } descriptor.value = value; } } - -var _data = /*#__PURE__*/new WeakMap(); - /** * @implements {TooltipItemRenderer} */ class IdentityTooltipItem { /** @type {IdentityObject} */ - + #data; /** @param {IdentityObject} data */ constructor(data) { - _classPrivateFieldInitSpec(this, _data, { - writable: true, - value: void 0 - }); - - _defineProperty(this, "id", () => String(_classPrivateFieldGet(this, _data).id)); - - _defineProperty(this, "labelMedium", subtype => { - if (subtype === 'addressCountryCode') { - return (0, _formatters.getCountryDisplayName)('en', _classPrivateFieldGet(this, _data).addressCountryCode || ''); - } - - if (_classPrivateFieldGet(this, _data).id === 'privateAddress') { - return 'Generate Private Duck Address'; - } - - return _classPrivateFieldGet(this, _data)[subtype]; - }); - - _defineProperty(this, "labelSmall", _ => { - return _classPrivateFieldGet(this, _data).title; - }); - - _classPrivateFieldSet(this, _data, data); + this.#data = data; } - + id = () => String(this.#data.id); + labelMedium = subtype => { + if (subtype === 'addressCountryCode') { + return (0, _formatters.getCountryDisplayName)('en', this.#data.addressCountryCode || ''); + } + if (this.#data.id === 'privateAddress') { + return 'Generate Private Duck Address'; + } + return this.#data[subtype]; + }; label(subtype) { - if (_classPrivateFieldGet(this, _data).id === 'privateAddress') { - return _classPrivateFieldGet(this, _data)[subtype]; + if (this.#data.id === 'privateAddress') { + return this.#data[subtype]; } - return null; } - + labelSmall = _ => { + return this.#data.title; + }; } - exports.IdentityTooltipItem = IdentityTooltipItem; -},{"../Form/formatters.js":34}],46:[function(require,module,exports){ +},{"../Form/formatters.js":36}],48:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.PasswordGenerator = void 0; - var _index = require("../packages/password/index.js"); - var _rules = _interopRequireDefault(require("../packages/password/rules.json")); - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); } - -function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } } - -function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; } - -function _classApplyDescriptorSet(receiver, descriptor, value) { if (descriptor.set) { descriptor.set.call(receiver, value); } else { if (!descriptor.writable) { throw new TypeError("attempted to set read only private field"); } descriptor.value = value; } } - -function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); } - -function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); } - -function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; } - -var _previous = /*#__PURE__*/new WeakMap(); - /** * Create a password once and reuse it. */ class PasswordGenerator { - constructor() { - _classPrivateFieldInitSpec(this, _previous, { - writable: true, - value: null - }); - } + /** @type {string|null} */ + #previous = null; /** @returns {boolean} */ get generated() { - return _classPrivateFieldGet(this, _previous) !== null; + return this.#previous !== null; } - /** @returns {string|null} */ - + /** @returns {string|null} */ get password() { - return _classPrivateFieldGet(this, _previous); + return this.#previous; } - /** @param {import('../packages/password').GenerateOptions} [params] */ - + /** @param {import('../packages/password').GenerateOptions} [params] */ generate() { let params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - - if (_classPrivateFieldGet(this, _previous)) { - return _classPrivateFieldGet(this, _previous); + if (this.#previous) { + return this.#previous; } - - _classPrivateFieldSet(this, _previous, (0, _index.generate)({ ...params, + this.#previous = (0, _index.generate)({ + ...params, rules: _rules.default - })); - - return _classPrivateFieldGet(this, _previous); + }); + return this.#previous; } - } - exports.PasswordGenerator = PasswordGenerator; -},{"../packages/password/index.js":15,"../packages/password/rules.json":19}],47:[function(require,module,exports){ +},{"../packages/password/index.js":17,"../packages/password/rules.json":21}],49:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.createScanner = createScanner; - var _Form = require("./Form/Form.js"); - var _constants = require("./constants.js"); - var _matching = require("./Form/matching.js"); - var _autofillUtils = require("./autofill-utils.js"); - var _deviceApiCalls = require("./deviceApiCalls/__generated__/deviceApiCalls.js"); - -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - const { MAX_INPUTS_PER_PAGE, MAX_FORMS_PER_PAGE, MAX_INPUTS_PER_FORM } = _constants.constants; + /** * @typedef {{ * forms: Map; @@ -14907,7 +13677,6 @@ const { */ /** @type {ScannerOptions} */ - const defaultScannerOptions = { // This buffer size is very large because it's an unexpected edge-case that // a DOM will be continually modified over and over without ever stopping. If we do see 1000 unique @@ -14924,302 +13693,225 @@ const defaultScannerOptions = { maxFormsPerPage: MAX_FORMS_PER_PAGE, maxInputsPerForm: MAX_INPUTS_PER_FORM }; + /** * This allows: * 1) synchronous DOM scanning + mutations - via `createScanner(device).findEligibleInputs(document)` * 2) or, as above + a debounced mutation observer to re-run the scan after the given time */ - class DefaultScanner { /** @type Map */ - + forms = new Map(); /** @type {any|undefined} the timer to reset */ - + debounceTimer; /** @type {Set} stored changed elements until they can be processed */ - + changedElements = new Set(); /** @type {ScannerOptions} */ - + options; /** @type {HTMLInputElement | null} */ - + activeInput = null; /** @type {boolean} A flag to indicate the whole page will be re-scanned */ - + rescanAll = false; /** @type {boolean} Indicates whether we called stopScanning */ - + stopped = false; /** @type {import("./Form/matching").Matching} matching */ + matching; /** * @param {import("./DeviceInterface/InterfacePrototype").default} device * @param {ScannerOptions} options */ constructor(device, options) { - _defineProperty(this, "forms", new Map()); - - _defineProperty(this, "debounceTimer", void 0); - - _defineProperty(this, "changedElements", new Set()); - - _defineProperty(this, "options", void 0); - - _defineProperty(this, "activeInput", null); - - _defineProperty(this, "rescanAll", false); - - _defineProperty(this, "stopped", false); - - _defineProperty(this, "matching", void 0); - - _defineProperty(this, "mutObs", new MutationObserver(mutationList => { - /** @type {HTMLElement[]} */ - if (this.rescanAll) { - // quick version if buffer full - this.enqueue([]); - return; - } - - const outgoing = []; - - for (const mutationRecord of mutationList) { - if (mutationRecord.type === 'childList') { - for (let addedNode of mutationRecord.addedNodes) { - if (!(addedNode instanceof HTMLElement)) continue; - if (addedNode.nodeName === 'DDG-AUTOFILL') continue; - outgoing.push(addedNode); - } - } - } - - this.enqueue(outgoing); - })); - this.device = device; this.matching = (0, _matching.createMatching)(); this.options = options; /** @type {number} A timestamp of the */ - this.initTimeStamp = Date.now(); } + /** * Determine whether we should fire the credentials autoprompt. This is needed because some sites are blank * on page load and load scripts asynchronously, so our initial scan didn't set the autoprompt correctly * @returns {boolean} */ - - get shouldAutoprompt() { return Date.now() - this.initTimeStamp <= 1500; } + /** * Call this to scan once and then watch for changes. * * Call the returned function to remove listeners. * @returns {(reason: string, ...rest) => void} */ - - init() { var _this = this; - if (this.device.globalConfig.isExtension) { this.device.deviceApi.notify(new _deviceApiCalls.AddDebugFlagCall({ flag: 'autofill' })); } - - const delay = this.options.initialDelay; // if the delay is zero, (chrome/firefox etc) then use `requestIdleCallback` - + const delay = this.options.initialDelay; + // if the delay is zero, (chrome/firefox etc) then use `requestIdleCallback` if (delay === 0) { window.requestIdleCallback(() => this.scanAndObserve()); } else { // otherwise, use the delay time to defer the initial scan setTimeout(() => this.scanAndObserve(), delay); } - return function (reason) { for (var _len = arguments.length, rest = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { rest[_key - 1] = arguments[_key]; } - _this.stopScanner(reason, ...rest); }; } + /** * Scan the page and begin observing changes */ - - scanAndObserve() { - var _window$performance, _window$performance$m, _window$performance2, _window$performance2$; - - (_window$performance = window.performance) === null || _window$performance === void 0 ? void 0 : (_window$performance$m = _window$performance.mark) === null || _window$performance$m === void 0 ? void 0 : _window$performance$m.call(_window$performance, 'initial_scanner:init:start'); + window.performance?.mark?.('initial_scanner:init:start'); this.findEligibleInputs(document); - (_window$performance2 = window.performance) === null || _window$performance2 === void 0 ? void 0 : (_window$performance2$ = _window$performance2.mark) === null || _window$performance2$ === void 0 ? void 0 : _window$performance2$.call(_window$performance2, 'initial_scanner:init:end'); + window.performance?.mark?.('initial_scanner:init:end'); (0, _autofillUtils.logPerformance)('initial_scanner'); this.mutObs.observe(document.documentElement, { childList: true, subtree: true }); } + /** * @param context */ - - findEligibleInputs(context) { - var _context$matches; - // Avoid autofill on Email Protection web app if (this.device.globalConfig.isDDGDomain) { return this; } - - if ('matches' in context && (_context$matches = context.matches) !== null && _context$matches !== void 0 && _context$matches.call(context, this.matching.cssSelector('formInputsSelector'))) { + if ('matches' in context && context.matches?.(this.matching.cssSelector('formInputsSelector'))) { this.addInput(context); } else { const inputs = context.querySelectorAll(this.matching.cssSelector('formInputsSelector')); - if (inputs.length > this.options.maxInputsPerPage) { this.stopScanner('Too many input fields in the given context, stop scanning', context); return this; } - inputs.forEach(input => this.addInput(input)); } - return this; } + /** * Stops scanning, switches off the mutation observer and clears all forms * @param {string} reason * @param {...any} rest */ - - stopScanner(reason) { - var _this$device$activeFo; - this.stopped = true; - if ((0, _autofillUtils.shouldLog)()) { for (var _len2 = arguments.length, rest = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { rest[_key2 - 1] = arguments[_key2]; } - console.log(reason, ...rest); } + const activeInput = this.device.activeForm?.activeInput; - const activeInput = (_this$device$activeFo = this.device.activeForm) === null || _this$device$activeFo === void 0 ? void 0 : _this$device$activeFo.activeInput; // remove Dax, listeners, timers, and observers - + // remove Dax, listeners, timers, and observers clearTimeout(this.debounceTimer); this.changedElements.clear(); this.mutObs.disconnect(); this.forms.forEach(form => { form.destroy(); }); - this.forms.clear(); // Bring the user back to the input they were interacting with + this.forms.clear(); - activeInput === null || activeInput === void 0 ? void 0 : activeInput.focus(); + // Bring the user back to the input they were interacting with + activeInput?.focus(); } + /** * @param {HTMLElement|HTMLInputElement|HTMLSelectElement} input * @returns {HTMLFormElement|HTMLElement} */ - - getParentForm(input) { if (input instanceof HTMLInputElement || input instanceof HTMLSelectElement) { if (input.form) { // Use input.form unless it encloses most of the DOM // In that case we proceed to identify more precise wrappers - if (this.forms.has(input.form) || // If we've added the form we've already checked that it's not a page wrapper + if (this.forms.has(input.form) || + // If we've added the form we've already checked that it's not a page wrapper !(0, _autofillUtils.isFormLikelyToBeUsedAsPageWrapper)(input.form)) { return input.form; } } } - - let element = input; // traverse the DOM to search for related inputs - + let element = input; + // traverse the DOM to search for related inputs while (element.parentElement && element.parentElement !== document.documentElement) { - var _element$parentElemen; - // Avoid overlapping containers or forms - const siblingForm = (_element$parentElemen = element.parentElement) === null || _element$parentElemen === void 0 ? void 0 : _element$parentElemen.querySelector('form'); - + const siblingForm = element.parentElement?.querySelector('form'); if (siblingForm && siblingForm !== element) { return element; } - element = element.parentElement; const inputs = element.querySelectorAll(this.matching.cssSelector('formInputsSelector')); - const buttons = element.querySelectorAll(this.matching.cssSelector('submitButtonSelector')); // If we find a button or another input, we assume that's our form - + const buttons = element.querySelectorAll(this.matching.cssSelector('submitButtonSelector')); + // If we find a button or another input, we assume that's our form if (inputs.length > 1 || buttons.length) { // found related input, return common ancestor return element; } } - return input; } + /** * @param {HTMLInputElement|HTMLSelectElement} input */ - - addInput(input) { if (this.stopped) return; const parentForm = this.getParentForm(input); - if (parentForm instanceof HTMLFormElement && this.forms.has(parentForm)) { - var _this$forms$get; - // We've met the form, add the input - (_this$forms$get = this.forms.get(parentForm)) === null || _this$forms$get === void 0 ? void 0 : _this$forms$get.addInput(input); + this.forms.get(parentForm)?.addInput(input); return; - } // Check if the forms we've seen are either disconnected, - // or are parent/child of the currently-found form - + } + // Check if the forms we've seen are either disconnected, + // or are parent/child of the currently-found form let previouslyFoundParent, childForm; - for (const [formEl] of this.forms) { // Remove disconnected forms to avoid leaks if (!formEl.isConnected) { this.forms.delete(formEl); continue; } - if (formEl.contains(parentForm)) { previouslyFoundParent = formEl; break; } - if (parentForm.contains(formEl)) { childForm = formEl; break; } } - if (previouslyFoundParent) { if (parentForm instanceof HTMLFormElement && parentForm !== previouslyFoundParent) { // If we had a prior parent but this is an explicit form, the previous was a false positive this.forms.delete(previouslyFoundParent); } else { - var _this$forms$get2; - // If we've already met the form or a descendant, add the input - (_this$forms$get2 = this.forms.get(previouslyFoundParent)) === null || _this$forms$get2 === void 0 ? void 0 : _this$forms$get2.addInput(input); + this.forms.get(previouslyFoundParent)?.addInput(input); } } else { // if this form is an ancestor of an existing form, remove that before adding this if (childForm) { - var _this$forms$get3; - - (_this$forms$get3 = this.forms.get(childForm)) === null || _this$forms$get3 === void 0 ? void 0 : _this$forms$get3.destroy(); + this.forms.get(childForm)?.destroy(); this.forms.delete(childForm); - } // Only add the form if below the limit of forms per page - + } + // Only add the form if below the limit of forms per page if (this.forms.size < this.options.maxFormsPerPage) { this.forms.set(parentForm, new _Form.Form(parentForm, input, this.device, this.matching, this.shouldAutoprompt)); } else { @@ -15227,14 +13919,13 @@ class DefaultScanner { } } } + /** * enqueue elements to be re-scanned after the given * amount of time has elapsed. * * @param {(HTMLElement|Document)[]} htmlElements */ - - enqueue(htmlElements) { // if the buffer limit is reached, stop trying to track elements and process body instead. if (this.changedElements.size >= this.options.bufferSize) { @@ -15246,77 +13937,82 @@ class DefaultScanner { this.changedElements.add(element); } } - clearTimeout(this.debounceTimer); this.debounceTimer = setTimeout(() => { - var _window$performance3, _window$performance3$, _window$performance4, _window$performance4$; - - (_window$performance3 = window.performance) === null || _window$performance3 === void 0 ? void 0 : (_window$performance3$ = _window$performance3.mark) === null || _window$performance3$ === void 0 ? void 0 : _window$performance3$.call(_window$performance3, 'scanner:init:start'); + window.performance?.mark?.('scanner:init:start'); this.processChangedElements(); this.changedElements.clear(); this.rescanAll = false; - (_window$performance4 = window.performance) === null || _window$performance4 === void 0 ? void 0 : (_window$performance4$ = _window$performance4.mark) === null || _window$performance4$ === void 0 ? void 0 : _window$performance4$.call(_window$performance4, 'scanner:init:end'); + window.performance?.mark?.('scanner:init:end'); (0, _autofillUtils.logPerformance)('scanner'); }, this.options.debounceTimePeriod); } + /** * re-scan the changed elements, but only if they * are still present in the DOM */ - - processChangedElements() { if (this.rescanAll) { this.findEligibleInputs(document); return; } - for (let element of this.changedElements) { if (element.isConnected) { this.findEligibleInputs(element); } } } + /** * Watch for changes in the DOM, and enqueue elements to be scanned * @type {MutationObserver} */ - - + mutObs = new MutationObserver(mutationList => { + /** @type {HTMLElement[]} */ + if (this.rescanAll) { + // quick version if buffer full + this.enqueue([]); + return; + } + const outgoing = []; + for (const mutationRecord of mutationList) { + if (mutationRecord.type === 'childList') { + for (let addedNode of mutationRecord.addedNodes) { + if (!(addedNode instanceof HTMLElement)) continue; + if (addedNode.nodeName === 'DDG-AUTOFILL') continue; + outgoing.push(addedNode); + } + } + } + this.enqueue(outgoing); + }); } + /** * @param {import("./DeviceInterface/InterfacePrototype").default} device * @param {Partial} [scannerOptions] * @returns {Scanner} */ - - function createScanner(device, scannerOptions) { - return new DefaultScanner(device, { ...defaultScannerOptions, + return new DefaultScanner(device, { + ...defaultScannerOptions, ...scannerOptions }); } -},{"./Form/Form.js":31,"./Form/matching.js":41,"./autofill-utils.js":59,"./constants.js":62,"./deviceApiCalls/__generated__/deviceApiCalls.js":63}],48:[function(require,module,exports){ +},{"./Form/Form.js":33,"./Form/matching.js":43,"./autofill-utils.js":61,"./constants.js":64,"./deviceApiCalls/__generated__/deviceApiCalls.js":65}],50:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Settings = void 0; - var _index = require("../packages/device-api/index.js"); - var _deviceApiCalls = require("./deviceApiCalls/__generated__/deviceApiCalls.js"); - var _validatorsZod = require("./deviceApiCalls/__generated__/validators.zod.js"); - var _autofillUtils = require("./autofill-utils.js"); - var _appleUtils = require("@duckduckgo/content-scope-scripts/src/apple-utils"); - -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - /** * Some Type helpers to prevent duplication * @typedef {import("./deviceApiCalls/__generated__/validators-ts").AutofillFeatureToggles} AutofillFeatureToggles @@ -15337,37 +14033,27 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope */ class Settings { /** @type {GlobalConfig} */ - + globalConfig; /** @type {DeviceApi} */ - + deviceApi; /** @type {AutofillFeatureToggles | null} */ - + _featureToggles = null; /** @type {AvailableInputTypes | null} */ - + _availableInputTypes = null; /** @type {RuntimeConfiguration | null | undefined} */ - + _runtimeConfiguration = null; /** @type {boolean | null} */ + _enabled = null; /** * @param {GlobalConfig} config * @param {DeviceApi} deviceApi */ constructor(config, deviceApi) { - _defineProperty(this, "globalConfig", void 0); - - _defineProperty(this, "deviceApi", void 0); - - _defineProperty(this, "_featureToggles", null); - - _defineProperty(this, "_availableInputTypes", null); - - _defineProperty(this, "_runtimeConfiguration", null); - - _defineProperty(this, "_enabled", null); - this.deviceApi = deviceApi; this.globalConfig = config; } + /** * Feature toggles are delivered as part of the Runtime Configuration - a flexible design that * allows data per user + remote config to be accessed together. @@ -15380,32 +14066,26 @@ class Settings { * * @returns {Promise} */ - - async getFeatureToggles() { try { - var _runtimeConfig$userPr, _runtimeConfig$userPr2, _runtimeConfig$userPr3; - const runtimeConfig = await this._getRuntimeConfiguration(); - const autofillSettings = (0, _index.validate)((_runtimeConfig$userPr = runtimeConfig.userPreferences) === null || _runtimeConfig$userPr === void 0 ? void 0 : (_runtimeConfig$userPr2 = _runtimeConfig$userPr.features) === null || _runtimeConfig$userPr2 === void 0 ? void 0 : (_runtimeConfig$userPr3 = _runtimeConfig$userPr2.autofill) === null || _runtimeConfig$userPr3 === void 0 ? void 0 : _runtimeConfig$userPr3.settings, _validatorsZod.autofillSettingsSchema); + const autofillSettings = (0, _index.validate)(runtimeConfig.userPreferences?.features?.autofill?.settings, _validatorsZod.autofillSettingsSchema); return autofillSettings.featureToggles; } catch (e) { // these are the fallbacks for when a platform hasn't implemented the calls above. if (this.globalConfig.isDDGTestMode) { console.log('isDDGTestMode: getFeatureToggles: ❌', e); } - return Settings.defaults.featureToggles; } } + /** * If the platform in question is happy to derive it's 'enabled' state from the RuntimeConfiguration, * then they should use this. Currently only Windows supports this, but we aim to move all platforms to * support this going forward. * @returns {Promise} */ - - async getEnabled() { try { const runtimeConfig = await this._getRuntimeConfiguration(); @@ -15416,10 +14096,10 @@ class Settings { if (this.globalConfig.isDDGTestMode) { console.log('isDDGTestMode: getFeatureToggles: ❌', e); } - return null; } } + /** * Get runtime configuration, but only once. * @@ -15433,22 +14113,19 @@ class Settings { * @throws * @private */ - - async _getRuntimeConfiguration() { if (this._runtimeConfiguration) return this._runtimeConfiguration; const runtimeConfig = await this.deviceApi.request(new _deviceApiCalls.GetRuntimeConfigurationCall(null)); this._runtimeConfiguration = runtimeConfig; return this._runtimeConfiguration; } + /** * Available Input Types are boolean indicators to represent which input types the * current **user** has data available for. * * @returns {Promise} */ - - async getAvailableInputTypes() { try { return await this.deviceApi.request(new _deviceApiCalls.GetAvailableInputTypesCall(null)); @@ -15456,10 +14133,10 @@ class Settings { if (this.globalConfig.isDDGTestMode) { console.log('isDDGTestMode: getAvailableInputTypes: ❌', e); } - return Settings.defaults.availableInputTypes; } } + /** * To 'refresh' settings means to re-call APIs to determine new state. This may * only occur once per page, but it must be done before any page scanning/decorating can happen @@ -15470,25 +14147,24 @@ class Settings { * enabled: boolean | null * }>} */ - - async refresh() { this.setEnabled(await this.getEnabled()); this.setFeatureToggles(await this.getFeatureToggles()); - this.setAvailableInputTypes(await this.getAvailableInputTypes()); // If 'this.enabled' is a boolean it means we were able to set it correctly and therefor respect its value + this.setAvailableInputTypes(await this.getAvailableInputTypes()); + // If 'this.enabled' is a boolean it means we were able to set it correctly and therefor respect its value if (typeof this.enabled === 'boolean') { if (!this.enabled) { return Settings.defaults; } } - return { featureToggles: this.featureToggles, availableInputTypes: this.availableInputTypes, enabled: this.enabled }; } + /** * Checks if input type is one which we can't autofill * @param {{ @@ -15497,31 +14173,27 @@ class Settings { * }} types * @returns {boolean} */ - - isTypeUnavailable(_ref) { let { mainType, subtype } = _ref; if (mainType === 'unknown') return true; - - if (!this.featureToggles["inputType_".concat(mainType)] && subtype !== 'emailAddress') { + if (!this.featureToggles[`inputType_${mainType}`] && subtype !== 'emailAddress') { return true; } - return false; } + /** * Requests data from remote * @returns {Promise<>} */ - - async populateData() { const availableInputTypesFromRemote = await this.getAvailableInputTypes(); this.setAvailableInputTypes(availableInputTypesFromRemote); } + /** * Requests data from remote if not available * @param {{ @@ -15530,11 +14202,7 @@ class Settings { * }} types * @returns {Promise} */ - - async populateDataIfNeeded(_ref2) { - var _this$availableInputT; - let { mainType, subtype @@ -15543,14 +14211,13 @@ class Settings { mainType, subtype })) return false; - - if (((_this$availableInputT = this.availableInputTypes) === null || _this$availableInputT === void 0 ? void 0 : _this$availableInputT[mainType]) === undefined) { + if (this.availableInputTypes?.[mainType] === undefined) { await this.populateData(); return true; } - return false; } + /** * Checks if items will show in the autofill menu, including in-context signup. * Triggers side-effect if input types is not already available. @@ -15561,11 +14228,7 @@ class Settings { * @param {import("./InContextSignup.js").InContextSignup?} inContextSignup * @returns {boolean} */ - - canAutofillType(_ref3, inContextSignup) { - var _this$availableInputT6; - let { mainType, subtype @@ -15573,157 +14236,146 @@ class Settings { if (this.isTypeUnavailable({ mainType, subtype - })) return false; // If it's an email field and Email Protection is enabled, return true regardless of other options + })) return false; + // If it's an email field and Email Protection is enabled, return true regardless of other options const isEmailProtectionEnabled = this.featureToggles.emailProtection && this.availableInputTypes.email; - if (subtype === 'emailAddress' && isEmailProtectionEnabled) { return true; } - - if (inContextSignup !== null && inContextSignup !== void 0 && inContextSignup.isAvailable(subtype)) { + if (inContextSignup?.isAvailable(subtype)) { return true; } - if (subtype === 'fullName') { - var _this$availableInputT2, _this$availableInputT3; - - return Boolean(((_this$availableInputT2 = this.availableInputTypes.identities) === null || _this$availableInputT2 === void 0 ? void 0 : _this$availableInputT2.firstName) || ((_this$availableInputT3 = this.availableInputTypes.identities) === null || _this$availableInputT3 === void 0 ? void 0 : _this$availableInputT3.lastName)); + return Boolean(this.availableInputTypes.identities?.firstName || this.availableInputTypes.identities?.lastName); } - if (subtype === 'expiration') { - var _this$availableInputT4, _this$availableInputT5; - - return Boolean(((_this$availableInputT4 = this.availableInputTypes.creditCards) === null || _this$availableInputT4 === void 0 ? void 0 : _this$availableInputT4.expirationMonth) || ((_this$availableInputT5 = this.availableInputTypes.creditCards) === null || _this$availableInputT5 === void 0 ? void 0 : _this$availableInputT5.expirationYear)); + return Boolean(this.availableInputTypes.creditCards?.expirationMonth || this.availableInputTypes.creditCards?.expirationYear); } - - return Boolean((_this$availableInputT6 = this.availableInputTypes[mainType]) === null || _this$availableInputT6 === void 0 ? void 0 : _this$availableInputT6[subtype]); + return Boolean(this.availableInputTypes[mainType]?.[subtype]); } - /** @returns {AutofillFeatureToggles} */ - + /** @returns {AutofillFeatureToggles} */ get featureToggles() { if (this._featureToggles === null) throw new Error('feature toggles accessed before being set'); return this._featureToggles; } - /** @param {AutofillFeatureToggles} input */ - + /** @param {AutofillFeatureToggles} input */ setFeatureToggles(input) { this._featureToggles = input; } - /** @returns {AvailableInputTypes} */ - + /** @returns {AvailableInputTypes} */ get availableInputTypes() { if (this._availableInputTypes === null) throw new Error('available input types accessed before being set'); return this._availableInputTypes; } - /** @param {AvailableInputTypes} value */ - + /** @param {AvailableInputTypes} value */ setAvailableInputTypes(value) { - this._availableInputTypes = { ...this._availableInputTypes, + this._availableInputTypes = { + ...this._availableInputTypes, ...value }; } - + static defaults = { + /** @type {AutofillFeatureToggles} */ + featureToggles: { + credentials_saving: false, + password_generation: false, + emailProtection: false, + emailProtection_incontext_signup: false, + inputType_identities: false, + inputType_credentials: false, + inputType_creditCards: false, + inlineIcon_credentials: false + }, + /** @type {AvailableInputTypes} */ + availableInputTypes: { + credentials: { + username: false, + password: false + }, + identities: { + firstName: false, + middleName: false, + lastName: false, + birthdayDay: false, + birthdayMonth: false, + birthdayYear: false, + addressStreet: false, + addressStreet2: false, + addressCity: false, + addressProvince: false, + addressPostalCode: false, + addressCountryCode: false, + phone: false, + emailAddress: false + }, + creditCards: { + cardName: false, + cardSecurityCode: false, + expirationMonth: false, + expirationYear: false, + cardNumber: false + }, + email: false + }, + /** @type {boolean | null} */ + enabled: null + }; static default(globalConfig, deviceApi) { const settings = new Settings(globalConfig, deviceApi); settings.setFeatureToggles(Settings.defaults.featureToggles); settings.setAvailableInputTypes(Settings.defaults.availableInputTypes); return settings; } - /** @returns {boolean|null} */ - + /** @returns {boolean|null} */ get enabled() { return this._enabled; } + /** * @param {boolean|null} enabled */ - - setEnabled(enabled) { this._enabled = enabled; } - } - exports.Settings = Settings; -_defineProperty(Settings, "defaults", { - /** @type {AutofillFeatureToggles} */ - featureToggles: { - credentials_saving: false, - password_generation: false, - emailProtection: false, - emailProtection_incontext_signup: false, - inputType_identities: false, - inputType_credentials: false, - inputType_creditCards: false, - inlineIcon_credentials: false - }, - - /** @type {AvailableInputTypes} */ - availableInputTypes: { - credentials: { - username: false, - password: false - }, - identities: { - firstName: false, - middleName: false, - lastName: false, - birthdayDay: false, - birthdayMonth: false, - birthdayYear: false, - addressStreet: false, - addressStreet2: false, - addressCity: false, - addressProvince: false, - addressPostalCode: false, - addressCountryCode: false, - phone: false, - emailAddress: false - }, - creditCards: { - cardName: false, - cardSecurityCode: false, - expirationMonth: false, - expirationYear: false, - cardNumber: false - }, - email: false - }, - - /** @type {boolean | null} */ - enabled: null -}); - -},{"../packages/device-api/index.js":10,"./autofill-utils.js":59,"./deviceApiCalls/__generated__/deviceApiCalls.js":63,"./deviceApiCalls/__generated__/validators.zod.js":64,"@duckduckgo/content-scope-scripts/src/apple-utils":1}],49:[function(require,module,exports){ +},{"../packages/device-api/index.js":12,"./autofill-utils.js":61,"./deviceApiCalls/__generated__/deviceApiCalls.js":65,"./deviceApiCalls/__generated__/validators.zod.js":66,"@duckduckgo/content-scope-scripts/src/apple-utils":1}],51:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; - var _autofillUtils = require("../autofill-utils.js"); - var _HTMLTooltip = _interopRequireDefault(require("./HTMLTooltip.js")); - var _Credentials = require("../InputTypes/Credentials.js"); - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - class DataHTMLTooltip extends _HTMLTooltip.default { renderEmailProtectionIncontextSignup(isOtherItems) { - const dataTypeClass = "tooltip__button--data--identities"; + const dataTypeClass = `tooltip__button--data--identities`; const providerIconClass = 'tooltip__button--data--duckduckgo'; - return "\n ".concat(isOtherItems ? '
    ' : '', "\n \n "); + return ` + ${isOtherItems ? '
    ' : ''} + + `; } + /** * @param {InputTypeConfigs} config * @param {TooltipItemRenderer[]} items @@ -15736,38 +14388,58 @@ class DataHTMLTooltip extends _HTMLTooltip.default { * onIncontextSignup?(): void * }} callbacks */ - - render(config, items, callbacks) { const { wrapperClass, css } = this.options; - const isTopAutofill = wrapperClass === null || wrapperClass === void 0 ? void 0 : wrapperClass.includes('top-autofill'); - let hasAddedSeparator = false; // Only show an hr above the first duck address button, but it can be either personal or private - + const isTopAutofill = wrapperClass?.includes('top-autofill'); + let hasAddedSeparator = false; + // Only show an hr above the first duck address button, but it can be either personal or private const shouldShowSeparator = (dataId, index) => { const shouldShow = ['personalAddress', 'privateAddress'].includes(dataId) && !hasAddedSeparator; - if (shouldShow) hasAddedSeparator = true; // Don't show the separator if we want to show it, but it's unnecessary as the first item in the menu + if (shouldShow) hasAddedSeparator = true; + // Don't show the separator if we want to show it, but it's unnecessary as the first item in the menu const isFirst = index === 0; return shouldShow && !isFirst; - }; // Only show manage Manage… when it's topAutofill, the provider is unlocked, and it's not just EmailProtection - + }; + // Only show manage Manage… when it's topAutofill, the provider is unlocked, and it's not just EmailProtection const shouldShowManageButton = isTopAutofill && items.some(item => !['personalAddress', 'privateAddress', _Credentials.PROVIDER_LOCKED].includes(item.id())); const topClass = wrapperClass || ''; - const dataTypeClass = "tooltip__button--data--".concat(config.type); - this.shadow.innerHTML = "\n".concat(css, "\n"); + const dataTypeClass = `tooltip__button--data--${config.type}`; + this.shadow.innerHTML = ` +${css} +`; this.wrapper = this.shadow.querySelector('.wrapper'); this.tooltip = this.shadow.querySelector('.tooltip'); this.autofillButtons = this.shadow.querySelectorAll('.js-autofill-button'); @@ -15782,49 +14454,36 @@ class DataHTMLTooltip extends _HTMLTooltip.default { }); }); this.manageButton = this.shadow.getElementById('manage-button'); - if (this.manageButton) { this.registerClickableButton(this.manageButton, () => { callbacks.onManage(config.type); }); } - const getIncontextSignup = this.shadow.querySelector('.js-get-email-signup'); - if (getIncontextSignup) { this.registerClickableButton(getIncontextSignup, () => { - var _callbacks$onIncontex, _callbacks$onIncontex2; - - (_callbacks$onIncontex = callbacks.onIncontextSignupDismissed) === null || _callbacks$onIncontex === void 0 ? void 0 : _callbacks$onIncontex.call(callbacks, { + callbacks.onIncontextSignupDismissed?.({ hasOtherOptions: items.length > 0 }); - (_callbacks$onIncontex2 = callbacks.onIncontextSignup) === null || _callbacks$onIncontex2 === void 0 ? void 0 : _callbacks$onIncontex2.call(callbacks); + callbacks.onIncontextSignup?.(); }); } - this.init(); return this; } - } +var _default = exports.default = DataHTMLTooltip; -var _default = DataHTMLTooltip; -exports.default = _default; - -},{"../InputTypes/Credentials.js":43,"../autofill-utils.js":59,"./HTMLTooltip.js":52}],50:[function(require,module,exports){ +},{"../InputTypes/Credentials.js":45,"../autofill-utils.js":61,"./HTMLTooltip.js":54}],52:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; - var _autofillUtils = require("../autofill-utils.js"); - var _HTMLTooltip = _interopRequireDefault(require("./HTMLTooltip.js")); - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - class EmailHTMLTooltip extends _HTMLTooltip.default { /** * @param {import("../DeviceInterface/InterfacePrototype").default} device @@ -15832,20 +14491,34 @@ class EmailHTMLTooltip extends _HTMLTooltip.default { render(device) { this.device = device; this.addresses = device.getLocalAddresses(); - this.shadow.innerHTML = "\n".concat(this.options.css, "\n"); + this.shadow.innerHTML = ` +${this.options.css} +`; this.wrapper = this.shadow.querySelector('.wrapper'); this.tooltip = this.shadow.querySelector('.tooltip'); this.usePersonalButton = this.shadow.querySelector('.js-use-personal'); this.usePrivateButton = this.shadow.querySelector('.js-use-private'); this.addressEl = this.shadow.querySelector('.js-address'); - this.updateAddresses = addresses => { if (addresses && this.addressEl) { this.addresses = addresses; this.addressEl.textContent = (0, _autofillUtils.formatDuckAddress)(addresses.personalAddress); } }; - const firePixel = this.device.firePixel.bind(this.device); this.registerClickableButton(this.usePersonalButton, () => { this.fillForm('personalAddress'); @@ -15858,8 +14531,9 @@ class EmailHTMLTooltip extends _HTMLTooltip.default { firePixel({ pixelName: 'autofill_private_address' }); - }); // Get the alias from the extension + }); + // Get the alias from the extension this.device.getAddresses().then(this.updateAddresses); this.init(); return this; @@ -15867,87 +14541,83 @@ class EmailHTMLTooltip extends _HTMLTooltip.default { /** * @param {'personalAddress' | 'privateAddress'} id */ - - async fillForm(id) { - var _this$device; - const address = this.addresses[id]; const formattedAddress = (0, _autofillUtils.formatDuckAddress)(address); - (_this$device = this.device) === null || _this$device === void 0 ? void 0 : _this$device.selectedDetail({ + this.device?.selectedDetail({ email: formattedAddress, id }, 'email'); } - } +var _default = exports.default = EmailHTMLTooltip; -var _default = EmailHTMLTooltip; -exports.default = _default; - -},{"../autofill-utils.js":59,"./HTMLTooltip.js":52}],51:[function(require,module,exports){ +},{"../autofill-utils.js":61,"./HTMLTooltip.js":54}],53:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; - var _HTMLTooltip = _interopRequireDefault(require("./HTMLTooltip.js")); - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - class EmailSignupHTMLTooltip extends _HTMLTooltip.default { /** * @param {import("../DeviceInterface/InterfacePrototype").default} device */ render(device) { this.device = device; - this.shadow.innerHTML = "\n".concat(this.options.css, "\n"); + this.shadow.innerHTML = ` +${this.options.css} +`; this.tooltip = this.shadow.querySelector('.tooltip'); this.closeEmailSignup = this.shadow.querySelector('.js-close-email-signup'); this.registerClickableButton(this.closeEmailSignup, () => { - var _device$inContextSign; - - (_device$inContextSign = device.inContextSignup) === null || _device$inContextSign === void 0 ? void 0 : _device$inContextSign.onIncontextSignupClosed(); + device.inContextSignup?.onIncontextSignupClosed(); }); this.dismissEmailSignup = this.shadow.querySelector('.js-dismiss-email-signup'); this.registerClickableButton(this.dismissEmailSignup, () => { - var _device$inContextSign2; - - (_device$inContextSign2 = device.inContextSignup) === null || _device$inContextSign2 === void 0 ? void 0 : _device$inContextSign2.onIncontextSignupDismissed(); + device.inContextSignup?.onIncontextSignupDismissed(); }); this.getEmailSignup = this.shadow.querySelector('.js-get-email-signup'); this.registerClickableButton(this.getEmailSignup, () => { - var _device$inContextSign3; - - (_device$inContextSign3 = device.inContextSignup) === null || _device$inContextSign3 === void 0 ? void 0 : _device$inContextSign3.onIncontextSignup(); + device.inContextSignup?.onIncontextSignup(); }); this.init(); return this; } - } +var _default = exports.default = EmailSignupHTMLTooltip; -var _default = EmailSignupHTMLTooltip; -exports.default = _default; - -},{"./HTMLTooltip.js":52}],52:[function(require,module,exports){ +},{"./HTMLTooltip.js":54}],54:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.defaultOptions = exports.default = exports.HTMLTooltip = void 0; - var _autofillUtils = require("../autofill-utils.js"); - var _matching = require("../Form/matching.js"); - var _styles = require("./styles/styles.js"); - -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - /** * @typedef {object} HTMLTooltipOptions * @property {boolean} testMode @@ -15969,25 +14639,29 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope */ /** @type {HTMLTooltipOptions} */ -const defaultOptions = { +const defaultOptions = exports.defaultOptions = { wrapperClass: '', - tooltipPositionClass: (top, left) => "\n .tooltip {\n transform: translate(".concat(Math.floor(left), "px, ").concat(Math.floor(top), "px) !important;\n }\n "), - caretPositionClass: (top, left, isAboveInput) => "\n .tooltip--email__caret {\n ".concat(isAboveInput ? "transform: translate(".concat(Math.floor(left), "px, ").concat(Math.floor(top), "px) rotate(180deg); transform-origin: 18px !important;") : "transform: translate(".concat(Math.floor(left), "px, ").concat(Math.floor(top), "px) !important;"), "\n }"), - css: ""), + tooltipPositionClass: (top, left) => ` + .tooltip { + transform: translate(${Math.floor(left)}px, ${Math.floor(top)}px) !important; + } + `, + caretPositionClass: (top, left, isAboveInput) => ` + .tooltip--email__caret { + ${isAboveInput ? `transform: translate(${Math.floor(left)}px, ${Math.floor(top)}px) rotate(180deg); transform-origin: 18px !important;` : `transform: translate(${Math.floor(left)}px, ${Math.floor(top)}px) !important;`} + }`, + css: ``, setSize: undefined, - remove: () => { - /** noop */ - }, + remove: () => {/** noop */}, testMode: false, checkVisibility: true, hasCaret: false, isIncontextSignupAvailable: () => false }; -exports.defaultOptions = defaultOptions; - class HTMLTooltip { + isAboveInput = false; /** @type {HTMLTooltipOptions} */ - + options; /** * @param config * @param inputType @@ -15995,30 +14669,6 @@ class HTMLTooltip { * @param {HTMLTooltipOptions} options */ constructor(config, inputType, getPosition, options) { - _defineProperty(this, "isAboveInput", false); - - _defineProperty(this, "options", void 0); - - _defineProperty(this, "resObs", new ResizeObserver(entries => entries.forEach(() => this.checkPosition()))); - - _defineProperty(this, "mutObsCheckPositionWhenIdle", _autofillUtils.whenIdle.call(this, this.checkPosition)); - - _defineProperty(this, "mutObs", new MutationObserver(mutationList => { - for (const mutationRecord of mutationList) { - if (mutationRecord.type === 'childList') { - // Only check added nodes - mutationRecord.addedNodes.forEach(el => { - if (el.nodeName === 'DDG-AUTOFILL') return; - this.ensureIsLastInDOM(); - }); - } - } - - this.mutObsCheckPositionWhenIdle(); - })); - - _defineProperty(this, "clickableButtons", new Map()); - this.options = options; this.shadow = document.createElement('ddg-autofill').attachShadow({ mode: options.testMode ? 'open' : 'closed' @@ -16032,8 +14682,8 @@ class HTMLTooltip { 'display': 'block', 'visibility': 'visible', 'opacity': '1' - }; // @ts-ignore how to narrow this.host to HTMLElement? - + }; + // @ts-ignore how to narrow this.host to HTMLElement? (0, _autofillUtils.addInlineStyles)(this.host, forcedVisibilityStyles); this.count = 0; this.device = null; @@ -16043,7 +14693,6 @@ class HTMLTooltip { * 'caret': TransformRuleObj * }} */ - this.transformRules = { caret: { getRuleString: this.options.caretPositionClass, @@ -16055,19 +14704,14 @@ class HTMLTooltip { } }; } - get isHidden() { return this.tooltip.parentNode.hidden; } - append() { document.body.appendChild(this.host); } - remove() { - var _this$device; - - (_this$device = this.device) === null || _this$device === void 0 ? void 0 : _this$device.activeForm.resetIconStylesToInitial(); + this.device?.activeForm.resetIconStylesToInitial(); window.removeEventListener('scroll', this, { capture: true }); @@ -16075,13 +14719,11 @@ class HTMLTooltip { this.mutObs.disconnect(); this.lift(); } - lift() { this.left = null; this.top = null; document.body.removeChild(this.host); } - handleEvent(event) { switch (event.type) { case 'scroll': @@ -16089,24 +14731,19 @@ class HTMLTooltip { break; } } - focus(x, y) { - var _this$shadow$elementF, _this$shadow$elementF2; - const focusableElements = 'button'; const currentFocusClassName = 'currentFocus'; - const currentFocused = this.shadow.querySelectorAll(".".concat(currentFocusClassName)); + const currentFocused = this.shadow.querySelectorAll(`.${currentFocusClassName}`); [...currentFocused].forEach(el => { el.classList.remove(currentFocusClassName); }); - (_this$shadow$elementF = this.shadow.elementFromPoint(x, y)) === null || _this$shadow$elementF === void 0 ? void 0 : (_this$shadow$elementF2 = _this$shadow$elementF.closest(focusableElements)) === null || _this$shadow$elementF2 === void 0 ? void 0 : _this$shadow$elementF2.classList.add(currentFocusClassName); + this.shadow.elementFromPoint(x, y)?.closest(focusableElements)?.classList.add(currentFocusClassName); } - checkPosition() { if (this.animationFrame) { window.cancelAnimationFrame(this.animationFrame); } - this.animationFrame = window.requestAnimationFrame(() => { if (this.isHidden) return; const { @@ -16115,14 +14752,12 @@ class HTMLTooltip { height, top } = this.getPosition(); - if (left !== this.left || bottom !== this.top) { const coords = { left, top: bottom }; this.updatePosition('tooltip', coords); - if (this.options.hasCaret) { // Recalculate tooltip top as it may have changed after update potition above const { @@ -16131,16 +14766,15 @@ class HTMLTooltip { this.isAboveInput = top > tooltipTop; const borderWidth = 2; const caretTop = this.isAboveInput ? coords.top - height - borderWidth : coords.top; - this.updatePosition('caret', { ...coords, + this.updatePosition('caret', { + ...coords, top: caretTop }); } } - this.animationFrame = null; }); } - getOverridePosition(_ref) { let { left, @@ -16148,8 +14782,9 @@ class HTMLTooltip { } = _ref; const tooltipBoundingBox = this.tooltip.getBoundingClientRect(); const smallScreenWidth = tooltipBoundingBox.width * 2; - const spacing = 5; // If overflowing from the bottom, move to above the input + const spacing = 5; + // If overflowing from the bottom, move to above the input if (tooltipBoundingBox.bottom > window.innerHeight) { const inputPosition = this.getPosition(); const caretHeight = 14; @@ -16158,9 +14793,9 @@ class HTMLTooltip { left, top: overriddenTopPosition }; - } // If overflowing from the left on smaller screen, center in the window - + } + // If overflowing from the left on smaller screen, center in the window if (tooltipBoundingBox.left < 0 && window.innerWidth <= smallScreenWidth) { const leftOverflow = Math.abs(tooltipBoundingBox.left); const leftPosWhenCentered = (window.innerWidth - tooltipBoundingBox.width) / 2; @@ -16169,9 +14804,9 @@ class HTMLTooltip { left: overriddenLeftPosition, top }; - } // If overflowing from the left on larger screen, move so it's just on screen on the left - + } + // If overflowing from the left on larger screen, move so it's just on screen on the left if (tooltipBoundingBox.left < 0 && window.innerWidth > smallScreenWidth) { const leftOverflow = Math.abs(tooltipBoundingBox.left); const overriddenLeftPosition = left + leftOverflow + spacing; @@ -16179,9 +14814,9 @@ class HTMLTooltip { left: overriddenLeftPosition, top }; - } // If overflowing from the right, move so it's just on screen on the right - + } + // If overflowing from the right, move so it's just on screen on the right if (tooltipBoundingBox.right > window.innerWidth) { const rightOverflow = tooltipBoundingBox.right - window.innerWidth; const overriddenLeftPosition = left - rightOverflow - spacing; @@ -16191,6 +14826,7 @@ class HTMLTooltip { }; } } + /** * @param {'tooltip' | 'caret'} element * @param {{ @@ -16198,18 +14834,13 @@ class HTMLTooltip { * top: number * }} coords */ - - applyPositionalStyles(element, _ref2) { - var _ruleObj$getRuleStrin; - let { left, top } = _ref2; const shadow = this.shadow; const ruleObj = this.transformRules[element]; - if (ruleObj.index) { if (shadow.styleSheets[0].rules[ruleObj.index]) { // If we have already set the rule, remove it… @@ -16219,13 +14850,12 @@ class HTMLTooltip { // …otherwise, set the index as the very last rule ruleObj.index = shadow.styleSheets[0].rules.length; } - - const cssRule = (_ruleObj$getRuleStrin = ruleObj.getRuleString) === null || _ruleObj$getRuleStrin === void 0 ? void 0 : _ruleObj$getRuleStrin.call(ruleObj, top, left, this.isAboveInput); - + const cssRule = ruleObj.getRuleString?.(top, left, this.isAboveInput); if (typeof cssRule === 'string') { shadow.styleSheets[0].insertRule(cssRule, ruleObj.index); } } + /** * @param {'tooltip' | 'caret'} element * @param {{ @@ -16233,29 +14863,22 @@ class HTMLTooltip { * top: number * }} coords */ - - updatePosition(element, _ref3) { let { left, top } = _ref3; - // If the stylesheet is not loaded wait for load (Chrome bug) if (!this.shadow.styleSheets.length) { - var _this$stylesheet; - - (_this$stylesheet = this.stylesheet) === null || _this$stylesheet === void 0 ? void 0 : _this$stylesheet.addEventListener('load', () => this.checkPosition()); + this.stylesheet?.addEventListener('load', () => this.checkPosition()); return; } - this.left = left; this.top = top; this.applyPositionalStyles(element, { left, top }); - if (this.options.hasCaret) { const overridePosition = this.getOverridePosition({ left, @@ -16264,10 +14887,9 @@ class HTMLTooltip { if (overridePosition) this.updatePosition(element, overridePosition); } } - ensureIsLastInDOM() { - this.count = this.count || 0; // If DDG el is not the last in the doc, move it there - + this.count = this.count || 0; + // If DDG el is not the last in the doc, move it there if (document.body.lastElementChild !== this.host) { // Try up to 15 times to avoid infinite loop in case someone is doing the same if (this.count < 15) { @@ -16278,29 +14900,39 @@ class HTMLTooltip { } else { // Remove the tooltip from the form to cleanup listeners and observers this.options.remove(); - console.info("DDG autofill bailing out"); + console.info(`DDG autofill bailing out`); } } } - + resObs = new ResizeObserver(entries => entries.forEach(() => this.checkPosition())); + mutObsCheckPositionWhenIdle = _autofillUtils.whenIdle.call(this, this.checkPosition); + mutObs = new MutationObserver(mutationList => { + for (const mutationRecord of mutationList) { + if (mutationRecord.type === 'childList') { + // Only check added nodes + mutationRecord.addedNodes.forEach(el => { + if (el.nodeName === 'DDG-AUTOFILL') return; + this.ensureIsLastInDOM(); + }); + } + } + this.mutObsCheckPositionWhenIdle(); + }); setActiveButton(e) { this.activeButton = e.target; } - unsetActiveButton() { this.activeButton = null; } - + clickableButtons = new Map(); registerClickableButton(btn, handler) { - this.clickableButtons.set(btn, handler); // Needed because clicks within the shadow dom don't provide this info to the outside - + this.clickableButtons.set(btn, handler); + // Needed because clicks within the shadow dom don't provide this info to the outside btn.addEventListener('mouseenter', e => this.setActiveButton(e)); btn.addEventListener('mouseleave', () => this.unsetActiveButton()); } - dispatchClick() { const handler = this.clickableButtons.get(this.activeButton); - if (handler) { if (this.activeButton.matches('.wrapper:not(.top-autofill) button:hover, .wrapper:not(.top-autofill) a:hover, .currentFocus')) { (0, _autofillUtils.safeExecute)(this.activeButton, handler, { @@ -16311,7 +14943,6 @@ class HTMLTooltip { } } } - setupSizeListener() { // Listen to layout and paint changes to register the size const observer = new PerformanceObserver(() => { @@ -16321,31 +14952,25 @@ class HTMLTooltip { entryTypes: ['layout-shift', 'paint'] }); } - setSize() { - var _this$options$setSize, _this$options; - - const innerNode = this.shadow.querySelector('.wrapper--data'); // Shouldn't be possible - + const innerNode = this.shadow.querySelector('.wrapper--data'); + // Shouldn't be possible if (!innerNode) return; const details = { height: innerNode.clientHeight, width: innerNode.clientWidth }; - (_this$options$setSize = (_this$options = this.options).setSize) === null || _this$options$setSize === void 0 ? void 0 : _this$options$setSize.call(_this$options, details); + this.options.setSize?.(details); } - init() { - var _this$stylesheet2; - this.animationFrame = null; this.top = 0; this.left = 0; this.transformRuleIndex = null; - this.stylesheet = this.shadow.querySelector('link, style'); // Un-hide once the style and web fonts have loaded, to avoid flashing + this.stylesheet = this.shadow.querySelector('link, style'); + // Un-hide once the style and web fonts have loaded, to avoid flashing // unstyled content and layout shifts - - (_this$stylesheet2 = this.stylesheet) === null || _this$stylesheet2 === void 0 ? void 0 : _this$stylesheet2.addEventListener('load', () => { + this.stylesheet?.addEventListener('load', () => { Promise.allSettled([document.fonts.load("normal 13px 'DDG_ProximaNova'"), document.fonts.load("bold 13px 'DDG_ProximaNova'")]).then(() => { this.tooltip.parentNode.removeAttribute('hidden'); this.checkPosition(); @@ -16362,46 +14987,30 @@ class HTMLTooltip { capture: true }); this.setSize(); - if (typeof this.options.setSize === 'function') { this.setupSizeListener(); } } - } - exports.HTMLTooltip = HTMLTooltip; -var _default = HTMLTooltip; -exports.default = _default; +var _default = exports.default = HTMLTooltip; -},{"../Form/matching.js":41,"../autofill-utils.js":59,"./styles/styles.js":58}],53:[function(require,module,exports){ +},{"../Form/matching.js":43,"../autofill-utils.js":61,"./styles/styles.js":60}],55:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.HTMLTooltipUIController = void 0; - var _autofillUtils = require("../../autofill-utils.js"); - var _inputTypeConfig = require("../../Form/inputTypeConfig.js"); - var _matching = require("../../Form/matching.js"); - var _DataHTMLTooltip = _interopRequireDefault(require("../DataHTMLTooltip.js")); - var _EmailHTMLTooltip = _interopRequireDefault(require("../EmailHTMLTooltip.js")); - var _EmailSignupHTMLTooltip = _interopRequireDefault(require("../EmailSignupHTMLTooltip.js")); - var _HTMLTooltip = require("../HTMLTooltip.js"); - var _UIController = require("./UIController.js"); - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - /** * @typedef HTMLTooltipControllerOptions * @property {"modern" | "legacy" | "emailsignup"} tooltipKind - A choice between the newer Autofill UI vs the older ones used in the extension @@ -16417,15 +15026,19 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope */ class HTMLTooltipUIController extends _UIController.UIController { /** @type {import("../HTMLTooltip.js").HTMLTooltip | null} */ + _activeTooltip = null; /** @type {HTMLTooltipControllerOptions} */ + _options; /** @type {import('../HTMLTooltip.js').HTMLTooltipOptions} */ + _htmlTooltipOptions; /** * Overwritten when calling createTooltip * @type {import('../../Form/matching').SupportedTypes} */ + _activeInputType = 'unknown'; /** * @param {HTMLTooltipControllerOptions} options @@ -16434,24 +15047,13 @@ class HTMLTooltipUIController extends _UIController.UIController { constructor(options) { let htmlTooltipOptions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _HTMLTooltip.defaultOptions; super(); - - _defineProperty(this, "_activeTooltip", null); - - _defineProperty(this, "_options", void 0); - - _defineProperty(this, "_htmlTooltipOptions", void 0); - - _defineProperty(this, "_activeInputType", 'unknown'); - - _defineProperty(this, "_activeInput", void 0); - - _defineProperty(this, "_activeInputOriginalAutocomplete", void 0); - this._options = options; this._htmlTooltipOptions = Object.assign({}, _HTMLTooltip.defaultOptions, htmlTooltipOptions); window.addEventListener('pointerdown', this, true); window.addEventListener('pointerup', this, true); } + _activeInput; + _activeInputOriginalAutocomplete; /** * Cleans up after this UI controller by removing the tooltip and all @@ -16462,16 +15064,14 @@ class HTMLTooltipUIController extends _UIController.UIController { window.removeEventListener('pointerdown', this, true); window.removeEventListener('pointerup', this, true); } + /** * @param {import('./UIController').AttachArgs} args */ - - attach(args) { if (this.getActiveTooltip()) { return; } - const { topContextData, getPosition, @@ -16485,55 +15085,49 @@ class HTMLTooltipUIController extends _UIController.UIController { this._activeInputOriginalAutocomplete = input.getAttribute('autocomplete'); input.setAttribute('autocomplete', 'off'); } + /** * Actually create the HTML Tooltip * @param {PosFn} getPosition * @param {TopContextData} topContextData * @return {import("../HTMLTooltip").HTMLTooltip} */ - - createTooltip(getPosition, topContextData) { this._attachListeners(); - const config = (0, _inputTypeConfig.getInputConfigFromType)(topContextData.inputType); this._activeInputType = topContextData.inputType; + /** * @type {import('../HTMLTooltip').HTMLTooltipOptions} */ - - const tooltipOptions = { ...this._htmlTooltipOptions, + const tooltipOptions = { + ...this._htmlTooltipOptions, remove: () => this.removeTooltip(), isIncontextSignupAvailable: () => { - var _this$_options$device; - const subtype = (0, _matching.getSubtypeFromType)(topContextData.inputType); - return !!((_this$_options$device = this._options.device.inContextSignup) !== null && _this$_options$device !== void 0 && _this$_options$device.isAvailable(subtype)); + return !!this._options.device.inContextSignup?.isAvailable(subtype); } }; - if (this._options.tooltipKind === 'legacy') { this._options.device.firePixel({ pixelName: 'autofill_show' }); - return new _EmailHTMLTooltip.default(config, topContextData.inputType, getPosition, tooltipOptions).render(this._options.device); } - if (this._options.tooltipKind === 'emailsignup') { this._options.device.firePixel({ pixelName: 'incontext_show' }); - return new _EmailSignupHTMLTooltip.default(config, topContextData.inputType, getPosition, tooltipOptions).render(this._options.device); - } // collect the data for each item to display - - - const data = this._dataForAutofill(config, topContextData.inputType, topContextData); // convert the data into tool tip item renderers + } + // collect the data for each item to display + const data = this._dataForAutofill(config, topContextData.inputType, topContextData); - const asRenderers = data.map(d => config.tooltipItem(d)); // construct the autofill + // convert the data into tool tip item renderers + const asRenderers = data.map(d => config.tooltipItem(d)); + // construct the autofill return new _DataHTMLTooltip.default(config, topContextData.inputType, getPosition, tooltipOptions).render(config, asRenderers, { onSelect: id => { this._onSelect(topContextData.inputType, data, id); @@ -16549,16 +15143,15 @@ class HTMLTooltipUIController extends _UIController.UIController { } }); } - updateItems(data) { if (this._activeInputType === 'unknown') return; - const config = (0, _inputTypeConfig.getInputConfigFromType)(this._activeInputType); // convert the data into tool tip item renderers + const config = (0, _inputTypeConfig.getInputConfigFromType)(this._activeInputType); + // convert the data into tool tip item renderers const asRenderers = data.map(d => config.tooltipItem(d)); const activeTooltip = this.getActiveTooltip(); - if (activeTooltip instanceof _DataHTMLTooltip.default) { - activeTooltip === null || activeTooltip === void 0 ? void 0 : activeTooltip.render(config, asRenderers, { + activeTooltip?.render(config, asRenderers, { onSelect: id => { this._onSelect(this._activeInputType, data, id); }, @@ -16572,27 +15165,21 @@ class HTMLTooltipUIController extends _UIController.UIController { this._onIncontextSignup(); } }); - } // TODO: can we remove this timeout once implemented with real APIs? + } + // TODO: can we remove this timeout once implemented with real APIs? // The timeout is needed because clientHeight and clientWidth were returning 0 - - setTimeout(() => { - var _this$getActiveToolti; - - (_this$getActiveToolti = this.getActiveTooltip()) === null || _this$getActiveToolti === void 0 ? void 0 : _this$getActiveToolti.setSize(); + this.getActiveTooltip()?.setSize(); }, 10); } - _attachListeners() { window.addEventListener('input', this); window.addEventListener('keydown', this, true); } - _removeListeners() { window.removeEventListener('input', this); window.removeEventListener('keydown', this, true); } - handleEvent(event) { switch (event.type) { case 'keydown': @@ -16601,102 +15188,91 @@ class HTMLTooltipUIController extends _UIController.UIController { event.preventDefault(); event.stopImmediatePropagation(); } - this.removeTooltip(); } - break; - case 'input': this.removeTooltip(); break; - case 'pointerdown': { this._pointerDownListener(event); - break; } - case 'pointerup': { this._pointerUpListener(event); - break; } } - } // Global listener for event delegation - + } + // Global listener for event delegation _pointerDownListener(e) { - if (!e.isTrusted) return; // Ignore events on the Dax icon, we handle those elsewhere - - if ((0, _autofillUtils.isEventWithinDax)(e, e.target)) return; // @ts-ignore + if (!e.isTrusted) return; + // Ignore events on the Dax icon, we handle those elsewhere + if ((0, _autofillUtils.isEventWithinDax)(e, e.target)) return; + // @ts-ignore if (e.target.nodeName === 'DDG-AUTOFILL') { e.preventDefault(); - e.stopImmediatePropagation(); // Ignore pointer down events, we'll handle them on pointer up + e.stopImmediatePropagation(); + // Ignore pointer down events, we'll handle them on pointer up } else { this.removeTooltip().catch(e => { console.error('error removing tooltip', e); }); } - } // Global listener for event delegation - + } + // Global listener for event delegation _pointerUpListener(e) { - if (!e.isTrusted) return; // Ignore events on the Dax icon, we handle those elsewhere - - if ((0, _autofillUtils.isEventWithinDax)(e, e.target)) return; // @ts-ignore + if (!e.isTrusted) return; + // Ignore events on the Dax icon, we handle those elsewhere + if ((0, _autofillUtils.isEventWithinDax)(e, e.target)) return; + // @ts-ignore if (e.target.nodeName === 'DDG-AUTOFILL') { e.preventDefault(); e.stopImmediatePropagation(); const isMainMouseButton = e.button === 0; if (!isMainMouseButton) return; const activeTooltip = this.getActiveTooltip(); - activeTooltip === null || activeTooltip === void 0 ? void 0 : activeTooltip.dispatchClick(); + activeTooltip?.dispatchClick(); } } - async removeTooltip(_via) { this._htmlTooltipOptions.remove(); - if (this._activeTooltip) { this._removeListeners(); - this._activeTooltip.remove(); - this._activeTooltip = null; } - if (this._activeInput) { if (this._activeInputOriginalAutocomplete) { this._activeInput.setAttribute('autocomplete', this._activeInputOriginalAutocomplete); } else { this._activeInput.removeAttribute('autocomplete'); } - this._activeInput = null; this._activeInputOriginalAutocomplete = null; } } + /** * @returns {import("../HTMLTooltip.js").HTMLTooltip|null} */ - - getActiveTooltip() { return this._activeTooltip; } + /** * @param {import("../HTMLTooltip.js").HTMLTooltip} value */ - - setActiveTooltip(value) { this._activeTooltip = value; } + /** * Collect the data that's needed to populate the Autofill UI. * @@ -16706,11 +15282,10 @@ class HTMLTooltipUIController extends _UIController.UIController { * @param {import('../../Form/matching').SupportedTypes} inputType - The input type for the current field * @param {TopContextData} topContextData */ - - _dataForAutofill(config, inputType, topContextData) { return this._options.device.dataForAutofill(config, inputType, topContextData); } + /** * When a field is selected, call the `onSelect` method from the device. * @@ -16720,11 +15295,10 @@ class HTMLTooltipUIController extends _UIController.UIController { * @param {(CreditCardObject | IdentityObject | CredentialsObject)[]} data * @param {CreditCardObject['id']|IdentityObject['id']|CredentialsObject['id']} id */ - - _onSelect(inputType, data, id) { return this._options.device.onSelect(inputType, data, id); } + /** * Called when clicking on the Manage… button in the html tooltip * @@ -16732,94 +15306,57 @@ class HTMLTooltipUIController extends _UIController.UIController { * @returns {*} * @private */ - - _onManage(type) { this.removeTooltip(); - switch (type) { case 'credentials': return this._options.device.openManagePasswords(); - case 'creditCards': return this._options.device.openManageCreditCards(); - case 'identities': return this._options.device.openManageIdentities(); - - default: // noop - + default: + // noop } } _onIncontextSignupDismissed(_ref) { - var _this$_options$device2; - let { hasOtherOptions } = _ref; - (_this$_options$device2 = this._options.device.inContextSignup) === null || _this$_options$device2 === void 0 ? void 0 : _this$_options$device2.onIncontextSignupDismissed({ + this._options.device.inContextSignup?.onIncontextSignupDismissed({ shouldHideTooltip: !hasOtherOptions - }); // If there are other options available, just force a re-render + }); + // If there are other options available, just force a re-render if (hasOtherOptions) { const topContextData = this._options.device.getTopContextData(); - if (!topContextData) return; const config = (0, _inputTypeConfig.getInputConfigFromType)(topContextData.inputType); - const data = this._dataForAutofill(config, topContextData.inputType, topContextData); - this.updateItems(data); } } - _onIncontextSignup() { - var _this$_options$device3; - - (_this$_options$device3 = this._options.device.inContextSignup) === null || _this$_options$device3 === void 0 ? void 0 : _this$_options$device3.onIncontextSignup(); + this._options.device.inContextSignup?.onIncontextSignup(); } - isActive() { return Boolean(this.getActiveTooltip()); } - } - exports.HTMLTooltipUIController = HTMLTooltipUIController; -},{"../../Form/inputTypeConfig.js":36,"../../Form/matching.js":41,"../../autofill-utils.js":59,"../DataHTMLTooltip.js":49,"../EmailHTMLTooltip.js":50,"../EmailSignupHTMLTooltip.js":51,"../HTMLTooltip.js":52,"./UIController.js":56}],54:[function(require,module,exports){ +},{"../../Form/inputTypeConfig.js":38,"../../Form/matching.js":43,"../../autofill-utils.js":61,"../DataHTMLTooltip.js":51,"../EmailHTMLTooltip.js":52,"../EmailSignupHTMLTooltip.js":53,"../HTMLTooltip.js":54,"./UIController.js":58}],56:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.NativeUIController = void 0; - var _UIController = require("./UIController.js"); - var _matching = require("../../Form/matching.js"); - var _deviceApiCalls = require("../../deviceApiCalls/__generated__/deviceApiCalls.js"); - var _Credentials = require("../../InputTypes/Credentials.js"); - -function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); } - -function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } } - -function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); } - -function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; } - -function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; } - -function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); } - -function _classApplyDescriptorSet(receiver, descriptor, value) { if (descriptor.set) { descriptor.set.call(receiver, value); } else { if (!descriptor.writable) { throw new TypeError("attempted to set read only private field"); } descriptor.value = value; } } - -var _passwordStatus = /*#__PURE__*/new WeakMap(); - /** * `NativeController` should be used in situations where you DO NOT * want any Autofill-controlled user interface. @@ -16835,14 +15372,13 @@ var _passwordStatus = /*#__PURE__*/new WeakMap(); * ``` */ class NativeUIController extends _UIController.UIController { - constructor() { - super(...arguments); - - _classPrivateFieldInitSpec(this, _passwordStatus, { - writable: true, - value: 'default' - }); - } + /** + * Keep track of when passwords were suggested/rejected/accepted etc + * State is kept here because it's specific to the interactions on mobile (eg: NativeUIController) + * + * @type {"default" | "rejected"} + */ + #passwordStatus = 'default'; /** * @param {import('./UIController').AttachArgs} args @@ -16859,31 +15395,28 @@ class NativeUIController extends _UIController.UIController { const inputType = (0, _matching.getInputType)(input); const mainType = (0, _matching.getMainTypeFromType)(inputType); const subType = (0, _matching.getSubtypeFromType)(inputType); - if (mainType === 'unknown') { throw new Error('unreachable, should not be here if (mainType === "unknown")'); } - if (trigger === 'autoprompt') { window.scrollTo({ behavior: 'smooth', top: form.form.getBoundingClientRect().top - document.body.getBoundingClientRect().top - 50 }); } - /** @type {import('../../deviceApiCalls/__generated__/validators-ts').GetAutofillDataRequest} */ - + /** @type {import('../../deviceApiCalls/__generated__/validators-ts').GetAutofillDataRequest} */ let payload = { inputType, mainType, subType, trigger - }; // append generated password if enabled + }; + // append generated password if enabled if (device.settings.featureToggles.password_generation) { payload = this.appendGeneratedPassword(topContextData, payload, triggerMetaData); } - device.deviceApi.request(new _deviceApiCalls.GetAutofillDataCall(payload)).then(resp => { switch (resp.action) { case 'fill': @@ -16891,42 +15424,30 @@ class NativeUIController extends _UIController.UIController { if (mainType in resp) { form.autofillData(resp[mainType], mainType); } else { - throw new Error("action: \"fill\" cannot occur because \"".concat(mainType, "\" was missing")); + throw new Error(`action: "fill" cannot occur because "${mainType}" was missing`); } - break; } - case 'focus': { - var _form$activeInput; - - (_form$activeInput = form.activeInput) === null || _form$activeInput === void 0 ? void 0 : _form$activeInput.focus(); + form.activeInput?.focus(); break; } - case 'acceptGeneratedPassword': { - var _topContextData$crede; - form.autofillData({ - password: (_topContextData$crede = topContextData.credentials) === null || _topContextData$crede === void 0 ? void 0 : _topContextData$crede[0].password, + password: topContextData.credentials?.[0].password, [_Credentials.AUTOGENERATED_KEY]: true }, mainType); break; } - case 'rejectGeneratedPassword': { - var _form$activeInput2; - - _classPrivateFieldSet(this, _passwordStatus, 'rejected'); - + this.#passwordStatus = 'rejected'; form.touchAllInputs('credentials'); - (_form$activeInput2 = form.activeInput) === null || _form$activeInput2 === void 0 ? void 0 : _form$activeInput2.focus(); + form.activeInput?.focus(); break; } - default: { if (args.device.isTestMode()) { @@ -16939,6 +15460,7 @@ class NativeUIController extends _UIController.UIController { console.error(e); }); } + /** * If a password exists in `topContextData`, we can append it to the outgoing data * in a way that native platforms can easily understand. @@ -16948,79 +15470,53 @@ class NativeUIController extends _UIController.UIController { * @param {import('../../UI/controllers/UIController.js').AttachArgs['triggerMetaData']} triggerMetaData * @return {import('../../deviceApiCalls/__generated__/validators-ts.js').GetAutofillDataRequest} */ - - appendGeneratedPassword(topContextData, outgoingData, triggerMetaData) { - var _topContextData$crede2; - - const autoGeneratedCredential = (_topContextData$crede2 = topContextData.credentials) === null || _topContextData$crede2 === void 0 ? void 0 : _topContextData$crede2.find(credential => credential.autogenerated); // if there's no generated password, we don't need to do anything + const autoGeneratedCredential = topContextData.credentials?.find(credential => credential.autogenerated); - if (!(autoGeneratedCredential !== null && autoGeneratedCredential !== void 0 && autoGeneratedCredential.password)) { + // if there's no generated password, we don't need to do anything + if (!autoGeneratedCredential?.password) { return outgoingData; } - function suggestPassword() { - if (!(autoGeneratedCredential !== null && autoGeneratedCredential !== void 0 && autoGeneratedCredential.password)) throw new Error('unreachable'); - return { ...outgoingData, + if (!autoGeneratedCredential?.password) throw new Error('unreachable'); + return { + ...outgoingData, generatedPassword: { value: autoGeneratedCredential.password, username: autoGeneratedCredential.username } }; - } // for explicit opt-in, we should *always* append the password + } + + // for explicit opt-in, we should *always* append the password // this can occur when the user clicks icon directly - in that instance we ignore // any internal state and just append the password to the outgoing data - - if (triggerMetaData.type === 'explicit-opt-in') { return suggestPassword(); - } // When the opt-in is 'implicit' though we only append the password if the user has not previously rejected it. + } + + // When the opt-in is 'implicit' though we only append the password if the user has not previously rejected it. // This helps the situation where the user has rejected a password for the username field, but then // taps into the confirm password field - - - if (triggerMetaData.type === 'implicit-opt-in' && _classPrivateFieldGet(this, _passwordStatus) !== 'rejected') { + if (triggerMetaData.type === 'implicit-opt-in' && this.#passwordStatus !== 'rejected') { return suggestPassword(); - } // if we get here there's nothing to do - + } + // if we get here there's nothing to do return outgoingData; } - } - exports.NativeUIController = NativeUIController; -},{"../../Form/matching.js":41,"../../InputTypes/Credentials.js":43,"../../deviceApiCalls/__generated__/deviceApiCalls.js":63,"./UIController.js":56}],55:[function(require,module,exports){ +},{"../../Form/matching.js":43,"../../InputTypes/Credentials.js":45,"../../deviceApiCalls/__generated__/deviceApiCalls.js":65,"./UIController.js":58}],57:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.OverlayUIController = void 0; - var _UIController = require("./UIController.js"); - var _matching = require("../../Form/matching.js"); - -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - -function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); } - -function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } } - -function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); } - -function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; } - -function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; } - -function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); } - -function _classApplyDescriptorSet(receiver, descriptor, value) { if (descriptor.set) { descriptor.set.call(receiver, value); } else { if (!descriptor.writable) { throw new TypeError("attempted to set read only private field"); } descriptor.value = value; } } - -var _state = /*#__PURE__*/new WeakMap(); - /** * @typedef {import('../../deviceApiCalls/__generated__/validators-ts').GetAutofillDataRequest} GetAutofillDataRequest * @typedef {import('../../deviceApiCalls/__generated__/validators-ts').TriggerContext} TriggerContext @@ -17051,49 +15547,44 @@ var _state = /*#__PURE__*/new WeakMap(); */ class OverlayUIController extends _UIController.UIController { /** @type {"idle" | "parentShown"} */ + #state = 'idle'; /** @type {import('../HTMLTooltip.js').HTMLTooltip | null} */ + _activeTooltip = null; /** * @type {OverlayControllerOptions} */ + _options; /** * @param {OverlayControllerOptions} options */ constructor(options) { super(); + this._options = options; - _classPrivateFieldInitSpec(this, _state, { - writable: true, - value: 'idle' - }); - - _defineProperty(this, "_activeTooltip", null); - - _defineProperty(this, "_options", void 0); - - this._options = options; // We always register this 'pointerdown' event, regardless of + // We always register this 'pointerdown' event, regardless of // whether we have a tooltip currently open or not. This is to ensure // we can clear out any existing state before opening a new one. - window.addEventListener('pointerdown', this, true); } + /** * @param {import('./UIController').AttachArgs} args */ - - attach(args) { const { getPosition, topContextData, click, input - } = args; // Do not attach the tooltip if the input is not in the DOM + } = args; - if (!input.parentNode) return; // If the input is removed from the DOM while the tooltip is attached, remove it + // Do not attach the tooltip if the input is not in the DOM + if (!input.parentNode) return; + // If the input is removed from the DOM while the tooltip is attached, remove it this._mutObs = new MutationObserver(mutationList => { for (const mutationRecord of mutationList) { mutationRecord.removedNodes.forEach(el => { @@ -17103,63 +15594,51 @@ class OverlayUIController extends _UIController.UIController { }); } }); - this._mutObs.observe(document.body, { childList: true, subtree: true }); + const position = getPosition(); - const position = getPosition(); // If the element is not in viewport, scroll there and recurse. 50ms is arbitrary - + // If the element is not in viewport, scroll there and recurse. 50ms is arbitrary if (!click && !this.elementIsInViewport(position)) { - var _this$_mutObs; - input.scrollIntoView(true); - (_this$_mutObs = this._mutObs) === null || _this$_mutObs === void 0 ? void 0 : _this$_mutObs.disconnect(); + this._mutObs?.disconnect(); setTimeout(() => { this.attach(args); }, 50); return; } - - _classPrivateFieldSet(this, _state, 'parentShown'); - + this.#state = 'parentShown'; this.showTopTooltip(click, position, topContextData).catch(e => { console.error('error from showTopTooltip', e); - - _classPrivateFieldSet(this, _state, 'idle'); + this.#state = 'idle'; }); } + /** * @param {{ x: number; y: number; height: number; width: number; }} inputDimensions * @returns {boolean} */ - - elementIsInViewport(inputDimensions) { if (inputDimensions.x < 0 || inputDimensions.y < 0 || inputDimensions.x + inputDimensions.width > document.documentElement.clientWidth || inputDimensions.y + inputDimensions.height > document.documentElement.clientHeight) { return false; } - const viewport = document.documentElement; - if (inputDimensions.x + inputDimensions.width > viewport.clientWidth || inputDimensions.y + inputDimensions.height > viewport.clientHeight) { return false; } - return true; } + /** * @param {{ x: number; y: number; } | null} click * @param {{ x: number; y: number; height: number; width: number; }} inputDimensions * @param {TopContextData} data */ - - async showTopTooltip(click, inputDimensions, data) { let diffX = inputDimensions.x; let diffY = inputDimensions.y; - if (click) { diffX -= click.x; diffY -= click.y; @@ -17167,20 +15646,16 @@ class OverlayUIController extends _UIController.UIController { // If the focus event is outside the viewport ignore, we've already tried to scroll to it return; } - if (!data.inputType) { throw new Error('No input type found'); } - const mainType = (0, _matching.getMainTypeFromType)(data.inputType); const subType = (0, _matching.getSubtypeFromType)(data.inputType); - if (mainType === 'unknown') { throw new Error('unreachable, should not be here if (mainType === "unknown")'); } - /** @type {GetAutofillDataRequest} */ - + /** @type {GetAutofillDataRequest} */ const details = { inputType: data.inputType, mainType, @@ -17194,32 +15669,25 @@ class OverlayUIController extends _UIController.UIController { inputWidth: Math.floor(inputDimensions.width) } }; - try { - _classPrivateFieldSet(this, _state, 'parentShown'); - + this.#state = 'parentShown'; this._attachListeners(); - await this._options.show(details); } catch (e) { console.error('could not show parent', e); - - _classPrivateFieldSet(this, _state, 'idle'); + this.#state = 'idle'; } } - _attachListeners() { window.addEventListener('scroll', this); window.addEventListener('keydown', this, true); window.addEventListener('input', this); } - _removeListeners() { window.removeEventListener('scroll', this); window.removeEventListener('keydown', this, true); window.removeEventListener('input', this); } - handleEvent(event) { switch (event.type) { case 'scroll': @@ -17227,7 +15695,6 @@ class OverlayUIController extends _UIController.UIController { this.removeTooltip(event.type); break; } - case 'keydown': { if (['Escape', 'Tab', 'Enter'].includes(event.code)) { @@ -17235,19 +15702,15 @@ class OverlayUIController extends _UIController.UIController { event.preventDefault(); event.stopImmediatePropagation(); } - this.removeTooltip(event.type); } - break; } - case 'input': { this.removeTooltip(event.type); break; } - case 'pointerdown': { this.removeTooltip(event.type); @@ -17255,51 +15718,40 @@ class OverlayUIController extends _UIController.UIController { } } } + /** * @param {string} trigger * @returns {Promise} */ - - async removeTooltip(trigger) { - var _this$_mutObs2; - // for none pointer events, check to see if the tooltip is open before trying to close it if (trigger !== 'pointerdown') { - if (_classPrivateFieldGet(this, _state) !== 'parentShown') { + if (this.#state !== 'parentShown') { return; } } - try { await this._options.remove(); } catch (e) { console.error('Could not close parent', e); } - - _classPrivateFieldSet(this, _state, 'idle'); - + this.#state = 'idle'; this._removeListeners(); - - (_this$_mutObs2 = this._mutObs) === null || _this$_mutObs2 === void 0 ? void 0 : _this$_mutObs2.disconnect(); + this._mutObs?.disconnect(); } - isActive() { - return _classPrivateFieldGet(this, _state) === 'parentShown'; + return this.#state === 'parentShown'; } - } - exports.OverlayUIController = OverlayUIController; -},{"../../Form/matching.js":41,"./UIController.js":56}],56:[function(require,module,exports){ +},{"../../Form/matching.js":43,"./UIController.js":58}],58:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.UIController = void 0; - /** * @typedef AttachArgs The argument required to 'attach' a tooltip * @property {import("../../Form/Form").Form} form the Form that triggered this 'attach' call @@ -17337,90 +15789,71 @@ class UIController { * @param {TopContextData} _topContextData * @returns {any | null} */ - - createTooltip(_pos, _topContextData) {} /** * @param {string} _via */ - - removeTooltip(_via) {} + /** * Set the currently open HTMLTooltip instance * * @param {import("../HTMLTooltip.js").HTMLTooltip} _tooltip */ - - setActiveTooltip(_tooltip) {} + /** * Get the currently open HTMLTooltip instance, if one exists * * @returns {import("../HTMLTooltip.js").HTMLTooltip | null} */ - - getActiveTooltip() { return null; } + /** * Indicate whether the controller deems itself 'active' * * @returns {boolean} */ - - isActive() { return false; } + /** * Updates the items in the tooltip based on new data. Currently only supporting credentials. * @param {CredentialsObject[]} _data */ - - updateItems(_data) {} - destroy() {} - } - exports.UIController = UIController; -},{}],57:[function(require,module,exports){ +},{}],59:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ddgPasswordIconFocused = exports.ddgPasswordIconFilled = exports.ddgPasswordIconBaseWhite = exports.ddgPasswordIconBase = exports.ddgIdentityIconBase = exports.ddgCcIconFilled = exports.ddgCcIconBase = void 0; -const ddgPasswordIconBase = 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iMjRweCIgaGVpZ2h0PSIyNHB4IiB2aWV3Qm94PSIwIDAgMjQgMjQiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8dGl0bGU+ZGRnLXBhc3N3b3JkLWljb24tYmFzZTwvdGl0bGU+CiAgICA8ZyBpZ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; -exports.ddgIdentityIconBase = ddgIdentityIconBase; - -},{}],58:[function(require,module,exports){ +const ddgPasswordIconBase = exports.ddgPasswordIconBase = 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iMjRweCIgaGVpZ2h0PSIyNHB4IiB2aWV3Qm94PSIwIDAgMjQgMjQiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8dGl0bGU+ZGRnLXBhc3N3b3JkLWljb24tYmFzZTwvdGl0bGU+CiAgICA8ZyBpZD0iZGRnLXBhc3N3b3JkLWljb24tYmFzZSIgc3Ryb2tlPSJub25lIiBzdHJva2Utd2lkdGg9IjEiIGZpbGw9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCI+CiAgICAgICAgPGcgaWQ9IlVuaW9uIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSg0LjAwMDAwMCwgNC4wMDAwMDApIiBmaWxsPSIjMDAwMDAwIj4KICAgICAgICAgICAgPHBhdGggZD0iTTExLjMzMzMsMi42NjY2NyBDMTAuMjI4OCwyLjY2NjY3IDkuMzMzMzMsMy41NjIxIDkuMzMzMzMsNC42NjY2NyBDOS4zMzMzMyw1Ljc3MTI0IDEwLjIyODgsNi42NjY2NyAxMS4zMzMzLDYuNjY2NjcgQzEyLjQzNzksNi42NjY2NyAxMy4zMzMzLDUuNzcxMjQgMTMuMzMzMyw0LjY2NjY3IEMxMy4zMzMzLDMuNTYyMSAxMi40Mzc5LDIuNjY2NjcgMTEuMzMzMywyLjY2NjY3IFogTTEwLjY2NjcsNC42NjY2NyBDMTAuNjY2Nyw0LjI5ODQ4IDEwLjk2NTEsNCAxMS4zMzMzLDQgQzExLjcwMTUsNCAxMiw0LjI5ODQ4IDEyLDQuNjY2N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YuMzMgNC4yNi45MTZ6TTEyIDIzYzYuMDc1IDAgMTEtNC45MjUgMTEtMTFTMTguMDc1IDEgMTIgMSAxIDUuOTI1IDEgMTJzNC45MjUgMTEgMTEgMTF6bTMtMTNjMCAxLjY1Ny0xLjM0MyAzLTMgM3MtMy0xLjM0My0zLTMgMS4zNDMtMyAzLTMgMyAxLjM0MyAzIDN6bTIgMGMwIDIuNzYxLTIuMjM5IDUtNSA1cy01LTIuMjM5LTUtNSAyLjIzOS01IDUtNSA1IDIuMjM5IDUgNXoiIGZpbGw9IiMwMDAiLz4KPC9zdmc+Cg==`; + +},{}],60:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.CSS_STYLES = void 0; -const CSS_STYLES = ":root {\n color-scheme: light dark;\n}\n\n.wrapper *, .wrapper *::before, .wrapper *::after {\n box-sizing: border-box;\n}\n.wrapper {\n position: fixed;\n top: 0;\n left: 0;\n padding: 0;\n font-family: 'DDG_ProximaNova', 'Proxima Nova', system-ui, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu',\n 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;\n -webkit-font-smoothing: antialiased;\n z-index: 2147483647;\n}\n.wrapper--data {\n font-family: 'SF Pro Text', system-ui, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu',\n 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;\n}\n:not(.top-autofill) .tooltip {\n position: absolute;\n width: 300px;\n max-width: calc(100vw - 25px);\n transform: translate(-1000px, -1000px);\n z-index: 2147483647;\n}\n.tooltip--data, #topAutofill {\n background-color: rgba(242, 240, 240, 1);\n -webkit-backdrop-filter: blur(40px);\n backdrop-filter: blur(40px);\n}\n@media (prefers-color-scheme: dark) {\n .tooltip--data, #topAutofill {\n background: rgb(100, 98, 102, .9);\n }\n}\n.tooltip--data {\n padding: 6px;\n font-size: 13px;\n line-height: 14px;\n width: 315px;\n max-height: 290px;\n overflow-y: auto;\n}\n.top-autofill .tooltip--data {\n min-height: 100vh;\n}\n.tooltip--data.tooltip--incontext-signup {\n width: 360px;\n}\n:not(.top-autofill) .tooltip--data {\n top: 100%;\n left: 100%;\n border: 0.5px solid rgba(255, 255, 255, 0.2);\n border-radius: 6px;\n box-shadow: 0 10px 20px rgba(0, 0, 0, 0.32);\n}\n@media (prefers-color-scheme: dark) {\n :not(.top-autofill) .tooltip--data {\n border: 1px solid rgba(255, 255, 255, 0.2);\n }\n}\n:not(.top-autofill) .tooltip--email {\n top: calc(100% + 6px);\n right: calc(100% - 48px);\n padding: 8px;\n border: 1px solid #D0D0D0;\n border-radius: 10px;\n background-color: #FFFFFF;\n font-size: 14px;\n line-height: 1.3;\n color: #333333;\n box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);\n}\n.tooltip--email__caret {\n position: absolute;\n transform: translate(-1000px, -1000px);\n z-index: 2147483647;\n}\n.tooltip--email__caret::before,\n.tooltip--email__caret::after {\n content: \"\";\n width: 0;\n height: 0;\n border-left: 10px solid transparent;\n border-right: 10px solid transparent;\n display: block;\n border-bottom: 8px solid #D0D0D0;\n position: absolute;\n right: -28px;\n}\n.tooltip--email__caret::before {\n border-bottom-color: #D0D0D0;\n top: -1px;\n}\n.tooltip--email__caret::after {\n border-bottom-color: #FFFFFF;\n top: 0px;\n}\n\n/* Buttons */\n.tooltip__button {\n display: flex;\n width: 100%;\n padding: 8px 8px 8px 0px;\n font-family: inherit;\n color: inherit;\n background: transparent;\n border: none;\n border-radius: 6px;\n}\n.tooltip__button.currentFocus,\n.wrapper:not(.top-autofill) .tooltip__button:hover {\n background-color: #3969EF;\n color: #FFFFFF;\n}\n\n/* Data autofill tooltip specific */\n.tooltip__button--data {\n position: relative;\n min-height: 48px;\n flex-direction: row;\n justify-content: flex-start;\n font-size: inherit;\n font-weight: 500;\n line-height: 16px;\n text-align: left;\n border-radius: 3px;\n}\n.tooltip--data__item-container {\n max-height: 220px;\n overflow: auto;\n}\n.tooltip__button--data:first-child {\n margin-top: 0;\n}\n.tooltip__button--data:last-child {\n margin-bottom: 0;\n}\n.tooltip__button--data::before {\n content: '';\n flex-shrink: 0;\n display: block;\n width: 32px;\n height: 32px;\n margin: 0 8px;\n background-size: 20px 20px;\n background-repeat: no-repeat;\n background-position: center 6px;\n}\n#provider_locked::after {\n position: absolute;\n content: '';\n flex-shrink: 0;\n display: block;\n width: 32px;\n height: 32px;\n margin: 0 8px;\n background-size: 11px 13px;\n background-repeat: no-repeat;\n background-position: right bottom;\n}\n.tooltip__button--data.currentFocus:not(.tooltip__button--data--bitwarden)::before,\n.wrapper:not(.top-autofill) .tooltip__button--data:not(.tooltip__button--data--bitwarden):hover::before {\n filter: invert(100%);\n}\n@media (prefers-color-scheme: dark) {\n .tooltip__button--data:not(.tooltip__button--data--bitwarden)::before,\n .tooltip__button--data:not(.tooltip__button--data--bitwarden)::before {\n filter: invert(100%);\n opacity: .9;\n }\n}\n.tooltip__button__text-container {\n margin: auto 0;\n}\n.label {\n display: block;\n font-weight: 400;\n letter-spacing: -0.25px;\n color: rgba(0,0,0,.8);\n font-size: 13px;\n line-height: 1;\n}\n.label + .label {\n margin-top: 2px;\n}\n.label.label--medium {\n font-weight: 500;\n letter-spacing: -0.25px;\n color: rgba(0,0,0,.9);\n}\n.label.label--small {\n font-size: 11px;\n font-weight: 400;\n letter-spacing: 0.06px;\n color: rgba(0,0,0,0.6);\n}\n@media (prefers-color-scheme: dark) {\n .tooltip--data .label {\n color: #ffffff;\n }\n .tooltip--data .label--medium {\n color: #ffffff;\n }\n .tooltip--data .label--small {\n color: #cdcdcd;\n }\n}\n.tooltip__button.currentFocus .label,\n.wrapper:not(.top-autofill) .tooltip__button:hover .label {\n color: #FFFFFF;\n}\n\n.tooltip__button--manage {\n font-size: 13px;\n padding: 5px 9px;\n border-radius: 3px;\n margin: 0;\n}\n\n/* Icons */\n.tooltip__button--data--credentials::before {\n background-image: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD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0OC0xLTF6bTEtM2MtMS42NTcgMC0zIDEuMzQzLTMgM3MxLjM0MyAzIDMgMyAzLTEuMzQzIDMtMy0xLjM0My0zLTMtM3oiIGZpbGw9IiMwMDAiIGZpbGwtb3BhY2l0eT0iLjkiLz4KPC9zdmc+');\n}\n.tooltip__button--data--creditCards::before {\n background-image: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgZmlsbD0ibm9uZSI+CiAgICA8cGF0aCBkPSJNNSA5Yy0uNTUyIDAtMSAuNDQ4LTEgMXYyYzAgLjU1Mi40NDggMSAxIDFoM2MuNTUyIDAgMS0uNDQ4IDEtMXYtMmMwLS41NTItLjQ0OC0xLTEtMUg1eiIgZmlsbD0iIzAwMCIvPgogICAgPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xIDZjMC0yLjIxIDEuNzktNCA0LTRoMTRjMi4yMSAwIDQgMS43OSA0IDR2MTJjMCAyLjIxLTEuNzkgNC00IDRINWMtMi4yMSAwLTQtMS43OS00LTRWNnptNC0yYy0xLjEwNSAwLTIgLjg5NS0yIDJ2OWgxOFY2YzAtMS4xMDUtLjg5NS0yLTItMkg1em0wIDE2Yy0xLjEwNSAwLTItLjg5NS0yLTJoMThjMCAxLjEwNS0uODk1IDItMiAySDV6IiBmaWxsPSIjMDAwIi8+Cjwvc3ZnPgo=');\n}\n.tooltip__button--data--identities::before {\n background-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgZmlsbD0ibm9uZSI+CiAgICA8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTEyIDIxYzIuMTQzIDAgNC4xMTEtLjc1IDUuNjU3LTItLjYyNi0uNTA2LTEuMzE4LS45MjctMi4wNi0xLjI1LTEuMS0uNDgtMi4yODUtLjczNS0zLjQ4Ni0uNzUtMS4yLS4wMTQtMi4zOTIuMjExLTMuNTA0LjY2NC0uODE3LjMzMy0xLjU4Ljc4My0yLjI2NCAxLjMzNiAxLjU0NiAxLjI1IDMuNTE0IDIgNS42NTcgMnptNC4zOTctNS4wODNjLjk2Ny40MjIgMS44NjYuOTggMi42NzIgMS42NTVDMjAuMjc5IDE2LjAzOSAyMSAxNC4xMDQgMjEgMTJjMC00Ljk3LTQuMDMtOS05LTlzLTkgNC4wMy05IDljMCAyLjEwNC43MjIgNC4wNCAxLjkzMiA1LjU3Mi44NzQtLjczNCAxLjg2LTEuMzI4IDIuOTIxLTEuNzYgMS4zNi0uNTU0IDIuODE2LS44MyA0LjI4My0uODExIDEuNDY3LjAxOCAyLjkxNi4zMyA0LjI2LjkxNnpNMTIgMjNjNi4wNzUgMCAxMS00LjkyNSAxMS0xMVMxOC4wNzUgMSAxMiAxIDEgNS45MjUgMSAxMnM0LjkyNSAxMSAxMSAxMXptMy0xM2MwIDEuNjU3LTEuMzQzIDMtMyAzcy0zLTEuMzQzLTMtMyAxLjM0My0zIDMtMyAzIDEuMzQzIDMgM3ptMiAwYzAgMi43NjEtMi4yMzkgNS01IDVzLTUtMi4yMzktNS01IDIuMjM5LTUgNS01IDUgMi4yMzkgNSA1eiIgZmlsbD0iIzAwMCIvPgo8L3N2Zz4=');\n}\n.tooltip__button--data--credentials.tooltip__button--data--bitwarden::before {\n background-image: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHJlY3Qgd2lkdGg9Ij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Ug0Ljg3NVY1LjE5MTNDNC44NzU5NiA1LjEwNzc0IDQuOTA5NTggNS4wMjc4MyA0Ljk2ODcgNC45Njg3WiIgZmlsbD0iIzIyMjIyMiIgc3Ryb2tlPSJ3aGl0ZSIgc3Ryb2tlLXdpZHRoPSIyIi8+Cjwvc3ZnPgo=');\n}\n\nhr {\n display: block;\n margin: 5px 9px;\n border: none; /* reset the border */\n border-top: 1px solid rgba(0,0,0,.1);\n}\n\nhr:first-child {\n display: none;\n}\n\n@media (prefers-color-scheme: dark) {\n hr {\n border-top: 1px solid rgba(255,255,255,.2);\n }\n}\n\n#privateAddress {\n align-items: flex-start;\n}\n#personalAddress::before,\n#privateAddress::before,\n#incontextSignup::before,\n#personalAddress.currentFocus::before,\n#personalAddress:hover::before,\n#privateAddress.currentFocus::before,\n#privateAddress:hover::before {\n filter: none;\n /* This is the same icon as `daxBase64` in `src/Form/logo-svg.js` */\n background-image: url('data:image/svg+xml;base64,PHN2ZyBmaWxsPSJub25lIiB2aWV3Qm94PSIwIDAgMTI4IDEyOCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICAgIDxwYXRoIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0ibTY0IDEyOGMzNS4zNDYgMCA2NC0yOC42NTQgNjQtNjRzLTI4LjY1NC02NC02NC02NC02NCAyOC42NTQtNjQgNjQgMjguNjU0IDY0IDY0IDY0eiIgZmlsbD0iI2RlNTgzMyIgZmlsbC1ydWxlPSJldmVub2RkIi8+CiAgICA8cGF0aCBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Im03MyAxMTEuNzVjMC0uNS4xMjMtLjYxNC0xLjQ2Ni0zLjc4Mi00LjIyNC04LjQ1OS04LjQ3LTIwLjM4NC02LjU0LTI4LjA3NS4zNTMtMS4zOTctMy45NzgtNTEuNzQ0LTcuMDQtNTMuMzY1LTMuNDAyLTEuODEzLTcuNTg4LTQuNjktMTEuNDE4LTUuMzMtMS45ND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45LS44OTV6bS0yNS40NjQgMy41NDJhNC4wNDIgNC4wNDIgMCAwIDEgLTQuMDQ5IDQuMDM3IDQuMDQ1IDQuMDQ1IDAgMCAxIC00LjA1LTQuMDM3IDQuMDQ1IDQuMDQ1IDAgMCAxIDQuMDUtNC4wMzcgNC4wNDUgNC4wNDUgMCAwIDEgNC4wNSA0LjAzN3ptLTEuMTkzLTEuMzM4YTEuMDUgMS4wNSAwIDAgMCAtMi4wOTcgMCAxLjA0OCAxLjA0OCAwIDAgMCAyLjA5NyAweiIgZmlsbC1ydWxlPSJldmVub2RkIi8+CiAgICA8L2c+CiAgICA8cGF0aCBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Im02NCAxMTcuNzVjMjkuNjg1IDAgNTMuNzUtMjQuMDY1IDUzLjc1LTUzLjc1cy0yNC4wNjUtNTMuNzUtNTMuNzUtNTMuNzUtNTMuNzUgMjQuMDY1LTUzLjc1IDUzLjc1IDI0LjA2NSA1My43NSA1My43NSA1My43NXptMCA1YzMyLjQ0NyAwIDU4Ljc1LTI2LjMwMyA1OC43NS01OC43NXMtMjYuMzAzLTU4Ljc1LTU4Ljc1LTU4Ljc1LTU4Ljc1IDI2LjMwMy01OC43NSA1OC43NSAyNi4zMDMgNTguNzUgNTguNzUgNTguNzV6IiBmaWxsPSIjZmZmIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiLz4KPC9zdmc+');\n}\n\n/* Email tooltip specific */\n.tooltip__button--email {\n flex-direction: column;\n justify-content: center;\n align-items: flex-start;\n font-size: 14px;\n padding: 4px 8px;\n}\n.tooltip__button--email__primary-text {\n font-weight: bold;\n}\n.tooltip__button--email__secondary-text {\n font-size: 12px;\n}\n\n/* Email Protection signup notice */\n:not(.top-autofill) .tooltip--email-signup {\n text-align: left;\n color: #222222;\n padding: 16px 20px;\n width: 380px;\n}\n\n.tooltip--email-signup h1 {\n font-weight: 700;\n font-size: 16px;\n line-height: 1.5;\n margin: 0;\n}\n\n.tooltip--email-signup p {\n font-weight: 400;\n font-size: 14px;\n line-height: 1.4;\n}\n\n.notice-controls {\n display: flex;\n}\n\n.tooltip--email-signup .notice-controls > * {\n border-radius: 8px;\n border: 0;\n cursor: pointer;\n display: inline-block;\n font-family: inherit;\n font-style: normal;\n font-weight: bold;\n padding: 8px 12px;\n text-decoration: none;\n}\n\n.notice-controls .ghost {\n margin-left: 1rem;\n}\n\n.tooltip--email-signup a.primary {\n background: #3969EF;\n color: #fff;\n}\n\n.tooltip--email-signup a.primary:hover,\n.tooltip--email-signup a.primary:focus {\n background: #2b55ca;\n}\n\n.tooltip--email-signup a.primary:active {\n background: #1e42a4;\n}\n\n.tooltip--email-signup button.ghost {\n background: transparent;\n color: #3969EF;\n}\n\n.tooltip--email-signup button.ghost:hover,\n.tooltip--email-signup button.ghost:focus {\n background-color: rgba(0, 0, 0, 0.06);\n color: #2b55ca;\n}\n\n.tooltip--email-signup button.ghost:active {\n background-color: rgba(0, 0, 0, 0.12);\n color: #1e42a4;\n}\n\n.tooltip--email-signup button.close-tooltip {\n background-color: transparent;\n background-image: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iMTMiIHZpZXdCb3g9IjAgMCAxMiAxMyIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0wLjI5Mjg5NCAwLjY1NjkwN0MwLjY4MzQxOCAwLjI2NjM4MyAxLjMxNjU4IDAuMjY2MzgzIDEuNzA3MTEgMC42NTY5MDdMNiA0Ljk0OThMMTAuMjkyOSAwLjY1NjkwN0MxMC42ODM0IDAuMjY2MzgzIDExLjMxNjYgMC4yNjYzODMgMTEuNzA3MSAwLjY1NjkwN0MxMi4wOTc2IDEuMDQ3NDMgMTIuMDk3NiAxLjY4MDYgMTEuNzA3MSAyLjA3MTEyTDcuNDE0MjEgNi4zNjQwMUwxMS43MDcxIDEwLjY1NjlDMTIuMDk3NiAxMS4wNDc0IDEyLjA5NzYgMTEuNjgwNiAxMS43MDcxIDEyLjA3MTFDMTEuMzE2NiAxMi40NjE2IDEwLjY4MzQgMTIuNDYxNiAxMC4yOTI5IDEyLjA3MTFMNiA3Ljc3ODIzTDEuNzA3MTEgMTIuMDcxMUMxLjMxNjU4IDEyLjQ2MTYgMC42ODM0MTcgMTIuNDYxNiAwLjI5Mjg5MyAxMi4wNzExQy0wLjA5NzYzMTEgMTEuNjgwNiAtMC4wOTc2MzExIDExLjA0NzQgMC4yOTI4OTMgMTAuNjU2OUw0LjU4NTc5IDYuMzY0MDFMMC4yOTI4OTQgMi4wNzExMkMtMC4wOTc2MzA2IDEuNjgwNiAtMC4wOTc2MzA2IDEuMDQ3NDMgMC4yOTI4OTQgMC42NTY5MDdaIiBmaWxsPSJibGFjayIgZmlsbC1vcGFjaXR5PSIwLjg0Ii8+Cjwvc3ZnPgo=);\n background-position: center center;\n background-repeat: no-repeat;\n border: 0;\n cursor: pointer;\n padding: 16px;\n position: absolute;\n right: 12px;\n top: 12px;\n}\n"; -exports.CSS_STYLES = CSS_STYLES; +const CSS_STYLES = exports.CSS_STYLES = ":root {\n color-scheme: light dark;\n}\n\n.wrapper *, .wrapper *::before, .wrapper *::after {\n box-sizing: border-box;\n}\n.wrapper {\n position: fixed;\n top: 0;\n left: 0;\n padding: 0;\n font-family: 'DDG_ProximaNova', 'Proxima Nova', system-ui, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu',\n 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;\n -webkit-font-smoothing: antialiased;\n z-index: 2147483647;\n}\n.wrapper--data {\n font-family: 'SF Pro Text', system-ui, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu',\n 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;\n}\n:not(.top-autofill) .tooltip {\n position: absolute;\n width: 300px;\n max-width: calc(100vw - 25px);\n transform: translate(-1000px, -1000px);\n z-index: 2147483647;\n}\n.tooltip--data, #topAutofill {\n background-color: rgba(242, 240, 240, 1);\n -webkit-backdrop-filter: blur(40px);\n backdrop-filter: blur(40px);\n}\n@media (prefers-color-scheme: dark) {\n .tooltip--data, #topAutofill {\n background: rgb(100, 98, 102, .9);\n }\n}\n.tooltip--data {\n padding: 6px;\n font-size: 13px;\n line-height: 14px;\n width: 315px;\n max-height: 290px;\n overflow-y: auto;\n}\n.top-autofill .tooltip--data {\n min-height: 100vh;\n}\n.tooltip--data.tooltip--incontext-signup {\n width: 360px;\n}\n:not(.top-autofill) .tooltip--data {\n top: 100%;\n left: 100%;\n border: 0.5px solid rgba(255, 255, 255, 0.2);\n border-radius: 6px;\n box-shadow: 0 10px 20px rgba(0, 0, 0, 0.32);\n}\n@media (prefers-color-scheme: dark) {\n :not(.top-autofill) .tooltip--data {\n border: 1px solid rgba(255, 255, 255, 0.2);\n }\n}\n:not(.top-autofill) .tooltip--email {\n top: calc(100% + 6px);\n right: calc(100% - 48px);\n padding: 8px;\n border: 1px solid #D0D0D0;\n border-radius: 10px;\n background-color: #FFFFFF;\n font-size: 14px;\n line-height: 1.3;\n color: #333333;\n box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);\n}\n.tooltip--email__caret {\n position: absolute;\n transform: translate(-1000px, -1000px);\n z-index: 2147483647;\n}\n.tooltip--email__caret::before,\n.tooltip--email__caret::after {\n content: \"\";\n width: 0;\n height: 0;\n border-left: 10px solid transparent;\n border-right: 10px solid transparent;\n display: block;\n border-bottom: 8px solid #D0D0D0;\n position: absolute;\n right: -28px;\n}\n.tooltip--email__caret::before {\n border-bottom-color: #D0D0D0;\n top: -1px;\n}\n.tooltip--email__caret::after {\n border-bottom-color: #FFFFFF;\n top: 0px;\n}\n\n/* Buttons */\n.tooltip__button {\n display: flex;\n width: 100%;\n padding: 8px 8px 8px 0px;\n font-family: inherit;\n color: inherit;\n background: transparent;\n border: none;\n border-radius: 6px;\n}\n.tooltip__button.currentFocus,\n.wrapper:not(.top-autofill) .tooltip__button:hover {\n background-color: #3969EF;\n color: #FFFFFF;\n}\n\n/* Data autofill tooltip specific */\n.tooltip__button--data {\n position: relative;\n min-height: 48px;\n flex-direction: row;\n justify-content: flex-start;\n font-size: inherit;\n font-weight: 500;\n line-height: 16px;\n text-align: left;\n border-radius: 3px;\n}\n.tooltip--data__item-container {\n max-height: 220px;\n overflow: auto;\n}\n.tooltip__button--data:first-child {\n margin-top: 0;\n}\n.tooltip__button--data:last-child {\n margin-bottom: 0;\n}\n.tooltip__button--data::before {\n content: '';\n flex-shrink: 0;\n display: block;\n width: 32px;\n height: 32px;\n margin: 0 8px;\n background-size: 20px 20px;\n background-repeat: no-repeat;\n background-position: center 6px;\n}\n#provider_locked::after {\n position: absolute;\n content: '';\n flex-shrink: 0;\n display: block;\n width: 32px;\n height: 32px;\n margin: 0 8px;\n background-size: 11px 13px;\n background-repeat: no-repeat;\n background-position: right bottom;\n}\n.tooltip__button--data.currentFocus:not(.tooltip__button--data--bitwarden)::before,\n.wrapper:not(.top-autofill) .tooltip__button--data:not(.tooltip__button--data--bitwarden):hover::before {\n filter: invert(100%);\n}\n@media (prefers-color-scheme: dark) {\n .tooltip__button--data:not(.tooltip__button--data--bitwarden)::before,\n .tooltip__button--data:not(.tooltip__button--data--bitwarden)::before {\n filter: invert(100%);\n opacity: .9;\n }\n}\n.tooltip__button__text-container {\n margin: auto 0;\n}\n.label {\n display: block;\n font-weight: 400;\n letter-spacing: -0.25px;\n color: rgba(0,0,0,.8);\n font-size: 13px;\n line-height: 1;\n}\n.label + .label {\n margin-top: 2px;\n}\n.label.label--medium {\n font-weight: 500;\n letter-spacing: -0.25px;\n color: rgba(0,0,0,.9);\n}\n.label.label--small {\n font-size: 11px;\n font-weight: 400;\n letter-spacing: 0.06px;\n color: rgba(0,0,0,0.6);\n}\n@media (prefers-color-scheme: dark) {\n .tooltip--data .label {\n color: #ffffff;\n }\n .tooltip--data .label--medium {\n color: #ffffff;\n }\n .tooltip--data .label--small {\n color: #cdcdcd;\n }\n}\n.tooltip__button.currentFocus .label,\n.wrapper:not(.top-autofill) .tooltip__button:hover .label {\n color: #FFFFFF;\n}\n\n.tooltip__button--manage {\n font-size: 13px;\n padding: 5px 9px;\n border-radius: 3px;\n margin: 0;\n}\n\n/* Icons */\n.tooltip__button--data--credentials::before {\n background-image: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik05LjYzNiA4LjY4MkM5LjYzNiA1LjU0NCAxMi4xOCAzIDE1LjMxOCAzIDE4LjQ1NiAzIDIxIDUuNTQ0IDIxIDguNjgyYzAgMy4xMzgtMi41NDQgNS42ODItNS42ODIgNS42ODItLjY5MiAwLTEuMzUzLS4xMjQtMS45NjQtLjM0OS0uMzcyLS4xMzctLjc5LS4wNDEtMS4wNjYuMjQ1bC0uNzEzLjc0SDEwYy0uNTUyIDAtMSAuNDQ4LTEgMXYySDdjLS41NTIgMC0xIC40NDgtMSAxdjJIM3YtMi44ODFsNi42NjgtNi42NjhjLjI2NS0uMjY2LjM2LS42NTguMjQ0LTEuMDE1LS4xNzktLjU1MS0uMjc2LTEuMTQtLjI3Ni0xLjc1NHpNMTUuMzE4IDFjLTQuMjQyIDAtNy42ODIgMy40NC03LjY4MiA3LjY4MiAwIC42MDcuMDcxIDEuMi4yMDUgMS43NjdsLTYuNTQ4IDYuNTQ4Yy0uMTg4LjE4OC0uMjkzLjQ0Mi0uMjkzLjcwOFYyMmMwIC4yNjUuMTA1LjUyLjI5My43MDcuMTg3LjE4OC40NDIuMjkzLjcwNy4yOTNoNGMxLjEwNSAwIDItLjg5NSAyLTJ2LTFoM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iA2LjczMzM1IDEuMDAwODUgNy4xNjEzMSAxIDcuNjAwNTdaTTQuOTY4NyA0Ljk2ODdDNS4wMjY5NCA0LjkxMDQ3IDUuMTA1MzIgNC44NzY5OSA1LjE4NzUgNC44NzUwN0M1LjI2OTY4IDQuODc2OTkgNS4zNDgwNiA0LjkxMDQ3IDUuNDA2MyA0Ljk2ODdDNS40NjU0MiA1LjAyNzgzIDUuNDk5MDQgNS4xMDc3NCA1LjUgNS4xOTEzVjUuNUg0Ljg3NVY1LjE5MTNDNC44NzU5NiA1LjEwNzc0IDQuOTA5NTggNS4wMjc4MyA0Ljk2ODcgNC45Njg3WiIgZmlsbD0iIzIyMjIyMiIgc3Ryb2tlPSJ3aGl0ZSIgc3Ryb2tlLXdpZHRoPSIyIi8+Cjwvc3ZnPgo=');\n}\n\nhr {\n display: block;\n margin: 5px 9px;\n border: none; /* reset the border */\n border-top: 1px solid rgba(0,0,0,.1);\n}\n\nhr:first-child {\n display: none;\n}\n\n@media (prefers-color-scheme: dark) {\n hr {\n border-top: 1px solid rgba(255,255,255,.2);\n }\n}\n\n#privateAddress {\n align-items: flex-start;\n}\n#personalAddress::before,\n#privateAddress::before,\n#incontextSignup::before,\n#personalAddress.currentFocus::before,\n#personalAddress:hover::before,\n#privateAddress.currentFocus::before,\n#privateAddress:hover::before {\n filter: none;\n /* This is the same icon as `daxBase64` in `src/Form/logo-svg.js` */\n background-image: url('data:image/svg+xml;base64,PHN2ZyBmaWxsPSJub25lIiB2aWV3Qm94PSIwIDAgMTI4IDEyOCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICAgIDxwYXRoIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0ibTY0IDEyOGMzNS4zNDYgMCA2NC0yOC42NTQgNjQtNjRzLTI4LjY1NC02NC02NC02NC02NCAyOC42NTQtNjQgNjQgMjguNjU0IDY0IDY0IDY0eiIgZmlsbD0iI2RlNTgzMyIgZmlsbC1ydWxlPSJld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n align-items: flex-start;\n font-size: 14px;\n padding: 4px 8px;\n}\n.tooltip__button--email__primary-text {\n font-weight: bold;\n}\n.tooltip__button--email__secondary-text {\n font-size: 12px;\n}\n\n/* Email Protection signup notice */\n:not(.top-autofill) .tooltip--email-signup {\n text-align: left;\n color: #222222;\n padding: 16px 20px;\n width: 380px;\n}\n\n.tooltip--email-signup h1 {\n font-weight: 700;\n font-size: 16px;\n line-height: 1.5;\n margin: 0;\n}\n\n.tooltip--email-signup p {\n font-weight: 400;\n font-size: 14px;\n line-height: 1.4;\n}\n\n.notice-controls {\n display: flex;\n}\n\n.tooltip--email-signup .notice-controls > * {\n border-radius: 8px;\n border: 0;\n cursor: pointer;\n display: inline-block;\n font-family: inherit;\n font-style: normal;\n font-weight: bold;\n padding: 8px 12px;\n text-decoration: none;\n}\n\n.notice-controls .ghost {\n margin-left: 1rem;\n}\n\n.tooltip--email-signup a.primary {\n background: #3969EF;\n color: #fff;\n}\n\n.tooltip--email-signup a.primary:hover,\n.tooltip--email-signup a.primary:focus {\n background: #2b55ca;\n}\n\n.tooltip--email-signup a.primary:active {\n background: #1e42a4;\n}\n\n.tooltip--email-signup button.ghost {\n background: transparent;\n color: #3969EF;\n}\n\n.tooltip--email-signup button.ghost:hover,\n.tooltip--email-signup button.ghost:focus {\n background-color: rgba(0, 0, 0, 0.06);\n color: #2b55ca;\n}\n\n.tooltip--email-signup button.ghost:active {\n background-color: rgba(0, 0, 0, 0.12);\n color: #1e42a4;\n}\n\n.tooltip--email-signup button.close-tooltip {\n background-color: transparent;\n background-image: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iMTMiIHZpZXdCb3g9IjAgMCAxMiAxMyIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0wLjI5Mjg5NCAwLjY1NjkwN0MwLjY4MzQxOCAwLjI2NjM4MyAxLjMxNjU4IDAuMjY2MzgzIDEuNzA3MTEgMC42NTY5MDdMNiA0Ljk0OThMMTAuMjkyOSAwLjY1NjkwN0MxMC42ODM0IDAuMjY2MzgzIDExLjMxNjYgMC4yNjYzODMgMTEuNzA3MSAwLjY1NjkwN0MxMi4wOTc2IDEuMDQ3NDMgMTIuMDk3NiAxLjY4MDYgMTEuNzA3MSAyLjA3MTEyTDcuNDE0MjEgNi4zNjQwMUwxMS43MDcxIDEwLjY1NjlDMTIuMDk3NiAxMS4wNDc0IDEyLjA5NzYgMTEuNjgwNiAxMS43MDcxIDEyLjA3MTFDMTEuMzE2NiAxMi40NjE2IDEwLjY4MzQgMTIuNDYxNiAxMC4yOTI5IDEyLjA3MTFMNiA3Ljc3ODIzTDEuNzA3MTEgMTIuMDcxMUMxLjMxNjU4IDEyLjQ2MTYgMC42ODM0MTcgMTIuNDYxNiAwLjI5Mjg5MyAxMi4wNzExQy0wLjA5NzYzMTEgMTEuNjgwNiAtMC4wOTc2MzExIDExLjA0NzQgMC4yOTI4OTMgMTAuNjU2OUw0LjU4NTc5IDYuMzY0MDFMMC4yOTI4OTQgMi4wNzExMkMtMC4wOTc2MzA2IDEuNjgwNiAtMC4wOTc2MzA2IDEuMDQ3NDMgMC4yOTI4OTQgMC42NTY5MDdaIiBmaWxsPSJibGFjayIgZmlsbC1vcGFjaXR5PSIwLjg0Ii8+Cjwvc3ZnPgo=);\n background-position: center center;\n background-repeat: no-repeat;\n border: 0;\n cursor: pointer;\n padding: 16px;\n position: absolute;\n right: 12px;\n top: 12px;\n}\n"; -},{}],59:[function(require,module,exports){ +},{}],61:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { @@ -17441,15 +15874,12 @@ exports.shouldLogPerformance = shouldLogPerformance; exports.truncateFromMiddle = truncateFromMiddle; exports.wasAutofilledByChrome = void 0; exports.whenIdle = whenIdle; - var _matching = require("./Form/matching.js"); - -const SIGN_IN_MSG = { +const SIGN_IN_MSG = exports.SIGN_IN_MSG = { signMeIn: true -}; // Send a message to the web app (only on DDG domains) - -exports.SIGN_IN_MSG = SIGN_IN_MSG; +}; +// Send a message to the web app (only on DDG domains) const notifyWebApp = message => { window.postMessage(message, window.origin); }; @@ -17459,17 +15889,13 @@ const notifyWebApp = message => { * @param {String} expectedResponse - the name of the response * @returns {Promise<*>} */ - - exports.notifyWebApp = notifyWebApp; - const sendAndWaitForAnswer = (msgOrFn, expectedResponse) => { if (typeof msgOrFn === 'function') { msgOrFn(); } else { window.postMessage(msgOrFn, window.origin); } - return new Promise(resolve => { const handler = e => { if (e.origin !== window.origin) return; @@ -17477,71 +15903,59 @@ const sendAndWaitForAnswer = (msgOrFn, expectedResponse) => { resolve(e.data); window.removeEventListener('message', handler); }; - window.addEventListener('message', handler); }); }; + /** * @param {Pick} globalConfig * @param [processConfig] * @return {boolean} */ - - exports.sendAndWaitForAnswer = sendAndWaitForAnswer; - const autofillEnabled = (globalConfig, processConfig) => { if (!globalConfig.contentScope) { // Return enabled for platforms that haven't implemented the config yet return true; } - const { contentScope, userUnprotectedDomains, userPreferences - } = globalConfig; // Check config on Apple platforms + } = globalConfig; + // Check config on Apple platforms const processedConfig = processConfig(contentScope, userUnprotectedDomains, userPreferences); return isAutofillEnabledFromProcessedConfig(processedConfig); }; - exports.autofillEnabled = autofillEnabled; - const isAutofillEnabledFromProcessedConfig = processedConfig => { const site = processedConfig.site; - if (site.isBroken || !site.enabledFeatures.includes('autofill')) { if (shouldLog()) { console.log('⚠️ Autofill disabled by remote config'); } - return false; } - return true; }; - exports.isAutofillEnabledFromProcessedConfig = isAutofillEnabledFromProcessedConfig; - const isIncontextSignupEnabledFromProcessedConfig = processedConfig => { const site = processedConfig.site; - if (site.isBroken || !site.enabledFeatures.includes('incontextSignup')) { if (shouldLog()) { console.log('⚠️ In-context signup disabled by remote config'); } - return false; } - return true; -}; // Access the original setter (needed to bypass React's implementation on mobile) -// @ts-ignore - +}; +// Access the original setter (needed to bypass React's implementation on mobile) +// @ts-ignore exports.isIncontextSignupEnabledFromProcessedConfig = isIncontextSignupEnabledFromProcessedConfig; const originalSet = Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype, 'value').set; + /** * Ensures the value is set properly and dispatches events to simulate real user action * @param {HTMLInputElement} el @@ -17549,39 +15963,38 @@ const originalSet = Object.getOwnPropertyDescriptor(window.HTMLInputElement.prot * @param {GlobalConfig} [config] * @return {boolean} */ - const setValueForInput = (el, val, config) => { // Avoid keyboard flashing on Android - if (!(config !== null && config !== void 0 && config.isAndroid)) { + if (!config?.isAndroid) { el.focus(); - } // todo(Shane): Not sending a 'key' property on these events can cause exceptions on 3rd party listeners that expect it - + } + // todo(Shane): Not sending a 'key' property on these events can cause exceptions on 3rd party listeners that expect it el.dispatchEvent(new Event('keydown', { bubbles: true })); - originalSet === null || originalSet === void 0 ? void 0 : originalSet.call(el, val); + originalSet?.call(el, val); const events = [new Event('input', { bubbles: true - }), // todo(Shane): Not sending a 'key' property on these events can cause exceptions on 3rd party listeners that expect it + }), + // todo(Shane): Not sending a 'key' property on these events can cause exceptions on 3rd party listeners that expect it new Event('keyup', { bubbles: true }), new Event('change', { bubbles: true })]; - events.forEach(ev => el.dispatchEvent(ev)); // We call this again to make sure all forms are happy - - originalSet === null || originalSet === void 0 ? void 0 : originalSet.call(el, val); + events.forEach(ev => el.dispatchEvent(ev)); + // We call this again to make sure all forms are happy + originalSet?.call(el, val); events.forEach(ev => el.dispatchEvent(ev)); el.blur(); return true; }; + /** * Fires events on a select element to simulate user interaction * @param {HTMLSelectElement} el */ - - const fireEventsOnSelect = el => { /** @type {Event[]} */ const events = [new Event('mousedown', { @@ -17592,12 +16005,14 @@ const fireEventsOnSelect = el => { bubbles: true }), new Event('change', { bubbles: true - })]; // Events fire on the select el, not option + })]; + // Events fire on the select el, not option events.forEach(ev => el.dispatchEvent(ev)); events.forEach(ev => el.dispatchEvent(ev)); el.blur(); }; + /** * Selects an option of a select element * We assume Select is only used for dates, i.e. in the credit card @@ -17605,25 +16020,22 @@ const fireEventsOnSelect = el => { * @param {string} val * @return {boolean} */ - - const setValueForSelect = (el, val) => { const subtype = (0, _matching.getInputSubtype)(el); const isMonth = subtype.includes('Month'); const isZeroBasedNumber = isMonth && el.options[0].value === '0' && el.options.length === 12; const stringVal = String(val); - const numberVal = Number(val); // Loop first through all values because they tend to be more precise + const numberVal = Number(val); + // Loop first through all values because they tend to be more precise for (const option of el.options) { // If values for months are zero-based (Jan === 0), add one to match our data type let value = option.value; - if (isZeroBasedNumber) { - value = "".concat(Number(value) + 1); - } // TODO: try to match localised month names + value = `${Number(value) + 1}`; + } + // TODO: try to match localised month names // TODO: implement alternative versions of values (abbreviations for States/Provinces or variations like USA, US, United States, etc.) - - if (value === stringVal || Number(value) === numberVal) { if (option.selected) return false; option.selected = true; @@ -17631,7 +16043,6 @@ const setValueForSelect = (el, val) => { return true; } } - for (const option of el.options) { if (option.innerText === stringVal || Number(option.innerText) === numberVal) { if (option.selected) return false; @@ -17639,11 +16050,11 @@ const setValueForSelect = (el, val) => { fireEventsOnSelect(el); return true; } - } // If we didn't find a matching option return false - - + } + // If we didn't find a matching option return false return false; }; + /** * Sets or selects a value to a form element * @param {HTMLInputElement | HTMLSelectElement} el @@ -17651,24 +16062,19 @@ const setValueForSelect = (el, val) => { * @param {GlobalConfig} [config] * @return {boolean} */ - - const setValue = (el, val, config) => { if (el instanceof HTMLInputElement) return setValueForInput(el, val, config); if (el instanceof HTMLSelectElement) return setValueForSelect(el, val); return false; }; + /** * Use IntersectionObserver v2 to make sure the element is visible when clicked * https://developers.google.com/web/updates/2019/02/intersectionobserver-v2 */ - - exports.setValue = setValue; - const safeExecute = function (el, fn) { let _opts = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; - // TODO: temporary fix to misterious bug in Chrome // const {checkVisibility = true} = opts const intObs = new IntersectionObserver(changes => { @@ -17678,7 +16084,6 @@ const safeExecute = function (el, fn) { // The browser doesn't support Intersection Observer v2, falling back to v1 behavior. change.isVisible = true; } - if (change.isIntersecting) { /** * If 'checkVisibility' is 'false' (like on Windows), then we always execute the function @@ -17691,7 +16096,6 @@ const safeExecute = function (el, fn) { fn(); } } - intObs.disconnect(); }, { trackVisibility: true, @@ -17699,15 +16103,13 @@ const safeExecute = function (el, fn) { }); intObs.observe(el); }; + /** * Checks that an element is potentially viewable (even if off-screen) * @param {HTMLElement} el * @return {boolean} */ - - exports.safeExecute = safeExecute; - const isPotentiallyViewable = el => { const computedStyle = window.getComputedStyle(el); const opacity = parseFloat(computedStyle.getPropertyValue('opacity') || '1'); @@ -17715,15 +16117,13 @@ const isPotentiallyViewable = el => { const opacityThreshold = 0.6; return el.clientWidth !== 0 && el.clientHeight !== 0 && opacity > opacityThreshold && visibility !== 'hidden'; }; + /** * Gets the bounding box of the icon * @param {HTMLInputElement} input * @returns {{top: number, left: number, bottom: number, width: number, x: number, y: number, right: number, height: number}} */ - - exports.isPotentiallyViewable = isPotentiallyViewable; - const getDaxBoundingBox = input => { const { right: inputRight, @@ -17748,16 +16148,14 @@ const getDaxBoundingBox = input => { y: top }; }; + /** * Check if a mouse event is within the icon * @param {MouseEvent} e * @param {HTMLInputElement} input * @returns {boolean} */ - - exports.getDaxBoundingBox = getDaxBoundingBox; - const isEventWithinDax = (e, input) => { const { left, @@ -17769,50 +16167,40 @@ const isEventWithinDax = (e, input) => { const withinY = e.clientY >= top && e.clientY <= bottom; return withinX && withinY; }; + /** * Adds inline styles from a prop:value object * @param {HTMLElement} el * @param {Object} styles */ - - exports.isEventWithinDax = isEventWithinDax; - const addInlineStyles = (el, styles) => Object.entries(styles).forEach(_ref => { let [property, val] = _ref; return el.style.setProperty(property, val, 'important'); }); + /** * Removes inline styles from a prop:value object * @param {HTMLElement} el * @param {Object} styles */ - - exports.addInlineStyles = addInlineStyles; - const removeInlineStyles = (el, styles) => Object.keys(styles).forEach(property => el.style.removeProperty(property)); - exports.removeInlineStyles = removeInlineStyles; -const ADDRESS_DOMAIN = '@duck.com'; +const ADDRESS_DOMAIN = exports.ADDRESS_DOMAIN = '@duck.com'; /** * Given a username, returns the full email address * @param {string} address * @returns {string} */ - -exports.ADDRESS_DOMAIN = ADDRESS_DOMAIN; - const formatDuckAddress = address => address + ADDRESS_DOMAIN; + /** * Escapes any occurrences of &, ", <, > or / with XML entities. * @param {string} str The string to escape. * @return {string} The escaped string. */ - - exports.formatDuckAddress = formatDuckAddress; - function escapeXML(str) { const replacements = { '&': '&', @@ -17824,38 +16212,38 @@ function escapeXML(str) { }; return String(str).replace(/[&"'<>/]/g, m => replacements[m]); } + /** * Determines if an element is likely to be a submit button * @param {HTMLElement} el A button, input, anchor or other element with role=button * @param {import("./Form/matching").Matching} matching * @return {boolean} */ - - const isLikelyASubmitButton = (el, matching) => { - var _matching$getDDGMatch, _matching$getDDGMatch2, _matching$getDDGMatch3; - const text = getTextShallow(el); const ariaLabel = el.getAttribute('aria-label') || ''; const dataTestId = el.getAttribute('data-test-id') || ''; - if ((el.getAttribute('type') === 'submit' || // is explicitly set as "submit" - el.getAttribute('name') === 'submit') && // is called "submit" - !((_matching$getDDGMatch = matching.getDDGMatcherRegex('submitButtonUnlikelyRegex')) !== null && _matching$getDDGMatch !== void 0 && _matching$getDDGMatch.test(text + ' ' + ariaLabel))) return true; - return (/primary|submit/i.test(el.className) || // has high-signal submit classes - /submit/i.test(dataTestId) || ((_matching$getDDGMatch2 = matching.getDDGMatcherRegex('submitButtonRegex')) === null || _matching$getDDGMatch2 === void 0 ? void 0 : _matching$getDDGMatch2.test(text)) || // has high-signal text + if ((el.getAttribute('type') === 'submit' || + // is explicitly set as "submit" + el.getAttribute('name') === 'submit') && + // is called "submit" + !matching.getDDGMatcherRegex('submitButtonUnlikelyRegex')?.test(text + ' ' + ariaLabel)) return true; + return (/primary|submit/i.test(el.className) || + // has high-signal submit classes + /submit/i.test(dataTestId) || matching.getDDGMatcherRegex('submitButtonRegex')?.test(text) || + // has high-signal text el.offsetHeight * el.offsetWidth >= 10000 && !/secondary/i.test(el.className) // it's a large element 250x40px - ) && el.offsetHeight * el.offsetWidth >= 2000 && // it's not a very small button like inline links and such - !((_matching$getDDGMatch3 = matching.getDDGMatcherRegex('submitButtonUnlikelyRegex')) !== null && _matching$getDDGMatch3 !== void 0 && _matching$getDDGMatch3.test(text + ' ' + ariaLabel)); + ) && el.offsetHeight * el.offsetWidth >= 2000 && + // it's not a very small button like inline links and such + !matching.getDDGMatcherRegex('submitButtonUnlikelyRegex')?.test(text + ' ' + ariaLabel); }; + /** * Check that a button matches the form type - login buttons on a login form, signup buttons on a signup form * @param {HTMLElement} el * @param {import('./Form/Form').Form} formObj */ - - exports.isLikelyASubmitButton = isLikelyASubmitButton; - const buttonMatchesFormType = (el, formObj) => { if (formObj.isLogin) { return !/sign.?up|register|join/i.test(el.textContent || ''); @@ -17865,7 +16253,6 @@ const buttonMatchesFormType = (el, formObj) => { return true; } }; - exports.buttonMatchesFormType = buttonMatchesFormType; const buttonInputTypes = ['submit', 'button']; /** @@ -17873,65 +16260,55 @@ const buttonInputTypes = ['submit', 'button']; * @param {Node} el * @returns {string} */ - const getTextShallow = el => { // for buttons, we don't care about descendants, just get the whole text as is // this is important in order to give proper attribution of the text to the button if (el instanceof HTMLButtonElement) return (0, _matching.removeExcessWhitespace)(el.textContent); - if (el instanceof HTMLInputElement) { if (buttonInputTypes.includes(el.type)) { return el.value; } - if (el.type === 'image') { return (0, _matching.removeExcessWhitespace)(el.alt || el.value || el.title || el.name); } } - let text = ''; - for (const childNode of el.childNodes) { if (childNode instanceof Text) { text += ' ' + childNode.textContent; } } - return (0, _matching.removeExcessWhitespace)(text); }; + /** * Check if hostname is a local address * @param {string} [hostname] * @returns {boolean} */ - - exports.getTextShallow = getTextShallow; - function isLocalNetwork() { let hostname = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : window.location.hostname; return ['localhost', '', '::1'].includes(hostname) || hostname.includes('127.0.0.1') || hostname.includes('192.168.') || hostname.startsWith('10.0.') || hostname.endsWith('.local') || hostname.endsWith('.internal'); -} // Extracted from lib/DDG/Util/Constants.pm - +} +// Extracted from lib/DDG/Util/Constants.pm const tldrs = /\.(?:c(?:o(?:m|op)?|at?|[iykgdmnxruhcfzvl])|o(?:rg|m)|n(?:et?|a(?:me)?|[ucgozrfpil])|e(?:d?u|[gechstr])|i(?:n(?:t|fo)?|[stqldroem])|m(?:o(?:bi)?|u(?:seum)?|i?l|[mcyvtsqhaerngxzfpwkd])|g(?:ov|[glqeriabtshdfmuywnp])|b(?:iz?|[drovfhtaywmzjsgbenl])|t(?:r(?:avel)?|[ncmfzdvkopthjwg]|e?l)|k[iemygznhwrp]|s[jtvberindlucygkhaozm]|u[gymszka]|h[nmutkr]|r[owesu]|d[kmzoej]|a(?:e(?:ro)?|r(?:pa)?|[qofiumsgzlwcnxdt])|p(?:ro?|[sgnthfymakwle])|v[aegiucn]|l[sayuvikcbrt]|j(?:o(?:bs)?|[mep])|w[fs]|z[amw]|f[rijkom]|y[eut]|qa)$/i; /** * Check if hostname is a valid top-level domain * @param {string} [hostname] * @returns {boolean} */ - function isValidTLD() { let hostname = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : window.location.hostname; return tldrs.test(hostname) || hostname === 'fill.dev'; } + /** * Chrome's UA adds styles using this selector when using the built-in autofill * @param {HTMLInputElement} input * @returns {boolean} */ - - const wasAutofilledByChrome = input => { try { // Other browsers throw because the selector is invalid @@ -17940,131 +16317,111 @@ const wasAutofilledByChrome = input => { return false; } }; + /** * Checks if we should log form analysis debug info to the console * @returns {boolean} */ - - exports.wasAutofilledByChrome = wasAutofilledByChrome; - function shouldLog() { return readDebugSetting('ddg-autofill-debug'); } + /** * Checks if we should log performance info to the console * @returns {boolean} */ - - function shouldLogPerformance() { return readDebugSetting('ddg-autofill-perf'); } + /** * Check if a sessionStorage item is set to 'true' * @param setting * @returns {boolean} */ - - function readDebugSetting(setting) { // sessionStorage throws in invalid schemes like data: and file: try { - var _window$sessionStorag; - - return ((_window$sessionStorag = window.sessionStorage) === null || _window$sessionStorag === void 0 ? void 0 : _window$sessionStorag.getItem(setting)) === 'true'; + return window.sessionStorage?.getItem(setting) === 'true'; } catch (e) { return false; } } - function logPerformance(markName) { if (shouldLogPerformance()) { - var _window$performance, _window$performance2; - - const measurement = (_window$performance = window.performance) === null || _window$performance === void 0 ? void 0 : _window$performance.measure("".concat(markName, ":init"), "".concat(markName, ":init:start"), "".concat(markName, ":init:end")); - console.log("".concat(markName, " took ").concat(Math.round(measurement === null || measurement === void 0 ? void 0 : measurement.duration), "ms")); - (_window$performance2 = window.performance) === null || _window$performance2 === void 0 ? void 0 : _window$performance2.clearMarks(); + const measurement = window.performance?.measure(`${markName}:init`, `${markName}:init:start`, `${markName}:init:end`); + console.log(`${markName} took ${Math.round(measurement?.duration)}ms`); + window.performance?.clearMarks(); } } + /** * * @param {Function} callback * @returns {Function} */ - - function whenIdle(callback) { var _this = this; - let timer; return function () { for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } - cancelIdleCallback(timer); timer = requestIdleCallback(() => callback.apply(_this, args)); }; } + /** * Truncate string from the middle if exceeds the totalLength (default: 30) * @param {string} string * @param {number} totalLength * @returns {string} */ - - function truncateFromMiddle(string) { let totalLength = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 30; - if (totalLength < 4) { throw new Error('Do not use with strings shorter than 4'); } - if (string.length <= totalLength) return string; const truncated = string.slice(0, totalLength / 2).concat('…', string.slice(totalLength / -2)); return truncated; } + /** * Determines if the form is likely to be enclosing most of the DOM * @param {HTMLFormElement} form * @returns {boolean} */ - - function isFormLikelyToBeUsedAsPageWrapper(form) { if (form.parentElement !== document.body) return false; - const formChildren = form.querySelectorAll('*').length; // If the form has few content elements, it's unlikely to cause issues anyway - + const formChildren = form.querySelectorAll('*').length; + // If the form has few content elements, it's unlikely to cause issues anyway if (formChildren < 100) return false; const bodyChildren = document.body.querySelectorAll('*').length; + /** * Percentage of the formChildren on the total body elements * form * 100 / body = x */ - const formChildrenPercentage = formChildren * 100 / bodyChildren; return formChildrenPercentage > 50; } -},{"./Form/matching.js":41}],60:[function(require,module,exports){ +},{"./Form/matching.js":43}],62:[function(require,module,exports){ "use strict"; require("./requestIdleCallback.js"); - var _DeviceInterface = require("./DeviceInterface.js"); - var _autofillUtils = require("./autofill-utils.js"); - // Polyfills/shims + (() => { if ((0, _autofillUtils.shouldLog)()) { console.log('DuckDuckGo Autofill Active'); } - if (!window.isSecureContext) return false; - try { const startupAutofill = () => { if (document.visibilityState === 'visible') { @@ -18076,14 +16433,14 @@ var _autofillUtils = require("./autofill-utils.js"); }); } }; - startupAutofill(); } catch (e) { - console.error(e); // Noop, we errored + console.error(e); + // Noop, we errored } })(); -},{"./DeviceInterface.js":20,"./autofill-utils.js":59,"./requestIdleCallback.js":71}],61:[function(require,module,exports){ +},{"./DeviceInterface.js":22,"./autofill-utils.js":61,"./requestIdleCallback.js":73}],63:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { @@ -18091,59 +16448,60 @@ Object.defineProperty(exports, "__esModule", { }); exports.DDG_DOMAIN_REGEX = void 0; exports.createGlobalConfig = createGlobalConfig; -const DDG_DOMAIN_REGEX = new RegExp(/^https:\/\/(([a-z0-9-_]+?)\.)?duckduckgo\.com\/email/); +const DDG_DOMAIN_REGEX = exports.DDG_DOMAIN_REGEX = new RegExp(/^https:\/\/(([a-z0-9-_]+?)\.)?duckduckgo\.com\/email/); + /** * This is a centralised place to contain all string/variable replacements * * @param {Partial} [overrides] * @returns {GlobalConfig} */ - -exports.DDG_DOMAIN_REGEX = DDG_DOMAIN_REGEX; - function createGlobalConfig(overrides) { let isApp = false; let isTopFrame = false; - let supportsTopFrame = false; // Do not remove -- Apple devices change this when they support modern webkit messaging - - let hasModernWebkitAPI = false; // INJECT isApp HERE + let supportsTopFrame = false; + // Do not remove -- Apple devices change this when they support modern webkit messaging + let hasModernWebkitAPI = false; + // INJECT isApp HERE // INJECT isTopFrame HERE // INJECT supportsTopFrame HERE // INJECT hasModernWebkitAPI HERE - let isWindows = false; // INJECT isWindows HERE - // This will be used when 'hasModernWebkitAPI' is false + let isWindows = false; + // INJECT isWindows HERE + // This will be used when 'hasModernWebkitAPI' is false /** @type {string[]} */ + let webkitMessageHandlerNames = []; + // INJECT webkitMessageHandlerNames HERE - let webkitMessageHandlerNames = []; // INJECT webkitMessageHandlerNames HERE - - let isDDGTestMode = false; isDDGTestMode = true; + let isDDGTestMode = false; + isDDGTestMode = true; let contentScope = null; let userUnprotectedDomains = null; /** @type {Record | null} */ - - let userPreferences = null; // INJECT contentScope HERE + let userPreferences = null; + // INJECT contentScope HERE // INJECT userUnprotectedDomains HERE // INJECT userPreferences HERE /** @type {Record | null} */ + let availableInputTypes = null; + // INJECT availableInputTypes HERE - let availableInputTypes = null; // INJECT availableInputTypes HERE // The native layer will inject a randomised secret here and use it to verify the origin - let secret = 'PLACEHOLDER_SECRET'; + /** * The user agent check will not be needed here once `android` supports `userPreferences?.platform.name` */ // @ts-ignore - - const isAndroid = (userPreferences === null || userPreferences === void 0 ? void 0 : userPreferences.platform.name) === 'android' || /Android.*DuckDuckGo\/\d/i.test(window.navigator.userAgent); // @ts-ignore - - const isDDGApp = ['ios', 'android', 'macos', 'windows'].includes(userPreferences === null || userPreferences === void 0 ? void 0 : userPreferences.platform.name) || isAndroid || isWindows; // @ts-ignore - - const isMobileApp = ['ios', 'android'].includes(userPreferences === null || userPreferences === void 0 ? void 0 : userPreferences.platform.name) || isAndroid; + const isAndroid = userPreferences?.platform.name === 'android' || /Android.*DuckDuckGo\/\d/i.test(window.navigator.userAgent); + // @ts-ignore + const isDDGApp = ['ios', 'android', 'macos', 'windows'].includes(userPreferences?.platform.name) || isAndroid || isWindows; + // @ts-ignore + const isMobileApp = ['ios', 'android'].includes(userPreferences?.platform.name) || isAndroid; const isFirefox = navigator.userAgent.includes('Firefox'); const isDDGDomain = Boolean(window.location.href.match(DDG_DOMAIN_REGEX)); const isExtension = false; @@ -18171,14 +16529,14 @@ function createGlobalConfig(overrides) { return config; } -},{}],62:[function(require,module,exports){ +},{}],64:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.constants = void 0; -const constants = { +const constants = exports.constants = { ATTR_INPUT_TYPE: 'data-ddg-inputType', ATTR_AUTOFILL: 'data-ddg-autofill', TEXT_LENGTH_CUTOFF: 100, @@ -18187,511 +16545,256 @@ const constants = { MAX_INPUTS_PER_FORM: 80, MAX_FORM_MUT_OBS_COUNT: 50 }; -exports.constants = constants; -},{}],63:[function(require,module,exports){ +},{}],65:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.StoreFormDataCall = exports.StartEmailProtectionSignupCall = exports.SetSizeCall = exports.SetIncontextSignupPermanentlyDismissedAtCall = exports.SendJSPixelCall = exports.SelectedDetailCall = exports.OpenManagePasswordsCall = exports.OpenManageIdentitiesCall = exports.OpenManageCreditCardsCall = exports.GetRuntimeConfigurationCall = exports.GetIncontextSignupDismissedAtCall = exports.GetAvailableInputTypesCall = exports.GetAutofillInitDataCall = exports.GetAutofillDataCall = exports.GetAutofillCredentialsCall = exports.EmailProtectionStoreUserDataCall = exports.EmailProtectionRemoveUserDataCall = exports.EmailProtectionRefreshPrivateAddressCall = exports.EmailProtectionGetUserDataCall = exports.EmailProtectionGetIsLoggedInCall = exports.EmailProtectionGetCapabilitiesCall = exports.EmailProtectionGetAddressesCall = exports.CloseEmailProtectionTabCall = exports.CloseAutofillParentCall = exports.CheckCredentialsProviderStatusCall = exports.AskToUnlockProviderCall = exports.AddDebugFlagCall = void 0; - var _validatorsZod = require("./validators.zod.js"); - var _deviceApi = require("../../../packages/device-api"); - -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } +/* DO NOT EDIT, this file was generated by scripts/api-call-generator.js */ /** * @extends {DeviceApiCall} */ class AddDebugFlagCall extends _deviceApi.DeviceApiCall { - constructor() { - super(...arguments); - - _defineProperty(this, "method", "addDebugFlag"); - - _defineProperty(this, "paramsValidator", _validatorsZod.addDebugFlagParamsSchema); - } - + method = "addDebugFlag"; + paramsValidator = _validatorsZod.addDebugFlagParamsSchema; } /** * @extends {DeviceApiCall} */ - - exports.AddDebugFlagCall = AddDebugFlagCall; - class GetAutofillDataCall extends _deviceApi.DeviceApiCall { - constructor() { - super(...arguments); - - _defineProperty(this, "method", "getAutofillData"); - - _defineProperty(this, "id", "getAutofillDataResponse"); - - _defineProperty(this, "paramsValidator", _validatorsZod.getAutofillDataRequestSchema); - - _defineProperty(this, "resultValidator", _validatorsZod.getAutofillDataResponseSchema); - } - + method = "getAutofillData"; + id = "getAutofillDataResponse"; + paramsValidator = _validatorsZod.getAutofillDataRequestSchema; + resultValidator = _validatorsZod.getAutofillDataResponseSchema; } /** * @extends {DeviceApiCall} */ - - exports.GetAutofillDataCall = GetAutofillDataCall; - class GetRuntimeConfigurationCall extends _deviceApi.DeviceApiCall { - constructor() { - super(...arguments); - - _defineProperty(this, "method", "getRuntimeConfiguration"); - - _defineProperty(this, "id", "getRuntimeConfigurationResponse"); - - _defineProperty(this, "resultValidator", _validatorsZod.getRuntimeConfigurationResponseSchema); - } - + method = "getRuntimeConfiguration"; + id = "getRuntimeConfigurationResponse"; + resultValidator = _validatorsZod.getRuntimeConfigurationResponseSchema; } /** * @extends {DeviceApiCall} */ - - exports.GetRuntimeConfigurationCall = GetRuntimeConfigurationCall; - class StoreFormDataCall extends _deviceApi.DeviceApiCall { - constructor() { - super(...arguments); - - _defineProperty(this, "method", "storeFormData"); - - _defineProperty(this, "paramsValidator", _validatorsZod.storeFormDataSchema); - } - + method = "storeFormData"; + paramsValidator = _validatorsZod.storeFormDataSchema; } /** * @extends {DeviceApiCall} */ - - exports.StoreFormDataCall = StoreFormDataCall; - class GetAvailableInputTypesCall extends _deviceApi.DeviceApiCall { - constructor() { - super(...arguments); - - _defineProperty(this, "method", "getAvailableInputTypes"); - - _defineProperty(this, "id", "getAvailableInputTypesResponse"); - - _defineProperty(this, "resultValidator", _validatorsZod.getAvailableInputTypesResultSchema); - } - + method = "getAvailableInputTypes"; + id = "getAvailableInputTypesResponse"; + resultValidator = _validatorsZod.getAvailableInputTypesResultSchema; } /** * @extends {DeviceApiCall} */ - - exports.GetAvailableInputTypesCall = GetAvailableInputTypesCall; - class GetAutofillInitDataCall extends _deviceApi.DeviceApiCall { - constructor() { - super(...arguments); - - _defineProperty(this, "method", "getAutofillInitData"); - - _defineProperty(this, "id", "getAutofillInitDataResponse"); - - _defineProperty(this, "resultValidator", _validatorsZod.getAutofillInitDataResponseSchema); - } - + method = "getAutofillInitData"; + id = "getAutofillInitDataResponse"; + resultValidator = _validatorsZod.getAutofillInitDataResponseSchema; } /** * @extends {DeviceApiCall} */ - - exports.GetAutofillInitDataCall = GetAutofillInitDataCall; - class GetAutofillCredentialsCall extends _deviceApi.DeviceApiCall { - constructor() { - super(...arguments); - - _defineProperty(this, "method", "getAutofillCredentials"); - - _defineProperty(this, "id", "getAutofillCredentialsResponse"); - - _defineProperty(this, "paramsValidator", _validatorsZod.getAutofillCredentialsParamsSchema); - - _defineProperty(this, "resultValidator", _validatorsZod.getAutofillCredentialsResultSchema); - } - + method = "getAutofillCredentials"; + id = "getAutofillCredentialsResponse"; + paramsValidator = _validatorsZod.getAutofillCredentialsParamsSchema; + resultValidator = _validatorsZod.getAutofillCredentialsResultSchema; } /** * @extends {DeviceApiCall} */ - - exports.GetAutofillCredentialsCall = GetAutofillCredentialsCall; - class SetSizeCall extends _deviceApi.DeviceApiCall { - constructor() { - super(...arguments); - - _defineProperty(this, "method", "setSize"); - - _defineProperty(this, "paramsValidator", _validatorsZod.setSizeParamsSchema); - } - + method = "setSize"; + paramsValidator = _validatorsZod.setSizeParamsSchema; } /** * @extends {DeviceApiCall} */ - - exports.SetSizeCall = SetSizeCall; - class SelectedDetailCall extends _deviceApi.DeviceApiCall { - constructor() { - super(...arguments); - - _defineProperty(this, "method", "selectedDetail"); - - _defineProperty(this, "paramsValidator", _validatorsZod.selectedDetailParamsSchema); - } - + method = "selectedDetail"; + paramsValidator = _validatorsZod.selectedDetailParamsSchema; } /** * @extends {DeviceApiCall} */ - - exports.SelectedDetailCall = SelectedDetailCall; - class CloseAutofillParentCall extends _deviceApi.DeviceApiCall { - constructor() { - super(...arguments); - - _defineProperty(this, "method", "closeAutofillParent"); - } - + method = "closeAutofillParent"; } /** * @extends {DeviceApiCall} - */ - - + */ exports.CloseAutofillParentCall = CloseAutofillParentCall; - class AskToUnlockProviderCall extends _deviceApi.DeviceApiCall { - constructor() { - super(...arguments); - - _defineProperty(this, "method", "askToUnlockProvider"); - - _defineProperty(this, "id", "askToUnlockProviderResponse"); - - _defineProperty(this, "resultValidator", _validatorsZod.askToUnlockProviderResultSchema); - } - + method = "askToUnlockProvider"; + id = "askToUnlockProviderResponse"; + resultValidator = _validatorsZod.askToUnlockProviderResultSchema; } /** * @extends {DeviceApiCall} */ - - exports.AskToUnlockProviderCall = AskToUnlockProviderCall; - class CheckCredentialsProviderStatusCall extends _deviceApi.DeviceApiCall { - constructor() { - super(...arguments); - - _defineProperty(this, "method", "checkCredentialsProviderStatus"); - - _defineProperty(this, "id", "checkCredentialsProviderStatusResponse"); - - _defineProperty(this, "resultValidator", _validatorsZod.checkCredentialsProviderStatusResultSchema); - } - + method = "checkCredentialsProviderStatus"; + id = "checkCredentialsProviderStatusResponse"; + resultValidator = _validatorsZod.checkCredentialsProviderStatusResultSchema; } /** * @extends {DeviceApiCall} */ - - exports.CheckCredentialsProviderStatusCall = CheckCredentialsProviderStatusCall; - class SendJSPixelCall extends _deviceApi.DeviceApiCall { - constructor() { - super(...arguments); - - _defineProperty(this, "method", "sendJSPixel"); - - _defineProperty(this, "paramsValidator", _validatorsZod.sendJSPixelParamsSchema); - } - + method = "sendJSPixel"; + paramsValidator = _validatorsZod.sendJSPixelParamsSchema; } /** * @extends {DeviceApiCall} */ - - exports.SendJSPixelCall = SendJSPixelCall; - class SetIncontextSignupPermanentlyDismissedAtCall extends _deviceApi.DeviceApiCall { - constructor() { - super(...arguments); - - _defineProperty(this, "method", "setIncontextSignupPermanentlyDismissedAt"); - - _defineProperty(this, "paramsValidator", _validatorsZod.setIncontextSignupPermanentlyDismissedAtSchema); - } - + method = "setIncontextSignupPermanentlyDismissedAt"; + paramsValidator = _validatorsZod.setIncontextSignupPermanentlyDismissedAtSchema; } /** * @extends {DeviceApiCall} */ - - exports.SetIncontextSignupPermanentlyDismissedAtCall = SetIncontextSignupPermanentlyDismissedAtCall; - class GetIncontextSignupDismissedAtCall extends _deviceApi.DeviceApiCall { - constructor() { - super(...arguments); - - _defineProperty(this, "method", "getIncontextSignupDismissedAt"); - - _defineProperty(this, "id", "getIncontextSignupDismissedAt"); - - _defineProperty(this, "resultValidator", _validatorsZod.getIncontextSignupDismissedAtSchema); - } - + method = "getIncontextSignupDismissedAt"; + id = "getIncontextSignupDismissedAt"; + resultValidator = _validatorsZod.getIncontextSignupDismissedAtSchema; } /** * @extends {DeviceApiCall} */ - - exports.GetIncontextSignupDismissedAtCall = GetIncontextSignupDismissedAtCall; - class OpenManagePasswordsCall extends _deviceApi.DeviceApiCall { - constructor() { - super(...arguments); - - _defineProperty(this, "method", "openManagePasswords"); - } - + method = "openManagePasswords"; } /** * @extends {DeviceApiCall} */ - - exports.OpenManagePasswordsCall = OpenManagePasswordsCall; - class OpenManageCreditCardsCall extends _deviceApi.DeviceApiCall { - constructor() { - super(...arguments); - - _defineProperty(this, "method", "openManageCreditCards"); - } - + method = "openManageCreditCards"; } /** * @extends {DeviceApiCall} */ - - exports.OpenManageCreditCardsCall = OpenManageCreditCardsCall; - class OpenManageIdentitiesCall extends _deviceApi.DeviceApiCall { - constructor() { - super(...arguments); - - _defineProperty(this, "method", "openManageIdentities"); - } - + method = "openManageIdentities"; } /** * @extends {DeviceApiCall} */ - - exports.OpenManageIdentitiesCall = OpenManageIdentitiesCall; - class EmailProtectionStoreUserDataCall extends _deviceApi.DeviceApiCall { - constructor() { - super(...arguments); - - _defineProperty(this, "method", "emailProtectionStoreUserData"); - - _defineProperty(this, "id", "emailProtectionStoreUserDataResponse"); - - _defineProperty(this, "paramsValidator", _validatorsZod.emailProtectionStoreUserDataParamsSchema); - } - + method = "emailProtectionStoreUserData"; + id = "emailProtectionStoreUserDataResponse"; + paramsValidator = _validatorsZod.emailProtectionStoreUserDataParamsSchema; } /** * @extends {DeviceApiCall} */ - - exports.EmailProtectionStoreUserDataCall = EmailProtectionStoreUserDataCall; - class EmailProtectionRemoveUserDataCall extends _deviceApi.DeviceApiCall { - constructor() { - super(...arguments); - - _defineProperty(this, "method", "emailProtectionRemoveUserData"); - } - + method = "emailProtectionRemoveUserData"; } /** * @extends {DeviceApiCall} */ - - exports.EmailProtectionRemoveUserDataCall = EmailProtectionRemoveUserDataCall; - class EmailProtectionGetIsLoggedInCall extends _deviceApi.DeviceApiCall { - constructor() { - super(...arguments); - - _defineProperty(this, "method", "emailProtectionGetIsLoggedIn"); - - _defineProperty(this, "id", "emailProtectionGetIsLoggedInResponse"); - - _defineProperty(this, "resultValidator", _validatorsZod.emailProtectionGetIsLoggedInResultSchema); - } - + method = "emailProtectionGetIsLoggedIn"; + id = "emailProtectionGetIsLoggedInResponse"; + resultValidator = _validatorsZod.emailProtectionGetIsLoggedInResultSchema; } /** * @extends {DeviceApiCall} */ - - exports.EmailProtectionGetIsLoggedInCall = EmailProtectionGetIsLoggedInCall; - class EmailProtectionGetUserDataCall extends _deviceApi.DeviceApiCall { - constructor() { - super(...arguments); - - _defineProperty(this, "method", "emailProtectionGetUserData"); - - _defineProperty(this, "id", "emailProtectionGetUserDataResponse"); - - _defineProperty(this, "resultValidator", _validatorsZod.emailProtectionGetUserDataResultSchema); - } - + method = "emailProtectionGetUserData"; + id = "emailProtectionGetUserDataResponse"; + resultValidator = _validatorsZod.emailProtectionGetUserDataResultSchema; } /** * @extends {DeviceApiCall} */ - - exports.EmailProtectionGetUserDataCall = EmailProtectionGetUserDataCall; - class EmailProtectionGetCapabilitiesCall extends _deviceApi.DeviceApiCall { - constructor() { - super(...arguments); - - _defineProperty(this, "method", "emailProtectionGetCapabilities"); - - _defineProperty(this, "id", "emailProtectionGetCapabilitiesResponse"); - - _defineProperty(this, "resultValidator", _validatorsZod.emailProtectionGetCapabilitiesResultSchema); - } - + method = "emailProtectionGetCapabilities"; + id = "emailProtectionGetCapabilitiesResponse"; + resultValidator = _validatorsZod.emailProtectionGetCapabilitiesResultSchema; } /** * @extends {DeviceApiCall} */ - - exports.EmailProtectionGetCapabilitiesCall = EmailProtectionGetCapabilitiesCall; - class EmailProtectionGetAddressesCall extends _deviceApi.DeviceApiCall { - constructor() { - super(...arguments); - - _defineProperty(this, "method", "emailProtectionGetAddresses"); - - _defineProperty(this, "id", "emailProtectionGetAddressesResponse"); - - _defineProperty(this, "resultValidator", _validatorsZod.emailProtectionGetAddressesResultSchema); - } - + method = "emailProtectionGetAddresses"; + id = "emailProtectionGetAddressesResponse"; + resultValidator = _validatorsZod.emailProtectionGetAddressesResultSchema; } /** * @extends {DeviceApiCall} */ - - exports.EmailProtectionGetAddressesCall = EmailProtectionGetAddressesCall; - class EmailProtectionRefreshPrivateAddressCall extends _deviceApi.DeviceApiCall { - constructor() { - super(...arguments); - - _defineProperty(this, "method", "emailProtectionRefreshPrivateAddress"); - - _defineProperty(this, "id", "emailProtectionRefreshPrivateAddressResponse"); - - _defineProperty(this, "resultValidator", _validatorsZod.emailProtectionRefreshPrivateAddressResultSchema); - } - + method = "emailProtectionRefreshPrivateAddress"; + id = "emailProtectionRefreshPrivateAddressResponse"; + resultValidator = _validatorsZod.emailProtectionRefreshPrivateAddressResultSchema; } /** * @extends {DeviceApiCall} */ - - exports.EmailProtectionRefreshPrivateAddressCall = EmailProtectionRefreshPrivateAddressCall; - class StartEmailProtectionSignupCall extends _deviceApi.DeviceApiCall { - constructor() { - super(...arguments); - - _defineProperty(this, "method", "startEmailProtectionSignup"); - } - + method = "startEmailProtectionSignup"; } /** * @extends {DeviceApiCall} */ - - exports.StartEmailProtectionSignupCall = StartEmailProtectionSignupCall; - class CloseEmailProtectionTabCall extends _deviceApi.DeviceApiCall { - constructor() { - super(...arguments); - - _defineProperty(this, "method", "closeEmailProtectionTab"); - } - + method = "closeEmailProtectionTab"; } - exports.CloseEmailProtectionTabCall = CloseEmailProtectionTabCall; -},{"../../../packages/device-api":10,"./validators.zod.js":64}],64:[function(require,module,exports){ +},{"../../../packages/device-api":12,"./validators.zod.js":66}],66:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.userPreferencesSchema = exports.triggerContextSchema = exports.storeFormDataSchema = exports.setSizeParamsSchema = exports.setIncontextSignupPermanentlyDismissedAtSchema = exports.sendJSPixelParamsSchema = exports.selectedDetailParamsSchema = exports.runtimeConfigurationSchema = exports.providerStatusUpdatedSchema = exports.outgoingCredentialsSchema = exports.getRuntimeConfigurationResponseSchema = exports.getIncontextSignupDismissedAtSchema = exports.getAvailableInputTypesResultSchema = exports.getAutofillInitDataResponseSchema = exports.getAutofillDataResponseSchema = exports.getAutofillDataRequestSchema = exports.getAutofillCredentialsResultSchema = exports.getAutofillCredentialsParamsSchema = exports.getAliasResultSchema = exports.getAliasParamsSchema = exports.genericErrorSchema = exports.generatedPasswordSchema = exports.emailProtectionStoreUserDataParamsSchema = exports.emailProtectionRefreshPrivateAddressResultSchema = exports.emailProtectionGetUserDataResultSchema = exports.emailProtectionGetIsLoggedInResultSchema = exports.emailProtectionGetCapabilitiesResultSchema = exports.emailProtectionGetAddressesResultSchema = exports.credentialsSchema = exports.contentScopeSchema = exports.checkCredentialsProviderStatusResultSchema = exports.availableInputTypesSchema = exports.availableInputTypes1Schema = exports.autofillSettingsSchema = exports.autofillFeatureTogglesSchema = exports.askToUnlockProviderResultSchema = exports.apiSchema = exports.addDebugFlagParamsSchema = void 0; - var _zod = require("zod"); - /* DO NOT EDIT, this file was generated by scripts/api-call-generator.js */ // Generated by ts-to-zod -const sendJSPixelParamsSchema = _zod.z.union([_zod.z.object({ + +const sendJSPixelParamsSchema = exports.sendJSPixelParamsSchema = _zod.z.union([_zod.z.object({ pixelName: _zod.z.literal("autofill_identity"), params: _zod.z.object({ fieldType: _zod.z.string().optional() @@ -18711,33 +16814,56 @@ const sendJSPixelParamsSchema = _zod.z.union([_zod.z.object({ }), _zod.z.object({ pixelName: _zod.z.literal("incontext_close_x") })]); - -exports.sendJSPixelParamsSchema = sendJSPixelParamsSchema; - -const addDebugFlagParamsSchema = _zod.z.object({ +const addDebugFlagParamsSchema = exports.addDebugFlagParamsSchema = _zod.z.object({ flag: _zod.z.string() }); - -exports.addDebugFlagParamsSchema = addDebugFlagParamsSchema; - -const generatedPasswordSchema = _zod.z.object({ +const getAutofillCredentialsParamsSchema = exports.getAutofillCredentialsParamsSchema = _zod.z.object({ + id: _zod.z.string() +}); +const setSizeParamsSchema = exports.setSizeParamsSchema = _zod.z.object({ + height: _zod.z.number(), + width: _zod.z.number() +}); +const selectedDetailParamsSchema = exports.selectedDetailParamsSchema = _zod.z.object({ + data: _zod.z.record(_zod.z.unknown()), + configType: _zod.z.string() +}); +const setIncontextSignupPermanentlyDismissedAtSchema = exports.setIncontextSignupPermanentlyDismissedAtSchema = _zod.z.object({ + value: _zod.z.number().optional() +}); +const getIncontextSignupDismissedAtSchema = exports.getIncontextSignupDismissedAtSchema = _zod.z.object({ + success: _zod.z.object({ + permanentlyDismissedAt: _zod.z.number().optional(), + isInstalledRecently: _zod.z.boolean().optional() + }) +}); +const getAliasParamsSchema = exports.getAliasParamsSchema = _zod.z.object({ + requiresUserPermission: _zod.z.boolean(), + shouldConsumeAliasIfProvided: _zod.z.boolean(), + isIncontextSignupAvailable: _zod.z.boolean().optional() +}); +const getAliasResultSchema = exports.getAliasResultSchema = _zod.z.object({ + success: _zod.z.object({ + alias: _zod.z.string().optional() + }) +}); +const emailProtectionStoreUserDataParamsSchema = exports.emailProtectionStoreUserDataParamsSchema = _zod.z.object({ + token: _zod.z.string(), + userName: _zod.z.string(), + cohort: _zod.z.string() +}); +const generatedPasswordSchema = exports.generatedPasswordSchema = _zod.z.object({ value: _zod.z.string(), username: _zod.z.string() }); - -exports.generatedPasswordSchema = generatedPasswordSchema; - -const triggerContextSchema = _zod.z.object({ +const triggerContextSchema = exports.triggerContextSchema = _zod.z.object({ inputTop: _zod.z.number(), inputLeft: _zod.z.number(), inputHeight: _zod.z.number(), inputWidth: _zod.z.number(), wasFromClick: _zod.z.boolean() }); - -exports.triggerContextSchema = triggerContextSchema; - -const credentialsSchema = _zod.z.object({ +const credentialsSchema = exports.credentialsSchema = _zod.z.object({ id: _zod.z.string().optional(), username: _zod.z.string(), password: _zod.z.string(), @@ -18747,16 +16873,10 @@ const credentialsSchema = _zod.z.object({ credentialsProvider: _zod.z.union([_zod.z.literal("duckduckgo"), _zod.z.literal("bitwarden")]).optional(), providerStatus: _zod.z.union([_zod.z.literal("locked"), _zod.z.literal("unlocked")]).optional() }); - -exports.credentialsSchema = credentialsSchema; - -const genericErrorSchema = _zod.z.object({ +const genericErrorSchema = exports.genericErrorSchema = _zod.z.object({ message: _zod.z.string() }); - -exports.genericErrorSchema = genericErrorSchema; - -const contentScopeSchema = _zod.z.object({ +const contentScopeSchema = exports.contentScopeSchema = _zod.z.object({ features: _zod.z.record(_zod.z.object({ exceptions: _zod.z.array(_zod.z.unknown()), state: _zod.z.union([_zod.z.literal("enabled"), _zod.z.literal("disabled")]), @@ -18764,10 +16884,7 @@ const contentScopeSchema = _zod.z.object({ })), unprotectedTemporary: _zod.z.array(_zod.z.unknown()) }); - -exports.contentScopeSchema = contentScopeSchema; - -const userPreferencesSchema = _zod.z.object({ +const userPreferencesSchema = exports.userPreferencesSchema = _zod.z.object({ globalPrivacyControlValue: _zod.z.boolean().optional(), sessionKey: _zod.z.string().optional(), debug: _zod.z.boolean(), @@ -18778,17 +16895,11 @@ const userPreferencesSchema = _zod.z.object({ settings: _zod.z.record(_zod.z.unknown()) })) }); - -exports.userPreferencesSchema = userPreferencesSchema; - -const outgoingCredentialsSchema = _zod.z.object({ +const outgoingCredentialsSchema = exports.outgoingCredentialsSchema = _zod.z.object({ username: _zod.z.string().optional(), password: _zod.z.string().optional() }); - -exports.outgoingCredentialsSchema = outgoingCredentialsSchema; - -const availableInputTypesSchema = _zod.z.object({ +const availableInputTypesSchema = exports.availableInputTypesSchema = _zod.z.object({ credentials: _zod.z.object({ username: _zod.z.boolean().optional(), password: _zod.z.boolean().optional() @@ -18819,56 +16930,7 @@ const availableInputTypesSchema = _zod.z.object({ email: _zod.z.boolean().optional(), credentialsProviderStatus: _zod.z.union([_zod.z.literal("locked"), _zod.z.literal("unlocked")]).optional() }); - -exports.availableInputTypesSchema = availableInputTypesSchema; - -const getAutofillInitDataResponseSchema = _zod.z.object({ - type: _zod.z.literal("getAutofillInitDataResponse").optional(), - success: _zod.z.object({ - credentials: _zod.z.array(credentialsSchema), - identities: _zod.z.array(_zod.z.record(_zod.z.unknown())), - creditCards: _zod.z.array(_zod.z.record(_zod.z.unknown())), - serializedInputContext: _zod.z.string() - }).optional(), - error: genericErrorSchema.optional() -}); - -exports.getAutofillInitDataResponseSchema = getAutofillInitDataResponseSchema; - -const getAutofillCredentialsParamsSchema = _zod.z.object({ - id: _zod.z.string() -}); - -exports.getAutofillCredentialsParamsSchema = getAutofillCredentialsParamsSchema; - -const getAutofillCredentialsResultSchema = _zod.z.object({ - type: _zod.z.literal("getAutofillCredentialsResponse").optional(), - success: _zod.z.object({ - id: _zod.z.string().optional(), - autogenerated: _zod.z.boolean().optional(), - username: _zod.z.string(), - password: _zod.z.string().optional() - }).optional(), - error: genericErrorSchema.optional() -}); - -exports.getAutofillCredentialsResultSchema = getAutofillCredentialsResultSchema; - -const setSizeParamsSchema = _zod.z.object({ - height: _zod.z.number(), - width: _zod.z.number() -}); - -exports.setSizeParamsSchema = setSizeParamsSchema; - -const selectedDetailParamsSchema = _zod.z.object({ - data: _zod.z.record(_zod.z.unknown()), - configType: _zod.z.string() -}); - -exports.selectedDetailParamsSchema = selectedDetailParamsSchema; - -const availableInputTypes1Schema = _zod.z.object({ +const availableInputTypes1Schema = exports.availableInputTypes1Schema = _zod.z.object({ credentials: _zod.z.object({ username: _zod.z.boolean().optional(), password: _zod.z.boolean().optional() @@ -18895,29 +16957,11 @@ const availableInputTypes1Schema = _zod.z.object({ expirationMonth: _zod.z.boolean().optional(), expirationYear: _zod.z.boolean().optional(), cardNumber: _zod.z.boolean().optional() - }).optional(), - email: _zod.z.boolean().optional(), - credentialsProviderStatus: _zod.z.union([_zod.z.literal("locked"), _zod.z.literal("unlocked")]).optional() -}); - -exports.availableInputTypes1Schema = availableInputTypes1Schema; - -const setIncontextSignupPermanentlyDismissedAtSchema = _zod.z.object({ - value: _zod.z.number().optional() -}); - -exports.setIncontextSignupPermanentlyDismissedAtSchema = setIncontextSignupPermanentlyDismissedAtSchema; - -const getIncontextSignupDismissedAtSchema = _zod.z.object({ - success: _zod.z.object({ - permanentlyDismissedAt: _zod.z.number().optional(), - isInstalledRecently: _zod.z.boolean().optional() - }) + }).optional(), + email: _zod.z.boolean().optional(), + credentialsProviderStatus: _zod.z.union([_zod.z.literal("locked"), _zod.z.literal("unlocked")]).optional() }); - -exports.getIncontextSignupDismissedAtSchema = getIncontextSignupDismissedAtSchema; - -const autofillFeatureTogglesSchema = _zod.z.object({ +const autofillFeatureTogglesSchema = exports.autofillFeatureTogglesSchema = _zod.z.object({ inputType_credentials: _zod.z.boolean().optional(), inputType_identities: _zod.z.boolean().optional(), inputType_creditCards: _zod.z.boolean().optional(), @@ -18928,41 +16972,60 @@ const autofillFeatureTogglesSchema = _zod.z.object({ inlineIcon_credentials: _zod.z.boolean().optional(), third_party_credentials_provider: _zod.z.boolean().optional() }); - -exports.autofillFeatureTogglesSchema = autofillFeatureTogglesSchema; - -const getAliasParamsSchema = _zod.z.object({ - requiresUserPermission: _zod.z.boolean(), - shouldConsumeAliasIfProvided: _zod.z.boolean(), - isIncontextSignupAvailable: _zod.z.boolean().optional() +const getAutofillDataRequestSchema = exports.getAutofillDataRequestSchema = _zod.z.object({ + generatedPassword: generatedPasswordSchema.optional(), + inputType: _zod.z.string(), + mainType: _zod.z.union([_zod.z.literal("credentials"), _zod.z.literal("identities"), _zod.z.literal("creditCards")]), + subType: _zod.z.string(), + trigger: _zod.z.union([_zod.z.literal("userInitiated"), _zod.z.literal("autoprompt"), _zod.z.literal("postSignup")]).optional(), + serializedInputContext: _zod.z.string().optional(), + triggerContext: triggerContextSchema.optional() }); - -exports.getAliasParamsSchema = getAliasParamsSchema; - -const getAliasResultSchema = _zod.z.object({ +const getAutofillDataResponseSchema = exports.getAutofillDataResponseSchema = _zod.z.object({ + type: _zod.z.literal("getAutofillDataResponse").optional(), success: _zod.z.object({ - alias: _zod.z.string().optional() - }) + credentials: credentialsSchema.optional(), + action: _zod.z.union([_zod.z.literal("fill"), _zod.z.literal("focus"), _zod.z.literal("none"), _zod.z.literal("acceptGeneratedPassword"), _zod.z.literal("rejectGeneratedPassword")]) + }).optional(), + error: genericErrorSchema.optional() }); - -exports.getAliasResultSchema = getAliasResultSchema; - -const emailProtectionStoreUserDataParamsSchema = _zod.z.object({ - token: _zod.z.string(), - userName: _zod.z.string(), - cohort: _zod.z.string() +const storeFormDataSchema = exports.storeFormDataSchema = _zod.z.object({ + credentials: outgoingCredentialsSchema.optional(), + trigger: _zod.z.union([_zod.z.literal("formSubmission"), _zod.z.literal("passwordGeneration"), _zod.z.literal("emailProtection")]).optional() }); - -exports.emailProtectionStoreUserDataParamsSchema = emailProtectionStoreUserDataParamsSchema; - -const emailProtectionGetIsLoggedInResultSchema = _zod.z.object({ +const getAvailableInputTypesResultSchema = exports.getAvailableInputTypesResultSchema = _zod.z.object({ + type: _zod.z.literal("getAvailableInputTypesResponse").optional(), + success: availableInputTypesSchema, + error: genericErrorSchema.optional() +}); +const getAutofillInitDataResponseSchema = exports.getAutofillInitDataResponseSchema = _zod.z.object({ + type: _zod.z.literal("getAutofillInitDataResponse").optional(), + success: _zod.z.object({ + credentials: _zod.z.array(credentialsSchema), + identities: _zod.z.array(_zod.z.record(_zod.z.unknown())), + creditCards: _zod.z.array(_zod.z.record(_zod.z.unknown())), + serializedInputContext: _zod.z.string() + }).optional(), + error: genericErrorSchema.optional() +}); +const getAutofillCredentialsResultSchema = exports.getAutofillCredentialsResultSchema = _zod.z.object({ + type: _zod.z.literal("getAutofillCredentialsResponse").optional(), + success: _zod.z.object({ + id: _zod.z.string().optional(), + autogenerated: _zod.z.boolean().optional(), + username: _zod.z.string(), + password: _zod.z.string().optional() + }).optional(), + error: genericErrorSchema.optional() +}); +const autofillSettingsSchema = exports.autofillSettingsSchema = _zod.z.object({ + featureToggles: autofillFeatureTogglesSchema +}); +const emailProtectionGetIsLoggedInResultSchema = exports.emailProtectionGetIsLoggedInResultSchema = _zod.z.object({ success: _zod.z.boolean().optional(), error: genericErrorSchema.optional() }); - -exports.emailProtectionGetIsLoggedInResultSchema = emailProtectionGetIsLoggedInResultSchema; - -const emailProtectionGetUserDataResultSchema = _zod.z.object({ +const emailProtectionGetUserDataResultSchema = exports.emailProtectionGetUserDataResultSchema = _zod.z.object({ success: _zod.z.object({ userName: _zod.z.string(), nextAlias: _zod.z.string(), @@ -18970,10 +17033,7 @@ const emailProtectionGetUserDataResultSchema = _zod.z.object({ }).optional(), error: genericErrorSchema.optional() }); - -exports.emailProtectionGetUserDataResultSchema = emailProtectionGetUserDataResultSchema; - -const emailProtectionGetCapabilitiesResultSchema = _zod.z.object({ +const emailProtectionGetCapabilitiesResultSchema = exports.emailProtectionGetCapabilitiesResultSchema = _zod.z.object({ success: _zod.z.object({ addUserData: _zod.z.boolean().optional(), getUserData: _zod.z.boolean().optional(), @@ -18981,114 +17041,46 @@ const emailProtectionGetCapabilitiesResultSchema = _zod.z.object({ }).optional(), error: genericErrorSchema.optional() }); - -exports.emailProtectionGetCapabilitiesResultSchema = emailProtectionGetCapabilitiesResultSchema; - -const emailProtectionGetAddressesResultSchema = _zod.z.object({ +const emailProtectionGetAddressesResultSchema = exports.emailProtectionGetAddressesResultSchema = _zod.z.object({ success: _zod.z.object({ personalAddress: _zod.z.string(), privateAddress: _zod.z.string() }).optional(), error: genericErrorSchema.optional() }); - -exports.emailProtectionGetAddressesResultSchema = emailProtectionGetAddressesResultSchema; - -const emailProtectionRefreshPrivateAddressResultSchema = _zod.z.object({ +const emailProtectionRefreshPrivateAddressResultSchema = exports.emailProtectionRefreshPrivateAddressResultSchema = _zod.z.object({ success: _zod.z.object({ personalAddress: _zod.z.string(), privateAddress: _zod.z.string() }).optional(), error: genericErrorSchema.optional() }); - -exports.emailProtectionRefreshPrivateAddressResultSchema = emailProtectionRefreshPrivateAddressResultSchema; - -const getAutofillDataRequestSchema = _zod.z.object({ - generatedPassword: generatedPasswordSchema.optional(), - inputType: _zod.z.string(), - mainType: _zod.z.union([_zod.z.literal("credentials"), _zod.z.literal("identities"), _zod.z.literal("creditCards")]), - subType: _zod.z.string(), - trigger: _zod.z.union([_zod.z.literal("userInitiated"), _zod.z.literal("autoprompt"), _zod.z.literal("postSignup")]).optional(), - serializedInputContext: _zod.z.string().optional(), - triggerContext: triggerContextSchema.optional() -}); - -exports.getAutofillDataRequestSchema = getAutofillDataRequestSchema; - -const getAutofillDataResponseSchema = _zod.z.object({ - type: _zod.z.literal("getAutofillDataResponse").optional(), - success: _zod.z.object({ - credentials: credentialsSchema.optional(), - action: _zod.z.union([_zod.z.literal("fill"), _zod.z.literal("focus"), _zod.z.literal("none"), _zod.z.literal("acceptGeneratedPassword"), _zod.z.literal("rejectGeneratedPassword")]) - }).optional(), - error: genericErrorSchema.optional() -}); - -exports.getAutofillDataResponseSchema = getAutofillDataResponseSchema; - -const runtimeConfigurationSchema = _zod.z.object({ +const runtimeConfigurationSchema = exports.runtimeConfigurationSchema = _zod.z.object({ contentScope: contentScopeSchema, userUnprotectedDomains: _zod.z.array(_zod.z.string()), userPreferences: userPreferencesSchema }); - -exports.runtimeConfigurationSchema = runtimeConfigurationSchema; - -const storeFormDataSchema = _zod.z.object({ - credentials: outgoingCredentialsSchema.optional(), - trigger: _zod.z.union([_zod.z.literal("formSubmission"), _zod.z.literal("passwordGeneration"), _zod.z.literal("emailProtection")]).optional() -}); - -exports.storeFormDataSchema = storeFormDataSchema; - -const getAvailableInputTypesResultSchema = _zod.z.object({ - type: _zod.z.literal("getAvailableInputTypesResponse").optional(), - success: availableInputTypesSchema, - error: genericErrorSchema.optional() -}); - -exports.getAvailableInputTypesResultSchema = getAvailableInputTypesResultSchema; - -const providerStatusUpdatedSchema = _zod.z.object({ +const providerStatusUpdatedSchema = exports.providerStatusUpdatedSchema = _zod.z.object({ status: _zod.z.union([_zod.z.literal("locked"), _zod.z.literal("unlocked")]), credentials: _zod.z.array(credentialsSchema), availableInputTypes: availableInputTypes1Schema }); - -exports.providerStatusUpdatedSchema = providerStatusUpdatedSchema; - -const checkCredentialsProviderStatusResultSchema = _zod.z.object({ - type: _zod.z.literal("checkCredentialsProviderStatusResponse").optional(), - success: providerStatusUpdatedSchema, - error: genericErrorSchema.optional() -}); - -exports.checkCredentialsProviderStatusResultSchema = checkCredentialsProviderStatusResultSchema; - -const autofillSettingsSchema = _zod.z.object({ - featureToggles: autofillFeatureTogglesSchema -}); - -exports.autofillSettingsSchema = autofillSettingsSchema; - -const getRuntimeConfigurationResponseSchema = _zod.z.object({ +const getRuntimeConfigurationResponseSchema = exports.getRuntimeConfigurationResponseSchema = _zod.z.object({ type: _zod.z.literal("getRuntimeConfigurationResponse").optional(), success: runtimeConfigurationSchema.optional(), error: genericErrorSchema.optional() }); - -exports.getRuntimeConfigurationResponseSchema = getRuntimeConfigurationResponseSchema; - -const askToUnlockProviderResultSchema = _zod.z.object({ +const askToUnlockProviderResultSchema = exports.askToUnlockProviderResultSchema = _zod.z.object({ type: _zod.z.literal("askToUnlockProviderResponse").optional(), success: providerStatusUpdatedSchema, error: genericErrorSchema.optional() }); - -exports.askToUnlockProviderResultSchema = askToUnlockProviderResultSchema; - -const apiSchema = _zod.z.object({ +const checkCredentialsProviderStatusResultSchema = exports.checkCredentialsProviderStatusResultSchema = _zod.z.object({ + type: _zod.z.literal("checkCredentialsProviderStatusResponse").optional(), + success: providerStatusUpdatedSchema, + error: genericErrorSchema.optional() +}); +const apiSchema = exports.apiSchema = _zod.z.object({ addDebugFlag: _zod.z.record(_zod.z.unknown()).and(_zod.z.object({ paramsValidator: addDebugFlagParamsSchema.optional() })).optional(), @@ -19183,82 +17175,54 @@ const apiSchema = _zod.z.object({ closeEmailProtectionTab: _zod.z.record(_zod.z.unknown()).optional() }); -exports.apiSchema = apiSchema; - -},{"zod":8}],65:[function(require,module,exports){ +},{"zod":9}],67:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.GetAlias = void 0; - var _index = require("../../packages/device-api/index.js"); - var _validatorsZod = require("./__generated__/validators.zod.js"); - -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - /** * @extends {DeviceApiCall} */ class GetAlias extends _index.DeviceApiCall { - constructor() { - super(...arguments); - - _defineProperty(this, "method", 'emailHandlerGetAlias'); - - _defineProperty(this, "id", 'n/a'); - - _defineProperty(this, "paramsValidator", _validatorsZod.getAliasParamsSchema); - - _defineProperty(this, "resultValidator", _validatorsZod.getAliasResultSchema); - } - + method = 'emailHandlerGetAlias'; + id = 'n/a'; + paramsValidator = _validatorsZod.getAliasParamsSchema; + resultValidator = _validatorsZod.getAliasResultSchema; preResultValidation(response) { // convert to the correct format, because this is a legacy API return { success: response }; } - } - exports.GetAlias = GetAlias; -},{"../../packages/device-api/index.js":10,"./__generated__/validators.zod.js":64}],66:[function(require,module,exports){ +},{"../../packages/device-api/index.js":12,"./__generated__/validators.zod.js":66}],68:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.AndroidTransport = void 0; - var _index = require("../../../packages/device-api/index.js"); - var _deviceApiCalls = require("../__generated__/deviceApiCalls.js"); - -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - class AndroidTransport extends _index.DeviceApiTransport { /** @type {GlobalConfig} */ + config; /** @param {GlobalConfig} globalConfig */ constructor(globalConfig) { super(); - - _defineProperty(this, "config", void 0); - this.config = globalConfig; - if (this.config.isDDGTestMode) { - var _window$BrowserAutofi, _window$BrowserAutofi2; - - if (typeof ((_window$BrowserAutofi = window.BrowserAutofill) === null || _window$BrowserAutofi === void 0 ? void 0 : _window$BrowserAutofi.getAutofillData) !== 'function') { + if (typeof window.BrowserAutofill?.getAutofillData !== 'function') { console.warn('window.BrowserAutofill.getAutofillData missing'); } - - if (typeof ((_window$BrowserAutofi2 = window.BrowserAutofill) === null || _window$BrowserAutofi2 === void 0 ? void 0 : _window$BrowserAutofi2.storeFormData) !== 'function') { + if (typeof window.BrowserAutofill?.storeFormData !== 'function') { console.warn('window.BrowserAutofill.storeFormData missing'); } } @@ -19267,39 +17231,30 @@ class AndroidTransport extends _index.DeviceApiTransport { * @param {import("../../../packages/device-api").DeviceApiCall} deviceApiCall * @returns {Promise} */ - - async send(deviceApiCall) { if (deviceApiCall instanceof _deviceApiCalls.GetRuntimeConfigurationCall) { return androidSpecificRuntimeConfiguration(this.config); } - if (deviceApiCall instanceof _deviceApiCalls.GetAvailableInputTypesCall) { return androidSpecificAvailableInputTypes(this.config); } - if (deviceApiCall instanceof _deviceApiCalls.GetAutofillDataCall) { window.BrowserAutofill.getAutofillData(JSON.stringify(deviceApiCall.params)); return waitForResponse(deviceApiCall.id, this.config); } - if (deviceApiCall instanceof _deviceApiCalls.StoreFormDataCall) { return window.BrowserAutofill.storeFormData(JSON.stringify(deviceApiCall.params)); } - throw new Error('android: not implemented: ' + deviceApiCall.method); } - } + /** * @param {string} expectedResponse - the name/id of the response * @param {GlobalConfig} config * @returns {Promise<*>} */ - - exports.AndroidTransport = AndroidTransport; - function waitForResponse(expectedResponse, config) { return new Promise(resolve => { const handler = e => { @@ -19308,53 +17263,43 @@ function waitForResponse(expectedResponse, config) { return; } } - if (!e.data) { return; } - if (typeof e.data !== 'string') { if (config.isDDGTestMode) { console.log('❌ event.data was not a string. Expected a string so that it can be JSON parsed'); } - return; } - try { let data = JSON.parse(e.data); - if (data.type === expectedResponse) { window.removeEventListener('message', handler); return resolve(data); } - if (config.isDDGTestMode) { - console.log("\u274C event.data.type was '".concat(data.type, "', which didnt match '").concat(expectedResponse, "'"), JSON.stringify(data)); + console.log(`❌ event.data.type was '${data.type}', which didnt match '${expectedResponse}'`, JSON.stringify(data)); } } catch (e) { window.removeEventListener('message', handler); - if (config.isDDGTestMode) { console.log('❌ Could not JSON.parse the response'); } } }; - window.addEventListener('message', handler); }); } + /** * @param {GlobalConfig} globalConfig * @returns {{success: import('../__generated__/validators-ts').RuntimeConfiguration}} */ - - function androidSpecificRuntimeConfiguration(globalConfig) { if (!globalConfig.userPreferences) { throw new Error('globalConfig.userPreferences not supported yet on Android'); } - return { success: { // @ts-ignore @@ -19368,36 +17313,30 @@ function androidSpecificRuntimeConfiguration(globalConfig) { } }; } + /** * @param {GlobalConfig} globalConfig * @returns {{success: import('../__generated__/validators-ts').AvailableInputTypes}} */ - - function androidSpecificAvailableInputTypes(globalConfig) { if (!globalConfig.availableInputTypes) { throw new Error('globalConfig.availableInputTypes not supported yet on Android'); } - return { success: globalConfig.availableInputTypes }; } -},{"../../../packages/device-api/index.js":10,"../__generated__/deviceApiCalls.js":63}],67:[function(require,module,exports){ +},{"../../../packages/device-api/index.js":12,"../__generated__/deviceApiCalls.js":65}],69:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.AppleTransport = void 0; - var _messaging = require("../../../packages/messaging/messaging.js"); - var _index = require("../../../packages/device-api/index.js"); - var _deviceApiCalls = require("../__generated__/deviceApiCalls.js"); - class AppleTransport extends _index.DeviceApiTransport { /** @param {GlobalConfig} globalConfig */ constructor(globalConfig) { @@ -19410,7 +17349,6 @@ class AppleTransport extends _index.DeviceApiTransport { }); this.messaging = new _messaging.Messaging(webkitConfig); } - async send(deviceApiCall) { try { // if the call has an `id`, it means that it expects a response @@ -19424,27 +17362,22 @@ class AppleTransport extends _index.DeviceApiTransport { if (this.config.isDDGTestMode) { console.log('MissingWebkitHandler error for:', deviceApiCall.method); } - if (deviceApiCall instanceof _deviceApiCalls.GetRuntimeConfigurationCall) { return deviceApiCall.result(appleSpecificRuntimeConfiguration(this.config)); } - throw new Error('unimplemented handler: ' + deviceApiCall.method); } else { throw e; } } } - } + /** * @param {GlobalConfig} globalConfig * @returns {ReturnType} */ - - exports.AppleTransport = AppleTransport; - function appleSpecificRuntimeConfiguration(globalConfig) { return { success: { @@ -19460,74 +17393,58 @@ function appleSpecificRuntimeConfiguration(globalConfig) { }; } -},{"../../../packages/device-api/index.js":10,"../../../packages/messaging/messaging.js":13,"../__generated__/deviceApiCalls.js":63}],68:[function(require,module,exports){ +},{"../../../packages/device-api/index.js":12,"../../../packages/messaging/messaging.js":15,"../__generated__/deviceApiCalls.js":65}],70:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ExtensionTransport = void 0; - var _index = require("../../../packages/device-api/index.js"); - var _deviceApiCalls = require("../__generated__/deviceApiCalls.js"); - var _autofillUtils = require("../../autofill-utils.js"); - var _Settings = require("../../Settings.js"); - class ExtensionTransport extends _index.DeviceApiTransport { /** @param {GlobalConfig} globalConfig */ constructor(globalConfig) { super(); this.config = globalConfig; } - async send(deviceApiCall) { if (deviceApiCall instanceof _deviceApiCalls.GetRuntimeConfigurationCall) { return deviceApiCall.result(await extensionSpecificRuntimeConfiguration(this)); } - if (deviceApiCall instanceof _deviceApiCalls.GetAvailableInputTypesCall) { return deviceApiCall.result(await extensionSpecificGetAvailableInputTypes()); } - if (deviceApiCall instanceof _deviceApiCalls.SetIncontextSignupPermanentlyDismissedAtCall) { return deviceApiCall.result(await extensionSpecificSetIncontextSignupPermanentlyDismissedAtCall(deviceApiCall.params)); } - if (deviceApiCall instanceof _deviceApiCalls.GetIncontextSignupDismissedAtCall) { return deviceApiCall.result(await extensionSpecificGetIncontextSignupDismissedAt()); - } // TODO: unify all calls to use deviceApiCall.method instead of all these if blocks - + } + // TODO: unify all calls to use deviceApiCall.method instead of all these if blocks if (deviceApiCall instanceof _deviceApiCalls.SendJSPixelCall) { return deviceApiCall.result(await extensionSpecificSendPixel(deviceApiCall.params)); } - if (deviceApiCall instanceof _deviceApiCalls.AddDebugFlagCall) { return deviceApiCall.result(await extensionSpecificAddDebugFlag(deviceApiCall.params)); } - if (deviceApiCall instanceof _deviceApiCalls.CloseAutofillParentCall || deviceApiCall instanceof _deviceApiCalls.StartEmailProtectionSignupCall) { return; // noop } console.error('Send not implemented for ' + deviceApiCall.method); } - } + /** * @param {ExtensionTransport} deviceApi * @returns {Promise>} */ - - exports.ExtensionTransport = ExtensionTransport; - async function extensionSpecificRuntimeConfiguration(deviceApi) { - var _deviceApi$config; - const contentScope = await getContentScopeConfig(); const emailProtectionEnabled = (0, _autofillUtils.isAutofillEnabledFromProcessedConfig)(contentScope); const incontextSignupEnabled = (0, _autofillUtils.isIncontextSignupEnabledFromProcessedConfig)(contentScope); @@ -19540,7 +17457,8 @@ async function extensionSpecificRuntimeConfiguration(deviceApi) { features: { autofill: { settings: { - featureToggles: { ..._Settings.Settings.defaults.featureToggles, + featureToggles: { + ..._Settings.Settings.defaults.featureToggles, emailProtection: emailProtectionEnabled, emailProtection_incontext_signup: incontextSignupEnabled } @@ -19549,21 +17467,20 @@ async function extensionSpecificRuntimeConfiguration(deviceApi) { } }, // @ts-ignore - userUnprotectedDomains: (_deviceApi$config = deviceApi.config) === null || _deviceApi$config === void 0 ? void 0 : _deviceApi$config.userUnprotectedDomains + userUnprotectedDomains: deviceApi.config?.userUnprotectedDomains } }; } - async function extensionSpecificGetAvailableInputTypes() { const contentScope = await getContentScopeConfig(); const emailProtectionEnabled = (0, _autofillUtils.isAutofillEnabledFromProcessedConfig)(contentScope); return { - success: { ..._Settings.Settings.defaults.availableInputTypes, + success: { + ..._Settings.Settings.defaults.availableInputTypes, email: emailProtectionEnabled } }; } - async function getContentScopeConfig() { return new Promise(resolve => { chrome.runtime.sendMessage({ @@ -19576,11 +17493,10 @@ async function getContentScopeConfig() { }); }); } + /** * @param {import('../__generated__/validators-ts').SendJSPixelParams} params */ - - async function extensionSpecificSendPixel(params) { return new Promise(resolve => { chrome.runtime.sendMessage({ @@ -19591,11 +17507,10 @@ async function extensionSpecificSendPixel(params) { }); }); } + /** * @param {import('../__generated__/validators-ts').AddDebugFlagParams} params */ - - async function extensionSpecificAddDebugFlag(params) { return new Promise(resolve => { chrome.runtime.sendMessage({ @@ -19606,7 +17521,6 @@ async function extensionSpecificAddDebugFlag(params) { }); }); } - async function extensionSpecificGetIncontextSignupDismissedAt() { return new Promise(resolve => { chrome.runtime.sendMessage({ @@ -19616,11 +17530,10 @@ async function extensionSpecificGetIncontextSignupDismissedAt() { }); }); } + /** * @param {import('../__generated__/validators-ts').SetIncontextSignupPermanentlyDismissedAt} params */ - - async function extensionSpecificSetIncontextSignupPermanentlyDismissedAtCall(params) { return new Promise(resolve => { chrome.runtime.sendMessage({ @@ -19632,70 +17545,58 @@ async function extensionSpecificSetIncontextSignupPermanentlyDismissedAtCall(par }); } -},{"../../../packages/device-api/index.js":10,"../../Settings.js":48,"../../autofill-utils.js":59,"../__generated__/deviceApiCalls.js":63}],69:[function(require,module,exports){ +},{"../../../packages/device-api/index.js":12,"../../Settings.js":50,"../../autofill-utils.js":61,"../__generated__/deviceApiCalls.js":65}],71:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.createTransport = createTransport; - var _appleTransport = require("./apple.transport.js"); - var _androidTransport = require("./android.transport.js"); - var _extensionTransport = require("./extension.transport.js"); - var _windowsTransport = require("./windows.transport.js"); - /** * @param {GlobalConfig} globalConfig * @returns {import("../../../packages/device-api").DeviceApiTransport} */ -function createTransport(globalConfig) { - var _globalConfig$userPre, _globalConfig$userPre2, _globalConfig$userPre3, _globalConfig$userPre4; - if (typeof ((_globalConfig$userPre = globalConfig.userPreferences) === null || _globalConfig$userPre === void 0 ? void 0 : (_globalConfig$userPre2 = _globalConfig$userPre.platform) === null || _globalConfig$userPre2 === void 0 ? void 0 : _globalConfig$userPre2.name) === 'string') { - switch ((_globalConfig$userPre3 = globalConfig.userPreferences) === null || _globalConfig$userPre3 === void 0 ? void 0 : (_globalConfig$userPre4 = _globalConfig$userPre3.platform) === null || _globalConfig$userPre4 === void 0 ? void 0 : _globalConfig$userPre4.name) { +function createTransport(globalConfig) { + if (typeof globalConfig.userPreferences?.platform?.name === 'string') { + switch (globalConfig.userPreferences?.platform?.name) { case 'ios': case 'macos': return new _appleTransport.AppleTransport(globalConfig); - case 'android': return new _androidTransport.AndroidTransport(globalConfig); - default: throw new Error('selectSender unimplemented!'); } } - if (globalConfig.isWindows) { return new _windowsTransport.WindowsTransport(); - } // fallback for when `globalConfig.userPreferences.platform.name` is absent - + } + // fallback for when `globalConfig.userPreferences.platform.name` is absent if (globalConfig.isDDGApp) { if (globalConfig.isAndroid) { return new _androidTransport.AndroidTransport(globalConfig); } - throw new Error('unreachable, createTransport'); - } // falls back to extension... is this still the best way to determine this? - + } + // falls back to extension... is this still the best way to determine this? return new _extensionTransport.ExtensionTransport(globalConfig); } -},{"./android.transport.js":66,"./apple.transport.js":67,"./extension.transport.js":68,"./windows.transport.js":70}],70:[function(require,module,exports){ +},{"./android.transport.js":68,"./apple.transport.js":69,"./extension.transport.js":70,"./windows.transport.js":72}],72:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.WindowsTransport = void 0; - var _index = require("../../../packages/device-api/index.js"); - /** * @typedef {import('../../../packages/device-api/lib/device-api').CallOptions} CallOptions * @typedef {import("../../../packages/device-api").DeviceApiCall} DeviceApiCall @@ -19705,19 +17606,15 @@ class WindowsTransport extends _index.DeviceApiTransport { if (deviceApiCall.id) { return windowsTransport(deviceApiCall, options).withResponse(deviceApiCall.id); } - return windowsTransport(deviceApiCall, options); } - } + /** * @param {DeviceApiCall} deviceApiCall * @param {CallOptions} [options] */ - - exports.WindowsTransport = WindowsTransport; - function windowsTransport(deviceApiCall, options) { windowsInteropPostMessage({ Feature: 'Autofill', @@ -19733,7 +17630,6 @@ function windowsTransport(deviceApiCall, options) { withResponse(responseId) { return waitForWindowsResponse(responseId, options); } - }; } /** @@ -19741,59 +17637,50 @@ function windowsTransport(deviceApiCall, options) { * @param {CallOptions} [options] * @returns {Promise} */ - - function waitForWindowsResponse(responseId, options) { return new Promise((resolve, reject) => { - var _options$signal, _options$signal2; - // if already aborted, reject immediately - if (options !== null && options !== void 0 && (_options$signal = options.signal) !== null && _options$signal !== void 0 && _options$signal.aborted) { + if (options?.signal?.aborted) { return reject(new DOMException('Aborted', 'AbortError')); } + let teardown; - let teardown; // The event handler - + // The event handler const handler = event => { // console.log(`📩 windows, ${window.location.href}`, [event.origin, JSON.stringify(event.data)]) if (!event.data) { console.warn('data absent from message'); return; } - if (event.data.type === responseId) { teardown(); resolve(event.data); } - }; // what to do if this promise is aborted - + }; + // what to do if this promise is aborted const abortHandler = () => { teardown(); reject(new DOMException('Aborted', 'AbortError')); - }; // setup - + }; + // setup windowsInteropAddEventListener('message', handler); - options === null || options === void 0 ? void 0 : (_options$signal2 = options.signal) === null || _options$signal2 === void 0 ? void 0 : _options$signal2.addEventListener('abort', abortHandler); - + options?.signal?.addEventListener('abort', abortHandler); teardown = () => { - var _options$signal3; - windowsInteropRemoveEventListener('message', handler); - options === null || options === void 0 ? void 0 : (_options$signal3 = options.signal) === null || _options$signal3 === void 0 ? void 0 : _options$signal3.removeEventListener('abort', abortHandler); + options?.signal?.removeEventListener('abort', abortHandler); }; }); } -},{"../../../packages/device-api/index.js":10}],71:[function(require,module,exports){ +},{"../../../packages/device-api/index.js":12}],73:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; - /*! * Copyright 2015 Google Inc. All rights reserved. * @@ -19809,15 +17696,14 @@ exports.default = void 0; * or implied. See the License for the specific language governing * permissions and limitations under the License. */ - /* * @see https://developers.google.com/web/updates/2015/08/using-requestidlecallback */ // @ts-ignore window.requestIdleCallback = window.requestIdleCallback || function (cb) { return setTimeout(function () { - const start = Date.now(); // eslint-disable-next-line standard/no-callback-literal - + const start = Date.now(); + // eslint-disable-next-line standard/no-callback-literal cb({ didTimeout: false, timeRemaining: function () { @@ -19826,12 +17712,9 @@ window.requestIdleCallback = window.requestIdleCallback || function (cb) { }); }, 1); }; - window.cancelIdleCallback = window.cancelIdleCallback || function (id) { clearTimeout(id); }; +var _default = exports.default = {}; -var _default = {}; -exports.default = _default; - -},{}]},{},[60]); +},{}]},{},[62]); diff --git a/swift-package/Resources/assets/autofill.js b/swift-package/Resources/assets/autofill.js index 591e41063..2371f2b2b 100644 --- a/swift-package/Resources/assets/autofill.js +++ b/swift-package/Resources/assets/autofill.js @@ -5,7 +5,6 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.processConfig = processConfig; - function getTopLevelURL() { try { // FROM: https://stackoverflow.com/a/7739035/73479 @@ -19,20 +18,18 @@ function getTopLevelURL() { return new URL(location.href); } } - function isUnprotectedDomain(topLevelUrl, featureList) { let unprotectedDomain = false; - const domainParts = topLevelUrl && topLevelUrl.host ? topLevelUrl.host.split('.') : []; // walk up the domain to see if it's unprotected + const domainParts = topLevelUrl && topLevelUrl.host ? topLevelUrl.host.split('.') : []; + // walk up the domain to see if it's unprotected while (domainParts.length > 1 && !unprotectedDomain) { const partialDomain = domainParts.join('.'); unprotectedDomain = featureList.filter(domain => domain.domain === partialDomain).length > 0; domainParts.shift(); } - return unprotectedDomain; } - function processConfig(data, userList, preferences) { const topLevelUrl = getTopLevelURL(); const allowlisted = userList.filter(domain => domain === topLevelUrl.host).length > 0; @@ -46,8 +43,8 @@ function processConfig(data, userList, preferences) { isBroken, allowlisted, enabledFeatures - }; // TODO - + }; + // TODO preferences.cookie = {}; return preferences; } @@ -94,9 +91,7 @@ Object.defineProperty(exports, "validate", { return _deviceApiCall.validate; } }); - var _deviceApiCall = require("./lib/device-api-call.js"); - var _deviceApi = require("./lib/device-api.js"); },{"./lib/device-api-call.js":3,"./lib/device-api.js":4}],3:[function(require,module,exports){ @@ -110,9 +105,6 @@ exports.createDeviceApiCall = createDeviceApiCall; exports.createNotification = void 0; exports.createRequest = createRequest; exports.validate = validate; - -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - /** * This roughly follows https://www.jsonrpc.org/specification * @template {import("zod").ZodType} Params=import("zod").ZodType @@ -120,18 +112,18 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope */ class DeviceApiCall { /** @type {string} */ - + method = 'unknown'; /** * An optional 'id' - used to indicate if a request requires a response. * @type {string|null} */ - + id = null; /** @type {Params | null | undefined} */ - + paramsValidator = null; /** @type {Result | null | undefined} */ - + resultValidator = null; /** @type {import("zod").infer} */ - + params; /** * This is a carve-out for legacy messages that are not typed yet. * If you set this to 'true', then the response will not be checked to conform @@ -139,7 +131,7 @@ class DeviceApiCall { * @deprecated this is here to aid migration, should be removed ASAP * @type {boolean} */ - + throwOnResultKeysMissing = true; /** * New messages should be in a particular format, eg: { success: T }, * but you can set this to false if you want to access the result as-is, @@ -147,96 +139,67 @@ class DeviceApiCall { * @deprecated this is here to aid migration, should be removed ASAP * @type {boolean} */ - + unwrapResult = true; /** * @param {import("zod").infer} data */ constructor(data) { - _defineProperty(this, "method", 'unknown'); - - _defineProperty(this, "id", null); - - _defineProperty(this, "paramsValidator", null); - - _defineProperty(this, "resultValidator", null); - - _defineProperty(this, "params", void 0); - - _defineProperty(this, "throwOnResultKeysMissing", true); - - _defineProperty(this, "unwrapResult", true); - this.params = data; } + /** * @returns {import("zod").infer|undefined} */ - - validateParams() { if (this.params === undefined) { return undefined; } - this._validate(this.params, this.paramsValidator); - return this.params; } + /** * @param {any|null} incoming * @returns {import("zod").infer} */ - - validateResult(incoming) { this._validate(incoming, this.resultValidator); - if (!incoming) { return incoming; } - if (!this.unwrapResult) { return incoming; } - if ('data' in incoming) { console.warn('response had `data` property. Please migrate to `success`'); return incoming.data; } - if ('success' in incoming) { return incoming.success; } - if ('error' in incoming) { if (typeof incoming.error.message === 'string') { - throw new DeviceApiCallError("".concat(this.method, ": ").concat(incoming.error.message)); + throw new DeviceApiCallError(`${this.method}: ${incoming.error.message}`); } } - if (this.throwOnResultKeysMissing) { throw new Error('unreachable. Response did not contain `success` or `data`'); } - return incoming; } + /** * @param {any} data * @param {import("zod").ZodType|undefined|null} [validator] * @private */ - - _validate(data, validator) { if (!validator) return data; - if (validator) { - const result = validator === null || validator === void 0 ? void 0 : validator.safeParse(data); - + const result = validator?.safeParse(data); if (!result) { throw new Error('unreachable, data failure', data); } - if (!result.success) { if ('error' in result) { this.throwError(result.error.issues); @@ -246,15 +209,15 @@ class DeviceApiCall { } } } + /** * @param {import('zod').ZodIssue[]} errors */ - - throwError(errors) { const error = SchemaValidationError.fromZodErrors(errors, this.constructor.name); throw error; } + /** * Use this helper for creating stand-in response messages that are typed correctly. * @@ -268,38 +231,26 @@ class DeviceApiCall { * @param {import("zod").infer} response * @returns {import("zod").infer} */ - - result(response) { return response; } /** * @returns {import("zod").infer} */ - - preResultValidation(response) { return response; } - } - exports.DeviceApiCall = DeviceApiCall; - class DeviceApiCallError extends Error {} + /** * Check for this error if you'd like to */ - - exports.DeviceApiCallError = DeviceApiCallError; - class SchemaValidationError extends Error { - constructor() { - super(...arguments); - - _defineProperty(this, "validationErrors", []); - } + /** @type {import("zod").ZodIssue[]} */ + validationErrors = []; /** * @param {import("zod").ZodIssue[]} errors @@ -307,17 +258,15 @@ class SchemaValidationError extends Error { * @returns {SchemaValidationError} */ static fromZodErrors(errors, name) { - const heading = "".concat(errors.length, " SchemaValidationError(s) errors for ") + name; - + const heading = `${errors.length} SchemaValidationError(s) errors for ` + name; function log(issue) { switch (issue.code) { case 'invalid_literal': case 'invalid_type': { - console.log("".concat(name, ". Path: '").concat(issue.path.join('.'), "', Error: '").concat(issue.message, "'")); + console.log(`${name}. Path: '${issue.path.join('.')}', Error: '${issue.message}'`); break; } - case 'invalid_union': { for (let unionError of issue.unionErrors) { @@ -325,28 +274,24 @@ class SchemaValidationError extends Error { log(issue1); } } - break; } - default: { console.log(name, 'other issue:', issue); } } } - for (let error of errors) { log(error); } - const message = [heading, 'please see the details above'].join('\n '); const error = new SchemaValidationError(message); error.validationErrors = errors; return error; } - } + /** * Creates an instance of `DeviceApiCall` from only a name and 'params' * and optional validators. Use this to help migrate existing messages. @@ -359,14 +304,10 @@ class SchemaValidationError extends Error { * @param {Result|null} [resultValidator] * @returns {DeviceApiCall} */ - - exports.SchemaValidationError = SchemaValidationError; - function createDeviceApiCall(method, params) { let paramsValidator = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null; let resultValidator = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null; - /** @type {DeviceApiCall} */ const deviceApiCall = new DeviceApiCall(params); deviceApiCall.paramsValidator = paramsValidator; @@ -376,6 +317,7 @@ function createDeviceApiCall(method, params) { deviceApiCall.unwrapResult = false; return deviceApiCall; } + /** * Creates an instance of `DeviceApiCall` from only a name and 'params' * and optional validators. Use this to help migrate existing messages. @@ -392,8 +334,6 @@ function createDeviceApiCall(method, params) { * @param {Result|null} [resultValidator] * @returns {DeviceApiCall} */ - - function createRequest(method, params) { let id = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'n/a'; let paramsValidator = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null; @@ -402,8 +342,8 @@ function createRequest(method, params) { call.id = id; return call; } +const createNotification = exports.createNotification = createDeviceApiCall; -const createNotification = createDeviceApiCall; /** * Validate any arbitrary data with any Zod validator * @@ -412,16 +352,11 @@ const createNotification = createDeviceApiCall; * @param {Validator | null} [validator] * @returns {import("zod").infer} */ - -exports.createNotification = createNotification; - function validate(data) { let validator = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; - if (validator) { return validator.parse(data); } - return data; } @@ -432,9 +367,6 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.DeviceApiTransport = exports.DeviceApi = void 0; - -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - /** * Platforms should only need to implement this `send` method */ @@ -447,8 +379,8 @@ class DeviceApiTransport { async send(_deviceApiCall, _options) { return undefined; } - } + /** * This is the base Sender class that platforms can will implement. * @@ -457,17 +389,12 @@ class DeviceApiTransport { * @typedef CallOptions * @property {AbortSignal} [signal] */ - - exports.DeviceApiTransport = DeviceApiTransport; - class DeviceApi { /** @type {DeviceApiTransport} */ - + transport; /** @param {DeviceApiTransport} transport */ constructor(transport) { - _defineProperty(this, "transport", void 0); - this.transport = transport; } /** @@ -476,8 +403,6 @@ class DeviceApi { * @param {CallOptions} [options] * @returns {Promise['success']>>} */ - - async request(deviceApiCall, options) { deviceApiCall.validateParams(); let result = await this.transport.send(deviceApiCall, options); @@ -490,15 +415,11 @@ class DeviceApi { * @param {CallOptions} [options] * @returns {Promise} */ - - async notify(deviceApiCall, options) { deviceApiCall.validateParams(); return this.transport.send(deviceApiCall, options); } - } - exports.DeviceApi = DeviceApi; },{}],5:[function(require,module,exports){ @@ -514,9 +435,7 @@ Object.defineProperty(exports, "WebkitMessagingConfig", { return _webkit.WebkitMessagingConfig; } }); - var _webkit = require("./webkit.js"); - /** * @module Messaging * @@ -594,8 +513,6 @@ class Messaging { * @param {string} name * @param {Record} [data] */ - - notify(name) { let data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; this.transport.notify(name, data); @@ -615,21 +532,16 @@ class Messaging { * @param {Record} [data] * @return {Promise} */ - - request(name) { let data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; return this.transport.request(name, data); } - } + /** * @interface */ - - exports.Messaging = Messaging; - class MessagingTransport { /** * @param {string} name @@ -647,34 +559,27 @@ class MessagingTransport { * @return {Promise} */ // @ts-ignore - ignoring a no-unused ts error, this is only an interface. - - request(name) { let data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; throw new Error('must implement'); } - } + /** * @param {WebkitMessagingConfig} config * @returns {MessagingTransport} */ - - exports.MessagingTransport = MessagingTransport; - function getTransport(config) { if (config instanceof _webkit.WebkitMessagingConfig) { return new _webkit.WebkitMessagingTransport(config); } - throw new Error('unreachable'); } + /** * Thrown when a handler cannot be found */ - - class MissingHandler extends Error { /** * @param {string} message @@ -684,13 +589,11 @@ class MissingHandler extends Error { super(message); this.handlerName = handlerName; } - } + /** * Some re-exports for convenience */ - - exports.MissingHandler = MissingHandler; },{"./webkit.js":6}],6:[function(require,module,exports){ @@ -700,10 +603,37 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.WebkitMessagingTransport = exports.WebkitMessagingConfig = exports.SecureMessagingParams = void 0; - var _messaging = require("./messaging.js"); - -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } +/** + * @module Webkit Messaging + * + * @description + * + * A wrapper for messaging on WebKit platforms. It supports modern WebKit messageHandlers + * along with encryption for older versions (like macOS Catalina) + * + * Note: If you wish to support Catalina then you'll need to implement the native + * part of the message handling, see {@link WebkitMessagingTransport} for details. + * + * ```js + * import { Messaging, WebkitMessagingConfig } from "@duckduckgo/content-scope-scripts/lib/messaging.js" + * + * // This config would be injected into the UserScript + * const injectedConfig = { + * hasModernWebkitAPI: true, + * webkitMessageHandlerNames: ["foo", "bar", "baz"], + * secret: "dax", + * }; + * + * // Then use that config to construct platform-specific configuration + * const config = new WebkitMessagingConfig(injectedConfig); + * + * // finally, get an instance of Messaging and start sending messages in a unified way 🚀 + * const messaging = new Messaging(config); + * messaging.notify("hello world!", {foo: "bar"}) + * + * ``` + */ /** * @typedef {import("./messaging").MessagingTransport} MessagingTransport @@ -757,77 +687,59 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope */ class WebkitMessagingTransport { /** @type {WebkitMessagingConfig} */ - + config; + globals; /** - * @param {WebkitMessagingConfig} config - */ + * @param {WebkitMessagingConfig} config + */ constructor(config) { - _defineProperty(this, "config", void 0); - - _defineProperty(this, "globals", void 0); - - _defineProperty(this, "algoObj", { - name: 'AES-GCM', - length: 256 - }); - this.config = config; this.globals = captureGlobals(); - if (!this.config.hasModernWebkitAPI) { this.captureWebkitHandlers(this.config.webkitMessageHandlerNames); } } /** - * Sends message to the webkit layer (fire and forget) - * @param {String} handler - * @param {*} data - * @internal - */ - - + * Sends message to the webkit layer (fire and forget) + * @param {String} handler + * @param {*} data + * @internal + */ wkSend(handler) { - var _this$globals$window$, _this$globals$window$2; - let data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - if (!(handler in this.globals.window.webkit.messageHandlers)) { - throw new _messaging.MissingHandler("Missing webkit handler: '".concat(handler, "'"), handler); + throw new _messaging.MissingHandler(`Missing webkit handler: '${handler}'`, handler); } - - const outgoing = { ...data, - messageHandling: { ...data.messageHandling, + const outgoing = { + ...data, + messageHandling: { + ...data.messageHandling, secret: this.config.secret } }; - if (!this.config.hasModernWebkitAPI) { if (!(handler in this.globals.capturedWebkitHandlers)) { - throw new _messaging.MissingHandler("cannot continue, method ".concat(handler, " not captured on macos < 11"), handler); + throw new _messaging.MissingHandler(`cannot continue, method ${handler} not captured on macos < 11`, handler); } else { return this.globals.capturedWebkitHandlers[handler](outgoing); } } - - return (_this$globals$window$ = (_this$globals$window$2 = this.globals.window.webkit.messageHandlers[handler]).postMessage) === null || _this$globals$window$ === void 0 ? void 0 : _this$globals$window$.call(_this$globals$window$2, outgoing); + return this.globals.window.webkit.messageHandlers[handler].postMessage?.(outgoing); } - /** - * Sends message to the webkit layer and waits for the specified response - * @param {String} handler - * @param {*} data - * @returns {Promise<*>} - * @internal - */ - + /** + * Sends message to the webkit layer and waits for the specified response + * @param {String} handler + * @param {*} data + * @returns {Promise<*>} + * @internal + */ async wkSendAndWait(handler) { let data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - if (this.config.hasModernWebkitAPI) { const response = await this.wkSend(handler, data); return this.globals.JSONparse(response || '{}'); } - try { const randMethodName = this.createRandMethodName(); const key = await this.createRandKey(); @@ -835,9 +747,7 @@ class WebkitMessagingTransport { const { ciphertext, tag - } = await new this.globals.Promise(( - /** @type {any} */ - resolve) => { + } = await new this.globals.Promise(( /** @type {any} */resolve) => { this.generateRandomMethod(randMethodName, resolve); data.messageHandling = new SecureMessagingParams({ methodName: randMethodName, @@ -864,89 +774,81 @@ class WebkitMessagingTransport { } } /** - * @param {string} name - * @param {Record} [data] - */ - - + * @param {string} name + * @param {Record} [data] + */ notify(name) { let data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; this.wkSend(name, data); } /** - * @param {string} name - * @param {Record} [data] - */ - - + * @param {string} name + * @param {Record} [data] + */ request(name) { let data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; return this.wkSendAndWait(name, data); } /** - * Generate a random method name and adds it to the global scope - * The native layer will use this method to send the response - * @param {string | number} randomMethodName - * @param {Function} callback - */ - - + * Generate a random method name and adds it to the global scope + * The native layer will use this method to send the response + * @param {string | number} randomMethodName + * @param {Function} callback + */ generateRandomMethod(randomMethodName, callback) { var _this = this; - this.globals.ObjectDefineProperty(this.globals.window, randomMethodName, { enumerable: false, // configurable, To allow for deletion later configurable: true, writable: false, - /** * @param {any[]} args */ value: function () { - callback(...arguments); // @ts-ignore - we want this to throw if it fails as it would indicate a fatal error. - + callback(...arguments); + // @ts-ignore - we want this to throw if it fails as it would indicate a fatal error. delete _this.globals.window[randomMethodName]; } }); } - randomString() { return '' + this.globals.getRandomValues(new this.globals.Uint32Array(1))[0]; } - createRandMethodName() { return '_' + this.randomString(); } - /** - * @type {{name: string, length: number}} - */ + /** + * @type {{name: string, length: number}} + */ + algoObj = { + name: 'AES-GCM', + length: 256 + }; /** - * @returns {Promise} - */ + * @returns {Promise} + */ async createRandKey() { const key = await this.globals.generateKey(this.algoObj, true, ['encrypt', 'decrypt']); const exportedKey = await this.globals.exportKey('raw', key); return new this.globals.Uint8Array(exportedKey); } - /** - * @returns {Uint8Array} - */ - + /** + * @returns {Uint8Array} + */ createRandIv() { return this.globals.getRandomValues(new this.globals.Uint8Array(12)); } - /** - * @param {BufferSource} ciphertext - * @param {BufferSource} key - * @param {Uint8Array} iv - * @returns {Promise} - */ - + /** + * @param {BufferSource} ciphertext + * @param {BufferSource} key + * @param {Uint8Array} iv + * @returns {Promise} + */ async decrypt(ciphertext, key, iv) { const cryptoKey = await this.globals.importKey('raw', key, 'AES-GCM', false, ['decrypt']); const algo = { @@ -957,37 +859,31 @@ class WebkitMessagingTransport { let dec = new this.globals.TextDecoder(); return dec.decode(decrypted); } - /** - * When required (such as on macos 10.x), capture the `postMessage` method on - * each webkit messageHandler - * - * @param {string[]} handlerNames - */ - + /** + * When required (such as on macos 10.x), capture the `postMessage` method on + * each webkit messageHandler + * + * @param {string[]} handlerNames + */ captureWebkitHandlers(handlerNames) { const handlers = window.webkit.messageHandlers; if (!handlers) throw new _messaging.MissingHandler('window.webkit.messageHandlers was absent', 'all'); - for (let webkitMessageHandlerName of handlerNames) { - var _handlers$webkitMessa; - - if (typeof ((_handlers$webkitMessa = handlers[webkitMessageHandlerName]) === null || _handlers$webkitMessa === void 0 ? void 0 : _handlers$webkitMessa.postMessage) === 'function') { - var _handlers$webkitMessa2; - + if (typeof handlers[webkitMessageHandlerName]?.postMessage === 'function') { /** * `bind` is used here to ensure future calls to the captured * `postMessage` have the correct `this` context */ const original = handlers[webkitMessageHandlerName]; - const bound = (_handlers$webkitMessa2 = handlers[webkitMessageHandlerName].postMessage) === null || _handlers$webkitMessa2 === void 0 ? void 0 : _handlers$webkitMessa2.bind(original); + const bound = handlers[webkitMessageHandlerName].postMessage?.bind(original); this.globals.capturedWebkitHandlers[webkitMessageHandlerName] = bound; delete handlers[webkitMessageHandlerName].postMessage; } } } - } + /** * Use this configuration to create an instance of {@link Messaging} for WebKit * @@ -1004,10 +900,7 @@ class WebkitMessagingTransport { * const resp = await messaging.request("debugConfig") * ``` */ - - exports.WebkitMessagingTransport = WebkitMessagingTransport; - class WebkitMessagingConfig { /** * @param {object} params @@ -1024,25 +917,20 @@ class WebkitMessagingConfig { /** * A list of WebKit message handler names that a user script can send */ - this.webkitMessageHandlerNames = params.webkitMessageHandlerNames; /** * A string provided by native platforms to be sent with future outgoing * messages */ - this.secret = params.secret; } - } + /** * This is the additional payload that gets appended to outgoing messages. * It's used in the Swift side to encrypt the response that comes back */ - - exports.WebkitMessagingConfig = WebkitMessagingConfig; - class SecureMessagingParams { /** * @param {object} params @@ -1059,29 +947,23 @@ class SecureMessagingParams { /** * The secret used to ensure message sender validity */ - this.secret = params.secret; /** * The CipherKey as number[] */ - this.key = params.key; /** * The Initial Vector as number[] */ - this.iv = params.iv; } - } + /** * Capture some globals used for messaging handling to prevent page * scripts from tampering with this */ - - exports.SecureMessagingParams = SecureMessagingParams; - function captureGlobals() { // Creat base with null prototype return { @@ -1104,7 +986,6 @@ function captureGlobals() { Promise: window.Promise, ObjectDefineProperty: window.Object.defineProperty, addEventListener: window.addEventListener.bind(window), - /** @type {Record} */ capturedWebkitHandlers: {} }; @@ -1131,13 +1012,9 @@ Object.defineProperty(exports, "constants", { } }); exports.generate = generate; - var _applePassword = require("./lib/apple.password.js"); - var _rulesParser = require("./lib/rules-parser.js"); - var _constants = require("./lib/constants.js"); - /** * @typedef {{ * domain?: string | null | undefined; @@ -1146,7 +1023,6 @@ var _constants = require("./lib/constants.js"); * onError?: ((error: unknown) => void) | null | undefined; * }} GenerateOptions */ - /** * Generate a random password based on the following attempts * @@ -1161,16 +1037,13 @@ var _constants = require("./lib/constants.js"); */ function generate() { let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - try { - if (typeof (options === null || options === void 0 ? void 0 : options.input) === 'string') { + if (typeof options?.input === 'string') { return _applePassword.Password.generateOrThrow(options.input); } - - if (typeof (options === null || options === void 0 ? void 0 : options.domain) === 'string') { - if (options !== null && options !== void 0 && options.rules) { + if (typeof options?.domain === 'string') { + if (options?.rules) { const rules = _selectPasswordRules(options.domain, options.rules); - if (rules) { return _applePassword.Password.generateOrThrow(rules); } @@ -1178,25 +1051,25 @@ function generate() { } } catch (e) { // if an 'onError' callback was provided, forward all errors - if (options !== null && options !== void 0 && options.onError && typeof (options === null || options === void 0 ? void 0 : options.onError) === 'function') { + if (options?.onError && typeof options?.onError === 'function') { options.onError(e); } else { // otherwise, only console.error unknown errors (which could be implementation bugs) const isKnownError = e instanceof _rulesParser.ParserError || e instanceof HostnameInputError; - if (!isKnownError) { console.error(e); } } - } // At this point, we have to trust the generation will not throw - // as it is NOT using any user/page-provided data - + } + // At this point, we have to trust the generation will not throw + // as it is NOT using any user/page-provided data return _applePassword.Password.generateDefault(); -} // An extension type to differentiate between known errors - +} +// An extension type to differentiate between known errors class HostnameInputError extends Error {} + /** * @typedef {Record} RulesFormat */ @@ -1208,54 +1081,44 @@ class HostnameInputError extends Error {} * @returns {string | undefined} * @throws {HostnameInputError} */ - - exports.HostnameInputError = HostnameInputError; - function _selectPasswordRules(inputHostname, rules) { - const hostname = _safeHostname(inputHostname); // direct match - - + const hostname = _safeHostname(inputHostname); + // direct match if (rules[hostname]) { return rules[hostname]['password-rules']; - } // otherwise, start chopping off subdomains and re-joining to compare - + } + // otherwise, start chopping off subdomains and re-joining to compare const pieces = hostname.split('.'); - while (pieces.length > 1) { pieces.shift(); const joined = pieces.join('.'); - if (rules[joined]) { return rules[joined]['password-rules']; } } - return undefined; } + /** * @private * @param {string} inputHostname; * @throws {HostnameInputError} * @returns {string} */ - - function _safeHostname(inputHostname) { if (inputHostname.startsWith('http:') || inputHostname.startsWith('https:')) { throw new HostnameInputError('invalid input, you can only provide a hostname but you gave a scheme'); } - if (inputHostname.includes(':')) { throw new HostnameInputError('invalid input, you can only provide a hostname but you gave a :port'); } - try { const asUrl = new URL('https://' + inputHostname); return asUrl.hostname; } catch (e) { - throw new HostnameInputError("could not instantiate a URL from that hostname ".concat(inputHostname)); + throw new HostnameInputError(`could not instantiate a URL from that hostname ${inputHostname}`); } } @@ -1266,16 +1129,23 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.Password = void 0; - var parser = _interopRequireWildcard(require("./rules-parser.js")); - var _constants = require("./constants.js"); - function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } - function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } - -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } +/* + * + * NOTE: + * + * This file was created with inspiration from https://developer.apple.com/password-rules + * + * * The changes made by DuckDuckGo employees are: + * + * 1) removed all logic relating to 'more typeable passwords' + * 2) reduced the number of password styles from 4 to only the 1 which suits our needs + * 2) added JSDoc comments (for Typescript checking) + * + */ /** * @typedef {{ @@ -1287,7 +1157,6 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope * PasswordMaxLength?: number, * }} Requirements */ - /** * @typedef {{ * NumberOfRequiredRandomCharacters: number, @@ -1301,12 +1170,12 @@ const defaults = Object.freeze({ defaultPasswordLength: _constants.constants.DEFAULT_MIN_LENGTH, defaultPasswordRules: _constants.constants.DEFAULT_PASSWORD_RULES, defaultRequiredCharacterSets: ['abcdefghijklmnopqrstuvwxyz', 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', '0123456789'], - /** * @type {typeof window.crypto.getRandomValues | null} */ getRandomValues: null }); + /** * This is added here to ensure: * @@ -1316,37 +1185,28 @@ const defaults = Object.freeze({ * * @type {{ getRandomValues: typeof window.crypto.getRandomValues }} */ - const safeGlobals = {}; - if (typeof window !== 'undefined') { safeGlobals.getRandomValues = window.crypto.getRandomValues.bind(window.crypto); } - class Password { - /** - * @type {typeof defaults} - */ - /** * @param {Partial} [options] */ constructor() { let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - - _defineProperty(this, "options", void 0); - - this.options = { ...defaults, + /** + * @type {typeof defaults} + */ + this.options = { + ...defaults, ...options }; return this; } - /** - * This is here to provide external access to un-modified defaults - * in case they are needed for tests/verifications - * @type {typeof defaults} - */ - + static get defaults() { + return defaults; + } /** * Generates a password from the given input. @@ -1381,12 +1241,11 @@ class Password { * @param {Partial} [options] * @returns {string} */ - - static generateDefault() { let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; return new Password(options).parse(Password.defaults.defaultPasswordRules).generate(); } + /** * Convert a ruleset into it's internally-used component pieces. * @@ -1400,59 +1259,44 @@ class Password { * generate: () => string; * }} */ - - parse(inputString) { const rules = parser.parsePasswordRules(inputString); - const requirements = this._requirementsFromRules(rules); - if (!requirements) throw new Error('could not generate requirements for ' + JSON.stringify(inputString)); - const parameters = this._passwordGenerationParametersDictionary(requirements); - return { requirements, parameters, rules, - get entropy() { return Math.log2(parameters.PasswordAllowedCharacters.length ** parameters.NumberOfRequiredRandomCharacters); }, - generate: () => { const password = this._generatedPasswordMatchingRequirements(requirements, parameters); /** * The following is unreachable because if user input was incorrect then * the parsing phase would throw. The following lines is to satisfy Typescript */ - - if (password === '') throw new Error('unreachable'); return password; } }; } + /** * Given an array of `Rule's`, convert into `Requirements` * * @param {parser.Rule[]} passwordRules * @returns {Requirements | null} */ - - _requirementsFromRules(passwordRules) { /** @type {Requirements} */ const requirements = {}; - for (let rule of passwordRules) { if (rule.name === parser.RuleName.ALLOWED) { console.assert(!('PasswordAllowedCharacters' in requirements)); - const chars = this._charactersFromCharactersClasses(rule.value); - const scanSet = this._canonicalizedScanSetFromCharacters(chars); - if (scanSet) { requirements.PasswordAllowedCharacters = scanSet; } @@ -1461,108 +1305,94 @@ class Password { requirements.PasswordRepeatedCharacterLimit = rule.value; } else if (rule.name === parser.RuleName.REQUIRED) { let requiredCharacters = requirements.PasswordRequiredCharacters; - if (!requiredCharacters) { requiredCharacters = requirements.PasswordRequiredCharacters = []; } - requiredCharacters.push(this._canonicalizedScanSetFromCharacters(this._charactersFromCharactersClasses(rule.value))); } else if (rule.name === parser.RuleName.MIN_LENGTH) { requirements.PasswordMinLength = rule.value; } else if (rule.name === parser.RuleName.MAX_LENGTH) { requirements.PasswordMaxLength = rule.value; } - } // Only include an allowed rule matching SCAN_SET_ORDER (all characters) when a required rule is also present. - + } + // Only include an allowed rule matching SCAN_SET_ORDER (all characters) when a required rule is also present. if (requirements.PasswordAllowedCharacters === this.options.SCAN_SET_ORDER && !requirements.PasswordRequiredCharacters) { delete requirements.PasswordAllowedCharacters; - } // Fix up PasswordRequiredCharacters, if needed. - + } + // Fix up PasswordRequiredCharacters, if needed. if (requirements.PasswordRequiredCharacters && requirements.PasswordRequiredCharacters.length === 1 && requirements.PasswordRequiredCharacters[0] === this.options.SCAN_SET_ORDER) { delete requirements.PasswordRequiredCharacters; } - return Object.keys(requirements).length ? requirements : null; } + /** * @param {number} range * @returns {number} */ - - _randomNumberWithUniformDistribution(range) { - const getRandomValues = this.options.getRandomValues || safeGlobals.getRandomValues; // Based on the algorithm described in https://pthree.org/2018/06/13/why-the-multiply-and-floor-rng-method-is-biased/ - + const getRandomValues = this.options.getRandomValues || safeGlobals.getRandomValues; + // Based on the algorithm described in https://pthree.org/2018/06/13/why-the-multiply-and-floor-rng-method-is-biased/ const max = Math.floor(2 ** 32 / range) * range; let x; - do { x = getRandomValues(new Uint32Array(1))[0]; } while (x >= max); - return x % range; } + /** * @param {number} numberOfRequiredRandomCharacters * @param {string} allowedCharacters */ - - _classicPassword(numberOfRequiredRandomCharacters, allowedCharacters) { const length = allowedCharacters.length; const randomCharArray = Array(numberOfRequiredRandomCharacters); - for (let i = 0; i < numberOfRequiredRandomCharacters; i++) { const index = this._randomNumberWithUniformDistribution(length); - randomCharArray[i] = allowedCharacters[index]; } - return randomCharArray.join(''); } + /** * @param {string} password * @param {number} consecutiveCharLimit * @returns {boolean} */ - - _passwordHasNotExceededConsecutiveCharLimit(password, consecutiveCharLimit) { let longestConsecutiveCharLength = 1; - let firstConsecutiveCharIndex = 0; // Both "123" or "abc" and "321" or "cba" are considered consecutive. - + let firstConsecutiveCharIndex = 0; + // Both "123" or "abc" and "321" or "cba" are considered consecutive. let isSequenceAscending; - for (let i = 1; i < password.length; i++) { const currCharCode = password.charCodeAt(i); const prevCharCode = password.charCodeAt(i - 1); - if (isSequenceAscending) { // If `isSequenceAscending` is defined, then we know that we are in the middle of an existing // pattern. Check if the pattern continues based on whether the previous pattern was // ascending or descending. if (isSequenceAscending.valueOf() && currCharCode === prevCharCode + 1 || !isSequenceAscending.valueOf() && currCharCode === prevCharCode - 1) { continue; - } // Take into account the case when the sequence transitions from descending - // to ascending. - + } + // Take into account the case when the sequence transitions from descending + // to ascending. if (currCharCode === prevCharCode + 1) { firstConsecutiveCharIndex = i - 1; isSequenceAscending = Boolean(true); continue; - } // Take into account the case when the sequence transitions from ascending - // to descending. - + } + // Take into account the case when the sequence transitions from ascending + // to descending. if (currCharCode === prevCharCode - 1) { firstConsecutiveCharIndex = i - 1; isSequenceAscending = Boolean(false); continue; } - isSequenceAscending = null; } else if (currCharCode === prevCharCode + 1) { isSequenceAscending = Boolean(true); @@ -1571,192 +1401,157 @@ class Password { isSequenceAscending = Boolean(false); continue; } - const currConsecutiveCharLength = i - firstConsecutiveCharIndex; - if (currConsecutiveCharLength > longestConsecutiveCharLength) { longestConsecutiveCharLength = currConsecutiveCharLength; } - firstConsecutiveCharIndex = i; } - if (isSequenceAscending) { const currConsecutiveCharLength = password.length - firstConsecutiveCharIndex; - if (currConsecutiveCharLength > longestConsecutiveCharLength) { longestConsecutiveCharLength = currConsecutiveCharLength; } } - return longestConsecutiveCharLength <= consecutiveCharLimit; } + /** * @param {string} password * @param {number} repeatedCharLimit * @returns {boolean} */ - - _passwordHasNotExceededRepeatedCharLimit(password, repeatedCharLimit) { let longestRepeatedCharLength = 1; let lastRepeatedChar = password.charAt(0); let lastRepeatedCharIndex = 0; - for (let i = 1; i < password.length; i++) { const currChar = password.charAt(i); - if (currChar === lastRepeatedChar) { continue; } - const currRepeatedCharLength = i - lastRepeatedCharIndex; - if (currRepeatedCharLength > longestRepeatedCharLength) { longestRepeatedCharLength = currRepeatedCharLength; } - lastRepeatedChar = currChar; lastRepeatedCharIndex = i; } - return longestRepeatedCharLength <= repeatedCharLimit; } + /** * @param {string} password * @param {string[]} requiredCharacterSets * @returns {boolean} */ - - _passwordContainsRequiredCharacters(password, requiredCharacterSets) { const requiredCharacterSetsLength = requiredCharacterSets.length; const passwordLength = password.length; - for (let i = 0; i < requiredCharacterSetsLength; i++) { const requiredCharacterSet = requiredCharacterSets[i]; let hasRequiredChar = false; - for (let j = 0; j < passwordLength; j++) { const char = password.charAt(j); - if (requiredCharacterSet.indexOf(char) !== -1) { hasRequiredChar = true; break; } } - if (!hasRequiredChar) { return false; } } - return true; } + /** * @param {string} string1 * @param {string} string2 * @returns {boolean} */ - - _stringsHaveAtLeastOneCommonCharacter(string1, string2) { const string2Length = string2.length; - for (let i = 0; i < string2Length; i++) { const char = string2.charAt(i); - if (string1.indexOf(char) !== -1) { return true; } } - return false; } + /** * @param {Requirements} requirements * @returns {PasswordParameters} */ - - _passwordGenerationParametersDictionary(requirements) { let minPasswordLength = requirements.PasswordMinLength; - const maxPasswordLength = requirements.PasswordMaxLength; // @ts-ignore + const maxPasswordLength = requirements.PasswordMaxLength; + // @ts-ignore if (minPasswordLength > maxPasswordLength) { // Resetting invalid value of min length to zero means "ignore min length parameter in password generation". minPasswordLength = 0; } - const requiredCharacterArray = requirements.PasswordRequiredCharacters; let allowedCharacters = requirements.PasswordAllowedCharacters; let requiredCharacterSets = this.options.defaultRequiredCharacterSets; - if (requiredCharacterArray) { const mutatedRequiredCharacterSets = []; const requiredCharacterArrayLength = requiredCharacterArray.length; - for (let i = 0; i < requiredCharacterArrayLength; i++) { const requiredCharacters = requiredCharacterArray[i]; - if (allowedCharacters && this._stringsHaveAtLeastOneCommonCharacter(requiredCharacters, allowedCharacters)) { mutatedRequiredCharacterSets.push(requiredCharacters); } } - requiredCharacterSets = mutatedRequiredCharacterSets; - } // If requirements allow, we will generateOrThrow the password in default format: "xxx-xxx-xxx-xxx". - + } + // If requirements allow, we will generateOrThrow the password in default format: "xxx-xxx-xxx-xxx". let numberOfRequiredRandomCharacters = this.options.defaultPasswordLength; - if (minPasswordLength && minPasswordLength > numberOfRequiredRandomCharacters) { numberOfRequiredRandomCharacters = minPasswordLength; } - if (maxPasswordLength && maxPasswordLength < numberOfRequiredRandomCharacters) { numberOfRequiredRandomCharacters = maxPasswordLength; } - if (!allowedCharacters) { allowedCharacters = this.options.defaultUnambiguousCharacters; - } // In default password format, we use dashes only as separators, not as symbols you can encounter at a random position. + } + // In default password format, we use dashes only as separators, not as symbols you can encounter at a random position. if (!requiredCharacterSets) { requiredCharacterSets = this.options.defaultRequiredCharacterSets; - } // If we have more requirements of the type "need a character from set" than the length of the password we want to generateOrThrow, then + } + + // If we have more requirements of the type "need a character from set" than the length of the password we want to generateOrThrow, then // we will never be able to meet these requirements, and we'll end up in an infinite loop generating passwords. To avoid this, // reset required character sets if the requirements are impossible to meet. - - if (requiredCharacterSets.length > numberOfRequiredRandomCharacters) { requiredCharacterSets = []; - } // Do not require any character sets that do not contain allowed characters. - + } + // Do not require any character sets that do not contain allowed characters. const requiredCharacterSetsLength = requiredCharacterSets.length; const mutatedRequiredCharacterSets = []; const allowedCharactersLength = allowedCharacters.length; - for (let i = 0; i < requiredCharacterSetsLength; i++) { const requiredCharacterSet = requiredCharacterSets[i]; let requiredCharacterSetContainsAllowedCharacters = false; - for (let j = 0; j < allowedCharactersLength; j++) { const character = allowedCharacters.charAt(j); - if (requiredCharacterSet.indexOf(character) !== -1) { requiredCharacterSetContainsAllowedCharacters = true; break; } } - if (requiredCharacterSetContainsAllowedCharacters) { mutatedRequiredCharacterSets.push(requiredCharacterSet); } } - requiredCharacterSets = mutatedRequiredCharacterSets; return { NumberOfRequiredRandomCharacters: numberOfRequiredRandomCharacters, @@ -1764,13 +1559,12 @@ class Password { RequiredCharacterSets: requiredCharacterSets }; } + /** * @param {Requirements | null} requirements * @param {PasswordParameters} [parameters] * @returns {string} */ - - _generatedPasswordMatchingRequirements(requirements, parameters) { requirements = requirements || {}; parameters = parameters || this._passwordGenerationParametersDictionary(requirements); @@ -1778,111 +1572,85 @@ class Password { const repeatedCharLimit = requirements.PasswordRepeatedCharacterLimit; const allowedCharacters = parameters.PasswordAllowedCharacters; const shouldCheckRepeatedCharRequirement = !!repeatedCharLimit; - while (true) { const password = this._classicPassword(numberOfRequiredRandomCharacters, allowedCharacters); - if (!this._passwordContainsRequiredCharacters(password, parameters.RequiredCharacterSets)) { continue; } - if (shouldCheckRepeatedCharRequirement) { if (repeatedCharLimit !== undefined && repeatedCharLimit >= 1 && !this._passwordHasNotExceededRepeatedCharLimit(password, repeatedCharLimit)) { continue; } } - const consecutiveCharLimit = requirements.PasswordConsecutiveCharacterLimit; - if (consecutiveCharLimit && consecutiveCharLimit >= 1) { if (!this._passwordHasNotExceededConsecutiveCharLimit(password, consecutiveCharLimit)) { continue; } } - return password || ''; } } + /** * @param {parser.CustomCharacterClass | parser.NamedCharacterClass} characterClass * @returns {string[]} */ - - _scanSetFromCharacterClass(characterClass) { if (characterClass instanceof parser.CustomCharacterClass) { return characterClass.characters; } - console.assert(characterClass instanceof parser.NamedCharacterClass); - switch (characterClass.name) { case parser.Identifier.ASCII_PRINTABLE: case parser.Identifier.UNICODE: return this.options.SCAN_SET_ORDER.split(''); - case parser.Identifier.DIGIT: return this.options.SCAN_SET_ORDER.substring(this.options.SCAN_SET_ORDER.indexOf('0'), this.options.SCAN_SET_ORDER.indexOf('9') + 1).split(''); - case parser.Identifier.LOWER: return this.options.SCAN_SET_ORDER.substring(this.options.SCAN_SET_ORDER.indexOf('a'), this.options.SCAN_SET_ORDER.indexOf('z') + 1).split(''); - case parser.Identifier.SPECIAL: return this.options.SCAN_SET_ORDER.substring(this.options.SCAN_SET_ORDER.indexOf('-'), this.options.SCAN_SET_ORDER.indexOf(']') + 1).split(''); - case parser.Identifier.UPPER: return this.options.SCAN_SET_ORDER.substring(this.options.SCAN_SET_ORDER.indexOf('A'), this.options.SCAN_SET_ORDER.indexOf('Z') + 1).split(''); } - console.assert(false, parser.SHOULD_NOT_BE_REACHED); return []; } + /** * @param {(parser.CustomCharacterClass | parser.NamedCharacterClass)[]} characterClasses */ - - _charactersFromCharactersClasses(characterClasses) { const output = []; - for (let characterClass of characterClasses) { output.push(...this._scanSetFromCharacterClass(characterClass)); } - return output; } + /** * @param {string[]} characters * @returns {string} */ - - _canonicalizedScanSetFromCharacters(characters) { if (!characters.length) { return ''; } - let shadowCharacters = Array.prototype.slice.call(characters); shadowCharacters.sort((a, b) => this.options.SCAN_SET_ORDER.indexOf(a) - this.options.SCAN_SET_ORDER.indexOf(b)); let uniqueCharacters = [shadowCharacters[0]]; - for (let i = 1, length = shadowCharacters.length; i < length; ++i) { if (shadowCharacters[i] === shadowCharacters[i - 1]) { continue; } - uniqueCharacters.push(shadowCharacters[i]); } - return uniqueCharacters.join(''); } - } - exports.Password = Password; -_defineProperty(Password, "defaults", defaults); - },{"./constants.js":9,"./rules-parser.js":10}],9:[function(require,module,exports){ "use strict"; @@ -1894,15 +1662,14 @@ const DEFAULT_MIN_LENGTH = 20; const DEFAULT_MAX_LENGTH = 30; const DEFAULT_REQUIRED_CHARS = '-!?$&#%'; const DEFAULT_UNAMBIGUOUS_CHARS = 'abcdefghijkmnopqrstuvwxyzABCDEFGHIJKLMNPQRSTUVWXYZ0123456789'; -const DEFAULT_PASSWORD_RULES = ["minlength: ".concat(DEFAULT_MIN_LENGTH), "maxlength: ".concat(DEFAULT_MAX_LENGTH), "required: [".concat(DEFAULT_REQUIRED_CHARS, "]"), "allowed: [".concat(DEFAULT_UNAMBIGUOUS_CHARS, "]")].join('; '); -const constants = { +const DEFAULT_PASSWORD_RULES = [`minlength: ${DEFAULT_MIN_LENGTH}`, `maxlength: ${DEFAULT_MAX_LENGTH}`, `required: [${DEFAULT_REQUIRED_CHARS}]`, `allowed: [${DEFAULT_UNAMBIGUOUS_CHARS}]`].join('; '); +const constants = exports.constants = { DEFAULT_MIN_LENGTH, DEFAULT_MAX_LENGTH, DEFAULT_PASSWORD_RULES, DEFAULT_REQUIRED_CHARS, DEFAULT_UNAMBIGUOUS_CHARS }; -exports.constants = constants; },{}],10:[function(require,module,exports){ "use strict"; @@ -1928,7 +1695,8 @@ exports.parsePasswordRules = parsePasswordRules; * ^ the default implementation still returns a base-line ruleset, which we didn't want. * */ -const Identifier = { + +const Identifier = exports.Identifier = { ASCII_PRINTABLE: 'ascii-printable', DIGIT: 'digit', LOWER: 'lower', @@ -1936,131 +1704,106 @@ const Identifier = { UNICODE: 'unicode', UPPER: 'upper' }; -exports.Identifier = Identifier; -const RuleName = { +const RuleName = exports.RuleName = { ALLOWED: 'allowed', MAX_CONSECUTIVE: 'max-consecutive', REQUIRED: 'required', MIN_LENGTH: 'minlength', MAX_LENGTH: 'maxlength' }; -exports.RuleName = RuleName; const CHARACTER_CLASS_START_SENTINEL = '['; const CHARACTER_CLASS_END_SENTINEL = ']'; const PROPERTY_VALUE_SEPARATOR = ','; const PROPERTY_SEPARATOR = ';'; const PROPERTY_VALUE_START_SENTINEL = ':'; const SPACE_CODE_POINT = ' '.codePointAt(0); -const SHOULD_NOT_BE_REACHED = 'Should not be reached'; -exports.SHOULD_NOT_BE_REACHED = SHOULD_NOT_BE_REACHED; - +const SHOULD_NOT_BE_REACHED = exports.SHOULD_NOT_BE_REACHED = 'Should not be reached'; class Rule { constructor(name, value) { this._name = name; this.value = value; } - get name() { return this._name; } - toString() { return JSON.stringify(this); } - } - exports.Rule = Rule; ; - class NamedCharacterClass { constructor(name) { console.assert(_isValidRequiredOrAllowedPropertyValueIdentifier(name)); this._name = name; } - get name() { return this._name.toLowerCase(); } - toString() { return this._name; } - toHTMLString() { return this._name; } - } - exports.NamedCharacterClass = NamedCharacterClass; ; - class ParserError extends Error {} - exports.ParserError = ParserError; ; - class CustomCharacterClass { constructor(characters) { console.assert(characters instanceof Array); this._characters = characters; } - get characters() { return this._characters; } - toString() { - return "[".concat(this._characters.join(''), "]"); + return `[${this._characters.join('')}]`; } - toHTMLString() { - return "[".concat(this._characters.join('').replace('"', '"'), "]"); + return `[${this._characters.join('').replace('"', '"')}]`; } - } - exports.CustomCharacterClass = CustomCharacterClass; -; // MARK: Lexer functions +; -function _isIdentifierCharacter(c) { - console.assert(c.length === 1); // eslint-disable-next-line no-mixed-operators +// MARK: Lexer functions +function _isIdentifierCharacter(c) { + console.assert(c.length === 1); + // eslint-disable-next-line no-mixed-operators return c >= 'a' && c <= 'z' || c >= 'A' && c <= 'Z' || c === '-'; } - function _isASCIIDigit(c) { console.assert(c.length === 1); return c >= '0' && c <= '9'; } - function _isASCIIPrintableCharacter(c) { console.assert(c.length === 1); return c >= ' ' && c <= '~'; } - function _isASCIIWhitespace(c) { console.assert(c.length === 1); return c === ' ' || c === '\f' || c === '\n' || c === '\r' || c === '\t'; -} // MARK: ASCII printable character bit set and canonicalization functions +} +// MARK: ASCII printable character bit set and canonicalization functions function _bitSetIndexForCharacter(c) { - console.assert(c.length === 1); // @ts-ignore - + console.assert(c.length === 1); + // @ts-ignore return c.codePointAt(0) - SPACE_CODE_POINT; } - function _characterAtBitSetIndex(index) { return String.fromCodePoint(index + SPACE_CODE_POINT); } - function _markBitsForNamedCharacterClass(bitSet, namedCharacterClass) { console.assert(bitSet instanceof Array); console.assert(namedCharacterClass.name !== Identifier.UNICODE); console.assert(namedCharacterClass.name !== Identifier.ASCII_PRINTABLE); - if (namedCharacterClass.name === Identifier.UPPER) { bitSet.fill(true, _bitSetIndexForCharacter('A'), _bitSetIndexForCharacter('Z') + 1); } else if (namedCharacterClass.name === Identifier.LOWER) { @@ -2076,223 +1819,176 @@ function _markBitsForNamedCharacterClass(bitSet, namedCharacterClass) { console.assert(false, SHOULD_NOT_BE_REACHED, namedCharacterClass); } } - function _markBitsForCustomCharacterClass(bitSet, customCharacterClass) { for (let character of customCharacterClass.characters) { bitSet[_bitSetIndexForCharacter(character)] = true; } } - function _canonicalizedPropertyValues(propertyValues, keepCustomCharacterClassFormatCompliant) { // @ts-ignore let asciiPrintableBitSet = new Array('~'.codePointAt(0) - ' '.codePointAt(0) + 1); - for (let propertyValue of propertyValues) { if (propertyValue instanceof NamedCharacterClass) { if (propertyValue.name === Identifier.UNICODE) { return [new NamedCharacterClass(Identifier.UNICODE)]; } - if (propertyValue.name === Identifier.ASCII_PRINTABLE) { return [new NamedCharacterClass(Identifier.ASCII_PRINTABLE)]; } - _markBitsForNamedCharacterClass(asciiPrintableBitSet, propertyValue); } else if (propertyValue instanceof CustomCharacterClass) { _markBitsForCustomCharacterClass(asciiPrintableBitSet, propertyValue); } } - let charactersSeen = []; - function checkRange(start, end) { let temp = []; - for (let i = _bitSetIndexForCharacter(start); i <= _bitSetIndexForCharacter(end); ++i) { if (asciiPrintableBitSet[i]) { temp.push(_characterAtBitSetIndex(i)); } } - let result = temp.length === _bitSetIndexForCharacter(end) - _bitSetIndexForCharacter(start) + 1; - if (!result) { charactersSeen = charactersSeen.concat(temp); } - return result; } - let hasAllUpper = checkRange('A', 'Z'); let hasAllLower = checkRange('a', 'z'); - let hasAllDigits = checkRange('0', '9'); // Check for special characters, accounting for characters that are given special treatment (i.e. '-' and ']') + let hasAllDigits = checkRange('0', '9'); + // Check for special characters, accounting for characters that are given special treatment (i.e. '-' and ']') let hasAllSpecial = false; let hasDash = false; let hasRightSquareBracket = false; let temp = []; - for (let i = _bitSetIndexForCharacter(' '); i <= _bitSetIndexForCharacter('/'); ++i) { if (!asciiPrintableBitSet[i]) { continue; } - let character = _characterAtBitSetIndex(i); - if (keepCustomCharacterClassFormatCompliant && character === '-') { hasDash = true; } else { temp.push(character); } } - for (let i = _bitSetIndexForCharacter(':'); i <= _bitSetIndexForCharacter('@'); ++i) { if (asciiPrintableBitSet[i]) { temp.push(_characterAtBitSetIndex(i)); } } - for (let i = _bitSetIndexForCharacter('['); i <= _bitSetIndexForCharacter('`'); ++i) { if (!asciiPrintableBitSet[i]) { continue; } - let character = _characterAtBitSetIndex(i); - if (keepCustomCharacterClassFormatCompliant && character === ']') { hasRightSquareBracket = true; } else { temp.push(character); } } - for (let i = _bitSetIndexForCharacter('{'); i <= _bitSetIndexForCharacter('~'); ++i) { if (asciiPrintableBitSet[i]) { temp.push(_characterAtBitSetIndex(i)); } } - if (hasDash) { temp.unshift('-'); } - if (hasRightSquareBracket) { temp.push(']'); } - let numberOfSpecialCharacters = _bitSetIndexForCharacter('/') - _bitSetIndexForCharacter(' ') + 1 + (_bitSetIndexForCharacter('@') - _bitSetIndexForCharacter(':') + 1) + (_bitSetIndexForCharacter('`') - _bitSetIndexForCharacter('[') + 1) + (_bitSetIndexForCharacter('~') - _bitSetIndexForCharacter('{') + 1); hasAllSpecial = temp.length === numberOfSpecialCharacters; - if (!hasAllSpecial) { charactersSeen = charactersSeen.concat(temp); } - let result = []; - if (hasAllUpper && hasAllLower && hasAllDigits && hasAllSpecial) { return [new NamedCharacterClass(Identifier.ASCII_PRINTABLE)]; } - if (hasAllUpper) { result.push(new NamedCharacterClass(Identifier.UPPER)); } - if (hasAllLower) { result.push(new NamedCharacterClass(Identifier.LOWER)); } - if (hasAllDigits) { result.push(new NamedCharacterClass(Identifier.DIGIT)); } - if (hasAllSpecial) { result.push(new NamedCharacterClass(Identifier.SPECIAL)); } - if (charactersSeen.length) { result.push(new CustomCharacterClass(charactersSeen)); } - return result; -} // MARK: Parser functions +} +// MARK: Parser functions function _indexOfNonWhitespaceCharacter(input) { let position = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; console.assert(position >= 0); console.assert(position <= input.length); let length = input.length; - while (position < length && _isASCIIWhitespace(input[position])) { ++position; } - return position; } - function _parseIdentifier(input, position) { console.assert(position >= 0); console.assert(position < input.length); console.assert(_isIdentifierCharacter(input[position])); let length = input.length; let seenIdentifiers = []; - do { let c = input[position]; - if (!_isIdentifierCharacter(c)) { break; } - seenIdentifiers.push(c); ++position; } while (position < length); - return [seenIdentifiers.join(''), position]; } - function _isValidRequiredOrAllowedPropertyValueIdentifier(identifier) { return identifier && Object.values(Identifier).includes(identifier.toLowerCase()); } - function _parseCustomCharacterClass(input, position) { console.assert(position >= 0); console.assert(position < input.length); console.assert(input[position] === CHARACTER_CLASS_START_SENTINEL); let length = input.length; ++position; - if (position >= length) { // console.error('Found end-of-line instead of character class character') return [null, position]; } - let initialPosition = position; let result = []; - do { let c = input[position]; - if (!_isASCIIPrintableCharacter(c)) { ++position; continue; } - if (c === '-' && position - initialPosition > 0) { // FIXME: Should this be an error? console.warn("Ignoring '-'; a '-' may only appear as the first character in a character class"); ++position; continue; } - result.push(c); ++position; - if (c === CHARACTER_CLASS_END_SENTINEL) { break; } } while (position < length); - if (position < length && input[position] !== CHARACTER_CLASS_END_SENTINEL) { // Fix up result; we over consumed. result.pop(); @@ -2302,37 +1998,31 @@ function _parseCustomCharacterClass(input, position) { result.pop(); return [result, position]; } - if (position < length && input[position] === CHARACTER_CLASS_END_SENTINEL) { return [result, position + 1]; - } // console.error('Found end-of-line instead of end of character class') - + } + // console.error('Found end-of-line instead of end of character class') return [null, position]; } - function _parsePasswordRequiredOrAllowedPropertyValue(input, position) { console.assert(position >= 0); console.assert(position < input.length); let length = input.length; let propertyValues = []; - while (true) { if (_isIdentifierCharacter(input[position])) { - let identifierStartPosition = position; // eslint-disable-next-line no-redeclare - + let identifierStartPosition = position; + // eslint-disable-next-line no-redeclare var [propertyValue, position] = _parseIdentifier(input, position); - if (!_isValidRequiredOrAllowedPropertyValueIdentifier(propertyValue)) { // console.error('Unrecognized property value identifier: ' + propertyValue) return [null, identifierStartPosition]; } - propertyValues.push(new NamedCharacterClass(propertyValue)); } else if (input[position] === CHARACTER_CLASS_START_SENTINEL) { // eslint-disable-next-line no-redeclare var [propertyValue, position] = _parseCustomCharacterClass(input, position); - if (propertyValue && propertyValue.length) { propertyValues.push(new CustomCharacterClass(propertyValue)); } @@ -2340,300 +2030,240 @@ function _parsePasswordRequiredOrAllowedPropertyValue(input, position) { // console.error('Failed to find start of property value: ' + input.substr(position)) return [null, position]; } - position = _indexOfNonWhitespaceCharacter(input, position); - if (position >= length || input[position] === PROPERTY_SEPARATOR) { break; } - if (input[position] === PROPERTY_VALUE_SEPARATOR) { position = _indexOfNonWhitespaceCharacter(input, position + 1); - if (position >= length) { // console.error('Found end-of-line instead of start of next property value') return [null, position]; } - continue; - } // console.error('Failed to find start of next property or property value: ' + input.substr(position)) - + } + // console.error('Failed to find start of next property or property value: ' + input.substr(position)) return [null, position]; } - return [propertyValues, position]; } + /** * @param input * @param position * @returns {[Rule|null, number, string|undefined]} * @private */ - - function _parsePasswordRule(input, position) { console.assert(position >= 0); console.assert(position < input.length); console.assert(_isIdentifierCharacter(input[position])); let length = input.length; - var mayBeIdentifierStartPosition = position; // eslint-disable-next-line no-redeclare - + var mayBeIdentifierStartPosition = position; + // eslint-disable-next-line no-redeclare var [identifier, position] = _parseIdentifier(input, position); - if (!Object.values(RuleName).includes(identifier)) { // console.error('Unrecognized property name: ' + identifier) return [null, mayBeIdentifierStartPosition, undefined]; } - if (position >= length) { // console.error('Found end-of-line instead of start of property value') return [null, position, undefined]; } - if (input[position] !== PROPERTY_VALUE_START_SENTINEL) { // console.error('Failed to find start of property value: ' + input.substr(position)) return [null, position, undefined]; } - let property = { name: identifier, value: null }; - position = _indexOfNonWhitespaceCharacter(input, position + 1); // Empty value - + position = _indexOfNonWhitespaceCharacter(input, position + 1); + // Empty value if (position >= length || input[position] === PROPERTY_SEPARATOR) { return [new Rule(property.name, property.value), position, undefined]; } - switch (identifier) { case RuleName.ALLOWED: case RuleName.REQUIRED: { // eslint-disable-next-line no-redeclare var [propertyValue, position] = _parsePasswordRequiredOrAllowedPropertyValue(input, position); - if (propertyValue) { property.value = propertyValue; } - return [new Rule(property.name, property.value), position, undefined]; } - case RuleName.MAX_CONSECUTIVE: { // eslint-disable-next-line no-redeclare var [propertyValue, position] = _parseMaxConsecutivePropertyValue(input, position); - if (propertyValue) { property.value = propertyValue; } - return [new Rule(property.name, property.value), position, undefined]; } - case RuleName.MIN_LENGTH: case RuleName.MAX_LENGTH: { // eslint-disable-next-line no-redeclare var [propertyValue, position] = _parseMinLengthMaxLengthPropertyValue(input, position); - if (propertyValue) { property.value = propertyValue; } - return [new Rule(property.name, property.value), position, undefined]; } } - console.assert(false, SHOULD_NOT_BE_REACHED); return [null, -1, undefined]; } - function _parseMinLengthMaxLengthPropertyValue(input, position) { return _parseInteger(input, position); } - function _parseMaxConsecutivePropertyValue(input, position) { return _parseInteger(input, position); } - function _parseInteger(input, position) { console.assert(position >= 0); console.assert(position < input.length); - if (!_isASCIIDigit(input[position])) { // console.error('Failed to parse value of type integer; not a number: ' + input.substr(position)) return [null, position]; } - - let length = input.length; // let initialPosition = position - + let length = input.length; + // let initialPosition = position let result = 0; - do { result = 10 * result + parseInt(input[position], 10); ++position; } while (position < length && input[position] !== PROPERTY_SEPARATOR && _isASCIIDigit(input[position])); - if (position >= length || input[position] === PROPERTY_SEPARATOR) { return [result, position]; - } // console.error('Failed to parse value of type integer; not a number: ' + input.substr(initialPosition)) - + } + // console.error('Failed to parse value of type integer; not a number: ' + input.substr(initialPosition)) return [null, position]; } + /** * @param input * @returns {[Rule[]|null, string|undefined]} * @private */ - - function _parsePasswordRulesInternal(input) { let parsedProperties = []; let length = input.length; - var position = _indexOfNonWhitespaceCharacter(input); - while (position < length) { if (!_isIdentifierCharacter(input[position])) { // console.warn('Failed to find start of property: ' + input.substr(position)) return [parsedProperties, undefined]; - } // eslint-disable-next-line no-redeclare - + } + // eslint-disable-next-line no-redeclare var [parsedProperty, position, message] = _parsePasswordRule(input, position); - if (parsedProperty && parsedProperty.value) { parsedProperties.push(parsedProperty); } - position = _indexOfNonWhitespaceCharacter(input, position); - if (position >= length) { break; } - if (input[position] === PROPERTY_SEPARATOR) { position = _indexOfNonWhitespaceCharacter(input, position + 1); - if (position >= length) { return [parsedProperties, undefined]; } - continue; - } // console.error('Failed to find start of next property: ' + input.substr(position)) - + } + // console.error('Failed to find start of next property: ' + input.substr(position)) return [null, message || 'Failed to find start of next property: ' + input.substr(position)]; } - return [parsedProperties, undefined]; } + /** * @param {string} input * @param {boolean} [formatRulesForMinifiedVersion] * @returns {Rule[]} */ - - function parsePasswordRules(input, formatRulesForMinifiedVersion) { let [passwordRules, maybeMessage] = _parsePasswordRulesInternal(input); - if (!passwordRules) { throw new ParserError(maybeMessage); } - if (passwordRules.length === 0) { throw new ParserError('No valid rules were provided'); - } // When formatting rules for minified version, we should keep the formatted rules - // as similar to the input as possible. Avoid copying required rules to allowed rules. - + } + // When formatting rules for minified version, we should keep the formatted rules + // as similar to the input as possible. Avoid copying required rules to allowed rules. let suppressCopyingRequiredToAllowed = formatRulesForMinifiedVersion; let requiredRules = []; let newAllowedValues = []; let minimumMaximumConsecutiveCharacters = null; let maximumMinLength = 0; let minimumMaxLength = null; - for (let rule of passwordRules) { switch (rule.name) { case RuleName.MAX_CONSECUTIVE: minimumMaximumConsecutiveCharacters = minimumMaximumConsecutiveCharacters ? Math.min(rule.value, minimumMaximumConsecutiveCharacters) : rule.value; break; - case RuleName.MIN_LENGTH: maximumMinLength = Math.max(rule.value, maximumMinLength); break; - case RuleName.MAX_LENGTH: minimumMaxLength = minimumMaxLength ? Math.min(rule.value, minimumMaxLength) : rule.value; break; - case RuleName.REQUIRED: rule.value = _canonicalizedPropertyValues(rule.value, formatRulesForMinifiedVersion); requiredRules.push(rule); - if (!suppressCopyingRequiredToAllowed) { newAllowedValues = newAllowedValues.concat(rule.value); } - break; - case RuleName.ALLOWED: newAllowedValues = newAllowedValues.concat(rule.value); break; } } - let newPasswordRules = []; - if (maximumMinLength > 0) { newPasswordRules.push(new Rule(RuleName.MIN_LENGTH, maximumMinLength)); } - if (minimumMaxLength !== null) { newPasswordRules.push(new Rule(RuleName.MAX_LENGTH, minimumMaxLength)); } - if (minimumMaximumConsecutiveCharacters !== null) { newPasswordRules.push(new Rule(RuleName.MAX_CONSECUTIVE, minimumMaximumConsecutiveCharacters)); } - let sortedRequiredRules = requiredRules.sort(function (a, b) { const namedCharacterClassOrder = [Identifier.LOWER, Identifier.UPPER, Identifier.DIGIT, Identifier.SPECIAL, Identifier.ASCII_PRINTABLE, Identifier.UNICODE]; let aIsJustOneNamedCharacterClass = a.value.length === 1 && a.value[0] instanceof NamedCharacterClass; let bIsJustOneNamedCharacterClass = b.value.length === 1 && b.value[0] instanceof NamedCharacterClass; - if (aIsJustOneNamedCharacterClass && !bIsJustOneNamedCharacterClass) { return -1; } - if (!aIsJustOneNamedCharacterClass && bIsJustOneNamedCharacterClass) { return 1; } - if (aIsJustOneNamedCharacterClass && bIsJustOneNamedCharacterClass) { let aIndex = namedCharacterClassOrder.indexOf(a.value[0].name); let bIndex = namedCharacterClassOrder.indexOf(b.value[0].name); return aIndex - bIndex; } - return 0; }); newPasswordRules = newPasswordRules.concat(sortedRequiredRules); newAllowedValues = _canonicalizedPropertyValues(newAllowedValues, suppressCopyingRequiredToAllowed); - if (!suppressCopyingRequiredToAllowed && !newAllowedValues.length) { newAllowedValues = [new NamedCharacterClass(Identifier.ASCII_PRINTABLE)]; } - if (newAllowedValues.length) { newPasswordRules.push(new Rule(RuleName.ALLOWED, newAllowedValues)); } - return newPasswordRules; } @@ -3475,35 +3105,24 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.createDevice = createDevice; - var _config = require("./config.js"); - var _AndroidInterface = require("./DeviceInterface/AndroidInterface.js"); - var _ExtensionInterface = require("./DeviceInterface/ExtensionInterface.js"); - var _AppleDeviceInterface = require("./DeviceInterface/AppleDeviceInterface.js"); - var _AppleOverlayDeviceInterface = require("./DeviceInterface/AppleOverlayDeviceInterface.js"); - var _transports = require("./deviceApiCalls/transports/transports.js"); - var _index = require("../packages/device-api/index.js"); - var _Settings = require("./Settings.js"); - var _WindowsInterface = require("./DeviceInterface/WindowsInterface.js"); - var _WindowsOverlayDeviceInterface = require("./DeviceInterface/WindowsOverlayDeviceInterface.js"); - function createDevice() { const globalConfig = (0, _config.createGlobalConfig)(); const transport = (0, _transports.createTransport)(globalConfig); + /** * A wrapper around transports to assist in debugging/integrations * @type {import("../packages/device-api").DeviceApiTransport} */ - const loggingTransport = { async send(deviceApiCall) { console.log('[->outgoing]', 'id:', deviceApiCall.method, deviceApiCall.params || null); @@ -3511,32 +3130,26 @@ function createDevice() { console.log('[<-incoming]', 'id:', deviceApiCall.method, result || null); return result; } + }; - }; // Create the DeviceAPI + Setting - + // Create the DeviceAPI + Setting let deviceApi = new _index.DeviceApi(globalConfig.isDDGTestMode ? loggingTransport : transport); const settings = new _Settings.Settings(globalConfig, deviceApi); - if (globalConfig.isWindows) { if (globalConfig.isTopFrame) { return new _WindowsOverlayDeviceInterface.WindowsOverlayDeviceInterface(globalConfig, deviceApi, settings); } - return new _WindowsInterface.WindowsInterface(globalConfig, deviceApi, settings); } - if (globalConfig.isDDGApp) { if (globalConfig.isAndroid) { return new _AndroidInterface.AndroidInterface(globalConfig, deviceApi, settings); } - if (globalConfig.isTopFrame) { return new _AppleOverlayDeviceInterface.AppleOverlayDeviceInterface(globalConfig, deviceApi, settings); } - return new _AppleDeviceInterface.AppleDeviceInterface(globalConfig, deviceApi, settings); } - globalConfig.isExtension = true; return new _ExtensionInterface.ExtensionInterface(globalConfig, deviceApi, settings); } @@ -3548,26 +3161,19 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.AndroidInterface = void 0; - var _InterfacePrototype = _interopRequireDefault(require("./InterfacePrototype.js")); - var _autofillUtils = require("../autofill-utils.js"); - var _NativeUIController = require("../UI/controllers/NativeUIController.js"); - var _appleUtils = require("@duckduckgo/content-scope-scripts/src/apple-utils"); - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - class AndroidInterface extends _InterfacePrototype.default { async isEnabled() { return (0, _autofillUtils.autofillEnabled)(this.globalConfig, _appleUtils.processConfig); } + /** * @returns {Promise} */ - - async getAlias() { const { alias @@ -3576,47 +3182,40 @@ class AndroidInterface extends _InterfacePrototype.default { }, 'getAliasResponse'); return alias; } + /** * @override */ - - createUIController() { return new _NativeUIController.NativeUIController(); } + /** * @deprecated use `this.settings.availableInputTypes.email` in the future * @returns {boolean} */ - - isDeviceSignedIn() { - var _this$globalConfig$av; - // on DDG domains, always check via `window.EmailInterface.isSignedIn()` if (this.globalConfig.isDDGDomain) { return window.EmailInterface.isSignedIn() === 'true'; - } // on non-DDG domains, where `availableInputTypes.email` is present, use it - + } - if (typeof ((_this$globalConfig$av = this.globalConfig.availableInputTypes) === null || _this$globalConfig$av === void 0 ? void 0 : _this$globalConfig$av.email) === 'boolean') { + // on non-DDG domains, where `availableInputTypes.email` is present, use it + if (typeof this.globalConfig.availableInputTypes?.email === 'boolean') { return this.globalConfig.availableInputTypes.email; - } // ...on other domains we assume true because the script wouldn't exist otherwise - + } + // ...on other domains we assume true because the script wouldn't exist otherwise return true; } - async setupAutofill() {} + /** * Used by the email web app * Settings page displays data of the logged in user data */ - - getUserData() { let userData = null; - try { userData = JSON.parse(window.EmailInterface.getUserData()); } catch (e) { @@ -3624,18 +3223,15 @@ class AndroidInterface extends _InterfacePrototype.default { console.error(e); } } - return Promise.resolve(userData); } + /** * Used by the email web app * Device capabilities determine which functionality is available to the user */ - - getEmailProtectionCapabilities() { let deviceCapabilities = null; - try { deviceCapabilities = JSON.parse(window.EmailInterface.getDeviceCapabilities()); } catch (e) { @@ -3643,10 +3239,8 @@ class AndroidInterface extends _InterfacePrototype.default { console.error(e); } } - return Promise.resolve(deviceCapabilities); } - storeUserData(_ref) { let { addUserData: { @@ -3657,12 +3251,11 @@ class AndroidInterface extends _InterfacePrototype.default { } = _ref; return window.EmailInterface.storeCredentials(token, userName, cohort); } + /** * Used by the email web app * Provides functionality to log the user out */ - - removeUserData() { try { return window.EmailInterface.removeCredentials(); @@ -3672,7 +3265,6 @@ class AndroidInterface extends _InterfacePrototype.default { } } } - addLogoutListener(handler) { // Only deal with logging out if we're in the email web app if (!this.globalConfig.isDDGDomain) return; @@ -3682,13 +3274,10 @@ class AndroidInterface extends _InterfacePrototype.default { } }); } - /** Noop */ - + /** Noop */ firePixel(_pixelParam) {} - } - exports.AndroidInterface = AndroidInterface; },{"../UI/controllers/NativeUIController.js":46,"../autofill-utils.js":51,"./InterfacePrototype.js":17,"@duckduckgo/content-scope-scripts/src/apple-utils":1}],14:[function(require,module,exports){ @@ -3698,52 +3287,32 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.AppleDeviceInterface = void 0; - var _InterfacePrototype = _interopRequireDefault(require("./InterfacePrototype.js")); - var _autofillUtils = require("../autofill-utils.js"); - var _appleUtils = require("@duckduckgo/content-scope-scripts/src/apple-utils"); - var _HTMLTooltip = require("../UI/HTMLTooltip.js"); - var _HTMLTooltipUIController = require("../UI/controllers/HTMLTooltipUIController.js"); - var _OverlayUIController = require("../UI/controllers/OverlayUIController.js"); - var _index = require("../../packages/device-api/index.js"); - var _additionalDeviceApiCalls = require("../deviceApiCalls/additionalDeviceApiCalls.js"); - var _NativeUIController = require("../UI/controllers/NativeUIController.js"); - var _deviceApiCalls = require("../deviceApiCalls/__generated__/deviceApiCalls.js"); - var _matching = require("../Form/matching.js"); - var _InContextSignup = require("../InContextSignup.js"); - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - /** * @typedef {import('../deviceApiCalls/__generated__/validators-ts').GetAutofillDataRequest} GetAutofillDataRequest */ -class AppleDeviceInterface extends _InterfacePrototype.default { - constructor() { - super(...arguments); - - _defineProperty(this, "inContextSignup", new _InContextSignup.InContextSignup(this)); - - _defineProperty(this, "initialSetupDelayMs", 300); - _defineProperty(this, "pollingTimeout", null); - } +class AppleDeviceInterface extends _InterfacePrototype.default { + inContextSignup = new _InContextSignup.InContextSignup(this); + /** @override */ + initialSetupDelayMs = 300; async isEnabled() { return (0, _autofillUtils.autofillEnabled)(this.globalConfig, _appleUtils.processConfig); } + /** * The default functionality of this class is to operate as an 'overlay controller' - * which means it's purpose is to message the native layer about when to open/close the overlay. @@ -3755,17 +3324,13 @@ class AppleDeviceInterface extends _InterfacePrototype.default { * @override * @returns {import("../UI/controllers/UIController.js").UIController} */ - - createUIController() { - var _this$globalConfig$us, _this$globalConfig$us2; - - if (((_this$globalConfig$us = this.globalConfig.userPreferences) === null || _this$globalConfig$us === void 0 ? void 0 : (_this$globalConfig$us2 = _this$globalConfig$us.platform) === null || _this$globalConfig$us2 === void 0 ? void 0 : _this$globalConfig$us2.name) === 'ios') { + if (this.globalConfig.userPreferences?.platform?.name === 'ios') { return new _NativeUIController.NativeUIController(); } - if (!this.globalConfig.supportsTopFrame) { - const options = { ..._HTMLTooltip.defaultOptions, + const options = { + ..._HTMLTooltip.defaultOptions, testMode: this.isTestMode() }; return new _HTMLTooltipUIController.HTMLTooltipUIController({ @@ -3773,16 +3338,16 @@ class AppleDeviceInterface extends _InterfacePrototype.default { tooltipKind: 'modern' }, options); } + /** * If we get here, we're just a controller for an overlay */ - - return new _OverlayUIController.OverlayUIController({ remove: async () => this._closeAutofillParent(), show: async details => this._show(details) }); } + /** * For now, this could be running * 1) on iOS @@ -3792,78 +3357,67 @@ class AppleDeviceInterface extends _InterfacePrototype.default { * @override * @returns {Promise} */ - - async setupAutofill() { if (!this.globalConfig.supportsTopFrame) { await this._getAutofillInitData(); } - await this.inContextSignup.init(); const signedIn = await this._checkDeviceSignedIn(); - if (signedIn) { if (this.globalConfig.isApp) { await this.getAddresses(); } } } + /** * Used by the email web app * Settings page displays data of the logged in user data */ - - getUserData() { return this.deviceApi.request((0, _index.createRequest)('emailHandlerGetUserData')); } + /** * Used by the email web app * Device capabilities determine which functionality is available to the user */ - - getEmailProtectionCapabilities() { return this.deviceApi.request((0, _index.createRequest)('emailHandlerGetCapabilities')); } + /** */ - - async getSelectedCredentials() { return this.deviceApi.request((0, _index.createRequest)('getSelectedCredentials')); } + /** * The data format provided here for `parentArgs` matches Window now. * @param {GetAutofillDataRequest} parentArgs */ - - async _showAutofillParent(parentArgs) { - const applePayload = { ...parentArgs.triggerContext, + const applePayload = { + ...parentArgs.triggerContext, serializedInputContext: parentArgs.serializedInputContext }; return this.deviceApi.notify((0, _index.createNotification)('showAutofillParent', applePayload)); } + /** * @returns {Promise} */ - - async _closeAutofillParent() { return this.deviceApi.notify((0, _index.createNotification)('closeAutofillParent', {})); } + /** * @param {GetAutofillDataRequest} details */ - - async _show(details) { await this._showAutofillParent(details); - this._listenForSelectedCredential(async response => { if (!response) return; - if ('configType' in response) { this.selectedDetail(response.data, response.configType); } else if ('stop' in response) { @@ -3873,12 +3427,10 @@ class AppleDeviceInterface extends _InterfacePrototype.default { } }); } - async refreshData() { await super.refreshData(); await this._checkDeviceSignedIn(); } - async getAddresses() { if (!this.globalConfig.isApp) return this.getAlias(); const { @@ -3887,23 +3439,18 @@ class AppleDeviceInterface extends _InterfacePrototype.default { this.storeLocalAddresses(addresses); return addresses; } - async refreshAlias() { - await this.deviceApi.notify((0, _index.createNotification)('emailHandlerRefreshAlias')); // On macOS we also update the addresses stored locally - + await this.deviceApi.notify((0, _index.createNotification)('emailHandlerRefreshAlias')); + // On macOS we also update the addresses stored locally if (this.globalConfig.isApp) this.getAddresses(); } - async _checkDeviceSignedIn() { const { isAppSignedIn } = await this.deviceApi.request((0, _index.createRequest)('emailHandlerCheckAppSignedInStatus')); - this.isDeviceSignedIn = () => !!isAppSignedIn; - return !!isAppSignedIn; } - storeUserData(_ref) { let { addUserData: { @@ -3918,24 +3465,23 @@ class AppleDeviceInterface extends _InterfacePrototype.default { cohort })); } + /** * Used by the email web app * Provides functionality to log the user out */ - - removeUserData() { this.deviceApi.notify((0, _index.createNotification)('emailHandlerRemoveToken')); } + /** * Used by the email web app * Provides functionality to close the window after in-context sign-up or sign-in */ - - closeEmailProtection() { this.deviceApi.request(new _deviceApiCalls.CloseEmailProtectionTabCall(null)); } + /** * PM endpoints */ @@ -3944,91 +3490,79 @@ class AppleDeviceInterface extends _InterfacePrototype.default { * Gets the init data from the device * @returns {APIResponse} */ - - async _getAutofillInitData() { const response = await this.deviceApi.request((0, _index.createRequest)('pmHandlerGetAutofillInitData')); this.storeLocalData(response.success); return response; } + /** * Gets credentials ready for autofill * @param {CredentialsObject['id']} id - the credential id * @returns {APIResponseSingle} */ - - getAutofillCredentials(id) { return this.deviceApi.request((0, _index.createRequest)('pmHandlerGetAutofillCredentials', { id })); } + /** * Opens the native UI for managing passwords */ - - openManagePasswords() { return this.deviceApi.notify((0, _index.createNotification)('pmHandlerOpenManagePasswords')); } + /** * Opens the native UI for managing identities */ - - openManageIdentities() { return this.deviceApi.notify((0, _index.createNotification)('pmHandlerOpenManageIdentities')); } + /** * Opens the native UI for managing credit cards */ - - openManageCreditCards() { return this.deviceApi.notify((0, _index.createNotification)('pmHandlerOpenManageCreditCards')); } + /** * Gets a single identity obj once the user requests it * @param {IdentityObject['id']} id * @returns {Promise<{success: IdentityObject|undefined}>} */ - - getAutofillIdentity(id) { const identity = this.getLocalIdentities().find(_ref2 => { let { id: identityId } = _ref2; - return "".concat(identityId) === "".concat(id); + return `${identityId}` === `${id}`; }); return Promise.resolve({ success: identity }); } + /** * Gets a single complete credit card obj once the user requests it * @param {CreditCardObject['id']} id * @returns {APIResponse} */ - - getAutofillCreditCard(id) { return this.deviceApi.request((0, _index.createRequest)('pmHandlerGetCreditCard', { id })); } - getCurrentInputType() { - var _this$activeForm; - const topContextData = this.getTopContextData(); - return topContextData !== null && topContextData !== void 0 && topContextData.inputType ? topContextData.inputType : (0, _matching.getInputType)((_this$activeForm = this.activeForm) === null || _this$activeForm === void 0 ? void 0 : _this$activeForm.activeInput); + return topContextData?.inputType ? topContextData.inputType : (0, _matching.getInputType)(this.activeForm?.activeInput); } + /** * @returns {Promise} */ - - async getAlias() { const { alias @@ -4039,7 +3573,6 @@ class AppleDeviceInterface extends _InterfacePrototype.default { })); return alias ? (0, _autofillUtils.formatDuckAddress)(alias) : alias; } - addLogoutListener(handler) { // Only deal with logging out if we're in the email web app if (!this.globalConfig.isDDGDomain) return; @@ -4049,7 +3582,6 @@ class AppleDeviceInterface extends _InterfacePrototype.default { } }); } - async addDeviceListeners() { if (this.settings.featureToggles.third_party_credentials_provider) { if (this.globalConfig.hasModernWebkitAPI) { @@ -4066,17 +3598,15 @@ class AppleDeviceInterface extends _InterfacePrototype.default { setTimeout(() => this._pollForUpdatesToCredentialsProvider(), 2000); } } - } // Only used on Catalina - + } + // Only used on Catalina async _pollForUpdatesToCredentialsProvider() { try { const response = await this.deviceApi.request(new _deviceApiCalls.CheckCredentialsProviderStatusCall(null)); - if (response.availableInputTypes.credentialsProviderStatus !== this.settings.availableInputTypes.credentialsProviderStatus) { this.providerStatusUpdated(response); } - setTimeout(() => this._pollForUpdatesToCredentialsProvider(), 2000); } catch (e) { if (this.globalConfig.isDDGTestMode) { @@ -4084,9 +3614,9 @@ class AppleDeviceInterface extends _InterfacePrototype.default { } } } - /** @type {any} */ - + /** @type {any} */ + pollingTimeout = null; /** * Poll the native listener until the user has selected a credential. * Message return types are: @@ -4101,13 +3631,11 @@ class AppleDeviceInterface extends _InterfacePrototype.default { const poll = async () => { clearTimeout(this.pollingTimeout); const response = await this.getSelectedCredentials(); - switch (response.type) { case 'none': // Parent hasn't got a selected credential yet this.pollingTimeout = setTimeout(() => poll(), 100); return; - case 'ok': { await callback({ @@ -4116,7 +3644,6 @@ class AppleDeviceInterface extends _InterfacePrototype.default { }); return; } - case 'state': { // Inform that state has changed, but continue polling @@ -4127,7 +3654,6 @@ class AppleDeviceInterface extends _InterfacePrototype.default { this.pollingTimeout = setTimeout(() => poll(), 100); return; } - case 'stop': // Parent wants us to stop polling await callback({ @@ -4135,12 +3661,9 @@ class AppleDeviceInterface extends _InterfacePrototype.default { }); } }; - poll(); } - } - exports.AppleDeviceInterface = AppleDeviceInterface; },{"../../packages/device-api/index.js":2,"../Form/matching.js":33,"../InContextSignup.js":34,"../UI/HTMLTooltip.js":44,"../UI/controllers/HTMLTooltipUIController.js":45,"../UI/controllers/NativeUIController.js":46,"../UI/controllers/OverlayUIController.js":47,"../autofill-utils.js":51,"../deviceApiCalls/__generated__/deviceApiCalls.js":55,"../deviceApiCalls/additionalDeviceApiCalls.js":57,"./InterfacePrototype.js":17,"@duckduckgo/content-scope-scripts/src/apple-utils":1}],15:[function(require,module,exports){ @@ -4150,21 +3673,12 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.AppleOverlayDeviceInterface = void 0; - var _AppleDeviceInterface = require("./AppleDeviceInterface.js"); - var _HTMLTooltipUIController = require("../UI/controllers/HTMLTooltipUIController.js"); - var _overlayApi = require("./overlayApi.js"); - var _index = require("../../packages/device-api/index.js"); - var _deviceApiCalls = require("../deviceApiCalls/__generated__/deviceApiCalls.js"); - var _validatorsZod = require("../deviceApiCalls/__generated__/validators.zod.js"); - -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - /** * This subclass is designed to separate code that *only* runs inside the * Overlay into a single place. @@ -4173,17 +3687,18 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope * can be viewed as *not* executing within a regular page context. */ class AppleOverlayDeviceInterface extends _AppleDeviceInterface.AppleDeviceInterface { - constructor() { - super(...arguments); - - _defineProperty(this, "stripCredentials", false); - - _defineProperty(this, "overlay", (0, _overlayApi.overlayApi)(this)); - - _defineProperty(this, "previousX", 0); + /** + * Mark top frame as not stripping credential data + * @type {boolean} + */ + stripCredentials = false; - _defineProperty(this, "previousY", 0); - } + /** + * overlay API helpers + */ + overlay = (0, _overlayApi.overlayApi)(this); + previousX = 0; + previousY = 0; /** * Because we're running inside the Overlay, we always create the HTML @@ -4194,9 +3709,7 @@ class AppleOverlayDeviceInterface extends _AppleDeviceInterface.AppleDeviceInter */ createUIController() { return new _HTMLTooltipUIController.HTMLTooltipUIController({ - tooltipKind: - /** @type {const} */ - 'modern', + tooltipKind: /** @type {const} */'modern', device: this }, { wrapperClass: 'top-autofill', @@ -4206,7 +3719,6 @@ class AppleOverlayDeviceInterface extends _AppleDeviceInterface.AppleDeviceInter testMode: this.isTestMode() }); } - addDeviceListeners() { /** * The native side will send a custom event 'mouseMove' to indicate @@ -4216,26 +3728,25 @@ class AppleOverlayDeviceInterface extends _AppleDeviceInterface.AppleDeviceInter * page load every time it's opened. */ window.addEventListener('mouseMove', event => { - var _this$uiController, _this$uiController$ge; - // Don't set focus if the mouse hasn't moved ever // This is to avoid clickjacking where an attacker puts the pulldown under the cursor // and tricks the user into clicking - if (!this.previousX && !this.previousY || // if no previous coords + if (!this.previousX && !this.previousY || + // if no previous coords this.previousX === event.detail.x && this.previousY === event.detail.y // or the mouse hasn't moved ) { this.previousX = event.detail.x; this.previousY = event.detail.y; return; } - - const activeTooltip = (_this$uiController = this.uiController) === null || _this$uiController === void 0 ? void 0 : (_this$uiController$ge = _this$uiController.getActiveTooltip) === null || _this$uiController$ge === void 0 ? void 0 : _this$uiController$ge.call(_this$uiController); - activeTooltip === null || activeTooltip === void 0 ? void 0 : activeTooltip.focus(event.detail.x, event.detail.y); + const activeTooltip = this.uiController?.getActiveTooltip?.(); + activeTooltip?.focus(event.detail.x, event.detail.y); this.previousX = event.detail.x; this.previousY = event.detail.y; }); return super.addDeviceListeners(); } + /** * Since we're running inside the Overlay we can limit what happens here to * be only things that are needed to power the HTML Tooltip @@ -4243,23 +3754,20 @@ class AppleOverlayDeviceInterface extends _AppleDeviceInterface.AppleDeviceInter * @override * @returns {Promise} */ - - async setupAutofill() { await this._getAutofillInitData(); await this.inContextSignup.init(); const signedIn = await this._checkDeviceSignedIn(); - if (signedIn) { await this.getAddresses(); } } - async postInit() { // setup overlay API pieces this.overlay.showImmediately(); super.postInit(); } + /** * In the top-frame scenario we override the base 'selectedDetail'. * @@ -4269,33 +3777,27 @@ class AppleOverlayDeviceInterface extends _AppleDeviceInterface.AppleDeviceInter * @param {IdentityObject|CreditCardObject|CredentialsObject|{email:string, id: string}} data * @param {string} type */ - - async selectedDetail(data, type) { return this.overlay.selectedDetail(data, type); } - async askToUnlockProvider() { const response = await this.deviceApi.request(new _deviceApiCalls.AskToUnlockProviderCall(null)); this.providerStatusUpdated(response); } - providerStatusUpdated(data) { - var _this$uiController2; - const { credentials, availableInputTypes - } = (0, _index.validate)(data, _validatorsZod.providerStatusUpdatedSchema); // Update local settings and data + } = (0, _index.validate)(data, _validatorsZod.providerStatusUpdatedSchema); + // Update local settings and data this.settings.setAvailableInputTypes(availableInputTypes); - this.storeLocalCredentials(credentials); // rerender the tooltip + this.storeLocalCredentials(credentials); - (_this$uiController2 = this.uiController) === null || _this$uiController2 === void 0 ? void 0 : _this$uiController2.updateItems(credentials); + // rerender the tooltip + this.uiController?.updateItems(credentials); } - } - exports.AppleOverlayDeviceInterface = AppleOverlayDeviceInterface; },{"../../packages/device-api/index.js":2,"../UI/controllers/HTMLTooltipUIController.js":45,"../deviceApiCalls/__generated__/deviceApiCalls.js":55,"../deviceApiCalls/__generated__/validators.zod.js":56,"./AppleDeviceInterface.js":14,"./overlayApi.js":21}],16:[function(require,module,exports){ @@ -4305,42 +3807,31 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.ExtensionInterface = void 0; - var _InterfacePrototype = _interopRequireDefault(require("./InterfacePrototype.js")); - var _autofillUtils = require("../autofill-utils.js"); - var _HTMLTooltipUIController = require("../UI/controllers/HTMLTooltipUIController.js"); - var _HTMLTooltip = require("../UI/HTMLTooltip.js"); - var _InContextSignup = require("../InContextSignup.js"); - var _matching = require("../Form/matching.js"); - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - const TOOLTIP_TYPES = { EmailProtection: 'EmailProtection', EmailSignup: 'EmailSignup' }; - class ExtensionInterface extends _InterfacePrototype.default { - constructor() { - super(...arguments); - - _defineProperty(this, "inContextSignup", new _InContextSignup.InContextSignup(this)); - } + /** + * Adding this here since only the extension currently supports this + */ + inContextSignup = new _InContextSignup.InContextSignup(this); /** * @override */ createUIController() { /** @type {import('../UI/HTMLTooltip.js').HTMLTooltipOptions} */ - const htmlTooltipOptions = { ..._HTMLTooltip.defaultOptions, - css: ""), + const htmlTooltipOptions = { + ..._HTMLTooltip.defaultOptions, + css: ``, testMode: this.isTestMode(), hasCaret: true }; @@ -4354,23 +3845,16 @@ class ExtensionInterface extends _InterfacePrototype.default { device: this }, htmlTooltipOptions); } - getActiveTooltipType() { - var _this$activeForm, _this$inContextSignup; - if (this.hasLocalAddresses) { return TOOLTIP_TYPES.EmailProtection; } - - const inputType = (_this$activeForm = this.activeForm) !== null && _this$activeForm !== void 0 && _this$activeForm.activeInput ? (0, _matching.getInputSubtype)(this.activeForm.activeInput) : undefined; - - if ((_this$inContextSignup = this.inContextSignup) !== null && _this$inContextSignup !== void 0 && _this$inContextSignup.isAvailable(inputType)) { + const inputType = this.activeForm?.activeInput ? (0, _matching.getInputSubtype)(this.activeForm.activeInput) : undefined; + if (this.inContextSignup?.isAvailable(inputType)) { return TOOLTIP_TYPES.EmailSignup; } - return null; } - async resetAutofillUI(callback) { this.removeAutofillUIFromPage('Resetting autofill.'); await this.setupAutofill(); @@ -4378,12 +3862,9 @@ class ExtensionInterface extends _InterfacePrototype.default { this.uiController = this.createUIController(); await this.postInit(); } - async isEnabled() { return new Promise(resolve => { - var _chrome, _chrome$runtime; - - (_chrome = chrome) === null || _chrome === void 0 ? void 0 : (_chrome$runtime = _chrome.runtime) === null || _chrome$runtime === void 0 ? void 0 : _chrome$runtime.sendMessage({ + chrome?.runtime?.sendMessage({ registeredTempAutofillContentScript: true, documentUrl: window.location.href }, response => { @@ -4393,11 +3874,9 @@ class ExtensionInterface extends _InterfacePrototype.default { }); }); } - isDeviceSignedIn() { return this.hasLocalAddresses; } - async setupAutofill() { /** * In the extension, we must resolve `inContextSignup` data as part of setup @@ -4405,17 +3884,13 @@ class ExtensionInterface extends _InterfacePrototype.default { await this.inContextSignup.init(); return this.getAddresses(); } - postInit() { switch (this.getActiveTooltipType()) { case TOOLTIP_TYPES.EmailProtection: { - var _this$activeForm2; - this._scannerCleanup = this.scanner.init(); this.addLogoutListener(() => { this.resetAutofillUI(); - if (this.globalConfig.isDDGDomain) { (0, _autofillUtils.notifyWebApp)({ deviceSignedIn: { @@ -4424,13 +3899,10 @@ class ExtensionInterface extends _InterfacePrototype.default { }); } }); - - if ((_this$activeForm2 = this.activeForm) !== null && _this$activeForm2 !== void 0 && _this$activeForm2.activeInput) { - var _this$activeForm3; - + if (this.activeForm?.activeInput) { this.attachTooltip({ form: this.activeForm, - input: (_this$activeForm3 = this.activeForm) === null || _this$activeForm3 === void 0 ? void 0 : _this$activeForm3.activeInput, + input: this.activeForm?.activeInput, click: null, trigger: 'postSignup', triggerMetaData: { @@ -4438,16 +3910,13 @@ class ExtensionInterface extends _InterfacePrototype.default { } }); } - break; } - case TOOLTIP_TYPES.EmailSignup: { this._scannerCleanup = this.scanner.init(); break; } - default: { // Don't do anyhing if we don't have a tooltip to show @@ -4455,7 +3924,6 @@ class ExtensionInterface extends _InterfacePrototype.default { } } } - getAddresses() { return new Promise(resolve => chrome.runtime.sendMessage({ getAddresses: true @@ -4464,41 +3932,38 @@ class ExtensionInterface extends _InterfacePrototype.default { return resolve(data); })); } + /** * Used by the email web app * Settings page displays data of the logged in user data */ - - getUserData() { return new Promise(resolve => chrome.runtime.sendMessage({ getUserData: true }, data => resolve(data))); } + /** * Used by the email web app * Device capabilities determine which functionality is available to the user */ - - getEmailProtectionCapabilities() { return new Promise(resolve => chrome.runtime.sendMessage({ getEmailProtectionCapabilities: true }, data => resolve(data))); } - refreshAlias() { return chrome.runtime.sendMessage({ refreshAlias: true }, addresses => this.storeLocalAddresses(addresses)); } - async trySigningIn() { if (this.globalConfig.isDDGDomain) { const data = await (0, _autofillUtils.sendAndWaitForAnswer)(_autofillUtils.SIGN_IN_MSG, 'addUserData'); this.storeUserData(data); } } + /** * @param {object} message * @param {object} message.addUserData @@ -4506,23 +3971,19 @@ class ExtensionInterface extends _InterfacePrototype.default { * @param {string} message.addUserData.userName * @param {string} message.addUserData.cohort */ - - storeUserData(message) { return chrome.runtime.sendMessage(message); } + /** * Used by the email web app * Provides functionality to log the user out */ - - removeUserData() { return chrome.runtime.sendMessage({ removeUserData: true }); } - addDeviceListeners() { // Add contextual menu listeners let activeEl = null; @@ -4531,49 +3992,43 @@ class ExtensionInterface extends _InterfacePrototype.default { }); chrome.runtime.onMessage.addListener((message, sender) => { if (sender.id !== chrome.runtime.id) return; - switch (message.type) { case 'ddgUserReady': this.resetAutofillUI(() => this.setupSettingsPage({ shouldLog: true })); break; - case 'contextualAutofill': (0, _autofillUtils.setValue)(activeEl, (0, _autofillUtils.formatDuckAddress)(message.alias), this.globalConfig); activeEl.classList.add('ddg-autofilled'); - this.refreshAlias(); // If the user changes the alias, remove the decoration + this.refreshAlias(); + // If the user changes the alias, remove the decoration activeEl.addEventListener('input', e => e.target.classList.remove('ddg-autofilled'), { once: true }); break; - default: break; } }); } - addLogoutListener(handler) { // Make sure there's only one log out listener attached by removing the // previous logout listener first, if it exists. if (this._logoutListenerHandler) { chrome.runtime.onMessage.removeListener(this._logoutListenerHandler); - } // Cleanup on logout events - + } + // Cleanup on logout events this._logoutListenerHandler = (message, sender) => { if (sender.id === chrome.runtime.id && message.type === 'logout') { handler(); } }; - chrome.runtime.onMessage.addListener(this._logoutListenerHandler); } - } - exports.ExtensionInterface = ExtensionInterface; },{"../Form/matching.js":33,"../InContextSignup.js":34,"../UI/HTMLTooltip.js":44,"../UI/controllers/HTMLTooltipUIController.js":45,"../autofill-utils.js":51,"./InterfacePrototype.js":17}],17:[function(require,module,exports){ @@ -4583,90 +4038,69 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; - var _autofillUtils = require("../autofill-utils.js"); - var _matching = require("../Form/matching.js"); - var _formatters = require("../Form/formatters.js"); - var _Credentials = require("../InputTypes/Credentials.js"); - var _PasswordGenerator = require("../PasswordGenerator.js"); - var _Scanner = require("../Scanner.js"); - var _config = require("../config.js"); - var _NativeUIController = require("../UI/controllers/NativeUIController.js"); - var _transports = require("../deviceApiCalls/transports/transports.js"); - var _Settings = require("../Settings.js"); - var _index = require("../../packages/device-api/index.js"); - var _deviceApiCalls = require("../deviceApiCalls/__generated__/deviceApiCalls.js"); - var _initFormSubmissionsApi = require("./initFormSubmissionsApi.js"); - var _validatorsZod = require("../deviceApiCalls/__generated__/validators.zod.js"); - var _EmailProtection = require("../EmailProtection.js"); - -function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); } - -function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } } - -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - -function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; } - -function _classApplyDescriptorSet(receiver, descriptor, value) { if (descriptor.set) { descriptor.set.call(receiver, value); } else { if (!descriptor.writable) { throw new TypeError("attempted to set read only private field"); } descriptor.value = value; } } - -function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); } - -function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); } - -function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; } - -var _addresses = /*#__PURE__*/new WeakMap(); - -var _data2 = /*#__PURE__*/new WeakMap(); - /** * @typedef {import('../deviceApiCalls/__generated__/validators-ts').StoreFormData} StoreFormData */ - /** * @implements {GlobalConfigImpl} * @implements {FormExtensionPoints} * @implements {DeviceExtensionPoints} */ class InterfacePrototype { + attempts = 0; /** @type {import("../Form/Form").Form | null} */ - + activeForm = null; /** @type {import("../UI/HTMLTooltip.js").default | null} */ - + currentTooltip = null; /** @type {number} */ + initialSetupDelayMs = 0; + autopromptFired = false; /** @type {PasswordGenerator} */ + passwordGenerator = new _PasswordGenerator.PasswordGenerator(); + emailProtection = new _EmailProtection.EmailProtection(this); /** @type {import("../InContextSignup.js").InContextSignup | null} */ + inContextSignup = null; /** @type {{privateAddress: string, personalAddress: string}} */ + #addresses = { + privateAddress: '', + personalAddress: '' + }; /** @type {GlobalConfig} */ + globalConfig; /** @type {import('../Scanner').Scanner} */ + scanner; /** @type {import("../UI/controllers/UIController.js").UIController | null} */ + uiController; /** @type {import("../../packages/device-api").DeviceApi} */ + deviceApi; /** @type {boolean} */ + isInitializationStarted; /** @type {((reason, ...rest) => void) | null} */ + _scannerCleanup = null; /** * @param {GlobalConfig} config @@ -4674,52 +4108,6 @@ class InterfacePrototype { * @param {Settings} settings */ constructor(config, deviceApi, settings) { - _defineProperty(this, "attempts", 0); - - _defineProperty(this, "activeForm", null); - - _defineProperty(this, "currentTooltip", null); - - _defineProperty(this, "initialSetupDelayMs", 0); - - _defineProperty(this, "autopromptFired", false); - - _defineProperty(this, "passwordGenerator", new _PasswordGenerator.PasswordGenerator()); - - _defineProperty(this, "emailProtection", new _EmailProtection.EmailProtection(this)); - - _defineProperty(this, "inContextSignup", null); - - _classPrivateFieldInitSpec(this, _addresses, { - writable: true, - value: { - privateAddress: '', - personalAddress: '' - } - }); - - _defineProperty(this, "globalConfig", void 0); - - _defineProperty(this, "scanner", void 0); - - _defineProperty(this, "uiController", void 0); - - _defineProperty(this, "deviceApi", void 0); - - _defineProperty(this, "isInitializationStarted", void 0); - - _defineProperty(this, "_scannerCleanup", null); - - _classPrivateFieldInitSpec(this, _data2, { - writable: true, - value: { - credentials: [], - creditCards: [], - identities: [], - topContextData: undefined - } - }); - this.globalConfig = config; this.deviceApi = deviceApi; this.settings = settings; @@ -4729,60 +4117,56 @@ class InterfacePrototype { }); this.isInitializationStarted = false; } + /** * Implementors should override this with a UI controller that suits * their platform. * * @returns {import("../UI/controllers/UIController.js").UIController} */ - - createUIController() { return new _NativeUIController.NativeUIController(); } + /** * @param {string} reason */ - - removeAutofillUIFromPage(reason) { - var _this$uiController, _this$_scannerCleanup; - - (_this$uiController = this.uiController) === null || _this$uiController === void 0 ? void 0 : _this$uiController.destroy(); - (_this$_scannerCleanup = this._scannerCleanup) === null || _this$_scannerCleanup === void 0 ? void 0 : _this$_scannerCleanup.call(this, reason); + this.uiController?.destroy(); + this._scannerCleanup?.(reason); } - get hasLocalAddresses() { - var _classPrivateFieldGet2, _classPrivateFieldGet3; - - return !!((_classPrivateFieldGet2 = _classPrivateFieldGet(this, _addresses)) !== null && _classPrivateFieldGet2 !== void 0 && _classPrivateFieldGet2.privateAddress && (_classPrivateFieldGet3 = _classPrivateFieldGet(this, _addresses)) !== null && _classPrivateFieldGet3 !== void 0 && _classPrivateFieldGet3.personalAddress); + return !!(this.#addresses?.privateAddress && this.#addresses?.personalAddress); } - getLocalAddresses() { - return _classPrivateFieldGet(this, _addresses); + return this.#addresses; } - storeLocalAddresses(addresses) { - _classPrivateFieldSet(this, _addresses, addresses); // When we get new duck addresses, add them to the identities list - - + this.#addresses = addresses; + // When we get new duck addresses, add them to the identities list const identities = this.getLocalIdentities(); const privateAddressIdentity = identities.find(_ref => { let { id } = _ref; return id === 'privateAddress'; - }); // If we had previously stored them, just update the private address - + }); + // If we had previously stored them, just update the private address if (privateAddressIdentity) { privateAddressIdentity.emailAddress = (0, _autofillUtils.formatDuckAddress)(addresses.privateAddress); } else { // Otherwise, add both addresses - _classPrivateFieldGet(this, _data2).identities = this.addDuckAddressesToIdentities(identities); + this.#data.identities = this.addDuckAddressesToIdentities(identities); } } - /** @type { PMData } */ + /** @type { PMData } */ + #data = { + credentials: [], + creditCards: [], + identities: [], + topContextData: undefined + }; /** * @returns {import('../Form/matching').SupportedTypes} @@ -4790,7 +4174,6 @@ class InterfacePrototype { getCurrentInputType() { throw new Error('Not implemented'); } - addDuckAddressesToIdentities(identities) { if (!this.hasLocalAddresses) return identities; const newIdentities = []; @@ -4799,16 +4182,18 @@ class InterfacePrototype { personalAddress } = this.getLocalAddresses(); privateAddress = (0, _autofillUtils.formatDuckAddress)(privateAddress); - personalAddress = (0, _autofillUtils.formatDuckAddress)(personalAddress); // Get the duck addresses in identities + personalAddress = (0, _autofillUtils.formatDuckAddress)(personalAddress); + // Get the duck addresses in identities const duckEmailsInIdentities = identities.reduce((duckEmails, _ref2) => { let { emailAddress: email } = _ref2; - return email !== null && email !== void 0 && email.includes(_autofillUtils.ADDRESS_DOMAIN) ? duckEmails.concat(email) : duckEmails; - }, []); // Only add the personal duck address to identities if the user hasn't - // already manually added it + return email?.includes(_autofillUtils.ADDRESS_DOMAIN) ? duckEmails.concat(email) : duckEmails; + }, []); + // Only add the personal duck address to identities if the user hasn't + // already manually added it if (!duckEmailsInIdentities.includes(personalAddress)) { newIdentities.push({ id: 'personalAddress', @@ -4816,7 +4201,6 @@ class InterfacePrototype { title: 'Block email trackers' }); } - newIdentities.push({ id: 'privateAddress', emailAddress: privateAddress, @@ -4824,58 +4208,55 @@ class InterfacePrototype { }); return [...identities, ...newIdentities]; } + /** * Stores init data coming from the tooltipHandler * @param { InboundPMData } data */ - - storeLocalData(data) { this.storeLocalCredentials(data.credentials); - data.creditCards.forEach(cc => delete cc.cardNumber && delete cc.cardSecurityCode); // Store the full name as a separate field to simplify autocomplete - - const updatedIdentities = data.identities.map(identity => ({ ...identity, + data.creditCards.forEach(cc => delete cc.cardNumber && delete cc.cardSecurityCode); + // Store the full name as a separate field to simplify autocomplete + const updatedIdentities = data.identities.map(identity => ({ + ...identity, fullName: (0, _formatters.formatFullName)(identity) - })); // Add addresses - - _classPrivateFieldGet(this, _data2).identities = this.addDuckAddressesToIdentities(updatedIdentities); - _classPrivateFieldGet(this, _data2).creditCards = data.creditCards; // Top autofill only + })); + // Add addresses + this.#data.identities = this.addDuckAddressesToIdentities(updatedIdentities); + this.#data.creditCards = data.creditCards; + // Top autofill only if (data.serializedInputContext) { try { - _classPrivateFieldGet(this, _data2).topContextData = JSON.parse(data.serializedInputContext); + this.#data.topContextData = JSON.parse(data.serializedInputContext); } catch (e) { console.error(e); this.removeTooltip(); } } } + /** * Stores credentials locally * @param {CredentialsObject[]} credentials */ - - storeLocalCredentials(credentials) { credentials.forEach(cred => delete cred.password); - _classPrivateFieldGet(this, _data2).credentials = credentials; + this.#data.credentials = credentials; } - getTopContextData() { - return _classPrivateFieldGet(this, _data2).topContextData; + return this.#data.topContextData; } + /** * @deprecated use `availableInputTypes.credentials` directly instead * @returns {boolean} */ - - get hasLocalCredentials() { - return _classPrivateFieldGet(this, _data2).credentials.length > 0; + return this.#data.credentials.length > 0; } - getLocalCredentials() { - return _classPrivateFieldGet(this, _data2).credentials.map(cred => { + return this.#data.credentials.map(cred => { const { password, ...rest @@ -4887,51 +4268,44 @@ class InterfacePrototype { * @deprecated use `availableInputTypes.identities` directly instead * @returns {boolean} */ - - get hasLocalIdentities() { - return _classPrivateFieldGet(this, _data2).identities.length > 0; + return this.#data.identities.length > 0; } - getLocalIdentities() { - return _classPrivateFieldGet(this, _data2).identities; + return this.#data.identities; } + /** * @deprecated use `availableInputTypes.creditCards` directly instead * @returns {boolean} */ - - get hasLocalCreditCards() { - return _classPrivateFieldGet(this, _data2).creditCards.length > 0; + return this.#data.creditCards.length > 0; } /** @return {CreditCardObject[]} */ - - getLocalCreditCards() { - return _classPrivateFieldGet(this, _data2).creditCards; + return this.#data.creditCards; } - async startInit() { if (this.isInitializationStarted) return; this.alreadyInitialized = true; await this.refreshSettings(); this.addDeviceListeners(); await this.setupAutofill(); - this.uiController = this.createUIController(); // this is the temporary measure to support windows whilst we still have 'setupAutofill' - // eventually all interfaces will use this + this.uiController = this.createUIController(); + // this is the temporary measure to support windows whilst we still have 'setupAutofill' + // eventually all interfaces will use this if (!this.isEnabledViaSettings()) { return; } - await this.setupSettingsPage(); await this.postInit(); - if (this.settings.featureToggles.credentials_saving) { (0, _initFormSubmissionsApi.initFormSubmissionsApi)(this.scanner.forms, this.scanner.matching); } } + /** * This is to aid the migration to all platforms using Settings.enabled. * @@ -4943,11 +4317,10 @@ class InterfacePrototype { * * @returns {boolean} */ - - isEnabledViaSettings() { return true; } + /** * This is a fall-back situation for macOS since it was the only * platform to support anything none-email based in the past. @@ -4956,20 +4329,15 @@ class InterfacePrototype { * * @returns {Promise} */ - - async refreshSettings() { await this.settings.refresh(); } - async isEnabled() { return (0, _autofillUtils.autofillEnabled)(this.globalConfig); } - async init() { const isEnabled = await this.isEnabled(); if (!isEnabled) return; - const handler = async () => { if (document.readyState === 'complete') { window.removeEventListener('load', handler); @@ -4977,7 +4345,6 @@ class InterfacePrototype { await this.startInit(); } }; - if (document.readyState === 'complete') { await this.startInit(); } else { @@ -4985,12 +4352,10 @@ class InterfacePrototype { document.addEventListener('readystatechange', handler); } } - postInit() { const cleanup = this.scanner.init(); this.addLogoutListener(() => { cleanup('Logged out'); - if (this.globalConfig.isDDGDomain) { (0, _autofillUtils.notifyWebApp)({ deviceSignedIn: { @@ -5000,19 +4365,18 @@ class InterfacePrototype { } }); } + /** * @deprecated This was a port from the macOS implementation so the API may not be suitable for all * @returns {Promise} */ - - async getSelectedCredentials() { throw new Error('`getSelectedCredentials` not implemented'); } - isTestMode() { return this.globalConfig.isDDGTestMode; } + /** * This indicates an item was selected on Desktop, and we should try to autofill * @@ -5022,35 +4386,30 @@ class InterfacePrototype { * @param {IdentityObject|CreditCardObject|CredentialsObject|{email:string, id: string}} data * @param {string} type */ - - async selectedDetail(data, type) { const form = this.activeForm; - if (!form) { return; - } // are we autofilling email? - + } + // are we autofilling email? if (type === 'email' && 'email' in data) { form.autofillEmail(data.email); } else { form.autofillData(data, type); } - const isPrivateAddress = data.id === 'privateAddress'; + /** * This is desktop only: was it a private address? if so, save it with * the trigger 'emailProtection' so that native sides can use it */ - if (isPrivateAddress) { this.refreshAlias(); - if ('emailAddress' in data && data.emailAddress) { this.emailProtection.storeReceived(data.emailAddress); - /** @type {DataStorageObject} */ + /** @type {DataStorageObject} */ const formValues = { credentials: { username: data.emailAddress, @@ -5060,9 +4419,9 @@ class InterfacePrototype { this.storeFormData(formValues, 'emailProtection'); } } - await this.removeTooltip(); } + /** * Before the DataWebTooltip opens, we collect the data based on the config.type * @param {InputTypeConfigs} config @@ -5070,19 +4429,14 @@ class InterfacePrototype { * @param {TopContextData} [data] * @returns {(CredentialsObject|CreditCardObject|IdentityObject)[]} */ - - dataForAutofill(config, inputType, data) { const subtype = (0, _matching.getSubtypeFromType)(inputType); - if (config.type === 'identities') { return this.getLocalIdentities().filter(identity => !!identity[subtype]); } - if (config.type === 'creditCards') { return this.getLocalCreditCards(); } - if (config.type === 'credentials') { if (data) { if (Array.isArray(data.credentials) && data.credentials.length > 0) { @@ -5092,9 +4446,9 @@ class InterfacePrototype { } } } - return []; } + /** * @param {object} params * @param {import("../Form/Form").Form} params.form @@ -5103,35 +4457,31 @@ class InterfacePrototype { * @param {import('../deviceApiCalls/__generated__/validators-ts').GetAutofillDataRequest['trigger']} params.trigger * @param {import('../UI/controllers/UIController.js').AttachArgs["triggerMetaData"]} params.triggerMetaData */ - - attachTooltip(params) { - var _this$uiController2; - const { form, input, click, trigger - } = params; // Avoid flashing tooltip from background tabs on macOS - - if (document.visibilityState !== 'visible' && trigger !== 'postSignup') return; // Only autoprompt on mobile devices - - if (trigger === 'autoprompt' && !this.globalConfig.isMobileApp) return; // Only fire autoprompt once - + } = params; + // Avoid flashing tooltip from background tabs on macOS + if (document.visibilityState !== 'visible' && trigger !== 'postSignup') return; + // Only autoprompt on mobile devices + if (trigger === 'autoprompt' && !this.globalConfig.isMobileApp) return; + // Only fire autoprompt once if (trigger === 'autoprompt' && this.autopromptFired) return; form.activeInput = input; this.activeForm = form; const inputType = (0, _matching.getInputType)(input); - /** @type {PosFn} */ + /** @type {PosFn} */ const getPosition = () => { // In extensions, the tooltip is centered on the Dax icon const alignLeft = this.globalConfig.isApp || this.globalConfig.isWindows; return alignLeft ? input.getBoundingClientRect() : (0, _autofillUtils.getDaxBoundingBox)(input); - }; // todo: this will be migrated to use NativeUIController soon - + }; + // todo: this will be migrated to use NativeUIController soon if (this.globalConfig.isMobileApp && inputType === 'identities.emailAddress') { this.getAlias().then(alias => { if (alias) { @@ -5140,31 +4490,28 @@ class InterfacePrototype { * We're on mobile here, so we just record the email received. * Then later in the form submission we can compare the values */ - this.emailProtection.storeReceived(alias); } else { - var _form$activeInput; + form.activeInput?.focus(); + } - (_form$activeInput = form.activeInput) === null || _form$activeInput === void 0 ? void 0 : _form$activeInput.focus(); - } // Update data from native-side in case the `getAlias` call + // Update data from native-side in case the `getAlias` call // has included a successful in-context signup - - this.updateForStateChange(); this.onFinishedAutofill(); }); return; } - /** @type {TopContextData} */ - + /** @type {TopContextData} */ const topContextData = { inputType - }; // Allow features to append/change top context data - // for example, generated passwords may get appended here + }; + // Allow features to append/change top context data + // for example, generated passwords may get appended here const processedTopContext = this.preAttachTooltip(topContextData, input, form); - (_this$uiController2 = this.uiController) === null || _this$uiController2 === void 0 ? void 0 : _this$uiController2.attach({ + this.uiController?.attach({ input, form, click, @@ -5174,11 +4521,11 @@ class InterfacePrototype { trigger, triggerMetaData: params.triggerMetaData }); - if (trigger === 'autoprompt') { this.autopromptFired = true; } } + /** * When an item was selected, we then call back to the device * to fetch the full suite of data needed to complete the autofill @@ -5187,52 +4534,43 @@ class InterfacePrototype { * @param {(CreditCardObject|IdentityObject|CredentialsObject)[]} items * @param {CreditCardObject['id']|IdentityObject['id']|CredentialsObject['id']} id */ - - onSelect(inputType, items, id) { id = String(id); const mainType = (0, _matching.getMainTypeFromType)(inputType); const subtype = (0, _matching.getSubtypeFromType)(inputType); - if (id === _Credentials.PROVIDER_LOCKED) { return this.askToUnlockProvider(); } - const matchingData = items.find(item => String(item.id) === id); if (!matchingData) throw new Error('unreachable (fatal)'); - const dataPromise = (() => { switch (mainType) { case 'creditCards': return this.getAutofillCreditCard(id); - case 'identities': return this.getAutofillIdentity(id); - case 'credentials': { if (_Credentials.AUTOGENERATED_KEY in matchingData) { - const autogeneratedPayload = { ...matchingData, + const autogeneratedPayload = { + ...matchingData, username: '' }; return Promise.resolve({ success: autogeneratedPayload }); } - return this.getAutofillCredentials(id); } - default: throw new Error('unreachable!'); } - })(); // wait for the data back from the device - + })(); + // wait for the data back from the device dataPromise.then(response => { if (response) { const data = response.success || response; - if (mainType === 'identities') { this.firePixel({ pixelName: 'autofill_identity', @@ -5240,35 +4578,29 @@ class InterfacePrototype { fieldType: subtype } }); - switch (id) { case 'personalAddress': this.firePixel({ pixelName: 'autofill_personal_address' }); break; - case 'privateAddress': this.firePixel({ pixelName: 'autofill_private_address' }); break; - default: // Also fire pixel when filling an identity with the personal duck address from an email field - const checks = [subtype === 'emailAddress', this.hasLocalAddresses, (data === null || data === void 0 ? void 0 : data.emailAddress) === (0, _autofillUtils.formatDuckAddress)(_classPrivateFieldGet(this, _addresses).personalAddress)]; - + const checks = [subtype === 'emailAddress', this.hasLocalAddresses, data?.emailAddress === (0, _autofillUtils.formatDuckAddress)(this.#addresses.personalAddress)]; if (checks.every(Boolean)) { this.firePixel({ pixelName: 'autofill_personal_address' }); } - break; } - } // some platforms do not include a `success` object, why? - - + } + // some platforms do not include a `success` object, why? return this.selectedDetail(data, mainType); } else { return Promise.reject(new Error('none-success response')); @@ -5278,91 +4610,68 @@ class InterfacePrototype { return this.removeTooltip(); }); } - async askToUnlockProvider() { const response = await this.deviceApi.request(new _deviceApiCalls.AskToUnlockProviderCall(null)); this.providerStatusUpdated(response); } - isTooltipActive() { - var _this$uiController$is, _this$uiController3, _this$uiController3$i; - - return (_this$uiController$is = (_this$uiController3 = this.uiController) === null || _this$uiController3 === void 0 ? void 0 : (_this$uiController3$i = _this$uiController3.isActive) === null || _this$uiController3$i === void 0 ? void 0 : _this$uiController3$i.call(_this$uiController3)) !== null && _this$uiController$is !== void 0 ? _this$uiController$is : false; + return this.uiController?.isActive?.() ?? false; } - removeTooltip() { - var _this$uiController4, _this$uiController4$r; - - return (_this$uiController4 = this.uiController) === null || _this$uiController4 === void 0 ? void 0 : (_this$uiController4$r = _this$uiController4.removeTooltip) === null || _this$uiController4$r === void 0 ? void 0 : _this$uiController4$r.call(_this$uiController4, 'interface'); + return this.uiController?.removeTooltip?.('interface'); } - onFinishedAutofill() { - var _this$activeForm, _this$activeForm$acti; - // Let input handlers know we've stopped autofilling - (_this$activeForm = this.activeForm) === null || _this$activeForm === void 0 ? void 0 : (_this$activeForm$acti = _this$activeForm.activeInput) === null || _this$activeForm$acti === void 0 ? void 0 : _this$activeForm$acti.dispatchEvent(new Event('mouseleave')); + this.activeForm?.activeInput?.dispatchEvent(new Event('mouseleave')); } - async updateForStateChange() { - var _this$activeForm2, _this$activeForm3; - // Remove decorations before refreshing data to make sure we // remove the currently set icons - (_this$activeForm2 = this.activeForm) === null || _this$activeForm2 === void 0 ? void 0 : _this$activeForm2.removeAllDecorations(); // Update for any state that may have changed + this.activeForm?.removeAllDecorations(); - await this.refreshData(); // Add correct icons and behaviour + // Update for any state that may have changed + await this.refreshData(); - (_this$activeForm3 = this.activeForm) === null || _this$activeForm3 === void 0 ? void 0 : _this$activeForm3.recategorizeAllInputs(); + // Add correct icons and behaviour + this.activeForm?.recategorizeAllInputs(); } - async refreshData() { - var _this$inContextSignup; - - await ((_this$inContextSignup = this.inContextSignup) === null || _this$inContextSignup === void 0 ? void 0 : _this$inContextSignup.refreshData()); + await this.inContextSignup?.refreshData(); await this.settings.populateData(); } - async setupSettingsPage() { let { shouldLog } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : { shouldLog: false }; - if (!this.globalConfig.isDDGDomain) { return; } - (0, _autofillUtils.notifyWebApp)({ isApp: this.globalConfig.isApp }); - if (this.isDeviceSignedIn()) { let userData; - try { userData = await this.getUserData(); } catch (e) {} - let capabilities; - try { capabilities = await this.getEmailProtectionCapabilities(); - } catch (e) {} // Set up listener for web app actions - + } catch (e) {} + // Set up listener for web app actions if (this.globalConfig.isDDGDomain) { window.addEventListener('message', e => { if (e.data.removeUserData) { this.removeUserData(); } - if (e.data.closeEmailProtection) { this.closeEmailProtection(); } }); } - const hasUserData = userData && !userData.error && Object.entries(userData).length > 0; (0, _autofillUtils.notifyWebApp)({ deviceSignedIn: { @@ -5376,43 +4685,35 @@ class InterfacePrototype { this.trySigningIn(); } } - async setupAutofill() {} - /** @returns {Promise} */ - + /** @returns {Promise} */ async getAddresses() { throw new Error('unimplemented'); } - /** @returns {Promise>} */ - + /** @returns {Promise>} */ getUserData() { return Promise.resolve(null); } - /** @returns {void} */ - - removeUserData() {} /** @returns {void} */ + removeUserData() {} - + /** @returns {void} */ closeEmailProtection() {} - /** @returns {Promise>} */ - + /** @returns {Promise>} */ getEmailProtectionCapabilities() { throw new Error('unimplemented'); } - refreshAlias() {} - async trySigningIn() { if (this.globalConfig.isDDGDomain) { if (this.attempts < 10) { this.attempts++; - const data = await (0, _autofillUtils.sendAndWaitForAnswer)(_autofillUtils.SIGN_IN_MSG, 'addUserData'); // This call doesn't send a response, so we can't know if it succeeded - + const data = await (0, _autofillUtils.sendAndWaitForAnswer)(_autofillUtils.SIGN_IN_MSG, 'addUserData'); + // This call doesn't send a response, so we can't know if it succeeded this.storeUserData(data); await this.setupAutofill(); await this.refreshSettings(); @@ -5425,37 +4726,32 @@ class InterfacePrototype { } } } - storeUserData(_data) {} - addDeviceListeners() {} + /** * Called by the native layer on all tabs when the provider status is updated * @param {import("../deviceApiCalls/__generated__/validators-ts").ProviderStatusUpdated} data */ - - providerStatusUpdated(data) { try { - var _this$uiController5, _availableInputTypes$; - const { credentials, availableInputTypes - } = (0, _index.validate)(data, _validatorsZod.providerStatusUpdatedSchema); // Update local settings and data + } = (0, _index.validate)(data, _validatorsZod.providerStatusUpdatedSchema); + // Update local settings and data this.settings.setAvailableInputTypes(availableInputTypes); - this.storeLocalCredentials(credentials); // rerender the tooltip - - (_this$uiController5 = this.uiController) === null || _this$uiController5 === void 0 ? void 0 : _this$uiController5.updateItems(credentials); // If the tooltip is open on an autofill type that's not available, close it + this.storeLocalCredentials(credentials); + // rerender the tooltip + this.uiController?.updateItems(credentials); + // If the tooltip is open on an autofill type that's not available, close it const currentInputSubtype = (0, _matching.getSubtypeFromType)(this.getCurrentInputType()); - - if (!((_availableInputTypes$ = availableInputTypes.credentials) !== null && _availableInputTypes$ !== void 0 && _availableInputTypes$[currentInputSubtype])) { + if (!availableInputTypes.credentials?.[currentInputSubtype]) { this.removeTooltip(); - } // Redecorate fields according to the new types - - + } + // Redecorate fields according to the new types this.scanner.forms.forEach(form => form.recategorizeAllInputs()); } catch (e) { if (this.globalConfig.isDDGTestMode) { @@ -5463,66 +4759,53 @@ class InterfacePrototype { } } } - /** @param {() => void} _fn */ - + /** @param {() => void} _fn */ addLogoutListener(_fn) {} - isDeviceSignedIn() { return false; } /** * @returns {Promise} */ - - async getAlias() { return undefined; - } // PM endpoints - - + } + // PM endpoints getAccounts() {} /** * Gets credentials ready for autofill * @param {CredentialsObject['id']} id - the credential id * @returns {Promise} */ - - async getAutofillCredentials(id) { return this.deviceApi.request(new _deviceApiCalls.GetAutofillCredentialsCall({ id: String(id) })); } /** @returns {APIResponse} */ - - async getAutofillCreditCard(_id) { throw new Error('getAutofillCreditCard unimplemented'); } /** @returns {Promise<{success: IdentityObject|undefined}>} */ - - async getAutofillIdentity(_id) { throw new Error('getAutofillIdentity unimplemented'); } - openManagePasswords() {} - openManageCreditCards() {} - openManageIdentities() {} + /** * @param {StoreFormData} values * @param {StoreFormData['trigger']} trigger */ - - storeFormData(values, trigger) { - this.deviceApi.notify(new _deviceApiCalls.StoreFormDataCall({ ...values, + this.deviceApi.notify(new _deviceApiCalls.StoreFormDataCall({ + ...values, trigger })); } + /** * `preAttachTooltip` happens just before a tooltip is show - features may want to append some data * at this point. @@ -5534,27 +4817,25 @@ class InterfacePrototype { * @param {HTMLInputElement} input * @param {import("../Form/Form").Form} form */ - - preAttachTooltip(topContextData, input, form) { // A list of checks to determine if we need to generate a password - const checks = [topContextData.inputType === 'credentials.password', this.settings.featureToggles.password_generation, form.isSignup]; // if all checks pass, generate and save a password + const checks = [topContextData.inputType === 'credentials.password', this.settings.featureToggles.password_generation, form.isSignup]; + // if all checks pass, generate and save a password if (checks.every(Boolean)) { - var _rawValues$credential, _rawValues$identities; - const password = this.passwordGenerator.generate({ input: input.getAttribute('passwordrules'), domain: window.location.hostname }); const rawValues = form.getRawValues(); - const username = ((_rawValues$credential = rawValues.credentials) === null || _rawValues$credential === void 0 ? void 0 : _rawValues$credential.username) || ((_rawValues$identities = rawValues.identities) === null || _rawValues$identities === void 0 ? void 0 : _rawValues$identities.emailAddress) || ''; // append the new credential to the topContextData so that the top autofill can display it + const username = rawValues.credentials?.username || rawValues.identities?.emailAddress || ''; + // append the new credential to the topContextData so that the top autofill can display it topContextData.credentials = [(0, _Credentials.fromPassword)(password, username)]; } - return topContextData; } + /** * `postAutofill` gives features an opportunity to perform an action directly * following an autofill. @@ -5565,17 +4846,13 @@ class InterfacePrototype { * @param {SupportedMainTypes} dataType * @param {import("../Form/Form").Form} formObj */ - - postAutofill(data, dataType, formObj) { // If there's an autogenerated password, prompt to save - if (_Credentials.AUTOGENERATED_KEY in data && 'password' in data && // Don't send message on Android to avoid potential abuse. Data is saved on native confirmation instead. + if (_Credentials.AUTOGENERATED_KEY in data && 'password' in data && + // Don't send message on Android to avoid potential abuse. Data is saved on native confirmation instead. !this.globalConfig.isAndroid) { - var _formValues$credentia; - const formValues = formObj.getValuesReadyForStorage(); - - if (((_formValues$credentia = formValues.credentials) === null || _formValues$credentia === void 0 ? void 0 : _formValues$credentia.password) === data.password) { + if (formValues.credentials?.password === data.password) { /** @type {StoreFormData} */ const formData = (0, _Credentials.appendGeneratedKey)(formValues, { password: data.password @@ -5583,11 +4860,11 @@ class InterfacePrototype { this.storeFormData(formData, 'passwordGeneration'); } } - if (dataType === 'credentials' && formObj.shouldAutoSubmit) { formObj.attemptSubmissionIfNeeded(); } } + /** * `postSubmit` gives features a one-time-only opportunity to perform an * action directly after a form submission was observed. @@ -5599,13 +4876,10 @@ class InterfacePrototype { * @param {DataStorageObject} values * @param {import("../Form/Form").Form} form */ - - postSubmit(values, form) { if (!form.form) return; if (!form.hasValues(values)) return; const checks = [form.shouldPromptToStoreData, this.passwordGenerator.generated]; - if (checks.some(Boolean)) { const formData = (0, _Credentials.appendGeneratedKey)(values, { password: this.passwordGenerator.password, @@ -5614,36 +4888,29 @@ class InterfacePrototype { this.storeFormData(formData, 'formSubmission'); } } + /** * Sends a pixel to be fired on the client side * @param {import('../deviceApiCalls/__generated__/validators-ts').SendJSPixelParams} pixelParams */ - - firePixel(pixelParams) { this.deviceApi.notify(new _deviceApiCalls.SendJSPixelCall(pixelParams)); } + /** * This serves as a single place to create a default instance * of InterfacePrototype that can be useful in testing scenarios * @returns {InterfacePrototype} */ - - static default() { const globalConfig = (0, _config.createGlobalConfig)(); const transport = (0, _transports.createTransport)(globalConfig); const deviceApi = new _index.DeviceApi(transport); - const settings = _Settings.Settings.default(globalConfig, deviceApi); - return new InterfacePrototype(globalConfig, deviceApi, settings); } - } - -var _default = InterfacePrototype; -exports.default = _default; +var _default = exports.default = InterfacePrototype; },{"../../packages/device-api/index.js":2,"../EmailProtection.js":22,"../Form/formatters.js":26,"../Form/matching.js":33,"../InputTypes/Credentials.js":35,"../PasswordGenerator.js":38,"../Scanner.js":39,"../Settings.js":40,"../UI/controllers/NativeUIController.js":46,"../autofill-utils.js":51,"../config.js":53,"../deviceApiCalls/__generated__/deviceApiCalls.js":55,"../deviceApiCalls/__generated__/validators.zod.js":56,"../deviceApiCalls/transports/transports.js":61,"./initFormSubmissionsApi.js":20}],18:[function(require,module,exports){ "use strict"; @@ -5652,31 +4919,19 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.WindowsInterface = void 0; - var _InterfacePrototype = _interopRequireDefault(require("./InterfacePrototype.js")); - var _OverlayUIController = require("../UI/controllers/OverlayUIController.js"); - var _deviceApiCalls = require("../deviceApiCalls/__generated__/deviceApiCalls.js"); - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - /** * @typedef {import('../deviceApiCalls/__generated__/validators-ts').GetAutofillDataRequest} GetAutofillDataRequest */ -const EMAIL_PROTECTION_LOGOUT_MESSAGE = 'EMAIL_PROTECTION_LOGOUT'; +const EMAIL_PROTECTION_LOGOUT_MESSAGE = 'EMAIL_PROTECTION_LOGOUT'; class WindowsInterface extends _InterfacePrototype.default { - constructor() { - super(...arguments); - - _defineProperty(this, "ready", false); - - _defineProperty(this, "_abortController", null); - } - + ready = false; + /** @type {AbortController|null} */ + _abortController = null; /** * @deprecated This runs too early, and will be removed eventually. * @returns {Promise} @@ -5684,24 +4939,19 @@ class WindowsInterface extends _InterfacePrototype.default { async isEnabled() { return true; } - async setupAutofill() { const loggedIn = await this._getIsLoggedIn(); - if (loggedIn) { await this.getAddresses(); } } - isEnabledViaSettings() { return Boolean(this.settings.enabled); } - postInit() { super.postInit(); this.ready = true; } - createUIController() { /** * If we get here, we're just a controller for an overlay @@ -5711,20 +4961,18 @@ class WindowsInterface extends _InterfacePrototype.default { show: async details => this._show(details) }); } + /** * @param {GetAutofillDataRequest} details */ - - async _show(details) { const { mainType - } = details; // prevent overlapping listeners - + } = details; + // prevent overlapping listeners if (this._abortController && !this._abortController.signal.aborted) { this._abortController.abort(); } - this._abortController = new AbortController(); this.deviceApi.request(new _deviceApiCalls.GetAutofillDataCall(details), { signal: this._abortController.signal @@ -5732,35 +4980,26 @@ class WindowsInterface extends _InterfacePrototype.default { if (!this.activeForm) { throw new Error('this.currentAttached was absent'); } - switch (resp.action) { case 'fill': { if (mainType in resp) { - var _this$activeForm; - - (_this$activeForm = this.activeForm) === null || _this$activeForm === void 0 ? void 0 : _this$activeForm.autofillData(resp[mainType], mainType); + this.activeForm?.autofillData(resp[mainType], mainType); } else { - throw new Error("action: \"fill\" cannot occur because \"".concat(mainType, "\" was missing")); + throw new Error(`action: "fill" cannot occur because "${mainType}" was missing`); } - break; } - case 'focus': { - var _this$activeForm2, _this$activeForm2$act; - - (_this$activeForm2 = this.activeForm) === null || _this$activeForm2 === void 0 ? void 0 : (_this$activeForm2$act = _this$activeForm2.activeInput) === null || _this$activeForm2$act === void 0 ? void 0 : _this$activeForm2$act.focus(); + this.activeForm?.activeInput?.focus(); break; } - case 'none': { // do nothing break; } - default: { if (this.globalConfig.isDDGTestMode) { @@ -5768,7 +5007,6 @@ class WindowsInterface extends _InterfacePrototype.default { } } } - return this._closeAutofillParent(); }).catch(e => { if (this.globalConfig.isDDGTestMode) { @@ -5780,14 +5018,14 @@ class WindowsInterface extends _InterfacePrototype.default { } }); } + /** * @returns {Promise} */ - - async _closeAutofillParent() { return this.deviceApi.notify(new _deviceApiCalls.CloseAutofillParentCall(null)); } + /** * Email Protection calls */ @@ -5795,20 +5033,14 @@ class WindowsInterface extends _InterfacePrototype.default { /** * @returns {Promise} */ - - getEmailProtectionCapabilities() { return this.deviceApi.request(new _deviceApiCalls.EmailProtectionGetCapabilitiesCall({})); } - async _getIsLoggedIn() { const isLoggedIn = await this.deviceApi.request(new _deviceApiCalls.EmailProtectionGetIsLoggedInCall({})); - this.isDeviceSignedIn = () => isLoggedIn; - return isLoggedIn; } - addLogoutListener(handler) { // Only deal with logging out if we're in the email web app if (!this.globalConfig.isDDGDomain) return; @@ -5818,11 +5050,10 @@ class WindowsInterface extends _InterfacePrototype.default { } }); } + /** * @returns {Promise} */ - - storeUserData(_ref) { let { addUserData @@ -5832,33 +5063,25 @@ class WindowsInterface extends _InterfacePrototype.default { /** * @returns {Promise} */ - - removeUserData() { return this.deviceApi.request(new _deviceApiCalls.EmailProtectionRemoveUserDataCall({})); } /** * @returns {Promise} */ - - getUserData() { return this.deviceApi.request(new _deviceApiCalls.EmailProtectionGetUserDataCall({})); } - async refreshAlias() { const addresses = await this.deviceApi.request(new _deviceApiCalls.EmailProtectionRefreshPrivateAddressCall({})); this.storeLocalAddresses(addresses); } - async getAddresses() { const addresses = await this.deviceApi.request(new _deviceApiCalls.EmailProtectionGetAddressesCall({})); this.storeLocalAddresses(addresses); return addresses; } - } - exports.WindowsInterface = WindowsInterface; },{"../UI/controllers/OverlayUIController.js":47,"../deviceApiCalls/__generated__/deviceApiCalls.js":55,"./InterfacePrototype.js":17}],19:[function(require,module,exports){ @@ -5868,19 +5091,11 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.WindowsOverlayDeviceInterface = void 0; - var _InterfacePrototype = _interopRequireDefault(require("./InterfacePrototype.js")); - var _HTMLTooltipUIController = require("../UI/controllers/HTMLTooltipUIController.js"); - var _deviceApiCalls = require("../deviceApiCalls/__generated__/deviceApiCalls.js"); - var _overlayApi = require("./overlayApi.js"); - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - /** * This subclass is designed to separate code that *only* runs inside the * Windows Overlay into a single place. @@ -5889,17 +5104,18 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope * this is another DeviceInterface */ class WindowsOverlayDeviceInterface extends _InterfacePrototype.default { - constructor() { - super(...arguments); - - _defineProperty(this, "stripCredentials", false); - - _defineProperty(this, "overlay", (0, _overlayApi.overlayApi)(this)); - - _defineProperty(this, "previousScreenX", 0); + /** + * Mark top frame as not stripping credential data + * @type {boolean} + */ + stripCredentials = false; - _defineProperty(this, "previousScreenY", 0); - } + /** + * overlay API helpers + */ + overlay = (0, _overlayApi.overlayApi)(this); + previousScreenX = 0; + previousScreenY = 0; /** * Because we're running inside the Overlay, we always create the HTML @@ -5910,9 +5126,7 @@ class WindowsOverlayDeviceInterface extends _InterfacePrototype.default { */ createUIController() { return new _HTMLTooltipUIController.HTMLTooltipUIController({ - tooltipKind: - /** @type {const} */ - 'modern', + tooltipKind: /** @type {const} */'modern', device: this }, { wrapperClass: 'top-autofill', @@ -5920,14 +5134,12 @@ class WindowsOverlayDeviceInterface extends _InterfacePrototype.default { setSize: details => this.deviceApi.notify(new _deviceApiCalls.SetSizeCall(details)), remove: async () => this._closeAutofillParent(), testMode: this.isTestMode(), - /** * Note: This is needed because Mutation observer didn't support visibility checks on Windows */ checkVisibility: false }); } - addDeviceListeners() { /** * On Windows (vs. MacOS) we can use the built-in `mousemove` @@ -5937,58 +5149,51 @@ class WindowsOverlayDeviceInterface extends _InterfacePrototype.default { * page load every time it's opened. */ window.addEventListener('mousemove', event => { - var _this$uiController, _this$uiController$ge; - // Don't set focus if the mouse hasn't moved ever // This is to avoid clickjacking where an attacker puts the pulldown under the cursor // and tricks the user into clicking - if (!this.previousScreenX && !this.previousScreenY || // if no previous coords + if (!this.previousScreenX && !this.previousScreenY || + // if no previous coords this.previousScreenX === event.screenX && this.previousScreenY === event.screenY // or the mouse hasn't moved ) { this.previousScreenX = event.screenX; this.previousScreenY = event.screenY; return; } - - const activeTooltip = (_this$uiController = this.uiController) === null || _this$uiController === void 0 ? void 0 : (_this$uiController$ge = _this$uiController.getActiveTooltip) === null || _this$uiController$ge === void 0 ? void 0 : _this$uiController$ge.call(_this$uiController); - activeTooltip === null || activeTooltip === void 0 ? void 0 : activeTooltip.focus(event.x, event.y); + const activeTooltip = this.uiController?.getActiveTooltip?.(); + activeTooltip?.focus(event.x, event.y); this.previousScreenX = event.screenX; this.previousScreenY = event.screenY; }); return super.addDeviceListeners(); } + /** * @returns {Promise} */ - - async _closeAutofillParent() { return this.deviceApi.notify(new _deviceApiCalls.CloseAutofillParentCall(null)); } + /** * @returns {Promise} */ - - openManagePasswords() { return this.deviceApi.notify(new _deviceApiCalls.OpenManagePasswordsCall({})); } /** * @returns {Promise} */ - - openManageCreditCards() { return this.deviceApi.notify(new _deviceApiCalls.OpenManageCreditCardsCall({})); } /** * @returns {Promise} */ - - openManageIdentities() { return this.deviceApi.notify(new _deviceApiCalls.OpenManageIdentitiesCall({})); } + /** * Since we're running inside the Overlay we can limit what happens here to * be only things that are needed to power the HTML Tooltip @@ -5996,25 +5201,21 @@ class WindowsOverlayDeviceInterface extends _InterfacePrototype.default { * @override * @returns {Promise} */ - - async setupAutofill() { const loggedIn = await this._getIsLoggedIn(); - if (loggedIn) { await this.getAddresses(); } - - const response = await this.deviceApi.request(new _deviceApiCalls.GetAutofillInitDataCall(null)); // @ts-ignore - + const response = await this.deviceApi.request(new _deviceApiCalls.GetAutofillInitDataCall(null)); + // @ts-ignore this.storeLocalData(response); } - async postInit() { // setup overlay API pieces this.overlay.showImmediately(); super.postInit(); } + /** * In the top-frame scenario, we send a message to the native * side to indicate a selection. Once received, the native side will store that selection so that a @@ -6024,50 +5225,42 @@ class WindowsOverlayDeviceInterface extends _InterfacePrototype.default { * @param {IdentityObject|CreditCardObject|CredentialsObject|{email:string, id: string}} data * @param {string} type */ - - async selectedDetail(data, type) { return this.overlay.selectedDetail(data, type); } + /** * Email Protection calls */ - async _getIsLoggedIn() { const isLoggedIn = await this.deviceApi.request(new _deviceApiCalls.EmailProtectionGetIsLoggedInCall({})); - this.isDeviceSignedIn = () => isLoggedIn; - return isLoggedIn; } - async getAddresses() { const addresses = await this.deviceApi.request(new _deviceApiCalls.EmailProtectionGetAddressesCall({})); this.storeLocalAddresses(addresses); return addresses; } + /** * Gets a single identity obj once the user requests it * @param {Number} id * @returns {Promise<{success: IdentityObject|undefined}>} */ - - getAutofillIdentity(id) { const identity = this.getLocalIdentities().find(_ref => { let { id: identityId } = _ref; - return "".concat(identityId) === "".concat(id); + return `${identityId}` === `${id}`; }); return Promise.resolve({ success: identity }); } - } - exports.WindowsOverlayDeviceInterface = WindowsOverlayDeviceInterface; },{"../UI/controllers/HTMLTooltipUIController.js":45,"../deviceApiCalls/__generated__/deviceApiCalls.js":55,"./InterfacePrototype.js":17,"./overlayApi.js":21}],20:[function(require,module,exports){ @@ -6077,11 +5270,8 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.initFormSubmissionsApi = initFormSubmissionsApi; - var _autofillUtils = require("../autofill-utils.js"); - var _labelUtil = require("../Form/label-util.js"); - /** * This is a single place to contain all functionality relating to form submission detection * @@ -6093,83 +5283,72 @@ function initFormSubmissionsApi(forms, matching) { * Global submit events */ window.addEventListener('submit', e => { - var _forms$get; - // @ts-ignore - return (_forms$get = forms.get(e.target)) === null || _forms$get === void 0 ? void 0 : _forms$get.submitHandler('global submit event'); + return forms.get(e.target)?.submitHandler('global submit event'); }, true); + /** * Global keydown events */ - window.addEventListener('keydown', e => { if (e.key === 'Enter') { const focusedForm = [...forms.values()].find(form => form.hasFocus(e)); - focusedForm === null || focusedForm === void 0 ? void 0 : focusedForm.submitHandler('global keydown + Enter'); + focusedForm?.submitHandler('global keydown + Enter'); } }); + /** * Global pointer down events * @param {PointerEvent} event */ - window.addEventListener('pointerdown', event => { const matchingForm = [...forms.values()].find(form => { - const btns = [...form.submitButtons]; // @ts-ignore - - if (btns.includes(event.target)) return true; // @ts-ignore + const btns = [...form.submitButtons]; + // @ts-ignore + if (btns.includes(event.target)) return true; + // @ts-ignore if (btns.find(btn => btn.contains(event.target))) return true; }); - matchingForm === null || matchingForm === void 0 ? void 0 : matchingForm.submitHandler('global pointerdown event + matching form'); - + matchingForm?.submitHandler('global pointerdown event + matching form'); if (!matchingForm) { - var _event$target, _matching$getDDGMatch, _event$target2; - - const selector = matching.cssSelector('submitButtonSelector') + ', a[href="#"], a[href^=javascript], *[onclick], [class*=button i]'; // check if the click happened on a button - - const button = - /** @type HTMLElement */ - (_event$target = event.target) === null || _event$target === void 0 ? void 0 : _event$target.closest(selector); + const selector = matching.cssSelector('submitButtonSelector') + ', a[href="#"], a[href^=javascript], *[onclick], [class*=button i]'; + // check if the click happened on a button + const button = /** @type HTMLElement */event.target?.closest(selector); if (!button) return; const text = (0, _autofillUtils.getTextShallow)(button) || (0, _labelUtil.extractElementStrings)(button).join(' '); - const hasRelevantText = (_matching$getDDGMatch = matching.getDDGMatcherRegex('submitButtonRegex')) === null || _matching$getDDGMatch === void 0 ? void 0 : _matching$getDDGMatch.test(text); - + const hasRelevantText = matching.getDDGMatcherRegex('submitButtonRegex')?.test(text); if (hasRelevantText && text.length < 25) { // check if there's a form with values const filledForm = [...forms.values()].find(form => form.hasValues()); - - if (filledForm && (0, _autofillUtils.buttonMatchesFormType)( - /** @type HTMLElement */ - button, filledForm)) { - filledForm === null || filledForm === void 0 ? void 0 : filledForm.submitHandler('global pointerdown event + filled form'); + if (filledForm && (0, _autofillUtils.buttonMatchesFormType)( /** @type HTMLElement */button, filledForm)) { + filledForm?.submitHandler('global pointerdown event + filled form'); } - } // TODO: Temporary hack to support Google signin in different languages - // https://app.asana.com/0/1198964220583541/1201650539303898/f - + } - if ( - /** @type HTMLElement */ - (_event$target2 = event.target) !== null && _event$target2 !== void 0 && _event$target2.closest('#passwordNext button, #identifierNext button')) { + // TODO: Temporary hack to support Google signin in different languages + // https://app.asana.com/0/1198964220583541/1201650539303898/f + if ( /** @type HTMLElement */event.target?.closest('#passwordNext button, #identifierNext button')) { // check if there's a form with values const filledForm = [...forms.values()].find(form => form.hasValues()); - filledForm === null || filledForm === void 0 ? void 0 : filledForm.submitHandler('global pointerdown event + google escape hatch'); + filledForm?.submitHandler('global pointerdown event + google escape hatch'); } } }, true); + /** * @type {PerformanceObserver} */ - const observer = new PerformanceObserver(list => { - const entries = list.getEntries().filter(entry => // @ts-ignore why does TS not know about `entry.initiatorType`? + const entries = list.getEntries().filter(entry => + // @ts-ignore why does TS not know about `entry.initiatorType`? ['fetch', 'xmlhttprequest'].includes(entry.initiatorType) && /login|sign-in|signin/.test(entry.name)); if (!entries.length) return; const filledForm = [...forms.values()].find(form => form.hasValues()); - const focusedForm = [...forms.values()].find(form => form.hasFocus()); // If a form is still focused the user is still typing: do nothing - + const focusedForm = [...forms.values()].find(form => form.hasFocus()); + // If a form is still focused the user is still typing: do nothing if (focusedForm) return; - filledForm === null || filledForm === void 0 ? void 0 : filledForm.submitHandler('performance observer'); + filledForm?.submitHandler('performance observer'); }); observer.observe({ entryTypes: ['resource'] @@ -6183,9 +5362,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.overlayApi = overlayApi; - var _deviceApiCalls = require("../deviceApiCalls/__generated__/deviceApiCalls.js"); - /** * These are some re-usable parts for handling 'overlays' (like on macOS + Windows) * @@ -6197,11 +5374,10 @@ function overlayApi(device) { * When we are inside an 'overlay' - the HTML tooltip will be opened immediately */ showImmediately() { - var _device$uiController, _device$uiController$; - const topContextData = device.getTopContextData(); - if (!topContextData) throw new Error('unreachable, topContextData should be available'); // Provide dummy values + if (!topContextData) throw new Error('unreachable, topContextData should be available'); + // Provide dummy values const getPosition = () => { return { x: 0, @@ -6209,18 +5385,14 @@ function overlayApi(device) { height: 50, width: 50 }; - }; // Create the tooltip, and set it as active - - - const tooltip = (_device$uiController = device.uiController) === null || _device$uiController === void 0 ? void 0 : (_device$uiController$ = _device$uiController.createTooltip) === null || _device$uiController$ === void 0 ? void 0 : _device$uiController$.call(_device$uiController, getPosition, topContextData); + }; + // Create the tooltip, and set it as active + const tooltip = device.uiController?.createTooltip?.(getPosition, topContextData); if (tooltip) { - var _device$uiController2, _device$uiController3; - - (_device$uiController2 = device.uiController) === null || _device$uiController2 === void 0 ? void 0 : (_device$uiController3 = _device$uiController2.setActiveTooltip) === null || _device$uiController3 === void 0 ? void 0 : _device$uiController3.call(_device$uiController2, tooltip); + device.uiController?.setActiveTooltip?.(tooltip); } }, - /** * @param {IdentityObject|CreditCardObject|CredentialsObject|{email:string, id: string}} data * @param {string} type @@ -6233,13 +5405,11 @@ function overlayApi(device) { }); const entries = Object.fromEntries(detailsEntries); /** @link {import("../deviceApiCalls/schemas/getAutofillData.result.json")} */ - await device.deviceApi.notify(new _deviceApiCalls.SelectedDetailCall({ data: entries, configType: type })); } - }; } @@ -6250,58 +5420,32 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.EmailProtection = void 0; - -function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); } - -function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } } - -function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; } - -function _classApplyDescriptorSet(receiver, descriptor, value) { if (descriptor.set) { descriptor.set.call(receiver, value); } else { if (!descriptor.writable) { throw new TypeError("attempted to set read only private field"); } descriptor.value = value; } } - -function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); } - -function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); } - -function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; } - -var _previous = /*#__PURE__*/new WeakMap(); - /** * Use this as place to store any state or functionality related to Email Protection */ class EmailProtection { /** @type {string|null} */ + #previous = null; /** @param {import("./DeviceInterface/InterfacePrototype").default} device */ constructor(device) { - _classPrivateFieldInitSpec(this, _previous, { - writable: true, - value: null - }); - this.device = device; } - /** @returns {string|null} */ - + /** @returns {string|null} */ get lastGenerated() { - return _classPrivateFieldGet(this, _previous); + return this.#previous; } + /** * Store the last received email address * @param {string} emailAddress */ - - storeReceived(emailAddress) { - _classPrivateFieldSet(this, _previous, emailAddress); - + this.#previous = emailAddress; return emailAddress; } - } - exports.EmailProtection = EmailProtection; },{}],23:[function(require,module,exports){ @@ -6311,39 +5455,27 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.Form = void 0; - var _FormAnalyzer = _interopRequireDefault(require("./FormAnalyzer.js")); - var _autofillUtils = require("../autofill-utils.js"); - var _matching = require("./matching.js"); - var _inputStyles = require("./inputStyles.js"); - var _inputTypeConfig = require("./inputTypeConfig.js"); - var _formatters = require("./formatters.js"); - var _constants = require("../constants.js"); - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - const { ATTR_AUTOFILL, ATTR_INPUT_TYPE, MAX_FORM_MUT_OBS_COUNT, MAX_INPUTS_PER_FORM } = _constants.constants; - class Form { /** @type {import("../Form/matching").Matching} */ - + matching; /** @type {HTMLElement} */ - + form; /** @type {HTMLInputElement | null} */ - + activeInput; /** * @param {HTMLElement} form * @param {HTMLInputElement|HTMLSelectElement} input @@ -6353,19 +5485,12 @@ class Form { */ constructor(form, input, deviceInterface, matching) { let shouldAutoprompt = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false; - - _defineProperty(this, "matching", void 0); - - _defineProperty(this, "form", void 0); - - _defineProperty(this, "activeInput", void 0); - this.form = form; this.matching = matching || (0, _matching.createMatching)(); this.formAnalyzer = new _FormAnalyzer.default(form, input, matching); this.device = deviceInterface; - /** @type Record<'all' | SupportedMainTypes, Set> */ + /** @type Record<'all' | SupportedMainTypes, Set> */ this.inputs = { all: new Set(), credentials: new Set(), @@ -6375,16 +5500,16 @@ class Form { }; this.touched = new Set(); this.listeners = new Set(); - this.activeInput = null; // We set this to true to skip event listeners while we're autofilling - + this.activeInput = null; + // We set this to true to skip event listeners while we're autofilling this.isAutofilling = false; this.handlerExecuted = false; this.shouldPromptToStoreData = true; this.shouldAutoSubmit = this.device.globalConfig.isMobileApp; + /** * @type {IntersectionObserver | null} */ - this.intObs = new IntersectionObserver(entries => { for (const entry of entries) { if (!entry.isIntersecting) this.removeTooltip(); @@ -6397,7 +5522,6 @@ class Form { }; this.mutObs = new MutationObserver(records => { const anythingRemoved = records.some(record => record.removedNodes.length > 0); - if (anythingRemoved) { // Must check for inputs because a parent may be removed and not show up in record.removedNodes if ([...this.inputs.all].some(input => !input.isConnected)) { @@ -6406,15 +5530,16 @@ class Form { this.formAnalyzer = new _FormAnalyzer.default(this.form, input, this.matching); this.recategorizeAllInputs(); }); - this.mutObsCount++; // If the form mutates too much, disconnect to avoid performance issues - + this.mutObsCount++; + // If the form mutates too much, disconnect to avoid performance issues if (this.mutObsCount >= MAX_FORM_MUT_OBS_COUNT) { this.mutObs.disconnect(); } } } - }); // This ensures we fire the handler again if the form is changed + }); + // This ensures we fire the handler again if the form is changed this.addListener(form, 'input', () => { if (!this.isAutofilling) { this.handlerExecuted = false; @@ -6424,160 +5549,129 @@ class Form { this.categorizeInputs(); this.mutObs.observe(this.form, this.mutObsConfig); this.logFormInfo(); - if (shouldAutoprompt) { this.promptLoginIfNeeded(); } } - get isLogin() { return this.formAnalyzer.isLogin; } - get isSignup() { return this.formAnalyzer.isSignup; } - get isHybrid() { return this.formAnalyzer.isHybrid; } - get isCCForm() { return this.formAnalyzer.isCCForm(); } - logFormInfo() { if (!(0, _autofillUtils.shouldLog)()) return; - console.log("Form type: %c".concat(this.getFormType()), 'font-weight: bold'); + console.log(`Form type: %c${this.getFormType()}`, 'font-weight: bold'); console.log('Signals: ', this.formAnalyzer.signals); console.log('Wrapping element: ', this.form); console.log('Inputs: ', this.inputs); console.log('Submit Buttons: ', this.submitButtons); } - getFormType() { - if (this.isHybrid) return "hybrid (hybrid score: ".concat(this.formAnalyzer.hybridSignal, ", score: ").concat(this.formAnalyzer.autofillSignal, ")"); - if (this.isLogin) return "login (score: ".concat(this.formAnalyzer.autofillSignal, ", hybrid score: ").concat(this.formAnalyzer.hybridSignal, ")"); - if (this.isSignup) return "signup (score: ".concat(this.formAnalyzer.autofillSignal, ", hybrid score: ").concat(this.formAnalyzer.hybridSignal, ")"); + if (this.isHybrid) return `hybrid (hybrid score: ${this.formAnalyzer.hybridSignal}, score: ${this.formAnalyzer.autofillSignal})`; + if (this.isLogin) return `login (score: ${this.formAnalyzer.autofillSignal}, hybrid score: ${this.formAnalyzer.hybridSignal})`; + if (this.isSignup) return `signup (score: ${this.formAnalyzer.autofillSignal}, hybrid score: ${this.formAnalyzer.hybridSignal})`; return 'something went wrong'; } + /** * Checks if the form element contains the activeElement or the event target * @return {boolean} * @param {KeyboardEvent | null} [e] */ - - hasFocus(e) { - return this.form.contains(document.activeElement) || this.form.contains( - /** @type HTMLElement */ - e === null || e === void 0 ? void 0 : e.target); + return this.form.contains(document.activeElement) || this.form.contains( /** @type HTMLElement */e?.target); } - submitHandler() { - var _this$device$postSubm, _this$device; - let via = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'unknown'; - if (this.device.globalConfig.isDDGTestMode) { console.log('Form.submitHandler via:', via, this); } - if (this.handlerExecuted) return; const values = this.getValuesReadyForStorage(); - (_this$device$postSubm = (_this$device = this.device).postSubmit) === null || _this$device$postSubm === void 0 ? void 0 : _this$device$postSubm.call(_this$device, values, this); // mark this form as being handled + this.device.postSubmit?.(values, this); + // mark this form as being handled this.handlerExecuted = true; } + /** * Reads the values from the form without preparing to store them * @return {InternalDataStorageObject} */ - - getRawValues() { const formValues = [...this.inputs.credentials, ...this.inputs.identities, ...this.inputs.creditCards].reduce((output, inputEl) => { - var _output$mainType, _value; - const mainType = (0, _matching.getInputMainType)(inputEl); const subtype = (0, _matching.getInputSubtype)(inputEl); - let value = inputEl.value || ((_output$mainType = output[mainType]) === null || _output$mainType === void 0 ? void 0 : _output$mainType[subtype]); - + let value = inputEl.value || output[mainType]?.[subtype]; if (subtype === 'addressCountryCode') { value = (0, _formatters.inferCountryCodeFromElement)(inputEl); - } // Discard passwords that are shorter than 4 characters - - - if (subtype === 'password' && ((_value = value) === null || _value === void 0 ? void 0 : _value.length) <= 3) { + } + // Discard passwords that are shorter than 4 characters + if (subtype === 'password' && value?.length <= 3) { value = undefined; } - if (value) { output[mainType][subtype] = value; } - return output; }, { credentials: {}, creditCards: {}, identities: {} }); - if (formValues.credentials.password && !formValues.credentials.username && !formValues.identities.emailAddress) { // If we have a password but no username, let's search further - const hiddenFields = - /** @type [HTMLInputElement] */ - [...this.form.querySelectorAll('input[type=hidden]')]; + const hiddenFields = /** @type [HTMLInputElement] */[...this.form.querySelectorAll('input[type=hidden]')]; const probableField = hiddenFields.find(field => { - var _this$matching$getDDG; - - const regex = new RegExp('email|' + ((_this$matching$getDDG = this.matching.getDDGMatcherRegex('username')) === null || _this$matching$getDDG === void 0 ? void 0 : _this$matching$getDDG.source)); + const regex = new RegExp('email|' + this.matching.getDDGMatcherRegex('username')?.source); const attributeText = field.id + ' ' + field.name; - return regex === null || regex === void 0 ? void 0 : regex.test(attributeText); + return regex?.test(attributeText); }); - - if (probableField !== null && probableField !== void 0 && probableField.value) { + if (probableField?.value) { formValues.credentials.username = probableField.value; - } else if ( // If a form has phone + password(s) fields, save the phone as username + } else if ( + // If a form has phone + password(s) fields, save the phone as username formValues.identities.phone && this.inputs.all.size - this.inputs.unknown.size < 4) { formValues.credentials.username = formValues.identities.phone; } else { // If we still don't have a username, try scanning the form's text for an email address this.form.querySelectorAll(this.matching.cssSelector('safeUniversalSelector')).forEach(el => { - var _elText$match; - - const elText = (0, _autofillUtils.getTextShallow)(el); // Ignore long texts to avoid false positives - + const elText = (0, _autofillUtils.getTextShallow)(el); + // Ignore long texts to avoid false positives if (elText.length > 70) return; - const emailOrUsername = (_elText$match = elText.match( // https://www.emailregex.com/ - /[a-zA-Z\d.!#$%&’*+/=?^_`{|}~-]+@[a-zA-Z\d-]+(?:\.[a-zA-Z\d-]+)*/)) === null || _elText$match === void 0 ? void 0 : _elText$match[0]; - + const emailOrUsername = elText.match( + // https://www.emailregex.com/ + /[a-zA-Z\d.!#$%&’*+/=?^_`{|}~-]+@[a-zA-Z\d-]+(?:\.[a-zA-Z\d-]+)*/)?.[0]; if (emailOrUsername) { formValues.credentials.username = emailOrUsername; } }); } } - return formValues; } + /** * Return form values ready for storage * @returns {DataStorageObject} */ - - getValuesReadyForStorage() { const formValues = this.getRawValues(); return (0, _formatters.prepareFormValuesForStorage)(formValues); } + /** * Determine if the form has values we want to store in the device * @param {DataStorageObject} [values] * @return {boolean} */ - - hasValues(values) { const { credentials, @@ -6586,26 +5680,17 @@ class Form { } = values || this.getValuesReadyForStorage(); return Boolean(credentials || creditCards || identities); } - async removeTooltip() { - var _this$intObs; - const tooltip = this.device.isTooltipActive(); - if (this.isAutofilling || !tooltip) { return; } - await this.device.removeTooltip(); - (_this$intObs = this.intObs) === null || _this$intObs === void 0 ? void 0 : _this$intObs.disconnect(); + this.intObs?.disconnect(); } - showingTooltip(input) { - var _this$intObs2; - - (_this$intObs2 = this.intObs) === null || _this$intObs2 === void 0 ? void 0 : _this$intObs2.observe(input); + this.intObs?.observe(input); } - removeInputHighlight(input) { if (!input.classList.contains('ddg-autofilled')) return; (0, _autofillUtils.removeInlineStyles)(input, (0, _inputStyles.getIconStylesAutofilled)(input, this)); @@ -6615,31 +5700,27 @@ class Form { input.classList.remove('ddg-autofilled'); this.addAutofillStyles(input); } - resetIconStylesToInitial() { const input = this.activeInput; - if (input) { const initialStyles = (0, _inputStyles.getIconStylesBase)(input, this); (0, _autofillUtils.addInlineStyles)(input, initialStyles); } } - removeAllHighlights(e, dataType) { // This ensures we are not removing the highlight ourselves when autofilling more than once - if (e && !e.isTrusted) return; // If the user has changed the value, we prompt to update the stored data + if (e && !e.isTrusted) return; + // If the user has changed the value, we prompt to update the stored data this.shouldPromptToStoreData = true; this.execOnInputs(input => this.removeInputHighlight(input), dataType); } - removeInputDecoration(input) { (0, _autofillUtils.removeInlineStyles)(input, (0, _inputStyles.getIconStylesBase)(input, this)); (0, _autofillUtils.removeInlineStyles)(input, (0, _inputStyles.getIconStylesAlternate)(input, this)); input.removeAttribute(ATTR_AUTOFILL); input.removeAttribute(ATTR_INPUT_TYPE); } - removeAllDecorations() { this.execOnInputs(input => this.removeInputDecoration(input)); this.listeners.forEach(_ref => { @@ -6652,7 +5733,6 @@ class Form { return el.removeEventListener(type, fn, opts); }); } - redecorateAllInputs() { this.removeAllDecorations(); this.execOnInputs(input => { @@ -6661,11 +5741,10 @@ class Form { } }); } + /** * Removes all scoring attributes from the inputs and deletes them from memory */ - - forgetAllInputs() { this.execOnInputs(input => { input.removeAttribute(ATTR_AUTOFILL); @@ -6673,18 +5752,16 @@ class Form { }); Object.values(this.inputs).forEach(inputSet => inputSet.clear()); } + /** * Resets our input scoring and starts from scratch */ - - recategorizeAllInputs() { this.initialScanComplete = false; this.removeAllDecorations(); this.forgetAllInputs(); this.categorizeInputs(); } - resetAllInputs() { this.execOnInputs(input => { (0, _autofillUtils.setValue)(input, '', this.device.globalConfig); @@ -6693,12 +5770,10 @@ class Form { if (this.activeInput) this.activeInput.focus(); this.matching.clear(); } - dismissTooltip() { this.removeTooltip(); - } // This removes all listeners to avoid memory leaks and weird behaviours - - + } + // This removes all listeners to avoid memory leaks and weird behaviours destroy() { this.removeAllDecorations(); this.removeTooltip(); @@ -6707,21 +5782,16 @@ class Form { this.matching.clear(); this.intObs = null; } - categorizeInputs() { const selector = this.matching.cssSelector('formInputsSelector'); - if (this.form.matches(selector)) { this.addInput(this.form); } else { - let foundInputs = this.form.querySelectorAll(selector); // If the markup is broken form.querySelectorAll may not return the fields, so we select from the parent - + let foundInputs = this.form.querySelectorAll(selector); + // If the markup is broken form.querySelectorAll may not return the fields, so we select from the parent if (foundInputs.length === 0 && this.form instanceof HTMLFormElement && this.form.length > 0) { - var _this$form$parentElem; - - foundInputs = ((_this$form$parentElem = this.form.parentElement) === null || _this$form$parentElem === void 0 ? void 0 : _this$form$parentElem.querySelectorAll(selector)) || foundInputs; + foundInputs = this.form.parentElement?.querySelectorAll(selector) || foundInputs; } - if (foundInputs.length < MAX_INPUTS_PER_FORM) { foundInputs.forEach(input => this.addInput(input)); } else { @@ -6730,89 +5800,81 @@ class Form { } } } - this.initialScanComplete = true; } - get submitButtons() { const selector = this.matching.cssSelector('submitButtonSelector'); - const allButtons = - /** @type {HTMLElement[]} */ - [...this.form.querySelectorAll(selector)]; + const allButtons = /** @type {HTMLElement[]} */[...this.form.querySelectorAll(selector)]; return allButtons.filter(btn => (0, _autofillUtils.isPotentiallyViewable)(btn) && (0, _autofillUtils.isLikelyASubmitButton)(btn, this.matching) && (0, _autofillUtils.buttonMatchesFormType)(btn, this)); } - attemptSubmissionIfNeeded() { - if (!this.isLogin || // Only submit login forms + if (!this.isLogin || + // Only submit login forms this.submitButtons.length > 1 // Do not submit if we're unsure about the submit button - ) return; // check for visible empty fields before attemtping submission - // this is to avoid loops where a captcha keeps failing for the user + ) return; + // check for visible empty fields before attemtping submission + // this is to avoid loops where a captcha keeps failing for the user let isThereAnEmptyVisibleField = false; this.execOnInputs(input => { if (input.value === '' && (0, _autofillUtils.isPotentiallyViewable)(input)) isThereAnEmptyVisibleField = true; }, 'all', false); - if (isThereAnEmptyVisibleField) return; // We're not using .submit() to minimise breakage with client-side forms + if (isThereAnEmptyVisibleField) return; + // We're not using .submit() to minimise breakage with client-side forms this.submitButtons.forEach(button => { if ((0, _autofillUtils.isPotentiallyViewable)(button)) { button.click(); } }); } + /** * Executes a function on input elements. Can be limited to certain element types * @param {(input: HTMLInputElement|HTMLSelectElement) => void} fn * @param {'all' | SupportedMainTypes} inputType * @param {boolean} shouldCheckForDecorate */ - - execOnInputs(fn) { let inputType = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'all'; let shouldCheckForDecorate = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true; const inputs = this.inputs[inputType]; - for (const input of inputs) { - let canExecute = true; // sometimes we want to execute even if we didn't decorate - + let canExecute = true; + // sometimes we want to execute even if we didn't decorate if (shouldCheckForDecorate) { canExecute = (0, _inputTypeConfig.isFieldDecorated)(input); } - if (canExecute) fn(input); } } - addInput(input) { - var _this$device$settings; - - if (this.inputs.all.has(input)) return this; // If the form has too many inputs, destroy everything to avoid performance issues + if (this.inputs.all.has(input)) return this; + // If the form has too many inputs, destroy everything to avoid performance issues if (this.inputs.all.size > MAX_INPUTS_PER_FORM) { if ((0, _autofillUtils.shouldLog)()) { console.log('The form has too many inputs, destroying.'); } - this.destroy(); return this; - } // When new inputs are added after the initial scan, reanalyze the whole form - + } + // When new inputs are added after the initial scan, reanalyze the whole form if (this.initialScanComplete) { this.formAnalyzer = new _FormAnalyzer.default(this.form, input, this.matching); this.recategorizeAllInputs(); return this; - } // Nothing to do with 1-character fields - + } + // Nothing to do with 1-character fields if (input.maxLength === 1) return this; this.inputs.all.add(input); const opts = { isLogin: this.isLogin, isHybrid: this.isHybrid, isCCForm: this.isCCForm, - hasCredentials: Boolean((_this$device$settings = this.device.settings.availableInputTypes.credentials) === null || _this$device$settings === void 0 ? void 0 : _this$device$settings.username), + hasCredentials: Boolean(this.device.settings.availableInputTypes.credentials?.username), supportsIdentitiesAutofill: this.device.settings.featureToggles.inputType_identities }; this.matching.setInputType(input, this.form, opts); @@ -6821,6 +5883,7 @@ class Form { this.decorateInput(input); return this; } + /** * Adds event listeners and keeps track of them for subsequent removal * @param {HTMLElement} el @@ -6828,8 +5891,6 @@ class Form { * @param {(Event) => void} fn * @param {AddEventListenerOptions} [opts] */ - - addListener(el, type, fn, opts) { el.addEventListener(type, fn, opts); this.listeners.add({ @@ -6839,7 +5900,6 @@ class Form { opts }); } - addAutofillStyles(input) { const initialStyles = (0, _inputStyles.getIconStylesBase)(input, this); const activeStyles = (0, _inputStyles.getIconStylesAlternate)(input, this); @@ -6849,20 +5909,18 @@ class Form { onMouseLeave: initialStyles }; } + /** * Decorate here means adding listeners and an optional icon * @param {HTMLInputElement} input * @returns {Promise} */ - - async decorateInput(input) { const config = (0, _inputTypeConfig.getInputConfig)(input); const shouldDecorate = await config.shouldDecorate(input, this); if (!shouldDecorate) return this; input.setAttribute(ATTR_AUTOFILL, 'true'); const hasIcon = !!config.getIconBase(input, this); - if (hasIcon) { const { onMouseMove, @@ -6870,7 +5928,6 @@ class Form { } = this.addAutofillStyles(input); this.addListener(input, 'mousemove', e => { if ((0, _autofillUtils.wasAutofilledByChrome)(input)) return; - if ((0, _autofillUtils.isEventWithinDax)(e, e.target)) { (0, _autofillUtils.addInlineStyles)(e.target, { 'cursor': 'pointer', @@ -6879,10 +5936,11 @@ class Form { } else { (0, _autofillUtils.removeInlineStyles)(e.target, { 'cursor': 'pointer' - }); // Only overwrite active icon styles if tooltip is closed - + }); + // Only overwrite active icon styles if tooltip is closed if (!this.device.isTooltipActive()) { - (0, _autofillUtils.addInlineStyles)(e.target, { ...onMouseLeave + (0, _autofillUtils.addInlineStyles)(e.target, { + ...onMouseLeave }); } } @@ -6890,20 +5948,20 @@ class Form { this.addListener(input, 'mouseleave', e => { (0, _autofillUtils.removeInlineStyles)(e.target, { 'cursor': 'pointer' - }); // Only overwrite active icon styles if tooltip is closed - + }); + // Only overwrite active icon styles if tooltip is closed if (!this.device.isTooltipActive()) { - (0, _autofillUtils.addInlineStyles)(e.target, { ...onMouseLeave + (0, _autofillUtils.addInlineStyles)(e.target, { + ...onMouseLeave }); } }); } + /** * @param {PointerEvent} e * @returns {{ x: number; y: number; } | undefined} */ - - function getMainClickCoords(e) { if (!e.isTrusted) return; const isMainMouseButton = e.button === 0; @@ -6913,86 +5971,74 @@ class Form { y: e.clientY }; } + /** * @param {Event} e * @param {WeakMap} storedClickCoords * @returns {{ x: number; y: number; } | null} */ - - function getClickCoords(e, storedClickCoords) { // Get click co-ordinates for pointer events // We need click coordinates to position the tooltip when the field is in an iframe if (e.type === 'pointerdown') { - return getMainClickCoords( - /** @type {PointerEvent} */ - e) || null; - } // Reuse a previous click co-ordinates if they exist for this element - + return getMainClickCoords( /** @type {PointerEvent} */e) || null; + } + // Reuse a previous click co-ordinates if they exist for this element const click = storedClickCoords.get(input); storedClickCoords.delete(input); return click || null; - } // Store the click to a label so we can use the click when the field is focused - // Needed to handle label clicks when the form is in an iframe - + } + // Store the click to a label so we can use the click when the field is focused + // Needed to handle label clicks when the form is in an iframe let storedClickCoords = new WeakMap(); let timeout = null; + /** * @param {PointerEvent} e */ - const handlerLabel = e => { - var _e$target, _e$target$closest; - // Look for e.target OR it's closest parent to be a HTMLLabelElement - const control = - /** @type HTMLElement */ - (_e$target = e.target) === null || _e$target === void 0 ? void 0 : (_e$target$closest = _e$target.closest('label')) === null || _e$target$closest === void 0 ? void 0 : _e$target$closest.control; + const control = /** @type HTMLElement */e.target?.closest('label')?.control; if (!control) return; - if (e.isTrusted) { storedClickCoords.set(control, getMainClickCoords(e)); } - - clearTimeout(timeout); // Remove the stored click if the timer expires - + clearTimeout(timeout); + // Remove the stored click if the timer expires timeout = setTimeout(() => { storedClickCoords = new WeakMap(); }, 1000); }; - const handler = e => { // Avoid firing multiple times if (this.isAutofilling || this.device.isTooltipActive()) { return; - } // On mobile, we don't trigger on focus, so here we get the target control on label click - + } + // On mobile, we don't trigger on focus, so here we get the target control on label click const isLabel = e.target instanceof HTMLLabelElement; const input = isLabel ? e.target.control : e.target; if (!input || !this.inputs.all.has(input)) return; if ((0, _autofillUtils.wasAutofilledByChrome)(input)) return; if (!(0, _inputTypeConfig.canBeInteractedWith)(input)) return; const clickCoords = getClickCoords(e, storedClickCoords); - if (e.type === 'pointerdown') { // Only allow real user clicks with co-ordinates through if (!e.isTrusted || !clickCoords) return; } - if (this.shouldOpenTooltip(e, input)) { - const iconClicked = (0, _autofillUtils.isEventWithinDax)(e, input); // On mobile and extensions we don't trigger the focus event to avoid + const iconClicked = (0, _autofillUtils.isEventWithinDax)(e, input); + // On mobile and extensions we don't trigger the focus event to avoid // keyboard flashing and conflicts with browsers' own tooltips - - if ((this.device.globalConfig.isMobileApp || this.device.globalConfig.isExtension) && // Avoid the icon capturing clicks on small fields making it impossible to focus + if ((this.device.globalConfig.isMobileApp || this.device.globalConfig.isExtension) && + // Avoid the icon capturing clicks on small fields making it impossible to focus input.offsetWidth > 50 && iconClicked) { e.preventDefault(); e.stopImmediatePropagation(); input.blur(); } - this.touched.add(input); this.device.attachTooltip({ form: this, @@ -7009,13 +6055,10 @@ class Form { (0, _autofillUtils.addInlineStyles)(input, activeStyles); } }; - if (!(input instanceof HTMLSelectElement)) { - var _input$labels; - const events = ['pointerdown']; if (!this.device.globalConfig.isMobileApp) events.push('focus'); - (_input$labels = input.labels) === null || _input$labels === void 0 ? void 0 : _input$labels.forEach(label => { + input.labels?.forEach(label => { if (this.device.globalConfig.isMobileApp) { // On mobile devices we don't trigger on focus, so we use the click handler here this.addListener(label, 'pointerdown', handler); @@ -7026,83 +6069,81 @@ class Form { }); events.forEach(ev => this.addListener(input, ev, handler)); } - return this; } - shouldOpenTooltip(e, input) { - var _this$device$inContex; - - if (!(0, _autofillUtils.isPotentiallyViewable)(input)) return false; // Always open if the user has clicked on the Dax icon + if (!(0, _autofillUtils.isPotentiallyViewable)(input)) return false; + // Always open if the user has clicked on the Dax icon if ((0, _autofillUtils.isEventWithinDax)(e, input)) return true; if (this.device.globalConfig.isWindows) return true; const subtype = (0, _matching.getInputSubtype)(input); - const isIncontextSignupAvailable = (_this$device$inContex = this.device.inContextSignup) === null || _this$device$inContex === void 0 ? void 0 : _this$device$inContex.isAvailable(subtype); - + const isIncontextSignupAvailable = this.device.inContextSignup?.isAvailable(subtype); if (this.device.globalConfig.isApp) { - const mainType = (0, _matching.getInputMainType)(input); // Check if, without in-context signup (passed as `null` below), + const mainType = (0, _matching.getInputMainType)(input); + // Check if, without in-context signup (passed as `null` below), // we'd have any other items to show. This lets us know if we're // just showing in-context signup, or with other autofill items. - const hasSavedDetails = this.device.settings.canAutofillType({ mainType, subtype - }, null); // Don't open the tooltip on input focus whenever it'll only show in-context signup + }, null); + // Don't open the tooltip on input focus whenever it'll only show in-context signup if (!hasSavedDetails && isIncontextSignupAvailable) return false; return true; } - if (this.device.globalConfig.isExtension || this.device.globalConfig.isMobileApp) { // Don't open the tooltip on input focus whenever it's showing in-context signup if (isIncontextSignupAvailable) return false; } - return !this.touched.has(input) && !input.classList.contains('ddg-autofilled'); } - autofillInput(input, string, dataType) { // Do not autofill if it's invisible (select elements can be hidden because of custom implementations) - if (input instanceof HTMLInputElement && !(0, _autofillUtils.isPotentiallyViewable)(input)) return; // Do not autofill if it's disabled or readonly to avoid potential breakage - - if (!(0, _inputTypeConfig.canBeInteractedWith)(input)) return; // @ts-ignore + if (input instanceof HTMLInputElement && !(0, _autofillUtils.isPotentiallyViewable)(input)) return; + // Do not autofill if it's disabled or readonly to avoid potential breakage + if (!(0, _inputTypeConfig.canBeInteractedWith)(input)) return; + // @ts-ignore const activeInputSubtype = (0, _matching.getInputSubtype)(this.activeInput); const inputSubtype = (0, _matching.getInputSubtype)(input); - const isEmailAutofill = activeInputSubtype === 'emailAddress' && inputSubtype === 'emailAddress'; // Don't override values for identities, unless it's the current input or we're autofilling email - - if (dataType === 'identities' && // only for identities - input.nodeName !== 'SELECT' && input.value !== '' && // if the input is not empty - this.activeInput !== input && // and this is not the active input + const isEmailAutofill = activeInputSubtype === 'emailAddress' && inputSubtype === 'emailAddress'; + + // Don't override values for identities, unless it's the current input or we're autofilling email + if (dataType === 'identities' && + // only for identities + input.nodeName !== 'SELECT' && input.value !== '' && + // if the input is not empty + this.activeInput !== input && + // and this is not the active input !isEmailAutofill // and we're not auto-filling email ) return; // do not overwrite the value - // If the value is already there, just return + // If the value is already there, just return if (input.value === string) return; const successful = (0, _autofillUtils.setValue)(input, string, this.device.globalConfig); if (!successful) return; input.classList.add('ddg-autofilled'); (0, _autofillUtils.addInlineStyles)(input, (0, _inputStyles.getIconStylesAutofilled)(input, this)); - this.touched.add(input); // If the user changes the value, remove the decoration + this.touched.add(input); + // If the user changes the value, remove the decoration input.addEventListener('input', e => this.removeAllHighlights(e, dataType), { once: true }); } + /** * Autofill method for email protection only * @param {string} alias * @param {'all' | SupportedMainTypes} dataType */ - - autofillEmail(alias) { let dataType = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'identities'; this.isAutofilling = true; this.execOnInputs(input => { const inputSubtype = (0, _matching.getInputSubtype)(input); - if (inputSubtype === 'emailAddress') { this.autofillInput(input, alias, dataType); } @@ -7110,64 +6151,53 @@ class Form { this.isAutofilling = false; this.removeTooltip(); } - autofillData(data, dataType) { - var _this$device$postAuto, _this$device2; - this.isAutofilling = true; this.execOnInputs(input => { const inputSubtype = (0, _matching.getInputSubtype)(input); let autofillData = data[inputSubtype]; - if (inputSubtype === 'expiration' && input instanceof HTMLInputElement) { autofillData = (0, _formatters.getUnifiedExpiryDate)(input, data.expirationMonth, data.expirationYear, this); } - if (inputSubtype === 'expirationYear' && input instanceof HTMLInputElement) { autofillData = (0, _formatters.formatCCYear)(input, autofillData, this); } - if (inputSubtype === 'addressCountryCode') { autofillData = (0, _formatters.getCountryName)(input, data); } - if (autofillData) { this.autofillInput(input, autofillData, dataType); } }, dataType); - this.isAutofilling = false; // After autofill we check if form values match the data provided… + this.isAutofilling = false; + // After autofill we check if form values match the data provided… const formValues = this.getValuesReadyForStorage(); const areAllFormValuesKnown = Object.keys(formValues[dataType] || {}).every(subtype => formValues[dataType][subtype] === data[subtype]); - if (areAllFormValuesKnown) { // …if we know all the values do not prompt to store data - this.shouldPromptToStoreData = false; // reset this to its initial value - + this.shouldPromptToStoreData = false; + // reset this to its initial value this.shouldAutoSubmit = this.device.globalConfig.isMobileApp; } else { // …otherwise we will prompt and do not want to autosubmit because the experience is jarring this.shouldAutoSubmit = false; } - - (_this$device$postAuto = (_this$device2 = this.device).postAutofill) === null || _this$device$postAuto === void 0 ? void 0 : _this$device$postAuto.call(_this$device2, data, dataType, this); + this.device.postAutofill?.(data, dataType, this); this.removeTooltip(); } + /** * Set all inputs of the data type to "touched" * @param {'all' | SupportedMainTypes} dataType */ - - touchAllInputs() { let dataType = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'all'; this.execOnInputs(input => this.touched.add(input), dataType); } - getFirstViableCredentialsInput() { return [...this.inputs.credentials].find(input => (0, _inputTypeConfig.canBeInteractedWith)(input) && (0, _autofillUtils.isPotentiallyViewable)(input)); } - async promptLoginIfNeeded() { if (document.visibilityState !== 'visible' || !this.isLogin) return; const firstCredentialInput = this.getFirstViableCredentialsInput(); @@ -7179,7 +6209,6 @@ class Form { mainType, subtype }); - if (this.device.settings.canAutofillType({ mainType, subtype @@ -7195,10 +6224,9 @@ class Form { height } = this.form.getBoundingClientRect(); const elHCenter = x + width / 2; - const elVCenter = y + height / 2; // This checks that the form is not covered by anything else - + const elVCenter = y + height / 2; + // This checks that the form is not covered by anything else const topMostElementFromPoint = document.elementFromPoint(elHCenter, elVCenter); - if (this.form.contains(topMostElementFromPoint)) { this.execOnInputs(input => { if ((0, _autofillUtils.isPotentiallyViewable)(input)) { @@ -7219,9 +6247,7 @@ class Form { }, 200); } } - } - exports.Form = Form; },{"../autofill-utils.js":51,"../constants.js":54,"./FormAnalyzer.js":24,"./formatters.js":26,"./inputStyles.js":27,"./inputTypeConfig.js":28,"./matching.js":33}],24:[function(require,module,exports){ @@ -7231,118 +6257,99 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; - var _matching = require("./matching.js"); - var _constants = require("../constants.js"); - var _compiledMatchingConfig = require("./matching-config/__generated__/compiled-matching-config.js"); - var _autofillUtils = require("../autofill-utils.js"); - -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - class FormAnalyzer { /** @type HTMLElement */ - + form; /** @type Matching */ - + matching; /** * @param {HTMLElement} form * @param {HTMLInputElement|HTMLSelectElement} input * @param {Matching} [matching] */ constructor(form, input, matching) { - _defineProperty(this, "form", void 0); - - _defineProperty(this, "matching", void 0); - - _defineProperty(this, "_isCCForm", undefined); - this.form = form; this.matching = matching || new _matching.Matching(_compiledMatchingConfig.matchingConfiguration); + /** * The signal is a continuum where negative values imply login and positive imply signup * @type {number} */ - this.autofillSignal = 0; /** * A hybrid form can be either a login or a signup, the site uses a single form for both * @type {number} */ - this.hybridSignal = 0; + /** * Collects the signals for debugging purposes * @type {string[]} */ - this.signals = []; this.evaluateElAttributes(input, 1, true); form ? this.evaluateForm() : this.evaluatePage(); return this; } + /** * Hybrid forms can be used for both login and signup * @returns {boolean} */ - - get isHybrid() { // When marking for hybrid we also want to ensure other signals are weak const areOtherSignalsWeak = Math.abs(this.autofillSignal) < 10; return this.hybridSignal > 0 && areOtherSignalsWeak; } - get isLogin() { if (this.isHybrid) return false; return this.autofillSignal < 0; } - get isSignup() { if (this.isHybrid) return false; return this.autofillSignal >= 0; } + /** * Tilts the scoring towards Signup * @param {number} strength * @param {string} signal * @returns {FormAnalyzer} */ - - increaseSignalBy(strength, signal) { this.autofillSignal += strength; - this.signals.push("".concat(signal, ": +").concat(strength)); + this.signals.push(`${signal}: +${strength}`); return this; } + /** * Tilts the scoring towards Login * @param {number} strength * @param {string} signal * @returns {FormAnalyzer} */ - - decreaseSignalBy(strength, signal) { this.autofillSignal -= strength; - this.signals.push("".concat(signal, ": -").concat(strength)); + this.signals.push(`${signal}: -${strength}`); return this; } + /** * Increases the probability that this is a hybrid form (can be either login or signup) * @param {number} strength * @param {string} signal * @returns {FormAnalyzer} */ - - increaseHybridSignal(strength, signal) { this.hybridSignal += strength; - this.signals.push("".concat(signal, " (hybrid): +").concat(strength)); + this.signals.push(`${signal} (hybrid): +${strength}`); return this; } + /** * Updates the Login<->Signup signal according to the provided parameters * @param {object} p @@ -7354,11 +6361,7 @@ class FormAnalyzer { * @param {boolean} [p.shouldBeConservative] - Should use the conservative signup regex * @returns {FormAnalyzer} */ - - updateSignal(_ref) { - var _this$matching$getDDG, _this$matching$getDDG2, _this$matching$getDDG3; - let { string, strength, @@ -7367,16 +6370,17 @@ class FormAnalyzer { shouldCheckUnifiedForm = false, shouldBeConservative = false } = _ref; - const matchesLogin = /current.?password/i.test(string) || ((_this$matching$getDDG = this.matching.getDDGMatcherRegex('loginRegex')) === null || _this$matching$getDDG === void 0 ? void 0 : _this$matching$getDDG.test(string)) || ((_this$matching$getDDG2 = this.matching.getDDGMatcherRegex('resetPasswordLink')) === null || _this$matching$getDDG2 === void 0 ? void 0 : _this$matching$getDDG2.test(string)); // Check explicitly for unified login/signup forms + const matchesLogin = /current.?password/i.test(string) || this.matching.getDDGMatcherRegex('loginRegex')?.test(string) || this.matching.getDDGMatcherRegex('resetPasswordLink')?.test(string); - if (shouldCheckUnifiedForm && matchesLogin && (_this$matching$getDDG3 = this.matching.getDDGMatcherRegex('conservativeSignupRegex')) !== null && _this$matching$getDDG3 !== void 0 && _this$matching$getDDG3.test(string)) { + // Check explicitly for unified login/signup forms + if (shouldCheckUnifiedForm && matchesLogin && this.matching.getDDGMatcherRegex('conservativeSignupRegex')?.test(string)) { this.increaseHybridSignal(strength, signalType); return this; } - const signupRegexToUse = this.matching.getDDGMatcherRegex(shouldBeConservative ? 'conservativeSignupRegex' : 'signupRegex'); - const matchesSignup = /new.?password/i.test(string) || (signupRegexToUse === null || signupRegexToUse === void 0 ? void 0 : signupRegexToUse.test(string)); // In some cases a login match means the login is somewhere else, i.e. when a link points outside + const matchesSignup = /new.?password/i.test(string) || signupRegexToUse?.test(string); + // In some cases a login match means the login is somewhere else, i.e. when a link points outside if (shouldFlip) { if (matchesLogin) this.increaseSignalBy(strength, signalType); if (matchesSignup) this.decreaseSignalBy(strength, signalType); @@ -7384,53 +6388,45 @@ class FormAnalyzer { if (matchesLogin) this.decreaseSignalBy(strength, signalType); if (matchesSignup) this.increaseSignalBy(strength, signalType); } - return this; } - evaluateElAttributes(el) { let signalStrength = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 3; let isInput = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; Array.from(el.attributes).forEach(attr => { if (attr.name === 'style') return; - const attributeString = "".concat(attr.name, "=").concat(attr.value); + const attributeString = `${attr.name}=${attr.value}`; this.updateSignal({ string: attributeString, strength: signalStrength, - signalType: "".concat(el.name, " attr: ").concat(attributeString), + signalType: `${el.name} attr: ${attributeString}`, shouldCheckUnifiedForm: isInput }); }); } - evaluateUrl() { - var _this$matching$getDDG4, _this$matching$getDDG5; - const path = window.location.pathname; - const matchesLogin = (_this$matching$getDDG4 = this.matching.getDDGMatcherRegex('loginRegex')) === null || _this$matching$getDDG4 === void 0 ? void 0 : _this$matching$getDDG4.test(path); - const matchesSignup = (_this$matching$getDDG5 = this.matching.getDDGMatcherRegex('conservativeSignupRegex')) === null || _this$matching$getDDG5 === void 0 ? void 0 : _this$matching$getDDG5.test(path); // If the url matches both, do nothing: the signal is probably confounding + const matchesLogin = this.matching.getDDGMatcherRegex('loginRegex')?.test(path); + const matchesSignup = this.matching.getDDGMatcherRegex('conservativeSignupRegex')?.test(path); + // If the url matches both, do nothing: the signal is probably confounding if (matchesLogin && matchesSignup) return; - if (matchesLogin) { this.decreaseSignalBy(1, 'url matches login'); } - if (matchesSignup) { this.increaseSignalBy(1, 'url matches signup'); } } - evaluatePageTitle() { const pageTitle = document.title; this.updateSignal({ string: pageTitle, strength: 2, - signalType: "page title: ".concat(pageTitle), + signalType: `page title: ${pageTitle}`, shouldCheckUnifiedForm: true }); } - evaluatePageHeadings() { const headings = document.querySelectorAll('h1, h2, h3, [class*="title"], [id*="title"]'); headings.forEach(_ref2 => { @@ -7441,17 +6437,16 @@ class FormAnalyzer { this.updateSignal({ string: textContent, strength: 0.5, - signalType: "heading: ".concat(textContent), + signalType: `heading: ${textContent}`, shouldCheckUnifiedForm: true, shouldBeConservative: true }); }); } - evaluatePage() { this.evaluatePageTitle(); - this.evaluatePageHeadings(); // Check for submit buttons - + this.evaluatePageHeadings(); + // Check for submit buttons const buttons = document.querySelectorAll(this.matching.cssSelector('submitButtonSelector')); buttons.forEach(button => { // if the button has a form, it's not related to our input, because our input has no form here @@ -7463,25 +6458,22 @@ class FormAnalyzer { } }); } - evaluateElement(el) { const string = (0, _autofillUtils.getTextShallow)(el); - if (el.matches(this.matching.cssSelector('password'))) { // These are explicit signals by the web author, so we weigh them heavily this.updateSignal({ string: el.getAttribute('autocomplete') || el.getAttribute('name') || '', strength: 5, - signalType: "explicit: ".concat(el.getAttribute('autocomplete')) + signalType: `explicit: ${el.getAttribute('autocomplete')}` }); return; - } // check button contents - + } + // check button contents if (el.matches(this.matching.cssSelector('submitButtonSelector') + ', *[class*=button]')) { // If we're confident this is the submit button, it's a stronger signal let likelyASubmit = (0, _autofillUtils.isLikelyASubmitButton)(el, this.matching); - if (likelyASubmit) { this.form.querySelectorAll('input[type=submit], button[type=submit]').forEach(submit => { // If there is another element marked as submit and this is not, flip back to false @@ -7490,133 +6482,120 @@ class FormAnalyzer { } }); } - const strength = likelyASubmit ? 20 : 2; this.updateSignal({ string, strength, - signalType: "submit: ".concat(string) + signalType: `submit: ${string}` }); return; - } // if an external link matches one of the regexes, we assume the match is not pertinent to the current form - - + } + // if an external link matches one of the regexes, we assume the match is not pertinent to the current form if (el instanceof HTMLAnchorElement && el.href && el.getAttribute('href') !== '#' || (el.getAttribute('role') || '').toUpperCase() === 'LINK' || el.matches('button[class*=secondary]')) { - var _this$matching$getDDG6, _this$matching$getDDG7; - let shouldFlip = true; - let strength = 1; // Don't flip forgotten password links - - if ((_this$matching$getDDG6 = this.matching.getDDGMatcherRegex('resetPasswordLink')) !== null && _this$matching$getDDG6 !== void 0 && _this$matching$getDDG6.test(string)) { + let strength = 1; + // Don't flip forgotten password links + if (this.matching.getDDGMatcherRegex('resetPasswordLink')?.test(string)) { shouldFlip = false; strength = 3; - } else if ((_this$matching$getDDG7 = this.matching.getDDGMatcherRegex('loginProvidersRegex')) !== null && _this$matching$getDDG7 !== void 0 && _this$matching$getDDG7.test(string)) { + } else if (this.matching.getDDGMatcherRegex('loginProvidersRegex')?.test(string)) { // Don't flip login providers links shouldFlip = false; } - this.updateSignal({ string, strength, - signalType: "external link: ".concat(string), + signalType: `external link: ${string}`, shouldFlip }); } else { - var _removeExcessWhitespa; - // any other case // only consider the el if it's a small text to avoid noisy disclaimers - if (((_removeExcessWhitespa = (0, _matching.removeExcessWhitespace)(el.textContent)) === null || _removeExcessWhitespa === void 0 ? void 0 : _removeExcessWhitespa.length) < _constants.constants.TEXT_LENGTH_CUTOFF) { + if ((0, _matching.removeExcessWhitespace)(el.textContent)?.length < _constants.constants.TEXT_LENGTH_CUTOFF) { this.updateSignal({ string, strength: 1, - signalType: "generic: ".concat(string), + signalType: `generic: ${string}`, shouldCheckUnifiedForm: true }); } } } - evaluateForm() { // Check page url - this.evaluateUrl(); // Check page title + this.evaluateUrl(); - this.evaluatePageTitle(); // Check form attributes + // Check page title + this.evaluatePageTitle(); - this.evaluateElAttributes(this.form); // Check form contents (noisy elements are skipped with the safeUniversalSelector) + // Check form attributes + this.evaluateElAttributes(this.form); + // Check form contents (noisy elements are skipped with the safeUniversalSelector) this.form.querySelectorAll(this.matching.cssSelector('safeUniversalSelector')).forEach(el => { // Check if element is not hidden. Note that we can't use offsetHeight // nor intersectionObserver, because the element could be outside the // viewport or its parent hidden const displayValue = window.getComputedStyle(el, null).getPropertyValue('display'); if (displayValue !== 'none') this.evaluateElement(el); - }); // A form with many fields is unlikely to be a login form + }); + // A form with many fields is unlikely to be a login form const relevantFields = this.form.querySelectorAll(this.matching.cssSelector('genericTextField')); - if (relevantFields.length >= 4) { this.increaseSignalBy(relevantFields.length * 1.5, 'many fields: it is probably not a login'); - } // If we can't decide at this point, try reading page headings - + } + // If we can't decide at this point, try reading page headings if (this.autofillSignal === 0) { this.evaluatePageHeadings(); } - return this; } - /** @type {undefined|boolean} */ - + /** @type {undefined|boolean} */ + _isCCForm = undefined; /** * Tries to infer if it's a credit card form * @returns {boolean} */ isCCForm() { - var _formEl$textContent; - if (this._isCCForm !== undefined) return this._isCCForm; const formEl = this.form; const ccFieldSelector = this.matching.joinCssSelectors('cc'); - if (!ccFieldSelector) { this._isCCForm = false; return this._isCCForm; } - - const hasCCSelectorChild = formEl.matches(ccFieldSelector) || formEl.querySelector(ccFieldSelector); // If the form contains one of the specific selectors, we have high confidence - + const hasCCSelectorChild = formEl.matches(ccFieldSelector) || formEl.querySelector(ccFieldSelector); + // If the form contains one of the specific selectors, we have high confidence if (hasCCSelectorChild) { this._isCCForm = true; return this._isCCForm; - } // Read form attributes to find a signal - + } + // Read form attributes to find a signal const hasCCAttribute = [...formEl.attributes].some(_ref3 => { let { name, value } = _ref3; - return /(credit|payment).?card/i.test("".concat(name, "=").concat(value)); + return /(credit|payment).?card/i.test(`${name}=${value}`); }); - if (hasCCAttribute) { this._isCCForm = true; return this._isCCForm; - } // Match form textContent against common cc fields (includes hidden labels) - + } - const textMatches = (_formEl$textContent = formEl.textContent) === null || _formEl$textContent === void 0 ? void 0 : _formEl$textContent.match(/(credit|payment).?card(.?number)?|ccv|security.?code|cvv|cvc|csc/ig); // We check for more than one to minimise false positives + // Match form textContent against common cc fields (includes hidden labels) + const textMatches = formEl.textContent?.match(/(credit|payment).?card(.?number)?|ccv|security.?code|cvv|cvc|csc/ig); + // We check for more than one to minimise false positives this._isCCForm = Boolean(textMatches && textMatches.length > 1); return this._isCCForm; } - } - -var _default = FormAnalyzer; -exports.default = _default; +var _default = exports.default = FormAnalyzer; },{"../autofill-utils.js":51,"../constants.js":54,"./matching-config/__generated__/compiled-matching-config.js":31,"./matching.js":33}],25:[function(require,module,exports){ "use strict"; @@ -7625,13 +6604,12 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.COUNTRY_NAMES_TO_CODES = exports.COUNTRY_CODES_TO_NAMES = void 0; - /** * Country names object using 2-letter country codes to reference country name * Derived from the Intl.DisplayNames implementation * @source https://stackoverflow.com/a/70517921/1948947 */ -const COUNTRY_CODES_TO_NAMES = { +const COUNTRY_CODES_TO_NAMES = exports.COUNTRY_CODES_TO_NAMES = { AC: 'Ascension Island', AD: 'Andorra', AE: 'United Arab Emirates', @@ -7912,14 +6890,13 @@ const COUNTRY_CODES_TO_NAMES = { ZW: 'Zimbabwe', ZZ: 'Unknown Region' }; + /** * Country names object using country name to reference 2-letter country codes * Derived from the solution above with * Object.fromEntries(Object.entries(COUNTRY_CODES_TO_NAMES).map(entry => [entry[1], entry[0]])) */ - -exports.COUNTRY_CODES_TO_NAMES = COUNTRY_CODES_TO_NAMES; -const COUNTRY_NAMES_TO_CODES = { +const COUNTRY_NAMES_TO_CODES = exports.COUNTRY_NAMES_TO_CODES = { 'Ascension Island': 'AC', Andorra: 'AD', 'United Arab Emirates': 'AE', @@ -8184,7 +7161,6 @@ const COUNTRY_NAMES_TO_CODES = { Zambia: 'ZM', 'Unknown Region': 'ZZ' }; -exports.COUNTRY_NAMES_TO_CODES = COUNTRY_NAMES_TO_CODES; },{}],26:[function(require,module,exports){ "use strict"; @@ -8193,19 +7169,13 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.prepareFormValuesForStorage = exports.inferCountryCodeFromElement = exports.getUnifiedExpiryDate = exports.getMMAndYYYYFromString = exports.getCountryName = exports.getCountryDisplayName = exports.formatPhoneNumber = exports.formatFullName = exports.formatCCYear = void 0; - var _matching = require("./matching.js"); - var _countryNames = require("./countryNames.js"); - -var _templateObject, _templateObject2; - -function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); } - // Matches strings like mm/yy, mm-yyyy, mm-aa, 12 / 2024 -const DATE_SEPARATOR_REGEX = /\b((.)\2{1,3}|\d+)(?\s?[/\s.\-_—–]\s?)((.)\5{1,3}|\d+)\b/i; // Matches 4 non-digit repeated characters (YYYY or AAAA) or 4 digits (2022) - +const DATE_SEPARATOR_REGEX = /\b((.)\2{1,3}|\d+)(?\s?[/\s.\-_—–]\s?)((.)\5{1,3}|\d+)\b/i; +// Matches 4 non-digit repeated characters (YYYY or AAAA) or 4 digits (2022) const FOUR_DIGIT_YEAR_REGEX = /(\D)\1{3}|\d{4}/i; + /** * Format the cc year to best adapt to the input requirements (YY vs YYYY) * @param {HTMLInputElement} input @@ -8213,12 +7183,12 @@ const FOUR_DIGIT_YEAR_REGEX = /(\D)\1{3}|\d{4}/i; * @param {import("./Form").Form} form * @returns {string} */ - const formatCCYear = (input, year, form) => { const selector = form.matching.cssSelector('formInputsSelector'); if (input.maxLength === 4 || (0, _matching.checkPlaceholderAndLabels)(input, FOUR_DIGIT_YEAR_REGEX, form.form, selector)) return year; - return "".concat(Number(year) - 2000); + return `${Number(year) - 2000}`; }; + /** * Get a unified expiry date with separator * @param {HTMLInputElement} input @@ -8227,250 +7197,215 @@ const formatCCYear = (input, year, form) => { * @param {import("./Form").Form} form * @returns {string} */ - - exports.formatCCYear = formatCCYear; - const getUnifiedExpiryDate = (input, month, year, form) => { - var _matchInPlaceholderAn, _matchInPlaceholderAn2; - const formattedYear = formatCCYear(input, year, form); - const paddedMonth = "".concat(month).padStart(2, '0'); + const paddedMonth = `${month}`.padStart(2, '0'); const cssSelector = form.matching.cssSelector('formInputsSelector'); - const separator = ((_matchInPlaceholderAn = (0, _matching.matchInPlaceholderAndLabels)(input, DATE_SEPARATOR_REGEX, form.form, cssSelector)) === null || _matchInPlaceholderAn === void 0 ? void 0 : (_matchInPlaceholderAn2 = _matchInPlaceholderAn.groups) === null || _matchInPlaceholderAn2 === void 0 ? void 0 : _matchInPlaceholderAn2.separator) || '/'; - return "".concat(paddedMonth).concat(separator).concat(formattedYear); + const separator = (0, _matching.matchInPlaceholderAndLabels)(input, DATE_SEPARATOR_REGEX, form.form, cssSelector)?.groups?.separator || '/'; + return `${paddedMonth}${separator}${formattedYear}`; }; - exports.getUnifiedExpiryDate = getUnifiedExpiryDate; - const formatFullName = _ref => { let { firstName = '', middleName = '', lastName = '' } = _ref; - return "".concat(firstName, " ").concat(middleName ? middleName + ' ' : '').concat(lastName).trim(); + return `${firstName} ${middleName ? middleName + ' ' : ''}${lastName}`.trim(); }; + /** * Tries to look up a human-readable country name from the country code * @param {string} locale * @param {string} addressCountryCode * @return {string} - Returns the country code if we can't find a name */ - - exports.formatFullName = formatFullName; - const getCountryDisplayName = (locale, addressCountryCode) => { try { const regionNames = new Intl.DisplayNames([locale], { type: 'region' - }); // Adding this ts-ignore to prevent having to change this implementation. + }); + // Adding this ts-ignore to prevent having to change this implementation. // @ts-ignore - return regionNames.of(addressCountryCode); } catch (e) { return _countryNames.COUNTRY_CODES_TO_NAMES[addressCountryCode] || addressCountryCode; } }; + /** * Tries to infer the element locale or returns 'en' * @param {HTMLInputElement | HTMLSelectElement} el * @return {string | 'en'} */ - - exports.getCountryDisplayName = getCountryDisplayName; +const inferElementLocale = el => el.lang || el.form?.lang || document.body.lang || document.documentElement.lang || 'en'; -const inferElementLocale = el => { - var _el$form; - - return el.lang || ((_el$form = el.form) === null || _el$form === void 0 ? void 0 : _el$form.lang) || document.body.lang || document.documentElement.lang || 'en'; -}; /** * Tries to format the country code into a localised country name * @param {HTMLInputElement | HTMLSelectElement} el * @param {{addressCountryCode?: string}} options */ - - const getCountryName = function (el) { let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; const { addressCountryCode } = options; - if (!addressCountryCode) return ''; // Try to infer the field language or fallback to en + if (!addressCountryCode) return ''; + // Try to infer the field language or fallback to en const elLocale = inferElementLocale(el); - const localisedCountryName = getCountryDisplayName(elLocale, addressCountryCode); // If it's a select el we try to find a suitable match to autofill + const localisedCountryName = getCountryDisplayName(elLocale, addressCountryCode); + // If it's a select el we try to find a suitable match to autofill if (el.nodeName === 'SELECT') { - const englishCountryName = getCountryDisplayName('en', addressCountryCode); // This regex matches both the localised and English country names - - const countryNameRegex = new RegExp(String.raw(_templateObject || (_templateObject = _taggedTemplateLiteral(["", "|", ""])), localisedCountryName.replace(/ /g, '.?'), englishCountryName.replace(/ /g, '.?')), 'i'); - const countryCodeRegex = new RegExp(String.raw(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\b", "\b"], ["\\b", "\\b"])), addressCountryCode), 'i'); // We check the country code first because it's more accurate + const englishCountryName = getCountryDisplayName('en', addressCountryCode); + // This regex matches both the localised and English country names + const countryNameRegex = new RegExp(String.raw`${localisedCountryName.replace(/ /g, '.?')}|${englishCountryName.replace(/ /g, '.?')}`, 'i'); + const countryCodeRegex = new RegExp(String.raw`\b${addressCountryCode}\b`, 'i'); + // We check the country code first because it's more accurate if (el instanceof HTMLSelectElement) { for (const option of el.options) { if (countryCodeRegex.test(option.value)) { return option.value; } } - for (const option of el.options) { if (countryNameRegex.test(option.value) || countryNameRegex.test(option.innerText)) return option.value; } } } - return localisedCountryName; }; + /** * Try to get a map of localised country names to code, or falls back to the English map * @param {HTMLInputElement | HTMLSelectElement} el */ - - exports.getCountryName = getCountryName; - const getLocalisedCountryNamesToCodes = el => { - if (typeof Intl.DisplayNames !== 'function') return _countryNames.COUNTRY_NAMES_TO_CODES; // Try to infer the field language or fallback to en + if (typeof Intl.DisplayNames !== 'function') return _countryNames.COUNTRY_NAMES_TO_CODES; + // Try to infer the field language or fallback to en const elLocale = inferElementLocale(el); return Object.fromEntries(Object.entries(_countryNames.COUNTRY_CODES_TO_NAMES).map(_ref2 => { let [code] = _ref2; return [getCountryDisplayName(elLocale, code), code]; })); }; + /** * Try to infer a country code from an element we identified as identities.addressCountryCode * @param {HTMLInputElement | HTMLSelectElement} el * @return {string} */ - - const inferCountryCodeFromElement = el => { if (_countryNames.COUNTRY_CODES_TO_NAMES[el.value]) return el.value; if (_countryNames.COUNTRY_NAMES_TO_CODES[el.value]) return _countryNames.COUNTRY_NAMES_TO_CODES[el.value]; const localisedCountryNamesToCodes = getLocalisedCountryNamesToCodes(el); if (localisedCountryNamesToCodes[el.value]) return localisedCountryNamesToCodes[el.value]; - if (el instanceof HTMLSelectElement) { - var _el$selectedOptions$; - - const selectedText = (_el$selectedOptions$ = el.selectedOptions[0]) === null || _el$selectedOptions$ === void 0 ? void 0 : _el$selectedOptions$.text; + const selectedText = el.selectedOptions[0]?.text; if (_countryNames.COUNTRY_CODES_TO_NAMES[selectedText]) return selectedText; if (_countryNames.COUNTRY_NAMES_TO_CODES[selectedText]) return localisedCountryNamesToCodes[selectedText]; if (localisedCountryNamesToCodes[selectedText]) return localisedCountryNamesToCodes[selectedText]; } - return ''; }; + /** * Gets separate expiration month and year from a single string * @param {string} expiration * @return {{expirationYear: string, expirationMonth: string}} */ - - exports.inferCountryCodeFromElement = inferCountryCodeFromElement; - const getMMAndYYYYFromString = expiration => { /** @type {string[]} */ const values = expiration.match(/(\d+)/g) || []; - return values === null || values === void 0 ? void 0 : values.reduce((output, current) => { + return values?.reduce((output, current) => { if (Number(current) > 12) { output.expirationYear = current.padStart(4, '20'); } else { output.expirationMonth = current.padStart(2, '0'); } - return output; }, { expirationYear: '', expirationMonth: '' }); }; + /** * @param {InternalDataStorageObject} credentials * @return {boolean} */ - - exports.getMMAndYYYYFromString = getMMAndYYYYFromString; - const shouldStoreCredentials = _ref3 => { let { credentials } = _ref3; return Boolean(credentials.password); }; + /** * @param {InternalDataStorageObject} credentials * @return {boolean} */ - - const shouldStoreIdentities = _ref4 => { let { identities } = _ref4; return Boolean((identities.firstName || identities.fullName) && identities.addressStreet && identities.addressCity); }; + /** * @param {InternalDataStorageObject} credentials * @return {boolean} */ - - const shouldStoreCreditCards = _ref5 => { let { creditCards } = _ref5; if (!creditCards.cardNumber) return false; - if (creditCards.cardSecurityCode) return true; // Some forms (Amazon) don't have the cvv, so we still save if there's the expiration - - if (creditCards.expiration) return true; // Expiration can also be two separate values - + if (creditCards.cardSecurityCode) return true; + // Some forms (Amazon) don't have the cvv, so we still save if there's the expiration + if (creditCards.expiration) return true; + // Expiration can also be two separate values return Boolean(creditCards.expirationYear && creditCards.expirationMonth); }; + /** * Removes formatting characters from phone numbers, only leaves digits and the + sign * @param {String} phone * @returns {String} */ - - const formatPhoneNumber = phone => phone.replaceAll(/[^0-9|+]/g, ''); + /** * Formats form data into an object to send to the device for storage * If values are insufficient for a complete entry, they are discarded * @param {InternalDataStorageObject} formValues * @return {DataStorageObject} */ - - exports.formatPhoneNumber = formatPhoneNumber; - const prepareFormValuesForStorage = formValues => { - var _identities, _identities2; - /** @type {Partial} */ let { credentials, identities, creditCards - } = formValues; // If we have an identity name but not a card name, copy it over there + } = formValues; - if (!creditCards.cardName && ((_identities = identities) !== null && _identities !== void 0 && _identities.fullName || (_identities2 = identities) !== null && _identities2 !== void 0 && _identities2.firstName)) { - var _identities3; - - creditCards.cardName = ((_identities3 = identities) === null || _identities3 === void 0 ? void 0 : _identities3.fullName) || formatFullName(identities); + // If we have an identity name but not a card name, copy it over there + if (!creditCards.cardName && (identities?.fullName || identities?.firstName)) { + creditCards.cardName = identities?.fullName || formatFullName(identities); } + /** Fixes for credentials **/ // Don't store if there isn't enough data - - if (shouldStoreCredentials(formValues)) { // If we don't have a username to match a password, let's see if the email is available if (credentials.password && !credentials.username && identities.emailAddress) { @@ -8479,17 +7414,15 @@ const prepareFormValuesForStorage = formValues => { } else { credentials = undefined; } + /** Fixes for identities **/ // Don't store if there isn't enough data - - if (shouldStoreIdentities(formValues)) { if (identities.fullName) { // when forms have both first/last and fullName we keep the individual values and drop the fullName if (!(identities.firstName && identities.lastName)) { // If the fullname can be easily split into two, we'll store it as first and last const nameParts = identities.fullName.trim().split(/\s+/); - if (nameParts.length === 2) { identities.firstName = nameParts[0]; identities.lastName = nameParts[1]; @@ -8498,23 +7431,18 @@ const prepareFormValuesForStorage = formValues => { identities.firstName = identities.fullName; } } - delete identities.fullName; } - if (identities.phone) { identities.phone = formatPhoneNumber(identities.phone); } } else { identities = undefined; } + /** Fixes for credit cards **/ // Don't store if there isn't enough data - - if (shouldStoreCreditCards(formValues)) { - var _creditCards$expirati; - if (creditCards.expiration) { const { expirationMonth, @@ -8524,23 +7452,19 @@ const prepareFormValuesForStorage = formValues => { creditCards.expirationYear = expirationYear; delete creditCards.expiration; } - - creditCards.expirationYear = (_creditCards$expirati = creditCards.expirationYear) === null || _creditCards$expirati === void 0 ? void 0 : _creditCards$expirati.padStart(4, '20'); - + creditCards.expirationYear = creditCards.expirationYear?.padStart(4, '20'); if (creditCards.cardNumber) { creditCards.cardNumber = creditCards.cardNumber.replace(/\D/g, ''); } } else { creditCards = undefined; } - return { credentials, identities, creditCards }; }; - exports.prepareFormValuesForStorage = prepareFormValuesForStorage; },{"./countryNames.js":25,"./matching.js":33}],27:[function(require,module,exports){ @@ -8550,9 +7474,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.getIconStylesBase = exports.getIconStylesAutofilled = exports.getIconStylesAlternate = void 0; - var _inputTypeConfig = require("./inputTypeConfig.js"); - /** * Returns the css-ready base64 encoding of the icon for the given input * @param {HTMLInputElement} input @@ -8563,86 +7485,77 @@ var _inputTypeConfig = require("./inputTypeConfig.js"); const getIcon = function (input, form) { let type = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'base'; const config = (0, _inputTypeConfig.getInputConfig)(input); - if (type === 'base') { return config.getIconBase(input, form); } - if (type === 'filled') { return config.getIconFilled(input, form); } - if (type === 'alternate') { return config.getIconAlternate(input, form); } - return ''; }; + /** * Returns an object with styles to be applied inline * @param {HTMLInputElement} input * @param {String} icon * @return {Object} */ - - const getBasicStyles = (input, icon) => ({ // Height must be > 0 to account for fields initially hidden - 'background-size': "auto ".concat(input.offsetHeight <= 30 && input.offsetHeight > 0 ? '100%' : '24px'), + 'background-size': `auto ${input.offsetHeight <= 30 && input.offsetHeight > 0 ? '100%' : '24px'}`, 'background-position': 'center right', 'background-repeat': 'no-repeat', 'background-origin': 'content-box', - 'background-image': "url(".concat(icon, ")"), + 'background-image': `url(${icon})`, 'transition': 'background 0s' }); + /** * Get inline styles for the injected icon, base state * @param {HTMLInputElement} input * @param {import("./Form").Form} form * @return {Object} */ - - const getIconStylesBase = (input, form) => { const icon = getIcon(input, form); if (!icon) return {}; return getBasicStyles(input, icon); }; + /** * Get inline styles for the injected icon, alternate state * @param {HTMLInputElement} input * @param {import("./Form").Form} form * @return {Object} */ - - exports.getIconStylesBase = getIconStylesBase; - const getIconStylesAlternate = (input, form) => { const icon = getIcon(input, form, 'alternate'); if (!icon) return {}; - return { ...getBasicStyles(input, icon) + return { + ...getBasicStyles(input, icon) }; }; + /** * Get inline styles for the injected icon, autofilled state * @param {HTMLInputElement} input * @param {import("./Form").Form} form * @return {Object} */ - - exports.getIconStylesAlternate = getIconStylesAlternate; - const getIconStylesAutofilled = (input, form) => { const icon = getIcon(input, form, 'filled'); const iconStyle = icon ? getBasicStyles(input, icon) : {}; - return { ...iconStyle, + return { + ...iconStyle, 'background-color': '#F8F498', 'color': '#333333' }; }; - exports.getIconStylesAutofilled = getIconStylesAutofilled; },{"./inputTypeConfig.js":28}],28:[function(require,module,exports){ @@ -8652,25 +7565,15 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.isFieldDecorated = exports.getInputConfigFromType = exports.getInputConfig = exports.canBeInteractedWith = void 0; - var _logoSvg = require("./logo-svg.js"); - var ddgPasswordIcons = _interopRequireWildcard(require("../UI/img/ddgPasswordIcon.js")); - var _matching = require("./matching.js"); - var _Credentials = require("../InputTypes/Credentials.js"); - var _CreditCard = require("../InputTypes/CreditCard.js"); - var _Identity = require("../InputTypes/Identity.js"); - var _constants = require("../constants.js"); - function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } - function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } - /** * Get the icon for the identities (currently only Dax for emails) * @param {HTMLInputElement} input @@ -8678,28 +7581,25 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && * @return {string} */ const getIdentitiesIcon = (input, _ref) => { - var _device$inContextSign; - let { device } = _ref; - if (!canBeInteractedWith(input)) return ''; // In Firefox web_accessible_resources could leak a unique user identifier, so we avoid it here + if (!canBeInteractedWith(input)) return ''; + // In Firefox web_accessible_resources could leak a unique user identifier, so we avoid it here const { isDDGApp, isFirefox, isExtension } = device.globalConfig; const subtype = (0, _matching.getInputSubtype)(input); - - if ((_device$inContextSign = device.inContextSignup) !== null && _device$inContextSign !== void 0 && _device$inContextSign.isAvailable(subtype)) { + if (device.inContextSignup?.isAvailable(subtype)) { if (isDDGApp || isFirefox) { return _logoSvg.daxGrayscaleBase64; } else if (isExtension) { return chrome.runtime.getURL('img/logo-small-grayscale.svg'); } } - if (subtype === 'emailAddress' && device.isDeviceSignedIn()) { if (isDDGApp || isFirefox) { return _logoSvg.daxBase64; @@ -8707,34 +7607,30 @@ const getIdentitiesIcon = (input, _ref) => { return chrome.runtime.getURL('img/logo-small.svg'); } } - return ''; }; + /** * Get the alternate icon for the identities (currently only Dax for emails) * @param {HTMLInputElement} input * @param {import("./Form").Form} form * @return {string} */ - - const getIdentitiesAlternateIcon = (input, _ref2) => { - var _device$inContextSign2; - let { device } = _ref2; - if (!canBeInteractedWith(input)) return ''; // In Firefox web_accessible_resources could leak a unique user identifier, so we avoid it here + if (!canBeInteractedWith(input)) return ''; + // In Firefox web_accessible_resources could leak a unique user identifier, so we avoid it here const { isDDGApp, isFirefox, isExtension } = device.globalConfig; const subtype = (0, _matching.getInputSubtype)(input); - const isIncontext = (_device$inContextSign2 = device.inContextSignup) === null || _device$inContextSign2 === void 0 ? void 0 : _device$inContextSign2.isAvailable(subtype); + const isIncontext = device.inContextSignup?.isAvailable(subtype); const isEmailProtection = subtype === 'emailAddress' && device.isDeviceSignedIn(); - if (isIncontext || isEmailProtection) { if (isDDGApp || isFirefox) { return _logoSvg.daxBase64; @@ -8742,27 +7638,23 @@ const getIdentitiesAlternateIcon = (input, _ref2) => { return chrome.runtime.getURL('img/logo-small.svg'); } } - return ''; }; + /** * Checks whether a field is readonly or disabled * @param {HTMLInputElement} input * @return {boolean} */ - - const canBeInteractedWith = input => !input.readOnly && !input.disabled; + /** * Checks if the input can be decorated and we have the needed data * @param {HTMLInputElement} input * @param {import("../DeviceInterface/InterfacePrototype").default} device * @returns {Promise} */ - - exports.canBeInteractedWith = canBeInteractedWith; - const canBeAutofilled = async (input, device) => { if (!canBeInteractedWith(input)) return false; const mainType = (0, _matching.getInputMainType)(input); @@ -8777,12 +7669,11 @@ const canBeAutofilled = async (input, device) => { }, device.inContextSignup); return Boolean(canAutofill); }; + /** * A map of config objects. These help by centralising here some complexity * @type {InputTypeConfig} */ - - const inputTypeConfig = { /** @type {CredentialsInputTypeConfig} */ credentials: { @@ -8793,22 +7684,18 @@ const inputTypeConfig = { device } = _ref3; if (!canBeInteractedWith(input)) return ''; - if (device.settings.featureToggles.inlineIcon_credentials) { return ddgPasswordIcons.ddgPasswordIconBase; } - return ''; }, getIconFilled: (_input, _ref4) => { let { device } = _ref4; - if (device.settings.featureToggles.inlineIcon_credentials) { return ddgPasswordIcons.ddgPasswordIconFilled; } - return ''; }, getIconAlternate: () => '', @@ -8818,27 +7705,23 @@ const inputTypeConfig = { isHybrid, device } = _ref5; - // if we are on a 'login' page, check if we have data to autofill the field if (isLogin || isHybrid) { return canBeAutofilled(input, device); - } // at this point, it's not a 'login' form, so we could offer to provide a password - + } + // at this point, it's not a 'login' form, so we could offer to provide a password if (device.settings.featureToggles.password_generation) { const subtype = (0, _matching.getInputSubtype)(input); - if (subtype === 'password') { return canBeInteractedWith(input); } } - return false; }, dataType: 'Credentials', tooltipItem: data => (0, _Credentials.createCredentialsTooltipItem)(data) }, - /** @type {CreditCardsInputTypeConfig} */ creditCards: { type: 'creditCards', @@ -8855,7 +7738,6 @@ const inputTypeConfig = { dataType: 'CreditCards', tooltipItem: data => new _CreditCard.CreditCardTooltipItem(data) }, - /** @type {IdentitiesInputTypeConfig} */ identities: { type: 'identities', @@ -8872,7 +7754,6 @@ const inputTypeConfig = { dataType: 'Identities', tooltipItem: data => new _Identity.IdentityTooltipItem(data) }, - /** @type {UnknownInputTypeConfig} */ unknown: { type: 'unknown', @@ -8887,42 +7768,37 @@ const inputTypeConfig = { } } }; + /** * Retrieves configs from an input el * @param {HTMLInputElement} input * @returns {InputTypeConfigs} */ - const getInputConfig = input => { const inputType = (0, _matching.getInputType)(input); return getInputConfigFromType(inputType); }; + /** * Retrieves configs from an input type * @param {import('./matching').SupportedTypes} inputType * @returns {InputTypeConfigs} */ - - exports.getInputConfig = getInputConfig; - const getInputConfigFromType = inputType => { const inputMainType = (0, _matching.getMainTypeFromType)(inputType); return inputTypeConfig[inputMainType]; }; + /** * Given an input field checks wheter it was previously decorated * @param {HTMLInputElement} input * @returns {Boolean} */ - - exports.getInputConfigFromType = getInputConfigFromType; - const isFieldDecorated = input => { return input.hasAttribute(_constants.constants.ATTR_INPUT_TYPE); }; - exports.isFieldDecorated = isFieldDecorated; },{"../InputTypes/Credentials.js":35,"../InputTypes/CreditCard.js":36,"../InputTypes/Identity.js":37,"../UI/img/ddgPasswordIcon.js":49,"../constants.js":54,"./logo-svg.js":30,"./matching.js":33}],29:[function(require,module,exports){ @@ -8932,10 +7808,9 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.extractElementStrings = exports.EXCLUDED_TAGS = void 0; - var _matching = require("./matching.js"); +const EXCLUDED_TAGS = exports.EXCLUDED_TAGS = ['BR', 'SCRIPT', 'NOSCRIPT', 'OPTION', 'STYLE']; -const EXCLUDED_TAGS = ['BR', 'SCRIPT', 'NOSCRIPT', 'OPTION', 'STYLE']; /** * Extract all strings of an element's children to an array. * "element.textContent" is a string which is merged of all children nodes, @@ -8946,44 +7821,32 @@ const EXCLUDED_TAGS = ['BR', 'SCRIPT', 'NOSCRIPT', 'OPTION', 'STYLE']; * @returns {string[]} * All strings in an element. */ - -exports.EXCLUDED_TAGS = EXCLUDED_TAGS; - const extractElementStrings = element => { const strings = new Set(); - const _extractElementStrings = el => { if (EXCLUDED_TAGS.includes(el.tagName)) { return; - } // only take the string when it's an explicit text node - + } + // only take the string when it's an explicit text node if (el.nodeType === el.TEXT_NODE || !el.childNodes.length) { let trimmedText = (0, _matching.removeExcessWhitespace)(el.textContent); - if (trimmedText) { strings.add(trimmedText); } - return; } - for (let node of el.childNodes) { let nodeType = node.nodeType; - if (nodeType !== node.ELEMENT_NODE && nodeType !== node.TEXT_NODE) { continue; } - _extractElementStrings(node); } }; - _extractElementStrings(element); - return [...strings]; }; - exports.extractElementStrings = extractElementStrings; },{"./matching.js":33}],30:[function(require,module,exports){ @@ -8993,12 +7856,31 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.daxGrayscaleBase64 = exports.daxBase64 = void 0; -const daxSvg = "\n\n \n \n \n \n \n \n \n \n \n \n \n\n".trim(); -const daxBase64 = "data:image/svg+xml;base64,".concat(window.btoa(daxSvg)); -exports.daxBase64 = daxBase64; -const daxGrayscaleSvg = "\n\n \n \n \n \n\n".trim(); -const daxGrayscaleBase64 = "data:image/svg+xml;base64,".concat(window.btoa(daxGrayscaleSvg)); -exports.daxGrayscaleBase64 = daxGrayscaleBase64; +const daxSvg = ` + + + + + + + + + + + + + +`.trim(); +const daxBase64 = exports.daxBase64 = `data:image/svg+xml;base64,${window.btoa(daxSvg)}`; +const daxGrayscaleSvg = ` + + + + + + +`.trim(); +const daxGrayscaleBase64 = exports.daxGrayscaleBase64 = `data:image/svg+xml;base64,${window.btoa(daxGrayscaleSvg)}`; },{}],31:[function(require,module,exports){ "use strict"; @@ -9007,11 +7889,10 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.matchingConfiguration = void 0; - /* DO NOT EDIT, this file was generated by scripts/precompile-regexes.js */ /** @type {MatchingConfiguration} */ -const matchingConfiguration = { +const matchingConfiguration = exports.matchingConfiguration = { matchers: { fields: { unknown: { @@ -9446,7 +8327,6 @@ const matchingConfiguration = { } } }; -exports.matchingConfiguration = matchingConfiguration; },{}],32:[function(require,module,exports){ "use strict"; @@ -9456,11 +8336,8 @@ Object.defineProperty(exports, "__esModule", { }); exports.logMatching = logMatching; exports.logUnmatched = logUnmatched; - var _autofillUtils = require("../autofill-utils.js"); - var _matching = require("./matching.js"); - /** * Logs out matching details when debug flag is active * @param {HTMLInputElement | HTMLSelectElement} el @@ -9478,49 +8355,44 @@ function logMatching(el, matchingResult) { matcherType } = matchingResult; const verb = getVerb(matchingResult); - let stringToLog = "".concat(verb, " for \"").concat(matcherType, "\" with \"").concat(strategyName, "\""); - + let stringToLog = `${verb} for "${matcherType}" with "${strategyName}"`; if (matchedString && matchedFrom) { - stringToLog += "\nString: \"".concat(matchedString, "\"\nSource: \"").concat(matchedFrom, "\""); + stringToLog += `\nString: "${matchedString}"\nSource: "${matchedFrom}"`; } - console.log(stringToLog); console.groupEnd(); } + /** * Helper to form the correct string based on matching result type * @param {MatchingResult} matchingResult * @return {string} */ - - function getVerb(matchingResult) { if (matchingResult.matched) return 'Matched'; if (matchingResult.proceed === false) return 'Matched forceUnknown'; if (matchingResult.skip) return 'Skipped'; return ''; } + /** * Returns a human-friendly name to identify a single input field * @param {HTMLInputElement | HTMLSelectElement} el * @returns {string} */ - - function getInputIdentifier(el) { const label = (0, _matching.getExplicitLabelsText)(el); - const placeholder = el instanceof HTMLInputElement && el.placeholder ? "".concat(el.placeholder) : ''; - const name = el.name ? "".concat(el.name) : ''; - const id = el.id ? "#".concat(el.id) : ''; + const placeholder = el instanceof HTMLInputElement && el.placeholder ? `${el.placeholder}` : ''; + const name = el.name ? `${el.name}` : ''; + const id = el.id ? `#${el.id}` : ''; return 'Field: ' + (label || placeholder || name || id); } + /** * Logs info when a field was not matched by the algo * @param el * @param allStrings */ - - function logUnmatched(el, allStrings) { if (!(0, _autofillUtils.shouldLog)()) return; const fieldIdentifier = getInputIdentifier(el); @@ -9546,140 +8418,76 @@ exports.getMainTypeFromType = getMainTypeFromType; exports.getRelatedText = void 0; exports.getSubtypeFromType = getSubtypeFromType; exports.removeExcessWhitespace = exports.matchInPlaceholderAndLabels = void 0; - var _constants = require("../constants.js"); - var _labelUtil = require("./label-util.js"); - var _compiledMatchingConfig = require("./matching-config/__generated__/compiled-matching-config.js"); - var _matchingUtils = require("./matching-utils.js"); - var _autofillUtils = require("../autofill-utils.js"); - -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - -function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); } - -function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } } - -function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); } - -function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; } - -function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; } - -function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); } - -function _classApplyDescriptorSet(receiver, descriptor, value) { if (descriptor.set) { descriptor.set.call(receiver, value); } else { if (!descriptor.writable) { throw new TypeError("attempted to set read only private field"); } descriptor.value = value; } } - const { TEXT_LENGTH_CUTOFF, ATTR_INPUT_TYPE } = _constants.constants; -/** @type {{[K in keyof MatcherLists]?: { minWidth: number }} } */ +/** @type {{[K in keyof MatcherLists]?: { minWidth: number }} } */ const dimensionBounds = { emailAddress: { minWidth: 35 } }; + /** * An abstraction around the concept of classifying input fields. * * The only state this class keeps is derived from the passed-in MatchingConfiguration. */ - -var _config = /*#__PURE__*/new WeakMap(); - -var _cssSelectors = /*#__PURE__*/new WeakMap(); - -var _ddgMatchers = /*#__PURE__*/new WeakMap(); - -var _vendorRegexRules = /*#__PURE__*/new WeakMap(); - -var _matcherLists = /*#__PURE__*/new WeakMap(); - -var _defaultStrategyOrder = /*#__PURE__*/new WeakMap(); - class Matching { /** @type {MatchingConfiguration} */ + #config; /** @type {CssSelectorConfiguration['selectors']} */ + #cssSelectors; /** @type {Record} */ + #ddgMatchers; /** * This acts as an internal cache for the larger vendorRegexes * @type {VendorRegexConfiguration['rules']} */ + #vendorRegexRules; /** @type {MatcherLists} */ + #matcherLists; /** @type {Array} */ + #defaultStrategyOrder = ['cssSelector', 'ddgMatcher', 'vendorRegex']; /** @type {Record} */ + activeElementStrings = { + nameAttr: '', + labelText: '', + placeholderAttr: '', + relatedText: '', + id: '' + }; /** * @param {MatchingConfiguration} config */ constructor(config) { - _classPrivateFieldInitSpec(this, _config, { - writable: true, - value: void 0 - }); - - _classPrivateFieldInitSpec(this, _cssSelectors, { - writable: true, - value: void 0 - }); - - _classPrivateFieldInitSpec(this, _ddgMatchers, { - writable: true, - value: void 0 - }); - - _classPrivateFieldInitSpec(this, _vendorRegexRules, { - writable: true, - value: void 0 - }); - - _classPrivateFieldInitSpec(this, _matcherLists, { - writable: true, - value: void 0 - }); - - _classPrivateFieldInitSpec(this, _defaultStrategyOrder, { - writable: true, - value: ['cssSelector', 'ddgMatcher', 'vendorRegex'] - }); - - _defineProperty(this, "activeElementStrings", { - nameAttr: '', - labelText: '', - placeholderAttr: '', - relatedText: '', - id: '' - }); - - _defineProperty(this, "_elementStringCache", new WeakMap()); - - _classPrivateFieldSet(this, _config, config); - - _classPrivateFieldSet(this, _vendorRegexRules, _classPrivateFieldGet(this, _config).strategies.vendorRegex.rules); - - _classPrivateFieldSet(this, _cssSelectors, _classPrivateFieldGet(this, _config).strategies.cssSelector.selectors); - - _classPrivateFieldSet(this, _ddgMatchers, _classPrivateFieldGet(this, _config).strategies.ddgMatcher.matchers); - - _classPrivateFieldSet(this, _matcherLists, { + this.#config = config; + this.#vendorRegexRules = this.#config.strategies.vendorRegex.rules; + this.#cssSelectors = this.#config.strategies.cssSelector.selectors; + this.#ddgMatchers = this.#config.strategies.ddgMatcher.matchers; + this.#matcherLists = { unknown: [], cc: [], id: [], password: [], username: [], emailAddress: [] - }); + }; + /** * Convert the raw config data into actual references. * @@ -9687,125 +8495,104 @@ class Matching { * * `email: [{type: "email", strategies: {cssSelector: "email", ... etc}]` */ - - - for (let [listName, matcherNames] of Object.entries(_classPrivateFieldGet(this, _config).matchers.lists)) { + for (let [listName, matcherNames] of Object.entries(this.#config.matchers.lists)) { for (let fieldName of matcherNames) { - if (!_classPrivateFieldGet(this, _matcherLists)[listName]) { - _classPrivateFieldGet(this, _matcherLists)[listName] = []; + if (!this.#matcherLists[listName]) { + this.#matcherLists[listName] = []; } - - _classPrivateFieldGet(this, _matcherLists)[listName].push(_classPrivateFieldGet(this, _config).matchers.fields[fieldName]); + this.#matcherLists[listName].push(this.#config.matchers.fields[fieldName]); } } } + /** * @param {HTMLInputElement|HTMLSelectElement} input * @param {HTMLElement} formEl */ - - setActiveElementStrings(input, formEl) { this.activeElementStrings = this.getElementStrings(input, formEl); } + /** * Try to access a 'vendor regex' by name * @param {string} regexName * @returns {RegExp | undefined} */ - - vendorRegex(regexName) { - const match = _classPrivateFieldGet(this, _vendorRegexRules)[regexName]; - + const match = this.#vendorRegexRules[regexName]; if (!match) { console.warn('Vendor Regex not found for', regexName); return undefined; } - return match; } + /** * Strategies can have different lookup names. This returns the correct one * @param {MatcherTypeNames} matcherName * @param {StrategyNames} vendorRegex * @returns {MatcherTypeNames} */ - - getStrategyLookupByType(matcherName, vendorRegex) { - var _classPrivateFieldGet2; - - return (_classPrivateFieldGet2 = _classPrivateFieldGet(this, _config).matchers.fields[matcherName]) === null || _classPrivateFieldGet2 === void 0 ? void 0 : _classPrivateFieldGet2.strategies[vendorRegex]; + return this.#config.matchers.fields[matcherName]?.strategies[vendorRegex]; } + /** * Try to access a 'css selector' by name from configuration * @param {RequiredCssSelectors | string} selectorName * @returns {string}; */ - - cssSelector(selectorName) { - const match = _classPrivateFieldGet(this, _cssSelectors)[selectorName]; - + const match = this.#cssSelectors[selectorName]; if (!match) { console.warn('CSS selector not found for %s, using a default value', selectorName); return ''; } - return match; } + /** * Try to access a 'ddg matcher' by name from configuration * @param {MatcherTypeNames | string} matcherName * @returns {DDGMatcher | undefined} */ - - ddgMatcher(matcherName) { - const match = _classPrivateFieldGet(this, _ddgMatchers)[matcherName]; - + const match = this.#ddgMatchers[matcherName]; if (!match) { console.warn('DDG matcher not found for', matcherName); return undefined; } - return match; } + /** * Returns the RegExp for the given matcherName, with proper flags * @param {AllDDGMatcherNames} matcherName * @returns {RegExp|undefined} */ - - getDDGMatcherRegex(matcherName) { const matcher = this.ddgMatcher(matcherName); - if (!matcher || !matcher.match) { console.warn('DDG matcher has unexpected format'); return undefined; } - - return matcher === null || matcher === void 0 ? void 0 : matcher.match; + return matcher?.match; } + /** * Try to access a list of matchers by name - these are the ones collected in the constructor * @param {keyof MatcherLists} listName * @return {Matcher[]} */ - - matcherList(listName) { - const matcherList = _classPrivateFieldGet(this, _matcherLists)[listName]; - + const matcherList = this.#matcherLists[listName]; if (!matcherList) { console.warn('MatcherList not found for ', listName); return []; } - return matcherList; } + /** * Convert a list of matchers into a single CSS selector. * @@ -9815,52 +8602,46 @@ class Matching { * @param {keyof MatcherLists} listName * @returns {string | undefined} */ - - joinCssSelectors(listName) { const matcherList = this.matcherList(listName); - if (!matcherList) { console.warn('Matcher list not found for', listName); return undefined; } + /** * @type {string[]} */ - - const selectors = []; - for (let matcher of matcherList) { if (matcher.strategies.cssSelector) { const css = this.cssSelector(matcher.strategies.cssSelector); - if (css) { selectors.push(css); } } } - return selectors.join(', '); } + /** * Returns true if the field is visible and large enough * @param {keyof MatcherLists} matchedType * @param {HTMLInputElement} input * @returns {boolean} */ - - isInputLargeEnough(matchedType, input) { const expectedDimensionBounds = dimensionBounds[matchedType]; if (!expectedDimensionBounds) return true; const width = input.offsetWidth; - const height = input.offsetHeight; // Ignore hidden elements as we can't determine their dimensions + const height = input.offsetHeight; + // Ignore hidden elements as we can't determine their dimensions const isHidden = height === 0 && width === 0; if (isHidden) return true; return width >= expectedDimensionBounds.minWidth; } + /** * Tries to infer the input type for an input * @@ -9869,28 +8650,23 @@ class Matching { * @param {SetInputTypeOpts} [opts] * @returns {SupportedTypes} */ - - inferInputType(input, formEl) { let opts = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; const presetType = getInputType(input); - if (presetType !== 'unknown') { return presetType; } - this.setActiveElementStrings(input, formEl); - if (this.subtypeFromMatchers('unknown', input)) return 'unknown'; // For CC forms we run aggressive matches, so we want to make sure we only - // run them on actual CC forms to avoid false positives and expensive loops + if (this.subtypeFromMatchers('unknown', input)) return 'unknown'; + // For CC forms we run aggressive matches, so we want to make sure we only + // run them on actual CC forms to avoid false positives and expensive loops if (opts.isCCForm) { const subtype = this.subtypeFromMatchers('cc', input); - if (subtype && isValidCreditCardSubtype(subtype)) { - return "creditCards.".concat(subtype); + return `creditCards.${subtype}`; } } - if (input instanceof HTMLInputElement) { if (this.subtypeFromMatchers('password', input)) { // Any other input type is likely a false match @@ -9899,7 +8675,6 @@ class Matching { return 'credentials.password'; } } - if (this.subtypeFromMatchers('emailAddress', input) && this.isInputLargeEnough('emailAddress', input)) { if (opts.isLogin || opts.isHybrid) { // TODO: Being this support back in the future @@ -9908,32 +8683,29 @@ class Matching { // if (opts.supportsIdentitiesAutofill && !opts.hasCredentials) { // return 'identities.emailAddress' // } - return 'credentials.username'; - } // TODO: Temporary hack to support Google signin in different languages - // https://app.asana.com/0/1198964220583541/1201650539303898/f + return 'credentials.username'; + } + // TODO: Temporary hack to support Google signin in different languages + // https://app.asana.com/0/1198964220583541/1201650539303898/f if (window.location.href.includes('https://accounts.google.com/v3/signin/identifier') && input.matches('[type=email][autocomplete=username]')) { return 'credentials.username'; } - return 'identities.emailAddress'; } - if (this.subtypeFromMatchers('username', input)) { return 'credentials.username'; } } - const idSubtype = this.subtypeFromMatchers('id', input); - if (idSubtype && isValidIdentitiesSubtype(idSubtype)) { - return "identities.".concat(idSubtype); + return `identities.${idSubtype}`; } - (0, _matchingUtils.logUnmatched)(input, this.activeElementStrings); return 'unknown'; } + /** * @typedef {{ * isLogin?: boolean, @@ -9951,39 +8723,31 @@ class Matching { * @param {SetInputTypeOpts} [opts] * @returns {SupportedSubTypes | string} */ - - setInputType(input, formEl) { let opts = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; const type = this.inferInputType(input, formEl, opts); input.setAttribute(ATTR_INPUT_TYPE, type); return type; } + /** * Tries to infer input subtype, with checks in decreasing order of reliability * @param {keyof MatcherLists} listName * @param {HTMLInputElement|HTMLSelectElement} el * @return {MatcherTypeNames|undefined} */ - - subtypeFromMatchers(listName, el) { const matchers = this.matcherList(listName); + /** * Loop through each strategy in order */ - - for (let strategyName of _classPrivateFieldGet(this, _defaultStrategyOrder)) { - var _result4; - + for (let strategyName of this.#defaultStrategyOrder) { let result; /** * Now loop through each matcher in the list. */ - for (let matcher of matchers) { - var _result, _result2, _result3; - /** * for each `strategyName` (such as cssSelector), check * if the current matcher implements it. @@ -9993,56 +8757,50 @@ class Matching { * Sometimes a matcher may not implement the current strategy, * so we skip it */ - if (!lookup) continue; + /** * Now perform the matching */ - if (strategyName === 'cssSelector') { result = this.execCssSelector(lookup, el); } - if (strategyName === 'ddgMatcher') { result = this.execDDGMatcher(lookup); } - if (strategyName === 'vendorRegex') { result = this.execVendorRegex(lookup); } + /** * If there's a match, return the matcher type. * * So, for example if 'username' had a `cssSelector` implemented, and * it matched the current element, then we'd return 'username' */ - - - if ((_result = result) !== null && _result !== void 0 && _result.matched) { + if (result?.matched) { (0, _matchingUtils.logMatching)(el, result); return matcher.type; } + /** * If a matcher wants to prevent all future matching on this element, * it would return { matched: false, proceed: false } */ - - - if (!((_result2 = result) !== null && _result2 !== void 0 && _result2.matched) && ((_result3 = result) === null || _result3 === void 0 ? void 0 : _result3.proceed) === false) { - (0, _matchingUtils.logMatching)(el, result); // If we get here, do not allow subsequent strategies to continue - + if (!result?.matched && result?.proceed === false) { + (0, _matchingUtils.logMatching)(el, result); + // If we get here, do not allow subsequent strategies to continue return undefined; } } - - if ((_result4 = result) !== null && _result4 !== void 0 && _result4.skip) { + if (result?.skip) { (0, _matchingUtils.logMatching)(el, result); break; } } - return undefined; } + /** * CSS selector matching just leverages the `.matches` method on elements * @@ -10050,8 +8808,6 @@ class Matching { * @param {HTMLInputElement|HTMLSelectElement} el * @returns {MatchingResult} */ - - execCssSelector(lookup, el) { const selector = this.cssSelector(lookup); return { @@ -10060,6 +8816,7 @@ class Matching { matcherType: lookup }; } + /** * A DDG Matcher can have a `match` regex along with a `not` regex. This is done * to allow it to be driven by configuration as it avoids needing to invoke custom functions. @@ -10070,8 +8827,6 @@ class Matching { * @param {MatcherTypeNames} lookup * @returns {MatchingResult} */ - - execDDGMatcher(lookup) { /** @type {MatchingResult} */ const defaultResult = { @@ -10080,46 +8835,44 @@ class Matching { matcherType: lookup }; const ddgMatcher = this.ddgMatcher(lookup); - if (!ddgMatcher || !ddgMatcher.match) { return defaultResult; } - let matchRexExp = this.getDDGMatcherRegex(lookup); - if (!matchRexExp) { return defaultResult; } - let requiredScore = ['match', 'forceUnknown', 'maxDigits'].filter(ddgMatcherProp => ddgMatcherProp in ddgMatcher).length; - /** @type {MatchableStrings[]} */ + /** @type {MatchableStrings[]} */ const matchableStrings = ddgMatcher.matchableStrings || ['labelText', 'placeholderAttr', 'relatedText']; - for (let stringName of matchableStrings) { let elementString = this.activeElementStrings[stringName]; - if (!elementString) continue; // Scoring to ensure all DDG tests are valid + if (!elementString) continue; + // Scoring to ensure all DDG tests are valid let score = 0; - /** @type {MatchingResult} */ - const result = { ...defaultResult, + /** @type {MatchingResult} */ + const result = { + ...defaultResult, matchedString: elementString, matchedFrom: stringName - }; // If a negated regex was provided, ensure it does not match - // If it DOES match - then we need to prevent any future strategies from continuing + }; + // If a negated regex was provided, ensure it does not match + // If it DOES match - then we need to prevent any future strategies from continuing if (ddgMatcher.forceUnknown) { let notRegex = ddgMatcher.forceUnknown; - if (!notRegex) { - return { ...result, + return { + ...result, matched: false }; } - if (notRegex.test(elementString)) { - return { ...result, + return { + ...result, matched: false, proceed: false }; @@ -10128,61 +8881,59 @@ class Matching { score++; } } - if (ddgMatcher.skip) { let skipRegex = ddgMatcher.skip; - if (!skipRegex) { - return { ...result, + return { + ...result, matched: false }; } - if (skipRegex.test(elementString)) { - return { ...result, + return { + ...result, matched: false, skip: true }; } - } // if the `match` regex fails, moves onto the next string - + } + // if the `match` regex fails, moves onto the next string if (!matchRexExp.test(elementString)) { continue; - } // Otherwise, increment the score - + } - score++; // If a 'maxDigits' rule was provided, validate it + // Otherwise, increment the score + score++; + // If a 'maxDigits' rule was provided, validate it if (ddgMatcher.maxDigits) { const digitLength = elementString.replace(/[^0-9]/g, '').length; - if (digitLength > ddgMatcher.maxDigits) { - return { ...result, + return { + ...result, matched: false }; } else { score++; } } - if (score === requiredScore) { - return { ...result, + return { + ...result, matched: true }; } } - return defaultResult; } + /** * If we get here, a firefox/vendor regex was given and we can execute it on the element * strings * @param {MatcherTypeNames} lookup * @return {MatchingResult} */ - - execVendorRegex(lookup) { /** @type {MatchingResult} */ const defaultResult = { @@ -10191,30 +8942,26 @@ class Matching { matcherType: lookup }; const regex = this.vendorRegex(lookup); - if (!regex) { return defaultResult; } /** @type {MatchableStrings[]} */ - - const stringsToMatch = ['placeholderAttr', 'nameAttr', 'labelText', 'id', 'relatedText']; - for (let stringName of stringsToMatch) { let elementString = this.activeElementStrings[stringName]; if (!elementString) continue; - if (regex.test(elementString)) { - return { ...defaultResult, + return { + ...defaultResult, matched: true, matchedString: elementString, matchedFrom: stringName }; } } - return defaultResult; } + /** * Yield strings in the order in which they should be checked against. * @@ -10233,16 +8980,14 @@ class Matching { * @param {HTMLElement} form * @returns {Record} */ - - + _elementStringCache = new WeakMap(); getElementStrings(el, form) { if (this._elementStringCache.has(el)) { return this._elementStringCache.get(el); } - const explicitLabelsText = getExplicitLabelsText(el); - /** @type {Record} */ + /** @type {Record} */ const next = { nameAttr: el.name, labelText: explicitLabelsText, @@ -10250,254 +8995,217 @@ class Matching { id: el.id, relatedText: explicitLabelsText ? '' : getRelatedText(el, form, this.cssSelector('formInputsSelector')) }; - this._elementStringCache.set(el, next); - return next; } - clear() { this._elementStringCache = new WeakMap(); } + /** * @param {HTMLInputElement|HTMLSelectElement} input * @param {HTMLElement} form * @returns {Matching} */ - - forInput(input, form) { this.setActiveElementStrings(input, form); return this; } + /** * @type {MatchingConfiguration} */ - - + static emptyConfig = { + matchers: { + lists: {}, + fields: {} + }, + strategies: { + 'vendorRegex': { + rules: {}, + ruleSets: [] + }, + 'ddgMatcher': { + matchers: {} + }, + 'cssSelector': { + selectors: {} + } + } + }; } + /** * @returns {SupportedTypes} */ - - exports.Matching = Matching; - -_defineProperty(Matching, "emptyConfig", { - matchers: { - lists: {}, - fields: {} - }, - strategies: { - 'vendorRegex': { - rules: {}, - ruleSets: [] - }, - 'ddgMatcher': { - matchers: {} - }, - 'cssSelector': { - selectors: {} - } - } -}); - function getInputType(input) { - const attr = input === null || input === void 0 ? void 0 : input.getAttribute(ATTR_INPUT_TYPE); - + const attr = input?.getAttribute(ATTR_INPUT_TYPE); if (isValidSupportedType(attr)) { return attr; } - return 'unknown'; } + /** * Retrieves the main type * @param {SupportedTypes | string} type * @returns {SupportedMainTypes} */ - - function getMainTypeFromType(type) { const mainType = type.split('.')[0]; - switch (mainType) { case 'credentials': case 'creditCards': case 'identities': return mainType; } - return 'unknown'; } + /** * Retrieves the input main type * @param {HTMLInputElement} input * @returns {SupportedMainTypes} */ - - const getInputMainType = input => getMainTypeFromType(getInputType(input)); -/** @typedef {supportedIdentitiesSubtypes[number]} SupportedIdentitiesSubTypes */ - +/** @typedef {supportedIdentitiesSubtypes[number]} SupportedIdentitiesSubTypes */ exports.getInputMainType = getInputMainType; -const supportedIdentitiesSubtypes = -/** @type {const} */ -['emailAddress', 'firstName', 'middleName', 'lastName', 'fullName', 'phone', 'addressStreet', 'addressStreet2', 'addressCity', 'addressProvince', 'addressPostalCode', 'addressCountryCode', 'birthdayDay', 'birthdayMonth', 'birthdayYear']; +const supportedIdentitiesSubtypes = /** @type {const} */['emailAddress', 'firstName', 'middleName', 'lastName', 'fullName', 'phone', 'addressStreet', 'addressStreet2', 'addressCity', 'addressProvince', 'addressPostalCode', 'addressCountryCode', 'birthdayDay', 'birthdayMonth', 'birthdayYear']; + /** * @param {SupportedTypes | any} supportedType * @returns {supportedType is SupportedIdentitiesSubTypes} */ - function isValidIdentitiesSubtype(supportedType) { return supportedIdentitiesSubtypes.includes(supportedType); } -/** @typedef {supportedCreditCardSubtypes[number]} SupportedCreditCardSubTypes */ +/** @typedef {supportedCreditCardSubtypes[number]} SupportedCreditCardSubTypes */ +const supportedCreditCardSubtypes = /** @type {const} */['cardName', 'cardNumber', 'cardSecurityCode', 'expirationMonth', 'expirationYear', 'expiration']; -const supportedCreditCardSubtypes = -/** @type {const} */ -['cardName', 'cardNumber', 'cardSecurityCode', 'expirationMonth', 'expirationYear', 'expiration']; /** * @param {SupportedTypes | any} supportedType * @returns {supportedType is SupportedCreditCardSubTypes} */ - function isValidCreditCardSubtype(supportedType) { return supportedCreditCardSubtypes.includes(supportedType); } -/** @typedef {supportedCredentialsSubtypes[number]} SupportedCredentialsSubTypes */ +/** @typedef {supportedCredentialsSubtypes[number]} SupportedCredentialsSubTypes */ +const supportedCredentialsSubtypes = /** @type {const} */['password', 'username']; -const supportedCredentialsSubtypes = -/** @type {const} */ -['password', 'username']; /** * @param {SupportedTypes | any} supportedType * @returns {supportedType is SupportedCredentialsSubTypes} */ - function isValidCredentialsSubtype(supportedType) { return supportedCredentialsSubtypes.includes(supportedType); } + /** @typedef {SupportedIdentitiesSubTypes | SupportedCreditCardSubTypes | SupportedCredentialsSubTypes} SupportedSubTypes */ /** @typedef {`identities.${SupportedIdentitiesSubTypes}` | `creditCards.${SupportedCreditCardSubTypes}` | `credentials.${SupportedCredentialsSubTypes}` | 'unknown'} SupportedTypes */ +const supportedTypes = [...supportedIdentitiesSubtypes.map(type => `identities.${type}`), ...supportedCreditCardSubtypes.map(type => `creditCards.${type}`), ...supportedCredentialsSubtypes.map(type => `credentials.${type}`)]; - -const supportedTypes = [...supportedIdentitiesSubtypes.map(type => "identities.".concat(type)), ...supportedCreditCardSubtypes.map(type => "creditCards.".concat(type)), ...supportedCredentialsSubtypes.map(type => "credentials.".concat(type))]; /** * Retrieves the subtype * @param {SupportedTypes | string} type * @returns {SupportedSubTypes | 'unknown'} */ - function getSubtypeFromType(type) { - const subType = type === null || type === void 0 ? void 0 : type.split('.')[1]; + const subType = type?.split('.')[1]; const validType = isValidSubtype(subType); return validType ? subType : 'unknown'; } + /** * @param {SupportedSubTypes | any} supportedSubType * @returns {supportedSubType is SupportedSubTypes} */ - - function isValidSubtype(supportedSubType) { return isValidIdentitiesSubtype(supportedSubType) || isValidCreditCardSubtype(supportedSubType) || isValidCredentialsSubtype(supportedSubType); } + /** * @param {SupportedTypes | any} supportedType * @returns {supportedType is SupportedTypes} */ - - function isValidSupportedType(supportedType) { return supportedTypes.includes(supportedType); } + /** * Retrieves the input subtype * @param {HTMLInputElement|Element} input * @returns {SupportedSubTypes | 'unknown'} */ - - function getInputSubtype(input) { const type = getInputType(input); return getSubtypeFromType(type); } + /** * Remove whitespace of more than 2 in a row and trim the string * @param {string | null} string * @return {string} */ - - const removeExcessWhitespace = function () { let string = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; if (!string) return ''; return string.replace(/\n/g, ' ').replace(/\s{2,}/g, ' ').trim(); }; + /** * Get text from all explicit labels * @param {HTMLInputElement|HTMLSelectElement} el * @return {string} */ - - exports.removeExcessWhitespace = removeExcessWhitespace; - const getExplicitLabelsText = el => { const labelTextCandidates = []; - for (let label of el.labels || []) { labelTextCandidates.push(...(0, _labelUtil.extractElementStrings)(label)); } - if (el.hasAttribute('aria-label')) { labelTextCandidates.push(removeExcessWhitespace(el.getAttribute('aria-label'))); - } // Try to access another element if it was marked as the label for this input/select - + } + // Try to access another element if it was marked as the label for this input/select const ariaLabelAttr = removeExcessWhitespace(el.getAttribute('aria-labelled') || el.getAttribute('aria-labelledby')); - if (ariaLabelAttr) { const labelledByElement = document.getElementById(ariaLabelAttr); - if (labelledByElement) { labelTextCandidates.push(...(0, _labelUtil.extractElementStrings)(labelledByElement)); } - } // Labels with long text are likely to be noisy and lead to false positives - + } + // Labels with long text are likely to be noisy and lead to false positives const filteredLabels = labelTextCandidates.filter(string => string.length < 65); - if (filteredLabels.length > 0) { return filteredLabels.join(' '); } - return ''; }; + /** * Tries to get a relevant previous Element sibling, excluding certain tags * @param {Element} el * @returns {Element|null} */ - - exports.getExplicitLabelsText = getExplicitLabelsText; - const recursiveGetPreviousElSibling = el => { const previousEl = el.previousElementSibling; - if (!previousEl) return null; // Skip elements with no childNodes + if (!previousEl) return null; + // Skip elements with no childNodes if (_labelUtil.EXCLUDED_TAGS.includes(previousEl.tagName)) { return recursiveGetPreviousElSibling(previousEl); } - return previousEl; }; + /** * Get all text close to the input (useful when no labels are defined) * @param {HTMLInputElement|HTMLSelectElement} el @@ -10505,52 +9213,46 @@ const recursiveGetPreviousElSibling = el => { * @param {string} cssSelector * @return {string} */ - - const getRelatedText = (el, form, cssSelector) => { - let scope = getLargestMeaningfulContainer(el, form, cssSelector); // If we didn't find a container, try looking for an adjacent label + let scope = getLargestMeaningfulContainer(el, form, cssSelector); + // If we didn't find a container, try looking for an adjacent label if (scope === el) { let previousEl = recursiveGetPreviousElSibling(el); - if (previousEl instanceof HTMLElement) { scope = previousEl; - } // If there is still no meaningful container return empty string - - + } + // If there is still no meaningful container return empty string if (scope === el || scope instanceof HTMLSelectElement) { if (el.previousSibling instanceof Text) { return removeExcessWhitespace(el.previousSibling.textContent); } - return ''; } - } // If there is still no meaningful container return empty string - + } + // If there is still no meaningful container return empty string if (scope === el || scope instanceof HTMLSelectElement) { if (el.previousSibling instanceof Text) { return removeExcessWhitespace(el.previousSibling.textContent); } - return ''; } - let trimmedText = ''; const label = scope.querySelector('label'); - if (label) { // Try searching for a label first trimmedText = (0, _autofillUtils.getTextShallow)(label); } else { // If the container has a select element, remove its contents to avoid noise trimmedText = (0, _labelUtil.extractElementStrings)(scope).join(' '); - } // If the text is longer than n chars it's too noisy and likely to yield false positives, so return '' - + } + // If the text is longer than n chars it's too noisy and likely to yield false positives, so return '' if (trimmedText.length < TEXT_LENGTH_CUTOFF) return trimmedText; return ''; }; + /** * Find a container for the input field that won't contain other inputs (useful to get elements related to the field) * @param {HTMLElement} el @@ -10558,23 +9260,20 @@ const getRelatedText = (el, form, cssSelector) => { * @param {string} cssSelector * @return {HTMLElement} */ - - exports.getRelatedText = getRelatedText; - const getLargestMeaningfulContainer = (el, form, cssSelector) => { /* TODO: there could be more than one select el for the same label, in that case we should change how we compute the container */ const parentElement = el.parentElement; if (!parentElement || el === form || !cssSelector) return el; - const inputsInParentsScope = parentElement.querySelectorAll(cssSelector); // To avoid noise, ensure that our input is the only in scope - + const inputsInParentsScope = parentElement.querySelectorAll(cssSelector); + // To avoid noise, ensure that our input is the only in scope if (inputsInParentsScope.length === 1) { return getLargestMeaningfulContainer(parentElement, form, cssSelector); } - return el; }; + /** * Find a regex match for a given input * @param {HTMLInputElement} input @@ -10583,13 +9282,10 @@ const getLargestMeaningfulContainer = (el, form, cssSelector) => { * @param {string} cssSelector * @returns {RegExpMatchArray|null} */ - - const matchInPlaceholderAndLabels = (input, regex, form, cssSelector) => { - var _input$placeholder; - - return ((_input$placeholder = input.placeholder) === null || _input$placeholder === void 0 ? void 0 : _input$placeholder.match(regex)) || getExplicitLabelsText(input).match(regex) || getRelatedText(input, form, cssSelector).match(regex); + return input.placeholder?.match(regex) || getExplicitLabelsText(input).match(regex) || getRelatedText(input, form, cssSelector).match(regex); }; + /** * Check if a given input matches a regex * @param {HTMLInputElement} input @@ -10598,22 +9294,17 @@ const matchInPlaceholderAndLabels = (input, regex, form, cssSelector) => { * @param {string} cssSelector * @returns {boolean} */ - - exports.matchInPlaceholderAndLabels = matchInPlaceholderAndLabels; - const checkPlaceholderAndLabels = (input, regex, form, cssSelector) => { return !!matchInPlaceholderAndLabels(input, regex, form, cssSelector); }; + /** * Factory for instances of Matching * * @return {Matching} */ - - exports.checkPlaceholderAndLabels = checkPlaceholderAndLabels; - function createMatching() { return new Matching(_compiledMatchingConfig.matchingConfiguration); } @@ -10625,11 +9316,8 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.InContextSignup = void 0; - var _deviceApiCalls = require("./deviceApiCalls/__generated__/deviceApiCalls.js"); - var _autofillUtils = require("./autofill-utils.js"); - class InContextSignup { /** * @param {import("./DeviceInterface/InterfacePrototype").default} device @@ -10637,15 +9325,12 @@ class InContextSignup { constructor(device) { this.device = device; } - async init() { await this.refreshData(); this.addNativeAccessibleGlobalFunctions(); } - addNativeAccessibleGlobalFunctions() { if (!this.device.globalConfig.hasModernWebkitAPI) return; - try { // Set up a function which can be called from the native layer after completed sign-up or sign-in. Object.defineProperty(window, 'openAutofillAfterClosingEmailProtectionTab', { @@ -10656,31 +9341,30 @@ class InContextSignup { this.openAutofillTooltip(); } }); - } catch (e) {// Ignore if function can't be set up, it's a UX enhancement not a critical flow + } catch (e) { + // Ignore if function can't be set up, it's a UX enhancement not a critical flow } } - async refreshData() { const incontextSignupDismissedAt = await this.device.deviceApi.request(new _deviceApiCalls.GetIncontextSignupDismissedAtCall(null)); this.permanentlyDismissedAt = incontextSignupDismissedAt.permanentlyDismissedAt; this.isInstalledRecently = incontextSignupDismissedAt.isInstalledRecently; } - async openAutofillTooltip() { - var _this$device$uiContro, _this$device$activeFo; - // Make sure we're working with the latest data - await this.device.refreshData(); // Make sure the tooltip is closed before we try to open it + await this.device.refreshData(); - await ((_this$device$uiContro = this.device.uiController) === null || _this$device$uiContro === void 0 ? void 0 : _this$device$uiContro.removeTooltip('stateChange')); // Make sure the input doesn't have focus so we can focus on it again + // Make sure the tooltip is closed before we try to open it + await this.device.uiController?.removeTooltip('stateChange'); - const activeInput = (_this$device$activeFo = this.device.activeForm) === null || _this$device$activeFo === void 0 ? void 0 : _this$device$activeFo.activeInput; - activeInput === null || activeInput === void 0 ? void 0 : activeInput.blur(); // Select the active input to open the tooltip + // Make sure the input doesn't have focus so we can focus on it again + const activeInput = this.device.activeForm?.activeInput; + activeInput?.blur(); + // Select the active input to open the tooltip const selectActiveInput = () => { - activeInput === null || activeInput === void 0 ? void 0 : activeInput.focus(); + activeInput?.focus(); }; - if (document.hasFocus()) { selectActiveInput(); } else { @@ -10691,17 +9375,14 @@ class InContextSignup { }); } } - isPermanentlyDismissed() { return Boolean(this.permanentlyDismissedAt); } - isOnValidDomain() { // Only show in-context signup if we've high confidence that the page is // not internally hosted or an intranet return (0, _autofillUtils.isValidTLD)() && !(0, _autofillUtils.isLocalNetwork)(); } - isAllowedByDevice() { if (typeof this.isInstalledRecently === 'boolean') { return this.isInstalledRecently; @@ -10711,43 +9392,36 @@ class InContextSignup { return true; } } + /** * @param {import('./Form/matching.js').SupportedSubTypes | "unknown"} [inputType] * @returns {boolean} */ - - isAvailable() { - var _this$device$settings, _this$device$settings2; - let inputType = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'emailAddress'; const isEmailInput = inputType === 'emailAddress'; - const isEmailProtectionEnabled = !!((_this$device$settings = this.device.settings) !== null && _this$device$settings !== void 0 && _this$device$settings.featureToggles.emailProtection); - const isIncontextSignupEnabled = !!((_this$device$settings2 = this.device.settings) !== null && _this$device$settings2 !== void 0 && _this$device$settings2.featureToggles.emailProtection_incontext_signup); + const isEmailProtectionEnabled = !!this.device.settings?.featureToggles.emailProtection; + const isIncontextSignupEnabled = !!this.device.settings?.featureToggles.emailProtection_incontext_signup; const isNotAlreadyLoggedIn = !this.device.isDeviceSignedIn(); const isNotDismissed = !this.isPermanentlyDismissed(); const isOnExpectedPage = this.device.globalConfig.isTopFrame || this.isOnValidDomain(); const isAllowedByDevice = this.isAllowedByDevice(); return isEmailInput && isEmailProtectionEnabled && isIncontextSignupEnabled && isNotAlreadyLoggedIn && isNotDismissed && isOnExpectedPage && isAllowedByDevice; } - onIncontextSignup() { this.device.deviceApi.notify(new _deviceApiCalls.StartEmailProtectionSignupCall({})); this.device.firePixel({ pixelName: 'incontext_primary_cta' }); } - onIncontextSignupDismissed() { let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : { shouldHideTooltip: true }; - if (options.shouldHideTooltip) { this.device.removeAutofillUIFromPage('Email Protection in-context signup dismissed.'); this.device.deviceApi.notify(new _deviceApiCalls.CloseAutofillParentCall(null)); } - this.permanentlyDismissedAt = new Date().getTime(); this.device.deviceApi.notify(new _deviceApiCalls.SetIncontextSignupPermanentlyDismissedAtCall({ value: this.permanentlyDismissedAt @@ -10755,20 +9429,16 @@ class InContextSignup { this.device.firePixel({ pixelName: 'incontext_dismiss_persisted' }); - } // In-context signup can be closed when displayed as a stand-alone tooltip, e.g. extension - + } + // In-context signup can be closed when displayed as a stand-alone tooltip, e.g. extension onIncontextSignupClosed() { - var _this$device$activeFo2; - - (_this$device$activeFo2 = this.device.activeForm) === null || _this$device$activeFo2 === void 0 ? void 0 : _this$device$activeFo2.dismissTooltip(); + this.device.activeForm?.dismissTooltip(); this.device.firePixel({ pixelName: 'incontext_close_x' }); } - } - exports.InContextSignup = InContextSignup; },{"./autofill-utils.js":51,"./deviceApiCalls/__generated__/deviceApiCalls.js":55}],35:[function(require,module,exports){ @@ -10781,107 +9451,55 @@ exports.PROVIDER_LOCKED = exports.AUTOGENERATED_KEY = void 0; exports.appendGeneratedKey = appendGeneratedKey; exports.createCredentialsTooltipItem = createCredentialsTooltipItem; exports.fromPassword = fromPassword; - var _autofillUtils = require("../autofill-utils.js"); +const AUTOGENERATED_KEY = exports.AUTOGENERATED_KEY = 'autogenerated'; +const PROVIDER_LOCKED = exports.PROVIDER_LOCKED = 'provider_locked'; -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - -function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); } - -function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } } - -function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); } - -function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; } - -function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; } - -function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); } - -function _classApplyDescriptorSet(receiver, descriptor, value) { if (descriptor.set) { descriptor.set.call(receiver, value); } else { if (!descriptor.writable) { throw new TypeError("attempted to set read only private field"); } descriptor.value = value; } } - -const AUTOGENERATED_KEY = 'autogenerated'; -exports.AUTOGENERATED_KEY = AUTOGENERATED_KEY; -const PROVIDER_LOCKED = 'provider_locked'; /** * @implements {TooltipItemRenderer} */ - -exports.PROVIDER_LOCKED = PROVIDER_LOCKED; - -var _data = /*#__PURE__*/new WeakMap(); - class CredentialsTooltipItem { /** @type {CredentialsObject} */ - + #data; /** @param {CredentialsObject} data */ constructor(data) { - _classPrivateFieldInitSpec(this, _data, { - writable: true, - value: void 0 - }); - - _defineProperty(this, "id", () => String(_classPrivateFieldGet(this, _data).id)); - - _defineProperty(this, "labelMedium", _subtype => { - var _classPrivateFieldGet2; - - if (_classPrivateFieldGet(this, _data).username) { - return _classPrivateFieldGet(this, _data).username; - } - - if ((_classPrivateFieldGet2 = _classPrivateFieldGet(this, _data).origin) !== null && _classPrivateFieldGet2 !== void 0 && _classPrivateFieldGet2.url) { - return "Password for ".concat((0, _autofillUtils.truncateFromMiddle)(_classPrivateFieldGet(this, _data).origin.url)); - } - - return ''; - }); - - _defineProperty(this, "labelSmall", _subtype => { - var _classPrivateFieldGet3; - - if ((_classPrivateFieldGet3 = _classPrivateFieldGet(this, _data).origin) !== null && _classPrivateFieldGet3 !== void 0 && _classPrivateFieldGet3.url) { - return (0, _autofillUtils.truncateFromMiddle)(_classPrivateFieldGet(this, _data).origin.url); - } - - return '•••••••••••••••'; - }); - - _defineProperty(this, "credentialsProvider", () => _classPrivateFieldGet(this, _data).credentialsProvider); - - _classPrivateFieldSet(this, _data, data); + this.#data = data; } - + id = () => String(this.#data.id); + labelMedium = _subtype => { + if (this.#data.username) { + return this.#data.username; + } + if (this.#data.origin?.url) { + return `Password for ${(0, _autofillUtils.truncateFromMiddle)(this.#data.origin.url)}`; + } + return ''; + }; + labelSmall = _subtype => { + if (this.#data.origin?.url) { + return (0, _autofillUtils.truncateFromMiddle)(this.#data.origin.url); + } + return '•••••••••••••••'; + }; + credentialsProvider = () => this.#data.credentialsProvider; } + /** * @implements {TooltipItemRenderer} */ - - -var _data2 = /*#__PURE__*/new WeakMap(); - class AutoGeneratedCredential { /** @type {CredentialsObject} */ - + #data; /** @param {CredentialsObject} data */ constructor(data) { - _classPrivateFieldInitSpec(this, _data2, { - writable: true, - value: void 0 - }); - - _defineProperty(this, "id", () => String(_classPrivateFieldGet(this, _data2).id)); - - _defineProperty(this, "label", _subtype => _classPrivateFieldGet(this, _data2).password); - - _defineProperty(this, "labelMedium", _subtype => 'Generated password'); - - _defineProperty(this, "labelSmall", _subtype => 'Login information will be saved for this website'); - - _classPrivateFieldSet(this, _data2, data); + this.#data = data; } - + id = () => String(this.#data.id); + label = _subtype => this.#data.password; + labelMedium = _subtype => 'Generated password'; + labelSmall = _subtype => 'Login information will be saved for this website'; } + /** * Generate a stand-in 'CredentialsObject' from a * given (generated) password. @@ -10890,8 +9508,6 @@ class AutoGeneratedCredential { * @param {string} username * @returns {CredentialsObject} */ - - function fromPassword(password, username) { return { [AUTOGENERATED_KEY]: true, @@ -10899,35 +9515,23 @@ function fromPassword(password, username) { username }; } + /** * @implements TooltipItemRenderer */ - - -var _data3 = /*#__PURE__*/new WeakMap(); - class ProviderLockedItem { /** @type {CredentialsObject} */ - + #data; /** @param {CredentialsObject} data */ constructor(data) { - _classPrivateFieldInitSpec(this, _data3, { - writable: true, - value: void 0 - }); - - _defineProperty(this, "id", () => String(_classPrivateFieldGet(this, _data3).id)); - - _defineProperty(this, "labelMedium", _subtype => 'Bitwarden is locked'); - - _defineProperty(this, "labelSmall", _subtype => 'Unlock your vault to access credentials or generate passwords'); - - _defineProperty(this, "credentialsProvider", () => _classPrivateFieldGet(this, _data3).credentialsProvider); - - _classPrivateFieldSet(this, _data3, data); + this.#data = data; } - + id = () => String(this.#data.id); + labelMedium = _subtype => 'Bitwarden is locked'; + labelSmall = _subtype => 'Unlock your vault to access credentials or generate passwords'; + credentialsProvider = () => this.#data.credentialsProvider; } + /** * If the locally generated/stored password or username ends up being the same * as submitted in a subsequent form submission - then we mark the @@ -10940,50 +9544,47 @@ class ProviderLockedItem { * @param {string|null|undefined} [autofilledFields.password] - if present, it's the last generated password * */ - - function appendGeneratedKey(data) { - var _data$credentials, _data$credentials2; - let autofilledFields = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - let autogenerated = false; // does the current password match the most recently generated one? + let autogenerated = false; - if (autofilledFields.password && ((_data$credentials = data.credentials) === null || _data$credentials === void 0 ? void 0 : _data$credentials.password) === autofilledFields.password) { + // does the current password match the most recently generated one? + if (autofilledFields.password && data.credentials?.password === autofilledFields.password) { autogenerated = true; - } // does the current username match a recently generated one? (eg: email protection) - + } - if (autofilledFields.username && ((_data$credentials2 = data.credentials) === null || _data$credentials2 === void 0 ? void 0 : _data$credentials2.username) === autofilledFields.username) { + // does the current username match a recently generated one? (eg: email protection) + if (autofilledFields.username && data.credentials?.username === autofilledFields.username) { autogenerated = true; - } // if neither username nor password were generated, don't alter the outgoing data + } + // if neither username nor password were generated, don't alter the outgoing data + if (!autogenerated) return data; - if (!autogenerated) return data; // if we get here, we're confident that something was generated + filled + // if we get here, we're confident that something was generated + filled // so we mark the credential as 'autogenerated' for the benefit of native implementations - - return { ...data, - credentials: { ...data.credentials, + return { + ...data, + credentials: { + ...data.credentials, [AUTOGENERATED_KEY]: true } }; } + /** * Factory for creating a TooltipItemRenderer * * @param {CredentialsObject} data * @returns {TooltipItemRenderer} */ - - function createCredentialsTooltipItem(data) { if (data.id === PROVIDER_LOCKED) { return new ProviderLockedItem(data); } - if (AUTOGENERATED_KEY in data && data.password) { return new AutoGeneratedCredential(data); } - return new CredentialsTooltipItem(data); } @@ -10994,49 +9595,20 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.CreditCardTooltipItem = void 0; - -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - -function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); } - -function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } } - -function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); } - -function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; } - -function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; } - -function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); } - -function _classApplyDescriptorSet(receiver, descriptor, value) { if (descriptor.set) { descriptor.set.call(receiver, value); } else { if (!descriptor.writable) { throw new TypeError("attempted to set read only private field"); } descriptor.value = value; } } - -var _data = /*#__PURE__*/new WeakMap(); - /** * @implements {TooltipItemRenderer} */ class CreditCardTooltipItem { /** @type {CreditCardObject} */ - + #data; /** @param {CreditCardObject} data */ constructor(data) { - _classPrivateFieldInitSpec(this, _data, { - writable: true, - value: void 0 - }); - - _defineProperty(this, "id", () => String(_classPrivateFieldGet(this, _data).id)); - - _defineProperty(this, "labelMedium", _ => _classPrivateFieldGet(this, _data).title); - - _defineProperty(this, "labelSmall", _ => _classPrivateFieldGet(this, _data).displayNumber); - - _classPrivateFieldSet(this, _data, data); + this.#data = data; } - + id = () => String(this.#data.id); + labelMedium = _ => this.#data.title; + labelSmall = _ => this.#data.displayNumber; } - exports.CreditCardTooltipItem = CreditCardTooltipItem; },{}],37:[function(require,module,exports){ @@ -11046,71 +9618,37 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.IdentityTooltipItem = void 0; - var _formatters = require("../Form/formatters.js"); - -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - -function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); } - -function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } } - -function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); } - -function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; } - -function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; } - -function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); } - -function _classApplyDescriptorSet(receiver, descriptor, value) { if (descriptor.set) { descriptor.set.call(receiver, value); } else { if (!descriptor.writable) { throw new TypeError("attempted to set read only private field"); } descriptor.value = value; } } - -var _data = /*#__PURE__*/new WeakMap(); - /** * @implements {TooltipItemRenderer} */ class IdentityTooltipItem { /** @type {IdentityObject} */ - + #data; /** @param {IdentityObject} data */ constructor(data) { - _classPrivateFieldInitSpec(this, _data, { - writable: true, - value: void 0 - }); - - _defineProperty(this, "id", () => String(_classPrivateFieldGet(this, _data).id)); - - _defineProperty(this, "labelMedium", subtype => { - if (subtype === 'addressCountryCode') { - return (0, _formatters.getCountryDisplayName)('en', _classPrivateFieldGet(this, _data).addressCountryCode || ''); - } - - if (_classPrivateFieldGet(this, _data).id === 'privateAddress') { - return 'Generate Private Duck Address'; - } - - return _classPrivateFieldGet(this, _data)[subtype]; - }); - - _defineProperty(this, "labelSmall", _ => { - return _classPrivateFieldGet(this, _data).title; - }); - - _classPrivateFieldSet(this, _data, data); + this.#data = data; } - + id = () => String(this.#data.id); + labelMedium = subtype => { + if (subtype === 'addressCountryCode') { + return (0, _formatters.getCountryDisplayName)('en', this.#data.addressCountryCode || ''); + } + if (this.#data.id === 'privateAddress') { + return 'Generate Private Duck Address'; + } + return this.#data[subtype]; + }; label(subtype) { - if (_classPrivateFieldGet(this, _data).id === 'privateAddress') { - return _classPrivateFieldGet(this, _data)[subtype]; + if (this.#data.id === 'privateAddress') { + return this.#data[subtype]; } - return null; } - + labelSmall = _ => { + return this.#data.title; + }; } - exports.IdentityTooltipItem = IdentityTooltipItem; },{"../Form/formatters.js":26}],38:[function(require,module,exports){ @@ -11120,69 +9658,39 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.PasswordGenerator = void 0; - var _index = require("../packages/password/index.js"); - var _rules = _interopRequireDefault(require("../packages/password/rules.json")); - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); } - -function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } } - -function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; } - -function _classApplyDescriptorSet(receiver, descriptor, value) { if (descriptor.set) { descriptor.set.call(receiver, value); } else { if (!descriptor.writable) { throw new TypeError("attempted to set read only private field"); } descriptor.value = value; } } - -function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); } - -function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); } - -function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; } - -var _previous = /*#__PURE__*/new WeakMap(); - /** * Create a password once and reuse it. */ class PasswordGenerator { - constructor() { - _classPrivateFieldInitSpec(this, _previous, { - writable: true, - value: null - }); - } + /** @type {string|null} */ + #previous = null; /** @returns {boolean} */ get generated() { - return _classPrivateFieldGet(this, _previous) !== null; + return this.#previous !== null; } - /** @returns {string|null} */ - + /** @returns {string|null} */ get password() { - return _classPrivateFieldGet(this, _previous); + return this.#previous; } - /** @param {import('../packages/password').GenerateOptions} [params] */ - + /** @param {import('../packages/password').GenerateOptions} [params] */ generate() { let params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - - if (_classPrivateFieldGet(this, _previous)) { - return _classPrivateFieldGet(this, _previous); + if (this.#previous) { + return this.#previous; } - - _classPrivateFieldSet(this, _previous, (0, _index.generate)({ ...params, + this.#previous = (0, _index.generate)({ + ...params, rules: _rules.default - })); - - return _classPrivateFieldGet(this, _previous); + }); + return this.#previous; } - } - exports.PasswordGenerator = PasswordGenerator; },{"../packages/password/index.js":7,"../packages/password/rules.json":11}],39:[function(require,module,exports){ @@ -11192,24 +9700,17 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.createScanner = createScanner; - var _Form = require("./Form/Form.js"); - var _constants = require("./constants.js"); - var _matching = require("./Form/matching.js"); - var _autofillUtils = require("./autofill-utils.js"); - var _deviceApiCalls = require("./deviceApiCalls/__generated__/deviceApiCalls.js"); - -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - const { MAX_INPUTS_PER_PAGE, MAX_FORMS_PER_PAGE, MAX_INPUTS_PER_FORM } = _constants.constants; + /** * @typedef {{ * forms: Map; @@ -11231,7 +9732,6 @@ const { */ /** @type {ScannerOptions} */ - const defaultScannerOptions = { // This buffer size is very large because it's an unexpected edge-case that // a DOM will be continually modified over and over without ever stopping. If we do see 1000 unique @@ -11248,302 +9748,225 @@ const defaultScannerOptions = { maxFormsPerPage: MAX_FORMS_PER_PAGE, maxInputsPerForm: MAX_INPUTS_PER_FORM }; + /** * This allows: * 1) synchronous DOM scanning + mutations - via `createScanner(device).findEligibleInputs(document)` * 2) or, as above + a debounced mutation observer to re-run the scan after the given time */ - class DefaultScanner { /** @type Map */ - + forms = new Map(); /** @type {any|undefined} the timer to reset */ - + debounceTimer; /** @type {Set} stored changed elements until they can be processed */ - + changedElements = new Set(); /** @type {ScannerOptions} */ - + options; /** @type {HTMLInputElement | null} */ - + activeInput = null; /** @type {boolean} A flag to indicate the whole page will be re-scanned */ - + rescanAll = false; /** @type {boolean} Indicates whether we called stopScanning */ - + stopped = false; /** @type {import("./Form/matching").Matching} matching */ + matching; /** * @param {import("./DeviceInterface/InterfacePrototype").default} device * @param {ScannerOptions} options */ constructor(device, options) { - _defineProperty(this, "forms", new Map()); - - _defineProperty(this, "debounceTimer", void 0); - - _defineProperty(this, "changedElements", new Set()); - - _defineProperty(this, "options", void 0); - - _defineProperty(this, "activeInput", null); - - _defineProperty(this, "rescanAll", false); - - _defineProperty(this, "stopped", false); - - _defineProperty(this, "matching", void 0); - - _defineProperty(this, "mutObs", new MutationObserver(mutationList => { - /** @type {HTMLElement[]} */ - if (this.rescanAll) { - // quick version if buffer full - this.enqueue([]); - return; - } - - const outgoing = []; - - for (const mutationRecord of mutationList) { - if (mutationRecord.type === 'childList') { - for (let addedNode of mutationRecord.addedNodes) { - if (!(addedNode instanceof HTMLElement)) continue; - if (addedNode.nodeName === 'DDG-AUTOFILL') continue; - outgoing.push(addedNode); - } - } - } - - this.enqueue(outgoing); - })); - this.device = device; this.matching = (0, _matching.createMatching)(); this.options = options; /** @type {number} A timestamp of the */ - this.initTimeStamp = Date.now(); } + /** * Determine whether we should fire the credentials autoprompt. This is needed because some sites are blank * on page load and load scripts asynchronously, so our initial scan didn't set the autoprompt correctly * @returns {boolean} */ - - get shouldAutoprompt() { return Date.now() - this.initTimeStamp <= 1500; } + /** * Call this to scan once and then watch for changes. * * Call the returned function to remove listeners. * @returns {(reason: string, ...rest) => void} */ - - init() { var _this = this; - if (this.device.globalConfig.isExtension) { this.device.deviceApi.notify(new _deviceApiCalls.AddDebugFlagCall({ flag: 'autofill' })); } - - const delay = this.options.initialDelay; // if the delay is zero, (chrome/firefox etc) then use `requestIdleCallback` - + const delay = this.options.initialDelay; + // if the delay is zero, (chrome/firefox etc) then use `requestIdleCallback` if (delay === 0) { window.requestIdleCallback(() => this.scanAndObserve()); } else { // otherwise, use the delay time to defer the initial scan setTimeout(() => this.scanAndObserve(), delay); } - return function (reason) { for (var _len = arguments.length, rest = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { rest[_key - 1] = arguments[_key]; } - _this.stopScanner(reason, ...rest); }; } + /** * Scan the page and begin observing changes */ - - scanAndObserve() { - var _window$performance, _window$performance$m, _window$performance2, _window$performance2$; - - (_window$performance = window.performance) === null || _window$performance === void 0 ? void 0 : (_window$performance$m = _window$performance.mark) === null || _window$performance$m === void 0 ? void 0 : _window$performance$m.call(_window$performance, 'initial_scanner:init:start'); + window.performance?.mark?.('initial_scanner:init:start'); this.findEligibleInputs(document); - (_window$performance2 = window.performance) === null || _window$performance2 === void 0 ? void 0 : (_window$performance2$ = _window$performance2.mark) === null || _window$performance2$ === void 0 ? void 0 : _window$performance2$.call(_window$performance2, 'initial_scanner:init:end'); + window.performance?.mark?.('initial_scanner:init:end'); (0, _autofillUtils.logPerformance)('initial_scanner'); this.mutObs.observe(document.documentElement, { childList: true, subtree: true }); } + /** * @param context */ - - findEligibleInputs(context) { - var _context$matches; - // Avoid autofill on Email Protection web app if (this.device.globalConfig.isDDGDomain) { return this; } - - if ('matches' in context && (_context$matches = context.matches) !== null && _context$matches !== void 0 && _context$matches.call(context, this.matching.cssSelector('formInputsSelector'))) { + if ('matches' in context && context.matches?.(this.matching.cssSelector('formInputsSelector'))) { this.addInput(context); } else { const inputs = context.querySelectorAll(this.matching.cssSelector('formInputsSelector')); - if (inputs.length > this.options.maxInputsPerPage) { this.stopScanner('Too many input fields in the given context, stop scanning', context); return this; } - inputs.forEach(input => this.addInput(input)); } - return this; } + /** * Stops scanning, switches off the mutation observer and clears all forms * @param {string} reason * @param {...any} rest */ - - stopScanner(reason) { - var _this$device$activeFo; - this.stopped = true; - if ((0, _autofillUtils.shouldLog)()) { for (var _len2 = arguments.length, rest = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { rest[_key2 - 1] = arguments[_key2]; } - console.log(reason, ...rest); } + const activeInput = this.device.activeForm?.activeInput; - const activeInput = (_this$device$activeFo = this.device.activeForm) === null || _this$device$activeFo === void 0 ? void 0 : _this$device$activeFo.activeInput; // remove Dax, listeners, timers, and observers - + // remove Dax, listeners, timers, and observers clearTimeout(this.debounceTimer); this.changedElements.clear(); this.mutObs.disconnect(); this.forms.forEach(form => { form.destroy(); }); - this.forms.clear(); // Bring the user back to the input they were interacting with + this.forms.clear(); - activeInput === null || activeInput === void 0 ? void 0 : activeInput.focus(); + // Bring the user back to the input they were interacting with + activeInput?.focus(); } + /** * @param {HTMLElement|HTMLInputElement|HTMLSelectElement} input * @returns {HTMLFormElement|HTMLElement} */ - - getParentForm(input) { if (input instanceof HTMLInputElement || input instanceof HTMLSelectElement) { if (input.form) { // Use input.form unless it encloses most of the DOM // In that case we proceed to identify more precise wrappers - if (this.forms.has(input.form) || // If we've added the form we've already checked that it's not a page wrapper + if (this.forms.has(input.form) || + // If we've added the form we've already checked that it's not a page wrapper !(0, _autofillUtils.isFormLikelyToBeUsedAsPageWrapper)(input.form)) { return input.form; } } } - - let element = input; // traverse the DOM to search for related inputs - + let element = input; + // traverse the DOM to search for related inputs while (element.parentElement && element.parentElement !== document.documentElement) { - var _element$parentElemen; - // Avoid overlapping containers or forms - const siblingForm = (_element$parentElemen = element.parentElement) === null || _element$parentElemen === void 0 ? void 0 : _element$parentElemen.querySelector('form'); - + const siblingForm = element.parentElement?.querySelector('form'); if (siblingForm && siblingForm !== element) { return element; } - element = element.parentElement; const inputs = element.querySelectorAll(this.matching.cssSelector('formInputsSelector')); - const buttons = element.querySelectorAll(this.matching.cssSelector('submitButtonSelector')); // If we find a button or another input, we assume that's our form - + const buttons = element.querySelectorAll(this.matching.cssSelector('submitButtonSelector')); + // If we find a button or another input, we assume that's our form if (inputs.length > 1 || buttons.length) { // found related input, return common ancestor return element; } } - return input; } + /** * @param {HTMLInputElement|HTMLSelectElement} input */ - - addInput(input) { if (this.stopped) return; const parentForm = this.getParentForm(input); - if (parentForm instanceof HTMLFormElement && this.forms.has(parentForm)) { - var _this$forms$get; - // We've met the form, add the input - (_this$forms$get = this.forms.get(parentForm)) === null || _this$forms$get === void 0 ? void 0 : _this$forms$get.addInput(input); + this.forms.get(parentForm)?.addInput(input); return; - } // Check if the forms we've seen are either disconnected, - // or are parent/child of the currently-found form - + } + // Check if the forms we've seen are either disconnected, + // or are parent/child of the currently-found form let previouslyFoundParent, childForm; - for (const [formEl] of this.forms) { // Remove disconnected forms to avoid leaks if (!formEl.isConnected) { this.forms.delete(formEl); continue; } - if (formEl.contains(parentForm)) { previouslyFoundParent = formEl; break; } - if (parentForm.contains(formEl)) { childForm = formEl; break; } } - if (previouslyFoundParent) { if (parentForm instanceof HTMLFormElement && parentForm !== previouslyFoundParent) { // If we had a prior parent but this is an explicit form, the previous was a false positive this.forms.delete(previouslyFoundParent); } else { - var _this$forms$get2; - // If we've already met the form or a descendant, add the input - (_this$forms$get2 = this.forms.get(previouslyFoundParent)) === null || _this$forms$get2 === void 0 ? void 0 : _this$forms$get2.addInput(input); + this.forms.get(previouslyFoundParent)?.addInput(input); } } else { // if this form is an ancestor of an existing form, remove that before adding this if (childForm) { - var _this$forms$get3; - - (_this$forms$get3 = this.forms.get(childForm)) === null || _this$forms$get3 === void 0 ? void 0 : _this$forms$get3.destroy(); + this.forms.get(childForm)?.destroy(); this.forms.delete(childForm); - } // Only add the form if below the limit of forms per page - + } + // Only add the form if below the limit of forms per page if (this.forms.size < this.options.maxFormsPerPage) { this.forms.set(parentForm, new _Form.Form(parentForm, input, this.device, this.matching, this.shouldAutoprompt)); } else { @@ -11551,14 +9974,13 @@ class DefaultScanner { } } } + /** * enqueue elements to be re-scanned after the given * amount of time has elapsed. * * @param {(HTMLElement|Document)[]} htmlElements */ - - enqueue(htmlElements) { // if the buffer limit is reached, stop trying to track elements and process body instead. if (this.changedElements.size >= this.options.bufferSize) { @@ -11570,53 +9992,66 @@ class DefaultScanner { this.changedElements.add(element); } } - clearTimeout(this.debounceTimer); this.debounceTimer = setTimeout(() => { - var _window$performance3, _window$performance3$, _window$performance4, _window$performance4$; - - (_window$performance3 = window.performance) === null || _window$performance3 === void 0 ? void 0 : (_window$performance3$ = _window$performance3.mark) === null || _window$performance3$ === void 0 ? void 0 : _window$performance3$.call(_window$performance3, 'scanner:init:start'); + window.performance?.mark?.('scanner:init:start'); this.processChangedElements(); this.changedElements.clear(); this.rescanAll = false; - (_window$performance4 = window.performance) === null || _window$performance4 === void 0 ? void 0 : (_window$performance4$ = _window$performance4.mark) === null || _window$performance4$ === void 0 ? void 0 : _window$performance4$.call(_window$performance4, 'scanner:init:end'); + window.performance?.mark?.('scanner:init:end'); (0, _autofillUtils.logPerformance)('scanner'); }, this.options.debounceTimePeriod); } + /** * re-scan the changed elements, but only if they * are still present in the DOM */ - - processChangedElements() { if (this.rescanAll) { this.findEligibleInputs(document); return; } - for (let element of this.changedElements) { if (element.isConnected) { this.findEligibleInputs(element); } } } + /** * Watch for changes in the DOM, and enqueue elements to be scanned * @type {MutationObserver} */ - - + mutObs = new MutationObserver(mutationList => { + /** @type {HTMLElement[]} */ + if (this.rescanAll) { + // quick version if buffer full + this.enqueue([]); + return; + } + const outgoing = []; + for (const mutationRecord of mutationList) { + if (mutationRecord.type === 'childList') { + for (let addedNode of mutationRecord.addedNodes) { + if (!(addedNode instanceof HTMLElement)) continue; + if (addedNode.nodeName === 'DDG-AUTOFILL') continue; + outgoing.push(addedNode); + } + } + } + this.enqueue(outgoing); + }); } + /** * @param {import("./DeviceInterface/InterfacePrototype").default} device * @param {Partial} [scannerOptions] * @returns {Scanner} */ - - function createScanner(device, scannerOptions) { - return new DefaultScanner(device, { ...defaultScannerOptions, + return new DefaultScanner(device, { + ...defaultScannerOptions, ...scannerOptions }); } @@ -11628,19 +10063,11 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.Settings = void 0; - var _index = require("../packages/device-api/index.js"); - var _deviceApiCalls = require("./deviceApiCalls/__generated__/deviceApiCalls.js"); - var _validatorsZod = require("./deviceApiCalls/__generated__/validators.zod.js"); - var _autofillUtils = require("./autofill-utils.js"); - var _appleUtils = require("@duckduckgo/content-scope-scripts/src/apple-utils"); - -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - /** * Some Type helpers to prevent duplication * @typedef {import("./deviceApiCalls/__generated__/validators-ts").AutofillFeatureToggles} AutofillFeatureToggles @@ -11661,37 +10088,27 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope */ class Settings { /** @type {GlobalConfig} */ - + globalConfig; /** @type {DeviceApi} */ - + deviceApi; /** @type {AutofillFeatureToggles | null} */ - + _featureToggles = null; /** @type {AvailableInputTypes | null} */ - + _availableInputTypes = null; /** @type {RuntimeConfiguration | null | undefined} */ - + _runtimeConfiguration = null; /** @type {boolean | null} */ + _enabled = null; /** * @param {GlobalConfig} config * @param {DeviceApi} deviceApi */ constructor(config, deviceApi) { - _defineProperty(this, "globalConfig", void 0); - - _defineProperty(this, "deviceApi", void 0); - - _defineProperty(this, "_featureToggles", null); - - _defineProperty(this, "_availableInputTypes", null); - - _defineProperty(this, "_runtimeConfiguration", null); - - _defineProperty(this, "_enabled", null); - this.deviceApi = deviceApi; this.globalConfig = config; } + /** * Feature toggles are delivered as part of the Runtime Configuration - a flexible design that * allows data per user + remote config to be accessed together. @@ -11704,32 +10121,26 @@ class Settings { * * @returns {Promise} */ - - async getFeatureToggles() { try { - var _runtimeConfig$userPr, _runtimeConfig$userPr2, _runtimeConfig$userPr3; - const runtimeConfig = await this._getRuntimeConfiguration(); - const autofillSettings = (0, _index.validate)((_runtimeConfig$userPr = runtimeConfig.userPreferences) === null || _runtimeConfig$userPr === void 0 ? void 0 : (_runtimeConfig$userPr2 = _runtimeConfig$userPr.features) === null || _runtimeConfig$userPr2 === void 0 ? void 0 : (_runtimeConfig$userPr3 = _runtimeConfig$userPr2.autofill) === null || _runtimeConfig$userPr3 === void 0 ? void 0 : _runtimeConfig$userPr3.settings, _validatorsZod.autofillSettingsSchema); + const autofillSettings = (0, _index.validate)(runtimeConfig.userPreferences?.features?.autofill?.settings, _validatorsZod.autofillSettingsSchema); return autofillSettings.featureToggles; } catch (e) { // these are the fallbacks for when a platform hasn't implemented the calls above. if (this.globalConfig.isDDGTestMode) { console.log('isDDGTestMode: getFeatureToggles: ❌', e); } - return Settings.defaults.featureToggles; } } + /** * If the platform in question is happy to derive it's 'enabled' state from the RuntimeConfiguration, * then they should use this. Currently only Windows supports this, but we aim to move all platforms to * support this going forward. * @returns {Promise} */ - - async getEnabled() { try { const runtimeConfig = await this._getRuntimeConfiguration(); @@ -11740,10 +10151,10 @@ class Settings { if (this.globalConfig.isDDGTestMode) { console.log('isDDGTestMode: getFeatureToggles: ❌', e); } - return null; } } + /** * Get runtime configuration, but only once. * @@ -11757,22 +10168,19 @@ class Settings { * @throws * @private */ - - async _getRuntimeConfiguration() { if (this._runtimeConfiguration) return this._runtimeConfiguration; const runtimeConfig = await this.deviceApi.request(new _deviceApiCalls.GetRuntimeConfigurationCall(null)); this._runtimeConfiguration = runtimeConfig; return this._runtimeConfiguration; } + /** * Available Input Types are boolean indicators to represent which input types the * current **user** has data available for. * * @returns {Promise} */ - - async getAvailableInputTypes() { try { return await this.deviceApi.request(new _deviceApiCalls.GetAvailableInputTypesCall(null)); @@ -11780,10 +10188,10 @@ class Settings { if (this.globalConfig.isDDGTestMode) { console.log('isDDGTestMode: getAvailableInputTypes: ❌', e); } - return Settings.defaults.availableInputTypes; } } + /** * To 'refresh' settings means to re-call APIs to determine new state. This may * only occur once per page, but it must be done before any page scanning/decorating can happen @@ -11794,25 +10202,24 @@ class Settings { * enabled: boolean | null * }>} */ - - async refresh() { this.setEnabled(await this.getEnabled()); this.setFeatureToggles(await this.getFeatureToggles()); - this.setAvailableInputTypes(await this.getAvailableInputTypes()); // If 'this.enabled' is a boolean it means we were able to set it correctly and therefor respect its value + this.setAvailableInputTypes(await this.getAvailableInputTypes()); + // If 'this.enabled' is a boolean it means we were able to set it correctly and therefor respect its value if (typeof this.enabled === 'boolean') { if (!this.enabled) { return Settings.defaults; } } - return { featureToggles: this.featureToggles, availableInputTypes: this.availableInputTypes, enabled: this.enabled }; } + /** * Checks if input type is one which we can't autofill * @param {{ @@ -11821,31 +10228,27 @@ class Settings { * }} types * @returns {boolean} */ - - isTypeUnavailable(_ref) { let { mainType, subtype } = _ref; if (mainType === 'unknown') return true; - - if (!this.featureToggles["inputType_".concat(mainType)] && subtype !== 'emailAddress') { + if (!this.featureToggles[`inputType_${mainType}`] && subtype !== 'emailAddress') { return true; } - return false; } + /** * Requests data from remote * @returns {Promise<>} */ - - async populateData() { const availableInputTypesFromRemote = await this.getAvailableInputTypes(); this.setAvailableInputTypes(availableInputTypesFromRemote); } + /** * Requests data from remote if not available * @param {{ @@ -11854,11 +10257,7 @@ class Settings { * }} types * @returns {Promise} */ - - async populateDataIfNeeded(_ref2) { - var _this$availableInputT; - let { mainType, subtype @@ -11867,14 +10266,13 @@ class Settings { mainType, subtype })) return false; - - if (((_this$availableInputT = this.availableInputTypes) === null || _this$availableInputT === void 0 ? void 0 : _this$availableInputT[mainType]) === undefined) { + if (this.availableInputTypes?.[mainType] === undefined) { await this.populateData(); return true; } - return false; } + /** * Checks if items will show in the autofill menu, including in-context signup. * Triggers side-effect if input types is not already available. @@ -11885,11 +10283,7 @@ class Settings { * @param {import("./InContextSignup.js").InContextSignup?} inContextSignup * @returns {boolean} */ - - canAutofillType(_ref3, inContextSignup) { - var _this$availableInputT6; - let { mainType, subtype @@ -11897,135 +10291,116 @@ class Settings { if (this.isTypeUnavailable({ mainType, subtype - })) return false; // If it's an email field and Email Protection is enabled, return true regardless of other options + })) return false; + // If it's an email field and Email Protection is enabled, return true regardless of other options const isEmailProtectionEnabled = this.featureToggles.emailProtection && this.availableInputTypes.email; - if (subtype === 'emailAddress' && isEmailProtectionEnabled) { return true; } - - if (inContextSignup !== null && inContextSignup !== void 0 && inContextSignup.isAvailable(subtype)) { + if (inContextSignup?.isAvailable(subtype)) { return true; } - if (subtype === 'fullName') { - var _this$availableInputT2, _this$availableInputT3; - - return Boolean(((_this$availableInputT2 = this.availableInputTypes.identities) === null || _this$availableInputT2 === void 0 ? void 0 : _this$availableInputT2.firstName) || ((_this$availableInputT3 = this.availableInputTypes.identities) === null || _this$availableInputT3 === void 0 ? void 0 : _this$availableInputT3.lastName)); + return Boolean(this.availableInputTypes.identities?.firstName || this.availableInputTypes.identities?.lastName); } - if (subtype === 'expiration') { - var _this$availableInputT4, _this$availableInputT5; - - return Boolean(((_this$availableInputT4 = this.availableInputTypes.creditCards) === null || _this$availableInputT4 === void 0 ? void 0 : _this$availableInputT4.expirationMonth) || ((_this$availableInputT5 = this.availableInputTypes.creditCards) === null || _this$availableInputT5 === void 0 ? void 0 : _this$availableInputT5.expirationYear)); + return Boolean(this.availableInputTypes.creditCards?.expirationMonth || this.availableInputTypes.creditCards?.expirationYear); } - - return Boolean((_this$availableInputT6 = this.availableInputTypes[mainType]) === null || _this$availableInputT6 === void 0 ? void 0 : _this$availableInputT6[subtype]); + return Boolean(this.availableInputTypes[mainType]?.[subtype]); } - /** @returns {AutofillFeatureToggles} */ - + /** @returns {AutofillFeatureToggles} */ get featureToggles() { if (this._featureToggles === null) throw new Error('feature toggles accessed before being set'); return this._featureToggles; } - /** @param {AutofillFeatureToggles} input */ - + /** @param {AutofillFeatureToggles} input */ setFeatureToggles(input) { this._featureToggles = input; } - /** @returns {AvailableInputTypes} */ - + /** @returns {AvailableInputTypes} */ get availableInputTypes() { if (this._availableInputTypes === null) throw new Error('available input types accessed before being set'); return this._availableInputTypes; } - /** @param {AvailableInputTypes} value */ - + /** @param {AvailableInputTypes} value */ setAvailableInputTypes(value) { - this._availableInputTypes = { ...this._availableInputTypes, + this._availableInputTypes = { + ...this._availableInputTypes, ...value }; } - + static defaults = { + /** @type {AutofillFeatureToggles} */ + featureToggles: { + credentials_saving: false, + password_generation: false, + emailProtection: false, + emailProtection_incontext_signup: false, + inputType_identities: false, + inputType_credentials: false, + inputType_creditCards: false, + inlineIcon_credentials: false + }, + /** @type {AvailableInputTypes} */ + availableInputTypes: { + credentials: { + username: false, + password: false + }, + identities: { + firstName: false, + middleName: false, + lastName: false, + birthdayDay: false, + birthdayMonth: false, + birthdayYear: false, + addressStreet: false, + addressStreet2: false, + addressCity: false, + addressProvince: false, + addressPostalCode: false, + addressCountryCode: false, + phone: false, + emailAddress: false + }, + creditCards: { + cardName: false, + cardSecurityCode: false, + expirationMonth: false, + expirationYear: false, + cardNumber: false + }, + email: false + }, + /** @type {boolean | null} */ + enabled: null + }; static default(globalConfig, deviceApi) { const settings = new Settings(globalConfig, deviceApi); settings.setFeatureToggles(Settings.defaults.featureToggles); settings.setAvailableInputTypes(Settings.defaults.availableInputTypes); return settings; } - /** @returns {boolean|null} */ - + /** @returns {boolean|null} */ get enabled() { return this._enabled; } + /** * @param {boolean|null} enabled */ - - setEnabled(enabled) { this._enabled = enabled; } - } - exports.Settings = Settings; -_defineProperty(Settings, "defaults", { - /** @type {AutofillFeatureToggles} */ - featureToggles: { - credentials_saving: false, - password_generation: false, - emailProtection: false, - emailProtection_incontext_signup: false, - inputType_identities: false, - inputType_credentials: false, - inputType_creditCards: false, - inlineIcon_credentials: false - }, - - /** @type {AvailableInputTypes} */ - availableInputTypes: { - credentials: { - username: false, - password: false - }, - identities: { - firstName: false, - middleName: false, - lastName: false, - birthdayDay: false, - birthdayMonth: false, - birthdayYear: false, - addressStreet: false, - addressStreet2: false, - addressCity: false, - addressProvince: false, - addressPostalCode: false, - addressCountryCode: false, - phone: false, - emailAddress: false - }, - creditCards: { - cardName: false, - cardSecurityCode: false, - expirationMonth: false, - expirationYear: false, - cardNumber: false - }, - email: false - }, - - /** @type {boolean | null} */ - enabled: null -}); - },{"../packages/device-api/index.js":2,"./autofill-utils.js":51,"./deviceApiCalls/__generated__/deviceApiCalls.js":55,"./deviceApiCalls/__generated__/validators.zod.js":56,"@duckduckgo/content-scope-scripts/src/apple-utils":1}],41:[function(require,module,exports){ "use strict"; @@ -12033,21 +10408,29 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; - var _autofillUtils = require("../autofill-utils.js"); - var _HTMLTooltip = _interopRequireDefault(require("./HTMLTooltip.js")); - var _Credentials = require("../InputTypes/Credentials.js"); - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - class DataHTMLTooltip extends _HTMLTooltip.default { renderEmailProtectionIncontextSignup(isOtherItems) { - const dataTypeClass = "tooltip__button--data--identities"; + const dataTypeClass = `tooltip__button--data--identities`; const providerIconClass = 'tooltip__button--data--duckduckgo'; - return "\n ".concat(isOtherItems ? '
    ' : '', "\n \n "); + return ` + ${isOtherItems ? '
    ' : ''} + + `; } + /** * @param {InputTypeConfigs} config * @param {TooltipItemRenderer[]} items @@ -12060,38 +10443,58 @@ class DataHTMLTooltip extends _HTMLTooltip.default { * onIncontextSignup?(): void * }} callbacks */ - - render(config, items, callbacks) { const { wrapperClass, css } = this.options; - const isTopAutofill = wrapperClass === null || wrapperClass === void 0 ? void 0 : wrapperClass.includes('top-autofill'); - let hasAddedSeparator = false; // Only show an hr above the first duck address button, but it can be either personal or private - + const isTopAutofill = wrapperClass?.includes('top-autofill'); + let hasAddedSeparator = false; + // Only show an hr above the first duck address button, but it can be either personal or private const shouldShowSeparator = (dataId, index) => { const shouldShow = ['personalAddress', 'privateAddress'].includes(dataId) && !hasAddedSeparator; - if (shouldShow) hasAddedSeparator = true; // Don't show the separator if we want to show it, but it's unnecessary as the first item in the menu + if (shouldShow) hasAddedSeparator = true; + // Don't show the separator if we want to show it, but it's unnecessary as the first item in the menu const isFirst = index === 0; return shouldShow && !isFirst; - }; // Only show manage Manage… when it's topAutofill, the provider is unlocked, and it's not just EmailProtection - + }; + // Only show manage Manage… when it's topAutofill, the provider is unlocked, and it's not just EmailProtection const shouldShowManageButton = isTopAutofill && items.some(item => !['personalAddress', 'privateAddress', _Credentials.PROVIDER_LOCKED].includes(item.id())); const topClass = wrapperClass || ''; - const dataTypeClass = "tooltip__button--data--".concat(config.type); - this.shadow.innerHTML = "\n".concat(css, "\n"); + const dataTypeClass = `tooltip__button--data--${config.type}`; + this.shadow.innerHTML = ` +${css} +`; this.wrapper = this.shadow.querySelector('.wrapper'); this.tooltip = this.shadow.querySelector('.tooltip'); this.autofillButtons = this.shadow.querySelectorAll('.js-autofill-button'); @@ -12106,34 +10509,25 @@ class DataHTMLTooltip extends _HTMLTooltip.default { }); }); this.manageButton = this.shadow.getElementById('manage-button'); - if (this.manageButton) { this.registerClickableButton(this.manageButton, () => { callbacks.onManage(config.type); }); } - const getIncontextSignup = this.shadow.querySelector('.js-get-email-signup'); - if (getIncontextSignup) { this.registerClickableButton(getIncontextSignup, () => { - var _callbacks$onIncontex, _callbacks$onIncontex2; - - (_callbacks$onIncontex = callbacks.onIncontextSignupDismissed) === null || _callbacks$onIncontex === void 0 ? void 0 : _callbacks$onIncontex.call(callbacks, { + callbacks.onIncontextSignupDismissed?.({ hasOtherOptions: items.length > 0 }); - (_callbacks$onIncontex2 = callbacks.onIncontextSignup) === null || _callbacks$onIncontex2 === void 0 ? void 0 : _callbacks$onIncontex2.call(callbacks); + callbacks.onIncontextSignup?.(); }); } - this.init(); return this; } - } - -var _default = DataHTMLTooltip; -exports.default = _default; +var _default = exports.default = DataHTMLTooltip; },{"../InputTypes/Credentials.js":35,"../autofill-utils.js":51,"./HTMLTooltip.js":44}],42:[function(require,module,exports){ "use strict"; @@ -12142,13 +10536,9 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; - var _autofillUtils = require("../autofill-utils.js"); - var _HTMLTooltip = _interopRequireDefault(require("./HTMLTooltip.js")); - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - class EmailHTMLTooltip extends _HTMLTooltip.default { /** * @param {import("../DeviceInterface/InterfacePrototype").default} device @@ -12156,20 +10546,34 @@ class EmailHTMLTooltip extends _HTMLTooltip.default { render(device) { this.device = device; this.addresses = device.getLocalAddresses(); - this.shadow.innerHTML = "\n".concat(this.options.css, "\n"); + this.shadow.innerHTML = ` +${this.options.css} +`; this.wrapper = this.shadow.querySelector('.wrapper'); this.tooltip = this.shadow.querySelector('.tooltip'); this.usePersonalButton = this.shadow.querySelector('.js-use-personal'); this.usePrivateButton = this.shadow.querySelector('.js-use-private'); this.addressEl = this.shadow.querySelector('.js-address'); - this.updateAddresses = addresses => { if (addresses && this.addressEl) { this.addresses = addresses; this.addressEl.textContent = (0, _autofillUtils.formatDuckAddress)(addresses.personalAddress); } }; - const firePixel = this.device.firePixel.bind(this.device); this.registerClickableButton(this.usePersonalButton, () => { this.fillForm('personalAddress'); @@ -12182,8 +10586,9 @@ class EmailHTMLTooltip extends _HTMLTooltip.default { firePixel({ pixelName: 'autofill_private_address' }); - }); // Get the alias from the extension + }); + // Get the alias from the extension this.device.getAddresses().then(this.updateAddresses); this.init(); return this; @@ -12191,23 +10596,16 @@ class EmailHTMLTooltip extends _HTMLTooltip.default { /** * @param {'personalAddress' | 'privateAddress'} id */ - - async fillForm(id) { - var _this$device; - const address = this.addresses[id]; const formattedAddress = (0, _autofillUtils.formatDuckAddress)(address); - (_this$device = this.device) === null || _this$device === void 0 ? void 0 : _this$device.selectedDetail({ + this.device?.selectedDetail({ email: formattedAddress, id }, 'email'); } - } - -var _default = EmailHTMLTooltip; -exports.default = _default; +var _default = exports.default = EmailHTMLTooltip; },{"../autofill-utils.js":51,"./HTMLTooltip.js":44}],43:[function(require,module,exports){ "use strict"; @@ -12216,45 +10614,54 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; - var _HTMLTooltip = _interopRequireDefault(require("./HTMLTooltip.js")); - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - class EmailSignupHTMLTooltip extends _HTMLTooltip.default { /** * @param {import("../DeviceInterface/InterfacePrototype").default} device */ render(device) { this.device = device; - this.shadow.innerHTML = "\n".concat(this.options.css, "\n"); + this.shadow.innerHTML = ` +${this.options.css} +`; this.tooltip = this.shadow.querySelector('.tooltip'); this.closeEmailSignup = this.shadow.querySelector('.js-close-email-signup'); this.registerClickableButton(this.closeEmailSignup, () => { - var _device$inContextSign; - - (_device$inContextSign = device.inContextSignup) === null || _device$inContextSign === void 0 ? void 0 : _device$inContextSign.onIncontextSignupClosed(); + device.inContextSignup?.onIncontextSignupClosed(); }); this.dismissEmailSignup = this.shadow.querySelector('.js-dismiss-email-signup'); this.registerClickableButton(this.dismissEmailSignup, () => { - var _device$inContextSign2; - - (_device$inContextSign2 = device.inContextSignup) === null || _device$inContextSign2 === void 0 ? void 0 : _device$inContextSign2.onIncontextSignupDismissed(); + device.inContextSignup?.onIncontextSignupDismissed(); }); this.getEmailSignup = this.shadow.querySelector('.js-get-email-signup'); this.registerClickableButton(this.getEmailSignup, () => { - var _device$inContextSign3; - - (_device$inContextSign3 = device.inContextSignup) === null || _device$inContextSign3 === void 0 ? void 0 : _device$inContextSign3.onIncontextSignup(); + device.inContextSignup?.onIncontextSignup(); }); this.init(); return this; } - } - -var _default = EmailSignupHTMLTooltip; -exports.default = _default; +var _default = exports.default = EmailSignupHTMLTooltip; },{"./HTMLTooltip.js":44}],44:[function(require,module,exports){ "use strict"; @@ -12263,15 +10670,9 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.defaultOptions = exports.default = exports.HTMLTooltip = void 0; - var _autofillUtils = require("../autofill-utils.js"); - var _matching = require("../Form/matching.js"); - var _styles = require("./styles/styles.js"); - -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - /** * @typedef {object} HTMLTooltipOptions * @property {boolean} testMode @@ -12293,25 +10694,29 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope */ /** @type {HTMLTooltipOptions} */ -const defaultOptions = { +const defaultOptions = exports.defaultOptions = { wrapperClass: '', - tooltipPositionClass: (top, left) => "\n .tooltip {\n transform: translate(".concat(Math.floor(left), "px, ").concat(Math.floor(top), "px) !important;\n }\n "), - caretPositionClass: (top, left, isAboveInput) => "\n .tooltip--email__caret {\n ".concat(isAboveInput ? "transform: translate(".concat(Math.floor(left), "px, ").concat(Math.floor(top), "px) rotate(180deg); transform-origin: 18px !important;") : "transform: translate(".concat(Math.floor(left), "px, ").concat(Math.floor(top), "px) !important;"), "\n }"), - css: ""), + tooltipPositionClass: (top, left) => ` + .tooltip { + transform: translate(${Math.floor(left)}px, ${Math.floor(top)}px) !important; + } + `, + caretPositionClass: (top, left, isAboveInput) => ` + .tooltip--email__caret { + ${isAboveInput ? `transform: translate(${Math.floor(left)}px, ${Math.floor(top)}px) rotate(180deg); transform-origin: 18px !important;` : `transform: translate(${Math.floor(left)}px, ${Math.floor(top)}px) !important;`} + }`, + css: ``, setSize: undefined, - remove: () => { - /** noop */ - }, + remove: () => {/** noop */}, testMode: false, checkVisibility: true, hasCaret: false, isIncontextSignupAvailable: () => false }; -exports.defaultOptions = defaultOptions; - class HTMLTooltip { + isAboveInput = false; /** @type {HTMLTooltipOptions} */ - + options; /** * @param config * @param inputType @@ -12319,30 +10724,6 @@ class HTMLTooltip { * @param {HTMLTooltipOptions} options */ constructor(config, inputType, getPosition, options) { - _defineProperty(this, "isAboveInput", false); - - _defineProperty(this, "options", void 0); - - _defineProperty(this, "resObs", new ResizeObserver(entries => entries.forEach(() => this.checkPosition()))); - - _defineProperty(this, "mutObsCheckPositionWhenIdle", _autofillUtils.whenIdle.call(this, this.checkPosition)); - - _defineProperty(this, "mutObs", new MutationObserver(mutationList => { - for (const mutationRecord of mutationList) { - if (mutationRecord.type === 'childList') { - // Only check added nodes - mutationRecord.addedNodes.forEach(el => { - if (el.nodeName === 'DDG-AUTOFILL') return; - this.ensureIsLastInDOM(); - }); - } - } - - this.mutObsCheckPositionWhenIdle(); - })); - - _defineProperty(this, "clickableButtons", new Map()); - this.options = options; this.shadow = document.createElement('ddg-autofill').attachShadow({ mode: options.testMode ? 'open' : 'closed' @@ -12356,8 +10737,8 @@ class HTMLTooltip { 'display': 'block', 'visibility': 'visible', 'opacity': '1' - }; // @ts-ignore how to narrow this.host to HTMLElement? - + }; + // @ts-ignore how to narrow this.host to HTMLElement? (0, _autofillUtils.addInlineStyles)(this.host, forcedVisibilityStyles); this.count = 0; this.device = null; @@ -12367,7 +10748,6 @@ class HTMLTooltip { * 'caret': TransformRuleObj * }} */ - this.transformRules = { caret: { getRuleString: this.options.caretPositionClass, @@ -12379,19 +10759,14 @@ class HTMLTooltip { } }; } - get isHidden() { return this.tooltip.parentNode.hidden; } - append() { document.body.appendChild(this.host); } - remove() { - var _this$device; - - (_this$device = this.device) === null || _this$device === void 0 ? void 0 : _this$device.activeForm.resetIconStylesToInitial(); + this.device?.activeForm.resetIconStylesToInitial(); window.removeEventListener('scroll', this, { capture: true }); @@ -12399,13 +10774,11 @@ class HTMLTooltip { this.mutObs.disconnect(); this.lift(); } - lift() { this.left = null; this.top = null; document.body.removeChild(this.host); } - handleEvent(event) { switch (event.type) { case 'scroll': @@ -12413,24 +10786,19 @@ class HTMLTooltip { break; } } - focus(x, y) { - var _this$shadow$elementF, _this$shadow$elementF2; - const focusableElements = 'button'; const currentFocusClassName = 'currentFocus'; - const currentFocused = this.shadow.querySelectorAll(".".concat(currentFocusClassName)); + const currentFocused = this.shadow.querySelectorAll(`.${currentFocusClassName}`); [...currentFocused].forEach(el => { el.classList.remove(currentFocusClassName); }); - (_this$shadow$elementF = this.shadow.elementFromPoint(x, y)) === null || _this$shadow$elementF === void 0 ? void 0 : (_this$shadow$elementF2 = _this$shadow$elementF.closest(focusableElements)) === null || _this$shadow$elementF2 === void 0 ? void 0 : _this$shadow$elementF2.classList.add(currentFocusClassName); + this.shadow.elementFromPoint(x, y)?.closest(focusableElements)?.classList.add(currentFocusClassName); } - checkPosition() { if (this.animationFrame) { window.cancelAnimationFrame(this.animationFrame); } - this.animationFrame = window.requestAnimationFrame(() => { if (this.isHidden) return; const { @@ -12439,14 +10807,12 @@ class HTMLTooltip { height, top } = this.getPosition(); - if (left !== this.left || bottom !== this.top) { const coords = { left, top: bottom }; this.updatePosition('tooltip', coords); - if (this.options.hasCaret) { // Recalculate tooltip top as it may have changed after update potition above const { @@ -12455,16 +10821,15 @@ class HTMLTooltip { this.isAboveInput = top > tooltipTop; const borderWidth = 2; const caretTop = this.isAboveInput ? coords.top - height - borderWidth : coords.top; - this.updatePosition('caret', { ...coords, + this.updatePosition('caret', { + ...coords, top: caretTop }); } } - this.animationFrame = null; }); } - getOverridePosition(_ref) { let { left, @@ -12472,8 +10837,9 @@ class HTMLTooltip { } = _ref; const tooltipBoundingBox = this.tooltip.getBoundingClientRect(); const smallScreenWidth = tooltipBoundingBox.width * 2; - const spacing = 5; // If overflowing from the bottom, move to above the input + const spacing = 5; + // If overflowing from the bottom, move to above the input if (tooltipBoundingBox.bottom > window.innerHeight) { const inputPosition = this.getPosition(); const caretHeight = 14; @@ -12482,9 +10848,9 @@ class HTMLTooltip { left, top: overriddenTopPosition }; - } // If overflowing from the left on smaller screen, center in the window - + } + // If overflowing from the left on smaller screen, center in the window if (tooltipBoundingBox.left < 0 && window.innerWidth <= smallScreenWidth) { const leftOverflow = Math.abs(tooltipBoundingBox.left); const leftPosWhenCentered = (window.innerWidth - tooltipBoundingBox.width) / 2; @@ -12493,9 +10859,9 @@ class HTMLTooltip { left: overriddenLeftPosition, top }; - } // If overflowing from the left on larger screen, move so it's just on screen on the left - + } + // If overflowing from the left on larger screen, move so it's just on screen on the left if (tooltipBoundingBox.left < 0 && window.innerWidth > smallScreenWidth) { const leftOverflow = Math.abs(tooltipBoundingBox.left); const overriddenLeftPosition = left + leftOverflow + spacing; @@ -12503,9 +10869,9 @@ class HTMLTooltip { left: overriddenLeftPosition, top }; - } // If overflowing from the right, move so it's just on screen on the right - + } + // If overflowing from the right, move so it's just on screen on the right if (tooltipBoundingBox.right > window.innerWidth) { const rightOverflow = tooltipBoundingBox.right - window.innerWidth; const overriddenLeftPosition = left - rightOverflow - spacing; @@ -12515,6 +10881,7 @@ class HTMLTooltip { }; } } + /** * @param {'tooltip' | 'caret'} element * @param {{ @@ -12522,18 +10889,13 @@ class HTMLTooltip { * top: number * }} coords */ - - applyPositionalStyles(element, _ref2) { - var _ruleObj$getRuleStrin; - let { left, top } = _ref2; const shadow = this.shadow; const ruleObj = this.transformRules[element]; - if (ruleObj.index) { if (shadow.styleSheets[0].rules[ruleObj.index]) { // If we have already set the rule, remove it… @@ -12543,13 +10905,12 @@ class HTMLTooltip { // …otherwise, set the index as the very last rule ruleObj.index = shadow.styleSheets[0].rules.length; } - - const cssRule = (_ruleObj$getRuleStrin = ruleObj.getRuleString) === null || _ruleObj$getRuleStrin === void 0 ? void 0 : _ruleObj$getRuleStrin.call(ruleObj, top, left, this.isAboveInput); - + const cssRule = ruleObj.getRuleString?.(top, left, this.isAboveInput); if (typeof cssRule === 'string') { shadow.styleSheets[0].insertRule(cssRule, ruleObj.index); } } + /** * @param {'tooltip' | 'caret'} element * @param {{ @@ -12557,29 +10918,22 @@ class HTMLTooltip { * top: number * }} coords */ - - updatePosition(element, _ref3) { let { left, top } = _ref3; - // If the stylesheet is not loaded wait for load (Chrome bug) if (!this.shadow.styleSheets.length) { - var _this$stylesheet; - - (_this$stylesheet = this.stylesheet) === null || _this$stylesheet === void 0 ? void 0 : _this$stylesheet.addEventListener('load', () => this.checkPosition()); + this.stylesheet?.addEventListener('load', () => this.checkPosition()); return; } - this.left = left; this.top = top; this.applyPositionalStyles(element, { left, top }); - if (this.options.hasCaret) { const overridePosition = this.getOverridePosition({ left, @@ -12588,10 +10942,9 @@ class HTMLTooltip { if (overridePosition) this.updatePosition(element, overridePosition); } } - ensureIsLastInDOM() { - this.count = this.count || 0; // If DDG el is not the last in the doc, move it there - + this.count = this.count || 0; + // If DDG el is not the last in the doc, move it there if (document.body.lastElementChild !== this.host) { // Try up to 15 times to avoid infinite loop in case someone is doing the same if (this.count < 15) { @@ -12602,29 +10955,39 @@ class HTMLTooltip { } else { // Remove the tooltip from the form to cleanup listeners and observers this.options.remove(); - console.info("DDG autofill bailing out"); + console.info(`DDG autofill bailing out`); } } } - + resObs = new ResizeObserver(entries => entries.forEach(() => this.checkPosition())); + mutObsCheckPositionWhenIdle = _autofillUtils.whenIdle.call(this, this.checkPosition); + mutObs = new MutationObserver(mutationList => { + for (const mutationRecord of mutationList) { + if (mutationRecord.type === 'childList') { + // Only check added nodes + mutationRecord.addedNodes.forEach(el => { + if (el.nodeName === 'DDG-AUTOFILL') return; + this.ensureIsLastInDOM(); + }); + } + } + this.mutObsCheckPositionWhenIdle(); + }); setActiveButton(e) { this.activeButton = e.target; } - unsetActiveButton() { this.activeButton = null; } - + clickableButtons = new Map(); registerClickableButton(btn, handler) { - this.clickableButtons.set(btn, handler); // Needed because clicks within the shadow dom don't provide this info to the outside - + this.clickableButtons.set(btn, handler); + // Needed because clicks within the shadow dom don't provide this info to the outside btn.addEventListener('mouseenter', e => this.setActiveButton(e)); btn.addEventListener('mouseleave', () => this.unsetActiveButton()); } - dispatchClick() { const handler = this.clickableButtons.get(this.activeButton); - if (handler) { if (this.activeButton.matches('.wrapper:not(.top-autofill) button:hover, .wrapper:not(.top-autofill) a:hover, .currentFocus')) { (0, _autofillUtils.safeExecute)(this.activeButton, handler, { @@ -12635,7 +10998,6 @@ class HTMLTooltip { } } } - setupSizeListener() { // Listen to layout and paint changes to register the size const observer = new PerformanceObserver(() => { @@ -12645,31 +11007,25 @@ class HTMLTooltip { entryTypes: ['layout-shift', 'paint'] }); } - setSize() { - var _this$options$setSize, _this$options; - - const innerNode = this.shadow.querySelector('.wrapper--data'); // Shouldn't be possible - + const innerNode = this.shadow.querySelector('.wrapper--data'); + // Shouldn't be possible if (!innerNode) return; const details = { height: innerNode.clientHeight, width: innerNode.clientWidth }; - (_this$options$setSize = (_this$options = this.options).setSize) === null || _this$options$setSize === void 0 ? void 0 : _this$options$setSize.call(_this$options, details); + this.options.setSize?.(details); } - init() { - var _this$stylesheet2; - this.animationFrame = null; this.top = 0; this.left = 0; this.transformRuleIndex = null; - this.stylesheet = this.shadow.querySelector('link, style'); // Un-hide once the style and web fonts have loaded, to avoid flashing + this.stylesheet = this.shadow.querySelector('link, style'); + // Un-hide once the style and web fonts have loaded, to avoid flashing // unstyled content and layout shifts - - (_this$stylesheet2 = this.stylesheet) === null || _this$stylesheet2 === void 0 ? void 0 : _this$stylesheet2.addEventListener('load', () => { + this.stylesheet?.addEventListener('load', () => { Promise.allSettled([document.fonts.load("normal 13px 'DDG_ProximaNova'"), document.fonts.load("bold 13px 'DDG_ProximaNova'")]).then(() => { this.tooltip.parentNode.removeAttribute('hidden'); this.checkPosition(); @@ -12686,17 +11042,13 @@ class HTMLTooltip { capture: true }); this.setSize(); - if (typeof this.options.setSize === 'function') { this.setupSizeListener(); } } - } - exports.HTMLTooltip = HTMLTooltip; -var _default = HTMLTooltip; -exports.default = _default; +var _default = exports.default = HTMLTooltip; },{"../Form/matching.js":33,"../autofill-utils.js":51,"./styles/styles.js":50}],45:[function(require,module,exports){ "use strict"; @@ -12705,27 +11057,15 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.HTMLTooltipUIController = void 0; - var _autofillUtils = require("../../autofill-utils.js"); - var _inputTypeConfig = require("../../Form/inputTypeConfig.js"); - var _matching = require("../../Form/matching.js"); - var _DataHTMLTooltip = _interopRequireDefault(require("../DataHTMLTooltip.js")); - var _EmailHTMLTooltip = _interopRequireDefault(require("../EmailHTMLTooltip.js")); - var _EmailSignupHTMLTooltip = _interopRequireDefault(require("../EmailSignupHTMLTooltip.js")); - var _HTMLTooltip = require("../HTMLTooltip.js"); - var _UIController = require("./UIController.js"); - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - /** * @typedef HTMLTooltipControllerOptions * @property {"modern" | "legacy" | "emailsignup"} tooltipKind - A choice between the newer Autofill UI vs the older ones used in the extension @@ -12741,15 +11081,19 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope */ class HTMLTooltipUIController extends _UIController.UIController { /** @type {import("../HTMLTooltip.js").HTMLTooltip | null} */ + _activeTooltip = null; /** @type {HTMLTooltipControllerOptions} */ + _options; /** @type {import('../HTMLTooltip.js').HTMLTooltipOptions} */ + _htmlTooltipOptions; /** * Overwritten when calling createTooltip * @type {import('../../Form/matching').SupportedTypes} */ + _activeInputType = 'unknown'; /** * @param {HTMLTooltipControllerOptions} options @@ -12758,24 +11102,13 @@ class HTMLTooltipUIController extends _UIController.UIController { constructor(options) { let htmlTooltipOptions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _HTMLTooltip.defaultOptions; super(); - - _defineProperty(this, "_activeTooltip", null); - - _defineProperty(this, "_options", void 0); - - _defineProperty(this, "_htmlTooltipOptions", void 0); - - _defineProperty(this, "_activeInputType", 'unknown'); - - _defineProperty(this, "_activeInput", void 0); - - _defineProperty(this, "_activeInputOriginalAutocomplete", void 0); - this._options = options; this._htmlTooltipOptions = Object.assign({}, _HTMLTooltip.defaultOptions, htmlTooltipOptions); window.addEventListener('pointerdown', this, true); window.addEventListener('pointerup', this, true); } + _activeInput; + _activeInputOriginalAutocomplete; /** * Cleans up after this UI controller by removing the tooltip and all @@ -12786,16 +11119,14 @@ class HTMLTooltipUIController extends _UIController.UIController { window.removeEventListener('pointerdown', this, true); window.removeEventListener('pointerup', this, true); } + /** * @param {import('./UIController').AttachArgs} args */ - - attach(args) { if (this.getActiveTooltip()) { return; } - const { topContextData, getPosition, @@ -12809,55 +11140,49 @@ class HTMLTooltipUIController extends _UIController.UIController { this._activeInputOriginalAutocomplete = input.getAttribute('autocomplete'); input.setAttribute('autocomplete', 'off'); } + /** * Actually create the HTML Tooltip * @param {PosFn} getPosition * @param {TopContextData} topContextData * @return {import("../HTMLTooltip").HTMLTooltip} */ - - createTooltip(getPosition, topContextData) { this._attachListeners(); - const config = (0, _inputTypeConfig.getInputConfigFromType)(topContextData.inputType); this._activeInputType = topContextData.inputType; + /** * @type {import('../HTMLTooltip').HTMLTooltipOptions} */ - - const tooltipOptions = { ...this._htmlTooltipOptions, + const tooltipOptions = { + ...this._htmlTooltipOptions, remove: () => this.removeTooltip(), isIncontextSignupAvailable: () => { - var _this$_options$device; - const subtype = (0, _matching.getSubtypeFromType)(topContextData.inputType); - return !!((_this$_options$device = this._options.device.inContextSignup) !== null && _this$_options$device !== void 0 && _this$_options$device.isAvailable(subtype)); + return !!this._options.device.inContextSignup?.isAvailable(subtype); } }; - if (this._options.tooltipKind === 'legacy') { this._options.device.firePixel({ pixelName: 'autofill_show' }); - return new _EmailHTMLTooltip.default(config, topContextData.inputType, getPosition, tooltipOptions).render(this._options.device); } - if (this._options.tooltipKind === 'emailsignup') { this._options.device.firePixel({ pixelName: 'incontext_show' }); - return new _EmailSignupHTMLTooltip.default(config, topContextData.inputType, getPosition, tooltipOptions).render(this._options.device); - } // collect the data for each item to display - - - const data = this._dataForAutofill(config, topContextData.inputType, topContextData); // convert the data into tool tip item renderers + } + // collect the data for each item to display + const data = this._dataForAutofill(config, topContextData.inputType, topContextData); - const asRenderers = data.map(d => config.tooltipItem(d)); // construct the autofill + // convert the data into tool tip item renderers + const asRenderers = data.map(d => config.tooltipItem(d)); + // construct the autofill return new _DataHTMLTooltip.default(config, topContextData.inputType, getPosition, tooltipOptions).render(config, asRenderers, { onSelect: id => { this._onSelect(topContextData.inputType, data, id); @@ -12873,16 +11198,15 @@ class HTMLTooltipUIController extends _UIController.UIController { } }); } - updateItems(data) { if (this._activeInputType === 'unknown') return; - const config = (0, _inputTypeConfig.getInputConfigFromType)(this._activeInputType); // convert the data into tool tip item renderers + const config = (0, _inputTypeConfig.getInputConfigFromType)(this._activeInputType); + // convert the data into tool tip item renderers const asRenderers = data.map(d => config.tooltipItem(d)); const activeTooltip = this.getActiveTooltip(); - if (activeTooltip instanceof _DataHTMLTooltip.default) { - activeTooltip === null || activeTooltip === void 0 ? void 0 : activeTooltip.render(config, asRenderers, { + activeTooltip?.render(config, asRenderers, { onSelect: id => { this._onSelect(this._activeInputType, data, id); }, @@ -12896,27 +11220,21 @@ class HTMLTooltipUIController extends _UIController.UIController { this._onIncontextSignup(); } }); - } // TODO: can we remove this timeout once implemented with real APIs? + } + // TODO: can we remove this timeout once implemented with real APIs? // The timeout is needed because clientHeight and clientWidth were returning 0 - - setTimeout(() => { - var _this$getActiveToolti; - - (_this$getActiveToolti = this.getActiveTooltip()) === null || _this$getActiveToolti === void 0 ? void 0 : _this$getActiveToolti.setSize(); + this.getActiveTooltip()?.setSize(); }, 10); } - _attachListeners() { window.addEventListener('input', this); window.addEventListener('keydown', this, true); } - _removeListeners() { window.removeEventListener('input', this); window.removeEventListener('keydown', this, true); } - handleEvent(event) { switch (event.type) { case 'keydown': @@ -12925,102 +11243,91 @@ class HTMLTooltipUIController extends _UIController.UIController { event.preventDefault(); event.stopImmediatePropagation(); } - this.removeTooltip(); } - break; - case 'input': this.removeTooltip(); break; - case 'pointerdown': { this._pointerDownListener(event); - break; } - case 'pointerup': { this._pointerUpListener(event); - break; } } - } // Global listener for event delegation - + } + // Global listener for event delegation _pointerDownListener(e) { - if (!e.isTrusted) return; // Ignore events on the Dax icon, we handle those elsewhere - - if ((0, _autofillUtils.isEventWithinDax)(e, e.target)) return; // @ts-ignore + if (!e.isTrusted) return; + // Ignore events on the Dax icon, we handle those elsewhere + if ((0, _autofillUtils.isEventWithinDax)(e, e.target)) return; + // @ts-ignore if (e.target.nodeName === 'DDG-AUTOFILL') { e.preventDefault(); - e.stopImmediatePropagation(); // Ignore pointer down events, we'll handle them on pointer up + e.stopImmediatePropagation(); + // Ignore pointer down events, we'll handle them on pointer up } else { this.removeTooltip().catch(e => { console.error('error removing tooltip', e); }); } - } // Global listener for event delegation - + } + // Global listener for event delegation _pointerUpListener(e) { - if (!e.isTrusted) return; // Ignore events on the Dax icon, we handle those elsewhere - - if ((0, _autofillUtils.isEventWithinDax)(e, e.target)) return; // @ts-ignore + if (!e.isTrusted) return; + // Ignore events on the Dax icon, we handle those elsewhere + if ((0, _autofillUtils.isEventWithinDax)(e, e.target)) return; + // @ts-ignore if (e.target.nodeName === 'DDG-AUTOFILL') { e.preventDefault(); e.stopImmediatePropagation(); const isMainMouseButton = e.button === 0; if (!isMainMouseButton) return; const activeTooltip = this.getActiveTooltip(); - activeTooltip === null || activeTooltip === void 0 ? void 0 : activeTooltip.dispatchClick(); + activeTooltip?.dispatchClick(); } } - async removeTooltip(_via) { this._htmlTooltipOptions.remove(); - if (this._activeTooltip) { this._removeListeners(); - this._activeTooltip.remove(); - this._activeTooltip = null; } - if (this._activeInput) { if (this._activeInputOriginalAutocomplete) { this._activeInput.setAttribute('autocomplete', this._activeInputOriginalAutocomplete); } else { this._activeInput.removeAttribute('autocomplete'); } - this._activeInput = null; this._activeInputOriginalAutocomplete = null; } } + /** * @returns {import("../HTMLTooltip.js").HTMLTooltip|null} */ - - getActiveTooltip() { return this._activeTooltip; } + /** * @param {import("../HTMLTooltip.js").HTMLTooltip} value */ - - setActiveTooltip(value) { this._activeTooltip = value; } + /** * Collect the data that's needed to populate the Autofill UI. * @@ -13030,11 +11337,10 @@ class HTMLTooltipUIController extends _UIController.UIController { * @param {import('../../Form/matching').SupportedTypes} inputType - The input type for the current field * @param {TopContextData} topContextData */ - - _dataForAutofill(config, inputType, topContextData) { return this._options.device.dataForAutofill(config, inputType, topContextData); } + /** * When a field is selected, call the `onSelect` method from the device. * @@ -13044,11 +11350,10 @@ class HTMLTooltipUIController extends _UIController.UIController { * @param {(CreditCardObject | IdentityObject | CredentialsObject)[]} data * @param {CreditCardObject['id']|IdentityObject['id']|CredentialsObject['id']} id */ - - _onSelect(inputType, data, id) { return this._options.device.onSelect(inputType, data, id); } + /** * Called when clicking on the Manage… button in the html tooltip * @@ -13056,60 +11361,44 @@ class HTMLTooltipUIController extends _UIController.UIController { * @returns {*} * @private */ - - _onManage(type) { this.removeTooltip(); - switch (type) { case 'credentials': return this._options.device.openManagePasswords(); - case 'creditCards': return this._options.device.openManageCreditCards(); - case 'identities': return this._options.device.openManageIdentities(); - - default: // noop - + default: + // noop } } _onIncontextSignupDismissed(_ref) { - var _this$_options$device2; - let { hasOtherOptions } = _ref; - (_this$_options$device2 = this._options.device.inContextSignup) === null || _this$_options$device2 === void 0 ? void 0 : _this$_options$device2.onIncontextSignupDismissed({ + this._options.device.inContextSignup?.onIncontextSignupDismissed({ shouldHideTooltip: !hasOtherOptions - }); // If there are other options available, just force a re-render + }); + // If there are other options available, just force a re-render if (hasOtherOptions) { const topContextData = this._options.device.getTopContextData(); - if (!topContextData) return; const config = (0, _inputTypeConfig.getInputConfigFromType)(topContextData.inputType); - const data = this._dataForAutofill(config, topContextData.inputType, topContextData); - this.updateItems(data); } } - _onIncontextSignup() { - var _this$_options$device3; - - (_this$_options$device3 = this._options.device.inContextSignup) === null || _this$_options$device3 === void 0 ? void 0 : _this$_options$device3.onIncontextSignup(); + this._options.device.inContextSignup?.onIncontextSignup(); } - isActive() { return Boolean(this.getActiveTooltip()); } - } - exports.HTMLTooltipUIController = HTMLTooltipUIController; },{"../../Form/inputTypeConfig.js":28,"../../Form/matching.js":33,"../../autofill-utils.js":51,"../DataHTMLTooltip.js":41,"../EmailHTMLTooltip.js":42,"../EmailSignupHTMLTooltip.js":43,"../HTMLTooltip.js":44,"./UIController.js":48}],46:[function(require,module,exports){ @@ -13119,31 +11408,10 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.NativeUIController = void 0; - var _UIController = require("./UIController.js"); - var _matching = require("../../Form/matching.js"); - var _deviceApiCalls = require("../../deviceApiCalls/__generated__/deviceApiCalls.js"); - var _Credentials = require("../../InputTypes/Credentials.js"); - -function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); } - -function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } } - -function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); } - -function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; } - -function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; } - -function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); } - -function _classApplyDescriptorSet(receiver, descriptor, value) { if (descriptor.set) { descriptor.set.call(receiver, value); } else { if (!descriptor.writable) { throw new TypeError("attempted to set read only private field"); } descriptor.value = value; } } - -var _passwordStatus = /*#__PURE__*/new WeakMap(); - /** * `NativeController` should be used in situations where you DO NOT * want any Autofill-controlled user interface. @@ -13159,14 +11427,13 @@ var _passwordStatus = /*#__PURE__*/new WeakMap(); * ``` */ class NativeUIController extends _UIController.UIController { - constructor() { - super(...arguments); - - _classPrivateFieldInitSpec(this, _passwordStatus, { - writable: true, - value: 'default' - }); - } + /** + * Keep track of when passwords were suggested/rejected/accepted etc + * State is kept here because it's specific to the interactions on mobile (eg: NativeUIController) + * + * @type {"default" | "rejected"} + */ + #passwordStatus = 'default'; /** * @param {import('./UIController').AttachArgs} args @@ -13183,31 +11450,28 @@ class NativeUIController extends _UIController.UIController { const inputType = (0, _matching.getInputType)(input); const mainType = (0, _matching.getMainTypeFromType)(inputType); const subType = (0, _matching.getSubtypeFromType)(inputType); - if (mainType === 'unknown') { throw new Error('unreachable, should not be here if (mainType === "unknown")'); } - if (trigger === 'autoprompt') { window.scrollTo({ behavior: 'smooth', top: form.form.getBoundingClientRect().top - document.body.getBoundingClientRect().top - 50 }); } - /** @type {import('../../deviceApiCalls/__generated__/validators-ts').GetAutofillDataRequest} */ - + /** @type {import('../../deviceApiCalls/__generated__/validators-ts').GetAutofillDataRequest} */ let payload = { inputType, mainType, subType, trigger - }; // append generated password if enabled + }; + // append generated password if enabled if (device.settings.featureToggles.password_generation) { payload = this.appendGeneratedPassword(topContextData, payload, triggerMetaData); } - device.deviceApi.request(new _deviceApiCalls.GetAutofillDataCall(payload)).then(resp => { switch (resp.action) { case 'fill': @@ -13215,42 +11479,30 @@ class NativeUIController extends _UIController.UIController { if (mainType in resp) { form.autofillData(resp[mainType], mainType); } else { - throw new Error("action: \"fill\" cannot occur because \"".concat(mainType, "\" was missing")); + throw new Error(`action: "fill" cannot occur because "${mainType}" was missing`); } - break; } - case 'focus': { - var _form$activeInput; - - (_form$activeInput = form.activeInput) === null || _form$activeInput === void 0 ? void 0 : _form$activeInput.focus(); + form.activeInput?.focus(); break; } - case 'acceptGeneratedPassword': { - var _topContextData$crede; - form.autofillData({ - password: (_topContextData$crede = topContextData.credentials) === null || _topContextData$crede === void 0 ? void 0 : _topContextData$crede[0].password, + password: topContextData.credentials?.[0].password, [_Credentials.AUTOGENERATED_KEY]: true }, mainType); break; } - case 'rejectGeneratedPassword': { - var _form$activeInput2; - - _classPrivateFieldSet(this, _passwordStatus, 'rejected'); - + this.#passwordStatus = 'rejected'; form.touchAllInputs('credentials'); - (_form$activeInput2 = form.activeInput) === null || _form$activeInput2 === void 0 ? void 0 : _form$activeInput2.focus(); + form.activeInput?.focus(); break; } - default: { if (args.device.isTestMode()) { @@ -13263,6 +11515,7 @@ class NativeUIController extends _UIController.UIController { console.error(e); }); } + /** * If a password exists in `topContextData`, we can append it to the outgoing data * in a way that native platforms can easily understand. @@ -13272,47 +11525,42 @@ class NativeUIController extends _UIController.UIController { * @param {import('../../UI/controllers/UIController.js').AttachArgs['triggerMetaData']} triggerMetaData * @return {import('../../deviceApiCalls/__generated__/validators-ts.js').GetAutofillDataRequest} */ - - appendGeneratedPassword(topContextData, outgoingData, triggerMetaData) { - var _topContextData$crede2; - - const autoGeneratedCredential = (_topContextData$crede2 = topContextData.credentials) === null || _topContextData$crede2 === void 0 ? void 0 : _topContextData$crede2.find(credential => credential.autogenerated); // if there's no generated password, we don't need to do anything + const autoGeneratedCredential = topContextData.credentials?.find(credential => credential.autogenerated); - if (!(autoGeneratedCredential !== null && autoGeneratedCredential !== void 0 && autoGeneratedCredential.password)) { + // if there's no generated password, we don't need to do anything + if (!autoGeneratedCredential?.password) { return outgoingData; } - function suggestPassword() { - if (!(autoGeneratedCredential !== null && autoGeneratedCredential !== void 0 && autoGeneratedCredential.password)) throw new Error('unreachable'); - return { ...outgoingData, + if (!autoGeneratedCredential?.password) throw new Error('unreachable'); + return { + ...outgoingData, generatedPassword: { value: autoGeneratedCredential.password, username: autoGeneratedCredential.username } }; - } // for explicit opt-in, we should *always* append the password + } + + // for explicit opt-in, we should *always* append the password // this can occur when the user clicks icon directly - in that instance we ignore // any internal state and just append the password to the outgoing data - - if (triggerMetaData.type === 'explicit-opt-in') { return suggestPassword(); - } // When the opt-in is 'implicit' though we only append the password if the user has not previously rejected it. + } + + // When the opt-in is 'implicit' though we only append the password if the user has not previously rejected it. // This helps the situation where the user has rejected a password for the username field, but then // taps into the confirm password field - - - if (triggerMetaData.type === 'implicit-opt-in' && _classPrivateFieldGet(this, _passwordStatus) !== 'rejected') { + if (triggerMetaData.type === 'implicit-opt-in' && this.#passwordStatus !== 'rejected') { return suggestPassword(); - } // if we get here there's nothing to do - + } + // if we get here there's nothing to do return outgoingData; } - } - exports.NativeUIController = NativeUIController; },{"../../Form/matching.js":33,"../../InputTypes/Credentials.js":35,"../../deviceApiCalls/__generated__/deviceApiCalls.js":55,"./UIController.js":48}],47:[function(require,module,exports){ @@ -13322,29 +11570,8 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.OverlayUIController = void 0; - var _UIController = require("./UIController.js"); - var _matching = require("../../Form/matching.js"); - -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - -function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); } - -function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } } - -function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); } - -function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; } - -function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; } - -function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); } - -function _classApplyDescriptorSet(receiver, descriptor, value) { if (descriptor.set) { descriptor.set.call(receiver, value); } else { if (!descriptor.writable) { throw new TypeError("attempted to set read only private field"); } descriptor.value = value; } } - -var _state = /*#__PURE__*/new WeakMap(); - /** * @typedef {import('../../deviceApiCalls/__generated__/validators-ts').GetAutofillDataRequest} GetAutofillDataRequest * @typedef {import('../../deviceApiCalls/__generated__/validators-ts').TriggerContext} TriggerContext @@ -13375,49 +11602,44 @@ var _state = /*#__PURE__*/new WeakMap(); */ class OverlayUIController extends _UIController.UIController { /** @type {"idle" | "parentShown"} */ + #state = 'idle'; /** @type {import('../HTMLTooltip.js').HTMLTooltip | null} */ + _activeTooltip = null; /** * @type {OverlayControllerOptions} */ + _options; /** * @param {OverlayControllerOptions} options */ constructor(options) { super(); + this._options = options; - _classPrivateFieldInitSpec(this, _state, { - writable: true, - value: 'idle' - }); - - _defineProperty(this, "_activeTooltip", null); - - _defineProperty(this, "_options", void 0); - - this._options = options; // We always register this 'pointerdown' event, regardless of + // We always register this 'pointerdown' event, regardless of // whether we have a tooltip currently open or not. This is to ensure // we can clear out any existing state before opening a new one. - window.addEventListener('pointerdown', this, true); } + /** * @param {import('./UIController').AttachArgs} args */ - - attach(args) { const { getPosition, topContextData, click, input - } = args; // Do not attach the tooltip if the input is not in the DOM + } = args; - if (!input.parentNode) return; // If the input is removed from the DOM while the tooltip is attached, remove it + // Do not attach the tooltip if the input is not in the DOM + if (!input.parentNode) return; + // If the input is removed from the DOM while the tooltip is attached, remove it this._mutObs = new MutationObserver(mutationList => { for (const mutationRecord of mutationList) { mutationRecord.removedNodes.forEach(el => { @@ -13427,63 +11649,51 @@ class OverlayUIController extends _UIController.UIController { }); } }); - this._mutObs.observe(document.body, { childList: true, subtree: true }); + const position = getPosition(); - const position = getPosition(); // If the element is not in viewport, scroll there and recurse. 50ms is arbitrary - + // If the element is not in viewport, scroll there and recurse. 50ms is arbitrary if (!click && !this.elementIsInViewport(position)) { - var _this$_mutObs; - input.scrollIntoView(true); - (_this$_mutObs = this._mutObs) === null || _this$_mutObs === void 0 ? void 0 : _this$_mutObs.disconnect(); + this._mutObs?.disconnect(); setTimeout(() => { this.attach(args); }, 50); return; } - - _classPrivateFieldSet(this, _state, 'parentShown'); - + this.#state = 'parentShown'; this.showTopTooltip(click, position, topContextData).catch(e => { console.error('error from showTopTooltip', e); - - _classPrivateFieldSet(this, _state, 'idle'); + this.#state = 'idle'; }); } + /** * @param {{ x: number; y: number; height: number; width: number; }} inputDimensions * @returns {boolean} */ - - elementIsInViewport(inputDimensions) { if (inputDimensions.x < 0 || inputDimensions.y < 0 || inputDimensions.x + inputDimensions.width > document.documentElement.clientWidth || inputDimensions.y + inputDimensions.height > document.documentElement.clientHeight) { return false; } - const viewport = document.documentElement; - if (inputDimensions.x + inputDimensions.width > viewport.clientWidth || inputDimensions.y + inputDimensions.height > viewport.clientHeight) { return false; } - return true; } + /** * @param {{ x: number; y: number; } | null} click * @param {{ x: number; y: number; height: number; width: number; }} inputDimensions * @param {TopContextData} data */ - - async showTopTooltip(click, inputDimensions, data) { let diffX = inputDimensions.x; let diffY = inputDimensions.y; - if (click) { diffX -= click.x; diffY -= click.y; @@ -13491,20 +11701,16 @@ class OverlayUIController extends _UIController.UIController { // If the focus event is outside the viewport ignore, we've already tried to scroll to it return; } - if (!data.inputType) { throw new Error('No input type found'); } - const mainType = (0, _matching.getMainTypeFromType)(data.inputType); const subType = (0, _matching.getSubtypeFromType)(data.inputType); - if (mainType === 'unknown') { throw new Error('unreachable, should not be here if (mainType === "unknown")'); } - /** @type {GetAutofillDataRequest} */ - + /** @type {GetAutofillDataRequest} */ const details = { inputType: data.inputType, mainType, @@ -13518,32 +11724,25 @@ class OverlayUIController extends _UIController.UIController { inputWidth: Math.floor(inputDimensions.width) } }; - try { - _classPrivateFieldSet(this, _state, 'parentShown'); - + this.#state = 'parentShown'; this._attachListeners(); - await this._options.show(details); } catch (e) { console.error('could not show parent', e); - - _classPrivateFieldSet(this, _state, 'idle'); + this.#state = 'idle'; } } - _attachListeners() { window.addEventListener('scroll', this); window.addEventListener('keydown', this, true); window.addEventListener('input', this); } - _removeListeners() { window.removeEventListener('scroll', this); window.removeEventListener('keydown', this, true); window.removeEventListener('input', this); } - handleEvent(event) { switch (event.type) { case 'scroll': @@ -13551,7 +11750,6 @@ class OverlayUIController extends _UIController.UIController { this.removeTooltip(event.type); break; } - case 'keydown': { if (['Escape', 'Tab', 'Enter'].includes(event.code)) { @@ -13559,19 +11757,15 @@ class OverlayUIController extends _UIController.UIController { event.preventDefault(); event.stopImmediatePropagation(); } - this.removeTooltip(event.type); } - break; } - case 'input': { this.removeTooltip(event.type); break; } - case 'pointerdown': { this.removeTooltip(event.type); @@ -13579,41 +11773,31 @@ class OverlayUIController extends _UIController.UIController { } } } + /** * @param {string} trigger * @returns {Promise} */ - - async removeTooltip(trigger) { - var _this$_mutObs2; - // for none pointer events, check to see if the tooltip is open before trying to close it if (trigger !== 'pointerdown') { - if (_classPrivateFieldGet(this, _state) !== 'parentShown') { + if (this.#state !== 'parentShown') { return; } } - try { await this._options.remove(); } catch (e) { console.error('Could not close parent', e); } - - _classPrivateFieldSet(this, _state, 'idle'); - + this.#state = 'idle'; this._removeListeners(); - - (_this$_mutObs2 = this._mutObs) === null || _this$_mutObs2 === void 0 ? void 0 : _this$_mutObs2.disconnect(); + this._mutObs?.disconnect(); } - isActive() { - return _classPrivateFieldGet(this, _state) === 'parentShown'; + return this.#state === 'parentShown'; } - } - exports.OverlayUIController = OverlayUIController; },{"../../Form/matching.js":33,"./UIController.js":48}],48:[function(require,module,exports){ @@ -13623,7 +11807,6 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.UIController = void 0; - /** * @typedef AttachArgs The argument required to 'attach' a tooltip * @property {import("../../Form/Form").Form} form the Form that triggered this 'attach' call @@ -13661,55 +11844,44 @@ class UIController { * @param {TopContextData} _topContextData * @returns {any | null} */ - - createTooltip(_pos, _topContextData) {} /** * @param {string} _via */ - - removeTooltip(_via) {} + /** * Set the currently open HTMLTooltip instance * * @param {import("../HTMLTooltip.js").HTMLTooltip} _tooltip */ - - setActiveTooltip(_tooltip) {} + /** * Get the currently open HTMLTooltip instance, if one exists * * @returns {import("../HTMLTooltip.js").HTMLTooltip | null} */ - - getActiveTooltip() { return null; } + /** * Indicate whether the controller deems itself 'active' * * @returns {boolean} */ - - isActive() { return false; } + /** * Updates the items in the tooltip based on new data. Currently only supporting credentials. * @param {CredentialsObject[]} _data */ - - updateItems(_data) {} - destroy() {} - } - exports.UIController = UIController; },{}],49:[function(require,module,exports){ @@ -13719,20 +11891,13 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.ddgPasswordIconFocused = exports.ddgPasswordIconFilled = exports.ddgPasswordIconBaseWhite = exports.ddgPasswordIconBase = exports.ddgIdentityIconBase = exports.ddgCcIconFilled = exports.ddgCcIconBase = void 0; -const ddgPasswordIconBase = 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iMjRweCIgaGVpZ2h0PSIyNHB4IiB2aWV3Qm94PSIwIDAgMjQgMjQiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8dGl0bGU+ZGRnLXBhc3N3b3JkLWljb24tYmFzZTwvdGl0bGU+CiAgICA8ZyBpZD0iZGRnLXBhc3N3b3JkLWljb24tYmFzZSIgc3Ryb2tlPSJub25lIiBzdHJva2Utd2lkdGg9IjEiIGZpbGw9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCI+CiAgICAgICAgPGcgaWQ9IlVuaW9uIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSg0LjAwMDAwMCwgNC4wMDAwMDApIiBmaWxsPSIjMDAwMDAwIj4KICAgICAgICAgICAgPHBhdGggZD0iTTExLjMzMzMsMi42NjY2NyBDMTAuMjI4OCwyLjY2NjY3IDkuMzMzMzMsMy41NjIxIDkuMzMzMzMsNC42NjY2NyBDOS4zMzMzMy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SAwLTIgLjg5NS0yIDJ2OWgxOFY2YzAtMS4xMDUtLjg5NS0yLTItMkg1em0wIDE2Yy0xLjEwNSAwLTItLjg5NS0yLTJoMThjMCAxLjEwNS0uODk1IDItMiAySDV6IiBmaWxsPSIjMDAwIi8+Cjwvc3ZnPgo='; -exports.ddgCcIconBase = ddgCcIconBase; -const ddgCcIconFilled = 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgZmlsbD0ibm9uZSI+CiAgICA8cGF0aCBkPSJNNSA5Yy0uNTUyIDAtMSAuNDQ4LTEgMXYyYzAgLjU1Mi40NDggMSAxIDFoM2MuNTUyIDAgMS0uNDQ4IDEtMXYtMmMwLS41NTItLjQ0OC0xLTEtMUg1eiIgZmlsbD0iIzc2NDMxMCIvPgogICAgPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xIDZjMC0yLjIxIDEuNzktNCA0LTRoMTRjMi4yMSAwIDQgMS43OSA0IDR2MTJjMCAyLjIxLTEuNzkgNC00IDRINWMtMi4yMSAwLTQtMS43OS00LTRWNnptNC0yYy0xLjEwNSAwLTIgLjg5NS0yIDJ2OWgxOFY2YzAtMS4xMDUtLjg5NS0yLTItMkg1em0wIDE2Yy0xLjEwNSAwLTItLjg5NS0yLTJoMThjMCAxLjEwNS0uODk1IDItMiAySDV6IiBmaWxsPSIjNzY0MzEwIi8+Cjwvc3ZnPgo='; -exports.ddgCcIconFilled = ddgCcIconFilled; -const ddgIdentityIconBase = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgZmlsbD0ibm9uZSI+CiAgICA8cGF0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Property(exports, "__esModule", { value: true }); exports.CSS_STYLES = void 0; -const CSS_STYLES = ":root {\n color-scheme: light dark;\n}\n\n.wrapper *, .wrapper *::before, .wrapper *::after {\n box-sizing: border-box;\n}\n.wrapper {\n position: fixed;\n top: 0;\n left: 0;\n padding: 0;\n font-family: 'DDG_ProximaNova', 'Proxima Nova', system-ui, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu',\n 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;\n -webkit-font-smoothing: antialiased;\n z-index: 2147483647;\n}\n.wrapper--data {\n font-family: 'SF Pro Text', system-ui, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu',\n 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;\n}\n:not(.top-autofill) .tooltip {\n position: absolute;\n width: 300px;\n max-width: calc(100vw - 25px);\n transform: translate(-1000px, -1000px);\n z-index: 2147483647;\n}\n.tooltip--data, #topAutofill {\n background-color: rgba(242, 240, 240, 1);\n -webkit-backdrop-filter: blur(40px);\n backdrop-filter: blur(40px);\n}\n@media (prefers-color-scheme: dark) {\n .tooltip--data, #topAutofill {\n background: rgb(100, 98, 102, .9);\n }\n}\n.tooltip--data {\n padding: 6px;\n font-size: 13px;\n line-height: 14px;\n width: 315px;\n max-height: 290px;\n overflow-y: auto;\n}\n.top-autofill .tooltip--data {\n min-height: 100vh;\n}\n.tooltip--data.tooltip--incontext-signup {\n width: 360px;\n}\n:not(.top-autofill) .tooltip--data {\n top: 100%;\n left: 100%;\n border: 0.5px solid rgba(255, 255, 255, 0.2);\n border-radius: 6px;\n box-shadow: 0 10px 20px rgba(0, 0, 0, 0.32);\n}\n@media (prefers-color-scheme: dark) {\n :not(.top-autofill) .tooltip--data {\n border: 1px solid rgba(255, 255, 255, 0.2);\n }\n}\n:not(.top-autofill) .tooltip--email {\n top: calc(100% + 6px);\n right: calc(100% - 48px);\n padding: 8px;\n border: 1px solid #D0D0D0;\n border-radius: 10px;\n background-color: #FFFFFF;\n font-size: 14px;\n line-height: 1.3;\n color: #333333;\n box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);\n}\n.tooltip--email__caret {\n position: absolute;\n transform: translate(-1000px, -1000px);\n z-index: 2147483647;\n}\n.tooltip--email__caret::before,\n.tooltip--email__caret::after {\n content: \"\";\n width: 0;\n height: 0;\n border-left: 10px solid transparent;\n border-right: 10px solid transparent;\n display: block;\n border-bottom: 8px solid #D0D0D0;\n position: absolute;\n right: -28px;\n}\n.tooltip--email__caret::before {\n border-bottom-color: #D0D0D0;\n top: -1px;\n}\n.tooltip--email__caret::after {\n border-bottom-color: #FFFFFF;\n top: 0px;\n}\n\n/* Buttons */\n.tooltip__button {\n display: flex;\n width: 100%;\n padding: 8px 8px 8px 0px;\n font-family: inherit;\n color: inherit;\n background: transparent;\n border: none;\n border-radius: 6px;\n}\n.tooltip__button.currentFocus,\n.wrapper:not(.top-autofill) .tooltip__button:hover {\n background-color: #3969EF;\n color: #FFFFFF;\n}\n\n/* Data autofill tooltip specific */\n.tooltip__button--data {\n position: relative;\n min-height: 48px;\n flex-direction: row;\n justify-content: flex-start;\n font-size: inherit;\n font-weight: 500;\n line-height: 16px;\n text-align: left;\n border-radius: 3px;\n}\n.tooltip--data__item-container {\n max-height: 220px;\n overflow: auto;\n}\n.tooltip__button--data:first-child {\n margin-top: 0;\n}\n.tooltip__button--data:last-child {\n margin-bottom: 0;\n}\n.tooltip__button--data::before {\n content: '';\n flex-shrink: 0;\n display: block;\n width: 32px;\n height: 32px;\n margin: 0 8px;\n background-size: 20px 20px;\n background-repeat: no-repeat;\n background-position: center 6px;\n}\n#provider_locked::after {\n position: absolute;\n content: '';\n flex-shrink: 0;\n display: block;\n width: 32px;\n height: 32px;\n margin: 0 8px;\n background-size: 11px 13px;\n background-repeat: no-repeat;\n background-position: right bottom;\n}\n.tooltip__button--data.currentFocus:not(.tooltip__button--data--bitwarden)::before,\n.wrapper:not(.top-autofill) .tooltip__button--data:not(.tooltip__button--data--bitwarden):hover::before {\n filter: invert(100%);\n}\n@media (prefers-color-scheme: dark) {\n .tooltip__button--data:not(.tooltip__button--data--bitwarden)::before,\n .tooltip__button--data:not(.tooltip__button--data--bitwarden)::before {\n filter: invert(100%);\n opacity: .9;\n }\n}\n.tooltip__button__text-container {\n margin: auto 0;\n}\n.label {\n display: block;\n font-weight: 400;\n letter-spacing: -0.25px;\n color: rgba(0,0,0,.8);\n font-size: 13px;\n line-height: 1;\n}\n.label + .label {\n margin-top: 2px;\n}\n.label.label--medium {\n font-weight: 500;\n letter-spacing: -0.25px;\n color: rgba(0,0,0,.9);\n}\n.label.label--small {\n font-size: 11px;\n font-weight: 400;\n letter-spacing: 0.06px;\n color: rgba(0,0,0,0.6);\n}\n@media (prefers-color-scheme: dark) {\n .tooltip--data .label {\n color: #ffffff;\n }\n .tooltip--data .label--medium {\n color: #ffffff;\n }\n .tooltip--data .label--small {\n color: #cdcdcd;\n }\n}\n.tooltip__button.currentFocus .label,\n.wrapper:not(.top-autofill) .tooltip__button:hover .label {\n color: #FFFFFF;\n}\n\n.tooltip__button--manage {\n font-size: 13px;\n padding: 5px 9px;\n border-radius: 3px;\n margin: 0;\n}\n\n/* Icons */\n.tooltip__button--data--credentials::before {\n background-image: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik05LjYzNiA4LjY4MkM5LjYzNiA1LjU0NCAxMi4xOCAzIDE1LjMxOCAzIDE4LjQ1NiAzIDIxIDUuNTQ0IDIxIDguNjgyYzAgMy4xMzgtMi41NDQgNS42ODItNS42ODIgNS42ODItLjY5MiAwLTEuMzUzLS4xMjQtMS45NjQtLjM0OS0uMzcyLS4xMzctLjc5LS4w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dDOS4zNzQxNSA3LjE2MTMxIDkuMjM1NzQgNi43MzMzNSA4Ljk3OTIyIDYuMzc2NzhDOC44NzY4MyA2LjIzNDQ2IDguNzU3NjggNi4xMDYzNyA4LjYyNSA1Ljk5NDg5VjUuMTg3NUM4LjYyNSA0LjI3NTgyIDguMjYyODQgMy40MDE0OCA3LjYxODE4IDIuNzU2ODJDNi45NzM1MiAyLjExMjE2IDYuMDk5MTggMS43NSA1LjE4NzUgMS43NUM0LjI3NTgyIDEuNzUgMy40MDE0OCAyLjExMjE2IDIuNzU2ODIgMi43NTY4MkMyLjExMjE2IDMuNDAxNDggMS43NSA0LjI3NTgyIDEuNzUgNS4xODc1VjUuOTk0ODlDMS42MTczMiA2LjEwNjM3IDEuNDk4MTcgNi4yMzQ0NiAxLjM5NTc4IDYuMzc2NzhDMS4xMzkyNiA2LjczMzM1IDEuMDAwODUgNy4xNjEzMSAxIDcuNjAwNTdaTTQuOTY4NyA0Ljk2ODdDNS4wMjY5NCA0LjkxMDQ3IDUuMTA1MzIgNC44NzY5OSA1LjE4NzUgNC44NzUwN0M1LjI2OTY4IDQuODc2OTkgNS4zNDgwNiA0LjkxMDQ3IDUuNDA2MyA0Ljk2ODdDNS40NjU0MiA1LjAyNzgzIDUuNDk5MDQgNS4xMDc3NCA1LjUgNS4xOTEzVjUuNUg0Ljg3NVY1LjE5MTNDNC44NzU5NiA1LjEwNzc0IDQuOTA5NTggNS4wMjc4MyA0Ljk2ODcgNC45Njg3WiIgZmlsbD0iIzIyMjIyMiIgc3Ryb2tlPSJ3aGl0ZSIgc3Ryb2tlLXdpZHRoPSIyIi8+Cjwvc3ZnPgo=');\n}\n\nhr {\n display: block;\n margin: 5px 9px;\n border: none; /* reset the border */\n border-top: 1px solid rgba(0,0,0,.1);\n}\n\nhr:first-child {\n display: none;\n}\n\n@media (prefers-color-scheme: dark) {\n hr {\n border-top: 1px solid rgba(255,255,255,.2);\n }\n}\n\n#privateAddress {\n align-items: flex-start;\n}\n#personalAddress::before,\n#privateAddress::before,\n#incontextSignup::before,\n#personalAddress.currentFocus::before,\n#personalAddress:hover::before,\n#privateAddress.currentFocus::before,\n#privateAddress:hover::before {\n filter: none;\n /* This is the same icon as `daxBase64` in `src/Form/logo-svg.js` */\n background-image: url('data:image/svg+xml;base64,PHN2ZyBmaWxsPSJub25lIiB2aWV3Qm94PSIwIDAgMTI4IDEyOCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICAgIDxwYXRoIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0ibTY0IDEyOGMzNS4zNDYgMCA2NC0yOC42NTQgNjQtNjRzLTI4LjY1NC02NC02NC02NC02NCAyOC42NTQtNjQgNjQgMjguNjU0IDY0IDY0IDY0eiIgZmlsbD0iI2RlNTgzMyIgZmlsbC1ydWxlPSJldmVub2RkIi8+CiAgICA8cGF0aCBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Im03MyAxMTEuNzVjMC0uNS4xMjMtLjYxNC0xLjQ2Ni0zLjc4Mi00LjIyNC04LjQ1OS04LjQ3LTIwLjM4NC02LjU0LTI4LjA3NS4zNTMtMS4zOTctMy45NzgtNTEuNzQ0LTcuMDQtNTMuMzY1LTMuNDAyLTEuODEzLTcuNTg4LTQuNjktMTEuNDE4LTUuMzMtMS45NDMtLjMxLTQuNDktLjE2NC02LjQ4Mi4xMDUtLjM1My4wNDctLjM2OC42ODMtLjAzLjc5OCAxLjMwOC40NDMgMi44OTUgMS4yMTIgMy44MyAyLjM3NS4xNzguMjItLjA2LjU2Ni0uMzQyLjU3Ny0uODgyLjAzMi0yLjQ4Mi40MDItNC41OTMgMi4xOTUtLjI0NC4yMDctLjA0MS41OTIuMjczLjUzIDQuNTM2LS44OTcgOS4xNy0uNDU1IDExLjkgMi4wMjcuMTc3LjE2LjA4NC40NS0uMTQ3LjUxMi0yMy42OTQgNi40NC0xOS4wMDMgMjcuMDUtMTIuNjk2IDUyLjM0NCA1LjYxOSAyMi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9ImV2ZW5vZGQiIGQ9Im02NCAxMTcuNzVjMjkuNjg1IDAgNTMuNzUtMjQuMDY1IDUzLjc1LTUzLjc1cy0yNC4wNjUtNTMuNzUtNTMuNzUtNTMuNzUtNTMuNzUgMjQuMDY1LTUzLjc1IDUzLjc1IDI0LjA2NSA1My43NSA1My43NSA1My43NXptMCA1YzMyLjQ0NyAwIDU4Ljc1LTI2LjMwMyA1OC43NS01OC43NXMtMjYuMzAzLTU4Ljc1LTU4Ljc1LTU4Ljc1LTU4Ljc1IDI2LjMwMy01OC43NSA1OC43NSAyNi4zMDMgNTguNzUgNTguNzUgNTguNzV6IiBmaWxsPSIjZmZmIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiLz4KPC9zdmc+');\n}\n\n/* Email tooltip specific */\n.tooltip__button--email {\n flex-direction: column;\n justify-content: center;\n align-items: flex-start;\n font-size: 14px;\n padding: 4px 8px;\n}\n.tooltip__button--email__primary-text {\n font-weight: bold;\n}\n.tooltip__button--email__secondary-text {\n font-size: 12px;\n}\n\n/* Email Protection signup notice */\n:not(.top-autofill) .tooltip--email-signup {\n text-align: left;\n color: #222222;\n padding: 16px 20px;\n width: 380px;\n}\n\n.tooltip--email-signup h1 {\n font-weight: 700;\n font-size: 16px;\n line-height: 1.5;\n margin: 0;\n}\n\n.tooltip--email-signup p {\n font-weight: 400;\n font-size: 14px;\n line-height: 1.4;\n}\n\n.notice-controls {\n display: flex;\n}\n\n.tooltip--email-signup .notice-controls > * {\n border-radius: 8px;\n border: 0;\n cursor: pointer;\n display: inline-block;\n font-family: inherit;\n font-style: normal;\n font-weight: bold;\n padding: 8px 12px;\n text-decoration: none;\n}\n\n.notice-controls .ghost {\n margin-left: 1rem;\n}\n\n.tooltip--email-signup a.primary {\n background: #3969EF;\n color: #fff;\n}\n\n.tooltip--email-signup a.primary:hover,\n.tooltip--email-signup a.primary:focus {\n background: #2b55ca;\n}\n\n.tooltip--email-signup a.primary:active {\n background: #1e42a4;\n}\n\n.tooltip--email-signup button.ghost {\n background: transparent;\n color: #3969EF;\n}\n\n.tooltip--email-signup button.ghost:hover,\n.tooltip--email-signup button.ghost:focus {\n background-color: rgba(0, 0, 0, 0.06);\n color: #2b55ca;\n}\n\n.tooltip--email-signup button.ghost:active {\n background-color: rgba(0, 0, 0, 0.12);\n color: #1e42a4;\n}\n\n.tooltip--email-signup button.close-tooltip {\n background-color: transparent;\n background-image: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iMTMiIHZpZXdCb3g9IjAgMCAxMiAxMyIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0wLjI5Mjg5NCAwLjY1NjkwN0MwLjY4MzQxOCAwLjI2NjM4MyAxLjMxNjU4IDAuMjY2MzgzIDEuNzA3MTEgMC42NTY5MDdMNiA0Ljk0OThMMTAuMjkyOSAwLjY1NjkwN0MxMC42ODM0IDAuMjY2MzgzIDExLjMxNjYgMC4yNjYzODMgMTEuNzA3MSAwLjY1NjkwN0MxMi4wOTc2IDEuMDQ3NDMgMTIuMDk3NiAxLjY4MDYgMTEuNzA3MSAyLjA3MTEyTDcuNDE0MjEgNi4zNjQwMUwxMS43MDcxIDEwLjY1NjlDMTIuMDk3NiAxMS4wNDc0IDEyLjA5NzYgMTEuNjgwNiAxMS43MDcxIDEyLjA3MTFDMTEuMzE2NiAxMi40NjE2IDEwLjY4MzQgMTIuNDYxNiAxMC4yOTI5IDEyLjA3MTFMNiA3Ljc3ODIzTDEuNzA3MTEgMTIuMDcxMUMxLjMxNjU4IDEyLjQ2MTYgMC42ODM0MTcgMTIuNDYxNiAwLjI5Mjg5MyAxMi4wNzExQy0wLjA5NzYzMTEgMTEuNjgwNiAtMC4wOTc2MzExIDExLjA0NzQgMC4yOTI4OTMgMTAuNjU2OUw0LjU4NTc5IDYuMzY0MDFMMC4yOTI4OTQgMi4wNzExMkMtMC4wOTc2MzA2IDEuNjgwNiAtMC4wOTc2MzA2IDEuMDQ3NDMgMC4yOTI4OTQgMC42NTY5MDdaIiBmaWxsPSJibGFjayIgZmlsbC1vcGFjaXR5PSIwLjg0Ii8+Cjwvc3ZnPgo=);\n background-position: center center;\n background-repeat: no-repeat;\n border: 0;\n cursor: pointer;\n padding: 16px;\n position: absolute;\n right: 12px;\n top: 12px;\n}\n"; -exports.CSS_STYLES = CSS_STYLES; +const CSS_STYLES = exports.CSS_STYLES = ":root {\n color-scheme: light dark;\n}\n\n.wrapper *, .wrapper *::before, .wrapper *::after {\n box-sizing: border-box;\n}\n.wrapper {\n position: fixed;\n top: 0;\n left: 0;\n padding: 0;\n font-family: 'DDG_ProximaNova', 'Proxima Nova', system-ui, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu',\n 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;\n -webkit-font-smoothing: antialiased;\n z-index: 2147483647;\n}\n.wrapper--data {\n font-family: 'SF Pro Text', system-ui, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu',\n 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;\n}\n:not(.top-autofill) .tooltip {\n position: absolute;\n width: 300px;\n max-width: calc(100vw - 25px);\n transform: translate(-1000px, -1000px);\n z-index: 2147483647;\n}\n.tooltip--data, #topAutofill {\n background-color: rgba(242, 240, 240, 1);\n -webkit-backdrop-filter: blur(40px);\n backdrop-filter: blur(40px);\n}\n@media (prefers-color-scheme: dark) {\n .tooltip--data, #topAutofill {\n background: rgb(100, 98, 102, .9);\n }\n}\n.tooltip--data {\n padding: 6px;\n font-size: 13px;\n line-height: 14px;\n width: 315px;\n max-height: 290px;\n overflow-y: auto;\n}\n.top-autofill .tooltip--data {\n min-height: 100vh;\n}\n.tooltip--data.tooltip--incontext-signup {\n width: 360px;\n}\n:not(.top-autofill) .tooltip--data {\n top: 100%;\n left: 100%;\n border: 0.5px solid rgba(255, 255, 255, 0.2);\n border-radius: 6px;\n box-shadow: 0 10px 20px rgba(0, 0, 0, 0.32);\n}\n@media (prefers-color-scheme: dark) {\n :not(.top-autofill) .tooltip--data {\n border: 1px solid rgba(255, 255, 255, 0.2);\n }\n}\n:not(.top-autofill) .tooltip--email {\n top: calc(100% + 6px);\n right: calc(100% - 48px);\n padding: 8px;\n border: 1px solid #D0D0D0;\n border-radius: 10px;\n background-color: #FFFFFF;\n font-size: 14px;\n line-height: 1.3;\n color: #333333;\n box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);\n}\n.tooltip--email__caret {\n position: absolute;\n transform: translate(-1000px, -1000px);\n z-index: 2147483647;\n}\n.tooltip--email__caret::before,\n.tooltip--email__caret::after {\n content: \"\";\n width: 0;\n height: 0;\n border-left: 10px solid transparent;\n border-right: 10px solid transparent;\n display: block;\n border-bottom: 8px solid #D0D0D0;\n position: absolute;\n right: -28px;\n}\n.tooltip--email__caret::before {\n border-bottom-color: #D0D0D0;\n top: -1px;\n}\n.tooltip--email__caret::after {\n border-bottom-color: #FFFFFF;\n top: 0px;\n}\n\n/* Buttons */\n.tooltip__button {\n display: flex;\n width: 100%;\n padding: 8px 8px 8px 0px;\n font-family: inherit;\n color: inherit;\n background: transparent;\n border: none;\n border-radius: 6px;\n}\n.tooltip__button.currentFocus,\n.wrapper:not(.top-autofill) .tooltip__button:hover {\n background-color: #3969EF;\n color: #FFFFFF;\n}\n\n/* Data autofill tooltip specific */\n.tooltip__button--data {\n position: relative;\n min-height: 48px;\n flex-direction: row;\n justify-content: flex-start;\n font-size: inherit;\n font-weight: 500;\n line-height: 16px;\n text-align: left;\n border-radius: 3px;\n}\n.tooltip--data__item-container {\n max-height: 220px;\n overflow: auto;\n}\n.tooltip__button--data:first-child {\n margin-top: 0;\n}\n.tooltip__button--data:last-child {\n margin-bottom: 0;\n}\n.tooltip__button--data::before {\n content: '';\n flex-shrink: 0;\n display: block;\n width: 32px;\n height: 32px;\n margin: 0 8px;\n background-size: 20px 20px;\n background-repeat: no-repeat;\n background-position: center 6px;\n}\n#provider_locked::after {\n position: absolute;\n content: '';\n flex-shrink: 0;\n display: block;\n width: 32px;\n height: 32px;\n margin: 0 8px;\n background-size: 11px 13px;\n background-repeat: no-repeat;\n background-position: right bottom;\n}\n.tooltip__button--data.currentFocus:not(.tooltip__button--data--bitwarden)::before,\n.wrapper:not(.top-autofill) .tooltip__button--data:not(.tooltip__button--data--bitwarden):hover::before {\n filter: invert(100%);\n}\n@media (prefers-color-scheme: dark) {\n .tooltip__button--data:not(.tooltip__button--data--bitwarden)::before,\n .tooltip__button--data:not(.tooltip__button--data--bitwarden)::before {\n filter: invert(100%);\n opacity: .9;\n }\n}\n.tooltip__button__text-container {\n margin: auto 0;\n}\n.label {\n display: block;\n font-weight: 400;\n letter-spacing: -0.25px;\n color: rgba(0,0,0,.8);\n font-size: 13px;\n line-height: 1;\n}\n.label + .label {\n margin-top: 2px;\n}\n.label.label--medium {\n font-weight: 500;\n letter-spacing: -0.25px;\n color: rgba(0,0,0,.9);\n}\n.label.label--small {\n font-size: 11px;\n font-weight: 400;\n letter-spacing: 0.06px;\n color: rgba(0,0,0,0.6);\n}\n@media (prefers-color-scheme: dark) {\n .tooltip--data .label {\n color: #ffffff;\n }\n .tooltip--data .label--medium {\n color: #ffffff;\n }\n .tooltip--data .label--small {\n color: #cdcdcd;\n }\n}\n.tooltip__button.currentFocus .label,\n.wrapper:not(.top-autofill) .tooltip__button:hover .label {\n color: #FFFFFF;\n}\n\n.tooltip__button--manage {\n font-size: 13px;\n padding: 5px 9px;\n border-radius: 3px;\n margin: 0;\n}\n\n/* Icons */\n.tooltip__button--data--credentials::before {\n background-image: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgPHB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IGZpbGw9IiMwMDAiIGZpbGwtb3BhY2l0eT0iLjkiLz4KPC9zdmc+');\n}\n.tooltip__button--data--creditCards::before {\n background-image: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgZmlsbD0ibm9uZSI+CiAgICA8cGF0aCBkPSJNNSA5Yy0uNTUyIDAtMSAuNDQ4LTEgMXYyYzAgLjU1Mi40NDggMSAxIDFoM2MuNTUyIDAgMS0uNDQ4IDEtMXYtMmMwLS41NTItLjQ0OC0xLTEtMUg1eiIgZmlsbD0iIzAwMCIvPgogICAgPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xIDZjMC0yLjIxIDEuNzktNCA0LTRoMTRjMi4yMSAwIDQgMS43OSA0IDR2MTJjMCAyLjIxLTEuNzkgNC00IDRINWMtMi4yMSAwLTQtMS43OS00LTRWNnptNC0yYy0xLjEwNSAwLTIgLjg5NS0yIDJ2OWgxOFY2YzAtMS4xMDUtLjg5NS0yLTItMkg1em0wIDE2Yy0xLjEwNSAwLTItLjg5NS0yLTJoMThjMCAxLjEwNS0uODk1IDItMiAySDV6IiBmaWxsPSIjMDAwIi8+Cjwvc3ZnPgo=');\n}\n.tooltip__button--data--identities::before {\n background-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgZmlsbD0ibm9uZSI+CiAgICA8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTEyIDIxYzIuMTQzIDAgNC4xMTEtLjc1IDUuNjU3LTItLjYyNi0uNTA2LTEuMzE4LS45MjctMi4wNi0xLjI1LTEuMS0uNDgtMi4yODUtLjczNS0zLjQ4Ni0uNzUtMS4yLS4wMTQtMi4zOTIuMjExLTMuNTA0LjY2NC0uODE3LjMzMy0xLjU4Ljc4My0yLjI2NCAxLjMzNiAxLjU0NiAxLjI1IDMuNTE0IDIgNS42NTcgMnptNC4zOTctNS4wODNjLjk2Ny40MjIgMS44NjYuOTggMi42NzIgMS42NTVDMjAuMjc5IDE2LjAzOSAyMSAxNC4xMDQgMjEgMTJjMC00Ljk3LTQuMDMtOS05LTlzLTkgNC4wMy05IDljMCAyLjEwNC43MjIgNC4wNCAxLjkzMiA1LjU3Mi44NzQtLjczNCAxLjg2LTEuMzI4IDIuOTIxLTEuNzYgMS4zNi0uNTU0IDIuODE2LS44MyA0LjI4My0uODExIDEuNDY3LjAxOCAyLjkxNi4zMyA0LjI2LjkxNnpNMTIgMjNjNi4wNzUgMCAxMS00LjkyNSAxMS0xMVMxOC4wNzUgMSAxMiAxIDEgNS45MjUgMSAxMnM0LjkyNSAxMSAxMSAxMXptMy0xM2MwIDEuNjU3LTEuMzQzIDMtMyAzcy0zLTEuMzQzLTMtMyAxLjM0My0zIDMtMyAzIDEuMzQzIDMgM3ptMiAwYzAgMi43NjEtMi4yMzkgNS01IDVzLTUtMi4yMzktNS01IDIuMjM5LTUgNS01IDUgMi4yMzkgNSA1eiIgZmlsbD0iIzAwMCIvPgo8L3N2Zz4=');\n}\n.tooltip__button--data--credentials.tooltip__button--data--bitwarden::before {\n background-image: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHJlY3Qgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0IiByeD0iOCIgZmlsbD0iIzE3NUREQyIvPgo8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNs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zIyMjIyMiIgc3Ryb2tlPSJ3aGl0ZSIgc3Ryb2tlLXdpZHRoPSIyIi8+Cjwvc3ZnPgo=');\n}\n\nhr {\n display: block;\n margin: 5px 9px;\n border: none; /* reset the border */\n border-top: 1px solid rgba(0,0,0,.1);\n}\n\nhr:first-child {\n display: none;\n}\n\n@media (prefers-color-scheme: dark) {\n hr {\n border-top: 1px solid rgba(255,255,255,.2);\n }\n}\n\n#privateAddress {\n align-items: flex-start;\n}\n#personalAddress::before,\n#privateAddress::before,\n#incontextSignup::before,\n#personalAddress.currentFocus::before,\n#personalAddress:hover::before,\n#privateAddress.currentFocus::before,\n#privateAddress:hover::before {\n filter: none;\n /* This is the same icon as `daxBase64` in `src/Form/logo-svg.js` */\n background-image: url('data:image/svg+xml;base64,PHN2ZyBmaWxsPSJub25lIiB2aWV3Qm94PSIwIDAgMTI4IDEyOCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICAgIDxwYXRoIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0ibTY0IDEyOGMzNS4zNDYgMCA2NC0yOC42NTQgNjQtNjRzLTI4LjY1NC02NC02NC02NC02NCAyOC42NTQtNjQgNjQgMjguNjU0IDY0IDY0IDY0eiIgZmlsbD0iI2RlNTgzMyIgZmlsbC1ydWxlPSJldmVub2RkIi8+CiAgICA8cGF0aCBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Im03MyAxMTEuNzVjMC0uNS4xMjMtLjYxNC0xLjQ2Ni0zLjc4Mi00LjIyNC04LjQ1OS04LjQ3LTIwLjM4NC02LjU0LTI4LjA3NS4zNTMtMS4zOTctMy45NzgtNTEuNzQ0LTcuMDQtNTMuMzY1LTMuNDAyLTEuODEzLTcuNTg4LTQuNjktMTEuNDE4LTUuMzMtMS45NDMtLjMxLTQuNDktLjE2NC02LjQ4Mi4xMDUtLjM1My4wNDctLjM2OC42ODMtLjAzLjc5OCAxLjMwOC40NDMgMi44OTUgMS4yMT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AxIC00LjA1LTQuMDM3IDQuMDQ1IDQuMDQ1IDAgMCAxIDQuMDUtNC4wMzcgNC4wNDUgNC4wNDUgMCAwIDEgNC4wNSA0LjAzN3ptLTEuMTkzLTEuMzM4YTEuMDUgMS4wNSAwIDAgMCAtMi4wOTcgMCAxLjA0OCAxLjA0OCAwIDAgMCAyLjA5NyAweiIgZmlsbC1ydWxlPSJldmVub2RkIi8+CiAgICA8L2c+CiAgICA8cGF0aCBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Im02NCAxMTcuNzVjMjkuNjg1IDAgNTMuNzUtMjQuMDY1IDUzLjc1LTUzLjc1cy0yNC4wNjUtNTMuNzUtNTMuNzUtNTMuNzUtNTMuNzUgMjQuMDY1LTUzLjc1IDUzLjc1IDI0LjA2NSA1My43NSA1My43NSA1My43NXptMCA1YzMyLjQ0NyAwIDU4Ljc1LTI2LjMwMyA1OC43NS01OC43NXMtMjYuMzAzLTU4Ljc1LTU4Ljc1LTU4Ljc1LTU4Ljc1IDI2LjMwMy01OC43NSA1OC43NSAyNi4zMDMgNTguNzUgNTguNzUgNTguNzV6IiBmaWxsPSIjZmZmIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiLz4KPC9zdmc+');\n}\n\n/* Email tooltip specific */\n.tooltip__button--email {\n flex-direction: column;\n justify-content: center;\n align-items: flex-start;\n font-size: 14px;\n padding: 4px 8px;\n}\n.tooltip__button--email__primary-text {\n font-weight: bold;\n}\n.tooltip__button--email__secondary-text {\n font-size: 12px;\n}\n\n/* Email Protection signup notice */\n:not(.top-autofill) .tooltip--email-signup {\n text-align: left;\n color: #222222;\n padding: 16px 20px;\n width: 380px;\n}\n\n.tooltip--email-signup h1 {\n font-weight: 700;\n font-size: 16px;\n line-height: 1.5;\n margin: 0;\n}\n\n.tooltip--email-signup p {\n font-weight: 400;\n font-size: 14px;\n line-height: 1.4;\n}\n\n.notice-controls {\n display: flex;\n}\n\n.tooltip--email-signup .notice-controls > * {\n border-radius: 8px;\n border: 0;\n cursor: pointer;\n display: inline-block;\n font-family: inherit;\n font-style: normal;\n font-weight: bold;\n padding: 8px 12px;\n text-decoration: none;\n}\n\n.notice-controls .ghost {\n margin-left: 1rem;\n}\n\n.tooltip--email-signup a.primary {\n background: #3969EF;\n color: #fff;\n}\n\n.tooltip--email-signup a.primary:hover,\n.tooltip--email-signup a.primary:focus {\n background: #2b55ca;\n}\n\n.tooltip--email-signup a.primary:active {\n background: #1e42a4;\n}\n\n.tooltip--email-signup button.ghost {\n background: transparent;\n color: #3969EF;\n}\n\n.tooltip--email-signup button.ghost:hover,\n.tooltip--email-signup button.ghost:focus {\n background-color: rgba(0, 0, 0, 0.06);\n color: #2b55ca;\n}\n\n.tooltip--email-signup button.ghost:active {\n background-color: rgba(0, 0, 0, 0.12);\n color: #1e42a4;\n}\n\n.tooltip--email-signup button.close-tooltip {\n background-color: transparent;\n background-image: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iMTMiIHZpZXdCb3g9IjAgMCAxMiAxMyIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0wLjI5Mjg5NCAwLjY1NjkwN0MwLjY4MzQxOCAwLjI2NjM4MyAxLjMxNjU4IDAuMjY2MzgzIDEuNzA3MTEgMC42NTY5MDdMNiA0Ljk0OThMMTAuMjkyOSAwLjY1NjkwN0MxMC42ODM0IDAuMjY2MzgzIDExLjMxNjYgMC4yNjYzODMgMTEuNzA3MSAwLjY1NjkwN0MxMi4wOTc2IDEuMDQ3NDMgMTIuMDk3NiAxLjY4MDYgMTEuNzA3MSAyLjA3MTEyTDcuNDE0MjEgNi4zNjQwMUwxMS43MDcxIDEwLjY1NjlDMTIuMDk3NiAxMS4wNDc0IDEyLjA5NzYgMTEuNjgwNiAxMS43MDcxIDEyLjA3MTFDMTEuMzE2NiAxMi40NjE2IDEwLjY4MzQgMTIuNDYxNiAxMC4yOTI5IDEyLjA3MTFMNiA3Ljc3ODIzTDEuNzA3MTEgMTIuMDcxMUMxLjMxNjU4IDEyLjQ2MTYgMC42ODM0MTcgMTIuNDYxNiAwLjI5Mjg5MyAxMi4wNzExQy0wLjA5NzYzMTEgMTEuNjgwNiAtMC4wOTc2MzExIDExLjA0NzQgMC4yOTI4OTMgMTAuNjU2OUw0LjU4NTc5IDYuMzY0MDFMMC4yOTI4OTQgMi4wNzExMkMtMC4wOTc2MzA2IDEuNjgwNiAtMC4wOTc2MzA2IDEuMDQ3NDMgMC4yOTI4OTQgMC42NTY5MDdaIiBmaWxsPSJibGFjayIgZmlsbC1vcGFjaXR5PSIwLjg0Ii8+Cjwvc3ZnPgo=);\n background-position: center center;\n background-repeat: no-repeat;\n border: 0;\n cursor: pointer;\n padding: 16px;\n position: absolute;\n right: 12px;\n top: 12px;\n}\n"; },{}],51:[function(require,module,exports){ "use strict"; @@ -13765,15 +11929,12 @@ exports.shouldLogPerformance = shouldLogPerformance; exports.truncateFromMiddle = truncateFromMiddle; exports.wasAutofilledByChrome = void 0; exports.whenIdle = whenIdle; - var _matching = require("./Form/matching.js"); - -const SIGN_IN_MSG = { +const SIGN_IN_MSG = exports.SIGN_IN_MSG = { signMeIn: true -}; // Send a message to the web app (only on DDG domains) - -exports.SIGN_IN_MSG = SIGN_IN_MSG; +}; +// Send a message to the web app (only on DDG domains) const notifyWebApp = message => { window.postMessage(message, window.origin); }; @@ -13783,17 +11944,13 @@ const notifyWebApp = message => { * @param {String} expectedResponse - the name of the response * @returns {Promise<*>} */ - - exports.notifyWebApp = notifyWebApp; - const sendAndWaitForAnswer = (msgOrFn, expectedResponse) => { if (typeof msgOrFn === 'function') { msgOrFn(); } else { window.postMessage(msgOrFn, window.origin); } - return new Promise(resolve => { const handler = e => { if (e.origin !== window.origin) return; @@ -13801,71 +11958,59 @@ const sendAndWaitForAnswer = (msgOrFn, expectedResponse) => { resolve(e.data); window.removeEventListener('message', handler); }; - window.addEventListener('message', handler); }); }; + /** * @param {Pick} globalConfig * @param [processConfig] * @return {boolean} - */ - - + */ exports.sendAndWaitForAnswer = sendAndWaitForAnswer; - const autofillEnabled = (globalConfig, processConfig) => { if (!globalConfig.contentScope) { // Return enabled for platforms that haven't implemented the config yet return true; } - const { contentScope, userUnprotectedDomains, userPreferences - } = globalConfig; // Check config on Apple platforms + } = globalConfig; + // Check config on Apple platforms const processedConfig = processConfig(contentScope, userUnprotectedDomains, userPreferences); return isAutofillEnabledFromProcessedConfig(processedConfig); }; - exports.autofillEnabled = autofillEnabled; - const isAutofillEnabledFromProcessedConfig = processedConfig => { const site = processedConfig.site; - if (site.isBroken || !site.enabledFeatures.includes('autofill')) { if (shouldLog()) { console.log('⚠️ Autofill disabled by remote config'); } - return false; } - return true; }; - exports.isAutofillEnabledFromProcessedConfig = isAutofillEnabledFromProcessedConfig; - const isIncontextSignupEnabledFromProcessedConfig = processedConfig => { const site = processedConfig.site; - if (site.isBroken || !site.enabledFeatures.includes('incontextSignup')) { if (shouldLog()) { console.log('⚠️ In-context signup disabled by remote config'); } - return false; } - return true; -}; // Access the original setter (needed to bypass React's implementation on mobile) -// @ts-ignore - +}; +// Access the original setter (needed to bypass React's implementation on mobile) +// @ts-ignore exports.isIncontextSignupEnabledFromProcessedConfig = isIncontextSignupEnabledFromProcessedConfig; const originalSet = Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype, 'value').set; + /** * Ensures the value is set properly and dispatches events to simulate real user action * @param {HTMLInputElement} el @@ -13873,39 +12018,38 @@ const originalSet = Object.getOwnPropertyDescriptor(window.HTMLInputElement.prot * @param {GlobalConfig} [config] * @return {boolean} */ - const setValueForInput = (el, val, config) => { // Avoid keyboard flashing on Android - if (!(config !== null && config !== void 0 && config.isAndroid)) { + if (!config?.isAndroid) { el.focus(); - } // todo(Shane): Not sending a 'key' property on these events can cause exceptions on 3rd party listeners that expect it - + } + // todo(Shane): Not sending a 'key' property on these events can cause exceptions on 3rd party listeners that expect it el.dispatchEvent(new Event('keydown', { bubbles: true })); - originalSet === null || originalSet === void 0 ? void 0 : originalSet.call(el, val); + originalSet?.call(el, val); const events = [new Event('input', { bubbles: true - }), // todo(Shane): Not sending a 'key' property on these events can cause exceptions on 3rd party listeners that expect it + }), + // todo(Shane): Not sending a 'key' property on these events can cause exceptions on 3rd party listeners that expect it new Event('keyup', { bubbles: true }), new Event('change', { bubbles: true })]; - events.forEach(ev => el.dispatchEvent(ev)); // We call this again to make sure all forms are happy - - originalSet === null || originalSet === void 0 ? void 0 : originalSet.call(el, val); + events.forEach(ev => el.dispatchEvent(ev)); + // We call this again to make sure all forms are happy + originalSet?.call(el, val); events.forEach(ev => el.dispatchEvent(ev)); el.blur(); return true; }; + /** * Fires events on a select element to simulate user interaction * @param {HTMLSelectElement} el */ - - const fireEventsOnSelect = el => { /** @type {Event[]} */ const events = [new Event('mousedown', { @@ -13916,12 +12060,14 @@ const fireEventsOnSelect = el => { bubbles: true }), new Event('change', { bubbles: true - })]; // Events fire on the select el, not option + })]; + // Events fire on the select el, not option events.forEach(ev => el.dispatchEvent(ev)); events.forEach(ev => el.dispatchEvent(ev)); el.blur(); }; + /** * Selects an option of a select element * We assume Select is only used for dates, i.e. in the credit card @@ -13929,25 +12075,22 @@ const fireEventsOnSelect = el => { * @param {string} val * @return {boolean} */ - - const setValueForSelect = (el, val) => { const subtype = (0, _matching.getInputSubtype)(el); const isMonth = subtype.includes('Month'); const isZeroBasedNumber = isMonth && el.options[0].value === '0' && el.options.length === 12; const stringVal = String(val); - const numberVal = Number(val); // Loop first through all values because they tend to be more precise + const numberVal = Number(val); + // Loop first through all values because they tend to be more precise for (const option of el.options) { // If values for months are zero-based (Jan === 0), add one to match our data type let value = option.value; - if (isZeroBasedNumber) { - value = "".concat(Number(value) + 1); - } // TODO: try to match localised month names + value = `${Number(value) + 1}`; + } + // TODO: try to match localised month names // TODO: implement alternative versions of values (abbreviations for States/Provinces or variations like USA, US, United States, etc.) - - if (value === stringVal || Number(value) === numberVal) { if (option.selected) return false; option.selected = true; @@ -13955,7 +12098,6 @@ const setValueForSelect = (el, val) => { return true; } } - for (const option of el.options) { if (option.innerText === stringVal || Number(option.innerText) === numberVal) { if (option.selected) return false; @@ -13963,11 +12105,11 @@ const setValueForSelect = (el, val) => { fireEventsOnSelect(el); return true; } - } // If we didn't find a matching option return false - - + } + // If we didn't find a matching option return false return false; }; + /** * Sets or selects a value to a form element * @param {HTMLInputElement | HTMLSelectElement} el @@ -13975,24 +12117,19 @@ const setValueForSelect = (el, val) => { * @param {GlobalConfig} [config] * @return {boolean} */ - - const setValue = (el, val, config) => { if (el instanceof HTMLInputElement) return setValueForInput(el, val, config); if (el instanceof HTMLSelectElement) return setValueForSelect(el, val); return false; }; + /** * Use IntersectionObserver v2 to make sure the element is visible when clicked * https://developers.google.com/web/updates/2019/02/intersectionobserver-v2 */ - - exports.setValue = setValue; - const safeExecute = function (el, fn) { let _opts = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; - // TODO: temporary fix to misterious bug in Chrome // const {checkVisibility = true} = opts const intObs = new IntersectionObserver(changes => { @@ -14002,7 +12139,6 @@ const safeExecute = function (el, fn) { // The browser doesn't support Intersection Observer v2, falling back to v1 behavior. change.isVisible = true; } - if (change.isIntersecting) { /** * If 'checkVisibility' is 'false' (like on Windows), then we always execute the function @@ -14015,7 +12151,6 @@ const safeExecute = function (el, fn) { fn(); } } - intObs.disconnect(); }, { trackVisibility: true, @@ -14023,15 +12158,13 @@ const safeExecute = function (el, fn) { }); intObs.observe(el); }; + /** * Checks that an element is potentially viewable (even if off-screen) * @param {HTMLElement} el * @return {boolean} */ - - exports.safeExecute = safeExecute; - const isPotentiallyViewable = el => { const computedStyle = window.getComputedStyle(el); const opacity = parseFloat(computedStyle.getPropertyValue('opacity') || '1'); @@ -14039,15 +12172,13 @@ const isPotentiallyViewable = el => { const opacityThreshold = 0.6; return el.clientWidth !== 0 && el.clientHeight !== 0 && opacity > opacityThreshold && visibility !== 'hidden'; }; + /** * Gets the bounding box of the icon * @param {HTMLInputElement} input * @returns {{top: number, left: number, bottom: number, width: number, x: number, y: number, right: number, height: number}} */ - - exports.isPotentiallyViewable = isPotentiallyViewable; - const getDaxBoundingBox = input => { const { right: inputRight, @@ -14072,16 +12203,14 @@ const getDaxBoundingBox = input => { y: top }; }; + /** * Check if a mouse event is within the icon * @param {MouseEvent} e * @param {HTMLInputElement} input * @returns {boolean} */ - - exports.getDaxBoundingBox = getDaxBoundingBox; - const isEventWithinDax = (e, input) => { const { left, @@ -14093,50 +12222,40 @@ const isEventWithinDax = (e, input) => { const withinY = e.clientY >= top && e.clientY <= bottom; return withinX && withinY; }; + /** * Adds inline styles from a prop:value object * @param {HTMLElement} el * @param {Object} styles */ - - exports.isEventWithinDax = isEventWithinDax; - const addInlineStyles = (el, styles) => Object.entries(styles).forEach(_ref => { let [property, val] = _ref; return el.style.setProperty(property, val, 'important'); }); + /** * Removes inline styles from a prop:value object * @param {HTMLElement} el * @param {Object} styles */ - - exports.addInlineStyles = addInlineStyles; - const removeInlineStyles = (el, styles) => Object.keys(styles).forEach(property => el.style.removeProperty(property)); - exports.removeInlineStyles = removeInlineStyles; -const ADDRESS_DOMAIN = '@duck.com'; +const ADDRESS_DOMAIN = exports.ADDRESS_DOMAIN = '@duck.com'; /** * Given a username, returns the full email address * @param {string} address * @returns {string} */ - -exports.ADDRESS_DOMAIN = ADDRESS_DOMAIN; - const formatDuckAddress = address => address + ADDRESS_DOMAIN; + /** * Escapes any occurrences of &, ", <, > or / with XML entities. * @param {string} str The string to escape. * @return {string} The escaped string. */ - - exports.formatDuckAddress = formatDuckAddress; - function escapeXML(str) { const replacements = { '&': '&', @@ -14148,38 +12267,38 @@ function escapeXML(str) { }; return String(str).replace(/[&"'<>/]/g, m => replacements[m]); } + /** * Determines if an element is likely to be a submit button * @param {HTMLElement} el A button, input, anchor or other element with role=button * @param {import("./Form/matching").Matching} matching * @return {boolean} */ - - const isLikelyASubmitButton = (el, matching) => { - var _matching$getDDGMatch, _matching$getDDGMatch2, _matching$getDDGMatch3; - const text = getTextShallow(el); const ariaLabel = el.getAttribute('aria-label') || ''; const dataTestId = el.getAttribute('data-test-id') || ''; - if ((el.getAttribute('type') === 'submit' || // is explicitly set as "submit" - el.getAttribute('name') === 'submit') && // is called "submit" - !((_matching$getDDGMatch = matching.getDDGMatcherRegex('submitButtonUnlikelyRegex')) !== null && _matching$getDDGMatch !== void 0 && _matching$getDDGMatch.test(text + ' ' + ariaLabel))) return true; - return (/primary|submit/i.test(el.className) || // has high-signal submit classes - /submit/i.test(dataTestId) || ((_matching$getDDGMatch2 = matching.getDDGMatcherRegex('submitButtonRegex')) === null || _matching$getDDGMatch2 === void 0 ? void 0 : _matching$getDDGMatch2.test(text)) || // has high-signal text + if ((el.getAttribute('type') === 'submit' || + // is explicitly set as "submit" + el.getAttribute('name') === 'submit') && + // is called "submit" + !matching.getDDGMatcherRegex('submitButtonUnlikelyRegex')?.test(text + ' ' + ariaLabel)) return true; + return (/primary|submit/i.test(el.className) || + // has high-signal submit classes + /submit/i.test(dataTestId) || matching.getDDGMatcherRegex('submitButtonRegex')?.test(text) || + // has high-signal text el.offsetHeight * el.offsetWidth >= 10000 && !/secondary/i.test(el.className) // it's a large element 250x40px - ) && el.offsetHeight * el.offsetWidth >= 2000 && // it's not a very small button like inline links and such - !((_matching$getDDGMatch3 = matching.getDDGMatcherRegex('submitButtonUnlikelyRegex')) !== null && _matching$getDDGMatch3 !== void 0 && _matching$getDDGMatch3.test(text + ' ' + ariaLabel)); + ) && el.offsetHeight * el.offsetWidth >= 2000 && + // it's not a very small button like inline links and such + !matching.getDDGMatcherRegex('submitButtonUnlikelyRegex')?.test(text + ' ' + ariaLabel); }; + /** * Check that a button matches the form type - login buttons on a login form, signup buttons on a signup form * @param {HTMLElement} el * @param {import('./Form/Form').Form} formObj */ - - exports.isLikelyASubmitButton = isLikelyASubmitButton; - const buttonMatchesFormType = (el, formObj) => { if (formObj.isLogin) { return !/sign.?up|register|join/i.test(el.textContent || ''); @@ -14189,7 +12308,6 @@ const buttonMatchesFormType = (el, formObj) => { return true; } }; - exports.buttonMatchesFormType = buttonMatchesFormType; const buttonInputTypes = ['submit', 'button']; /** @@ -14197,65 +12315,55 @@ const buttonInputTypes = ['submit', 'button']; * @param {Node} el * @returns {string} */ - const getTextShallow = el => { // for buttons, we don't care about descendants, just get the whole text as is // this is important in order to give proper attribution of the text to the button if (el instanceof HTMLButtonElement) return (0, _matching.removeExcessWhitespace)(el.textContent); - if (el instanceof HTMLInputElement) { if (buttonInputTypes.includes(el.type)) { return el.value; } - if (el.type === 'image') { return (0, _matching.removeExcessWhitespace)(el.alt || el.value || el.title || el.name); } } - let text = ''; - for (const childNode of el.childNodes) { if (childNode instanceof Text) { text += ' ' + childNode.textContent; } } - return (0, _matching.removeExcessWhitespace)(text); }; + /** * Check if hostname is a local address * @param {string} [hostname] * @returns {boolean} */ - - exports.getTextShallow = getTextShallow; - function isLocalNetwork() { let hostname = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : window.location.hostname; return ['localhost', '', '::1'].includes(hostname) || hostname.includes('127.0.0.1') || hostname.includes('192.168.') || hostname.startsWith('10.0.') || hostname.endsWith('.local') || hostname.endsWith('.internal'); -} // Extracted from lib/DDG/Util/Constants.pm - +} +// Extracted from lib/DDG/Util/Constants.pm const tldrs = /\.(?:c(?:o(?:m|op)?|at?|[iykgdmnxruhcfzvl])|o(?:rg|m)|n(?:et?|a(?:me)?|[ucgozrfpil])|e(?:d?u|[gechstr])|i(?:n(?:t|fo)?|[stqldroem])|m(?:o(?:bi)?|u(?:seum)?|i?l|[mcyvtsqhaerngxzfpwkd])|g(?:ov|[glqeriabtshdfmuywnp])|b(?:iz?|[drovfhtaywmzjsgbenl])|t(?:r(?:avel)?|[ncmfzdvkopthjwg]|e?l)|k[iemygznhwrp]|s[jtvberindlucygkhaozm]|u[gymszka]|h[nmutkr]|r[owesu]|d[kmzoej]|a(?:e(?:ro)?|r(?:pa)?|[qofiumsgzlwcnxdt])|p(?:ro?|[sgnthfymakwle])|v[aegiucn]|l[sayuvikcbrt]|j(?:o(?:bs)?|[mep])|w[fs]|z[amw]|f[rijkom]|y[eut]|qa)$/i; /** * Check if hostname is a valid top-level domain * @param {string} [hostname] * @returns {boolean} */ - function isValidTLD() { let hostname = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : window.location.hostname; return tldrs.test(hostname) || hostname === 'fill.dev'; } + /** * Chrome's UA adds styles using this selector when using the built-in autofill * @param {HTMLInputElement} input * @returns {boolean} */ - - const wasAutofilledByChrome = input => { try { // Other browsers throw because the selector is invalid @@ -14264,110 +12372,94 @@ const wasAutofilledByChrome = input => { return false; } }; + /** * Checks if we should log form analysis debug info to the console * @returns {boolean} */ - - exports.wasAutofilledByChrome = wasAutofilledByChrome; - function shouldLog() { return readDebugSetting('ddg-autofill-debug'); } + /** * Checks if we should log performance info to the console * @returns {boolean} */ - - function shouldLogPerformance() { return readDebugSetting('ddg-autofill-perf'); } + /** * Check if a sessionStorage item is set to 'true' * @param setting * @returns {boolean} */ - - function readDebugSetting(setting) { // sessionStorage throws in invalid schemes like data: and file: try { - var _window$sessionStorag; - - return ((_window$sessionStorag = window.sessionStorage) === null || _window$sessionStorag === void 0 ? void 0 : _window$sessionStorag.getItem(setting)) === 'true'; + return window.sessionStorage?.getItem(setting) === 'true'; } catch (e) { return false; } } - function logPerformance(markName) { if (shouldLogPerformance()) { - var _window$performance, _window$performance2; - - const measurement = (_window$performance = window.performance) === null || _window$performance === void 0 ? void 0 : _window$performance.measure("".concat(markName, ":init"), "".concat(markName, ":init:start"), "".concat(markName, ":init:end")); - console.log("".concat(markName, " took ").concat(Math.round(measurement === null || measurement === void 0 ? void 0 : measurement.duration), "ms")); - (_window$performance2 = window.performance) === null || _window$performance2 === void 0 ? void 0 : _window$performance2.clearMarks(); + const measurement = window.performance?.measure(`${markName}:init`, `${markName}:init:start`, `${markName}:init:end`); + console.log(`${markName} took ${Math.round(measurement?.duration)}ms`); + window.performance?.clearMarks(); } } + /** * * @param {Function} callback * @returns {Function} */ - - function whenIdle(callback) { var _this = this; - let timer; return function () { for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } - cancelIdleCallback(timer); timer = requestIdleCallback(() => callback.apply(_this, args)); }; } + /** * Truncate string from the middle if exceeds the totalLength (default: 30) * @param {string} string * @param {number} totalLength * @returns {string} */ - - function truncateFromMiddle(string) { let totalLength = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 30; - if (totalLength < 4) { throw new Error('Do not use with strings shorter than 4'); } - if (string.length <= totalLength) return string; const truncated = string.slice(0, totalLength / 2).concat('…', string.slice(totalLength / -2)); return truncated; } + /** * Determines if the form is likely to be enclosing most of the DOM * @param {HTMLFormElement} form * @returns {boolean} */ - - function isFormLikelyToBeUsedAsPageWrapper(form) { if (form.parentElement !== document.body) return false; - const formChildren = form.querySelectorAll('*').length; // If the form has few content elements, it's unlikely to cause issues anyway - + const formChildren = form.querySelectorAll('*').length; + // If the form has few content elements, it's unlikely to cause issues anyway if (formChildren < 100) return false; const bodyChildren = document.body.querySelectorAll('*').length; + /** * Percentage of the formChildren on the total body elements * form * 100 / body = x */ - const formChildrenPercentage = formChildren * 100 / bodyChildren; return formChildrenPercentage > 50; } @@ -14376,19 +12468,15 @@ function isFormLikelyToBeUsedAsPageWrapper(form) { "use strict"; require("./requestIdleCallback.js"); - var _DeviceInterface = require("./DeviceInterface.js"); - var _autofillUtils = require("./autofill-utils.js"); - // Polyfills/shims + (() => { if ((0, _autofillUtils.shouldLog)()) { console.log('DuckDuckGo Autofill Active'); } - if (!window.isSecureContext) return false; - try { const startupAutofill = () => { if (document.visibilityState === 'visible') { @@ -14400,10 +12488,10 @@ var _autofillUtils = require("./autofill-utils.js"); }); } }; - startupAutofill(); } catch (e) { - console.error(e); // Noop, we errored + console.error(e); + // Noop, we errored } })(); @@ -14415,59 +12503,60 @@ Object.defineProperty(exports, "__esModule", { }); exports.DDG_DOMAIN_REGEX = void 0; exports.createGlobalConfig = createGlobalConfig; -const DDG_DOMAIN_REGEX = new RegExp(/^https:\/\/(([a-z0-9-_]+?)\.)?duckduckgo\.com\/email/); +const DDG_DOMAIN_REGEX = exports.DDG_DOMAIN_REGEX = new RegExp(/^https:\/\/(([a-z0-9-_]+?)\.)?duckduckgo\.com\/email/); + /** * This is a centralised place to contain all string/variable replacements * * @param {Partial} [overrides] * @returns {GlobalConfig} */ - -exports.DDG_DOMAIN_REGEX = DDG_DOMAIN_REGEX; - function createGlobalConfig(overrides) { let isApp = false; let isTopFrame = false; - let supportsTopFrame = false; // Do not remove -- Apple devices change this when they support modern webkit messaging - - let hasModernWebkitAPI = false; // INJECT isApp HERE + let supportsTopFrame = false; + // Do not remove -- Apple devices change this when they support modern webkit messaging + let hasModernWebkitAPI = false; + // INJECT isApp HERE // INJECT isTopFrame HERE // INJECT supportsTopFrame HERE // INJECT hasModernWebkitAPI HERE - let isWindows = false; // INJECT isWindows HERE - // This will be used when 'hasModernWebkitAPI' is false + let isWindows = false; + // INJECT isWindows HERE + // This will be used when 'hasModernWebkitAPI' is false /** @type {string[]} */ + let webkitMessageHandlerNames = []; + // INJECT webkitMessageHandlerNames HERE - let webkitMessageHandlerNames = []; // INJECT webkitMessageHandlerNames HERE - - let isDDGTestMode = false; // INJECT isDDGTestMode HERE + let isDDGTestMode = false; + // INJECT isDDGTestMode HERE let contentScope = null; let userUnprotectedDomains = null; /** @type {Record | null} */ - - let userPreferences = null; // INJECT contentScope HERE + let userPreferences = null; + // INJECT contentScope HERE // INJECT userUnprotectedDomains HERE // INJECT userPreferences HERE /** @type {Record | null} */ + let availableInputTypes = null; + // INJECT availableInputTypes HERE - let availableInputTypes = null; // INJECT availableInputTypes HERE // The native layer will inject a randomised secret here and use it to verify the origin - let secret = 'PLACEHOLDER_SECRET'; + /** * The user agent check will not be needed here once `android` supports `userPreferences?.platform.name` */ // @ts-ignore - - const isAndroid = (userPreferences === null || userPreferences === void 0 ? void 0 : userPreferences.platform.name) === 'android' || /Android.*DuckDuckGo\/\d/i.test(window.navigator.userAgent); // @ts-ignore - - const isDDGApp = ['ios', 'android', 'macos', 'windows'].includes(userPreferences === null || userPreferences === void 0 ? void 0 : userPreferences.platform.name) || isAndroid || isWindows; // @ts-ignore - - const isMobileApp = ['ios', 'android'].includes(userPreferences === null || userPreferences === void 0 ? void 0 : userPreferences.platform.name) || isAndroid; + const isAndroid = userPreferences?.platform.name === 'android' || /Android.*DuckDuckGo\/\d/i.test(window.navigator.userAgent); + // @ts-ignore + const isDDGApp = ['ios', 'android', 'macos', 'windows'].includes(userPreferences?.platform.name) || isAndroid || isWindows; + // @ts-ignore + const isMobileApp = ['ios', 'android'].includes(userPreferences?.platform.name) || isAndroid; const isFirefox = navigator.userAgent.includes('Firefox'); const isDDGDomain = Boolean(window.location.href.match(DDG_DOMAIN_REGEX)); const isExtension = false; @@ -14502,7 +12591,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.constants = void 0; -const constants = { +const constants = exports.constants = { ATTR_INPUT_TYPE: 'data-ddg-inputType', ATTR_AUTOFILL: 'data-ddg-autofill', TEXT_LENGTH_CUTOFF: 100, @@ -14511,7 +12600,6 @@ const constants = { MAX_INPUTS_PER_FORM: 80, MAX_FORM_MUT_OBS_COUNT: 50 }; -exports.constants = constants; },{}],55:[function(require,module,exports){ "use strict"; @@ -14520,487 +12608,234 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.StoreFormDataCall = exports.StartEmailProtectionSignupCall = exports.SetSizeCall = exports.SetIncontextSignupPermanentlyDismissedAtCall = exports.SendJSPixelCall = exports.SelectedDetailCall = exports.OpenManagePasswordsCall = exports.OpenManageIdentitiesCall = exports.OpenManageCreditCardsCall = exports.GetRuntimeConfigurationCall = exports.GetIncontextSignupDismissedAtCall = exports.GetAvailableInputTypesCall = exports.GetAutofillInitDataCall = exports.GetAutofillDataCall = exports.GetAutofillCredentialsCall = exports.EmailProtectionStoreUserDataCall = exports.EmailProtectionRemoveUserDataCall = exports.EmailProtectionRefreshPrivateAddressCall = exports.EmailProtectionGetUserDataCall = exports.EmailProtectionGetIsLoggedInCall = exports.EmailProtectionGetCapabilitiesCall = exports.EmailProtectionGetAddressesCall = exports.CloseEmailProtectionTabCall = exports.CloseAutofillParentCall = exports.CheckCredentialsProviderStatusCall = exports.AskToUnlockProviderCall = exports.AddDebugFlagCall = void 0; - var _validatorsZod = require("./validators.zod.js"); - var _deviceApi = require("../../../packages/device-api"); - -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } +/* DO NOT EDIT, this file was generated by scripts/api-call-generator.js */ /** * @extends {DeviceApiCall} */ class AddDebugFlagCall extends _deviceApi.DeviceApiCall { - constructor() { - super(...arguments); - - _defineProperty(this, "method", "addDebugFlag"); - - _defineProperty(this, "paramsValidator", _validatorsZod.addDebugFlagParamsSchema); - } - + method = "addDebugFlag"; + paramsValidator = _validatorsZod.addDebugFlagParamsSchema; } /** * @extends {DeviceApiCall} */ - - exports.AddDebugFlagCall = AddDebugFlagCall; - class GetAutofillDataCall extends _deviceApi.DeviceApiCall { - constructor() { - super(...arguments); - - _defineProperty(this, "method", "getAutofillData"); - - _defineProperty(this, "id", "getAutofillDataResponse"); - - _defineProperty(this, "paramsValidator", _validatorsZod.getAutofillDataRequestSchema); - - _defineProperty(this, "resultValidator", _validatorsZod.getAutofillDataResponseSchema); - } - + method = "getAutofillData"; + id = "getAutofillDataResponse"; + paramsValidator = _validatorsZod.getAutofillDataRequestSchema; + resultValidator = _validatorsZod.getAutofillDataResponseSchema; } /** * @extends {DeviceApiCall} */ - - exports.GetAutofillDataCall = GetAutofillDataCall; - class GetRuntimeConfigurationCall extends _deviceApi.DeviceApiCall { - constructor() { - super(...arguments); - - _defineProperty(this, "method", "getRuntimeConfiguration"); - - _defineProperty(this, "id", "getRuntimeConfigurationResponse"); - - _defineProperty(this, "resultValidator", _validatorsZod.getRuntimeConfigurationResponseSchema); - } - + method = "getRuntimeConfiguration"; + id = "getRuntimeConfigurationResponse"; + resultValidator = _validatorsZod.getRuntimeConfigurationResponseSchema; } /** * @extends {DeviceApiCall} */ - - exports.GetRuntimeConfigurationCall = GetRuntimeConfigurationCall; - class StoreFormDataCall extends _deviceApi.DeviceApiCall { - constructor() { - super(...arguments); - - _defineProperty(this, "method", "storeFormData"); - - _defineProperty(this, "paramsValidator", _validatorsZod.storeFormDataSchema); - } - + method = "storeFormData"; + paramsValidator = _validatorsZod.storeFormDataSchema; } /** * @extends {DeviceApiCall} */ - - exports.StoreFormDataCall = StoreFormDataCall; - class GetAvailableInputTypesCall extends _deviceApi.DeviceApiCall { - constructor() { - super(...arguments); - - _defineProperty(this, "method", "getAvailableInputTypes"); - - _defineProperty(this, "id", "getAvailableInputTypesResponse"); - - _defineProperty(this, "resultValidator", _validatorsZod.getAvailableInputTypesResultSchema); - } - + method = "getAvailableInputTypes"; + id = "getAvailableInputTypesResponse"; + resultValidator = _validatorsZod.getAvailableInputTypesResultSchema; } /** * @extends {DeviceApiCall} */ - - exports.GetAvailableInputTypesCall = GetAvailableInputTypesCall; - class GetAutofillInitDataCall extends _deviceApi.DeviceApiCall { - constructor() { - super(...arguments); - - _defineProperty(this, "method", "getAutofillInitData"); - - _defineProperty(this, "id", "getAutofillInitDataResponse"); - - _defineProperty(this, "resultValidator", _validatorsZod.getAutofillInitDataResponseSchema); - } - + method = "getAutofillInitData"; + id = "getAutofillInitDataResponse"; + resultValidator = _validatorsZod.getAutofillInitDataResponseSchema; } /** * @extends {DeviceApiCall} */ - - exports.GetAutofillInitDataCall = GetAutofillInitDataCall; - class GetAutofillCredentialsCall extends _deviceApi.DeviceApiCall { - constructor() { - super(...arguments); - - _defineProperty(this, "method", "getAutofillCredentials"); - - _defineProperty(this, "id", "getAutofillCredentialsResponse"); - - _defineProperty(this, "paramsValidator", _validatorsZod.getAutofillCredentialsParamsSchema); - - _defineProperty(this, "resultValidator", _validatorsZod.getAutofillCredentialsResultSchema); - } - + method = "getAutofillCredentials"; + id = "getAutofillCredentialsResponse"; + paramsValidator = _validatorsZod.getAutofillCredentialsParamsSchema; + resultValidator = _validatorsZod.getAutofillCredentialsResultSchema; } /** * @extends {DeviceApiCall} */ - - exports.GetAutofillCredentialsCall = GetAutofillCredentialsCall; - class SetSizeCall extends _deviceApi.DeviceApiCall { - constructor() { - super(...arguments); - - _defineProperty(this, "method", "setSize"); - - _defineProperty(this, "paramsValidator", _validatorsZod.setSizeParamsSchema); - } - + method = "setSize"; + paramsValidator = _validatorsZod.setSizeParamsSchema; } /** * @extends {DeviceApiCall} */ - - exports.SetSizeCall = SetSizeCall; - class SelectedDetailCall extends _deviceApi.DeviceApiCall { - constructor() { - super(...arguments); - - _defineProperty(this, "method", "selectedDetail"); - - _defineProperty(this, "paramsValidator", _validatorsZod.selectedDetailParamsSchema); - } - + method = "selectedDetail"; + paramsValidator = _validatorsZod.selectedDetailParamsSchema; } /** * @extends {DeviceApiCall} */ - - exports.SelectedDetailCall = SelectedDetailCall; - class CloseAutofillParentCall extends _deviceApi.DeviceApiCall { - constructor() { - super(...arguments); - - _defineProperty(this, "method", "closeAutofillParent"); - } - + method = "closeAutofillParent"; } /** * @extends {DeviceApiCall} */ - - exports.CloseAutofillParentCall = CloseAutofillParentCall; - class AskToUnlockProviderCall extends _deviceApi.DeviceApiCall { - constructor() { - super(...arguments); - - _defineProperty(this, "method", "askToUnlockProvider"); - - _defineProperty(this, "id", "askToUnlockProviderResponse"); - - _defineProperty(this, "resultValidator", _validatorsZod.askToUnlockProviderResultSchema); - } - + method = "askToUnlockProvider"; + id = "askToUnlockProviderResponse"; + resultValidator = _validatorsZod.askToUnlockProviderResultSchema; } /** * @extends {DeviceApiCall} */ - - exports.AskToUnlockProviderCall = AskToUnlockProviderCall; - -class CheckCredentialsProviderStatusCall extends _deviceApi.DeviceApiCall { - constructor() { - super(...arguments); - - _defineProperty(this, "method", "checkCredentialsProviderStatus"); - - _defineProperty(this, "id", "checkCredentialsProviderStatusResponse"); - - _defineProperty(this, "resultValidator", _validatorsZod.checkCredentialsProviderStatusResultSchema); - } - +class CheckCredentialsProviderStatusCall extends _deviceApi.DeviceApiCall { + method = "checkCredentialsProviderStatus"; + id = "checkCredentialsProviderStatusResponse"; + resultValidator = _validatorsZod.checkCredentialsProviderStatusResultSchema; } /** * @extends {DeviceApiCall} */ - - exports.CheckCredentialsProviderStatusCall = CheckCredentialsProviderStatusCall; - class SendJSPixelCall extends _deviceApi.DeviceApiCall { - constructor() { - super(...arguments); - - _defineProperty(this, "method", "sendJSPixel"); - - _defineProperty(this, "paramsValidator", _validatorsZod.sendJSPixelParamsSchema); - } - + method = "sendJSPixel"; + paramsValidator = _validatorsZod.sendJSPixelParamsSchema; } /** * @extends {DeviceApiCall} */ - - exports.SendJSPixelCall = SendJSPixelCall; - class SetIncontextSignupPermanentlyDismissedAtCall extends _deviceApi.DeviceApiCall { - constructor() { - super(...arguments); - - _defineProperty(this, "method", "setIncontextSignupPermanentlyDismissedAt"); - - _defineProperty(this, "paramsValidator", _validatorsZod.setIncontextSignupPermanentlyDismissedAtSchema); - } - + method = "setIncontextSignupPermanentlyDismissedAt"; + paramsValidator = _validatorsZod.setIncontextSignupPermanentlyDismissedAtSchema; } /** * @extends {DeviceApiCall} */ - - exports.SetIncontextSignupPermanentlyDismissedAtCall = SetIncontextSignupPermanentlyDismissedAtCall; - class GetIncontextSignupDismissedAtCall extends _deviceApi.DeviceApiCall { - constructor() { - super(...arguments); - - _defineProperty(this, "method", "getIncontextSignupDismissedAt"); - - _defineProperty(this, "id", "getIncontextSignupDismissedAt"); - - _defineProperty(this, "resultValidator", _validatorsZod.getIncontextSignupDismissedAtSchema); - } - + method = "getIncontextSignupDismissedAt"; + id = "getIncontextSignupDismissedAt"; + resultValidator = _validatorsZod.getIncontextSignupDismissedAtSchema; } /** * @extends {DeviceApiCall} */ - - exports.GetIncontextSignupDismissedAtCall = GetIncontextSignupDismissedAtCall; - class OpenManagePasswordsCall extends _deviceApi.DeviceApiCall { - constructor() { - super(...arguments); - - _defineProperty(this, "method", "openManagePasswords"); - } - + method = "openManagePasswords"; } /** * @extends {DeviceApiCall} */ - - exports.OpenManagePasswordsCall = OpenManagePasswordsCall; - class OpenManageCreditCardsCall extends _deviceApi.DeviceApiCall { - constructor() { - super(...arguments); - - _defineProperty(this, "method", "openManageCreditCards"); - } - + method = "openManageCreditCards"; } /** * @extends {DeviceApiCall} */ - - exports.OpenManageCreditCardsCall = OpenManageCreditCardsCall; - class OpenManageIdentitiesCall extends _deviceApi.DeviceApiCall { - constructor() { - super(...arguments); - - _defineProperty(this, "method", "openManageIdentities"); - } - + method = "openManageIdentities"; } /** * @extends {DeviceApiCall} */ - - exports.OpenManageIdentitiesCall = OpenManageIdentitiesCall; - class EmailProtectionStoreUserDataCall extends _deviceApi.DeviceApiCall { - constructor() { - super(...arguments); - - _defineProperty(this, "method", "emailProtectionStoreUserData"); - - _defineProperty(this, "id", "emailProtectionStoreUserDataResponse"); - - _defineProperty(this, "paramsValidator", _validatorsZod.emailProtectionStoreUserDataParamsSchema); - } - + method = "emailProtectionStoreUserData"; + id = "emailProtectionStoreUserDataResponse"; + paramsValidator = _validatorsZod.emailProtectionStoreUserDataParamsSchema; } /** * @extends {DeviceApiCall} */ - - exports.EmailProtectionStoreUserDataCall = EmailProtectionStoreUserDataCall; - class EmailProtectionRemoveUserDataCall extends _deviceApi.DeviceApiCall { - constructor() { - super(...arguments); - - _defineProperty(this, "method", "emailProtectionRemoveUserData"); - } - + method = "emailProtectionRemoveUserData"; } /** * @extends {DeviceApiCall} */ - - exports.EmailProtectionRemoveUserDataCall = EmailProtectionRemoveUserDataCall; - class EmailProtectionGetIsLoggedInCall extends _deviceApi.DeviceApiCall { - constructor() { - super(...arguments); - - _defineProperty(this, "method", "emailProtectionGetIsLoggedIn"); - - _defineProperty(this, "id", "emailProtectionGetIsLoggedInResponse"); - - _defineProperty(this, "resultValidator", _validatorsZod.emailProtectionGetIsLoggedInResultSchema); - } - + method = "emailProtectionGetIsLoggedIn"; + id = "emailProtectionGetIsLoggedInResponse"; + resultValidator = _validatorsZod.emailProtectionGetIsLoggedInResultSchema; } /** * @extends {DeviceApiCall} */ - - exports.EmailProtectionGetIsLoggedInCall = EmailProtectionGetIsLoggedInCall; - class EmailProtectionGetUserDataCall extends _deviceApi.DeviceApiCall { - constructor() { - super(...arguments); - - _defineProperty(this, "method", "emailProtectionGetUserData"); - - _defineProperty(this, "id", "emailProtectionGetUserDataResponse"); - - _defineProperty(this, "resultValidator", _validatorsZod.emailProtectionGetUserDataResultSchema); - } - + method = "emailProtectionGetUserData"; + id = "emailProtectionGetUserDataResponse"; + resultValidator = _validatorsZod.emailProtectionGetUserDataResultSchema; } /** * @extends {DeviceApiCall} */ - - exports.EmailProtectionGetUserDataCall = EmailProtectionGetUserDataCall; - class EmailProtectionGetCapabilitiesCall extends _deviceApi.DeviceApiCall { - constructor() { - super(...arguments); - - _defineProperty(this, "method", "emailProtectionGetCapabilities"); - - _defineProperty(this, "id", "emailProtectionGetCapabilitiesResponse"); - - _defineProperty(this, "resultValidator", _validatorsZod.emailProtectionGetCapabilitiesResultSchema); - } - + method = "emailProtectionGetCapabilities"; + id = "emailProtectionGetCapabilitiesResponse"; + resultValidator = _validatorsZod.emailProtectionGetCapabilitiesResultSchema; } /** * @extends {DeviceApiCall} */ - - exports.EmailProtectionGetCapabilitiesCall = EmailProtectionGetCapabilitiesCall; - class EmailProtectionGetAddressesCall extends _deviceApi.DeviceApiCall { - constructor() { - super(...arguments); - - _defineProperty(this, "method", "emailProtectionGetAddresses"); - - _defineProperty(this, "id", "emailProtectionGetAddressesResponse"); - - _defineProperty(this, "resultValidator", _validatorsZod.emailProtectionGetAddressesResultSchema); - } - + method = "emailProtectionGetAddresses"; + id = "emailProtectionGetAddressesResponse"; + resultValidator = _validatorsZod.emailProtectionGetAddressesResultSchema; } /** * @extends {DeviceApiCall} */ - - exports.EmailProtectionGetAddressesCall = EmailProtectionGetAddressesCall; - class EmailProtectionRefreshPrivateAddressCall extends _deviceApi.DeviceApiCall { - constructor() { - super(...arguments); - - _defineProperty(this, "method", "emailProtectionRefreshPrivateAddress"); - - _defineProperty(this, "id", "emailProtectionRefreshPrivateAddressResponse"); - - _defineProperty(this, "resultValidator", _validatorsZod.emailProtectionRefreshPrivateAddressResultSchema); - } - + method = "emailProtectionRefreshPrivateAddress"; + id = "emailProtectionRefreshPrivateAddressResponse"; + resultValidator = _validatorsZod.emailProtectionRefreshPrivateAddressResultSchema; } /** * @extends {DeviceApiCall} */ - - exports.EmailProtectionRefreshPrivateAddressCall = EmailProtectionRefreshPrivateAddressCall; - class StartEmailProtectionSignupCall extends _deviceApi.DeviceApiCall { - constructor() { - super(...arguments); - - _defineProperty(this, "method", "startEmailProtectionSignup"); - } - + method = "startEmailProtectionSignup"; } /** * @extends {DeviceApiCall} */ - - exports.StartEmailProtectionSignupCall = StartEmailProtectionSignupCall; - class CloseEmailProtectionTabCall extends _deviceApi.DeviceApiCall { - constructor() { - super(...arguments); - - _defineProperty(this, "method", "closeEmailProtectionTab"); - } - + method = "closeEmailProtectionTab"; } - exports.CloseEmailProtectionTabCall = CloseEmailProtectionTabCall; },{"../../../packages/device-api":2,"./validators.zod.js":56}],56:[function(require,module,exports){ @@ -15010,82 +12845,44 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.userPreferencesSchema = exports.triggerContextSchema = exports.storeFormDataSchema = exports.setSizeParamsSchema = exports.setIncontextSignupPermanentlyDismissedAtSchema = exports.sendJSPixelParamsSchema = exports.selectedDetailParamsSchema = exports.runtimeConfigurationSchema = exports.providerStatusUpdatedSchema = exports.outgoingCredentialsSchema = exports.getRuntimeConfigurationResponseSchema = exports.getIncontextSignupDismissedAtSchema = exports.getAvailableInputTypesResultSchema = exports.getAutofillInitDataResponseSchema = exports.getAutofillDataResponseSchema = exports.getAutofillDataRequestSchema = exports.getAutofillCredentialsResultSchema = exports.getAutofillCredentialsParamsSchema = exports.getAliasResultSchema = exports.getAliasParamsSchema = exports.genericErrorSchema = exports.generatedPasswordSchema = exports.emailProtectionStoreUserDataParamsSchema = exports.emailProtectionRefreshPrivateAddressResultSchema = exports.emailProtectionGetUserDataResultSchema = exports.emailProtectionGetIsLoggedInResultSchema = exports.emailProtectionGetCapabilitiesResultSchema = exports.emailProtectionGetAddressesResultSchema = exports.credentialsSchema = exports.contentScopeSchema = exports.checkCredentialsProviderStatusResultSchema = exports.availableInputTypesSchema = exports.availableInputTypes1Schema = exports.autofillSettingsSchema = exports.autofillFeatureTogglesSchema = exports.askToUnlockProviderResultSchema = exports.apiSchema = exports.addDebugFlagParamsSchema = void 0; -const sendJSPixelParamsSchema = null; -exports.sendJSPixelParamsSchema = sendJSPixelParamsSchema; -const addDebugFlagParamsSchema = null; -exports.addDebugFlagParamsSchema = addDebugFlagParamsSchema; -const generatedPasswordSchema = null; -exports.generatedPasswordSchema = generatedPasswordSchema; -const triggerContextSchema = null; -exports.triggerContextSchema = triggerContextSchema; -const credentialsSchema = null; -exports.credentialsSchema = credentialsSchema; -const genericErrorSchema = null; -exports.genericErrorSchema = genericErrorSchema; -const contentScopeSchema = null; -exports.contentScopeSchema = contentScopeSchema; -const userPreferencesSchema = null; -exports.userPreferencesSchema = userPreferencesSchema; -const outgoingCredentialsSchema = null; -exports.outgoingCredentialsSchema = outgoingCredentialsSchema; -const availableInputTypesSchema = null; -exports.availableInputTypesSchema = availableInputTypesSchema; -const getAutofillInitDataResponseSchema = null; -exports.getAutofillInitDataResponseSchema = getAutofillInitDataResponseSchema; -const getAutofillCredentialsParamsSchema = null; -exports.getAutofillCredentialsParamsSchema = getAutofillCredentialsParamsSchema; -const getAutofillCredentialsResultSchema = null; -exports.getAutofillCredentialsResultSchema = getAutofillCredentialsResultSchema; -const setSizeParamsSchema = null; -exports.setSizeParamsSchema = setSizeParamsSchema; -const selectedDetailParamsSchema = null; -exports.selectedDetailParamsSchema = selectedDetailParamsSchema; -const availableInputTypes1Schema = null; -exports.availableInputTypes1Schema = availableInputTypes1Schema; -const setIncontextSignupPermanentlyDismissedAtSchema = null; -exports.setIncontextSignupPermanentlyDismissedAtSchema = setIncontextSignupPermanentlyDismissedAtSchema; -const getIncontextSignupDismissedAtSchema = null; -exports.getIncontextSignupDismissedAtSchema = getIncontextSignupDismissedAtSchema; -const autofillFeatureTogglesSchema = null; -exports.autofillFeatureTogglesSchema = autofillFeatureTogglesSchema; -const getAliasParamsSchema = null; -exports.getAliasParamsSchema = getAliasParamsSchema; -const getAliasResultSchema = null; -exports.getAliasResultSchema = getAliasResultSchema; -const emailProtectionStoreUserDataParamsSchema = null; -exports.emailProtectionStoreUserDataParamsSchema = emailProtectionStoreUserDataParamsSchema; -const emailProtectionGetIsLoggedInResultSchema = null; -exports.emailProtectionGetIsLoggedInResultSchema = emailProtectionGetIsLoggedInResultSchema; -const emailProtectionGetUserDataResultSchema = null; -exports.emailProtectionGetUserDataResultSchema = emailProtectionGetUserDataResultSchema; -const emailProtectionGetCapabilitiesResultSchema = null; -exports.emailProtectionGetCapabilitiesResultSchema = emailProtectionGetCapabilitiesResultSchema; -const emailProtectionGetAddressesResultSchema = null; -exports.emailProtectionGetAddressesResultSchema = emailProtectionGetAddressesResultSchema; -const emailProtectionRefreshPrivateAddressResultSchema = null; -exports.emailProtectionRefreshPrivateAddressResultSchema = emailProtectionRefreshPrivateAddressResultSchema; -const getAutofillDataRequestSchema = null; -exports.getAutofillDataRequestSchema = getAutofillDataRequestSchema; -const getAutofillDataResponseSchema = null; -exports.getAutofillDataResponseSchema = getAutofillDataResponseSchema; -const runtimeConfigurationSchema = null; -exports.runtimeConfigurationSchema = runtimeConfigurationSchema; -const storeFormDataSchema = null; -exports.storeFormDataSchema = storeFormDataSchema; -const getAvailableInputTypesResultSchema = null; -exports.getAvailableInputTypesResultSchema = getAvailableInputTypesResultSchema; -const providerStatusUpdatedSchema = null; -exports.providerStatusUpdatedSchema = providerStatusUpdatedSchema; -const checkCredentialsProviderStatusResultSchema = null; -exports.checkCredentialsProviderStatusResultSchema = checkCredentialsProviderStatusResultSchema; -const autofillSettingsSchema = null; -exports.autofillSettingsSchema = autofillSettingsSchema; -const getRuntimeConfigurationResponseSchema = null; -exports.getRuntimeConfigurationResponseSchema = getRuntimeConfigurationResponseSchema; -const askToUnlockProviderResultSchema = null; -exports.askToUnlockProviderResultSchema = askToUnlockProviderResultSchema; -const apiSchema = null; -exports.apiSchema = apiSchema; +const sendJSPixelParamsSchema = exports.sendJSPixelParamsSchema = null; +const addDebugFlagParamsSchema = exports.addDebugFlagParamsSchema = null; +const getAutofillCredentialsParamsSchema = exports.getAutofillCredentialsParamsSchema = null; +const setSizeParamsSchema = exports.setSizeParamsSchema = null; +const selectedDetailParamsSchema = exports.selectedDetailParamsSchema = null; +const setIncontextSignupPermanentlyDismissedAtSchema = exports.setIncontextSignupPermanentlyDismissedAtSchema = null; +const getIncontextSignupDismissedAtSchema = exports.getIncontextSignupDismissedAtSchema = null; +const getAliasParamsSchema = exports.getAliasParamsSchema = null; +const getAliasResultSchema = exports.getAliasResultSchema = null; +const emailProtectionStoreUserDataParamsSchema = exports.emailProtectionStoreUserDataParamsSchema = null; +const generatedPasswordSchema = exports.generatedPasswordSchema = null; +const triggerContextSchema = exports.triggerContextSchema = null; +const credentialsSchema = exports.credentialsSchema = null; +const genericErrorSchema = exports.genericErrorSchema = null; +const contentScopeSchema = exports.contentScopeSchema = null; +const userPreferencesSchema = exports.userPreferencesSchema = null; +const outgoingCredentialsSchema = exports.outgoingCredentialsSchema = null; +const availableInputTypesSchema = exports.availableInputTypesSchema = null; +const availableInputTypes1Schema = exports.availableInputTypes1Schema = null; +const autofillFeatureTogglesSchema = exports.autofillFeatureTogglesSchema = null; +const getAutofillDataRequestSchema = exports.getAutofillDataRequestSchema = null; +const getAutofillDataResponseSchema = exports.getAutofillDataResponseSchema = null; +const storeFormDataSchema = exports.storeFormDataSchema = null; +const getAvailableInputTypesResultSchema = exports.getAvailableInputTypesResultSchema = null; +const getAutofillInitDataResponseSchema = exports.getAutofillInitDataResponseSchema = null; +const getAutofillCredentialsResultSchema = exports.getAutofillCredentialsResultSchema = null; +const autofillSettingsSchema = exports.autofillSettingsSchema = null; +const emailProtectionGetIsLoggedInResultSchema = exports.emailProtectionGetIsLoggedInResultSchema = null; +const emailProtectionGetUserDataResultSchema = exports.emailProtectionGetUserDataResultSchema = null; +const emailProtectionGetCapabilitiesResultSchema = exports.emailProtectionGetCapabilitiesResultSchema = null; +const emailProtectionGetAddressesResultSchema = exports.emailProtectionGetAddressesResultSchema = null; +const emailProtectionRefreshPrivateAddressResultSchema = exports.emailProtectionRefreshPrivateAddressResultSchema = null; +const runtimeConfigurationSchema = exports.runtimeConfigurationSchema = null; +const providerStatusUpdatedSchema = exports.providerStatusUpdatedSchema = null; +const getRuntimeConfigurationResponseSchema = exports.getRuntimeConfigurationResponseSchema = null; +const askToUnlockProviderResultSchema = exports.askToUnlockProviderResultSchema = null; +const checkCredentialsProviderStatusResultSchema = exports.checkCredentialsProviderStatusResultSchema = null; +const apiSchema = exports.apiSchema = null; },{}],57:[function(require,module,exports){ "use strict"; @@ -15094,38 +12891,23 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.GetAlias = void 0; - var _index = require("../../packages/device-api/index.js"); - var _validatorsZod = require("./__generated__/validators.zod.js"); - -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - /** * @extends {DeviceApiCall} */ class GetAlias extends _index.DeviceApiCall { - constructor() { - super(...arguments); - - _defineProperty(this, "method", 'emailHandlerGetAlias'); - - _defineProperty(this, "id", 'n/a'); - - _defineProperty(this, "paramsValidator", _validatorsZod.getAliasParamsSchema); - - _defineProperty(this, "resultValidator", _validatorsZod.getAliasResultSchema); - } - + method = 'emailHandlerGetAlias'; + id = 'n/a'; + paramsValidator = _validatorsZod.getAliasParamsSchema; + resultValidator = _validatorsZod.getAliasResultSchema; preResultValidation(response) { // convert to the correct format, because this is a legacy API return { success: response }; } - } - exports.GetAlias = GetAlias; },{"../../packages/device-api/index.js":2,"./__generated__/validators.zod.js":56}],58:[function(require,module,exports){ @@ -15135,32 +12917,21 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.AndroidTransport = void 0; - var _index = require("../../../packages/device-api/index.js"); - var _deviceApiCalls = require("../__generated__/deviceApiCalls.js"); - -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - class AndroidTransport extends _index.DeviceApiTransport { /** @type {GlobalConfig} */ + config; /** @param {GlobalConfig} globalConfig */ constructor(globalConfig) { super(); - - _defineProperty(this, "config", void 0); - this.config = globalConfig; - if (this.config.isDDGTestMode) { - var _window$BrowserAutofi, _window$BrowserAutofi2; - - if (typeof ((_window$BrowserAutofi = window.BrowserAutofill) === null || _window$BrowserAutofi === void 0 ? void 0 : _window$BrowserAutofi.getAutofillData) !== 'function') { + if (typeof window.BrowserAutofill?.getAutofillData !== 'function') { console.warn('window.BrowserAutofill.getAutofillData missing'); } - - if (typeof ((_window$BrowserAutofi2 = window.BrowserAutofill) === null || _window$BrowserAutofi2 === void 0 ? void 0 : _window$BrowserAutofi2.storeFormData) !== 'function') { + if (typeof window.BrowserAutofill?.storeFormData !== 'function') { console.warn('window.BrowserAutofill.storeFormData missing'); } } @@ -15169,39 +12940,30 @@ class AndroidTransport extends _index.DeviceApiTransport { * @param {import("../../../packages/device-api").DeviceApiCall} deviceApiCall * @returns {Promise} */ - - async send(deviceApiCall) { if (deviceApiCall instanceof _deviceApiCalls.GetRuntimeConfigurationCall) { return androidSpecificRuntimeConfiguration(this.config); } - if (deviceApiCall instanceof _deviceApiCalls.GetAvailableInputTypesCall) { return androidSpecificAvailableInputTypes(this.config); } - if (deviceApiCall instanceof _deviceApiCalls.GetAutofillDataCall) { window.BrowserAutofill.getAutofillData(JSON.stringify(deviceApiCall.params)); return waitForResponse(deviceApiCall.id, this.config); } - if (deviceApiCall instanceof _deviceApiCalls.StoreFormDataCall) { return window.BrowserAutofill.storeFormData(JSON.stringify(deviceApiCall.params)); } - throw new Error('android: not implemented: ' + deviceApiCall.method); } - } + /** * @param {string} expectedResponse - the name/id of the response * @param {GlobalConfig} config * @returns {Promise<*>} */ - - exports.AndroidTransport = AndroidTransport; - function waitForResponse(expectedResponse, config) { return new Promise(resolve => { const handler = e => { @@ -15210,53 +12972,43 @@ function waitForResponse(expectedResponse, config) { return; } } - if (!e.data) { return; } - if (typeof e.data !== 'string') { if (config.isDDGTestMode) { console.log('❌ event.data was not a string. Expected a string so that it can be JSON parsed'); } - return; } - try { let data = JSON.parse(e.data); - if (data.type === expectedResponse) { window.removeEventListener('message', handler); return resolve(data); } - if (config.isDDGTestMode) { - console.log("\u274C event.data.type was '".concat(data.type, "', which didnt match '").concat(expectedResponse, "'"), JSON.stringify(data)); + console.log(`❌ event.data.type was '${data.type}', which didnt match '${expectedResponse}'`, JSON.stringify(data)); } } catch (e) { window.removeEventListener('message', handler); - if (config.isDDGTestMode) { console.log('❌ Could not JSON.parse the response'); } } }; - window.addEventListener('message', handler); }); } + /** * @param {GlobalConfig} globalConfig * @returns {{success: import('../__generated__/validators-ts').RuntimeConfiguration}} */ - - function androidSpecificRuntimeConfiguration(globalConfig) { if (!globalConfig.userPreferences) { throw new Error('globalConfig.userPreferences not supported yet on Android'); } - return { success: { // @ts-ignore @@ -15270,17 +13022,15 @@ function androidSpecificRuntimeConfiguration(globalConfig) { } }; } + /** * @param {GlobalConfig} globalConfig * @returns {{success: import('../__generated__/validators-ts').AvailableInputTypes}} */ - - function androidSpecificAvailableInputTypes(globalConfig) { if (!globalConfig.availableInputTypes) { throw new Error('globalConfig.availableInputTypes not supported yet on Android'); } - return { success: globalConfig.availableInputTypes }; @@ -15293,13 +13043,9 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.AppleTransport = void 0; - var _messaging = require("../../../packages/messaging/messaging.js"); - var _index = require("../../../packages/device-api/index.js"); - var _deviceApiCalls = require("../__generated__/deviceApiCalls.js"); - class AppleTransport extends _index.DeviceApiTransport { /** @param {GlobalConfig} globalConfig */ constructor(globalConfig) { @@ -15312,7 +13058,6 @@ class AppleTransport extends _index.DeviceApiTransport { }); this.messaging = new _messaging.Messaging(webkitConfig); } - async send(deviceApiCall) { try { // if the call has an `id`, it means that it expects a response @@ -15326,27 +13071,22 @@ class AppleTransport extends _index.DeviceApiTransport { if (this.config.isDDGTestMode) { console.log('MissingWebkitHandler error for:', deviceApiCall.method); } - if (deviceApiCall instanceof _deviceApiCalls.GetRuntimeConfigurationCall) { return deviceApiCall.result(appleSpecificRuntimeConfiguration(this.config)); } - throw new Error('unimplemented handler: ' + deviceApiCall.method); } else { throw e; } } } - } + /** * @param {GlobalConfig} globalConfig * @returns {ReturnType} */ - - exports.AppleTransport = AppleTransport; - function appleSpecificRuntimeConfiguration(globalConfig) { return { success: { @@ -15369,67 +13109,51 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.ExtensionTransport = void 0; - var _index = require("../../../packages/device-api/index.js"); - var _deviceApiCalls = require("../__generated__/deviceApiCalls.js"); - var _autofillUtils = require("../../autofill-utils.js"); - var _Settings = require("../../Settings.js"); - class ExtensionTransport extends _index.DeviceApiTransport { /** @param {GlobalConfig} globalConfig */ constructor(globalConfig) { super(); this.config = globalConfig; } - async send(deviceApiCall) { if (deviceApiCall instanceof _deviceApiCalls.GetRuntimeConfigurationCall) { return deviceApiCall.result(await extensionSpecificRuntimeConfiguration(this)); } - if (deviceApiCall instanceof _deviceApiCalls.GetAvailableInputTypesCall) { return deviceApiCall.result(await extensionSpecificGetAvailableInputTypes()); } - if (deviceApiCall instanceof _deviceApiCalls.SetIncontextSignupPermanentlyDismissedAtCall) { return deviceApiCall.result(await extensionSpecificSetIncontextSignupPermanentlyDismissedAtCall(deviceApiCall.params)); } - if (deviceApiCall instanceof _deviceApiCalls.GetIncontextSignupDismissedAtCall) { return deviceApiCall.result(await extensionSpecificGetIncontextSignupDismissedAt()); - } // TODO: unify all calls to use deviceApiCall.method instead of all these if blocks - + } + // TODO: unify all calls to use deviceApiCall.method instead of all these if blocks if (deviceApiCall instanceof _deviceApiCalls.SendJSPixelCall) { return deviceApiCall.result(await extensionSpecificSendPixel(deviceApiCall.params)); } - if (deviceApiCall instanceof _deviceApiCalls.AddDebugFlagCall) { return deviceApiCall.result(await extensionSpecificAddDebugFlag(deviceApiCall.params)); } - if (deviceApiCall instanceof _deviceApiCalls.CloseAutofillParentCall || deviceApiCall instanceof _deviceApiCalls.StartEmailProtectionSignupCall) { return; // noop } console.error('Send not implemented for ' + deviceApiCall.method); } - } + /** * @param {ExtensionTransport} deviceApi * @returns {Promise>} */ - - exports.ExtensionTransport = ExtensionTransport; - async function extensionSpecificRuntimeConfiguration(deviceApi) { - var _deviceApi$config; - const contentScope = await getContentScopeConfig(); const emailProtectionEnabled = (0, _autofillUtils.isAutofillEnabledFromProcessedConfig)(contentScope); const incontextSignupEnabled = (0, _autofillUtils.isIncontextSignupEnabledFromProcessedConfig)(contentScope); @@ -15442,7 +13166,8 @@ async function extensionSpecificRuntimeConfiguration(deviceApi) { features: { autofill: { settings: { - featureToggles: { ..._Settings.Settings.defaults.featureToggles, + featureToggles: { + ..._Settings.Settings.defaults.featureToggles, emailProtection: emailProtectionEnabled, emailProtection_incontext_signup: incontextSignupEnabled } @@ -15451,21 +13176,20 @@ async function extensionSpecificRuntimeConfiguration(deviceApi) { } }, // @ts-ignore - userUnprotectedDomains: (_deviceApi$config = deviceApi.config) === null || _deviceApi$config === void 0 ? void 0 : _deviceApi$config.userUnprotectedDomains + userUnprotectedDomains: deviceApi.config?.userUnprotectedDomains } }; } - async function extensionSpecificGetAvailableInputTypes() { const contentScope = await getContentScopeConfig(); const emailProtectionEnabled = (0, _autofillUtils.isAutofillEnabledFromProcessedConfig)(contentScope); return { - success: { ..._Settings.Settings.defaults.availableInputTypes, + success: { + ..._Settings.Settings.defaults.availableInputTypes, email: emailProtectionEnabled } }; } - async function getContentScopeConfig() { return new Promise(resolve => { chrome.runtime.sendMessage({ @@ -15478,11 +13202,10 @@ async function getContentScopeConfig() { }); }); } + /** * @param {import('../__generated__/validators-ts').SendJSPixelParams} params */ - - async function extensionSpecificSendPixel(params) { return new Promise(resolve => { chrome.runtime.sendMessage({ @@ -15493,11 +13216,10 @@ async function extensionSpecificSendPixel(params) { }); }); } + /** * @param {import('../__generated__/validators-ts').AddDebugFlagParams} params */ - - async function extensionSpecificAddDebugFlag(params) { return new Promise(resolve => { chrome.runtime.sendMessage({ @@ -15508,7 +13230,6 @@ async function extensionSpecificAddDebugFlag(params) { }); }); } - async function extensionSpecificGetIncontextSignupDismissedAt() { return new Promise(resolve => { chrome.runtime.sendMessage({ @@ -15518,11 +13239,10 @@ async function extensionSpecificGetIncontextSignupDismissedAt() { }); }); } + /** * @param {import('../__generated__/validators-ts').SetIncontextSignupPermanentlyDismissedAt} params */ - - async function extensionSpecificSetIncontextSignupPermanentlyDismissedAtCall(params) { return new Promise(resolve => { chrome.runtime.sendMessage({ @@ -15541,50 +13261,40 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.createTransport = createTransport; - var _appleTransport = require("./apple.transport.js"); - var _androidTransport = require("./android.transport.js"); - var _extensionTransport = require("./extension.transport.js"); - var _windowsTransport = require("./windows.transport.js"); - /** * @param {GlobalConfig} globalConfig * @returns {import("../../../packages/device-api").DeviceApiTransport} */ -function createTransport(globalConfig) { - var _globalConfig$userPre, _globalConfig$userPre2, _globalConfig$userPre3, _globalConfig$userPre4; - if (typeof ((_globalConfig$userPre = globalConfig.userPreferences) === null || _globalConfig$userPre === void 0 ? void 0 : (_globalConfig$userPre2 = _globalConfig$userPre.platform) === null || _globalConfig$userPre2 === void 0 ? void 0 : _globalConfig$userPre2.name) === 'string') { - switch ((_globalConfig$userPre3 = globalConfig.userPreferences) === null || _globalConfig$userPre3 === void 0 ? void 0 : (_globalConfig$userPre4 = _globalConfig$userPre3.platform) === null || _globalConfig$userPre4 === void 0 ? void 0 : _globalConfig$userPre4.name) { +function createTransport(globalConfig) { + if (typeof globalConfig.userPreferences?.platform?.name === 'string') { + switch (globalConfig.userPreferences?.platform?.name) { case 'ios': case 'macos': return new _appleTransport.AppleTransport(globalConfig); - case 'android': return new _androidTransport.AndroidTransport(globalConfig); - default: throw new Error('selectSender unimplemented!'); } } - if (globalConfig.isWindows) { return new _windowsTransport.WindowsTransport(); - } // fallback for when `globalConfig.userPreferences.platform.name` is absent - + } + // fallback for when `globalConfig.userPreferences.platform.name` is absent if (globalConfig.isDDGApp) { if (globalConfig.isAndroid) { return new _androidTransport.AndroidTransport(globalConfig); } - throw new Error('unreachable, createTransport'); - } // falls back to extension... is this still the best way to determine this? - + } + // falls back to extension... is this still the best way to determine this? return new _extensionTransport.ExtensionTransport(globalConfig); } @@ -15595,9 +13305,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.WindowsTransport = void 0; - var _index = require("../../../packages/device-api/index.js"); - /** * @typedef {import('../../../packages/device-api/lib/device-api').CallOptions} CallOptions * @typedef {import("../../../packages/device-api").DeviceApiCall} DeviceApiCall @@ -15607,19 +13315,15 @@ class WindowsTransport extends _index.DeviceApiTransport { if (deviceApiCall.id) { return windowsTransport(deviceApiCall, options).withResponse(deviceApiCall.id); } - return windowsTransport(deviceApiCall, options); } - } + /** * @param {DeviceApiCall} deviceApiCall * @param {CallOptions} [options] */ - - exports.WindowsTransport = WindowsTransport; - function windowsTransport(deviceApiCall, options) { windowsInteropPostMessage({ Feature: 'Autofill', @@ -15635,7 +13339,6 @@ function windowsTransport(deviceApiCall, options) { withResponse(responseId) { return waitForWindowsResponse(responseId, options); } - }; } /** @@ -15643,47 +13346,39 @@ function windowsTransport(deviceApiCall, options) { * @param {CallOptions} [options] * @returns {Promise} */ - - function waitForWindowsResponse(responseId, options) { return new Promise((resolve, reject) => { - var _options$signal, _options$signal2; - // if already aborted, reject immediately - if (options !== null && options !== void 0 && (_options$signal = options.signal) !== null && _options$signal !== void 0 && _options$signal.aborted) { + if (options?.signal?.aborted) { return reject(new DOMException('Aborted', 'AbortError')); } + let teardown; - let teardown; // The event handler - + // The event handler const handler = event => { // console.log(`📩 windows, ${window.location.href}`, [event.origin, JSON.stringify(event.data)]) if (!event.data) { console.warn('data absent from message'); return; } - if (event.data.type === responseId) { teardown(); resolve(event.data); } - }; // what to do if this promise is aborted - + }; + // what to do if this promise is aborted const abortHandler = () => { teardown(); reject(new DOMException('Aborted', 'AbortError')); - }; // setup - + }; + // setup windowsInteropAddEventListener('message', handler); - options === null || options === void 0 ? void 0 : (_options$signal2 = options.signal) === null || _options$signal2 === void 0 ? void 0 : _options$signal2.addEventListener('abort', abortHandler); - + options?.signal?.addEventListener('abort', abortHandler); teardown = () => { - var _options$signal3; - windowsInteropRemoveEventListener('message', handler); - options === null || options === void 0 ? void 0 : (_options$signal3 = options.signal) === null || _options$signal3 === void 0 ? void 0 : _options$signal3.removeEventListener('abort', abortHandler); + options?.signal?.removeEventListener('abort', abortHandler); }; }); } @@ -15695,7 +13390,6 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; - /*! * Copyright 2015 Google Inc. All rights reserved. * @@ -15711,15 +13405,14 @@ exports.default = void 0; * or implied. See the License for the specific language governing * permissions and limitations under the License. */ - /* * @see https://developers.google.com/web/updates/2015/08/using-requestidlecallback */ // @ts-ignore window.requestIdleCallback = window.requestIdleCallback || function (cb) { return setTimeout(function () { - const start = Date.now(); // eslint-disable-next-line standard/no-callback-literal - + const start = Date.now(); + // eslint-disable-next-line standard/no-callback-literal cb({ didTimeout: false, timeRemaining: function () { @@ -15728,12 +13421,9 @@ window.requestIdleCallback = window.requestIdleCallback || function (cb) { }); }, 1); }; - window.cancelIdleCallback = window.cancelIdleCallback || function (id) { clearTimeout(id); }; - -var _default = {}; -exports.default = _default; +var _default = exports.default = {}; },{}]},{},[52]);